**** Merged r47302 from MCS ****
[mono.git] / mcs / gmcs / ChangeLog
1 2005-08-12  Martin Baulig  <martin@ximian.com>
2
3         * expression.cs (MemberAccess.ResolveNamespaceOrType): Only search
4         for nested types here to avoid hitting the cache too early.
5
6 2005-08-09  Miguel de Icaza  <miguel@novell.com>
7
8         * enum.cs: On the new compiler CLS error 3005 is now a warning not
9         an error. 
10
11 2005-08-03  Martin Baulig  <martin@ximian.com>
12
13         Make iterators in generic methods work; see gtest-191.cs.
14
15         * generic.cs
16         (Constraints.Resolve): Protect against being called twice.
17
18         * class.cs
19         (TypeContainer.GetClassBases): Make this `protected virtual'.
20
21         * iterator.cs (Iterator.ctor): Added `GenericMethod' argument.
22         (Iterator.GetClassBases): Override this and compute the base
23         classes here.
24         (Iterator.DefineNestedTypes): If we're a generic method, all our
25         method type parameters become class type parameters on the proxy
26         class.
27
28         * statement.cs
29         (ToplevelBlock.Parameters): Make this a property, not a field.
30         (ToplevelBlock.ResolveMeta): Update the `parameters' from the `ip'.
31
32 2005-08-03  Martin Baulig  <martin@ximian.com>
33
34         * typemanager.cs (TypeManager.IsSubclassOf): Use
35         `TypeManager.IsEqual' instead of `Type.Equals'; fixes gtest-190.cs.
36         (TypeManager.GetFullName_recursed): Improved.
37
38 2005-07-27  Carlos Alberto Cortez <calberto.cortez@gmail.com>
39
40         Fix #75417
41         * ecore.cs (Expression.IsAccessorAccessible): Change the check for
42         Private accessor case, using TypeManager.IsPrivateAccessible instead of
43         invocation_type == mi.DeclaringType, since the first one also checks
44         other condition used by generic instances.
45         
46 2005-07-27  Martin Baulig  <martin@ximian.com>
47
48         * anonymous.cs (CaptureContext.AddField): Added
49         `AnonymousContainer am' argument; compute its toplevel scope if
50         it's not already computed.  Fixes #75649.
51
52 2005-07-14  Raja R Harinath  <rharinath@novell.com>
53
54         * ecore.cs (IAlias): Remove.
55         * decl.cs (DeclSpace): Don't derive from IAlias.  Remove members
56         that implement the interface.
57         * namespace.cs (Namespace): Likewise.
58         (Namespace.declspaces): Renamed from 'defined_names'.
59         (Namespace.AddDeclSpace): Renamed from 'DefineName'.  Take a
60         DeclSpace instead of an IAlias.
61         * tree.cs (Tree.AddDecl): Update.
62
63 2005-07-12  Raja R Harinath  <rharinath@novell.com>
64
65         * statement.cs (Block.Flags); Remove HasVarargs.
66         (Block.HasVarargs): Move to ToplevelBlock.
67         (Block.ThisVariable, Block.AddThisVariable): Likewise.
68         (Block.Variables): Make protected.  Initialize variable hashtable
69         if necessary.
70         (Block.AddVariable): Update.
71         (Block.Resolve): Update to changes.
72         (ToplevelBlock.HasVarargs): New boolean.
73         (ToplevelBlock.ThisVariable): Move here from Block.
74         (ToplevelBlock.AddThisVariable): Likewise.
75         (ToplevelBlock.IsThisAssigned): New.  Forwards call to this_variable.
76         * expression.cs (This.ResolveBase): Update to changes.
77         (ArglistAccess.DoResolve): Likewise.
78
79 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
80
81         Fix #75321
82         * ecore.cs, class.cs: Use SetAssigned instead of direct access.
83
84         * class.cs (TypeContainer.VerifyMembers): Distinguish between
85         not used and not used & assigned.
86         (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
87
88 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
89
90         Fix #75053
91         * expression.cs (Is.DoResolve): null is never provided type.
92
93 2005-07-08  Marek Safar  <marek.safar@seznam.cz>
94
95         Fix #52496
96         * cs-parser.jay: Less strict event error rule to catch more errors.
97
98 2005-07-11  Martin Baulig  <martin@ximian.com>
99
100         * generic.cs (ConstructedType.CheckConstraints): Improve the check
101         for the constructor constraint: we do not only have to check
102         whether the class has a public constructor, but also ensure that
103         it's parameterless.  Fixes #75492.
104
105 2005-07-11  Martin Baulig  <martin@ximian.com>
106
107         * expression.cs (Binary.ResolveOperator): Only allow `==' and `!='
108         between type parameters if they either have the reference type
109         constraint or the class constraint.
110
111 2005-07-10  Kamil Skalski <nazgul@nemerle.org>
112
113         * generic.cs: Use MakeGenericType instead of BindGenericParameters.
114
115 2005-07-07  Marek Safar  <marek.safar@seznam.cz>
116
117         Fix #74975
118         * attribute.cs (orig_sec_assembly): Holds original version of assembly.
119         (ExtractSecurityPermissionSet): Cope with self referencing security
120         attributes properly.
121
122         * driver.cs (SetOutputFile): Made public property OutputFile.
123
124 2005-07-07  Raja R Harinath  <rharinath@novell.com>
125
126         Fix #75486.
127         * class.cs (TypeContainer.first_nonstatic_field): Rename from
128         has_nonstatic_fields.  Make into a FieldBase pointer.
129         (TypeContainer.AddField): Add CS0282 check.
130         (TypeContainer.EmitType): Update.
131
132 2005-07-06  Miguel de Icaza  <miguel@novell.com>
133
134         * cs-tokenizer.cs (consume_identifier): Do not create strings to
135         compare if they start with __.
136
137 2005-07-06  Raja R Harinath  <rharinath@novell.com>
138
139         * statement.cs (Switch.SwitchGoverningType): Only look at
140         UserCasts that don't need implicit standard conversions to one of
141         the allowed switch types (Fixes test-322.cs).
142         (LocalInfo.Resolve): Re-enable sanity-test.
143
144 2005-07-06  Marek Safar  <marek.safar@seznam.cz>
145
146         * cs-tokenizer.cs (consume_identifier): Detect double undescores
147         
148         * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
149         
150         * expression.cs (Invocation.DoResolve): Report error CS0245 here.
151
152 2005-07-06  Raja R Harinath  <rharinath@novell.com>
153
154         Fix #75472.
155         * ecore.cs (SimpleName.GetSignatureForError): Add.
156         * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
157         (MemberAccess.GetSignatureForError): Add.
158
159 2005-07-05  Marek Safar  <marek.safar@seznam.cz>
160  
161         The big error and warning messages review.
162         
163         * anonymous.cs,
164         * assign.cs,
165         * attribute.cs,
166         * class.cs,
167         * codegen.cs,
168         * convert.cs,
169         * cs-parser.jay,
170         * cs-tokenizer.cs,
171         * decl.cs,
172         * delegate.cs,
173         * doc.cs,
174         * driver.cs,
175         * ecore.cs,
176         * enum.cs,
177         * expression.cs,
178         * flowanalysis.cs,
179         * iterators.cs,
180         * literal.cs,
181         * location.cs,
182         * modifiers.cs,
183         * namespace.cs,
184         * parameter.cs,
185         * pending.cs,
186         * report.cs,
187         * rootcontext.cs,
188         * statement.cs,
189         * support.cs,
190         * tree.cs,
191         * typemanager.cs: Updated.
192         
193         * class.cs: (MethodCore.SetYields): Moved here to share.
194         (PropertyMethod.Define): Moved iterator setup here.
195         
196         * iterators.cs: Add orig_method to have full access to parent
197         container.
198
199 2005-07-05  Raja R Harinath  <rharinath@novell.com>
200
201         Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
202         * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
203         (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
204         variable of struct type.
205         * expression.cs (Unary.ResolveOperator): Update to change.
206         (Indirection.VerifyFixed): Likewise.
207         (LocalVariableReference.VerifyFixed): A local variable is always fixed.
208         (ParameterReference.VerifyFixed): Value parameters are fixed.
209         (This.VerifyFixed): Treat 'this' as a value parameter.
210         * statement.cs (LocalInfo.IsFixed): Remove.
211
212 2005-07-01  Martin Baulig  <martin@ximian.com>
213
214         * iterators.cs (Iterator.CapturedThisReference.Emit): Use
215         `ec.EmitThis ()' to get the correct scope.
216
217 2005-07-01  Martin Baulig  <martin@ximian.com>
218
219         * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
220         instance is a ParameterReference; fixes #75299.
221
222 2005-06-30  Raja R Harinath  <rharinath@novell.com>
223
224         Fix #75412.
225         * expression.cs (Indexers.map): Remove.
226         (Indexers.Append): Filter out inaccessible setters and getters.
227         (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
228
229         Fix #75283.
230         * ecore.cs (MemberExpr.EmitInstance): New.  Add CS0120 check.
231         Refactored from ...
232         (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
233         (FieldExpr.Emit, PropertyExpr.Emit): Update.
234         (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
235         * expression.cs (Invocation.EmitCall): Add CS0120 check.
236
237 2005-06-30  Marek Safar  <marek.safar@seznam.cz>
238
239         Fix #75322
240         * class.cs (FieldBase.GetInitializerExpression): One more field
241         for backup.
242
243 2005-06-28  Miguel de Icaza  <miguel@novell.com>
244
245         * pending.cs: Do not define a proxy if the base method is virtual,
246         it will be picked up by the runtime (bug 75270).
247
248 2005-07-08  Martin Baulig  <martin@ximian.com>
249
250         * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
251         handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
252
253 2005-07-07  Martin Baulig  <martin@ximian.com>
254
255         * generic.cs (ConstructedType.CheckConstraint): Use
256         ResolveAsTypeStep(), not ResolveAsTypeTerminal() so we're not
257         called recursively; fixes #75329.
258
259 2005-07-06  Martin Baulig  <martin@ximian.com>
260
261         * generic.cs (TypeManager.InferTypeArguments): Added support for
262         anonymous methods; fixes #75461.
263
264 2005-07-01  Martin Baulig  <martin@ximian.com>
265
266         * iterators.cs (Iterator.CapturedThisReference.Emit): Use
267         `ec.EmitThis ()' to get the correct scope.
268
269 2005-07-01  Martin Baulig  <martin@ximian.com>
270
271         * ecore.cs (FieldExpr.DoResolve): Only capture the field if it's
272         instance is `This'; fixes #75299.
273
274 2005-06-30  Martin Baulig  <martin@ximian.com>
275
276         * class.cs (Indexer): Implement IIteratorContainer; added support
277         for iterators in indexers.
278
279         * codegen.cs
280         (EmitContext.CurrentIterator): Make this a property, not a field.
281
282         * anonymous.cs (AnonymousContainer.Iterator): New public property.
283
284 2005-06-28  Miguel de Icaza  <miguel@novell.com>
285
286         * pending.cs: Do not define a proxy if the base method is virtual,
287         it will be picked up by the runtime (bug 75270).
288
289 2005-06-28  Martin Baulig  <martin@ximian.com>
290
291         * cs-parser.jay (interface_method_declaration): Avoid a
292         reduce/reduce conflict by moving some of the code into a separate
293         `interface_method_declaration_body' rule; fixes #75368.
294
295 2005-06-28  Martin Baulig  <martin@ximian.com>
296
297         * typemanager.cs (TypeManager.MemberLookup_FindMembers): Move the
298         array check after the check for TypeBuilder's.
299
300 2005-06-21  Raja R Harinath  <rharinath@novell.com>
301
302         * convert.cs (FindMostEncompassedType): Add two trivial special
303         cases (number_of_types == 0 || number_of_types == 1).
304         (FindMostEncompasingType): Likewise.
305
306 2005-06-17  Raja R Harinath  <rharinath@novell.com>
307
308         Some cleanups preparing for the fix of #75283.
309         * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
310         error testing.
311         (EventExpr.InstanceResolve): Likewise.
312         (EventExpr.DoResolve): Remove redundant checks.
313
314 2005-06-08  Miguel de Icaza  <miguel@novell.com>
315
316         * class.cs: Small fix.
317
318 2005-06-08  Raja R Harinath  <rharinath@novell.com>
319
320         Fix #75160.
321         * class.cs (GetPartialBases): Fix return value check of
322         part.GetClassBases.
323
324 2005-06-07  Raja R Harinath  <rharinath@novell.com>
325
326         Ensure that partial classes are registered in their enclosing
327         namespace.  Initial part of fix of #75160.
328         * tree.cs (Tree.RecordDecl): Add new namespace argument.
329         Register declspace with namespace here, not in
330         DeclSpace.RecordDecl.
331         * cs-parser.jay: Pass namespace to RecordDecl.
332         * class.cs (PartialContainer.Create): Likewise.
333         (ClassPart.DefineType): New sanity-check.  Throws an exception if
334         called.
335         * decl.cs (Declspace.RecordDecl): Remove.
336         * namespace.cs (NamespaceEntry.DefineName): Remove.
337
338 2005-06-06  Marek Safar  <marek.safar@seznam.cz>
339
340         * rootcontext.cs: Reset TargetExt as well.
341
342 2005-06-03  Raja R Harinath  <rharinath@novell.com>
343
344         * ecore.cs (Expression.Resolve): Emit CS0654 error when
345         -langversion:ISO-1.
346
347 2005-06-02  Raja R Harinath  <rharinath@novell.com>
348
349         Fix #75080, cs0119.cs.
350         * ecore.cs (Expression.ExprClassToResolveFlags): New.  Broken out
351         of ...
352         (Expression.Resolve): ... this.  Use it.  Remove bogus code
353         allowing ExprClass.Type and ExprClass.Namespace for
354         ResolveFlags.VariableOrValue.
355         (Expression.Resolve) [1-argument variant]: Change default resolve
356         flags based on language version.
357         (Expression.Error_UnexpectedKind): Use a simple string array
358         rather than an ArrayList.
359         * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
360         not ExprClass.Type.
361         (TypeOfVoid.DoResolve): Likewise.
362         (MemberAccess.DoResolve) [3-argument variant]: Make private.  Drop
363         flags argument -- it always has the same value.
364
365 2005-05-31  Raja R Harinath  <rharinath@novell.com>
366
367         Fix #75081.
368         * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
369         Use it in the error message.
370         * assign.cs, expression.cs, statement.cs: Update.
371
372 2005-05-30  Raja R Harinath  <rharinath@novell.com>
373
374         Fix #75088.
375         * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
376         the "almostMatchedMember" case too.
377         * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
378         that failed the accessibility checks to 'almost_match'.
379
380 2005-05-27  Vladimir Vukicevic  <vladimir@pobox.com>
381
382         * attribute.cs: Use internal MethodBuilder methods to set
383         ExactSpelling and SetLastError on PInvoke methods, instead
384         of passing them via charset.  Fixes #75060.
385
386 2005-05-27  Raja R Harinath  <rharinath@novell.com>
387
388         * parameter.cs (Parameter): Remove TODO comment.
389         (Parameter.DefineParameter): Remove Location parameter.
390         (Parameters.LabelParameters): Likewise.
391         * class.cs (Constructor.Emit): Update to change.
392         (MethodData.Emit): Likewise.
393         * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.  
394         * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
395
396 2005-05-27  Atsushi Enomoto  <atsushi@ximian.com>
397
398         * parameter.cs,
399           Removed Parameters.Location and added Parameter.Location instead.
400           Removed Location parameter from Emit() and GetSignature().
401         * anonymous.cs,
402           class.cs,
403           cs-parser.jay,
404           delegate.cs,
405           iterators.cs,
406           statement.cs :
407           Modified all related calls.
408
409 2005-06-21  Martin Baulig  <martin@ximian.com>
410
411         * generic.cs (NullCoalescingOperator.Emit): Make this work if the
412         left-hand side is not a nullable type; fixes #75328.
413
414 2005-06-21  Martin Baulig  <martin@ximian.com>
415
416         * typemanager.cs
417         (TypeManager.CSharpName): Use GetFullName() instead of `t.FullName'.
418         (TypeManager.GetFullNameSignature): Likewise.
419
420         * convert.cs (Convert.Error_CannotImplicitConversion): Compare
421         `source.FullName' and `target.FullName' to check whether there are
422         two conflicting definitions.
423
424 2005-06-21  Martin Baulig  <martin@ximian.com>
425
426         * convert.cs (Convert.ImplicitTypeParameterConversion): Always use
427         a BoxedCast - also for reference types - to be compatible with csc.
428
429 2005-06-21  Martin Baulig  <martin@ximian.com>
430
431         * expression.cs (MemberAccess.DoResolve): Add support for nested
432         types in a generic instance; fixes #75320.
433
434 2005-06-20  Martin Baulig  <martin@ximian.com>
435
436         * generic.cs (TypeManager.InferType): Also walk the class
437         hierarchy for generic instances; fixes #75261.
438
439 2005-06-17  Martin Baulig  <martin@ximian.com>
440
441         * typemanager.cs (TypeManager.IsBuiltinType): Use TypeToCoreType()
442         to make things work for corlib.
443
444 2005-06-15  Martin Baulig  <martin@ximian.com>
445
446         * attribute.cs (Attribute.CheckSecurityActionValidity): Remove the
447         obsolete `SecurityAction' values.
448
449 2005-06-06  Marek Safar  <marek.safar@seznam.cz>
450
451         * rootcontext.cs: Reset TargetExt as well.
452         
453 2005-06-09  Martin Baulig  <martin@ximian.com>
454
455         * delegate.cs (Delegate.VerifyMethod): Added
456         `MethodGroupExpr old_mg' argument; inherit its
457         `HasTypeParameters'; fix #75085.
458
459 2005-06-09  Martin Baulig  <martin@ximian.com>
460
461         * expression.cs (Invocation.OverloadResolve): Correctly handle
462         generic methods for the SetMemberIsUsed(); fix #75064.
463
464 2005-06-09  Martin Baulig  <martin@ximian.com>
465
466         * statement.cs (Throw.Resolve): Use TypeManager.IsSubclassOf();
467         fixes #75062.
468
469 2005-06-08  Martin Baulig  <martin@ximian.com>
470
471         * cs-parser.jay (nullable_type_or_conditional): If we put the
472         nullable back and our `type' is a `ComposedCast', remove the
473         nullable from it.  Fixes #75156.
474
475         * expression.cs (ComposedCast.RemoveNullable): New public method.
476
477 2005-06-08  Martin Baulig  <martin@ximian.com>
478
479         The big Iterators rewrite :-)
480
481         * iterators.cs: Rewrite this to use the anonymous methods framework.
482
483         * rootcontext.cs (RootContext.DefineTypes): Define Delegates
484         before the TypeContainers; see 2test-21.cs.
485
486         * class.cs
487         (TypeContainer.DefineType): Don't create a new EmitContext if we
488         already have one (this only happens if we're an Iterator).
489         (TypeContainer.Define): Also call Define() on all our iterators.
490         (Method.CreateEmitContext): Added support for iterators.
491
492         * anonymous.cs
493         (AnonymousContainer): New abstract base class for `AnonymousMethod'.
494         (AnonymousContainer.CreateMethodHost): Moved here from
495         AnonymousMethod and made abstract.
496         (AnonymousContainer.CreateScopeType): New abstract method.
497         (AnonymousContainer.IsIterator): New public property.
498         (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
499         get the ScopeTypeBuilder rather than manually defining it here. 
500         (ScopeInfo.EmitScopeInstance): New public method; correctly handle
501         iterators here.
502
503         * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
504         before RootContext.DefineTypes().
505
506         * codegen.cs (EmitContext.RemapToProxy): Removed.
507         (EmitContext.CurrentAnonymousMethod): Changed type from
508         AnonymousMethod -> AnonymousContainer.
509         (EmitContext.ResolveTopBlock): Protect from being called twice.
510         (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
511         (EmitContext.EmitThis): Removed the iterators hacks; use the
512         anonymous methods framework for that.
513
514         * statement.cs
515         (ToplevelBlock.Container): Make this a property, not a field.
516         (ToplevelBlock.ReParent): New public method; move the
517         ToplevelBlock into a new container.
518         (Foreach.TemporaryVariable): Simplify.
519
520 2005-06-05  Martin Baulig  <martin@ximian.com>
521
522         * statement.cs (LocalInfo.CompilerGenerated): New flag.
523         (Block.AddTemporaryVariable): New public method; creates a new
524         `LocalInfo' for a temporary variable.
525         (Block.EmitMeta): Create the LocalBuilders for all the temporary
526         variables here.
527         (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
528         non-iterator variables.
529
530 2005-06-05  Martin Baulig  <martin@ximian.com>
531
532         * statement.cs (Foreach.TemporaryVariable): Create the
533         LocalBuilder in the Emit phase and not in Resolve since in some
534         situations, we don't have an ILGenerator during Resolve; see
535         2test-19.cs for an example.
536
537 2005-06-04  Martin Baulig  <martin@ximian.com>
538
539         The big Foreach rewrite - Part II.
540
541         * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
542         with `PropertyInfo ienumerator_getcurrent'.
543
544         * codegen.cs (VariableStorage): Removed.
545
546         * statement.cs
547         (Foreach): Derive from Statement, not ExceptionStatement.
548         (Foreach.CollectionForeach): New nested class.  Moved all the code
549         dealing with collection foreach here.
550         (Foreach.ForeachHelperMethods): Removed.
551         (Foreach.TemporaryVariable): Implement IMemoryLocation.
552
553 2005-05-23  Martin Baulig  <martin@ximian.com>
554
555         * statement.cs (Try.DoResolve): Don't create a `finally' if we
556         don't need to.  Fix #75014.
557
558 2005-05-26  Raja R Harinath  <rharinath@novell.com>
559
560         Improve user-defined conversion handling.
561         * convert.cs (GetConversionOperators): Rewrite.  Return only the
562         applicable operators.
563         (AddConversionOperators): New.  Helper for GetConversionOperators.
564         (FindMostEncompassedType, FindMostEncompassingType): Verify that
565         there is only one most encompassed/encompassing type.
566         (FindMostSpecificSource, FindMostSpecificTarget): Remove
567         "applicable operator" handling.
568         (UserConversion): Move cache here from GetConversionOperators.
569         Directly cache the chosen operator, rather than the whole
570         MethodGroup.
571         (ExplicitNumericConversion): Fix buggy implementation of Decimal
572         case.  Allow conversion of decimal to sbyte and byte too.
573         * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
574         New static methods.  Used to avoid allocating EmptyExpressions in
575         convert.cs.
576
577 2005-05-24  Duncan Mak  <duncan@novell.com>
578
579         * ecore.cs (CastFromDecimal): New class for casting a decimal to
580         another class, used in Convert.ExplicitNumericConversion.
581         (CastToDecimal): New class, similar to above, but casts to
582         System.Decimal, used in Convert.ImplicitNumericConversion and also
583         in explicit convesion from double/float to decimal.
584
585         * convert.cs (ImplicitNumericConversion): Handle implicit
586         conversions to System.Decimal.
587         (ExplicitNumericConversion): handle explicit conversions to
588         System.Decimal.
589
590         This fixes #68711.
591         
592 2005-05-20  Miguel de Icaza  <miguel@novell.com>
593
594         * typemanager.cs: Do not throw an exception in the TypeBuilder
595         case, we take care of it on the TypeCode.
596
597 2005-05-17  Marek Safar  <marek.safar@seznam.cz>
598         
599         * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
600         is back.
601         
602         * cs-parser.jay: Catch more lexical errors.
603         
604         * report.cs: Add one more Error method.
605         
606         * rootcontext.cs,
607         * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
608
609 2005-05-20  Martin Baulig  <martin@ximian.com>
610
611         * class.cs (TypeContainer.CircularDepException): Removed.
612         (TypeContainer.DefineType): Removed the `InTransit' stuff.
613         (TypeContainer.CheckRecursiveDefinition): Check for circular class
614         (CS0146) and interface (CS0529) dependencies here.
615
616 2005-05-20  Martin Baulig  <martin@ximian.com>
617
618         * expression.cs (New.DoResolve): Move the CS0712 check above the
619         CS0144 check; otherwise it can never be reached.
620
621 2005-05-20  Martin Baulig  <martin@ximian.com>
622
623         * cs-parser.jay: Fix CS0080 check; add CS0231 and CS0257 from MCS.
624
625 2005-05-20  Martin Baulig  <martin@ximian.com>
626
627         * class.cs (TypeContainer.DefineType): Fix CS0698 check.
628
629         * typemanager.cs (TypeManager.IsAttributeType): New public method.
630
631 2005-05-19  Martin Baulig  <martin@ximian.com>
632
633         * delegate.cs
634         (ImplicitDelegateCreation.Check): Added `bool check_only' argument
635         to disable error reporting.
636
637         * convert.cs (Convert.ImplicitStandardConversionExists): Use it
638         here since we don't want to report an error; see the new test-336.cs.
639
640 2005-05-19  Raja R Harinath  <rharinath@novell.com>
641
642         * statement.cs (ToplevelBlock.GetParameterReference)
643         (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
644         Move here from class Block.
645         * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
646         * expression.cs (ParameterReference.DoResolveBase): Likewise.
647
648 2005-05-18  Martin Baulig  <martin@ximian.com>
649
650         Fix #74978.
651
652         * flowanalysis.cs
653         (FlowBranching.Reachability): Add non-static public And() and Or()
654         methods.
655         (FlowBranchingSwitch): New class; do the `break_origins' thing
656         like in FlowBranchingLoop.
657         (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
658         reachability, not just locals and parameters.
659         (FlowBranching.MergeChild): Remove some of the hacks for loop and
660         switch; MergeBreakOrigins() now takes care of that.
661
662 2005-05-18  Martin Baulig  <martin@ximian.com>
663
664         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
665         a loop and may leave it, reset the barrier; fixes #74974.
666
667 2005-05-16  Raja R Harinath  <rharinath@novell.com>
668
669         Fix test-382.cs.  Emit values of decimal constants.
670         * class.cs (TypeContainer.RegisterFieldForInitialization): New.
671         Carved out of ...
672         (TypeContainer.AddField): ... this.
673         (TypeContainer.EmitFieldInitializers): Allow the list of fields
674         with initializers to include 'Const's.
675         (ClassPart.RegisterFieldForInitialization): Forward to
676         PartialContainer.
677         * const.cs (Const.Const): Pass initializer to base class.
678         (Const.Define): In case of decimal constants, register them for
679         initialization in a static constructor.
680
681 2005-05-14  Martin Baulig  <martin@ximian.com>
682
683         * statement.cs (Block.Resolve): Correctly handle unreachable code;
684         do not call ResolveUnreachable() on unreachable statements in
685         here, see the comment in the source code.
686
687 2005-05-13  Raja R Harinath  <rharinath@novell.com>
688
689         Fix #74934.
690         * expression.cs (BinaryResolveOperator): If one of the operands of
691         an equality comparison is 'null' and the other is a pointer type,
692         convert the null to a NullPointer.
693         * convert.cs (ImplicitReferenceConversion): If the expression is a
694         NullLiteral and the target type is a pointer type, return a
695         NullPointer instead.
696         (ImplicitConversionStandard): Likewise.
697
698 2005-05-13  Marek Safar  <marek.safar@seznam.cz>
699         
700         * cs-parser.jay: Set readonly context based on special constructs.
701         
702         * expression.cs (LocalVariableReference.DoResolveBase): Improved
703         readonly variable error handling.
704         
705         * rootcontext.cs (EmitCode): Don't verify members when error
706         occurred.
707         
708         * statement.cs (LocalInfo): Add reaodnly context information.
709         (SetReadOnlyContext, GetReadOnlyContext): New methods.
710
711 2005-05-17  Martin Baulig  <martin@ximian.com>
712
713         * expression.cs (Argument.Resolve): Turn on flow analysis; fix
714         #70970. 
715
716 2005-05-13  Martin Baulig  <martin@ximian.com>
717
718         * statement.cs (Block.Resolve, ResolveUnreachable): Correctly
719         handle unreachable blocks.
720
721 2005-05-13  Martin Baulig  <martin@ximian.com>
722
723         * class.cs
724         (ConstructorInitializer.GetOverloadedConstructor): Don't crash.
725         (MethodCore.CheckCore): Use TypeManager.IsEqual(); fix #74904 and
726         #74905. 
727
728 2005-05-13  Martin Baulig  <martin@ximian.com>
729
730         * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
731         instance variable, not a local.  Fix #74873.
732         (Block.ResolveUnreachable): Set it to true here.
733
734 2005-05-12  Martin Baulig  <martin@ximian.com>
735
736         * cs-parser.jay (property_declaration): Pass the `current_class',
737         not the `current_container' to Property's .ctor.  Fixes #74912.
738
739 2005-05-11  Martin Baulig  <martin@ximian.com>
740
741         * typemanager.cs (Closure): Copy this from MCS and merge all the
742         GMCS-specific changes into it.
743
744 2005-05-12  Raja R Harinath  <harinath@gmail.com>
745
746         Fix #74920.
747         * typemanager.cs (unmanaged_enclosing_types): New.
748         (IsUnmanagedType): Avoid infloops by using
749         'unmanaged_enclosing_types' to talk with recursive invocations.
750
751 2005-05-11  Duncan Mak  <duncan@novell.com>
752
753         * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
754         continuing to process for 'arg'.
755         (handle_preprocessing_directive): Check the argument of the #endif
756         directive and report error CS1025 if there are any trailing
757         characters.
758
759         According to the C# spec, having even whitespace after the #endif
760         directive is illegal; however, because we call arg.TrimEnd ()
761         beforehand, we have the same behavior as csc, allowing whitespace
762         after the directive.
763
764         Fixes #74892.
765
766 2005-05-11  Marek Safar  <marek.safar@seznam.cz>
767
768         Fix #74863.
769         
770         * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
771         (Constructor.GetObsoleteAttribute): Implemented correctly.
772
773 2005-05-10  Martin Baulig  <martin@ximian.com>
774
775         * generic.cs (Constraints.Resolve): Report CS0246 if we cannot
776         resolve the type; fixes #74864.
777         (DefaultValueExpression): Create the LocalTemporary in Emit(), not
778         in DoResolve(); fixes #74862.
779
780 2005-05-10  Martin Baulig  <martin@ximian.com>
781
782         * support.cs (ReflectionParameters.ParameterModifier): Use
783         `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
784         and `ParameterAttributes.In'.  Fixes #74884.
785
786 2005-05-10  Martin Baulig  <martin@ximian.com>
787
788         * typemanager.cs (TypeManager.MemberLookup_FindMembers): Don't use
789         the cache if we're just looking for `MemberTypes.NestedType' in a
790         generic instance.
791
792         * ecore.cs (Expression.ResolveAsTypeTerminal): Don't check the
793         constraints if we're still resolving the type tree.
794         (Expression.MemberLookup): If we're resolving the type tree, only
795         look for `MemberTypes.NestedType' since we're only interested in
796         getting types.
797
798         * class.cs (TypeContainer.DefineType): Don't resolve the type
799         parameters here; do this later in ResolveType() after the type
800         tree has been resolved.
801         (TypeContainer.ResolveType): New public method; this is called
802         after the type tree is resolved and before the types are being
803         populated.  We resolve the generic constraints here.
804         (TypeContainer.DoDefineMember): Check the constraints on our base
805         class and interfaces.
806
807         * decl.cs (DeclSpace.ResolveBaseTypeExpr): Make this protected;
808         set the `ResolvingTypeTree' flag on the EmitContext.
809
810         * codegen.cs (EmitContext.ResolvingTypeTree): New public field.
811
812 2005-05-10  Marek Safar  <marek.safar@seznam.cz>
813
814         * class.cs (Method.Define): Catch attempt for Finalizer declaration.
815         
816         * expression.cs (Argument.GetParameterModifier): Turned to property.
817         (Invocation.Error_InvalidArguments): Add more descriptive errors.
818         
819         * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
820         its C# equivalent.
821         
822 2005-05-09  Raja R Harinath  <rharinath@novell.com>
823
824         Fix #74852.
825         * decl.cs (MemberCache.AddMethods): Register override methods,
826         rather than non-override methods.
827         * typemanager.cs (RegisterOverride): New.
828         (IsOverride): Update.
829
830 2005-05-09  Marek Safar  <marek.safar@seznam.cz>
831
832         * typemanager.cs (TypeManager): Moved InitGenerics to Reset method.
833
834 2005-05-06  Martin Baulig  <martin@ximian.com>
835
836         * attribute.cs
837         (Attributable.IsClsComplianceRequired): Fix typo in the method name.
838         (AttributeTester.AnalyzeTypeCompliance): Add generics support.
839
840 2005-05-09  Marek Safar  <marek.safar@seznam.cz>
841
842         Fix #73105.
843         
844         * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
845         recursive declaration.
846         
847         * statement.cs (Block.ResolveMeta): Report any error in resolving.
848         
849 2005-05-06  Marek Safar  <marek.safar@seznam.cz>
850
851         * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
852         
853         * expression.cs (Binary.DoResolve): (x && 0) is always 0.
854
855 2005-05-05  Raja R Harinath  <rharinath@novell.com>
856
857         Fix #74797.
858         * decl.cs (DeclSpace.FamilyAccessible): 
859         Use TypeManager.IsNestedFamilyAccessible.
860
861         Fix reopened #64812.
862         * typemanager.cs (Closure.Filter): Introduce checks for 'protected
863         internal'.
864
865 2005-05-04  Raja R Harinath  <rharinath@novell.com>
866             Abin Thomas  <projectmonokochi@rediffmail.com>
867             Anoob V E  <projectmonokochi@rediffmail.com>
868             Harilal P R  <projectmonokochi@rediffmail.com>
869
870         Fix #64812.
871         * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
872         allow access to all static members.
873
874 2005-05-04  Martin Baulig  <martin@ximian.com>
875
876         * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
877
878 2005-05-04  Martin Baulig  <martin@ximian.com>
879
880         Fix #74655.
881
882         * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
883         section at the end; make things work if `default' is not the last
884         section.        
885
886 2005-05-04  Martin Baulig  <martin@ximian.com>
887
888         Fix #70400.
889
890         * statement.cs (Switch): Replaced the `got_default' field with a
891         `default_section' one.
892         (Switch.CheckSwitch): Set `default_section' here.
893         (Switch.Resolve): If we're a constant switch and the constant is
894         not found, use the default section.
895
896 2005-05-03  Martin Baulig  <martin@ximian.com>
897
898         * expression.cs (ArrayAccess.EmitGetLength): New public method.
899
900         * statement.cs (Foreach.ArrayForeach): New nested class.
901         (Foreach.TemporaryVariable): New nested class.
902         (Foreach.EmitArrayForeach): Removed; this is now in the new
903         ArrayForeach class.
904
905 2005-05-03  Raja R Harinath  <rharinath@novell.com>
906
907         * pending.cs (BaseImplements): Move the #74773 fix here.  This is
908         more conservative.
909         (VerifyPendingMethods): Revert change below.
910
911         * typemanager.cs (IsOverride, RegisterNonOverride): New.
912         * decl.cs (MemberCache.AddMethod): Register "non-override" methods
913         that used to trigger warning -28.  Remove warning -28.
914         * expression.cs (Invocation.OverloadResolve): Use
915         TypeManager.IsOverride to distinguish override methods.
916
917         Fix #74773.
918         * pending.cs (VerifyPendingMethods): If a base type implements the
919         requested interface, don't bother checking individual methods of
920         the base type.  As a side-effect, this prevents the creation of
921         unnecessary proxies.
922
923 2005-05-02  Martin Baulig  <martin@ximian.com>
924
925         Fix #70182.
926
927         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
928         Also `And' the locals if the old vector is null.
929         (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
930         null; in this case we basically reset all the variables.        
931
932 2005-05-02  Martin Baulig  <martin@ximian.com>
933
934         Fix #74529.
935
936         * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
937         Added `FlowBranching branching' argument; always `and' the
938         variables instead of `or'ing them unless we're an infinite loop.
939
940         * statement.cs (While.Resolve): Create a new sibling unless we're
941         infinite.       
942
943 2005-05-02  Martin Baulig  <martin@ximian.com>
944
945         Fix #70140.
946
947         * class.cs (ConstructorInitializer.Resolve): Added `Block block'
948         arguments; use it instead of creating a new TopLevelBlock.
949         (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
950         our ConstructorInitializer.
951
952         * statement.cs
953         (TopLevelBlock.TopLevelBranching): New public property.
954         (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
955         and create our `TopLevelBranching'.
956
957         * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
958         anonymous method host, use `block.TopLevelBranching' rather than
959         creating a new branching.
960
961 2005-04-20  Miguel de Icaza  <miguel@novell.com>
962
963         * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
964         a ScopeInfo, if any of the current children is a child of the new
965         entry, move those children there.
966
967 2005-04-30  Martin Baulig  <martin@ximian.com>
968
969         * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
970         at the beginning of a SwitchSection.  Fix #73335.
971
972 2005-04-27  Marek Safar  <marek.safar@seznam.cz>
973
974         Fix #74378
975         * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
976         
977         * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
978         (FieldExpr.DoResolve): Obsolete members are ignored for field
979         initializers.
980         
981 2005-04-26  Marek Safar  <marek.safar@seznam.cz>
982
983         * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
984         of arrays detection.
985
986         * class.cs (Interface.VerifyClsCompliance): Add base interfaces
987         verification.
988         (Field.VerifyClsCompliance): Volatile fields are not compliant.
989
990         * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
991         arrays report.
992
993 2005-04-25  Ben Maurer  <bmaurer@ximian.com>
994
995         * cs-parser.jay: Use the prefered version of -unsafe in error
996         message.
997
998 2005-04-22  Marek Safar  <marek.safar@seznam.cz>
999
1000         * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
1001         circumstances.
1002
1003 2005-04-20  John Luke  <john.luke@gmail.com>
1004
1005         * driver.cs: fix typo in error message, --outout to --output
1006
1007 2005-04-30  Martin Baulig  <martin@ximian.com>
1008
1009         * attribute.cs (Attribute.CheckSecurityActionValidity): Correctly
1010         handle the .NET 2.x security attributes.
1011
1012 2005-04-30  Martin Baulig  <martin@ximian.com>
1013
1014         * typemanager.cs
1015         (TypeManager.ExpandInterfaces): Don't add things twice.
1016
1017         * class.cs
1018         (TypeContainer.VerifyClsCompliance): Allow generic instances.
1019
1020 2005-04-29  Martin Baulig  <martin@ximian.com>
1021
1022         * generic.cs (Constraints.ResolveTypes): Expand interfaces.
1023
1024         * anonymous.cs: Added support for anonymous generic methods.
1025
1026 2005-04-29  Martin Baulig  <martin@ximian.com>
1027
1028         * typemanager.cs (TypeManager.GetInterfaces): Correctly handle
1029         generic instances.
1030
1031 2005-04-29  Martin Baulig  <martin@ximian.com>
1032
1033         * generic.cs (TypeManager.HasConstructorConstraint): Removed.
1034
1035         * expression.cs (New.DoResolve): Fix the CS0304 check.
1036
1037 2005-04-29  Martin Baulig  <martin@ximian.com>
1038
1039         * typemanager.cs (TypeManager.GetFullName): Updated to the new
1040         naming schema.
1041
1042         * class.cs (MethodCore.IsDuplicateImplementation): If we're an
1043         explicit interface implementation, compare the interface types.
1044         (MethodData.Define): Use the new naming scheme from the latest
1045         .NET 2.x beta2.
1046         (MemberBase.DoDefineBase): Resolve `InterfaceType' here.
1047
1048         * decl.cs (MemberName.GetMemberName): Removed.
1049         (MemberName.MethodName, FullName): New properties.
1050
1051 2005-04-25  Raja R Harinath  <rharinath@novell.com>
1052
1053         * gmcs.exe.config: Update v2.0.40607 -> v2.0.50215.
1054
1055 2005-04-22  Martin Baulig  <martin@ximian.com>
1056
1057         * generic.cs (GenericMethod): Create the EmitContext in the
1058         `Define()'; in `Define(MethodBuilder)', create the type parameters
1059         before calling `Define()'.  Fixes #73933.
1060
1061 2005-04-22  Martin Baulig  <martin@ximian.com>
1062
1063         * generic.cs
1064         (Constraints.Resolve): Make things work wrt. the new type lookup system.
1065         (ConstructedType.ResolveAsTypeTerminal): Don't override this.
1066
1067         * ecore.cs (Expression.ResolveAsTypeTerminal): If `te' is a
1068         ConstructedType, check its constraints.
1069
1070 2005-04-20  Marek Safar  <marek.safar@seznam.cz>
1071
1072         * codegen.cs (InRefOutArgumentResolving): New field.
1073         
1074         * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
1075         fields outside contructor.
1076         
1077         * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
1078         
1079 2005-04-19  Miguel de Icaza  <miguel@novell.com>
1080
1081         * anonymous.cs (CaptureContext.EmitParameterInstance): The
1082         parameter code was not completed ever, so it was not as up-to-date
1083         as local variables.  Must finish it.
1084
1085         The bug fix was to compare the Toplevel of the block, not the
1086         current block.  Thanks for Ben for pointing this out. 
1087
1088 2005-04-19  Raja R Harinath  <rharinath@novell.com>
1089
1090         * decl.cs (AddMethods): Use the declaring type of the problem
1091         method to determine if we want to squash a warning.
1092
1093 2005-04-19  Marek Safar  <marek.safar@seznam.cz>
1094
1095         * attribute.cs: Removed debug output.
1096
1097         * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
1098         
1099         * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
1100         Report.Stderr.
1101         
1102 2005-04-18  Raja R Harinath  <rharinath@novell.com>
1103
1104         Fix #74481.
1105         * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
1106         (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
1107         all null comparisons against reference types.
1108
1109 2005-04-18  Marek Safar  <marek.safar@seznam.cz>
1110
1111         Fix# 74565
1112         * class.cs (TypeContainer.CircularDepException) New nested
1113         exception class.
1114         (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
1115         (TypeContainer.DefineType): Removed error, reset InTransit before
1116         exit.
1117         (Class.DefineType): Throw exception when is in Transit.
1118         Catch exception and report error.
1119         (Struct.DefineType): Throw exception when is in Transit.
1120         Catch exception and report error.
1121         (Interface.DefineType): Throw exception when is in Transit.
1122         Catch exception and report error.
1123
1124         * codegen.cs: Add InCatch,InFinally to EmitContext to easily
1125         handle nested exception handlers.
1126
1127         * flowanalysis.cs (InTryWithCatch): New method, search for try with
1128         a catch.
1129
1130         * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
1131         InFinally and InCatch storage.
1132
1133         * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
1134         (Catch.Resolve): Set and Restore ec.InCatch.
1135         (Try.Resolve): Set and Restore ec.InFinally.
1136         (Try.HasCatch): True when try has catch.
1137
1138 2005-04-17  Atsushi Enomoto  <atsushi@ximian.com>
1139
1140         * doc.cs : In some cases FilterName returns MonoEvent and MonoField
1141           for the same event member, so exclude such cases from warning 419.
1142           Fixed bug #74633.
1143
1144 2005-04-16  Miguel de Icaza  <miguel@novell.com>
1145
1146         * expression.cs (Binary.ResolveOperator): Apply patch from John
1147         Luke to fix bug 59864: operators &, | and ^ on enumerations
1148         require that the same enum type on both sides.
1149
1150         * driver.cs: Add warnings to old flag usage, this is to assist
1151         people who produce Makefiles and hope that the Makefiles will be
1152         used on Windows.
1153
1154         * class.cs (TypeContainer.EmitType): Moved the definition of the
1155         special $PRIVATE$ field from the resolve phase to the Emit phase.
1156         During resolve we do not know if we are a struct with
1157         HasExplicitLayout, we know this only after the attributes for the
1158         type are emitted.
1159
1160         Set the FieldOffset to zero on the dummy field that we create for
1161         the class.   Fixes 74590.
1162
1163 2005-04-16  Raja R Harinath  <rharinath@novell.com>
1164
1165         Fix #73834.
1166         * ecore.cs (PropertyExpr.resolved): New.
1167         (DoResolve): Use it to handle a case of double resolution here.
1168         Handle a case of identical-name-and-type-name.
1169         * expression.cs (ArrayCreation.CheckIndices): Avoid double
1170         resolution by storing the results of expression resolution back
1171         into the "probes" array.
1172
1173 2005-04-15  Raja R Harinath  <rharinath@novell.com>
1174
1175         Fix cs0208-7.cs and cs0208-8.cs.
1176         * typemanager.cs (IsUnmanagedType): Arrays are not allowed
1177         (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0).  Improve
1178         error reporting to point out the reason a struct is not unmanaged.
1179
1180 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
1181
1182         * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and 
1183           just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
1184
1185 2005-04-13  Raja R Harinath  <rharinath@novell.com>
1186
1187         Fix #74528.
1188         * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
1189         IdenticalNameAndTypeName here.
1190         (EventExpr.InstanceResolve): Likewise.
1191
1192 2005-04-13  Marek Safar  <marek.safar@seznam.cz>
1193
1194         C# 2.0 DefaultCharSetAttribute implementation
1195         
1196         * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
1197         which allows us to set GlobalNamespace for every resolve.
1198         (Attribute.ResolveArguments): Cut from Resolve.
1199         (Attribute.GetCharSetValue): Returns CharSet named argument.
1200         (Attribute.DefinePInvokeMethod): Gets default charset from
1201         module settings.
1202         (GlobalAttribute.ResolveAsTypeStep): Override.
1203         (GlobalAttribute.ResolveArguments): Override.
1204         
1205         * class.cs (TypeAttr): Is protected.
1206         
1207         * codegen.cs (ModuleClass.DefaultCharSet): New member.
1208         (ModuleClass.DefaultCharSetType): New memeber.
1209         (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
1210         
1211         * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
1212         charset from module.
1213         
1214         * delegate.cs (TypeAttr): Override.
1215         (Delegate.DefineType): Use this TypeAttr.
1216         
1217         * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
1218         at very early stage (before types are defined) to resolve model
1219         module attributes. It will probably not work with corlib but it
1220         should be ok.
1221         
1222         * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
1223         charset from module.
1224         
1225         * typemanager.cs (default_charset_type): New type.
1226
1227 2005-04-13  Raja R Harinath  <rharinath@novell.com>
1228
1229         * decl.cs (MemberCache.AddMethods): Don't warn if
1230         System.Object.Finalize has buggy MethodAttributes.
1231
1232         * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
1233         removed below.
1234
1235 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
1236
1237         * doc.cs : detect ambiguous reference to overloaded members.
1238           Fixed bug #71603. MS 1.1 csc does not detect it.
1239
1240 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
1241
1242         * doc.cs : delegates must not be referenced with parameters.
1243           Fixed bug #71605.
1244
1245 2005-04-12  Miguel de Icaza  <miguel@novell.com>
1246
1247         * typemanager.cs (IsUnmanagedType): Arrays are allowed.
1248
1249 2005-04-10  Miguel de Icaza  <miguel@novell.com>
1250
1251         * driver.cs (MainDriver): Stop processing if the CLS stage found
1252         errors. 
1253
1254         (CompilerCallableEntryPoint.InvokeCompiler): Always
1255         reset after execution;   Take a TextWriter argument for the
1256         output.
1257
1258         * report.cs: Use the error stream instead of hardcoding stderr. 
1259
1260 2005-04-09  Miguel de Icaza  <miguel@novell.com>
1261
1262         * class.cs: Reduce code paths to test, too small of an
1263         optimization to make it worth the extra testing.  Always perform
1264         it. 
1265
1266 2005-04-08  Raja R Harinath  <rharinath@novell.com>
1267
1268         Fix #74510.
1269         * class.cs (OperatorArrayList.CheckPairedOperators): Skip
1270         operators that had errors reported on them.
1271
1272 2005-04-08  Marek Safar  <marek.safar@seznam.cz>
1273
1274         * attribute.cs (Attribute.IsValidArgumentType): Test valid named
1275         argument types.
1276         (Attribute.Resolve): Add named argument type checking.
1277         
1278         * class.cs (FixedField.Define): Use IsPrimitiveType
1279         
1280         * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
1281         
1282         * iterators.cs (Iterator.DefineIterator): Add check for arglist and
1283         unsafe parameter types.
1284         
1285         * statement.cs (Using.ResolveExpression): Add better error description.
1286         
1287         * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
1288         
1289 2005-04-08  Raja R Harinath  <rharinath@novell.com>
1290
1291         Fix #74484.
1292         * attribute.cs (Attribute.GetAttributeUsage): Resolve
1293         AttributeUsageAttribute in the emitcontext of the attribute class,
1294         not in the emitcontext of the attributable entity it was attached to.
1295         * cs-parser.jay: Use 'current_class', not 'current_container',
1296         when creating a GlobalAttribute.
1297
1298 2005-04-08  Alp Toker  <alp@atoker.com>
1299
1300         * pending.cs: The fix to #58413 failed to compile methods implementing
1301         interfaces with/without params modifiers and vice versa, even though
1302         params modifiers aren't part of the signature. Make the modifier check
1303         less strict as in csc.
1304
1305 2005-04-07  Abin Thomas  <projectmonokochi@rediffmail.com>
1306             Anoob V E  <projectmonokochi@rediffmail.com>
1307             Harilal P R  <projectmonokochi@rediffmail.com>
1308
1309         Fix #58413.
1310         * pending.cs (TypeAndMethods.mods): New.  Store the parameter
1311         modifiers of pending methods.
1312         (PendingImplementation.PendingImplementation): Initialize it.
1313         Add Parameter.Modifier [][] mods and initialize it with ParameterData.
1314         (PendingImplementation.InterFaceMethod): Repalce Type[] argument
1315         with ParameterData.  Add check for modifiers.
1316         * class.cs (MethodData.Define): Update to changes.
1317
1318 2005-04-07  Raja R Harinath  <rharinath@novell.com>
1319
1320         * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
1321
1322 2005-04-07  Marek Safar  <marek.safar@seznam.cz>
1323
1324         * class.cs (PropertyMethod.Define): Check private accessor in abstract
1325         property.
1326         
1327         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
1328         
1329         * rootcontext.cs,
1330         * typemanager.cs: Registered RequiredAttributeAttribute.
1331         
1332 2005-04-06  Marek Safar  <marek.safar@seznam.cz>
1333
1334         * class.cs (VerifyMembers): Doesn't need EmitContext argument.
1335         Warning CS0169 is back at level 3.
1336         (IMethodData.SetMemberIsUsed): New method.
1337         
1338         * decl.cs (IsUsed): New value; moved from FieldBase.Status
1339         (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
1340         
1341         * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
1342
1343         * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
1344         contants.
1345         (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
1346         is used.
1347         
1348         * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
1349         is used.
1350         
1351         * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
1352         to avoid the problems with nested types.
1353
1354 2005-04-05  Abin Thomas  <projectmonokochi@rediffmail.com>
1355             Anoob V.E  <projectmonokochi@rediffmail.com>
1356             Harilal P.R  <projectmonokochi@rediffmail.com>
1357             Raja R Harinath  <rharinath@novell.com>
1358
1359         Fix #73820.
1360         * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
1361         attribute.
1362         * typemanager (GetConstructor): Make public.
1363
1364 2005-04-05  John Luke  <john.luke@gmail.com>
1365             Raja R Harinath  <rharinath@novell.com>
1366
1367         Fix #62232.
1368         * typemanager.cs (IsUnmanagedType): Check non-public fields of a
1369         struct too.  Return false quicker in a few cases.
1370         (VerifyUnManaged): Use it.
1371
1372 2005-04-05  Raja R Harinath  <rharinath@novell.com>
1373
1374         Fix #74041.
1375         * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
1376         not 'unreachable_seen'.
1377
1378 2005-04-04  Marek Safar  <marek.safar@seznam.cz>
1379
1380         * attribute.cs (Attribute.GetValue): Removed unused.
1381         
1382         * codegen.cs (CodeGen.TrimExt): Removed unused.
1383         
1384         * cs-parser.jay (output): Removed unused.
1385         
1386         * cs-tokenizer.cs (hex_digits): Removed unused.
1387         
1388         * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
1389         
1390         * expression.cs (Indirection.LoadExprValue): Removed unused.
1391         (ArrayCreation.ExpressionToArrayArgument): Removed unused.
1392         
1393         * iterators.cs (Iterator.param_types): Removed unused.
1394         
1395         * statement.cs (Goto.block): Removed unused.
1396         (ToplevelBlock.did): Removed unused.
1397         (Switch.ResolveConstantSwitch): Removed unused.
1398
1399 2005-04-01  Ben Maurer  <bmaurer@ximian.com>
1400
1401         * rootcontext.cs: Allow mcs to bootstrap with the compilation
1402         resetting thingy.
1403
1404 2005-04-19  Martin Baulig  <martin@ximian.com>
1405
1406         Merged r42462 from MCS and made it work for GMCS.
1407
1408         * class.cs (MethodCore.ds): Moved this field to `MemberBase'.
1409
1410         * generic.cs (GenericMethod.Define): Removed `return_type' argument.
1411
1412 2005-04-01  Raja R Harinath  <rharinath@novell.com>
1413
1414         Fix #74232 and cs0208-3.cs.
1415         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
1416         * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
1417         unmanaged type.  Don't use FieldBuilders when 't' is a
1418         TypeBuilder.  Use ModFlags and MemberType fields.
1419         * class.cs (MemberBase.member_type): Rename from MemberType.
1420         (MemberBase.MemberType): New property.  Determines member_type on
1421         demand.
1422         (MemberBase.DoDefine): Don't initialize MemberType here.
1423         (FieldMember.Define): Likewise.
1424
1425 2005-04-01  Marek Safar  <marek.safar@seznam.cz>
1426
1427         Fix #74241
1428         * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
1429         Attributes are emitted there.
1430         
1431 2005-04-01  Raja R Harinath  <rharinath@novell.com>
1432
1433         * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
1434         keyword in 'partial enum' too.
1435         * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
1436         is not allowed).
1437         Report from Kamil Skalski <nazgul@omega.pl>.
1438
1439         Fix #74309.
1440         * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
1441         have partial containers too.
1442
1443         * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
1444         in block' checks to Block.CheckInvariantMeaningInBlock.
1445         * statement.cs (Block.GetKnownVariableInfo): Make private.
1446         (Block.IsVariableUsedInChildBlock): Remove.
1447         (Block.IsVariableUsedInBlock): Likewise.
1448         (Block.CheckInvariantMeaningInBlock): New.  Show location of
1449         conflicting declaration.
1450         (Block.AddVariable): Make error messages less long-winded and more
1451         specific.  Show location of conflicting declaration.
1452         * parameter.cs (Parameters.Location): New readonly property.
1453
1454 2005-03-31  Raja R Harinath  <rharinath@novell.com>
1455
1456         Clean up semantics of invoking ResolveMemberAccess.
1457         * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
1458         can have an instance, ensure that we pass in a non-TypeExpression
1459         to ResolveMemberAccess.  Tighten up IdenticalNameAndTypeName checks.
1460         (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
1461         argument.  Update to changes and simplify.
1462         (FieldExpr.Emitinstance): Remove CS0120 check.
1463         (PropertyExpr.EmitInstance): Likewise.
1464         * expression.cs (Argument.Resolve): Likewise.
1465         (Invocation.DoResolve): Update to changes in semantics of
1466         InstanceExpression.
1467
1468 2005-03-31  Marek Safar  <marek.safar@seznam.cz>
1469
1470         Fix #74241
1471         * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
1472         customization.
1473         
1474         * decl.cs (MemberCache.AddMethods): Fix infinite loop.
1475
1476 2005-03-31  Raja R Harinath  <rharinath@novell.com>
1477
1478         Fix difference in behaviour with commandline invocation.
1479         * driver.cs (Driver.Reset): New.
1480         (CompilerCallableEntryPoint): Call it.
1481
1482         * statement.cs (If.Resolve): Avoid spurious "uninitialized
1483         variable" warnings if the boolean expression failed to resolve.
1484
1485 2005-03-30  Sebastien Pouliot  <sebastien@ximian.com>
1486
1487         * attribute.cs: Fix the union of several permissions when some of them
1488         are unrestricted (so the result isn't an unrestricted permission set).
1489         Fix #74036.
1490
1491 2005-03-30  Raja R Harinath  <rharinath@novell.com>
1492
1493         * ecore.cs (MemberExpr): New class.  Convert from interface
1494         IMemberExpr.
1495         (MemberExpr.ResolveMemberAccess): Refactor and move here from
1496         MemberAccess.ResolveMemberAccess.  Tighten up pre-conditions and
1497         error checks.
1498         (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
1499         (MethodGroupExpr.IsExplicitImpl): Remove.
1500         (Expression.GetFieldFromEvent): Remove.
1501         (SimpleName.MemberStaticCheck): Remove.
1502         (SimpleName.DoSimpleNameResolve): Update to changes.
1503         * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
1504         (MemberAccess.IdenticalNameAndTypeName): Remove.
1505         (MemberAccess.error176): Move to MemberExpr.
1506         (MemberAccess.DoResolve): Update to changes.
1507         (BaseAccess.DoResolve): Likewise.
1508
1509 2005-03-30  Marek Safar  <marek.safar@seznam.cz>
1510
1511         C# 2.0 Conditional attribute class implementation
1512         
1513         * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
1514         Analyzes class whether it has attribute which has ConditionalAttribute
1515         and its condition is not defined.
1516         
1517         * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
1518         (Class.IsExcluded): New method. Search for at least one defined
1519         condition in ConditionalAttribute of attribute class.
1520
1521 2005-03-30  Raja R Harinath  <rharinath@novell.com>
1522
1523         * ecore.cs (PropertyExpr): Derive from Expression, not
1524         ExpressionStatement.
1525         (PropertyExpr.EmitStatement): Remove.
1526
1527 2005-03-29  Raja R Harinath  <rharinath@novell.com>
1528
1529         Fix #74060.
1530         * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
1531         internal field "value__" of an enum be private.  The examples for
1532         "value__" that I found on MSDN all used FieldAttributes.Private.
1533
1534         * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
1535         Don't mention IL method attribute names.
1536
1537         Fix #47991.  Remove a TODO.
1538         * statement.cs (Block.Toplevel): Make into a field.
1539         (Block.Parameters): Move into ToplevelBlock.
1540         (Block.known_variables): Rename from child_variable_names.
1541         (Block.Block): Remove variants that take Parameters.  Initialize
1542         'Toplevel' with the immediately surrounding toplevel block.
1543         (Block.AddKnownVariable): Rename from AddChildVariableName.  Add a
1544         LocalInfo parameter.
1545         (Block.GetKnownVariableInfo): New.
1546         (Block.IsVariableNameUsedInChildBlock): Update.
1547         (Block.IsVariableNameUsedInBlock): New.  Checks if a name is used in
1548         the block, even though it may not be in scope.
1549         (Block.AddVariable): Remove Parameters parameter.  Use
1550         Toplevel.Parameters instead.
1551         (Block.AddConstant): Remove Parameters parameter.
1552         (Block.GetParameterReference): Update to use Toplevel.Parameters.
1553         (Block.IsParamaterReference): Likewise.
1554         (Block.IsLocalParameter): Likewise.  Simplify a lot.
1555         (ToplevelBlock.Parameters): New.  Moved from Block.
1556         (ToplevelBlock.ToplevelBlock): Update to changes.  Always
1557         initialize Parameters to a non-null value.
1558         * cs-parser.jay: Update to changes.
1559         * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
1560         simple names that mean different things in the same block.  Use
1561         Block.IsVariableNameUsedInBlock.
1562
1563 2005-03-28  Raja R Harinath  <rharinath@novell.com>
1564
1565         * enum.cs (Enum.LookupEnumValue): Remove debugging code.
1566
1567 2005-03-26  Raja R Harinath  <harinath@acm.org>
1568
1569         Fix #73038.
1570         * assign.cs (Assign.DoResolve): When the RHS of an assignment
1571         fails to resolve, ensure that the LHS is still resolved as an
1572         lvalue.
1573
1574 2005-03-25  Raja R Harinath  <harinath@acm.org>
1575
1576         * enum.cs (Enum.DefineType): Set ec.InEnumContext and
1577         ec.ContainerType.
1578         (Enum.current_ec): Remove.
1579         (Enum.LookupEnumValue): Remove EmitContext argument.
1580         Just uses the one created during DefineType.
1581         (Enum.FindMembers): Update.
1582         * expression.cs (MemberAccess.DoResolve): Update.
1583
1584 2005-03-22  Marek Safar  <marek.safar@seznam.cz>
1585
1586         * assign.cs (Assign.DoResolve): Check for CS1717 when
1587         source and target are same (uses Equals).
1588
1589         * expression.cs (LocalVariableReference, ParameterReference,
1590         This): Implemented Equals, GetHashCode.
1591
1592         * statement.cs (Block.GetParameterReference): Removed useless
1593         local variable.
1594
1595 2005-03-22  Raja R Harinath  <rharinath@novell.com>
1596
1597         Fix cs0128.cs
1598         * statement.cs (Block.AddVariable): Ensure that we skip implicit
1599         blocks before deciding whether the error is cs0136 or cs0128.
1600
1601         * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
1602         (using_alias_directive, using_namespace_directive): Pass
1603         MemberName, not an expression to Namespace.UsingAlias and
1604         Namespace.Using.
1605         (MakeName): Use the MemberName of the namespace.
1606         * namespace.cs (Namespace.MemberName): New.
1607         (UsingEntry.UsingEntry): Take a MemberName, not an expression.
1608         (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
1609         Likewise.
1610         * decl.cs (MemberName.Name): Make readonly.
1611         (MemberName.FromDotted): New "constructor".
1612         (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
1613         (MemberCore.Name): Compute from MemberName on demand.
1614         (MemberCore.SetMemberName): Provide a way to change the
1615         MemberName.
1616         (MemberCore.AddToContainer): Don't take a fullname parameter.
1617         * class.cs (TypeContainer.AddToMemberContainer): Don't add the
1618         fully qualified name of the container to the member name.
1619         (TypeContainer.AddToTypeContainer): Use a fully qualified name
1620         only if the type is a member of the root container.
1621         (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
1622         MemberName.Left rather than searching for an embedded ".".
1623         (PartialContainer.CreatePart): Update to changes in RootContext.
1624         (MemberBase.ShortName): Turn into a property.  Use
1625         MemberCore.SetMemberName.
1626         (MemberBase.ExplicitInterfaceName): Remove.
1627         (MemberBase.UpdateMemberName): Remove.
1628         (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
1629         (PropertyBase.SetMemberName): New override.
1630         * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
1631         (Tree.GetDecl): New.
1632         (Tree.AllDecls): Rename from Decls.
1633         * attribute.cs, enum.cs, report.cs: Update to changes.
1634         * driver.cs (MainDriver): Use MemberName.FromDotted on
1635         RootContext.MainClass.
1636
1637 2005-03-21  Marek Safar  <marek.safar@seznam.cz>
1638
1639         * class.cs (FixedField.Define): Check for CS1664 and more sanity
1640         checks.
1641
1642         * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
1643
1644 2005-03-18  Marek Safar  <marek.safar@seznam.cz>
1645
1646         * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
1647         property accessor modifiers.
1648
1649         * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
1650         fixed buffer attribute (CS1716).
1651         (PropertyMethod.HasCustomAccessModifier): When property accessor
1652         has custom modifier.
1653
1654         * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
1655         modifiers.
1656         (PropertyExpr.DoResolveLValue): Add CS0272.
1657
1658 2005-03-17  Miguel de Icaza  <miguel@novell.com>
1659
1660         * convert.cs: When converting to a pointer, use the proper Conv.U
1661         or Conv.I depending on the source data type.
1662
1663         * cs-tokenizer.cs: Make the size for large decimal constants,
1664         fixes #72957.
1665
1666 2005-03-17  Martin Baulig  <martin@ximian.com>
1667
1668         * anonymous.cs (AnonymousMethod.method_modifiers): Change default
1669         from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'.  Fixes #73260.
1670
1671 2005-03-17  Martin Baulig  <martin@ximian.com>
1672
1673         * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
1674         to bool so we can return an error condition.
1675         (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
1676         returned an error.
1677
1678 2005-03-16  Zoltan Varga  <vargaz@freemail.hu>
1679
1680         * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
1681         attributes.
1682
1683 2005-03-16  Raja R Harinath  <rharinath@novell.com>
1684
1685         Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
1686         Refactor to avoid traversing the list of assemblies, and to avoid
1687         string concatenation.
1688         * typemanager.cs (guid_attr_type): Remove.
1689         (negative_hits, pointers, references): Remove hashes.
1690         (type_hash): New.
1691         (GetConstructedType): New.  Uses type_hash to handle constructed
1692         types (arrays, references, pointers).
1693         (GetReferenceType, GetPointerType): Use it.
1694         (GetNestedType): New.  Uses type_hash to handle nested types of
1695         reflected types.
1696         (LookupType, LookupTypeDirect): Remove.
1697         (CoreLookupType): Inline parts of old LookupTypeDirect code.  Use
1698         'types' hash and LookupTypeReflection directly.
1699         (params_string, params_object): Use GetConstructedType.
1700         * namespace.cs (Namespace.cached_types): New.  Cache of reflected
1701         top-level types.
1702         (Namespace.Lookup): Use cached_types.
1703         (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
1704         provided by old TypeManager.LookupType.
1705         * rootcontext.cs (MakeFQN): Remove.
1706         * decl.cs (DeclSpace.MakeFQN): Likewise.
1707         (DeclSpace.LookupType): Use TypeManager.GetNestedType.
1708         * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
1709         TypeManager.GetConstructedType.
1710         * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
1711
1712 2005-04-16  Zoltan Varga  <vargaz@freemail.hu>
1713
1714         * cs-parser.jay: Fix build.
1715
1716 2005-03-15  Marek Safar  <marek.safar@seznam.cz>
1717
1718         * class.cs (TypeContainer.CircularDepException) New nested
1719         (MethodCore.CheckBase): Report CS1715 for properties and indexers.
1720
1721         * cs-parser.jay: Reports CS1527 for any namespace element.
1722
1723         * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
1724         Added CS0407.
1725
1726         * expression.cs (ParameterReference.IsAssigned): Changed error to
1727         CS0269.
1728         (Error_WrongNumArguments): Moved CS0245 detection here.
1729
1730         * statement.cs (Return.Resolve): Add CS1622 report.
1731
1732 2005-03-11  Marek Safar  <marek.safar@seznam.cz>
1733
1734         * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
1735
1736 2005-03-11  Zoltan Varga  <vargaz@freemail.hu>
1737
1738         * attribute.cs expression.cs: Get rid of some allocations.
1739
1740 2004-03-11  Atsushi Enomoto  <atsushi@ximian.com>
1741
1742         * doc.cs : just eliminate the latest change.
1743
1744 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
1745
1746         * doc.cs : commented out the latest change. It breaks xml-030.cs
1747
1748 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
1749
1750         * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
1751           fail. So invoke CreateType() in FindDocumentedType().
1752
1753 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
1754
1755         * cs-tokenizer.cs : added IsKeyword().
1756         * doc.cs : Detect keyword incorrectly used as identifier.
1757           Allow identifiers prefixed by @.
1758
1759 2005-03-10  Marek Safar  <marek.safar@seznam.cz>
1760
1761         * attributes.cs (Attributes.Emit): Continue after CheckTargets.
1762         It caused exception in namespace resolving (again!).
1763         
1764         * class.cs (Class.ctor): Removed exit.
1765         (PropertyMethod.ctor): ditto.
1766         
1767         * codegen.cs (Codegen.Reset): Reset static data.
1768         (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
1769         
1770         * cs-tokenizer.cs (Cleanup): Removed.
1771         
1772         * driver.cs (GetSystemDir): Rewrote to one line command.
1773         It caused problem with unloaded dynamic modules.
1774         (UnixParseOption): Removed Exit.
1775         (CompilerCallableEntryPoint.InvokeCompiler): Make static.
1776         (CompilerCallableEntryPoint.Reset): Reset suitable static data.
1777         Now can be mcs used as library.
1778         
1779         * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
1780         empty location.
1781         
1782         * location.cs (Reset): Reset static data.
1783         
1784         * namespace.cs (Reset): Reset static data.
1785         
1786         * report.cs (Report.Reset): Reset static data.
1787         
1788         * rootcontext.cs (RootContext.Reset): Reset static data.
1789         
1790         * tree.cs (RootTypes.ctor): Use Location.Null
1791         
1792         * typemanager.cs (TypeManager.Reset): Reset static data.
1793         (CoreLookupType): Removed Exit.
1794         (TypeHandle.Reset): Reset static data.
1795         
1796 2005-03-10  Raja R Harinath  <rharinath@novell.com>
1797
1798         Fix #73516.
1799         * typemanager.cs (ComputeNamespaces): Import namespaces from
1800         referenced modules too.
1801
1802 2005-03-09  Raja R Harinath  <rharinath@novell.com>
1803
1804         * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
1805         than '.'.
1806
1807 2005-03-09  Raja R Harinath  <rharinath@novell.com>
1808
1809         * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
1810         enclosing DeclSpace.  This ensures that a name-lookup populates
1811         more caches and there are fewer 'TypeExpression's.  Carve out
1812         nested type lookup into ...
1813         (LookupNestedTypeInHierarchy): ... this.
1814
1815 2005-04-15  Martin Baulig  <martin@ximian.com>
1816
1817         Merged r41590 from MCS and make it work in the generics land.
1818
1819         * generic.cs (TypeParameter.UpdateConstraints): Removed the
1820         `check' argument.
1821
1822         * class.cs (PartialContainer.UpdateConstraints): Removed.
1823         (PartialContainer.CheckConstraints): Removed.
1824         (PartialContainer.SetParameterInfo): Store the constraints here.
1825         (PartialContainer.DefineTypeParameters): New public method;
1826         resolve the type parameter's constraints here.  Note that the
1827         PartialContainer doesn't have an EmitContext anymore, so we must
1828         do this in the ClassPart.
1829
1830 2005-03-09  Raja R Harinath  <rharinath@novell.com>
1831
1832         Clean up a few partial-class semantics.  
1833         Fixes test-357.cs and cs1618-2.cs.
1834         * cs-parser.jay (struct_declaration): Use 'current_class' as
1835         parent of newly-created struct.  Remove call to Register ().
1836         Use 'pop_current_class' to complete handing the current struct.
1837         (interface_declaration): Likewise.
1838         (class_declaration): Likewise.
1839         (enum_declaration): Use 'current_class' as parent of newly created
1840         enum.
1841         (delegate_declaration): Likewise.
1842         (pop_current_class): New function.  This is used to handle closing
1843         up the 'current_class' and 'current_container', and pointing them
1844         to the enclosing class/container.
1845         (CSharpParser): Initialize 'current_class' too.
1846         * decl.cs (MemberCore): Add check for invariant: a partial
1847         container is not a parsed entity, and thus does not enclose any
1848         parsed members.
1849         (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
1850         (DeclSpace.BaseTypeExpr): Use it.
1851         (DeclSpace.LookupType): Add check for invariant.
1852         * class.cs (TypeContainer): Add check for invariant: a nested
1853         class should have the same NamespaceEntry as its enclosing class.
1854         (TypeContainer.EmitFieldInitializers): Make virtual.
1855         (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
1856         MemberCore.
1857         (TypeContainer.Register): Remove.
1858         (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
1859         null.  Use TypeResolveEmitContext for resolving base types and
1860         interfaces.  Move initialization of Parts.TypeBuilder here from
1861         ...
1862         (TypeContainer.DefineNestedTypes): ... here.
1863         (PartialContainer): Take a Namespace not a NamespaceEntry.
1864         (PartialContainer.Create): Don't use Register.  Call the
1865         appropriate Add... function directly.
1866         (ClassPart): Take both the PartialContainer and the enclosing
1867         class as constructor arguments.
1868         (ClassPart.EmitFieldInitializers): Override.
1869         (ClassPart.PartFindNestedTypes): Remove.
1870         (FieldBase.GetInitializerExpression): Resolve the initializer
1871         expression in the emit context of the enclosing class.
1872         * tree.cs (RootTypes): Remove Register ().
1873         
1874 2005-03-08  Marek Safar  <marek.safar@seznam.cz>
1875
1876         * cs-parser.jay: Removed CS0134.
1877         
1878         * driver.cs: Removed CS1901.
1879         
1880         * expression.cs (SizeOf.DoResolve): Don't report CS0233
1881         for predefined types.
1882
1883 2005-03-07  Duncan Mak  <duncan@novell.com>
1884
1885         * codegen.cs (Save):  Catch UnauthorizedAccessException as
1886         well. Fixes bug #73454.
1887
1888 2005-03-07  Marek Safar  <marek.safar@seznam.cz>
1889
1890         * cs-tokenizer.cs (xtoken): Add CS1035.
1891         
1892         * class.cs (MethodData.Define): Add CS0683.
1893         (FieldMember.ctor): Add CS0681.
1894
1895 2005-03-07  Raja R Harinath  <rharinath@novell.com>
1896
1897         * ecore.cs (SimpleName.DoResolve): Rename from
1898         SimpleName.DoResolveAllowStatic.
1899         (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
1900         Pass 'intermediate' flag to MemberStaticCheck.
1901         (SimpleName.MemberStaticCheck): Skip "static check" only in case
1902         of "intermediate" lookups via MemberAccess.
1903         (SimpleName.IdenticalNameAndTypeName): New.  Carved out of ...
1904         * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
1905
1906 2005-03-07  Raja R Harinath  <rharinath@novell.com>
1907
1908         Fix #73394.
1909         * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
1910         slipped in because of variable names that are identical to a
1911         builtin type's BCL equivalent ('string String;', 'int Int32;').
1912         (PropertyExpr.EmitInstance): Likewise.
1913
1914 2005-03-04  Marek Safar  <marek.safar@seznam.cz>
1915
1916         * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
1917         
1918         * report.cs (warning_ignore_table): Made public.
1919
1920 2005-03-04  Raja R Harinath  <rharinath@novell.com>
1921
1922         Fix #73282.
1923         * class.cs (MethodData.Emit): Pass 'container' to
1924         container.GetObsoleteAttribute instead of 'container.Parent'.
1925
1926 2005-03-03  Marek Safar  <marek.safar@seznam.cz>
1927
1928         * cs-parser.jay: Add 1534 error test.
1929
1930         * iterators.cs (Yield.CheckContext): Add error 1629.
1931         (Iterator.ctor): Save unsafe modifier.
1932         (MoveNextMethod.DoEmit): Restore unsafe context.
1933
1934         * namespace.cs (UsingAlias): Better error message.
1935
1936 2005-03-03  Dan Winship  <danw@novell.com>
1937
1938         * convert.cs (Error_CannotImplicitConversion): fix two bugs in
1939         the warning message [#73219]
1940
1941 2005-03-03  Raja R Harinath  <rharinath@novell.com>
1942
1943         Fix compile with MCS 1.0.0.0.
1944         * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
1945         w_restore to not depend on string constant folding.
1946
1947 2005-03-03  Raja R Harinath  <rharinath@novell.com>
1948
1949         * decl.cs (DeclSpace.LookupType): Remove 'silent' argument.  Move
1950         CS0246 check to users who passed 'silent = false'.
1951         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
1952         check.
1953         (SimpleName.SimpleNameResolve): Update.
1954         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
1955         (MemberAccess.IdenticalNameAndTypeName): Update.
1956         * doc.cs (FindDocumentedTypeNonArray): Update.
1957
1958 2005-03-03  Raja R Harinath  <rharinath@novell.com>     
1959
1960         * codegen.cs (EmitContext): Remove ResolvingTypeTree.
1961         * parameters.cs (ComputeAndDefineParameters): Remove.
1962         * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
1963         * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
1964         Use GetParameterInfo.
1965
1966 2005-03-02  Marek Safar  <marek.safar@seznam.cz>
1967
1968         * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
1969
1970 2005-03-02  Raja R Harinath  <rharinath@novell.com>
1971
1972         Unify DeclSpace.LookupType and DeclSpace.FindType.
1973         * decl.cs (DeclSpace.FindNestedType): New virtual function.  This
1974         is in charge of defining nested types on demand.
1975         (DeclSpace.LookupType): Use it when the current_type is a
1976         TypeBuilder.  Use LookupTypeDirect for reflected types.
1977         (DeclSpace.FindType): Remove.
1978         (DeclSpace.LookupInterfaceOrClass): Likewise.
1979         (DeclSpace.DefineTypeAndParents): Likewise.
1980         * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
1981         DeclSpace.LookupType.
1982         * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
1983         * typemanager.cs (LookupType): Simplify.
1984         (AddUserType): Remove type from negative_hits.
1985         * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
1986         * class.cs (TypeContainer.FindMembers): Move handling of nested
1987         types ...
1988         (TypeContainer.FindMembers_NestedTypes): ... here.
1989         (TypeContainer.FindNestedType): Implement override.
1990         (ClassPart.FindNestedType): Delegate to PartialContainer.
1991         (ClassPart.PartFindNestedType): Looks up the nested types of the
1992         part alone.
1993
1994 2005-04-14  Martin Baulig  <martin@ximian.com>
1995
1996         * generic.cs (ConstructedType): Moved all the type lookup and
1997         nested class logic into SimpleName.
1998         (ConstructedType.ResolveConstructedType): Our underlying type is
1999         already fully resolved; all the type lookup stuff is in
2000         SimpleName.
2001
2002         * ecore.cs (SimpleName.ResolveAsTypeStep): Resolve nested
2003         constructed types here instead of in ConstructedType.
2004
2005         * decl.cs (MemberName.GetTypeExpression): Always create a
2006         SimpleName, not a ConstructedType.
2007         (DeclSpace.ResolveNestedType): Removed; this is now in SimpleName.
2008
2009 2005-03-02  Martin Baulig  <martin@ximian.com>
2010
2011         * class.cs (TypeContainer.DoDefineMembers): We also need a default
2012         static constructor in static classes.
2013
2014 2005-03-01  Zoltan Varga  <vargaz@freemail.hu>
2015
2016         * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
2017         sizeParamIndex is not specified.
2018
2019 2005-03-01  Marek Safar  <marek.safar@seznam.cz>
2020
2021         Fix #73117
2022         * report.cs (WarningMessage.IsEnabled): Missing null check.
2023
2024 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
2025
2026         * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
2027         in the fields and not in the properties.
2028
2029 2005-02-28  Zoltan Varga  <vargaz@freemail.hu>
2030
2031         * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex 
2032         fields as well.
2033
2034 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
2035
2036         * attribute.cs: Small refactoring (improved robustness).
2037         (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
2038         (ValidateGuid): Removed.
2039         (Resolve): Removed referenced to above mentioned.
2040         (GetAttributeUsage): Made private and changed to work without
2041         class assistance.
2042         (GetIndexerAttributeValue): Don't crash.
2043         (GetConditionalAttributeValue): Ditto.
2044         (GetClsCompliantAttributeValue): Ditto.
2045         (ExtractSecurityPermissionSet): All attributes exceptions are
2046         error 648.
2047         (GetPropertyValue): New helper.
2048         (GetMethodImplOptions): New method.
2049         (DefinePInvokeMethod): Reuse common code. Implemented handling of
2050         some missing properties.
2051         
2052         * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
2053         (Method.ApplyAttributeBuilder): Updated.
2054         
2055         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
2056         exception.
2057
2058 2005-02-28  Raja R Harinath  <rharinath@novell.com>
2059
2060         Fix #73052.
2061         * report.cs (Report.SymbolRelatedToPreviousError): Handle
2062         non-simple types (array, pointer, reference).
2063
2064 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
2065
2066         * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
2067
2068         * class.cs (MethodCore.IsDuplicateImplementation): Special error
2069         for operators.
2070         (Method.CheckBase): Catch wrong destructor here.
2071         (MethodData.Define): Add errors 550, 668.
2072
2073         * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
2074
2075         * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
2076
2077         * pending.cs (VerifyPendingMethods): Add error 551.
2078
2079         * typemanager.cs (CSharpName): Next error report helper.
2080
2081 2005-02-25  Marek Safar  <marek.safar@seznam.cz>
2082
2083         * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
2084         attributes. Removed useless attribute double check.
2085         It saves almost 2MBs for corlib.
2086
2087 2005-02-25  Raja R Harinath  <rharinath@novell.com>
2088
2089         Fix #72924.
2090         * statement.cs (ExpressionStatement.Resolve): Make robust to being
2091         called twice in case of error.
2092
2093 2005-02-23  Chris Toshok  <toshok@ximian.com>
2094
2095         Fix compiler portions of #72827.
2096         * statement.cs (Block.Emit): call Begin/EndScope on the
2097         EmitContext instead of the ILGenerator.
2098
2099         * codegen.cs (EmitContext.BeginScope): new method, call
2100         ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
2101         we have one.)
2102         (EmitContext.BeginScope): same, but EndScope and CloseScope
2103
2104         * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
2105         offset and call the superclass's OpenScope(int) with it.
2106         (SymbolWriter.CloseScope): get the current il
2107         offset and call superclass's CloseScope(int) with it.
2108
2109 2005-02-23  Marek Safar  <marek.safar@seznam.cz>
2110
2111         * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
2112         CS1677 for out and ref as well.
2113
2114         * class.cs (Method.Define): Add error CS1599 detection.
2115         
2116         * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
2117         
2118         * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
2119         
2120         * delegate.cs (Delegate.Define): Add error CS1599 detection.
2121         
2122         * support.cs.cs (ModifierDesc): New helper method.
2123
2124 2005-02-23  Raja R Harinath  <rharinath@novell.com>
2125             Abin Thomas  <projectmonokochi@rediffmail.com>
2126             Anoob V E  <projectmonokochi@rediffmail.com>
2127             Harilal P R  <projectmonokochi@rediffmail.com>
2128
2129         Fix #57851, #72718.
2130         * class.cs (ConstructorBuilder.Resolve): Make sure that the second
2131         MemberLookup (used for error reporting) actually returns a result.
2132         Fix error report number (122, not 112).
2133
2134 2005-02-22  Abin Thomas  <projectmonokochi@rediffmail.com>
2135             Anoob V E  <projectmonokochi@rediffmail.com>
2136             Harilal P R  <projectmonokochi@rediffmail.com>
2137
2138         Fix #71134.
2139         * pending.cs (PendingImplementation.GetAbstractMethods):
2140         Find NonPublic members too.
2141
2142 2005-02-22  Marek Safar  <marek.safar@seznam.cz>
2143
2144         * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
2145         Fixed error 217.
2146         
2147         * class.cs (MethodCore.CheckMethodAgainstBase):
2148         Add error 239 report.
2149
2150 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
2151
2152         * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
2153         
2154         * class.cs (Operator.Define): Add error 217 report.
2155         
2156 2005-02-21  Raja R Harinath  <rharinath@novell.com>
2157
2158         Fix #68955.
2159         * expression.cs (Invocation.IsApplicable): Make public.
2160         (Invocation.IsParamsMethodApplicable): Likewise.
2161         * delegate.cs (Delegate.VerifyApplicability): Don't use
2162         Invocation.VerifyArgumentCompat for parameter applicability
2163         testing.  Use Invocation.IsApplicable and
2164         Invocation.IsParamsMethodApplicable.
2165
2166 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
2167
2168         * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
2169         
2170         * class.cs (Operator.Define): Add error 217 report.
2171         
2172 2005-02-21  Raja R Harinath  <rharinath@novell.com>
2173
2174         * namespace.cs (UsingEntry.Resolve): Undo change below.
2175
2176 2005-02-21  Raja R Harinath  <rharinath@novell.com>
2177
2178         Fix #72756.
2179         * ecore.cs (Expression.MemberLookupFailed): Add argument to
2180         disable the error message when the extended MemberLookup also
2181         fails.
2182         (Expression.MemberLookupFinal): Update.
2183         (SimpleName.DoSimpleNameResolve): Update.
2184         * expression.cs (MemberAccess.ResolveNamespaceOrType):
2185         Don't use MemberLookupFinal.
2186         (New.DoResolve): Update.
2187         (BaseAccess.CommonResolve): Update.
2188
2189 2005-02-21  Raja R Harinath  <rharinath@novell.com>
2190
2191         Fix #72732.
2192         * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
2193         occured previously, don't resolve again.
2194
2195 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
2196
2197         Fix #69949
2198         * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
2199         argument. Call ResolveAttributeUsage for unresolved.
2200         when types doesn't match ctor arguments.
2201         
2202         * class.cs (DoDefineMembers.TypeContainer): Removed safety check
2203         for nested attribute classes.
2204         (Class.attribute_usage): Removed.
2205         (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
2206         for attribute class.
2207         
2208         * ecore.cs (IsAttribute): Removed.
2209         
2210         * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
2211         
2212         * rootcontext.cs (RegisterAttribute): Removed, attributes are
2213         now normal types.
2214         (attribute_types): Removed.
2215         (EmitCode): Global attributes are emited as the latest.
2216
2217 2005-02-18  Marek Safar  <marek.safar@seznam.cz>
2218
2219         * class.cs (EmitFieldInitializers): Don't emit field initializer
2220         for default values when optimilization is on.
2221         
2222         * constant.cs (Constant.IsDefaultValue): New property.
2223         
2224         * driver.cs: Add /optimize handling.
2225         
2226         * constant.cs,
2227         * ecore.cs,
2228         * literal.cs: Implement new IsDefaultValue property.
2229         
2230         * rootcontext.cs (Optimize): New field, holds /optimize option.
2231
2232 2005-02-18  Raja R Harinath  <rharinath@novell.com>
2233
2234         Fix crasher in re-opened #72347.
2235         * namespace.cs (Namespace.Lookup): Return null if
2236         DeclSpace.DefineType returns null.
2237
2238         Fix #72678.
2239         * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
2240
2241 2005-02-18  Raja R Harinath  <rharinath@novell.com>
2242
2243         Fix remainder of #63202.  Change semantics of DoResolveLValue: it
2244         now returns null if it cannot resolve to an lvalue.
2245         * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
2246         (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
2247         returned null.  Remove check for SimpleName.
2248         (EventExpr.DoResolveLValue): New.
2249         * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
2250         * expression.cs (Argument.Error_LValueRequired): New.  Move CS1510
2251         error from ...
2252         (Argument.Resolve): ... here.  Use it.  Use DoResolveLValue to
2253         avoid CS0131 error.
2254         (Unary.ResolveOperator): Move CS0211 check ...
2255         (Unary.DoResolve): ... here.  Use DoResolveLValue to avoid
2256         CS0131 error.
2257         (Unary.DoResolveLValue): Simplify.
2258         (AddressOf.DoResolveLValue): New.
2259         (ArrayAccess.DoResolveLValue): New.
2260
2261 2005-02-16  Marek Safar  <marek.safar@seznam.cz>
2262
2263         * attribute.cs (Attribute.Resolve): Add arguments casting for
2264         when types doesn't match ctor arguments.
2265
2266 2005-02-16  Raja R Harinath  <rharinath@novell.com>
2267
2268         Fix parts of #63202.
2269         * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
2270         lookup of operator in base type.  Ensure that all checks happen
2271         when the operator resolves to an "op_..." method.
2272
2273 2005-02-15  Raja R Harinath  <rharinath@novell.com>
2274
2275         Fix #71992.
2276         * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
2277         'ignore_cs0104' parameter.  Pass it to ...
2278         (NamespaceEntry.Lookup): ... this.
2279         * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
2280         * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
2281         (TypeLookupExpression.DoResolveAsTypeStep): Update.
2282         * expression.cs (MemberAccess.IdenticalNameAndTypeName):
2283         Update.  Request that cs0104 errors be ignored.
2284         (ComposedCast.ResolveAsTypeStep): Update.
2285
2286 2005-02-14  Raja R Harinath  <rharinath@novell.com>
2287
2288         Fix #59209.
2289         * expression.cs (Invocation.BetterFunction): Remove support for
2290         comparing virtual functions and their overrides.
2291         (Invocation.IsOverride): New.
2292         (Invocation.OverloadResolve): Don't consider 'override' functions
2293         during candidate selection.  Store them in a lookaside list.
2294         If the selected method is a 'virtual' function, use the list to
2295         find any overrides that are closer to the LHS type.
2296
2297 2005-02-14  Marek Safar  <marek.safar@seznam.cz>
2298
2299         * expression.cs (New.DoResolve): Add complex core type reduction.
2300         (New.Constantify): Converts complex core type syntax like 'new int ()'
2301         to simple constant.
2302         
2303 2005-02-14  Raja R Harinath  <rharinath@novell.com>
2304
2305         * decl.cs (EntryType.EntryType): New constructor to create an
2306         updated copy of a cache entry.
2307         (MemberCache.AddMethods): Use it.
2308         (MemberCache.ClearDeclaredOnly): Remove.
2309         (MemberCache.MemberCache): Update.
2310
2311 2005-02-11  Miguel de Icaza  <miguel@novell.com>
2312
2313         * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
2314         variable.  This one is represents the actual low-level declaration
2315         of the method, as opposed to the semantic level `IsStatic'.   
2316
2317         An anonymous method which is hosted into a static method might be
2318         actually an instance method.  IsStatic would reflect the
2319         container, while MethodIsStatic represents the actual code
2320         generated.
2321
2322         * expression.cs (ParameterReference): Use the new MethodIsStatic
2323         instead of IsStatic.
2324
2325         * anonymous.cs (AnonymousMethod.Compatible): Pass the
2326         Modifiers.STATIC to the Anonymous' Method EmitContext if static is
2327         set on the current EmitContext. 
2328
2329         * expression.cs (Cast): Overload DoResolveLValue so we can pass
2330         resolve our casted expression as an LValue.  This triggers the
2331         proper LValue processing that is later required by Assign.
2332
2333         This fixes 72347.
2334
2335         * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
2336
2337 2005-02-11  Marek Safar  <marek.safar@seznam.cz>
2338
2339         C# 2.0 Fixed buffer implementation
2340
2341         * anonymous.cs: Update after RegisterHelperClass renaming.
2342
2343         * attribute.cs (AttributeTester.fixed_buffer_cache):
2344         Cache of external fixed buffers.
2345         (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
2346         implementation if field is fixed buffer else null.
2347
2348         * class.cs
2349         (TypeContainer.AddField): Accept FieldMember instead of Field.
2350         (FieldBase.IsFieldClsCompliant): Extracted code from
2351         VerifyClsCompliance descendant customization.
2352         (FixedField): New class handles fixed buffer fields.
2353         (FixedFieldExternal): Keeps information about imported fixed
2354         buffer.
2355         (IFixedField): Make access to internal or external fixed buffer
2356         same.
2357
2358         * cs-parser.jay: Add fixed buffer parsing.
2359
2360         * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
2361         buffer.
2362
2363         * expression.cs (Indirection): Extended implementation to accept
2364         fixed buffer field.
2365         (PointerArithmetic.Emit): Get element from fixed buffer as well.
2366         (ElementAccess.MakePointerAccess): Get type as parameter.
2367         (DoResolve): Add fixed buffer field expression conversion.
2368         (DoResolveLValue): Ditto.
2369         (FixedBufferPtr): New class. Moved most of original ArrayPtr.
2370         (ArrayPtr): Derives from FixedBufferPtr.
2371         (ArrayPtr.Emit): Add extra emit for array elements.
2372
2373         * flowanalysis.cs.cs (StructInfo): Use FieldMember.
2374
2375         * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
2376         for compiler generated types.
2377         (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
2378
2379         * statement.cs (Fixed): Refactored to be easier add fixed buffer
2380         and consume less memory.
2381         (Fixed.Resolve): Add fixed buffer case.
2382
2383         * typemanager.cs (compiler_generated_attr_ctor,
2384         fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
2385         (HasElementType): Add our own implementation to work on every
2386         runtime.
2387
2388 2005-02-11  Miguel de Icaza  <miguel@novell.com>
2389
2390         * anonymous.cs (CaptureContext): Track whether `this' has been
2391         referenced.   
2392
2393         * expression.cs (This.ResolveBase): Call CaptureThis.  Before we
2394         only captured `this' if it was implicitly done (instance
2395         methods/variables were used). 
2396
2397         * codegen.cs (EmitContext.CaptureThis): New method to flag that
2398         `this' must be captured.
2399
2400 2005-01-30  Miguel de Icaza  <miguel@novell.com>
2401  
2402         * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
2403         is null it means that there has been no need to capture anything,
2404         so we just create a sibling.
2405
2406         Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
2407
2408         Just a partial fix.  The other half is fairly elusive.
2409         
2410 2005-02-10  Raja R Harinath  <rharinath@novell.com>
2411
2412         Fix #52586, cs0121-4.cs.
2413         * decl.cs (MemberCache.DeepCopy): Rename from SetupCache.  Take
2414         and return a hashtable.
2415         (MemberCache.ClearDeclaredOnly): New.
2416         (MemberCache.MemberCache): Update to change.  Make a deep copy of
2417         the method_hash of a base type too.
2418         (MemberCache.AddMethods): Adapt to having a deep copy of the base
2419         type methods.  Overwrite entries with the same MethodHandle so
2420         that the ReflectedType is correct.  The process leaves in base
2421         virtual functions and their overrides as distinct entries.
2422         (CacheEntry): Now a class instead of a struct.  It shouldn't alter
2423         matters since it was boxed in a ArrayList before.
2424         (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
2425         modifier.
2426         * expression.cs (Invocation.BetterFunction): Simplify.  Handle the
2427         case of a virtual function and its override (choose the overload
2428         as better).
2429         (Invocation.OverloadResolve): Avoid 'override' members during
2430         'applicable_type' calculation.
2431
2432 2005-03-28  Raja R Harinath  <rharinath@novell.com>
2433
2434         * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
2435         (TypeHandle.TypeHandle): Use LookupMemberCache rather than
2436         GetTypeHandle.  It is possible for a reflected type to derive from
2437         a TypeBuilder (e.g., int[] derives from the TypeBuilder
2438         System.Array during mscorlib compilation).
2439         * decl.cs (MemberCache.MemberCache): If the base cache doesn't
2440         contain a method_hash, don't create one either.  Don't create a
2441         deep copy of the base cache's method_hash.
2442         (MemberCache.SetupCache): Rename back from DeepCopy.
2443         (MemberCache.AddMethods): Rewrite, now that method_hash isn't
2444         already initialized.  If we see an override function, add its
2445         underlying base virtual function to the member_hash too.
2446
2447 2005-02-09  Raja R Harinath  <rharinath@novell.com>
2448
2449         Combine two near-redundant caches.
2450         * typemanager.cs (method_params): Rename from method_internal_params.
2451         (TypeManager.GetParameterData): New.  Replace
2452         Invocation.GetParameterData.
2453         (TypeManager.LookupParametersByBuilder): Remove.
2454         * expression.cs (Invocation.method_parameter_cache): Remove.
2455         (Invocation.GetParameterData): Remove.
2456         Update to changes.
2457         * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
2458         Update to changes.
2459
2460 2005-02-08  Raja R Harinath  <rharinath@novell.com>
2461
2462         Fix #72015.
2463         * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
2464         TypeManager.multicast_delegate_type is null, resolve it by looking
2465         up "System.MulticastDelegate".
2466         * rootcontext.cs (RootContext.ResolveCore): Simplify.
2467
2468 2005-02-07  Abin Thomas (NOSIP)  <projectmonokochi@rediffmail.com>
2469             Anoob V.E (NOSIP)  <projectmonokochi@rediffmail.com>
2470             Harilal P.R (NOSIP)  <projectmonokochi@rediffmail.com>
2471
2472         Fix cs0164.cs.
2473         * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
2474         (LabeledStatement.AddReference): New.  Set 'referenced'.
2475         (Goto.Resolve): Use it.
2476
2477 2005-02-05  John Luke  <john.luke@gmail.com>
2478
2479         * driver.cs: remove duplicate -doc line in Usage ()
2480
2481 2005-02-04  Raja R Harinath  <rharinath@novell.com>
2482
2483         * location.cs (Location.AddFile): Fix CS2002 error report.
2484
2485 2005-02-02  Martin Baulig  <martin@ximian.com>
2486
2487         * delegate.cs (Delegate.DefineType): Report an internal error if
2488         TypeManager.multicast_delegate_type is null.  See bug #72015 for
2489         details.        
2490
2491 2005-02-02  Raja R Harinath  <rharinath@novell.com>
2492
2493         Fix a crasher in a variant of #31984.
2494         * const.cs (Constant.CheckBase): New override that defers the
2495         new-or-override check in case the base type hasn't been populated
2496         yet.
2497         (Constant.Define): Ensure the new-or-override check is performed.
2498
2499 2005-02-01  Duncan Mak  <duncan@ximian.com>
2500
2501         * const.cs (LookupConstantValue): Check that `ce' is not null
2502         before calling GetValue ().
2503
2504 2005-02-01  Raja R Harinath  <rharinath@novell.com>
2505
2506         Fix test-334.cs (#69519).
2507         * cs-parser.jay (using_alias_directive): Pass in an expression to
2508         NamespaceEntry.UsingAlias.
2509         (using_namespace_directive): Pass in an expression to
2510         NamespaceEntry.Using.
2511         (namespace_name): Don't flatten to a string.
2512         * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
2513         (NamespaceEntry.AliasEntry.Resolve): Lookup using
2514         ResolveAsTypeStep.
2515         (NamespaceEntry.UsingEntry): Likewise.
2516         (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
2517         changes.
2518         (NamespaceEntry.LookupForUsing): Remove.
2519         (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
2520         names.
2521         (NamespaceEntry.Lookup): Remove support for dotted names.
2522
2523 2005-02-01  Raja R Harinath  <rharinath@novell.com>
2524
2525         * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
2526         split into two.
2527         (NamespaceEntry.ImplicitParent): Compute on demand.
2528         (NamespaceEntry.Doppelganger): New implicit namespace-entry that
2529         parallels the current.
2530         (NamespaceEntry.LookupForUsing): Use it.
2531         (NamespaceEntry.Lookup): If the current namespace-entry is
2532         implicit, don't search aliases and using tables.
2533
2534 2005-02-01  Raja R Harinath  <rharinath@novell.com>
2535
2536         Fix #31984.
2537         * class.cs (TypeContainer.DoDefineMembers): Don't initialize
2538         BaseCache here.
2539         (TypeContainer.BaseCache): Compute on demand.
2540         (TypeContainer.FindMembers): Define constants and types if they're
2541         not already created.
2542         (FieldMember.Define): Move resetting of ec.InUnsafe before error
2543         check.
2544         * const.cs (Constant.Define): Make idempotent.
2545
2546 2005-01-29  Miguel de Icaza  <miguel@novell.com>
2547
2548         * pending.cs: Produce better code (no nops produced by using Ldarg
2549         + value).
2550         
2551         * pending.cs (PendingImplementation.DefineProxy): It was not `arg
2552         i - 1' it should be arg + 1.
2553
2554         Fixes bug #71819.
2555
2556 2005-01-28  Raja R Harinath  <rharinath@novell.com>
2557
2558         * attribute.cs (Attribute.CheckAttributeType): Make private
2559         non-virtual.
2560         (Attribute.ResolveType): Make virtual.
2561         (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
2562         handling of RootContext.Tree.Types.
2563
2564 2005-01-27  Raja R Harinath  <rharinath@novell.com>
2565
2566         Update attribute-handling to use the SimpleName/MemberAccess
2567         mechanisms.
2568         * cs-parser.jay (attribute): Pass in an expression to the
2569         constructors of Attribute and GlobalAttribute.
2570         * attribute.cs (Attribute): Take an expression for the name.
2571         (Attribute.ResolvePossibleAttributeTypes): New.  Resolves the
2572         passed in attribute name expression.
2573         (Attribute.CheckAttributeType): Use it.
2574         * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
2575         * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
2576         (MemberAccess.ResolveNamespaceOrType): ... here.  Add 'silent'
2577         argument to prevent error messages if the lookup fails.
2578
2579 2005-01-27  Marek Safar  <marek.safar@seznam.cz>
2580
2581         * expression.cs (Indirection): Implemented IVariable interface
2582         to support indirection in AddressOf operator.
2583         (PointerArithmetic.Emit): Add optimalization for case where
2584         result can be precomputed.
2585
2586 2005-01-26  Martin Baulig  <martin@ximian.com>
2587
2588         * class.cs (TypeContainer.AttributeTargets): Return the correct
2589         AttributeTargets depending on our `Kind' instead of throwing an
2590         exception; fixes #71632.
2591
2592 2005-01-26  Marek Safar  <marek.safar@seznam.cz>
2593
2594         Fix #71257
2595         * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
2596         constant members.
2597
2598 2005-03-17  Martin Baulig  <martin@ximian.com>
2599
2600         * anonymous.cs (AnonymousMethod.method_modifiers): Change default
2601         from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'.  Fixes #73260.
2602
2603 2005-03-17  Martin Baulig  <martin@ximian.com>
2604
2605         * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
2606         to bool so we can return an error condition.
2607         (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
2608         returned an error.
2609
2610 2005-03-17  Martin Baulig  <martin@ximian.com>
2611
2612         * generic.cs (TypeMananager.IsIEnumerable): New public method.
2613
2614         * convert.cs (Convert.ImplicitReferenceConversion(Exists)): Allow
2615         converting from an array-type of T to `IEnumerable<T>'.
2616
2617 2005-03-16  Martin Baulig  <martin@ximian.com>
2618
2619         * generic.cs (Nullable.Unwrap): Implement IAssignMethod.
2620         (Nullable.LiftedUnaryMutator): New public class.
2621
2622         * expression.cs (UnaryMutator.DoResolve): Added support for
2623         Nullable Types.
2624
2625 2005-03-14  Martin Baulig  <martin@ximian.com>
2626
2627         * generic.cs (Nullable.NullCoalescingOperator): Implemented.
2628
2629 2005-03-14  Martin Baulig  <martin@ximian.com>
2630
2631         * generic.cs (Nullable.LiftedBinaryOperator): Added support for
2632         the comparision operators `<', `>', `<=' and `>='.
2633
2634 2005-03-13  Martin Baulig  <martin@ximian.com>
2635
2636         * generic.cs
2637         (Nullable.NullLiteral): Renamed to `Nullable.NullableLiteral' to
2638         avoid confusion with the `NullLiteral'.
2639         (Nullable.LiftedBinaryOperator): Correctly implement `==' and '!='.
2640
2641 2005-03-13  Martin Baulig  <martin@ximian.com>
2642
2643         * expression.cs (Binary.ResolveOperator): For `==' and `!=', allow
2644         comparing arbitrary types with the null literal.
2645
2646 2005-03-13  Martin Baulig  <martin@ximian.com>
2647
2648         * generic.cs (Nullable.LiftedBinaryOperator): Add support for the
2649         boolean operators '&&', '||', '&' and '|'.
2650         (Nullable.OperatorTrueOrFalse): New public class.
2651
2652         * ecore.cs (Expression.GetOperatorTrue/False): Return an `Expression'
2653         instead of a `StaticCallExpr'; added support for nullables.
2654
2655 2005-03-10  Martin Baulig  <martin@ximian.com>
2656
2657         * expression.cs
2658         (ArrayAccess.EmitDynamicInitializers): Use `etype.IsValueType'
2659         rather than `etype.IsSubclassOf (TypeManager.value_type)'.      
2660
2661 2005-03-07  Martin Baulig  <martin@ximian.com>
2662
2663         * generic.cs (Nullable.Unwrap): Implement IMemoryLocation and make
2664         it work if `expr' is not an IMemoryLocation.
2665         (Nullable.Lifted): Implement IMemoryLocation.
2666         (Nullable.LiftedConversion.ResolveUnderlying): Use the correct
2667         target type.
2668
2669 2005-03-05  Martin Baulig  <martin@ximian.com>
2670
2671         * generic.cs (Nullable.Unwrap, Wrap): New protected classes.
2672         (Nullable.Lifted): New abstract class; rewrote the lifted conversions.
2673         (Nullable): Added support for lifted unary and binary operators.
2674
2675         * expression.cs (Unary.DoResolve): Added support for nullable types.
2676         (Binary.DoResolve): Likewise.
2677         (Conditional.DoResolve): Likewise.
2678
2679 2005-03-02  Martin Baulig  <martin@ximian.com>
2680
2681         * decl.cs (DeclSpace.SetParameterInfo): Make this virtual.
2682
2683         * class.cs (ClassPart.SetParameterInfo): Override this.
2684         (PartialContainer.SetParameterInfo): Override this.
2685         (TypeContainer.CheckConstraints): New protected method.
2686         (PartialContainer.CheckConstraints): Override this and check
2687         whether the same contraints were specified in all parts of a
2688         partial generic type definition.
2689         (PartialContainer.UpdateConstraints): New public method.
2690
2691         * generic.cs (TypeParameter.UpdateConstraints): New public method.
2692
2693 2005-03-02  Martin Baulig  <martin@ximian.com>
2694
2695         Committing a patch from Carlos Alberto Cortez to fix #72887.
2696
2697         * convert.cs (Convert.ExplicitReferenceConversionExists): Allow
2698         casts from `T []' to `int []'.
2699
2700 2005-03-02  Martin Baulig  <martin@ximian.com>
2701
2702         * generic.cs (TypeManager.IsEqual): Make this symmetric.
2703
2704         * expression.cs (Binary.ResolveOperator): When resolving a
2705         BinaryDelegate, use `TypeManager.IsEqual (l, r)' rather than just
2706         `=='.  Fixes #71866.  See gen-127.cs.
2707
2708 2005-03-02  Martin Baulig  <martin@ximian.com>
2709
2710         * class.cs (TypeContainer.DoDefineMembers): We also need a default
2711         static constructor in static classes.
2712
2713 2005-03-02  Martin Baulig  <martin@ximian.com>
2714
2715         * generic.cs
2716         (NullableType.Name, NullableType.FullName): Add a "?" to the name.
2717         (Nullable.LiftedConversion): Added support for user-defined
2718         conversions.
2719
2720         * cs-tokenizer.cs (Tokenizer.PutbackCloseParens): New public method.
2721
2722         * cs-parser.jay: Use ComposedCast everywhere instead of
2723         NullableType, so we don't need to check for NullableType
2724         everywhere.
2725         (conditional_expression): Added `INTERR CLOSE_PARENS' rule for the
2726         case where we'll be resolved into a `parenthesized_expression_0'
2727         afterwards.
2728
2729         * convert.cs
2730         (Convert.UserDefinedConversion): Added nullable conversions.
2731
2732 2005-02-28  Martin Baulig  <martin@ximian.com>
2733
2734         * generic.cs (TypeManager.IsNullableType): New static method.
2735         (Nullable): New abstract class.
2736         (Nullable.NullLiteral): New public class.
2737         (Nullable.LiftedConversion): New public class.
2738
2739         * cs-parser.jay (non_expression_type): Changed `builtin_types' to
2740         `builtin_types opt_nullable'.
2741
2742         * convert.cs
2743         (Convert.ImplicitConversionStandard): Added nullable conversions.
2744         (Convert.ExplicitConversionStandard): Likewise.
2745         (Convert.ExplicitConversion): Likewise.
2746
2747 2005-02-26  Martin Baulig  <martin@ximian.com>
2748
2749         * expression.cs (ComposedCast.DoResolveAsTypeStep): Allow `dim' to
2750         begin with a "?", for instance "?[]".  Don't do a type lookup if
2751         `dim' is empty.
2752
2753 2005-02-25  Martin Baulig  <martin@ximian.com>
2754
2755         The first part of Nullable Types :-)
2756
2757         * generic.cs (NullableType): New public class.
2758         (NullCoalescingOperator): New public class.
2759         (TypeArguments.Resolve): Add a CS0306 check.
2760
2761         * cs-parser.jay (opt_error_modifier): Removed, this was unused.
2762         (opt_nullable): New rule.
2763         (type): Added `opt_nullable' to `namespace_or_type_name',
2764         `builtin_types' and `pointer_type'.
2765         (array_type): Added `opt_nullable'.
2766         (opt_rank_specifier_or_nullable): New rule; this is the
2767         combination of `opt_rank_specifier' and `opt_nullable'.
2768         (opt_error): New rule; catch errors here.
2769         (nullable_type_or_conditional): New rule; we use this to check for
2770         nullable and still detect the conditional operator.
2771         (local_variable_type): Use `opt_rank_specifier_or_nullable'
2772         instead `opt_rank_specifier'.
2773
2774         * expression.cs (ComposedCast.DoResolveAsTypeStep): Added support
2775         for nullables.
2776
2777 2005-02-24  Martin Baulig  <martin@ximian.com>
2778
2779         * README, README.Changes: Removed; they're old and obsolete.
2780
2781 2005-02-22  Martin Baulig  <martin@ximian.com>
2782
2783         * generic.cs (TypeParameter.Resolve): If resolving the constraints
2784         returned an error, set `constraints' to null to avoid a crash
2785         later on.
2786         (TypeParameter.ResolveType): Likewise.
2787
2788 2005-02-22  Martin Baulig  <martin@ximian.com>
2789
2790         * generic.cs
2791         (Constraints.ResolveTypes): Protect against being called twice.
2792         (Constraints.CheckInterfaceMethod): Don't call ResolveTypes().
2793         (TypeParameter.ResolveType): New public method; calls
2794         constraints.ResolveTypes().
2795         (TypeParameter.DefineType): Moved constraints.ResolveType() out
2796         into the new ResolveType().
2797         (GenericMethod.Define): Call ResolveType() on all our
2798         TypeParameter's.        
2799
2800 2005-02-21  Martin Baulig  <martin@ximian.com>
2801
2802         * generic.cs
2803         (TypeManager.generic_nullable_type): New static public field.
2804         (TypeManager.InitGenericCoreType): Lookup "System.Nullable`1".
2805
2806         * rootcontext.cs
2807         (RootContext.ResolveCore): Resolve "System.Nullable`1".
2808
2809 2005-02-15  Martin Baulig  <martin@ximian.com>
2810
2811         * generic.cs (ConstructedType.Constraints): Correctly check
2812         constraints if the argument type is a type parameter; fixes
2813         #72326. 
2814
2815 2005-02-02  Martin Baulig  <martin@ximian.com>
2816
2817         * delegate.cs (Delegate.DefineType): Report an internal error if
2818         TypeManager.multicast_delegate_type is null.  See bug #72015 for
2819         details.        
2820
2821 2005-01-29  Miguel de Icaza  <miguel@novell.com>
2822
2823         * pending.cs: Produce better code (no nops produced by using Ldarg
2824         + value).
2825         
2826         * pending.cs (PendingImplementation.DefineProxy): It was not `arg
2827         i - 1' it should be arg + 1.
2828
2829         Fixes bug #71819.
2830         
2831 2005-01-26  Martin Baulig  <martin@ximian.com>
2832
2833         * cs-parser.jay (indexer_declarator): Don't report an error if we
2834         have type parameters since we can be an explicit interface
2835         implementation; fixes #71449.
2836
2837 2005-01-26  Martin Baulig  <martin@ximian.com>
2838
2839         * class.cs (TypeContainer.AttributeTargets): Return the correct
2840         AttributeTargets depending on our `Kind' instead of throwing an
2841         exception; fixes #71632.
2842
2843 2005-01-26  Martin Baulig  <martin@ximian.com>
2844
2845         * delegate.cs (Delegate.DefineType): Correctly define our type
2846         parameters.  Fixes #71483.
2847
2848 2005-01-25  Raja R Harinath  <rharinath@novell.com>
2849
2850         Fix #71602.
2851         * expression.cs (MemberAccess.DoResolve): Don't complain with
2852         cs0572 when the LHS of a member access has identical name and type
2853         name.
2854
2855 2005-01-25  Marek Safar  <marek.safar@seznam.cz>
2856
2857         Fix #71651, #71675
2858         * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
2859         CreatePermission.
2860         Create custom PermissionSet only for PermissionSetAttribute.
2861
2862 2005-01-24  Marek Safar  <marek.safar@seznam.cz>
2863
2864         Fix #71649
2865         * class.cs (StaticClass.DefineContainerMembers): Enable enums and
2866         delegates in static class.
2867
2868 2005-01-24  Martin Baulig  <martin@ximian.com>
2869
2870         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
2871         merging an implicit block, just use its reachability.
2872
2873         * statement.cs (Block.Resolve): Make the unreachable code check
2874         work wrt. implicit blocks; see test-337 from #63842.
2875
2876 2005-01-21  Alp Toker  <alp@atoker.com>
2877  
2878         * cs-parser.jay: destructor_declaration's container is PartialContainer
2879         not Class when partial types are used, so use Kind prop instead of
2880         'is'.
2881         
2882 2005-01-22  Miguel de Icaza  <miguel@ximian.com>
2883
2884         * cs-parser.jay: Improve error reporting when an interface
2885         declares new types.
2886
2887 2005-01-20  Dick Porter  <dick@ximian.com>
2888
2889         * support.cs: SeekableStreamReader fix from Sandor Dobos
2890         (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
2891         chars are read.  Fixes bug 70369.
2892
2893 2005-01-20  Raja R Harinath  <rharinath@novell.com>
2894
2895         * cs-parser.jay (catch_clause): Simplify current_block handling
2896         somewhat.
2897
2898 2005-01-17  Miguel de Icaza  <miguel@ximian.com>
2899
2900         * convert.cs (ImplicitStandardConversionExists): Synchronize the
2901         code with ImplicitStandardConversion to handle the implicit
2902         conversion of method groups into valid delegate invocations. 
2903
2904         The problem is that in parameter handling we were using this code
2905         path.  Fixes bug #64698
2906
2907 2005-01-19  Raja R Harinath  <rharinath@novell.com>
2908
2909         * cs-parser.jay: Fix several infelicities.
2910         - Avoid assigning to the parser value stack.  Code like 
2911           '$3 = null' is unclean.  Synthesize a value for the code block
2912           instead. 
2913         - Avoid using oob_stack for storing location information.  Use ...
2914         (_mark_): ... this.  New (empty) rule.  Saves the current location
2915         in $$.
2916         (foreach_statement): Avoid using oob_stack for current_block
2917         handling.  Use technique used in for_statement and
2918         using_statement.  Synthesize a value for the code block to store
2919         additional intermediate information.
2920
2921 2005-01-13  Miguel de Icaza  <miguel@ximian.com>
2922
2923         * ecore.cs (IsAccessorAccessible): Accessibility to private fields
2924         of a different type is only allowed to private fields of a
2925         containing type, not on fields of a base class.
2926
2927         See test-174.cs and error cs0122-9.cs
2928
2929 2005-01-13  Raja R Harinath  <rharinath@novell.com>
2930
2931         Fix test-335.cs (bug #58126).
2932         * cs-parser.jay (argument): Split out non-expression parts of the
2933         rule into 'non_simple_argument'.
2934         (invocation_expression): Support parenthesized invocations with
2935         multiple arguments, and with single non-simple arguments.
2936
2937 2005-01-13  Raja R Harinath  <rharinath@novell.com>
2938
2939         * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
2940         places.
2941
2942 2005-01-12  Raja R Harinath  <rharinath@novell.com>
2943
2944         Fix cs0038-1.cs, cs1640-6.cs.
2945         * ecore.cs (Expression.Resolve): Remove special-case for
2946         SimpleName in error-handling.
2947         (Expression.almostMatchedMembers): Relax access permission to
2948         protected.
2949         (Expression.MemberLookupFailed): Handle duplicates in
2950         almostMatchedMembers list.
2951         (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
2952         * expression.cs (New.DoResolve): Report CS1540 for more cases.
2953         * typemanager.cs (GetFullNameSignature): Use the MethodBase
2954         overload if the passed in MemberInfo is a MethodBase.
2955
2956 2005-01-25  Martin Baulig  <martin@ximian.com>
2957
2958         * doc.cs
2959         (DocUtil.emptyParamList): Removed; use `Type.EmptyTypes' instead.
2960
2961 2005-01-12  Marek Safar  <marek.safar@seznam.cz>
2962
2963         Fix #70749
2964         * attribute.cs (ExtractSecurityPermissionSet): Don't report error
2965         for non-CAS & merge permission sets properly.
2966
2967 2005-01-11  Raja R Harinath  <rharinath@novell.com>
2968
2969         Improve standard-compliance of simple name and member access 
2970         resolution.  Fixes bugs #52697, #57200, #67520, #69519.
2971         * ecore.cs (FullNamedExpression): New abstract base class 
2972         for Namespaces and TypeExpressions.
2973         (ResolveFlags.SimpleName): Remove.
2974         (SimpleName): Remove support for dotted names.
2975         (SimpleName.ResolveAsTypeStep): Simplify.  Now just a wrapper to 
2976         DeclSpace.FindType and DeclSpace.LookupType.
2977         (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
2978         (Expression.ExprClassName): Make member function.
2979         * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
2980         a namespace.  Remove creation of dotted "SimpleName"s.
2981         (MemberAccess.DoResolve): Likewise.
2982         * decl.cs (DeclSpace.Cache): Make private.
2983         (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
2984         (DeclSpace.FindType): Update.
2985         (DeclSpace.LookupType): Move here from RootContext.  Return a 
2986         FullNamedExpression.
2987         * namespace.cs (Namespace): Derive from FullNamedExpression
2988         so that it can be part of expression resolution.
2989         (Namespace.Lookup): Return an FullNamedExpression.
2990         (NamespaceEntry.LookupAlias): Lookup aliases only in current
2991         namespace.
2992         * rootcontext.cs (NamespaceLookup): Remove.
2993         (LookupType): Move to DeclSpace.
2994         * attribute.cs (CheckAttributeType): Update.
2995         * doc.cs (FindDocumentedType): Remove allowAlias argument.
2996         (FindDocumentedTypeNonArray): Likewise.
2997
2998 2005-01-11  Raja R Harinath  <rharinath@novell.com>
2999
3000         Fix cs0509.cs, cs1632.cs.
3001         * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
3002         is the same as IsInterface.
3003         (TypeContainer.GetClassBases): Likewise.
3004         * statement.cs (LabeledStatement.ig): New field.
3005         (LabeledStatement.LabelTarget): Save ILGenerator which created the
3006         label.
3007         (LabeledStatement.DoEmit): Check that the label was created with
3008         the same ILGenerator.
3009
3010 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
3011
3012         Fix #71058
3013         * attribute.cs (GetMethodObsoleteAttribute): Need to transform
3014         accessors to its properties.
3015
3016         * ecore.cs (PropertyExpr): Add AccessorTable to help track back
3017         from accessors to property.
3018         
3019 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
3020
3021         Fix #70722
3022         * class.cs (MethodCore.CheckBase): Test base method obsoleteness
3023         only for overrides.
3024         
3025 2005-01-08  Miguel de Icaza  <miguel@ximian.com>
3026
3027         * attribute.cs: Check for null and empty strings.  
3028
3029         I have lost another battle to Paolo.
3030
3031 2005-01-07  Marek Safar  <marek.safar@seznam.cz>
3032
3033         Fix #70942
3034         * class.cs (PropertyMethod): Set Parent field in ctors.
3035         (SetMethod.InternalParameters): Add unsafe switch hack.
3036         Override MarkForDuplicationCheck where it is appropriate.
3037
3038         * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
3039         It says whether container allows members with the same name.
3040         Base default is no.
3041         (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
3042         Removed is_method parameter.
3043
3044 2005-01-06  Duncan Mak  <duncan@ximian.com>
3045
3046         * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
3047         because the previous change led to incorrect reporting of CS1032
3048         ("Cannot define/undefine preprocessor symbols after first token in
3049         file"). Instead of using `tokens_seen' as the only flag that
3050         triggers CS1040, introduce `comments_seen'. This new flag is used
3051         to signify having seen comments on the current line, so it is
3052         unset after a newline.
3053
3054 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
3055
3056         * doc.cs : When searching for a type, find nested type too.
3057           This fixes bug #71040.
3058
3059 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
3060
3061         * doc.cs :
3062           - Warn missing member comment on those classes which also does not
3063             have doc comments. Fixed bug #71041.
3064           - Don't warn missing doc comment on default constructor.
3065             Fixed bug #71042.
3066
3067 2005-01-06  Duncan Mak  <duncan@ximian.com>
3068
3069         * cs-tokenizer.cs (xtoken): After handling traditional C-style
3070         comments, set `tokens_seen' to true. This allows us to detect
3071         misplaced preprocessor directives (i.e. not at the beginning of
3072         the a line, nor after whitespaces). In that case, report error
3073         CS1040. This fixes bug #56460.
3074
3075         * cs-parser.jay (interface_member_declaration): Add checks for
3076         IsExplicitImpl, and report CS0541 error if an interface member is
3077         defined as an explicit interface declaration.
3078
3079 2005-01-06  Marek Safar  <marek.safar@seznam.cz>
3080
3081         Fix #70817
3082         * class.cs (PropertyMethod): Set Parent field in ctors.
3083         (SetMethod.InternalParameters): Add unsafe switch hack.
3084         
3085         * decl.cs (MemberCore.Parent): Cannot be readonly.
3086
3087 2005-01-06  Raja R Harinath  <rharinath@novell.com>
3088
3089         * decl.cs (DeclSpace.ResolveType): Remove.
3090         (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
3091         Merge in code from ...
3092         (DeclSpace.GetTypeResolvingEmitContext): ... here.  Remove.
3093         * class.cs, enum.cs: Update to changes.
3094
3095 2005-01-06  Miguel de Icaza  <miguel@ximian.com>
3096
3097         * anonymous.cs: Ensure that we init the scope of our parent if it
3098         has not been initialized yet.
3099
3100 2004-12-30  Duncan Mak  <duncan@ximian.com>
3101
3102         * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
3103         if field.FieldBuilder is null. Fixes #70758.
3104
3105         * convert.cs: Fixed some typos and updated some of the comments.
3106         (ImplicitStandardConversionExists):
3107         (TryImplicitIntConversion): If `target_type' is an interface and
3108         the type of `ic' implements this interface, return true or a new
3109         BoxedCast instead of null. This fixes #70468.
3110
3111 2004-12-29  Duncan Mak  <duncan@ximian.com>
3112
3113         * expression.cs (Argument.Emit): Check that Expr is
3114         IMemoryLocation before casting to it, and report CS1510 otherwise.
3115
3116         This fixes #70402.
3117
3118 2004-12-21  Ben Maurer  <bmaurer@ximian.com>
3119
3120         * statement.cs (Block.ThisVariable): remove the recursion here, to
3121         make the --profile more sane.
3122
3123 2004-12-17  Carlos Cortez <calberto.cortez@gmail.com>
3124
3125         * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
3126         assembly, by JB Evain.
3127
3128 2004-12-17  Raja R Harinath  <rharinath@novell.com>
3129
3130         * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs, 
3131           rootcontext.cs, typemanager.cs: Make nomenclature consistent.
3132         "parent" refers to enclosing type/class.  "base" refers to superclass.
3133
3134 2004-12-17  Raja R Harinath  <rharinath@novell.com>
3135
3136         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
3137         Ensure that we only have GlobalAttributes.
3138         * attribute.cs (Attribute.Emit): Make non-virtual.
3139         (GlobalAttribute.Emit): Remove.
3140         (Attribute.Resolve): Make virtual.
3141         (GlobalAttribute.Resolve): New.  Set Rootcontext.Tree.Types.NamespaceEntry.
3142         (Attribute.GetConditionalAttributeValue): Take an EmitContext as
3143         the argument. Don't create one.
3144         (Attribute.GetObsoleteAttribute): Likewise.
3145         (Attribute.GetClsCompliantAttributeValue): Likewise.
3146         * class.cs, decl.cs: Update to changes.
3147
3148 2004-12-17  Marek Safar  <marek.safar@seznam.cz>
3149
3150         * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
3151         
3152         * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
3153         
3154         * statement.cs (Foreach.Resolve): Add error 186 report.
3155
3156 2004-12-16  Marek Safar  <marek.safar@seznam.cz>
3157
3158         * expression.cs (Conditional.DoResolve): Add warning 429.
3159         
3160         * statement.cs (If.Resolve): Add warning 665.
3161
3162 2004-12-16  Raja R Harinath  <rharinath@novell.com>
3163
3164         New invariant: RootContext.Tree.Types.NamespaceEntry == null
3165         except when in the parser, and in GlobalAttribute.
3166         * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
3167         * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
3168         RootContext.Tree.Types.NamespaceEntry once work is done.
3169         (GlobalAttribute.Emit): New.  Wrapper for Attribute.Emit, but sets
3170         and resets RootContext.Tree.Types.NamespaceEntry.
3171
3172 2004-12-15  Marek Safar  <marek.safar@seznam.cz>
3173
3174         * cs-parser.jay: Don't create a block for every variable.
3175
3176 2004-12-14  Miguel de Icaza  <miguel@ximian.com>
3177
3178         * location.cs: Provide extra information.
3179
3180         * statement.cs: The instance is not `ldarg_0.THIS' when accessing
3181         variables from the captured environment, it is the ldarg_0.
3182
3183 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
3184
3185         * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
3186         find a conclusion.
3187         
3188         * class.cs: Changed warning level for 169 to avoid developer
3189         displeasure from warning flooding. It will be changed back when they
3190         fix most of current BCL warnings.
3191         
3192         * RootContext.cs: Pushed default WarningLevel to 3.
3193         
3194         * statement.cs: Removed unused variable.
3195
3196 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
3197
3198         * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
3199         (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
3200         Add error 502 report.
3201         (StaticClass.DefineType): Add error 441 report.
3202         (Class.AllowedModifiersProp): New virtual property as temporary
3203         extension to AllowedModifiers.
3204         (Class.DefineType): Add error 418 report. Moved ModFlags check here
3205         to share implementation with StaticClass and don't call virtual
3206         methods from ctor.
3207         
3208         * driver.cs (MainDriver): Add error 1558 test.
3209
3210         * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
3211         report. Moved error 36 test here.
3212
3213         * statement.cs (Throw.Resolve): Add error 724 report.
3214
3215         * typemanager.cs: Add out_attribute_type core type.
3216         
3217 2004-12-13  Marek Safar  <marek.safar@seznam.cz>
3218
3219         * class.cs (TypeContainer.VerifyClsCompliance): Add error
3220         3018 report.
3221         (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
3222
3223         * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
3224         3017 report.
3225         
3226         * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
3227
3228         * parameter.cs (ReturnParameter.ApplyAttributeBuilder): 
3229         Add error 3023 report.
3230         (Parameter.ApplyAttributeBuilder): Add error 3022 report.
3231
3232         * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
3233         implementation.
3234
3235 2004-12-12  John Luke  <john.luke@gmail.com>
3236
3237         * driver.cs (AddArgs): take -- into account when
3238         adding arguments, fixes bug 65710 
3239
3240 2004-12-12  Martin Baulig  <martin@ximian.com>
3241
3242         * expression.cs (Unary.TryReduceNegative): Added support for
3243         SByteConstant and ByteConstant.
3244         (Unary.Reduce): Check error values from TryReduceNegative().
3245
3246 2004-12-10  Marek Safar  <marek.safar@seznam.cz>
3247
3248         * attributes.cs (Attribute.Resolve): Avoid multiple error report
3249         and report exception as error 182.
3250
3251 2004-12-10  Raja R Harinath  <rharinath@novell.com>
3252
3253         * driver.cs (Main): Fix message when there are warnings.
3254
3255 2004-12-09  Miguel de Icaza  <miguel@ximian.com>
3256
3257         * delegate.cs: Fixed my fix from yesterday, sorry about that.
3258
3259 2004-12-09  Marek Safar  <marek.safar@seznam.cz>
3260
3261         * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs: 
3262         Reduced number of warnings.
3263         
3264         * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
3265
3266 2004-12-08  Miguel de Icaza  <miguel@ximian.com>
3267
3268         * driver.cs: Removed message.
3269
3270         * delegate.cs: Fix bug introduced in 1.1.x: 70219.
3271
3272 2004-12-08    <vargaz@freemail.hu>
3273
3274         * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
3275
3276 2004-12-08  Martin Baulig  <martin@ximian.com>
3277
3278         * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
3279         instead of a CS3002 for properties and indexer.
3280
3281 2004-12-08  Martin Baulig  <martin@ximian.com>
3282
3283         * decl.cs (MemberName.ToString): Make this work again.
3284
3285 2004-12-08  Marek Safar  <marek.safar@seznam.cz>
3286
3287         * attribute.cs (Resolve): Add error 591 detection.
3288
3289         * class.cs (FieldMember.Define): Add error 1547 detection.
3290         (Indexer.Define): Add error 620 detection.
3291         (Operator.Define): Add error 590 detection.
3292
3293         * ecore.cs: Missing argument for error 79.
3294
3295         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
3296         detection.
3297
3298 2004-12-07  Marek Safar  <marek.safar@seznam.cz>
3299
3300         Fix #70106
3301         * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
3302         only.
3303
3304 2004-12-07  Atsushi Enomoto  <atsushi@ximian.com>
3305
3306         * cs-parser.jay : handle doc comments on implicit/explicit operators.
3307           Some operator comments were suppressed.
3308         * doc.cs : Implicit/explicit operator name in doc comments are like
3309           "op_Explicit(type)~returnType", so added suffix handling.
3310
3311 2005-01-21  Alp Toker  <alp@atoker.com>
3312
3313         * cs-parser.jay: destructor_declaration's container is PartialContainer
3314         not Class when partial types are used, so use Kind prop instead of 'is'.
3315
3316 2004-12-12  Martin Baulig  <martin@ximian.com>
3317
3318         * expression.cs (Unary.TryReduceNegative): Added support for
3319         SByteConstant and ByteConstant.
3320         (Unary.Reduce): Check error values from TryReduceNegative().
3321
3322 2004-12-11  Martin Baulig  <martin@ximian.com>
3323
3324         * support.cs (ReflectionParameters.ParameterName): If we have a
3325         `gpd', call `ParameterName' on it.
3326
3327         * parameter.cs (Parameter.GetParameterAttributes): New static method.
3328
3329         * pending.cs (PendingImplementation.DefineProxy): Call
3330         DefineParameter() for all of the MethodBuilder's arguments.
3331
3332 2004-12-09  Martin Baulig  <martin@ximian.com>
3333
3334         * doc.cs (DocUtil): Make this a static class.
3335
3336 2004-12-09  Martin Baulig  <martin@ximian.com>
3337
3338         * expression.cs (Invocation.InferType): Moved the type inference
3339         implementation into TypeManager.
3340
3341         * generics.cs (TypeManager): Moved the type inference
3342         implementation here.
3343
3344 2004-12-09  Martin Baulig  <martin@ximian.com>
3345
3346         * typemanager.cs (TypeManager): Make this a partial class.
3347
3348         * generics.cs
3349         (TypeManager): Move the generics part of `TypeManager' here.
3350
3351 2004-12-08  Martin Baulig  <martin@ximian.com>
3352
3353         * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
3354         instead of a CS3002 for properties and indexer.  Added CS3024
3355         check for generic interfaces.
3356
3357         * attributes.cs (AttributeTester.AnalyzeTypeCompliance): Generic
3358         instances are not CLS-compliant.
3359
3360 2004-12-08  Martin Baulig  <martin@ximian.com>
3361
3362         * cs-parser.jay
3363         (void_pointer_expression): New rule for `void*', `void**' etc.
3364         (typeof_expression): Add `void_pointer_expression'; fixes #66846.       
3365
3366 2004-12-08  Martin Baulig  <martin@ximian.com>
3367
3368         * expression.cs (Invocation.InferType): Removed the hack for
3369         MethodCore.MayUnify().  
3370
3371         * typemanager.cs (TypeManager.MayBecomeEqualGenericTypes): Make
3372         this actually work.
3373
3374         * class.cs (MethodCore.MayUnify): Use
3375         TypeManager.MayBecomeEqualGenericTypes().       
3376
3377 2004-12-08  Martin Baulig  <martin@ximian.com>
3378
3379         * expression.cs (Is.DoResolve, As.DoResolve): If we're a type
3380         parameter, box it.  Fixes #69233.
3381
3382 2004-12-08  Martin Baulig  <martin@ximian.com>
3383
3384         * generic.cs (ConstructedType.CheckConstraints): Valuetypes always
3385         have the ctor constraint.  Fixes #68326.
3386
3387 2004-12-07  Atsushi Enomoto  <atsushi@ximian.com>
3388
3389         * cs-parser.jay : interface comment was not consumed because of
3390           extra opt_semicolon before doc handling.
3391
3392 2004-12-03  Raja R Harinath  <rharinath@novell.com>
3393
3394         Fix test-327.cs, test-328.cs, and put in early infrastructure
3395         for eventually fixing #52697.
3396         * namespace.cs (NamespaceEntry.LookupForUsing): New method.
3397         (NamespaceEntry.LookupNamespaceOrType): New method, refactored
3398         from other methods.
3399         (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
3400         (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
3401         (VerifyUsing, error246): Update.
3402         * rootcontext.cs (RootContext.NamespaceLookup): Just use
3403         'NamespaceEntry.LookupNamespaceOrType'.
3404
3405 2004-12-07  Martin Baulig  <martin@ximian.com>
3406
3407         * driver.cs: Call it "BETA SOFTWARE" :-)
3408
3409 2004-12-06  Raja R Harinath  <rharinath@novell.com>
3410
3411         Fix crash on cs0657-17.cs.
3412         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
3413         Use RootContext.Tree.Types, not 'new RootTypes ()'.
3414         * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
3415         the case where the NamespaceEntry gets overwritten.
3416
3417 2004-12-06  Marek Safar  <marek.safar@seznam.cz>
3418
3419         Fixed #69195, #56821
3420         * ecore.cs (ResolveBoolean): Tiny refactoring.
3421
3422         * expression.cs (Binary.DoResolve): Add warning 429 and skipping
3423         of right expression resolving when left is false constant and
3424         operator is LogicalAnd OR true constant and operator is LogicalOr.
3425
3426         * statement.cs (ResolveUnreachable): Always reports warning.
3427
3428 2004-12-05  Miguel de Icaza  <miguel@ximian.com>
3429
3430         * class.cs: Distinguish between 1721 and 1722 (just a little help
3431         for the programmer).
3432
3433 2004-12-03  Miguel de Icaza  <miguel@ximian.com>
3434
3435         * delegate.cs: Only allow this on new versions of the language. 
3436
3437 2004-12-02  Duncan Mak  <duncan@ximian.com>
3438
3439         * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
3440         Expression class.
3441         (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
3442         here as a static method. Take an additional bool out parameter
3443         `must_do_cs1540_check' for signaling to InstanceResolve.
3444         (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
3445         member field from PropertyExpr class and made it an argument of
3446         the method instead.
3447         (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
3448         check for MarshalByRefObject, and report CS0122 instead of CS1540.
3449         (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
3450         and `remove_accessor' as well as InstanceResolve: report CS0122
3451         where applicable.
3452
3453         Fixes #70129.
3454
3455 2004-12-07  Martin Baulig  <martin@ximian.com>
3456
3457         * decl.cs (DeclSpace.AddToContainer): Report correct errors CS0694
3458         and CS0692 where appropriate.
3459
3460 2004-12-06  Martin Baulig  <martin@ximian.com>
3461
3462         * class.cs (MethodCore.MayUnify): Moved the CS0408 check here from
3463         IsDuplicateImplementation() and improved it.
3464
3465         * expression.cs (Invocation.InferTypeArguments): Added
3466         `Type[] inferred_class_types' argument (for MethodCore.MayUnify)
3467         and removed the "ref" modifier from `infered_types'.
3468
3469         * decl.cs (MemberName.ToString): Removed the exception.
3470
3471 2004-12-03  Atsushi Enomoto  <atsushi@ximian.com>
3472
3473         * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
3474           comments are allowed.
3475
3476 2004-12-03  Carlos Alberto Cortez <calberto.cortez@gmail.com>
3477
3478         * delegate.cs: Add checks for subtypes in paramaters and return values
3479         in VerifyMethod () to add support for Covariance/Contravariance
3480         in delegates.
3481         
3482 2004-12-02  Miguel de Icaza  <miguel@ximian.com>
3483
3484         * report.cs: Remove extra closing parenthesis.
3485
3486         * convert.cs (Error_CannotImplicitConversion): If the name of the
3487         types are the same, provide some extra information.
3488
3489 2004-12-02  Marek Safar  <marek.safar@seznam.cz>
3490
3491         Fix bug #70102
3492         * attribute.cs (Resolve): Improved implementation of params
3493         attribute arguments.
3494
3495         * support.cs (ParameterData): Add HasParams to be faster.
3496
3497 2004-12-02  Atsushi Enomoto  <atsushi@ximian.com>
3498
3499         all things are for /doc support:
3500
3501         * doc.cs: new file that supports XML documentation generation.
3502         * mcs.exe.sources: added doc.cs.
3503         * driver.cs:
3504           Handle /doc command line option.
3505           Report error 2006 instead of 5 for missing file name for /doc.
3506           Generate XML documentation when required, after type resolution.
3507         * cs-tokenizer.cs:
3508           Added support for picking up documentation (/// and /** ... */),
3509           including a new XmlCommentState enumeration.
3510         * cs-parser.jay:
3511           Added lines to fill Documentation element for field, constant,
3512           property, indexer, method, constructor, destructor, operator, event
3513           and class, struct, interface, delegate, enum.
3514           Added lines to warn incorrect comment.
3515         * rootcontext.cs :
3516           Added Documentation field (passed only when /doc was specified).
3517         * decl.cs:
3518           Added DocComment, DocCommentHeader, GenerateDocComment() and
3519           OnGenerateDocComment() and some supporting private members for
3520           /doc feature to MemberCore.
3521         * class.cs:
3522           Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
3523         * delegate.cs:
3524           Added overriden DocCommentHeader.
3525         * enum.cs:
3526           Added overriden DocCommentHeader and GenerateDocComment().
3527
3528 2004-12-01  Miguel de Icaza  <miguel@ximian.com>
3529
3530         * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
3531         unwrapping the enumeration values, chain to
3532         DoConstantNumericPromotions again, so we can promote things to the
3533         fundamental types (takes care of enums that are bytes, sbytes).
3534
3535         Fixes bug #62054.
3536
3537 2004-12-01  Raja R Harinath  <rharinath@novell.com>
3538
3539         * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
3540         Fix long-standing bug in type-lookup.  Use FindType instead of
3541         LookupType when ec.ResolvingTypeTree.
3542         (Attribute.ResolveType, Attribute.Resolve)
3543         (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
3544         Update to changes.
3545         (Attributes.Search): Remove internal version.  Update.
3546         (Attributes.SearchMulti): Update.
3547         (Attributes.GetClsCompliantAttribute): Remove.
3548         (Attributes.GetIndexerNameAttribute): Remove.
3549         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
3550         (DeclSpace.GetClsCompliantAttributeValue): Likewise.
3551         * class.cs (Indexer.Define): Likewise.
3552
3553 2004-12-01  Marek Safar  <marek.safar@seznam.cz>
3554
3555         Fix bug #68790
3556         * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
3557         MarshallByReference members access.
3558
3559         * expression.cs: Use CheckMarshallByRefAccess;
3560         Better error CS0197 message.
3561
3562         * report.cs: Print whole related error message.
3563
3564 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
3565
3566         * class (GetClassBases): Better error 60 report.
3567         (EventProperty): Disabled warning 67 detection.
3568
3569 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
3570
3571         Fix bug #60324
3572         * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
3573
3574         * constant.cs (DecimalConstant.Emit): Don't use int ctor for
3575         precise values.
3576
3577 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
3578
3579         Fix bug #49488
3580         * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
3581
3582         * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
3583
3584 2004-11-26  Miguel de Icaza  <miguel@ximian.com>
3585
3586         * attribute.cs (Attribute.Resolve): Refine error reporting and
3587         report a cs0117 if the identifier does not exist, to distinguish
3588         from 0617 which is a miss-use of the actual identifier.
3589
3590         * ecore.cs (EventExpr.Emit): Refine error report and distinguish
3591         between cs0070 and cs0079.
3592
3593         * class.cs (MemberBase.DoDefine): When reporting a wrong
3594         accessibility level, we use MethodCore to compare instead of
3595         Method (this was a regression in some refactoring effort).
3596
3597         So now we correctly report cs0056 again.
3598
3599         * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
3600         testing the target_type (which was known to be object_type) and
3601         not the source type (which is anonymous_method).
3602
3603         Fixed reporting of error cs1660.
3604
3605         * expression.cs (UserCast.Source): Expose the underlying cast.
3606
3607         * statement.cs (Switch.SwitchGoverningType): Sort the list of
3608         allowed types to find a match to int32 first (most common).
3609
3610         In addition, it ignores any ImplicitUserConversions that did an
3611         internal implicit conversion (as the switch statement allows only
3612         one integral conversion to exist).
3613
3614         * class.cs (PartialContainer.Create): rename `name' to
3615         `member_name' for clarity.  Then replace the string calls with a
3616         call to MemberName.GetPartialName, as now using
3617         MemberName.ToString is an error (this is due to the side effects
3618         it had, that were fixed in the past).
3619
3620         This will restore the error reporting on a number of partial class
3621         errors that were missusing this (and getting an exception as a
3622         results, which is now just a plain textual warning, because
3623         yyparse debug output would crash otherwise).
3624
3625 2004-11-26  Raja R Harinath  <rharinath@novell.com>
3626
3627         * Makefile (PROGRAM_INSTALL_DIR): Remove.
3628
3629 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
3630
3631         * rootcontext.cs (LookupType): Make sure to cache lookups that
3632         don't give us a negative result. This saves about 5% of corlib
3633         compilation time.
3634
3635 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
3636
3637         * report.cs (AbstractMessage.Print): messages are sent to stderr
3638
3639         * class.cs (TypeContainer.GetClassBases): It is an error to have a
3640         non-interface in the list of interfaces (at this point, either
3641         parent was properly set, or a base class is being listed in the
3642         interfaces section).
3643
3644         This flags error 1722, and resolves the crash from bug 69259.
3645
3646 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
3647
3648         * statement.cs (Using.EmitExpressionFinally): make this work right
3649         for valuetypes. Fixes 69926.
3650
3651 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
3652
3653         * const.cs (Const.ChangeType): Cope with the "0 literal can be
3654         converted to an enum" here, before we try to change the underlying
3655         type.  This code exists, but it is a different code path than the
3656         one used while encoding constants.
3657
3658         (ImplicitReferenceConversionExists): In addition, resynchronized
3659         the code here, so it matches the same code in
3660         ImplicitReferenceConversionExists for the `from any class-type S
3661         to any interface-type T'.       
3662
3663 2004-11-25  Marek Safar  <marek.safar@seznam.cz>
3664
3665         * cfold.cs (BinaryFold): Add addition for DecimalConstant.
3666
3667 2004-11-24  Miguel de Icaza  <miguel@ximian.com>
3668
3669         * cs-parser.jay: Use verbosity accordingly. 
3670
3671 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
3672
3673         * expression.cs (Unary.ResolveOperator): Do not report warning;
3674         AddressOf reads from variable.
3675         
3676         (LocalVariableReferences.DoResolveBase): Improved my previous fix.
3677
3678 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
3679
3680         Fix bug #69462
3681
3682         * attribute.cs (Attributable): Removed CheckTargets.
3683         (Attributes.Emit): Explicit attribute targets are tested here.
3684
3685         * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
3686         not enabled for interfaces.
3687
3688         * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
3689         (GetAssemblyName): Ouch next bug there.
3690
3691 2004-11-23  Carlos Alberto Cortez <calberto.cortez@gmail.com>
3692
3693         * expression.cs: Error 275 added.
3694         
3695 2004-11-23  Marek Safar  <marek.safar@seznam.cz>
3696
3697         Fix bug #69177 (Implemented decimal constant support)
3698
3699         * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
3700         (BinaryFold): Add DecimalConstant.
3701
3702         * const.cs (Define): Decimal constant 
3703         (is not constant.
3704         (ChangeType): Add decimal type handling.
3705         (LookupConstantValue): Don't set value for decimal type but
3706         emit DecimalConstantAttribute. Needed for constant optimization.
3707
3708         * constant.cs (ToDecimal): New method.
3709         (ConvertToDecimal): New method.
3710         (IntConstant): Implemented ConvertToDecimal.
3711         (DecimalConstant.Emit): Emit optimized version for decimals in
3712         int range.
3713
3714         * expression.cs (ResolveOperator): Changed order of constant
3715         reduction to work correctly with native types which have
3716         overloaded operators.
3717         (ResolveMemberAccess): Extract constant value from attribute
3718         for decimal type.
3719
3720         * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
3721
3722         * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
3723         void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
3724         (ChangeType): Decimal is special.
3725         (TypeToCoreType): Add decimal type.
3726
3727 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
3728
3729         * convert.cs (ImplicitConversionRequired): Add error cs0642 for
3730         decimal types.
3731
3732 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
3733
3734         * class.cs (EventField.ApplyAttributeBuilder): Fix error
3735         test cs1667-5.cs.
3736
3737 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
3738
3739         * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
3740
3741         * pending.cs (PendingImplementation): Grab only interfaces.
3742
3743 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
3744
3745         * statement.cs (ForeachHelperMethods): Add location member and
3746         error 202 detection.
3747
3748 2004-11-18  Marek Safar  <marek.safar@seznam.cz>
3749
3750         * expression.cs (DoResolveBase): Fixed wrong warning for out
3751         variables.
3752
3753 2004-12-04  Martin Baulig  <martin@ximian.com>
3754
3755         * convert.cs (Convert.TypeParameter_to_Null): Use the constraints
3756         to check whether the conversion is ok.
3757
3758         * typemanager.cs (TypeManager.GetTypeArguments): Just return
3759         `Type.EmptyTypes' if we're not a generic TypeContainer.
3760
3761 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
3762
3763         * convert.cs (ImplicitReferenceConversionExists): A surprisingly
3764         old bug: when converting from the null literal to a pointer,
3765         return an EmptyCast, not the NullLiteral.
3766
3767         This fixes #69921, the recent null_type changes probably made this
3768         bug more prominent.
3769
3770 2004-12-03  Martin Baulig  <martin@ximian.com>
3771
3772         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
3773         method as our child, call AnonymousMethod.Compatible() on it.
3774
3775 2004-12-02  Miguel de Icaza  <miguel@ximian.com>
3776
3777         * class.cs (FieldBase): Use an unused bit field from the field to
3778         encode the `has_offset' property from the FieldMember.  This saves
3779         a couple of Ks on bootstrap compilation.
3780
3781         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
3782         method as our child, return the AnonymousMethod resolved
3783         expression.
3784
3785         * expression.cs (New.DoResolve): Allow return values from
3786         NewDelegate to also include AnonymousMethods.
3787
3788         Fixes #70150.
3789
3790 2004-11-29  Raja R Harinath  <rharinath@novell.com>
3791
3792         * decl.cs (MemberCore.MemberName): Remove readonly to fix an error
3793         cs1648 report.
3794         * rootcontext.cs (ResolveCore::interfaces_first_stage): Add
3795         System.Runtime.InteropServices._Exception, since it's a base
3796         interface of the core type System.Exception in the net_2_0 profile.
3797
3798 2004-11-27  Martin Baulig  <martin@ximian.com>
3799
3800         * ecore.cs (Expression.StoreFromPtr): Use `stobj' for generic parameters.
3801
3802 2004-11-26  Raja R Harinath  <rharinath@novell.com>
3803
3804         * Makefile: Convert to use executable.make.
3805         * gmcs.exe.sources: New.
3806
3807 2004-11-25  Martin Baulig  <martin@ximian.com>
3808
3809         * expression.cs (Invocation.InferType): Added support for byref types.
3810
3811 2004-11-25  Martin Baulig  <martin@ximian.com>
3812
3813         * statement.cs (Foreach.FetchMethodMoveNext): Wrap `mi.ReturnType'
3814         in TypeManager.TypeToCoreType().
3815
3816 2004-11-25  Martin Baulig  <martin@ximian.com>
3817
3818         * iterators.cs (Iterator.DoDefineMembers): Override and lookup the
3819         "Dispose" method from the `current_type'.
3820         (Iterator.EmitMoveNext): Use the `dispose_method' we looked up in
3821         DoDefineMembers() instead of using the MethodBuilder; this is
3822         required for generic iterators.
3823
3824         * class.cs (TypeContainer.DoDefineMembers): Make this virtual.
3825
3826 2004-11-24  Martin Baulig  <martin@ximian.com>
3827
3828         * ecore.cs (Expression.LoadFromPtr): Use `ldobj' for generic parameters.
3829
3830 2004-11-20  Martin Baulig  <martin@ximian.com>
3831
3832         * expression.cs (Invocation.InferType): Correctly infer generic
3833         instances; see gen-103.cs.
3834         (Invocation.InferTypeArguments): If a generic method doesn't have
3835         any unbound type parameters, we don't need to infer anything.
3836
3837 2004-11-19  Raja R Harinath  <rharinath@novell.com>
3838
3839         * Makefile (gmcs.exe): Update to new location of bootstrap mcs.exe.
3840
3841 2004-11-17  Raja R Harinath  <rharinath@novell.com>
3842
3843         * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
3844         (TypeHandle.GetMemberCache): New.
3845         (TypeHandle.TypeHandle): Update.
3846         (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
3847         (TypeManager.LookupParentInterfacesCache):
3848         Rename from LookupInterfaceCache.  Optimize slightly.
3849         (TypeManager.MemberLookup_FindMembers): Update.
3850         * decl.cs (MemberCache.MemberCache): Set Container to null in the
3851         multi-type variant.
3852         (AddCacheContents): Rename from AddHashtable.
3853         * class.cs (TypeContainer.parent_container): Remove.
3854         (TypeContainer.VerifyClsCompliance): Don't use parent_container.
3855         (TypeContainer.DoDefineMembers): Don't initialize it.
3856         Update to name changes.
3857         
3858 2004-11-17  Miguel de Icaza  <miguel@ximian.com>
3859
3860         * class.cs (MethodCore.CheckAccessModifiers): New helper routine
3861         that factors the code to check access modifiers on override.  
3862
3863         (PropertyBase): Use the code here.
3864
3865         Patch from Lluis S'anchez, fixes bug #69361.
3866
3867 2004-11-15  Miguel de Icaza  <miguel@ximian.com>
3868
3869         * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
3870         routine that is used to report the use of a captured variable
3871         whose address has been taken.
3872
3873         There are two checks: one when variables are being captured and
3874         the other check is when the address of a variable is taken. 
3875         
3876         (because an anonymous methods might be resolved before *or* after
3877         the address has been taken) and 
3878
3879         * expression.cs (Conditional.DoResolve): Remove the special
3880         casing that Martin added to trueExpr and falseExpr being both
3881         NullLiteral.  We get the right behavior now just by introducing
3882         the null_type into the compiler. 
3883
3884         * convert.cs (ExplicitConversion): Change the code to use
3885         null_type instead of testing `expr is NullLiteral'.
3886         (ImplicitConversionStandard): use null_type too.
3887         (ImplicitReferenceConversionExists): use null_type too.
3888         (ImplicitReferenceConversion): use null_type too.
3889
3890         * literal.cs: The type of `NullLiteral' is now null_type instead
3891         of object_type. 
3892         (Resolve): Set the type here.
3893
3894         * typemanager.cs: Introduce null_type.
3895
3896 2004-11-18  Martin Baulig  <martin@ximian.com>
3897
3898         * rootcontext.cs
3899         (RootContext.LookupType): Return a `Type', not a `TypeExpr'.
3900
3901 2004-11-18  Martin Baulig  <martin@ximian.com>
3902
3903         * ecore.cs (TypeExpr.DoResolveAsTypeStep): Make this protected.
3904
3905 2004-11-18  Martin Baulig  <martin@ximian.com>
3906
3907         * generic.cs (Constraints.Resolve): Take an `EmitContext' instead
3908         of a `DeclSpace'.  If one of our constraints is a `ConstructedType',
3909         call ResolveConstructedType() on it to resolve it without checking
3910         constraints.
3911         (Constraints.ResolveTypes): Check them here.
3912         (ConstructedType.DoResolveAsTypeStep): Fully resolve ourselves,
3913         but don't check constraints.
3914         (ConstructedType.ResolveAsTypeTerminal): Override this and also
3915         check constraints here.
3916         (ConstructedType.ResolveConstructedType): New public method.  This
3917         is called from DoResolveAsTypeStep() and Constraints.Resolve() to
3918         resolve ourselves without checking constraints.
3919
3920         * ecore.cs (Expression.ResolveAsTypeTerminal): Make this virtual.
3921
3922 2004-11-18  Martin Baulig  <martin@ximian.com>
3923
3924         * decl.cs
3925         (DeclSpace.CurrentType): Changed type from `TypeExpr' to `Type'.
3926
3927         * delegate.cs (Delegate.DefineType): Always create the EmitContext.
3928
3929 2004-11-18  Martin Baulig  <martin@ximian.com>
3930
3931         * ecore.cs (TypeExpr.ResolveType): Removed.
3932         (Expression.ResolveAsTypeTerminal): We always return a fully
3933         resolved `TypeExpr', so we can just access its `Type'.
3934
3935         * class.cs (TypeContainer.DefineType): Resolve `CurrentType' here.
3936
3937 2004-11-17  Martin Baulig  <martin@ximian.com>
3938
3939         * ecore.cs (IAlias.Type): Replaced with ResolveAsType() to make
3940         sure we don't return any unresolved TypeExpr's.
3941         (TypeAliasExpression): The .ctor now takes an `IAlias' instead of
3942         a `TypeExpr'.
3943         (Expression.ResolveAsTypeTerminal): Make sure `te.Type != null'.
3944
3945         * expression.cs (MemberAccess.ResolveAsTypeStep): Don't return any
3946         unresolved `ConstructedType's.
3947
3948 2004-11-17  Martin Baulig  <martin@ximian.com>
3949
3950         * ecore.cs (TypeExpr.ResolveType): Don't make this virtual.
3951
3952 2004-11-17  Martin Baulig  <martin@ximian.com>
3953
3954         * ecore.cs
3955         (Expression.ResolveAsTypeTerminal): Removed the `bool silent' argument.
3956
3957         * decl.cs (DeclSpace.ResolveType): Removed.
3958         (DeclSpace.ResolveTypeExpr): Removed the `bool silent' argument.
3959
3960 2004-11-17  Martin Baulig  <martin@ximian.com>
3961
3962         * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
3963         direction, like FindMembers() does.  Fixes #69546, testcase is in
3964         test-315.cs.    
3965
3966 2004-11-16  Martin Baulig  <martin@ximian.com>
3967
3968         This is based on a patch from Marek Safar, see bug #69082.
3969         Fixes bugs #63705 and #67130.
3970
3971         * typemanager.cs (TypeManager.LookupInterfaceCache): New public
3972         method; create a MemberCache for an interface type and cache the
3973         result.
3974
3975         * decl.cs (IMemberContainer.ParentContainer): Removed.
3976         (IMemberContainer.ParentCache): New property.
3977         (MemberCache.SetupCacheForInterface): Removed.
3978         (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
3979         to create a cache for an interface's "parent".
3980
3981         * class.cs (TypeContainer.DoDefineMembers): Setup cache for
3982         interfaces too.
3983
3984 2004-11-14  Ben Maurer  <bmaurer@ximian.com>
3985
3986         * statement.cs: Avoid adding bools to a hashtable.
3987
3988 2004-11-15  Martin Baulig  <martin@ximian.com>
3989
3990         * decl.cs (MemberName.GetPartialName): Removed, use GetTypeName() instead.
3991
3992 2004-11-11  Martin Baulig  <martin@ximian.com>
3993
3994         * typemanager.cs (TypeManager.GetMethodName): New method.
3995
3996         * class.cs (MethodData.Define): Include the generic arity in the
3997         name of an explicit interface; also add it to the method name.
3998
3999         * pending.cs (PendingImplementation.InterfaceMethod): The method
4000         name now includes the generic arity.
4001
4002 2004-11-07  Miguel de Icaza  <miguel@ximian.com>
4003
4004         * expression.cs (Invocation.OverloadResolve): Flag error if we are
4005         calling an unsafe method from a safe location.
4006
4007 2004-11-06  Marek Safar  <marek.safar@seznam.cz>
4008
4009         Fix #69167
4010         * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
4011
4012 2004-11-06  Miguel de Icaza  <miguel@ximian.com>
4013
4014         * namespace.cs (VerifyUsing): use GetPartialName instead of
4015         ToString. 
4016
4017 2004-11-05  Miguel de Icaza  <miguel@ximian.com>
4018
4019         * statement.cs (Return.Resolve): Fix regression in typo: if
4020         `in_exc', we have to request a NeedReturnLabel, this was a typo
4021         introduced in the anonymous method check-in.  Fixes #69131.
4022
4023         * Indexers were using the ShortName when defining themselves,
4024         causing a regression in the compiler bootstrap when applying the
4025         patch from 2004-11-02 (first part), now they use their full name
4026         and the bug is gone.
4027
4028 2004-11-04  Zoltan Varga  <vargaz@freemail.hu>
4029
4030         * driver.cs: Strip the path from the names of embedded resources. Fixes
4031         #68519.
4032
4033 2004-11-04  Raja R Harinath  <rharinath@novell.com>
4034
4035         Fix error message regression: cs0104-2.cs.
4036         * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
4037         (AliasEntry.Resolve): Update.
4038         * rootcontext.cs (RootContext.NamespaceLookup): Update.  Remove
4039         'silent' flag.
4040         (RootContext.LookupType): Update.
4041
4042 2004-11-03  Carlos Alberto Cortez <carlos@unixmexico.org>
4043
4044         * cs-parser.jay: Add support for handling accessor modifiers
4045         * class: Add support port accessor modifiers and error checking,
4046         define PropertyMethod.Define as virtual (not abstract anymore)
4047         * ecore.cs: Add checking for proeprties access with access modifiers
4048         * iterators.cs: Modify Accessor constructor call based in the modified
4049         constructor
4050 2004-11-02  Ben Maurer  <bmaurer@ximian.com>
4051
4052         * expression.cs (StringConcat): Handle being called twice,
4053         as when we have a concat in a field init with more than two
4054         ctors in the class
4055
4056 2004-11-02  Miguel de Icaza  <miguel@ximian.com>
4057
4058         * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
4059         special case explicit implementations, we should always produce
4060         the .property or .event declaration.
4061         
4062         * decl.cs (MemberName): Renamed GetFullName to GetPartialName
4063         since it will not return correct data if people use this
4064         unresolved in the presence of using statements (see test-313).
4065
4066         * class.cs (MethodData.Define): If we are an explicit interface
4067         implementation, set the method name to the full name of the
4068         interface plus the name of the method.  
4069
4070         Notice that using the method.MethodName.GetFullName() does not
4071         work, as it will only contain the name as declared on the source
4072         file (it can be a shorthand in the presence of using statements)
4073         and not the fully qualifed type name, for example:
4074
4075         using System;
4076
4077         class D : ICloneable {
4078                 object ICloneable.Clone ()  {
4079                 }
4080         }
4081
4082         Would produce a method called `ICloneable.Clone' instead of
4083         `System.ICloneable.Clone'.
4084
4085         * namespace.cs (Alias.Resolve): Use GetPartialName.
4086         
4087 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
4088
4089         * cs-parser.jay: Add error 1055 report.
4090
4091 2004-11-01  Miguel de Icaza  <miguel@ximian.com>
4092
4093         * assign.cs (Assign.DoResolve): Only do the transform of
4094         assignment into a New if the types are compatible, if not, fall
4095         through and let the implicit code deal with the errors and with
4096         the necessary conversions. 
4097
4098 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
4099
4100         * cs-parser.jay: Add error 1031 report.
4101
4102         * cs-tokenizer.cs: Add location for error 1038.
4103
4104 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
4105
4106         * cs-parser.jay: Add error 1016 report.
4107
4108 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
4109
4110         * cs-parser.jay: Add errors 1575,1611 report.
4111
4112 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
4113
4114         * cs-parser.jay: Add error 1001 report.
4115
4116 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
4117
4118         Fix #68850
4119         * attribute.cs (GetMarshal): Add method argument for
4120         caller identification.
4121
4122         * class.cs, codegen.cs, enum.cs, parameter.cs: Added
4123         agument for GetMarshal and RuntimeMissingSupport.
4124
4125 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
4126
4127         * attribute.cs (ExtractSecurityPermissionSet): Removed
4128         TypeManager.code_access_permission_type.
4129
4130         * typemanager.cs: Removed TypeManager.code_access_permission_type.
4131
4132 2004-10-27  Miguel de Icaza  <miguel@ximian.com>
4133
4134         * expression.cs (LocalVariableReference.DoResolveLValue): Check
4135         for obsolete use of a variable here.   Fixes regression on errors
4136         cs0619-25 and cs0619-26.
4137
4138 2004-10-27  Marek Safar  <marek.safar@seznam.cz>
4139
4140         Fix #62358, implemented security attribute encoding.
4141
4142         * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
4143         Tests permitted SecurityAction for assembly or other types.
4144         (Assembly.ExtractSecurityPermissionSet): New method. Transforms
4145         data from SecurityPermissionAttribute to PermisionSet class.
4146
4147         * class.cs (ApplyAttributeBuilder): Added special handling
4148         for System.Security.Permissions.SecurityAttribute based types.
4149
4150         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
4151         special handling for System.Security.Permissions.SecurityAttribute
4152         based types.
4153
4154         * enum.cs (ApplyAttributeBuilder): Added special handling
4155         for System.Security.Permissions.SecurityAttribute based types.
4156
4157         * parameter.cs (ApplyAttributeBuilder): Added special handling
4158         for System.Security.Permissions.SecurityAttribute based types.
4159
4160         * rootcontext.cs: Next 2 core types.
4161
4162         * typemanager.cs (TypeManager.security_permission_attr_type):
4163         Built in type for the SecurityPermission Attribute.
4164         (code_access_permission_type): Build in type.
4165
4166 2004-10-17  Miguel de Icaza  <miguel@ximian.com>
4167
4168         * expression.cs (LocalVariableReference.DoResolveBase, Emit):
4169         Remove the tests for `ec.RemapToProxy' from here, and encapsulate
4170         all of this information into
4171         EmitContext.EmitCapturedVariableInstance.
4172         
4173         * codegen.cs (EmitCapturedVariableInstance): move here the
4174         funcionality of emitting an ldarg.0 in the presence of a
4175         remapping.   This centralizes the instance emit code.
4176
4177         (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
4178         then emit a load of this: it means that we have reached the
4179         topmost ScopeInfo: the one that contains the pointer to the
4180         instance of the class hosting the anonymous method.
4181
4182         * anonymous.cs (AddField, HaveCapturedFields): Propagate field
4183         captures to the topmost CaptureContext.
4184
4185 2004-10-12  Miguel de Icaza  <miguel@ximian.com>
4186
4187         * expression.cs (LocalVariableReference): Move the knowledge about
4188         the iterators into codegen's EmitCapturedVariableInstance.
4189
4190 2004-10-11  Miguel de Icaza  <miguel@ximian.com>
4191
4192         * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
4193         all code paths return a value from an anonymous method (it is the
4194         same as the 161 error, but for anonymous methods).
4195
4196 2004-10-08  Miguel de Icaza  <miguel@ximian.com>
4197
4198         The introduction of anonymous methods in the compiler changed
4199         various ways of doing things in the compiler.  The most
4200         significant one is the hard split between the resolution phase
4201         and the emission phases of the compiler.
4202
4203         For instance, routines that referenced local variables no
4204         longer can safely create temporary variables during the
4205         resolution phase: they must do so from the emission phase,
4206         since the variable might have been "captured", hence access to
4207         it can not be done with the local-variable operations from the runtime.
4208         
4209         * statement.cs 
4210
4211         (Block.Flags): New flag `IsTopLevel' to indicate that this block
4212         is a toplevel block.
4213
4214         (ToplevelBlock): A new kind of Block, these are the blocks that
4215         are created by the parser for all toplevel method bodies.  These
4216         include methods, accessors and anonymous methods.
4217
4218         These contain some extra information not found in regular blocks:
4219         A pointer to an optional CaptureContext (for tracking captured
4220         local variables and parameters).  A pointer to the parent
4221         ToplevelBlock.
4222         
4223         (Return.Resolve): Catch missmatches when returning a value from an
4224         anonymous method (error 1662).
4225         Invoke NeedReturnLabel from the Resolve phase instead of the emit
4226         phase.
4227
4228         (Break.Resolve): ditto.
4229
4230         (SwitchLabel): instead of defining the labels during the
4231         resolution phase, we now turned the public ILLabel and ILLabelCode
4232         labels into methods called GetILLabelCode() and GetILLabel() that
4233         only define the label during the Emit phase.
4234
4235         (GotoCase): Track the SwitchLabel instead of the computed label
4236         (its contained therein).  Emit the code by using
4237         SwitchLabel.GetILLabelCode ().
4238
4239         (LocalInfo.Flags.Captured): A new flag has been introduce to track
4240         whether the Local has been captured or not.
4241
4242         (LocalInfo.IsCaptured): New property, used to tell whether the
4243         local has been captured.
4244         
4245         * anonymous.cs: Vastly updated to contain the anonymous method
4246         support.
4247
4248         The main classes here are: CaptureContext which tracks any
4249         captured information for a toplevel block and ScopeInfo used to
4250         track the activation frames for various local variables.   
4251
4252         Each toplevel block has an optional capture context associated
4253         with it.  When a method contains an anonymous method both the
4254         toplevel method and the anonymous method will create a capture
4255         context.   When variables or parameters are captured, they are
4256         recorded on the CaptureContext that owns them, for example:
4257
4258         void Demo () {
4259              int a;
4260              MyDelegate d = delegate {
4261                  a = 1;
4262              }
4263         }
4264
4265         Here `a' will be recorded as captured on the toplevel
4266         CapturedContext, the inner captured context will not have anything
4267         (it will only have data if local variables or parameters from it
4268         are captured in a nested anonymous method.
4269
4270         The ScopeInfo is used to track the activation frames for local
4271         variables, for example:
4272
4273         for (int i = 0; i < 10; i++)
4274                 for (int j = 0; j < 10; j++){
4275                    MyDelegate d = delegate {
4276                         call (i, j);
4277                    }
4278                 }
4279
4280         At runtime this captures a single captured variable `i', but it
4281         captures 10 different versions of the variable `j'.  The variable
4282         `i' will be recorded on the toplevel ScopeInfo, while `j' will be
4283         recorded on a child.  
4284
4285         The toplevel ScopeInfo will also track information like the `this'
4286         pointer if instance variables were referenced (this is necessary
4287         as the anonymous method lives inside a nested class in the host
4288         type of the method). 
4289
4290         (AnonymousMethod): Expanded to track the Toplevel, implement
4291         `AnonymousMethod.Compatible' to tell whether an anonymous method
4292         can be converted to a target delegate type. 
4293
4294         The routine now also produces the anonymous method content
4295
4296         (AnonymousDelegate): A helper class that derives from
4297         DelegateCreation, this is used to generate the code necessary to
4298         produce the delegate for the anonymous method that was created. 
4299
4300         * assign.cs: API adjustments for new changes in
4301         Convert.ImplicitStandardConversionExists.
4302
4303         * class.cs: Adjustments to cope with the fact that now toplevel
4304         blocks are of type `ToplevelBlock'. 
4305
4306         * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
4307         insteda of standard blocks.
4308
4309         Flag errors if params arguments are passed to anonymous methods.
4310
4311         * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
4312         `CurrentAnonymousMethod' which points to the current Anonymous
4313         Method.  The variable points to the AnonymousMethod class that
4314         holds the code being compiled.  It is set in the new EmitContext
4315         created for the anonymous method.
4316
4317         (EmitContext.Phase): Introduce a variable and an enumeration to
4318         assist in enforcing some rules about when and where we are allowed
4319         to invoke certain methods (EmitContext.NeedsReturnLabel is the
4320         only one that enfonces this right now).
4321
4322         (EmitContext.HaveCaptureInfo): new helper method that returns
4323         whether we have a CapturedContext initialized.
4324
4325         (EmitContext.CaptureVariable): New method used to register that a
4326         LocalInfo must be flagged for capturing. 
4327
4328         (EmitContext.CapturedParameter): New method used to register that a
4329         parameters must be flagged for capturing. 
4330         
4331         (EmitContext.CapturedField): New method used to register that a
4332         field must be flagged for capturing. 
4333
4334         (EmitContext.HaveCapturedVariables,
4335         EmitContext.HaveCapturedFields): Return whether there are captured
4336         variables or fields. 
4337
4338         (EmitContext.EmitMethodHostInstance): This is used to emit the
4339         instance for the anonymous method.  The instance might be null
4340         (static methods), this (for anonymous methods that capture nothing
4341         and happen to live side-by-side with the current method body) or a
4342         more complicated expression if the method has a CaptureContext.
4343
4344         (EmitContext.EmitTopBlock): Routine that drives the emission of
4345         code: it will first resolve the top block, then emit any metadata
4346         and then emit the code.  The split is done so that we can extract
4347         any anonymous methods and flag any captured variables/parameters.
4348         
4349         (EmitContext.ResolveTopBlock): Triggers the resolution phase,
4350         during this phase, the ILGenerator should not be used as labels
4351         and local variables declared here might not be accessible to any
4352         code that is part of an anonymous method.  
4353
4354         Exceptions to this include the temporary variables that are
4355         created by some statements internally for holding temporary
4356         variables. 
4357         
4358         (EmitContext.EmitMeta): New routine, in charge of emitting all the
4359         metadata for a cb
4360
4361         (EmitContext.TemporaryReturn): This method is typically called
4362         from the Emit phase, and its the only place where we allow the
4363         ReturnLabel to be defined other than the EmitMeta.  The reason is
4364         that otherwise we would have to duplicate a lot of logic in the
4365         Resolve phases of various methods that today is on the Emit
4366         phase. 
4367
4368         (EmitContext.NeedReturnLabel): This no longer creates the label,
4369         as the ILGenerator is not valid during the resolve phase.
4370
4371         (EmitContext.EmitThis): Extended the knowledge in this class to
4372         work in anonymous methods in addition to iterators. 
4373
4374         (EmitContext.EmitCapturedVariableInstance): This emits whatever
4375         code is necessary on the stack to access the instance to a local
4376         variable (the variable will be accessed as a field).
4377
4378         (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
4379         EmitContext.EmitAddressOfParameter): Routines to support
4380         parameters (not completed at this point). 
4381         
4382         Removals: Removed RemapLocal and RemapLocalLValue.  We probably
4383         will also remove the parameters.
4384
4385         * convert.cs (Convert): Define a `ConstantEC' which points to a
4386         null.  This is just to prefity some code that uses
4387         ImplicitStandardConversion code and do not have an EmitContext
4388         handy.
4389
4390         The idea is to flag explicitly that at that point in time, it is
4391         known that the conversion will not trigger the delegate checking
4392         code in implicit conversions (which requires a valid
4393         EmitContext). 
4394
4395         Everywhere: pass new EmitContext parameter since
4396         ImplicitStandardConversionExists now requires it to check for
4397         anonymous method conversions. 
4398
4399         (Convert.ImplicitStandardConversionExists): If the type of an
4400         expression is the anonymous_method_type, and the type is a
4401         delegate, we invoke the AnonymousMethod.Compatible method to check
4402         whether an implicit conversion is possible. 
4403
4404         (Convert.ImplicitConversionStandard): Only do implicit method
4405         group conversions if the language level is not ISO_1.
4406
4407         * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
4408         MethodInfo for the Invoke method.  used by Delegate and
4409         AnonymousDelegate.
4410
4411         * expression.cs (Binary.DoNumericPromotions): only allow anonymous
4412         method conversions if the target type is a delegate.
4413
4414         Removed extra debugging nops.
4415
4416         (LocalVariableReference): Turn the `local_info' into a public
4417         field. 
4418
4419         Add `prepared' field, the same hack used for FieldExprs to cope
4420         with composed assignments, as Local variables do not necessarily
4421         operate purely on the stack as they used to: they can be captured
4422         fields. 
4423
4424         Add `temp' for a temporary result, like fields.
4425
4426         Refactor DoResolve and DoResolveLValue into DoResolveBase.
4427
4428         It now copes with Local variables that are captured and emits the
4429         proper instance variable to load it from a field in the captured
4430         case. 
4431
4432         (ParameterReference.DoResolveBase): During the resolve phase,
4433         capture parameters if we are in an anonymous method.
4434
4435         (ParameterReference.Emit, ParameterReference.AddressOf): If in an
4436         anonymous method, use the EmitContext helper routines to emit the
4437         parameter reference.
4438
4439         * iterators.cs: Set RemapToProxy to true/false during the
4440         EmitDispose class.
4441
4442         * parameters.cs (GetParameterByName): New helper method. 
4443
4444         * typemanager.cs (anonymous_method_type) a new type that
4445         represents an anonyous method.  This is always an internal type,
4446         used as a fencepost to test against the anonymous-methodness of an
4447         expression. 
4448         
4449 2004-10-20  Marek Safar  <marek.safar@seznam.cz>
4450
4451         * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
4452         561 report.
4453         (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
4454
4455 2004-11-10  Martin Baulig  <martin@ximian.com>
4456
4457         * expression.cs (Invocation.BetterFunction): If two methods have
4458         equal parameter types, but only one of them is generic, the
4459         non-generic one wins.
4460         (New.DoResolve): Don't set `is_struct' to false if we're a generic
4461         instance; just use `Type.IsValueType' to determine whether
4462         something is a struct or not.
4463         (MemberAccess.DoResolveAsTypeStep): Don't modify the `args' field,
4464         so we can be called multiple times.
4465
4466 2004-11-10  Martin Baulig  <martin@ximian.com>
4467
4468         * generic.cs (TypeParameter.DefineConstraints): New public method.
4469         (TypeParameter.CheckAccessLevel): Override this and return true.
4470         (ConstructedType.ResolveType): Renamed to DoResolveType(), don't
4471         override ResolveType() anymore.
4472         (ConstructedType.DoResolveAsTypeStep): Call DoResolveType() here.
4473
4474 2004-11-10  Martin Baulig  <martin@ximian.com>
4475
4476         * rootcontext.cs (RootContext.LookupType): If we're a nested type,
4477         call DeclSpace.ResolveNestedType() on it.
4478
4479 2004-11-10  Martin Baulig  <martin@ximian.com>
4480
4481         * support.cs (ReflectionParameters.ParameterModifier): If `gpd' is
4482         non-null, call ParameterModifier() on it.
4483
4484 2004-11-10  Martin Baulig  <martin@ximian.com>
4485
4486         * iterators.cs
4487         (Iterators): Added `current_type' and `this_type' fields.
4488         (Iterators.DefineIterator): Create a new EmitContext and store it
4489         in `ec'; compute `this_type'.
4490
4491 2004-11-10  Martin Baulig  <martin@ximian.com>
4492
4493         * typemanager.cs
4494         (TypeManager.IsPrivateAccessible): New public method.
4495         (Closure.Filter): Use IsPrivateAccessible() instead of IsEqual().
4496
4497 2004-11-10  Martin Baulig  <martin@ximian.com>
4498
4499         * class.cs (TypeContainer.DefineType): Call
4500         TypeBuilder.DefineGenericParameters() before resolving the type
4501         parameters.
4502         (MethodData.parent_method): New protected field.
4503         (MethodData..ctor): Added `MethodInfo parent_method' argument.
4504         (MethodData.Define): Compute `parent_method'.
4505
4506         * decl.cs
4507         (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
4508         (MemberCore.GetClsCompliantAttributeValue): Likewise.
4509         (DeclSpace.ec): New protected field; store the EmitContext here.
4510         (DeclSpace.EmitContext): New public property.
4511         (DeclSpace.ResolveType): Un-comment from the [Obsolte] attribute.
4512         (DeclSpace.ResolveNestedType): New public method.
4513         (DeclSpace.ResolveTypeExpr): Just call ResolveAsTypeTerminal() here.
4514         (DeclSpace.NestedAccessible): Added `Type tb' argument.
4515         (DeclSpace.FamilyAccessible): Likewise.
4516         (DeclSpace.FindType): Call ResolveNestedType() for nested types.
4517         (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
4518         EmitContext.
4519
4520         * delegate.cs (Delegate.Define): Store the EmitContext in the `ec'
4521         field.
4522
4523         * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
4524         (Enum.Emit): Don't create a new EmitContext.
4525
4526 2004-10-18  Martin Baulig  <martin@ximian.com>
4527
4528         * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
4529         `Type' directly, but call ResolveType() on it.
4530         (Catch.Resolve): Likewise.
4531         (Foreach.Resolve): Likewise.
4532
4533 2004-10-18  Martin Baulig  <martin@ximian.com>
4534
4535         * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
4536         `Type' directly, but call ResolveType() on it.
4537         (Probe.DoResolve): Likewise.
4538         (ArrayCreation.LookupType): Likewise.
4539         (TypeOf.DoResolve): Likewise.
4540         (SizeOf.DoResolve): Likewise.
4541
4542 2004-10-18  Raja R Harinath  <rharinath@novell.com>
4543
4544         * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
4545         the ResolveType.
4546
4547 2004-10-17  John Luke  <john.luke@gmail.com>
4548
4549         * class.cs (Operator.GetSignatureForError): use CSharpName
4550
4551         * parameter.cs (Parameter.GetSignatureForError): Returns
4552         correct name even if was not defined.
4553
4554 2004-10-13  Raja R Harinath  <rharinath@novell.com>
4555
4556         Fix #65816.
4557         * class.cs (TypeContainer.EmitContext): New property.
4558         (DefineNestedTypes): Create an emitcontext for each part.
4559         (MethodCore.DoDefineParameters): Use container's emitcontext.
4560         Pass type array to InternalParameters.
4561         (MemberBase.DoDefine): Use container's emitcontext.
4562         (FieldMember.Define): Likewise.
4563         (Event.Define): Likewise.
4564         (SetMethod.GetParameterInfo): Change argument to EmitContext.
4565         Pass type array to InternalParameters.
4566         (SetIndexerMethod.GetParameterInfo): Likewise.
4567         (SetMethod.Define): Pass emitcontext to GetParameterInfo.
4568         * delegate.cs (Define): Pass emitcontext to
4569         ComputeAndDefineParameterTypes and GetParameterInfo.  Pass type
4570         array to InternalParameters.
4571         * expression.cs (ParameterReference.DoResolveBase): Pass
4572         emitcontext to GetParameterInfo.
4573         (ComposedCast.DoResolveAsTypeStep): Remove check on
4574         ec.ResolvingTypeTree.
4575         * parameter.cs (Parameter.Resolve): Change argument to
4576         EmitContext.  Use ResolveAsTypeTerminal.
4577         (Parameter.GetSignature): Change argument to EmitContext.
4578         (Parameters.ComputeSignature): Likewise.
4579         (Parameters.ComputeParameterTypes): Likewise.
4580         (Parameters.GetParameterInfo): Likewise.
4581         (Parameters.ComputeAndDefineParameterTypes): Likewise.
4582         Re-use ComputeParameterTypes.  Set ec.ResolvingTypeTree.
4583         * support.cs (InternalParameters..ctor): Remove variant that takes
4584         a DeclSpace.
4585         * typemanager.cs (system_intptr_expr): New.
4586         (InitExpressionTypes): Initialize it.
4587
4588 2004-10-12  Chris Toshok  <toshok@ximian.com>
4589
4590         * cs-parser.jay: fix location for try_statement and catch_clause.
4591
4592 2004-10-18  Martin Baulig  <martin@ximian.com>
4593
4594         * class.cs (FieldMember.Define): Don't access the TypeExpr's
4595         `Type' directly, but call ResolveType() on it.
4596         (MemberBase.DoDefine): Likewise.
4597
4598         * expression.cs (New.DoResolve): Don't access the TypeExpr's
4599         `Type' directly, but call ResolveType() on it.
4600         (ComposedCast.DoResolveAsTypeStep): Likewise.
4601
4602         * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
4603         `Type' directly, but call ResolveType() on it.
4604
4605 2004-10-17  John Luke  <john.luke@gmail.com>
4606
4607         * class.cs (Operator.GetSignatureForError): use CSharpName
4608
4609         * parameter.cs (Parameter.GetSignatureForError): Returns
4610         correct name even if was not defined.
4611
4612 2004-10-13  Raja R Harinath  <rharinath@novell.com>
4613
4614         Fix #65816.
4615         * class.cs (TypeContainer.EmitContext): New property.
4616         (DefineNestedTypes): Create an emitcontext for each part.
4617         (MethodCore.DoDefineParameters): Use container's emitcontext.
4618         Pass type array to InternalParameters.
4619         (MemberBase.DoDefine): Use container's emitcontext.
4620         (FieldMember.Define): Likewise.
4621         (Event.Define): Likewise.
4622         (SetMethod.GetParameterInfo): Change argument to EmitContext.
4623         Pass type array to InternalParameters.
4624         (SetIndexerMethod.GetParameterInfo): Likewise.
4625         (SetMethod.Define): Pass emitcontext to GetParameterInfo.
4626         * delegate.cs (Define): Pass emitcontext to
4627         ComputeAndDefineParameterTypes and GetParameterInfo.  Pass type
4628         array to InternalParameters.
4629         * expression.cs (ParameterReference.DoResolveBase): Pass
4630         emitcontext to GetParameterInfo.
4631         (ComposedCast.DoResolveAsTypeStep): Remove check on
4632         ec.ResolvingTypeTree.
4633         * parameter.cs (Parameter.Resolve): Change argument to
4634         EmitContext.  Use ResolveAsTypeTerminal.
4635         (Parameter.GetSignature): Change argument to EmitContext.
4636         (Parameters.ComputeSignature): Likewise.
4637         (Parameters.ComputeParameterTypes): Likewise.
4638         (Parameters.GetParameterInfo): Likewise.
4639         (Parameters.ComputeAndDefineParameterTypes): Likewise.
4640         Re-use ComputeParameterTypes.  Set ec.ResolvingTypeTree.
4641         * support.cs (InternalParameters..ctor): Remove variant that takes
4642         a DeclSpace.
4643         * typemanager.cs (system_intptr_expr): New.
4644         (InitExpressionTypes): Initialize it.
4645
4646 2004-10-12  Chris Toshok  <toshok@ximian.com>
4647
4648         * cs-parser.jay: fix location for try_statement and catch_clause.
4649
4650 2004-10-07  Raja R Harinath  <rharinath@novell.com>
4651
4652         More DeclSpace.ResolveType avoidance.
4653         * decl.cs (MemberCore.InUnsafe): New property.
4654         * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal 
4655         with newly created EmitContext.
4656         (FieldMember.Define): Likewise.
4657         * delegate.cs (Delegate.Define): Likewise.
4658         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
4659         only if normal name-lookup fails.
4660         (TypeExpr.DoResolve): Enable error-checking.
4661         * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
4662         (SizeOf.DoResolve): Likewise.
4663         (ComposedCast.DoResolveAsTypeStep): Likewise.
4664         (StackAlloc.DoResolve): Likewise.
4665         * statement.cs (Block.Flags): Add new flag 'Unsafe'.
4666         (Block.Unsafe): New property.
4667         (Block.EmitMeta): Set ec.InUnsafe as appropriate.
4668         (Unsafe): Set 'unsafe' flag of contained block.
4669         (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
4670         (Fixed.Resolve): Likewise.
4671         (Catch.Resolve): Likewise.
4672         (Using.ResolveLocalVariableDecls): Likewise.
4673         (Foreach.Resolve): Likewise.
4674
4675 2004-10-05  John Luke <john.luke@gmail.com>
4676
4677         * cs-parser.jay: add location to error CS0175
4678
4679 2004-10-04  Miguel de Icaza  <miguel@ximian.com>
4680
4681         * ecore.cs (Expression.Constantity): Add support for turning null
4682         into a constant.
4683
4684         * const.cs (Const.Define): Allow constants to be reference types
4685         as long as the value is Null.
4686
4687 2004-10-04  Juraj Skripsky  <js@hotfeet.ch>
4688
4689         * namespace.cs (NamespaceEntry.Using): No matter which warning
4690         level is set, check if this namespace name has already been added.
4691
4692 2004-10-03 Ben Maurer  <bmaurer@ximian.com>
4693
4694         * expression.cs: reftype [!=]= null should always use br[true,false].
4695         # 67410
4696
4697 2004-10-03  Marek Safar  <marek.safar@seznam.cz>
4698
4699         Fix #67108
4700         * attribute.cs: Enum conversion moved to 
4701         GetAttributeArgumentExpression to be applied to the all
4702         expressions.
4703
4704 2004-10-01  Raja R Harinath  <rharinath@novell.com>
4705
4706         Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
4707         * class.c (TypeContainer.DefineType): Flag error if
4708         base types aren't accessible due to access permissions.
4709         * decl.cs (DeclSpace.ResolveType): Move logic to
4710         Expression.ResolveAsTypeTerminal.
4711         (DeclSpace.ResolveTypeExpr): Thin layer over
4712         Expression.ResolveAsTypeTerminal.
4713         (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
4714         Refactor code into NestedAccess.  Use it.
4715         (DeclSpace.NestedAccess): New.
4716         * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
4717         argument to silence errors.  Check access permissions.
4718         (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
4719         * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
4720         (Cast.DoResolve): Likewise.
4721         (New.DoResolve): Likewise.
4722         (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
4723         (TypeOf.DoResolve): Likewise.
4724
4725         * expression.cs (Invocation.BetterConversion): Return the Type of
4726         the better conversion.  Implement section 14.4.2.3 more faithfully.
4727         (Invocation.BetterFunction): Make boolean.  Make correspondence to
4728         section 14.4.2.2 explicit.
4729         (Invocation.OverloadResolve): Update.
4730         (Invocation): Remove is_base field.
4731         (Invocation.DoResolve): Don't use is_base.  Use mg.IsBase.
4732         (Invocation.Emit): Likewise.
4733
4734 2004-09-24  Marek Safar  <marek.safar@seznam.cz>
4735
4736         * cs-parser.jay: Reverted 642 warning fix.
4737
4738 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
4739
4740         Fix bug #66615
4741         * decl.cs (FindMemberWithSameName): Indexer can have more than
4742         1 argument.
4743
4744 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
4745
4746         * expression.cs (LocalVariableReference.DoResolveLValue):
4747         Do not report warning 219 for out values.
4748         (EmptyExpression.Null): New member to avoid extra allocations.
4749
4750 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
4751
4752         * cs-parser.jay: Fix wrong warning 642 report.
4753
4754         * cs-tokenizer.cs (CheckNextToken): New helper;
4755         Inspect next character if is same as expected.
4756
4757 2004-09-23  Martin Baulig  <martin@ximian.com>
4758
4759         * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
4760         (Convert.ImplicitReferenceConversionExists): Likewise.
4761
4762 2004-11-09  Raja R Harinath  <rharinath@novell.com>
4763
4764         * Makefile (DISTFILES): Comment out a few missing files.
4765
4766 2004-10-29  Raja R Harinath  <rharinath@novell.com>
4767
4768         * Makefile (bootstrap_libs,bootstrap_libfiles): New.
4769         (bootstrap-libs): New target.  Invokes the net_2_0_bootstrap profile.
4770         (gmcs.exe): Invoke bootstrap-libs.
4771         (clean-local): Clean the net_2_0_bootstrap profile too.
4772         (PROGRAM_INSTALL_DIR): New.
4773         (install-local): Use it.
4774
4775 2004-10-13  Martin Baulig  <martin@ximian.com>
4776
4777         * generic.cs (TypeManager.InflatedConstraints): New nested class.
4778         (TypeParameter.DefineType): If we're a method type parameter and
4779         that method is overriding something, "inflate" its constraints.
4780
4781 2004-10-12  Martin Baulig  <martin@ximian.com>
4782
4783         * expression.cs (MemberAccess.DoResolve): If we're a SimpleName
4784         and have type arguments, create and resolve a ConstructedType.
4785
4786 2004-10-12  Martin Baulig  <martin@ximian.com>
4787
4788         * decl.cs (MemberCache.FindMemberToOverride): Use
4789         TypeManager.IsEqual() to compare the parameters and Type.Equals()
4790         to compare the invocationType.
4791
4792         * typemanager.cs (TypeManager.IsEqual): Added support for arrays.
4793         When comparing two type parameters, only do the signature-only
4794         comparision for method type parameters.
4795
4796 2004-10-11  Martin Baulig  <martin@ximian.com>
4797
4798         * report.cs: Don't make --fatal abort on warnings, we have
4799         -warnaserror for that.
4800
4801 2004-10-11  Martin Baulig  <martin@ximian.com>
4802
4803         * typemanager.cs
4804         (TypeManager.IsEqualGenericType): Removed, use IsEqual() instead.
4805         (TypeManager.IsEqual): Call ourself recursively instead of using
4806         Type.IsEqual(). 
4807
4808 2004-10-11  Martin Baulig  <martin@ximian.com>
4809
4810         * class.cs (TypeContainer.DefineType): Only call TypeParameter.Define()
4811         on our own type parameters, not on the ones we inherit from a containing
4812         class.
4813
4814         * expression.cs (Invocation.InferType): Use `==', not `Equals()' for
4815         the comparision.
4816
4817         * generic.cs (TypeParameter.Define): We may only be called once.
4818
4819         * pending.cs (Pending.InterfaceMethod): Call TypeManager.Real_IsEqual()
4820         instead of TypeManager.IsEqual().
4821
4822 2004-09-28  Martin Baulig  <martin@ximian.com>
4823
4824         * generic.cs
4825         (GenericConstraints.EffectiveBaseClass): New public property.
4826         (TypeParameter.GenericConstraints): New public property.
4827         (ConstructedType.CheckConstraints): Improved.
4828
4829         * convert.cs (Convert.TypeParam_EffectiveBaseType): New private method.
4830         (Convert.TypeParameterConversion): New private method; use this in
4831         ImplicitReferenceConversion() and ImplicitReferenceConversionExists()
4832         for all conversions related to type parameters.
4833
4834 2004-09-24  Martin Baulig  <martin@ximian.com>
4835
4836         * convert.cs (Convert.ImplicitReferenceConversion): Added implicit
4837         type parameter conversions for type parameters which are known to
4838         be reference types.
4839
4840 2004-09-24  Martin Baulig  <martin@ximian.com>
4841
4842         * generic.cs (GenericConstraints): Added `IsReferenceType' and
4843         `IsValueType' properties.
4844
4845         * support.cs (ReflectionConstraints): Use
4846         Type.GetGenericParameterConstraints() instead of the old hack.
4847
4848 2004-09-24  Martin Baulig  <martin@ximian.com>
4849
4850         * generic.cs (GenericConstraints): Moved here and made it an
4851         abstract class.
4852
4853         * support.cs (GenericConstraints): Moved to generic.cs.
4854
4855 2004-09-24  Martin Baulig  <martin@ximian.com>
4856
4857         * support.cs
4858         (ReflectionConstraints): Un-nested this class and made it public.
4859
4860         * typemanager.cs
4861         (TypeManager.GetTypeParameterConstraints): New public method.
4862         (TypeManager.HasConstructorConstraint): Use the attributes.
4863
4864 2004-09-24  Martin Baulig  <martin@ximian.com>
4865
4866         * support.cs (GenericConstraints): Replaced `HasConstructor',
4867         `IsReferenceType' and `IsValueType' with `Attributes'.
4868         (ReflectionParameters.ReflectionConstraints): Removed the Create()
4869         method and made the .ctor public.
4870
4871         * generic.cs (Constraints.Attributes): New public property.
4872         (Constraints): Renamed `HasConstructor' -> `HasConstructorConstraint',
4873         `IsReferenceType' -> `HasReferenceTypeConstraint' and
4874         `IsValueType' -> `HasValueTypeConstraint'.
4875
4876 2004-09-23  Martin Baulig  <martin@ximian.com>
4877
4878         * generic.cs (Constraints): Reflect latest runtime changes.
4879
4880 2004-09-23  Martin Baulig  <martin@ximian.com>
4881
4882         * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
4883         (Convert.ImplicitReferenceConversionExists): Likewise.
4884
4885 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
4886
4887         * class.cs (Operator.Define): Add error 448 and 559 report.
4888         
4889 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
4890
4891         * class.cs (MemberBase.IsTypePermitted): New protected
4892         method for checking error CS0610.
4893
4894 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
4895
4896         * class.cs (TypeContainer.HasExplicitLayout): New property
4897         Returns whether container has StructLayout attribute set Explicit.
4898         (FieldMember): New abstract class for consts and fields.
4899         (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
4900         (Field): Reuse FieldMember.
4901
4902         * const.cs (Const): Reuse FieldMember.
4903
4904         * rootcontext.cs: EmitConstants call moved to class.
4905
4906 2004-09-22  Martin Baulig  <martin@ximian.com>
4907
4908         Marek and me just fixed one of our oldest bugs: #28562 :-)
4909
4910         * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
4911
4912         * attribute.cs (Attribute.GetAttributeArgumentExpression): If
4913         we're an EnumConstant, just return that.
4914         (Attribute.Resolve): GetAttributeArgumentExpression() may give us
4915         an EnumConstant.  In this case, we need to use GetValueAsEnumType()
4916         to get the value which'll actually be written into the attribute.
4917         However, we have to use GetValue() to access the attribute's value
4918         in the compiler.        
4919
4920 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
4921
4922         * constant.cs (Constant.IsNegative): New abstract property
4923         IsNegative.
4924
4925         * expression.cs (ArrayAccess.DoResolve): Add warning 251.
4926         (StackAlloc.DoResolve): Reused IsNegative.
4927
4928 2004-09-22  Martin Baulig  <martin@ximian.com>
4929
4930         * typemanager.cs (TypeManager.LookupGenericTypeContainer): New
4931         public method; like LookupTypeContainer, but also works for
4932         generic instances.
4933
4934         * report.cs (Report.SymbolRelatedToPreviousError): Use
4935         TypeManager.LookupGenericTypeContainer().       
4936
4937 2004-09-22  Martin Baulig  <martin@ximian.com>
4938
4939         Thanks to Peter Sestoft for this bug report.
4940
4941         * expression.cs (Conditional): If both the `trueExpr' and the
4942         `falseExpr' is a NullLiteral, return a NullLiteral.
4943
4944 2004-09-22  Martin Baulig  <martin@ximian.com>
4945
4946         * statement.cs (Foreach.EmitCollectionForeach): If we're in an
4947         iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
4948         for the "get_Current" call.
4949
4950 2004-09-21  Martin Baulig  <martin@ximian.com>
4951
4952         * convert.cs (Convert.ImplicitReferenceConversion): When
4953         converting to an interface type, first check whether we're
4954         converting from a reference type.
4955
4956 2004-09-14  Martin Baulig  <martin@ximian.com>
4957
4958         * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
4959
4960 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
4961
4962         Fixed bug #61902
4963         * codegen.cs (TestObsoleteMethodUsage): Trace when method is
4964         called and is obsolete then this member suppress message
4965         when call is inside next [Obsolete] method or type.
4966
4967         * expression.cs: Use TestObsoleteMethodUsage member.
4968
4969 2004-09-14  Martin Baulig  <martin@ximian.com>
4970
4971         * genericparser.cs: Removed.
4972
4973 2004-09-13  Marek Safar  <marek.safar@seznam.cz>
4974
4975         * class.cs (MethodCore.CheckBase): Fix bug #65757.
4976
4977 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
4978
4979         * attribute.cs (Attribute.Resolve): Add error 653 report.
4980
4981         * class.cs (Class.ApplyAttributeBuilder): Add error 641
4982         report.
4983         (Method.ApplyAttributeBuilder): Add error 685 report.
4984         (Operator.Define): Add error 564 report.
4985
4986         * cs-tokenizer.cs (handle_hex): Add error 1013 report.
4987
4988         * expression.cs (Invocation.DoResolve): Add error
4989         245 and 250 report.
4990
4991         * parameter.cs (Parameter.ApplyAttributeBuilder): Add
4992         error 674 report.
4993
4994 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
4995
4996         * class.cs (ConstructorInitializer.Resolve):
4997         Wrong error number (515->516).
4998
4999 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
5000
5001         * class.cs (Indexer.Define): Add error 631 report.
5002
5003 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
5004
5005         * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
5006
5007 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
5008
5009         * expression.cs (Probe.DoResolve): Add error CS0241 report.
5010
5011 2004-09-10  Marek Safar  <marek.safar@seznam.cz>
5012
5013         * cs-parser.jay: Added error CS0241 report.
5014
5015 2004-09-10  Raja R Harinath  <rharinath@novell.com>
5016
5017         * cs-parser.jay (fixed_statement): Introduce a scope for the
5018         declaration in the 'fixed' statement.
5019
5020 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
5021
5022         * cs-parser.jay: Added CS0230 error report.
5023
5024 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
5025
5026         * cs-parser.jay: Added errors CS0231 and CS0257 report.
5027
5028 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
5029
5030         * expression.cs (Argument.Resolve): Added error CS0192 and
5031         CS0199 report.
5032
5033 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
5034
5035         C# 2.0 #pragma warning feature
5036
5037         * cs-tokenizer.cs (PreProcessPragma): New method; 
5038         Handles #pragma directive.
5039
5040         * report.cs (WarningRegions): New class; Support
5041         class for #pragma warning directive. It tests whether
5042         warning is enabled for a given line.
5043
5044 2004-09-08  Miguel de Icaza  <miguel@ximian.com>
5045
5046         * const.cs: Add more descriptive error report, tahnks to
5047         Sebastien. 
5048
5049 2004-09-08  Marek Safar  <marek.safar@seznam.cz>
5050
5051         * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
5052
5053 2004-09-07  Miguel de Icaza  <miguel@ximian.com>
5054
5055         * expression.cs: Apply patch from Ben: Remove dead code from
5056         ArrayCreation, and remove the TurnintoConstant call in const.cs,
5057         as that code just threw an exception anwyays.
5058
5059         * const.cs: Remove the call to the turnintoconstant, for details
5060         see bug: #63144
5061         
5062         * literal.cs: The type of the null-literal is the null type;  So
5063         we use a placeholder type (literal.cs:System.Null, defined here)
5064         for it.
5065
5066         * expression.cs (Conditional.DoResolve): Remove some old code that
5067         is no longer needed, conversions have been fixed.
5068
5069         (ArrayCreationExpression.DoResolve): Return false if we fail to
5070         resolve the inner expression.
5071
5072 2004-09-07  Raja R Harinath  <rharinath@novell.com>
5073
5074         Fix test-290.cs.
5075         * cs-parser.jay (delegate_declaration): Record a delegate
5076         declaration as a type declaration.
5077         Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
5078
5079 2004-09-06  Miguel de Icaza  <miguel@ximian.com>
5080
5081         * parameter.cs: Do not crash if the type can not be resolved. 
5082
5083         * expression.cs: Report errors with unsafe pointers, fixes #64896
5084
5085 2004-09-06 Ben Maurer  <bmaurer@users.sourceforge.net>
5086
5087         * expression.cs: Pointer arith always needs to do a conv.i
5088         if the operand is a long. fix 65320
5089
5090 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
5091
5092         Fixed cs0619-37.cs, cs0619-38.cs
5093
5094         * enum.cs (GetObsoleteAttribute): Removed.
5095
5096         * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
5097         on Enum member is double staged. The first is tested member
5098         and then enum.
5099
5100 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
5101
5102         Fixed #56986, #63631, #65231
5103
5104         * class.cs: (TypeContainer.AddToMemberContainer): New method,
5105         adds member to name container.
5106         (TypeContainer.AddToTypeContainer): New method, adds type to
5107         name container.
5108         (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
5109         AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
5110         AddOperator): Simplified by reusing AddToMemberContainer.
5111         (TypeContainer.UserDefinedStaticConstructor): Changed to property
5112         instead of field.
5113         (Method.CheckForDuplications): Fixed implementation to test all
5114         possibilities.
5115         (MemberBase): Detection whether member is explicit interface
5116         implementation is now in constructor.
5117         (MemberBase.UpdateMemberName): Handles IndexerName.
5118         (Accessor): Changed to keep also location information.
5119         (AbstractPropertyEventMethod): Is derived from MemberCore.
5120         (AbstractPropertyEventMethod.IsDummy): Says whether accessor
5121         will be emited or not.
5122         (PropertyBase.AreAccessorsDuplicateImplementation):
5123         Tests whether accessors are not in collision with some method.
5124         (Operator): Is derived from MethodCore to simplify common
5125         operations.
5126
5127         * decl.cs (Flags.TestMethodDuplication): Test for duplication
5128         must be performed.
5129         (DeclSpace.AddToContainer): Adds the member to defined_names
5130         table. It tests for duplications and enclosing name conflicts.
5131
5132         * enum.cs (EnumMember): Clean up to reuse the base structures
5133
5134 2004-09-03  Martin Baulig  <martin@ximian.com>
5135
5136         Merged latest changes into gmcs.  Please keep this comment in
5137         here, it makes it easier for me to see what changed in MCS since
5138         the last time I merged.
5139
5140 2004-09-03  Martin Baulig  <martin@ximian.com>
5141
5142         * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
5143         into TypeContainer, to make partial classes work again.
5144
5145 2004-09-03  Martin Baulig  <martin@ximian.com>
5146
5147         * rootcontext.cs (RootContext.V2): Removed.
5148
5149 2004-03-23  Martin Baulig  <martin@ximian.com>
5150
5151         * expression.cs (Invocation.OverloadResolve): Added `bool
5152         may_fail' argument and use it instead of the Location.IsNull() hack.
5153
5154 2004-09-09  Martin Baulig  <martin@ximian.com>
5155
5156         * cs-parser.jay (namespace_declaration): Fixed CS0134 reporting.
5157
5158 2004-09-09  Martin Baulig  <martin@ximian.com>
5159
5160         * generic.cs (TypeParameter.DefineType): Added support for
5161         explicit interface methods.
5162
5163 2004-09-09  Martin Baulig  <martin@ximian.com>
5164
5165         * README.Changes: New document.  Started to list important changes
5166         between MCS and GMCS here.
5167
5168 2004-09-08  Martin Baulig  <martin@ximian.com>
5169
5170         * class.cs
5171         (TypeContainer.CheckRecursiveDefinition): New protected method.
5172         (TypeContainer.DefineType): Move the CS0146 check into
5173         CheckRecursiveDefinition().     
5174
5175 2004-09-06  Martin Baulig  <martin@ximian.com>
5176
5177         * generic.cs (ConstructedType.CheckConstraints): Allow builtin
5178         types for the constructor constraint.
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-03  Martin Baulig  <martin@ximian.com>
5195
5196         Merged latest changes into gmcs.  Please keep this comment in
5197         here, it makes it easier for me to see what changed in MCS since
5198         the last time I merged.
5199
5200 2004-09-03  Raja R Harinath  <rharinath@novell.com>
5201
5202         Fix #61128.
5203         * expression.cs (BetterConversion): Don't allow either conversion 
5204         to be null.  Remove redundant implicit conversion test when 'q ==
5205         null' -- when this function is invoked, we already know that the
5206         implicit conversion exists.
5207         (BetterFunction): Assume that 'best' is non-null.  Remove
5208         redundant reimplementation of IsApplicable when 'best' is null.
5209         (IsParamsMethodApplicable, IsApplicable): Add new parameter for
5210         number of arguments.
5211         (IsAncestralType): Extract from OverloadResolve.
5212         (OverloadResolve): Make robust to the MethodGroupExpr being
5213         unsorted.  Implement all the logic of Section 14.5.5.1, and
5214         support overloading of methods from multiple applicable types.
5215         Clean up logic somewhat.  Don't pass null methods to BetterFunction.
5216
5217         * report.cs (SymbolRelatedToPreviousError): Cleanup output.
5218         (RealError, Warning): Append type of report to related symbol.
5219
5220 2004-09-03  Marek Safar  <marek.safar@seznam.cz>
5221
5222         * enum.cs: Fixed CLS-Compliance checks for enum members.
5223         Error tests cs3008-8.cs, cs3014-8.cs
5224
5225 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
5226
5227         Fixed bug #62342, #63102
5228         * class.cs: ImplementIndexer uses member.IsExplicitImpl
5229         like ImplementMethod.
5230
5231 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
5232
5233         * attribute.cs (Attribute.GetAttributeArgumentExpression):
5234         Fixed bug #65170.
5235
5236 2004-09-02  Martin Baulig  <martin@ximian.com>
5237
5238         * statement.cs (Using.EmitLocalVariableDeclFinally): Use
5239         TypeManager.GetArgumentTypes() rather than calling GetParameters()
5240         on the MethodBase.
5241
5242 2004-09-01  Marek Safar  <marek.safar@seznam.cz>
5243
5244         C# 2.0 Static classes implemented
5245
5246         * class.cs (TypeContainer): instance_constructors,
5247         initialized_fields, initialized_static_fields,
5248         default_constructor, base_inteface_types are protected to be
5249         accessible from StaticClass.
5250         (TypeContainer.DefineDefaultConstructor): New virtual method
5251         for custom default constructor generating
5252         (StaticClass): New class to handle "Static classes" feature.
5253
5254         * cs-parser.jay: Handle static keyword on class like instance
5255         of StaticClass.
5256
5257         * driver.cs: Added "/langversion" command line switch with two
5258         options (iso-1, default).
5259
5260 2004-08-31  Marek Safar  <marek.safar@seznam.cz>
5261
5262         * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
5263
5264 2004-08-31  Miguel de Icaza  <miguel@ximian.com>
5265
5266         * delegate.cs: Style.
5267
5268 2004-08-31 Ben Maurer  <bmaurer@users.sourceforge.net>
5269
5270         * delegate.cs: Add seperate instance expr field for miguel.
5271
5272 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
5273
5274         * PointerArithmetic (Resolve): make sure we are not doing
5275         pointer arith on void*. Also, make sure we are resolved
5276         by not setting eclass until resolve.
5277
5278         All callers: Make sure that PointerArithmetic gets resolved.
5279
5280 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
5281
5282         * ArrayCreation (LookupType): If the type does not resolve 
5283         to an array, give an error.
5284
5285 2004-08-27  Marek Safar  <marek.safar@seznam.cz>
5286
5287         * statement.cs (Try.Resolve): Fixed bug #64222
5288
5289 2004-08-27  Martin Baulig  <martin@ximian.com>
5290
5291         * class.cs
5292         (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
5293         crash here.     
5294
5295 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
5296
5297         * ecore.cs (Constantify): Get underlying type via
5298         System.Enum.GetUnderlyingType to avoid StackOverflow on the
5299         Windows in special cases.
5300
5301 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
5302
5303         * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
5304         for obtaining also private methods.
5305         (GetRemoveMethod): Used GetRemoveMethod (true)
5306         for obtaining also private methods.
5307
5308 2004-09-02  Martin Baulig  <martin@ximian.com>
5309
5310         * statement.cs (Using.EmitLocalVariableDeclFinally): Use
5311         TypeManager.GetArgumentTypes() rather than calling GetParameters()
5312         on the MethodBase.
5313
5314 2004-08-27  Martin Baulig  <martin@ximian.com>
5315
5316         * class.cs
5317         (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
5318         crash here.     
5319
5320 2004-08-25  Martin Baulig  <martin@ximian.com>
5321
5322         * support.cs (ReflectionParameters..ctor): If this is a generic
5323         method, retrieve and store its type parameters.
5324         (InternalParameters..ctor): Added `TypeParameter[]' argument.
5325         (ReflectionParameters.GenericConstraints): The argument specifies
5326         the type parameter, not the method parameter.
5327         (InternalParameters.GenericConstraints): Likewise.
5328
5329         * generic.cs (TypeParameter.DefineType): Correctly handle
5330         constraints wrt. generic methods in interfaces and their
5331         implementations.        
5332
5333 2004-08-24  Martin Baulig  <martin@ximian.com>
5334
5335         * generic.cs (TypeParameter.IsSubclassOf): New public method.
5336         (Constraints.IsSubclassOf): New internal method.
5337
5338         * typemanager.cs (TypeManager.FindMembers): Added special support
5339         for GenericTypeParameterBuilder's.      
5340         (TypeManager.IsSubclassOf, IsFamilyAccessible): Added support for
5341         type parameters.
5342
5343 2004-08-24  Martin Baulig  <martin@ximian.com>
5344
5345         * typemanager.cs
5346         (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
5347         this for accessibility checks.
5348         (TypeManager.IsSubclassOrNestedChildOf): Renamed to
5349         IsNestedFamilyAccessible.
5350         (TypeManager.IsSubclassOf): New method, do what the name actually
5351         says.   
5352
5353 2004-08-24  Martin Baulig  <martin@ximian.com>
5354
5355         * expression.cs (MemberAccess.DoResolve): When resolving ourselves
5356         as a SimpleName, include the generic arity.
5357
5358 2004-08-24  Martin Baulig  <martin@ximian.com>
5359
5360         * class.cs (Method.Define): Set MethodAttributes.SpecialName and
5361         MethodAttributes.HideBySig for operators.
5362
5363 2004-08-23  Martin Baulig  <martin@ximian.com>
5364
5365         Back to the old error reporting system :-)
5366
5367         * report.cs (Message): Removed.
5368         (Report.MessageData, ErrorData, WarningData): Removed.
5369         (Report.Error, Warning): Back to the old system.
5370
5371 2004-08-23  Martin Baulig  <martin@ximian.com>
5372
5373         * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
5374
5375         * class.cs (TypeContainer.ParentContainer): New public virtual
5376         method; replaces the explicit interface implementation.
5377         (ClassPart.ParentContainer): Override.
5378
5379 2004-08-23  Martin Baulig  <martin@ximian.com>
5380
5381         * statement.cs (Switch): Added support for constant switches; see
5382         #59428 or test-285.cs.
5383
5384 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
5385
5386         Fixed bug #62740.
5387         * statement.cs (GetEnumeratorFilter): Removed useless
5388         logic because C# specs is strict. GetEnumerator must be
5389         public.
5390
5391 2004-08-22  Martin Baulig  <martin@ximian.com>
5392
5393         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
5394         a switch and may break, reset the barrier.  Fixes #59867.
5395
5396 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
5397
5398         CLS-Compliance speed up (~5% for corlib)
5399
5400         * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
5401         New method. Tests container for CLS-Compliant names
5402
5403         * class.cs (TypeContainer.VerifyClsName): New method.
5404         Checks whether container name is CLS Compliant.
5405         (Constructor): Implements IMethodData.
5406
5407         * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
5408         low-case table for CLS Compliance test.
5409         (MemberCache.VerifyClsParameterConflict): New method.
5410         Checks method parameters for CS3006 error.
5411
5412         * enum.cs (EnumMember): Is derived from MemberCore.
5413         (Enum.VerifyClsName): Optimized for better performance.
5414
5415 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
5416
5417         * report.cs: Renamed Error_T to Error and changed all
5418         references.
5419
5420 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
5421
5422         * class.cs (TypeContainer.IndexerArrayList): New inner class
5423         container for indexers.
5424         (TypeContainer.DefaultIndexerName): New constant for default
5425         indexer name. Replaced all "Item" with this constant.
5426         (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
5427
5428         * typemanager.cs (TypeManager.default_member_ctor): Cache here
5429         DefaultMemberAttribute constructor.
5430
5431 2004-08-05  Martin Baulig  <martin@ximian.com>
5432
5433         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
5434         Fix bug #59429.
5435
5436 2004-08-05  Marek Safar  <marek.safar@seznam.cz>
5437
5438         * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
5439         multi platforms problem.
5440
5441         * compiler.csproj: Included shared files.
5442
5443 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
5444
5445         Fix bug 60333, 55971 in the more general way
5446         * attribute.cs (Attribute.GetAttributeArgumentExpression):
5447         Added arg_type argument for constant conversion.
5448         (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
5449
5450 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
5451
5452         Fix bug #59760
5453         * class.cs (TypeContainer ): New inner classes MethodArrayList, 
5454         OperatorArrayList, MethodCoreArrayList for typecontainer
5455         containers. Changed class member types to these new types.
5456         (MethodArrayList.DefineMembers): Added test for CS0659.
5457
5458 2004-08-04  Miguel de Icaza  <miguel@ximian.com>
5459
5460         * cfold.cs: Synchronize the folding with the code in expression.cs
5461         Binary.DoNumericPromotions for uint operands.
5462
5463         * attribute.cs: Revert patch from Raja, it introduced a regression
5464         while building Blam-1.2.1 (hard to isolate a test case).
5465
5466 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
5467
5468         Fix for #55382
5469         * class.cs:
5470         (TypeContainer.Define): Renamed to DefineContainerMembers because of
5471         name collision.
5472         (MethodCore.parent_method): New member. The method we're overriding
5473         if this is an override method.
5474         (MethodCore.CheckBase): Moved from Method class and made common.
5475         (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
5476         private.
5477         (MethodCore.CheckForDuplications): New abstract method. For custom
5478         member duplication search in a container
5479         (MethodCore.FindOutParentMethod): New abstract method. Gets parent
5480         method and its return type.
5481         (Event.conflict_symbol): New member. Symbol with same name in the
5482         parent class.
5483
5484         * decl.cs:
5485         (MemberCache.FindMemberWithSameName): New method. The method
5486         is looking for conflict with inherited symbols.
5487
5488 2004-08-04  Martin Baulig  <martin@ximian.com>
5489
5490         * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
5491
5492         * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
5493
5494 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
5495
5496         * report.cs (Message): New enum for better error, warning reference in
5497         the code.
5498         (MessageData): New inner abstract class. It generally handles printing of
5499         error and warning messages.
5500         Removed unused Error, Warning, Message methods.
5501
5502 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
5503
5504         Fix for cs0592-8.cs test
5505         * attribute.cs
5506         (Attributable.ValidAttributeTargets): Made public.
5507         (Attribute.ExplicitTarget): New member for explicit target value.
5508         (Attribute.CheckTargets): Now we translate explicit attribute
5509         target to Target here.
5510
5511 2004-08-03  Ben Maurer  <bmaurer@ximian.com>
5512
5513         * ecore.cs (MethodGroupExpr): new IsBase property.
5514
5515         * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
5516
5517         * delegate.cs (DelegateCreation): store a MethodGroupExpr
5518         rather than an instance expr.
5519
5520         (DelegateCreation.Emit): Use the method group rather than
5521         the instance expression. Also, if you have base.Foo as the
5522         method for a delegate, make sure to emit ldftn, not ldftnvirt.
5523
5524         (ResolveMethodGroupExpr): Use the MethodGroupExpr. 
5525
5526         (NewDelegate.DoResolve): Only check for the existance of Invoke
5527         if the method is going to be needed. Use MethodGroupExpr.
5528
5529         (NewDelegate.Emit): Remove, DelegateCreation implements this.   
5530
5531         * expression.cs: For pointer arith., make sure to use
5532         the size of the type, not the size of the pointer to
5533         the type.
5534
5535 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
5536
5537         Fix for #60722
5538         * class.cs (Class): Added error CS0502 test.
5539
5540 2004-08-03  John Luke  <jluke@cfl.rr.com>
5541             Raja R Harinath  <rharinath@novell.com>
5542
5543         Fix for #60997.
5544         * attribute.cs (Attribute.complained_before): New flag.
5545         (Attribute.ResolveType, Attribute.Resolve),
5546         (Attribute.DefinePInvokeMethod): Set it.
5547         (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
5548         
5549 2004-08-03  Martin Baulig  <martin@ximian.com>
5550
5551         * expression.cs (Binary.ResolveOperator): Don't abort if we can't
5552         use a user-defined operator; we still need to do numeric
5553         promotions in case one argument is a builtin type and the other
5554         one has an implicit conversion to that type.  Fixes #62322.
5555
5556 2004-08-18  Martin Baulig  <martin@ximian.com>
5557
5558         * class.cs (Method.Define): Use the correct method name when
5559         creating the MethodBuilder for a generic method.
5560
5561 2004-08-17  Martin Baulig  <martin@ximian.com>
5562
5563         * generic.cs (Constraints): Support type parameter constraints.
5564
5565 2004-08-16  Martin Baulig  <martin@ximian.com>
5566
5567         * cs-tokenizer.cs (Tokenizer.TypeOfParsing): New public property.
5568         (Token.GENERIC_DIMENSION): New token; this is returned if we
5569         encounter an unbound generic type in a typeof() expression.
5570
5571         * cs-parser.jay (opt_type_argument_list): Added GENERIC_DIMENSION;
5572         this token is only generated while parsing a typeof() expression.
5573         (typeof_expression): Removed the old unbound_type hack.
5574
5575         * generic.cs (TypeArguments.IsUnbound): New public property.
5576
5577         * decl.cs (MemberName): Added support for unbound types.
5578
5579 2004-08-14  Martin Baulig  <martin@ximian.com>
5580
5581         * typemanager.cs
5582         (TypeManager.IsEqualGenericInstance): New static method.
5583         (TypeManager.IsSubclassOrNestedChildOf, IsSubclassOf): This is
5584         just used to check accessibility, so follow the rules of 26.1.6.        
5585
5586         * expression.cs (MemberAccess.ResolveAsTypeStep): Return a
5587         ConstructedType instead of a TypeExpression if we have type arguments.
5588
5589         * cs-parser.jay (typeof_expression): Support unbound generic types.
5590
5591         * ecore.cs (UnboundTypeExpression): New public class.
5592
5593 2004-08-12  Martin Baulig  <martin@ximian.com>
5594
5595         * typemanager.cs (TypeManager.IsNestedChildOf): Use
5596         TypeManager.IsEqual() rather than `=='.
5597
5598         * decl.cs (DeclSpace.CheckAccessLevel): Use `tb.FullName' for
5599         generic instances as well.
5600
5601 2004-08-12  Martin Baulig  <martin@ximian.com>
5602
5603         * expression.cs (Invocation.InferType): We can only infer method
5604         type parameters.  Fixes #62647.
5605
5606 2004-08-11  Martin Baulig  <martin@ximian.com>
5607
5608         * class.cs (TypeContainer.DefineType): Create the TypeBuilder
5609         before resolving the base classes.
5610
5611 2004-08-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
5612
5613         * Makefile: install .mdb file too.
5614
5615 2004-08-05  Martin Baulig  <martin@ximian.com>
5616
5617         * ecore.cs (FieldExpr.DoResolveLValue): If we're resolving a field
5618         initializer, the current type is just the TypeBuilder, not the
5619         instantiated generic type.
5620         (FieldExpr.IsFieldInitializer): New public property.
5621
5622 2004-08-04  Martin Baulig  <martin@ximian.com>
5623
5624         * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
5625
5626         * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
5627
5628 2004-08-03  Martin Baulig  <martin@ximian.com>
5629
5630         * class.cs (MethodData.Define): If we're an explicit
5631         implementation, remove the generic arity from the type name.
5632
5633 2004-08-03  Martin Baulig  <martin@ximian.com>
5634
5635         * expression.cs (Binary.ResolveOperator): Don't abort if we can't
5636         use a user-defined operator; we still need to do numeric
5637         promotions in case one argument is a builtin type and the other
5638         one has an implicit conversion to that type.  Fixes #62322.
5639
5640 2004-08-02  Martin Baulig  <martin@ximian.com>
5641
5642         * class.cs (TypeContainer.ifaces): Make this a `Type[]', not a
5643         `TypeExpr[]' array.
5644         (TypeContainer.GetClassBases): Return the unexpanded list of
5645         interfaces; we expand them later.
5646         (TypeContainer.DefineType): After creating the TypeBuilder, call
5647         TypeManager.ExpandInterfaces() to get an expanded and resolved
5648         list of interfaces.
5649
5650         * ecore.cs (TypeExpr.GetInterfaces): Removed
5651
5652         * generics.cs (Constraints.InterfaceConstraints): Remove.
5653         (TypeParameter.DefineType): Call TypeManager.RegisterBuilder() to
5654         register the interface constraints.
5655
5656         * typemanager.cs
5657         (TypeManager.AddUserType): Removed the `ifaces' argument.
5658         (TypeManager.AddTypeParameter): Likewise.
5659         (TypeManager.AddUserInterface): Removed, was unused.
5660         (TypeManager.RegisterBuilder): Take a `Type[]' instead of a
5661         `TypeExpr[]' array for the interfaces.
5662         (TypeManager.ExpandInterfaces): Call this after the TypeBuilder
5663         has been defined, returns a list of the resolved interfaces types.
5664         (TypeManager.GetInterfaces): Return a `Type[]', not a `TypeExpr[]'.
5665         (TypeManager.GetExplicitInterfaces): Likewise.  
5666
5667 2004-08-02  Martin Baulig  <martin@ximian.com>
5668
5669         * expression.cs (Invocation.EmitCall): If we're invoking a method
5670         on a type parameter, use the new `Constrained' prefix opcode.
5671
5672 2004-08-02  Martin Baulig  <martin@ximian.com>
5673
5674         * statement.cs (LocalInfo.Flags): Added `IsThis'.
5675         (LocalInfo.IsThis): New public property.
5676         (Block.EmitMeta): Don't create a LocalBuilder for `this'.
5677
5678 2004-08-01  Martin Baulig  <martin@ximian.com>
5679
5680         * class.cs (TypeContainer.GetClassBases): Don't set the default
5681         here since we may get called from GetPartialBases().
5682         (TypeContainer.DefineType): If GetClassBases() didn't return a
5683         parent, use the default one.
5684
5685 2004-07-30  Martin Baulig  <martin@ximian.com>
5686
5687         * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
5688
5689         * class.cs (SourceMethod): New public class, derive from the
5690         symbol writer's ISourceMethod.
5691         (Method): Use the new symbol writer API.
5692
5693         * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
5694         as argument and use the new symbol writer.
5695
5696         * location.cs
5697         (SourceFile): Implement the symbol writer's ISourceFile.
5698         (Location.SymbolDocument): Removed.
5699         (Location.SourceFile): New public property.
5700
5701         * symbolwriter.cs: Use the new symbol writer API.
5702
5703 2004-07-30  Raja R Harinath  <rharinath@novell.com>
5704
5705         * Makefile (install-local): Remove.  Functionality moved to
5706         executable.make.
5707
5708 2004-07-28  Lluis Sanchez Gual  <lluis@novell.com>
5709
5710         * Makefile: Install mcs.exe.config file together with mcs.exe.
5711         * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
5712         correct runtime version.
5713         
5714 2004-07-25  Martin Baulig  <martin@ximian.com>
5715
5716         * class.cs
5717         (TypeContainer.RegisterOrder): Removed, this was unused.
5718         (TypeContainer, interface_order): Removed.
5719         (TypeContainer.AddClass, AddStruct, AddInterface): Take a
5720         TypeContainer as argument since we can also be called with a
5721         `PartialContainer' for a partial class/struct/interface.
5722         (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
5723         of checking whether we're an `Interface' - we could be a
5724         `PartialContainer'.
5725         (PartialContainer.Register): Override; call
5726         AddClass()/AddStruct()/AddInterface() on our parent.
5727
5728         * cs-parser.jay (interface_member_declaration): Add things to the
5729         `current_container', not the `current_class'.
5730
5731         * rootcontext.cs (RegisterOrder): The overloaded version which
5732         takes an `Interface' was unused, removed.
5733
5734         * typemanager.cs (TypeManager.LookupInterface): Return a
5735         `TypeContainer', not an `Interface'.
5736         (TypeManager.IsInterfaceType): The `builder_to_declspace' may
5737         contain a `PartialContainer' for an interface, so check it's
5738         `Kind' to figure out what it is.
5739
5740 2004-07-25  Martin Baulig  <martin@ximian.com>
5741
5742         * class.cs (Class.DefaultTypeAttributes): New public constant.
5743         (Struct.DefaultTypeAttributes): Likewise.
5744         (Interface.DefaultTypeAttributes): Likewise.
5745         (PartialContainer.TypeAttr): Override this and add the
5746         DefaultTypeAttributes.
5747
5748 2004-07-25  Martin Baulig  <martin@ximian.com>
5749
5750         * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
5751         we can just use the `Parent' field instead.
5752
5753 2004-07-25  Martin Baulig  <martin@ximian.com>
5754
5755         * class.cs (TypeContainer.Emit): Renamed to EmitType().
5756
5757 2004-07-25  Martin Baulig  <martin@ximian.com>
5758
5759         * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
5760         our parts before defining any methods.
5761         (TypeContainer.VerifyImplements): Make this virtual.
5762         (ClassPart.VerifyImplements): Override and call VerifyImplements()
5763         on our PartialContainer.
5764
5765 2004-07-25  Martin Baulig  <martin@ximian.com>
5766
5767         * iterators.cs (Iterator.Define): Renamed to DefineIterator().
5768
5769         * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
5770         argument, we can just use the `Parent' field instead.
5771
5772         * class.cs
5773         (MemberBase.CheckBase): Removed the `TypeContainer' argument.   
5774         (MemberBase.DoDefine): Likewise.
5775
5776 2004-07-24  Martin Baulig  <martin@ximian.com>
5777
5778         * decl.cs (MemberCore.Parent): New public field.
5779         (DeclSpace.Parent): Moved to MemberCore.
5780
5781         * class.cs (MethodCore.ds): Removed; use `Parent' instead.
5782         (MemberBase.ctor): Added TypeContainer argument, pass it to our
5783         parent's .ctor.
5784         (FieldBase, Field, Operator): Likewise.
5785         (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
5786         (EventField, Event): Likewise.
5787
5788 2004-07-23  Martin Baulig  <martin@ximian.com>
5789
5790         * class.cs (PartialContainer): New public class.
5791         (ClassPart): New public class.
5792         (TypeContainer): Added support for partial classes.
5793         (TypeContainer.GetClassBases): Splitted some of the functionality
5794         out into GetNormalBases() and GetPartialBases().
5795
5796         * cs-tokenizer.cs (Token.PARTIAL): New token.
5797         (Tokenizer.consume_identifier): Added some hacks to recognize
5798         `partial', but only if it's immediately followed by `class',
5799         `struct' or `interface'.
5800
5801         * cs-parser.jay: Added support for partial clases.
5802
5803 2004-07-23  Martin Baulig  <martin@ximian.com>
5804
5805         * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
5806         a `DeclSpace' and also made it readonly.
5807         (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
5808         (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
5809         (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
5810
5811         * cs-parser.jay: Pass the `current_class', not the
5812         `current_container' (at the moment, this is still the same thing)
5813         to a new Method, Property, Event, Indexer or Constructor.
5814
5815 2004-07-23  Martin Baulig  <martin@ximian.com>
5816
5817         * cs-parser.jay (CSharpParser): Added a new `current_class' field
5818         and removed the `current_interface' one.
5819         (struct_declaration, class_declaration, interface_declaration):
5820         Set `current_class' to the newly created class/struct/interface;
5821         set their `Bases' and call Register() before parsing their body.
5822
5823 2004-07-23  Martin Baulig  <martin@ximian.com>
5824
5825         * class.cs (Kind): New public enum.
5826         (TypeContainer): Made this class abstract.
5827         (TypeContainer.Kind): New public readonly field.
5828         (TypeContainer.CheckDef): New public method; moved here from
5829         cs-parser.jay.
5830         (TypeContainer.Register): New public abstract method.
5831         (TypeContainer.GetPendingImplementations): New public abstract
5832         method.
5833         (TypeContainer.GetClassBases): Removed the `is_class' and
5834         `is_iface' parameters.
5835         (TypeContainer.DefineNestedTypes): Formerly known as
5836         DoDefineType().
5837         (ClassOrStruct): Made this class abstract.
5838
5839         * tree.cs (RootTypes): New public type. 
5840
5841 2004-07-20  Martin Baulig  <martin@ximian.com>
5842
5843         * tree.cs (Tree.RecordNamespace): Removed.
5844         (Tree.Namespaces): Removed.
5845
5846         * rootcontext.cs (RootContext.IsNamespace): Removed.
5847
5848         * cs-parser.jay (namespace_declaration): Just create a new
5849         NamespaceEntry here.
5850
5851 2004-07-21  Lluis Sanchez Gual  <lluis@novell.com>
5852
5853         * Makefile: Install gmcs.exe.config file together with gmcs.exe.
5854         * gmcs.exe.config: Renamed from mcs.exe.config. Added supportedRuntime
5855         entry to make sure it runs in the correct runtime version.
5856         
5857 2004-07-18  Martin Baulig  <martin@ximian.com>
5858
5859         * generic.cs (ConstructedType.CheckConstraints): Improved
5860         constraints checking.
5861
5862 2004-07-18  Martin Baulig  <martin@ximian.com>
5863
5864         * expression.cs (Invocation.BetterMethod): Call
5865         TypeManager.TypeToCoreType() on all types and removed my previous
5866         hack; we're already doig the right thing here.
5867
5868 2004-07-17  Martin Baulig  <martin@ximian.com>
5869
5870         * decl.cs (MemberName.MakeName): Create the "class`1" names here.
5871
5872 2004-07-16  Martin Baulig  <martin@ximian.com>
5873
5874         * iterators.cs: Added generics support.
5875
5876 2004-07-16  Martin Baulig  <martin@ximian.com>
5877
5878         * iterators.cs: Rewrote this.  We're now using one single Proxy
5879         class for both the IEnumerable and the IEnumerator interface and
5880         `Iterator' derives from Class so we can use the high-level API.
5881
5882         * class.cs (TypeContainer.AddIterator): New method.
5883         (TypeContainer.DoDefineType): New protected virtual method, which
5884         is called from DefineType().
5885         (TypeContainer.DoDefineMembers): Call DefineType() and
5886         DefineMembers() on all our iterators.
5887         (TypeContainer.Emit): Call Emit() on all our iterators.
5888         (TypeContainer.CloseType): Call CloseType() on all our iterators.
5889
5890         * codegen.cs (EmitContext.CurrentIterator): New public field.
5891
5892 2004-07-15  Martin Baulig  <martin@ximian.com>
5893
5894         * typemanager.cs
5895         (TypeManager.not_supported_exception_type): New type.   
5896
5897 2004-07-14  Martin Baulig  <martin@ximian.com>
5898
5899         * typemanager.cs
5900         (TypeManager.generic_ienumerable_type): New type.
5901         (TypeManager.generic_ienumerator_type): New type.
5902
5903         * rootcontext.cs
5904         (RootContext.interfaces_first_stage): Added
5905         "System.Collections.Generic.IEnumerator`1" and
5906         "System.Collections.Generic.IEnumerable`1".     
5907
5908 2004-07-14  Martin Baulig  <martin@ximian.com>
5909
5910         * iterators.cs: Use real error numbers.
5911
5912 2004-07-14  Martin Baulig  <martin@ximian.com>
5913
5914         * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
5915         requires this to be a System.Collection.IEnumerable and not a
5916         class implementing that interface.
5917         (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.      
5918
5919 2004-07-13  Marek Safar  <marek.safar@seznam.cz>
5920
5921         * class.cs: Fixed previous fix, it broke some error tests.
5922
5923 2004-07-12  Martin Baulig  <martin@ximian.com>
5924
5925         * enum.cs (Enum.Define): Call Emit() to emit the attributes.
5926         Fixes #61293.
5927
5928 2004-07-14  Martin Baulig  <martin@ximian.com>
5929
5930         * decl.cs, expression.cs, generic.cs: Use a backqoute (`) and not
5931         an exclamation mark (!) for the generic arity to reflect the
5932         latest spec changes; ie. use "System.Collections.Generic.IList`1".
5933
5934 2004-07-13  Martin Baulig  <martin@ximian.com>
5935
5936         * cs-tokenizer.cs (Tokenizer.parse_less_than): Allow array rank
5937         specifiers being part of a type argument.
5938
5939 2004-07-13  Martin Baulig  <martin@ximian.com>
5940
5941         * expression.cs (MemberAccess.ResolveAsTypeStep): Use the full `!'
5942         name for generic types.
5943
5944 2004-07-13  Martin Baulig  <martin@ximian.com>
5945
5946         * assign.cs (Assign.DoResolve): Moved the CS0131 check up a little
5947         bit to fix #60119.
5948
5949 2004-07-09  Miguel de Icaza  <miguel@ximian.com>
5950
5951         * assign.cs (LocalTemporary): Add new argument: is_address,If
5952         `is_address' is true, then the value that we store is the address
5953         to the real value, and not the value itself.
5954         
5955         * ecore.cs (PropertyExpr): use the new local temporary
5956         stuff to allow us to handle X.Y += z (where X is a struct)
5957
5958 2004-07-08  Martin Baulig  <martin@ximian.com>
5959
5960         * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
5961         not always return, just like we're doing in Using.Resolve().
5962
5963 2004-07-07  Miguel de Icaza  <miguel@ximian.com>
5964
5965         * cs-parser.jay (fixed_statement): flag this as Pinned.
5966
5967 2004-07-06  Miguel de Icaza  <miguel@ximian.com>
5968
5969         * typemanager.cs (TypeManager): Removed MakePinned method, this
5970         mechanism is replaced with the .NET 2.x compatible mechanism of
5971         calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
5972
5973         * statement.cs (LocalInfo): Remove MakePinned, add Pinned property 
5974         Rename `Fixed' to `Pinned' as a flag, to distinguish from the
5975         `IsFixed' property which has a different meaning.
5976
5977 2004-07-02  Raja R Harinath  <rharinath@novell.com>
5978
5979         * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
5980         visible from inside a nested class, not just the names of the
5981         immediately enclosing class.
5982         Fix for bug #60730.
5983
5984 2004-06-24  Raja R Harinath  <rharinath@novell.com>
5985
5986         * expression.cs (BetterConversion): Remove buggy special-case
5987         handling of "implicit constant expression conversions".  At this
5988         point, we already know that the conversion is possible -- we're
5989         only checking to see which is better.
5990
5991 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
5992
5993         * cs-parser.jay: Added error CS0210 test.
5994
5995 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
5996
5997         * cs-parser.jay: Added error CS0134 test.
5998
5999 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
6000
6001         Fix bug #52507
6002         * cs-parser.jay: Added error CS0145 test.
6003
6004 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
6005
6006         * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
6007
6008 2004-06-23  Ben Maurer  <bmaurer@ximian.com>
6009         
6010         * expression.cs (StackAlloc.Resolve): The argument may not
6011         be a constant; deal with this case.
6012         
6013 2004-06-23  Marek Safar  <marek.safar@seznam.cz>
6014
6015         * attribute.cs (IndexerName_GetIndexerName): Renamed to
6016         GetIndexerAttributeValue.
6017         (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
6018
6019         * class.cs (Indexer.Define): Added error tests for CS0415,
6020         CS0609.
6021
6022 2004-06-23  Miguel de Icaza  <miguel@ximian.com>
6023
6024         * attribute.cs (Attribute.Resolve): Keep field code in sync with
6025         property code.
6026
6027 2004-06-23  Martin Baulig  <martin@ximian.com>
6028
6029         * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
6030         neither return nor throw, reset the barrier as well.  Fixes #60457.
6031
6032 2004-06-22  Atsushi Enomoto  <atsushi@ximian.com>
6033
6034         * class.cs : EventAttributes is now set to None by default.
6035           This fixes bug #60459.
6036
6037 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
6038
6039         Fix bug #60219
6040         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
6041         Don't throw exception but return null (it's sufficient now).
6042
6043 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
6044
6045         * typemanager.cs (GetArgumentTypes): Faster implementation.
6046
6047 2004-06-18  Martin Baulig  <martin@ximian.com>
6048
6049         * attribute.cs (Attribute.Resolve): Check whether we're an
6050         EmptyCast which a Constant child.  Fixes #60333.
6051
6052 2004-06-17  Ben Maurer  <bmaurer@ximian.com>
6053
6054         * statement.cs (EmitCollectionForeach): Account for the fact that
6055         not all valuetypes are in areas which we can take the address of.
6056         For these variables, we store to a temporary variable. Also, make
6057         sure that we dont emit a `callvirt' on a valuetype method.
6058
6059 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
6060
6061         * expression.cs (StackAlloc.DoReSolve): Added test for
6062         negative parameter (CS0247).
6063
6064 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
6065
6066         Fix bug #59792
6067         * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
6068
6069 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
6070
6071         Fix bug #59781
6072         * expression.cs: (Binary.DoNumericPromotions): Added conversion for
6073         ulong.
6074
6075 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
6076
6077         Fix bug #58254 & cs1555.cs, cs1556.cs
6078         * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
6079
6080 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
6081
6082         * cs-parser.jay: Added error CS1669 test for indexers.
6083
6084 2004-06-18  Martin Baulig  <martin@ximian.com>
6085
6086         * generics.cs (GenericMethod.ctor): Don't take an Attributes
6087         argument.  Fixes #60441.
6088
6089 2004-06-16  Ben Maurer  <bmaurer@ximian.com>
6090         * ecore.cs (MethodGroupExpr.Name): Revert Martin's patch.
6091         The name needs to have the actual name of the method in order
6092         for other tests (such as the one in OverloadResolve for Invoke
6093         on a delegate) to work. As well, it does not really help
6094         error reporting because the method group had multiple methods.
6095         * Makefile: Remove MCS_DEBUG, you can enable with the DEBUG_FLAGS.
6096         Make profiling work.
6097         
6098 2004-06-13  Martin Baulig  <martin@ximian.com>
6099
6100         * cs-parser.jay: Don't allow generic attributes.
6101
6102 2004-06-13  Martin Baulig  <martin@ximian.com>
6103
6104         * class.cs (MemberBase.DoDefineBase): New protected method.
6105         (MemberBase.DoDefine): Compute the `flags' in the new
6106         DoDefineBase() which must be called first.
6107         (Method.Define): Call DoDefineBase() first so we have the flags
6108         when defining the generic method.
6109
6110         * cs-parser.jay (interface_method_declaration): Support generic methods.
6111
6112 2004-06-13  Martin Baulig  <martin@ximian.com>
6113
6114         * decl.cs (TypeName): Removed.
6115         (MemberName): Removed TypeName and MemberNow; now we just have
6116         MemberName.
6117
6118         * cs-parser.jay: Don't distinguish between type arguments and type
6119         parameters in the grammar and simplified the rules a bit.  The
6120         reduce/reduce conflicts are now gone (except the one we inherited
6121         from mcs).
6122
6123 2004-06-11  Martin Baulig  <martin@ximian.com>
6124
6125         * expression.cs (Invocation.IsParamsMethodApplicable): We need to
6126         call this twice: for params and varargs methods.
6127
6128 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
6129
6130         * class.cs:
6131         (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
6132
6133 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
6134
6135         * attribute.cs (Attribute.GetValidTargets): Made public.
6136
6137         * class.cs: 
6138         (AbstractPropertyEventMethod): New class for better code sharing.
6139         (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
6140         CS1667 report.
6141         (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
6142
6143 2004-06-09  Martin Baulig  <martin@ximian.com>
6144
6145         * cs-parser.jay: Removed a reduce/reduce conflict.
6146
6147 2004-06-03  Martin Baulig  <martin@ximian.com>
6148
6149         * generic.cs (ConstructedType.GetMemberAccess): Renamed to
6150         GetSimpleName() and return a SimpleName.
6151
6152         * ecore.cs (SimpleName.Arguments): New public field.
6153         (SimpleName): Added overloaded ctor which takes an additional
6154         TypeArguments argument.
6155         (SimpleName.SimpleNameResolve): Added support for generic methods.
6156         (MethodGroupExpr.ResolveGeneric): New public method.  The code was
6157         formerly in MemberAccess.DoResolve(), but we also need it in
6158         SimpleNameResolve().
6159
6160         * expression.cs (MemberAccess.DoResolve): Use the new
6161         MethodGroupExpr.ResolveGeneric().       
6162
6163 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
6164
6165         * decl.cs: If possible, use lookuptypedirect here. We can only do
6166         this if there is no `.' after the namespace. Avoids using
6167         LookupType, which does lots of slow processing.
6168         (FindNestedType) New method, does what it says :-).
6169         * namespace.cs: use LookupTypeDirect.
6170         * rootcontext.cs: use membercache, if possible.
6171         * typemanager.cs (LookupTypeDirect): Cache negative hits too.
6172
6173 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
6174
6175         * expression.cs:
6176         According to the spec, 
6177
6178         In a member access of the form E.I, if E is a single identifier,
6179         and if the meaning of E as a simple-name (§7.5.2) is a constant,
6180         field, property, localvariable, or parameter with the same type as
6181         the meaning of E as a type-name (§3.8), then both possible
6182         meanings of E are permitted.
6183
6184         We did not check that E as a simple-name had the same type as E as
6185         a type name.
6186
6187         This trivial check gives us 5-7% on bootstrap time.
6188
6189 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
6190
6191         * expression.cs (Invocation.OverloadResolve): Avoid the
6192         use of hashtables and boxing here by allocating on demand.
6193
6194 2004-05-30  Martin Baulig  <martin@ximian.com>
6195
6196         * rootcontext.cs (RootContext.LookupType): Don't cache things if
6197         we're doing a silent lookup.  Don't try to lookup nested types in
6198         TypeManager.object_type (thanks to Ben Maurer).
6199
6200 2004-05-30  Martin Baulig  <martin@ximian.com>
6201
6202         Committing a patch from Ben Maurer.
6203
6204         * rootcontext.cs (RootContext.LookupType): Cache negative results.
6205
6206 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
6207
6208         * convert.cs: add a trivial cache for overload operator resolution.
6209
6210 2004-05-31  Marek Safar  <marek.safar@seznam.cz>
6211
6212         * attribute.cs
6213         (AttributeTester.GetObsoleteAttribute): Returns instance of
6214         ObsoleteAttribute when type is obsolete.
6215
6216         * class.cs
6217         (TypeContainer.VerifyObsoleteAttribute): Override.
6218         (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
6219         (MethodCode.VerifyObsoleteAttribute): Override.
6220         (MemberBase.VerifyObsoleteAttribute): Override.
6221
6222         * decl.cs
6223         (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
6224         and report proper error.
6225
6226         *delegate.cs
6227         (Delegate.VerifyObsoleteAttribute): Override.
6228
6229         * ecore.cs
6230         (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
6231         and report proper error.
6232         (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
6233
6234         * enum.cs
6235         (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
6236         and enum member.
6237
6238         * expression.cs
6239         (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
6240         New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
6241         Added test for ObsoleteAttribute.
6242
6243         * statement.cs
6244         (Catch): Derived from Statement.
6245
6246 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
6247
6248         * decl.cs: If possible, use lookuptypedirect here. We can only do
6249         this if there is no `.' after the namespace. Avoids using
6250         LookupType, which does lots of slow processing.
6251         (FindNestedType) New method, does what it says :-).
6252         * namespace.cs: use LookupTypeDirect.
6253         * rootcontext.cs: use membercache, if possible.
6254         * typemanager.cs (LookupTypeDirect): Cache negative hits too.
6255
6256 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
6257
6258         * expression.cs:
6259         According to the spec, 
6260
6261         In a member access of the form E.I, if E is a single identifier,
6262         and if the meaning of E as a simple-name (§7.5.2) is a constant,
6263         field, property, localvariable, or parameter with the same type as
6264         the meaning of E as a type-name (§3.8), then both possible
6265         meanings of E are permitted.
6266
6267         We did not check that E as a simple-name had the same type as E as
6268         a type name.
6269
6270         This trivial check gives us 5-7% on bootstrap time.
6271
6272 2004-05-30  Marek Safar  <marek.safar@seznam.cz>
6273
6274         Fixed bug #59071 & cs0160.cs
6275         * statement.cs (Try.Resolve): Check here whether order of catch
6276         clauses matches their dependencies.
6277
6278 2004-05-30  Marek Safar  <marek.safar@seznam.cz>
6279
6280         Fixed bug #58624
6281         * ecore.cs (SimpleName.SimpleNameResolve): Added test for
6282         unsafe type.
6283
6284 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
6285
6286         * expression.cs (Invocation.OverloadResolve): Avoid the
6287         use of hashtables and boxing here by allocating on demand.
6288
6289 2004-05-30  Martin Baulig  <martin@ximian.com>
6290
6291         * rootcontext.cs (RootContext.LookupType): Don't cache things if
6292         we're doing a silent lookup.  Don't try to lookup nested types in
6293         TypeManager.object_type (thanks to Ben Maurer).
6294
6295 2004-05-30  Martin Baulig  <martin@ximian.com>
6296
6297         Committing a patch from Ben Maurer.
6298
6299         * rootcontext.cs (RootContext.LookupType): Cache negative results.      
6300
6301 2004-05-29  Martin Baulig  <martin@ximian.com>
6302
6303         * class.cs (IMethodData.ShouldIgnore): New method.
6304
6305         * typemanager.cs (TypeManager.MethodFlags): Don't take a
6306         `Location' argument, we don't need it anywhere.  Use
6307         `IMethodData.ShouldIgnore ()' instead of
6308         `MethodData.GetMethodFlags ()'.
6309         (TypeManager.AddMethod): Removed.
6310         (TypeManager.AddMethod2): Renamed to AddMethod.
6311
6312 2004-05-29  Martin Baulig  <martin@ximian.com>
6313
6314         Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
6315
6316         * convert.cs (Convert.ImplicitReferenceConversion): If we're
6317         converting from a class type S to an interface type and we already
6318         have an object on the stack, don't box it again.  Fixes #52578.
6319
6320 2004-05-29  Martin Baulig  <martin@ximian.com>
6321
6322         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
6323         Added support for `params' parameters.  Fixes #59267.
6324
6325 2004-05-29  Martin Baulig  <martin@ximian.com>
6326
6327         * literal.cs (NullPointer): Provide a private .ctor which sets
6328         `type' to TypeManager.object_type.  Fixes #59048.
6329
6330 2004-05-29  Martin Baulig  <martin@ximian.com>
6331
6332         * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
6333         EventExpr, set `ee.InstanceExpression = left'.  Fixes #59188.
6334
6335         * ecore.cs (EventExpr.instance_expr): Make the field private.
6336
6337 2004-05-26  Marek Safar  <marek.safar@seznam.cz>
6338
6339         Fixed bug #50080 & cs0214-2.cs
6340         * expression.cs (Cast.DoResolve): Check unsafe context here.
6341         
6342         * statement.cs (Resolve.DoResolve): Likewise.
6343
6344 2004-05-26  Martin Baulig  <martin@ximian.com>
6345
6346         * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
6347
6348         * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
6349         (RootContext.LookupType): Pass down the `silent' flag.
6350
6351 2004-05-25  Martin Baulig  <martin@ximian.com>
6352
6353         * expression.cs
6354         (MethodGroupExpr.IdenticalTypeName): New public property.
6355         (Invocation.DoResolve): Don't report a CS0176 if the "instance"
6356         expression actually refers to a type.
6357
6358 2004-05-25  Martin Baulig  <martin@ximian.com>
6359
6360         * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
6361         for #56176 and made it actually work.
6362
6363 2004-05-25  Martin Baulig  <martin@ximian.com>
6364
6365         * ecore.cs (Expression.CacheTemporaries): Make this virtual.
6366         (FieldExpr, PropertyExpr): Override and implement
6367         CacheTemporaries.  Fixes #52279.
6368
6369 2004-05-25  Miguel de Icaza  <miguel@ximian.com>
6370
6371         * location.cs: In the new compiler listing a file twice is a
6372         warning, not an error.
6373
6374 2004-05-24  Martin Baulig  <martin@ximian.com>
6375
6376         * enum.cs (Enum.DefineType): For the `BaseType' to be a
6377         TypeLookupExpression; otherwise, report a CS1008.  Fixes #58571.
6378
6379 2004-05-24  Martin Baulig  <martin@ximian.com>
6380
6381         * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
6382         walking the `using' list.  Fixes #53921.
6383
6384 2004-05-24  Martin Baulig  <martin@ximian.com>
6385
6386         * const.cs (Const.LookupConstantValue): Added support for
6387         EmptyCast's; fixes #55251.
6388
6389 2004-05-24  Martin Baulig  <martin@ximian.com>
6390
6391         * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
6392         DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
6393         which does the CS0135 check.  The reason is that we first need to
6394         check whether the variable actually exists.
6395
6396 2004-05-24  Martin Baulig  <martin@ximian.com>
6397
6398         * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
6399         than RootContext.LookupType() to find the explicit interface
6400         type.  Fixes #58584.
6401
6402 2004-05-24  Raja R Harinath  <rharinath@novell.com>
6403
6404         * Makefile: Simplify.  Use executable.make.
6405         * mcs.exe.sources: New file.  List of sources of mcs.exe.
6406
6407 2004-05-24  Anders Carlsson  <andersca@gnome.org>
6408
6409         * decl.cs:
6410         * enum.cs:
6411         Use the invariant culture when doing String.Compare for CLS case
6412         sensitivity.
6413         
6414 2004-05-23  Martin Baulig  <martin@ximian.com>
6415
6416         * decl.cs (DeclSpace.FindType): Only check the `using' list if we
6417         don't have any dots.  Fixes #52622, added cs0246-8.cs.
6418
6419         * namespace.cs (NamespaceEntry.Lookup): Likewise.
6420
6421 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
6422
6423         * class.cs (MemberBase.Define): Reuse MemberType member for 
6424         resolved type. Other methods can use it too.
6425
6426 2004-05-23  Martin Baulig  <martin@ximian.com>
6427
6428         * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
6429         the variable also exists in the current block (otherwise, we need
6430         to report a CS0103).  Fixes #58670.
6431
6432 2004-05-23  Martin Baulig  <martin@ximian.com>
6433
6434         * flowanalysis.cs (Reachability.Reachable): Compute this
6435         on-the-fly rather than storing it as a field.
6436
6437 2004-05-23  Martin Baulig  <martin@ximian.com>
6438
6439         * flowanalysis.cs (Reachability.And): Manually compute the
6440         resulting `barrier' from the reachability.      
6441        
6442 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
6443
6444         Fix bug #57835
6445         * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
6446         instance of ObsoleteAttribute when symbol is obsolete.
6447
6448         * class.cs
6449         (IMethodData): Extended interface for ObsoleteAttribute support.
6450
6451 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
6452
6453         * attribute.cs: Fix bug #55970
6454
6455 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
6456
6457         Fix bug #52705
6458         * attribute.cs
6459         (GetObsoleteAttribute): New method. Creates the instance of
6460         ObsoleteAttribute.
6461         (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
6462         ObsoleteAttribute when member is obsolete.
6463         (AttributeTester.Report_ObsoleteMessage): Common method for
6464         Obsolete error/warning reporting.
6465
6466         * class.cs
6467         (TypeContainer.base_classs_type): New member for storing parent type.
6468
6469         * decl.cs
6470         (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
6471         for this MemberCore.
6472
6473 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
6474
6475         * attribute.cs, const.cs: Fix bug #58590
6476
6477 2004-05-21  Martin Baulig  <martin@ximian.com>
6478
6479         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
6480         out parameters if the end of the method is unreachable.  Fixes
6481         #58098. 
6482
6483 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
6484
6485         * codegen.cs, cs-parser.jay: Removed SetAttributes method.
6486         Hari was right, why extra method.
6487
6488 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
6489
6490         * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
6491
6492 2004-05-20  Martin Baulig  <martin@ximian.com>
6493
6494         * delegate.cs: Convert this file to Unix mode - like the original
6495         version in mcs is.
6496
6497 2004-05-20  Martin Baulig  <martin@ximian.com>
6498
6499         * attribute.cs: Convert this file to Unix mode - like the original
6500         version in mcs is.
6501
6502 2004-05-19  Marek Safar  <marek.safar@seznam.cz>
6503
6504        Fix bug #58688 (MCS does not report error when the same attribute
6505        is assigned twice)
6506
6507        * attribute.cs (Attribute.Emit): Distinction between null and default.
6508
6509 2004-05-19  Raja R Harinath  <rharinath@novell.com>
6510
6511        * cs-parser.jay (attribute): Create a GlobalAttribute for the case
6512        of a top-level attribute without an attribute target.
6513        * attribute.cs (Attribute.Error_AttributeConstructorMismatch): 
6514        Make non-static.
6515        (Attribute.Conditional_GetConditionName), 
6516        (Attribute.Obsolete_GetObsoleteMessage): Update.
6517        (Attribute.IndexerName_GetIndexerName): New.  Attribute-specific
6518        part of ScanForIndexerName.
6519        (Attribute.CanIgnoreInvalidAttribute): New function.
6520        (Attribute.ScanForIndexerName): Move to ...
6521        (Attributes.ScanForIndexerName): ... here.
6522        (Attributes.Attrs): Rename from now-misnamed AttributeSections.
6523        (Attributes.Search): New internal variant that can choose not to
6524        complain if types aren't resolved.  The original signature now
6525        complains.
6526        (Attributes.GetClsCompliantAttribute): Use internal variant, with
6527        complaints suppressed.
6528        (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
6529        only if it not useful.
6530        (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
6531        top-level for attributes that are shared between the assembly
6532        and a top-level class.
6533        * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
6534        * class.cs: Update to reflect changes.
6535        (DefineIndexers): Fuse loops.
6536        * codegen.cs (GetAssemblyName): Update to reflect changes.  Accept
6537        a couple more variants of attribute names.
6538
6539 2004-05-18  Marek Safar  <marek.safar@seznam.cz>
6540
6541         Fix bug #52585 (Implemented explicit attribute declaration)
6542
6543         * attribute.cs:
6544         (Attributable.ValidAttributeTargets): New abstract method. It gets
6545         list of valid attribute targets for explicit target declaration.
6546         (Attribute.Target): It holds target itself.
6547         (AttributeSection): Removed.
6548         (Attribute.CheckTargets): New method. It checks whether attribute
6549         target is valid for the current element.
6550
6551         * class.cs:
6552         (EventProperty): New class. For events that are declared like
6553         property (with add and remove accessors).
6554         (EventField): New class. For events that are declared like field.
6555         class.cs
6556
6557         * cs-parser.jay: Implemented explicit attribute target declaration.
6558
6559         * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:        
6560         Override ValidAttributeTargets.
6561
6562         * parameter.cs:
6563         (ReturnParameter): Class for applying custom attributes on 
6564         the return type.
6565         (ParameterAtribute): New class. Class for applying custom
6566         attributes on the parameter type.
6567
6568 2004-05-17  Miguel de Icaza  <miguel@ximian.com>
6569
6570         * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
6571         definitions. 
6572
6573         (Method): Allow UNSAFE here.
6574
6575         * modifiers.cs: Support unsafe reporting.
6576
6577 2004-05-17  Marek Safar  <marek.safar@seznam.cz>
6578
6579         * decl.cs: Fix bug #58478.
6580
6581 2004-05-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
6582
6583         * statement.cs: When checking for unreachable code on an EmptyStatement,
6584         set the location. Fixes bug #58488.
6585
6586 2004-05-13  Miguel de Icaza  <miguel@ximian.com>
6587
6588         * driver.cs: Add -pkg handling.
6589
6590         From Gonzalo: UseShelLExecute=false
6591
6592 2004-05-12  Marek Safar  <marek.safar@seznam.cz>
6593
6594         * attribute.cs:
6595         (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
6596         for attribute.
6597         (Attribute.IsClsCompliaceRequired): Moved to base for better
6598         accesibility.
6599         (Attribute.UsageAttribute): New property for AttributeUsageAttribute
6600         when attribute is AttributeUsageAttribute.
6601         (Attribute.GetValidTargets): Simplified.
6602         (Attribute.GetAttributeUsage): New method returns AttributeUsage
6603         attribute for this type.
6604         (Attribute.ApplyAttributes): Method renamed to Emit and make
6605         non-static.
6606         (GlobalAttributeSection): New class for special handling of global
6607         attributes (assembly, module).
6608         (AttributeSection.Emit): New method.
6609
6610         * class.cs: Implemented Attributable abstract methods.
6611         (MethodCore.LabelParameters): Moved to Parameter class.
6612         (Accessor): Is back simple class.
6613         (PropertyMethod): Implemented Attributable abstract class.
6614         (DelegateMethod): Implemented Attributable abstract class.
6615         (Event): New constructor for disctintion between normal Event
6616         and Event with accessors.
6617
6618         * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
6619
6620         * codegen.cs, const.cs, decl.cs, delegate.cs:
6621         (CommonAssemblyModulClass): Implemented Attributable abstract class
6622         and simplified.
6623
6624         * enum.cs: Implement IAttributeSupport interface.
6625         (EnumMember): New class for emum members. Implemented Attributable
6626         abstract class
6627
6628         * parameter.cs:
6629         (ParameterBase): Is abstract.
6630         (ReturnParameter): New class for easier [return:] attribute handling.
6631
6632         * typemanager.cs: Removed builder_to_attr.
6633
6634 2004-05-11  Raja R Harinath  <rharinath@novell.com>
6635
6636         Fix bug #57151.
6637         * attribute.cs (Attribute.GetPositionalValue): New function.
6638         * class.cs (TypeContainer.VerifyMembers): New function.
6639         (TypeContainer.Emit): Use it.
6640         (ClassOrStruct): New base class for Class and Struct.
6641         (ClassOrStruct.ApplyAttributeBuilder): New function.  Note if 
6642         StructLayout(LayoutKind.Explicit) was ascribed to the struct or
6643         class.
6644         (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
6645         then each non-static field should have a FieldOffset attribute.
6646         Otherwise, none of the fields should have a FieldOffset attribute.
6647         * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout 
6648         and FieldOffset attributes.
6649         * typemanager.cs (TypeManager.struct_layout_attribute_type)
6650         (TypeManager.field_offset_attribute_type): New core types.
6651         (TypeManager.InitCoreTypes): Initialize them.
6652
6653 2004-05-11  Michal Moskal  <malekith@pld-linux.org>
6654
6655         * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
6656         Return correct type.
6657         From bug #58270.
6658
6659 2004-05-09  Miguel de Icaza  <miguel@ximian.com>
6660
6661         * expression.cs (Binary.DoNumericPromotions): 0 long constant can
6662         be implicitly converted to ulong.
6663         
6664         * expression.cs: The logic for allowing operator &, | and ^ worked
6665         was wrong, it worked before because we did not report an error in
6666         an else branch.  Fixes 57895.
6667
6668         * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
6669         allow volatile fields to be reference types.
6670
6671 2004-05-07  Miguel de Icaza  <miguel@ximian.com>
6672
6673         * driver.cs: Add support for /debug-
6674
6675 2004-05-07  Raja R Harinath  <rharinath@novell.com>
6676
6677         * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType): 
6678         Add a 'complain' parameter to silence errors.
6679         (Attribute.Resolve): Update to changes.  Put in sanity check to catch
6680         silently overlooked type-resolutions.
6681         (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
6682         to reflect changes.
6683         (Attributes.Search): New function.
6684         (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
6685         (Attributes.GetAttributeFullName): Remove hack.
6686         * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes): 
6687         Update to reflect changes.
6688         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
6689         Use Attributes.Search instead of nested loops.
6690
6691 2004-05-07  Marek Safar  <marek.safar@seznam.cz>
6692
6693         * decl.cs:
6694         (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
6695         (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
6696         (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
6697
6698         * report.cs: (Report.Warning): Renamed to Warning_T because of
6699         parameter collision.
6700
6701 2004-05-05  Raja R Harinath  <rharinath@novell.com>
6702
6703         * expression.cs (MemberAccess.ResolveMemberAccess):
6704         Exit with non-zero status after Report.Error.
6705         * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
6706         Likewise.
6707         * typemanager.cs (TypeManager.CoreLookupType): Likewise.
6708
6709 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
6710
6711         * support.cs: Don't hang when the file is empty.
6712
6713 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
6714
6715         * support.cs: In SeekableStreamReader, compute the preamble size of the
6716           underlying stream. Position changes should take into account that initial
6717           count of bytes.
6718
6719 2004-05-03  Todd Berman  <tberman@sevenl.net>
6720
6721         * driver.cs: remove unused GetSysVersion function.
6722
6723 2004-05-03  Todd Berman  <tberman@sevenl.net>
6724
6725         * driver.cs: Remove the hack from saturday, as well as the hack
6726         from jackson (LoadAssemblyFromGac), also adds the CWD to the
6727         link_paths to get that bit proper.
6728
6729 2004-05-01  Todd Berman  <tberman@sevenl.net>
6730
6731         * driver.cs: Try a LoadFrom before a Load, this checks the current
6732         path. This is currently a bug in mono that is be fixed, however, this
6733         provides a workaround for now. This will be removed when the bug
6734         is fixed.
6735
6736 2004-05-01  Sebastien Pouliot  <sebastien@ximian.com>
6737
6738         * CryptoConvert.cs: Updated to latest version. Fix issue with 
6739         incomplete key pairs (#57941).
6740
6741 2004-05-01  Todd Berman  <tberman@sevenl.net>
6742
6743         * driver.cs: Remove '.' from path_chars, now System.* loads properly
6744         from the GAC
6745
6746 2004-04-30  Jackson Harper  <jackson@ximian.com>
6747
6748         * codegen.cs: Open keys readonly.
6749         
6750 2004-04-30  Gonzalo Paniagua Javier <gonzalo@ximian.com>
6751
6752         * typemanager.cs: don't report cyclic struct layout when a struct
6753         contains 2 or more fields of the same type. Failed for Pango.AttrShape
6754         which has 2 Pango.Rectangle fields.
6755
6756 2004-04-29 Ben Maurer  <bmaurer@users.sourceforge.net>
6757
6758         * expression.cs: Handle IntPtr comparisons with IL code
6759         rather than a method call.
6760
6761 2004-04-29  Martin Baulig  <martin@ximian.com>
6762
6763         * ecore.cs (PropertyExpr.FindAccessor): New private method.  Walk
6764         the list of PropertyInfo's in class hierarchy and find the
6765         accessor.  Fixes #56013.
6766
6767 2004-04-29  Martin Baulig  <martin@ximian.com>
6768
6769         * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
6770
6771 2004-04-29  Martin Baulig  <martin@ximian.com>
6772
6773         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
6774
6775         * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
6776
6777 2004-04-29  Martin Baulig  <martin@ximian.com>
6778
6779         * class.cs (ConstructorInitializer.Resolve): Check whether the
6780         parent .ctor is accessible.  Fixes #52146.
6781
6782 2004-04-29  Martin Baulig  <martin@ximian.com>
6783
6784         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
6785
6786         * statement.cs (Using.EmitLocalVariableDecls): Use
6787         TypeManager.idisposable_type, not typeof (IDisposable).
6788         (Foreach.EmitCollectionForeach): Added support for valuetypes.
6789
6790 2004-04-29  Martin Baulig  <martin@ximian.com>
6791
6792         * class.cs (Event.Define): Don't emit the field and don't set
6793         RTSpecialName and SpecialName for events on interfaces.  Fixes
6794         #57703. 
6795
6796 2004-04-29  Raja R Harinath  <rharinath@novell.com>
6797
6798         Refactor Attribute.ApplyAttributes.
6799         * attribute.cs (Attributable): New base class for objects that can
6800         have Attributes applied on them.
6801         (Attribute): Make AttributeUsage fields public.
6802         (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
6803         (Attribute.IsInternalCall): New property.
6804         (Attribute.UsageAttr): Convert to a public read-only property.
6805         (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
6806         (Attribute.ResolveType, Attribute.Resolve)
6807         (Attribute.ScanForIndexerName): Update to reflect changes.
6808         (Attribute.CheckAttributeTarget): Re-format.
6809         (Attribute.ApplyAttributes): Refactor, to various
6810         Attributable.ApplyAttributeBuilder methods.
6811         * decl.cs (MemberCore): Make Attributable.
6812         * class.cs (Accessor): Make Attributable.
6813         (MethodData.ApplyAttributes): Use proper attribute types, not
6814         attribute names.
6815         (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
6816         (TypeContainer.ApplyAttributeBuilder)
6817         (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
6818         (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)   
6819         (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
6820         (Operator.ApplyAttributeBuilder): New factored-out methods.
6821         * const.cs (Const.ApplyAttributeBuilder): Likewise.
6822         * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
6823         * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
6824         * parameter.cs (ParameterBase): New Attributable base class
6825         that can also represent Return types.
6826         (Parameter): Update to the changes.
6827
6828 2004-04-29  Jackson Harper  <jackson@ximian.com>
6829
6830         * driver.cs: Prefer the corlib system version when looking for
6831         assemblies in the GAC. This is still a hack, but its a better hack
6832         now.
6833         
6834 2004-04-29  Marek Safar  <marek.safar@seznam.cz>
6835
6836         * decl.cs, enum.cs: Improved error 3005 reporting.
6837   
6838         * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
6839         (related_symbols): New private member for list of symbols
6840         related to reported error/warning.
6841         
6842         * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
6843
6844 2004-04-29  Martin Baulig  <martin@ximian.com>
6845
6846         * ecore.cs (Expression.Constantify): If we're an enum and
6847         TypeManager.TypeToCoreType() doesn't give us another type, use
6848         t.UnderlyingSystemType.  Fixes #56178.  
6849
6850 2004-04-29  Martin Baulig  <martin@ximian.com>
6851
6852         * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
6853         interfaces and for each interface, only add members directly
6854         declared in that interface.  Fixes #53255.
6855
6856 2004-04-28  Martin Baulig  <martin@ximian.com>
6857
6858         * expression.cs (ConditionalLogicalOperator): Use a temporary
6859         variable for `left' to avoid that we evaluate it more than once;
6860         bug #52588.
6861
6862 2004-04-28  Martin Baulig  <martin@ximian.com>
6863
6864         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
6865         `void[]' (CS1547).
6866
6867 2004-04-28  Martin Baulig  <martin@ximian.com>
6868
6869         * statement.cs (LocalInfo.Resolve): Check whether the type is not
6870         void (CS1547).
6871
6872         * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
6873         whether the type is not void (CS1547).
6874
6875 2004-04-28  Martin Baulig  <martin@ximian.com>
6876
6877         * expression.cs (Unary.DoResolveLValue): Override this and report
6878         CS0131 for anything but Operator.Indirection.
6879
6880 2004-04-28  Martin Baulig  <martin@ximian.com>
6881
6882         Committing a patch from Ben Maurer; see bug #50820.
6883
6884         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
6885         check for classes.
6886
6887         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
6888         classes.        
6889
6890 2004-04-28  Martin Baulig  <martin@ximian.com>
6891
6892         Committing a patch from Ben Maurer; see bug #50820.
6893
6894         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
6895         check for classes.
6896
6897         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
6898         classes.        
6899
6900 2004-04-28  Martin Baulig  <martin@ximian.com>
6901
6902         * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
6903         (Block.AddLabel): Call DoLookupLabel() to only search in the
6904         current block.
6905
6906 2004-04-28  Martin Baulig  <martin@ximian.com>
6907
6908         * cfold.cs (ConstantFold.BinaryFold): Added special support for
6909         comparing StringConstants and NullLiterals in Equality and Inequality.
6910
6911 2004-04-28  Jackson Harper  <jackson@ximian.com>
6912
6913         * driver.cs: Attempt to load referenced assemblies from the
6914         GAC. This is the quick and dirty version of this method that
6915         doesnt take into account versions and just takes the first
6916         canidate found. Will be good enough for now as we will not have more
6917         then one version installed into the GAC until I update this method.
6918
6919 2004-04-28  Martin Baulig  <martin@ximian.com>
6920
6921         * typemanager.cs (TypeManager.CheckStructCycles): New public
6922         static method to check for cycles in the struct layout.
6923
6924         * rootcontext.cs (RootContext.PopulateTypes): Call
6925         TypeManager.CheckStructCycles() for each TypeContainer.
6926         [Note: We only need to visit each type once.]
6927
6928 2004-04-28  Martin Baulig  <martin@ximian.com>
6929
6930         * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
6931
6932         * const.cs (Const.LookupConstantValue): Return a `bool' signalling
6933         success and added `out object value'.  Use a `bool resolved' field
6934         to check whether we've already been called rather than
6935         `ConstantValue != null' since this breaks for NullLiterals.
6936
6937 2004-04-28  Raja R Harinath  <rharinath@novell.com>
6938
6939         * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
6940         setting of this flag, since the 'set' method may be non-public.
6941
6942 2004-04-28  Raja R Harinath  <rharinath@novell.com>
6943
6944         * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
6945         check on current_vector.Block.
6946
6947 2004-04-27  Martin Baulig  <martin@ximian.com>
6948
6949         * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
6950         a field initializer.  Fixes #56459.
6951
6952 2004-04-27  Martin Baulig  <martin@ximian.com>
6953
6954         * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
6955         we're not attempting to use an indexer.  Fixes #52154.
6956
6957 2004-04-27  Martin Baulig  <martin@ximian.com>
6958
6959         * statement.cs (Return): Don't create a return label if we don't
6960         need it; reverts my change from January 20th.  Thanks to Ben
6961         Maurer for this.
6962
6963 2004-04-27  Martin Baulig  <martin@ximian.com>
6964
6965         According to the spec, `goto' can only leave a nested scope, but
6966         never enter it.
6967
6968         * statement.cs (Block.LookupLabel): Only lookup in the current
6969         block, don't recurse into parent or child blocks.
6970         (Block.AddLabel): Check in parent and child blocks, report
6971         CS0140/CS0158 if we find a duplicate.
6972         (Block): Removed this indexer for label lookups.
6973         (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
6974         this already does the error reporting for us.
6975
6976         * flowanalysis.cs
6977         (FlowBranching.UsageVector.Block): New public variable; may be null.
6978         (FlowBranching.CreateSibling): Added `Block' argument.
6979         (FlowBranching.LookupLabel): New public virtual method.  Lookup a
6980         label for the target of a `goto' and check whether we're not
6981         leaving a `finally'.
6982
6983 2004-04-27  Martin Baulig  <martin@ximian.com>
6984
6985         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
6986         a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
6987         just for returns).
6988
6989 2004-04-27  Martin Baulig  <martin@ximian.com>
6990
6991         * statement.cs (Block.AddLabel): Also check for implicit blocks
6992         and added a CS0158 check.
6993
6994 2004-04-27  Martin Baulig  <martin@ximian.com>
6995
6996         * flowanalysis.cs (FlowBranchingLoop): New class.
6997         (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
6998         UsageVector's instead of an ArrayList.
6999         (FlowBranching.Label): Likewise.
7000         (FlowBranching.UsageVector.MergeBreakOrigins): New method.
7001         (FlowBranching.AddBreakVector): New method.
7002
7003 2004-04-27  Miguel de Icaza  <miguel@ximian.com>
7004
7005         * attribute.cs: Small regression fix: only convert the type if we
7006         the type is different, fixes System.Drawing build.
7007
7008 2004-04-27  Martin Baulig  <martin@ximian.com>
7009
7010         * attribute.cs (Attribute.Resolve): If we have a constant value
7011         for a named field or property, implicity convert it to the correct
7012         type.
7013
7014 2004-04-27  Raja R Harinath  <rharinath@novell.com>
7015
7016         * statement.cs (Block.Block): Implicit blocks share
7017         'child_variable_names' fields with parent blocks.
7018         (Block.AddChildVariableNames): Remove.
7019         (Block.AddVariable): Mark variable as "used by a child block" in
7020         every surrounding block.
7021         * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
7022         been used in a child block, complain about violation of "Invariant
7023         meaning in blocks" rule.
7024         * cs-parser.jay (declare_local_variables): Don't use
7025         AddChildVariableNames.
7026         (foreach_statement): Don't create an implicit block: 'foreach'
7027         introduces a scope.
7028
7029 2004-04-23  Miguel de Icaza  <miguel@ximian.com>
7030
7031         * convert.cs (ImplicitNumericConversion): 0 is also positive when
7032         converting from 0L to ulong.  Fixes 57522.
7033
7034 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
7035
7036         * decl.cs (FindMemberToOverride): Fix wrong warning for case when
7037         derived class hides via 'new' keyword field from base class (test-242.cs).
7038         TODO: Handle this in the more general way.
7039         
7040         * class.cs (CheckBase): Ditto.
7041
7042 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
7043
7044         * decl.cs (caching_flags): New member for storing cached values
7045         as bit flags.
7046         (MemberCore.Flags): New enum where bit flags for caching_flags
7047         are defined.
7048         (MemberCore.cls_compliance): Moved to caching_flags.
7049         (DeclSpace.Created): Moved to caching_flags.
7050
7051         * class.cs: Use caching_flags instead of DeclSpace.Created
7052         
7053 2004-04-21  Miguel de Icaza  <miguel@ximian.com>
7054
7055         * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
7056         if we are only a derived class, not a nested class.
7057
7058         * typemanager.cs: Same as above, but do this at the MemberLookup
7059         level (used by field and methods, properties are handled in
7060         PropertyExpr).   Allow for the qualified access if we are a nested
7061         method. 
7062
7063 2004-04-21  Marek Safar  <marek.safar@seznam.cz>
7064
7065         * class.cs: Refactoring.
7066         (IMethodData): New inteface; Holds links to parent members
7067         to avoid member duplication (reduced memory allocation).
7068         (Method): Implemented IMethodData interface.
7069         (PropertyBase): New inner classes for get/set methods.
7070         (PropertyBase.PropertyMethod): Implemented IMethodData interface
7071         (Event): New inner classes for add/remove methods.
7072         (Event.DelegateMethod): Implemented IMethodData interface.
7073
7074         * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
7075         EmitContext (related to class.cs refactoring).
7076
7077 2004-04-21  Raja R Harinath  <rharinath@novell.com>
7078
7079         * delegate.cs (Delegate.VerifyApplicability): If the number of
7080         arguments are the same as the number of parameters, first try to
7081         verify applicability ignoring  any 'params' modifier on the last
7082         parameter.
7083         Fixes #56442.
7084
7085 2004-04-08  Martin Baulig  <martin@ximian.com>
7086
7087         Merged latest changes into gmcs.  Please keep this comment in
7088         here, it makes it easier for me to see what changed in MCS since
7089         the last time I merged.
7090
7091 2004-04-16  Raja R Harinath  <rharinath@novell.com>
7092
7093         * class.cs (TypeContainer.AddIndexer): Use
7094         'ExplicitInterfaceName' to determine if interface name was
7095         explicitly specified.  'InterfaceType' is not initialized at this time.
7096         (TypeContainer.DefineIndexers): Remove use of temporary list.  The
7097         Indexers array is already in the required order.  Initialize
7098         'IndexerName' only if there are normal indexers.
7099         (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
7100         (TypeContainer.Emit): Emit DefaultMember attribute only if
7101         IndexerName is initialized.
7102         Fixes #56300.
7103
7104 2004-04-15  Benjamin Jemlich  <pcgod@gmx.net>
7105
7106         * enum.cs (Enum.DefineType): Don't allow char as type for enum.
7107         Fixes #57007
7108
7109 2004-04-15  Raja R Harinath  <rharinath@novell.com>
7110
7111         * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
7112         attributes.
7113         Fix for #56456.
7114
7115         * attribute.cs (Attribute.Resolve): Check for duplicate named
7116         attributes.
7117         Fix for #56463.
7118
7119 2004-04-15  Miguel de Icaza  <miguel@ximian.com>
7120
7121         * iterators.cs (MarkYield): track whether we are in an exception,
7122         and generate code accordingly.  Use a temporary value to store the
7123         result for our state.
7124
7125         I had ignored a bit the interaction of try/catch with iterators
7126         since their behavior was not entirely obvious, but now it is
7127         possible to verify that our behavior is the same as MS .NET 2.0
7128
7129         Fixes 54814
7130
7131 2004-04-14  Miguel de Icaza  <miguel@ximian.com>
7132
7133         * iterators.cs: Avoid creating temporaries if there is no work to
7134         do. 
7135
7136         * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
7137         Enumerations, use TypeManager.EnumToUnderlying and call
7138         recursively. 
7139
7140         Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
7141         bug #57013
7142
7143         (This.Emit): Use EmitContext.EmitThis to emit our
7144         instance variable.
7145
7146         (This.EmitAssign): Ditto.
7147
7148         * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
7149         codepaths, we will move all the functionality into
7150         Mono.CSharp.This 
7151
7152         (FieldExpr.EmitAssign): Ditto.
7153
7154         This fixes several hidden bugs that I uncovered while doing a code
7155         review of this today.
7156
7157         * codegen.cs (EmitThis): reworked so the semantics are more clear
7158         and also support value types "this" instances.
7159
7160         * iterators.cs: Changed so that for iterators in value types, we
7161         do not pass the value type as a parameter.  
7162
7163         Initialization of the enumerator helpers is now done in the caller
7164         instead of passing the parameters to the constructors and having
7165         the constructor set the fields.
7166
7167         The fields have now `assembly' visibility instead of private.
7168
7169 2004-04-11  Miguel de Icaza  <miguel@ximian.com>
7170
7171         * expression.cs (Argument.Resolve): Check if fields passed as ref
7172         or out are contained in a MarshalByRefObject.
7173
7174         * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
7175         another compiler type.
7176
7177 2004-04-06 Ben Maurer  <bmaurer@users.sourceforge.net>
7178
7179         * class.cs (Indexer.Define): use the new name checking method.
7180         Also, return false on an error.
7181         * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
7182         (is_identifier_[start/part]_character): make static.
7183
7184 2004-04-10  Miguel de Icaza  <miguel@ximian.com>
7185
7186         * expression.cs (Binary.ResolveOperator): Do no append strings
7187         twice: since we can be invoked more than once (array evaluation)
7188         on the same concatenation, take care of this here.  Based on a fix
7189         from Ben (bug #56454)
7190
7191 2004-04-08  Sebastien Pouliot  <sebastien@ximian.com>
7192
7193         * codegen.cs: Fix another case where CS1548 must be reported (when 
7194         delay-sign isn't specified and no private is available #56564). Fix
7195         loading the ECMA "key" to delay-sign an assembly. Report a CS1548 
7196         error when MCS is used on the MS runtime and we need to delay-sign 
7197         (which seems unsupported by AssemblyBuilder - see #56621).
7198
7199 2004-04-08  Marek Safar  <marek.safar@seznam.cz>
7200
7201         * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
7202         (TypeManager.ComputeNamespaces): Faster implementation for
7203         Microsoft runtime.
7204
7205         * compiler.csproj: Updated AssemblyName to mcs.
7206
7207 2004-05-11  Jackson Harper  <jackson@ximian.com>
7208
7209         * Makefile: Preserve MONO_PATH
7210         
7211 2004-05-11  Jackson Harper  <jackson@ximian.com>
7212
7213         * Makefile: Use mono and mcs to build gmcs
7214         
7215 2004-05-03  Miguel de Icaza  <miguel@ximian.com>
7216
7217         * codegen.cs: Add patch from Robert Shade
7218         <rshade@dvsconsulting.com>, use FileAccess.Read on the keyfile, to
7219         sync with mcs.
7220
7221 2004-05-02  Sebastien Pouliot  <sebastien@ximian.com>
7222
7223         * CryptoConvert.cs: Updated to latest version. Fix issue with 
7224         incomplete key pairs (#57941).
7225
7226 2004-04-08  Sebastien Pouliot  <sebastien@ximian.com>
7227
7228         * codegen.cs: Fix another case where CS1548 must be reported (when 
7229         delay-sign isn't specified and no private is available #56564). Fix
7230         loading the ECMA "key" to delay-sign an assembly. Report a CS1548 
7231         error when MCS is used on the MS runtime and we need to delay-sign 
7232         (which seems unsupported by AssemblyBuilder - see #56621).
7233
7234 2004-04-29  Jackson Harper  <jackson@ximian.com>
7235
7236         * Makefile: Set MONO_PATH to use the bootstrap corlib
7237         * driver.cs: Check the GAC for referenced assemblies.
7238                 
7239 2004-04-29  Martin Baulig  <martin@ximian.com>
7240
7241         * Makefile (gmcs.exe): Set MONO_PATH to use `../class/lib/net_2_0'.
7242
7243 2004-04-07  Martin Baulig  <martin@ximian.com>
7244
7245         * expression.cs (Binary.ResolveOperator): Added special case for
7246         Equality/Inequality between a type parameter and a null literal.
7247
7248 2004-04-07  Martin Baulig  <martin@ximian.com>
7249
7250         * convert.cs: Check null literal -> type parameter conversions.
7251
7252 2004-04-07  Martin Baulig  <martin@ximian.com>
7253
7254         * generic.cs (ConstructedType.CheckConstraints): Enforce the
7255         `class' and `struct' constraints.
7256
7257 2004-04-07  Martin Baulig  <martin@ximian.com>
7258
7259         * generic.cs (SpecialConstraint): New public enum.
7260         (Constraints.Resolve): Added support for the `class' and `struct'
7261         constraints.
7262
7263         * cs-parser.jay (type_parameter_constraint): Added support for the
7264         `class' and `struct' constraints.
7265
7266 2004-04-07  Martin Baulig  <martin@ximian.com>
7267
7268         * support.cs (GenericConstraints): Replaced `Types' by
7269         `ClassConstraint' and `InterfaceConstraints'; added
7270         `HasClassConstraint'.   
7271
7272 2004-04-07  Martin Baulig  <martin@ximian.com>
7273
7274         * generic.cs
7275         (Constraints.InterfaceConstraints): New public property.
7276         (Constraints.Types): Make this property public
7277         (TypeParameter): Implement IMemberContainer.
7278         (TypeParameter.Define): Take a `GenericTypeParameterBuilder'
7279         instead of a TypeBuilder/MethodBuilder; pass the interface
7280         constraints to TypeManager.AddTypeParameter().
7281         (TypeParameter.DefineType): Just take an EmitContext and no
7282         TypeBuilder/MethodBuilder.  Use the new public API.
7283
7284         * typemanager.cs (TypeManager.AddTypeParameter): Added
7285         `TypeExpr[]' argument; add the interfaces to the
7286         `builder_to_ifaces' hash.
7287         (TypeManager.LookupMemberContainer): For
7288         GenericTypeParameterBuilders, get the TypeParameter from the
7289         `builder_to_type_param'.
7290         (TypeManager.FindMembers): For GenericTypeParameterBuilders, get
7291         the TypeParameter and call FindMembers on it.
7292
7293 2004-04-07  Martin Baulig  <martin@ximian.com>
7294
7295         * class.cs
7296         (MethodCore.GenericMethod): Moved this field here from Method.
7297         (MethodCore.IsDuplicateImplementation): Take the number of type
7298         parameters into account if we're a generic method.
7299
7300         * expression.cs (Invocation.InferTypeArguments): Don't return true
7301         if `arguments' is null; we still need to check whether we actually
7302         don't need to infer anything in this case.
7303         (MemberAccess): Merged the functionality from GenericMemberAccess
7304         into this class.
7305
7306         * generic.cs (GenericMemberAccess): Removed.
7307
7308 2004-04-05  Martin Baulig  <martin@ximian.com>
7309
7310         * decl.cs (MemberCore): For generic classes, interfaces and
7311         structs, `Name' now includes the number of type parameters
7312         ("Stack!1.Node!1").
7313         (DeclSpace.FindType): Removed the `num_type_args' argument; we now
7314         encode the number of type arguments in the type name.
7315
7316         * expression.cs (Expression.MemberLookup): Removed the
7317         `num_type_args' argument; we now encode the number of type
7318         arguments in the type name.
7319
7320         * ecore.cs (SimpleName): Encode the number of type arguments in
7321         the type name itself.
7322
7323         * generic.cs (ConstructedType): Likewise.
7324
7325         * tree.cs (Tree.RecordDecl): Take a `string' instead of a
7326         `MemberName'; we now include the number of type parameters in the
7327         type name.
7328
7329         * typemanager.cs (TypeManager.CheckGeneric): Removed.
7330         (TypeManager.MemberLookup): Removed the
7331         `num_type_args' argument; we now encode the number of type
7332         arguments in the type name.     
7333
7334 2004-04-03  Martin Baulig  <martin@ximian.com>
7335
7336         * decl.cs (MemberCore.ctor): Take a MemberName instead of a sting.
7337         (MemberCore.MemberName): Moved here from MemberBase.
7338         (DeclSpace.SetParameterInfo): Just take the constraints as an
7339         ArrayList; we already have the type parameters in our
7340         `MemberName'; also do the CS0080 reporting here.
7341
7342         * cs-parser.jay (struct_declaration): Use `member_name' instead of
7343         `IDENTIFIER opt_type_parameter_list'; when constructing our
7344         `MemberName', it'll already include our type parameters.
7345         (class_declaration, interface_declaration): Likewise.
7346         (delegate_declaration): Likewise.
7347         (MakeName): Take a MemberName and return a MemberName.
7348         The following two changes are required to avoid shift/reduce conflicts:
7349         (member_name): Don't include a TypeName anymore; ie. this is now
7350         just 'IDENTIFIER opt_type_parameter_list'.
7351         (property_declaration, event_declaration): Use a
7352         `namespace_or_type_name' instead of a `member_name'.            
7353
7354 2004-04-03  Martin Baulig  <martin@ximian.com>
7355
7356         * decl.cs (MemberName): Renamed to `TypeName' and created a new
7357         `MemberName' class.
7358         (TypeName): Formerly known as MemberName.
7359
7360         * namespace.cs (NamespaceEntry.UsingAlias): Take a `TypeName'
7361         instead of a `MemberName'.
7362
7363         * cs-parser.jay (namespace_or_type_name): Create a TypeName.
7364         (member_name): New rule; create a MemberName.
7365
7366 2004-04-02  Martin Baulig  <martin@ximian.com>
7367
7368         * namespace.cs (NamespaceEntry.VerifyUsing): Added error checking
7369         (CS0305 and CS0308).
7370
7371 2004-04-02  Martin Baulig  <martin@ximian.com>
7372
7373         * generic.cs (GenericMemberAccess.ResolveAsTypeStep): Added
7374         support for nested types.
7375
7376 2004-04-02  Martin Baulig  <martin@ximian.com>
7377
7378         * ecore.cs (IAlias): New public interface.
7379         (TypeExpr, TypeExpression): Implement IAlias.
7380         (TypeAliasExpression): New public class.
7381
7382         * namespace.cs (Namespace): Implement IAlias.
7383         (Namespace.Lookup): Return an IAlias instead on an object.
7384         (Namespace.DefineName): Take an IAlias instead of an object.
7385         (NamespaceEntry.AliasEntry.Resolve): Return an IAlias instead of
7386         an object.
7387         (NamespaceEntry.UsingAlias): Take a Membername instead of an
7388         Expression.
7389         (NamespaceEntry.LookupAlias): Return an IAlias instead on an
7390         object.
7391         (NamespaceEntry.Lookup): Likewise.
7392
7393         * rootcontext.cs (RootContext.LookupType): Return a TypeExpr
7394         instead of a Type.      
7395
7396         * decl.cs (DeclSpace): Implement IAlias.
7397         (DeclSpace.LookupAlias): Return an IAlias instead of a string.
7398
7399         * generic.cs (ConstructedType): Improved error checking.
7400
7401 2004-04-02  Martin Baulig  <martin@ximian.com>
7402
7403         * convert.cs: Added type parameter conversions.
7404
7405         * ecore.cs
7406         (UnboxCast.Emit): Emit an `unbox.any' for type params.
7407         (ClassCast.Emit): If the source type is a type parameter, box it.
7408         If the target type is a type parameter, emit an `unbox.any'
7409         instead of a `classcast'.1      
7410
7411 2004-04-01  Martin Baulig  <martin@ximian.com>
7412
7413         * cs-tokenizer.cs (parse_less_than): Allow Token.DOT.
7414
7415 2004-04-01  Martin Baulig  <martin@ximian.com>
7416
7417         * generic.cs (ConstructedType.CheckConstraints): Use
7418         Convert.ImplicitStandardConversionExists(); user-defined implicit
7419         conversions are not allowed according to the spec.
7420
7421 2004-03-30  Martin Baulig  <martin@ximian.com>
7422
7423         * expression.cs (New): Added support for type parameters.
7424
7425         * typemanager.cs
7426         (TypeManager.activator_type): New public static field.
7427         (TypeManager.activator_create_instance): Likewise.
7428
7429 2004-03-30  Martin Baulig  <martin@ximian.com>
7430
7431         * typemanager.cs (TypeManager.HasConstructorConstraint): New
7432         public method.
7433
7434 2004-03-30  Martin Baulig  <martin@ximian.com>
7435
7436         * generic.cs (ConstructedType.CheckConstraints): Actually follow
7437         the spec here: the argument type must be convertible to the
7438         constraints.
7439
7440 2004-03-30  Martin Baulig  <martin@ximian.com>
7441
7442         * generic.cs
7443         (TypeParameter.Define, TypeParameter.DefineMethod): Call
7444         TypeManager.AddTypeParameter().
7445         (ConstructedType.CheckConstraints): Re-enable this and actually
7446         check whether we have a constructor constraint.
7447
7448         * typemanager.cs
7449         (TypeManager.builder_to_type_param): New static field.
7450         (TypeManager.AddTypeParameter): New static method.
7451         (TypeManager.LookupTypeParameter): New public method.
7452
7453 2004-03-30  Martin Baulig  <martin@ximian.com>
7454
7455         * generic.cs (TypeParameter.DefineType): Return a boolean and use
7456         the new API to actually define the constructor constraint.
7457
7458         * typemanager.cs
7459         (TypeManager.new_constraint_attr_type): New static field.
7460         (TypeManager.InitCoreTypes): Initialize it.
7461
7462 2004-03-30  Martin Baulig  <martin@ximian.com>
7463
7464         * generic.cs (Constraints): Completed error checking, use correct
7465         error numbers.
7466
7467 2004-03-29  Martin Baulig  <martin@ximian.com>
7468
7469         * delegate.cs (Delegate.VerifyMethod): Infer type arguments.
7470
7471         * expression.cs (Invocation.InferTypeArguments): Added overloaded
7472         public version which takes a `ParameterData pd' instead of an
7473         `ArrayList args'.
7474
7475 2004-03-29  Martin Baulig  <martin@ximian.com>
7476
7477         * typemanager.cs (TypeManager.IsGenericMethod): Take a MethodBase,
7478         not a MethodInfo.       
7479
7480 2004-03-29  Martin Baulig  <martin@ximian.com>
7481
7482         * expression.cs (Argument.ResolveMethodGroup): If we're a
7483         ConstructedType, call GetMemberAccess() on it.  
7484
7485 2004-03-29  Martin Baulig  <martin@ximian.com>
7486
7487         * class.cs (MethodBase.CheckGenericOverride): New abstract method.
7488         (MethodCore.CheckGenericOverride): When overriding a generic
7489         method, check whether the constraints match.
7490
7491         * support.cs (GenericConstraints): New public interface.
7492         (ParameterData.GenericConstraints): New public method.
7493
7494         * parameter.cs (Parameter.Resolve): Check whether we're a generic
7495         method parameter and compute our constraints if appropriate.
7496         (Parameter.GenericConstraints): New public property.
7497
7498         * generic.cs (Constraints): Implement GenericConstraints.
7499
7500 2004-03-29  Martin Baulig  <martin@ximian.com>
7501
7502         * decl.cs (MemberCache.FindMemberToOverride): Use
7503         `paramTypes [j].Equals (cmpAttrs [j])' instead of `=='.
7504
7505 2004-03-29  Martin Baulig  <martin@ximian.com>
7506
7507         * generic.cs (GenericMethod.Define): Resolve our type parameters.
7508
7509 2004-03-29  Martin Baulig  <martin@ximian.com>
7510
7511         * cs-parser.jay: Report CS0080 instead of -200 ("Constraints are
7512         not allowed on non-generic declarations").
7513
7514 2004-03-29  Martin Baulig  <martin@ximian.com>
7515
7516         * expression.cs (Invocation.InferTypeArguments): Added overloaded
7517         public version of this method.
7518
7519         * class.cs (MethodCore.IsDuplicateImplementation): Use
7520         Invocation.InferTypeArguments() to check this.
7521
7522 2004-03-29  Martin Baulig  <martin@ximian.com>
7523
7524         * convert.cs: Use TypeManager.IsDelegateType() instead of
7525         comparing types correctly.
7526
7527 2004-03-29  Martin Baulig  <martin@ximian.com>
7528
7529         * convert.cs: Use TypeManager.IsSubclassOf() instead of comparing
7530         types directly to make it work for generic instances.
7531
7532         * typemanager.cs (TypeManager.IsSubclassOf): New static method.
7533
7534 2004-03-29  Martin Baulig  <martin@ximian.com>
7535
7536         * typemanager.cs (TypeManager.MayBecomeEqualGenericTypes): Added
7537         support for arrays.     
7538
7539 2004-03-24  Martin Baulig  <martin@ximian.com>
7540
7541         * decl.cs (DeclSpace.FindType): Also use
7542         TypeManager.CheckGeneric() for types from the using clauses.
7543
7544 2004-03-23  Martin Baulig  <martin@ximian.com>
7545
7546         * expression.cs (Invocation.OverloadResolve): Added `bool
7547         may_fail' argument and use it instead of the Location.IsNull() hack.
7548
7549 2004-03-23  Martin Baulig  <martin@ximian.com>
7550
7551         * expression.cs (Invocation.InferType): Use correct type inference
7552         rules here.     
7553
7554 2004-03-23  Martin Baulig  <martin@ximian.com>
7555
7556         * ecore.cs (MethodGroupExpr.Name): Use
7557         TypeManager.CSharpSignature() instead of just the name.
7558
7559         * expression.cs (Invocation.OverloadResolve): Provide better error
7560         reporting.
7561         (Invocation.DoResolve): OverloadResolve() never returns null
7562         without reporting an error, so removed the error -6 reporting here.
7563
7564 2004-03-23  Martin Baulig  <martin@ximian.com>
7565
7566         * typemanager.cs (TypeManager.GetMethodFlags): Fixed the FIXME for
7567         generic methods.
7568
7569         * cs-parser.jay (delegate_declaration): Support generic delegates.
7570
7571         * delegate.cs: Support generic delegates.
7572
7573 2004-03-22  Martin Baulig  <martin@ximian.com>
7574
7575         * expression.cs (Invocation.InferParamsTypeArguments): New static
7576         method; does type inference for params arguments.
7577
7578 2004-03-21  Martin Baulig  <martin@ximian.com>
7579
7580         * typemanager.cs (TypeManager.IsGenericMethod): New public static
7581         method; checks whether a method is a generic method.    
7582
7583         * expression.cs (Invocation.InferTypeArguments): New static method;
7584         infer type arguments for generic method invocation.
7585
7586         * ecore.cs (MethodGroupExpr.HasTypeArguments): New public
7587         property; we set this to true if we're resolving a generic method
7588         invocation and the user specified type arguments, ie. we're not
7589         doing type inference.
7590
7591 2004-03-20  Martin Baulig  <martin@ximian.com>
7592
7593         * class.cs (MethodData.DeclaringType): New public property.
7594         (MethodData.Define): Set DeclaringType here.
7595         (Operator.Define): Use OperatorMethod.MethodData.DeclaringType
7596         instead of OperatorMethodBuilder.DeclaringType.
7597
7598 2004-03-20  Martin Baulig  <martin@ximian.com>
7599
7600         * cs-tokenizer.cs (xtoken): Return a special
7601         Token.DEFAULT_OPEN_PARENS for "`default' followed by open parens".
7602
7603         * cs-parser.jay (default_value_expression): Switch to the new
7604         syntax (14.5.13).
7605
7606 2004-03-19  Martin Baulig  <martin@ximian.com>
7607
7608         * decl.cs (MemberName): New class.  We use this to "construct"
7609         namespace_or_type_name's.
7610
7611         * generics.cs (TypeArguments.GetDeclarations): New public method;
7612         returns the type arguments as a string[] and reports a CS0081 if
7613         one of them is not an identifier.
7614
7615         * class.cs (MemberBase): The .ctor now takes the name as a
7616         MemberName instead of a string.
7617         (MemberBase.ExplicitInterfaceName): Changed type from string to
7618         Expression.
7619         (MemberBase.DoDefine): If we're an explicit implementation, the
7620         InterfaceType may be a generic instance.
7621
7622         * cs-parser.jay (namespace_or_type_name): Return a MemberName.
7623         (namespace_name): Call MemberName.GetName () to transform the
7624         MemberName into a string and ensure we don't have any type
7625         arguments.
7626         (type_name): Call MemberName.GetTypeExpression() to transfrom the
7627         MemberName into an expression.
7628         (method_header): Use namespace_or_type_name instead of member_name.     
7629
7630 2004-04-07  Miguel de Icaza  <miguel@ximian.com>
7631
7632         * rootcontext.cs: Add new types to the boot resolution.
7633
7634         * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
7635         MulticastDelegate is not allowed.
7636
7637         * typemanager.cs: Add new types to lookup: System.TypedReference
7638         and ArgIterator.
7639
7640         * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
7641         check for TypedReference or ArgIterator, they are not allowed. 
7642
7643         * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
7644         makes us properly catch 1510 in some conditions (see bug 56016 for
7645         details). 
7646
7647 2004-04-06  Bernie Solomon  <bernard@ugsolutions.com>
7648
7649         * CryptoConvert.cs: update from corlib version
7650         with endian fixes.
7651
7652 2004-04-05  Miguel de Icaza  <miguel@ximian.com>
7653
7654         * class.cs (Indexer.Define): Check indexername declaration
7655
7656 2004-04-05  Marek Safar  <marek.safar@seznam.cz>
7657
7658         * attribute.cs (IsClsCompliant): Fixed problem with handling
7659         all three states (compliant, not-compliant, undetected).
7660
7661 2004-03-30  Marek Safar  <marek.safar@seznam.cz>
7662
7663         * attribute.cs (Attribute): Location is now public.
7664         (Resolve): Store resolved arguments (pos_values) in attribute class.
7665         Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
7666         (GetClsCompliantAttributeValue): New method that gets
7667         CLSCompliantAttribute value.
7668         (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
7669         if exists else null.
7670         (AttributeTester): New class for CLS-Compliant verification routines.
7671
7672         * class.cs (Emit): Add CLS-Compliant verification.
7673         (Method.GetSignatureForError): Implemented.
7674         (Constructor.GetSignatureForError): Implemented
7675         (Constructor.HasCompliantArgs): Returns if constructor has
7676         CLS-Compliant arguments.
7677         (Constructor.Emit): Override.
7678         (Construcor.IsIdentifierClsCompliant): New method; For constructors
7679         is needed to test only parameters.
7680         (FieldBase.GetSignatureForError): Implemented.
7681         (TypeContainer): New member for storing base interfaces.
7682         (TypeContainer.FindMembers): Search in base interfaces too.
7683
7684         * codegen.cs (GetClsComplianceAttribute): New method that gets
7685         assembly or module CLSCompliantAttribute value.
7686         (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
7687         for assembly.
7688         (ModuleClass.Emit): Add error 3012 test.
7689
7690         * const.cs (Emit): Override and call base for CLS-Compliant tests.
7691
7692         * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
7693         state for all decl types.
7694         (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
7695         if CLS-Compliant tests are required.
7696         (IsClsCompliaceRequired): New method. Analyze whether code
7697         must be CLS-Compliant.
7698         (IsExposedFromAssembly): New method. Returns true when MemberCore
7699         is exposed from assembly.
7700         (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
7701         value or gets cached value.
7702         (HasClsCompliantAttribute): New method. Returns true if MemberCore
7703         is explicitly marked with CLSCompliantAttribute.
7704         (IsIdentifierClsCompliant): New abstract method. This method is
7705         used to testing error 3005.
7706         (IsIdentifierAndParamClsCompliant): New method. Common helper method
7707         for identifier and parameters CLS-Compliant testing.
7708         (VerifyClsCompliance): New method. The main virtual method for
7709         CLS-Compliant verifications.
7710         (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
7711         null. I don't know why is null (too many public members !).
7712         (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
7713         and get value of first CLSCompliantAttribute that found.
7714
7715         * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
7716         (VerifyClsCompliance): Override and add extra tests.
7717
7718         * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
7719         clscheck- disable CLS-Compliant verification event if assembly is has
7720         CLSCompliantAttribute(true).
7721
7722         * enum.cs (Emit): Override and call base for CLS-Compliant tests.
7723         ApllyAttribute is now called in emit section as in the other cases.
7724         Possible future Emit integration.
7725         (IsIdentifierClsCompliant): New override.
7726         (VerifyClsCompliance): New override.
7727         (GetEnumeratorName): Returns full enum name.
7728
7729         * parameter.cs (GetSignatureForError): Implemented.
7730
7731         * report.cs (WarningData): New struct for Warning message information.
7732         (LocationOfPreviousError): New method.
7733         (Warning): New method. Reports warning based on the warning table.
7734         (Error_T): New method. Reports error based on the error table.
7735
7736         * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
7737         verifications are done here.
7738
7739         * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
7740
7741         * typemanager.cs (cls_compliant_attribute_type): New member thath holds
7742         CLSCompliantAttribute.
7743         (all_imported_types): New member holds all imported types from other
7744         assemblies.
7745         (LoadAllImportedTypes): New method fills static table with exported types
7746         from all referenced assemblies.
7747         (Modules): New property returns all assembly modules.
7748
7749 2004-03-30  Miguel de Icaza  <miguel@ximian.com>
7750
7751         * cs-parser.jay: Add a rule to catch wrong event syntax instead of
7752         throwing a parser error.
7753
7754         * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
7755         which removes the hardcoded get_/set_ prefixes for properties, as
7756         IL allows for the properties to be named something else.  
7757
7758         Bug #56013
7759
7760         * expression.cs: Do not override operand before we know if it is
7761         non-null.  Fix 56207
7762
7763 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
7764
7765         * typemanager.cs: support for pinned variables.
7766
7767 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
7768
7769         * decl.cs, typemanager.cs: Avoid using an arraylist
7770         as a buffer if there is only one result set.
7771
7772 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
7773
7774         * expression.cs: Make sure you cant call a static method
7775         with an instance expression, bug #56174.
7776
7777 2004-03-29  Miguel de Icaza  <miguel@ximian.com>
7778
7779         * class.cs (IsDuplicateImplementation): Improve error reporting to
7780         flag 663 (method only differs in parameter modifier).
7781
7782         * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
7783         in preprocessor directives.
7784
7785         * location.cs (LookupFile): Allow for the empty path.
7786
7787         * attribute.cs (DefinePInvokeMethod): Fix 56148;  I would like a
7788         better approach for some of that patch, but its failing with the
7789         CharSet enumeration.  For now try/catch will do.
7790
7791         * typemanager.cs: Do not crash if a struct does not have fields.
7792         Fixes 56150.
7793
7794 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
7795
7796         * expression.cs: cs0213, cant fix a fixed expression.
7797         fixes 50231.
7798
7799 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
7800
7801         * cs-parser.jay: detect invalid embeded statements gracefully.
7802         bug #51113.
7803
7804 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
7805
7806         * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
7807         As a regex:
7808         s/
7809         the invocation type may not be a subclass of the tye of the item/
7810         The type of the item must be a subclass of the invocation item.
7811         /g
7812
7813         Fixes bug #50820.
7814
7815 2004-03-25  Sebastien Pouliot  <sebastien@ximian.com>
7816
7817         * attribute.cs: Added methods to get a string and a bool from an
7818         attribute. Required to information from AssemblyKeyFileAttribute,
7819         AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
7820         * codegen.cs: Modified AssemblyName creation to include support for
7821         strongnames. Catch additional exceptions to report them as CS1548.
7822         * compiler.csproj: Updated include CryptoConvert.cs.
7823         * compiler.csproj.user: Removed file - user specific configuration.
7824         * CryptoConvert.cs: New. A COPY of the class CryptoConvert from 
7825         Mono.Security assembly. The original class is maintained and tested in
7826         /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
7827         * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
7828         like CSC 8.0 (C# v2) supports.
7829         * Makefile: Added CryptoConvert.cs to mcs sources.
7830         * rootcontext.cs: Added new options for strongnames.
7831
7832 2004-03-24 Ben Maurer  <bmaurer@users.sourceforge.net>
7833
7834         * driver.cs: For --expect-error, report error code `2'
7835         if the program compiled with no errors, error code `1' if
7836         it compiled with an error other than the one expected.
7837
7838 2004-03-24  Sebastien Pouliot  <sebastien@ximian.com>
7839
7840         * compiler.csproj: Updated for Visual Studio .NET 2003.
7841         * compiler.csproj.user: Updated for Visual Studio .NET 2003.
7842         * compiler.sln: Updated for Visual Studio .NET 2003.
7843
7844 2004-03-24  Ravi Pratap M  <ravi@ximian.com>
7845
7846         * expression.cs: Fix bug #47234. We basically need to apply the
7847         rule that we prefer the conversion of null to a reference type
7848         when faced with a conversion to 'object' (csc behaviour).
7849
7850 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
7851
7852         * statement.cs: Shorter form for foreach, eliminates
7853         a local variable. r=Martin.
7854
7855 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
7856
7857         * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
7858         checks if we can use brtrue/brfalse to test for 0.
7859         * expression.cs: use the above in the test for using brtrue/brfalse.
7860         cleanup code a bit.
7861
7862 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
7863
7864         * expression.cs: Rewrite string concat stuff. Benefits:
7865
7866         - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
7867         - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
7868         rather than a concat chain.
7869
7870         * typemanager.cs: Add lookups for more concat overloads.
7871
7872 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
7873
7874         * expression.cs: Emit shorter il code for array init.
7875
7876         newarr
7877         dup
7878         // set 1
7879
7880         // set 2
7881
7882         newarr
7883         stloc.x
7884
7885         ldloc.x
7886         // set 1
7887
7888         ldloc.x
7889         // set 2
7890
7891 2004-03-22 Ben Maurer  <bmaurer@users.sourceforge.net>
7892
7893         * statement.cs: Before, two switch blocks would be merged if the
7894         total size of the blocks (end_item - begin_item + 1) was less than
7895         two times the combined sizes of the blocks.
7896
7897         Now, it will only merge if after the merge at least half of the
7898         slots are filled.
7899
7900         fixes 55885.
7901
7902 2004-03-20  Atsushi Enomoto  <atsushi@ximian.com>
7903
7904         * class.cs : csc build fix for GetMethods(). See bug #52503.
7905
7906 2004-03-20 Ben Maurer  <bmaurer@users.sourceforge.net>
7907
7908         * expression.cs: Make sure fp comparisons work with NaN.
7909         This fixes bug #54303. Mig approved this patch a long
7910         time ago, but we were not able to test b/c the runtime
7911         had a related bug.
7912
7913 2004-03-19  Miguel de Icaza  <miguel@ximian.com>
7914
7915         * ecore.cs (TypExpr.GetHashCode): implement this overload. 
7916
7917 2004-03-19  Martin Baulig  <martin@ximian.com>
7918
7919         * class.cs (MemberCore.IsDuplicateImplementation): Check whether
7920         two overloads may unify for some type parameter substitutions and
7921         report a CS0408 if appropriate.
7922
7923 2004-03-19  Martin Baulig  <martin@ximian.com>
7924
7925         * class.cs (MemberCore.IsDuplicateImplementation): Report the
7926         error here and not in our caller.
7927
7928 2004-03-19  Martin Baulig  <martin@ximian.com>
7929
7930         * interface.cs: Completely killed this file.
7931         (Interface): We're now a TypeContainer and live in class.cs.
7932
7933         * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
7934         argument; we're now also called for interfaces.
7935         (TypeContainer.DefineMembers): Allow this method being called
7936         multiple times.
7937         (TypeContainer.GetMethods): New public method; formerly known as
7938         Interface.GetMethod().  This is used by PendingImplementation.
7939         (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
7940         it's now private and non-static.
7941         (Interface): Moved this here; it's now implemented similar to
7942         Class and Struct.
7943         (Method, Property, Event, Indexer): Added `bool is_interface'
7944         argument to their .ctor's.
7945         (MemberBase.IsInterface): New public field.
7946
7947         * cs-parser.jay: Create normal Method, Property, Event, Indexer
7948         instances instead of InterfaceMethod, InterfaceProperty, etc.
7949         (opt_interface_base): Removed; we now use `opt_class_base' instead.
7950         (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
7951
7952 2004-03-19  Martin Baulig  <martin@ximian.com>
7953
7954         * class.cs (MethodCore.IsDuplicateImplementation): New private
7955         method which does the CS0111 checking.
7956         (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
7957         Use IsDuplicateImplementation().
7958
7959 2004-03-17 Ben Maurer  <bmaurer@users.sourceforge.net>
7960
7961         * decl.cs (FindMemberToOverride): New method to find the correct
7962         method or property to override in the base class.
7963         * class.cs
7964             - Make Method/Property use the above method to find the
7965               version in the base class.
7966             - Remove the InheritableMemberSignatureCompare as it is now
7967               dead code.
7968
7969         This patch makes large code bases much faster to compile, as it is
7970         O(n) rather than O(n^2) to do this validation.
7971
7972         Also, it fixes bug 52458 which is that nested classes are not
7973         taken into account when finding the base class member.
7974
7975         Reviewed/Approved by Martin.
7976
7977 2004-03-17  Martin Baulig  <martin@ximian.com>
7978
7979         * expression.cs (MemberAccess.DoResolve): Take the parent's number
7980         of type arguments into account; use the `real_num_type_args'
7981         approach like in DoResolveAsTypeStep().
7982
7983         * generic.cs (GenericMemberAccess.DoResolve): Make this work for
7984         nested types.
7985
7986 2004-03-17  Marek Safar  <marek.safar@seznam.cz>
7987
7988         * interface.cs: In all interface classes removed redundant
7989         member initialization.
7990
7991 2004-03-16  Martin Baulig  <martin@ximian.com>
7992
7993         * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
7994
7995 2004-03-15  Miguel de Icaza  <miguel@ximian.com>
7996
7997         * decl.cs (DefineTypeAndParents): New helper method to define a
7998         type's containers before the type itself is defined;  This is a
7999         bug exposed by the recent changes to Windows.Forms when an
8000         implemented interface was defined inside a class that had not been
8001         built yet.   
8002
8003         * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
8004
8005         (Check): Loop correctly to report errors modifiers
8006         (UNSAFE was not in the loop, since it was the same as TOP).
8007
8008         * interface.cs: Every interface member now takes a ModFlags,
8009         instead of a "is_new" bool, which we set on the base MemberCore. 
8010
8011         Every place where we called "UnsafeOk" in the interface, now we
8012         call the proper member (InterfaceMethod.UnsafeOK) instead to get
8013         the unsafe settings from the member declaration instead of the
8014         container interface. 
8015
8016         * cs-parser.jay (opt_new): Allow unsafe here per the spec. 
8017
8018         * pending.cs (TypeAndMethods): Add `get_indexer_name' and
8019         `set_indexer_name' to the pending bits (one per type).
8020
8021         We fixed a bug today that was picking the wrong method to
8022         override, since for properties the existing InterfaceMethod code
8023         basically ignored the method name.  Now we make sure that the
8024         method name is one of the valid indexer names.
8025
8026 2004-03-14  Gustavo Giráldez  <gustavo.giraldez@gmx.net>
8027  
8028         * support.cs (SeekableStreamReader): Keep track of stream byte
8029         positions and don't mix them with character offsets to the buffer.
8030
8031         Patch from Gustavo Giráldez
8032
8033 2004-03-15  Marek Safar  <marek.safar@seznam.cz>
8034
8035         * interface.cs (InterfaceSetGetBase): Removed double member
8036         initialization, base class does it as well.
8037
8038 2004-03-13  Martin Baulig  <martin@ximian.com>
8039
8040         * class.cs: Reverted Miguel's latest commit; it makes mcs crash
8041         when compiling corlib.
8042
8043 2004-03-13  Miguel de Icaza  <miguel@ximian.com>
8044
8045         * convert.cs (ExplicitConversion): We were reporting an error on
8046         certain conversions (object_type source to a value type, when the
8047         expression was `null') before we had a chance to pass it through
8048         the user defined conversions.
8049
8050         * driver.cs: Replace / and \ in resource specifications to dots.
8051         Fixes 50752
8052
8053         * class.cs: Add check for duplicate operators.  Fixes 52477
8054
8055 2004-03-11  Miguel de Icaza  <miguel@ximian.com>
8056
8057         * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
8058         that are in the middle of the statements, not only at the end.
8059         Fixes #54987
8060
8061         * class.cs (TypeContainer.AddField): No longer set the
8062         `HaveStaticConstructor' flag, now we call it
8063         `UserDefineStaticConstructor' to diferentiate the slightly
8064         semantic difference.
8065
8066         The situation is that we were not adding BeforeFieldInit (from
8067         Modifiers.TypeAttr) to classes that could have it.
8068         BeforeFieldInit should be set to classes that have no static
8069         constructor. 
8070
8071         See:
8072
8073         http://www.yoda.arachsys.com/csharp/beforefieldinit.html
8074
8075         And most importantly Zoltan's comment:
8076
8077         http://bugzilla.ximian.com/show_bug.cgi?id=44229
8078
8079         "I think beforefieldinit means 'it's ok to initialize the type sometime 
8080          before its static fields are used', i.e. initialization does not need
8081          to be triggered by the first access to the type. Setting this flag
8082          helps the JIT to compile better code, since it can run the static
8083          constructor at JIT time, and does not need to generate code to call it
8084          (possibly lots of times) at runtime. Unfortunately, mcs does not set
8085          this flag for lots of classes like String. 
8086          
8087          csc sets this flag if the type does not have an explicit static 
8088          constructor. The reasoning seems to be that if there are only static
8089          initalizers for a type, and no static constructor, then the programmer
8090          does not care when this initialization happens, so beforefieldinit
8091          can be used.
8092          
8093          This bug prevents the AOT compiler from being usable, since it 
8094          generates so many calls to mono_runtime_class_init that the AOT code
8095          is much slower than the JITted code. The JITted code is faster, 
8096          because it does not generate these calls if the vtable is type is
8097          already initialized, which is true in the majority of cases. But the
8098          AOT compiler can't do this."
8099
8100 2004-03-10  Miguel de Icaza  <miguel@ximian.com>
8101
8102         * class.cs (MethodData.Emit): Refactor the code so symbolic
8103         information is generated for destructors;  For some reasons we
8104         were taking a code path that did not generate symbolic information
8105         before. 
8106
8107 2004-03-11 Ben Maurer  <bmaurer@users.sourceforge.net>
8108
8109         * class.cs: Create a Constructor.CheckBase method that
8110         takes care of all validation type code. The method
8111         contains some code that was moved from Define.
8112
8113         It also includes new code that checks for duplicate ctors.
8114         This fixes bug #55148.
8115
8116 2004-03-09  Joshua Tauberer <tauberer@for.net>
8117
8118         * expression.cs (ArrayCreation): Fix: More than 6 nulls in
8119         a { ... }-style array creation invokes EmitStaticInitializers
8120         which is not good for reference-type arrays.  String, decimal
8121         and now null constants (NullCast) are not counted toward
8122         static initializers.
8123
8124 2004-03-05  Martin Baulig  <martin@ximian.com>
8125
8126         * location.cs (SourceFile.HasLineDirective): New public field;
8127         specifies whether the file contains or is referenced by a "#line"
8128         directive.
8129         (Location.DefineSymbolDocuments): Ignore source files which
8130         either contain or are referenced by a "#line" directive.        
8131
8132 2004-02-29  Ben Maurer <bmaurer@users.sourceforge.net>
8133
8134         * class.cs (Method.CheckBase): Avoid using FindMembers, we have
8135         direct access to our parent, so check the method inline there.
8136
8137 2004-02-27 Ben Maurer  <bmaurer@users.sourceforge.net>
8138
8139         * expression.cs (Invocation.EmitCall): Miguel's last commit
8140         caused a regression. If you had:
8141
8142             T t = null;
8143             t.Foo ();
8144
8145         In Foo the implict this would be null.
8146
8147 2004-02-27  Miguel de Icaza  <miguel@ximian.com>
8148
8149         * expression.cs (Invocation.EmitCall): If the method is not
8150         virtual, do not emit a CallVirt to it, use Call.
8151
8152         * typemanager.cs (GetFullNameSignature): Improve the method to
8153         cope with ".ctor" and replace it with the type name.
8154
8155         * class.cs (ConstructorInitializer.Resolve): Now the method takes
8156         as an argument the ConstructorBuilder where it is being defined,
8157         to catch the recursive constructor invocations.
8158
8159 2004-03-16  Martin Baulig  <martin@ximian.com>
8160
8161         * expression.cs (MemberAccess.DoResolve): If `expr' resolved to a
8162         ConstructedType, call ResolveType() on it to get the type rather
8163         than just using `expr.Type'.
8164
8165 2004-03-16  Martin Baulig  <martin@ximian.com>
8166
8167         * generics.cs (ConstructedType.GetMemberAccess): Take the
8168         EmitContext instead on the TypeExpr and use
8169         ec.TypeContainer.CurrentType/ec.ContainerType.
8170
8171 2004-03-16  Martin Baulig  <martin@ximian.com>
8172
8173         * ecore.cs (SimpleName.DoResolveAsTypeStep): Lookup type
8174         parameters before aliases.
8175
8176 2004-03-16  Martin Baulig  <martin@ximian.com>
8177
8178         * typemanager.cs (TypeManager.MayBecomeEqualGenericInstances):
8179         New oublic function; checks whether two generic instances may become
8180         equal under some instantiations (26.3.1).
8181
8182         * class.cs (TypeContainer.Define): Call
8183         TypeManager.MayBecomeEqualGenericInstances() and report CS0695 on
8184         error.
8185
8186 2004-03-16  Martin Baulig  <martin@ximian.com>
8187
8188         * class.cs (TypeContainer.GetClassBases): Moved
8189         Error_TypeParameterAsBase() here and also check whether the base
8190         class is not an attribute.
8191
8192 2004-03-16  Martin Baulig  <martin@ximian.com>
8193
8194         * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
8195
8196 2004-03-16  Martin Baulig  <martin@ximian.com>
8197
8198         * class.cs (Error_TypeParameterAsBase): Use correct error number
8199         here (CS0689).  
8200
8201 2004-03-16  Martin Baulig  <martin@ximian.com>
8202
8203         * decl.cs (DeclSpace.ResolveTypeExpr): Added more error checking
8204         for generics.
8205
8206         * generics.cs (ConstructedType.DoResolveAsTypeStep): Added better
8207         error reporting.
8208
8209 2004-03-15  Martin Baulig  <martin@ximian.com>
8210
8211         * typemanager.cs (TypeManager.GetFullName): New public method.
8212         (TypeManager.MemberLookup): Added `int_num_type_arguments'
8213         argument; only return members with the correct number of type
8214         arguments.
8215         (TypeManager.CheckGeneric): Allow -1 to bypass the check.
8216         (TypeManager.FilterWithClosure): Call CheckGeneric() to check
8217         whether the number of type arguments matches.
8218
8219         * generic.cs (GenericMemberAccess.ResolveAsTypeStep): Allow `expr'
8220         not being a ConstructedType; we can now do "typeof (Foo.Bar<U>)".
8221
8222         * expression.cs (MemberAccess): Added public `NumTypeArguments'
8223         field; it's set by the protected .ctor when we're actually a
8224         GenericMemberAccess.
8225         (MemberAccess.ResolveAsTypeStep): Compute the total number of type
8226         arguments and pass it to MemberLookupFinal ().
8227
8228         * ecore.cs (Expression.MemberLookup): Added `int
8229         num_type_arguments' argument; only return members with the correct
8230         number of type arguments.
8231         (Expression.MemberLookupFailed): Check whether the MemberLookup
8232         failed because we did not have the correct number of type
8233         arguments; report CS0305 in this case.
8234
8235         * decl.cs (DeclSpace.ResolveTypeExpr): Don't report an error if
8236         `e.ResolveAsTypeTerminal()' already did so.
8237
8238 2004-03-15  Martin Baulig  <martin@ximian.com>
8239
8240         * ecore.cs (Expression.ResolveLValue): Allow e.type being null if
8241         we're a ConstructedType; in this case, the caller must report an
8242         error (for instance CS0131).
8243
8244         * generic.cs (TypeArguments): Added Location argument to the .ctor.
8245         (TypeArguments.Resolve): Actually report errors here.
8246
8247 2004-03-15  Miguel de Icaza  <miguel@ximian.com>
8248
8249         * pending.cs (TypeAndMethods): Add `get_indexer_name' and
8250         `set_indexer_name' to the pending bits (one per type).
8251
8252         We fixed a bug today that was picking the wrong method to
8253         override, since for properties the existing InterfaceMethod code
8254         basically ignored the method name.  Now we make sure that the
8255         method name is one of the valid indexer names.
8256
8257 2004-03-15  Martin Baulig  <martin@ximian.com>
8258
8259         * typemanager.cs (TypeManager.IndexerPropertyName): Added support
8260         for generic instances.
8261
8262 2004-03-13  Martin Baulig  <martin@ximian.com>
8263
8264         * class.cs (TypeContainer.DefineType): Call
8265         TypeManager.AddUserType() immediately after creating the
8266         TypeBuilder; pass all type parameters when creating the
8267         CurrentType.
8268
8269         * decl.cs (DeclSpace.FindNestedType): New public method.
8270         (DeclSpace.FindType): Added `int num_type_args' argument; only
8271         return types with the correct number of type parameters.
8272         (DeclSpace.CountTypeParams): New public property.
8273
8274         * ecore.cs (SimpleName.ctor): Added overloaded version which takes
8275         the number of type parameters; defaults to zero.
8276
8277         * generic.cs (TypeArguments.Count): New public property.
8278         (ConstructedType.DoResolveAsTypeStep): First call
8279         ds.FindNestedType() to find out whether we're nested in the
8280         current generic type; in this case, we inherit all type parameters
8281         from the current class.
8282
8283         * rootcontext.cs (RootContext.NamespaceLookup): Added `int
8284         num_type_args' argument.
8285         (RootContext.LookupType): Added overloaded version which takes the
8286         number of type arguments; only return types with the correct
8287         number of type arguments.
8288
8289         * typemanager.cs (TypeManager.CheckGeneric): New public function;
8290         checks whether `Type t' has `int num_type_args'.
8291
8292 2004-03-13  Martin Baulig  <martin@ximian.com>
8293
8294         * generic.cs (GenericMethod.DefineType): New method; calls
8295         DefineType() on all the type parameters.
8296
8297         * class.cs (MethodData.ctor): Added `GenericMethod generic' argument.
8298         (MethodData.Define): If we're a generic method, call
8299         GenericMethod.DefineType() to define the type parameters.       
8300
8301 2004-03-10  Martin Baulig  <martin@ximian.com>
8302
8303         * pending.cs (Pending.InterfaceMethod): Use TypeManager.IsEqual()
8304         instead of IsAssignableFrom.    
8305
8306 2004-03-10  Martin Baulig  <martin@ximian.com>
8307
8308         * ecore.cs (FieldExpr.ctor): Use TypeManager.TypeToCoreType().
8309
8310         * support.cs (ParameterData.HasArrayParameter): New property.
8311         (ReflectionParameters.ctor): Take a MethodBase instead of a
8312         ParameterInfo[].  If we have any type parameters, get the generic
8313         method definition and ask it whether we have variable arguments.
8314
8315 2004-02-26  Miguel de Icaza  <miguel@ximian.com>
8316
8317         * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
8318         routines to check if a type is an enumerable/enumerator allow
8319         classes that implement the IEnumerable or IEnumerator interfaces.
8320
8321         * class.cs (Property, Operator): Implement IIteratorContainer, and
8322         implement SetYields.
8323
8324         (Property.Define): Do the block swapping for get_methods in the
8325         context of iterators.   We need to check if Properties also
8326         include indexers or not.
8327
8328         (Operator): Assign the Block before invoking the
8329         OperatorMethod.Define, so we can trigger the Iterator code
8330         replacement. 
8331
8332         * cs-parser.jay (SimpleIteratorContainer): new helper class.  Both
8333         Property and Operator classes are not created when we parse the
8334         declarator but until we have the block completed, so we use a
8335         singleton SimpleIteratorContainer.Simple to flag whether the
8336         SetYields has been invoked.
8337
8338         We propagate this setting then to the Property or the Operator to
8339         allow the `yield' to function.
8340
8341 2004-02-25  Marek Safar  <marek.safar@seznam.cz>
8342
8343         * codegen.cs: Implemented attribute support for modules.
8344         New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
8345         Assembly/Module functionality.
8346
8347         * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
8348         interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
8349         Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
8350
8351 2004-02-16  Marek Safar  <marek.safar@seznam.cz>
8352
8353         * interface.cs (FindMembers): The operation is performed on all base
8354         interfaces and not only on the first. It is required for future CLS Compliance patch.
8355
8356 2004-02-12 Ben Maurer  <bmaurer@users.sourceforge.net>
8357
8358         * statement.cs, codegen.cs:
8359         This patch deals with patterns such as:
8360
8361         public class List : IEnumerable {
8362
8363                 public MyEnumerator GetEnumerator () {
8364                         return new MyEnumerator(this);
8365                 }
8366
8367                 IEnumerator IEnumerable.GetEnumerator () {
8368                         ...
8369                 }
8370                 
8371                 public struct MyEnumerator : IEnumerator {
8372                         ...
8373                 }
8374         }
8375
8376         Before, there were a few things we did wrong:
8377         1) we would emit callvirt on a struct, which is illegal
8378         2) we emited ldarg when we needed to emit ldarga
8379         3) we would mistakenly call the interface methods on an enumerator
8380         type that derived from IEnumerator and was in another assembly. For example:
8381
8382         public class MyEnumerator : IEnumerator
8383
8384         Would have the interface methods called, even if there were public impls of the
8385         method. In a struct, this lead to invalid IL code.
8386
8387 2004-02-11  Marek Safar  <marek.safar@seznam.cz>
8388
8389         * const.cs: Const is now derived from FieldBase. Method EmitConstant name
8390           renamed to Emit.
8391
8392         * delegate.cs (Define): Fixed crash when delegate type is undefined.
8393
8394 2004-02-11  Miguel de Icaza  <miguel@ximian.com>
8395
8396         * cs-parser.jay: Fix small regression: we were not testing V2
8397         compiler features correctly.
8398
8399         * interface.cs: If the emit context is null, then create one
8400
8401 2004-02-09  Marek Safar  <marek.safar@seznam.cz>
8402
8403         * decl.cs (GetSignatureForError): New virtual method to get full name
8404           for error messages.
8405
8406         * attribute.cs (IAttributeSupport): New interface for attribute setting.
8407           Now it is possible to rewrite ApplyAttributes method to be less if/else.
8408
8409         * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
8410           Duplicated members and code in these classes has been removed.
8411           Better encapsulation in these classes.
8412
8413 2004-02-07  Miguel de Icaza  <miguel@ximian.com>
8414
8415         * assign.cs (Assign.DoResolve): When dealing with compound
8416         assignments, there is a new rule in ECMA C# 2.4 (might have been
8417         there before, but it is documented here) that states that in:
8418
8419         a op= b;
8420
8421         If b is of type int, and the `op' is a shift-operator, then the
8422         above is evaluated as:
8423
8424         a = (int) a op b 
8425
8426         * expression.cs (Binary.ResolveOperator): Instead of testing for
8427         int/uint/long/ulong, try to implicitly convert to any of those
8428         types and use that in pointer arithmetic.
8429
8430         * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
8431         method to print information for from the type, not from the
8432         null-method we were given.
8433
8434 2004-02-01  Duncan Mak  <duncan@ximian.com>
8435
8436         * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
8437         parsing for cmd, fixes bug #53694.
8438
8439 2004-02-04  Marek Safar  <marek.safar@seznam.cz>
8440
8441         * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
8442         in the member name duplication tests. Property and operator name duplication
8443         was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
8444
8445 2004-02-03  Marek Safar  <marek.safar@seznam.cz>
8446
8447         * interface.cs (PopulateMethod): Fixed crash when interface method
8448         returns not existing type (error test cs0246-3.cs).
8449
8450 2004-02-02  Ravi Pratap M <ravi@ximian.com>
8451
8452         * cs-parser.jay (interface_accessors): Re-write actions to also
8453         store attributes attached to get and set methods. Fix spelling
8454         while at it.
8455
8456         (inteface_property_declaration): Modify accordingly.
8457
8458         (InterfaceAccessorInfo): New helper class to store information to pass
8459         around between rules that use interface_accessors.
8460
8461         * interface.cs (Emit): Apply attributes on the get and set
8462         accessors of properties and indexers too.
8463
8464         * attribute.cs (ApplyAttributes): Modify accordingly to use the
8465         right MethodBuilder when applying attributes to the get and set accessors.
8466
8467 2004-01-31  Miguel de Icaza  <miguel@ximian.com>
8468
8469         * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
8470
8471 2004-01-26  Miguel de Icaza  <miguel@ximian.com>
8472
8473         * cs-tokenizer.cs: Handle #line hidden from PDC bits.
8474
8475 2004-01-25  Miguel de Icaza  <miguel@ximian.com>
8476
8477         * cs-parser.jay: Remove YIELD token, instead use the new grammar
8478         changes that treat `yield' specially when present before `break'
8479         or `return' tokens.
8480
8481         * cs-tokenizer.cs: yield is no longer a keyword.
8482
8483 2004-01-23  Marek Safar  <marek.safar@seznam.cz>
8484
8485         * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
8486         setting for default constructors.
8487         For default constructors are almost every time set wrong Modifier. The
8488         generated IL code has been alright. But inside mcs this values was
8489         wrong and this was reason why several of my CLS Compliance tests
8490         failed.
8491
8492 2004-02-27  Martin Baulig  <martin@ximian.com>
8493
8494         * generics.cs (ConstructedType.ResolveType): Make the nested type
8495         stuff actually work.
8496
8497 2004-02-25  Martin Baulig  <martin@ximian.com>
8498
8499         * decl.cs (DeclSpace.CurrentTypeParameters): New protected
8500         property; returns the type parameters just from the current type,
8501         ie. with the ones from outer classes.
8502         (DeclSpace.LookupGeneric): First search in the current class, then
8503         in outer classes.
8504         (DeclSpace.initialize_type_params): When hiding a type parameter
8505         from an outer class, put it into the `type_param_list' anyways.
8506
8507         * expression.cs (MemberAccess.expr): Made this field protected.
8508
8509         * class.cs (TypeContainer.Define): The `CurrentType' just contains
8510         the type parameters from the current class.
8511
8512         * generic.cs (ConstructedType.ResolveType): Support nested generic
8513         types by taking the type parameters which we inherit from outer
8514         classes into account.
8515         (GenericMemberAccess.ResolveAsTypeStep): Override this and added
8516         support for nested generic types.
8517
8518 2004-02-23  Martin Baulig  <martin@ximian.com>
8519
8520         * decl.cs (DeclSpace.IsGeneric): Make this a property instead of a
8521         field and check whether we're nested inside a generic type.
8522         (DeclSpace.ResolveType): If we're resolving to a generic type
8523         definition, create a ConstructedType and return its resolved type.
8524         (DeclSpace.initialize_type_params): New private method;
8525         initializes the `type_param_list' field from the type parameters
8526         from this and all enclosing classes.
8527         (DeclSpace.TypeParameters): Call initialize_type_params() unless
8528         we're already initialized.
8529
8530 2004-02-23  Martin Baulig  <martin@ximian.com>
8531
8532         * class.cs (Method.Define): Create the generic method before
8533         calling DoDefine().
8534         (Memberbase.DoDefine): Added DeclSpace argument (in addition to
8535         the TypeContainer one); we use this for generic methods.
8536
8537         * decl.cs (CheckAccessLevel): If we're a GenericMethod, use our
8538         parent's TypeBuilder.
8539
8540 2004-02-18  Martin Baulig  <martin@ximian.com>
8541
8542         * ecore.cs (FieldExpr.DoResolveLValue): Use TypeManager.IsEqual()
8543         to check for equality.
8544
8545 2004-02-05  Martin Baulig  <martin@ximian.com>
8546
8547         * ecore.cs (FieldExpr.DoResolveLValue): If we have an
8548         `ec.TypeContainer.CurrentType', use it instead of
8549         `ec.ContainerType' to check whether we're in the type's ctor.
8550
8551 2004-01-29  Martin Baulig  <martin@ximian.com>
8552
8553         * expression.cs (Invocation.DoResolve): If we're a
8554         `ConstructedType', then we're actually a generic method, so
8555         rewrite the expr as a GenericMemberAccess.
8556
8557         * cs-parser.jay (member_name): Don't use `namespace_or_type_name'
8558         here; manually parse it into a string.
8559
8560 2004-01-28  Martin Baulig  <martin@ximian.com>
8561
8562         * typemanager.cs (TypeManager.IsEqual): New static method.
8563         (TypeManager.FilterWithClosure): Call TypeManager.IsEqual() to
8564         check for equality instead of using `=='.
8565
8566 2004-01-26  Martin Baulig  <martin@ximian.com>
8567
8568         * decl.cs (DeclSpace.CurrentType): New public field.
8569
8570         * expression.cs (This.ResolveBase): If we have an
8571         `ec.TypeContainer.CurrentType', use it instead of
8572         `ec.ContainerType'.
8573
8574         * class.cs (TypeContainer.DefineType): If we're a generic type,
8575         create the `CurrentType' (unresolved).
8576         (TypeContainer.GenericType): New private field.
8577         (TypeContainer.DefineMembers): If we have a `CurrentType', resolve
8578         it and store it in `GenericType' before creating the MemberCache.
8579         (TypeContainer.GetMembers): If we have a `GenericType', call
8580         TypeManager.FindMembers() on it.
8581
8582         * interface.cs (Interface.GenericType): New private field.
8583         (Interface.DefineType): If we're a generic type, create the
8584         `CurrentType' (unresolved).
8585         (Interface.DefineMembers): If we have a `CurrentType', resolve it
8586         and store it in `GenericType' before creating the MemberCache.
8587         (Interface.GetMembers): If we have a `GenericType', call
8588         TypeManager.FindMembers() on it.
8589
8590 2004-01-22  Martin Baulig  <martin@ximian.com>
8591
8592         * cs-parser.jay (namespace_or_type_name): Return an Expression,
8593         not a QualifiedIdentifier.  This is what `type_name_expression'
8594         was previously doing.
8595         (type_name_expression): Removed; the code is now in
8596         `namespace_or_type_name'.
8597         (qualified_identifier): Removed, use `namespace_or_type_name'
8598         instead.
8599         (QualifiedIdentifier): Removed this class.      
8600
8601 2004-01-22  Martin Baulig  <martin@ximian.com>
8602
8603         * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
8604         not a string as alias name.
8605
8606 2004-01-21  Miguel de Icaza  <miguel@ximian.com>
8607
8608         * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
8609         #52730 bug, and instead compute correctly the need to use a
8610         temporary variable when requesting an address based on the
8611         static/instace modified of the field and the constructor.
8612  
8613 2004-01-21  Martin Baulig  <martin@ximian.com>
8614
8615         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
8616         class and namespace before looking up aliases.  Fixes #52517.
8617
8618 2004-01-21  Martin Baulig  <martin@ximian.com>
8619
8620         * flowanalysis.cs (UsageVector.Merge): Allow variables being
8621         assinged in a 'try'; fixes exception4.cs.
8622
8623 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
8624         * class.cs : Implemented parameter-less constructor for TypeContainer
8625
8626         * decl.cs: Attributes are now stored here. New property OptAttributes
8627
8628         * delegate.cs, enum.cs, interface.cs: Removed attribute member.
8629
8630         * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
8631
8632 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
8633
8634         * typemanager.cs (CSharpSignature): Now reports also inner class name.
8635           (CSharpSignature): New method for indexer and property signature.
8636
8637 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
8638
8639         * pending.cs (IsVirtualFilter): Faster implementation.
8640
8641 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
8642
8643         * typemanager.cs: Avoid inclusion of same assembly more than once.
8644
8645 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
8646
8647         * cs-parser.jay: Fixed problem where the last assembly attribute
8648           has been applied also to following declaration (class, struct, etc.)
8649           
8650 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
8651
8652         * class.cs: Added error CS0538, CS0539 reporting.
8653         Fixed crash on Microsoft runtime when field type is void.
8654
8655         * cs-parser.jay: Added error CS0537 reporting.
8656
8657         * pending.cs: Added error CS0535 reporting.
8658         Improved error report for errors CS0536, CS0534.
8659
8660 2004-01-20  Miguel de Icaza  <miguel@ximian.com>
8661
8662         Merge a few bits from the Anonymous Method MCS tree.
8663
8664         * statement.cs (ToplevelBlock): New class for toplevel methods,
8665         will hold anonymous methods, lifted variables.
8666
8667         * cs-parser.jay: Create toplevel blocks for delegates and for
8668         regular blocks of code. 
8669
8670 2004-01-20  Martin Baulig  <martin@ximian.com>
8671
8672         * codegen.cs (EmitContext): Removed `InTry', `InCatch',
8673         `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
8674         and `NeedExplicitReturn'; added `IsLastStatement'.
8675         (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
8676         have a `ReturnLabel' or we're not unreachable.
8677
8678         * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
8679         child's reachability; don't just override ours with it.  Fixes
8680         #58058 (lluis's example).
8681         (FlowBranching): Added public InTryOrCatch(), InCatch(),
8682         InFinally(), InLoop(), InSwitch() and
8683         BreakCrossesTryCatchBoundary() methods.
8684
8685         * statement.cs (Return): Do all error checking in Resolve().
8686         Unless we are the last statement in a top-level block, always
8687         create a return label and jump to it.
8688         (Break, Continue): Do all error checking in Resolve(); also make
8689         sure we aren't leaving a `finally'.
8690         (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
8691         statement in a top-level block.
8692         (Block.Flags): Added `IsDestructor'.
8693         (Block.IsDestructor): New public property.
8694
8695 2004-01-20  Martin Baulig  <martin@ximian.com>
8696
8697         * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
8698
8699 2004-01-20  Martin Baulig  <martin@ximian.com>
8700
8701         * statement.cs (Statement.ResolveUnreachable): New public method.
8702         (If, While): Do the dead-code elimination in Resolve(), not in Emit().
8703         (Block.Resolve): Resolve unreachable statements.
8704
8705 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
8706
8707         * expression.cs: We need to fix the case where we do
8708         not have a temp variable here.
8709
8710         * assign.cs: Only expression compound assignments need
8711         temporary variables.
8712
8713 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
8714
8715         * flowanalysis.cs: Reduce memory allocation in a few ways:
8716           - A block with no variables should not allocate a bit
8717             vector for itself.
8718           - A method with no out parameters does not need any tracking
8719             for assignment of the parameters, so we need not allocate
8720             any data for it.
8721           - The arrays:
8722                 public readonly Type[] VariableTypes;
8723                 public readonly string[] VariableNames;
8724             Are redundant. The data is already stored in the variable
8725             map, so we need not allocate another array for it.
8726           - We need to add alot of checks for if (params | locals) == null
8727             due to the first two changes.
8728
8729 2004-01-18  Miguel de Icaza  <miguel@ximian.com>
8730
8731         * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
8732         implement IMemoryLocation, we store a copy on a local variable and
8733         take the address of it.  Patch from Benjamin Jemlich
8734
8735         * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
8736         to use a special "type_name_expression" rule which reduces the
8737         number of "QualifiedIdentifier" classes created, and instead
8738         directly creates MemberAccess expressions.
8739
8740 2004-01-17  Miguel de Icaza  <miguel@ximian.com>
8741
8742         * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
8743         that fixes #52853.  Null literal assignment to ValueType
8744
8745         * class.cs (MethodData.Emit): Instead of checking the name of the
8746         method to determine if its a destructor, create a new derived
8747         class from Method called Destructor, and test for that.  
8748
8749         * cs-parser.jay: Create a Destructor object instead of a Method.  
8750
8751         Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
8752
8753         Fixes: 52933
8754
8755 2004-01-16  Miguel de Icaza  <miguel@ximian.com>
8756
8757         * expression.cs (Binary.ResolveOperator): Perform an implicit
8758         conversion from MethodGroups to their delegate types on the
8759         Addition operation.
8760
8761         * delegate.cs: Introduce a new class DelegateCreation that is the
8762         base class for `NewDelegate' and `ImplicitDelegateCreation',
8763         factor some code in here.
8764
8765         * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
8766         conversion from MethodGroups to compatible delegate types. 
8767
8768         * ecore.cs (Expression.Resolve): Do not flag error 654
8769         (Methodgroupd needs parenthesis) if running on the V2 compiler, as
8770         we allow conversions from MethodGroups to delegate types now.
8771
8772         * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
8773         assignments in v2 either.
8774
8775 2004-01-10  Miguel de Icaza  <miguel@ximian.com>
8776
8777         * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
8778         static read-only fields in ctors.
8779
8780         Applied patch from Benjamin Jemlich 
8781
8782         * expression.cs (UnaryMutator): Avoid leaking local variables. 
8783
8784 2004-01-09  Miguel de Icaza  <miguel@ximian.com>
8785
8786         * cs-tokenizer.cs (IsCastToken): Allow the various native types
8787         here to return true, as they can be used like this:
8788
8789                 (XXX) int.MEMBER ()
8790
8791         Fixed 49836 and all the other dups
8792
8793 2004-01-09  Zoltan Varga  <vargaz@freemail.hu>
8794
8795         * driver.cs: Implement /win32res and /win32icon.
8796
8797 2004-01-08  Miguel de Icaza  <miguel@ximian.com>
8798
8799         * cs-parser.jay: Add a rule to improve error handling for the
8800         common mistake of placing modifiers after the type.
8801
8802 2004-01-07  Miguel de Icaza  <miguel@ximian.com>
8803
8804         * cs-parser.jay (interface_event_declaration): Catch
8805         initialization of events on interfaces, and report cs0068
8806
8807         * cs-parser.jay (interface_event_declaration): Catch
8808         initialization of events. 
8809
8810         * ecore.cs: Better report missing constructors.
8811
8812         * expression.cs (Binary.ResolveOperator): My previous bug fix had
8813         the error reporting done in the wrong place.  Fix.
8814
8815         * expression.cs (Binary.ResolveOperator): Catch the 
8816         operator + (E x, E y) error earlier, and later allow for implicit
8817         conversions in operator +/- (E e, U x) from U to the underlying
8818         type of E.
8819
8820         * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
8821         52596, if the container class is abstract, the default constructor
8822         is protected otherwise its public (before, we were always public).
8823
8824         * statement.cs (Fixed.Resolve): Catch a couple more errors in the
8825         fixed statement.
8826
8827         (Using.EmitLocalVariableDecls): Applied patch from Benjamin
8828         Jemlich that fixes bug #52597, MCS was generating invalid code for
8829         idisposable structs.   Thanks to Ben for following up with this
8830         bug as well.
8831
8832 2004-01-06  Miguel de Icaza  <miguel@ximian.com>
8833
8834         * driver.cs: Allow assemblies without code to be generated, fixes
8835         52230.
8836
8837 2004-01-07  Nick Drochak <ndrochak@gol.com>
8838
8839         * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
8840
8841 2004-01-05  Miguel de Icaza  <miguel@ximian.com>
8842
8843         * cs-parser.jay: Add rules to improve error reporting if fields or
8844         methods are declared at the namespace level (error 116)
8845
8846         * Add rules to catch event add/remove
8847
8848 2004-01-04  David Sheldon <dave-mono@earth.li>
8849
8850   * expression.cs: Added matching ")" to error message for 
8851   CS0077
8852
8853 2004-01-03 Todd Berman <tberman@gentoo.org>
8854
8855         * ecore.cs, attribute.cs:
8856         Applying fix from #52429.
8857
8858 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
8859
8860         * ecore.cs, expression.cs, statement.cs:
8861         Total rewrite of how we handle branching. We
8862         now handle complex boolean expressions with fewer
8863         jumps. As well if (x == 0) no longer emits a ceq.
8864
8865         if (x is Foo) is much faster now, because we generate
8866         better code.
8867
8868         Overall, we get a pretty big improvement on our benchmark
8869         tests. The code we generate is smaller and more readable.
8870
8871         I did a full two-stage bootstrap. The patch was reviewed
8872         by Martin and Miguel.
8873
8874 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
8875
8876         * cs-parser.jay: Make primary_expression not take a QI.
8877         we dont need this because the member_access rule covers
8878         us here. So we replace the rule with just IDENTIFIER.
8879
8880         This has two good effects. First, we remove a s/r conflict.
8881         Second, we allocate many fewer QualifiedIdentifier objects.
8882
8883 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
8884
8885         * attribute.cs: Handle MarshalAs attributes as pseudo, and
8886         set the correct information via SRE. This prevents
8887         hanging on the MS runtime. Fixes #29374.
8888
8889 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
8890
8891         * convert.cs: correctly handle conversions to value types
8892         from Enum and ValueType as unboxing conversions.
8893
8894         Fixes bug #52569. Patch by Benjamin Jemlich.
8895
8896 2004-01-02  Ravi Pratap  <ravi@ximian.com>
8897
8898         * expression.cs (BetterConversion): Prefer int -> uint
8899         over int -> ulong (csc's behaviour). This fixed bug #52046.
8900
8901 2004-01-02 Ben Maurer  <bmaurer@users.sourceforge.net>
8902
8903         * decl.cs (MemberCache.FindMembers): now returns a
8904         MemberInfo [].
8905
8906         * typemanager.cs: In general, go with with ^^.
8907         (CopyNewMethods): take an IList.
8908         (RealMemberLookup): Only allocate an arraylist
8909         if we copy from two sets of methods.
8910
8911         This change basically does two things:
8912         1) Fewer array lists allocated due to CopyNewMethods.
8913         2) the explicit cast in MemberList costed ALOT.
8914
8915 2004-01-02  Zoltan Varga  <vargaz@freemail.hu>
8916
8917         * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
8918         a hashtable to avoid needless string allocations when an identifier is
8919         used more than once (the common case).
8920
8921 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
8922
8923         * pending.cs: MS's TypeBuilder.GetInterfaces ()
8924         is broken, it will not return anything. So, we
8925         have to use the information we have in mcs to
8926         do the task.
8927
8928         * typemanager.cs: Add a cache for GetInterfaces,
8929         since this will now be used more often (due to ^^)
8930
8931         (GetExplicitInterfaces) New method that gets the
8932         declared, not effective, interfaces on a type
8933         builder (eg, if you have interface IFoo, interface
8934         IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
8935         { IBar }.
8936
8937         This patch makes MCS able to bootstrap itself on
8938         Windows again.
8939
8940 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
8941
8942         * expression.cs: Remove the Nop's that Miguel put
8943         in by mistake.
8944
8945 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
8946
8947         * report.cs, codegen.cs: Give the real stack trace to
8948         the error when an exception is thrown.
8949
8950 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
8951
8952         * decl.cs: only allocate hashtables for ifaces if 
8953         it is an iface!
8954
8955 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
8956
8957         * expression.cs: fix the error from cs0121-2.cs
8958         (a parent interface has two child interfaces that
8959         have a function with the same name and 0 params
8960         and the function is called through the parent).
8961
8962 2003-12-30 Ben Maurer  <bmaurer@users.sourceforge.net>
8963
8964         * class.cs, rootcontext.cs, typmanager.cs: do not
8965         leak pointers.
8966
8967 2003-12-28 Ben Maurer  <bmaurer@users.sourceforge.net>
8968
8969         * codegen.cs: remove stack for the ec flow branching.
8970         It is already a linked list, so no need.
8971
8972 2003-12-27 Ben Maurer  <bmaurer@users.sourceforge.net>
8973
8974         * Makefile: Allow custom profiler here.
8975
8976 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
8977
8978         * typemanager.cs (LookupType):
8979           - Use a static char [], because split takes
8980             a param array for args, so it was allocating
8981             every time.
8982           - Do not store true in a hashtable, it boxes.
8983
8984 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
8985
8986         * flowanalysis.cs: bytify common enums.
8987
8988 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
8989
8990         * modifiers.cs: Add a new set of flags for the
8991         flags allowed on explicit interface impls.
8992         * cs-parser.jay: catch the use of modifiers in
8993         interfaces correctly.
8994         * class.cs: catch private void IFoo.Blah ().
8995
8996         All related to bug #50572.
8997
8998 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
8999
9000         * decl.cs: Rewrite the consistant accessability checking.
9001         Accessability is not linear, it must be implemented in
9002         a tableish way. Fixes #49704.
9003
9004 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
9005
9006         * expression.cs: Handle negation in a checked context.
9007         We must use subtraction from zero. Fixes #38674.
9008
9009 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
9010
9011         * class.cs: Ignore static void main in DLLs.
9012         * rootcontext.cs: Handle the target type here,
9013         since we are have to access it from class.cs
9014         * driver.cs: account for the above.
9015
9016 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
9017
9018         * report.cs: Give line numbers and files if available.
9019
9020 2003-12-20  Zoltan Varga  <vargaz@freemail.hu>
9021
9022         * driver.cs: Implement /addmodule.
9023
9024         * typemanager.cs:  Change 'modules' field so it now contains Modules not
9025         ModuleBuilders.
9026
9027 2003-12-20  Martin Baulig  <martin@ximian.com>
9028
9029         * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
9030         (FieldBase.IsAssigned): Removed this field.
9031         (FieldBase.SetAssigned): New public method.
9032         (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
9033
9034 2003-12-20  Martin Baulig  <martin@ximian.com>
9035
9036         * expression.cs (LocalVariableReference.DoResolve): Don't set
9037         `vi.Used' if we're called from DoResolveLValue().
9038
9039         * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
9040         returns the usage vector it just merged into the current one -
9041         pass this one to UsageWarning().
9042         (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
9043         of the `EmitContext', don't call this recursively on our children.
9044
9045 2003-12-19  Zoltan Varga  <vargaz@freemail.hu>
9046
9047         * driver.cs: Implement /target:module.
9048
9049 2003-12-18  Zoltan Varga  <vargaz@freemail.hu>
9050
9051         * support.cs (CharArrayHashtable): New helper class.
9052
9053         * cs-tokenizer.cs: Store keywords in a hashtable indexed by 
9054         char arrays, not strings, so we can avoid creating a string in
9055         consume_identifier if the identifier is a keyword.
9056
9057 2003-12-16  Martin Baulig  <martin@ximian.com>
9058
9059         * statement.cs (LocalInfo.Assigned): Removed this property.
9060         (LocalInfo.Flags): Removed `Assigned'.
9061         (LocalInfo.IsAssigned): New public method; takes the EmitContext
9062         and uses flow analysis.
9063         (Block.UsageWarning): Made this method private.
9064         (Block.Resolve): Call UsageWarning() if appropriate.
9065
9066         * expression.cs (LocalVariableReference.DoResolve): Always set
9067         LocalInfo.Used here.
9068
9069 2003-12-13  Martin Baulig  <martin@ximian.com>
9070
9071         * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
9072         any value here; we're now using flow analysis to figure out
9073         whether a statement/block returns a value.
9074
9075 2003-12-13  Martin Baulig  <martin@ximian.com>
9076
9077         * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
9078         working again.
9079         (FlowBranching.MergeFinally): Don't call
9080         `branching.CheckOutParameters()' here, this is called in
9081         MergeTopBlock().
9082         (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
9083         when adding the `finally' vector.       
9084
9085 2003-12-13  Martin Baulig  <martin@ximian.com>
9086
9087         * flowanalysis.cs
9088         (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
9089         actually work and also fix #48962.
9090
9091 2003-12-12 Ben Maurer  <bmaurer@users.sourceforge.net>
9092
9093         * decl.cs: Do not check System.Object for nested types,
9094         since we know it does not have any. Big bang for buck:
9095
9096         BEFORE:
9097            Run 1:   8.35 seconds
9098            Run 2:   8.32 seconds
9099            corlib:  17.99 seconds
9100         AFTER:
9101            Run 1:   8.17 seconds
9102            Run 2:   8.17 seconds
9103            corlib:  17.39 seconds
9104
9105 2003-12-11 Ben Maurer  <bmaurer@users.sourceforge.net>
9106
9107         * class.cs (FindMembers): Allocate arraylists on demand. Most of the
9108         time we are returning 0 members, so we save alot here.
9109
9110 2003-12-11  Martin Baulig  <martin@ximian.com>
9111
9112         * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
9113         `MergeChild()', also just take the `FlowBranching' as argument;
9114         call Merge() on it and return the result.
9115         (FlowBranching.Merge): We don't need to do anything if we just
9116         have one sibling.
9117
9118 2003-12-11  Martin Baulig  <martin@ximian.com>
9119
9120         * flowanalysis.cs: Use a list of `UsageVector's instead of storing
9121         them in an `ArrayList' to reduce memory usage.  Thanks to Ben
9122         Maurer for this idea.
9123
9124 2003-12-11  Martin Baulig  <martin@ximian.com>
9125
9126         * flowanalysis.cs (MergeResult): This class is now gone; we now
9127         use the `UsageVector' for this.  The reason for this is that if a
9128         branching just has one sibling, we don't need to "merge" them at
9129         all - that's the next step to do.
9130         (FlowBranching.Merge): We now return a `UsageVector' instead of a
9131         `MergeResult'.
9132
9133 2003-12-11  Martin Baulig  <martin@ximian.com>
9134
9135         Reworked flow analyis and made it more precise and bug-free.  The
9136         most important change is that we're now using a special `Reachability'
9137         class instead of having "magic" meanings of `FlowReturns'.  I'll
9138         do some more cleanups and optimizations and also add some more
9139         documentation this week.
9140
9141         * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
9142         largely reworked this class.
9143         (FlowReturns): Removed `Unreachable' and `Exception'; we now use
9144         the new `Reachability' class instead of having "magic" values here.
9145         (FlowBranching): We're now using an instance of `Reachability'
9146         instead of having separate `Returns', `Breaks' etc. fields.
9147
9148         * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
9149         based on flow analysis; ignore the return value of block.Emit ().
9150
9151 2003-12-10  Zoltan Varga  <vargaz@freemail.hu>
9152
9153         * driver.cs typemanager.cs: Find the mono extensions to corlib even
9154         if they are private.
9155
9156 2003-12-09  Martin Baulig  <martin@ximian.com>
9157
9158         * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
9159         call them directly on the UsageVector.
9160
9161 2003-12-09  Martin Baulig  <martin@ximian.com>
9162
9163         * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
9164         Changed return type from `FlowReturns' to `Reachability'.
9165
9166 2003-12-09  Martin Baulig  <martin@ximian.com>
9167
9168         * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
9169         (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
9170         `Reachable' fields with a single `Reachability' one.
9171
9172 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
9173
9174         * class.cs (FindMembers): Remove foreach's.
9175
9176         Bootstrap times:
9177
9178         BEFORE
9179                 Run 1:   8.74 seconds
9180                 Run 2:   8.71 seconds
9181
9182         AFTER
9183                 Run 1:   8.64 seconds
9184                 Run 2:   8.58 seconds
9185
9186
9187 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
9188
9189         * cs-parser.jay:
9190         * gen-treedump.cs:
9191         * statement.cs:
9192         This patch does a few things:
9193                 1. EmptyStatement is now a singleton, so it is never reallocated.
9194                 2. All blah is EmptyStatement constructs have been changed to
9195                    blah == EmptyStatement.Value, which is much faster and valid
9196                    now that EmptyStatement is a singleton.
9197                 3. When resolving a block, rather than allocating a new array for
9198                    the non-empty statements, empty statements are replaced with
9199                    EmptyStatement.Value
9200                 4. Some recursive functions have been made non-recursive.
9201         Mainly the performance impact is from (3), however (1) and (2) are needed for
9202         this to work. (4) does not make a big difference in normal situations, however
9203         it makes the profile look saner.
9204
9205         Bootstrap times:
9206
9207         BEFORE
9208         9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
9209         9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
9210         Total memory allocated: 56397 KB
9211
9212         AFTER
9213         9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
9214         8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
9215         Total memory allocated: 55666 KB
9216
9217 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
9218
9219         * support.cs: Rewrite DoubleHash to use its own impl. Is faster
9220         than the hashtable in a hashtable version
9221
9222         * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
9223         we always end up concating a string. This results in a huge perf
9224         loss, because many strings have to be tracked by the GC. In this
9225         patch, we first use a hashtable that works with two keys, so that
9226         the strings do not need to be concat'ed.
9227
9228         Bootstrap times:
9229         BEFORE
9230                 Run 1:   8.74 seconds
9231                 Run 2:   8.71 seconds
9232
9233         AFTER
9234                 Run 1:   8.65 seconds
9235                 Run 2:   8.56 seconds
9236
9237 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
9238
9239         * Makefile: Add a new target `do-time' that does a quick and simple
9240         profile, leaving easy to parse output.
9241
9242 2003-12-08  Zoltan Varga  <vargaz@freemail.hu>
9243
9244         * codegen.cs (Init): Create the dynamic assembly with 
9245         AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
9246
9247 2003-12-02 Ben Maurer  <bmaurer@users.sourceforge.net>
9248
9249         * support.cs: Make the PtrHashtable use only one
9250         instance of its comparer.
9251
9252 2003-11-30  Zoltan Varga  <vargaz@freemail.hu>
9253
9254         * typemanager.cs: Fix lookup of GetNamespaces.
9255
9256 2003-11-29  Miguel de Icaza  <miguel@ximian.com>
9257
9258         * expression.cs: Removed redundant line.
9259
9260         * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
9261         ArrayLists, use for loops with bounds.  
9262
9263         * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
9264         arraylist.
9265
9266         * expression.cs (Invocation.OverloadResolve): Avoid foreach on
9267         arraylists, use for loop with bounds.
9268
9269         The above three changes give us a 0.071 second performance
9270         improvement out of 3.294 seconds down to 3.223.  On my machine
9271         the above changes reduced the memory usage by 1,387 KB during
9272         compiler bootstrap.
9273
9274         * cs-parser.jay (QualifiedIdentifier): New class used to represent
9275         QualifiedIdentifiers.  Before we created a new string through
9276         concatenation, and mostly later on, the result would be
9277         manipulated by DecomposeQI through string manipulation.
9278
9279         This reduced the compiler memory usage for bootstrapping from
9280         59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
9281         compile times in 0.05 seconds.
9282
9283 2003-11-28  Dick Porter  <dick@ximian.com>
9284
9285         * support.cs: Do string compares with the Invariant culture.
9286
9287         * rootcontext.cs: 
9288         * gen-treedump.cs: 
9289         * expression.cs: 
9290         * driver.cs: 
9291         * decl.cs: 
9292         * codegen.cs: 
9293         * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
9294         the comparison is done with the Invariant culture.
9295
9296 2003-11-27  Miguel de Icaza  <miguel@ximian.com>
9297
9298         * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
9299         GetEnumerator method.
9300
9301         (ProbeCollectionType): Iterate starting at the most specific type
9302         upwards looking for a GetEnumerator
9303
9304         * expression.cs: Shift count can be up to 31 for int/uint and 63
9305         for long/ulong.
9306
9307 2003-11-26  Miguel de Icaza  <miguel@ximian.com>
9308
9309         * statement.cs (Block.LookupLabel): Also look for the label on the
9310         children blocks.  Use a hash table to keep track of visited
9311         nodes. 
9312
9313         * cfold.cs (IntConstant to UIntConstant mapping): Only return if
9314         we actually did transform the other operand, otherwise fall back
9315         to the common codepath that casts to long.
9316
9317         * cs-tokenizer.cs: Use the same code pattern as the int case.
9318         Maybe I should do the parsing myself, and avoid depending on the
9319         Parse routines to get this done.
9320
9321 2003-11-25  Miguel de Icaza  <miguel@ximian.com>
9322
9323         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
9324         which fixes bug 51347.  This time test it.
9325
9326         * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
9327         attributes for example can not tell the difference between these.
9328         The difference was only a syntax feature of the language. 
9329
9330         * attribute.cs: Apply attributes to delegates.
9331
9332         * delegate.cs: Call the apply attributes method.
9333
9334 2003-11-24  Miguel de Icaza  <miguel@ximian.com>
9335
9336         * convert.cs (TryImplicitIntConversion): One line bug fix: we were
9337         comparing 0 vs Byte.MinValue, not the value
9338
9339         (ImplicitConversionRequired): When reporting a conversion error,
9340         use error 31 to print out the constant error instead of the
9341         simpler 29.
9342
9343         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
9344         which fixes bug 51347.
9345
9346 2003-11-22  Miguel de Icaza  <miguel@ximian.com>
9347
9348         * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen) 
9349         which fixes the -warnaserror command line option.
9350
9351 2003-11-21  Miguel de Icaza  <miguel@ximian.com>
9352
9353         * cfold.cs (DoNumericPromotions): During constant folding of
9354         additions on UIntConstant, special case intconstants with
9355         IntConstants like we do on the expression binary operator. 
9356
9357 2003-11-12  Miguel de Icaza  <miguel@ximian.com>
9358
9359         * convert.cs (ImplicitReferenceConversion): We were missing a case
9360         (System.Enum are not value types or class types, so we need to
9361         classify them separatedly).
9362
9363         * driver.cs: We do not support error 2007.
9364
9365 2003-11-12 Jackson Harper <jackson@ximian.com>
9366
9367         * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
9368         system directory. Also use the full file name so users can
9369         libraries names mscorlib-o-tron.dll in a non system dir.
9370         
9371 2004-01-04  David Sheldon <dave-mono@earth.li>
9372
9373         * expression.cs: Added matching ")" to error message for CS0077.
9374
9375 2003-12-19  Martin Baulig  <martin@ximian.com>
9376
9377         * typemanager.cs (TypeManager.IsEqualGenericType): New public
9378         static method; see documentation in the method.
9379         (TypeManager.IsSubclassOrNestedChild): Allow IsEqualGenericType().
9380
9381         * convert.cs (Convert.ImplicitReferenceConversion,
9382         Convert.ImplicitReferenceConversionExists): Add support for
9383         generic type declarations; see gen-36.cs.
9384
9385 2003-12-19  Martin Baulig  <martin@ximian.com>
9386
9387         * pending.cs (Pending.InterfaceMethod): Use
9388         `Type.IsAssignableFrom()' instead of `=='.
9389
9390 2003-12-18  Martin Baulig  <martin@ximian.com>
9391
9392         * decl.cs (DeclSpace.AsAccessible): Check for array, pointer and
9393         byref types first.
9394
9395         * convert.cs (Convert.ImplicitStandardConversionExists): Use
9396         `expr_type.Equals (target_type)' instead of `=='.
9397
9398 2003-12-08  Martin Baulig  <martin@ximian.com>
9399
9400         * generics.cs (Constraints.Types): Removed.
9401         (Constraints.Resolve): Just resolve everything to TypeExpr's, not
9402         to Type's.
9403         (Constraints.ResolveTypes): New public method; resolves the
9404         TypeExpr's to Type's.
9405         (TypeParameter.Define): TypeBuilder.DefineGenericParameter() no
9406         longer takes the constraints.
9407         (TypeParameter.DefineMethod): Likewise.
9408         (TypeParameter.DefineType): New public method.  Calls
9409         `TypeBuilder/MethodBuilder.SetGenericParameterConstraints()' to set
9410         the constraints.
9411
9412 2003-12-08  Martin Baulig  <martin@ximian.com>
9413
9414         * convert.cs (Convert.ImplicitConversionStandard): Use
9415         `expr_type.Equals (target_type)' instead of `=='.
9416
9417 2003-12-08  Martin Baulig  <martin@ximian.com>
9418
9419         * typemanager.cs (TypeManager.GetReferenceType): Call
9420         `Type.MakeByRefType ()'.
9421
9422 2003-12-08  Martin Baulig  <martin@ximian.com>
9423
9424         * cs-parser.jay, cs-tokenizer.cs: `where' is not a keyword, it
9425         just has some special meaning in some situations.  For instance,
9426         it is allowed to use `where' as the name of a variable etc.
9427
9428 2003-12-04  Martin Baulig  <martin@ximian.com>
9429
9430         * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
9431         `Type.MakeArrayType()' for array types.
9432
9433 2003-11-18  Miguel de Icaza  <miguel@ximian.com>
9434
9435         * expression.cs (Invocation.VerifyArgumentsCompat): Remove
9436         debugging message.
9437
9438         (SizeOf.DoResolve): assign the `type_queried' field.  This gets
9439         corlib to compile.
9440
9441 2003-11-16  Martin Baulig  <martin@ximian.com>
9442
9443         * codegen.cs (EmitContext.IsGeneric): Removed.
9444
9445         * ecore.cs (SimpleName.ResolveAsTypeStep): Always call
9446         ResolveGeneric() on the DeclSpace.
9447
9448 2003-11-16  Martin Baulig  <martin@ximian.com>
9449
9450         * generic.cs (TypeArguments.Resolve):
9451         `Expression.ResolveAsTypeTerminal()' returns a TypeExpr; call
9452         `ResolveType()' on it to get the Type.
9453
9454 2003-11-15  Martin Baulig  <martin@ximian.com>
9455
9456         * generic.cs (ConstructedType.GetInterfaces): Override this.
9457
9458 2003-11-14  Martin Baulig  <martin@ximian.com>
9459
9460         * interface.cs (Interface.DefineType): Define all type parameters
9461         before adding the interfaces we inherit.
9462
9463 2003-11-11  Martin Baulig  <martin@ximian.com>
9464
9465         * generic.cs (ConstructedType.ResolveType): Always call
9466         `gt.BindGenericParameters (atypes)'; also if `args.HasTypeArguments'.
9467
9468 2003-11-10  Martin Baulig  <martin@ximian.com>
9469
9470         * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
9471         (TypeManager.InitCoreTypes): Initialize them here, but instead of
9472         calling `ResolveType()' on them, directly assign their `Type'.
9473
9474 2003-11-08  Martin Baulig  <martin@ximian.com>
9475
9476         * generic.cs (ConstructedType): Override `IsClass' etc.
9477
9478 2003-11-08  Martin Baulig  <martin@ximian.com>
9479
9480         * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
9481         return value and the `out parent' parameter.
9482         (TypeContainer.DefineType): Moved the CS0644 check into
9483         GetClassBases().  Don't pass the interface types to the
9484         `builder.DefineType()'/`builder.DefineNestedType()', but resolve
9485         them later and then call `TypeBuilder.AddInterfaceImplementation()'.
9486
9487         * ecore.cs (TypeExpr.IsAttribute): New property.
9488         (TypeExpr.GetInterfaces): New method.
9489
9490         * interface.cs (Interface.GetInterfaceTypeByName): Return a
9491         TypeExpr instead of a Type.
9492         (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
9493         (Interface.DefineType): Don't pass the interface types to the
9494         `builder.Definetype()'/`builder.DefineNestedType()', but resolve
9495         them later and then call `TypeBulider.AddInterfaceImplementation()'.
9496
9497         * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
9498         instead of a `Type[]'.
9499         (TypeManager.RegisterBuilder): Likewise.
9500         (TypeManager.AddUserInterface): Likewise.
9501         (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
9502         `Type[]' and also return a `TypeExpr[]'.
9503         (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
9504
9505 2003-11-08  Martin Baulig  <martin@ximian.com>
9506
9507         * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
9508         Expression.     
9509
9510 2003-11-08  Martin Baulig  <martin@ximian.com>
9511
9512         * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
9513         TypeManager.ResolveExpressionTypes().
9514
9515         * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
9516         instead of an Expression.
9517         (TypeExpr): This is now an abstract base class for `TypeExpression'.
9518         (TypeExpression): New public class; formerly known as `TypeExpr'.
9519
9520         * expression.cs (ComposedCast): Derive from TypeExpr.
9521
9522         * typemanager.cs (TypeManager.system_*_expr): These are now
9523         TypExpr's instead of Expression's.
9524         (TypeManager.ResolveExpressionTypes): New public static function;
9525         called from DeclSpace.GetTypeResolveEmitContext() to resolve all
9526         of them.        
9527
9528 2003-11-06  Miguel de Icaza  <miguel@ximian.com>
9529
9530         * expression.cs (New.DoResolve): Do not dereference value that
9531         might be a null return.
9532
9533         * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
9534         sure that the constant value has the right type.  Fixes an
9535         unreported bug, similar to 50425.
9536
9537         * const.cs (Const.LookupConstantValue): Call
9538         ImplicitStandardConversionExists before doing a conversion to
9539         avoid havng the TypeManager.ChangeType do conversions.
9540
9541         Reduced the number of casts used
9542
9543         (Const.ChangeType): New routine to enable reuse of the constant
9544         type changing code from statement.
9545
9546         * typemanager.cs (ChangeType): Move common initialization to
9547         static global variables.
9548
9549         Fixes #50425.
9550
9551         * convert.cs (ImplicitReferenceConversion): Somehow we allowed
9552         every value type to go through, even if it was void.  Fix that. 
9553
9554         * cs-tokenizer.cs: Use is_identifier_start_character on the start
9555         character of the define, and the is_identifier_part_character for
9556         the rest of the string.
9557
9558 2003-11-05  Miguel de Icaza  <miguel@ximian.com>
9559
9560         * expression.cs (UnaryMutator.EmitCode): When I updated
9561         LocalVariableReference.DoResolve, I overdid it, and dropped an
9562         optimization done on local variable references.
9563
9564 2003-11-04  Miguel de Icaza  <miguel@ximian.com>
9565
9566         * ecore.cs: Convert the return from Ldlen into an int.
9567
9568 2003-10-20  Miguel de Icaza  <miguel@ximian.com>
9569
9570         * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
9571         the accessibility, this is a special case for toplevel non-public
9572         classes (internal for instance).
9573
9574 2003-10-20  Nick Drochak <ndrochak@gol.com>
9575
9576         * ecore.cs: Fix typo and build.  Needed another right paren.
9577
9578 2003-10-19  Miguel de Icaza  <miguel@ximian.com>
9579
9580         * ecore.cs: Applied fix from Ben Maurer.   We were handling in the
9581         `internal' case regular and protected, but not allowing protected
9582         to be evaluated later.  Bug 49840
9583
9584 2003-10-15  Miguel de Icaza  <miguel@ximian.com>
9585
9586         * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
9587         to kb.Nlast, and not the kb.nFirst to isolate the switch
9588         statement.
9589
9590         Extract the underlying type, so enumerations of long/ulong are
9591         treated like long/ulong.
9592
9593 2003-10-14  Miguel de Icaza  <miguel@ximian.com>
9594
9595         * expression.cs (New): Overload the meaning of RequestedType to
9596         track the possible creation of the NewDelegate type, since
9597         DoResolve is invoked more than once for new constructors on field
9598         initialization.
9599
9600         See bugs: #48800 and #37014
9601
9602         * cs-parser.jay (declare_local_constants): Take an arraylist
9603         instead of a single constant.
9604
9605         (local_constant_declaration): It should take a
9606         constant_declarators, not a constant_declarator.  Fixes 49487
9607
9608         * convert.cs: Fix error report.
9609
9610 2003-10-13 Jackson Harper <jackson@ximian.com>
9611
9612         * typemanager.cs (TypeToCoreType): Add float and double this fixes
9613         bug #49611
9614         
9615 2003-11-03  Martin Baulig  <martin@ximian.com>
9616
9617         * expression.cs (ArrayAccess.GetStoreOpcode): Added
9618         `out bool has_type_arg'; if set, we need to pass the type to
9619         ig.Emit().
9620         (ArrayAccess.GetStoreOpcode, ArrayAccess.EmitLoadOpcode): Use
9621         Stelem_Any/Ldelem_Any for generic parameters.   
9622
9623 2003-11-02  Martin Baulig  <martin@ximian.com>
9624
9625         * expression.cs (Invocation.EmitCall): Use
9626         `TypeManager.IsValueType()' to check whether it's a value type.
9627         Don't set `struct_call' when calling a method on a type parameter.
9628
9629 2003-11-02  Martin Baulig  <martin@ximian.com>
9630
9631         * generics.cs (ConstructedType.Resolve): Renamed to ResolveType()
9632         and removed the TypeBuilder argument.
9633
9634         * typemanager.cs (TypeManager.IsValueType): Return
9635         `t.IsGenericParameter || t.IsValueType'.
9636
9637 2003-10-25  Martin Baulig  <martin@ximian.com>
9638
9639         * decl.cs (DeclSpace.ResolveType): If we're a ConstructedType,
9640         call ConstructedType.Resolve() on it.
9641
9642         * generic.cs (ConstructedType.Resolve): Set `type' on success.
9643
9644 2003-10-25  Martin Baulig  <martin@ximian.com>
9645
9646         * class.cs (TypeContainer.GetClassBases): Changed
9647         `out Type parent' into `out TypeExpr parent'.  Moved CS0644 and
9648         CS8214 reporting here.
9649         (TypeContainer.DefineType): GetClassBases() gives us a `TypeExpr'
9650         instead of a `Type' for our parent.  In case of a recursive
9651         declaration (see tests/gen-23.cs for an example), our parent is a
9652         ConstructedType and it doesn't have its type set.  So, first
9653         create our own TypeBuilder, then call constructed.Resolve() to get
9654         the parent's type and finally TypeBuilder.SetParent() it.
9655
9656         * ecore.cs (TypeExpr.Name): New public virtual property.
9657
9658         * generic.cs
9659         (ConstructedType): We're now a TypeExpr and not just an Expression.
9660         (ConstructedType.ResolveAsTypeStep): Don't resolve our type
9661         arguments here; this is done later.
9662         (ConstructedType.Resolve): New public method to resolve the type
9663         arguments and bind them.
9664
9665 2003-10-21  Martin Baulig  <martin@ximian.com>
9666
9667         * convert.cs: Use `TypeManager.IsValueType' instead of
9668         'type.IsValueType' everywhere.
9669
9670         * typemanager.cs (TypeManager.IsValueType): Return true for type
9671         parameters.  The reason for this is that we need to box a type
9672         parameter when converting it to a reference type.
9673
9674         * cs-parser.jay: Added support for default value expressions.
9675
9676         * generics.cs (DefaultValueExpression): New public class.       
9677
9678 2003-10-17  Martin Baulig  <martin@ximian.com>
9679
9680         * generic.cs (Constraints.Resolve): Take a DecpSpace instead of a
9681         TypeContainer so we can also use this for Interfaces.
9682         (TypeParameter.Resolve): Likewise.
9683
9684         * interface.cs (Interface.DefineType): Added support for generic
9685         interfaces.
9686
9687         * cs-parser.jay: Added support for generic structs and interfaces.
9688
9689 2003-10-17  Martin Baulig  <martin@ximian.com>
9690
9691         * generic.cs (GenericMemberAccess.DoResolve): We can now actually
9692         call generic methods :-)
9693
9694 2003-10-16  Martin Baulig  <martin@ximian.com>
9695
9696         * cs-parser.jay (namespace_or_type_name): Only create a
9697         GenericMemberAccess if we actually have type arguments.
9698
9699 2003-10-13  Martin Baulig  <martin@ximian.com>
9700
9701         * class.cs (Method.Define): If we're a generic method, call
9702         TypeBuilder.DefineGenericMethod () before resolving
9703         the parameters.
9704         (MethodData): Added .ctor which takes an additional MethodBuilder
9705         argument; this is used for generic methods.
9706         (MethodData.Define): Call `builder.SetGenericMethodSignature()' if
9707         we already have a MethodBuilder.
9708
9709 2003-10-10  Martin Baulig  <martin@ximian.com>
9710
9711         * class.cs (Method): Added .ctor which takes a `GenericMethod'
9712         instead of a `DeclSpace'.  This is used for generic methods.
9713
9714         * cs-parser.jay (method_header): Added support for generic
9715         methods; create a `GenericMethod' instance and pass it to the
9716         `Method's .ctor; it'll be used as the `DeclSpace' to lookup
9717         parameters and locals.
9718
9719         * decl.cs (DeclSpace.SetParameterInfo): Removed Location argument
9720         since we already have the location.  Check whether we're a generic
9721         type declaration or a generic method and create the correct type
9722         parameter.
9723
9724         * generic.cs (TypeParameter.DefineMethod): New public method.
9725         (GenericMethod): New public class; derives from DeclSpace and is
9726         used for generic methods.       
9727
9728 2003-10-09  Martin Baulig  <martin@ximian.com>
9729
9730         * class.cs (MethodCore): Added additional `DeclSpace ds' argument
9731         to the .ctor.
9732         (MethodCore.DoDefineParameters): Removed the TypeContainer
9733         argument; use the DeclSpace which was passed to the .ctor instead.
9734         (MethodCore.CheckParameter): Take a DeclSpace instead of a
9735         TypeContainer; we only need a DeclSpace here.
9736
9737 2003-10-09  Martin Baulig  <martin@ximian.com>
9738
9739         * class.cs (MethodData): Added additional `DeclSpace ds' argument
9740         to the .ctor.
9741         (MethodData.Define, MethodData.Emit): Pass the `ds' to the
9742         EmitContext's .ctor.    
9743
9744 2003-10-09  Martin Baulig  <martin@ximian.com>
9745
9746         * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
9747         (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
9748         AsAccessible(), moved them as well.
9749
9750         * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
9751
9752 2003-10-07  Miguel de Icaza  <miguel@ximian.com>
9753
9754         * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
9755         generation for >=, as spotted by Paolo, bug 48679.  
9756         Patch from David Waite.
9757
9758         * cs-tokenizer.cs: Add handling for #pragma.
9759
9760         * cs-parser.jay: Allow for both yield and yield return in the
9761         syntax.  The anti-cobolization of C# fight will go on!
9762
9763         * class.cs (TypeBuilder.DefineType): Catch error condition here
9764         (Parent.DefineType erroring out and returning null).
9765
9766         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
9767         coping with enumerations variables, we were mistakenly processing
9768         them as a regular value type instead of built-in types.  Fixes the
9769         bug #48063
9770
9771         * typemanager.cs (IsBuiltinOrEnum): New method.
9772
9773 2003-09-30  Miguel de Icaza  <miguel@ximian.com>
9774
9775         * cs-parser.jay: Upgrade: yield now needs the return clause.
9776
9777 2003-10-08  Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
9778
9779         * cs-parser.jay : Renamed yyName to yyNames related to jay.
9780
9781 2003-09-29  Martin Baulig  <martin@ximian.com>
9782
9783         * typemanager.cs (TypeManager.GetMethodFlags): Added support for
9784         inflated generic methods.
9785
9786         * generics.cs (ConstructedType): Distinguish between open and
9787         closed constructed types; correctly resolve the arguments.
9788
9789 2003-09-22  Martin Baulig  <martin@ximian.com>
9790
9791         * generic.cs (ConstructedType.ResolveAsTypeCheck): Check whether
9792         all type arguments meet their constraints.
9793
9794 2003-09-19  Martin Baulig  <martin@ximian.com>
9795
9796         * decl.cs (MemberCache.SetupCacheForInterface): Take a
9797         `MemberCache parent' argument.  Normally, an interface doesn't
9798         have a parent type except System.Object, but we use this in gmcs
9799         for generic type parameters.
9800
9801 2003-09-18  Martin Baulig  <martin@ximian.com>
9802
9803         * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
9804         on `type.IsInterface'; don't check whether the type has a parent
9805         to determine whether it's an interface.
9806
9807 2003-09-17  Martin Baulig  <martin@ximian.com>
9808
9809         * generic.cs (ConstructedType.ToString): Always use `name' as the
9810         type name.
9811
9812 2003-09-15  Martin Baulig  <martin@ximian.com>
9813
9814         * cs-parser.jay: Fix grammar wrt. type_parameter_constraints.
9815
9816         * generic.cs (Constraints.Resolve): New public method; this is
9817         called to resolve the constraint types and to check whether all
9818         the constraints are correct.
9819         (Constraints.Types): New public property.
9820         (TypeParameter.Resolve): New public method; resolves all the
9821         type's constraints.
9822
9823         * class.cs (TypeContainer.DefineType): Call
9824         TypeParameter.Resolve() before actually defining the type.
9825
9826 2003-09-15  Martin Baulig  <martin@ximian.com>
9827
9828         * class.cs (TypeContainer.DefineType): Added an error flag to
9829         avoid reporting duplicate CS0146's ("class definition is
9830         circular.").
9831
9832         * driver.cs (Driver.MainDriver): Abort if
9833         RootContext.ResolveTree() reported any errors.
9834
9835 2003-09-07  Martin Baulig  <martin@ximian.com>
9836
9837         * report.cs (Error, Warning): Added overloaded versions which take
9838         a `params object[] args' and call String.Format().
9839
9840 2003-09-07  Martin Baulig  <martin@ximian.com>
9841
9842         * decl.cs (DeclSpace..ctor): Don't call
9843         NamespaceEntry.DefineName() here; do it in RecordDecl() which is
9844         called from Tree.RecordDecl().  Fixes the CS0101 reporting.
9845         (DeclSpace.RecordDecl): New method.
9846
9847         * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
9848
9849 2003-09-02  Ravi Pratap  <ravi@ximian.com>
9850
9851         * attribute.cs (CheckAttributeTarget): Ensure that we allow return
9852         value attributes to be applied to ParameterBuilders.
9853
9854         * class.cs (MethodCore.LabelParameters): Make static and more
9855         generic so that it can be used from other places - like interface
9856         methods, for instance.
9857
9858         * interface.cs (Interface.Emit): Call LabelParameters before
9859         emitting attributes on the InterfaceMethod.
9860
9861 2003-09-07  Martin Baulig  <martin@ximian.com>
9862
9863         * generic.cs (ConstructedType.ResolveAsTypeStep): Report a CS8217
9864         if the number of type parameters doesn't match.
9865
9866 2003-09-04  Martin Baulig  <martin@ximian.com>
9867
9868         * expression.cs (ComposedCast.ResolveAsTypeStep): Added support
9869         for arrays of generic type params (ie. `!0[]').
9870
9871 2003-09-04  Martin Baulig  <martin@ximian.com>
9872
9873         * class.cs (TypeContainer.AsAccessible): Ignore generic parameters
9874         for the moment.
9875
9876 2003-09-04  Martin Baulig  <martin@ximian.com>
9877
9878         * decl.cs (DeclSpace.LookupGeneric): New method.
9879         (DeclSpace.CheckAccessLevel): Ignore generic parameters for the
9880         moment.
9881
9882         * generic.cs (TypeParameterExpr): Take a TypeParameter as
9883         argument, not just a string.
9884         (TypeParameter.Define): New public method; this is called to
9885         actually define the generic parameter; after this, you can use the
9886         new `Type' property to get the type.
9887
9888 2003-09-04  Martin Baulig  <martin@ximian.com>
9889
9890         * decl.cs (DeclSpace.SetParameterInfo): The `constraints' argument
9891         is now an ArrayList; initialize the result of the `TypeParameters'
9892         property here.
9893         (DeclSpace.GetGenericData): Removed.
9894         (DeclSpace.LookupGeneric): Temporarily removed; we need to
9895         implement this in a different way.
9896         (DeclSpace.GetTypeParameters): Removed; there's now a
9897         `TypeParameters' property.
9898         (DeclSpace.TypeParameters): New public property.
9899
9900         * generic.cs (Constraints): Make this class public.
9901         (TypeParameter): New public class.
9902
9903 2003-09-04  Martin Baulig  <martin@ximian.com>
9904
9905         * decl.cs (DeclSpace.GetTypeParameters): New method to return the
9906         generic parameters.
9907
9908         * class.cs (TypeContainer.DefineType): Call
9909         TypeBuilder.DefineGenericParameter () on all generic parameters if
9910         this is a generic type.
9911
9912 2003-08-28  Martin Baulig  <martin@ximian.com>
9913
9914         * sample-stack.il: Compile this with ilasm: "ilasm /dll
9915         sample-stack.il".
9916
9917         * sample-hello.cs: Compile this with gmcs: "gmcs
9918         /r:sample-stack.dll sample-hello.cs".
9919
9920 2003-08-28  Martin Baulig  <martin@ximian.com>
9921
9922         * generic.cs (ConstructedType.ResolveAsTypeStep): Actually bind
9923         the parameters to the generic type.
9924
9925 2003-08-28  Martin Baulig  <martin@ximian.com>
9926
9927         * cs-tokenizer.cs (parse_less_than): Also allow all builtin types.
9928
9929 2003-08-28  Martin Baulig  <martin@ximian.com>
9930
9931         * cs-parser.jay (opt_type_argument_list): Use
9932         `OP_GENERICS_LT type_arguments OP_GENERICS_GT'.
9933         (primary_expression): Replace `qualified_identifier' with `type_name'.
9934         (type_parameter_list): Use `OP_GENERICS_LT type_parameters OP_GENERICS_GT'.
9935
9936         * cs-tokenizer.cs (is_punct): When reading a `<', invoke a custom
9937         parser to check whether it is syntactically a type parameter list;
9938         return OP_GENERICS_LT/OP_GENERICS_GT instead of OP_LT/OP_GT in
9939         this case.
9940
9941 2003-08-26  Martin Baulig  <martin@ximian.com>
9942
9943         * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
9944         resolving aliases; fixes #47927.
9945
9946 2003-08-26  Martin Baulig  <martin@ximian.com>
9947
9948         * statement.cs (Using.DoResolve): This is internally emitting a
9949         try/finally clause, so we need to set ec.NeedExplicitReturn if we
9950         do not always return.  Fixes #47681.
9951
9952 2003-08-26  Martin Baulig  <martin@ximian.com>
9953
9954         * decl.cs (MemberCore): Moved WarningNotHiding(),
9955         Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
9956         into MemberBase.
9957         (AdditionResult): Make this nested in DeclSpace.
9958         (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
9959         argument; call NamespaceEntry.Define() unless we're nested in a
9960         class or struct.
9961
9962         * namespace.cs (Namespace.DefineName): New public function.  This
9963         is called from DeclSpace's .ctor to add 
9964         (Namespace.Lookup): Include DeclSpaces in the lookup.
9965
9966         * class.cs (Operator): Derive from MemberBase, not MemberCore.
9967
9968         * const.cs (Const): Derive from MemberBase, not MemberCore.     
9969
9970 2003-08-25  Martin Baulig  <martin@ximian.com>
9971
9972         * convert.cs (Convert.ExplicitReferenceConversion): When
9973         converting from an interface type to a class, unbox if the target
9974         type is a struct type.  Fixes #47822.
9975
9976 2003-08-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9977
9978         * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
9979         #47854.
9980
9981 2003-08-22  Martin Baulig  <martin@ximian.com>
9982
9983         * class.cs (TypeManager.DefineType): When defining a nested type,
9984         call DefineType() on our parent; fixes #47801.
9985
9986 2003-08-22  Martin Baulig  <martin@ximian.com>
9987
9988         * class.cs (MethodData.Define): While checking if a method is an
9989         interface implementation, improve the test a bit more to fix #47654.
9990
9991 2003-08-22  Martin Baulig  <martin@ximian.com>
9992
9993         * expression.cs (Probe.DoResolve): Check whether `expr' resolved
9994         correctly; fixes #47722.
9995
9996 2003-08-22  Martin Baulig  <martin@ximian.com>
9997
9998         * expression.cs (UnaryMutator.ResolveVariable): If the target is a
9999         LocalVariableReference, ensure it's not read-only.  Fixes #47536.
10000
10001         * statement.cs (Fixed.DoResolve): Make all variables read-only. 
10002
10003 2003-08-22  Martin Baulig  <martin@ximian.com>
10004
10005         * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
10006         can only be assigned in static constructors.  Fixes #47161.
10007
10008 2003-08-22  Martin Baulig  <martin@ximian.com>
10009
10010         Rewrote and improved the flow analysis code.
10011
10012         * flowbranching.cs (FlowBranching): Make this class abstract.
10013         (FlowBranching.CreateBranching): New static function to create a
10014         new flow branching.
10015         (FlowBranchingBlock, FlowBranchingException): New classes.
10016         (FlowBranching.UsageVector.Type): New public readonly field.
10017         (FlowBranching.UsageVector.Breaks): Removed the setter.
10018         (FlowBranching.UsageVector.Returns): Removed the setter.
10019         (FlowBranching.UsageVector): Added Break(), Return(),
10020         NeverReachable() and Throw() methods to modify the reachability.
10021         (FlowBranching.UsageVector.MergeChildren): Removed, this is now
10022         done by FlowBranching.Merge().
10023         (FlowBranching.UsageVector.MergeChild): New method; merges the
10024         merge result into the current vector.
10025         (FlowBranching.Merge): New abstract method to merge a branching.
10026
10027 2003-08-12  Martin Baulig  <martin@ximian.com>
10028
10029         * expression.cs (Indirection.CacheTemporaries): Create the
10030         LocalTemporary with the pointer type, not its element type.
10031
10032 2003-08-10  Miguel de Icaza  <miguel@ximian.com>
10033
10034         * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
10035         token was a keyword or not.
10036
10037         Add `error' options where an IDENTIFIER was expected;  Provide
10038         CheckToken and CheckIdentifierToken convenience error reporting
10039         functions. 
10040
10041         Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
10042
10043         * decl.cs: Rename `NamespaceEntry Namespace' public field into
10044         NameSpaceEntry NameSpaceEntry.
10045
10046         (LookupInterfaceOrClass): Avoid creating a full qualified name
10047         from namespace and name: avoid doing lookups when we know the
10048         namespace is non-existant.   Use new Tree.LookupByNamespace which
10049         looks up DeclSpaces based on their namespace, name pair.
10050
10051         * driver.cs: Provide a new `parser verbose' to display the
10052         exception thrown during parsing.  This is turned off by default
10053         now, so the output of a failure from mcs is more graceful.
10054
10055         * namespace.cs: Track all the namespaces defined in a hashtable
10056         for quick lookup.
10057
10058         (IsNamespace): New method
10059
10060 2003-08-09  Miguel de Icaza  <miguel@ximian.com>
10061
10062         * namespace.cs: Remove redundant call;  Avoid using MakeFQN when
10063         we know that we need to concatenate (full typename can never be
10064         null). 
10065
10066         * class.cs: ditto.
10067
10068         * statement.cs: Use a bitfield;  Do not initialize to null things
10069         which are done by the constructor by default.
10070
10071         * cs-parser.jay: bug fix, parameter was 4, not 3.
10072
10073         * expression.cs: Just use the property;
10074
10075         * statement.cs: No need for GetVariableInfo method.
10076
10077 2003-08-08  Martin Baulig  <martin@ximian.com>
10078
10079         * flowanalysis.cs (FlowReturns): This is now nested in the
10080         `FlowBranching' class.
10081         (MyBitVector): Moved this here from statement.cs.
10082         (FlowBranching.SiblingType): New enum type.
10083         (FlowBranching.CreateSibling): Added `SiblingType' argument.
10084
10085 2003-08-07  Martin Baulig  <martin@ximian.com>
10086
10087         * flowanalysis.cs (FlowBranchingType): This is now nested in the
10088         `FlowBranching' class and called `BranchingType'.
10089
10090 2003-08-07  Martin Baulig  <martin@ximian.com>
10091
10092         * flowanalysis.cs: Moved all the control flow analysis code into
10093         its own file.
10094
10095 2003-08-07  Martin Baulig  <martin@ximian.com>
10096
10097         * assign.cs (Assign.DoResolve): `target' must either be an
10098         IAssignMethod or an EventAccess; report a CS0131 otherwise.  Fixes
10099         #37319.
10100
10101 2003-08-07  Miguel de Icaza  <miguel@ximian.com>
10102
10103         * expression.cs (BinaryMethod): This kind of expression is created by the
10104         Binary class if it determines that the operator has to be handled
10105         by a method.
10106
10107         (BinaryDelegate): This kind of expression is created if we are
10108         dealing with a + or - operator on delegates.
10109
10110         (Binary): remove method, argumetns, and DelegateOperator: when
10111         dealing with methods, 
10112
10113         * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
10114
10115         * statement.cs (Block): use bitfields for the three extra booleans
10116         we had in use.   Remove unused topblock parameter.
10117
10118         * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
10119
10120         * assign.cs: Drop extra unneeded tests.
10121
10122 2003-08-06  Miguel de Icaza  <miguel@ximian.com>
10123
10124         * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
10125
10126         * statement.cs (Foreach): Use VariableStorage instead of
10127         LocalBuilders.   
10128
10129         * codegen.cs (VariableStorage): New class used by clients that
10130         require a variable stored: locals or fields for variables that
10131         need to live across yield.
10132
10133         Maybe provide a convenience api for EmitThis+EmitLoad?
10134
10135         (GetTemporaryLocal, FreeTemporaryLocal): Recycle
10136         these bad boys.
10137
10138 2003-08-05  Miguel de Icaza  <miguel@ximian.com>
10139
10140         * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
10141         RemapParameterLValue): New methods that are used to turn a
10142         precomputed FieldInfo into an expression like this:
10143
10144                 instance.FieldInfo
10145
10146         The idea is to use this instead of making LocalVariableReference
10147         have more than one meaning.
10148
10149         * cs-parser.jay: Add error production to BASE.
10150
10151         * ecore.cs: Deal with TypeManager.GetField returning null, which
10152         is now a valid return value.
10153
10154         (FieldExprNoAddress): New expression for Fields whose address can
10155         not be taken.
10156
10157         * expression.cs (LocalVariableReference): During the resolve
10158         phases, create new expressions if we are in a remapping context.
10159         Remove code that dealt with remapping here.
10160
10161         (ParameterReference): same.
10162
10163         (ProxyInstance): New expression, like the `This' expression, but
10164         it is born fully resolved.  We know what we are doing, so remove
10165         the errors that are targeted to user-provided uses of `this'.
10166
10167         * statement.cs (Foreach): our variable is now stored as an
10168         Expression;  During resolution, follow the protocol, dont just
10169         assume it will return this.
10170
10171 2003-08-06  Martin Baulig  <martin@ximian.com>
10172
10173         * support.cs (SeekableStreamReader.cs): New public class.
10174
10175         * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
10176         SeekableStreamReader instead of the normal StreamReader.
10177
10178 2003-08-04  Martin Baulig  <martin@ximian.com>
10179
10180         * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
10181         CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
10182         deambiguate casts and delegate invocations.
10183         (parenthesized_expression): Use the new tokens to ensure this is
10184         not a cast of method invocation.
10185
10186         * cs-tokenizer.cs (is_punct): Return one of the new special tokens
10187         when reading a `)' and Deambiguate_CloseParens () was previously
10188         called.
10189
10190         * expression.cs (ParenthesizedExpression): New class.  This is
10191         just used for the CS0075 test.
10192         (Binary.DoResolve): Check for CS0075.   
10193
10194 2003-07-29  Ravi Pratap  <ravi@ximian.com>
10195
10196         * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
10197         Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
10198         reference comparison.
10199
10200         (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
10201         examine the ReturnType for equality - this is necessary in the
10202         cases of implicit and explicit operators whose signature also
10203         includes the return type.
10204
10205 2003-07-26  Miguel de Icaza  <miguel@ximian.com>
10206
10207         * namespace.cs: Cache the result of the namespace computation,
10208         instead of computing it every time.
10209
10210 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
10211
10212         * decl.cs: Use a global arraylist that we reuse over invocations
10213         to avoid excesive memory consumption.  Reduces memory usage on an
10214         mcs compile by one meg (45 average).
10215
10216         * typemanager.cs (LookupTypeReflection): In .NET pointers are
10217         private, work around that.
10218
10219 2003-07-23  Miguel de Icaza  <miguel@ximian.com>
10220
10221         * literal.cs (IntLiteral): Define Zero and One static literals. 
10222
10223         * cs-parser.jay (integer_literal): use static literals to reduce
10224         memory usage for the most used literals (0, 1 and -1).  211kb
10225         reduced in memory usage.
10226
10227         Replace all calls to `new ArrayList' with `new
10228         ArrayList(4)' which is a good average number for most allocations,
10229         and also requires only 16 bytes of memory for its buffer by
10230         default. 
10231
10232         This reduced MCS memory usage in seven megabytes for the RSS after
10233         bootstrapping.
10234
10235 2003-07-28  Ravi Pratap  <ravi@ximian.com>
10236
10237         * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
10238         handle params methods the correct way by forming only one
10239         applicable set with params and normal methods in them. Earlier we
10240         were looking at params methods only if we found no normal methods
10241         which was not the correct thing to do.
10242
10243         (Invocation.BetterFunction): Take separate arguments indicating
10244         when candidate and the best method are params methods in their
10245         expanded form.
10246
10247         This fixes bugs #43367 and #46199.
10248
10249         * attribute.cs: Documentation updates.
10250
10251         (CheckAttribute): Rename to CheckAttributeTarget.
10252         (GetValidPlaces): Rename to GetValidTargets.
10253
10254         * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
10255         bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
10256
10257         Fixes bug #44468.
10258
10259 2003-07-28  Miguel de Icaza  <miguel@ximian.com>
10260
10261         * codegen.cs: Compute IsGeneric correctly.
10262
10263         * cs-parser.jay: Introduce OP_GENERIC_LT for the grammar ambiguity
10264         resolution. 
10265
10266         Bring back (temporarily) OP_LEFT_SHIFT, OP_RIGHT_SHIFT,
10267         OP_SHIFT_RIGHT_ASSIGN, OP_SHIFT_LEFT_ASSIGN.  There were too many
10268         regressions, and I was chasing more bugs than I required.
10269
10270         * interface.cs: Use expressions for base type names (like classes
10271         and structs have been doing for a while now), and resolve that.
10272         This patch should probably go into head as well.
10273
10274         This makes it one less user of FindType.
10275
10276 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
10277
10278         This compiler can not self host currently.  Need to fix that.
10279         
10280         * Makefile: compile to `gmcs.exe'
10281
10282         * driver.cs: Turn on v2 by default on gmcs.
10283
10284         * generic.cs (ConstructedType): Does no longer take a container
10285         type argument;  That will be taken care of later.
10286
10287         (ConstructedType.DoResolve, ConstructedType.ResolveAsTypeStep):
10288         Use SimpleName to resolve for now, so we can continue the work on
10289         the parser, until we get Type.GetType that understands generics.
10290
10291         (ConstructedType.ToString): Implement
10292
10293         (TypeArguments.Resolve): Resolve the child expressions as types. 
10294         
10295         * cs-parser.jay: Rename interface_constraints to
10296         type_parameter_constraints
10297
10298         (namespace_or_type_name): Only use constructed types for the basic
10299         construction, we will deal with identifier<...> later.
10300
10301         (type/type_name): No longer call DecomposeQI, as
10302         namespace_or_type_name is always decoded now.
10303         
10304 2003-07-22  Ravi Pratap  <ravi@ximian.com>
10305
10306         * expression.cs (Invocation.OverloadResolve): Follow the spec more
10307         closely: we eliminate methods in base types when we have an
10308         applicable method in a top-level type.
10309
10310         Please see section 14.5.5.1 for an exact description of what goes
10311         on. 
10312
10313         This fixes bug #45127 and a host of other related to corlib compilation.
10314
10315         * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
10316         array is the method corresponding to the top-level type (this is
10317         because of the changes made to icall.c) so we change this
10318         accordingly.
10319
10320         (MethodGroupExpr.Name): This too.
10321
10322         * typemanager.cs (GetElementType): New method which does the right
10323         thing when compiling corlib. 
10324
10325         * everywhere: Make use of the above in the relevant places.
10326
10327 2003-07-22  Martin Baulig  <martin@ximian.com>
10328
10329         * cs-parser.jay (invocation_expression): Moved
10330         `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
10331         `cast_expression', but create a InvocationOrCast which later
10332         resolves to either an Invocation or a Cast.
10333
10334         * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
10335         method; call this before EmitStatement() to make sure that this
10336         expression can be used as a statement.
10337
10338         * expression.cs (InvocationOrCast): New class; resolves to either
10339         an Invocation or a Cast.
10340
10341         * statement.cs (StatementExpression): Call ResolveStatement() on
10342         the ExpressionStatement before emitting it.
10343
10344 2003-07-21  Martin Baulig  <martin@ximian.com>
10345
10346         * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
10347         `ref' and `out' attributes match; fixes #46220.
10348         (MemberAccess.ResolveMemberAccess): You can't reference a type
10349         through an expression; fixes #33180.
10350         (Indexers.GetIndexersForType): Don't return the indexers from
10351         interfaces the class implements; fixes #46502.
10352
10353 2003-07-21  Martin Baulig  <martin@ximian.com>
10354
10355         * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
10356         CS0661 checks; fixes bug #30442.
10357
10358 2003-07-21  Martin Baulig  <martin@ximian.com>
10359
10360         * decl.cs (AdditionResult): Added `Error'.
10361
10362         * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
10363
10364         * typemanager.cs (TypeManager.ChangeType): Catch exceptions; makes
10365         cs0031.cs actually work.
10366
10367  2003-07-20  Miguel de Icaza  <miguel@ximian.com>
10368  
10369         * cs-parser.jay (namespace_name): do not use
10370         namespace_or_type_name, use qualified_identifier, because
10371         namespace_or_type_name will soon return a composed expression
10372         instead of a string.
10373  
10374         (namespace_or_type_name): Instead of returning a string, now this
10375         production returns an expression.
10376  
10377         * codegen.cs (EmitContext): Setup IsGeneric property based on
10378         whether our DeclSpace is generic, our the method is generic.
10379  
10380         * modifier.cs (Modifiers.METHOD_GENERIC): New definition, use if
10381         the method is generic.
10382  
10383         * cs-parser.jay (type_arguments, opt_type_argument_list,
10384         type_parameters, type_parameter_list, opt_type_parameter_list,
10385         type_parameter,, opt_type_parameter_constraints_clauses,
10386         type_parameter_constraints_clauses,
10387         type_parameter_constraint_clause, type_parameter_constraint,
10388         interface_constraints): Add new production
10389  
10390         * decl.cs (DeclSpace): IsGeneric, flag to track whether this
10391         DeclSpace is generic or not.
10392  
10393         (DeclSpace.SetParameterInfo): New routine, used to set the
10394         parameter info for a type.
10395  
10396         (DeclSpace.LookupGeneric): Lookups a name, and if it is a generic,
10397         returns a GenericTypeExpr
10398  
10399         * ecore.cs (SimpleName.ResolveAsTypeStep): If our container is
10400         generic, lookup the generic argument.
10401  
10402         * attribute.cs: Do not allow TypeParameterExpressions in
10403         Attributes.
10404  
10405         * class.cs: Do not allow the Main method to be defined in a
10406         Generic container.
10407  
10408         * expression.cs (SizeOf): Do not allow generic types to be used as
10409         arguments to sizeof.
10410  
10411         * typemanager.cs (IsGeneric): Wrapper for Reflection when we have
10412         it: whether a type is generic or not.  Only works for types we are
10413         currently building for now.
10414         
10415 2003-07-20  Martin Baulig  <martin@ximian.com>
10416
10417         * namespace.cs: Fixed that bug which caused a crash when compiling
10418         the debugger's GUI.
10419
10420 2003-07-20  Miguel de Icaza  <miguel@ximian.com>
10421
10422         * typemanager.cs (LookupTypeReflection): Never expose types which
10423         are NotPublic, NestedPrivate, NestedAssembly, or
10424         NestedFamANDAssem.  We used to return these, and later do a check
10425         that would report a meaningful error, but the problem is that we
10426         would not get the real match, if there was a name override.
10427
10428 2003-07-18  Miguel de Icaza  <miguel@ximian.com>
10429
10430         * namespace.cs (Namespace, Name): Do not compute the namespace
10431         name dynamically, compute it in the constructor.  This reduced
10432         memory usage by 1697 KB.
10433
10434         * driver.cs: Use --pause to pause at the end.
10435
10436 2003-07-17  Peter Williams  <peter@newton.cx>
10437
10438         * Makefile: Change the name of the test target so that it doesn't
10439         conflict with the recursive test target.
10440
10441 2003-07-17  Miguel de Icaza  <miguel@ximian.com>
10442
10443         * expression.cs (LocalVariableReference.Emit, EmitAssign,
10444         AddressOf): Do not use EmitThis, that was wrong, use the actual
10445         this pointer.
10446
10447 2003-07-15  Miguel de Icaza  <miguel@ximian.com>
10448
10449         * class.cs (MethodData.Define): While checking if a method is an
10450         interface implementation, improve the test: If we are not public
10451         (use new test here: use the computed MethodAttributes directly,
10452         instead of the parsed modifier flags) check if the `implementing'
10453         method comes from an interface or not.
10454
10455         * pending.cs (VerifyPendingMethods): Slightly better error
10456         message.
10457
10458         * makefile: add test target that does the mcs bootstrap.
10459
10460 2003-07-16  Ravi Pratap  <ravi@ximian.com>
10461
10462         * interface.cs (Define): Do nothing here since there are no
10463         members to populate etc. Move the attribute emission out of here
10464         since this was just totally the wrong place to put it. Attribute
10465         application happens during the 'Emit' phase, not in the 'Define'
10466         phase.
10467
10468         (Emit): Add this method and move the attribute emission here
10469
10470         * rootcontext.cs (EmitCode): Call the Emit method on interface
10471         types too.
10472
10473 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
10474
10475         * expression.cs (OverloadResolve): Report error only if Location
10476         is not 'Null' which means that there was a probe going on.
10477
10478 2003-07-14  Martin Baulig  <martin@ximian.com>
10479
10480         * expression.cs (ConditionalLogicalOperator): New public class to
10481         implement user defined conditional logical operators.
10482         This is section 14.11.2 in the spec and bug #40505.
10483
10484 2003-07-14  Martin Baulig  <martin@ximian.com>
10485
10486         * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
10487
10488 2003-07-14  Martin Baulig  <martin@ximian.com>
10489
10490         * codegen.cs (EmitContext.InFixedInitializer): New public field.
10491
10492         * ecore.cs (IVariable.VerifyFixed): New interface method.
10493
10494         * expression.cs (Unary.ResolveOperator): When resolving the `&'
10495         operator, check whether the variable is actually fixed.  Fixes bug
10496         #36055.  Set a variable definitely assigned when taking its
10497         address as required by the spec.
10498
10499         * statement.cs (LocalInfo.IsFixed): New field.
10500         (LocalInfo.MakePinned): Set `IsFixed' to true.
10501
10502 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
10503
10504         * attribute.cs (Attribute.Resolve): While doing a Member lookup
10505         for .ctors, ensure that we only ask for members declared in the
10506         attribute type (BindingFlags.DeclaredOnly).
10507
10508         Fixes bug #43632.
10509
10510         * expression.cs (Error_WrongNumArguments): Report error 1501
10511         correctly the way CSC does.
10512
10513 2003-07-13  Martin Baulig  <martin@ximian.com>
10514
10515         * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
10516         lookup on the fully qualified name, to make things like "X.X" work
10517         where "X.X" is a fully qualified type name, but we also have a
10518         namespace "X" in the using list.  Fixes #41975.
10519
10520 2003-07-13  Martin Baulig  <martin@ximian.com>
10521
10522         * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
10523         function. If we're a CompoundAssign, we need to create an embedded
10524         CompoundAssign, not an embedded Assign.
10525         (Assign.DoResolve): Make this work for embedded CompoundAssign's.
10526         Fixes #45854.
10527
10528 2003-07-13  Martin Baulig  <martin@ximian.com>
10529
10530         * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
10531         work to fix bug #46088.
10532
10533 2003-07-13  Ravi Pratap <ravi@ximian.com>
10534
10535         * class.cs (Operator.Emit): Do not emit attributes here - it is
10536         taken care of by the Method class that we delegate too. This takes
10537         care of bug #45876.
10538
10539 2003-07-10  Martin Baulig  <martin@ximian.com>
10540
10541         * expression.cs (TypeOfVoid): New class.
10542         (TypeOf): Report a CS0673 if it's System.Void.  Fixes #42264.
10543
10544 2003-07-10  Martin Baulig  <martin@ximian.com>
10545
10546         * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
10547         bug #35957.
10548
10549 2003-07-10  Martin Baulig  <martin@ximian.com>
10550
10551         * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
10552         not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
10553
10554         * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
10555
10556         * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
10557
10558 2003-07-10  Martin Baulig  <martin@ximian.com>
10559
10560         * expression.cs (ArrayCreation): Don't use a byte blob for arrays
10561         of decimal.  Fixes #42850.
10562
10563         NOTE: I also fixed the created byte blob, but this doesn't work on
10564         the MS runtime and csc never produces any byte blobs for decimal
10565         arrays.
10566
10567 2003-07-10  Martin Baulig  <martin@ximian.com>
10568
10569         * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
10570         structs; fixes #32068.
10571         (Block.AddChildVariableNames): Fixed #44302.
10572
10573 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10574
10575         * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
10576
10577 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
10578
10579         * attribute.cs: And this test is onger needed.
10580
10581 2003-07-08  Martin Baulig  <martin@ximian.com>
10582
10583         * rootcontext.cs (RootContext.NamespaceLookup): Ignore
10584         inaccessible types.  Fixes #36313.
10585
10586         * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
10587
10588         * namespace.cs (NamespaceEntry): Create implicit entries for all
10589         namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
10590         implicit entries for N1.N2 and N1.
10591
10592 2003-07-08  Martin Baulig  <martin@ximian.com>
10593
10594         Rewrote the handling of namespaces to fix a lot of the issues
10595         wrt. `using' aliases etc.
10596
10597         * namespace.cs (Namespace): Splitted this class into a
10598         per-assembly `Namespace' and a per-file `NamespaceEntry'.
10599
10600         * typemanager.cs (TypeManager.IsNamespace): Removed.
10601         (TypeManager.ComputeNamespaces): Only compute namespaces from
10602         loaded assemblies here, not the namespaces from the assembly we're
10603         currently compiling.
10604
10605 2003-07-08  Martin Baulig  <martin@ximian.com>
10606
10607         * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
10608
10609 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
10610
10611         * typemanager.cs: Reverted patch from Gonzalo, my previous patch
10612         already fixed it.  
10613
10614         I thought about the memory savings here, but LookupTypeReflection
10615         is used under already very constrained scenarios.  Compiling
10616         corlib or mcs only exposes one hit, so it would not really reduce
10617         any memory consumption.
10618
10619 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10620
10621         * typemanager.cs: fixes bug #45889 by only adding public types from
10622         other assemblies to the list of known types.
10623
10624 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
10625
10626         * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
10627         on the type we resolved.
10628
10629 2003-07-05  Martin Baulig  <martin@ximian.com>
10630
10631         * pending.cs (PendingImplementation.ParentImplements): Don't
10632         create the proxy if the parent is abstract.
10633
10634         * class.cs (TypeContainer.DefineIndexers): Process explicit
10635         interface implementations first.  Fixes #37714.
10636
10637 2003-07-04  Miguel de Icaza  <miguel@ximian.com>
10638
10639         * expression.cs (MemberAccess.ResolveMemberAccess): Events are
10640         defined recursively;  but since we modify the input parameters
10641         (left is set to `this' temporarily), we reset this value if the
10642         left_is_explicit is false, which gives the original semantics to
10643         the code.  
10644
10645         * literal.cs (NullPointer): new class used to represent a null
10646         literal in a pointer context.
10647
10648         * convert.cs (Convert.ImplicitReferenceConversion): Is the target
10649         type is a pointer, use a NullPointer object instead of a
10650         NullLiteral.   Closes 43687
10651
10652         (ExplicitConversion): Convert pointer values using
10653         the conv opcode to the proper type.
10654
10655         * ecore.cs (New): change ValueTypeVariable property into a method,
10656         that returns whether the valuetype is suitable for being used.
10657
10658         * expression.cs (Binary.DoNumericPromotions): Only return if we
10659         the int constant was a valid uint, and we can return both left and
10660         right as uints.  If not, we continue processing, to trigger the
10661         type conversion.  This fixes 39018.
10662
10663         * statement.cs (Block.EmitMeta): During constant resolution, set
10664         the CurrentBlock property on the emitcontext, so that we resolve
10665         constants propertly.
10666
10667 2003-07-02  Martin Baulig  <martin@ximian.com>
10668
10669         * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
10670         (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
10671
10672         * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
10673         than emitting it here.
10674
10675         * statement.cs: Fixed some more flow analysis bugs.
10676
10677 2003-07-02  Martin Baulig  <martin@ximian.com>
10678
10679         * class.cs (MethodData.Define): When implementing interface
10680         methods, set Final unless we're Virtual.
10681
10682         * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
10683         check work for interface methods.
10684
10685 2003-07-01  Martin Baulig  <martin@ximian.com>
10686
10687         * ecore.cs (EmitContext.This): Replaced this property with a
10688         GetThis() method which takes a Location argument.  This ensures
10689         that we get the correct error location for a CS0188.
10690
10691 2003-07-01  Miguel de Icaza  <miguel@ximian.com>
10692
10693         * ecore.cs: (Convert.ConvertIntLiteral): Add test for
10694         ImplicitStandardConversion.
10695
10696         * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
10697
10698 2003-07-01  Zoltan Varga  <vargaz@freemail.hu>
10699
10700         * expression.cs (ResolveOperator): Fix Concat (string, string, string)
10701         optimization.
10702
10703 2003-06-30  Miguel de Icaza  <miguel@ximian.com>
10704
10705         * class.cs (Constructor.Define): Turn off initlocals for unsafe
10706         constructors.
10707
10708         (MethodData.Define): Turn off initlocals for unsafe methods.
10709
10710 2003-06-29  Miguel de Icaza  <miguel@ximian.com>
10711
10712         * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
10713         complete;  Fixes #37521.
10714
10715         * delegate.cs: Use Modifiers.TypeAttr to compute the
10716         TypeAttributes, instead of rolling our own.  This makes the flags
10717         correct for the delegates.
10718
10719 2003-06-28  Miguel de Icaza  <miguel@ximian.com>
10720
10721         * class.cs (Constructor.Define): Set the private flag for static
10722         constructors as well.
10723
10724         * cs-parser.jay (statement_expression): Set the return value to
10725         null, to avoid a crash when we catch an error.
10726
10727 2003-06-24  Miguel de Icaza  <miguel@ximian.com>
10728
10729         * cs-parser.jay: Applied patch from Jackson that adds support for
10730         extern and unsafe modifiers to destructor declarations.
10731
10732         * expression.cs: Report error 21 if the user is trying to index a
10733         System.Array.
10734
10735         * driver.cs: Add an error message, suggested by the bug report.
10736
10737         * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
10738         if we do not have a ": this ()" constructor initializer.  Fixes 45149
10739
10740 2003-06-14  Miguel de Icaza  <miguel@ximian.com>
10741
10742         * namespace.cs: Add some information to reduce FAQs.
10743
10744 2003-06-13  Miguel de Icaza  <miguel@ximian.com>
10745
10746         * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
10747         underlying enumeration types.  Fixes #43915.
10748
10749         * expression.cs: Treat ushort/short as legal values to be used in
10750         bitwise operations.
10751
10752 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
10753
10754         * delegate.cs: transfer custom attributes for paramenters from
10755         the delegate declaration to Invoke and BeginInvoke.
10756
10757 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
10758
10759         * attribute.cs: handle custom marshalers and emit marshal info
10760         for fields, too.
10761
10762 2003-05-28  Hector E. Gomez Morales  <hgomez_36@flashmail.com>
10763
10764         * makefile.gnu: Added anonymous.cs to the compiler sources.
10765
10766 2003-05-28  Miguel de Icaza  <miguel@ximian.com>
10767
10768         * iterators.cs: Change the name of the proxy class to include two
10769         underscores.
10770
10771         * cs-parser.jay: Update grammar to include anonymous methods.
10772
10773         * anonymous.cs: new file.
10774
10775 2003-05-27  Miguel de Icaza  <miguel@ximian.com>
10776
10777         * class.cs (Field.Define): Add missing test for pointers and
10778         safety. 
10779
10780 2003-05-27  Ravi Pratap  <ravi@ximian.com>
10781
10782         * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
10783         we use the stobj opcode.
10784
10785         (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
10786         since it wasn't the correct fix. 
10787
10788         It still is puzzling that we are required to use stobj for IntPtr
10789         which seems to be a ValueType.
10790
10791 2003-05-26  Miguel de Icaza  <miguel@ximian.com>
10792
10793         * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
10794         during regular simple name resolution.   Now, the trick is that
10795         instead of returning for processing the simplename, we do a
10796         TypeManager.LookupType (ie, a rooted lookup as opposed to a
10797         contextual lookup type).   If a match is found, return that, if
10798         not, return for further composition.
10799
10800         This fixes long-standing 30485.
10801
10802         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
10803         using the address to initialize an object, do an Stobj instead of
10804         using the regular Stelem.
10805
10806         (IndexerAccess.Emit, IndexerAccess.EmitAssign):
10807         Pass `is_base_indexer' to Invocation.EmitCall instead of false.
10808         Because if we are a BaseIndexerAccess that value will be true.
10809         Fixes 43643.
10810
10811         * statement.cs (GotoCase.Resolve): Return after reporting an
10812         error, do not attempt to continue. 
10813
10814         * expression.cs (PointerArithmetic.Emit): If our operand is a
10815         long, convert our constants to match the operand before
10816         multiplying.  Convert to I type before adding.   Fixes 43670.
10817
10818 2003-05-14  Ravi Pratap  <ravi@ximian.com>
10819
10820         * enum.cs (ImplicitConversionExists) : Rename to
10821         ImplicitEnumConversionExists to remove ambiguity. 
10822
10823         * ecore.cs (NullCast): New type of cast expression class which
10824         basically is very similar to EmptyCast with the difference being
10825         it still is a constant since it is used only to cast a null to
10826         something else
10827         (eg. (string) null)
10828
10829         * convert.cs (ImplicitReferenceConversion): When casting a null
10830         literal, we return a NullCast.
10831
10832         * literal.cs (NullLiteralTyped): Remove - I don't see why this
10833         should be around anymore.
10834
10835         The renaming (reported was slightly wrong). Corrections:
10836
10837         ConvertImplicitStandard -> ImplicitConversionStandard
10838         ConvertExplicitStandard -> ExplicitConversionStandard
10839
10840         * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
10841         before passing them in !
10842
10843         * convert.cs (ImplicitConversionStandard): When comparing for
10844         equal expr and target types, ensure that expr is not a
10845         NullLiteral.
10846
10847         In general, we must not be checking (expr_type ==
10848         target_type) in the top level conversion methods
10849         (ImplicitConversion, ExplicitConversion etc). This checking is
10850         done in the methods that they delegate to.
10851
10852 2003-05-20  Miguel de Icaza  <miguel@ximian.com>
10853
10854         * convert.cs: Move Error_CannotConvertType,
10855         ImplicitReferenceConversion, ImplicitReferenceConversionExists,
10856         ImplicitNumericConversion, ImplicitConversionExists,
10857         ImplicitUserConversionExists, StandardConversionExists,
10858         FindMostEncompassedType, FindMostSpecificSource,
10859         FindMostSpecificTarget, ImplicitUserConversion,
10860         ExplicitUserConversion, GetConversionOperators,
10861         UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
10862         TryImplicitIntConversion, Error_CannotConvertImplicit,
10863         ConvertImplicitRequired, ConvertNumericExplicit,
10864         ExplicitReferenceConversionExists, ConvertReferenceExplicit,
10865         ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
10866         its own file.
10867
10868         Perform the following renames:
10869
10870         StandardConversionExists -> ImplicitStandardConversionExists
10871         ConvertImplicit -> ImplicitConversion
10872         ConvertImplicitStandard -> ImplicitStandardConversion
10873         TryImplicitIntConversion -> ImplicitIntConversion
10874         ConvertImplicitRequired -> ImplicitConversionRequired
10875         ConvertNumericExplicit -> ExplicitNumericConversion
10876         ConvertReferenceExplicit -> ExplicitReferenceConversion
10877         ConvertExplicit -> ExplicitConversion
10878         ConvertExplicitStandard -> ExplicitStandardConversion
10879
10880 2003-05-19  Martin Baulig  <martin@ximian.com>
10881
10882         * statement.cs (TypeInfo.StructInfo): Made this type protected.
10883         (TypeInfo): Added support for structs having structs as fields.
10884
10885         * ecore.cs (FieldExpr): Implement IVariable.
10886         (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
10887         VariableInfo for the field.
10888
10889 2003-05-18  Martin Baulig  <martin@ximian.com>
10890
10891         * expression.cs (This.DoResolve): Report a CS0027 if we're
10892         emitting a field initializer.
10893
10894 2003-05-18  Martin Baulig  <martin@ximian.com>
10895
10896         * expression.cs (This.ResolveBase): New public function.
10897         (This.DoResolve): Check for CS0188.
10898
10899         * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
10900         This.Resolve().
10901
10902         * ecore.cs (MethodGroupExpr.DoResolve): Set the
10903         `instance_expression' to null if we don't have any non-static
10904         methods.
10905
10906 2003-05-18  Martin Baulig  <martin@ximian.com>
10907
10908         Reworked the way how local variables and parameters are handled by
10909         the flow analysis code.
10910
10911         * statement.cs (TypeInfo, VariableMap): New public classes.
10912         (VariableInfo): New public class.  This is now responsible for
10913         checking whether a variable has been assigned.  It is used for
10914         parameters and local variables.
10915         (Block.EmitMeta): Take the InternalParameters as argument; compute
10916         the layout of the flow vectors here.
10917         (Block.LocalMap, Block.ParameterMap): New public properties.
10918         (FlowBranching): The .ctor doesn't get the InternalParameters
10919         anymore since Block.EmitMeta() now computes the layout of the flow
10920         vector.
10921         (MyStructInfo): This class is now known as `StructInfo' and nested
10922         in `TypeInfo'; we don't access this directly anymore.
10923
10924         * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
10925         property and removed IsAssigned(), IsFieldAssigned(),
10926         SetAssigned() and SetFieldAssigned(); we now call them on the
10927         VariableInfo so we don't need to duplicate this code everywhere.
10928
10929         * expression.cs (ParameterReference): Added `Block block' argument
10930         to the .ctor.
10931         (LocalVariableReference, ParameterReference, This): The new
10932         VariableInfo class is now responsible for all the definite
10933         assignment stuff.
10934
10935         * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
10936         IsParameterAssigned, SetParameterAssigned): Removed.
10937
10938 2003-05-18  Martin Baulig  <martin@ximian.com>
10939
10940         * typemanager.cs (InitCoreTypes): Try calling
10941         SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
10942         the 3-args-version.  Corlib now also needs our `void_type'.
10943         (GetMethod): Added overloaded version which takes an optional
10944         `bool report_errors' to allow lookups of optional methods.
10945
10946 2003-05-12  Martin Baulig  <martin@ximian.com>
10947
10948         * statement.cs (VariableInfo): Renamed to LocalInfo since it's
10949         only used for locals and not for parameters.
10950
10951 2003-05-12  Miguel de Icaza  <miguel@ximian.com>
10952
10953         * support.cs (InternalParameters.ParameterType): Return the
10954         ExternalType of the parameter.
10955
10956         * parameter.cs (Parameter.ExternalType): drop the two arguments,
10957         they were unused.
10958
10959 2003-05-11  Miguel de Icaza  <miguel@ximian.com>
10960
10961         * class.cs (MethodData.Define): Do not set the `newslot' on
10962         interface members, if they are also flagged as "override".
10963
10964         * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
10965         better code for ++i and i++.  This only works for static fields
10966         and local variables.
10967
10968         * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
10969         want to pull the DeclSpace out of the builder_to_declspace instead
10970         of the TypeBuilder (like in TypeContainer.FindMembers).
10971
10972         * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
10973         instead of LookupTypeContainer.  Fixes the crash on .NET for
10974         looking up interface members.
10975
10976         * const.cs: Create our own emit context during the Definition
10977         stage, so that constants are evaluated in the proper context, when
10978         a recursive definition happens.
10979
10980 2003-05-11  Martin Baulig  <martin@ximian.com>
10981
10982         * statement.cs (Block.CreateSwitchBlock): New method.  Creates a
10983         new block for a switch section.
10984         (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
10985         the adding/lookup in the switch block.  Fixes #39828.
10986
10987 2003-05-09  Miguel de Icaza  <miguel@ximian.com>
10988
10989         * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
10990         functionality: I needed to convert the data after I had performed
10991         the add/sub operation into the operands type size.
10992
10993         * ecore.cs (ImplicitReferenceConversion): When boxing an interface
10994         pass the type for the box operation, otherwise the resulting
10995         object would have been of type object.
10996
10997         (BoxedCast): Add constructor to specify the type to box as.
10998
10999 2003-05-07  Miguel de Icaza  <miguel@ximian.com>
11000
11001         * iterators.cs: I was reusing the `count' variable inadvertently,
11002         take steps to not allow this to happen.
11003
11004 2003-05-06  Miguel de Icaza  <miguel@ximian.com>
11005
11006         * attribute.cs (Attribute.Resolve): Params attributes are encoded
11007         by creating an array at the point where the params starts and
11008         putting all those arguments there, then adjusting the size of the
11009         array.
11010
11011 2003-05-05  Miguel de Icaza  <miguel@ximian.com>
11012
11013         * expression.cs (New.AddressOf): Implement interface
11014         IMemoryLocation.  This is used when the `new' operator is used in
11015         the context of an invocation to a method on a value type.
11016
11017         See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
11018         example. 
11019
11020         * namespace.cs: Also check the using aliases here.
11021
11022         * driver.cs: Move the test for using validity after the types have
11023         been entered, so we do a single pass that also includes the using
11024         aliases. 
11025
11026         * statement.cs (Try.Resolve): Avoid crashing if there is a failure
11027         in the regular case.   CreateSiblingForFinally is doing extra
11028         error checking.
11029
11030         * attribute.cs (GetAttributeArgumentExpression): Store the result
11031         on an out value, and use the return value to indicate failure
11032         instead of using null (which is a valid return for Constant.GetValue).
11033
11034         * statement.cs: Perform the analysis flow for the increment
11035         portion after the statement, because this will be the real flow of
11036         execution.  Fixes #42385
11037
11038         * codegen.cs (EmitContext.EmitArgument,
11039         EmitContext.EmitStoreArgument): New helper functions when the
11040         RemapToProxy flag is set.
11041
11042         * expression.cs (ParameterReference.EmitLdarg): Expose this useful
11043         function.
11044
11045         Add support for remapping parameters. 
11046
11047         * iterators.cs: Propagate parameter values;  Store parameter
11048         values in the proxy classes.
11049
11050 2003-05-04  Miguel de Icaza  <miguel@ximian.com>
11051
11052         * ecore.cs (FieldExpr): Fix an obvious bug.  static fields do not
11053         need a proxy reference;  I do not know what I was thinking
11054
11055         * cs-parser.jay (constructor_initializer): catch another error,
11056         and display nice message.
11057
11058         (field_declaration): catch void field declaration
11059         to flag a better error. 
11060
11061         * class.cs (MemberBase.CheckBase): Report an error instead of a
11062         warning if a new protected member is declared in a struct. 
11063         (Field.Define): catch the error of readonly/volatile.
11064
11065         * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
11066
11067         (FieldExpr.AddressOf): ditto.  Catch error where the address of a
11068         volatile variable is taken
11069
11070 2003-05-02  Miguel de Icaza  <miguel@ximian.com>
11071
11072         * statement.cs (Fixed.Resolve): Report an error if we are not in
11073         an unsafe context.
11074
11075 2003-05-01  Miguel de Icaza  <miguel@ximian.com>
11076
11077         * typemanager.cs: reuse the code that handles type clashes for
11078         delegates and enumerations.
11079
11080         * class.cs (Report28): Always report.
11081
11082         * expression.cs (EncodeAsAttribute): Allow nulls here.
11083
11084 2003-04-28  Miguel de Icaza  <miguel@ximian.com>
11085
11086         * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
11087         the functionality for testing whether an expression is valid for
11088         an attribute here.  Also handle the case of arrays of elements
11089         being stored. 
11090
11091         * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
11092         encoding a linear array into an array of objects that are suitable
11093         to be passed to an CustomAttributeBuilder.
11094
11095         * delegate.cs: Check unsafe types being used outside of an Unsafe context.
11096
11097         * ecore.cs: (FieldExpr): Handle field remapping here.
11098
11099         * iteratators.cs: Pass the instance variable (if the method is an
11100         instance method) to the constructors, so we can access the field
11101         variables on the class.
11102
11103         TODO: Test this with structs.  I think the THIS variable on
11104         structs might have to be a pointer, and not a refenrece
11105
11106 2003-04-27  Miguel de Icaza  <miguel@ximian.com>
11107
11108         * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
11109         local variables to fields in a proxy class.
11110
11111         * iterators.cs (PopulateProxy): Rename our internal fields to
11112         <XXX>.  
11113         Create a <THIS> field if we are an instance method, so we can
11114         reference our parent container variables.
11115         (MapVariable): Called back from the EmitContext code to enter a
11116         new variable to field mapping into the proxy class (we just create
11117         a FieldBuilder).
11118
11119         * expression.cs
11120         (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
11121         for using the remapped locals to fields.
11122
11123         I placed the code here, because that gives the same semantics to
11124         local variables, and only changes the Emit code.
11125
11126         * statement.cs (Fixed.Resolve): it is not allowed to have fixed
11127         statements inside iterators.
11128         (VariableInfo): Add a FieldBuilder for the cases when we are
11129         remapping local variables to fields in a proxy class
11130
11131         * ecore.cs (SimpleNameResolve): Avoid testing two times for
11132         current_block != null.
11133
11134         * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
11135         not cope with strings, as it has been moved to the
11136         TableSwitchEmit.  Fixed bug in switch generation.
11137
11138         * expression.cs (New.DoResolve): Provide more context for the user
11139         when reporting an error.
11140
11141         * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
11142         pointers. 
11143
11144         * expression.cs (MemberAccess.DoResolve): When we get a type back,
11145         check the permissions for it.  Note than in a type-resolution
11146         context the check was already present in DeclSpace.ResolveType,
11147         but was missing from the MemberAccess.
11148
11149         (ArrayCreation.CheckIndices): warn if the user has
11150         more nested levels of expressions, but there are no more
11151         dimensions specified.  Avoids crash on bug 41906.
11152
11153 2003-04-26  Miguel de Icaza  <miguel@ximian.com>
11154
11155         * statement.cs (Block): replace Implicit bool, for a generic
11156         flags.   
11157         New flag: `Unchecked'.  This is used during the EmitMeta phase
11158         (which is out-of-line with the regular Resolve/Emit process for a
11159         statement, as this is done ahead of time, but still gets a chance
11160         to call constant resolve).
11161
11162         (Block.Flags): new enum for adding a new flag.
11163
11164         (Block.EmitMeta): track the state of unchecked.
11165
11166         (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
11167         to enable constant resolution to work there as well.
11168
11169 2003-04-22  Miguel de Icaza  <miguel@ximian.com>
11170
11171         * typemanager.cs (ienumerable_type): Also look up
11172         System.Collections.IEnumerable. 
11173
11174 2003-04-21  Miguel de Icaza  <miguel@ximian.com>
11175
11176         TODO: Test more than one conditional per method.
11177
11178         * class.cs (Indexer.Define): Report the location where the user is
11179         referencing the unsupported feature.
11180
11181         (MethodData): Overload the use of `conditionals' to
11182         minimize the creation of needless ArrayLists.   This saves roughly
11183         212kb on my machine.
11184
11185         (Method): Implement the new IIteratorContainer interface.
11186         (Method.SetYields): Implement the method by setting the ModFlags
11187         to contain METHOD_YIELDS.
11188
11189         * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
11190         which just got set to null.
11191
11192         * iterators.cs: New file.
11193
11194         (Yield, YieldBreak): New statements.
11195
11196         * statement.cs (Return.Resolve): Flag an error if we are used in
11197         an iterator method.
11198
11199         * codegen.cs (InIterator): New flag set if the code is being
11200         compiled in an iterator method.
11201
11202         * modifiers.cs: New flag METHOD_YIELDS.  This modifier is an
11203         internal modifier, and we just use it to avoid adding extra
11204         fields, as this is seldom used.  
11205
11206         * cs-parser.jay: Add yield_statement (yield and yield break).
11207
11208         * driver.cs: New flag -v2 to turn on version 2 features. 
11209
11210         * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
11211         hashtable when v2 is enabled.
11212
11213 2003-04-20  Miguel de Icaza  <miguel@ximian.com>
11214
11215         * typemanager.cs (TypeManager.NamespaceClash): Use to check if
11216         there is already a namespace defined with this name.
11217
11218         (TypeManager.InitCoreTypes): Remove the temporary workaround, as
11219         people upgraded their corlibs.
11220
11221         (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
11222         always use fully qualified types, no need to use the compiler
11223         front end.
11224
11225         (TypeManager.IsNamespace): Use binarysearch.
11226
11227         * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
11228         AddDelegate): I did not quite use the new IsValid API properly: I
11229         have to pass the short-name and the fullname.  I was passing only
11230         the basename instead of the fullname sometimes. 
11231
11232         (TypeContainer.DefineType): call NamespaceClash.
11233
11234         * interface.cs (Interface.DefineType): use NamespaceClash before
11235         defining the type.
11236
11237         * delegate.cs (Delegate.DefineType): use NamespaceClash before
11238         defining the type.
11239
11240         * enum.cs: (Enum.DefineType): use NamespaceClash before
11241         defining the type.
11242
11243         * typemanager.cs (: 3-line patch that gives us some tasty 11%
11244         speed increase.  First, use the negative_hits cache when we get a
11245         negative.  Second, add the type with its full original name
11246         instead of the new . and + encoded name (reflection uses + to
11247         separate type from a nested type).  Use LookupTypeReflection
11248         directly which bypasses the type->name hashtable (that we already
11249         know does not contain the type.
11250
11251         * decl.cs (DeclSpace.ResolveTypeExpr): track the
11252         location/container type. 
11253
11254         * driver.cs: When passing utf8, use directly the UTF8Encoding.
11255
11256 2003-04-19  Miguel de Icaza  <miguel@ximian.com>
11257
11258         * decl.cs (ResolveTypeExpr): Mirror check acess here too.
11259
11260         * delegate.cs (NewDelegate.Resolve): Test whether an instance
11261         method is being referenced in the method group from a static
11262         context, and report error 120 if so.
11263
11264         * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
11265         Error118. 
11266
11267         * typemanager.cs: Add intermediate namespaces (if a namespace A.B
11268         is created, we create the A namespace).
11269
11270         * cs-parser.jay: A namespace also introduces a DeclarationFound.
11271         Fixes #41591
11272
11273 2003-04-18  Miguel de Icaza  <miguel@ximian.com>
11274
11275         * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
11276         invocation to ModuleBuilder.GetType with the same values will
11277         return a new type instance, so we need to cache its return
11278         values. 
11279
11280         * expression.cs (Binary.ResolveOperator): Only allow the compare
11281         operators on enums if they are of the same type.
11282
11283         * ecore.cs (Expression.ImplicitReferenceConversion): handle target
11284         types of ValueType on their own case.  Before we were giving them
11285         the same treatment as objects.
11286
11287         * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
11288         fullname.  Short name is used to compare against container name.
11289         Fullname is used to check against defined namespace names.
11290
11291         * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
11292         AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
11293
11294         (Method.CheckBase): Call parent.
11295         (MemberBase.CheckBase): Check for protected members on sealed
11296         classes.
11297         (PropertyBase.CheckBase): Call parent.
11298         (Field.Define): Call parent.
11299
11300         * report.cs: Negative error codes are now mapped to 8000 - code,
11301         so that the display is render more nicely.
11302
11303         * typemanager.cs: Do not use try/catch, instead report a regular
11304         error. 
11305
11306         (GetPointerType, GetReferenceType): These methods provide
11307         mechanisms to obtain the T* and T& from a T.  We had the code
11308         previously scattered around the code base, and it also used
11309         TypeManager.LookupType that would go through plenty of caches.
11310         This one goes directly to the type source.
11311
11312         In some places we did the Type.GetType followed by
11313         ModuleBuilder.GetType, but not in others, so this unifies the
11314         processing as well.
11315
11316         * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
11317         statements now that we have namespace information.
11318
11319         * typemanager.cs (IsNamespace): New method, returns whether the
11320         string presented is a namespace or not.
11321
11322         (ComputeNamespaces): New public entry point, computes the list of
11323         available namespaces, using the GetNamespaces API call in Mono, or
11324         the slower version in MS.NET.   
11325
11326         Now before we start the semantic analysis phase, we have a
11327         complete list of namespaces including everything that the user has
11328         provided.
11329
11330         Deleted old code to cache namespaces in .nsc files.
11331
11332 2003-04-17  Miguel de Icaza  <miguel@ximian.com>
11333
11334         * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
11335         class/struct location definition Location for the implicit
11336         constructor location.
11337
11338         (Operator.Define): Use the location of the operator for the
11339         implicit Method definition.
11340
11341         (Constructor.Emit): use the constructor location for the implicit
11342         base initializer constructor.
11343
11344         * ecore.cs: Remove ITypeExpression.  This interface is now gone,
11345         and the Expression class now contains two new methods:
11346
11347         ResolveAsTypeStep and ResolveAsTypeTerminal.  This is used to
11348         isolate type lookup from the rest of the resolution process.
11349
11350         Since we use Expressions to hold type definitions due to the way
11351         we parse the input we have historically overloaded Resolve to
11352         perform the Type lookups if a special flag is passed.  Now this is
11353         eliminated and two methods take their place. 
11354
11355         The differences in the two methods between xStep and xTerminal is
11356         that xStep is involved in our current lookup system that uses
11357         SimpleNames to compose a name, while xTerminal is used just to
11358         catch the case where the simplename lookup failed.
11359
11360 2003-04-16  Miguel de Icaza  <miguel@ximian.com>
11361
11362         * expression.cs (ResolveMemberAccess): Remove redundant code.
11363         TypeExpr expressions are always born fully resolved.
11364
11365         * interface.cs (PopulateMethod): Do not lookup the types twice.
11366         We were doing it once during SemanticAnalysis and once during
11367         PopulateMethod.
11368
11369         * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
11370         in local variable type definitions, were being returned as a
11371         SimpleName (we decomposed everything into a string), that is
11372         because primary_expression was being used instead of a type in the
11373         grammar (reduce/reduce conflicts).
11374
11375         The part that was wrong is that we converted the expression into a
11376         string (an oversimplification in one hand, compounded with primary
11377         expressions doing string concatenation).
11378
11379         So things like:
11380
11381         A.B.C [] x;
11382
11383         Would return "A.B.C[]" as a SimpleName.  This stopped things like
11384         using clauses from working on this particular context.  And a type
11385         was being matched directly against "A.B.C[]".
11386
11387         We now use the correct approach, and allow for ComposedCast to be
11388         part of the unary expression.  So the "A.B.C []" become a composed
11389         cast of "A.B.C" (as a nested group of MemberAccess with a
11390         SimpleName at the end) plus the rank composition "[]". 
11391
11392         Also fixes 35567
11393
11394 2003-04-10  Miguel de Icaza  <miguel@ximian.com>
11395
11396         * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
11397         for the access level checking.
11398
11399         * class.cs: Cosmetic changes.  Renamed `TypeContainer parent' to
11400         `TypeContainer container', because I kept getting confused when I
11401         was debugging this code.
11402
11403         * expression.cs (Indexers): Instead of tracking getters/setters,
11404         we now track them in parallel.  We create one arraylist less, but
11405         most importantly it is possible now for the LValue code to find a
11406         matching get for a set.
11407
11408         (IndexerAccess.DoResolveLValue): Update the code.
11409         GetIndexersForType has been modified already to extract all the
11410         indexers from a type.  The code assumed it did not.
11411
11412         Also make the code set the correct return type for the indexer.
11413         This was fixed a long time ago for properties, but was missing for
11414         indexers.  It used to be void_type.
11415
11416         (Binary.Emit): Test first for doubles instead of
11417         floats, as they are more common.
11418
11419         (Binary.EmitBranchable): Use the .un version of the branch opcodes
11420         when dealing with floats and the <=, >= operators.  This fixes bug
11421         #39314 
11422
11423         * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
11424         to load the array value by emitting a load on the foreach variable
11425         type.  This was incorrect.  
11426
11427         We now emit the code to load an element using the the array
11428         variable type, and then we emit the conversion operator.
11429
11430         Fixed #40176
11431
11432 2003-04-10  Zoltan Varga  <vargaz@freemail.hu>
11433
11434         * attribute.cs: Avoid allocation of ArrayLists in the common case.
11435
11436 2003-04-09  Miguel de Icaza  <miguel@ximian.com>
11437
11438         * class.cs (MethodSignature.InheritableMemberSignatureCompare):
11439         test for protection before we test for signatures. 
11440
11441         (MethodSignature.ToString): implement.
11442
11443         * expression.cs (Unary.TryReduceNegative): Add missing minus sign
11444         to the case where we reduced into a LongConstant.
11445
11446         * decl.cs (CheckAccessLevel): If the type is an array, we can not
11447         depend on whether the information is acurrate, because the
11448         Microsoft runtime will always claim that the array type is public,
11449         regardless of the real state.
11450
11451         If the type is a pointer, another problem happens: the type is
11452         reported as non-public in Microsoft.  
11453
11454         In both cases we have to call CheckAccessLevel recursively with
11455         the underlying type as the argument to be tested.
11456
11457 2003-04-08  Miguel de Icaza  <miguel@ximian.com>
11458
11459         * assign.cs (Assign.Emit): If we are dealing with a compound
11460         assignment expression, we should use the code path that stores the
11461         intermediate result in a temporary value.  This fixes #40903.
11462
11463         *expression.cs (Indirection.ToString): Provide ToString method for
11464         debugging. 
11465
11466 2003-04-08  Zoltan Varga  <vargaz@freemail.hu>
11467
11468         * class.cs: Null out fields holding references to Block objects so
11469         they can be garbage collected.
11470
11471         * expression.cs (OverloadResolve): Remove unused local.
11472
11473 2003-04-07  Martin Baulig  <martin@ximian.com>
11474
11475         * codegen.cs (EmitContext.CurrentFile): New public field.
11476         (EmitContext.Mark): Use the CurrentFile to check whether the
11477         location is in the correct file.
11478         (EmitContext.EmitTopBlock): Initialize CurrentFile here.
11479
11480 2003-04-07  Martin Baulig  <martin@ximian.com>
11481
11482         * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
11483
11484         * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
11485         location.  [FIXME: The location argument which gets passed to this
11486         method is sometimes wrong!]
11487
11488 2003-04-07  Nick Drochak <ndrochak@gol.com>
11489
11490         * codegen.cs: Be more verbose when we can't find the symbol writer dll.
11491
11492 2003-04-07  Miguel de Icaza  <miguel@ximian.com>
11493
11494         * expression.cs (Indirection.EmitAssign): We were using the
11495         temporary, but returning immediately instead of continuing the
11496         EmitAssing flow.
11497
11498 2003-04-06  Martin Baulig  <martin@ximian.com>
11499
11500         * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
11501         if it's a nested child, but also deriving from the outer class.
11502         See test 190.cs.
11503
11504         * typemanager.cs (IsNestedChildOf): Make this work if it's a
11505         nested child, but also deriving from the outer class.  See
11506         test-190.cs.
11507         (FilterWithClosure): We may access private members of the outer
11508         class if we're a nested child and deriving from the outer class.
11509         (RealMemberLookup): Only set `closure_private_ok' if the
11510         `original_bf' contained BindingFlags.NonPublic.
11511
11512 2003-04-05  Martin Baulig  <martin@ximian.com>
11513
11514         * expression.cs (SizeOf.DoResolve): Use ResolveTypeExpr, so we can
11515         probe if its a type parameter, and if so, flag an error.
11516
11517         * decl.cs: Move here the SetParameterInfo code from class.cs.
11518         Handle IsGeneric here.
11519
11520         Handle a variety of errors in the parameter info definition.
11521
11522         * ecore.cs (SimpleName.DoResolveType): Handle look ups for generic
11523         type parameters here.
11524
11525         * cs-parser.jay (class_declaration): report errors for parameters
11526         here as well.
11527
11528 2003-01-21  Miguel de Icaza  <miguel@ximian.com>
11529
11530         * generic.cs: New file, contains support code for generics.
11531
11532         * cs-parser.jay: Remove OP_SHIFT_LEFT, OP_SHIFT_RIGHT,
11533         OP_SHIFT_LEFT_ASSIGN, OP_SHIFT_RIGHT_ASSIGN.
11534
11535         Update parser for the above removals.
11536
11537         * cs-tokenizer.cs: Do not handle <<= or >>= specially.  This is
11538         now taken care of in the parser.
11539
11540 2003-04-02  Miguel de Icaza  <miguel@ximian.com>
11541
11542         * class.cs (Event.Define): Do not allow abstract events to have
11543         initializers. 
11544
11545 2003-04-01  Miguel de Icaza  <miguel@ximian.com>
11546
11547         * cs-parser.jay: Add error productions for ADD/REMOVE missing a
11548         block in event declarations.
11549
11550         * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
11551         value type, get its address.
11552
11553         * expression.cs (Is.Emit): For action `LeaveOnStack' we were
11554         leaving a class on the stack instead of a boolean value (int
11555         0/1).  Change the code so we compare against null, and then the
11556         result against zero.
11557
11558         * class.cs (TypeContainer.GetClassBases): We were checking for the
11559         parent class being sealed too late.
11560
11561         * expression.cs (Binary.Emit): For <= and >= when dealing with
11562         floating point values, use cgt.un and clt.un instead of cgt and
11563         clt alone.
11564
11565 2003-04-01  Zoltan Varga  <vargaz@freemail.hu>
11566
11567         * statement.cs: Apply the same optimization as MS: skip the 
11568         GetEnumerator returning an IEnumerator, and use the one returning a 
11569         CharEnumerator instead. This allows us to avoid the try-finally block 
11570         and the boxing.
11571
11572 2003-03-31  Gaurav Vaish <gvaish_mono@lycos.com>
11573
11574         * cs-parser.jay: Attributes cannot be applied to
11575                          namespaces. Fixes #40473
11576
11577 2003-03-31  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11578
11579         * class.cs:
11580         (Add*): check if the name is valid using the full name for constants,
11581         fields, properties and events.
11582
11583 2003-03-28  Miguel de Icaza  <miguel@ximian.com>
11584
11585         * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
11586         char constants to be part of the enumeration.
11587
11588         * expression.cs (Conditional.DoResolve): Add support for operator
11589         true. Implements the missing functionality from 14.12
11590
11591         * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
11592         operator true/false as required by the spec.
11593
11594         * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
11595         implicit conversion to boolean.
11596
11597         * statement.cs (Statement.ResolveBoolean): A boolean expression is
11598         also one where the type implements `operator true'. 
11599
11600         * ecore.cs (Expression.GetOperatorTrue): New helper routine to
11601         get an expression that will invoke operator true based on an
11602         expression.  
11603
11604         (GetConversionOperators): Removed the hack that called op_True
11605         here.  
11606
11607         (Expression.ResolveBoolean): Move this from Statement.
11608
11609 2003-03-17  Miguel de Icaza  <miguel@ximian.com>
11610
11611         * ecore.cs (FieldExpr): do not allow initialization of initonly
11612         fields on derived classes
11613
11614 2003-03-13  Martin Baulig  <martin@ximian.com>
11615
11616         * statement.cs (Block.Emit): Call ig.BeginScope() and
11617         ig.EndScope() when compiling with debugging info; call
11618         LocalBuilder.SetLocalSymInfo _after_ opening the scope.
11619
11620 2003-03-08  Miguel de Icaza  <miguel@ximian.com>
11621
11622         * expression.cs (Indexers): Do not construct immediately, allow
11623         for new members to be appended as we go.  Fixes 38143
11624
11625 2003-03-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11626
11627         * expression.cs: save/restore context when resolving an unchecked
11628         expression.
11629
11630 2003-03-05  Miguel de Icaza  <miguel@ximian.com>
11631
11632         * cfold.cs: Catch division by zero in modulus operator during
11633         constant folding.
11634
11635 2003-03-03  Miguel de Icaza  <miguel@ximian.com>
11636
11637         * interface.cs (Interface.DefineMembers): Avoid defining members
11638         twice. 
11639
11640 2003-02-27  Miguel de Icaza  <miguel@ximian.com>
11641
11642         * driver.cs: handle the +/- options for -noconfig
11643
11644         * statement.cs (Unckeched.Resolve): Also track the state of
11645         unchecked in the Resolve phase.
11646
11647 2003-02-27  Martin Baulig  <martin@ximian.com>
11648
11649         * ecore.cs (Expression.MemberLookup): Don't create a
11650         MethodGroupExpr for something which is not a method.  Fixes #38291.
11651
11652 2003-02-25  Miguel de Icaza  <miguel@ximian.com>
11653
11654         * class.cs (MemberBase.CheckParameters): Also check that the type
11655         is unmanaged if it is a pointer.
11656
11657         * expression.cs (SizeOf.Resolve): Add location information.
11658
11659         * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
11660         a managed type is declared.
11661
11662         * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
11663         parameter modifiers as well.  Fixes bug 38606
11664
11665         * class.cs: Very sad.  Am backing out the speed up changes
11666         introduced by the ArrayList -> Array in the TypeContainer, as they
11667         were not actually that much faster, and introduced a bug (no error
11668         reports on duplicated methods).
11669
11670         * assign.cs (CompoundAssign.DoLResolve): Resolve the original
11671         source first, this will guarantee that we have a valid expression
11672         before calling in lower levels functions that will require a
11673         resolved object.  Then use this original_source in the
11674         target.ResolveLValue instead of the original source that was
11675         passed to us.
11676
11677         Another change.  Use target.Resolve instead of LValueResolve.
11678         Although we are resolving for LValues, we will let the Assign code
11679         take care of that (it will be called again from Resolve).  This
11680         basically allows code like this:
11681
11682         class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
11683         class Y { void A (X x) { x [0] += o; }
11684
11685         The problem was that the indexer was trying to resolve for
11686         set_Item (idx, object o) and never finding one.  The real set_Item
11687         was set_Item (idx, X).  By delaying the process we get the right
11688         semantics. 
11689
11690         Fixes bug 36505
11691
11692 2003-02-23  Martin Baulig  <martin@ximian.com>
11693
11694         * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
11695         while calling DoEmit ().
11696
11697         * codegen.cs (EmitContext.Mark): Don't mark locations in other
11698         source files; if you use the #line directive inside a method, the
11699         compiler stops emitting line numbers for the debugger until it
11700         reaches the end of the method or another #line directive which
11701         restores the original file.
11702
11703 2003-02-23  Martin Baulig  <martin@ximian.com>
11704
11705         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
11706
11707 2003-02-23  Martin Baulig  <martin@ximian.com>
11708
11709         * statement.cs (Block.AddChildVariableNames): We need to call this
11710         recursively, not just for our immediate children.
11711
11712 2003-02-23  Martin Baulig  <martin@ximian.com>
11713
11714         * class.cs (Event.Define): Always make the field private, like csc does.
11715
11716         * typemanager.cs (TypeManager.RealMemberLookup): Make events
11717         actually work, fixes bug #37521.
11718
11719 2003-02-23  Miguel de Icaza  <miguel@ximian.com>
11720
11721         * delegate.cs: When creating the various temporary "Parameters"
11722         classes, make sure that we call the ComputeAndDefineParameterTypes
11723         on those new parameters (just like we do with the formal ones), to
11724         allow them to be resolved in the context of the DeclSpace.
11725
11726         This fixes the bug that Dick observed in Bugzilla #38530.
11727
11728 2003-02-22  Miguel de Icaza  <miguel@ximian.com>
11729
11730         * expression.cs (ResolveMemberAccess): When resolving a constant,
11731         do not attempt to pull a constant if the value was not able to
11732         generate a valid constant.
11733
11734         * const.cs (LookupConstantValue): Do not report more errors than required.
11735
11736 2003-02-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11737
11738         * expression.cs: fixes bug #38328.
11739
11740 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
11741
11742         * class.cs: Changed all the various members that can be part of a
11743         class from being an ArrayList to be an Array of the right type.
11744         During the DefineType type_list, interface_list, delegate_list and
11745         enum_list are turned into types, interfaces, delegates and enums
11746         arrays.  
11747
11748         And during the member population, indexer_list, event_list,
11749         constant_list, field_list, instance_constructor_list, method_list,
11750         operator_list and property_list are turned into their real arrays.
11751
11752         Although we could probably perform this operation earlier, for
11753         good error reporting we need to keep the lists and remove the
11754         lists for longer than required.
11755
11756         This optimization was triggered by Paolo profiling the compiler
11757         speed on the output of `gen-sample-program.pl' perl script. 
11758
11759         * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
11760         not crash in methods like MemberLookupFailed that use this field.  
11761
11762         This problem arises when the compiler fails to resolve a type
11763         during interface type definition for example.
11764
11765 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
11766
11767         * expression.cs (Indexers.GetIndexersForType): Interfaces do not
11768         inherit from System.Object, so we have to stop at null, not only
11769         when reaching System.Object.
11770
11771 2003-02-17  Miguel de Icaza  <miguel@ximian.com>
11772
11773         * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
11774         DeclaredOnly because the parent indexer might have had a different
11775         name, but did not loop until the top of the hierarchy was reached.
11776
11777         The problem this one fixes is 35492: when a class implemented an
11778         indexer from an interface, we were getting the interface method
11779         (which was abstract) and we were flagging an error (can not invoke
11780         abstract method).
11781
11782         This also keeps bug 33089 functioning, and test-148 functioning.
11783
11784         * typemanager.cs (IsSpecialMethod): The correct way of figuring
11785         out if a method is special is to see if it is declared in a
11786         property or event, or whether it is one of the predefined operator
11787         names.   This should fix correctly #36804.
11788
11789 2003-02-15  Miguel de Icaza  <miguel@ximian.com>
11790
11791         The goal here is to remove the dependency on EmptyCast.Peel ().
11792         Killing it completely.
11793
11794         The problem is that currently in a number of places where
11795         constants are expected, we have to "probe" for an EmptyCast, and
11796         Peel, which is not the correct thing to do, as this will be
11797         repetitive and will likely lead to errors. 
11798
11799         The idea is to remove any EmptyCasts that are used in casts that
11800         can be reduced to constants, so we only have to cope with
11801         constants. 
11802
11803         This bug hunt was triggered by Bug 37363 and the desire to remove
11804         the duplicate pattern where we were "peeling" emptycasts to check
11805         whether they were constants.  Now constants will always be
11806         constants.
11807
11808         * ecore.cs: Use an enumconstant here instead of wrapping with
11809         EmptyCast.  
11810
11811         * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
11812         throwing me off.  By handling this we can get rid of a few hacks.
11813
11814         * statement.cs (Switch): Removed Peel() code.
11815
11816 2003-02-14  Miguel de Icaza  <miguel@ximian.com>
11817
11818         * class.cs: Location information for error 508
11819
11820         * expression.cs (New.DoResolve): Add a guard against double
11821         resolution of an expression.  
11822
11823         The New DoResolve might be called twice when initializing field
11824         expressions (see EmitFieldInitializers, the call to
11825         GetInitializerExpression will perform a resolve on the expression,
11826         and later the assign will trigger another resolution
11827
11828         This leads to bugs (#37014)
11829
11830         * delegate.cs: The signature for EndInvoke should contain any ref
11831         or out parameters as well.  We were not doing this in the past. 
11832
11833         * class.cs (Field.Define): Do not overwrite the type definition
11834         inside the `volatile' group.  Turns out that volatile enumerations
11835         were changing the type here to perform a validity test, which
11836         broke conversions. 
11837
11838 2003-02-12  Miguel de Icaza  <miguel@ximian.com>
11839
11840         * ecore.cs (FieldExpr.AddressOf): In the particular case of This
11841         and structs, we do not want to load the instance variable
11842
11843         (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
11844         enum_type has to be handled like an object reference (implicit
11845         conversions exists from this to object), but the regular IsClass
11846         and IsValueType tests will never return true for this one.
11847
11848         Also we use TypeManager.IsValueType instead of type.IsValueType,
11849         just for consistency with the rest of the code (this is only
11850         needed if we ever use the construct exposed by test-180.cs inside
11851         corlib, which we dont today).
11852
11853 2003-02-12  Zoltan Varga  <vargaz@freemail.hu>
11854
11855         * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
11856         just InternalCall.
11857
11858 2003-02-09  Martin Baulig  <martin@ximian.com>
11859
11860         * namespace.cs (Namespace..ctor): Added SourceFile argument.
11861         (Namespace.DefineNamespaces): New static public method; this is
11862         called when we're compiling with debugging to add all namespaces
11863         to the symbol file.
11864
11865         * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
11866         pass it to the Namespace's .ctor.
11867
11868         * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
11869         and MethodBase arguments; pass the namespace ID to the symwriter;
11870         pass the MethodBase instead of the token to the symwriter.
11871         (SymbolWriter.DefineNamespace): New method to add a namespace to
11872         the symbol file.
11873
11874 2003-02-09  Martin Baulig  <martin@ximian.com>
11875
11876         * symbolwriter.cs: New file.  This is a wrapper around
11877         ISymbolWriter with a cleaner API.  We'll dynamically Invoke()
11878         methods here in near future.
11879
11880 2003-02-09  Martin Baulig  <martin@ximian.com>
11881
11882         * codegen.cs (EmitContext.Mark): Just pass the arguments to
11883         ILGenerator.MarkSequencePoint() which are actually used by the
11884         symbol writer.
11885
11886 2003-02-09  Martin Baulig  <martin@ximian.com>
11887
11888         * location.cs (SourceFile): New public sealed class.  This
11889         contains the name and an index which is used in the location's token.
11890         (Location): Reserve an appropriate number of bits in the token for
11891         the source file instead of walking over that list, this gives us a
11892         really huge performance improvement when compiling with debugging.
11893
11894         * driver.cs (Driver.parse, Driver.tokenize_file): Take a
11895         `SourceFile' argument instead of a string.
11896         (Driver.ProcessFile): Add all the files via Location.AddFile(),
11897         but don't parse/tokenize here, we need to generate the list of all
11898         source files before we do that.
11899         (Driver.ProcessFiles): New static function.  Parses/tokenizes all
11900         the files.
11901
11902         * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
11903         instead of a string.
11904
11905         * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
11906         of a string.
11907
11908 2003-02-09  Martin Baulig  <martin@ximian.com>
11909
11910         * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
11911         filename on `#line default'.
11912
11913 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
11914
11915         * statement.cs: don't clear the pinned var when the fixed statement
11916         returns from the method (fixes bug#37752).
11917
11918 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
11919
11920         * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban) 
11921         to IsValueType.
11922
11923 2003-02-07  Martin Baulig  <martin@ximian.com>
11924
11925         * driver.cs: Removed the `--debug-args' command line argument.
11926
11927         * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
11928         automatically by the AsssemblyBuilder.
11929         (CodeGen.InitializeSymbolWriter): We don't need to call any
11930         initialization function on the symbol writer anymore.  This method
11931         doesn't take any arguments.
11932
11933 2003-02-03  Miguel de Icaza  <miguel@ximian.com>
11934
11935         * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
11936         from referenced assemblies as well.
11937
11938 2003-02-02  Martin Baulig  <martin@ximian.com>
11939
11940         * class.cs (MethodData.Emit): Generate debugging info for external methods.
11941
11942 2003-02-02  Martin Baulig  <martin@ximian.com>
11943
11944         * class.cs (Constructor.Emit): Open the symbol writer before
11945         emitting the constructor initializer.
11946         (ConstructorInitializer.Emit): Call ec.Mark() to allow
11947         single-stepping through constructor initializers.
11948
11949 2003-01-30  Miguel de Icaza  <miguel@ximian.com>
11950
11951         * class.cs: Handle error 549: do not allow virtual methods in
11952         sealed classes. 
11953
11954 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
11955
11956         * decl.cs: Check access levels when resolving types
11957
11958 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
11959
11960         * statement.cs: Add parameters and locals set in catch blocks that might 
11961         return to set vector
11962
11963 2003-01-29  Miguel de Icaza  <miguel@ximian.com>
11964
11965         * class.cs (Operator): Set the SpecialName flags for operators.
11966
11967         * expression.cs (Invocation.DoResolve): Only block calls to
11968         accessors and operators on SpecialName methods.
11969
11970         (Cast.TryReduce): Handle conversions from char constants.
11971
11972
11973 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
11974
11975         * statement.cs: small memory and time optimization in FlowBranching.
11976
11977 2003-01-28  Pedro Mart  <yoros@wanadoo.es>
11978
11979         * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
11980         problem that the last fix but in the other sid (Set).
11981
11982         * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
11983         access when there is no indexer in the hierarchy.
11984
11985 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
11986
11987         * class.cs: Combine some if statements.
11988
11989 2003-01-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11990
11991         * driver.cs: fixed bug #37187.
11992
11993 2003-01-27  Pedro Martinez Juliá  <yoros@wanadoo.es>
11994
11995         * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
11996         any indexer, it's needed to build a list with all the indexers in the
11997         hierarchy (AllGetters), else we have problems. Fixes #35653.
11998
11999 2003-01-23  Miguel de Icaza  <miguel@ximian.com>
12000
12001         * class.cs (MethodData.Define): It is wrong for an interface
12002         implementation to be static in both cases: explicit and implicit.
12003         We were only handling this in one case.
12004
12005         Improve the if situation there to not have negations.
12006
12007         * class.cs (Field.Define): Turns out that we do not need to check
12008         the unsafe bit on field definition, only on usage.  Remove the test.
12009
12010 2003-01-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12011
12012         * driver.cs: use assembly.Location instead of Codebase (the latest
12013         patch made mcs fail when using MS assemblies).
12014
12015 2003-01-21  Tim Haynes <thaynes@openlinksw.com>
12016
12017         * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
12018         get the path to *corlib.dll.
12019
12020 2003-01-21  Nick Drochak <ndrochak@gol.com>
12021
12022         * cs-tokenizer.cs:
12023         * pending.cs:
12024         * typemanager.cs: Remove compiler warnings
12025
12026 2003-01-20  Duncan Mak  <duncan@ximian.com>
12027
12028         * AssemblyInfo.cs: Bump the version number to 0.19.
12029
12030 2003-01-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12031
12032         * cs-tokenizer.cs: little fixes to line numbering when #line is used.
12033
12034 2003-01-18  Zoltan Varga  <vargaz@freemail.hu>
12035
12036         * class.cs (Constructor::Emit): Emit debugging info for constructors.
12037
12038 2003-01-17  Miguel de Icaza  <miguel@ximian.com>
12039
12040         * cs-parser.jay: Small fix: we were not comparing the constructor
12041         name correctly.   Thanks to Zoltan for the initial pointer.
12042
12043 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
12044
12045         * cs-tokenizer.cs: Set file name when specified with #line
12046
12047 2003-01-15  Miguel de Icaza  <miguel@ximian.com>
12048
12049         * cs-parser.jay: Only perform the constructor checks here if we
12050         are named like the class;  This will help provider a better
12051         error.  The constructor path is taken when a type definition is
12052         not found, but most likely the user forgot to add the type, so
12053         report that rather than the constructor error.
12054
12055 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
12056
12057         * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
12058         allocations.
12059
12060 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
12061
12062         * cs-parser.jay: Add cleanup call.
12063
12064 2003-01-13  Duncan Mak  <duncan@ximian.com>
12065
12066         * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
12067         consistent with other methods.
12068
12069 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
12070
12071         * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
12072
12073 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
12074
12075         * attribute.cs: only set GuidAttr to true when we have a
12076         GuidAttribute.
12077
12078 2003-01-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12079
12080         * ecore.cs:
12081         * expression.cs:
12082         * typemanager.cs: fixes to allow mcs compile corlib with the new
12083         Type.IsSubclassOf fix.
12084
12085 2003-01-08  Miguel de Icaza  <miguel@ximian.com>
12086
12087         * expression.cs (LocalVariableReference.DoResolve): Classify a
12088         constant as a value, not as a variable.   Also, set the type for
12089         the variable.
12090
12091         * cs-parser.jay (fixed_statement): take a type instead of a
12092         pointer_type, so we can produce a better error message later.
12093
12094         * statement.cs (Fixed.Resolve): Flag types that are not pointers
12095         as an error.  
12096
12097         (For.DoEmit): Make inifinite loops have a
12098         non-conditional branch back.
12099
12100         (Fixed.DoEmit): First populate the pinned variables, then emit the
12101         statement, then clear the variables.  Before I was emitting the
12102         code once for each fixed piece.
12103
12104
12105 2003-01-08  Martin Baulig  <martin@ximian.com>
12106
12107         * statement.cs (FlowBranching.MergeChild): A break in a
12108         SWITCH_SECTION does not leave a loop.  Fixes #36155.
12109
12110 2003-01-08  Martin Baulig  <martin@ximian.com>
12111
12112         * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
12113         lives in the same number space than `param_map'.  Fixes #36154.
12114
12115 2003-01-07  Miguel de Icaza  <miguel@ximian.com>
12116
12117         * cs-parser.jay (constructor_declaration): Set the
12118         Constructor.ModFlags before probing for it.  This makes the
12119         compiler report 514, 515 and 132 (the code was there, but got
12120         broken). 
12121
12122         * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
12123         (GotoDefault.Resolve): Set `Returns' to ALWAYS.
12124         (GotoCase.Resolve): Set `Returns' to ALWAYS.
12125
12126 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
12127
12128         * enum.cs: create the enum static fields using the enum type.
12129
12130 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
12131
12132         * class.cs: don't try to create the ParamBuilder for the return
12133         type if it's not needed (and handle it breaking for the ms runtime
12134         anyway).
12135
12136 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
12137
12138         * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
12139
12140 2002-12-29  Miguel de Icaza  <miguel@ximian.com>
12141
12142         * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
12143         the command.   This showed up while compiling the JANET source
12144         code, which used \r as its only newline separator.
12145
12146 2002-12-28  Miguel de Icaza  <miguel@ximian.com>
12147
12148         * class.cs (Method.Define): If we are an operator (because it
12149         reuses our code), then set the SpecialName and HideBySig.  #36128
12150
12151 2002-12-22  Miguel de Icaza  <miguel@ximian.com>
12152
12153         * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
12154         exception, report error 120 `object reference required'.
12155
12156         * driver.cs: Add --pause option, used during to measure the size
12157         of the process as it goes with --timestamp.
12158
12159         * expression.cs (Invocation.DoResolve): Do not allow methods with
12160         SpecialName to be invoked.
12161
12162 2002-12-21  Miguel de Icaza  <miguel@ximian.com>
12163
12164         * cs-tokenizer.cs: Small fix to the parser: compute the ascii
12165         number before adding it.
12166
12167 2002-12-21  Ravi Pratap  <ravi@ximian.com>
12168
12169         * ecore.cs (StandardImplicitConversion): When in an unsafe
12170         context, we allow conversion between void * to any other pointer
12171         type. This fixes bug #35973.
12172
12173 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
12174
12175         * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
12176         is not thrown when extensionless outputs are used 
12177
12178 2002-12-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12179
12180         * rootcontext.cs: fixed compilation of corlib.
12181
12182 2002-12-19  Miguel de Icaza  <miguel@ximian.com>
12183
12184         * attribute.cs (Attributes.Contains): Add new method.
12185
12186         * class.cs (MethodCore.LabelParameters): if the parameter is an
12187         `out' parameter, check that no attribute `[In]' has been passed.
12188
12189         * enum.cs: Handle the `value__' name in an enumeration.
12190
12191 2002-12-14  Jaroslaw Kowalski <jarek@atm.com.pl>
12192
12193         * decl.cs: Added special case to allow overrides on "protected
12194         internal" methods
12195
12196 2002-12-18  Ravi Pratap  <ravi@ximian.com>
12197
12198         * attribute.cs (Attributes.AddAttributeSection): Rename to this
12199         since it makes much more sense.
12200
12201         (Attributes.ctor): Don't require a Location parameter.
12202
12203         * rootcontext.cs (AddGlobalAttributeSection): Rename again.
12204
12205         * attribute.cs (ApplyAttributes): Remove extra Location parameters
12206         since we already have that information per attribute.
12207
12208         * everywhere : make appropriate changes.
12209
12210         * class.cs (LabelParameters): Write the code which actually
12211         applies attributes to the return type. We can't do this on the MS
12212         .NET runtime so we flag a warning in the case an exception is
12213         thrown.
12214
12215 2002-12-18  Miguel de Icaza  <miguel@ximian.com>
12216
12217         * const.cs: Handle implicit null conversions here too.
12218
12219 2002-12-17  Ravi Pratap  <ravi@ximian.com>
12220
12221         * class.cs (MethodCore.LabelParameters): Remove the extra
12222         Type [] parameter since it is completely unnecessary. Instead
12223         pass in the method's attributes so that we can extract
12224         the "return" attribute.
12225
12226 2002-12-17  Miguel de Icaza  <miguel@ximian.com>
12227
12228         * cs-parser.jay (parse): Use Report.Error to flag errors instead
12229         of ignoring it and letting the compile continue.
12230
12231         * typemanager.cs (ChangeType): use an extra argument to return an
12232         error condition instead of throwing an exception.
12233
12234 2002-12-15  Miguel de Icaza  <miguel@ximian.com>
12235
12236         * expression.cs (Unary.TryReduce): mimic the code for the regular
12237         code path.  Perform an implicit cast in the cases where we can
12238         implicitly convert to one of the integral types, and then reduce
12239         based on that constant.   This fixes bug #35483.
12240
12241 2002-12-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12242
12243         * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
12244
12245 2002-12-13  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12246
12247         * namespace.cs: fixed bug #35489.
12248
12249 2002-12-12  Miguel de Icaza  <miguel@ximian.com>
12250
12251         * class.cs: Remove some dead code.
12252
12253         * cs-parser.jay: Estimate the number of methods needed
12254         (RootContext.MethodCount);
12255
12256         * cs-tokenizer.cs: Use char arrays for parsing identifiers and
12257         numbers instead of StringBuilders.
12258
12259         * support.cs (PtrHashtable): Add constructor with initial size;
12260         We can now reduce reallocations of the method table.
12261
12262 2002-12-10  Ravi Pratap  <ravi@ximian.com>
12263
12264         * attribute.cs (ApplyAttributes): Keep track of the emitted
12265         attributes on a per-target basis. This fixes bug #35413.
12266
12267 2002-12-10  Miguel de Icaza  <miguel@ximian.com>
12268
12269         * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
12270         default to the Windows 1252 encoding.
12271
12272         (UnixParseOption): Support version, thanks to Alp for the missing
12273         pointer. 
12274
12275         * AssemblyInfo.cs: Add nice assembly information.
12276
12277         * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
12278         (bug 35169).
12279
12280         * cs-parser.jay: Allow a trailing comma before the close bracked
12281         in the attribute_section production.
12282
12283         * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
12284         address of the instance was being taken, I will take this out,
12285         because we take the address of the object immediately here.
12286
12287 2002-12-09  Ravi Pratap  <ravi@ximian.com>
12288
12289         * typemanager.cs (AreMultipleAllowed): Take care of the most
12290         obvious case where attribute type is not in the current assembly -
12291         stupid me ;-)
12292
12293 2002-12-08  Miguel de Icaza  <miguel@ximian.com>
12294
12295         * ecore.cs (SimpleName.DoResolve): First perform lookups on using
12296         definitions, instead of doing that afterwards.  
12297
12298         Also we use a nice little hack, depending on the constructor, we
12299         know if we are a "composed" name or a simple name.  Hence, we
12300         avoid the IndexOf test, and we avoid 
12301
12302         * codegen.cs: Add code to assist in a bug reporter to track down
12303         the source of a compiler crash. 
12304
12305 2002-12-07  Ravi Pratap  <ravi@ximian.com>
12306
12307         * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
12308         types have been emitted for a given element and flag an error
12309         if something which does not have AllowMultiple set is used more
12310         than once.
12311
12312         * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
12313         attribute types and their corresponding AllowMultiple properties
12314
12315         (AreMultipleAllowed): Check the property for a given type.
12316
12317         * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
12318         property in the case we have a TypeContainer.
12319
12320         (Attributes.AddAttribute): Detect duplicates and just skip on
12321         adding them. This trivial fix catches a pretty gross error in our
12322         attribute emission - global attributes were being emitted twice!
12323
12324         Bugzilla bug #33187 is now fixed.
12325
12326 2002-12-06  Miguel de Icaza  <miguel@ximian.com>
12327
12328         * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
12329         instead of pp_and).
12330
12331         * expression.cs (Binary.ResolveOperator): I can only use the
12332         Concat (string, string, string) and Concat (string, string,
12333         string, string) if the child is actually a concatenation of
12334         strings. 
12335
12336 2002-12-04  Miguel de Icaza  <miguel@ximian.com>
12337
12338         * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
12339         context where we need a 2-character lookahead.
12340
12341         * pending.cs (PendingImplementation): Rework so we can keep track
12342         of interface types all the time, and flag those which were
12343         implemented by parents as optional.
12344
12345 2002-12-03  Miguel de Icaza  <miguel@ximian.com>
12346
12347         * expression.cs (Binary.ResolveOperator): Use
12348         String.Concat(string,string,string) or
12349         String.Concat(string,string,string,string) when possible. 
12350
12351         * typemanager: More helper methods.
12352
12353
12354 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
12355
12356         * pending.cs: remove the bogus return from GetMissingInterfaces()
12357         (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
12358
12359 2002-12-02  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12360
12361         * namespace.cs: avoid duplicated 'using xxx' being added to
12362         using_clauses. This prevents mcs from issuing and 'ambiguous type' error
12363         when we get more than one 'using' statement for the same namespace.
12364         Report a CS0105 warning for it.
12365
12366 2002-11-30  Miguel de Icaza  <miguel@ximian.com>
12367
12368         * cs-tokenizer.cs (consume_identifier): use read directly, instead
12369         of calling getChar/putback, uses internal knowledge of it.    
12370
12371         (xtoken): Reorder tokenizer so most common patterns are checked
12372         first.  This reduces the compilation time in another 5% (from 8.11s
12373         average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
12374
12375         The parsing time is 22% of the compilation in mcs, and from that
12376         64% is spent on the tokenization process.  
12377
12378         I tried using a binary search for keywords, but this is slower
12379         than the hashtable.  Another option would be to do a couple of
12380         things:
12381
12382                 * Not use a StringBuilder, instead use an array of chars,
12383                   with a set value.  Notice that this way we could catch
12384                   the 645 error without having to do it *afterwards*.
12385
12386                 * We could write a hand-parser to avoid the hashtable
12387                   compares altogether.
12388
12389         The identifier consumption process takes 37% of the tokenization
12390         time.  Another 15% is spent on is_number.  56% of the time spent
12391         on is_number is spent on Int64.Parse:
12392
12393                 * We could probably choose based on the string length to
12394                   use Int32.Parse or Int64.Parse and avoid all the 64-bit
12395                   computations. 
12396
12397         Another 3% is spend on wrapping `xtoken' in the `token' function.
12398
12399         Handle 0xa0 as whitespace (#34752)
12400
12401 2002-11-26  Miguel de Icaza  <miguel@ximian.com>
12402
12403         * typemanager.cs (IsCLRType): New routine to tell whether a type
12404         is one of the builtin types.  
12405
12406         Maybe it needs to use TypeCodes to be faster.  Maybe we could use
12407         typecode in more places instead of doing pointer comparissions.
12408         We could leverage some knowledge about the way the typecodes are
12409         laid out.
12410
12411         New code to cache namespaces in assemblies, it is currently not
12412         invoked, to be used soon.
12413
12414         * decl.cs (DeclSpace.MakeFQN): Simple optimization.
12415
12416         * expression.cs (Binary.ResolveOperator): specially handle
12417         strings, and do not perform user-defined operator overloading for
12418         built-in types.
12419
12420 2002-11-24  Miguel de Icaza  <miguel@ximian.com>
12421
12422         * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
12423         internalcall as it is a pretty simple operation;  Avoid whenever
12424         possible to call Char.IsLetter.
12425
12426         (consume_identifier): Cut by half the number of
12427         hashtable calls by merging the is_keyword and GetKeyword behavior.
12428
12429         Do not short-circuit, because if we do, we
12430         report errors (ie, #if false && true would produce an invalid
12431         directive error);
12432
12433
12434 2002-11-24  Martin Baulig  <martin@ximian.com>
12435
12436         * expression.cs (Cast.TryReduce): If we're in checked syntax,
12437         check constant ranges and report a CS0221.  Fixes #33186.
12438
12439 2002-11-24  Martin Baulig  <martin@ximian.com>
12440
12441         * cs-parser.jay: Make this work for uninitialized variable
12442         declarations in the `for' initializer.  Fixes #32416.
12443
12444 2002-11-24  Martin Baulig  <martin@ximian.com>
12445
12446         * ecore.cs (Expression.ConvertExplicit): Make casting from/to
12447         System.Enum actually work.  Fixes bug #32269, added verify-6.cs.
12448
12449 2002-11-24  Martin Baulig  <martin@ximian.com>
12450
12451         * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
12452         argument; if true, we also check for user-defined conversions.
12453         This is only needed if both arguments are of a user-defined type.
12454         Fixes #30443, added test-175.cs.
12455         (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
12456
12457         * ecore.cs (Expression.ImplicitUserConversionExists): New method.
12458
12459 2002-11-24  Martin Baulig  <martin@ximian.com>
12460
12461         * expression.cs (ArrayAccess.GetStoreOpcode): New public static
12462         function to get the store opcode.
12463         (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
12464         only emit the Ldelema if the store opcode is Stobj.  You must run
12465         both test-34 and test-167 to test this.  Fixes #34529.
12466
12467 2002-11-23  Martin Baulig  <martin@ximian.com>
12468
12469         * ecore.cs (Expression.MemberLookup): Added additional
12470         `qualifier_type' argument which is used when we're being called
12471         from MemberAccess.DoResolve() and null if we're called from a
12472         SimpleName lookup.
12473         (Expression.MemberLookupFailed): New method to report errors; this
12474         does the CS1540 check and reports the correct error message.
12475
12476         * typemanager.cs (MemberLookup): Added additional `qualifier_type'
12477         argument for the CS1540 check and redone the way how we're dealing
12478         with private members.  See the comment in the source code for details.
12479         (FilterWithClosure): Reverted this back to revision 1.197; renamed
12480         `closure_start_type' to `closure_qualifier_type' and check whether
12481         it's not null.  It was not this filter being broken, it was just
12482         being called with the wrong arguments.
12483
12484         * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
12485         and pass it the correct `qualifier_type'; this also does the error
12486         handling for us.
12487
12488 2002-11-22  Miguel de Icaza  <miguel@ximian.com>
12489
12490         * expression.cs (Invocation.EmitParams): If the we are dealing
12491         with a non-built-in value type, load its address as well.
12492
12493         (ArrayCreation): Use a a pretty constant instead
12494         of the hardcoded value 2.   Use 6 instead of 2 for the number of
12495         static initializers.  
12496
12497         (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
12498         because they are not really value types, just glorified integers. 
12499
12500         * driver.cs: Do not append .exe, the CSC compiler does not do it.
12501
12502         * ecore.cs: Remove redundant code for enumerations, make them use
12503         the same code path as everything else, fixes the casting issue
12504         with enumerations in Windows.Forms.
12505
12506         * attribute.cs: Do only cast to string if it is a string, the
12507         validation happens later.
12508
12509         * typemanager.cs: Temproary hack to avoid a bootstrap issue until
12510         people upgrade their corlibs.
12511
12512         * ecore.cs: Oops, enumerations were not following the entire code path
12513
12514 2002-11-21  Miguel de Icaza  <miguel@ximian.com>
12515
12516         * typemanager.cs (FilterWithClosure): Commented out the test for
12517         1540 in typemanager.cs, as it has problems when accessing
12518         protected methods from a parent class (see test-174.cs). 
12519
12520         * attribute.cs (Attribute.ValidateGuid): new method.
12521         (Attribute.Resolve): Use above.
12522
12523 2002-11-19  Miguel de Icaza  <miguel@ximian.com>
12524
12525         * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
12526
12527         * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
12528         handling for enumerations, as we only needed the TypeContainer
12529         functionality to begin with (this is required for the fix below to
12530         work for enums that reference constants in a container class for
12531         example). 
12532
12533         * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
12534
12535         * enum.cs (Enum.Define): Use `this' instead of parent, so we have
12536         a valid TypeBuilder to perform lookups on.o
12537
12538         * class.cs (InheritableMemberSignatureCompare): Use true in the
12539         call to GetGetMethod and GetSetMethod, because we are comparing
12540         the signature, and we need to get the methods *even* if they are
12541         private. 
12542
12543         (PropertyBase.CheckBase): ditto.
12544
12545         * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
12546         GotoCase.Resolve): Use Peel on EmpytCasts.
12547
12548         * ecore.cs (EmptyCast): drop child, add Peel method.
12549
12550 2002-11-17  Martin Baulig  <martin@ximian.com>
12551
12552         * ecore.cs (EmptyCast.Child): New public property.
12553
12554         * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
12555         label resolved to an EmptyCast.  Fixes #34162.
12556         (GotoCase.Resolve): Likewise.
12557         (Block.EmitMeta): Likewise.
12558
12559 2002-11-17  Martin Baulig  <martin@ximian.com>
12560
12561         * expression.cs (Invocation.BetterConversion): Prefer int over
12562         uint; short over ushort; long over ulong for integer literals.
12563         Use ImplicitConversionExists instead of StandardConversionExists
12564         since we also need to check for user-defined implicit conversions.
12565         Fixes #34165.  Added test-173.cs.
12566
12567 2002-11-16  Martin Baulig  <martin@ximian.com>
12568
12569         * expression.cs (Binary.EmitBranchable): Eliminate comparisions
12570         with the `true' and `false' literals.  Fixes #33151.
12571
12572 2002-11-16  Martin Baulig  <martin@ximian.com>
12573
12574         * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
12575         October 22nd; don't do the cs1540 check for static members.
12576
12577         * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
12578         now using our own filter here and doing the cs1540 check again.
12579
12580 2002-11-16  Martin Baulig  <martin@ximian.com>
12581
12582         * support.cs (InternalParameters): Don't crash if we don't have
12583         any fixed parameters.  Fixes #33532.
12584
12585 2002-11-16  Martin Baulig  <martin@ximian.com>
12586
12587         * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
12588         when looking up static methods to make this work on Windows.
12589         Fixes #33773.
12590
12591 2002-11-16  Martin Baulig  <martin@ximian.com>
12592
12593         * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
12594         a setter rather than using PropertyInfo.CanWrite.
12595
12596 2002-11-15  Nick Drochak  <ndrochak@gol.com>
12597
12598         * class.cs: Allow acces to block member by subclasses. Fixes build
12599         breaker.
12600
12601 2002-11-14  Martin Baulig  <martin@ximian.com>
12602
12603         * class.cs (Constructor.Emit): Added the extern/block check.
12604         Fixes bug #33678.
12605
12606 2002-11-14  Martin Baulig  <martin@ximian.com>
12607
12608         * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
12609         iteration while looking for indexers, this is needed because the
12610         indexer may have a different name in our base classes.  Fixed the
12611         error reporting (no indexers at all, not get accessor, no
12612         overloaded match).  Fixes bug #33089.
12613         (IndexerAccess.DoResolveLValue): Likewise.
12614
12615 2002-11-14  Martin Baulig  <martin@ximian.com>
12616
12617         * class.cs (PropertyBase.CheckBase): Make this work for multiple
12618         indexers.  Fixes the first part of bug #33089.
12619         (MethodSignature.InheritableMemberSignatureCompare): Added support
12620         for properties.
12621
12622 2002-11-13  Ravi Pratap  <ravi@ximian.com>
12623
12624         * attribute.cs (Attribute.Resolve): Catch the
12625         NullReferenceException and report it since it isn't supposed to
12626         happen. 
12627
12628 2002-11-12  Miguel de Icaza  <miguel@ximian.com>
12629
12630         * expression.cs (Binary.EmitBranchable): Also handle the cases for
12631         LogicalOr and LogicalAnd that can benefit from recursively
12632         handling EmitBranchable.  The code now should be nice for Paolo.
12633
12634 2002-11-08  Miguel de Icaza  <miguel@ximian.com>
12635
12636         * typemanager.cs (LookupType): Added a negative-hit hashtable for
12637         the Type lookups, as we perform quite a number of lookups on
12638         non-Types.  This can be removed once we can deterministically tell
12639         whether we have a type or a namespace in advance.
12640
12641         But this might require special hacks from our corlib.
12642
12643         * TODO: updated.
12644
12645         * ecore.cs (TryImplicitIntConversion): Handle conversions to float
12646         and double which avoids a conversion from an integer to a double.
12647
12648         * expression.cs: tiny optimization, avoid calling IsConstant,
12649         because it effectively performs the lookup twice.
12650
12651 2002-11-06  Miguel de Icaza  <miguel@ximian.com>
12652
12653         But a bogus return here to keep the semantics of the old code
12654         until the Mono runtime is fixed.
12655
12656         * pending.cs (GetMissingInterfaces): New method used to remove all
12657         the interfaces that are already implemented by our parent
12658         classes from the list of pending methods. 
12659
12660         * interface.cs: Add checks for calls after ResolveTypeExpr.
12661
12662 2002-11-05  Miguel de Icaza  <miguel@ximian.com>
12663
12664         * class.cs (Class.Emit): Report warning 67: event not used if the
12665         warning level is beyond 3.
12666
12667         * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
12668         being a NullLiteral.
12669
12670         * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
12671         specifiers. 
12672
12673         * class.cs (TypeContainer.GetClassBases): Cover a missing code
12674         path that might fail if a type can not be resolved.
12675
12676         * expression.cs (Binary.Emit): Emit unsigned versions of the
12677         operators. 
12678
12679         * driver.cs: use error 5.
12680
12681 2002-11-02  Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
12682
12683         * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
12684
12685 2002-11-01  Miguel de Icaza  <miguel@ximian.com>
12686
12687         * cs-parser.jay (switch_section): A beautiful patch from Martin
12688         Baulig that fixed 33094.
12689
12690 2002-10-31  Miguel de Icaza  <miguel@ximian.com>
12691
12692         * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
12693         Check whether the base is abstract and report an error if so.
12694
12695         * expression.cs (IndexerAccess.DoResolveLValue,
12696         IndexerAccess.DoResolve): ditto. 
12697
12698         (Invocation.DoResolve): ditto.
12699
12700         (Invocation.FullMethodDesc): Improve the report string.
12701
12702         * statement.cs (Block): Eliminate IsVariableDefined as it is
12703         basically just a wrapper for GetVariableInfo.
12704
12705         * ecore.cs (SimpleName): Use new 
12706
12707         * support.cs (ReflectionParamter.ParameterType): We unwrap the
12708         type, as we return the actual parameter ref/unref state on a
12709         different call.
12710
12711 2002-10-30  Miguel de Icaza  <miguel@ximian.com>
12712
12713         * support.cs: Return proper flags REF/OUT fixing the previous
12714         commit.  
12715
12716         * expression.cs: Reverted last patch, that was wrong.  Is_ref is
12717         not used to mean `ref' but `ref or out' in ParameterReference
12718
12719         * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
12720         full type signature instead of calling TypeManger.CSharpName
12721         ourselves. 
12722
12723         * support.cs (InternalParameters.ParameterDesc): Do not compare
12724         directly to the modflags, because REF/OUT will actually be bitsets
12725         if set. 
12726
12727         * delegate.cs (VerifyMethod): Check also the modifiers.
12728
12729         * cs-tokenizer.cs: Fix bug where floating point values with an
12730         exponent where a sign was missing was ignored.
12731
12732         * driver.cs: Allow multiple assemblies to be specified in a single
12733         /r: argument
12734
12735 2002-10-28  Miguel de Icaza  <miguel@ximian.com>
12736
12737         * cs-parser.jay: Ugly.  We had to add a multiplicative_expression,
12738         because identifiers after a parenthesis would end up in this kind
12739         of production, and we needed to desamiguate it for having casts
12740         like:
12741
12742                 (UserDefinedType *) xxx
12743
12744 2002-10-24  Miguel de Icaza  <miguel@ximian.com>
12745
12746         * typemanager.cs (RealMemberLookup): when we deal with a subclass,
12747         we should set on the Bindingflags.NonPublic, but not turn on
12748         private_ok.  private_ok controls whether a Private member is
12749         returned (this is chekced on the filter routine), while the
12750         BindingFlags.NonPublic just controls whether private/protected
12751         will be allowed.   This fixes the problem part of the problem of
12752         private properties being allowed to be used in derived classes.
12753
12754         * expression.cs (BaseAccess): Provide an DoResolveLValue method,
12755         so we can call the children DoResolveLValue method (this will
12756         properly signal errors on lvalue assignments to base properties)
12757
12758         * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
12759         getter are null, and we have a property info, we know that this
12760         happened because the lookup failed, so we report an error 122 for
12761         protection level violation.
12762
12763         We also silently return if setter and getter are null in the
12764         resolve functions, this condition only happens if we have flagged
12765         the error before.  This is the other half of the problem. 
12766
12767         (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
12768         not have accessibility information, that is why we were returning
12769         true in the filter function in typemanager.cs.
12770
12771         To properly report 122 (property is inaccessible because of its
12772         protection level) correctly, we report this error in ResolveAccess
12773         by failing if both the setter and the getter are lacking (ie, the
12774         lookup failed). 
12775
12776         DoResolve and DoLResolve have been modified to check for both
12777         setter/getter being null and returning silently, the reason being
12778         that I did not want to put the knowledge about this error in upper
12779         layers, like:
12780
12781         int old = Report.Errors;
12782         x = new PropertyExpr (...);
12783         if (old != Report.Errors)
12784                 return null;
12785         else
12786                 return x;
12787
12788         So the property expr is returned, but it is invalid, so the error
12789         will be flagged during the resolve process. 
12790
12791         * class.cs: Remove InheritablePropertySignatureCompare from the
12792         class, as we no longer depend on the property signature to compute
12793         whether it is possible to implement a method or not.
12794
12795         The reason is that calling PropertyInfo.GetGetMethod will return
12796         null (in .NET, in Mono it works, and we should change this), in
12797         cases where the Get Method does not exist in that particular
12798         class.
12799
12800         So this code:
12801
12802         class X { public virtual int A { get { return 1; } } }
12803         class Y : X { }
12804         class Z : Y { public override int A { get { return 2; } } }
12805
12806         Would fail in Z because the parent (Y) would not have the property
12807         defined.  So we avoid this completely now (because the alternative
12808         fix was ugly and slow), and we now depend exclusively on the
12809         method names.
12810
12811         (PropertyBase.CheckBase): Use a method-base mechanism to find our
12812         reference method, instead of using the property.
12813
12814         * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
12815         routines are gone now.
12816
12817         * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
12818         names, they were incorrectly named.
12819
12820         * cs-tokenizer.cs: Return are more gentle token on failure. 
12821
12822         * pending.cs (PendingImplementation.InterfaceMethod): This routine
12823         had an out-of-sync index variable, which caused it to remove from
12824         the list of pending methods the wrong method sometimes.
12825
12826 2002-10-22  Miguel de Icaza  <miguel@ximian.com>
12827
12828         * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
12829         CanWrite, because those refer to this particular instance of the
12830         property, and do not take into account the fact that we can
12831         override single members of a property.
12832
12833         Constructor requires an EmitContext.  The resolution process does
12834         not happen here, but we need to compute the accessors before,
12835         because the resolution does not always happen for properties.
12836
12837         * typemanager.cs (RealMemberLookup): Set private_ok if we are a
12838         subclass, before we did not update this flag, but we did update
12839         bindingflags. 
12840
12841         (GetAccessors): Drop this routine, as it did not work in the
12842         presence of partially overwritten set/get methods. 
12843
12844         Notice that this broke the cs1540 detection, but that will require
12845         more thinking. 
12846
12847 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12848
12849         * class.cs:
12850         * codegen.cs:
12851         * driver.cs: issue a warning instead of an error if we don't support
12852         debugging for the platform. Also ignore a couple of errors that may
12853         arise when trying to write the symbols. Undo my previous patch.
12854
12855 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12856
12857         * driver.cs: ignore /debug switch except for Unix platforms.
12858
12859 2002-10-23  Nick Drochak  <ndrochak@gol.com>
12860
12861         * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
12862
12863 2002-10-21  Miguel de Icaza  <miguel@ximian.com>
12864
12865         * driver.cs: Do not make mcs-debug conditional, so we do not break
12866         builds that use it.
12867
12868         * statement.cs (UsageVector.MergeChildren): I would like Martin to
12869         review this patch.  But basically after all the children variables
12870         have been merged, the value of "Breaks" was not being set to
12871         new_breaks for Switch blocks.  I think that it should be set after
12872         it has executed.  Currently I set this to the value of new_breaks,
12873         but only if new_breaks is FlowReturn.ALWAYS, which is a bit
12874         conservative, but I do not understand this code very well.
12875
12876         I did not break anything in the build, so that is good ;-)
12877
12878         * cs-tokenizer.cs: Also allow \r in comments as a line separator.
12879
12880 2002-10-20  Mark Crichton  <crichton@gimp.org>
12881
12882         * cfold.cs: Fixed compile blocker.  Really fixed it this time.
12883
12884 2002-10-20  Nick Drochak  <ndrochak@gol.com>
12885
12886         * cfold.cs: Fixed compile blocker.
12887
12888 2002-10-20  Miguel de Icaza  <miguel@ximian.com>
12889
12890         * driver.cs: I was chekcing the key, not the file.
12891
12892 2002-10-19  Ravi Pratap  <ravi@ximian.com>
12893
12894         * ecore.cs (UserDefinedConversion): Get rid of the bogus error
12895         message that we were generating - we just need to silently return
12896         a null.
12897
12898 2002-10-19  Miguel de Icaza  <miguel@ximian.com>
12899
12900         * class.cs (Event.Define): Change my previous commit, as this
12901         breaks the debugger.  This is a temporary hack, as it seems like
12902         the compiler is generating events incorrectly to begin with.
12903
12904         * expression.cs (Binary.ResolveOperator): Added support for 
12905         "U operator - (E x, E y)"
12906
12907         * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
12908         y)".
12909
12910         * ecore.cs (FieldExpr.AddressOf): We had a special code path for
12911         init-only variables, but this path did not take into account that
12912         there might be also instance readonly variables.  Correct this
12913         problem. 
12914
12915         This fixes bug 32253
12916
12917         * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
12918         delegates as well.
12919
12920         * driver.cs: Change the extension for modules to `netmodule'
12921
12922         * cs-parser.jay: Improved slightly the location tracking for
12923         the debugger symbols.
12924
12925         * class.cs (Event.Define): Use Modifiers.FieldAttr on the
12926         modifiers that were specified instead of the hardcoded value
12927         (FamAndAssem).  This was basically ignoring the static modifier,
12928         and others.  Fixes 32429.
12929
12930         * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
12931         fixed a bug in the process (32476)
12932
12933         * expression.cs (ArrayAccess.EmitAssign): Patch from
12934         hwang_rob@yahoo.ca that fixes bug 31834.3
12935
12936 2002-10-18  Miguel de Icaza  <miguel@ximian.com>
12937
12938         * driver.cs: Make the module extension .netmodule.
12939
12940 2002-10-16  Miguel de Icaza  <miguel@ximian.com>
12941
12942         * driver.cs: Report an error if the resource file is not found
12943         instead of crashing.
12944
12945         * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
12946         false, like Emit does.
12947
12948 2002-10-16  Nick Drochak  <ndrochak@gol.com>
12949
12950         * typemanager.cs: Remove unused private member.  Also reported mcs
12951         bug to report this as a warning like csc.
12952
12953 2002-10-15  Martin Baulig  <martin@gnome.org>
12954
12955         * statement.cs (Statement.Emit): Made this a virtual method; emits
12956         the line number info and calls DoEmit().
12957         (Statement.DoEmit): New protected abstract method, formerly knows
12958         as Statement.Emit().
12959
12960         * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
12961
12962 2002-10-11  Miguel de Icaza  <miguel@ximian.com>
12963
12964         * class.cs: Following the comment from 2002-09-26 to AddMethod, I
12965         have fixed a remaining problem: not every AddXXXX was adding a
12966         fully qualified name.  
12967
12968         Now everyone registers a fully qualified name in the DeclSpace as
12969         being defined instead of the partial name.  
12970
12971         Downsides: we are slower than we need to be due to the excess
12972         copies and the names being registered this way.  
12973
12974         The reason for this is that we currently depend (on the corlib
12975         bootstrap for instance) that types are fully qualified, because
12976         we dump all the types in the namespace, and we should really have
12977         types inserted into the proper namespace, so we can only store the
12978         basenames in the defined_names array.
12979
12980 2002-10-10  Martin Baulig  <martin@gnome.org>
12981
12982         * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
12983         from bug #31834, see the bug report for a testcase which is
12984         miscompiled.
12985
12986 2002-10-10  Martin Baulig  <martin@gnome.org>
12987
12988         * codegen.cs (EmitContext.Breaks): Removed, we're now using the
12989         flow analysis code for this.
12990
12991         * statement.cs (Do, While, For): Tell the flow analysis code about
12992         infinite loops.
12993         (FlowBranching.UsageVector): Added support for infinite loops.
12994         (Block.Resolve): Moved the dead code elimination here and use flow
12995         analysis to do it.
12996
12997 2002-10-09  Miguel de Icaza  <miguel@ximian.com>
12998
12999         * class.cs (Field.Define): Catch cycles on struct type
13000         definitions. 
13001
13002         * typemanager.cs (IsUnmanagedtype): Do not recursively check
13003         fields if the fields are static.  We only need to check instance
13004         fields. 
13005
13006         * expression.cs (As.DoResolve): Test for reference type.
13007
13008         * statement.cs (Using.ResolveExpression): Use
13009         ConvertImplicitRequired, not ConvertImplicit which reports an
13010         error on failture
13011         (Using.ResolveLocalVariableDecls): ditto.
13012
13013         * expression.cs (Binary.ResolveOperator): Report errors in a few
13014         places where we had to.
13015
13016         * typemanager.cs (IsUnmanagedtype): Finish implementation.
13017
13018 2002-10-08  Miguel de Icaza  <miguel@ximian.com>
13019
13020         * expression.cs: Use StoreFromPtr instead of extracting the type
13021         and then trying to use Stelem.  Patch is from hwang_rob@yahoo.ca
13022
13023         * ecore.cs (ImplicitReferenceConversion): It is possible to assign
13024         an enumeration value to a System.Enum, but System.Enum is not a
13025         value type, but an class type, so we need to box.
13026
13027         (Expression.ConvertExplicit): One codepath could return
13028         errors but not flag them.  Fix this.  Fixes #31853
13029
13030         * parameter.cs (Resolve): Do not allow void as a parameter type.
13031
13032 2002-10-06  Martin Baulig  <martin@gnome.org>
13033
13034         * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
13035         if it's a class type and not a struct.  Fixes #31815.
13036
13037 2002-10-06  Martin Baulig  <martin@gnome.org>
13038
13039         * statement.cs: Reworked the flow analysis code a bit to make it
13040         usable for dead code elimination.
13041
13042 2002-10-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13043
13044         * cs-parser.jay: allow empty source files. Fixes bug #31781.
13045
13046 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
13047
13048         * expression.cs (ComposedCast.DoResolveType): A quick workaround
13049         to fix the test 165, will investigate deeper.
13050
13051 2002-10-04  Martin Baulig  <martin@gnome.org>
13052
13053         * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
13054         finally blocks actually work.
13055         (Try.Resolve): We don't need to create a sibling for `finally' if
13056         there is no finally block.
13057
13058 2002-10-04  Martin Baulig  <martin@gnome.org>
13059
13060         * class.cs (Constructor.Define): The default accessibility for a
13061         non-default constructor is private, not public.
13062
13063 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
13064
13065         * class.cs (Constructor): Make AllowedModifiers public, add
13066         EXTERN.
13067
13068         * cs-parser.jay: Perform the modifiers test here, as the
13069         constructor for the Constructor class usually receives a zero
13070         because of the way we create it (first we create, later we
13071         customize, and we were never checking the modifiers).
13072
13073         * typemanager.cs (Typemanager.LookupTypeDirect): This new function
13074         is a version of LookupTypeReflection that includes the type-name
13075         cache.  This can be used as a fast path for functions that know
13076         the fully qualified name and are only calling into *.GetType() to
13077         obtain a composed type.
13078
13079         This is also used by TypeManager.LookupType during its type
13080         composition.
13081
13082         (LookupType): We now also track the real type name, as sometimes
13083         we can get a quey for the real type name from things like
13084         ComposedCast.  This fixes bug 31422.
13085
13086         * expression.cs (ComposedCast.Resolve): Since we are obtaining a
13087         complete type fullname, it does not have to go through the type
13088         resolution system to obtain the composed version of the type (for
13089         obtaining arrays or pointers).
13090
13091         (Conditional.Emit): Use the EmitBoolExpression to
13092         generate nicer code, as requested by Paolo.
13093
13094         (ArrayCreation.CheckIndices): Use the patch from
13095         hwang_rob@yahoo.ca to validate the array initializers. 
13096
13097 2002-10-03  Miguel de Icaza  <miguel@ximian.com>
13098
13099         * class.cs (ConstructorInitializer.Emit): simplify code by using
13100         Invocation.EmitCall, and at the same time, fix the bugs in calling
13101         parent constructors that took variable arguments. 
13102
13103         * ecore.cs (Expression.ConvertNumericExplicit,
13104         Expression.ImplicitNumericConversion): Remove the code that
13105         manually wrapped decimal (InternalTypeConstructor call is now gone
13106         as well).
13107
13108         * expression.cs (Cast.TryReduce): Also handle decimal types when
13109         trying to perform a constant fold on the type.
13110
13111         * typemanager.cs (IsUnmanagedtype): Partially implemented.
13112
13113         * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
13114         that only turned off an error report, and did nothing else. 
13115
13116 2002-10-02  Miguel de Icaza  <miguel@ximian.com>
13117
13118         * driver.cs: Handle and ignore /fullpaths
13119
13120 2002-10-01  Miguel de Icaza  <miguel@ximian.com>
13121
13122         * expression.cs (Binary.ResolveOperator): Catch the case where
13123         DoNumericPromotions returns true, 
13124
13125         (Binary.DoNumericPromotions): Simplify the code, and the tests.
13126
13127 2002-09-27  Miguel de Icaza  <miguel@ximian.com>
13128
13129         * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
13130         report error 70.
13131
13132 2002-09-26  Miguel de Icaza  <miguel@ximian.com>
13133
13134         * ecore.cs (ConvertNumericExplicit): It is not enough that the
13135         conversion exists, but it is also required that the conversion be
13136         performed.  This manifested in "(Type64Enum) 2".  
13137
13138         * class.cs (TypeManager.AddMethod): The fix is not to change
13139         AddEnum, because that one was using a fully qualified name (every
13140         DeclSpace derivative does), but to change the AddMethod routine
13141         that was using an un-namespaced name.  This now correctly reports
13142         the duplicated name.
13143
13144         Revert patch until I can properly fix it.  The issue
13145         is that we have a shared Type space across all namespaces
13146         currently, which is wrong.
13147
13148         Options include making the Namespace a DeclSpace, and merge
13149         current_namespace/current_container in the parser.
13150
13151 2002-09-25  Miguel de Icaza  <miguel@ximian.com>
13152
13153         * cs-parser.jay: Improve error reporting when we get a different
13154         kind of expression in local_variable_type and
13155         local_variable_pointer_type. 
13156
13157         Propagate this to avoid missleading errors being reported.
13158
13159         * ecore.cs (ImplicitReferenceConversion): treat
13160         TypeManager.value_type as a target just like object_type.   As
13161         code like this:
13162
13163         ValueType v = 1;
13164
13165         Is valid, and needs to result in the int 1 being boxed before it
13166         is assigned to the value type v.
13167
13168         * class.cs (TypeContainer.AddEnum): Use the basename, not the name
13169         to validate the enumeration name.
13170
13171         * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
13172         EmitDynamicInitializers for the criteria to use Ldelema.  Thanks
13173         to hwang_rob@yahoo.ca for finding the bug and providing a patch.
13174
13175         * ecore.cs (TryImplicitIntConversion): When doing an
13176         implicit-enumeration-conversion, check if the type is 64-bits and
13177         perform a conversion before passing to EnumConstant.
13178
13179 2002-09-23  Miguel de Icaza  <miguel@ximian.com>
13180
13181         * decl.cs (Error_AmbiguousTypeReference); New routine used to
13182         report ambiguous type references.  Unlike the MS version, we
13183         report what the ambiguity is.   Innovation at work ;-)
13184
13185         (DeclSpace.FindType): Require a location argument to
13186         display when we display an ambiguous error.
13187
13188         * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
13189
13190         * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
13191
13192         * expression.cs (EmitDynamicInitializers): Apply patch from
13193         hwang_rob@yahoo.ca that fixes the order in which we emit our
13194         initializers. 
13195
13196 2002-09-21  Martin Baulig  <martin@gnome.org>
13197
13198         * delegate.cs (Delegate.VerifyApplicability): Make this work if the
13199         delegate takes no arguments.
13200
13201 2002-09-20  Miguel de Icaza  <miguel@ximian.com>
13202
13203         * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
13204         from integers.
13205
13206         * expression.cs: Extract the underlying type.
13207
13208         * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
13209
13210         * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
13211
13212 2002-09-19  Miguel de Icaza  <miguel@ximian.com>
13213
13214         * class.cs (TypeContainer.DefineType): We can not use the nice
13215         PackingSize with the size set to 1 DefineType method, because it
13216         will not allow us to define the interfaces that the struct
13217         implements.
13218
13219         This completes the fixing of bug 27287
13220
13221         * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
13222         means also structs.  This fixes part of the problem. 
13223         (Expresion.ImplicitReferenceConversionExists): ditto.
13224
13225         * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
13226         error if there were no errors reported during the type lookup
13227         process, to avoid duplicates or redundant errors.  Without this
13228         you would get an ambiguous errors plus a type not found.  We have
13229         beaten the user enough with the first error.  
13230
13231         (DeclSparce.FindType): Emit a warning if we have an ambiguous
13232         reference. 
13233
13234         * ecore.cs (SimpleName.DoResolveType): If an error is emitted
13235         during the resolution process, stop the lookup, this avoids
13236         repeated error reports (same error twice).
13237
13238         * rootcontext.cs: Emit a warning if we have an ambiguous reference.
13239
13240         * typemanager.cs (LookupType): Redo the type lookup code to match
13241         the needs of System.Reflection.  
13242
13243         The issue is that System.Reflection requires references to nested
13244         types to begin with a "+" sign instead of a dot.  So toplevel
13245         types look like: "NameSpace.TopLevelClass", and nested ones look
13246         like "Namespace.TopLevelClass+Nested", with arbitrary nesting
13247         levels. 
13248
13249 2002-09-19  Martin Baulig  <martin@gnome.org>
13250
13251         * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
13252         says that a method always returns or always throws an exception,
13253         don't report the CS0161.
13254
13255         * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
13256         set `Returns = new_returns'.
13257
13258 2002-09-19  Martin Baulig  <martin@gnome.org>
13259
13260         * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
13261         to an enum constant, check for a CS0176.
13262
13263 2002-09-18  Miguel de Icaza  <miguel@ximian.com>
13264
13265         * class.cs (TypeContainer.CheckPairedOperators): Now we check
13266         for operators that must be in pairs and report errors.
13267
13268         * ecore.cs (SimpleName.DoResolveType): During the initial type
13269         resolution process, when we define types recursively, we must
13270         check first for types in our current scope before we perform
13271         lookups in the enclosing scopes.
13272
13273         * expression.cs (MakeByteBlob): Handle Decimal blobs.
13274
13275         (Invocation.VerifyArgumentsCompat): Call
13276         TypeManager.TypeToCoreType on the parameter_type.GetElementType.
13277         I thought we were supposed to always call this, but there are a
13278         few places in the code where we dont do it.
13279
13280 2002-09-17  Miguel de Icaza  <miguel@ximian.com>
13281
13282         * driver.cs: Add support in -linkres and -resource to specify the
13283         name of the identifier.
13284
13285 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
13286
13287         * ecore.cs (StandardConversionExists): Sync with the conversion
13288         code: allow anything-* to void* conversions.
13289
13290         (FindMostSpecificSource): Use an Expression argument
13291         instead of a Type, because we might be handed over a Literal which
13292         gets a few more implicit conversions that plain types do not.  So
13293         this information was being lost.
13294
13295         Also, we drop the temporary type-holder expression when not
13296         required.
13297
13298 2002-09-17  Martin Baulig  <martin@gnome.org>
13299
13300         * class.cs (PropertyBase.CheckBase): Don't check the base class if
13301         this is an explicit interface implementation.
13302
13303 2002-09-17  Martin Baulig  <martin@gnome.org>
13304
13305         * class.cs (PropertyBase.CheckBase): Make this work for indexers with
13306         different `IndexerName' attributes.
13307
13308         * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
13309         (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
13310         virtual CommonResolve().
13311
13312 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
13313
13314         * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
13315         and convert that to the UnderlyingType.
13316
13317         * statement.cs (Foreach.Resolve): Indexers are just like variables
13318         or PropertyAccesses.
13319
13320         * cs-tokenizer.cs (consume_string): Track line numbers and columns
13321         inside quoted strings, we were not doing this before.
13322
13323 2002-09-16  Martin Baulig  <martin@gnome.org>
13324
13325         * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
13326         resolve it.  This is needed for the definite assignment check of the
13327         instance expression, fixes bug #29846.
13328         (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
13329
13330 2002-09-16  Nick Drochak  <ndrochak@gol.com>
13331
13332         * parameter.cs: Fix compile error.  Cannot reference static member
13333         from an instance object.  Is this an mcs bug?
13334
13335 2002-09-14  Martin Baulig  <martin@gnome.org>
13336
13337         * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
13338         multiple times.  Fixes bug #30295, added test-166.cs.
13339
13340 2002-09-14  Martin Baulig  <martin@gnome.org>
13341
13342         * statement.cs (Block.Emit): Don't emit unreachable code.
13343         (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
13344         `break' statements.
13345         (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
13346
13347 2002-09-14  Martin Baulig  <martin@gnome.org>
13348
13349         * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
13350         is set.
13351
13352 2002-09-14  Martin Baulig  <martin@gnome.org>
13353
13354         * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
13355         if `type == parent' since in this case `type.IsSubclassOf (parent)' will
13356         be false on the ms runtime.
13357
13358 2002-09-13  Martin Baulig  <martin@gnome.org>
13359
13360         * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
13361         the CS0038 error message.
13362
13363 2002-09-12  Miguel de Icaza  <miguel@ximian.com>
13364
13365         * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
13366         constant inside, return it.
13367
13368 2002-09-12  Martin Baulig  <martin@gnome.org>
13369
13370         * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
13371         implicit conversion can be done between enum types.
13372
13373         * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
13374         check whether an implicit conversion to the current enum's UnderlyingType
13375         exists and report an error if not.
13376
13377         * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
13378         without debugging support.
13379
13380         * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
13381         Fixes bug #30235.  Thanks to Ricardo Fernández Pascual.
13382
13383 2002-09-12  Martin Baulig  <martin@gnome.org>
13384
13385         * typemanager.cs (TypeManager.IsNestedChildOf): New method.
13386
13387         * ecore.cs (IMemberExpr.DeclaringType): New property.
13388         (SimpleName.SimpleNameResolve): Check whether we're accessing a
13389         nonstatic member of an outer type (CS0038).
13390
13391 2002-09-11  Miguel de Icaza  <miguel@ximian.com>
13392
13393         * driver.cs: Activate the using-error detector at warning level
13394         4 (at least for MS-compatible APIs).
13395
13396         * namespace.cs (VerifyUsing): Small buglett fix.
13397
13398         * pending.cs (PendingImplementation): pass the container pointer. 
13399
13400         * interface.cs (GetMethods): Allow for recursive definition.  Long
13401         term, I would like to move every type to support recursive
13402         definitions, not the current ordering mechanism that we have right
13403         now.
13404
13405         The situation is this: Attributes are handled before interfaces,
13406         so we can apply attributes to interfaces.  But some attributes
13407         implement interfaces, we will now handle the simple cases
13408         (recursive definitions will just get an error).  
13409
13410         * parameter.cs: Only invalidate types at the end if we fail to
13411         lookup all types.  
13412
13413 2002-09-09  Martin Baulig  <martin@gnome.org>
13414
13415         * ecore.cs (PropertyExpr.Emit): Also check for
13416         TypeManager.system_int_array_get_length so this'll also work when
13417         compiling corlib.  Fixes #30003.
13418
13419 2002-09-09  Martin Baulig  <martin@gnome.org>
13420
13421         * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
13422         and throw an exception if we can't get the type's size.  Fixed #30040,
13423         added test-165.cs.
13424
13425 2002-09-09  Martin Baulig  <martin@gnome.org>
13426
13427         * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
13428
13429         * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
13430         context.  Fixes bug #30027.
13431
13432         * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
13433         virtual functions.  Fixes bug #30043, added test-164.cs.
13434
13435 2002-09-08  Ravi Pratap  <ravi@ximian.com>
13436
13437         * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
13438
13439 2002-09-08  Nick Drochak  <ndrochak@gol.com>
13440
13441         * driver.cs: Use an object to get the windows codepage since it's not a
13442         static property.
13443
13444 2002-09-08  Miguel de Icaza  <miguel@ximian.com>
13445
13446         * statement.cs (For.Emit): for infinite loops (test == null)
13447         return whether there is a break inside, not always "true".
13448
13449         * namespace.cs (UsingEntry): New struct to hold the name of the
13450         using definition, the location where it is defined, and whether it
13451         has been used in a successful type lookup.
13452
13453         * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
13454         strings.
13455
13456         * decl.cs: ditto.
13457
13458 2002-09-06  Ravi Pratap  <ravi@ximian.com>
13459
13460         * attribute.cs : Fix incorrect code which relied on catching
13461         a NullReferenceException to detect a null being passed in
13462         where an object was expected.
13463
13464 2002-09-06  Miguel de Icaza  <miguel@ximian.com>
13465
13466         * statement.cs (Try): flag the catch variable as assigned
13467
13468         * expression.cs (Cast): Simplified by using ResolveType instead of
13469         manually resolving.
13470
13471         * statement.cs (Catch): Fix bug by using ResolveType.
13472
13473 2002-09-06  Ravi Pratap  <ravi@ximian.com>
13474
13475         * expression.cs (BetterConversion): Special case for when we have
13476         a NullLiteral as the argument and we have to choose between string
13477         and object types - we choose string the way csc does.
13478
13479         * attribute.cs (Attribute.Resolve): Catch the
13480         NullReferenceException and report error #182 since the Mono
13481         runtime no more has the bug and having this exception raised means
13482         we tried to select a constructor which takes an object and is
13483         passed a null.
13484
13485 2002-09-05  Ravi Pratap  <ravi@ximian.com>
13486
13487         * expression.cs (Invocation.OverloadResolve): Flag a nicer error
13488         message (1502, 1503) when we can't locate a method after overload
13489         resolution. This is much more informative and closes the bug
13490         Miguel reported.
13491
13492         * interface.cs (PopulateMethod): Return if there are no argument
13493         types. Fixes a NullReferenceException bug.
13494
13495         * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
13496         expressions too. Previously we were checking only in one place for
13497         positional arguments leaving out named arguments.
13498
13499         * ecore.cs (ImplicitNumericConversion): Conversion from underlying
13500         type to the enum type is not allowed. Remove code corresponding to
13501         that.
13502
13503         (ConvertNumericExplicit): Allow explicit conversions from
13504         the underlying type to enum type. This precisely follows the spec
13505         and closes a bug filed by Gonzalo.
13506
13507 2002-09-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13508
13509         * compiler.csproj:
13510         * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
13511
13512 2002-09-03  Miguel de Icaza  <miguel@ximian.com>
13513
13514         * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
13515         it was important that we stored the right value after the
13516         reduction in `converted'.
13517
13518 2002-09-04  Martin Baulig  <martin@gnome.org>
13519
13520         * location.cs (Location.SymbolDocument): Use full pathnames for the
13521         source files.
13522
13523 2002-08-30  Miguel de Icaza  <miguel@ximian.com>
13524
13525         * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
13526         of the expression resolve mechanism, because that will catch the
13527         SimpleName error failures.
13528
13529         (Conditional): If we can not resolve the
13530         expression, return, do not crash.
13531
13532 2002-08-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13533
13534         * cs-tokenizer.cs:
13535         (location): display token name instead of its number.
13536
13537 2002-08-28  Martin Baulig  <martin@gnome.org>
13538
13539         * expression.cs (Binary.ResolveOperator): Don't silently return
13540         but return an error if an operator cannot be applied between two
13541         enum types.
13542
13543 2002-08-28  Martin Baulig  <martin@gnome.org>
13544
13545         * class.cs (Constructor.Define): Set the permission attributes
13546         correctly instead of making all constructors public.
13547
13548 2002-08-28  Martin Baulig  <martin@gnome.org>
13549
13550         * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
13551         for private members before reporting a CS0103; if we find anything,
13552         it's a CS0122.
13553
13554 2002-08-28  Martin Baulig  <martin@gnome.org>
13555
13556         * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
13557         to check whether `closure_start_type == closure_invocation_type',
13558         we also need to check whether `m.DeclaringType == closure_invocation_type'
13559         before bypassing the permission checks.  We might be accessing
13560         protected/private members from the base class.
13561         (TypeManager.RealMemberLookup): Only set private_ok if private
13562         members were requested via BindingFlags.NonPublic.
13563
13564         * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
13565
13566         * expression.cs (MemberAccess.ResolveMemberAccess): Set
13567         MethodGroupExpr.IsExplicitImpl if appropriate.
13568         (Invocation.DoResolve): Don't report the CS0120 for explicit
13569         interface implementations.
13570
13571 2002-08-27  Martin Baulig  <martin@gnome.org>
13572
13573         * expression.cs (Invocation.DoResolve): If this is a static
13574         method and we don't have an InstanceExpression, we must report
13575         a CS0120.
13576
13577 2002-08-25  Martin Baulig  <martin@gnome.org>
13578
13579         * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
13580         `==' between a valuetype and an object.
13581
13582 2002-08-25  Miguel de Icaza  <miguel@ximian.com>
13583
13584         * ecore.cs (TypeExpr): Provide a ToString method.
13585
13586 2002-08-24  Martin Baulig  <martin@gnome.org>
13587
13588         * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
13589         now called proggie.dbg and it's a binary file.
13590
13591 2002-08-23  Martin Baulig  <martin@gnome.org>
13592
13593         * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
13594
13595 2002-08-23  Martin Baulig  <martin@gnome.org>
13596
13597         * struct.cs (MyStructInfo.ctor): Make this work with empty
13598         structs; it's not allowed to use foreach() on null.
13599
13600 2002-08-23  Martin Baulig  <martin@gnome.org>
13601
13602         * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
13603         writer the full pathname of the generated assembly.
13604
13605 2002-08-23  Martin Baulig  <martin@gnome.org>
13606
13607         * statements.cs (FlowBranching.UsageVector.MergeChildren):
13608         A `finally' block never returns or breaks; improved handling of
13609         unreachable code.
13610
13611 2002-08-23  Martin Baulig  <martin@gnome.org>
13612
13613         * statement.cs (Throw.Resolve): Allow `throw null'.
13614
13615 2002-08-23  Martin Baulig  <martin@gnome.org>
13616
13617         * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
13618         EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
13619         `ee.EventInfo.DeclaringType == ec.ContainerType'.  The
13620         MemberLookup would return a wrong event if this is an explicit
13621         interface implementation and the class has an event with the same
13622         name.
13623
13624 2002-08-23  Martin Baulig  <martin@gnome.org>
13625
13626         * statement.cs (Block.AddChildVariableNames): New public method.
13627         (Block.AddChildVariableName): Likewise.
13628         (Block.IsVariableNameUsedInChildBlock): Likewise.
13629         (Block.AddVariable): Check whether a variable name has already
13630         been used in a child block.
13631
13632         * cs-parser.jay (declare_local_variables): Mark all variable names
13633         from the current block as being used in a child block in the
13634         implicit block.
13635
13636 2002-08-23  Martin Baulig  <martin@gnome.org>
13637
13638         * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
13639         find the symbol writer.
13640
13641         * driver.cs: csc also allows the arguments to /define being
13642         separated by commas, not only by semicolons.
13643
13644 2002-08-23  Martin Baulig  <martin@gnome.org>
13645
13646         * interface.cs (Interface.GetMembers): Added static check for events.
13647
13648 2002-08-15  Martin Baulig  <martin@gnome.org>
13649
13650         * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
13651         call, use ec.ContainerType.BaseType as queried_type and invocation_type.
13652
13653         * ecore.cs (Expression.MemberLookup): Added documentation and explained
13654         why the MethodData.EmitDestructor() change was necessary.
13655
13656 2002-08-20  Martin Baulig  <martin@gnome.org>
13657
13658         * class.cs (TypeContainer.FindMembers): Added static check for events.
13659
13660         * decl.cs (MemberCache.AddMembers): Handle events like normal members.
13661
13662         * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
13663         use Type.GetEvents(), not Type.FindMembers().
13664
13665 2002-08-20  Martin Baulig  <martin@gnome.org>
13666
13667         * decl.cs (MemberCache): Added a special method cache which will
13668         be used for method-only searched.  This ensures that a method
13669         search will return a MethodInfo with the correct ReflectedType for
13670         inherited methods.      
13671
13672 2002-08-20  Martin Baulig  <martin@gnome.org>
13673
13674         * decl.cs (DeclSpace.FindMembers): Made this public.
13675
13676 2002-08-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13677
13678         * delegate.cs: fixed build on windows.
13679         [FIXME:  Filed as bug #29150: MCS must report these errors.]
13680
13681 2002-08-19  Ravi Pratap  <ravi@ximian.com>
13682
13683         * ecore.cs (StandardConversionExists): Return a false
13684         if we are trying to convert the void type to anything else
13685         since that is not allowed.
13686
13687         * delegate.cs (DelegateInvocation.DoResolve): Ensure that
13688         we flag error 70 in the event an event is trying to be accessed
13689         directly from outside the declaring type.
13690
13691 2002-08-20  Martin Baulig  <martin@gnome.org>
13692
13693         * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
13694         MemberCache from typemanager.cs to decl.cs.
13695
13696 2002-08-19  Martin Baulig  <martin@gnome.org>
13697
13698         * class.cs (TypeContainer): Implement IMemberContainer.
13699         (TypeContainer.DefineMembers): Create the MemberCache.
13700         (TypeContainer.FindMembers): Do better BindingFlags checking; only
13701         return public members if BindingFlags.Public was given, check
13702         whether members are static.
13703
13704 2002-08-16  Martin Baulig  <martin@gnome.org>
13705
13706         * decl.cs (DeclSpace.Define): Splitted this in Define and
13707         DefineMembers.  DefineMembers is called first and initializes the
13708         MemberCache.
13709
13710         * rootcontext.cs (RootContext.DefineMembers): New function.  Calls
13711         DefineMembers() on all our DeclSpaces.
13712
13713         * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
13714         but call DefineMembers() on all nested interfaces.  We call their
13715         Define() in our new Define() function.
13716
13717         * interface.cs (Interface): Implement IMemberContainer.
13718         (Interface.Define): Moved all code except the attribute stuf to
13719         DefineMembers().
13720         (Interface.DefineMembers): Initialize the member cache.
13721
13722         * typemanager.cs (IMemberFinder): Removed this interface, we don't
13723         need this anymore since we can use MemberCache.FindMembers directly.
13724
13725 2002-08-19  Martin Baulig  <martin@gnome.org>
13726
13727         * typemanager.cs (MemberCache): When creating the cache for an
13728         interface type, add all inherited members.
13729         (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
13730         to `out bool used_cache' and documented it.
13731         (TypeManager.MemberLookup): If we already used the cache in the first
13732         iteration, we don't need to do the interfaces check.
13733
13734 2002-08-19  Martin Baulig  <martin@gnome.org>
13735
13736         * decl.cs (DeclSpace.FindMembers): New abstract method.  Moved this
13737         here from IMemberFinder and don't implement this interface anymore.
13738         (DeclSpace.MemberCache): Moved here from IMemberFinder.
13739
13740         * typemanager.cs (IMemberFinder): This interface is now only used by
13741         classes which actually support the member cache.
13742         (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
13743         since we only put DeclSpaces into this Hashtable.
13744         (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
13745         a dynamic type and TypeHandle.GetTypeHandle() otherwise.
13746
13747 2002-08-16  Martin Baulig  <martin@gnome.org>
13748
13749         * typemanager.cs (ICachingMemberFinder): Removed.
13750         (IMemberFinder.MemberCache): New property.
13751         (TypeManager.FindMembers): Merged this with RealFindMembers().
13752         This function will never be called from TypeManager.MemberLookup()
13753         so we can't use the cache here, just the IMemberFinder.
13754         (TypeManager.MemberLookup_FindMembers): Check whether the
13755         IMemberFinder has a MemberCache and call the cache's FindMembers
13756         function.
13757         (MemberCache): Rewrote larger parts of this yet another time and
13758         cleaned it up a bit.
13759
13760 2002-08-15  Miguel de Icaza  <miguel@ximian.com>
13761
13762         * driver.cs (LoadArgs): Support quoting.
13763
13764         (Usage): Show the CSC-like command line arguments.
13765
13766         Improved a few error messages.
13767
13768 2002-08-15  Martin Baulig  <martin@gnome.org>
13769
13770         * typemanager.cs (IMemberContainer.Type): New property.
13771         (IMemberContainer.IsInterface): New property.
13772
13773         The following changes are conditional to BROKEN_RUNTIME, which is
13774         defined at the top of the file.
13775
13776         * typemanager.cs (MemberCache.MemberCache): Don't add the base
13777         class'es members, but add all members from TypeHandle.ObjectType
13778         if we're an interface.
13779         (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
13780         is the current type.
13781         (MemberCache.CacheEntry.Container): Removed this field.
13782         (TypeHandle.GetMembers): Include inherited members.
13783
13784 2002-08-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13785
13786         * typemanager.cs: fixed compilation and added a comment on a field that
13787         is never used.
13788
13789 2002-08-15  Martin Baulig  <martin@gnome.org>
13790
13791         * class.cs (ConstructorInitializer.Resolve): In the
13792         Expression.MemberLookup call, use the queried_type as
13793         invocation_type.
13794
13795         * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
13796         declared' attribute, it's always true.
13797         (IMemberContainer.Parent, IMemberContainer.Name): New properties.
13798         (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
13799         temporary wrapper for FindMembers which tells MemberLookup whether
13800         members from the base classes are included in the return value.
13801         This will go away soon.
13802         (TypeManager.MemberLookup): Use this temporary hack here; once the
13803         new MemberCache is completed, we don't need to do the DeclaredOnly
13804         looping here anymore since the MemberCache will take care of this.
13805         (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
13806         (MemberCache): When creating the MemberCache for a class, get
13807         members from the current class and all its base classes.
13808         (MemberCache.CacheEntry.Container): New field.  This is a
13809         temporary hack until the Mono runtime is fixed to distinguish
13810         between ReflectedType and DeclaringType.  It allows us to use MCS
13811         with both the MS runtime and the unfixed Mono runtime without
13812         problems and without accecting performance.
13813         (MemberCache.SearchMembers): The DeclaredOnly looping from
13814         TypeManager.MemberLookup is now done here.      
13815
13816 2002-08-14  Martin Baulig  <martin@gnome.org>
13817
13818         * statement.cs (MyStructInfo.MyStructInfo): Don't call
13819         Type.GetFields on dynamic types but get the fields from the
13820         corresponding TypeContainer.
13821         (MyStructInfo.GetStructInfo): Added check for enum types.
13822
13823         * typemanager.cs (MemberList.IsSynchronized): Implemented.
13824         (MemberList.SyncRoot): Implemented.
13825         (TypeManager.FilterWithClosure): No need to check permissions if
13826         closure_start_type == closure_invocation_type, don't crash if
13827         closure_invocation_type is null.
13828
13829 2002-08-13  Martin Baulig  <martin@gnome.org>
13830
13831         Rewrote TypeContainer.FindMembers to use a member cache.  This
13832         gives us a speed increase of about 35% for the self-hosting MCS
13833         build and of about 15-20% for the class libs (both on GNU/Linux).
13834
13835         * report.cs (Timer): New class to get enhanced profiling.  This
13836         whole class is "TIMER" conditional since it remarkably slows down
13837         compilation speed.
13838
13839         * class.cs (MemberList): New class.  This is an IList wrapper
13840         which we're now using instead of passing MemberInfo[]'s around to
13841         avoid copying this array unnecessarily.
13842         (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
13843         (ICachingMemberFinder, IMemberContainer): New interface.
13844         (TypeManager.FilterWithClosure): If `criteria' is null, the name
13845         has already been checked, otherwise use it for the name comparision.
13846         (TypeManager.FindMembers): Renamed to RealMemberFinder and
13847         provided wrapper which tries to use ICachingMemberFinder.FindMembers
13848         if possible.  Returns a MemberList, not a MemberInfo [].
13849         (TypeHandle): New class, implements IMemberContainer.  We create
13850         one instance of this class per type, it contains a MemberCache
13851         which is used to do the member lookups.
13852         (MemberCache): New class.  Each instance of this class contains
13853         all members of a type and a name-based hash table.
13854         (MemberCache.FindMembers): This is our new member lookup
13855         function.  First, it looks up all members of the requested name in
13856         the hash table.  Then, it walks this list and sorts out all
13857         applicable members and returns them.
13858
13859 2002-08-13  Martin Baulig  <martin@gnome.org>
13860
13861         In addition to a nice code cleanup, this gives us a performance
13862         increase of about 1.4% on GNU/Linux - not much, but it's already
13863         half a second for the self-hosting MCS compilation.
13864
13865         * typemanager.cs (IMemberFinder): New interface.  It is used by
13866         TypeManager.FindMembers to call FindMembers on a TypeContainer,
13867         Enum, Delegate or Interface.
13868         (TypeManager.finder_to_member_finder): New PtrHashtable.
13869         (TypeManager.finder_to_container): Removed.
13870         (TypeManager.finder_to_delegate): Removed.
13871         (TypeManager.finder_to_interface): Removed.
13872         (TypeManager.finder_to_enum): Removed.
13873
13874         * interface.cs (Interface): Implement IMemberFinder.
13875
13876         * delegate.cs (Delegate): Implement IMemberFinder.
13877
13878         * enum.cs (Enum): Implement IMemberFinder.
13879
13880         * class.cs (TypeContainer): Implement IMemberFinder.
13881
13882 2002-08-12  Martin Baulig  <martin@gnome.org>
13883
13884         * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
13885
13886 2002-08-12  Martin Baulig  <martin@gnome.org>
13887
13888         * ecore.cs (ITypeExpression): New interface for expressions which
13889         resolve to a type.
13890         (TypeExpression): Renamed to TypeLookupExpression.
13891         (Expression.DoResolve): If we're doing a types-only lookup, the
13892         expression must implement the ITypeExpression interface and we
13893         call DoResolveType() on it.
13894         (SimpleName): Implement the new ITypeExpression interface.
13895         (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
13896         hack, the situation that we're only looking up types can't happen
13897         anymore when this method is called.  Moved the type lookup code to
13898         DoResolveType() and call it.
13899         (SimpleName.DoResolveType): This ITypeExpression interface method
13900         is now doing the types-only lookup.
13901         (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
13902         (ResolveFlags): Added MaskExprClass.
13903
13904         * expression.cs (MemberAccess): Implement the ITypeExpression
13905         interface.
13906         (MemberAccess.DoResolve): Added support for a types-only lookup
13907         when we're called via ITypeExpression.DoResolveType().
13908         (ComposedCast): Implement the ITypeExpression interface.
13909
13910         * codegen.cs (EmitContext.OnlyLookupTypes): Removed.  Call
13911         Expression.Resolve() with ResolveFlags.Type instead.
13912
13913 2002-08-12  Martin Baulig  <martin@gnome.org>
13914
13915         * interface.cs (Interface.Define): Apply attributes.
13916
13917         * attribute.cs (Attribute.ApplyAttributes): Added support for
13918         interface attributes.
13919
13920 2002-08-11  Martin Baulig  <martin@gnome.org>
13921
13922         * statement.cs (Block.Emit): Only check the "this" variable if we
13923         do not always throw an exception.
13924
13925         * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
13926         whether the property has a set accessor.
13927
13928 2002-08-11  Martin Baulig  <martin@gnome.org>
13929
13930         Added control flow analysis support for structs.
13931
13932         * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
13933         with control flow analysis turned off.
13934         (IVariable): New interface.
13935         (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
13936         returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
13937         (FieldExpr.DoResolve): Resolve the instance expression with flow
13938         analysis turned off and do the definite assignment check after the
13939         resolving when we know what the expression will resolve to.
13940
13941         * expression.cs (LocalVariableReference, ParameterReference):
13942         Implement the new IVariable interface, only call the flow analysis
13943         code if ec.DoFlowAnalysis is true.
13944         (This): Added constructor which takes a Block argument.  Implement
13945         the new IVariable interface.
13946         (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
13947         DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
13948         This does the definite assignment checks for struct members.
13949
13950         * class.cs (Constructor.Emit): If this is a non-static `struct'
13951         constructor which doesn't have any initializer, call
13952         Block.AddThisVariable() to tell the flow analysis code that all
13953         struct elements must be initialized before control returns from
13954         the constructor.
13955
13956         * statement.cs (MyStructInfo): New public class.
13957         (UsageVector.this [VariableInfo vi]): Added `int field_idx'
13958         argument to this indexer.  If non-zero, check an individual struct
13959         member, not the whole struct.
13960         (FlowBranching.CheckOutParameters): Check struct members.
13961         (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
13962         overloaded versions of these methods which take an additional
13963         `int field_idx' argument to check struct members.
13964         (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
13965         overloaded versions of these methods which take an additional
13966         `string field_name' argument to check struct member.s
13967         (VariableInfo): Implement the IVariable interface.
13968         (VariableInfo.StructInfo): New public property.  Returns the
13969         MyStructInfo instance of the variable if it's a struct or null.
13970         (Block.AddThisVariable): New public method.  This is called from
13971         Constructor.Emit() for non-static `struct' constructor which do
13972         not have any initializer.  It creates a special variable for the
13973         "this" instance variable which will be checked by the flow
13974         analysis code to ensure that all of the struct's fields are
13975         initialized before control returns from the constructor.
13976         (UsageVector): Added support for struct members.  If a
13977         variable/parameter is a struct with N members, we reserve a slot
13978         in the usage vector for each member.  A struct is considered fully
13979         initialized if either the struct itself (slot 0) or all its
13980         members are initialized.
13981
13982 2002-08-08  Martin Baulig  <martin@gnome.org>
13983
13984         * driver.cs (Driver.MainDriver): Only report an error CS5001
13985         if there were no compilation errors.
13986
13987         * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
13988         `UnsafeContext' property to determine whether the parent is in
13989         unsafe context rather than checking the parent's ModFlags:
13990         classes nested in an unsafe class are unsafe as well.
13991
13992 2002-08-08  Martin Baulig  <martin@gnome.org>
13993
13994         * statement.cs (UsageVector.MergeChildren): Distinguish between
13995         `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
13996         we return.  Added test17() and test18() to test-154.cs.
13997
13998 2002-08-08  Martin Baulig  <martin@gnome.org>
13999
14000         * typemanager.cs (TypeManager.FilterWithClosure): If we have
14001         Family access, make sure the invoking type isn't a subclass of the
14002         queried type (that'd be a CS1540).
14003
14004         * ecore.cs (Expression.MemberLookup): Added overloaded version of
14005         this method which takes an additional `Type invocation_type'.
14006
14007         * expression.cs (BaseAccess.DoResolve): Use the base type as
14008         invocation and query type.
14009         (MemberAccess.DoResolve): If the lookup failed and we're about to
14010         report a CS0122, try a lookup with the ec.ContainerType - if this
14011         succeeds, we must report a CS1540.
14012
14013 2002-08-08  Martin Baulig  <martin@gnome.org>
14014
14015         * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
14016         (MethodGroupExpr): Implement the IMemberExpr interface.
14017
14018         * expression (MemberAccess.ResolveMemberAccess): No need to have
14019         any special code for MethodGroupExprs anymore, they're now
14020         IMemberExprs.   
14021
14022 2002-08-08  Martin Baulig  <martin@gnome.org>
14023
14024         * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
14025         Family, FamANDAssem and FamORAssem permissions.
14026         (TypeManager.IsSubclassOrNestedChildOf): New public method.
14027
14028 2002-08-08  Martin Baulig  <martin@gnome.org>
14029
14030         * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
14031         (UsageVector.MergeChildren): `break' breaks unless we're in a switch
14032         or loop block.
14033
14034 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
14035
14036         * driver.cs: implemented /resource option to embed managed resources.
14037
14038 2002-08-07  Martin Baulig  <martin@gnome.org>
14039
14040         * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
14041         (FieldBase.HasFieldInitializer): New public property.
14042         (FieldBase.GetInitializerExpression): New public method.  Resolves and
14043         returns the field initializer and makes sure it is only resolved once.
14044         (TypeContainer.EmitFieldInitializers): Call
14045         FieldBase.GetInitializerExpression to get the initializer, this ensures
14046         that it isn't resolved multiple times.
14047
14048         * codegen.cs (EmitContext): Added `bool IsFieldInitialier'.  This tells
14049         the resolving process (SimpleName/MemberLookup) that we're currently
14050         emitting a field initializer (which must not access any instance members,
14051         this is an error CS0236).
14052
14053         * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
14054         argument, if the `IsFieldInitializer' flag is set, we must report and
14055         error CS0236 and not an error CS0120.   
14056
14057 2002-08-07  Martin Baulig  <martin@gnome.org>
14058
14059         * ecore.cs (IMemberExpr): New public interface.
14060         (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
14061         (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
14062         if the expression is an IMemberExpr.
14063
14064         * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
14065         to be null, implicitly default to `this' if we're non-static in
14066         this case.  Simplified the code a lot by using the new IMemberExpr
14067         interface.  Also fixed bug #28176 here.
14068
14069 2002-08-06  Martin Baulig  <martin@gnome.org>
14070
14071         * cs-parser.jay (SimpleLookup): Removed.  We need to create
14072         ParameterReferences during semantic analysis so that we can do a
14073         type-only search when resolving Cast, TypeOf and SizeOf.
14074         (block): Pass the `current_local_parameters' to the Block's
14075         constructor.
14076
14077         * class.cs (ConstructorInitializer): Added `Parameters parameters'
14078         argument to the constructor.
14079         (ConstructorInitializer.Resolve): Create a temporary implicit
14080         block with the parameters.
14081
14082         * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
14083         references here if we aren't doing a type-only search.
14084
14085         * statement.cs (Block): Added constructor which takes a
14086         `Parameters parameters' argument.
14087         (Block.Parameters): New public property.
14088
14089         * support.cs (InternalParameters.Parameters): Renamed `parameters'
14090         to `Parameters' and made it public readonly.
14091
14092 2002-08-06  Martin Baulig  <martin@gnome.org>
14093
14094         * ecore.cs (Expression.Warning): Made this public as well.
14095
14096         * report.cs (Report.Debug): Print the contents of collections.
14097
14098 2002-08-06  Martin Baulig  <martin@gnome.org>
14099
14100         * ecore.cs (Expression.ResolveFlags): New [Flags] enum.  This is
14101         used to tell Resolve() which kinds of expressions it may return.
14102         (Expression.Resolve): Added overloaded version of this method which
14103         takes a `ResolveFlags flags' argument.  This can be used to tell
14104         Resolve() which kinds of expressions it may return.  Reports a
14105         CS0118 on error.
14106         (Expression.ResolveWithSimpleName): Removed, use Resolve() with
14107         ResolveFlags.SimpleName.
14108         (Expression.Error118): Added overloaded version of this method which
14109         takes a `ResolveFlags flags' argument.  It uses the flags to determine
14110         which kinds of expressions are allowed.
14111
14112         * expression.cs (Argument.ResolveMethodGroup): New public method.
14113         Resolves an argument, but allows a MethodGroup to be returned.
14114         This is used when invoking a delegate.
14115
14116         * TODO: Updated a bit.
14117
14118 2002-08-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14119
14120         Fixed compilation with csc.
14121
14122         * ecore.cs: Expression.Error made public. Is this correct? Should
14123         Warning be made public too?
14124
14125         * expression.cs: use ea.Location instead of ea.loc.
14126         [FIXME:  Filed as bug #28607: MCS must report these errors.]
14127
14128 2002-08-06  Martin Baulig  <martin@gnome.org>
14129
14130         * ecore.cs (Expression.loc): Moved the location here instead of
14131         duplicating it in all derived classes.
14132         (Expression.Location): New public property.
14133         (Expression.Error, Expression.Warning): Made them non-static and
14134         removed the location argument.
14135         (Expression.Warning): Added overloaded version which takes an
14136         `int level' argument.
14137         (Expression.Error118): Make this non-static and removed the
14138         expression and location arguments.
14139         (TypeExpr): Added location argument to the constructor.
14140
14141         * expression.cs (StaticCallExpr): Added location argument to
14142         the constructor.
14143         (Indirection, PointerArithmetic): Likewise.
14144         (CheckedExpr, UnCheckedExpr): Likewise.
14145         (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
14146         (StringPtr): Likewise.
14147
14148
14149 2002-08-05  Martin Baulig  <martin@gnome.org>
14150
14151         * expression.cs (BaseAccess.DoResolve): Actually report errors.
14152
14153         * assign.cs (Assign.DoResolve): Check whether the source
14154         expression is a value or variable.
14155
14156         * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
14157         while resolving the corresponding blocks.
14158
14159         * interface.cs (Interface.GetInterfaceTypeByName): Actually report
14160         an error, don't silently return null.
14161
14162         * statement.cs (Block.AddVariable): Do the error reporting here
14163         and distinguish between CS0128 and CS0136.
14164         (Block.DoResolve): Report all unused labels (warning CS0164).
14165         (LabeledStatement): Pass the location to the constructor.
14166         (LabeledStatement.HasBeenReferenced): New property.
14167         (LabeledStatement.Resolve): Set it to true here.
14168
14169         * statement.cs (Return.Emit): Return success even after reporting
14170         a type mismatch error (CS0126 or CS0127), this is what csc does and
14171         it avoids confusing the users with any consecutive errors.
14172
14173 2002-08-05  Martin Baulig  <martin@gnome.org>
14174
14175         * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
14176
14177         * const.cs (Const.LookupConstantValue): Catch circular definitions.
14178
14179         * expression.cs (MemberAccess.DoResolve): Silently return if an
14180         error has already been reported.
14181
14182         * ecore.cs (Expression.MemberLookupFinal): Silently return if an
14183         error has already been reported.
14184
14185 2002-08-05  Martin Baulig  <martin@gnome.org>
14186
14187         * statement.cs (UsageVector): Only initialize the `parameters'
14188         vector if we actually have any "out" parameters.
14189
14190 2002-08-05  Martin Baulig  <martin@gnome.org>
14191
14192         * expression.cs (Binary.ResolveOperator): When combining delegates,
14193         they must have the same type.
14194
14195 2002-08-05  Martin Baulig  <martin@gnome.org>
14196
14197         * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
14198         PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
14199         work with the ms runtime and we also don't need it: if we're a
14200         PropertyBuilder and not in the `indexer_arguments' hash, then we
14201         are a property and not an indexer.
14202
14203         * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
14204         Type.IsPointer and Type.IsByRef instead of Type.HasElementType
14205         since the latter one doesn't work with the ms runtime.
14206
14207 2002-08-03  Martin Baulig  <martin@gnome.org>
14208
14209         Fixed bugs #27998 and #22735.
14210
14211         * class.cs (Method.IsOperator): New public field.
14212         (Method.CheckBase): Report CS0111 if there's already a method
14213         with the same parameters in the current class.  Report CS0508 when
14214         attempting to change the return type of an inherited method.
14215         (MethodData.Emit): Report CS0179 if a method doesn't have a body
14216         and it's not marked abstract or extern.
14217         (PropertyBase): New abstract base class for Property and Indexer.
14218         (PropertyBase.CheckBase): Moved here from Property and made it work
14219         for indexers.
14220         (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
14221         the same so we can reuse it there.
14222         (Property, Indexer): Derive from PropertyBase.
14223         (MethodSignature.inheritable_property_signature_filter): New delegate
14224         to find properties and indexers.
14225
14226         * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
14227         argument and improved error reporting.
14228
14229         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
14230         EmptyReadOnlyParameters and made it a property.
14231
14232         * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
14233         version of this method which takes a `PropertyInfo indexer'.
14234         (TypeManager.RegisterIndexer): New method.
14235
14236         * class.cs: Added myself as author of this file :-)
14237
14238 2002-08-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14239
14240         * class.cs: fixed compilation on windoze.
14241
14242 2002-08-03  Martin Baulig  <martin@gnome.org>
14243
14244         * interface.cs (Interface.GetInterfaceBases): Check whether all
14245         base interfaces are at least as accessible than the current one.
14246
14247         * class.cs (TypeContainer.GetClassBases): Check whether base types
14248         are at least as accessible than the current type.
14249         (TypeContainer.AsAccessible): Implemented and made non-static.
14250         (MemberBase.CheckParameters): Report errors if the accessibility
14251         checks fail.
14252
14253         * delegate.cs (Delegate.Delegate): The default visibility is
14254         internal for top-level types and private for nested types.
14255         (Delegate.Define): Report errors if the accessibility checks fail.
14256
14257         * enum.cs (Enum.Enum): The default visibility is internal for
14258         top-level types and private for nested types.
14259         (Enum.DefineType): Compute the correct visibility.
14260
14261         * modifiers.cs (Modifiers.TypeAttr): Added a version of this
14262         function which takes a `bool is_toplevel' instead of a TypeContainer.
14263
14264         * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
14265         builtin type.
14266
14267 2002-08-02  Martin Baulig  <martin@gnome.org>
14268
14269         * expression.cs (LocalVariableReferenc): Added constructor which
14270         takes additional `VariableInfo vi' and `bool is_readonly' arguments.
14271         (LocalVariableReference.IsReadOnly): New property.
14272         (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
14273         variable is readonly, use our own readonly flag to do this; you can
14274         use the new constructor to get a writable reference to a read-only
14275         variable.
14276
14277         * cs-parser.jay (foreach_statement, using_statement): Get a writable
14278         reference to the local variable.
14279
14280 2002-08-01  Miguel de Icaza  <miguel@ximian.com>
14281
14282         * rootcontext.cs (ResolveCore): Also include System.Exception
14283
14284         * statement.cs (Block.Emit): Do not emit the dead-code warnings if
14285         we reach an EmptyStatement.
14286
14287         (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
14288         is also fine.
14289
14290         * expression.cs (Binary.ResolveOperator): Check error result in
14291         two places.
14292
14293         use brtrue/brfalse directly and avoid compares to null.
14294
14295 2002-08-02  Martin Baulig  <martin@gnome.org>
14296
14297         * class.cs (TypeContainer.Define): Define all nested interfaces here.
14298         Fixes bug #28407, added test-155.cs.
14299
14300 2002-08-01  Martin Baulig  <martin@gnome.org>
14301
14302         * class.cs (Event.EmitDefaultMethod): Make this work with static
14303         events.  Fixes #28311, added verify-3.cs.
14304
14305 2002-08-01  Martin Baulig  <martin@gnome.org>
14306
14307         * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
14308         `is_disposable' fields.
14309         (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
14310         `hm.is_disposable' if we're using the collection pattern.
14311         (Foreach.EmitCollectionForeach): Use the correct type for the
14312         enumerator's local variable, only emit the try/finally block if
14313         necessary (fixes #27713).
14314
14315 2002-08-01  Martin Baulig  <martin@gnome.org>
14316
14317         * ecore.cs (Expression.report118): Renamed to Error118 and made
14318         it public static.
14319
14320         * statement.cs (Throw.Resolve): Check whether the expression is of
14321         the correct type (CS0118) and whether the type derives from
14322         System.Exception (CS0155).
14323         (Catch.Resolve): New method.  Do the type lookup here and check
14324         whether it derives from System.Exception (CS0155).
14325         (Catch.CatchType, Catch.IsGeneral): New public properties.
14326
14327         * typemanager.cs (TypeManager.exception_type): Added.
14328
14329 2002-07-31  Miguel de Icaza  <miguel@ximian.com>
14330
14331         * driver.cs: Updated About function.
14332
14333 2002-07-31  Martin Baulig  <martin@gnome.org>
14334
14335         Implemented Control Flow Analysis.
14336
14337         * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
14338         (EmitContext.CurrentBranching): Added.
14339         (EmitContext.StartFlowBranching): Added.
14340         (EmitContext.EndFlowBranching): Added.
14341         (EmitContext.KillFlowBranching): Added.
14342         (EmitContext.IsVariableAssigned): Added.
14343         (EmitContext.SetVariableAssigned): Added.
14344         (EmitContext.IsParameterAssigned): Added.
14345         (EmitContext.SetParameterAssigned): Added.
14346         (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
14347         Added control flow analysis stuff here.
14348
14349         * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
14350         resolve the expression as lvalue.
14351         (LocalVariableReference.DoResolve): Check whether the variable has
14352         already been assigned.
14353         (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
14354         the parameter as assigned here.
14355         (ParameterReference.DoResolve): Check whether the parameter has already
14356         been assigned.
14357         (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
14358         expression as lvalue.
14359
14360         * statement.cs (FlowBranching): New class for the flow analysis code.
14361         (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
14362         (LabeledStatement.IsDefined): New public property.
14363         (LabeledStatement.AddUsageVector): New public method to tell flow
14364         analyis that the label may be reached via a forward jump.
14365         (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
14366         flow analysis.
14367         (VariableInfo.Number): New public field.  This is used by flow analysis
14368         to number all locals of a block.
14369         (Block.CountVariables): New public property.  This is the number of
14370         local variables in this block (including the locals from all parent
14371         blocks).
14372         (Block.EmitMeta): Number all the variables.
14373
14374         * statement.cs: Added flow analysis support to all classes.
14375
14376 2002-07-31  Martin Baulig  <martin@gnome.org>
14377
14378         * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
14379         To get debugging messages, compile mcs with /define:MCS_DEBUG and
14380         then use this argument.
14381
14382         * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
14383
14384         * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
14385         use this to specify /define options.
14386
14387 2002-07-29  Martin Baulig  <martin@gnome.org>
14388
14389         * statement.cs (Fixed): Moved all code that does variable lookups
14390         and resolvings from Emit to Resolve.
14391
14392         * statement.cs (For): Moved all code that does variable lookups
14393         and resolvings from Emit to Resolve.
14394
14395         * statement.cs (Using): Moved all code that does variable lookups
14396         and resolvings from Emit to Resolve.
14397
14398 2002-07-29  Martin Baulig  <martin@gnome.org>
14399
14400         * attribute.cs (Attribute.Resolve): Explicitly catch a
14401         System.NullReferenceException when creating the
14402         CustromAttributeBuilder and report a different warning message.
14403
14404 2002-07-29  Martin Baulig  <martin@gnome.org>
14405
14406         * support.cs (ParameterData.ParameterName): Added method to
14407         get the name of a parameter.
14408
14409         * typemanager.cs (TypeManager.IsValueType): New public method.
14410
14411 2002-07-29  Martin Baulig  <martin@gnome.org>
14412
14413         * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'.  This
14414         is a flag which specifies that it's either ref or out.
14415         (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
14416         the out parameter to `out Parameter.Modifier mod', also set the
14417         Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
14418
14419         * support.cs (InternalParameters.ParameterModifier): Distinguish
14420         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
14421         Parameter.Modifier.ISBYREF flag if it's either ref or out.
14422
14423         * expression.cs (Argument.GetParameterModifier): Distinguish
14424         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
14425         Parameter.Modifier.ISBYREF flag if it's either ref or out.
14426
14427 2002-07-29  Martin Baulig  <martin@gnome.org>
14428
14429         * expression.cs (ParameterReference.ParameterReference): Added
14430         `Location loc' argument to the constructor.
14431
14432         * cs-parser.jay: Pass location to ParameterReference.
14433
14434 2002-07-28  Miguel de Icaza  <miguel@ximian.com>
14435
14436         * statement.cs (Try): Initialize the location.
14437
14438         * cs-parser.jay: pass location to Try.
14439
14440         * expression.cs (Unary.Reduce): Change the prototype to return
14441         whether a constant fold could be performed or not.  The result is
14442         returned in an out parameters.  In the case of Indirection and
14443         AddressOf, we want to perform the full tests.
14444
14445 2002-07-26  Miguel de Icaza  <miguel@ximian.com>
14446
14447         * statement.cs (Statement.Emit): Flag dead code.
14448
14449 2002-07-27  Andrew Birkett  <andy@nobugs.org>
14450
14451         * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
14452
14453 2002-07-27  Martin Baulig  <martin@gnome.org>
14454
14455         * class.cs (MethodData.Define): Put back call to
14456         TypeManager.AddMethod(), accidentally commented this out.
14457
14458         * report.cs (Debug): New public method to print debugging information,
14459         this is `[Conditional ("DEBUG")]'.
14460
14461 2002-07-26  Martin Baulig  <martin@gnome.org>
14462
14463         * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
14464         (switch_statement): Push the current_block to the switch_stack and
14465         pop it again when we're done with the switch.
14466         (switch_section): The new block is a child of the current_block.
14467         Fixes bug #24007, added test-152.cs.
14468
14469 2002-07-27  Martin Baulig  <martin@gnome.org>
14470
14471         * expression.cs (Invocation.EmitArguments): When calling a varargs
14472         function with only its fixed arguments, we need to pass an empty
14473         array.
14474
14475 2002-07-27  Martin Baulig  <martin@gnome.org>
14476
14477         Mono 0.13 has been released.
14478
14479 2002-07-25  Miguel de Icaza  <miguel@ximian.com>
14480
14481         * driver.cs: Rename --resource to --linkres, because that is what
14482         we do currently, we dont support --resource yet.
14483
14484         * cs-tokenizer.cs: Fix test for reporting endif mismatches.
14485
14486 2002-07-25  Martin Baulig  <martin@gnome.org>
14487
14488         * class.cs (MethodData): New public class.  This is a `method builder'
14489         class for a method or one accessor of a Property/Indexer/Event.
14490         (MethodData.GetMethodFlags): Moved here from MemberBase.
14491         (MethodData.ApplyAttributes): Likewise.
14492         (MethodData.ApplyObsoleteAttribute): Likewise.
14493         (MethodData.ApplyConditionalAttribute): Likewise.
14494         (MethodData.ApplyDllImportAttribute): Likewise.
14495         (MethodData.CheckAbstractAndExternal): Likewise.
14496         (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
14497         (MethodData.Emit): Formerly known as Method.Emit().
14498         (MemberBase): Moved everything which was specific to a single
14499         accessor/method to MethodData.
14500         (Method): Create a new MethodData and call Define() and Emit() on it.
14501         (Property, Indexer, Event): Create a new MethodData objects for each
14502         accessor and call Define() and Emit() on them.
14503
14504 2002-07-25  Martin Baulig  <martin@gnome.org>
14505
14506         Made MethodCore derive from MemberBase to reuse the code from there.
14507         MemberBase now also checks for attributes.
14508
14509         * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
14510         (MemberBase.GetMethodFlags): Moved here from class Method and marked
14511         as virtual.
14512         (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
14513         `CallingConventions cc' and `Attributes opt_attrs' arguments.
14514         (MemberBase.ApplyAttributes): New virtual method; applies the
14515         attributes to a method or accessor.
14516         (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
14517         (MemberBase.ApplyConditionalAttribute): Likewise.
14518         (MemberBase.ApplyDllImportAttribute): Likewise.
14519         (MemberBase.CheckAbstractAndExternal): Likewise.
14520         (MethodCore.ParameterTypes): This is now a property instead of a
14521         method, it's initialized from DoDefineParameters().
14522         (MethodCore.ParameterInfo): Removed the set accessor.
14523         (MethodCore.DoDefineParameters): New protected virtual method to
14524         initialize ParameterTypes and ParameterInfo.
14525         (Method.GetReturnType): We can now simply return the MemberType.
14526         (Method.GetMethodFlags): Override the MemberBase version and add
14527         the conditional flags.
14528         (Method.CheckBase): Moved some code from Define() here, call
14529         DoDefineParameters() here.
14530         (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
14531         here to avoid some larger code duplication.
14532         (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
14533         ensure that abstract and external accessors don't declare a body.
14534
14535         * attribute.cs (Attribute.GetValidPieces): Make this actually work:
14536         `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
14537         lookup in the attribute's parent classes, so we need to abort as soon
14538         as we found the first match.
14539         (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
14540         the attribute has no arguments.
14541
14542         * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
14543         of a Method.
14544
14545 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14546
14547         * cs-parser.jay: reverted previous patch.
14548
14549 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14550
14551         * cs-parser.jay: fixed bug #22119.
14552
14553 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14554
14555         * attribute.cs: fixed compilation. The error was:
14556         "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must 
14557         be assigned to before control leaves the current method."
14558         [FIXME:  Filed as bug #28186: MCS must report this error.]
14559
14560 2002-07-25  Martin Baulig  <martin@gnome.org>
14561
14562         * attribute.cs (Attribute.Conditional_GetConditionName): New static
14563         method to pull the condition name ouf of a Conditional attribute.
14564         (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
14565         the obsolete message and error flag out of an Obsolete attribute.
14566
14567         * class.cs (Method.GetMethodFlags): New public method to get the
14568         TypeManager.MethodFlags for this method.
14569         (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
14570         private methods.
14571         (Method.Define): Get and apply the Obsolete and Conditional attributes;
14572         if we're overriding a virtual function, set the new private variable
14573         `parent_method'; call the new TypeManager.AddMethod().
14574
14575         * typemanager.cs (TypeManager.AddMethod): New static method.  Stores
14576         the MethodBuilder and the Method in a PtrHashtable.
14577         (TypeManager.builder_to_method): Added for this purpose.
14578         (TypeManager.MethodFlags): Added IsObsoleteError.
14579         (TypeManager.GetMethodFlags): Added `Location loc' argument.  Lookup
14580         Obsolete and Conditional arguments in MethodBuilders.  If we discover
14581         an Obsolete attribute, emit an appropriate warning 618 / error 619 with
14582         the message from the attribute.
14583
14584 2002-07-24  Martin Baulig  <martin@gnome.org>
14585
14586         * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
14587         preprocessor directives, ensure that the argument to #define/#undef is
14588         exactly one identifier and that it's actually an identifier.
14589
14590         Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
14591         did not work ....
14592
14593 2002-07-24  Martin Baulig  <martin@gnome.org>
14594
14595         * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
14596         initialize it to TypeManager.object_type in the constructor.
14597         (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
14598         of the `hm.get_current' method if we're using the collection pattern.
14599         (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
14600         for the explicit conversion to make it work when we're using the collection
14601         pattern and the `Current' property has a different return type than `object'.
14602         Fixes #27713.
14603
14604 2002-07-24  Martin Baulig  <martin@gnome.org>
14605
14606         * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
14607         does not match, but don't report any errors.  This method is called in
14608         order for all methods in a MethodGroupExpr until a matching method is
14609         found, so we don't want to bail out if the first method doesn't match.
14610         (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
14611         matches, report the 123.  Fixes #28070.
14612
14613 2002-07-24  Martin Baulig  <martin@gnome.org>
14614
14615         * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
14616         TypeManager.TypeToCoreType() to the top of the method so the
14617         following equality checks will work.  Fixes #28107.
14618
14619 2002-07-24  Martin Baulig  <martin@gnome.org>
14620
14621         * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
14622         operand is of type uint, and the other operand is of type sbyte,
14623         short or int, the operands are converted to type long." -
14624         Actually do what this comment already told us.  Fixes bug #28106,
14625         added test-150.cs.
14626
14627 2002-07-24  Martin Baulig  <martin@gnome.org>
14628
14629         * class.cs (MethodBase): New abstract class.  This is now a base
14630         class for Property, Indexer and Event to avoid some code duplication
14631         in their Define() and DefineMethods() methods.
14632         (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
14633         generic methods for Define() and DefineMethods().
14634         (FieldBase): Derive from MemberBase, not MemberCore.
14635         (Property): Derive from MemberBase, not MemberCore.
14636         (Property.DefineMethod): Moved all the code from this method to the
14637         new MethodBase.DefineAccessor(), just call it with appropriate
14638         argumetnts.
14639         (Property.Define): Call the new Property.DoDefine(), this does some
14640         sanity checks and we don't need to duplicate the code everywhere.
14641         (Event): Derive from MemberBase, not MemberCore.
14642         (Event.Define): Use the new MethodBase.DefineAccessor() to define the
14643         accessors, this will also make them work with interface events.
14644         (Indexer): Derive from MemberBase, not MemberCore.
14645         (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
14646         (Indexer.Define): Use the new MethodBase functions.
14647
14648         * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
14649         argument to the constructor.
14650         (Interface.FindMembers): Added support for interface events.
14651         (Interface.PopluateEvent): Implemented.
14652
14653         Added test-149.cs for this.  This also fixes bugs #26067 and #24256.
14654
14655 2002-07-22  Miguel de Icaza  <miguel@ximian.com>
14656
14657         * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
14658         but this is required to check for a method name being the same as
14659         the containing class.  
14660
14661         Handle this now.
14662
14663 2002-07-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14664
14665         * interface.cs: initialize variable.
14666
14667 2002-07-23  Martin Baulig  <martin@gnome.org>
14668
14669         Implemented the IndexerName attribute in interfaces.
14670
14671         * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
14672         name if this is an explicit interface implementation.
14673         (Indexer.InterfaceIndexerName): New public variable.  If we're
14674         implementing an interface indexer, this is the IndexerName in that
14675         interface.  Otherwise, it's the IndexerName.
14676         (Indexer.DefineMethod): If we're implementing interface indexer,
14677         set InterfaceIndexerName.  Use the new Pending.IsInterfaceIndexer
14678         and Pending.ImplementIndexer methods.
14679         (Indexer.Define): Also define the PropertyBuilder if we're
14680         implementing an interface indexer and this is neither an explicit
14681         interface implementation nor do the IndexerName match the one in
14682         the interface.
14683
14684         * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
14685         If a method is defined here, then we always need to create a proxy
14686         for it.  This is used when implementing interface indexers.
14687         (Pending.IsInterfaceIndexer): New public method.
14688         (Pending.ImplementIndexer): New public method.
14689         (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
14690         This is used when implementing interface indexers to define a proxy
14691         if necessary.
14692         (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
14693         define a proxy if necessary.
14694
14695         * interface.cs (Interface.IndexerName): New public variable.
14696         (Interface.PopulateIndexer): Set the IndexerName.
14697         (Interface.DefineIndexers): New private method.  Populate all the
14698         indexers and make sure their IndexerNames match.
14699
14700         * typemanager.cs (IndexerPropertyName): Added support for interface
14701         indexers.
14702
14703 2002-07-22  Martin Baulig  <martin@gnome.org>
14704
14705         * codegen.cs (EmitContext.HasReturnLabel): New public variable.
14706         (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
14707         ret if HasReturnLabel.
14708         (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
14709         variables.
14710
14711         * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
14712         and set the ec.LoopBeginTryCatchLevel.
14713         (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
14714         (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
14715         the current ec.TryCatchLevel, the branch goes out of an exception
14716         block.  In this case, we need to use Leave and not Br.
14717
14718 2002-07-22  Martin Baulig  <martin@gnome.org>
14719
14720         * statement.cs (Try.Emit): Emit an explicit ret after the end of the
14721         block unless the block does not always return or it is contained in
14722         another try { ... } catch { ... } block.  Fixes bug #26506.
14723         Added verify-1.cs to the test suite.
14724
14725 2002-07-22  Martin Baulig  <martin@gnome.org>
14726
14727         * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
14728         then we do not always return.  Fixes bug #24985.
14729
14730 2002-07-22  Martin Baulig  <martin@gnome.org>
14731
14732         * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
14733         lookup on a per-class level; ie. walk up the class hierarchy until we
14734         found at least one applicable method, then choose the best among them.
14735         Fixes bug #24463 and test-29.cs.
14736
14737 2002-07-22  Martin Baulig  <martin@gnome.org>
14738
14739         * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
14740         return types of the methods.  The return type is not part of the
14741         signature and we must not check it to make the `new' modifier work.
14742         Fixes bug #27999, also added test-147.cs.
14743         (TypeManager.TypeToCoreType): Added TypeManager.type_type.
14744
14745         * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
14746         on the method's return type.
14747
14748 2002-07-21  Martin Baulig  <martin@gnome.org>
14749
14750         * assign.cs: Make this work if the rightmost source is a constant and
14751         we need to do an implicit type conversion.  Also adding a few more tests
14752         to test-38.cs which should have caught this.
14753
14754         * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
14755         target in the makefile for this.  The makefile.gnu is primarily intended
14756         for end-users who don't want to debug the compiler.
14757
14758 2002-07-21  Martin Baulig  <martin@gnome.org>
14759
14760         * assign.cs: Improved the Assign class so it can now handle embedded
14761         assignments (X = Y = Z = something).  As a side-effect this'll now also
14762         consume less local variables.  test-38.cs now passes with MCS, added
14763         a few new test cases to that test.
14764
14765 2002-07-20  Martin Baulig  <martin@gnome.org>
14766
14767         * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
14768         instructions.  Fixes bug #27977, also added test-146.cs.
14769
14770 2002-07-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14771
14772         * cs-tokenizer.cs: fixed getHex ().
14773
14774 2002-07-19  Martin Baulig  <martin@gnome.org>
14775
14776         * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
14777         not Type.GetType() to lookup the array type.  This is needed when
14778         we're constructing an array of a user-defined type.
14779         (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
14780         single-dimensional arrays, but also for single-dimensial arrays of
14781         type decimal.
14782
14783 2002-07-19  Martin Baulig  <martin@gnome.org>
14784
14785         * expression.cs (New.DoEmit): Create a new LocalTemporary each time
14786         this function is called, it's not allowed to share LocalBuilders
14787         among ILGenerators.
14788
14789 2002-07-19  Martin Baulig  <martin@gnome.org>
14790
14791         * expression.cs (Argument.Resolve): Report an error 118 when trying
14792         to pass a type as argument.
14793
14794 2002-07-18  Martin Baulig  <martin@gnome.org>
14795
14796         * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
14797         Conv_R_Un for the signed `long' type.
14798
14799 2002-07-15  Miguel de Icaza  <miguel@ximian.com>
14800
14801         * expression.cs (MemberAccess.DoResolve): Do not reuse the field
14802         `expr' for the temporary result, as that will fail if we do
14803         multiple resolves on the same expression.
14804
14805 2002-07-05  Miguel de Icaza  <miguel@ximian.com>
14806
14807         * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
14808         ec.TypeContainer for looking up aliases. 
14809
14810         * class.cs (TypeContainer): Remove LookupAlias from here.
14811
14812         * decl.cs (DeclSpace); Move here.
14813
14814 2002-07-01  Miguel de Icaza  <miguel@ximian.com>
14815
14816         * class.cs (FindMembers): Only call filter if the constructor
14817         bulider is not null.
14818
14819         Also handle delegates in `NestedTypes' now.  Now we will perform
14820         type lookups using the standard resolution process.  This also
14821         fixes a bug.
14822
14823         * decl.cs (DeclSpace.ResolveType): New type resolution routine.
14824         This uses Expressions (the limited kind that can be parsed by the
14825         tree) instead of strings.
14826
14827         * expression.cs (ComposedCast.ToString): Implement, used to flag
14828         errors since now we have to render expressions.
14829
14830         (ArrayCreation): Kill FormElementType.  Use ComposedCasts in
14831         FormArrayType. 
14832
14833         * ecore.cs (SimpleName.ToString): ditto.
14834
14835         * cs-parser.jay: Instead of using strings to assemble types, use
14836         Expressions to assemble the type (using SimpleName, ComposedCast,
14837         MemberAccess).  This should fix the type lookups in declarations,
14838         because we were using a different code path for this.
14839
14840         * statement.cs (Block.Resolve): Continue processing statements
14841         even when there is an error.
14842
14843 2002-07-17  Miguel de Icaza  <miguel@ximian.com>
14844
14845         * class.cs (Event.Define): Also remove the `remove' method from
14846         the list of pending items.
14847
14848         * expression.cs (ParameterReference): Use ldarg.N (0..3) to
14849         generate more compact code. 
14850
14851 2002-07-17  Martin Baulig  <martin@gnome.org>
14852
14853         * const.cs (Const.LookupConstantValue): Add support for constant
14854         `unchecked' and `checked' expressions.
14855         Also adding test case test-140.cs for this.
14856
14857 2002-07-17  Martin Baulig  <martin@gnome.org>
14858
14859         * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
14860         check whether mi.ReturnType implements the IEnumerator interface; the
14861         `==' and the IsAssignableFrom() will fail in this situation.
14862
14863 2002-07-16  Ravi Pratap  <ravi@ximian.com>
14864
14865         * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix 
14866         here too.
14867
14868 2002-07-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14869
14870         * expression.cs: fixed bug #27811.
14871
14872 2002-07-14  Miguel de Icaza  <miguel@ximian.com>
14873
14874         * expression.cs (ParameterReference.AddressOf): Patch from Paolo
14875         Molaro: when we are a ref, the value already contains a pointer
14876         value, do not take the address of it.
14877
14878 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
14879         * removed mb-parser.jay and mb-tokenizer.cs
14880
14881 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
14882
14883         * expression.cs: check against the building corlib void type.
14884
14885 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
14886
14887         * ecore.cs: fix for valuetype static readonly fields: when 
14888         initializing them, we need their address, not the address of a copy.
14889
14890 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
14891
14892         * typemanager.cs: register also enum_type in corlib.
14893
14894 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
14895
14896         * class.cs: allow calling this (but not base) initializers in structs.
14897
14898 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
14899
14900         * ecore.cs: make sure we compare against the building base types
14901         in GetTypeSize ().
14902
14903 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
14904
14905         * typemanager.cs: fix TypeToCoreType() to handle void and object
14906         (corlib gets no more typerefs after this change).
14907
14908 2002-07-12  Miguel de Icaza  <miguel@ximian.com>
14909
14910         * expression.cs (ArrayCreation.EmitArrayArguments): use
14911         Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
14912
14913         (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
14914         Conv_Ovf_I_Un for the array arguments.  Even if C# allows longs as
14915         array indexes, the runtime actually forbids them.
14916
14917         * ecore.cs (ExpressionToArrayArgument): Move the conversion code
14918         for array arguments here.
14919
14920         * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
14921         instead of the default for ValueTypes.
14922
14923         (New.DoEmit): Use IsValueType instead of
14924         IsSubclassOf (value_type)
14925         (New.DoResolve): ditto.
14926         (Invocation.EmitCall): ditto.
14927
14928         * assign.cs (Assign): ditto.
14929
14930         * statement.cs (Unsafe): Ok, so I got the semantics wrong.
14931         Statements *are* currently doing part of their resolution during
14932         Emit.  
14933
14934         Expressions do always resolve during resolve, but statements are
14935         only required to propagate resolution to their children.
14936
14937 2002-07-11  Miguel de Icaza  <miguel@ximian.com>
14938
14939         * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
14940
14941         (LoadAssembly): Do not add the dll if it is already specified
14942
14943         (MainDriver): Add the System directory to the link path at the end,
14944         after all the other -L arguments. 
14945
14946         * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
14947         wrong opcode for loading bytes and bools (ldelem.i1 instead of
14948         ldelem.u1) and using the opposite for sbytes.
14949
14950         This fixes Digger, and we can finally run it.
14951
14952         * driver.cs (UnixParseOption): Move the option parsing here.  
14953         (CSCParseOption): Implement CSC-like parsing of options.
14954
14955         We now support both modes of operation, the old Unix way, and the
14956         new CSC-like way.  This should help those who wanted to make cross
14957         platform makefiles.
14958
14959         The only thing broken is that /r:, /reference: and /lib: are not
14960         implemented, because I want to make those have the same semantics
14961         as the CSC compiler has, and kill once and for all the confussion
14962         around this.   Will be doing this tomorrow.
14963
14964         * statement.cs (Unsafe.Resolve): The state is checked during
14965         resolve, not emit, so we have to set the flags for IsUnsfe here.
14966
14967 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
14968
14969         * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
14970         not catch the Error_ObjectRefRequired in SimpleName (as it is
14971         possible to have a class/instance variable name that later gets
14972         deambiguated), we have to check this here.      
14973
14974 2002-07-10  Ravi Pratap  <ravi@ximian.com>
14975
14976         * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
14977         make static and put into Expression.
14978
14979         (Event.Define): Register the private field of the event with the 
14980         TypeManager so that GetFieldFromEvent can get at it.
14981
14982         (TypeManager.RegisterPrivateFieldOfEvent): Implement to
14983         keep track of the private field associated with an event which
14984         has no accessors.
14985
14986         (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
14987         private field.
14988
14989         * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
14990
14991 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
14992
14993         * expression.cs (Binary.EmitBranchable): this routine emits the
14994         Binary expression in a branchable context.  This basically means:
14995         we need to branch somewhere, not just get the value on the stack.
14996
14997         This works together with Statement.EmitBoolExpression.
14998
14999         * statement.cs (Statement.EmitBoolExpression): Use
15000         EmitBranchable. 
15001
15002 2002-07-09  Miguel de Icaza  <miguel@ximian.com>
15003
15004         * statement.cs (For): Reduce the number of jumps in loops.
15005
15006         (For): Implement loop inversion for the For statement.
15007
15008         (Break): We can be breaking out of a Try/Catch controlled section
15009         (foreach might have an implicit try/catch clause), so we need to
15010         use Leave instead of Br.
15011
15012         * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
15013         now).  If the instace expression supports IMemoryLocation, we use
15014         the AddressOf method from the IMemoryLocation to extract the
15015         address instead of emitting the instance.
15016
15017         This showed up with `This', as we were emitting the instance
15018         always (Emit) instead of the Address of This.  Particularly
15019         interesting when This is a value type, as we dont want the Emit
15020         effect (which was to load the object).
15021
15022 2002-07-08  Miguel de Icaza  <miguel@ximian.com>
15023
15024         * attribute.cs: Pass the entry point to the DefinePInvokeMethod
15025
15026         * statement.cs (Checked): Set the CheckedState during the resolve
15027         process too, as the ConvCast operations track the checked state on
15028         the resolve process, and not emit.
15029
15030         * cs-parser.jay (namespace_member_declaration): Flag that we have
15031         found a declaration when we do.  This is used to flag error 1529
15032
15033         * driver.cs: Report ok when we display the help only.
15034
15035 2002-07-06  Andrew Birkett  <adb@tardis.ed.ac.uk>
15036
15037         * cs-tokenizer.cs (xtoken): Improve handling of string literals.
15038
15039 2002-07-04  Miguel de Icaza  <miguel@ximian.com>
15040
15041         * cs-tokenizer.cs (define): We also have to track locally the
15042         defines.  AllDefines is just used for the Conditional Attribute,
15043         but we also need the local defines for the current source code. 
15044
15045 2002-07-03  Miguel de Icaza  <miguel@ximian.com>
15046
15047         * statement.cs (While, For, Do): These loops can exit through a
15048         Break statement, use this information to tell whether the
15049         statement is the last piece of code.
15050
15051         (Break): Flag that we break.
15052
15053         * codegen.cs (EmitContexts): New `Breaks' state variable.
15054
15055 2002-07-03  Martin Baulig  <martin@gnome.org>
15056
15057         * class.cs (TypeContainer.MethodModifiersValid): Allow override
15058         modifiers in method declarations in structs.  Otherwise, you won't
15059         be able to override things like Object.Equals().
15060
15061 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
15062
15063         * class.cs (Method, Property, Indexer): Do not allow the public
15064         modifier to be used in explicit interface implementations.
15065
15066         (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
15067         override modifiers in method declarations in structs
15068
15069 2002-07-02   Andrew Birkett <adb@tardis.ed.ac.uk>
15070
15071         * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
15072         integer or real overflow, report an error
15073
15074 2002-07-02  Martin Baulig  <martin@gnome.org>
15075
15076         * typemanager.cs (TypeManager.InitCoreTypes): When compiling
15077         corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
15078         to tell the runtime about our newly created System.Object and
15079         System.ValueType types.
15080
15081 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
15082
15083         * expression.cs (This): Use Stobj/Ldobj when we are a member of a
15084         struct instead of Ldarg/Starg.
15085
15086 2002-07-02  Martin Baulig  <martin@gnome.org>
15087
15088         * expression.cs (Indirection.Indirection): Call
15089         TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
15090
15091 2002-07-02  Martin Baulig  <martin@gnome.org>
15092
15093         * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
15094         ValueType, call TypeManager.TypeToCoreType() on it.
15095         (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
15096         the OpCodes.Newarr argument.
15097
15098 2002-07-02  Martin Baulig  <martin@gnome.org>
15099
15100         * expression.cs (Invocation.EmitCall): When compiling corlib,
15101         replace all calls to the system's System.Array type to calls to
15102         the newly created one.
15103
15104         * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
15105         System.Array methods.
15106         (TypeManager.InitCoreTypes): When compiling corlib, get the methods
15107         from the system's System.Array type which must be replaced.
15108
15109 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
15110
15111         * typemanager.cs: load unverifiable_code_ctor so we can build
15112         corlib using the correct type. Avoid using GetTypeCode() with
15113         TypeBuilders.
15114         * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
15115         TypeManager.object_type to allow building corlib.
15116
15117 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
15118
15119         * ecore.cs: handle System.Enum separately in LoadFromPtr().
15120
15121 2002-07-01  Martin Baulig  <martin@gnome.org>
15122
15123         * class.cs: Make the last change actually work, we need to check
15124         whether `ifaces != null' to avoid a crash.
15125
15126 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
15127
15128         * class.cs: when we build structs without fields that implement
15129         interfaces, we need to add the interfaces separately, since there is
15130         no API to both set the size and add the interfaces at type creation
15131         time.
15132
15133 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
15134
15135         * expression.cs: the dimension arguments to the array constructors
15136         need to be converted if they are a long.
15137
15138 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
15139
15140         * class.cs: don't emit ldarg.0 if there is no parent constructor
15141         (fixes showstopper for corlib).
15142
15143 2002-06-29  Martin Baulig  <martin@gnome.org>
15144
15145         MCS now compiles corlib on GNU/Linux :-)
15146
15147         * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
15148         ie. check for MethodImplOptions.InternalCall.
15149
15150         * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
15151         and TypeManager.attribute_type are null, so we must explicitly check
15152         whether parent is not null to find out whether it's an attribute type.
15153         (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
15154         and SetBuilder, not only if the property is neither abstract nor external.
15155         This is necessary to set the MethodImplOptions on the accessor methods.
15156         (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
15157         SetBuilder, see Property.Emit().
15158
15159         * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
15160         populate "System.Object", "System.ValueType" and "System.Attribute" since
15161         they've already been populated from BootCorlib_PopulateCoreTypes().
15162
15163 2002-06-29  Martin Baulig  <martin@gnome.org>
15164
15165         * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
15166         is the NullLiteral, we also need to make sure that target_type is not
15167         an enum type.   
15168
15169 2002-06-29  Martin Baulig  <martin@gnome.org>
15170
15171         * rootcontext.cs (RootContext.ResolveCore): We must initialize
15172         `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
15173         before calling BootstrapCorlib_ResolveDelegate ().
15174
15175 2002-06-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15176
15177         * statement.cs: fixed build-breaker. All tests passed ok.
15178
15179 2002-06-27  Martin Baulig  <martin@gnome.org>
15180
15181         * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
15182         for System.Decimal when compiling corlib.
15183
15184 2002-06-27  Martin Baulig  <martin@gnome.org>
15185
15186         * statement.cs (Switch.TableSwitchEmit): Make this work with empty
15187         switch blocks which contain nothing but a default clause.
15188
15189 2002-06-26  Andrew  <adb@tardis.ed.ac.uk>
15190
15191        * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
15192
15193 2002-06-27  Martin Baulig  <martin@gnome.org>
15194
15195         * ecore.cs (PropertyExpr.PropertyExpr): Call
15196         TypeManager.TypeToCoreType() on the `pi.PropertyType'.
15197
15198         * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
15199         is already a TypeBuilder.
15200
15201 2002-06-27  Martin Baulig  <martin@gnome.org>
15202
15203         * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
15204         `target_type == TypeManager.array_type', not IsAssignableFrom() in
15205         the "from an array-type to System.Array" case.  This makes it work
15206         when compiling corlib.
15207
15208 2002-06-27  Martin Baulig  <martin@gnome.org>
15209
15210         * ecore.cs (Expression.SimpleNameResolve): If the expression is a
15211         non-static PropertyExpr, set its InstanceExpression.  This makes
15212         the `ICollection.Count' property work in System/Array.cs.
15213
15214 2002-06-25  Andrew Birkett  <adb@tardis.ed.ac.uk>
15215
15216         * driver.cs: Made error handling more consistent.  Errors now
15217         tracked by Report class, so many methods which used to return int
15218         now return void.  Main() now prints success/failure and 
15219         errors/warnings message.
15220
15221         Renamed '--probe' compiler argument to '--expect-error'.  Removed
15222         the magic number return values (123 and 124).  Now, if the
15223         expected error occurs, the compiler exits with success (exit value
15224         0).  If the compilation completes without seeing that particular
15225         error, the compiler exits with failure (exit value 1).  The
15226         makefile in mcs/errors has been changed to handle the new behaviour.
15227
15228         * report.cs: Made 'expected error' number a property and renamed
15229         it from 'Probe' to 'ExpectedError'.
15230
15231         * genericparser.cs: Removed error handling support, since it is
15232         now all done by Report class.
15233
15234         * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
15235         class, so parse() no longer returns an int.
15236
15237         * namespace.cs: Use Report.Error instead of GenericParser.error
15238
15239 2002-06-22  Miguel de Icaza  <miguel@ximian.com>
15240
15241         * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
15242         TypeContainer.AddOperator): At the front of the list put the
15243         explicit implementations, so they get resolved/defined first. 
15244
15245 2002-06-21  Miguel de Icaza  <miguel@ximian.com>
15246
15247         * class.cs (TypeContainer.VerifyImplements): Verifies that a given
15248         interface type is implemented by this TypeContainer.  Used during
15249         explicit interface implementation.
15250
15251         (Property.Define, Indexer.Define, Method.Define): Validate that
15252         the given interface in the explicit implementation is one of the
15253         base classes for the containing type.
15254
15255         Also if we are explicitly implementing an interface, but there is
15256         no match in the pending implementation table, report an error.
15257
15258         (Property.Define): Only define the property if we are
15259         not explicitly implementing a property from an interface.  Use the
15260         correct name also for those properties (the same CSC uses,
15261         although that is really not needed).
15262
15263         (Property.Emit): Do not emit attributes for explicitly implemented
15264         properties, as there is no TypeBuilder.
15265
15266         (Indexer.Emit): ditto.
15267
15268         Hiding then means that we do not really *implement* a pending
15269         implementation, which makes code fail.
15270
15271 2002-06-22  Martin Baulig  <martin@gnome.org>
15272
15273         * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
15274         the return value of Object.GetType().  [FIXME: we need to do this whenever
15275         we get a type back from the reflection library].
15276
15277 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
15278
15279         * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
15280
15281 2002-06-20  Miguel de Icaza  <miguel@ximian.com>
15282
15283         * attribute.cs: Return null if we can not look up the type.
15284
15285         * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
15286         the interface types found.
15287
15288         * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
15289         interface types found.
15290
15291         * typemanager.cs (GetInterfaces): Make this routine returns alll
15292         the interfaces and work around the lame differences between
15293         System.Type and System.Reflection.Emit.TypeBuilder in the results
15294         result for GetInterfaces.
15295
15296         (ExpandInterfaces): Given an array of interface types, expand and
15297         eliminate repeated ocurrences of an interface.  This expands in
15298         context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
15299         be IA, IB, IC.
15300
15301 2002-06-21  Martin Baulig  <martin@gnome.org>
15302
15303         * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
15304         on System.Enum.
15305
15306 2002-06-21  Martin Baulig  <martin@gnome.org>
15307
15308         * typemanager.cs (TypeManager.TypeToCoreType): New function.  When compiling corlib
15309         and called with one of the core types, return the corresponding typebuilder for
15310         that type.
15311
15312         * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
15313         element type.
15314
15315 2002-06-21  Martin Baulig  <martin@gnome.org>
15316
15317         * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
15318         `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
15319         (Expression.ConvertReferenceExplicit): Likewise.
15320
15321         * expression.cs (ElementAccess.DoResolve): Likewise.
15322         (ElementAccess.DoResolveLValue): Likewise.
15323
15324 2002-06-10  Martin Baulig  <martin@gnome.org>
15325
15326         * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
15327         add the "value" parameter to the parameter list.
15328
15329         * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
15330         to our caller.
15331
15332 2002-06-19  Miguel de Icaza  <miguel@ximian.com>
15333
15334         * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
15335         the argument to an int, uint, long or ulong, per the spec.  Also
15336         catch negative constants in array creation.
15337
15338 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
15339
15340         * class.cs: do not allow the same interface to appear twice in
15341         the definition list.
15342
15343 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
15344
15345         * ecore.cs: don't use ldlen with System.Array.
15346
15347 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
15348
15349         * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
15350
15351 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
15352
15353         * modifiers.cs: produce correct field attributes for protected
15354         internal. Easy fix so miguel can work on ther harder stuff:-)
15355
15356 2002-06-18  Miguel de Icaza  <miguel@ximian.com>
15357
15358         * pending.cs: New file.  Move the code from class.cs here.
15359         Support clearning the pending flag for all methods (when not doing
15360         explicit interface implementation).
15361
15362 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
15363
15364         * rootcontext.cs: added a couple more types needed to bootstrap.
15365
15366 2002-06-17  Miguel de Icaza  <miguel@ximian.com>
15367
15368         * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
15369         constructor in the type, instead of any constructor in the type
15370         hierarchy.  Thanks to Paolo for finding this bug (it showed up as
15371         a bug in the Mono runtime when applying the params attribute). 
15372
15373 2002-06-16  Rafael Teixeira  <rafaelteixeirabr@hotmail.com>
15374         * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
15375
15376 2002-06-14  Rachel Hestilow  <hestilow@ximian.com>
15377
15378         * expression.cs (Unary.ResolveOperator): Use TypeManager
15379         to resolve the type.
15380
15381 2002-06-13  Ravi Pratap  <ravi@ximian.com>
15382
15383         * cs-parser.jay (enum_member_declaration): Pass in the attributes
15384         attached.
15385
15386         * enum.cs (AddEnumMember): Add support to store the attributes associated 
15387         with each member too.
15388
15389         * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
15390         field builders too - this takes care of the enum member case.
15391
15392 2002-06-10  Rachel Hestilow  <hestilow@ximian.com>
15393
15394         * typemanager.cs (TypeManager.VerifyUnManaged): Allow
15395         address-of operator on both value types and pointers.
15396
15397 2002-06-10  Martin Baulig  <martin@gnome.org>
15398
15399         * interface.cs (Interface.PopulateIndexer): Add the indexer's
15400         PropertyBuilder to the `property_builders' list.
15401
15402         * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
15403         (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
15404         `lookup_type' and all its interfaces.  Unfortunately, Type.FindMembers() won't
15405         find any indexers which are inherited from an interface.
15406
15407 2002-06-09  Martin Baulig  <martin@gnome.org>
15408
15409         * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
15410         the same type as the constant if necessary.  There's also a test-130.cs
15411         for this.
15412
15413         * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
15414
15415         * typemanager.cs (TypeManager.ChangeType): Previously known as
15416         Enum.ChangeEnumType().
15417
15418 2002-06-09  Martin Baulig  <martin@gnome.org>
15419
15420         * expression.cs (Cast.TryReduce): Added support for consts.
15421
15422 2002-06-08  Ravi Pratap  <ravi@ximian.com>
15423
15424         * class.cs (Accessor): Hold attributes information so we can pass
15425         it along.
15426
15427         * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
15428         Modify to pass in attributes attached to the methods.
15429
15430         (add_accessor_declaration, remove_accessor_declaration): Ditto.
15431
15432         * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
15433         to handle the Accessor kind :-)
15434
15435         * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
15436
15437 2002-06-08  Martin Baulig  <martin@gnome.org>
15438
15439         * expression.cs (Unary.TryReduceNegative): Added support for
15440         ULongConstants.
15441
15442 2002-06-08  Martin Baulig  <martin@gnome.org>
15443
15444         * enum.cs (Enum.LookupEnumValue): Don't report an error if the
15445         name can't be found in the `defined_names' - the caller will do a
15446         MemberLookup in this case and thus find methods in System.Enum
15447         such as Enum.IsDefined().
15448
15449 2002-06-08  Martin Baulig  <martin@gnome.org>
15450
15451         * enum.cs (Enum.ChangeEnumType): This is a custom version of
15452         Convert.ChangeType() which works with TypeBuilder created types.
15453         (Enum.LookupEnumValue, Enum.Define): Use it here.
15454
15455         * class.cs (TypeContainer.RegisterRequiredImplementations): Added
15456         `TypeBuilder.BaseType != null' check.
15457         (TypeContainer.FindMembers): Only lookup parent members if we
15458         actually have a parent.
15459         (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
15460         (ConstructorInitializer.Resolve): Likewise.
15461
15462         * interface.cs (Interface.FindMembers): Added
15463         `TypeBuilder.BaseType != null' check.
15464
15465         * rootcontext.cs (RootContext.ResolveCore): Added
15466         "System.Runtime.CompilerServices.IndexerNameAttribute" to
15467         classes_second_stage.
15468
15469         * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
15470         debug_type and trace_type when compiling with --nostdlib.       
15471
15472 2002-06-07  Martin Baulig  <martin@gnome.org>
15473
15474         * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
15475         (AddField): Set it to true when adding a non-static field.
15476         (DefineType): Use `have_nonstatic_fields' to find out whether we
15477         have non-static fields, not `Fields != null'.
15478
15479 2002-06-02  Miguel de Icaza  <miguel@ximian.com>
15480
15481         * ecore.cs (SimpleNameResolve): Removed simple bug (we were
15482         dereferencing a null on the static-field code path)
15483
15484 2002-05-30  Martin Baulig  <martin@gnome.org>
15485
15486         * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
15487         to take command line arguments.  Use reflection to call the new
15488         custom `Initialize' function on the symbol writer and pass it the
15489         command line arguments.
15490
15491         * driver.cs (--debug-args): New command line argument to pass command
15492         line arguments to the symbol writer.
15493
15494 2002-05-28  Miguel de Icaza  <miguel@ximian.com>
15495
15496         * assign.cs (DoResolve): Forgot to do the implicit conversion to
15497         the target type for indexers and properties.  Thanks to Joe for
15498         catching this.
15499
15500 2002-05-27  Miguel de Icaza  <miguel@ximian.com>
15501
15502         * typemanager.cs (MethodFlags): returns the method flags
15503         (Obsolete/ShouldIgnore) that control warning emission and whether
15504         the invocation should be made, or ignored. 
15505
15506         * expression.cs (Invocation.Emit): Remove previous hack, we should
15507         not do this on matching a base type, we should do this based on an attribute
15508
15509         Only emit calls to System.Diagnostics.Debug and
15510         System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
15511         on the command line.
15512
15513         * rootcontext.cs: Global settings for tracing and debugging.
15514
15515         * cs-tokenizer.cs (define): New utility function to track
15516         defines.   Set the global settings for TRACE and DEBUG if found.
15517
15518 2002-05-25  Ravi Pratap  <ravi@ximian.com>
15519
15520         * interface.cs (Populate*): Pass in the TypeContainer as well as
15521         the DeclSpace as parameters so that we can create EmitContexts and
15522         then use that to apply attributes etc.
15523
15524         (PopulateMethod, PopulateEvent, PopulateProperty)
15525         (PopulateIndexer): Apply attributes everywhere.
15526
15527         * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
15528         etc.
15529
15530         (ApplyAttributes): Update accordingly.
15531
15532         We now apply interface attributes for all members too.
15533
15534 2002-05-26  Miguel de Icaza  <miguel@ximian.com>
15535
15536         * class.cs (Indexer.Define); Correctly check if we are explicit
15537         implementation (instead of checking the Name for a ".", we
15538         directly look up if the InterfaceType was specified).
15539
15540         Delay the creation of the PropertyBuilder.
15541
15542         Only create the PropertyBuilder if we are not an explicit
15543         interface implementation.   This means that explicit interface
15544         implementation members do not participate in regular function
15545         lookups, and hence fixes another major ambiguity problem in
15546         overload resolution (that was the visible effect).
15547
15548         (DefineMethod): Return whether we are doing an interface
15549         implementation. 
15550
15551         * typemanager.cs: Temporary hack until we get attributes in
15552         interfaces (Ravi is working on that) and we get IndexerName
15553         support in interfaces.
15554
15555         * interface.cs: Register the indexers as properties.
15556
15557         * attribute.cs (Attribute.Resolve): Catch the error, and emit a
15558         warning, I have verified that this is a bug in the .NET runtime
15559         (JavaScript suffers of the same problem).
15560
15561         * typemanager.cs (MemberLookup): When looking up members for
15562         interfaces, the parent of an interface is the implicit
15563         System.Object (so we succeed in searches of Object methods in an
15564         interface method invocation.  Example:  IEnumerable x;  x.ToString
15565         ()) 
15566
15567 2002-05-25  Miguel de Icaza  <miguel@ximian.com>
15568
15569         * class.cs (Event): Events should also register if they do
15570         implement the methods that an interface requires.
15571
15572         * typemanager.cs (MemberLookup); use the new GetInterfaces
15573         method. 
15574
15575         (GetInterfaces): The code used to lookup interfaces for a type is
15576         used in more than one place, factor it here. 
15577
15578         * driver.cs: Track the errors at the bottom of the file, we kept
15579         on going.
15580
15581         * delegate.cs (NewDelegate.Emit): We have to emit a null as the
15582         instance if the method we are calling is static!
15583
15584 2002-05-24  Miguel de Icaza  <miguel@ximian.com>
15585
15586         * attribute.cs (ApplyAttributes): Make this function filter out
15587         the IndexerName attribute (as that attribute in reality is never
15588         applied) and return the string constant for the IndexerName
15589         attribute. 
15590
15591         * class.cs (TypeContainer.Emit): Validate that all the indexers
15592         have the same IndexerName attribute, and if so, set the
15593         DefaultName attribute on the class. 
15594
15595         * typemanager.cs: The return value might contain other stuff (not
15596         only methods).  For instance, consider a method with an "Item"
15597         property and an Item method.
15598
15599         * class.cs: If there is a problem with the parameter types,
15600         return. 
15601
15602 2002-05-24  Ravi Pratap  <ravi@ximian.com>
15603
15604         * ecore.cs (ImplicitConversionExists): Wrapper function which also
15605         looks at user defined conversion after making a call to 
15606         StandardConversionExists - we need this for overload resolution.
15607
15608         * expression.cs : Update accordingly the various method calls.
15609
15610         This fixes 2 bugs filed against implicit user defined conversions 
15611
15612 2002-05-22  Miguel de Icaza  <miguel@ximian.com>
15613
15614         * statement.cs: Track the result of the assignment.
15615
15616 2002-05-21  Miguel de Icaza  <miguel@ximian.com>
15617
15618         * expression.cs (MemberAccess): Improved error reporting for
15619         inaccessible members.
15620
15621 2002-05-22  Martin Baulig  <martin@gnome.org>
15622
15623         * makefile (mcs-mono2.exe): New target.  This is mcs compiled with
15624         itself with debugging support.
15625
15626 2002-05-22  Martin Baulig  <martin@gnome.org>
15627
15628         * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
15629         Removed, this isn't needed anymore.
15630
15631 2002-05-20  Martin Baulig  <martin@gnome.org>
15632
15633         * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
15634         be underlying type for an enum.
15635
15636 2002-05-20  Miguel de Icaza  <miguel@ximian.com>
15637
15638         * typemanager.cs (InitEnumUnderlyingTypes): New helper function
15639         that splits out the loading of just the core types.
15640
15641         * rootcontext.cs (ResolveCore): Split the struct resolution in
15642         two, so we can load the enumeration underlying types before any
15643         enums are used.
15644
15645         * expression.cs (Is): Bandaid until we fix properly Switch (see
15646         bug #24985 for details).
15647
15648         * typemanager.cs (ImplementsInterface): The hashtable will contain
15649         a null if there are no interfaces implemented.
15650
15651 2002-05-18  Miguel de Icaza  <miguel@ximian.com>
15652
15653         * cs-parser.jay (indexer_declarator): It is fine to have array
15654         parameters
15655
15656 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
15657
15658         * typemanager.cs: (RegisterBuilder): New function used to register
15659         TypeBuilders that implement interfaces.  Since
15660         TypeBuilder.GetInterfaces (as usual) does not work with lame
15661         Reflection.Emit. 
15662         (AddUserType): register interfaces.
15663
15664         (ImplementsInterface): Use the builder_to_ifaces hash if we are
15665         dealing with TypeBuilder.  Also, arrays are showing up as
15666         SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
15667         methods can not be invoked on them!
15668
15669         * ecore.cs (ExplicitReferenceConversionExists): Made public.
15670         (ImplicitReferenceConversionExists): Split out from
15671         StandardConversionExists. 
15672
15673         * expression.cs (As): We were only implementing one of the three
15674         cases for the as operator.  We now implement them all.
15675         (Is): Implement the various other cases for Is as well.
15676
15677         * typemanager.cs (CACHE): New define used to control if we want or
15678         not the FindMembers cache.  Seems to have a negative impact on
15679         performance currently
15680
15681         (MemberLookup): Nested types have full acess to
15682         enclosing type members
15683
15684         Remove code that coped with instance/static returns for events, we
15685         now catch this in RealFindMembers.
15686
15687         (RealFindMembers): only perform static lookup if the instance
15688         lookup did not return a type or an event.  
15689
15690 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
15691
15692         * assign.cs (CompoundAssign): We pass more semantic information
15693         now to Compound Assignments than we did before: now we have all
15694         the information at hand, and now we resolve the target *before* we
15695         do the expression expansion, which allows the "CacheValue" method
15696         to have the effect we intended (before, a [x] += 1 would generate
15697         two differen ArrayAccess expressions from the ElementAccess,
15698         during the resolution process).
15699
15700         (CompoundAssign.DoResolve): Resolve target and original_source here.
15701
15702 2002-05-16  Miguel de Icaza  <miguel@ximian.com>
15703
15704         * expression.cs (ArrayAccess): dropped debugging information. 
15705
15706         * typemanager.cs: Small bug fix: I was always returning i_members,
15707         instead of one of i_members or s_members (depending on which had
15708         the content).
15709
15710         * assign.cs (IAssignMethod.CacheTemporaries): New method.  This
15711         method is invoked before any code generation takes place, and it
15712         is a mechanism to inform that the expression will be invoked more
15713         than once, and that the method should use temporary values to
15714         avoid having side effects
15715
15716         (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
15717
15718         * ecore.cs (Expression.CacheTemporaries): Provide empty default
15719         implementation.
15720
15721         * expression.cs (Indirection, ArrayAccess): Add support for
15722         CacheTemporaries in these two bad boys. 
15723
15724         * ecore.cs (LoadFromPtr): figure out on our own if we need to use
15725         ldobj or ldind_ref.  
15726         (StoreFromPtr): Handle stobj as well.
15727
15728         * expression.cs (UnaryMutator): Share more code.
15729
15730         * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
15731         down: I was not tracking the Filter function as well, which
15732         was affecting the results of the cache.
15733
15734 2002-05-15  Miguel de Icaza  <miguel@ximian.com>
15735
15736         * attribute.cs: Remove the hack to handle the CharSet property on
15737         StructLayouts. 
15738
15739 2002-05-14  Miguel de Icaza  <miguel@ximian.com>
15740
15741         * attribute.cs (DoResolve): More uglyness, we now only try to
15742         resolve the attribute partially, to extract the CharSet
15743         information (only if we are a StructLayout attribute).  Otherwise 
15744
15745         (GetExtraTypeInfo): Add some code to conditionally kill in the
15746         future this.   I am more and more convinced that the .NET
15747         framework has special code to handle the attribute setting on
15748         certain elements.
15749
15750         * expression.cs (IsParamsMethodApplicable): Revert my previous
15751         foreach change here, it was wrong.
15752
15753 2002-05-13  Miguel de Icaza  <miguel@ximian.com>
15754
15755         * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
15756         (pp_expr): do not abort on unknown input, just return.
15757         (eval): abort if there are pending chars.
15758
15759         * attribute.cs (Attribute.Resolve): Positional parameters are
15760         optional.  Deal with that case.
15761
15762         * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
15763         the Ansi/Unicode/Auto information for the type.
15764
15765         (TypeContainer.DefineType): instantiate the EmitContext here, as
15766         we will be using it during the type definition (to resolve
15767         attributes) and during the emit phase.
15768
15769         * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
15770         to pull type information out of the attributes
15771
15772         (Attribute.Resolve): track the constructor builder, and allow for
15773         multiple invocations (structs and classes will use this).
15774
15775         * ecore.cs (MemberLookupFinal): new version with all the
15776         parameters customizable.
15777
15778         * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
15779         constructors.  Return if the result value is null (as the error
15780         would have been flagged already by MemberLookupFinal)
15781
15782         Do not allow instances of abstract classes or interfaces to be
15783         created.
15784
15785         * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
15786         We have to compare the assembly property here when dealing with
15787         FamANDAssem and Assembly access modifiers, because we might be
15788         creating an assembly from *modules* (that means that we are not
15789         getting TypeBuilders for types defined in other modules that are
15790         part of this assembly).
15791
15792         (Method.Emit): If the method is marked abstract and has a body,
15793         emit an error. 
15794
15795         (TypeContainer.DefineMembers): If both the defined member and the
15796         parent name match are methods, then do not emit any warnings: let
15797         the Method.Define routine take care of flagging warnings.  But if
15798         there is a mismatch (method overrides something else, or method is
15799         overriwritten by something, then emit warning).
15800
15801         (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
15802         set to null, this means `do not check for the return type on the
15803         signature'. 
15804
15805         (Method.Define): set the return type for the method signature to
15806         null, so that we get methods with the same name and parameters and
15807         different return types.  This is used to flag warning 114 (you are
15808         hiding a method, and you probably want to use the new/override
15809         keywords instead).
15810
15811         * typemanager.cs (MemberLookup): Implemented proper access
15812         control, closing a long standing set of bug reports.  The problem
15813         was that the Framework only has two bits: Public and NonPublic,
15814         and NonPublic includes private and protected methods, but we need
15815         to enforce the FamANDAssem, FamOrAssem and Family. 
15816
15817 2002-05-11  Miguel de Icaza  <miguel@ximian.com>
15818
15819         * statement.cs (GotoCase): Return true: Ammounts to giving up
15820         knowledge on whether we return or not, and letting the other case
15821         be responsible for it.
15822
15823 2002-05-10  Miguel de Icaza  <miguel@ximian.com>
15824
15825         * driver.cs: Do not load directories for each file processed, only
15826         do it if there is a pattern.
15827
15828         * ecore.cs: Report readonly assigns here as well, as we might have
15829         been resolved only by MemberAccess.
15830
15831         (SimpleName.SimpleNameResolve): Also be useful for LValue
15832         resolution.   We need this to propagate assign to local readonly variables
15833
15834         * typemanager.cs: Use a ptrhashtable for the criteria, because we
15835         do not want to reuse potential criteria memory.
15836
15837         * class.cs (MyEventBuilder): Set reflected_type;
15838
15839         * ecore.cs (Constantify): Added support for constifying bools.
15840
15841         (RootContext.LookupType): Added a cache for values looked up in
15842         the declaration space.
15843
15844         * typemanager.cs (FindMembers): Now is a front-end to
15845         RealFindMembers, and provides a two-level hashtable-based cache to
15846         the request.  
15847
15848         15% performance improvement: from 22.5 to 19.2 seconds.
15849
15850         * expression.cs (IsParamsMethodApplicable): use foreach.
15851         (Invocation.DoResolve): ditto.
15852         (New.DoResolve): ditto.
15853         (ArrayCreation.DoResolve): ditto.
15854
15855         * ecore.cs (FindMostEncompassingType): use foreach.
15856
15857         * delegate.cs (NewDelegate.DoResolve): Use foreach
15858
15859         * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
15860         (RemoveMethods): use foreach.
15861
15862         * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
15863         nested foreach statements instead of for, and also break out of
15864         the inner loop once a match is found.
15865
15866         (Invocation.OverloadResolve): Use foreach, simplify the code. 
15867
15868 2002-05-08  Miguel de Icaza  <miguel@ximian.com>
15869
15870         * cfold.cs (BinaryFold): During an enumeration evaluation context,
15871         we actually unwrap the expression to allow for extra information
15872         to be extracted. 
15873
15874         * expression.cs: Use Shr_Un on unsigned operations. 
15875
15876 2002-05-08  Ravi Pratap  <ravi@ximian.com>
15877
15878         * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of 
15879         applicable operators was not being considered correctly. This closes
15880         the bug Miguel reported.
15881
15882 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
15883
15884         * attribute.cs: check that the type derives from System.Attribute
15885         and report the correct error in that case (moved the duplicate code to
15886         its own method, too).
15887
15888 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
15889
15890         * attribute.cs: lookup attribute type name as the spec says: first the
15891         bare attribute name and then name + "Attribute" (nant compiles with
15892         mcs after this fix).
15893
15894 2002-05-07  Miguel de Icaza  <miguel@ximian.com>
15895
15896         * expression.cs (Unary.TryReduceNegative): Ah!  Tricky!  Tricky!
15897         Because of the way we parse things, we should try to see if a
15898         UIntConstant can fit in an integer.
15899
15900 2002-05-07  Ravi Pratap  <ravi@ximian.com>
15901
15902         * ecore.cs (GetConversionOperators): Do not pick up op_True operators
15903         when we are in an explicit context.
15904
15905         (ConvertReferenceExplicit): When converting from Iface type S to Class
15906         T make sure the rules are implemented as an OR.
15907
15908         * parameter.cs (ParameterType): Make it a property for now although the
15909         purpose really isn't anything immediate.
15910
15911         * expression.cs (Is*Applicable): Do better checking on the parameter type
15912         of a ref/out parameter. The ones from the system assemblies are already 
15913         marked with the correct type so we don't need to do any correction.
15914
15915         * ecore.cs (StandardConversionExists): Conversion from Interface types to 
15916         the object type is standard too so include that.
15917
15918 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
15919
15920         * ecore.cs (StandardConversionExists): Augment with missing code:
15921         deal with IntConstant, LongConstants and Enumerations.
15922
15923         * assign.cs: Report the error, instead of failing silently
15924
15925         * rootcontext.cs (AddGlobalAttributes): Track attributes on the
15926         typecontainer that they are declared, because the
15927         typecontainer/namespace will have the list of using clauses that
15928         need to be applied.
15929
15930         Assembly Attributes were escaping the normal registration
15931         mechanism. 
15932
15933         (EmitCode): Apply attributes within an EmitContext that represents
15934         the container they were declared on.
15935
15936         * cs-parser.jay: Track bases for structs.  How did I get this wrong?
15937
15938 2002-05-06  Ravi Pratap  <ravi@ximian.com>
15939
15940         * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
15941         Revamp completely - make much cleaner as we now operate only
15942         on a set of Types.
15943
15944         (FindMostSpecificSource, FindMostSpecificTarget): New methods
15945         to implement the logic detailed in the spec more correctly.
15946
15947         (UserDefinedConversion): Update accordingly.
15948
15949 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
15950
15951         * statement.cs: Return flow analysis information up.
15952
15953         * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
15954         and the default.
15955
15956         (token): Do not consume an extra character before calling
15957         decimal_digits.
15958
15959 2002-05-06  Piers Haken <piersh@friskit.com>
15960
15961         * cs-parser.jay: add 'override' attribute to System.Object.Finalize
15962
15963 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
15964
15965         * class.cs (Constructor.Emit): Set the IsStatic flag in the
15966         EmitContext during the instance constructor initializer
15967         resolution, to stop access to instance variables.
15968
15969         This is mandated by the spec, last paragraph of the `constructor
15970         initializers' section. 
15971
15972 2002-05-05  Miguel de Icaza  <miguel@ximian.com>
15973
15974         * cs-parser.jay, class.cs (Accessor): new class used to represent
15975         an accessor (get or set).  In the past we used `null' to represent
15976         a missing accessor.  But this is ambiguous because there was no
15977         way to tell in abstract indexers/properties if one of them was
15978         specified.
15979
15980         Now there is a way of addressing that.
15981
15982         * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
15983         instead of FindMembers.
15984
15985         * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
15986         the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
15987
15988         * attribute.cs: Treat indexers and properties as the same in terms
15989         of applying attributes
15990
15991         * ecore.cs (FindMostEncompassedType): Use statically initialized
15992         EmptyExpressions()s like we do elsewhere to avoid creating useless
15993         objects (and we take this out of the tight loop).
15994
15995         (GetConversionOperators): Move the code to extract the actual
15996         operators to a separate routine to clean things up.
15997
15998 2002-05-04  Miguel de Icaza  <miguel@ximian.com>
15999
16000         * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
16001         events are always registered FieldBuilders.
16002
16003         * class.cs (FieldBase): New class shared by Fields 
16004
16005         * delegate.cs: If we are a toplevel delegate, use our full name.
16006         If we are a nested delegate, then only use our tail name.
16007
16008 2002-05-02  Ravi Pratap  <ravi@ximian.com>
16009
16010         * expression.cs (IsApplicable): Ensure that we add the "&" to
16011         ref/out types before comparing it with the type of the argument.
16012
16013         (IsParamsMethodApplicable): Ditto.
16014
16015         (Argument.Type): Use TypeManager.LookupType instead of Type.GetType - 
16016         silly me ;-)
16017
16018         * delegate.cs : Handle the case when we have more than one applicable
16019         method. Flag an error only when we finish checking all.
16020
16021 2002-05-02  Miguel de Icaza  <miguel@ximian.com>
16022
16023         * expression.cs: Add support for boolean static initializers.
16024
16025 2002-05-01  Miguel de Icaza  <miguel@ximian.com>
16026
16027         * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
16028
16029         * parameter.cs (ComputeParameterTypes,
16030         ComputeAndDefineParameterTypes): Better error handling: now we
16031         clear the `types' cache if we fail during any of the type lookups.
16032         We also return the status code correctly to our caller
16033
16034         * delegate.cs: If we fail to define a delegate, abort the extra
16035         steps. 
16036
16037         * expression.cs (Binary.ResolveOperator): for
16038         operator==(object,object) and operator !=(object, object) we also
16039         have to verify that there is an implicit conversion from one to
16040         the other.
16041
16042         (ArrayAccess.DoResolve): Array Access can operate on
16043         non-variables. 
16044
16045 2002-04-30  Miguel de Icaza  <miguel@ximian.com>
16046
16047         * assign.cs (CompoundAssign): A new class used as a "flag" that
16048         the assignment actually is happening as part of a compound
16049         assignment operator.
16050
16051         During compound assignment, a few new rules exist to enable things
16052         like:
16053
16054         byte b |= 1 + 2
16055
16056         From the spec:
16057
16058         x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
16059         to the type of x) if y is implicitly convertible to the type of x,
16060         and the operator is a builtin operator and the return type of the
16061         operator is explicitly convertible to the type of x. 
16062
16063         * rootcontext.cs: Reset warning level to 2.  4 catches various
16064         "interesting" features in mcs, we must clean this up at some
16065         point, but currently am trying to kill other bugs ;-)
16066
16067         * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
16068         in container classes as well.  
16069
16070         * expression.cs (Binary.ResolveOperator): Handle string case
16071         before anything else (as operator overloading does emit an error
16072         before doing anything else).
16073
16074         This code could go away when we move to a table driven model, but
16075         i could not come up with a good plan last night.
16076
16077 2002-04-30  Lawrence Pit <loz@cable.a2000.nl>
16078
16079         * typemanager.cs (CSharpName): reimplementation using regex.
16080         * class.cs: added null check for fields in Emit
16081         * rootcontext.cs: set warninglevel to 4
16082
16083 2002-04-29  Miguel de Icaza  <miguel@ximian.com>
16084
16085         * typemanager.cs (CSharpName): reimplemented with Lupus
16086         suggestion.
16087
16088 2002-04-28  Miguel de Icaza  <miguel@ximian.com>
16089
16090         * statement.cs (If): correclty implement Resolve, because we were
16091         not catching sem errors in there.  The same process is needed
16092         everywhere else. 
16093         (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
16094
16095
16096         (Statement.Warning_DeadCodeFound): Factorize code.
16097         (While): Report dead code here too.
16098
16099         (Statement): Added Resolve virtual method to allow
16100         for resolution split from the emit code.
16101
16102 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
16103
16104         * statement.cs (EmitBoolExpression): No longer try to resolve the
16105         expression here.    
16106         (MakeBoolean): New utility function that resolve, implicitly
16107         converts to boolean and tags the expression. 
16108
16109
16110         (If, Do): Implement dead code elimination.
16111         (While): Implement loop inversion
16112
16113         (Do, While, For, If): Resolve the expression prior to calling our
16114         code generation.
16115
16116 2002-04-22  Lawrence Pit <loz@cable.a2000.nl>
16117
16118         * class.cs:
16119           - added method Report28 (warning: program has more than one entry point)
16120           - added method IsEntryPoint, implements paragraph 10.1 of the spec
16121           - modified method Method.Define, the part at the end of the method
16122
16123         * rootcontext.cs: added static public Location EntryPointLocation;
16124           
16125         * ../errors/cs0028.cs : Add test case for the above warning.              
16126
16127         * typemanager.cs:
16128           - modified method CSharpName to allow arrays of primitive type to
16129             be printed nicely (e.g. instead of System.Int32[][] it now prints
16130             int[][])
16131           - added method CSharpSignature: returns the signature of a method
16132             in string format to be used in reporting errors, warnings, etc.
16133
16134         * support.cs: InternalParameters.ParameterDesc variable tmp initialized
16135         with String.Empty.
16136
16137 2002-04-26  Ravi Pratap  <ravi@ximian.com>
16138
16139         * delegate.cs (Define): Fix extremely silly bug where I was
16140         setting the type of the 'object' parameter of the BeginInvoke
16141         method to System.IAsyncResult instead of System.Object ;-)
16142
16143 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
16144
16145         * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
16146         here. 
16147
16148         (Constructor.Emit): return if we fail to initialize the
16149         constructor.  Another door closed!  
16150
16151         * expression.cs (New.DoResolve): Improve error message (from -6 to
16152         1501).  Use DeclaredOnly lookup to find the exact constructor.
16153
16154         * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
16155         loop.  This is useful.
16156
16157         * cs-parser.jay: Adjust the default parameters so that destructors
16158         have the proper signature.
16159
16160 2002-04-26  Martin Baulig  <martin@gnome.org>
16161
16162         * driver.cs (LoadAssembly): If `assembly' contains any characters
16163         which are only valid in path names and not in assembly names
16164         (currently slash, backslash and point), use Assembly.LoadFrom ()
16165         instead of Assembly.Load () on the `assembly' (before iteration
16166         over the link_paths).
16167
16168 2002-04-26  Martin Baulig  <martin@gnome.org>
16169
16170         * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
16171
16172 2002-04-25  Miguel de Icaza  <miguel@ximian.com>
16173
16174         * class.cs (Property): use the new typemanager.MemberLookup
16175
16176         (TypeContainer.MemberLookup): Implement using the
16177         TypeManager.MemberLookup now. 
16178
16179         * typemanager.cs: Make MemberLookup a function of the TypeManager,
16180         and return MemberInfos, so that these can be used without an
16181         EmitContext (what we had before).
16182
16183 2002-04-24  Miguel de Icaza  <miguel@ximian.com>
16184
16185         * expression.cs: Fix the case where the argument to params if the
16186         type of the params.  I omitted handling this before.   Fixed
16187
16188 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
16189
16190         * driver.cs: Call BootCorlib_PopulateCoreType
16191
16192         * class.cs (Property.CheckBase): Check for properties only, not
16193         for all members. 
16194
16195         * interface.cs: Temporary hack: try/catch around the
16196         CustomAttributeBuilder, because I am getting an exception that I
16197         do not understand.
16198
16199         * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
16200         types whose definitions are required to be there (attributes are
16201         defined before standard types).
16202
16203         Compute definitions as we boot the various types, as they are used
16204         immediately (value_type class will need object_type, but if we do
16205         not initialize object_type, we will pass a null, which will let
16206         the runtime pick the System.Object from the existing corlib, which
16207         is not what we want).
16208
16209 2002-04-22  Patrik Torstensson <totte@labs2.com>
16210
16211         * cs-tokenizer.cs: fixed a number of trim() issues.
16212
16213 2002-04-22  Ravi Pratap  <ravi@ximian.com>
16214
16215         * expression.cs (Argument.Type): Ensure that we return the correct
16216         type when we have out or ref parameters [in which case we 
16217         append a "&"].
16218
16219 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
16220
16221         * class.cs (Property, Indexer): Allow extern modifier in there. 
16222
16223         * typemanager.cs (InitBaseTypes): Initializes object_type and
16224         value_type, since those will be used early on during the bootstrap
16225         process to compile corlib.
16226
16227         (InitCoreTypes): Move code from here to InitBaseTypes.
16228
16229 2002-04-21  Miguel de Icaza  <miguel@ximian.com>
16230
16231         * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
16232         single-dimension arrays as using the ldlen opcode.  
16233
16234         Daniel Lewis discovered this optimization.  
16235
16236         * typemanager.cs: Add signature for System.Array::get_Length
16237
16238 2002-04-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16239
16240         * statement.cs: report the error when the foreach does not apply to an
16241         array nor a collection.
16242
16243 2002-04-19  Miguel de Icaza  <miguel@ximian.com>
16244
16245         * expression.cs: Add implicit conversions to the operator ~.
16246
16247         * constant.cs (DecimalConstant.Emit): Emit decimal value.
16248
16249         * typemanager.cs: Locate the decimal constructor.
16250
16251 2002-04-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16252
16253         * attribute.cs: use the new property of TypeOf.
16254         * expression.cs: added 'get' property around typearg.
16255
16256         These changes fix a build breaker reported by NickD. Is this the
16257         correct way to fix?  If not, please, revert my changes and make it
16258         work :-).
16259
16260 2002-04-17  Miguel de Icaza  <miguel@ximian.com>
16261
16262         * attribute.cs: Add support for typeof in attribute invocations.
16263         I am not sure that this is right though.
16264
16265 2002-04-14  Duncan Mak  <duncan@ximian.com>
16266
16267         * cfold.cs (BinaryFold): Catch DivideByZeroException in the
16268         Binary.Operator.Division case.
16269
16270 2002-04-13  Ravi Pratap  <ravi@ximian.com>
16271
16272         * class.cs (DefineType): Ensure that we do a proper check on
16273         attribute types and also register it with the TypeManager.
16274
16275         (TypeContainer.Targets): The default for attribute types is
16276         AttributeTargets.All.
16277
16278         * attribute.cs (ApplyAttributes): Registering the attribute type
16279         is done elsewhere, not when we discover we have a Usage attribute.
16280
16281 2002-04-12  Ravi Pratap  <ravi@ximian.com>
16282
16283         * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
16284         and get rid of is_delegate parameter.
16285
16286         * everywhere : update.
16287
16288 2002-04-12  Ravi Pratap  <ravi@ximian.com>
16289
16290         * cs-parser.jay (compilation_unit): Revamp completely to use
16291         some new ideas that I got from Rhys' grammar to solve the problems
16292         with assembly level attributes.
16293
16294         (outer_declaration): New grammar production.
16295
16296         (attribute_sections): Add.
16297
16298         (opt_attributes): Base on attribute_sections
16299
16300         (namespace_declaration): Allow opt_attributes to tackle the case
16301         when we have assembly level attributes - we are clever in this
16302         regard now ;-)
16303
16304         * attribute.cs (ApplyAttributes): Do not worry about assembly 
16305         attributes in the non-global context.
16306
16307         * rootcontext.cs (AddGlobalAttributes): Go back to using this
16308         instead of SetGlobalAttributes.
16309
16310         * class.cs, rootcontext.cs : Ensure we define and generate 
16311         attribute types before anything else.
16312
16313         * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
16314         and flag the new error -20 for the case when the attribute type
16315         does not have valid targets specified. csc does not catch this.
16316
16317         * ../errors/errors.txt : update for error # -20
16318
16319 2002-04-11  Ravi Pratap  <ravi@ximian.com>
16320
16321         * support.cs (InternalParameters.ParameterModifier): Do some null
16322         checking and return sane values.
16323
16324         * class.cs (Method.Define): If we are a PInvoke method, ensure
16325         that we are static and extern. Report error # 601
16326
16327         * ../errors/cs0601.cs : Add test case for the above error.
16328
16329 2002-04-07  Ravi Pratap  <ravi@ximian.com>
16330
16331         * rootcontext.cs (attribute_types): We need to keep type of
16332         all attribute types separately and emit code for them first.
16333
16334         (RegisterAttribute) : Implement.
16335
16336         * class.cs (DefineType): Check if the current Type is a custom
16337         attribute type and register it accordingly.
16338
16339         * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
16340         adding the first attribute twice and rename to
16341
16342         (SetGlobalAttributes): this.
16343
16344         * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
16345         lookups.
16346
16347         * attribute.cs (ApplyAttributes): Take an additional argument telling us
16348         if we are processing global arguments. Hmm, I am unsure of this.
16349
16350 2002-04-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16351
16352         * expression.cs: added static array of strings to avoid calling
16353         Enum.ToString () for Operator in Binary. Significant recover of
16354         performance.
16355
16356 2002-04-10  Miguel de Icaza  <miguel@ximian.com>
16357
16358         * class.cs (FindMembers): Allow the Builders of the various
16359         members to be null.  If they are skip them.  This only happens
16360         during the PInvoke declaration.
16361
16362 2002-04-09  Miguel de Icaza  <miguel@ximian.com>
16363
16364         * parameter.cs (Parameters.ComputeParameterTypes): Flag the
16365         failure, so we do not keep going afterwards.
16366
16367         * expression.cs: (Invocation.OverloadResolve): I believe Ravi
16368         wanted to pass `false' as the `is_delegate' argument.  If this is
16369         the case, why not use delegate_type == null to mean `is_delegate =
16370         false' and anything else as is_delegate = true.
16371
16372 Tue Apr  9 05:40:12  2002 Piers Haken <piersh@friskit.com>
16373
16374         * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
16375         code for the section, not the beginning of the tests.
16376
16377 2002-04-08  Miguel de Icaza  <miguel@ximian.com>
16378
16379         * cfold.cs: Handle operator + (Enum x, Underlying x) 
16380
16381         * expression.cs (Binary): same.  Warn about errors where we have
16382         Enum/Enum in operator + as well.
16383
16384 Mon Apr  8 06:29:03  2002 Piers Haken <piersh@friskit.com>
16385
16386         * statement.cs:
16387                 - added support for switch(bool)
16388                 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
16389                 - add TableSwitchEmit() to handle table-based switch statements
16390
16391 2002-04-05  Ravi Pratap  <ravi@ximian.com>
16392
16393         * expression.cs (Invocation.OverloadResolve): Factor out code which
16394         does parameter compatibility checking with arguments so that we can 
16395         re-use the code even from Delegate.VerifyApplicability
16396
16397         (VerifyArgumentsCompat): Move above code here.
16398
16399         * delegate.cs (VerifyApplicability): Get rid of duplicate code
16400         and instead make a call to the above method.
16401
16402 2002-03-31  Ravi Pratap  <ravi@ximian.com>
16403
16404         * typemanager.cs (attribute_type): Corresponds to System.Attribute.
16405         We use it to keep track of classes which are attribute types.
16406
16407 2002-04-02  Miguel de Icaza  <miguel@ximian.com>
16408
16409         * delegate.cs (Delegate.Define): Correctly define the types in the
16410         presence of fixed and array parameters.
16411
16412         * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
16413         doing FindMembers.
16414
16415         * ecore.cs (Expression.MemberLookup): Reset binding flags to not
16416         include NonPublic after the first iteration.
16417
16418         * class.cs (Indexer.CheckBase): Only check if both parents are
16419         non-null. 
16420
16421         * cs-parser.jay (accessor_body): If empty, set to null.
16422
16423         * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
16424         same code path here to resolve constants names that we did have in
16425         MemberAccess.DoResolve.  There is too much code duplicated here.
16426
16427 2002-04-01  Miguel de Icaza  <miguel@ximian.com>
16428
16429         * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
16430
16431         * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
16432         to MakeUnionSet.
16433
16434         * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
16435         tokens, numbers and strings.
16436
16437         * ecore.cs (MethodGroupExpr): Make Emit warn about missing
16438         parenthesis.
16439
16440         * delegate.cs: Use ComputeAndDefineParameterTypes for both the
16441         asyncronous parameters and the regular parameters.  
16442
16443         * codegen.cs (CodeGen.Init): Use the constructor that allows us to
16444         specify the target directory.
16445
16446         * expression.cs: (This.DoResolve): Simplify
16447         (As.Emit): Optimize, do not generate IsInst if the expression is
16448         always of the given type.
16449
16450         (Is.DoResolve): Bug fix, we were reporting both always/never for
16451         the is expression.
16452
16453         * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
16454         creating too many unnecessary arrays.
16455
16456 2002-03-31  Miguel de Icaza  <miguel@ximian.com>
16457
16458         * class.cs (EmitFieldInitializer): Use Assign expression to assign
16459         fields instead of rolling our own initializer.   Takes care of all
16460         implicit conversions, and drops unnecessary static checks/argument.
16461
16462 2002-03-31  Dick Porter  <dick@ximian.com>
16463
16464         * driver.cs: use the GetDirectories() return values properly, and
16465         use "/" as path separator.
16466
16467 2002-03-30  Miguel de Icaza  <miguel@ximian.com>
16468
16469         * expression.cs (Unary): Optimize - - expr into expr.
16470         (Binary): Optimize a + (-b) into a -b.
16471
16472         * codegen.cs (CodeGen): Made all methods static.
16473
16474 2002-03-29  Miguel de Icaza  <miguel@ximian.com>
16475
16476         * rootcontext.cs: 
16477
16478         * decl.cs: Rename `definition' into `TypeBuilder' and drop the
16479         TypeBuilder property.
16480
16481         * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
16482         instead. 
16483
16484         * tree.cs: Removed the various RecordXXXX, and replaced with a
16485         single RecordDecl.  Removed all the accessor methods, and just
16486         left a single access point Type 
16487
16488         * enum.cs: Rename DefineEnum to DefineType.
16489
16490         * decl.cs: New abstract method `DefineType' used to unify the
16491         Defines for Enumerations, Interfaces, TypeContainers and
16492         Delegates.
16493
16494         (FindType): Moved LookupInterfaceOrClass here.  Moved the
16495         LookupBaseClasses method that used to live in class.cs and
16496         interface.cs here, and renamed to FindType.
16497
16498         * delegate.cs: Implement DefineType.  Take advantage of the
16499         refactored pattern for locating the parent builder without taking
16500         the parent_builder argument (which we know does not work if we are
16501         nested, and triggering a toplevel definition).
16502
16503 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
16504
16505         * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
16506         accessibility of a member has changed during override and report
16507         an error if so.
16508
16509         * class.cs (Method.Define, Property.Define): Only complain on
16510         overrides if the method is private, any other accessibility is
16511         fine (and since we just checked the permission is the same, we are
16512         good to go).
16513
16514         * cs-tokenizer.cs: only line, region, endregion, if, endif, else
16515         and elif are processed always.  The other pre-processing
16516         directives are only processed if we are "taking" the path
16517
16518 2002-03-29  Martin Baulig  <martin@gnome.org>
16519
16520         * class.cs (Method.Emit): Only emit symbolic debugging info if the
16521         current location is not Null.
16522
16523         * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
16524         a separate method so we can profile it.
16525
16526         * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
16527         `span.Seconds' are just seconds, but no minutes or hours.
16528         (MainDriver): Profile the CodeGen.SaveSymbols calls.
16529
16530 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
16531
16532         * class.cs (Method.Define), (Property.Define), (Indexer.Define):
16533         Remove the gratuitous set of Final:
16534
16535                                 // If an interface implementation, then we can set Final.
16536                                 if (((flags & MethodAttributes.Abstract) == 0) &&
16537                                     implementing.DeclaringType.IsInterface)
16538                                         flags |= MethodAttributes.Final;
16539
16540         I do not know what I was smoking when I used that.
16541
16542
16543         * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
16544         step into fixing the name resolution issues for delegates and
16545         unifying the toplevel name resolution.
16546
16547 2002-03-28  Martin Baulig  <martin@gnome.org>
16548
16549         * class.cs (Method.Emit): If we have a symbol writer, call its
16550         OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
16551         tell it about the current method.
16552
16553         * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
16554         writer that we're going to emit the first byte of IL code for a new
16555         statement (a new source line).
16556         (EmitContext.EmitTopBlock): If we have a symbol writer, call
16557         EmitContext.Mark() before emitting any code.
16558
16559         * location.cs (SymbolDocument): Return null when we're Null.
16560
16561         * statement.cs (Statement): Moved the `Location loc' variable here.
16562         (Statement.EmitBoolExpression): If we have a symbol writer, call
16563         ec.Mark() before emitting any code to tell it that we're at the
16564         beginning of a new statement.
16565         (StatementExpression): Added `Location' argument to the constructor.
16566         (Block): Added public readonly variable `StartLocation' and public
16567         variable `EndLocation'.  The latter is to be set using SetEndLocation().
16568         (Block): Added constructor which takes a start and end location.
16569         (Block.SetEndLocation): New method. This sets the end location.
16570         (Block.EmitMeta): If we have a symbol writer, tell it the names of the
16571         local variables we create.
16572         (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
16573         each statement and do also mark the begin and end of the block.
16574
16575         * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
16576         tell it the current lexer.Location, use Location.Null for the end of the
16577         block.
16578         (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
16579         current block, set its end location using SetEndLocation().
16580         (statement_expression): StatementExpression constructor now takes the
16581         lexer.Location as additional argument.
16582         (for_statement, declare_local_variables): Likewise.
16583         (declare_local_variables): When creating a new implicit block, use the
16584         new Block constructor and pass it the lexer.Location.
16585
16586 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
16587
16588         * ecore.cs (Expression.MemberLookup): On interfaces, lookup
16589         members also on the parent interfaces recursively.
16590
16591 2002-03-27  Miguel de Icaza  <miguel@ximian.com>
16592
16593         * report.cs: Use new formats, since Gonzalo finished the missing
16594         bits. 
16595
16596         * expression.cs (Binary.ResolveOperator): added missing operator|
16597         operator& and operator^ for bool/bool.
16598
16599         * cs-parser.jay: CheckDef now takes a Location argument that is
16600         used to report errors more precisly (instead of reporting the end
16601         of a definition, we try to track something which is a lot closer
16602         to the source of the problem).
16603
16604         * cs-tokenizer.cs: Track global token use, so we can properly flag
16605         the use of #define/#undef after the first token has been seen.
16606
16607         Also, rename the reportXXXX to Error_DescriptiveName
16608
16609         * decl.cs (DeclSpace.IsTopLevel): Move property here from
16610         TypeContainer, so that Enum and Interface can use this too.
16611
16612         * class.cs (TypeContainer.LookupInterfaceOrClass,
16613         GetInterfaceOrClass, GetClassBases, DefineType): Drop the
16614         `builder' argument.  Typically this was used to pass the parent
16615         builder (a ModuleBuilder or a TypeBuilder from whoever triggered
16616         the definition).  
16617
16618         The problem is that a nested class could trigger the definition of
16619         a toplevel class, and the builder would be obviously wrong in that
16620         case. 
16621
16622         So we drop this argument, and we compute dynamically the
16623         TypeBuilder/ModuleBuilder (the correct information was available
16624         to us anyways from DeclSpace.Parent)
16625
16626         * interface.cs (Interface.DefineInterface): Drop builder
16627         parameter cleanup like class.cs
16628
16629         * enum.cs (Enum.DefineEnum): Drop builder parameter.  Clean up
16630         like class.cs
16631
16632         * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
16633         values. 
16634
16635         (Try.Emit): Propagate the returns value from the statement.
16636
16637         (Return.Emit): Even if we are leavning 
16638
16639         * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
16640
16641         * modifiers.cs: Fix the computation of MethodAttributes flags.
16642
16643 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
16644
16645         * driver.cs: allow compilation of files that start with '/'.
16646         Add a default case when checking the argument of --target.
16647
16648 2002-03-25  Miguel de Icaza  <miguel@ximian.com>
16649
16650         * interface.cs: Implement the same search algorithm for types in
16651         the interface code.
16652
16653         * delegate.cs: Do not allow multiple definition.
16654
16655         * Recovered ChangeLog that got accidentally amputated
16656
16657         * interface.cs (Interface.DefineInterface): Prevent from double definitions.
16658
16659         * rootcontext.cs: Load manually enum to allow core classes to
16660         contain enumerations.
16661
16662         * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
16663         Update to new static methods in TypeManager.
16664
16665         * typemanager.cs (GetMethod, GetConstructor): Use our
16666         implementation of FindMembers to find the members, since during
16667         corlib compilation, the types are TypeBuilders and GetMethod and
16668         GetConstructor do not work.
16669
16670         Make all methods in TypeManager static.
16671
16672         (InitCodeHelpers): Split the functionality from
16673         the InitCodeTypes function.
16674
16675         * driver.cs: Call InitCodeHelpers after we have populated the
16676         types. 
16677
16678         * cs-parser.jay (delegate_declaration): we did not used to compute
16679         the delegate name correctly for void delegates.
16680
16681 2002-03-24  Miguel de Icaza  <miguel@ximian.com>
16682
16683         * rootcontext.cs (RootContext): Init the interface_resolve_order
16684         and type_container_resolve_order always.
16685
16686         (ResolveCore, BootstrapCorlib_ResolveClass,
16687         BootstrapCorlib_ResolveStruct): New functions to bootstrap the
16688         compiler when compiling with --nostdlib
16689
16690         * class.cs (TypeContainer.DefineType): Check that our parent is
16691         not null.  This test is most important when we are bootstraping
16692         the core types.
16693
16694         * codegen.cs: Split out the symbol writing code.
16695
16696 2002-03-25  Martin Baulig  <martin@gnome.org>
16697
16698         * driver.cs (-g): Made -g an alias for --debug.
16699
16700 2002-03-24  Martin Baulig  <martin@gnome.org>
16701
16702         * codegen.cs (SymbolWriter): New public variable. Returns the
16703         current symbol writer.
16704         (CodeGen): Added `bool want_debugging_support' argument to the
16705          constructor. If true, tell the ModuleBuild that we want debugging
16706         support and ask it for the ISymbolWriter.
16707         (Save): If we have a symbol writer, call it's Close() method after
16708         saving the assembly.
16709
16710         * driver.c (--debug): New command line argument to create a
16711         debugger information file.
16712
16713         * location.cs (SymbolDocument): New public property. Returns an
16714         ISymbolDocumentWriter object for the current source file or null
16715         if we don't have a symbol writer.
16716
16717 2002-03-21  Miguel de Icaza  <miguel@ximian.com>
16718
16719         * driver.cs (LoadAssembly): Correctly return when all the paths
16720         have been tried and not before.
16721
16722         * statement.cs (Switch.Emit): return the actual coverage for this
16723         statement (returns/not-returns)
16724
16725         (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
16726         switch of the statement if we are the last switch section.  That
16727         kills two problems: try/catch problems (we used to emit an empty
16728         nop at the end) and switch statements where all branches would
16729         return. 
16730
16731 2002-03-19  Miguel de Icaza  <miguel@ximian.com>
16732
16733         * driver.cs: Add default assemblies (the equivalent to the
16734         Microsoft CSC.RSP file)
16735
16736         * cs-tokenizer.cs: When updating `cols and setting it to zero,
16737         also update tokens_seen and set it to false.
16738
16739         * driver.cs: Implement --recurse for Mike.
16740
16741         * driver.cs (SplitPathAndPattern): Small bug fix, I was not
16742         correctly splitting out the paths.
16743
16744 2002-03-18  Miguel de Icaza  <miguel@ximian.com>
16745
16746         * interface.cs (Interface.PopulateProperty): Instead of using
16747         `parent' as the declaration space for the set parameters, use
16748         `this' 
16749
16750         * support.cs (InternalParameters): InternalParameters constructor
16751         takes a DeclSpace instead of a TypeContainer.
16752
16753         * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
16754         types are being initialized, load the address of it before calling
16755         the function.  
16756
16757         (New): Provide a mechanism to disable the generation of local
16758         value type temporaries when the caller will be providing us with
16759         an address to store it.
16760
16761         (ArrayCreation.EmitDynamicInitializers): Use it.
16762
16763 2002-03-17  Miguel de Icaza  <miguel@ximian.com>
16764
16765         * expression.cs (Invocation.EmitArguments): Only probe for array
16766         property if there is more than one argument.  Sorry about that.
16767
16768         * class.cs (Invocation.EmitArguments): Fix to emit arguments for
16769         empty param arrays.
16770
16771         * class.cs (Method.LabelParameters): Fix incorrect code path that
16772         prevented the `ParamArrayAttribute' from being applied to the
16773         params attribute.
16774
16775 2002-03-16  Miguel de Icaza  <miguel@ximian.com>
16776
16777         * support.cs (ReflectionParameters): Correctly compute whether the
16778         last argument is a params array.  Fixes the problem with
16779         string.Split ('a')
16780
16781         * typemanager.cs: Make the assemblies array always be non-null
16782         (empty, but non-null)
16783
16784         * tree.cs (RecordDecl): New function that abstracts the recording
16785         of names.  This reports error 101, and provides a pointer to the
16786         previous declaration.  Fixes a crash in the compiler.
16787
16788         * cs-parser.jay (constructor_declaration): Update to new grammar,
16789         and provide a constructor_body that can be empty.
16790
16791 2002-03-15  Miguel de Icaza  <miguel@ximian.com>
16792
16793         * driver.cs: Add support for --resources.
16794
16795         * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
16796         Make all types for the various array helper methods be integer.
16797
16798         * ecore.cs (Expression.ConvertNumericExplicit): Pass the
16799         CheckState to ConvCast.
16800
16801         (ConvCast): Now it takes a `checked' state argument, to avoid
16802         depending on the emit context for the conversion, and just using
16803         the resolve time setting.
16804
16805         * expression.cs (ArrayCreation.EmitArrayArguments): New function,
16806         instead of Invocation.EmitArguments.  We do not emit the original
16807         arguments, instead we emit those which have been converted to
16808         unsigned int expressions.
16809
16810         * statement.cs (Block.EmitMeta): Drop tracking of indexes.
16811
16812         * codegen.cs: ditto.
16813
16814         * expression.cs (LocalVariableReference): Drop the use of the
16815         Store function that depended on the variable index.
16816
16817         * statement.cs (VariableInfo): Drop the `Idx' property from this
16818         class, as this is not taking into account the indexes for
16819         temporaries tat we generate during the execution, getting the
16820         indexes wrong.
16821
16822         * class.cs: First emit class initializers, then call the parent
16823         constructor. 
16824
16825         * expression.cs (Binary): Fix opcode emision.
16826         (UnaryMutator.EmitCode): Support checked code generation
16827
16828         * ecore.cs (MemberLookup): TypeManager.FindMembers will return
16829         matches for events for both the Static and Instance scans,
16830         pointing to the same element.   Fix that.
16831
16832 2002-03-14  Miguel de Icaza  <miguel@ximian.com>
16833
16834         * rootcontext.cs (ResolveTree): Always set the
16835         interface_resolve_order, because nested interfaces will be calling
16836         into us.
16837
16838         * class.cs (GetInterfaceOrClass): Track the same resolution
16839         process used by TypeManager.LookupType.  This fixes the nested
16840         type lookups in class declarations (separate path from
16841         LookupType). 
16842
16843         (TypeContainer.DefineType): Also define nested interfaces.
16844         (TypeContainer.RegisterOrder): New public function used to
16845         register the order in which child interfaces need to be closed.
16846
16847         Nested interfaces need to be closed after their parents have been
16848         created. 
16849
16850         * interface.cs (InterfaceAttr): Put all the logic for computing
16851         the interface attribute here. 
16852
16853         (DefineInterface): Register our interface order with the
16854         RootContext or with the TypeContainer depending on the case.
16855
16856 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
16857
16858         * cs-parser.jay: rework foreach statement to work with the new
16859         changes to the policy on SimpleNames.
16860
16861         * report.cs: support Stacktrace on warnings as well.
16862
16863         * makefile: drop --unsafe and /unsafe from the compile.
16864
16865 2002-03-13  Ravi Pratap  <ravi@ximian.com>
16866
16867         * ecore.cs (StandardConversionExists): Modify to take an Expression
16868         as the first parameter. Ensure we do null -> reference type conversion
16869         checking.
16870
16871         * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
16872         temporary Expression objects.
16873
16874 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
16875
16876         * interface.cs: workaround bug in method overloading resolution
16877         (there is already a bugzilla bug for it).
16878
16879 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
16880
16881         We could also solve this problem by having a separate path for
16882         performing type lookups, instead of DoResolve, we could have a
16883         ResolveType entry point, and only participating pieces of the
16884         production (simplename, deref, array) would implement this. 
16885
16886         * codegen.cs (EmitContext): New field OnlyLookupTypes used to
16887         signal SimpleName to only resolve type names and not attempt to
16888         resolve anything else.
16889
16890         * expression.cs (Cast): Set the flag.
16891
16892         * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
16893
16894         * class.cs: Only report 108 if there is no `new' modifier.
16895
16896         * cs-parser.jay: rework foreach statement to work with the new
16897         changes to the policy on SimpleNames.
16898         
16899         * report.cs: support Stacktrace on warnings as well.
16900
16901         * makefile: drop --unsafe and /unsafe from the compile.
16902
16903 2002-03-11  Miguel de Icaza  <miguel@ximian.com>
16904
16905         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
16906         lookups here, instead of doing that at parse time.  This means
16907         that our grammar will not introduce `LocalVariableReferences' as
16908         expressions at this point.  That solves the problem of code like
16909         this:
16910
16911         class X {
16912            static void Main ()
16913            { int X = 1;
16914             { X x = null }}}
16915
16916         This is only half the fix.  The full fix requires parameters to
16917         also be handled in this way.
16918
16919         * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
16920         makes the use more obvious of the DeclSpace.  The
16921         ec.TypeContainer.TypeBuilder is now only used to pull the
16922         TypeBuilder for it.
16923
16924         My theory is that I can get rid of the TypeBuilder completely from
16925         the EmitContext, and have typecasts where it is used (from
16926         DeclSpace to where it matters).  
16927
16928         The only pending problem is that the code that implements Aliases
16929         is on TypeContainer, and probably should go in DeclSpace.
16930
16931         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
16932         lookups here, instead of doing that at parse time.  This means
16933         that our grammar will not introduce `LocalVariableReferences' as
16934         expressions at this point.  That solves the problem of code like
16935         this:
16936
16937         class X {
16938            static void Main ()
16939            { int X = 1;
16940             { X x = null }}}
16941
16942         This is only half the fix.  The full fix requires parameters to
16943         also be handled in this way.
16944
16945         * class.cs (Property.DefineMethod): When implementing an interface
16946         method, set newslot, when implementing an abstract method, do not
16947         set the flag (before we tried never setting it, or always setting
16948         it, which is the difference).
16949         (Indexer.DefineMethod): same.
16950         (Method.DefineMethod): same.
16951
16952         * ecore.cs: Only set the status used flag if we get back a Field.
16953
16954         * attribute.cs: Temporary hack, so Paolo can keep working.
16955
16956 2002-03-08  Ravi Pratap  <ravi@ximian.com>
16957
16958         * attribute.cs (Attribute.UnmanagedType): This is to keep track of
16959         the unmanaged type in the case we have a MarshalAs attribute.
16960
16961         (Resolve): Handle the case when we are parsing the special MarshalAs
16962         attribute [we need to store the unmanaged type to use later]
16963
16964         * typemanager.cs (marshal_as_attr_type): Built in type for the 
16965         MarshalAs Attribute.
16966
16967         * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute 
16968         on parameters and accordingly set the marshalling info.
16969
16970 2002-03-09  Miguel de Icaza  <miguel@ximian.com>
16971
16972         * class.cs: Optimizing slightly by removing redundant code after
16973         we switched to the `NoTypes' return value.
16974         (Property.DefineMethod): use NoTypes here too.
16975
16976         This fixes the bug I introduced in my last batch of changes.
16977
16978 2002-03-05  Ravi Pratap  <ravi@ximian.com>
16979
16980         * tree.cs (RecordEnum): Add. We now keep track of enums too.
16981
16982         * class.cs (LookupInterfaceOrClass): Check against the list of recorded
16983         Enums since those are types too. 
16984
16985         * cs-parser.jay (enum_declaration): Record enums as we parse them.
16986
16987         * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined 
16988         thanks to a call during the lookup process.
16989
16990 2002-03-07  Miguel de Icaza  <miguel@ximian.com>
16991
16992         * statement.cs (Foreach): Lots of work to accomodate a particular
16993         kind of foreach statement that I had not kept in mind.  It is
16994         possible to have foreachs on classes that provide a GetEnumerator
16995         method that return objects that implement the "pattern" for using
16996         a foreach, there is no need to support GetEnumerator
16997         specifically. 
16998
16999         This is needed to compile nant.
17000
17001         * decl.cs: Only report 114 if the member is not `Finalize' and if
17002         the warning level is at least 2.
17003
17004         * class.cs: Moved the compare function from Method to
17005         MethodSignature. 
17006
17007         (MethodSignature.InheritableMemberSignatureCompare): Add new
17008         filter function that is used to extract inheritable methods from a
17009         class. 
17010
17011         (Method.Define): Use the new `inheritable_method_signature_filter'
17012         delegate
17013
17014         * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
17015         command. 
17016
17017 2002-03-06  Miguel de Icaza  <miguel@ximian.com>
17018
17019         * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
17020
17021         * cs-parser.jay: Add opt_semicolon to the interface declaration.
17022
17023         * expression.cs: Pass location information to
17024         ConvertImplicitStandard. 
17025
17026         * class.cs: Added debugging code to track return values from
17027         interfaces. 
17028
17029 2002-03-05  Miguel de Icaza  <miguel@ximian.com>
17030
17031         * expression.cs (Is.DoResolve): If either side of the `is' is an
17032         interface, do not flag the warning.
17033
17034         * ecore.cs (ImplicitReferenceConversion): We need a separate test
17035         for interfaces
17036
17037         * report.cs: Allow for --fatal to be used with --probe.
17038
17039         * typemanager.cs (NoTypes): Move the definition for the empty Type
17040         array here. 
17041
17042         * class.cs (TypeContainer.FindMembers): Also look for methods defined by
17043         properties. 
17044         (TypeContainer.DefineProxy): New function used to proxy to parent
17045         implementations when implementing interfaces.
17046         (TypeContainer.ParentImplements): used to lookup if our parent
17047         implements a public function that is required by an interface.
17048         (TypeContainer.VerifyPendingMethods): Hook this up.
17049
17050         * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
17051         `modules' and `assemblies' arraylists into arrays.  We only grow
17052         these are the very early start up of the program, so this improves
17053         the speedof LookupType (nicely measured).
17054
17055         * expression.cs (MakeByteBlob): Replaced unsafe code with
17056         BitConverter, as suggested by Paolo.
17057
17058         * cfold.cs (ConstantFold.Binary): Special case: perform constant
17059         folding of string concatenation, but if either side is a string,
17060         and the other is not, then return null, and let the runtime use
17061         the concatenation on the string plus the object (using
17062         `Object.ToString'). 
17063
17064 2002-03-04  Miguel de Icaza  <miguel@ximian.com>
17065
17066         Constant Folding has been implemented now.
17067
17068         * expression.cs (Unary.Reduce): Do not throw an exception, catch
17069         the error instead on types that are not supported in one's
17070         complement. 
17071
17072         * constant.cs (Constant and all children): New set of functions to
17073         perform implict and explicit conversions.
17074
17075         * ecore.cs (EnumConstant): Implement the new functions to perform
17076         conversion by proxying to the child expression.
17077
17078         * codegen.cs: (ConstantCheckState): Constant evaluation has its
17079         own separate setting that can not be turned off from the command
17080         line using --unchecked or --checked and is only controlled using
17081         the checked/unchecked statements and expressions.  This setting is
17082         used by the constant folder to flag errors.
17083
17084         * expression.cs (CheckedExpr, UncheckedExpr): Set the
17085         ConstantCheckState as well.   
17086
17087         During Resolve, they also have to flag the state, because the
17088         constant folder runs completely in the Resolve phase.
17089
17090         * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
17091         well.
17092
17093 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
17094
17095         * cfold.cs: New file, this file contains the constant folder.
17096
17097         * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
17098         argument to track whether we are using the resulting address to
17099         load or store a value and provide better error messages. 
17100
17101         (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
17102         new AddressOf arguments.
17103
17104         * statement.cs (Foreach.EmitCollectionForeach): Update
17105
17106         * expression.cs (Argument.Emit): Call AddressOf with proper
17107         arguments to track usage.
17108
17109         (New.DoEmit): Call AddressOf with new arguments.
17110
17111         (Unary.Emit): Adjust AddressOf call.
17112
17113 2002-03-01  Ravi Pratap  <ravi@ximian.com>
17114
17115         * cs-parser.jay (member_access): Change the case for pre-defined types
17116         to use a MemberAccess instead of a SimpleName. Thanks to Felix again for 
17117         this suggestion.
17118
17119         * class.cs (Operator::Emit): If we are abstract or extern, we don't have
17120         a method body.
17121
17122         * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
17123         essentially like methods and apply attributes like MethodImplOptions to them too.
17124
17125         * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
17126         not being null.
17127
17128         * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
17129         DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
17130         is the DeclSpace.
17131
17132         * Update code everywhere accordingly.
17133
17134         * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
17135
17136         * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
17137
17138 2002-02-28  Ravi Pratap  <ravi@ximian.com>
17139
17140         * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
17141         try performing lookups against those instead of jumping straight into using
17142         the 'using' clauses.
17143
17144         (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
17145
17146         (LookupType): Perform lookups in implicit parents too.
17147
17148         * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
17149         sequence as RootContext.LookupType. 
17150
17151         * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries 
17152         the various cases of namespace lookups into this method.
17153
17154 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
17155
17156         * cs-parser.jay: Add support for [Attribute ()] (empty arguments
17157         in positional arguments)
17158
17159         * class.cs (Operator): Update the AllowedModifiers to contain
17160         extern. 
17161
17162         * cs-parser.jay: Update operator declaration to allow for the
17163         operator body to be empty.
17164
17165         * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
17166         values. 
17167
17168 2002-02-27  Miguel de Icaza  <miguel@ximian.com>
17169
17170         * class.cs (Method.Emit): Label parameters.
17171
17172         * driver.cs: Return 1 or 0 as the program exit code.
17173
17174 2002-02-26  Miguel de Icaza  <miguel@ximian.com>
17175
17176         * expression.cs: Special case the `null' object when trying to
17177         auto-compute the type, as anything can be explicitly converted to
17178         that. 
17179
17180         * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
17181         spotting this Paolo.
17182
17183         (Expression.ImplicitNumericConversion): Perform comparissions of
17184         the type using the underlying type in the case of an enumeration
17185         rather than using the enumeration type for the compare.
17186
17187         Cope with the underlying == type case, which is not possible to
17188         catch before. 
17189
17190         (Expression.ConvertNumericExplicit): Perform comparissions of
17191         the type using the underlying type in the case of an enumeration
17192         rather than using the enumeration type for the compare.
17193
17194         * driver.cs: If the user does not supply an extension, assume .exe
17195
17196         * cs-parser.jay (if_statement): Rewrote so that we can track the
17197         location for the if statement.
17198
17199         * expression.cs (Binary.ConstantFold): Only concat strings when
17200         the operation is "+", not everything ;-)
17201
17202         * statement.cs (Statement.EmitBoolExpression): Take a location
17203         argument. 
17204         (If, While, Do): Track location.
17205
17206         * expression.cs (Binary.ResolveOperator): In the object + string
17207         case, I was missing a call to ConvertImplicit
17208
17209 2002-02-25  Ravi Pratap  <ravi@ximian.com>
17210
17211         * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
17212         Location arguments. Ensure we use RootContext.LookupType to do our work
17213         and not try to do a direct Type.GetType and ModuleBuilder.GetType
17214
17215         * interface.cs (PopulateMethod): Handle the type of the parameter being
17216         null gracefully.
17217
17218         * expression.cs (Invocation.BetterFunction): Handle the case when we 
17219         have a params method with no fixed arguments and a call is made with no
17220         arguments.
17221
17222 2002-02-25  Miguel de Icaza  <miguel@ximian.com>
17223
17224         * cs-tokenizer.cs: Add support for the quote-escape-sequence in
17225         the verbatim-string-literal
17226
17227         * support.cs (InternalParameters.ParameterModifier): handle null
17228         fixed parameters.
17229         (InternalParameters.ParameterType): ditto.
17230
17231         * parameter.cs (VerifyArgs): Also check if the fixed parameter is
17232         duplicating the name of the variable parameter.
17233         (GetParameterByName): Fix bug where we were not looking up array
17234         paramters if they were the only present (thanks Paolo!).
17235         (GetParameterInfo): We only have an empty set of types if both
17236         fixed and array are set to null.
17237         (GetParameterInfo-idx): Handle FixedParameter == null
17238
17239         * cs-parser.jay: Handle the case where there is no catch
17240         statements (missing null test).
17241
17242 2002-02-22  Miguel de Icaza  <miguel@ximian.com>
17243
17244         * driver.cs (MainDriver): Be conservative on our command line
17245         handling.
17246
17247         Catch DirectoryNotFoundException when calling GetFiles.
17248
17249         (SplitPathAndPattern): Used to split the input specification into
17250         a path and a pattern that we can feed to Directory.GetFiles.
17251
17252 2002-02-21  Miguel de Icaza  <miguel@ximian.com>
17253
17254         * statement.cs (Fixed): Implement the last case of the Fixed
17255         statement (string handling).
17256
17257         * expression.cs (StringPtr): New class used to return a char * to
17258         a string;  Used by the Fixed statement.
17259
17260         * typemanager.cs: Add char_ptr_type.  Add get_OffsetToStringData method.
17261
17262         * expression.cs (Binary.ResolveOperator): Remove redundant
17263         MemberLookup pn parent type.
17264         Optimize union call, we do not need a union if the types are the same.
17265         (Unary.ResolveOperator): REmove redundant MemberLookup on parent
17266         type.
17267
17268         Specialize the use of MemberLookup everywhere, instead of using
17269         the default settings. 
17270
17271         (StackAlloc): Implement stackalloc keyword.
17272
17273         * cs-parser.jay: Add rule to parse stackalloc.
17274
17275         * driver.cs: Handle /h, /help, /?
17276
17277         * expression.cs (MakeByteBlob): Removed the hacks we had in place
17278         before we supported unsafe code.
17279
17280         * makefile: add --unsafe to the self compilation of mcs.
17281
17282 2002-02-20  Miguel de Icaza  <miguel@ximian.com>
17283
17284         * expression.cs (PointerArithmetic): New class that is used to
17285         perform pointer arithmetic.
17286         (Binary.Resolve): Handle pointer arithmetic
17287         Handle pointer comparission.
17288         (ArrayPtr): Utility expression class that is used to take the
17289         address of an array.
17290
17291         (ElementAccess): Implement array access for pointers
17292
17293         * statement.cs (Fixed): Implement fixed statement for arrays, we
17294         are missing one more case before we are done.
17295
17296         * expression.cs (Indirection): Implement EmitAssign and set the
17297         ExprClass to Variable.  This allows pointer dereferences to be
17298         treated as variables, and to have values assigned to them.
17299
17300         * ecore.cs (Expression.StoreFromPtr): New utility function to
17301         store values dereferencing.
17302
17303 2002-02-20  Ravi Pratap  <ravi@ximian.com>
17304
17305         * expression.cs (Binary.ResolveOperator): Ensure that we are
17306         not trying to operate on a void type - this fixes the reported
17307         bug.
17308
17309         * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
17310         the parent implementation is sealed.
17311
17312         * ../errors/cs0239.cs : Add.
17313
17314         * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
17315
17316         * typemanager.cs (unverifiable_code_type): Corresponds to 
17317         System.Security.UnverifiableCodeAttribute. We need to emit this for modules
17318         which have unsafe code in them.
17319
17320         * rootcontext.cs (EmitCode): Emit the above attribute when we are in an 
17321         unsafe context.
17322
17323 2002-02-19  Miguel de Icaza  <miguel@ximian.com>
17324
17325         * cs-tokenizer.cs: Add support for @"litreal strings"
17326
17327         Make tokenizer accept pre-processor directives
17328         on any column (remove the old C-like limitation). 
17329
17330         * rootcontext.cs (EmitCode): Emit any global attributes.
17331         (AddGlobalAttributes): Used to keep track of assembly attributes. 
17332
17333         * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
17334
17335         * cs-parser.jay: Add support for global attributes.  
17336
17337 2002-02-17  Miguel de Icaza  <miguel@ximian.com>
17338
17339         * expression.cs (Indirection): New helper class.  Unary will
17340         create Indirection classes to be able to implement the
17341         IMemoryLocation interface on it.
17342
17343 2002-02-16  Miguel de Icaza  <miguel@ximian.com>
17344
17345         * cs-parser.jay (fixed_statement): reference the right statement.
17346
17347         * statement.cs (Fixed.Emit): Finish implementing the fixed
17348         statement for the &x case.
17349
17350 2002-02-14  Miguel de Icaza  <miguel@ximian.com>
17351
17352         * class.cs (Property.Define, Method.Define): Remove newslot when
17353         `implementing'.  
17354
17355         * modifiers.cs: My use of NewSlot when `Abstract' was set was
17356         wrong.  NewSlot should only be used if the `new' keyword is present.
17357
17358         * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
17359         locating our system dir.  Sorry about this.
17360
17361 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
17362
17363         * driver.cs (GetSystemDir): Compute correctly the location of our
17364         system assemblies.  I was using the compiler directory instead of
17365         the library directory.
17366
17367 2002-02-13  Ravi Pratap  <ravi@ximian.com>
17368
17369         * expression.cs (BetterFunction): Put back in what Miguel commented out
17370         since it is the correct fix. The problem is elsewhere ;-)
17371
17372         (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
17373         parameters of the parms method are themselves compatible or not !
17374
17375         (StandardConversionExists): Fix very dangerous bug where we were forgetting
17376         to check that a class implements an interface before saying that an implicit
17377         conversion was allowed. Use ImplementsInterface to do the checking.
17378
17379 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
17380
17381         * class.cs (Method.Define): Track whether we are an explicit
17382         implementation or not.  And only call DefineMethodOverride if we
17383         are an explicit implementation.
17384
17385         (Property.DefineMethod): Ditto.
17386
17387 2002-02-11  Ravi Pratap  <ravi@ximian.com>
17388
17389         * expression.cs (BetterFunction): Catch hideous bug which was
17390          preventing us from detecting ambiguous calls due to implicit casts i.e
17391         cs0121.
17392
17393 2002-01-29  Miguel de Icaza  <miguel@ximian.com>
17394
17395         * support.cs (Pair): Remove un-needed method.  I figured why I was
17396         getting the error in cs-parser.jay, the variable in a foreach loop
17397         is readonly, and the compiler does not really treat this as a variable.
17398
17399         * cs-parser.jay (fixed_statement): Fix grammar.  Use ASSIGN
17400         instead of EQUALS in grammar.  
17401
17402         * typemanager.cs (VerifyUnmanaged): Report correct error (208)
17403
17404         * expression.cs (Unary.DoResolve): Check whether the argument is
17405         managed or not.
17406
17407 2002-01-28  Miguel de Icaza  <miguel@ximian.com>
17408
17409         * support.cs: Api for Pair to set a value.  Despite the fact that
17410         the variables are public the MS C# compiler refuses to compile
17411         code that accesses the field if the variable is part of a foreach
17412         statement. 
17413
17414         * statement.cs (Fixed): Begin implementation of the fixed
17415         statement.
17416
17417         (Block.AddVariable): Return the VariableInfo on success and null
17418         on failure instead of true/false. 
17419
17420         * cs-parser.jay (foreach): Catch errors on variables already
17421         defined (we were ignoring this value before) and properly unwind
17422         the block hierarchy
17423
17424         (fixed_statement): grammar for the fixed statement.
17425
17426 2002-01-25  Miguel de Icaza  <miguel@ximian.com>
17427
17428         * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
17429         pointer types to be incretemented.
17430
17431         (SizeOf): Implement.
17432
17433         * cs-parser.jay (pointer_member_access): Implement
17434         expr->IDENTIFIER production.
17435
17436         * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
17437         MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
17438         on safe contexts.
17439
17440         (Unary): Implement indirection.
17441
17442         * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
17443         use in non-unsafe context).
17444
17445         (SimpleName.DoResolve): Check for pointers in field access on safe
17446         contexts. 
17447
17448         (Expression.LoadFromPtr): Factor the load-indirect code in this
17449         function.  This was duplicated in UnboxCast and ParameterReference
17450
17451 2002-01-24  Miguel de Icaza  <miguel@ximian.com>
17452
17453         * expression.cs (ComposedCast): report an error if a pointer cast
17454         is used in a safe region.
17455
17456         * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
17457         pointer type casts in unsafe context.
17458
17459         * codegen.cs (EmitContext): Set up IsUnsafe.
17460
17461         * cs-parser.jay (non_expression_type): Add productions for pointer
17462         casts. 
17463
17464         * expression.cs (Invocation.EmitCall): Remove chunk of buggy
17465         code.  We should not use force into static mode if the method is
17466         not virtual.  Fixes bug in MIS
17467
17468         * statement.cs (Do.Emit, While.Emit, For.Emit,
17469         Statement.EmitBoolExpression): Add support to Do and While to
17470         propagate infinite loop as `I do return' semantics.
17471
17472         Improve the For case to also test for boolean constants.
17473
17474         * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
17475         to the list of attributes we can add.
17476
17477         Remove `EmitContext' argument.
17478
17479         * class.cs (Method.Define): Apply parameter attributes.
17480         (Constructor.Define): Apply parameter attributes.
17481         (MethodCore.LabelParameters): Move here the core of labeling
17482         parameters. 
17483
17484         * support.cs (ReflectionParameters.ParameterModifier,
17485         InternalParameters.ParameterModifier): Use IsByRef on the type and
17486         only return the OUT bit for these parameters instead of in/out/ref
17487         flags.
17488
17489         This is because I miss-understood things.  The ParameterInfo.IsIn
17490         and IsOut represent whether the parameter has the [In] and [Out]
17491         attributes set.  
17492
17493 2002-01-22  Miguel de Icaza  <miguel@ximian.com>
17494
17495         * ecore.cs (FieldExpr.Emit): Release temporaries.
17496
17497         * assign.cs (LocalTemporary.Release): new function.
17498
17499         * codegen.cs (EmitContext.GetTemporaryStorage,
17500         EmitContext.FreeTemporaryStorage): Rework the way we deal with
17501         temporary storage.  Now we can "put back" localbuilders when we
17502         are done with them
17503
17504 2002-01-21  Miguel de Icaza  <miguel@ximian.com>
17505
17506         * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
17507         need to make a copy of the variable to generate verifiable code.
17508
17509 2002-01-19  Miguel de Icaza  <miguel@ximian.com>
17510
17511         * driver.cs: Compute dynamically the system directory.
17512
17513         * ecore.cs (CopyNewMethods): reworked, exposed, made public.
17514         Slower, but more generally useful.  Used by the abstract
17515         registering implementation. 
17516
17517         * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
17518         the rules for the special rule on Type/instances.  First check if
17519         we have the same name, and if so, try that special static path
17520         rather than the instance path.
17521
17522 2002-01-18  Miguel de Icaza  <miguel@ximian.com>
17523
17524         * cs-parser.jay: Emit 642 (warning: possible empty statement) for
17525         for, while and if.
17526
17527         * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
17528         Enum, ValueType, Delegate or Array for non-corlib compiles.
17529
17530         * cs-tokenizer.cs: Catch long identifiers (645)
17531
17532         * typemanager.cs (IndexerPropetyName): Ravi never tested this
17533         piece of code.
17534
17535         * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
17536         fix, we were returning too early, so we were not registering
17537         pending methods from abstract classes.
17538
17539         Do not register pending methods if the class is abstract.
17540
17541         * expression.cs (Conditional.DoResolve): Report circular implicit
17542         conversions when we neecd to compute it for conditional
17543         expressions. 
17544
17545         (Is.DoResolve): If the expression is always of the provided type,
17546         flag warning 183.  If the expression can not ever be of the
17547         provided type flag warning 184.
17548
17549         * class.cs: Catch 169 as well.
17550
17551         * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
17552         read. 
17553
17554 2002-01-18  Nick Drochak  <ndrochak@gol.com>
17555
17556         * makefile: remove path to beta2 csc.exe.  path to csc.exe must be in PATH instead.
17557
17558 2002-01-17  Miguel de Icaza  <miguel@ximian.com>
17559
17560         * interface.cs: (PopulateMethod): Check for pointers being defined
17561         only if the unsafe context is active.
17562         (PopulateProperty): ditto.
17563         (PopulateIndexer): ditto.
17564
17565         * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
17566         specified.  If pointers are present, make sure that they are
17567         present in an unsafe context.
17568         (Constructor, Constructor.Define): ditto.
17569         (Field, Field.Define): ditto.
17570         (Property, Property.Define): ditto.
17571         (Event, Event.Define): ditto.
17572
17573         * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
17574         hashtable if there are classes or structs defined.
17575
17576         * expression.cs (LocalVariableReference.DoResolve): Simplify this
17577         code, as the constant resolution moved.
17578
17579         * statement.cs (Block.EmitMeta): Resolve all constants as we emit
17580         the metadata, so we can flag error 133. 
17581
17582         * decl.cs (MemberCore.UnsafeOK): New function to test that a
17583         pointer is being declared in an unsafe context.
17584
17585 2002-01-16  Miguel de Icaza  <miguel@ximian.com>
17586
17587         * modifiers.cs (Modifiers.Check): Require a Location argument.
17588         Report error 227 for Unsafe use.
17589
17590         * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
17591
17592         * statement.cs (For.Emit): If the test is null, then report that
17593         we do `return', as we wont reach anything afterwards.
17594
17595         (Switch.SwitchGoverningType): Track the expression that matched
17596         the conversion.
17597
17598         * driver.cs: Allow negative numbers as an error code to flag.
17599
17600         * cs-parser.jay: Handle 1551.
17601
17602         * namespace.cs: Add 1537 checking (repeated using alias namespaces).
17603
17604 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
17605
17606         * cs-parser.jay: Report 1518 (type declaration can only contain
17607         class, struct, interface, enum or delegate)
17608
17609         (switch_label): Report 1523 (keywords `case' or `default' must
17610         preced code)
17611
17612         (opt_switch_sections): Report 1522 (empty switch)
17613
17614         * driver.cs: Report 1515 (response file specified multiple times)
17615         Report 1516 (Source file specified multiple times).
17616
17617         * expression.cs (Argument.Resolve): Signal 1510
17618
17619         (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
17620         access not allowed in static code)
17621
17622 2002-01-11  Ravi Pratap  <ravi@ximian.com>
17623
17624         * typemanager.cs (IsPointerType): Utility method which we are going
17625         to need a lot.
17626
17627         * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
17628         the object type, so we take care of that.
17629
17630         * expression.cs (FullMethodDesc): Also include the return type in descriptions.
17631
17632         * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
17633         added to non-params parameters :-)
17634
17635         * typemanager.cs (CSharpName): Include 'void' type too. 
17636
17637         (void_ptr_type): Include in the set of core types.
17638
17639         * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of 
17640         duplicating code.
17641
17642         (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have 
17643         an unsafe context.
17644
17645         * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had 
17646         completely forgotten about it.
17647
17648 2002-01-10  Ravi Pratap  <ravi@ximian.com>
17649
17650         * cs-parser.jay (pointer_type): Add. This begins our implementation
17651         of parsing rules for unsafe code.
17652
17653         (unsafe_statement): Implement.
17654
17655         (embedded_statement): Modify to include the above.
17656
17657         * statement.cs (Unsafe): Implement new class for unsafe blocks.
17658
17659         * codegen.cs (EmitContext.InUnsafe): Add. This determines
17660         if the current context is an unsafe one.
17661
17662         * cs-parser.jay (local_variable_pointer_type): Since local variable types
17663         are handled differently, we need separate rules for them.
17664
17665         (local_variable_declaration): Update to use local_variable_pointer_type
17666         to allow variable declarations of unmanaged pointer types.
17667
17668         * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
17669         in unsafe contexts.
17670
17671         * ../errors/cs0214.cs : Add.
17672
17673 2002-01-16  Nick Drochak  <ndrochak@gol.com>
17674
17675         * makefile: remove 'response' file when cleaning.
17676
17677 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
17678
17679         * cs-parser.jay: Report 1524.
17680
17681 2002-01-14  Miguel de Icaza  <miguel@ximian.com>
17682
17683         * typemanager.cs (RegisterMethod): drop checking if we have
17684         registered this from here
17685
17686 2002-01-12  Miguel de Icaza  <miguel@ximian.com>
17687
17688         * class.cs (Method.EmitDestructor): Implement calling our base
17689         destructor. 
17690
17691         * statement.cs (Try.Emit): Fix to reset the InFinally to the old
17692         value of InFinally.
17693
17694         * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
17695         this routine and will wrap the call in a try/catch block.  Deal
17696         with the case.
17697
17698 2002-01-11  Miguel de Icaza  <miguel@ximian.com>
17699
17700         * ecore.cs (Expression.MemberLookup): instead of taking a
17701         parameter `same_type' that was used to tell whether we could
17702         access private members we compute our containing type from the
17703         EmitContext.
17704
17705         (FieldExpr): Added partial support for volatile fields.  This does
17706         not work for volatile fields exposed from assemblies, as I can not
17707         figure out how to extract the modreq from it.
17708
17709         Updated all the source files to use this.
17710
17711         * codegen.cs (EmitContext): Compute ContainerType ahead of time,
17712         because it is referenced by MemberLookup very often. 
17713
17714 2002-01-09  Ravi Pratap  <ravi@ximian.com>
17715
17716         * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
17717         TypeBuilder.GetCustomAttributes to retrieve what we need.
17718
17719         Get rid of redundant default_member_attr_type as this is the same as
17720         default_member_type which already exists.
17721
17722         * interface.cs, attribute.cs : Update accordingly.
17723
17724 2002-01-08  Miguel de Icaza  <miguel@ximian.com>
17725
17726         * typemanager.cs: Enable IndexerPropertyName again.  It does not
17727         work for TYpeBuilders though.  Ravi, can you please fix this?
17728
17729         * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
17730
17731         * expression.cs (Argument.Emit): Handle the case of ref objects
17732         being passed to ref functions;  
17733
17734         (ParameterReference.EmitLoad): Loads the content of the pointer
17735         without dereferencing.
17736
17737 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
17738
17739         * cs-tokenizer.cs: Implemented the pre-processing expressions.
17740
17741 2002-01-08  Ravi Pratap  <ravi@ximian.com>
17742
17743         * class.cs (Indexer.DefineMethod): Incorporate the interface
17744         type in the name of the method if we are doing explicit interface
17745         implementation.
17746
17747         * expression.cs (ConversionExists): Remove as it is completely obsolete.
17748
17749         (BetterConversion): Fix extremely trivial bug where we were referring to
17750         ConversionExists instead of StandardConversionExists ! Hooray, things are fine
17751         again !
17752
17753         * ../errors/bug16.cs : Add although we have fixed it.
17754
17755 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
17756
17757         * expression.cs (BaseIndexer): Begin implementation.
17758
17759         * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
17760
17761         * cs-parser.jay (indexer_declarator): Use qualified_identifier
17762         production directly to remove a shift/reduce, and implement
17763         explicit interface implementation.
17764
17765         * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
17766         after a floating point suffix.
17767
17768         * expression.cs (DoNumericPromotions): Improved the conversion for
17769         uint/uint.  If we have a constant, we avoid doing a typecast to a
17770         larger type.
17771
17772         * class.cs (Indexer): Implement explicit interface implementation
17773         for indexers.
17774
17775 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
17776
17777         * class.cs: make the default instance constructor public and hidebysig.
17778
17779 2001-01-03  Ravi Pratap  <ravi@ximian.com>
17780
17781         * interface.cs (EmitDefaultMemberAttr): Make this helper method static
17782         so we can call it from elsewhere.
17783
17784         * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
17785         we emit it internally if the class has a defined indexer; otherwise the user
17786         emits it by decorating the class definition with the DefaultMemberAttribute.
17787
17788         * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
17789         attribute is not used on a type which defines an indexer.
17790
17791         * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
17792         character when we skip whitespace.
17793
17794         * ../errors/cs0646.cs : Add.
17795
17796 2002-01-03  Miguel de Icaza  <miguel@ximian.com>
17797
17798         * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
17799         again. 
17800
17801         * makefile: Add practical target `mcs3.exe' which builds the third
17802         generation compiler. 
17803
17804         * expression.cs (New): Fix structures constructor calling.
17805
17806         * class.cs (Property, Method, Indexer): Emit Final flag on the
17807         method if we are an interface implementation and we are not
17808         abstract. 
17809
17810         * ecore.cs (PropertyExpr): New public field `IsBase', tells
17811         whether this property is referencing a `base' method.
17812
17813         * expression.cs (Invocation.EmitCall): take an extra argument:
17814         is_base, this is used to determine whether the `call' or
17815         `callvirt' opcode should be used.
17816
17817
17818         * delegate.cs: update EmitCall.
17819
17820         * class.cs (Method.Define): Set NewSlot for the cases where we are
17821         not implementing an interface method.
17822
17823         (Property.Define): ditto.
17824
17825 2002-01-02  Miguel de Icaza  <miguel@ximian.com>
17826
17827         * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
17828         'r'.  Allows mcs to parse itself fully.
17829
17830 2002-01-02  Ravi Pratap  <ravi@ximian.com>
17831
17832         * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
17833         of the number of initializers that require the InitializeArray method.
17834
17835         (CheckIndices): Store the Expression in all cases - not the plain value. Also
17836         update the above field where necessary.
17837
17838         (MakeByteBlob): Update accordingly.
17839
17840         (DoEmit): Call EmitStaticInitializers only if the number of initializers is 
17841         greater than 2.
17842
17843         (EmitDynamicInitializers): Update in accordance with the new optimization.
17844
17845         (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
17846         same OpCode applies.
17847
17848         * cs-parser.jay : Fix some glaring errors I introduced.
17849
17850 2002-01-01  Ravi Pratap  <ravi@ximian.com> 
17851
17852         * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
17853         so that we can check for name clashes there too.
17854
17855         * typemanager.cs (default_member_attr_type): The attribute that we need to emit
17856         for interface indexers.
17857
17858         * interfaces.cs (Define): Emit the default member attribute.
17859
17860         * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
17861         variable was being referred to while setting the value ;-)
17862
17863 2002-01-01  Miguel de Icaza  <miguel@ximian.com>
17864
17865         * expression.cs (MakeByteBlob): Optimize: we do not need to fill
17866         byte-by-byte information when we know the data is zero.
17867
17868         Make the block always a multiple of 4, because
17869         DefineInitializedData has a bug.
17870
17871         * assign.cs: Fix, we should assign from the temporary, not from
17872         the source. 
17873
17874         * expression.cs (MakeByteBlob): Fix my incorrect code.
17875
17876 2001-12-31  Miguel de Icaza  <miguel@ximian.com>
17877
17878         * typemanager.cs (EnumToUnderlying): This function is used to get
17879         the underlying type from an enumeration, because it does not
17880         always work. 
17881
17882         * constant.cs: Use the I4_S form for values between -128 and 127.
17883
17884         * statement.cs (Block.LookupLabel): Looks up a label.
17885         (Block): Drop support for labeled blocks.
17886
17887         (LabeledStatement): New kind of statement that represents a label
17888         only.
17889
17890         (Goto): Finally implement this bad boy.
17891
17892         * cs-parser.jay: Update to reflect new mechanism to implement
17893         labels.
17894
17895 2001-12-30  Miguel de Icaza  <miguel@ximian.com>
17896
17897         * codegen.cs (EmitContext.This): a codegen property that keeps the
17898         a single instance of this instead of creating many different this
17899         instances. 
17900
17901         * delegate.cs (Delegate.DoResolve): Update to use the property;
17902
17903         * ecore.cs (SimpleName.SimpleNameResolve): Ditto
17904
17905         * expression.cs (BaseAccess.DoResolve): Ditto.
17906
17907 2001-12-29  Ravi Pratap  <ravi@ximian.com>
17908
17909         * typemanager.cs (methodimpl_attr_type): Add to hold the type
17910         corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
17911
17912         (InitCoreTypes): Update accordingly.
17913
17914         * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
17915         so we can quickly store the state.
17916
17917         (ApplyAttributes): Set the correct implementation flags
17918         for InternalCall methods.
17919
17920 2001-12-29  Miguel de Icaza  <miguel@ximian.com>
17921
17922         * expression.cs (EmitCall): if a method is not virtual, then do
17923         not use callvirt on it.
17924
17925         (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
17926         user defined stuff) requires the use of stobj, which takes an
17927         address on the stack instead of an array and an index.  So emit
17928         the Ldelema operation for it.
17929
17930         (EmitStoreOpcode): Use stobj for valuetypes.
17931
17932         (UnaryMutator.EmitCode): Use the right 1 value depending on
17933         whether we are dealing with int64/uint64, float or doubles.
17934
17935         * class.cs (TypeContainer.AddConstructor): Fix the logic to define
17936         constructors that I implemented last night.
17937
17938         (Constructor.IsDefault): Fix to work properly for static
17939         constructors.
17940
17941         * cs-parser.jay (CheckDef): report method signature errors.
17942         Update error number 103 to be 132.
17943
17944         * decl.cs: New AdditionResult enumeration value: MethodExists.
17945         Although we do this check for methods later on in the semantic
17946         analysis, catching repeated default constructors is so easy that
17947         we catch these here. 
17948
17949         * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
17950         promotions code.
17951
17952         (ParameterReference.EmitAssign, Emit): handle
17953         bools as bytes.
17954
17955         (ArrayAccess.EmitLoadOpcode): Handle bool type here.
17956         (ArrayAccess.EmitStoreOpcode): ditto.
17957
17958         * cs-tokenizer.cs (is_punct): Eliminated empty computation.
17959
17960         * expression.cs (MakeByteBlob): Complete all the missing types
17961         (uint, short, ushort, byte, sbyte)
17962
17963         * class.cs: Only init instance field initializers on instance
17964         constructors. 
17965
17966         Rename `constructors' to instance_constructors. 
17967
17968         (TypeContainer.AddConstructor): Only add constructors to the list
17969         if it is not static.
17970
17971         Make sure that we handle default_static_constructor independently
17972         everywhere where we handle instance_constructors
17973
17974 2001-12-28  Miguel de Icaza  <miguel@ximian.com>
17975
17976         * class.cs: Do not lookup or create a base initializer for a
17977         static constructor.
17978
17979         (ConstructorInitializer.Resolve): use the proper type to lookup
17980         for constructors.
17981
17982         * cs-parser.jay: Report error 1585 (modifiers between type and name).
17983
17984         * enum.cs, interface.cs: Remove CloseType, this is taken care by
17985         in DeclSpace. 
17986
17987         * decl.cs: CloseType is now an virtual method, the default
17988         implementation just closes this type.
17989
17990 2001-12-28  Ravi Pratap  <ravi@ximian.com>
17991
17992         * attribute.cs (DefinePInvokeMethod): Set the implementation flags
17993         to PreserveSig by default. Also emit HideBySig on such methods.
17994
17995         Basically, set the defaults to standard values.
17996
17997         * expression.cs (Invocation.BetterFunction): We need to make sure that for each
17998         argument, if candidate is better, it can't be worse than the best !
17999
18000         (Invocation): Re-write bits to differentiate between methods being
18001         applicable in their expanded form and their normal form - for params
18002         methods of course.
18003
18004         Get rid of use_standard everywhere as only standard conversions are allowed
18005         in overload resolution. 
18006
18007         More spec conformance.
18008
18009 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
18010
18011         * driver.cs: Add --timestamp, to see where the compiler spends
18012         most of its time.
18013
18014         * ecore.cs (SimpleName.DoResolve): Do not create an implicit
18015         `this' in static code.
18016
18017         (SimpleName.DoResolve): Implement in terms of a helper function
18018         that allows static-references to be passed upstream to
18019         MemberAccess.
18020
18021         (Expression.ResolveWithSimpleName): Resolve specially simple
18022         names when called by MemberAccess to implement the special
18023         semantics. 
18024
18025         (Expression.ImplicitReferenceConversion): Handle conversions from
18026         Null to reference types before others, as Null's type is
18027         System.Object. 
18028
18029         * expression.cs (Invocation.EmitCall): Handle the special case of
18030         calling methods declared on a reference type from a ValueType
18031         (Base classes System.Object and System.Enum)
18032
18033         (MemberAccess.Resolve): Only perform lookups on Enumerations if
18034         the left hand side is a TypeExpr, not on every enumeration. 
18035
18036         (Binary.Resolve): If types are reference types, then do a cast to
18037         object on operators != and == of both arguments.
18038
18039         * typemanager.cs (FindMembers): Extract instance and static
18040         members if requested.
18041
18042         * interface.cs (PopulateProperty): Use void_type instead of null
18043         as the return type for the setter method.
18044
18045         (PopulateIndexer): ditto.
18046
18047 2001-12-27  Ravi Pratap  <ravi@ximian.com>
18048
18049         * support.cs (ReflectionParameters): Fix minor bug where we
18050         were examining the wrong parameter for the ParamArray attribute.
18051
18052         Cope with requests for the type of the parameter at position
18053         greater than the params parameter's. We now return the element
18054         type of the params array as that makes more sense.
18055
18056         * expression.cs (Invocation.IsParamsMethodApplicable): Update 
18057         accordingly as we no longer have to extract the element type
18058         ourselves.
18059
18060         (Invocation.OverloadResolve): Update.
18061
18062 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
18063
18064         * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
18065         against IEnumerator, test whether the return value is a descendant
18066         of the IEnumerator interface.
18067
18068         * class.cs (Indexer.Define): Use an auxiliary method to implement
18069         the other bits of the method definition.  Begin support for
18070         explicit interface implementation.
18071
18072         (Property.DefineMethod): Use TypeManager.void_type instead of null
18073         for an empty return value.
18074
18075 2001-12-26  Miguel de Icaza  <miguel@ximian.com>
18076
18077         * expression.cs (MemberAccess.ResolveMemberAccess): if we are
18078         dealing with a FieldExpr which is composed of a FieldBuilder, in
18079         the code path we did extract the constant, but we should have
18080         obtained the underlying value to be able to cast it (otherwise we
18081         end up in an infinite loop, this is what Ravi was running into).
18082
18083         (ArrayCreation.UpdateIndices): Arrays might be empty.
18084
18085         (MemberAccess.ResolveMemberAccess): Add support for section
18086         14.5.4.1 that deals with the special case of E.I when E is a type
18087         and something else, that I can be a reference to a static member.
18088
18089         (ArrayCreation.MakeByteBlob): It is not an error to not be able to
18090         handle a particular array type to create byte blobs, it is just
18091         something we dont generate byteblobs for.
18092
18093         * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
18094         arguments. 
18095
18096         * location.cs (Push): remove the key from the hashtable that we
18097         are about to add.   This happens for empty files.
18098
18099         * driver.cs: Dispose files after we have parsed them.
18100
18101         (tokenize): new function that only runs the tokenizer on its
18102         input, for speed testing.
18103
18104 2001-12-26  Ravi Pratap  <ravi@ximian.com>
18105
18106         * class.cs (Event.Define): Define the private field only if there
18107         are no accessors defined.
18108
18109         * expression.cs (ResolveMemberAccess): If there is no associated
18110         field with the event, that means we have an event defined with its
18111         own accessors and we should flag error cs0070 since transforming
18112         ourselves into a field is not valid in that case.
18113
18114         * ecore.cs (SimpleName.DoResolve): Same as above.
18115
18116         * attribute.cs (DefinePInvokeMethod): Set the default calling convention
18117         and charset to sane values.
18118
18119 2001-12-25  Ravi Pratap  <ravi@ximian.com>
18120
18121         * assign.cs (DoResolve): Perform check on events only if they 
18122         are being accessed outside the declaring type.
18123
18124         * cs-parser.jay (event_declarations): Update rules to correctly
18125         set the type of the implicit parameter etc.
18126
18127         (add_accessor, remove_accessor): Set current local parameters.
18128
18129         * expression.cs (Binary): For delegate addition and subtraction,
18130         cast the return value from the method into the appropriate delegate
18131         type.
18132
18133 2001-12-24  Ravi Pratap  <ravi@ximian.com>
18134
18135         * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
18136         of these as the workaround is unnecessary.
18137
18138         * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
18139         delegate data - none of that is needed at all.
18140
18141         Re-write bits to extract the instance expression and the delegate method
18142         correctly.
18143
18144         * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator 
18145         on delegates too.
18146
18147         * attribute.cs (ApplyAttributes): New method to take care of common tasks
18148         of attaching attributes instead of duplicating code everywhere.
18149
18150         * everywhere : Update code to do attribute emission using the above method.
18151
18152 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
18153
18154         * expression.cs (IsParamsMethodApplicable): if there are not
18155         parameters, return immediately.
18156
18157         * ecore.cs: The 0 literal can be implicity converted to an enum
18158         type. 
18159
18160         (SimpleName.DoResolve): First lookup the type, then lookup the
18161         members. 
18162
18163         (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
18164         want to get its address.  If the InstanceExpression is not
18165         addressable, store the result in a temporary variable, then get
18166         the address of it.
18167
18168         * codegen.cs: Only display 219 errors on warning level or above. 
18169
18170         * expression.cs (ArrayAccess): Make it implement the
18171         IMemoryLocation interface.
18172
18173         (Binary.DoResolve): handle the operator == (object a, object b)
18174         and operator != (object a, object b) without incurring into a
18175         BoxedCast (because 5 != o should never be performed).
18176
18177         Handle binary enumerator operators.
18178
18179         (EmitLoadOpcode): Use Ldelema if the object we are loading is a
18180         value type, otherwise use Ldelem_ref.
18181
18182         Use precomputed names;
18183
18184         (AddressOf): Implement address of
18185
18186         * cs-parser.jay (labeled_statement): Fix recursive block
18187         addition by reworking the production.
18188
18189         * expression.cs (New.DoEmit): New has a special case:
18190                 
18191                  If we are dealing with a ValueType, we have a few
18192                  situations to deal with:
18193                 
18194                     * The target of New is a ValueType variable, that is
18195                       easy, we just pass this as the variable reference
18196                 
18197                     * The target of New is being passed as an argument,
18198                       to a boxing operation or a function that takes a
18199                       ValueType.
18200                 
18201                       In this case, we need to create a temporary variable
18202                       that is the argument of New.
18203
18204
18205 2001-12-23  Ravi Pratap  <ravi@ximian.com>
18206
18207         * rootcontext.cs (LookupType): Check that current_type is not null before
18208         going about looking at nested types.
18209
18210         * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
18211         not implement the IAssignMethod interface any more.
18212
18213         * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
18214         where we tranform them into FieldExprs if they are being resolved from within
18215         the declaring type.
18216
18217         * ecore.cs (SimpleName.DoResolve): Do the same here.
18218
18219         * assign.cs (DoResolve, Emit): Clean up code considerably. 
18220
18221         * ../errors/bug10.cs : Add.
18222
18223         * ../errors/cs0070.cs : Add.
18224
18225         * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
18226
18227         * assign.cs : Get rid of EventIsLocal everywhere.
18228
18229 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
18230
18231         * ecore.cs (ConvertIntLiteral): finished the implementation.
18232
18233         * statement.cs (SwitchLabel): Convert the value we are using as a
18234         key before looking up the table.
18235
18236 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
18237
18238         * codegen.cs (EmitTopBlock): Require a Location argument now.
18239
18240         * cs-parser.jay (constructor_declarator): We need to setup
18241         current_local_parameters before we parse the
18242         opt_constructor_initializer, to allow the variables to be bound
18243         to the constructor arguments.
18244
18245         * rootcontext.cs (LookupType): First lookup nested classes in our
18246         class and our parents before we go looking outside our class.
18247
18248         * expression.cs (ConstantFold): Extract/debox the values at the
18249         beginnning. 
18250
18251         * rootcontext.cs (EmitCode): Resolve the constants first before we
18252         resolve the types.  This is not really needed, but it helps debugging.
18253
18254         * statement.cs: report location.
18255
18256         * cs-parser.jay: pass location to throw statement.
18257
18258         * driver.cs: Small bug fix.
18259
18260         * report.cs: Updated format to be 4-zero filled digits.
18261
18262 2001-12-22  Ravi Pratap  <ravi@ximian.com>
18263
18264         * expression.cs (CheckIndices): Fix minor bug where the wrong
18265         variable was being referred to ;-)
18266
18267         (DoEmit): Do not call EmitStaticInitializers when the 
18268         underlying type is System.Object.
18269
18270 2001-12-21  Ravi Pratap  <ravi@ximian.com>
18271
18272         * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
18273         and do the usual workaround for SRE.
18274
18275         * class.cs (MyEventBuilder.EventType): New member to get at the type
18276         of the event, quickly.
18277
18278         * expression.cs (Binary.ResolveOperator): Handle delegate addition.
18279
18280         * assign.cs (Assign.DoResolve): Handle the case when the target
18281         is an EventExpr and perform the necessary checks.
18282
18283         * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
18284         interface.
18285
18286         (SimpleName.MemberStaticCheck): Include check for EventExpr.
18287
18288         (EventExpr): Set the type in the constructor itself since we 
18289         are meant to be born fully resolved.
18290
18291         (EventExpr.Define): Revert code I wrote earlier.
18292                 
18293         * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
18294         instance expression is null. The instance expression is a This in that case
18295         or a null, depending on whether it is a static method or not.
18296
18297         Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
18298         refers to more than one method.
18299
18300         * assign.cs (DoResolve): Check whether the event belongs to the same Type container
18301         and accordingly flag errors.
18302
18303 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
18304
18305         * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
18306
18307 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
18308
18309         * location.cs (ToString): Provide useful rutine.
18310
18311 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
18312
18313         * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
18314         objects, return the actual integral boxed.
18315
18316         * statement.cs (SwitchLabel): define an ILLabel for each
18317         SwitchLabel. 
18318
18319         (Switch.CheckSwitch): If the value is a Literal, extract
18320         the underlying literal.
18321
18322         Also in the unused hashtable we had, add the SwitchLabel so we can
18323         quickly look this value up.
18324
18325         * constant.cs: Implement a bunch of new constants.  Rewrite
18326         Literal based on this.  Made changes everywhere to adapt to this.
18327
18328         * expression.cs (Expression.MakeByteBlob): Optimize routine by
18329         dereferencing array only once, and also copes with enumrations.
18330
18331         bytes are two bytes wide, not one.
18332
18333         (Cast): Perform constant conversions.
18334
18335         * ecore.cs (TryImplicitIntConversion): Return literals instead of
18336         wrappers to the literals here.
18337
18338         * expression.cs (DoNumericPromotions): long literals can converted
18339         to ulong implicity (this is taken care of elsewhere, but I was
18340         missing this spot).
18341
18342         * ecore.cs (Expression.Literalize): Make the return type Literal,
18343         to improve type checking.
18344
18345         * rootcontext.cs: Lookup for nested classes in our class hierarchy.
18346
18347 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
18348
18349         * literal.cs: Revert code from ravi that checked the bounds.  The
18350         bounds are sane by the definition of the type itself. 
18351
18352         * typemanager.cs: Fix implementation of ImplementsInterface.  We
18353         need to actually look up in our parent hierarchy for interfaces
18354         implemented. 
18355
18356         * const.cs: Use the underlying type for enumerations
18357
18358         * delegate.cs: Compute the basename for the delegate creation,
18359         that should fix the delegate test case, and restore the correct
18360         Type Lookup semantics in rootcontext
18361
18362         * rootcontext.cs: Revert Ravi's last patch.  The correct way of
18363         referencing a nested type with the Reflection API is using the "+"
18364         sign. 
18365
18366         * cs-parser.jay: Do not require EOF token at the end.
18367
18368 2001-12-20  Ravi Pratap  <ravi@ximian.com>
18369
18370         * rootcontext.cs (LookupType): Concatenate type names with
18371         a '.' instead of a '+' The test suite passes again.
18372
18373         * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
18374         field of the enumeration.
18375
18376         * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
18377         the case when the member is an EventExpr.
18378
18379         * ecore.cs (EventExpr.InstanceExpression): Every event which is not
18380         static has an associated instance expression.
18381
18382         * typemanager.cs (RegisterEvent): The usual workaround, now for events.
18383
18384         (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
18385
18386         * class.cs (Event.Define): Register event and perform appropriate checks
18387         for error #111.
18388
18389         We define the Add and Remove methods even if the use provides none because
18390         in that case, we provide default implementations ourselves.
18391
18392         Define a private field of the type of the event. This is done by the CSC compiler
18393         and we should be doing it too ;-)
18394
18395         * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
18396         More methods we use in code we generate.
18397
18398         (multicast_delegate_type, delegate_type): Two separate types since the distinction
18399         is important.
18400
18401         (InitCoreTypes): Update accordingly for the above.
18402
18403         * class.cs (Event.Emit): Generate code for default accessors that we provide
18404
18405         (EmitDefaultMethod): Do the job in the above.
18406
18407         * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the 
18408         appropriate place.
18409
18410 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
18411
18412         * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
18413         builders even if we were missing one.
18414
18415         * interface.cs, class.cs, enum.cs: When calling DefineNestedType
18416         pass the Basename as our class name instead of the Name.  The
18417         basename will be correctly composed for us.
18418
18419         * parameter.cs (Paramters): Now takes a Location argument.
18420
18421         * decl.cs (DeclSpace.LookupType): Removed convenience function and
18422         make all the code call directly LookupType in RootContext and take
18423         this chance to pass the Location information everywhere.
18424
18425         * Everywhere: pass Location information.
18426
18427 2001-12-19  Miguel de Icaza  <miguel@ximian.com>
18428
18429         * class.cs (Constructor.Define): Updated way of detecting the
18430         length of the parameters.
18431
18432         (TypeContainer.DefineType): Use basename as the type name for
18433         nested types.
18434
18435         (TypeContainer.Define): Do not recursively define types here, as
18436         definition is taken care in order by the RootContext.
18437
18438         * tree.cs: Keep track of namespaces in a per-file basis.
18439
18440         * parameter.cs (Parameter.ComputeSignature): Update to use
18441         DeclSpace. 
18442
18443         (Parameters.GetSignature): ditto.
18444
18445         * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
18446         instead of a TypeContainer.
18447
18448         (Interface.SemanticAnalysis): Use `this' instead of our parent to
18449         resolve names.  Because we need to be resolve in our context, not
18450         our parents.
18451
18452         * driver.cs: Implement response files.
18453
18454         * class.cs (TypeContainer.DefineType): If we are defined, do not
18455         redefine ourselves.
18456
18457         (Event.Emit): Emit the code for add/remove handlers.
18458         (Event.Define): Save the MethodBuilders for add/remove.
18459
18460         * typemanager.cs: Use pair here too.
18461
18462         * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
18463         DictionaryEntry requires the first argument to be non-null.  
18464
18465         (enum_declaration): Compute full name for registering the
18466         enumeration.
18467
18468         (delegate_declaration): Instead of using
18469         formal_parameter_list, use opt_formal_parameter_list as the list
18470         can be empty.
18471
18472         * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
18473         (EventParsing): New property that controls whether `add' and
18474         `remove' are returned as tokens or identifiers (for events);
18475
18476 2001-12-19  Ravi Pratap  <ravi@ximian.com>
18477
18478         * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
18479         use MyEventBuilder only and let it wrap the real builder for us.
18480
18481         (MyEventBuilder): Revamp constructor etc.
18482
18483         Implement all operations that we perform on EventBuilder in precisely the same
18484         way here too.
18485
18486         (FindMembers): Update to use the EventBuilder member.
18487
18488         (Event.Emit): Update accordingly.
18489
18490 2001-12-18  Ravi Pratap  <ravi@ximian.com>
18491
18492         * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
18493         by calling the appropriate methods.
18494
18495         (GetCustomAttributes): Make stubs as they cannot possibly do anything
18496         useful.
18497
18498         (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
18499
18500 2001-12-17  Ravi Pratap  <ravi@ximian.com>
18501
18502         * delegate.cs (Delegate.Populate): Check that the return type
18503         and various parameters types are indeed accessible.
18504
18505         * class.cs (Constructor.Define): Same here.
18506
18507         (Field.Define): Ditto.
18508
18509         (Event.Define): Ditto.
18510
18511         (Operator.Define): Check that the underlying Method defined itself
18512         correctly - so it's MethodBuilder should not be null.
18513
18514         * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
18515         expression happens to be null.
18516
18517         * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
18518         members but as of now we don't seem to be able to do anything really useful with it.
18519
18520         (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
18521         not the EventBuilder.
18522
18523 2001-12-18  Miguel de Icaza  <miguel@ximian.com>
18524
18525         * cs-tokenizer.cs: Add support for defines.
18526         Add support for #if, #elif, #else, #endif
18527
18528         (eval_var): evaluates a variable.
18529         (eval): stubbed for evaluating functions.
18530
18531         * cs-parser.jay: Pass the defines information
18532
18533         * driver.cs: Add --define command line option.
18534
18535         * decl.cs: Move MemberCore here.
18536
18537         Make it the base class for DeclSpace.  This allows us to catch and
18538         report 108 and 109 for everything now.
18539
18540         * class.cs (TypeContainer.Define): Extract all the members
18541         before populating and emit the warning 108 (new keyword required
18542         to override) instead of having each member implement this.
18543
18544         (MemberCore.Define): New abstract method, we will be using this in
18545         the warning reporting engine in Populate.
18546
18547         (Operator.Define): Adjust to new MemberCore protocol. 
18548
18549         * const.cs (Const): This does not derive from Expression, it is a
18550         temporary object we use to create fields, it is a MemberCore. 
18551
18552         * class.cs (Method.Define): Allow the entry point to be in a
18553         specific class.
18554
18555         * driver.cs: Rewrite the argument handler to clean it up a bit.
18556
18557         * rootcontext.cs: Made it just an auxiliary namespace feature by
18558         making everything static.
18559
18560         * driver.cs: Adapt code to use RootContext type name instead of
18561         instance variable.
18562
18563         * delegate.cs: Remove RootContext argument.
18564
18565         * class.cs: (Struct, TypeContainer, Class): Remove RootContext
18566         argument. 
18567
18568         * class.cs (Event.Define): The lookup can fail.
18569
18570         * cs-tokenizer.cs: Begin implementation of pre-procesor. 
18571
18572         * expression.cs: Resolve the this instance before invoking the code.
18573
18574 2001-12-17  Miguel de Icaza  <miguel@ximian.com>
18575
18576         * cs-parser.jay: Add a production in element_access that allows
18577         the thing to become a "type" reference.  This way we can parse
18578         things like "(string [])" as a type.
18579
18580         Note that this still does not handle the more complex rules of
18581         casts. 
18582
18583
18584         * delegate.cs (Delegate.Populate): Register the delegage constructor builder here. 
18585
18586         * ecore.cs: (CopyNewMethods): new utility function used to
18587         assemble the list of methods from running FindMembers.
18588
18589         (MemberLookup): Rework FindMembers so that 
18590
18591 2001-12-16  Miguel de Icaza  <miguel@ximian.com>
18592
18593         * class.cs (TypeContainer): Remove Delegates who fail to be
18594         defined.
18595
18596         * delegate.cs (Populate): Verify that we dont get null return
18597         values.   TODO: Check for AsAccessible.
18598
18599         * cs-parser.jay: Use basename to emit error 574 (destructor should
18600         have the same name as container class), not the full name.
18601
18602         * cs-tokenizer.cs (adjust_int): Fit the integer in the best
18603         possible representation.  
18604
18605         Also implements integer type suffixes U and L.
18606
18607 2001-12-15  Miguel de Icaza  <miguel@ximian.com>
18608
18609         * expression.cs (ArrayCreation.DoResolve): We need to do the
18610         argument resolution *always*.
18611
18612         * decl.cs: Make this hold the namespace.  Hold the root context as
18613         well.
18614         (LookupType): Move here.
18615
18616         * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
18617
18618         * location.cs (Row, Name): Fixed the code, it was always returning
18619         references to the first file.
18620
18621         * interface.cs: Register properties defined through interfaces.
18622
18623         * driver.cs: Add support for globbing on the command line
18624
18625         * class.cs (Field): Make it derive from MemberCore as well.
18626         (Event): ditto.
18627
18628 2001-12-15  Ravi Pratap  <ravi@ximian.com>
18629
18630         * class.cs (Event::Define): Check that the type of the event is a delegate
18631         type else flag error #66.
18632
18633         Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
18634         same.
18635
18636         * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
18637         values of EntryPoint, CharSet etc etc.
18638
18639         Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
18640
18641         * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
18642         be null and we should ignore this. I am not sure if this is really clean. Apparently,
18643         there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
18644         which needs this to do its work.
18645
18646         * ../errors/cs0066.cs : Add.
18647
18648 2001-12-14  Miguel de Icaza  <miguel@ximian.com>
18649
18650         * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
18651         helper functions.
18652
18653         * class.cs: (MethodSignature.MethodSignature): Removed hack that
18654         clears out the parameters field.
18655         (MemberSignatureCompare): Cleanup
18656
18657         (MemberCore): New base class used to share code between MethodCore
18658         and Property.
18659
18660         (RegisterRequiredImplementations) BindingFlags.Public requires
18661         either BindingFlags.Instace or Static.  Use instance here.
18662
18663         (Property): Refactored code to cope better with the full spec.
18664
18665         * parameter.cs (GetParameterInfo): Return an empty array instead
18666         of null on error.
18667
18668         * class.cs (Property): Abstract or extern properties have no bodies.
18669
18670         * parameter.cs (GetParameterInfo): return a zero-sized array.
18671
18672         * class.cs (TypeContainer.MethodModifiersValid): Move all the
18673         method modifier validation to the typecontainer so we can reuse
18674         this on properties.
18675
18676         (MethodCore.ParameterTypes): return an empty sized array of types.
18677
18678         (Property.Define): Test property modifier validity.
18679
18680         Add tests for sealed/override too.
18681
18682         (Method.Emit): abstract or extern methods have no bodies.
18683
18684 2001-12-14  Ravi Pratap  <ravi@ximian.com>
18685
18686         * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
18687         thing.
18688
18689         (Method::Define, ::Emit): Modify accordingly.
18690
18691         * expression.cs (Invocation::OverloadResolve): Handle error # 121.
18692
18693         (ArrayCreation::MakeByteBlob): Handle floats and doubles.
18694
18695         * makefile: Pass in /unsafe.
18696
18697 2001-12-13  Miguel de Icaza  <miguel@ximian.com>
18698
18699         * class.cs (MakeKey): Kill routine.
18700
18701         * class.cs (TypeContainer.Define): Correctly define explicit
18702         method implementations (they require the full interface name plus
18703         the method name).
18704
18705         * typemanager.cs: Deply the PtrHashtable here and stop using the
18706         lame keys.  Things work so much better.
18707
18708         This of course broke everyone who depended on `RegisterMethod' to
18709         do the `test for existance' test.  This has to be done elsewhere.
18710
18711         * support.cs (PtrHashtable): A hashtable that avoid comparing with
18712         the object stupid Equals method (because, that like fails all over
18713         the place).  We still do not use it.
18714
18715         * class.cs (TypeContainer.SetRequiredInterface,
18716         TypeContainer.RequireMethods): Killed these two routines and moved
18717         all the functionality to RegisterRequiredImplementations.
18718
18719         (TypeContainer.RegisterRequiredImplementations): This routine now
18720         registers all the implementations required in an array for the
18721         interfaces and abstract methods.  We use an array of structures
18722         which can be computed ahead of time to reduce memory usage and we
18723         also assume that lookups are cheap as most classes will not
18724         implement too many interfaces.
18725
18726         We also avoid creating too many MethodSignatures.
18727
18728         (TypeContainer.IsInterfaceMethod): Update and optionally does not
18729         clear the "pending" bit if we find that there are problems with
18730         the declaration.
18731
18732         (TypeContainer.VerifyPendingMethods): Update to report errors of
18733         methods that look like implementations but are not.
18734
18735         (TypeContainer.Define): Add support for explicit interface method
18736         implementation. 
18737
18738 2001-12-12  Miguel de Icaza  <miguel@ximian.com>
18739
18740         * typemanager.cs: Keep track of the parameters here instead of
18741         being a feature of the TypeContainer.
18742
18743         * class.cs: Drop the registration of parameters here, as
18744         InterfaceMethods are also interface declarations.
18745
18746         * delegate.cs: Register methods with the TypeManager not only with
18747         the TypeContainer.  This code was buggy.
18748
18749         * interface.cs: Full registation here.
18750
18751 2001-12-11  Miguel de Icaza  <miguel@ximian.com>
18752
18753         * expression.cs: Remove reducer for binary expressions, it can not
18754         be done this way.
18755
18756         * const.cs: Put here the code that used to go into constant.cs
18757
18758         * constant.cs: Put here the code for constants, this is a new base
18759         class for Literals.
18760
18761         * literal.cs: Make Literal derive from Constant.
18762
18763 2001-12-09  Miguel de Icaza  <miguel@ximian.com>
18764
18765         * statement.cs (Return.Emit): Report error 157 if the user
18766         attempts to return from a finally block.
18767
18768         (Return.Emit): Instead of emitting a return, jump to the end of
18769         the function.
18770
18771         * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
18772         LocalBuilder to store the result of the function.  ReturnLabel is
18773         the target where we jump.
18774
18775
18776 2001-12-09  Radek Doulik  <rodo@ximian.com>
18777
18778         * cs-parser.jay: remember alias in current namespace
18779
18780         * ecore.cs (SimpleName::DoResolve): use aliases for types or
18781         namespaces
18782
18783         * class.cs (LookupAlias): lookup alias in my_namespace
18784
18785         * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
18786         aliases hashtable
18787         (LookupAlias): lookup alias in this and if needed in parent
18788         namespaces
18789
18790 2001-12-08  Miguel de Icaza  <miguel@ximian.com>
18791
18792         * support.cs: 
18793
18794         * rootcontext.cs: (ModuleBuilder) Made static, first step into
18795         making things static.  I need this to avoid passing the
18796         TypeContainer when calling ParameterType.
18797
18798         * support.cs (InternalParameters.ParameterType): Remove ugly hack
18799         that did string manipulation to compute the type and then call
18800         GetType.  Use Parameter.ParameterType instead.
18801
18802         * cs-tokenizer.cs: Consume the suffix for floating values.
18803
18804         * expression.cs (ParameterReference): figure out whether this is a
18805         reference parameter or not.  Kill an extra variable by computing
18806         the arg_idx during emission.
18807
18808         * parameter.cs (Parameters.GetParameterInfo): New overloaded
18809         function that returns whether a parameter is an out/ref value or not.
18810
18811         (Parameter.ParameterType): The type of the parameter (base,
18812         without ref/out applied).
18813
18814         (Parameter.Resolve): Perform resolution here.
18815         (Parameter.ExternalType): The full type (with ref/out applied).
18816
18817         * statement.cs (Using.Emit, Using.EmitExpression): Implement
18818         support for expressions on the using statement.
18819
18820 2001-12-07  Miguel de Icaza  <miguel@ximian.com>
18821
18822         * statement.cs (Using.EmitLocalVariableDecls): Split the
18823         localvariable handling of the using statement.
18824
18825         (Block.EmitMeta): Keep track of variable count across blocks.  We
18826         were reusing slots on separate branches of blocks.
18827
18828         (Try.Emit): Emit the general code block, we were not emitting it. 
18829
18830         Check the type of the declaration to be an IDisposable or
18831         something that can be implicity converted to it. 
18832
18833         Emit conversions if required.
18834
18835         * ecore.cs (EmptyExpression): New utility class.
18836         (Expression.ImplicitConversionExists): New utility function.
18837
18838 2001-12-06  Miguel de Icaza  <miguel@ximian.com>
18839
18840         * statement.cs (Using): Implement.
18841
18842         * expression.cs (LocalVariableReference): Support read only variables.
18843
18844         * statement.cs: Remove the explicit emit for the Leave opcode.
18845         (VariableInfo): Add a readonly field.
18846
18847 2001-12-05  Miguel de Icaza  <miguel@ximian.com>
18848
18849         * ecore.cs (ConvCast): new class used to encapsulate the various
18850         explicit integer conversions that works in both checked and
18851         unchecked contexts.
18852
18853         (Expression.ConvertNumericExplicit): Use new ConvCast class to
18854         properly generate the overflow opcodes.
18855
18856 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
18857
18858         * statement.cs: The correct type for the EmptyExpression is the
18859         element_type, not the variable type.  Ravi pointed this out.
18860
18861 2001-12-04  Ravi Pratap  <ravi@ximian.com>
18862
18863         * class.cs (Method::Define): Handle PInvoke methods specially
18864         by using DefinePInvokeMethod instead of the usual one.
18865
18866         * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
18867         above to do the task of extracting information and defining the method.
18868
18869 2001-12-04  Ravi Pratap  <ravi@ximian.com>
18870
18871         * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
18872         of the condition for string type.
18873
18874         (Emit): Move that here. 
18875
18876         (ArrayCreation::CheckIndices): Keep string literals in their expression
18877         form.
18878
18879         (EmitDynamicInitializers): Handle strings appropriately.
18880
18881 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
18882
18883         * codegen.cs (EmitContext): Replace multiple variables with a
18884         single pointer to the current Switch statement.
18885
18886         * statement.cs (GotoDefault, Switch): Adjust to cleaned up
18887         EmitContext.
18888
18889 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
18890
18891         * statement.cs 
18892
18893         * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
18894         default'.
18895
18896         (Foreach.Emit): Foreach on arrays was not setting
18897         up the loop variables (for break/continue).
18898
18899         (GotoCase): Semi-implented.
18900
18901 2001-12-03  Ravi Pratap  <ravi@ximian.com>
18902
18903         * attribute.cs (CheckAttribute): Handle system attributes by using
18904         Attribute.GetAttributes to examine information we need.
18905
18906         (GetValidPlaces): Same here.
18907
18908         * class.cs (Method::Define): Catch invalid use of extern and abstract together.
18909
18910         * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
18911
18912         * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
18913
18914         (Method::Define): Set appropriate flags if we have a DllImport attribute.
18915
18916         (Method::Emit): Handle the case when we are a PInvoke method.
18917
18918 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
18919
18920         * expression.cs: Use ResolveWithSimpleName on compound names.
18921
18922 2001-12-02  Ravi Pratap  <ravi@ximian.com>
18923
18924         * constant.cs (EmitConstant): Make sure we resolve the associated expression
18925         before trying to reduce it.
18926
18927         * typemanager.cs (RegisterConstant, LookupConstant): Implement.
18928
18929         * constant.cs (LookupConstantValue): Implement.
18930
18931         (EmitConstant): Use the above in emitting the constant.
18932
18933         * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
18934         that are user-defined by doing a LookupConstantValue on them.
18935
18936         (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
18937         too, like above.
18938
18939 2001-11-29  Miguel de Icaza  <miguel@ximian.com>
18940
18941         * expression.cs (BaseAccess, BaseIndexer): Also split this out.
18942
18943         (BaseAccess.DoResolve): Implement.
18944
18945         (MemberAccess.DoResolve): Split this routine into a
18946         ResolveMemberAccess routine that can be used independently
18947
18948 2001-11-28  Miguel de Icaza  <miguel@ximian.com>
18949
18950         * expression.cs (Probe, Is, As): Split Probe in two classes Is and
18951         As that share bits of the implementation.  Is returns a boolean,
18952         while As returns the Type that is being probed.
18953
18954 2001-12-01  Ravi Pratap  <ravi@ximian.com>
18955
18956         * enum.cs (LookupEnumValue): Re-write various bits, return an object value
18957         instead of a Literal - much easier.
18958
18959         (EnumInTransit): Remove - utterly useless :-)
18960
18961         (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
18962
18963         * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
18964
18965         * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
18966         chain when we have no associated expression.
18967
18968 2001-11-30  Ravi Pratap  <ravi@ximian.com>
18969
18970         * constant.cs (Define): Use Location while reporting the errror.
18971
18972         Also emit a warning when 'new' is used and there is no inherited
18973         member to hide.
18974
18975         * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being 
18976         populated.
18977
18978         (LookupEnumValue): Implement to lookup an enum member's value and define it
18979         if necessary.
18980
18981         (Populate): Re-write accordingly to use the above routine.
18982
18983 2001-11-27  Miguel de Icaza  <miguel@ximian.com>
18984
18985         * expression.cs (This): Fix prototype for DoResolveLValue to
18986         override the base class DoResolveLValue.
18987
18988         * cs-parser.cs: Report errors cs574 and cs575 (destructor
18989         declarations) 
18990
18991         * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
18992         (we need to load the address of the field here).  This fixes
18993         test-22. 
18994
18995         (FieldExpr.DoResolveLValue): Call the DoResolve
18996         function to initialize the Instance expression.
18997
18998         * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
18999         correctly the GetEnumerator operation on a value type.
19000
19001         * cs-parser.jay: Add more simple parsing error catches.
19002
19003         * statement.cs (Switch): Add support for string switches.
19004         Handle null specially.
19005
19006         * literal.cs (NullLiteral): Make NullLiteral objects singletons. 
19007
19008 2001-11-28  Ravi Pratap  <ravi@ximian.com>
19009
19010         * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
19011
19012         (declare_local_constant): New helper function.
19013
19014         * statement.cs (AddConstant): Keep a separate record of constants
19015
19016         (IsConstant): Implement to determine if a variable is a constant.
19017
19018         (GetConstantExpression): Implement.
19019
19020         * expression.cs (LocalVariableReference): Handle the case when it is a constant.
19021
19022         * statement.cs (IsVariableDefined): Re-write.
19023
19024 2001-11-27  Ravi Pratap  <ravi@ximian.com>
19025
19026         * class.cs (TypeContainer::FindMembers): Look for constants
19027         in the case when we are looking for MemberTypes.Field
19028
19029         * expression.cs (MemberAccess::DoResolve): Check that in the
19030         case we are a FieldExpr and a Literal, we are not being accessed
19031         by an instance reference.
19032
19033         * cs-parser.jay (local_constant_declaration): Implement.
19034
19035         (declaration_statement): Implement for constant declarations.
19036
19037 2001-11-26  Miguel de Icaza  <miguel@ximian.com>
19038
19039         * statement.cs (Switch): Catch double defaults.
19040
19041         (Switch): More work on the switch() statement
19042         implementation.  It works for integral values now, need to finish
19043         string support.
19044
19045
19046 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
19047
19048         * ecore.cs (Expression.ConvertIntLiteral): New function to convert
19049         integer literals into other integer literals.  To be used by
19050         switch. 
19051
19052 2001-11-24  Ravi Pratap  <ravi@ximian.com>
19053
19054         * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
19055         some memory.
19056
19057         (EmitDynamicInitializers): Cope with the above since we extract data
19058         directly from ArrayData now.
19059
19060         (ExpectInitializers): Keep track of whether initializers are mandatory
19061         or not.
19062
19063         (Bounds): Make it a hashtable to prevent the same dimension being 
19064         recorded for every element in that dimension.
19065
19066         (EmitDynamicInitializers): Fix bug which prevented the Set array method
19067         from being found.
19068
19069         Also fix bug which was causing the indices to be emitted in the reverse
19070         order.
19071
19072 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
19073
19074         * expression.cs (ArrayCreation): Implement the bits that Ravi left
19075         unfinished.  They do not work, because the underlying code is
19076         sloppy.
19077
19078 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
19079
19080         * cs-parser.jay: Remove bogus fixme.
19081
19082         * statement.cs (Switch, SwitchSection, SwithLabel): Started work
19083         on Switch statement.
19084
19085 2001-11-23  Ravi Pratap  <ravi@ximian.com>
19086
19087         * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
19088         the same. 
19089
19090         * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
19091         parameter. Apparently, any expression is allowed. 
19092
19093         (ValidateInitializers): Update accordingly.
19094
19095         (CheckIndices): Fix some tricky bugs thanks to recursion.
19096
19097         * delegate.cs (NewDelegate::DoResolve): Re-write large portions as 
19098         I was being completely brain-dead.
19099
19100         (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
19101         and re-write acordingly.
19102
19103         (DelegateInvocation): Re-write accordingly.
19104
19105         * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
19106
19107         (MakeByteBlob): Handle types more correctly.
19108
19109         * expression.cs (ArrayCreation:Emit): Write preliminary code to do
19110         initialization from expressions but it is incomplete because I am a complete
19111         Dodo :-|
19112
19113 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
19114
19115         * statement.cs (If.Emit): Fix a bug that generated incorrect code
19116         on If.  Basically, we have to return `true' (ie, we do return to
19117         our caller) only if both branches of the if return.
19118
19119         * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
19120         short-circuit operators, handle them as short circuit operators. 
19121
19122         (Cast.DoResolve): Resolve type.
19123         (Cast.Cast): Take an expression as the target type.
19124
19125         * cs-parser.jay (cast_expression): Remove old hack that only
19126         allowed a limited set of types to be handled.  Now we take a
19127         unary_expression and we resolve to a type during semantic
19128         analysis.
19129
19130         Use the grammar productions from Rhys to handle casts (this is
19131         not complete like Rhys syntax yet, we fail to handle that corner
19132         case that C# has regarding (-x), but we will get there.
19133
19134 2001-11-22  Ravi Pratap  <ravi@ximian.com>
19135
19136         * class.cs (EmitFieldInitializer): Take care of the case when we have a
19137         field which is an array type.
19138
19139         * cs-parser.jay (declare_local_variables): Support array initialization too.
19140
19141         * typemanager.cs (MakeKey): Implement.
19142
19143         (everywhere): Use the above appropriately.
19144
19145         * cs-parser.jay (for_statement): Update for array initialization while
19146         declaring variables.
19147
19148         * ecore.cs : The error message was correct, it's the variable's names that
19149         were misleading ;-) Make the code more readable.
19150
19151         (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
19152         the correct type etc.
19153
19154         (ConvertExplicit): Handle Enum types by examining the underlying type.
19155
19156 2001-11-21  Ravi Pratap  <ravi@ximian.com>
19157
19158         * parameter.cs (GetCallingConvention): Always return
19159         CallingConventions.Standard for now.
19160
19161 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
19162
19163         * expression.cs (Binary.ResolveOperator): Update the values of `l'
19164         and `r' after calling DoNumericPromotions.
19165
19166         * ecore.cs: Fix error message (the types were in the wrong order).
19167
19168         * statement.cs (Foreach.ProbeCollectionType): Need to pass
19169         BindingFlags.Instance as well 
19170
19171         * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
19172         implicit int literal conversion in an empty cast so that we
19173         propagate the right type upstream.
19174
19175         (UnboxCast): new class used to unbox value types.
19176         (Expression.ConvertExplicit): Add explicit type conversions done
19177         by unboxing.
19178
19179         (Expression.ImplicitNumericConversion): Oops, forgot to test for
19180         the target type before applying the implicit LongLiterals to ULong
19181         literal cast.
19182
19183 2001-11-21  Miguel de Icaza  <miguel@ximian.com>
19184
19185         * cs-parser.jay (for_statement): Reworked the way For works: now
19186         we declare manually any variables that are introduced in
19187         for_initializer to solve the problem of having out-of-band code
19188         emition (that is what got for broken).
19189
19190         (declaration_statement): Perform the actual variable declaration
19191         that used to be done in local_variable_declaration here.
19192
19193         (local_variable_declaration): Do not declare anything, just pass
19194         the information on a DictionaryEntry
19195
19196 2001-11-20  Ravi Pratap  <ravi@ximian.com>
19197
19198         * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
19199         re-write of the logic to now make it recursive.
19200
19201         (UpdateIndices): Re-write accordingly.
19202
19203         Store element data in a separate ArrayData list in the above methods.
19204
19205         (MakeByteBlob): Implement to dump the array data into a byte array.
19206
19207 2001-11-19  Ravi Pratap  <ravi@ximian.com>
19208
19209         * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
19210         into CheckIndices.
19211
19212         * constant.cs (Define): Implement.
19213
19214         (EmitConstant): Re-write fully.
19215
19216         Pass in location info.
19217
19218         * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
19219         respectively.
19220
19221         * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
19222         DictionaryEntry since we need location info too.
19223
19224         (constant_declaration): Update accordingly.
19225
19226         * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
19227         code into another method : UpdateIndices.
19228
19229 2001-11-18  Ravi Pratap  <ravi@ximian.com>
19230
19231         * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
19232         some type checking etc.
19233
19234 2001-11-17  Ravi Pratap  <ravi@ximian.com>
19235
19236         * expression.cs (ArrayCreation::ValidateInitializers): Implement
19237         bits to provide dimension info if the user skips doing that.
19238
19239         Update second constructor to store the rank correctly.
19240
19241 2001-11-16  Ravi Pratap  <ravi@ximian.com>
19242
19243         * expression.cs (ArrayCreation::ValidateInitializers): Poke around
19244         and try to implement.
19245
19246         * ../errors/cs0150.cs : Add.
19247
19248         * ../errors/cs0178.cs : Add.
19249
19250 2001-11-16  Miguel de Icaza  <miguel@ximian.com>
19251
19252         * statement.cs: Implement foreach on multi-dimensional arrays. 
19253
19254         * parameter.cs (Parameters.GetParameterByName): Also lookup the
19255         name of the params argument.
19256
19257         * expression.cs: Use EmitStoreOpcode to get the right opcode while
19258         initializing the array.
19259
19260         (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
19261         we can use this elsewhere.
19262
19263         * statement.cs: Finish implementation of foreach for single
19264         dimension arrays.
19265
19266         * cs-parser.jay: Use an out-of-band stack to pass information
19267         around, I wonder why I need this.
19268
19269         foreach_block: Make the new foreach_block the current_block.
19270
19271         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
19272         function used to return a static Parameters structure.  Used for
19273         empty parameters, as those are created very frequently.
19274
19275         * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
19276
19277 2001-11-15  Ravi Pratap  <ravi@ximian.com>
19278
19279         * interface.cs : Default modifier is private, not public. The
19280         make verify test passes again.
19281
19282 2001-11-15  Ravi Pratap  <ravi@ximian.com>
19283
19284         * support.cs (ReflectionParameters): Fix logic to determine
19285         whether the last parameter is a params one. Test 9 passes again.
19286
19287         * delegate.cs (Populate): Register the builders we define with
19288         RegisterParameterForBuilder. Test 19 passes again.
19289
19290         * cs-parser.jay (property_declaration): Reference $6 instead
19291         of $$ to get at the location.
19292
19293         (indexer_declaration): Similar stuff.
19294
19295         (attribute): Ditto.
19296
19297         * class.cs (Property): Register parameters for the Get and Set methods
19298         if they exist. Test 23 passes again.
19299
19300         * expression.cs (ArrayCreation::Emit): Pass null for the method in the
19301         call to EmitArguments as we are sure there aren't any params arguments. 
19302         Test 32 passes again.
19303
19304         * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
19305         IndexOutOfRangeException. 
19306
19307         * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
19308         Test 33 now passes again.
19309
19310 2001-11-15  Miguel de Icaza  <miguel@ximian.com>
19311
19312         * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
19313         broke a bunch of things.  Will have to come up with a better way
19314         of tracking locations.
19315
19316         * statement.cs: Implemented foreach for single dimension arrays.
19317
19318 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
19319
19320         * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
19321         an error.  This removes the lookup from the critical path.
19322
19323         * cs-parser.jay: Removed use of temporary_loc, which is completely
19324         broken. 
19325
19326 2001-11-14  Miguel de Icaza  <miguel@ximian.com>
19327
19328         * support.cs (ReflectionParameters.ParameterModifier): Report
19329         whether the argument is a PARAMS argument or not.
19330
19331         * class.cs: Set the attribute `ParamArrayAttribute' on the
19332         parameter argument.
19333
19334         * typemanager.cs: Define param_array_type (ParamArrayAttribute)
19335         and cons_param_array_attribute (ConstructorInfo for
19336         ParamArrayAttribute)., 
19337
19338         * codegen.cs: Emit the return using the `Return' statement, that
19339         way we can report the error correctly for missing return values. 
19340
19341         * class.cs (Method.Emit): Clean up.
19342
19343         * expression.cs (Argument.Resolve): Take another argument: the
19344         location where this argument is used.  Notice that this is not
19345         part of the "Argument" class as to reduce the size of the
19346         structure (we know the approximate location anyways).
19347
19348         Test if the argument is a variable-reference, if not, then
19349         complain with a 206.
19350
19351         (Argument.Emit): Emit addresses of variables.
19352
19353         (Argument.FullDesc): Simplify.
19354
19355         (Invocation.DoResolve): Update for Argument.Resolve.
19356
19357         (ElementAccess.DoResolve): ditto.
19358
19359         * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
19360         method should be virtual, as this method is always virtual.
19361
19362         (NewDelegate.DoResolve): Update for Argument.Resolve.
19363
19364         * class.cs (ConstructorInitializer.DoResolve): ditto.
19365
19366         * attribute.cs (Attribute.Resolve): ditto.
19367
19368 2001-11-13  Miguel de Icaza  <miguel@ximian.com>
19369
19370         * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
19371
19372         * expression.cs (ParameterReference): Drop IStackStorage and implement
19373         IAssignMethod instead. 
19374
19375         (LocalVariableReference): ditto.
19376
19377         * ecore.cs (FieldExpr): Drop IStackStorage and implement
19378         IAssignMethod instead. 
19379
19380 2001-11-13  Miguel de Icaza <miguel@ximian.com>
19381
19382         * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
19383         enumerations that are used in heavily used structures derive from
19384         byte in a laughable and pathetic attempt to reduce memory usage.
19385         This is the kind of pre-optimzations that you should not do at
19386         home without adult supervision.
19387
19388         * expression.cs (UnaryMutator): New class, used to handle ++ and
19389         -- separatedly from the other unary operators.  Cleans up the
19390         code, and kills the ExpressionStatement dependency in Unary.
19391
19392         (Unary): Removed `method' and `Arguments' from this class, making
19393         it smaller, and moving it all to SimpleCall, so I can reuse this
19394         code in other locations and avoid creating a lot of transient data
19395         strucutres when not required.
19396
19397         * cs-parser.jay: Adjust for new changes.
19398
19399 2001-11-11  Miguel de Icaza  <miguel@ximian.com>
19400
19401         * enum.cs (Enum.Populate): If there is a failure during
19402         definition, return
19403
19404         * cs-parser.jay (opt_enum_base): we used to catch type errors
19405         here, but this is really incorrect.  The type error should be
19406         catched during semantic analysis.
19407
19408 2001-12-11  Ravi Pratap  <ravi@ximian.com>
19409
19410         * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
19411         current_local_parameters as expected since I, in my stupidity, had forgotten
19412         to do this :-)
19413
19414         * attribute.cs (GetValidPlaces): Fix stupid bug.
19415
19416         * class.cs (Method::Emit): Perform check on applicability of attributes.
19417
19418         (Constructor::Emit): Ditto.
19419
19420         (Field::Emit): Ditto.
19421
19422         (Field.Location): Store location information.
19423
19424         (Property, Event, Indexer, Operator): Ditto.
19425
19426         * cs-parser.jay (field_declaration): Pass in location for each field.
19427
19428         * ../errors/cs0592.cs : Add.
19429
19430 2001-11-12  Ravi Pratap  <ravi@ximian.com>
19431
19432         * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
19433
19434         (InitCoreTypes): Update accordingly.
19435
19436         (RegisterAttrType, LookupAttr): Implement.
19437
19438         * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
19439         info about the same.
19440
19441         (Resolve): Update to populate the above as necessary.
19442
19443         (Error592): Helper.
19444
19445         (GetValidPlaces): Helper to the above.
19446
19447         (CheckAttribute): Implement to perform validity of attributes on declarative elements.
19448
19449         * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
19450
19451 2001-11-12  Ravi Pratap  <ravi@ximian.com>
19452
19453         * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
19454
19455         * ../errors/cs0617.cs : Add.
19456
19457 2001-11-11  Ravi Pratap  <ravi@ximian.com>
19458
19459         * enum.cs (Emit): Rename to Populate to be more consistent with what
19460         we expect it to do and when exactly it is called.
19461
19462         * class.cs, rootcontext.cs : Update accordingly.
19463
19464         * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
19465         FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
19466
19467         * enum.cs (Populate): Register fields with TypeManager.RegisterField.
19468
19469         * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
19470         of a fieldinfo using the above, when dealing with a FieldBuilder.
19471
19472 2001-11-10  Ravi Pratap  <ravi@ximian.com>
19473
19474         * ../errors/cs0031.cs : Add.
19475
19476         * ../errors/cs1008.cs : Add.
19477
19478         * ../errrors/cs0543.cs : Add.
19479
19480         * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
19481         enum type.
19482
19483         (FindMembers): Implement.
19484
19485         * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
19486         enums and delegates too.
19487
19488         (enum_types): Rename to builder_to_enum.
19489
19490         (delegate_types): Rename to builder_to_delegate.
19491
19492         * delegate.cs (FindMembers): Implement.
19493
19494 2001-11-09  Ravi Pratap  <ravi@ximian.com>
19495
19496         * typemanager.cs (IsEnumType): Implement.
19497
19498         * enum.cs (Emit): Re-write parts to account for the underlying type
19499         better and perform checking etc.
19500
19501         (GetNextDefaultValue): Helper to ensure we don't overshoot max value
19502         of the underlying type.
19503
19504         * literal.cs (GetValue methods everywhere): Perform bounds checking and return
19505         value
19506
19507         * enum.cs (error31): Helper to report error #31.
19508
19509         * cs-parser.jay (enum_declaration): Store location of each member too.
19510
19511         * enum.cs (member_to_location): New hashtable. 
19512
19513         (AddEnumMember): Update location hashtable.
19514
19515         (Emit): Use the location of each member while reporting errors.
19516
19517 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
19518
19519         * cs-parser.jay: A for_initializer if is a
19520         local_variable_declaration really ammount to have an implicit
19521         block with the variable declaration and no initializer for for.
19522
19523         * statement.cs (For.Emit): Cope with null initializers.
19524
19525         This fixes the infinite loop on for initializers.
19526
19527 2001-11-08  Miguel de Icaza  <miguel@ximian.com>
19528
19529         * enum.cs: More cleanup.
19530
19531         * ecore.cs: Remove dead code.
19532
19533         * class.cs (Property.Emit): More simplification.
19534         (Event.Emit): ditto.
19535
19536         Reworked to have less levels of indentation.
19537
19538 2001-11-08  Ravi Pratap  <ravi@ximian.com>
19539
19540         * class.cs (Property): Emit attributes.
19541
19542         (Field): Ditto.
19543
19544         (Event): Ditto.
19545
19546         (Indexer): Ditto.
19547
19548         (Operator): Ditto.
19549
19550         * enum.cs (Emit): Ditto.
19551
19552         * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
19553         Enums too.
19554
19555         * class.cs (Field, Event, etc.): Move attribute generation into the
19556         Emit method everywhere.
19557
19558         * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
19559         we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
19560         as we had no way of defining nested enums !
19561
19562         * rootcontext.cs : Adjust code accordingly.
19563
19564         * typemanager.cs (AddEnumType): To keep track of enum types separately.
19565
19566 2001-11-07  Ravi Pratap  <ravi@ximian.com>
19567
19568         * expression.cs (EvalConstantExpression): Move into ecore.cs
19569
19570         * enum.cs (Enum): Rename some members and make them public and readonly
19571         according to our convention.
19572
19573         * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
19574         nothing else.
19575
19576         * enum.cs (Enum::Define): Use the above instead of TypeAttr.
19577
19578         (Enum::Emit): Write a simple version for now which doesn't try to compute
19579         expressions. I shall modify this to be more robust in just a while.
19580
19581         * class.cs (TypeContainer::Emit): Make sure we include Enums too.
19582
19583         (TypeContainer::CloseType): Create the Enum types too.
19584
19585         * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
19586
19587         * expression.cs (EvalConstantExpression): Get rid of completely.
19588
19589         * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
19590         user-defined values and other cases.
19591
19592         (IsValidEnumLiteral): Helper function.
19593
19594         * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing 
19595         out there in the case we had a literal FieldExpr.
19596
19597         (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
19598
19599         (Literalize): Revamp a bit to take two arguments.
19600
19601         (EnumLiteral): New class which derives from Literal to wrap enum literals.
19602
19603 2001-11-06  Ravi Pratap  <ravi@ximian.com>
19604
19605         * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
19606
19607         * expression.cs (ArrayCreation::ValidateInitializers): Implement.
19608
19609         (Resolve): Use the above to ensure we have proper initializers.
19610
19611 2001-11-05  Ravi Pratap  <ravi@ximian.com>
19612
19613         * expression.cs (Expression::EvalConstantExpression): New method to 
19614         evaluate constant expressions.
19615
19616         * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
19617
19618 2001-11-07  Miguel de Icaza  <miguel@ximian.com>
19619
19620         * expression.cs (ArrayCreation.Emit): Some bits to initialize data
19621         in an array.
19622
19623         (Binary.ResolveOperator): Handle operator != (object a, object b)
19624         and operator == (object a, object b);
19625
19626         (Binary.DoNumericPromotions): Indicate whether the numeric
19627         promotion was possible.
19628
19629         (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
19630         Implement.  
19631
19632         Made the ArrayAccess implement interface IAssignMethod instead of
19633         IStackStore as the order in which arguments are passed reflects
19634         this.
19635
19636         * assign.cs: Instead of using expr.ExprClass to select the way of
19637         assinging, probe for the IStackStore/IAssignMethod interfaces.
19638
19639         * typemanager.cs: Load InitializeArray definition.
19640
19641         * rootcontext.cs (RootContext.MakeStaticData): Used to define
19642         static data that can be used to initialize arrays. 
19643
19644 2001-11-05  Miguel de Icaza  <miguel@ximian.com>
19645
19646         * expression.cs: Handle operator== and operator!= for booleans.
19647
19648         (Conditioal.Reduce): Implement reducer for the ?: operator.
19649
19650         (Conditional.Resolve): Implement dead code elimination.
19651
19652         (Binary.Resolve): Catch string literals and return a new
19653         concatenated string.
19654
19655         (Unary.Reduce): Implement reduction of unary expressions.
19656
19657         * ecore.cs: Split out the expression core handling here.
19658
19659         (Expression.Reduce): New method used to perform constant folding
19660         and CSE.  This is needed to support constant-expressions. 
19661
19662         * statement.cs (Statement.EmitBoolExpression): Pass true and false
19663         targets, and optimize for !x.
19664
19665 2001-11-04  Ravi Pratap  <ravi@ximian.com>
19666
19667         * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
19668         of an attribute gives us a CustomAttributeBuilder which we use accordingly to
19669         set custom atttributes.
19670
19671         * literal.cs (Literal::GetValue): New abstract method to return the actual
19672         value of the literal, cast as an object.
19673
19674         (*Literal): Implement GetValue method.
19675
19676         * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
19677         expressions to the arraylist but objects of type Argument.
19678
19679         * class.cs (TypeContainer::Emit): Emit our attributes too.
19680
19681         (Method::Emit, Constructor::Emit): Ditto.
19682
19683         * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
19684         to be ignoring earlier.
19685
19686 2001-11-03  Ravi Pratap  <ravi@ximian.com>
19687
19688         * attribute.cs (AttributeSection::Define): Implement to do the business
19689         of constructing a CustomAttributeBuilder.
19690
19691         (Attribute): New trivial class. Increases readability of code.  
19692
19693         * cs-parser.jay : Update accordingly.
19694
19695         (positional_argument_list, named_argument_list, named_argument): New rules
19696
19697         (attribute_arguments): Use the above so that we are more correct.
19698
19699 2001-11-02  Ravi Pratap  <ravi@ximian.com>
19700
19701         * expression.cs (Invocation::IsParamsMethodApplicable): Implement
19702         to perform all checks for a method with a params parameter.
19703
19704         (Invocation::OverloadResolve): Update to use the above method and therefore
19705         cope correctly with params method invocations.
19706
19707         * support.cs (InternalParameters::ParameterDesc): Provide a desc for 
19708         params too.
19709
19710         * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
19711         constructors in our parent too because we can't afford to miss out on 
19712         protected ones ;-)
19713
19714         * attribute.cs (AttributeSection): New name for the class Attribute
19715
19716         Other trivial changes to improve readability.
19717
19718         * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
19719         use the new class names.
19720
19721 2001-11-01  Ravi Pratap  <ravi@ximian.com>
19722
19723         * class.cs (Method::Define): Complete definition for params types too
19724
19725         (Indexer::Define): Ditto.
19726
19727         * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
19728         Cope everywhere with a request for info about the array parameter.
19729
19730 2001-11-01  Ravi Pratap  <ravi@ximian.com>
19731
19732         * tree.cs (RecordNamespace): Fix up to check for the correct key.
19733
19734         * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in 
19735         local_variable_type to extract the string corresponding to the type.
19736
19737         (local_variable_type): Fixup the action to use the new helper method.
19738
19739         * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to 
19740         go.
19741
19742         * expression.cs : Clean out code which uses the above.
19743
19744 2001-10-31  Ravi Pratap  <ravi@ximian.com>
19745
19746         * typemanager.cs (RegisterMethod): Check if we already have an existing key
19747         and bale out if necessary by returning a false.
19748
19749         (RegisterProperty): Ditto.
19750
19751         * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
19752         and print out appropriate error messages.
19753
19754         * interface.cs (everywhere): Ditto.
19755
19756         * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
19757         location to constructor.
19758
19759         * class.cs (Property, Event, Indexer): Update accordingly.
19760
19761         * ../errors/cs111.cs : Added.
19762
19763         * expression.cs (Invocation::IsApplicable): New static method to determine applicability
19764         of a method, as laid down by the spec.
19765
19766         (Invocation::OverloadResolve): Use the above method.
19767
19768 2001-10-31  Ravi Pratap  <ravi@ximian.com>
19769
19770         * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
19771         now take a TypeContainer and a Parameters object.
19772
19773         (ParameterData): Modify return type of ParameterModifier method to be 
19774         Parameter.Modifier and not a string.
19775
19776         (ReflectionParameters, InternalParameters): Update accordingly.
19777
19778         * expression.cs (Argument::GetParameterModifier): Same here.
19779
19780         * support.cs (InternalParameters::ParameterType): Find a better way of determining
19781         if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
19782         symbol in it at all so maybe this is only for now.
19783
19784 2001-10-30  Ravi Pratap  <ravi@ximian.com>
19785
19786         * support.cs (InternalParameters): Constructor now takes an extra argument 
19787         which is the actual Parameters class.
19788
19789         (ParameterDesc): Update to provide info on ref/out modifiers.
19790
19791         * class.cs (everywhere): Update call to InternalParameters to pass in
19792         the second argument too.
19793
19794         * support.cs (ParameterData): Add ParameterModifier, which is a method 
19795         to return the modifier info [ref/out etc]
19796
19797         (InternalParameters, ReflectionParameters): Implement the above.
19798
19799         * expression.cs (Argument::ParameterModifier): Similar function to return
19800         info about the argument's modifiers.
19801
19802         (Invocation::OverloadResolve): Update to take into account matching modifiers 
19803         too.
19804
19805         * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
19806         a new SetFormalParameters object which we pass to InternalParameters.
19807
19808 2001-10-30  Ravi Pratap  <ravi@ximian.com>
19809
19810         * expression.cs (NewArray): Merge into the ArrayCreation class.
19811
19812 2001-10-29  Ravi Pratap  <ravi@ximian.com>
19813
19814         * expression.cs (NewArray): Merge classes NewBuiltinArray and 
19815         NewUserdefinedArray into one as there wasn't much of a use in having
19816         two separate ones.
19817
19818         * expression.cs (Argument): Change field's name to ArgType from Type.
19819
19820         (Type): New readonly property which returns the proper type, taking into 
19821         account ref/out modifiers.
19822
19823         (everywhere): Adjust code accordingly for the above.
19824
19825         * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
19826         whether we are emitting for a ref or out parameter.
19827
19828         * expression.cs (Argument::Emit): Use the above field to set the state.
19829
19830         (LocalVariableReference::Emit): Update to honour the flag and emit the
19831         right stuff.
19832
19833         * parameter.cs (Attributes): Set the correct flags for ref parameters.
19834
19835         * expression.cs (Argument::FullDesc): New function to provide a full desc.
19836
19837         * support.cs (ParameterData): Add method ParameterDesc to the interface.
19838
19839         (ReflectionParameters, InternalParameters): Implement the above method.
19840
19841         * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
19842         reporting errors.
19843
19844         (Invocation::FullMethodDesc): Ditto. 
19845
19846 2001-10-29  Miguel de Icaza  <miguel@ximian.com>
19847
19848         * cs-parser.jay: Add extra production for the second form of array
19849         creation. 
19850
19851         * expression.cs (ArrayCreation): Update to reflect the above
19852         change. 
19853
19854         * Small changes to prepare for Array initialization.
19855
19856 2001-10-28  Miguel de Icaza  <miguel@ximian.com>
19857
19858         * typemanager.cs (ImplementsInterface): interface might be null;
19859         Deal with this problem;
19860
19861         Also, we do store negative hits on the cache (null values), so use
19862         this instead of calling t.GetInterfaces on the type everytime.
19863
19864 2001-10-28  Ravi Pratap  <ravi@ximian.com>
19865
19866         * typemanager.cs (IsBuiltinType): New method to help determine the same.
19867
19868         * expression.cs (New::DoResolve): Get rid of array creation code and instead
19869         split functionality out into different classes.
19870
19871         (New::FormArrayType): Move into NewBuiltinArray.
19872
19873         (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
19874         quite useless.
19875
19876         (NewBuiltinArray): New class to handle creation of built-in arrays.
19877
19878         (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
19879         account creation of one-dimensional arrays.
19880
19881         (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
19882
19883         (NewUserdefinedArray::DoResolve): Implement.
19884
19885         * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
19886
19887         * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
19888         we maintain inside the TypeManager. This is necessary to perform lookups on the
19889         module builder.
19890
19891         (LookupType): Update to perform GetType on the module builders too.     
19892
19893         * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
19894
19895         * exprssion.cs (NewUserdefinedArray::Emit): Implement.
19896
19897 2001-10-23  Ravi Pratap  <ravi@ximian.com>
19898
19899         * expression.cs (New::DoResolve): Implement guts of array creation.
19900
19901         (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
19902
19903 2001-10-27  Miguel de Icaza  <miguel@ximian.com>
19904
19905         * expression.cs: Fix bug I introduced lsat night that broke
19906         Delegates. 
19907
19908         (Expression.Resolve): Report a 246 error (can not resolve name)
19909         if we find a SimpleName in the stream.
19910
19911         (Expression.ResolveLValue): Ditto.
19912
19913         (Expression.ResolveWithSimpleName): This function is a variant of
19914         ResolveName, this one allows SimpleNames to be returned without a
19915         warning.  The only consumer of SimpleNames is MemberAccess
19916
19917 2001-10-26  Miguel de Icaza  <miguel@ximian.com>
19918
19919         * expression.cs (Invocation::DoResolve): Catch SimpleNames that
19920         might arrive here.  I have my doubts that this is correct.
19921
19922         * statement.cs (Lock): Implement lock statement.
19923
19924         * cs-parser.jay: Small fixes to support `lock' and `using'
19925
19926         * cs-tokenizer.cs: Remove extra space
19927
19928         * driver.cs: New flag --checked, allows to turn on integer math
19929         checking. 
19930
19931         * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
19932         Threading.Monitor.Exit 
19933
19934 2001-10-23  Miguel de Icaza  <miguel@ximian.com>
19935
19936         * expression.cs (IndexerAccess::DoResolveLValue): Set the
19937         Expression Class to be IndexerAccess.
19938
19939         Notice that Indexer::DoResolve sets the eclass to Value.
19940
19941 2001-10-22  Miguel de Icaza  <miguel@ximian.com>
19942
19943         * class.cs (TypeContainer::Emit): Emit code for indexers.
19944
19945         * assign.cs (IAssignMethod): New interface implemented by Indexers
19946         and Properties for handling assignment.
19947
19948         (Assign::Emit): Simplify and reuse code. 
19949
19950         * expression.cs (IndexerAccess, PropertyExpr): Implement
19951         IAssignMethod, clean up old code. 
19952
19953 2001-10-22  Ravi Pratap  <ravi@ximian.com>
19954
19955         * typemanager.cs (ImplementsInterface): New method to determine if a type
19956         implements a given interface. Provides a nice cache too.
19957
19958         * expression.cs (ImplicitReferenceConversion): Update checks to use the above
19959         method.
19960
19961         (ConvertReferenceExplicit): Ditto.
19962
19963         * delegate.cs (Delegate::Populate): Update to define the parameters on the 
19964         various methods, with correct names etc.
19965
19966         * class.cs (Operator::OpType): New members Operator.UnaryPlus and 
19967         Operator.UnaryNegation.
19968
19969         * cs-parser.jay (operator_declarator): Be a little clever in the case where
19970         we have a unary plus or minus operator.
19971
19972         * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and 
19973         UnaryMinus.
19974
19975         * everywhere : update accordingly.
19976
19977         * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
19978         respectively.
19979
19980         * class.cs (Method::Define): For the case where we are implementing a method
19981         inherited from an interface, we need to set the MethodAttributes.Final flag too. 
19982         Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
19983
19984 2001-10-21  Ravi Pratap  <ravi@ximian.com>
19985
19986         * interface.cs (FindMembers): Implement to work around S.R.E
19987         lameness.
19988
19989         * typemanager.cs (IsInterfaceType): Implement.
19990
19991         (FindMembers): Update to handle interface types too.
19992
19993         * expression.cs (ImplicitReferenceConversion): Re-write bits which
19994         use IsAssignableFrom as that is not correct - it doesn't work.
19995
19996         * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
19997         and accordingly override EmitStatement.
19998
19999         * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
20000         using the correct logic :-)
20001
20002 2001-10-19  Ravi Pratap  <ravi@ximian.com>
20003
20004         * ../errors/cs-11.cs : Add to demonstrate error -11 
20005
20006 2001-10-17  Miguel de Icaza  <miguel@ximian.com>
20007
20008         * assign.cs (Assign::Resolve): Resolve right hand side first, and
20009         then pass this as a hint to ResolveLValue.
20010
20011         * expression.cs (FieldExpr): Add Location information
20012
20013         (FieldExpr::LValueResolve): Report assignment to readonly
20014         variable. 
20015
20016         (Expression::ExprClassFromMemberInfo): Pass location information.
20017
20018         (Expression::ResolveLValue): Add new method that resolves an
20019         LValue. 
20020
20021         (Expression::DoResolveLValue): Default invocation calls
20022         DoResolve. 
20023
20024         (Indexers): New class used to keep track of indexers in a given
20025         Type. 
20026
20027         (IStackStore): Renamed from LValue, as it did not really describe
20028         what this did.  Also ResolveLValue is gone from this interface and
20029         now is part of Expression.
20030
20031         (ElementAccess): Depending on the element access type
20032
20033         * typemanager.cs: Add `indexer_name_type' as a Core type
20034         (System.Runtime.CompilerServices.IndexerNameAttribute)
20035
20036         * statement.cs (Goto): Take a location.
20037
20038 2001-10-18  Ravi Pratap  <ravi@ximian.com>
20039
20040         * delegate.cs (Delegate::VerifyDelegate): New method to verify
20041         if two delegates are compatible.
20042
20043         (NewDelegate::DoResolve): Update to take care of the case when
20044         we instantiate a delegate from another delegate.
20045
20046         * typemanager.cs (FindMembers): Don't even try to look up members
20047         of Delegate types for now.
20048
20049 2001-10-18  Ravi Pratap  <ravi@ximian.com>
20050
20051         * delegate.cs (NewDelegate): New class to take care of delegate
20052         instantiation.
20053
20054         * expression.cs (New): Split the delegate related code out into 
20055         the NewDelegate class.
20056
20057         * delegate.cs (DelegateInvocation): New class to handle delegate 
20058         invocation.
20059
20060         * expression.cs (Invocation): Split out delegate related code into
20061         the DelegateInvocation class.
20062
20063 2001-10-17  Ravi Pratap  <ravi@ximian.com>
20064
20065         * expression.cs (New::DoResolve): Implement delegate creation fully
20066         and according to the spec.
20067
20068         (New::DoEmit): Update to handle delegates differently.
20069
20070         (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
20071         because of which we were printing out arguments in reverse order !
20072
20073         * delegate.cs (VerifyMethod): Implement to check if the given method
20074         matches the delegate.
20075
20076         (FullDelegateDesc): Implement.
20077
20078         (VerifyApplicability): Implement.
20079
20080         * expression.cs (Invocation::DoResolve): Update to accordingly handle
20081         delegate invocations too.
20082
20083         (Invocation::Emit): Ditto.
20084
20085         * ../errors/cs1593.cs : Added.
20086
20087         * ../errors/cs1594.cs : Added.
20088
20089         * delegate.cs (InstanceExpression, TargetMethod): New properties.
20090
20091 2001-10-16  Ravi Pratap  <ravi@ximian.com>
20092
20093         * typemanager.cs (intptr_type): Core type for System.IntPtr
20094
20095         (InitCoreTypes): Update for the same.
20096
20097         (iasyncresult_type, asynccallback_type): Ditto.
20098
20099         * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
20100         correct.
20101
20102         * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
20103         too.
20104
20105         * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
20106         the builders for the 4 members of a delegate type :-)
20107
20108         (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
20109         type.
20110
20111         * expression.cs (New::DoResolve): Implement guts for delegate creation.
20112
20113         * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
20114
20115 2001-10-15  Miguel de Icaza  <miguel@ximian.com>
20116
20117         * statement.cs (Break::Emit): Implement.   
20118         (Continue::Emit): Implement.
20119
20120         (For::Emit): Track old being/end loops;  Set Begin loop, ack end loop
20121         (While::Emit): Track old being/end loops;  Set Begin loop, ack end loop
20122         (Do::Emit): Track old being/end loops;  Set Begin loop, ack end loop
20123         (Foreach::Emit): Track old being/end loops;  Set Begin loop, ack
20124         end loop
20125
20126         * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
20127         properties that track the label for the current loop (begin of the
20128         loop and end of the loop).
20129
20130 2001-10-15  Ravi Pratap  <ravi@ximian.com>
20131
20132         * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
20133         use of emitting anything at all.
20134
20135         * class.cs, rootcontext.cs : Get rid of calls to the same.
20136
20137         * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
20138
20139         (Populate): Define the constructor correctly and set the implementation
20140         attributes.
20141
20142         * typemanager.cs (delegate_types): New hashtable to hold delegates that
20143         have been defined.
20144
20145         (AddDelegateType): Implement.
20146
20147         (IsDelegateType): Implement helper method.
20148
20149         * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
20150
20151         * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
20152         and accordingly handle it.
20153
20154         * delegate.cs (Populate): Take TypeContainer argument.
20155         Implement bits to define the Invoke method. However, I still haven't figured out
20156         how to take care of the native int bit :-(
20157
20158         * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-) 
20159         Qualify the name of the delegate, not its return type !
20160
20161         * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
20162         conversion.
20163
20164         (StandardConversionExists): Checking for array types turns out to be recursive.
20165
20166         (ConvertReferenceExplicit): Implement array conversion.
20167
20168         (ExplicitReferenceConversionExists): New method to determine precisely that :-)
20169
20170 2001-10-12  Ravi Pratap  <ravi@ximian.com>
20171
20172         * cs-parser.jay (delegate_declaration): Store the fully qualified
20173         name as it is a type declaration.
20174
20175         * delegate.cs (ReturnType, Name): Rename members to these. Make them 
20176         readonly.
20177
20178         (DefineDelegate): Renamed from Define. Does the same thing essentially,
20179         as TypeContainer::DefineType.
20180
20181         (Populate): Method in which all the definition of the various methods (Invoke)
20182         etc is done.
20183
20184         (Emit): Emit any code, if necessary. I am not sure about this really, but let's
20185         see.
20186
20187         (CloseDelegate): Finally creates the delegate.
20188
20189         * class.cs (TypeContainer::DefineType): Update to define delegates.
20190         (Populate, Emit and CloseType): Do the same thing here too.
20191
20192         * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
20193         delegates in all these operations.
20194
20195 2001-10-14  Miguel de Icaza  <miguel@ximian.com>
20196
20197         * expression.cs: LocalTemporary: a new expression used to
20198         reference a temporary that has been created.
20199
20200         * assign.cs: Handle PropertyAccess back here, so that we can
20201         provide the proper semantic access to properties.
20202
20203         * expression.cs (Expression::ConvertReferenceExplicit): Implement
20204         a few more explicit conversions. 
20205
20206         * modifiers.cs: `NEW' modifier maps to HideBySig.
20207
20208         * expression.cs (PropertyExpr): Make this into an
20209         ExpressionStatement, and support the EmitStatement code path. 
20210
20211         Perform get/set error checking, clean up the interface.
20212
20213         * assign.cs: recognize PropertyExprs as targets, and if so, turn
20214         them into toplevel access objects.
20215
20216 2001-10-12  Miguel de Icaza  <miguel@ximian.com>
20217
20218         * expression.cs: PropertyExpr::PropertyExpr: use work around the
20219         SRE.
20220
20221         * typemanager.cs: Keep track here of our PropertyBuilders again to
20222         work around lameness in SRE.
20223
20224 2001-10-11  Miguel de Icaza  <miguel@ximian.com>
20225
20226         * expression.cs (LValue::LValueResolve): New method in the
20227         interface, used to perform a second resolution pass for LValues. 
20228
20229         (This::DoResolve): Catch the use of this in static methods.
20230
20231         (This::LValueResolve): Implement.
20232
20233         (This::Store): Remove warning, assigning to `this' in structures
20234         is 
20235
20236         (Invocation::Emit): Deal with invocation of
20237         methods on value types.  We need to pass the address to structure
20238         methods rather than the object itself.  (The equivalent code to
20239         emit "this" for structures leaves the entire structure on the
20240         stack instead of a pointer to it). 
20241
20242         (ParameterReference::DoResolve): Compute the real index for the
20243         argument based on whether the method takes or not a `this' pointer
20244         (ie, the method is static).
20245
20246         * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
20247         value types returned from functions when we need to invoke a
20248         method on the sturcture.
20249
20250
20251 2001-10-11  Ravi Pratap  <ravi@ximian.com>
20252
20253         * class.cs (TypeContainer::DefineType): Method to actually do the business of
20254         defining the type in the Modulebuilder or Typebuilder. This is to take
20255         care of nested types which need to be defined on the TypeBuilder using
20256         DefineNestedMethod.
20257
20258         (TypeContainer::GetClassBases): Implement. Essentially the code from the 
20259         methods in RootContext, only ported to be part of TypeContainer.
20260
20261         (TypeContainer::GetInterfaceOrClass): Ditto.
20262
20263         (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
20264
20265         * interface.cs (Interface::DefineInterface): New method. Does exactly
20266         what RootContext.CreateInterface did earlier, only it takes care of nested types 
20267         too.
20268
20269         (Interface::GetInterfaces): Move from RootContext here and port.
20270
20271         (Interface::GetInterfaceByName): Same here.
20272
20273         * rootcontext.cs (ResolveTree): Re-write.
20274
20275         (PopulateTypes): Re-write.
20276
20277         * class.cs (TypeContainer::Populate): Populate nested types too.
20278         (TypeContainer::Emit): Emit nested members too.
20279
20280         * typemanager.cs (AddUserType): Do not make use of the FullName property,
20281         instead just use the name argument passed in as it is already fully
20282         qualified.
20283
20284         (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
20285         to TypeContainer mapping to see if a type is user-defined.
20286
20287         * class.cs (TypeContainer::CloseType): Implement. 
20288
20289         (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
20290         the default constructor.
20291
20292         (TypeContainer::Populate): Fix minor bug which led to creating default constructors
20293         twice.
20294
20295         (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
20296
20297         * interface.cs (CloseType): Create the type here.
20298
20299         * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
20300         the hierarchy.
20301
20302         Remove all the methods which are now in TypeContainer.
20303
20304 2001-10-10  Ravi Pratap  <ravi@ximian.com>
20305
20306         * delegate.cs (Define): Re-write bits to define the delegate
20307         correctly.
20308
20309 2001-10-10  Miguel de Icaza  <miguel@ximian.com>
20310
20311         * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
20312
20313         * expression.cs (ImplicitReferenceConversion): handle null as well
20314         as a source to convert to any reference type.
20315
20316         * statement.cs (Return): Perform any implicit conversions to
20317         expected return type.  
20318
20319         Validate use of return statement.  
20320
20321         * codegen.cs (EmitContext): Pass the expected return type here.
20322
20323         * class.cs (Method, Constructor, Property): Pass expected return
20324         type to EmitContext.
20325
20326 2001-10-09  Miguel de Icaza  <miguel@ximian.com>
20327
20328         * expression.cs: Make DoResolve take an EmitContext instead of a
20329         TypeContainer.
20330
20331         Replaced `l' and `location' for `loc', for consistency.
20332
20333         (Error, Warning): Remove unneeded Tc argument.
20334
20335         * assign.cs, literal.cs, constant.cs: Update to new calling
20336         convention. 
20337
20338         * codegen.cs: EmitContext now contains a flag indicating whether
20339         code is being generated in a static method or not.
20340
20341         * cs-parser.jay: DecomposeQI, new function that replaces the old
20342         QualifiedIdentifier.  Now we always decompose the assembled
20343         strings from qualified_identifier productions into a group of
20344         memberaccesses.
20345
20346 2001-10-08  Miguel de Icaza  <miguel@ximian.com>
20347
20348         * rootcontext.cs: Deal with field-less struct types correctly now
20349         by passing the size option to Define Type.
20350
20351         * class.cs: Removed hack that created one static field. 
20352
20353 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
20354
20355         * statement.cs: Moved most of the code generation here. 
20356
20357 2001-10-09  Ravi Pratap  <ravi@ximian.com>
20358
20359         * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
20360         seem very right.
20361
20362         (ElementAccess): Remove useless bits for now - keep checks as the spec
20363         says.
20364
20365 2001-10-08  Ravi Pratap  <ravi@ximian.com>
20366
20367         * expression.cs (ElementAccess::DoResolve): Remove my crap code
20368         and start performing checks according to the spec.
20369
20370 2001-10-07  Ravi Pratap  <ravi@ximian.com>
20371
20372         * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
20373         rank_specifiers instead.
20374
20375         (rank_specifiers): Change the order in which the rank specifiers are stored
20376
20377         (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
20378
20379         * expression.cs (ElementAccess): Implement the LValue interface too.
20380
20381 2001-10-06  Ravi Pratap  <ravi@ximian.com>
20382
20383         * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
20384         except that user defined conversions are not included.
20385
20386         (UserDefinedConversion): Update to use the ConvertExplicitStandard to 
20387         perform the conversion of the return type, if necessary.
20388
20389         (New::DoResolve): Check whether we are creating an array or an object
20390         and accordingly do the needful.
20391
20392         (New::Emit): Same here.
20393
20394         (New::DoResolve): Implement guts of array creation.
20395
20396         (New::FormLookupType): Helper function.
20397
20398 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
20399
20400         * codegen.cs: Removed most of the code generation here, and move the
20401         corresponding code generation bits to the statement classes. 
20402
20403         Added support for try/catch/finalize and throw.
20404
20405         * cs-parser.jay: Added support for try/catch/finalize.
20406
20407         * class.cs: Catch static methods having the flags override,
20408         virtual or abstract.
20409
20410         * expression.cs (UserCast): This user cast was not really doing
20411         what it was supposed to do.  Which is to be born in fully resolved
20412         state.  Parts of the resolution were being performed at Emit time! 
20413
20414         Fixed this code.
20415
20416 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
20417
20418         * expression.cs: Implicity convert the result from UserCast.
20419
20420 2001-10-05  Ravi Pratap  <ravi@ximian.com>
20421
20422         * expression.cs (Expression::FindMostEncompassingType): Fix bug which
20423         prevented it from working correctly. 
20424
20425         (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
20426         merely ConvertImplicit.
20427
20428 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
20429
20430         * typemanager.cs: Make the LookupTypeContainer function static,
20431         and not per-instance.  
20432
20433         * class.cs: Make static FindMembers (the one that takes a Type
20434         argument). 
20435
20436         * codegen.cs: Add EmitForeach here.
20437
20438         * cs-parser.jay: Make foreach a toplevel object instead of the
20439         inline expansion, as we need to perform semantic analysis on it. 
20440
20441 2001-10-05  Ravi Pratap  <ravi@ximian.com>
20442
20443         * expression.cs (Expression::ImplicitUserConversion): Rename to
20444         UserDefinedConversion.
20445
20446         (Expression::UserDefinedConversion): Take an extra argument specifying 
20447         whether we look for explicit user conversions too.
20448
20449         (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
20450
20451         (UserDefinedConversion): Incorporate support for user defined explicit conversions.
20452
20453         (ExplicitUserConversion): Make it a call to UserDefinedConversion
20454         with the appropriate arguments.
20455
20456         * cs-parser.jay (cast_expression): Record location too.
20457
20458         * expression.cs (Cast): Record location info.
20459
20460         (Expression::ConvertExplicit): Take location argument.
20461
20462         (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
20463         to determine if we are doing explicit conversions.
20464
20465         (UserCast::Emit): Update accordingly.
20466
20467         (Expression::ConvertExplicit): Report an error if everything fails.
20468
20469         * ../errors/cs0030.cs : Add.
20470
20471 2001-10-04  Miguel de Icaza  <miguel@ximian.com>
20472
20473         * modifiers.cs: If the ABSTRACT keyword is present, also set the
20474         virtual and newslot bits. 
20475
20476         * class.cs (TypeContainer::RegisterRequiredImplementations):
20477         Record methods we need.
20478
20479         (TypeContainer::MakeKey): Helper function to make keys for
20480         MethodBases, since the Methodbase key is useless.
20481
20482         (TypeContainer::Populate): Call RegisterRequiredImplementations
20483         before defining the methods.   
20484
20485         Create a mapping for method_builders_to_methods ahead of time
20486         instead of inside a tight loop.
20487
20488         (::RequireMethods):  Accept an object as the data to set into the
20489         hashtable so we can report interface vs abstract method mismatch.
20490
20491 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
20492
20493         * report.cs: Make all of it static.
20494
20495         * rootcontext.cs: Drop object_type and value_type computations, as
20496         we have those in the TypeManager anyways.
20497
20498         Drop report instance variable too, now it is a global.
20499
20500         * driver.cs: Use try/catch on command line handling.
20501
20502         Add --probe option to debug the error reporting system with a test
20503         suite. 
20504
20505         * report.cs: Add support for exiting program when a probe
20506         condition is reached.
20507
20508 2001-10-03  Ravi Pratap  <ravi@ximian.com>
20509
20510         * expression.cs (Binary::DoNumericPromotions): Fix the case when
20511         we do a forcible conversion regardless of type, to check if 
20512         ForceConversion returns a null.
20513
20514         (Binary::error19): Use location to report error.
20515
20516         (Unary::error23): Use location here too.
20517
20518         * ../errors/cs0019.cs : Check in.
20519
20520         * ../errors/cs0023.cs : Check in.
20521
20522         * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
20523         case of a non-null MethodInfo object with a length of 0 !
20524
20525         (Binary::ResolveOperator): Flag error if overload resolution fails to find
20526         an applicable member - according to the spec :-)
20527         Also fix logic to find members in base types.
20528
20529         (Unary::ResolveOperator): Same here.
20530
20531         (Unary::report23): Change name to error23 and make first argument a TypeContainer
20532         as I was getting thoroughly confused between this and error19 :-)
20533
20534         * expression.cs (Expression::ImplicitUserConversion): Re-write fully
20535         (::FindMostEncompassedType): Implement.
20536         (::FindMostEncompassingType): Implement.
20537         (::StandardConversionExists): Implement.
20538
20539         (UserImplicitCast): Re-vamp. We now need info about most specific
20540         source and target types so that we can do the necessary conversions.
20541
20542         (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
20543         mathematical union with no duplicates.
20544
20545 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
20546
20547         * rootcontext.cs (RootContext::PopulateTypes): Populate containers
20548         in order from base classes to child classes, so that we can in
20549         child classes look up in our parent for method names and
20550         attributes (required for handling abstract, virtual, new, override
20551         constructs: we need to instrospect our base class, and if we dont
20552         populate the classes in order, the introspection might be
20553         incorrect.  For example, a method could query its parent before
20554         the parent has any methods and would determine that the parent has
20555         no abstract methods (while it could have had them)).
20556
20557         (RootContext::CreateType): Record the order in which we define the
20558         classes.
20559
20560 2001-10-02  Miguel de Icaza  <miguel@ximian.com>
20561
20562         * class.cs (TypeContainer::Populate): Also method definitions can
20563         fail now, keep track of this.
20564
20565         (TypeContainer::FindMembers): Implement support for
20566         DeclaredOnly/noDeclaredOnly flag.
20567
20568         (Constructor::Emit) Return the ConstructorBuilder.
20569
20570         (Method::Emit) Return the MethodBuilder. 
20571         Check for abstract or virtual methods to be public.
20572
20573         * rootcontext.cs (RootContext::CreateType): Register all the
20574         abstract methods required for the class to be complete and the
20575         interface methods that must be implemented. 
20576
20577         * cs-parser.jay: Report error 501 (method requires body if it is
20578         not marked abstract or extern).
20579
20580         * expression.cs (TypeOf::Emit): Implement.
20581
20582         * typemanager.cs: runtime_handle_type, new global type.
20583
20584         * class.cs (Property::Emit): Generate code for properties.
20585
20586 2001-10-02  Ravi Pratap  <ravi@ximian.com>
20587
20588         * expression.cs (Unary::ResolveOperator): Find operators on base type
20589         too - we now conform exactly to the spec.
20590
20591         (Binary::ResolveOperator): Same here.
20592
20593         * class.cs (Operator::Define): Fix minor quirk in the tests.
20594
20595         * ../errors/cs0215.cs : Added.
20596
20597         * ../errors/cs0556.cs : Added.
20598
20599         * ../errors/cs0555.cs : Added.
20600
20601 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
20602
20603         * cs-tokenizer.cs: Reimplemented Location to be a struct with a
20604         single integer which is really efficient
20605
20606 2001-10-01  Ravi Pratap  <ravi@ximian.com>
20607
20608         *  expression.cs (Expression::ImplicitUserConversion): Use location
20609         even in the case when we are examining True operators.
20610  
20611         * class.cs (Operator::Define): Perform extensive checks to conform
20612         with the rules for operator overloading in the spec.
20613
20614         * expression.cs (Expression::ImplicitReferenceConversion): Implement
20615         some of the other conversions mentioned in the spec.
20616
20617         * typemanager.cs (array_type): New static member for the System.Array built-in
20618         type.
20619
20620         (cloneable_interface): For System.ICloneable interface.
20621
20622         * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
20623         we start resolving the tree and populating types.
20624
20625         * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
20626  
20627 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
20628
20629         * expression.cs (Expression::ExprClassFromMemberInfo,
20630         Expression::Literalize): Create literal expressions from
20631         FieldInfos which are literals.
20632
20633         (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
20634         type casts, because they were wrong.  The test suite in tests
20635         caught these ones.
20636
20637         (ImplicitNumericConversion): ushort to ulong requires a widening
20638         cast. 
20639
20640         Int32 constant to long requires widening cast as well.
20641
20642         * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
20643         for integers because the type on the stack is not i4.
20644
20645 2001-09-30  Miguel de Icaza  <miguel@ximian.com>
20646
20647         * expression.cs (report118): require location argument. 
20648
20649         * parameter.cs: Do not dereference potential null value.
20650
20651         * class.cs: Catch methods that lack the `new' keyword when
20652         overriding a name.  Report warnings when `new' is used without
20653         anything being there to override.
20654
20655         * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
20656
20657         * class.cs: Only add constructor to hashtable if it is non-null
20658         (as now constructors can fail on define).
20659
20660         (TypeManager, Class, Struct): Take location arguments.
20661
20662         Catch field instance initialization in structs as errors.
20663
20664         accepting_filter: a new filter for FindMembers that is static so
20665         that we dont create an instance per invocation.
20666
20667         (Constructor::Define): Catch errors where a struct constructor is
20668         parameterless 
20669
20670         * cs-parser.jay: Pass location information for various new
20671         constructs. 
20672
20673         * delegate.cs (Delegate): take a location argument.
20674
20675         * driver.cs: Do not call EmitCode if there were problesm in the
20676         Definition of the types, as many Builders wont be there. 
20677
20678         * decl.cs (Decl::Decl): Require a location argument.
20679
20680         * cs-tokenizer.cs: Handle properly hex constants that can not fit
20681         into integers, and find the most appropiate integer for it.
20682
20683         * literal.cs: Implement ULongLiteral.
20684
20685         * rootcontext.cs: Provide better information about the location of
20686         failure when CreateType fails.
20687
20688 2001-09-29  Miguel de Icaza  <miguel@ximian.com>
20689
20690         * rootcontext.cs (RootContext::PopulateTypes): Populates structs
20691         as well.
20692
20693         * expression.cs (Binary::CheckShiftArguments): Add missing type
20694         computation.
20695         (Binary::ResolveOperator): Add type to the logical and and logical
20696         or, Bitwise And/Or and Exclusive Or code paths, it was missing
20697         before.
20698
20699         (Binary::DoNumericPromotions): In the case where either argument
20700         is ulong (and most signed types combined with ulong cause an
20701         error) perform implicit integer constant conversions as well.
20702
20703 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
20704
20705         * expression.cs (UserImplicitCast): Method should always be
20706         non-null. 
20707         (Invocation::BetterConversion): Simplified test for IntLiteral.
20708
20709         (Expression::ImplicitNumericConversion): Split this routine out.
20710         Put the code that performs implicit constant integer conversions
20711         here. 
20712
20713         (Expression::Resolve): Become a wrapper around DoResolve so we can
20714         check eclass and type being set after resolve.
20715
20716         (Invocation::Badness): Remove this dead function
20717
20718         (Binary::ResolveOperator): Do not compute the expensive argumnets
20719         unless we have a union for it.
20720
20721         (Probe::Emit): Is needs to do an isinst and then
20722         compare against null.
20723
20724         (::CanConvert): Added Location argument.  If the Location argument
20725         is null (Location.Null), then we do not report errors.  This is
20726         used by the `probe' mechanism of the Explicit conversion.  We do
20727         not want to generate an error for something that the user
20728         explicitly requested to be casted.  But the pipeline for an
20729         explicit cast first tests for potential implicit casts.
20730
20731         So for now, if the Location is null, it means `Probe only' to
20732         avoid adding another argument.   Might have to revise this
20733         strategy later.
20734
20735         (ClassCast): New class used to type cast objects into arbitrary
20736         classes (used in Explicit Reference Conversions).
20737
20738         Implement `as' as well.
20739
20740         Reverted all the patches from Ravi below: they were broken:
20741
20742                 * The use of `level' as a mechanism to stop recursive
20743                   invocations is wrong.  That was there just to catch the
20744                   bug with a strack trace but not as a way of addressing
20745                   the problem.
20746
20747                   To fix the problem we have to *understand* what is going
20748                   on and the interactions and come up with a plan, not
20749                   just get things going.
20750
20751                 * The use of the type conversion cache that I proposed
20752                   last night had an open topic: How does this work across
20753                   protection domains.  A user defined conversion might not
20754                   be public in the location where we are applying the
20755                   conversion, a different conversion might be selected
20756                   (ie, private A->B (better) but public B->A (worse),
20757                   inside A, A->B applies, but outside it, B->A will
20758                   apply).
20759
20760                 * On top of that (ie, even if the above is solved),
20761                   conversions in a cache need to be abstract.  Ie, `To
20762                   convert from an Int to a Short use an OpcodeCast', not
20763                   `To convert from an Int to a Short use the OpcodeCast on
20764                   the variable 5' (which is what this patch was doing).
20765
20766 2001-09-28  Ravi Pratap  <ravi@ximian.com>
20767
20768         * expression.cs (Invocation::ConversionExists): Re-write to use
20769         the conversion cache
20770
20771         (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
20772         cache all conversions done, not just user-defined ones.
20773
20774         (Invocation::BetterConversion): The real culprit. Use ConversionExists
20775         to determine if a conversion exists instead of acutually trying to 
20776         perform the conversion. It's faster too.
20777
20778         (Expression::ConvertExplicit): Modify to use ConversionExists to check
20779         and only then attempt the implicit conversion.
20780
20781 2001-09-28  Ravi Pratap  <ravi@ximian.com>
20782
20783         * expression.cs (ConvertImplicit): Use a cache for conversions
20784         already found. Check level of recursion and bail out if necessary.
20785
20786 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
20787
20788         * typemanager.cs (string_concat_string_string, string_concat_object_object):
20789         Export standard methods that we expect for string operations.
20790
20791         * statement.cs (Block::UsageWarning): Track usage of variables and
20792         report the errors for not used variables.
20793
20794         * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
20795         operator. 
20796
20797 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
20798
20799         * codegen.cs: remove unnneded code 
20800
20801         * expression.cs: Removed BuiltinTypeAccess class
20802
20803         Fix the order in which implicit conversions are
20804         done.  
20805
20806         The previous fixed dropped support for boxed conversions (adding a
20807         test to the test suite now)
20808
20809         (UserImplicitCast::CanConvert): Remove test for source being null,
20810         that code is broken.  We should not feed a null to begin with, if
20811         we do, then we should track the bug where the problem originates
20812         and not try to cover it up here.
20813
20814         Return a resolved expression of type UserImplicitCast on success
20815         rather than true/false.  Ravi: this is what I was talking about,
20816         the pattern is to use a static method as a "constructor" for
20817         objects. 
20818
20819         Also, do not create arguments until the very last minute,
20820         otherwise we always create the arguments even for lookups that
20821         will never be performed. 
20822
20823         (UserImplicitCast::Resolve): Eliminate, objects of type
20824         UserImplicitCast are born in a fully resolved state. 
20825
20826         * typemanager.cs (InitCoreTypes): Init also value_type
20827         (System.ValueType). 
20828
20829         * expression.cs (Cast::Resolve): First resolve the child expression.
20830
20831         (LValue): Add new method AddressOf to be used by
20832         the `&' operator.  
20833
20834         Change the argument of Store to take an EmitContext instead of an
20835         ILGenerator, because things like FieldExpr need to be able to call
20836         their children expression to generate the instance code. 
20837
20838         (Expression::Error, Expression::Warning): Sugar functions for
20839         reporting errors.
20840
20841         (Expression::MemberLookup): Accept a TypeContainer instead of a
20842         Report as the first argument.
20843
20844         (Expression::ResolvePrimary): Killed.  I still want to improve
20845         this as currently the code is just not right.
20846
20847         (Expression::ResolveMemberAccess): Simplify, but it is still
20848         wrong. 
20849
20850         (Unary::Resolve): Catch errors in AddressOf operators.
20851
20852         (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
20853         index to a byte for the short-version, or the compiler will choose
20854         the wrong Emit call, which generates the wrong data.
20855
20856         (ParameterReference::Emit, ::Store): same.
20857
20858         (FieldExpr::AddressOf): Implement.
20859
20860         * typemanager.cs: TypeManager: made public variable instead of
20861         property.
20862
20863         * driver.cs: document --fatal.
20864
20865         * report.cs (ErrorMessage, WarningMessage): new names for the old
20866         Error and Warning classes.
20867
20868         * cs-parser.jay (member_access): Turn built-in access to types
20869         into a normal simplename
20870
20871 2001-09-27  Ravi Pratap  <ravi@ximian.com>
20872
20873         * expression.cs (Invocation::BetterConversion): Fix to cope
20874         with q being null, since this was introducing a bug.
20875
20876         * expression.cs (ConvertImplicit): Do built-in conversions first.
20877
20878 2001-09-27  Ravi Pratap  <ravi@ximian.com>
20879
20880         * expression.cs (UserImplicitCast::Resolve): Fix bug.
20881
20882 2001-09-27  Ravi Pratap  <ravi@ximian.com>
20883
20884         * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
20885         I had introduced long ago (what's new ?).
20886
20887         * expression.cs (UserImplicitCast::CanConvert): Static method to do 
20888         the work of all the checking. 
20889         (ConvertImplicit): Call CanConvert and only then create object if necessary.
20890         (UserImplicitCast::CanConvert, ::Resolve): Re-write.
20891
20892         (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
20893         that is the right way. 
20894
20895         (Invocation::MakeUnionSet): Convenience function to make unions of sets for 
20896         overloading resolution. Use everywhere instead of cutting and pasting code.
20897
20898         (Binary::ResolveOperator): Use MakeUnionSet.
20899
20900         (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when 
20901         we have to convert to bool types. Not complete yet.
20902
20903 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
20904
20905         * typemanager.cs (TypeManager::CSharpName): support ushort.
20906
20907         * expression.cs (Expression::TryImplicitIntConversion): Attempts
20908         to provide an expression that performsn an implicit constant int
20909         conversion (section 6.1.6).
20910         (Expression::ConvertImplicitRequired): Reworked to include
20911         implicit constant expression conversions.
20912
20913         (Expression::ConvertNumericExplicit): Finished.
20914
20915         (Invocation::Emit): If InstanceExpression is null, then it means
20916         that we perform a call on this.
20917
20918 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
20919
20920         * expression.cs (Unary::Emit): Remove some dead code.
20921         (Probe): Implement Resolve and Emit for `is'.
20922         (Expression::ConvertImplicitRequired): Attempt to do constant
20923         expression conversions here.  Maybe should be moved to
20924         ConvertImplicit, but I am not sure.
20925         (Expression::ImplicitLongConstantConversionPossible,
20926         Expression::ImplicitIntConstantConversionPossible): New functions
20927         that tell whether is it possible to apply an implicit constant
20928         expression conversion.
20929
20930         (ConvertNumericExplicit): Started work on explicit numeric
20931         conversions.
20932
20933         * cs-parser.jay: Update operator constants.
20934
20935         * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
20936         (Parameters::GetSignature): Hook up VerifyArgs here.
20937         (Parameters::VerifyArgs): Verifies that no two arguments have the
20938         same name. 
20939
20940         * class.cs (Operator): Update the operator names to reflect the
20941         ones that the spec expects (as we are just stringizing the
20942         operator names).
20943
20944         * expression.cs (Unary::ResolveOperator): Fix bug: Use
20945         MethodInfo's ReturnType instead of LookupMethodByBuilder as the
20946         previous usage did only work for our methods.
20947         (Expression::ConvertImplicit): Handle decimal implicit numeric
20948         conversions as well.
20949         (Expression::InternalTypeConstructor): Used to invoke constructors
20950         on internal types for default promotions.
20951
20952         (Unary::Emit): Implement special handling for the pre/post
20953         increment/decrement for overloaded operators, as they need to have
20954         the same semantics as the other operators.
20955
20956         (Binary::ResolveOperator): ditto.
20957         (Invocation::ConversionExists): ditto.
20958         (UserImplicitCast::Resolve): ditto.
20959
20960 2001-09-26  Ravi Pratap  <ravi@ximian.com>
20961
20962         * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
20963         operator, return after emitting body. Regression tests pass again !
20964
20965         * expression.cs (ConvertImplicit): Take TypeContainer as first argument
20966         (Unary::ForceConversion, Binary::ForceConversion): Ditto.
20967         (Invocation::OverloadResolve): Ditto.
20968         (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
20969
20970         * everywhere : update calls to the above methods accordingly.
20971
20972 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
20973
20974         * assign.cs (Assign): Make it inherit from ExpressionStatement.
20975
20976         * expression.cs (ExpressionStatement): New base class used for
20977         expressions that can appear in statements, so that we can provide
20978         an alternate path to generate expression that do not leave a value
20979         on the stack.
20980
20981         (Expression::Emit, and all the derivatives): We no longer return
20982         whether a value is left on the stack or not.  Every expression
20983         after being emitted leaves a single value on the stack.
20984
20985         * codegen.cs (EmitContext::EmitStatementExpression): Use the
20986         facilties of ExpressionStatement if possible.
20987
20988         * cs-parser.jay: Update statement_expression.
20989
20990 2001-09-25  Miguel de Icaza  <miguel@ximian.com>
20991
20992         * driver.cs: Change the wording of message
20993
20994 2001-09-25  Ravi Pratap  <ravi@ximian.com>
20995
20996         * expression.cs (Binary::ResolveOperator): Had forgottten to set 
20997         the type of the expression to the return type of the method if
20998         we have an overloaded operator match ! The regression tests pass again !
20999         (Unary::ResolveOperator): Ditto.
21000
21001         * expression.cs (Invocation::ConversionExists): Correct the member lookup
21002         to find "op_Implicit", not "implicit" ;-)
21003         (UserImplicitCast): New class to take care of user-defined implicit conversions.
21004         (ConvertImplicit, ForceConversion): Take TypeContainer argument
21005
21006         * everywhere : Correct calls to the above accordingly.
21007
21008         * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
21009         (ConvertImplicit): Do user-defined conversion if it exists.
21010
21011 2001-09-24  Miguel de Icaza  <miguel@ximian.com>
21012
21013         * assign.cs: track location.
21014         (Resolve): Use implicit conversions on assignment.
21015
21016         * literal.cs: Oops.  Not good, Emit of short access values should
21017         pass (Bytes) or the wrong argument will be selected.
21018
21019         * expression.cs (Unary::Emit): Emit code for -expr.
21020
21021         (Unary::ResolveOperator): Handle `Substract' for non-constants
21022         (substract from zero from the non-constants).
21023         Deal with Doubles as well. 
21024
21025         (Expression::ConvertImplicitRequired): New routine that reports an
21026         error if no implicit conversion exists. 
21027
21028         (Invocation::OverloadResolve): Store the converted implicit
21029         expressions if we make them
21030
21031 2001-09-24  Ravi Pratap  <ravi@ximian.com>
21032
21033         * class.cs (ConstructorInitializer): Take a Location argument.
21034         (ConstructorBaseInitializer): Same here.
21035         (ConstructorThisInitializer): Same here.
21036
21037         * cs-parser.jay : Update all calls accordingly.
21038
21039         * expression.cs (Unary, Binary, New): Take location argument.
21040         Update accordingly everywhere.
21041
21042         * cs-parser.jay : Update all calls to the above to take a location
21043         argument.
21044
21045         * class.cs : Ditto.
21046
21047 2001-09-24  Ravi Pratap  <ravi@ximian.com>
21048
21049         * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
21050         (Invocation::BetterConversion): Same here
21051         (Invocation::ConversionExists): Ditto.
21052
21053         (Invocation::ConversionExists): Implement.
21054
21055 2001-09-22  Ravi Pratap  <ravi@ximian.com>
21056
21057         * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
21058         Also take an additional TypeContainer argument.
21059
21060         * All over : Pass in TypeContainer as argument to OverloadResolve.
21061
21062         * typemanager.cs (CSharpName): Update to check for the string type and return
21063         that too.
21064
21065         * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
21066         a given method.
21067
21068 2001-09-21  Ravi Pratap  <ravi@ximian.com>
21069
21070         * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
21071         (Invocation::BetterFunction): Implement.
21072         (Invocation::BetterConversion): Implement.
21073         (Invocation::ConversionExists): Skeleton, no implementation yet.
21074
21075         Okay, things work fine !
21076
21077 2001-09-21  Miguel de Icaza  <miguel@ximian.com>
21078
21079         * typemanager.cs: declare and load enum_type, delegate_type and
21080         void_type. 
21081
21082         * expression.cs (Expression::Emit): Now emit returns a value that
21083         tells whether a value is left on the stack or not.  This strategy
21084         might be reveted tomorrow with a mechanism that would address
21085         multiple assignments.
21086         (Expression::report118): Utility routine to report mismatches on
21087         the ExprClass.
21088
21089         (Unary::Report23): Report impossible type/operator combination
21090         utility function.
21091
21092         (Unary::IsIncrementableNumber): Whether the type can be
21093         incremented or decremented with add.
21094         (Unary::ResolveOperator): Also allow enumerations to be bitwise
21095         complemented. 
21096         (Unary::ResolveOperator): Implement ++, !, ~,
21097
21098         (Invocation::Emit): Deal with new Emit convetion.
21099
21100         * All Expression derivatives: Updated their Emit method to return
21101         whether they leave values on the stack or not.
21102
21103         * codegen.cs (CodeGen::EmitStatement): Pop values left on the
21104         stack for expressions that are statements. 
21105
21106 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
21107
21108         * expression.cs (LValue): New interface.  Must be implemented by
21109         LValue objects.
21110         (LocalVariableReference, ParameterReference, FieldExpr): Implement
21111         LValue interface.
21112
21113         * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
21114         interface for generating code, simplifies the code.
21115
21116 2001-09-20  Ravi Pratap  <ravi@ximian.com>
21117
21118         * expression.cs (everywhere): Comment out return statements in ::Resolve
21119         methods to avoid the warnings.
21120
21121 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
21122
21123         * driver.cs (parse): Report error 2001 if we can not open the
21124         source file.
21125
21126         * expression.cs (SimpleName::ResolveSimpleName): Error if we can
21127         not resolve it.
21128
21129         * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
21130         object. 
21131
21132         * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
21133         otherwise nested blocks end up with the same index.
21134
21135         * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
21136
21137         * expression.cs:  Instead of having FIXMEs in the Resolve
21138         functions, throw exceptions so it is obvious that we are facing a
21139         bug. 
21140
21141         * cs-parser.jay (invocation_expression): Pass Location information.
21142
21143         * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
21144         Use a basename for those routines because .NET does not like paths
21145         on them. 
21146
21147         * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
21148         already defined.
21149
21150 2001-09-19  Miguel de Icaza  <miguel@ximian.com>
21151
21152         * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
21153         are loading the correct data types (throws an exception if not).
21154         (TypeManager::InitCoreTypes): Use CoreLookupType
21155
21156         * expression.cs (Unary::ResolveOperator): return the child
21157         expression for expressions which are just +expr.
21158         (Unary::ResolveOperator): Return negative literals for -LITERAL
21159         expressions (otherwise they are Unary {Literal}).
21160         (Invocation::Badness): Take into account `Implicit constant
21161         expression conversions'.
21162
21163         * literal.cs (LongLiteral): Implement long literal class.
21164         (IntLiteral): export the `Value' of the intliteral. 
21165
21166 2001-09-19  Ravi Pratap  <ravi@ximian.com>
21167
21168         * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
21169
21170         * class.cs (Operator::Define): Change the methodname prefix to 'op_' 
21171         instead of 'Operator'
21172
21173         * expression.cs (Binary::ResolveOperator): Update accordingly.
21174         (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
21175         and 'Minus'
21176
21177         * cs-parser.jay (unary_expression): Update to use the new names.
21178
21179         * gen-treedump.cs (GetUnary): Same here.
21180
21181         * expression.cs (Unary::Resolve): Implement.
21182         (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded 
21183         operators are found instead of making noise ;-)
21184         (Unary::ResolveOperator): New method to do precisely the same thing which
21185         Binary::ResolveOperator does for Binary expressions.
21186         (Unary.method, .Arguments): Add.
21187         (Unary::OperName): Implement.   
21188         (Unary::ForceConversion): Copy and Paste !
21189
21190         * class.cs (Operator::Define): Fix a small bug for the case when we have 
21191         a unary operator.
21192
21193         * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
21194         for the inbuilt operators. Only overloading works for now ;-)
21195
21196 2001-09-18  Miguel de Icaza  <miguel@ximian.com>
21197
21198         * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
21199         UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
21200
21201         * expression.cs (This::Emit): Implement. 
21202         (This::Resolve): Implement.
21203         (TypeOf:Resolve): Implement.
21204         (Expression::ResolveSimpleName): Add an implicit this to instance
21205         field references. 
21206         (MemberAccess::Resolve): Deal with Parameters and Fields. 
21207         Bind instance variable to Field expressions.
21208         (FieldExpr::Instance): New field used to track the expression that
21209         represents the object instance.
21210         (FieldExpr::Resolve): Track potential errors from MemberLookup not
21211         binding 
21212         (FieldExpr::Emit): Implement.
21213
21214         * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
21215         the last instruction contains a return opcode to avoid generating
21216         the last `ret' instruction (this generates correct code, and it is
21217         nice to pass the peverify output).
21218
21219         * class.cs (TypeContainer::EmitFieldInitializers): Implement field
21220         initializer for static and instance variables.
21221         (Constructor::Emit): Allow initializer to be null in the case of
21222         static constructors.  Only emit initializer for instance
21223         constructors. 
21224
21225         (TypeContainer::FindMembers): Return a null array if there are no
21226         matches.
21227
21228         Also fix the code for the MemberTypes.Method branch, as it was not
21229         scanning that for operators (or tried to access null variables before).
21230
21231         * assign.cs (Assign::Emit): Handle instance and static fields. 
21232
21233         * TODO: Updated.
21234
21235         * driver.cs: Stop compilation if there are parse errors.
21236
21237         * cs-parser.jay (constructor_declaration): Provide default base
21238         initializer for non-static constructors.
21239         (constructor_declarator): Do not provide a default base
21240         initializers if none was specified.
21241         Catch the fact that constructors should not have parameters.
21242
21243         * class.cs: Do not emit parent class initializers for static
21244         constructors, that should be flagged as an error.
21245
21246 2001-09-18  Ravi Pratap  <ravi@ximian.com>
21247
21248         * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
21249         Move back code into TypeContainer::Populate.
21250
21251 2001-09-18  Ravi Pratap  <ravi@ximian.com>
21252
21253         * class.cs (TypeContainer::AddConstructor): Fix the check to
21254         compare against Name, not Basename. 
21255         (Operator::OpType): Change Plus and Minus to Add and Subtract.
21256
21257         * cs-parser.jay : Update accordingly.
21258
21259         * class.cs (TypeContainer::FindMembers): For the case where we are searching
21260         for methods, don't forget to look into the operators too.
21261         (RegisterMethodBuilder): Helper method to take care of this for
21262         methods, constructors and operators.
21263         (Operator::Define): Completely revamp.
21264         (Operator.OperatorMethod, MethodName): New fields.
21265         (TypeContainer::Populate): Move the registering of builders into
21266         RegisterMethodBuilder.
21267         (Operator::Emit): Re-write.
21268
21269         * expression.cs (Binary::Emit): Comment out code path to emit method
21270         invocation stuff for the case when we have a user defined operator. I am
21271         just not able to get it right !
21272
21273 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
21274
21275         * expression.cs (Expression::OverloadResolve): Drop TypeContainer
21276         argument. 
21277
21278         (Expression::MemberLookup): Provide a version that allows to
21279         specify the MemberTypes and BindingFlags. 
21280
21281         * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
21282         so it was not fetching variable information from outer blocks.
21283
21284         * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
21285         Beforefieldinit as it was buggy.
21286
21287         * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
21288         that Ravi put here.  
21289
21290         * class.cs (Constructor::Emit): Only emit if block is not null.
21291         (TypeContainer::EmitDefaultConstructor): Removed routine, now we
21292         deal with this by semantically definining it as if the user had
21293         done it.
21294
21295         (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
21296         constructors as we now "emit" them at a higher level.
21297
21298         (TypeContainer::DefineDefaultConstructor): Used to define the
21299         default constructors if none was provided.
21300
21301         (ConstructorInitializer): Add methods Resolve and Emit. 
21302
21303         * expression.cs: Cast to ConstructorInfo instead of MethodInfo
21304
21305 2001-09-17  Ravi Pratap  <ravi@ximian.com>
21306
21307         * class.cs (TypeContainer::EmitDefaultConstructor): Register
21308         the default constructor builder with our hashtable for methodbuilders
21309         to methodcores.
21310
21311         * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
21312         and argument_count is 0 in which case we have a match.
21313         (Binary::ResolveOperator): More null checking and miscellaneous coding
21314         style cleanup.
21315
21316 2001-09-17  Ravi Pratap  <ravi@ximian.com>
21317
21318         * rootcontext.cs (IsNameSpace): Compare against null.
21319
21320         * everywhere : Correct spelling to 'Greater' and to 'Subtract'
21321
21322         * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
21323         and Unary::Operator.
21324
21325         * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
21326         accordingly.
21327
21328         * expression.cs (Binary::method): New member to hold the MethodBase for the case when
21329         we have overloaded operators.
21330         (Binary::ResolveOperator): Implement the part which does the operator overload
21331         resolution.
21332
21333         * class.cs (Operator::Emit): Implement.
21334         (TypeContainer::Emit): Emit the operators we have too.
21335
21336         * expression.cs (Binary::Emit): Update to emit the appropriate code for
21337         the case when we have a user-defined operator.
21338
21339 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
21340
21341         * rootcontext.cs: Fix bug: tree.Namespaces might be null.
21342
21343 2001-09-16  Ravi Pratap  <ravi@ximian.com>
21344
21345         * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
21346         (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
21347         (Constructor::Emit): Implement.
21348         (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
21349         if we have no work to do. 
21350         (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's 
21351         Emit method.
21352
21353         * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
21354         (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
21355
21356         * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
21357         of parent.parent.
21358
21359 2001-09-15  Ravi Pratap  <ravi@ximian.com>
21360
21361         * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
21362         in the source.
21363         (Tree::RecordNamespace): Method to do what the name says ;-)
21364         (Tree::Namespaces): Property to get at the namespaces hashtable.
21365
21366         * cs-parser.jay (namespace_declaration): Call RecordNamespace to 
21367         keep track.
21368
21369         * rootcontext.cs (IsNamespace): Fixed it :-)
21370
21371 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
21372
21373         * class.cs (TypeContainer::FindMembers): Add support for
21374         constructors. 
21375         (MethodCore): New class that encapsulates both the shared aspects
21376         of a Constructor and a Method.  
21377         (Method, Constructor): Factored pieces into MethodCore.
21378
21379         * driver.cs: Added --fatal which makes errors throw exceptions.
21380         Load System assembly as well as part of the standard library.
21381
21382         * report.cs: Allow throwing exceptions on errors for debugging.
21383
21384         * modifiers.cs: Do not use `parent', instead use the real type
21385         container to evaluate permission settings.
21386
21387         * class.cs: Put Ravi's patch back in.  He is right, and we will
21388         have to cope with the
21389
21390 2001-09-14  Ravi Pratap  <ravi@ximian.com>
21391
21392         * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
21393         FamORAssem, not FamANDAssem.
21394
21395 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
21396
21397         * driver.cs: Added --parse option that only parses its input files
21398         and terminates.
21399
21400         * class.cs: Reverted last change from Ravi to IsTopLevel.  That is
21401         incorrect.  IsTopLevel is not used to tell whether an object is
21402         root_types or not (that can be achieved by testing this ==
21403         root_types).  But to see if this is a top-level *class* (not
21404         necessarly our "toplevel" container). 
21405
21406 2001-09-14  Ravi Pratap  <ravi@ximian.com>
21407
21408         * enum.cs (Enum::Define): Modify to call the Lookup method on the
21409         parent instead of a direct call to GetType.
21410
21411 2001-09-14  Ravi Pratap  <ravi@ximian.com>
21412
21413         * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
21414         Modifiers.TypeAttr. This should just be a call to that method.
21415
21416         * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
21417         object so that we can determine if we are top-level or not.
21418
21419         * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the 
21420         TypeContainer too.
21421
21422         * enum.cs (Enum::Define): Ditto.
21423
21424         * modifiers.cs (FieldAttr): Re-write.
21425
21426         * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
21427         (TypeContainer::HaveStaticConstructor): New property to provide access
21428         to precisely that info.
21429
21430         * modifiers.cs (MethodAttr): Re-write.
21431         (EventAttr): Remove altogether as there seems to be no ostensible use for it.
21432
21433         * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
21434         of top-level types as claimed.
21435
21436 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
21437
21438         * expression.cs (MemberLookup): Fruitless attempt to lookup
21439         constructors.  Maybe I need to emit default constructors?  That
21440         might be it (currently .NET emits this for me automatically).
21441         (Invocation::OverloadResolve): Cope with Arguments == null.
21442         (Invocation::EmitArguments): new function, shared by the new
21443         constructor and us.
21444         (Invocation::Emit): Handle static and instance methods.  Emit
21445         proper call instruction for virtual or non-virtual invocations.
21446         (New::Emit): Implement.
21447         (New::Resolve): Implement.
21448         (MemberAccess:Resolve): Implement.
21449         (MethodGroupExpr::InstanceExpression): used conforming to the spec
21450         to track instances.
21451         (FieldExpr::Resolve): Set type.
21452
21453         * support.cs: Handle empty arguments.
21454                 
21455         * cs-parser.jay (CompositeLookup, QualifierIdentifier,
21456         SimpleLookup): Auxiliary routines to help parse a qualifier
21457         identifier.  
21458
21459         Update qualifier_identifier rule.
21460
21461         * codegen.cs: Removed debugging messages.
21462
21463         * class.cs: Make this a global thing, this acts just as a "key" to
21464         objects that we might have around.
21465
21466         (Populate): Only initialize method_builders_to_methods once.
21467
21468         * expression.cs (PropertyExpr): Initialize type from the
21469         PropertyType. 
21470
21471         * codegen.cs (EmitContext::EmitBoolExpression): Use propper
21472         Resolve pattern.  Attempt to implicitly convert value to boolean.
21473         Emit code.
21474
21475         * expression.cs: Set the type for the int32/int32 argument case.
21476         (Binary::ResolveOperator): Set the return type to boolean for
21477         comparission operators
21478
21479         * typemanager.cs: Remove debugging print code.
21480
21481         (Invocation::Resolve): resolve type.
21482
21483         * class.cs: Allocate a MemberInfo of the correct size, as the code
21484         elsewhere depends on the test to reflect the correct contents.
21485
21486         (Method::) Keep track of parameters, due to System.Reflection holes
21487
21488         (TypeContainer::Populate): Keep track of MethodBuilders to Method
21489         mapping here.
21490
21491         (TypeContainer::FindMembers): Use ArrayList and then copy an array
21492         of the exact size and return that.
21493
21494         (Class::LookupMethodByBuilder): New function that maps
21495         MethodBuilders to its methods.  Required to locate the information
21496         on methods because System.Reflection bit us again.
21497
21498         * support.cs: New file, contains an interface ParameterData and
21499         two implementations: ReflectionParameters and InternalParameters
21500         used to access Parameter information.  We will need to grow this
21501         as required.
21502
21503         * expression.cs (Invocation::GetParameterData): implement a cache
21504         and a wrapper around the ParameterData creation for methods. 
21505         (Invocation::OverloadResolve): Use new code.
21506
21507 2001-09-13  Ravi Pratap  <ravi@ximian.com>
21508
21509         * class.cs (TypeContainer::EmitField): Remove and move into 
21510         (Field::Define): here and modify accordingly.
21511         (Field.FieldBuilder): New member.
21512         (TypeContainer::Populate): Update accordingly.
21513         (TypeContainer::FindMembers): Implement.
21514
21515 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
21516
21517         * statement.cs: (VariableInfo::VariableType): New field to be
21518         initialized with the full type once it is resolved. 
21519
21520 2001-09-12  Miguel de Icaza  <miguel@ximian.com>
21521
21522         * parameter.cs (GetParameterInfo): Use a type cache to compute
21523         things only once, and to reuse this information
21524
21525         * expression.cs (LocalVariableReference::Emit): Implement.
21526         (OpcodeCast::Emit): fix.
21527
21528         (ParameterReference::Resolve): Implement.
21529         (ParameterReference::Emit): Implement.
21530
21531         * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
21532         that are expressions need to stay as Expressions.
21533
21534         * typemanager.cs (CSharpName): Returns the C# name of a type if
21535         possible. 
21536
21537         * expression.cs (Expression::ConvertImplicit): New function that
21538         implements implicit type conversions.
21539
21540         (Expression::ImplicitReferenceConversion): Implements implicit
21541         reference conversions.
21542
21543         (EmptyCast): New type for transparent casts.
21544
21545         (OpcodeCast): New type for casts of types that are performed with
21546         a sequence of bytecodes.
21547
21548         (BoxedCast): New type used for casting value types into reference
21549         types.  Emits a box opcode.
21550
21551         (Binary::DoNumericPromotions): Implements numeric promotions of
21552         and computation of the Binary::Type.
21553
21554         (Binary::EmitBranchable): Optimization.
21555
21556         (Binary::Emit): Implement code emission for expressions.
21557
21558         * typemanager.cs (TypeManager): Added two new core types: sbyte
21559         and byte.
21560
21561 2001-09-12  Ravi Pratap  <ravi@ximian.com>
21562
21563         * class.cs (TypeContainer::FindMembers): Method which does exactly
21564         what Type.FindMembers does, only we don't have to use reflection. No
21565         implementation yet.
21566
21567         * typemanager.cs (typecontainers): New hashtable to hold the corresponding
21568         typecontainer objects as we need to get at them.
21569         (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
21570
21571         * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
21572         typecontainer object.
21573
21574         * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
21575         of just a Report object.
21576
21577 2001-09-11  Ravi Pratap  <ravi@ximian.com>
21578
21579         * class.cs (Event::Define): Go back to using the prefixes "add_" and
21580         "remove_"
21581         (TypeContainer::Populate): Now define the delegates of the type too.
21582         (TypeContainer.Delegates): Property to access the list of delegates defined
21583         in the type.
21584
21585         * delegates.cs (Delegate::Define): Implement partially.
21586
21587         * modifiers.cs (TypeAttr): Handle more flags.
21588
21589 2001-09-11  Ravi Pratap  <ravi@ximian.com>
21590
21591         * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
21592         and not <=
21593         (Operator::Define): Re-write logic to get types by using the LookupType method
21594         instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
21595         (Indexer::Define): Ditto.
21596         (Event::Define): Ditto.
21597         (Property::Define): Ditto.
21598
21599 2001-09-10  Ravi Pratap  <ravi@ximian.com>
21600
21601         * class.cs (TypeContainer::Populate): Now define operators too. 
21602         (TypeContainer.Operators): New property to access the list of operators
21603         in a type.
21604         (Operator.OperatorMethodBuilder): New member to hold the method builder
21605         for the operator we are defining.
21606         (Operator::Define): Implement.
21607
21608 2001-09-10  Ravi Pratap  <ravi@ximian.com>
21609
21610         * class.cs (Event::Define): Make the prefixes of the accessor methods
21611         addOn_ and removeOn_ 
21612
21613         * genericparser.cs (GenericParser::error): Overloaded method to handle the case
21614         of the location being passed in too. Ideally, this should go later since all
21615         error reporting should be done through the Report object.
21616
21617         * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
21618         (Populate): Iterate thru the indexers we have and define them too.
21619         (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
21620         for the get and set accessors.
21621         (Indexer::Define): Implement.
21622
21623 2001-09-09  Miguel de Icaza  <miguel@ximian.com>
21624
21625         * expression.cs (Binary::Resolve): Beginning of it.  I scratched
21626         my previous implementation, did not work.
21627
21628         * typemanager.cs: Add a couple of missing types (the longs).
21629
21630         * literal.cs: Use TypeManager.bool_type instead of getting it.
21631
21632         * expression.cs (EventExpr): New kind of expressions.
21633         (Expressio::ExprClassFromMemberInfo): finish
21634
21635 2001-09-08  Miguel de Icaza  <miguel@ximian.com>
21636
21637         * assign.cs: Emit stores to static fields differently.
21638
21639 2001-09-08  Ravi Pratap  <ravi@ximian.com>
21640
21641         * Merge in changes and adjust code to tackle conflicts. Backed out my
21642         code in Assign::Resolve ;-) 
21643
21644 2001-09-08  Ravi Pratap  <ravi@ximian.com>
21645
21646         * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
21647         instead Report.Error and also pass in the location.
21648         (CSharpParser::Lexer): New readonly property to return the reference
21649         to the Tokenizer object.
21650         (declare_local_variables): Use Report.Error with location instead of plain 
21651         old error.
21652         (CheckDef): Ditto.
21653
21654         * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
21655         (Operator.CheckBinaryOperator): Ditto.
21656
21657         * cs-parser.jay (operator_declarator): Update accordingly.
21658
21659         * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
21660         (CheckBinaryOperator): Same here.
21661
21662         * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
21663         on the name without any prefixes of namespace names etc. This is because we
21664         already might have something already fully qualified like 
21665         'System.Console.WriteLine'
21666
21667         * assign.cs (Resolve): Begin implementation. Stuck ;-)
21668
21669 2001-09-07  Ravi Pratap  <ravi@ximian.com>
21670
21671         * cs-tokenizer.cs (location): Return a string which also contains
21672         the file name.
21673
21674         * expression.cs (ElementAccess): New class for expressions of the
21675         type 'element access.'
21676         (BaseAccess): New class for expressions of the type 'base access.'
21677         (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
21678         respectively.
21679
21680         * cs-parser.jay (element_access): Implement action.
21681         (base_access): Implement actions.
21682         (checked_expression, unchecked_expression): Implement.
21683
21684         * cs-parser.jay (local_variable_type): Correct and implement.
21685         (type_suffixes, type_suffix_list, type_suffix): Implement actions.
21686
21687         * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
21688
21689         * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
21690         name and the specifiers.
21691
21692         * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
21693
21694         * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of 
21695         making them all public ;-)
21696
21697         * cs-parser.jay (error): Remove entirely as we have an implementation in the base
21698         class anyways.
21699
21700 2001-09-07  Miguel de Icaza  <miguel@ximian.com>
21701
21702         * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
21703         PropertyExprs.
21704         (FieldExpr, PropertyExprs): New resolved expressions.
21705         (SimpleName::MemberStaticCheck): Perform static checks for access
21706         to non-static fields on static methods. Maybe this should be
21707         generalized for MemberAccesses. 
21708         (SimpleName::ResolveSimpleName): More work on simple name
21709         resolution. 
21710
21711         * cs-parser.jay (primary_expression/qualified_identifier): track
21712         the parameter index.
21713
21714         * codegen.cs (CodeGen::Save): Catch save exception, report error.
21715         (EmitContext::EmitBoolExpression): Chain to expression generation
21716         instead of temporary hack.
21717         (::EmitStatementExpression): Put generic expression code generation.
21718
21719         * assign.cs (Assign::Emit): Implement variable assignments to
21720         local variables, parameters and fields.
21721
21722 2001-09-06  Miguel de Icaza  <miguel@ximian.com>
21723
21724         * statement.cs (Block::GetVariableInfo): New method, returns the
21725         VariableInfo for a variable name in a block.
21726         (Block::GetVariableType): Implement in terms of GetVariableInfo
21727
21728         * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
21729         DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
21730
21731 2001-09-06  Ravi Pratap  <ravi@ximian.com>
21732
21733         * cs-parser.jay (operator_declaration): Continue on my quest : update
21734         to take attributes argument.
21735         (event_declaration): Ditto.
21736         (enum_declaration): Ditto.
21737         (indexer_declaration): Ditto.
21738
21739         * class.cs (Operator::Operator): Update constructor accordingly.
21740         (Event::Event): Ditto.
21741
21742         * delegate.cs (Delegate::Delegate): Same here.
21743
21744         * enum.cs (Enum::Enum): Same here.
21745
21746 2001-09-05  Ravi Pratap  <ravi@ximian.com>
21747
21748         * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
21749
21750         * ../tests/cs0658.cs : New file to demonstrate error 0658.
21751
21752         * attribute.cs (Attributes): New class to encapsulate all attributes which were
21753         being passed around as an arraylist.
21754         (Attributes::AddAttribute): Method to add attribute sections.
21755
21756         * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
21757         (struct_declaration): Update accordingly.
21758         (constant_declaration): Update.
21759         (field_declaration): Update.
21760         (method_header): Update.
21761         (fixed_parameter): Update.
21762         (parameter_array): Ditto.
21763         (property_declaration): Ditto.
21764         (destructor_declaration): Ditto.
21765
21766         * class.cs (Struct::Struct): Update constructors accordingly.
21767         (Class::Class): Ditto.
21768         (Field::Field): Ditto.
21769         (Method::Method): Ditto.
21770         (Property::Property): Ditto.
21771         (TypeContainer::OptAttribute): update property's return type.
21772
21773         * interface.cs (Interface.opt_attributes): New member.
21774         (Interface::Interface): Update to take the extra Attributes argument.
21775
21776         * parameter.cs (Parameter::Parameter): Ditto.
21777
21778         * constant.cs (Constant::Constant): Ditto.
21779
21780         * interface.cs (InterfaceMemberBase): New OptAttributes field.
21781         (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take 
21782         the attributes as a parameter.
21783         (InterfaceProperty): Update constructor call.
21784         (InterfaceEvent): Ditto.
21785         (InterfaceMethod): Ditto.
21786         (InterfaceIndexer): Ditto.
21787
21788         * cs-parser.jay (interface_indexer_declaration): Update call to constructor to 
21789         pass the attributes too.
21790         (interface_event_declaration): Ditto.
21791         (interface_property_declaration): Ditto.
21792         (interface_method_declaration): Ditto.
21793         (interface_declaration): Ditto.
21794
21795 2001-09-05  Miguel de Icaza  <miguel@ximian.com>
21796
21797         * class.cs (Method::Define): Track the "static Main" definition to
21798         create an entry point. 
21799
21800         * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
21801         EntryPoint if we find it. 
21802
21803         * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
21804         (EmitContext::ig): Make this variable public.
21805
21806         * driver.cs: Make the default output file be the first file name
21807         with the .exe extension.  
21808
21809         Detect empty compilations
21810
21811         Handle various kinds of output targets.  Handle --target and
21812         rename -t to --dumper.
21813
21814         * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
21815         methods inherited from Expression return now an Expression.  This
21816         will is used during the tree rewriting as we resolve them during
21817         semantic analysis.
21818
21819         (Expression::MemberLookup): Implements the MemberLookup (7.3) from
21820         the spec.  Missing entirely is the information about
21821         accessability of elements of it.
21822
21823         (Expression::ExprClassFromMemberInfo): New constructor for
21824         Expressions that creates a fully initialized Expression based on
21825         a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
21826         a Type.
21827
21828         (Invocation::Resolve): Begin implementing resolution of invocations.
21829
21830         * literal.cs (StringLiteral):  Implement Emit.
21831
21832 2001-09-05  Ravi Pratap  <ravi@ximian.com>
21833
21834         * cs-parser.jay (error): Add new modifier because we are hiding an inherited
21835         member.
21836
21837 2001-09-04  Ravi Pratap  <ravi@ximian.com>
21838
21839         * cs-parser.jay (attribute_arguments): Implement actions.
21840         (attribute): Fix bug in production. Implement action.
21841         (attribute_list): Implement.
21842         (attribute_target): Implement.
21843         (attribute_target_specifier, opt_target_specifier): Implement
21844         (CheckAttributeTarget): New method to check if the attribute target
21845         is valid.
21846         (attribute_section): Implement.
21847         (opt_attributes): Implement.
21848
21849         * attribute.cs : New file to handle attributes.
21850         (Attribute): Class to hold attribute info.
21851
21852         * cs-parser.jay (opt_attribute_target_specifier): Remove production
21853         (attribute_section): Modify production to use 2 different rules to 
21854         achieve the same thing. 1 s/r conflict down !
21855         Clean out commented, useless, non-reducing dimension_separator rules.
21856
21857         * class.cs (TypeContainer.attributes): New member to hold list
21858         of attributes for a type.
21859         (Struct::Struct): Modify to take one more argument, the attribute list.
21860         (Class::Class): Ditto.
21861         (Field::Field): Ditto.
21862         (Method::Method): Ditto.
21863         (Property::Property): Ditto.
21864
21865         * cs-parser.jay (struct_declaration): Update constructor call to
21866         pass in the attributes too.
21867         (class_declaration): Ditto.
21868         (constant_declaration): Ditto.
21869         (field_declaration): Ditto.
21870         (method_header): Ditto.
21871         (fixed_parameter): Ditto.
21872         (parameter_array): Ditto.
21873         (property_declaration): Ditto.
21874
21875         * constant.cs (Constant::Constant): Update constructor similarly.
21876         Use System.Collections.
21877
21878         * parameter.cs (Parameter::Parameter): Update as above.
21879
21880 2001-09-02  Ravi Pratap  <ravi@ximian.com>
21881
21882         * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
21883         (TypeContainer.delegates): New member to hold list of delegates.
21884
21885         * cs-parser.jay (delegate_declaration): Implement the action correctly 
21886         this time as I seem to be on crack ;-)
21887
21888 2001-09-02  Miguel de Icaza  <miguel@ximian.com>
21889
21890         * rootcontext.cs (RootContext::IsNamespace): new function, used to
21891         tell whether an identifier represents a namespace.
21892
21893         * expression.cs (NamespaceExpr): A namespace expression, used only
21894         temporarly during expression resolution.
21895         (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
21896         utility functions to resolve names on expressions.
21897
21898 2001-09-01  Miguel de Icaza  <miguel@ximian.com>
21899
21900         * codegen.cs: Add hook for StatementExpressions. 
21901
21902         * class.cs: Fix inverted test for static flag in methods.
21903
21904 2001-09-02  Ravi Pratap  <ravi@ximian.com>
21905
21906         * class.cs (Operator::CheckUnaryOperator): Correct error number used
21907         to make it coincide with MS' number.
21908         (Operator::CheckBinaryOperator): Ditto.
21909
21910         * ../errors/errors.txt : Remove error numbers added earlier.
21911
21912         * ../errors/cs1019.cs : Test case for error # 1019
21913
21914         * ../errros/cs1020.cs : Test case for error # 1020
21915
21916         * cs-parser.jay : Clean out commented cruft.
21917         (dimension_separators, dimension_separator): Comment out. Ostensibly not
21918         used anywhere - non-reducing rule.
21919         (namespace_declarations): Non-reducing rule - comment out.
21920
21921         * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
21922         with TypeContainer::AddEnum.
21923
21924         * delegate.cs : New file for delegate handling classes.
21925         (Delegate): Class for declaring delegates.
21926
21927         * makefile : Update.
21928
21929         * cs-parser.jay (delegate_declaration): Implement.
21930
21931 2001-09-01  Ravi Pratap  <ravi@che.iitm.ac.in>
21932
21933         * class.cs (Event::Define): Implement.
21934         (Event.EventBuilder): New member.
21935
21936         * class.cs (TypeContainer::Populate): Update to define all enums and events
21937         we have.
21938         (Events): New property for the events arraylist we hold. Shouldn't we move to using
21939         readonly fields for all these cases ?
21940
21941 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
21942
21943         * class.cs (Property): Revamp to use the convention of making fields readonly.
21944         Accordingly modify code elsewhere.
21945
21946         * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
21947         the Define method of the Property class.
21948
21949         * class.cs : Clean up applied patch and update references to variables etc. Fix 
21950         trivial bug.
21951         (TypeContainer::Populate): Update to define all the properties we have. Also
21952         define all enumerations.
21953
21954         * enum.cs (Define): Implement.
21955
21956 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
21957
21958         * cs-parser.jay (overloadable_operator): The semantic value is an
21959         enum of the Operator class.
21960         (operator_declarator): Implement actions.
21961         (operator_declaration): Implement.
21962
21963         * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
21964         validity of definitions.
21965         (Operator::CheckBinaryOperator): Static method to check for binary operators
21966         (TypeContainer::AddOperator): New method to add an operator to a type.
21967
21968         * cs-parser.jay (indexer_declaration): Added line to actually call the
21969         AddIndexer method so it gets added ;-)
21970
21971         * ../errors/errors.txt : Update to include new error numbers. Are these numbers 
21972         already taken care of by the MS compiler ?  
21973
21974 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
21975
21976         * class.cs (Operator): New class for operator declarations.
21977         (Operator::OpType): Enum for the various operators.
21978
21979 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
21980
21981         * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
21982         ostensibly handle this in semantic analysis.
21983
21984         * cs-parser.jay (general_catch_clause): Comment out
21985         (specific_catch_clauses, specific_catch_clause): Ditto.
21986         (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
21987         (catch_args, opt_catch_args): New productions.
21988         (catch_clause): Rewrite to use the new productions above
21989         (catch_clauses): Modify accordingly.
21990         (opt_catch_clauses): New production to use in try_statement
21991         (try_statement): Revamp. Basically, we get rid of one unnecessary rule
21992         and re-write the code in the actions to extract the specific and
21993         general catch clauses by being a little smart ;-)
21994
21995         * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
21996         Hooray, try and catch statements parse fine !
21997
21998 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
21999
22000         * statement.cs (Block::GetVariableType): Fix logic to extract the type
22001         string from the hashtable of variables.
22002
22003         * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
22004         I end up making that mistake ;-)
22005         (catch_clauses): Fixed gross error which made Key and Value of the 
22006         DictionaryEntry the same : $1 !!
22007
22008 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
22009
22010         * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
22011
22012         * cs-parser.jay (event_declaration): Correct to remove the semicolon
22013         when the add and remove accessors are specified. 
22014
22015 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
22016
22017         * cs-parser.jay (IndexerDeclaration): New helper class to hold
22018         information about indexer_declarator.
22019         (indexer_declarator): Implement actions.
22020         (parsing_indexer): New local boolean used to keep track of whether
22021         we are parsing indexers or properties. This is necessary because 
22022         implicit_parameters come into picture even for the get accessor in the 
22023         case of an indexer.
22024         (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
22025
22026         * class.cs (Indexer): New class for indexer declarations.
22027         (TypeContainer::AddIndexer): New method to add an indexer to a type.
22028         (TypeContainer::indexers): New member to hold list of indexers for the
22029         type.
22030
22031 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
22032
22033         * cs-parser.jay (add_accessor_declaration): Implement action.
22034         (remove_accessor_declaration): Implement action.
22035         (event_accessors_declaration): Implement
22036         (variable_declarators): swap statements for first rule - trivial.
22037
22038         * class.cs (Event): New class to hold information about event
22039         declarations.
22040         (TypeContainer::AddEvent): New method to add an event to a type
22041         (TypeContainer::events): New member to hold list of events.
22042
22043         * cs-parser.jay (event_declaration): Implement actions.
22044
22045 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
22046
22047         * cs-parser.jay (dim_separators): Implement. Make it a string
22048         concatenating all the commas together, just as they appear.
22049         (opt_dim_separators): Modify accordingly
22050         (rank_specifiers): Update accordingly. Basically do the same
22051         thing - instead, collect the brackets here.
22052         (opt_rank_sepcifiers): Modify accordingly.
22053         (array_type): Modify to actually return the complete type string
22054         instead of ignoring the rank_specifiers.
22055         (expression_list): Implement to collect the expressions
22056         (variable_initializer): Implement. We make it a list of expressions
22057         essentially so that we can handle the array_initializer case neatly too.
22058         (variable_initializer_list): Implement.
22059         (array_initializer): Make it a list of variable_initializers
22060         (opt_array_initializer): Modify accordingly.
22061
22062         * expression.cs (New::NType): Add enumeration to help us
22063         keep track of whether we have an object/delegate creation
22064         or an array creation.
22065         (New:NewType, New::Rank, New::Indices, New::Initializers): New
22066         members to hold data about array creation.
22067         (New:New): Modify to update NewType
22068         (New:New): New Overloaded contructor for the array creation
22069         case.
22070
22071         * cs-parser.jay (array_creation_expression): Implement to call
22072         the overloaded New constructor.
22073
22074 2001-08-26  Ravi Pratap  <ravi@che.iitm.ac.in>
22075
22076         * class.cs (TypeContainer::Constructors): Return member
22077         constructors instead of returning null.
22078
22079 2001-08-26  Miguel de Icaza  <miguel@ximian.com>
22080
22081         * typemanager.cs (InitCoreTypes): Initialize the various core
22082         types after we have populated the type manager with the user
22083         defined types (this distinction will be important later while
22084         compiling corlib.dll)
22085
22086         * expression.cs, literal.cs, assign.cs, constant.cs: Started work
22087         on Expression Classification.  Now all expressions have a method
22088         `Resolve' and a method `Emit'.
22089
22090         * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
22091         generation from working.     Also add some temporary debugging
22092         code. 
22093
22094 2001-08-24  Miguel de Icaza  <miguel@ximian.com>
22095
22096         * codegen.cs: Lots of code generation pieces.  This is only the
22097         beginning, will continue tomorrow with more touches of polish.  We
22098         handle the fundamentals of if, while, do, for, return.  Others are
22099         trickier and I need to start working on invocations soon.
22100
22101         * gen-treedump.cs: Bug fix, use s.Increment here instead of
22102         s.InitStatement. 
22103
22104         * codegen.cs (EmitContext): New struct, used during code
22105         emission to keep a context.   Most of the code generation will be
22106         here. 
22107
22108         * cs-parser.jay: Add embedded blocks to the list of statements of
22109         this block.  So code generation proceeds in a top down fashion.
22110
22111 2001-08-23  Miguel de Icaza  <miguel@ximian.com>
22112
22113         * statement.cs: Add support for multiple child blocks.
22114
22115 2001-08-22  Miguel de Icaza  <miguel@ximian.com>
22116
22117         * codegen.cs (EmitCode): New function, will emit the code for a
22118         Block of code given a TypeContainer and its ILGenerator. 
22119
22120         * statement.cs (Block): Standard public readonly optimization.
22121         (Block::Block constructors): Link children. 
22122         (Block::Child): Child Linker.
22123         (Block::EmitVariables): Emits IL variable declarations.
22124
22125         * class.cs: Drop support for MethodGroups here, delay until
22126         Semantic Analysis.
22127         (Method::): Applied the same simplification that I did before, and
22128         move from Properties to public readonly fields.
22129         (Method::ParameterTypes): Returns the parameter types for the
22130         function, and implements a cache that will be useful later when I
22131         do error checking and the semantic analysis on the methods is
22132         performed.
22133         (Constructor::GetCallingConvention): Renamed from CallingConvetion
22134         and made a method, optional argument tells whether this is a class
22135         or a structure to apply the `has-this' bit.
22136         (Method::GetCallingConvention): Implement, returns the calling
22137         convention. 
22138         (Method::Define): Defines the type, a second pass is performed
22139         later to populate the methods.
22140
22141         (Constructor::ParameterTypes): implement a cache similar to the
22142         one on Method::ParameterTypes, useful later when we do semantic
22143         analysis. 
22144
22145         (TypeContainer::EmitMethod):  New method.  Emits methods.
22146
22147         * expression.cs: Removed MethodGroup class from here.
22148
22149         * parameter.cs (Parameters::GetCallingConvention): new method.
22150
22151 2001-08-21  Miguel de Icaza  <miguel@ximian.com>
22152
22153         * class.cs (TypeContainer::Populate): Drop RootContext from the
22154         argument. 
22155
22156         (Constructor::CallingConvention): Returns the calling convention.
22157         (Constructor::ParameterTypes): Returns the constructor parameter
22158         types. 
22159
22160         (TypeContainer::AddConstructor): Keep track of default constructor
22161         and the default static constructor.
22162
22163         (Constructor::) Another class that starts using `public readonly'
22164         instead of properties. 
22165
22166         (Constructor::IsDefault): Whether this is a default constructor. 
22167
22168         (Field::) use readonly public fields instead of properties also.
22169
22170         (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
22171         track of static constructors;  If none is used, turn on
22172         BeforeFieldInit in the TypeAttributes. 
22173
22174         * cs-parser.jay (opt_argument_list): now the return can be null
22175         for the cases where there are no arguments. 
22176
22177         (constructor_declarator): If there is no implicit `base' or
22178         `this', then invoke the default parent constructor. 
22179
22180         * modifiers.cs (MethodAttr): New static function maps a set of
22181         modifiers flags into a MethodAttributes enum
22182         (FieldAttr): renamed from `Map'.  So now we have FieldAttr,
22183         MethodAttr, TypeAttr to represent the various mappings where the
22184         modifiers are used.
22185         (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'  
22186
22187 2001-08-19  Miguel de Icaza  <miguel@ximian.com>
22188
22189         * parameter.cs (GetParameterInfo): Fix bug where there would be no
22190         method arguments.
22191
22192         * interface.cs (PopulateIndexer): Implemented the code generator
22193         for interface indexers.
22194
22195 2001-08-17  Miguel de Icaza  <miguel@ximian.com>
22196
22197         * interface.cs (InterfaceMemberBase): Now we track the new status
22198         here.  
22199
22200         (PopulateProperty): Implement property population.  Woohoo!  Got
22201         Methods and Properties going today. 
22202
22203         Removed all the properties for interfaces, and replaced them with
22204         `public readonly' fields. 
22205
22206 2001-08-16  Miguel de Icaza  <miguel@ximian.com>
22207
22208         * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
22209         initialize their hashtables/arraylists only when they are needed
22210         instead of doing this always.
22211
22212         * parameter.cs: Handle refs and out parameters.
22213
22214         * cs-parser.jay: Use an ArrayList to construct the arguments
22215         instead of the ParameterCollection, and then cast that to a
22216         Parameter[] array.
22217
22218         * parameter.cs: Drop the use of ParameterCollection and use
22219         instead arrays of Parameters.
22220
22221         (GetParameterInfo): Use the Type, not the Name when resolving
22222         types. 
22223
22224 2001-08-13  Miguel de Icaza  <miguel@ximian.com>
22225
22226         * parameter.cs: Eliminate the properties Name, Type and ModFlags,
22227         and instead use public readonly fields.
22228
22229         * class.cs: Put back walking code for type containers.
22230
22231 2001-08-11  Miguel de Icaza  <miguel@ximian.com>
22232
22233         * class.cs (MakeConstant): Code to define constants.
22234
22235         * rootcontext.cs (LookupType): New function.  Used to locate types 
22236
22237
22238 2001-08-08  Miguel de Icaza  <miguel@ximian.com>
22239
22240         * rootcontext.cs: OH MY!  My trick works!   It is amazing how nice
22241         this System.Reflection code is.  Kudos to Microsoft
22242
22243         * typemanager.cs: Implement a type cache and avoid loading all
22244         types at boot time.  Wrap in LookupType the internals.  This made
22245         the compiler so much faster.  Wow.  I rule!
22246
22247         * driver.cs: Make sure we always load mscorlib first (for
22248         debugging purposes, nothing really important).
22249
22250         * Renamespaced things that were on `CSC' to `CIR'.  Maybe I should
22251         have moved to `CSC' rather than `CIR'.  Oh man!  The confussion!  
22252
22253         * rootcontext.cs: Lookup types on their namespace;  Lookup types
22254         on namespaces that have been imported using the `using' keyword.
22255
22256         * class.cs (TypeContainer::TypeAttr): Virtualize.
22257         (Class::TypeAttr): Return attributes suitable for this bad boy.
22258         (Struct::TypeAttr): ditto.
22259         Handle nested classes.
22260         (TypeContainer::) Remove all the type visiting code, it is now
22261         replaced with the rootcontext.cs code
22262
22263         * rootcontext.cs (GetClassBases): Added support for structs. 
22264
22265 2001-08-06  Miguel de Icaza  <miguel@ximian.com>
22266
22267         * interface.cs, statement.cs, class.cs, parameter.cs,
22268         rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
22269         Drop use of TypeRefs, and use strings instead.
22270
22271 2001-08-04  Miguel de Icaza  <miguel@ximian.com>
22272
22273         * rootcontext.cs: 
22274
22275         * class.cs (Struct::Struct): set the SEALED flags after
22276         checking the modifiers.
22277         (TypeContainer::TypeAttr): new property, returns the
22278         TypeAttributes for a class.  
22279
22280         * cs-parser.jay (type_list): Oops, list production was creating a
22281         new list of base types.
22282
22283         * rootcontext.cs (StdLib): New property.
22284         (GetInterfaceTypeByName): returns an interface by type name, and
22285         encapsulates error handling here.
22286         (GetInterfaces): simplified.
22287         (ResolveTree): Encapsulated all the tree resolution here.
22288         (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
22289         types. 
22290
22291         * driver.cs: Add support for --nostdlib, to avoid loading the
22292         default assemblies.
22293         (Main): Do not put tree resolution here. 
22294
22295         * rootcontext.cs: Beginning of the class resolution.
22296
22297 2001-08-03  Miguel de Icaza  <miguel@ximian.com>
22298
22299         * rootcontext.cs: Provide better error reporting. 
22300
22301         * cs-parser.jay (interface_base): set our $$ to be interfaces.
22302
22303         * rootcontext.cs (CreateInterface): Handle the case where there
22304         are no parent interfaces.
22305
22306         (CloseTypes): Routine to flush types at the end.
22307         (CreateInterface): Track types.
22308         (GetInterfaces): Returns an array of Types from the list of
22309         defined interfaces.
22310
22311         * typemanager.c (AddUserType): Mechanism to track user types (puts
22312         the type on the global type hash, and allows us to close it at the
22313         end). 
22314
22315 2001-08-02  Miguel de Icaza  <miguel@ximian.com>
22316
22317         * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
22318         RecordInterface instead.
22319
22320         * cs-parser.jay: Updated to reflect changes above.
22321
22322         * decl.cs (Definition): Keep track of the TypeBuilder type that
22323         represents this type here.  Not sure we will use it in the long
22324         run, but wont hurt for now.
22325
22326         * driver.cs: Smaller changes to accomodate the new code.
22327
22328         Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
22329         when done. 
22330
22331         * rootcontext.cs (CreateInterface):  New method, used to create
22332         the System.TypeBuilder type for interfaces.
22333         (ResolveInterfaces): new entry point to resolve the interface
22334         hierarchy. 
22335         (CodeGen): Property, used to keep track of the code generator.
22336
22337 2001-07-26  Miguel de Icaza  <miguel@ximian.com>
22338
22339         * cs-parser.jay: Add a second production for delegate_declaration
22340         with `VOID'.
22341
22342         (enum_body): Put an opt_comma here instead of putting it on
22343         enum_body or enum_member_declarations so we can handle trailing
22344         commas on enumeration members.  Gets rid of a shift/reduce.
22345
22346         (type_list): Need a COMMA in the middle.
22347
22348         (indexer_declaration): Tell tokenizer to recognize get/set
22349
22350         * Remove old targets.
22351
22352         * Re-add the parser target.
22353
22354 2001-07-13  Simon Cozens <simon@simon-cozens.org>
22355
22356         * cs-parser.jay: Add precendence rules for a number of operators
22357         ot reduce the number of shift/reduce conflicts in the grammar.
22358
22359 2001-07-17  Miguel de Icaza  <miguel@ximian.com>
22360
22361         * tree.cs: moved IGenerator interface and renamed it to ITreeDump
22362         and put it here.
22363
22364         Get rid of old crufty code.
22365
22366         * rootcontext.cs: Use this to keep track of the parsed
22367         representation and the defined types available to the program. 
22368
22369         * gen-treedump.cs: adjust for new convention.
22370
22371         * type.cs: Split out the type manager, and the assembly builder
22372         from here. 
22373
22374         * typemanager.cs: the type manager will live here now.
22375
22376         * cil-codegen.cs: And the code generator here. 
22377
22378 2001-07-14  Sean MacIsaac  <macisaac@ximian.com>
22379
22380         * makefile: Fixed up for easy making.
22381
22382 2001-07-13  Simon Cozens <simon@simon-cozens.org>
22383
22384         * cs-parser.jay (rank_specifier): Remove a conflict by reordering
22385         the 
22386
22387         (unary_expression): Expand pre_increment_expression and
22388         post_decrement_expression to reduce a shift/reduce.
22389
22390 2001-07-11  Simon Cozens
22391
22392         * cs-tokenizer.cs: Hex numbers should begin with a 0.
22393
22394         Improve allow_keyword_as_indent name.
22395
22396 2001-06-19  Miguel de Icaza  <miguel@ximian.com>
22397
22398         * Adjustments for Beta2. 
22399
22400 2001-06-13  Miguel de Icaza  <miguel@ximian.com>
22401
22402         * decl.cs: Added `Define' abstract method.
22403         (InTransit): new property, used to catch recursive definitions. 
22404
22405         * interface.cs: Implement `Define'. 
22406
22407         * modifiers.cs: Map Modifiers.constants to
22408         System.Reflection.TypeAttribute flags.
22409
22410         * class.cs: Keep track of types and user-defined types.
22411         (BuilderInit): New method for creating an assembly
22412         (ResolveType): New function to launch the resolution process, only
22413         used by interfaces for now.
22414
22415         * cs-parser.jay: Keep track of Classes, Structs and Interfaces
22416         that are inserted into the name space. 
22417
22418 2001-06-08  Miguel de Icaza  <miguel@ximian.com>
22419
22420         * ARGH.  I have screwed up my tree so many times due to the use of
22421         rsync rather than using CVS.  Going to fix this at once. 
22422
22423         * driver.cs: Objetify driver.  Load assemblies, use assemblies to
22424         load types.
22425
22426 2001-06-07  Miguel de Icaza  <miguel@ximian.com>
22427
22428         * Experiment successful: Use System.Type rather that our own
22429         version of Type.  
22430
22431 2001-05-25  Miguel de Icaza  <miguel@ximian.com>
22432
22433         * cs-parser.jay: Removed nsAliases from here.
22434
22435         Use new namespaces, handle `using XXX;' 
22436
22437         * namespace.cs: Reimplemented namespace handling, use a recursive
22438         definition of the class.  Now we can keep track of using clauses
22439         and catch invalid using clauses.
22440
22441 2001-05-24  Miguel de Icaza  <miguel@ximian.com>
22442
22443         * gen-treedump.cs: Adapted for all the renaming.
22444
22445         * expression.cs (Expression): this class now has a Type property
22446         which returns an expression Type.
22447
22448         (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
22449         `Type', as this has a different meaning now in the base
22450
22451 2001-05-22  Miguel de Icaza  <miguel@ximian.com>
22452
22453         * interface.cs, class.cs: Removed from all the sources the
22454         references to signature computation, as we can not do method
22455         signature computation during the parsing time, as we are not
22456         trying to solve at that point distinguishing:
22457
22458         class X {
22459                 void a (Blah x) {}
22460                 void a (NS.Blah x) {}
22461         }
22462
22463         Which depending on the context might be valid or not, as we do not
22464         know if Blah is the same thing as NS.Blah at that point.
22465
22466         * Redid everything so the code uses TypeRefs now instead of
22467         Types.  TypeRefs are just temporary type placeholders, that need
22468         to be resolved.  They initially have a pointer to a string and the
22469         current scope in which they are used.  This is used later by the
22470         compiler to resolve the reference to an actual Type. 
22471
22472         * DeclSpace is no longer a CIR.Type, and neither are
22473         TypeContainers (Class and Struct) nor Interfaces nor Enums.  They
22474         are all DeclSpaces, but no Types. 
22475
22476         * type.cs (TypeRefManager): This implements the TypeRef manager,
22477         which keeps track of all the types that need to be resolved after
22478         the parsing has finished. 
22479
22480 2001-05-13  Miguel de Icaza  <miguel@ximian.com>
22481
22482         * ARGH.  We are going to have to store `foreach' as a class rather
22483         than resolving it, as we need to verify error 1579 after name
22484         resolution.   *OR* we could keep a flag that says `This request to
22485         IEnumerator comes from a foreach statement' which we can then use
22486         to generate the error.
22487
22488 2001-05-10  Miguel de Icaza  <miguel@ximian.com>
22489
22490         * class.cs (TypeContainer.AddMethod): we now add methods to the
22491         MethodGroup instead of the method hashtable.  
22492
22493         * expression.cs: Add MethodGroup abstraction, which gets us one
22494         step closer to the specification in the way we handle method
22495         declarations.  
22496
22497         * cs-parser.jay (primary_expression): qualified_identifier now
22498         tried to match up an identifier to a local variable reference or
22499         to a parameter reference.
22500
22501         current_local_parameters is now a parser global variable that
22502         points to the current parameters for the block, used during name
22503         lookup.
22504
22505         (property_declaration): Now creates an implicit `value' argument to
22506         the set accessor.
22507
22508 2001-05-09  Miguel de Icaza  <miguel@ximian.com>
22509
22510         * parameter.cs: Do not use `param' arguments as part of the
22511         signature, per the spec.
22512
22513 2001-05-08  Miguel de Icaza  <miguel@ximian.com>
22514
22515         * decl.cs: Base class for classes, structs and interfaces.  This
22516         is the "Declaration Space" 
22517
22518         * cs-parser.jay: Use CheckDef for checking declaration errors
22519         instead of having one on each function.
22520
22521         * class.cs: Factor out some code for handling error handling in
22522         accordance to the "Declarations" section in the "Basic Concepts"
22523         chapter in the ECMA C# spec.
22524
22525         * interface.cs: Make all interface member classes derive from
22526         InterfaceMemberBase.
22527
22528 2001-05-07  Miguel de Icaza  <miguel@ximian.com>
22529
22530         * Many things: all interfaces are parsed and generated in
22531         gen-treedump.  Support for member variables, constructors,
22532         destructors, properties, constants is there.
22533
22534         Beginning of the IL backend, but very little done, just there for
22535         testing purposes. 
22536
22537 2001-04-29  Miguel de Icaza  <miguel@ximian.com>
22538
22539         * cs-parser.jay: Fix labeled statement.
22540
22541         * cs-tokenizer.cs (escape): Escape " and ' always.
22542         ref_line, ref_name: keep track of the line/filename as instructed
22543         by #line by the compiler.
22544         Parse #line.
22545
22546 2001-04-27  Miguel de Icaza  <miguel@ximian.com>
22547
22548         * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
22549         to match the values in System.CodeDOM.
22550
22551         Divid renamed to Divide.
22552
22553         * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
22554         statements. 
22555         (Statements.set): remove.
22556
22557         * System.CodeDOM/CodeCatchClause.cs: always have a valid
22558         statements. 
22559
22560         * System.CodeDOM/CodeIfStatement.cs: trueStatements and
22561         falseStatements always have valid values. 
22562
22563         * cs-parser.jay: Use System.CodeDOM now.
22564