2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
[mono.git] / mcs / gmcs / ChangeLog
1 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
2
3         * driver.cs, support.cs : merged r48826.
4           Marek Safer wrote:
5           > could you integrate your mcs changes to gmcs otherwise
6           > gmcs cannot compile some files.
7
8 2005-08-20  Martin Baulig  <martin@ximian.com>
9
10         * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
11         scope if we don't already have it.
12
13         * expression.cs (Invocation.EmitCall): Use `ec.EmitThis ()' rather
14         than `ig.Emit (OpCodes.Ldarg_0)' to make it work inside iterators;
15         fixes #75867.
16
17 2005-07-31  Miguel de Icaza  <miguel@novell.com>
18
19         * statement.cs: Copy the local exception into the exception
20         captured local.  Fixes 75674
21
22 2005-07-15  Marek Safar  <marek.safar@seznam.cz>
23
24         * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
25         type as namespace.
26
27 2005-08-12  Martin Baulig  <martin@ximian.com>
28
29         * expression.cs (MemberAccess.ResolveNamespaceOrType): Only search
30         for nested types here to avoid hitting the cache too early.
31
32 2005-08-09  Miguel de Icaza  <miguel@novell.com>
33
34         * enum.cs: On the new compiler CLS error 3005 is now a warning not
35         an error. 
36
37 2005-08-03  Martin Baulig  <martin@ximian.com>
38
39         Make iterators in generic methods work; see gtest-191.cs.
40
41         * generic.cs
42         (Constraints.Resolve): Protect against being called twice.
43
44         * class.cs
45         (TypeContainer.GetClassBases): Make this `protected virtual'.
46
47         * iterator.cs (Iterator.ctor): Added `GenericMethod' argument.
48         (Iterator.GetClassBases): Override this and compute the base
49         classes here.
50         (Iterator.DefineNestedTypes): If we're a generic method, all our
51         method type parameters become class type parameters on the proxy
52         class.
53
54         * statement.cs
55         (ToplevelBlock.Parameters): Make this a property, not a field.
56         (ToplevelBlock.ResolveMeta): Update the `parameters' from the `ip'.
57
58 2005-08-03  Martin Baulig  <martin@ximian.com>
59
60         * typemanager.cs (TypeManager.IsSubclassOf): Use
61         `TypeManager.IsEqual' instead of `Type.Equals'; fixes gtest-190.cs.
62         (TypeManager.GetFullName_recursed): Improved.
63
64 2005-07-27  Carlos Alberto Cortez <calberto.cortez@gmail.com>
65
66         Fix #75417
67         * ecore.cs (Expression.IsAccessorAccessible): Change the check for
68         Private accessor case, using TypeManager.IsPrivateAccessible instead of
69         invocation_type == mi.DeclaringType, since the first one also checks
70         other condition used by generic instances.
71         
72 2005-07-27  Martin Baulig  <martin@ximian.com>
73
74         * anonymous.cs (CaptureContext.AddField): Added
75         `AnonymousContainer am' argument; compute its toplevel scope if
76         it's not already computed.  Fixes #75649.
77
78 2005-07-14  Marek Safar  <marek.safar@seznam.cz>
79
80         * attribute.cs (Attribute.ResolveAttributeType): Renamed from
81         CheckAttributeType and refactored.
82         (Attribute.ResolvePossibleAttributeType): Changed to reuse
83         ResolveAsTypeTerminal error handling.
84         (ResolveAsTypeTerminal): Introduced because of global attributes extra
85         handling.
86         (GetSignatureForError): Print errors in same way.
87
88         * class.cs,
89         * codegen.cs: Reflect attribute GetSignatureForError change.
90
91         * ecore.cs,
92         * expression.cs: Add silent parameter to ResolveAsTypeStep.
93
94         * namespace.cs (UsingEntry): Refactored to make fields private.
95
96         * assign.cs,
97         statement.cs: Error_UnexpectedKind has extra parameter.
98
99 2005-07-14  Raja R Harinath  <rharinath@novell.com>
100
101         * ecore.cs (IAlias): Remove.
102         * decl.cs (DeclSpace): Don't derive from IAlias.  Remove members
103         that implement the interface.
104         * namespace.cs (Namespace): Likewise.
105         (Namespace.declspaces): Renamed from 'defined_names'.
106         (Namespace.AddDeclSpace): Renamed from 'DefineName'.  Take a
107         DeclSpace instead of an IAlias.
108         * tree.cs (Tree.AddDecl): Update.
109
110 2005-07-12  Raja R Harinath  <rharinath@novell.com>
111
112         * statement.cs (Block.Flags); Remove HasVarargs.
113         (Block.HasVarargs): Move to ToplevelBlock.
114         (Block.ThisVariable, Block.AddThisVariable): Likewise.
115         (Block.Variables): Make protected.  Initialize variable hashtable
116         if necessary.
117         (Block.AddVariable): Update.
118         (Block.Resolve): Update to changes.
119         (ToplevelBlock.HasVarargs): New boolean.
120         (ToplevelBlock.ThisVariable): Move here from Block.
121         (ToplevelBlock.AddThisVariable): Likewise.
122         (ToplevelBlock.IsThisAssigned): New.  Forwards call to this_variable.
123         * expression.cs (This.ResolveBase): Update to changes.
124         (ArglistAccess.DoResolve): Likewise.
125
126 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
127
128         Fix #75321
129         * ecore.cs, class.cs: Use SetAssigned instead of direct access.
130
131         * class.cs (TypeContainer.VerifyMembers): Distinguish between
132         not used and not used & assigned.
133         (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
134
135 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
136
137         Fix #75053
138         * expression.cs (Is.DoResolve): null is never provided type.
139
140 2005-07-08  Marek Safar  <marek.safar@seznam.cz>
141
142         Fix #52496
143         * cs-parser.jay: Less strict event error rule to catch more errors.
144
145 2005-07-11  Martin Baulig  <martin@ximian.com>
146
147         * generic.cs (ConstructedType.CheckConstraints): Improve the check
148         for the constructor constraint: we do not only have to check
149         whether the class has a public constructor, but also ensure that
150         it's parameterless.  Fixes #75492.
151
152 2005-07-11  Martin Baulig  <martin@ximian.com>
153
154         * expression.cs (Binary.ResolveOperator): Only allow `==' and `!='
155         between type parameters if they either have the reference type
156         constraint or the class constraint.
157
158 2005-07-10  Kamil Skalski <nazgul@nemerle.org>
159
160         * generic.cs: Use MakeGenericType instead of BindGenericParameters.
161
162 2005-07-07  Marek Safar  <marek.safar@seznam.cz>
163
164         Fix #74975
165         * attribute.cs (orig_sec_assembly): Holds original version of assembly.
166         (ExtractSecurityPermissionSet): Cope with self referencing security
167         attributes properly.
168
169         * driver.cs (SetOutputFile): Made public property OutputFile.
170
171 2005-07-07  Raja R Harinath  <rharinath@novell.com>
172
173         Fix #75486.
174         * class.cs (TypeContainer.first_nonstatic_field): Rename from
175         has_nonstatic_fields.  Make into a FieldBase pointer.
176         (TypeContainer.AddField): Add CS0282 check.
177         (TypeContainer.EmitType): Update.
178
179 2005-07-06  Miguel de Icaza  <miguel@novell.com>
180
181         * cs-tokenizer.cs (consume_identifier): Do not create strings to
182         compare if they start with __.
183
184 2005-07-06  Raja R Harinath  <rharinath@novell.com>
185
186         * statement.cs (Switch.SwitchGoverningType): Only look at
187         UserCasts that don't need implicit standard conversions to one of
188         the allowed switch types (Fixes test-322.cs).
189         (LocalInfo.Resolve): Re-enable sanity-test.
190
191 2005-07-06  Marek Safar  <marek.safar@seznam.cz>
192
193         * cs-tokenizer.cs (consume_identifier): Detect double undescores
194         
195         * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
196         
197         * expression.cs (Invocation.DoResolve): Report error CS0245 here.
198
199 2005-07-06  Raja R Harinath  <rharinath@novell.com>
200
201         Fix #75472.
202         * ecore.cs (SimpleName.GetSignatureForError): Add.
203         * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
204         (MemberAccess.GetSignatureForError): Add.
205
206 2005-07-05  Marek Safar  <marek.safar@seznam.cz>
207  
208         The big error and warning messages review.
209         
210         * anonymous.cs,
211         * assign.cs,
212         * attribute.cs,
213         * class.cs,
214         * codegen.cs,
215         * convert.cs,
216         * cs-parser.jay,
217         * cs-tokenizer.cs,
218         * decl.cs,
219         * delegate.cs,
220         * doc.cs,
221         * driver.cs,
222         * ecore.cs,
223         * enum.cs,
224         * expression.cs,
225         * flowanalysis.cs,
226         * iterators.cs,
227         * literal.cs,
228         * location.cs,
229         * modifiers.cs,
230         * namespace.cs,
231         * parameter.cs,
232         * pending.cs,
233         * report.cs,
234         * rootcontext.cs,
235         * statement.cs,
236         * support.cs,
237         * tree.cs,
238         * typemanager.cs: Updated.
239         
240         * class.cs: (MethodCore.SetYields): Moved here to share.
241         (PropertyMethod.Define): Moved iterator setup here.
242         
243         * iterators.cs: Add orig_method to have full access to parent
244         container.
245
246 2005-07-05  Raja R Harinath  <rharinath@novell.com>
247
248         Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
249         * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
250         (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
251         variable of struct type.
252         * expression.cs (Unary.ResolveOperator): Update to change.
253         (Indirection.VerifyFixed): Likewise.
254         (LocalVariableReference.VerifyFixed): A local variable is always fixed.
255         (ParameterReference.VerifyFixed): Value parameters are fixed.
256         (This.VerifyFixed): Treat 'this' as a value parameter.
257         * statement.cs (LocalInfo.IsFixed): Remove.
258
259 2005-07-01  Martin Baulig  <martin@ximian.com>
260
261         * iterators.cs (Iterator.CapturedThisReference.Emit): Use
262         `ec.EmitThis ()' to get the correct scope.
263
264 2005-07-01  Martin Baulig  <martin@ximian.com>
265
266         * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
267         instance is a ParameterReference; fixes #75299.
268
269 2005-06-30  Raja R Harinath  <rharinath@novell.com>
270
271         Fix #75412.
272         * expression.cs (Indexers.map): Remove.
273         (Indexers.Append): Filter out inaccessible setters and getters.
274         (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
275
276         Fix #75283.
277         * ecore.cs (MemberExpr.EmitInstance): New.  Add CS0120 check.
278         Refactored from ...
279         (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
280         (FieldExpr.Emit, PropertyExpr.Emit): Update.
281         (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
282         * expression.cs (Invocation.EmitCall): Add CS0120 check.
283
284 2005-06-30  Marek Safar  <marek.safar@seznam.cz>
285
286         Fix #75322
287         * class.cs (FieldBase.GetInitializerExpression): One more field
288         for backup.
289
290 2005-06-28  Miguel de Icaza  <miguel@novell.com>
291
292         * pending.cs: Do not define a proxy if the base method is virtual,
293         it will be picked up by the runtime (bug 75270).
294
295 2005-07-08  Martin Baulig  <martin@ximian.com>
296
297         * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
298         handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
299
300 2005-07-07  Martin Baulig  <martin@ximian.com>
301
302         * generic.cs (ConstructedType.CheckConstraint): Use
303         ResolveAsTypeStep(), not ResolveAsTypeTerminal() so we're not
304         called recursively; fixes #75329.
305
306 2005-07-06  Martin Baulig  <martin@ximian.com>
307
308         * generic.cs (TypeManager.InferTypeArguments): Added support for
309         anonymous methods; fixes #75461.
310
311 2005-07-01  Martin Baulig  <martin@ximian.com>
312
313         * iterators.cs (Iterator.CapturedThisReference.Emit): Use
314         `ec.EmitThis ()' to get the correct scope.
315
316 2005-07-01  Martin Baulig  <martin@ximian.com>
317
318         * ecore.cs (FieldExpr.DoResolve): Only capture the field if it's
319         instance is `This'; fixes #75299.
320
321 2005-06-30  Martin Baulig  <martin@ximian.com>
322
323         * class.cs (Indexer): Implement IIteratorContainer; added support
324         for iterators in indexers.
325
326         * codegen.cs
327         (EmitContext.CurrentIterator): Make this a property, not a field.
328
329         * anonymous.cs (AnonymousContainer.Iterator): New public property.
330
331 2005-06-28  Miguel de Icaza  <miguel@novell.com>
332
333         * pending.cs: Do not define a proxy if the base method is virtual,
334         it will be picked up by the runtime (bug 75270).
335
336 2005-06-28  Martin Baulig  <martin@ximian.com>
337
338         * cs-parser.jay (interface_method_declaration): Avoid a
339         reduce/reduce conflict by moving some of the code into a separate
340         `interface_method_declaration_body' rule; fixes #75368.
341
342 2005-06-28  Martin Baulig  <martin@ximian.com>
343
344         * typemanager.cs (TypeManager.MemberLookup_FindMembers): Move the
345         array check after the check for TypeBuilder's.
346
347 2005-06-21  Raja R Harinath  <rharinath@novell.com>
348
349         * convert.cs (FindMostEncompassedType): Add two trivial special
350         cases (number_of_types == 0 || number_of_types == 1).
351         (FindMostEncompasingType): Likewise.
352
353 2005-06-17  Raja R Harinath  <rharinath@novell.com>
354
355         Some cleanups preparing for the fix of #75283.
356         * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
357         error testing.
358         (EventExpr.InstanceResolve): Likewise.
359         (EventExpr.DoResolve): Remove redundant checks.
360
361 2005-06-08  Miguel de Icaza  <miguel@novell.com>
362
363         * class.cs: Small fix.
364
365 2005-06-08  Raja R Harinath  <rharinath@novell.com>
366
367         Fix #75160.
368         * class.cs (GetPartialBases): Fix return value check of
369         part.GetClassBases.
370
371 2005-06-07  Raja R Harinath  <rharinath@novell.com>
372
373         Ensure that partial classes are registered in their enclosing
374         namespace.  Initial part of fix of #75160.
375         * tree.cs (Tree.RecordDecl): Add new namespace argument.
376         Register declspace with namespace here, not in
377         DeclSpace.RecordDecl.
378         * cs-parser.jay: Pass namespace to RecordDecl.
379         * class.cs (PartialContainer.Create): Likewise.
380         (ClassPart.DefineType): New sanity-check.  Throws an exception if
381         called.
382         * decl.cs (Declspace.RecordDecl): Remove.
383         * namespace.cs (NamespaceEntry.DefineName): Remove.
384
385 2005-06-06  Marek Safar  <marek.safar@seznam.cz>
386
387         * rootcontext.cs: Reset TargetExt as well.
388
389 2005-06-03  Raja R Harinath  <rharinath@novell.com>
390
391         * ecore.cs (Expression.Resolve): Emit CS0654 error when
392         -langversion:ISO-1.
393
394 2005-06-02  Raja R Harinath  <rharinath@novell.com>
395
396         Fix #75080, cs0119.cs.
397         * ecore.cs (Expression.ExprClassToResolveFlags): New.  Broken out
398         of ...
399         (Expression.Resolve): ... this.  Use it.  Remove bogus code
400         allowing ExprClass.Type and ExprClass.Namespace for
401         ResolveFlags.VariableOrValue.
402         (Expression.Resolve) [1-argument variant]: Change default resolve
403         flags based on language version.
404         (Expression.Error_UnexpectedKind): Use a simple string array
405         rather than an ArrayList.
406         * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
407         not ExprClass.Type.
408         (TypeOfVoid.DoResolve): Likewise.
409         (MemberAccess.DoResolve) [3-argument variant]: Make private.  Drop
410         flags argument -- it always has the same value.
411
412 2005-05-31  Raja R Harinath  <rharinath@novell.com>
413
414         Fix #75081.
415         * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
416         Use it in the error message.
417         * assign.cs, expression.cs, statement.cs: Update.
418
419 2005-05-30  Raja R Harinath  <rharinath@novell.com>
420
421         Fix #75088.
422         * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
423         the "almostMatchedMember" case too.
424         * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
425         that failed the accessibility checks to 'almost_match'.
426
427 2005-05-27  Vladimir Vukicevic  <vladimir@pobox.com>
428
429         * attribute.cs: Use internal MethodBuilder methods to set
430         ExactSpelling and SetLastError on PInvoke methods, instead
431         of passing them via charset.  Fixes #75060.
432
433 2005-05-27  Raja R Harinath  <rharinath@novell.com>
434
435         * parameter.cs (Parameter): Remove TODO comment.
436         (Parameter.DefineParameter): Remove Location parameter.
437         (Parameters.LabelParameters): Likewise.
438         * class.cs (Constructor.Emit): Update to change.
439         (MethodData.Emit): Likewise.
440         * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.  
441         * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
442
443 2005-05-27  Atsushi Enomoto  <atsushi@ximian.com>
444
445         * parameter.cs,
446           Removed Parameters.Location and added Parameter.Location instead.
447           Removed Location parameter from Emit() and GetSignature().
448         * anonymous.cs,
449           class.cs,
450           cs-parser.jay,
451           delegate.cs,
452           iterators.cs,
453           statement.cs :
454           Modified all related calls.
455
456 2005-06-21  Martin Baulig  <martin@ximian.com>
457
458         * generic.cs (NullCoalescingOperator.Emit): Make this work if the
459         left-hand side is not a nullable type; fixes #75328.
460
461 2005-06-21  Martin Baulig  <martin@ximian.com>
462
463         * typemanager.cs
464         (TypeManager.CSharpName): Use GetFullName() instead of `t.FullName'.
465         (TypeManager.GetFullNameSignature): Likewise.
466
467         * convert.cs (Convert.Error_CannotImplicitConversion): Compare
468         `source.FullName' and `target.FullName' to check whether there are
469         two conflicting definitions.
470
471 2005-06-21  Martin Baulig  <martin@ximian.com>
472
473         * convert.cs (Convert.ImplicitTypeParameterConversion): Always use
474         a BoxedCast - also for reference types - to be compatible with csc.
475
476 2005-06-21  Martin Baulig  <martin@ximian.com>
477
478         * expression.cs (MemberAccess.DoResolve): Add support for nested
479         types in a generic instance; fixes #75320.
480
481 2005-06-20  Martin Baulig  <martin@ximian.com>
482
483         * generic.cs (TypeManager.InferType): Also walk the class
484         hierarchy for generic instances; fixes #75261.
485
486 2005-06-17  Martin Baulig  <martin@ximian.com>
487
488         * typemanager.cs (TypeManager.IsBuiltinType): Use TypeToCoreType()
489         to make things work for corlib.
490
491 2005-06-15  Martin Baulig  <martin@ximian.com>
492
493         * attribute.cs (Attribute.CheckSecurityActionValidity): Remove the
494         obsolete `SecurityAction' values.
495
496 2005-06-06  Marek Safar  <marek.safar@seznam.cz>
497
498         * rootcontext.cs: Reset TargetExt as well.
499         
500 2005-06-09  Martin Baulig  <martin@ximian.com>
501
502         * delegate.cs (Delegate.VerifyMethod): Added
503         `MethodGroupExpr old_mg' argument; inherit its
504         `HasTypeParameters'; fix #75085.
505
506 2005-06-09  Martin Baulig  <martin@ximian.com>
507
508         * expression.cs (Invocation.OverloadResolve): Correctly handle
509         generic methods for the SetMemberIsUsed(); fix #75064.
510
511 2005-06-09  Martin Baulig  <martin@ximian.com>
512
513         * statement.cs (Throw.Resolve): Use TypeManager.IsSubclassOf();
514         fixes #75062.
515
516 2005-06-08  Martin Baulig  <martin@ximian.com>
517
518         * cs-parser.jay (nullable_type_or_conditional): If we put the
519         nullable back and our `type' is a `ComposedCast', remove the
520         nullable from it.  Fixes #75156.
521
522         * expression.cs (ComposedCast.RemoveNullable): New public method.
523
524 2005-06-08  Martin Baulig  <martin@ximian.com>
525
526         The big Iterators rewrite :-)
527
528         * iterators.cs: Rewrite this to use the anonymous methods framework.
529
530         * rootcontext.cs (RootContext.DefineTypes): Define Delegates
531         before the TypeContainers; see 2test-21.cs.
532
533         * class.cs
534         (TypeContainer.DefineType): Don't create a new EmitContext if we
535         already have one (this only happens if we're an Iterator).
536         (TypeContainer.Define): Also call Define() on all our iterators.
537         (Method.CreateEmitContext): Added support for iterators.
538
539         * anonymous.cs
540         (AnonymousContainer): New abstract base class for `AnonymousMethod'.
541         (AnonymousContainer.CreateMethodHost): Moved here from
542         AnonymousMethod and made abstract.
543         (AnonymousContainer.CreateScopeType): New abstract method.
544         (AnonymousContainer.IsIterator): New public property.
545         (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
546         get the ScopeTypeBuilder rather than manually defining it here. 
547         (ScopeInfo.EmitScopeInstance): New public method; correctly handle
548         iterators here.
549
550         * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
551         before RootContext.DefineTypes().
552
553         * codegen.cs (EmitContext.RemapToProxy): Removed.
554         (EmitContext.CurrentAnonymousMethod): Changed type from
555         AnonymousMethod -> AnonymousContainer.
556         (EmitContext.ResolveTopBlock): Protect from being called twice.
557         (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
558         (EmitContext.EmitThis): Removed the iterators hacks; use the
559         anonymous methods framework for that.
560
561         * statement.cs
562         (ToplevelBlock.Container): Make this a property, not a field.
563         (ToplevelBlock.ReParent): New public method; move the
564         ToplevelBlock into a new container.
565         (Foreach.TemporaryVariable): Simplify.
566
567 2005-06-05  Martin Baulig  <martin@ximian.com>
568
569         * statement.cs (LocalInfo.CompilerGenerated): New flag.
570         (Block.AddTemporaryVariable): New public method; creates a new
571         `LocalInfo' for a temporary variable.
572         (Block.EmitMeta): Create the LocalBuilders for all the temporary
573         variables here.
574         (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
575         non-iterator variables.
576
577 2005-06-05  Martin Baulig  <martin@ximian.com>
578
579         * statement.cs (Foreach.TemporaryVariable): Create the
580         LocalBuilder in the Emit phase and not in Resolve since in some
581         situations, we don't have an ILGenerator during Resolve; see
582         2test-19.cs for an example.
583
584 2005-06-04  Martin Baulig  <martin@ximian.com>
585
586         The big Foreach rewrite - Part II.
587
588         * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
589         with `PropertyInfo ienumerator_getcurrent'.
590
591         * codegen.cs (VariableStorage): Removed.
592
593         * statement.cs
594         (Foreach): Derive from Statement, not ExceptionStatement.
595         (Foreach.CollectionForeach): New nested class.  Moved all the code
596         dealing with collection foreach here.
597         (Foreach.ForeachHelperMethods): Removed.
598         (Foreach.TemporaryVariable): Implement IMemoryLocation.
599
600 2005-05-23  Martin Baulig  <martin@ximian.com>
601
602         * statement.cs (Try.DoResolve): Don't create a `finally' if we
603         don't need to.  Fix #75014.
604
605 2005-05-26  Raja R Harinath  <rharinath@novell.com>
606
607         Improve user-defined conversion handling.
608         * convert.cs (GetConversionOperators): Rewrite.  Return only the
609         applicable operators.
610         (AddConversionOperators): New.  Helper for GetConversionOperators.
611         (FindMostEncompassedType, FindMostEncompassingType): Verify that
612         there is only one most encompassed/encompassing type.
613         (FindMostSpecificSource, FindMostSpecificTarget): Remove
614         "applicable operator" handling.
615         (UserConversion): Move cache here from GetConversionOperators.
616         Directly cache the chosen operator, rather than the whole
617         MethodGroup.
618         (ExplicitNumericConversion): Fix buggy implementation of Decimal
619         case.  Allow conversion of decimal to sbyte and byte too.
620         * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
621         New static methods.  Used to avoid allocating EmptyExpressions in
622         convert.cs.
623
624 2005-05-24  Duncan Mak  <duncan@novell.com>
625
626         * ecore.cs (CastFromDecimal): New class for casting a decimal to
627         another class, used in Convert.ExplicitNumericConversion.
628         (CastToDecimal): New class, similar to above, but casts to
629         System.Decimal, used in Convert.ImplicitNumericConversion and also
630         in explicit convesion from double/float to decimal.
631
632         * convert.cs (ImplicitNumericConversion): Handle implicit
633         conversions to System.Decimal.
634         (ExplicitNumericConversion): handle explicit conversions to
635         System.Decimal.
636
637         This fixes #68711.
638         
639 2005-05-20  Miguel de Icaza  <miguel@novell.com>
640
641         * typemanager.cs: Do not throw an exception in the TypeBuilder
642         case, we take care of it on the TypeCode.
643
644 2005-05-17  Marek Safar  <marek.safar@seznam.cz>
645         
646         * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
647         is back.
648         
649         * cs-parser.jay: Catch more lexical errors.
650         
651         * report.cs: Add one more Error method.
652         
653         * rootcontext.cs,
654         * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
655
656 2005-05-20  Martin Baulig  <martin@ximian.com>
657
658         * class.cs (TypeContainer.CircularDepException): Removed.
659         (TypeContainer.DefineType): Removed the `InTransit' stuff.
660         (TypeContainer.CheckRecursiveDefinition): Check for circular class
661         (CS0146) and interface (CS0529) dependencies here.
662
663 2005-05-20  Martin Baulig  <martin@ximian.com>
664
665         * expression.cs (New.DoResolve): Move the CS0712 check above the
666         CS0144 check; otherwise it can never be reached.
667
668 2005-05-20  Martin Baulig  <martin@ximian.com>
669
670         * cs-parser.jay: Fix CS0080 check; add CS0231 and CS0257 from MCS.
671
672 2005-05-20  Martin Baulig  <martin@ximian.com>
673
674         * class.cs (TypeContainer.DefineType): Fix CS0698 check.
675
676         * typemanager.cs (TypeManager.IsAttributeType): New public method.
677
678 2005-05-19  Martin Baulig  <martin@ximian.com>
679
680         * delegate.cs
681         (ImplicitDelegateCreation.Check): Added `bool check_only' argument
682         to disable error reporting.
683
684         * convert.cs (Convert.ImplicitStandardConversionExists): Use it
685         here since we don't want to report an error; see the new test-336.cs.
686
687 2005-05-19  Raja R Harinath  <rharinath@novell.com>
688
689         * statement.cs (ToplevelBlock.GetParameterReference)
690         (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
691         Move here from class Block.
692         * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
693         * expression.cs (ParameterReference.DoResolveBase): Likewise.
694
695 2005-05-18  Martin Baulig  <martin@ximian.com>
696
697         Fix #74978.
698
699         * flowanalysis.cs
700         (FlowBranching.Reachability): Add non-static public And() and Or()
701         methods.
702         (FlowBranchingSwitch): New class; do the `break_origins' thing
703         like in FlowBranchingLoop.
704         (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
705         reachability, not just locals and parameters.
706         (FlowBranching.MergeChild): Remove some of the hacks for loop and
707         switch; MergeBreakOrigins() now takes care of that.
708
709 2005-05-18  Martin Baulig  <martin@ximian.com>
710
711         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
712         a loop and may leave it, reset the barrier; fixes #74974.
713
714 2005-05-16  Raja R Harinath  <rharinath@novell.com>
715
716         Fix test-382.cs.  Emit values of decimal constants.
717         * class.cs (TypeContainer.RegisterFieldForInitialization): New.
718         Carved out of ...
719         (TypeContainer.AddField): ... this.
720         (TypeContainer.EmitFieldInitializers): Allow the list of fields
721         with initializers to include 'Const's.
722         (ClassPart.RegisterFieldForInitialization): Forward to
723         PartialContainer.
724         * const.cs (Const.Const): Pass initializer to base class.
725         (Const.Define): In case of decimal constants, register them for
726         initialization in a static constructor.
727
728 2005-05-14  Martin Baulig  <martin@ximian.com>
729
730         * statement.cs (Block.Resolve): Correctly handle unreachable code;
731         do not call ResolveUnreachable() on unreachable statements in
732         here, see the comment in the source code.
733
734 2005-05-13  Raja R Harinath  <rharinath@novell.com>
735
736         Fix #74934.
737         * expression.cs (BinaryResolveOperator): If one of the operands of
738         an equality comparison is 'null' and the other is a pointer type,
739         convert the null to a NullPointer.
740         * convert.cs (ImplicitReferenceConversion): If the expression is a
741         NullLiteral and the target type is a pointer type, return a
742         NullPointer instead.
743         (ImplicitConversionStandard): Likewise.
744
745 2005-05-13  Marek Safar  <marek.safar@seznam.cz>
746         
747         * cs-parser.jay: Set readonly context based on special constructs.
748         
749         * expression.cs (LocalVariableReference.DoResolveBase): Improved
750         readonly variable error handling.
751         
752         * rootcontext.cs (EmitCode): Don't verify members when error
753         occurred.
754         
755         * statement.cs (LocalInfo): Add reaodnly context information.
756         (SetReadOnlyContext, GetReadOnlyContext): New methods.
757
758 2005-05-17  Martin Baulig  <martin@ximian.com>
759
760         * expression.cs (Argument.Resolve): Turn on flow analysis; fix
761         #70970. 
762
763 2005-05-13  Martin Baulig  <martin@ximian.com>
764
765         * statement.cs (Block.Resolve, ResolveUnreachable): Correctly
766         handle unreachable blocks.
767
768 2005-05-13  Martin Baulig  <martin@ximian.com>
769
770         * class.cs
771         (ConstructorInitializer.GetOverloadedConstructor): Don't crash.
772         (MethodCore.CheckCore): Use TypeManager.IsEqual(); fix #74904 and
773         #74905. 
774
775 2005-05-13  Martin Baulig  <martin@ximian.com>
776
777         * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
778         instance variable, not a local.  Fix #74873.
779         (Block.ResolveUnreachable): Set it to true here.
780
781 2005-05-12  Martin Baulig  <martin@ximian.com>
782
783         * cs-parser.jay (property_declaration): Pass the `current_class',
784         not the `current_container' to Property's .ctor.  Fixes #74912.
785
786 2005-05-11  Martin Baulig  <martin@ximian.com>
787
788         * typemanager.cs (Closure): Copy this from MCS and merge all the
789         GMCS-specific changes into it.
790
791 2005-05-12  Raja R Harinath  <harinath@gmail.com>
792
793         Fix #74920.
794         * typemanager.cs (unmanaged_enclosing_types): New.
795         (IsUnmanagedType): Avoid infloops by using
796         'unmanaged_enclosing_types' to talk with recursive invocations.
797
798 2005-05-11  Duncan Mak  <duncan@novell.com>
799
800         * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
801         continuing to process for 'arg'.
802         (handle_preprocessing_directive): Check the argument of the #endif
803         directive and report error CS1025 if there are any trailing
804         characters.
805
806         According to the C# spec, having even whitespace after the #endif
807         directive is illegal; however, because we call arg.TrimEnd ()
808         beforehand, we have the same behavior as csc, allowing whitespace
809         after the directive.
810
811         Fixes #74892.
812
813 2005-05-11  Marek Safar  <marek.safar@seznam.cz>
814
815         Fix #74863.
816         
817         * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
818         (Constructor.GetObsoleteAttribute): Implemented correctly.
819
820 2005-05-10  Martin Baulig  <martin@ximian.com>
821
822         * generic.cs (Constraints.Resolve): Report CS0246 if we cannot
823         resolve the type; fixes #74864.
824         (DefaultValueExpression): Create the LocalTemporary in Emit(), not
825         in DoResolve(); fixes #74862.
826
827 2005-05-10  Martin Baulig  <martin@ximian.com>
828
829         * support.cs (ReflectionParameters.ParameterModifier): Use
830         `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
831         and `ParameterAttributes.In'.  Fixes #74884.
832
833 2005-05-10  Martin Baulig  <martin@ximian.com>
834
835         * typemanager.cs (TypeManager.MemberLookup_FindMembers): Don't use
836         the cache if we're just looking for `MemberTypes.NestedType' in a
837         generic instance.
838
839         * ecore.cs (Expression.ResolveAsTypeTerminal): Don't check the
840         constraints if we're still resolving the type tree.
841         (Expression.MemberLookup): If we're resolving the type tree, only
842         look for `MemberTypes.NestedType' since we're only interested in
843         getting types.
844
845         * class.cs (TypeContainer.DefineType): Don't resolve the type
846         parameters here; do this later in ResolveType() after the type
847         tree has been resolved.
848         (TypeContainer.ResolveType): New public method; this is called
849         after the type tree is resolved and before the types are being
850         populated.  We resolve the generic constraints here.
851         (TypeContainer.DoDefineMember): Check the constraints on our base
852         class and interfaces.
853
854         * decl.cs (DeclSpace.ResolveBaseTypeExpr): Make this protected;
855         set the `ResolvingTypeTree' flag on the EmitContext.
856
857         * codegen.cs (EmitContext.ResolvingTypeTree): New public field.
858
859 2005-05-10  Marek Safar  <marek.safar@seznam.cz>
860
861         * class.cs (Method.Define): Catch attempt for Finalizer declaration.
862         
863         * expression.cs (Argument.GetParameterModifier): Turned to property.
864         (Invocation.Error_InvalidArguments): Add more descriptive errors.
865         
866         * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
867         its C# equivalent.
868         
869 2005-05-09  Raja R Harinath  <rharinath@novell.com>
870
871         Fix #74852.
872         * decl.cs (MemberCache.AddMethods): Register override methods,
873         rather than non-override methods.
874         * typemanager.cs (RegisterOverride): New.
875         (IsOverride): Update.
876
877 2005-05-09  Marek Safar  <marek.safar@seznam.cz>
878
879         * typemanager.cs (TypeManager): Moved InitGenerics to Reset method.
880
881 2005-05-06  Martin Baulig  <martin@ximian.com>
882
883         * attribute.cs
884         (Attributable.IsClsComplianceRequired): Fix typo in the method name.
885         (AttributeTester.AnalyzeTypeCompliance): Add generics support.
886
887 2005-05-09  Marek Safar  <marek.safar@seznam.cz>
888
889         Fix #73105.
890         
891         * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
892         recursive declaration.
893         
894         * statement.cs (Block.ResolveMeta): Report any error in resolving.
895         
896 2005-05-06  Marek Safar  <marek.safar@seznam.cz>
897
898         * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
899         
900         * expression.cs (Binary.DoResolve): (x && 0) is always 0.
901
902 2005-05-05  Raja R Harinath  <rharinath@novell.com>
903
904         Fix #74797.
905         * decl.cs (DeclSpace.FamilyAccessible): 
906         Use TypeManager.IsNestedFamilyAccessible.
907
908         Fix reopened #64812.
909         * typemanager.cs (Closure.Filter): Introduce checks for 'protected
910         internal'.
911
912 2005-05-04  Raja R Harinath  <rharinath@novell.com>
913             Abin Thomas  <projectmonokochi@rediffmail.com>
914             Anoob V E  <projectmonokochi@rediffmail.com>
915             Harilal P R  <projectmonokochi@rediffmail.com>
916
917         Fix #64812.
918         * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
919         allow access to all static members.
920
921 2005-05-04  Martin Baulig  <martin@ximian.com>
922
923         * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
924
925 2005-05-04  Martin Baulig  <martin@ximian.com>
926
927         Fix #74655.
928
929         * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
930         section at the end; make things work if `default' is not the last
931         section.        
932
933 2005-05-04  Martin Baulig  <martin@ximian.com>
934
935         Fix #70400.
936
937         * statement.cs (Switch): Replaced the `got_default' field with a
938         `default_section' one.
939         (Switch.CheckSwitch): Set `default_section' here.
940         (Switch.Resolve): If we're a constant switch and the constant is
941         not found, use the default section.
942
943 2005-05-03  Martin Baulig  <martin@ximian.com>
944
945         * expression.cs (ArrayAccess.EmitGetLength): New public method.
946
947         * statement.cs (Foreach.ArrayForeach): New nested class.
948         (Foreach.TemporaryVariable): New nested class.
949         (Foreach.EmitArrayForeach): Removed; this is now in the new
950         ArrayForeach class.
951
952 2005-05-03  Raja R Harinath  <rharinath@novell.com>
953
954         * pending.cs (BaseImplements): Move the #74773 fix here.  This is
955         more conservative.
956         (VerifyPendingMethods): Revert change below.
957
958         * typemanager.cs (IsOverride, RegisterNonOverride): New.
959         * decl.cs (MemberCache.AddMethod): Register "non-override" methods
960         that used to trigger warning -28.  Remove warning -28.
961         * expression.cs (Invocation.OverloadResolve): Use
962         TypeManager.IsOverride to distinguish override methods.
963
964         Fix #74773.
965         * pending.cs (VerifyPendingMethods): If a base type implements the
966         requested interface, don't bother checking individual methods of
967         the base type.  As a side-effect, this prevents the creation of
968         unnecessary proxies.
969
970 2005-05-02  Martin Baulig  <martin@ximian.com>
971
972         Fix #70182.
973
974         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
975         Also `And' the locals if the old vector is null.
976         (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
977         null; in this case we basically reset all the variables.        
978
979 2005-05-02  Martin Baulig  <martin@ximian.com>
980
981         Fix #74529.
982
983         * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
984         Added `FlowBranching branching' argument; always `and' the
985         variables instead of `or'ing them unless we're an infinite loop.
986
987         * statement.cs (While.Resolve): Create a new sibling unless we're
988         infinite.       
989
990 2005-05-02  Martin Baulig  <martin@ximian.com>
991
992         Fix #70140.
993
994         * class.cs (ConstructorInitializer.Resolve): Added `Block block'
995         arguments; use it instead of creating a new TopLevelBlock.
996         (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
997         our ConstructorInitializer.
998
999         * statement.cs
1000         (TopLevelBlock.TopLevelBranching): New public property.
1001         (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
1002         and create our `TopLevelBranching'.
1003
1004         * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
1005         anonymous method host, use `block.TopLevelBranching' rather than
1006         creating a new branching.
1007
1008 2005-04-20  Miguel de Icaza  <miguel@novell.com>
1009
1010         * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
1011         a ScopeInfo, if any of the current children is a child of the new
1012         entry, move those children there.
1013
1014 2005-04-30  Martin Baulig  <martin@ximian.com>
1015
1016         * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
1017         at the beginning of a SwitchSection.  Fix #73335.
1018
1019 2005-04-27  Marek Safar  <marek.safar@seznam.cz>
1020
1021         Fix #74378
1022         * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
1023         
1024         * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
1025         (FieldExpr.DoResolve): Obsolete members are ignored for field
1026         initializers.
1027         
1028 2005-04-26  Marek Safar  <marek.safar@seznam.cz>
1029
1030         * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
1031         of arrays detection.
1032
1033         * class.cs (Interface.VerifyClsCompliance): Add base interfaces
1034         verification.
1035         (Field.VerifyClsCompliance): Volatile fields are not compliant.
1036
1037         * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
1038         arrays report.
1039
1040 2005-04-25  Ben Maurer  <bmaurer@ximian.com>
1041
1042         * cs-parser.jay: Use the prefered version of -unsafe in error
1043         message.
1044
1045 2005-04-22  Marek Safar  <marek.safar@seznam.cz>
1046
1047         * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
1048         circumstances.
1049
1050 2005-04-20  John Luke  <john.luke@gmail.com>
1051
1052         * driver.cs: fix typo in error message, --outout to --output
1053
1054 2005-04-30  Martin Baulig  <martin@ximian.com>
1055
1056         * attribute.cs (Attribute.CheckSecurityActionValidity): Correctly
1057         handle the .NET 2.x security attributes.
1058
1059 2005-04-30  Martin Baulig  <martin@ximian.com>
1060
1061         * typemanager.cs
1062         (TypeManager.ExpandInterfaces): Don't add things twice.
1063
1064         * class.cs
1065         (TypeContainer.VerifyClsCompliance): Allow generic instances.
1066
1067 2005-04-29  Martin Baulig  <martin@ximian.com>
1068
1069         * generic.cs (Constraints.ResolveTypes): Expand interfaces.
1070
1071         * anonymous.cs: Added support for anonymous generic methods.
1072
1073 2005-04-29  Martin Baulig  <martin@ximian.com>
1074
1075         * typemanager.cs (TypeManager.GetInterfaces): Correctly handle
1076         generic instances.
1077
1078 2005-04-29  Martin Baulig  <martin@ximian.com>
1079
1080         * generic.cs (TypeManager.HasConstructorConstraint): Removed.
1081
1082         * expression.cs (New.DoResolve): Fix the CS0304 check.
1083
1084 2005-04-29  Martin Baulig  <martin@ximian.com>
1085
1086         * typemanager.cs (TypeManager.GetFullName): Updated to the new
1087         naming schema.
1088
1089         * class.cs (MethodCore.IsDuplicateImplementation): If we're an
1090         explicit interface implementation, compare the interface types.
1091         (MethodData.Define): Use the new naming scheme from the latest
1092         .NET 2.x beta2.
1093         (MemberBase.DoDefineBase): Resolve `InterfaceType' here.
1094
1095         * decl.cs (MemberName.GetMemberName): Removed.
1096         (MemberName.MethodName, FullName): New properties.
1097
1098 2005-04-25  Raja R Harinath  <rharinath@novell.com>
1099
1100         * gmcs.exe.config: Update v2.0.40607 -> v2.0.50215.
1101
1102 2005-04-22  Martin Baulig  <martin@ximian.com>
1103
1104         * generic.cs (GenericMethod): Create the EmitContext in the
1105         `Define()'; in `Define(MethodBuilder)', create the type parameters
1106         before calling `Define()'.  Fixes #73933.
1107
1108 2005-04-22  Martin Baulig  <martin@ximian.com>
1109
1110         * generic.cs
1111         (Constraints.Resolve): Make things work wrt. the new type lookup system.
1112         (ConstructedType.ResolveAsTypeTerminal): Don't override this.
1113
1114         * ecore.cs (Expression.ResolveAsTypeTerminal): If `te' is a
1115         ConstructedType, check its constraints.
1116
1117 2005-04-20  Marek Safar  <marek.safar@seznam.cz>
1118
1119         * codegen.cs (InRefOutArgumentResolving): New field.
1120         
1121         * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
1122         fields outside contructor.
1123         
1124         * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
1125         
1126 2005-04-19  Miguel de Icaza  <miguel@novell.com>
1127
1128         * anonymous.cs (CaptureContext.EmitParameterInstance): The
1129         parameter code was not completed ever, so it was not as up-to-date
1130         as local variables.  Must finish it.
1131
1132         The bug fix was to compare the Toplevel of the block, not the
1133         current block.  Thanks for Ben for pointing this out. 
1134
1135 2005-04-19  Raja R Harinath  <rharinath@novell.com>
1136
1137         * decl.cs (AddMethods): Use the declaring type of the problem
1138         method to determine if we want to squash a warning.
1139
1140 2005-04-19  Marek Safar  <marek.safar@seznam.cz>
1141
1142         * attribute.cs: Removed debug output.
1143
1144         * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
1145         
1146         * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
1147         Report.Stderr.
1148         
1149 2005-04-18  Raja R Harinath  <rharinath@novell.com>
1150
1151         Fix #74481.
1152         * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
1153         (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
1154         all null comparisons against reference types.
1155
1156 2005-04-18  Marek Safar  <marek.safar@seznam.cz>
1157
1158         Fix# 74565
1159         * class.cs (TypeContainer.CircularDepException) New nested
1160         exception class.
1161         (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
1162         (TypeContainer.DefineType): Removed error, reset InTransit before
1163         exit.
1164         (Class.DefineType): Throw exception when is in Transit.
1165         Catch exception and report error.
1166         (Struct.DefineType): Throw exception when is in Transit.
1167         Catch exception and report error.
1168         (Interface.DefineType): Throw exception when is in Transit.
1169         Catch exception and report error.
1170
1171         * codegen.cs: Add InCatch,InFinally to EmitContext to easily
1172         handle nested exception handlers.
1173
1174         * flowanalysis.cs (InTryWithCatch): New method, search for try with
1175         a catch.
1176
1177         * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
1178         InFinally and InCatch storage.
1179
1180         * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
1181         (Catch.Resolve): Set and Restore ec.InCatch.
1182         (Try.Resolve): Set and Restore ec.InFinally.
1183         (Try.HasCatch): True when try has catch.
1184
1185 2005-04-17  Atsushi Enomoto  <atsushi@ximian.com>
1186
1187         * doc.cs : In some cases FilterName returns MonoEvent and MonoField
1188           for the same event member, so exclude such cases from warning 419.
1189           Fixed bug #74633.
1190
1191 2005-04-16  Miguel de Icaza  <miguel@novell.com>
1192
1193         * expression.cs (Binary.ResolveOperator): Apply patch from John
1194         Luke to fix bug 59864: operators &, | and ^ on enumerations
1195         require that the same enum type on both sides.
1196
1197         * driver.cs: Add warnings to old flag usage, this is to assist
1198         people who produce Makefiles and hope that the Makefiles will be
1199         used on Windows.
1200
1201         * class.cs (TypeContainer.EmitType): Moved the definition of the
1202         special $PRIVATE$ field from the resolve phase to the Emit phase.
1203         During resolve we do not know if we are a struct with
1204         HasExplicitLayout, we know this only after the attributes for the
1205         type are emitted.
1206
1207         Set the FieldOffset to zero on the dummy field that we create for
1208         the class.   Fixes 74590.
1209
1210 2005-04-16  Raja R Harinath  <rharinath@novell.com>
1211
1212         Fix #73834.
1213         * ecore.cs (PropertyExpr.resolved): New.
1214         (DoResolve): Use it to handle a case of double resolution here.
1215         Handle a case of identical-name-and-type-name.
1216         * expression.cs (ArrayCreation.CheckIndices): Avoid double
1217         resolution by storing the results of expression resolution back
1218         into the "probes" array.
1219
1220 2005-04-15  Raja R Harinath  <rharinath@novell.com>
1221
1222         Fix cs0208-7.cs and cs0208-8.cs.
1223         * typemanager.cs (IsUnmanagedType): Arrays are not allowed
1224         (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0).  Improve
1225         error reporting to point out the reason a struct is not unmanaged.
1226
1227 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
1228
1229         * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and 
1230           just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
1231
1232 2005-04-13  Raja R Harinath  <rharinath@novell.com>
1233
1234         Fix #74528.
1235         * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
1236         IdenticalNameAndTypeName here.
1237         (EventExpr.InstanceResolve): Likewise.
1238
1239 2005-04-13  Marek Safar  <marek.safar@seznam.cz>
1240
1241         C# 2.0 DefaultCharSetAttribute implementation
1242         
1243         * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
1244         which allows us to set GlobalNamespace for every resolve.
1245         (Attribute.ResolveArguments): Cut from Resolve.
1246         (Attribute.GetCharSetValue): Returns CharSet named argument.
1247         (Attribute.DefinePInvokeMethod): Gets default charset from
1248         module settings.
1249         (GlobalAttribute.ResolveAsTypeStep): Override.
1250         (GlobalAttribute.ResolveArguments): Override.
1251         
1252         * class.cs (TypeAttr): Is protected.
1253         
1254         * codegen.cs (ModuleClass.DefaultCharSet): New member.
1255         (ModuleClass.DefaultCharSetType): New memeber.
1256         (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
1257         
1258         * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
1259         charset from module.
1260         
1261         * delegate.cs (TypeAttr): Override.
1262         (Delegate.DefineType): Use this TypeAttr.
1263         
1264         * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
1265         at very early stage (before types are defined) to resolve model
1266         module attributes. It will probably not work with corlib but it
1267         should be ok.
1268         
1269         * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
1270         charset from module.
1271         
1272         * typemanager.cs (default_charset_type): New type.
1273
1274 2005-04-13  Raja R Harinath  <rharinath@novell.com>
1275
1276         * decl.cs (MemberCache.AddMethods): Don't warn if
1277         System.Object.Finalize has buggy MethodAttributes.
1278
1279         * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
1280         removed below.
1281
1282 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
1283
1284         * doc.cs : detect ambiguous reference to overloaded members.
1285           Fixed bug #71603. MS 1.1 csc does not detect it.
1286
1287 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
1288
1289         * doc.cs : delegates must not be referenced with parameters.
1290           Fixed bug #71605.
1291
1292 2005-04-12  Miguel de Icaza  <miguel@novell.com>
1293
1294         * typemanager.cs (IsUnmanagedType): Arrays are allowed.
1295
1296 2005-04-10  Miguel de Icaza  <miguel@novell.com>
1297
1298         * driver.cs (MainDriver): Stop processing if the CLS stage found
1299         errors. 
1300
1301         (CompilerCallableEntryPoint.InvokeCompiler): Always
1302         reset after execution;   Take a TextWriter argument for the
1303         output.
1304
1305         * report.cs: Use the error stream instead of hardcoding stderr. 
1306
1307 2005-04-09  Miguel de Icaza  <miguel@novell.com>
1308
1309         * class.cs: Reduce code paths to test, too small of an
1310         optimization to make it worth the extra testing.  Always perform
1311         it. 
1312
1313 2005-04-08  Raja R Harinath  <rharinath@novell.com>
1314
1315         Fix #74510.
1316         * class.cs (OperatorArrayList.CheckPairedOperators): Skip
1317         operators that had errors reported on them.
1318
1319 2005-04-08  Marek Safar  <marek.safar@seznam.cz>
1320
1321         * attribute.cs (Attribute.IsValidArgumentType): Test valid named
1322         argument types.
1323         (Attribute.Resolve): Add named argument type checking.
1324         
1325         * class.cs (FixedField.Define): Use IsPrimitiveType
1326         
1327         * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
1328         
1329         * iterators.cs (Iterator.DefineIterator): Add check for arglist and
1330         unsafe parameter types.
1331         
1332         * statement.cs (Using.ResolveExpression): Add better error description.
1333         
1334         * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
1335         
1336 2005-04-08  Raja R Harinath  <rharinath@novell.com>
1337
1338         Fix #74484.
1339         * attribute.cs (Attribute.GetAttributeUsage): Resolve
1340         AttributeUsageAttribute in the emitcontext of the attribute class,
1341         not in the emitcontext of the attributable entity it was attached to.
1342         * cs-parser.jay: Use 'current_class', not 'current_container',
1343         when creating a GlobalAttribute.
1344
1345 2005-04-08  Alp Toker  <alp@atoker.com>
1346
1347         * pending.cs: The fix to #58413 failed to compile methods implementing
1348         interfaces with/without params modifiers and vice versa, even though
1349         params modifiers aren't part of the signature. Make the modifier check
1350         less strict as in csc.
1351
1352 2005-04-07  Abin Thomas  <projectmonokochi@rediffmail.com>
1353             Anoob V E  <projectmonokochi@rediffmail.com>
1354             Harilal P R  <projectmonokochi@rediffmail.com>
1355
1356         Fix #58413.
1357         * pending.cs (TypeAndMethods.mods): New.  Store the parameter
1358         modifiers of pending methods.
1359         (PendingImplementation.PendingImplementation): Initialize it.
1360         Add Parameter.Modifier [][] mods and initialize it with ParameterData.
1361         (PendingImplementation.InterFaceMethod): Repalce Type[] argument
1362         with ParameterData.  Add check for modifiers.
1363         * class.cs (MethodData.Define): Update to changes.
1364
1365 2005-04-07  Raja R Harinath  <rharinath@novell.com>
1366
1367         * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
1368
1369 2005-04-07  Marek Safar  <marek.safar@seznam.cz>
1370
1371         * class.cs (PropertyMethod.Define): Check private accessor in abstract
1372         property.
1373         
1374         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
1375         
1376         * rootcontext.cs,
1377         * typemanager.cs: Registered RequiredAttributeAttribute.
1378         
1379 2005-04-06  Marek Safar  <marek.safar@seznam.cz>
1380
1381         * class.cs (VerifyMembers): Doesn't need EmitContext argument.
1382         Warning CS0169 is back at level 3.
1383         (IMethodData.SetMemberIsUsed): New method.
1384         
1385         * decl.cs (IsUsed): New value; moved from FieldBase.Status
1386         (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
1387         
1388         * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
1389
1390         * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
1391         contants.
1392         (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
1393         is used.
1394         
1395         * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
1396         is used.
1397         
1398         * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
1399         to avoid the problems with nested types.
1400
1401 2005-04-05  Abin Thomas  <projectmonokochi@rediffmail.com>
1402             Anoob V.E  <projectmonokochi@rediffmail.com>
1403             Harilal P.R  <projectmonokochi@rediffmail.com>
1404             Raja R Harinath  <rharinath@novell.com>
1405
1406         Fix #73820.
1407         * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
1408         attribute.
1409         * typemanager (GetConstructor): Make public.
1410
1411 2005-04-05  John Luke  <john.luke@gmail.com>
1412             Raja R Harinath  <rharinath@novell.com>
1413
1414         Fix #62232.
1415         * typemanager.cs (IsUnmanagedType): Check non-public fields of a
1416         struct too.  Return false quicker in a few cases.
1417         (VerifyUnManaged): Use it.
1418
1419 2005-04-05  Raja R Harinath  <rharinath@novell.com>
1420
1421         Fix #74041.
1422         * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
1423         not 'unreachable_seen'.
1424
1425 2005-04-04  Marek Safar  <marek.safar@seznam.cz>
1426
1427         * attribute.cs (Attribute.GetValue): Removed unused.
1428         
1429         * codegen.cs (CodeGen.TrimExt): Removed unused.
1430         
1431         * cs-parser.jay (output): Removed unused.
1432         
1433         * cs-tokenizer.cs (hex_digits): Removed unused.
1434         
1435         * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
1436         
1437         * expression.cs (Indirection.LoadExprValue): Removed unused.
1438         (ArrayCreation.ExpressionToArrayArgument): Removed unused.
1439         
1440         * iterators.cs (Iterator.param_types): Removed unused.
1441         
1442         * statement.cs (Goto.block): Removed unused.
1443         (ToplevelBlock.did): Removed unused.
1444         (Switch.ResolveConstantSwitch): Removed unused.
1445
1446 2005-04-01  Ben Maurer  <bmaurer@ximian.com>
1447
1448         * rootcontext.cs: Allow mcs to bootstrap with the compilation
1449         resetting thingy.
1450
1451 2005-04-19  Martin Baulig  <martin@ximian.com>
1452
1453         Merged r42462 from MCS and made it work for GMCS.
1454
1455         * class.cs (MethodCore.ds): Moved this field to `MemberBase'.
1456
1457         * generic.cs (GenericMethod.Define): Removed `return_type' argument.
1458
1459 2005-04-01  Raja R Harinath  <rharinath@novell.com>
1460
1461         Fix #74232 and cs0208-3.cs.
1462         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
1463         * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
1464         unmanaged type.  Don't use FieldBuilders when 't' is a
1465         TypeBuilder.  Use ModFlags and MemberType fields.
1466         * class.cs (MemberBase.member_type): Rename from MemberType.
1467         (MemberBase.MemberType): New property.  Determines member_type on
1468         demand.
1469         (MemberBase.DoDefine): Don't initialize MemberType here.
1470         (FieldMember.Define): Likewise.
1471
1472 2005-04-01  Marek Safar  <marek.safar@seznam.cz>
1473
1474         Fix #74241
1475         * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
1476         Attributes are emitted there.
1477         
1478 2005-04-01  Raja R Harinath  <rharinath@novell.com>
1479
1480         * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
1481         keyword in 'partial enum' too.
1482         * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
1483         is not allowed).
1484         Report from Kamil Skalski <nazgul@omega.pl>.
1485
1486         Fix #74309.
1487         * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
1488         have partial containers too.
1489
1490         * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
1491         in block' checks to Block.CheckInvariantMeaningInBlock.
1492         * statement.cs (Block.GetKnownVariableInfo): Make private.
1493         (Block.IsVariableUsedInChildBlock): Remove.
1494         (Block.IsVariableUsedInBlock): Likewise.
1495         (Block.CheckInvariantMeaningInBlock): New.  Show location of
1496         conflicting declaration.
1497         (Block.AddVariable): Make error messages less long-winded and more
1498         specific.  Show location of conflicting declaration.
1499         * parameter.cs (Parameters.Location): New readonly property.
1500
1501 2005-03-31  Raja R Harinath  <rharinath@novell.com>
1502
1503         Clean up semantics of invoking ResolveMemberAccess.
1504         * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
1505         can have an instance, ensure that we pass in a non-TypeExpression
1506         to ResolveMemberAccess.  Tighten up IdenticalNameAndTypeName checks.
1507         (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
1508         argument.  Update to changes and simplify.
1509         (FieldExpr.Emitinstance): Remove CS0120 check.
1510         (PropertyExpr.EmitInstance): Likewise.
1511         * expression.cs (Argument.Resolve): Likewise.
1512         (Invocation.DoResolve): Update to changes in semantics of
1513         InstanceExpression.
1514
1515 2005-03-31  Marek Safar  <marek.safar@seznam.cz>
1516
1517         Fix #74241
1518         * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
1519         customization.
1520         
1521         * decl.cs (MemberCache.AddMethods): Fix infinite loop.
1522
1523 2005-03-31  Raja R Harinath  <rharinath@novell.com>
1524
1525         Fix difference in behaviour with commandline invocation.
1526         * driver.cs (Driver.Reset): New.
1527         (CompilerCallableEntryPoint): Call it.
1528
1529         * statement.cs (If.Resolve): Avoid spurious "uninitialized
1530         variable" warnings if the boolean expression failed to resolve.
1531
1532 2005-03-30  Sebastien Pouliot  <sebastien@ximian.com>
1533
1534         * attribute.cs: Fix the union of several permissions when some of them
1535         are unrestricted (so the result isn't an unrestricted permission set).
1536         Fix #74036.
1537
1538 2005-03-30  Raja R Harinath  <rharinath@novell.com>
1539
1540         * ecore.cs (MemberExpr): New class.  Convert from interface
1541         IMemberExpr.
1542         (MemberExpr.ResolveMemberAccess): Refactor and move here from
1543         MemberAccess.ResolveMemberAccess.  Tighten up pre-conditions and
1544         error checks.
1545         (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
1546         (MethodGroupExpr.IsExplicitImpl): Remove.
1547         (Expression.GetFieldFromEvent): Remove.
1548         (SimpleName.MemberStaticCheck): Remove.
1549         (SimpleName.DoSimpleNameResolve): Update to changes.
1550         * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
1551         (MemberAccess.IdenticalNameAndTypeName): Remove.
1552         (MemberAccess.error176): Move to MemberExpr.
1553         (MemberAccess.DoResolve): Update to changes.
1554         (BaseAccess.DoResolve): Likewise.
1555
1556 2005-03-30  Marek Safar  <marek.safar@seznam.cz>
1557
1558         C# 2.0 Conditional attribute class implementation
1559         
1560         * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
1561         Analyzes class whether it has attribute which has ConditionalAttribute
1562         and its condition is not defined.
1563         
1564         * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
1565         (Class.IsExcluded): New method. Search for at least one defined
1566         condition in ConditionalAttribute of attribute class.
1567
1568 2005-03-30  Raja R Harinath  <rharinath@novell.com>
1569
1570         * ecore.cs (PropertyExpr): Derive from Expression, not
1571         ExpressionStatement.
1572         (PropertyExpr.EmitStatement): Remove.
1573
1574 2005-03-29  Raja R Harinath  <rharinath@novell.com>
1575
1576         Fix #74060.
1577         * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
1578         internal field "value__" of an enum be private.  The examples for
1579         "value__" that I found on MSDN all used FieldAttributes.Private.
1580
1581         * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
1582         Don't mention IL method attribute names.
1583
1584         Fix #47991.  Remove a TODO.
1585         * statement.cs (Block.Toplevel): Make into a field.
1586         (Block.Parameters): Move into ToplevelBlock.
1587         (Block.known_variables): Rename from child_variable_names.
1588         (Block.Block): Remove variants that take Parameters.  Initialize
1589         'Toplevel' with the immediately surrounding toplevel block.
1590         (Block.AddKnownVariable): Rename from AddChildVariableName.  Add a
1591         LocalInfo parameter.
1592         (Block.GetKnownVariableInfo): New.
1593         (Block.IsVariableNameUsedInChildBlock): Update.
1594         (Block.IsVariableNameUsedInBlock): New.  Checks if a name is used in
1595         the block, even though it may not be in scope.
1596         (Block.AddVariable): Remove Parameters parameter.  Use
1597         Toplevel.Parameters instead.
1598         (Block.AddConstant): Remove Parameters parameter.
1599         (Block.GetParameterReference): Update to use Toplevel.Parameters.
1600         (Block.IsParamaterReference): Likewise.
1601         (Block.IsLocalParameter): Likewise.  Simplify a lot.
1602         (ToplevelBlock.Parameters): New.  Moved from Block.
1603         (ToplevelBlock.ToplevelBlock): Update to changes.  Always
1604         initialize Parameters to a non-null value.
1605         * cs-parser.jay: Update to changes.
1606         * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
1607         simple names that mean different things in the same block.  Use
1608         Block.IsVariableNameUsedInBlock.
1609
1610 2005-03-28  Raja R Harinath  <rharinath@novell.com>
1611
1612         * enum.cs (Enum.LookupEnumValue): Remove debugging code.
1613
1614 2005-03-26  Raja R Harinath  <harinath@acm.org>
1615
1616         Fix #73038.
1617         * assign.cs (Assign.DoResolve): When the RHS of an assignment
1618         fails to resolve, ensure that the LHS is still resolved as an
1619         lvalue.
1620
1621 2005-03-25  Raja R Harinath  <harinath@acm.org>
1622
1623         * enum.cs (Enum.DefineType): Set ec.InEnumContext and
1624         ec.ContainerType.
1625         (Enum.current_ec): Remove.
1626         (Enum.LookupEnumValue): Remove EmitContext argument.
1627         Just uses the one created during DefineType.
1628         (Enum.FindMembers): Update.
1629         * expression.cs (MemberAccess.DoResolve): Update.
1630
1631 2005-03-22  Marek Safar  <marek.safar@seznam.cz>
1632
1633         * assign.cs (Assign.DoResolve): Check for CS1717 when
1634         source and target are same (uses Equals).
1635
1636         * expression.cs (LocalVariableReference, ParameterReference,
1637         This): Implemented Equals, GetHashCode.
1638
1639         * statement.cs (Block.GetParameterReference): Removed useless
1640         local variable.
1641
1642 2005-03-22  Raja R Harinath  <rharinath@novell.com>
1643
1644         Fix cs0128.cs
1645         * statement.cs (Block.AddVariable): Ensure that we skip implicit
1646         blocks before deciding whether the error is cs0136 or cs0128.
1647
1648         * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
1649         (using_alias_directive, using_namespace_directive): Pass
1650         MemberName, not an expression to Namespace.UsingAlias and
1651         Namespace.Using.
1652         (MakeName): Use the MemberName of the namespace.
1653         * namespace.cs (Namespace.MemberName): New.
1654         (UsingEntry.UsingEntry): Take a MemberName, not an expression.
1655         (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
1656         Likewise.
1657         * decl.cs (MemberName.Name): Make readonly.
1658         (MemberName.FromDotted): New "constructor".
1659         (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
1660         (MemberCore.Name): Compute from MemberName on demand.
1661         (MemberCore.SetMemberName): Provide a way to change the
1662         MemberName.
1663         (MemberCore.AddToContainer): Don't take a fullname parameter.
1664         * class.cs (TypeContainer.AddToMemberContainer): Don't add the
1665         fully qualified name of the container to the member name.
1666         (TypeContainer.AddToTypeContainer): Use a fully qualified name
1667         only if the type is a member of the root container.
1668         (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
1669         MemberName.Left rather than searching for an embedded ".".
1670         (PartialContainer.CreatePart): Update to changes in RootContext.
1671         (MemberBase.ShortName): Turn into a property.  Use
1672         MemberCore.SetMemberName.
1673         (MemberBase.ExplicitInterfaceName): Remove.
1674         (MemberBase.UpdateMemberName): Remove.
1675         (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
1676         (PropertyBase.SetMemberName): New override.
1677         * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
1678         (Tree.GetDecl): New.
1679         (Tree.AllDecls): Rename from Decls.
1680         * attribute.cs, enum.cs, report.cs: Update to changes.
1681         * driver.cs (MainDriver): Use MemberName.FromDotted on
1682         RootContext.MainClass.
1683
1684 2005-03-21  Marek Safar  <marek.safar@seznam.cz>
1685
1686         * class.cs (FixedField.Define): Check for CS1664 and more sanity
1687         checks.
1688
1689         * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
1690
1691 2005-03-18  Marek Safar  <marek.safar@seznam.cz>
1692
1693         * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
1694         property accessor modifiers.
1695
1696         * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
1697         fixed buffer attribute (CS1716).
1698         (PropertyMethod.HasCustomAccessModifier): When property accessor
1699         has custom modifier.
1700
1701         * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
1702         modifiers.
1703         (PropertyExpr.DoResolveLValue): Add CS0272.
1704
1705 2005-03-17  Miguel de Icaza  <miguel@novell.com>
1706
1707         * convert.cs: When converting to a pointer, use the proper Conv.U
1708         or Conv.I depending on the source data type.
1709
1710         * cs-tokenizer.cs: Make the size for large decimal constants,
1711         fixes #72957.
1712
1713 2005-03-17  Martin Baulig  <martin@ximian.com>
1714
1715         * anonymous.cs (AnonymousMethod.method_modifiers): Change default
1716         from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'.  Fixes #73260.
1717
1718 2005-03-17  Martin Baulig  <martin@ximian.com>
1719
1720         * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
1721         to bool so we can return an error condition.
1722         (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
1723         returned an error.
1724
1725 2005-03-16  Zoltan Varga  <vargaz@freemail.hu>
1726
1727         * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
1728         attributes.
1729
1730 2005-03-16  Raja R Harinath  <rharinath@novell.com>
1731
1732         Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
1733         Refactor to avoid traversing the list of assemblies, and to avoid
1734         string concatenation.
1735         * typemanager.cs (guid_attr_type): Remove.
1736         (negative_hits, pointers, references): Remove hashes.
1737         (type_hash): New.
1738         (GetConstructedType): New.  Uses type_hash to handle constructed
1739         types (arrays, references, pointers).
1740         (GetReferenceType, GetPointerType): Use it.
1741         (GetNestedType): New.  Uses type_hash to handle nested types of
1742         reflected types.
1743         (LookupType, LookupTypeDirect): Remove.
1744         (CoreLookupType): Inline parts of old LookupTypeDirect code.  Use
1745         'types' hash and LookupTypeReflection directly.
1746         (params_string, params_object): Use GetConstructedType.
1747         * namespace.cs (Namespace.cached_types): New.  Cache of reflected
1748         top-level types.
1749         (Namespace.Lookup): Use cached_types.
1750         (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
1751         provided by old TypeManager.LookupType.
1752         * rootcontext.cs (MakeFQN): Remove.
1753         * decl.cs (DeclSpace.MakeFQN): Likewise.
1754         (DeclSpace.LookupType): Use TypeManager.GetNestedType.
1755         * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
1756         TypeManager.GetConstructedType.
1757         * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
1758
1759 2005-04-16  Zoltan Varga  <vargaz@freemail.hu>
1760
1761         * cs-parser.jay: Fix build.
1762
1763 2005-03-15  Marek Safar  <marek.safar@seznam.cz>
1764
1765         * class.cs (TypeContainer.CircularDepException) New nested
1766         (MethodCore.CheckBase): Report CS1715 for properties and indexers.
1767
1768         * cs-parser.jay: Reports CS1527 for any namespace element.
1769
1770         * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
1771         Added CS0407.
1772
1773         * expression.cs (ParameterReference.IsAssigned): Changed error to
1774         CS0269.
1775         (Error_WrongNumArguments): Moved CS0245 detection here.
1776
1777         * statement.cs (Return.Resolve): Add CS1622 report.
1778
1779 2005-03-11  Marek Safar  <marek.safar@seznam.cz>
1780
1781         * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
1782
1783 2005-03-11  Zoltan Varga  <vargaz@freemail.hu>
1784
1785         * attribute.cs expression.cs: Get rid of some allocations.
1786
1787 2004-03-11  Atsushi Enomoto  <atsushi@ximian.com>
1788
1789         * doc.cs : just eliminate the latest change.
1790
1791 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
1792
1793         * doc.cs : commented out the latest change. It breaks xml-030.cs
1794
1795 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
1796
1797         * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
1798           fail. So invoke CreateType() in FindDocumentedType().
1799
1800 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
1801
1802         * cs-tokenizer.cs : added IsKeyword().
1803         * doc.cs : Detect keyword incorrectly used as identifier.
1804           Allow identifiers prefixed by @.
1805
1806 2005-03-10  Marek Safar  <marek.safar@seznam.cz>
1807
1808         * attributes.cs (Attributes.Emit): Continue after CheckTargets.
1809         It caused exception in namespace resolving (again!).
1810         
1811         * class.cs (Class.ctor): Removed exit.
1812         (PropertyMethod.ctor): ditto.
1813         
1814         * codegen.cs (Codegen.Reset): Reset static data.
1815         (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
1816         
1817         * cs-tokenizer.cs (Cleanup): Removed.
1818         
1819         * driver.cs (GetSystemDir): Rewrote to one line command.
1820         It caused problem with unloaded dynamic modules.
1821         (UnixParseOption): Removed Exit.
1822         (CompilerCallableEntryPoint.InvokeCompiler): Make static.
1823         (CompilerCallableEntryPoint.Reset): Reset suitable static data.
1824         Now can be mcs used as library.
1825         
1826         * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
1827         empty location.
1828         
1829         * location.cs (Reset): Reset static data.
1830         
1831         * namespace.cs (Reset): Reset static data.
1832         
1833         * report.cs (Report.Reset): Reset static data.
1834         
1835         * rootcontext.cs (RootContext.Reset): Reset static data.
1836         
1837         * tree.cs (RootTypes.ctor): Use Location.Null
1838         
1839         * typemanager.cs (TypeManager.Reset): Reset static data.
1840         (CoreLookupType): Removed Exit.
1841         (TypeHandle.Reset): Reset static data.
1842         
1843 2005-03-10  Raja R Harinath  <rharinath@novell.com>
1844
1845         Fix #73516.
1846         * typemanager.cs (ComputeNamespaces): Import namespaces from
1847         referenced modules too.
1848
1849 2005-03-09  Raja R Harinath  <rharinath@novell.com>
1850
1851         * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
1852         than '.'.
1853
1854 2005-03-09  Raja R Harinath  <rharinath@novell.com>
1855
1856         * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
1857         enclosing DeclSpace.  This ensures that a name-lookup populates
1858         more caches and there are fewer 'TypeExpression's.  Carve out
1859         nested type lookup into ...
1860         (LookupNestedTypeInHierarchy): ... this.
1861
1862 2005-04-15  Martin Baulig  <martin@ximian.com>
1863
1864         Merged r41590 from MCS and make it work in the generics land.
1865
1866         * generic.cs (TypeParameter.UpdateConstraints): Removed the
1867         `check' argument.
1868
1869         * class.cs (PartialContainer.UpdateConstraints): Removed.
1870         (PartialContainer.CheckConstraints): Removed.
1871         (PartialContainer.SetParameterInfo): Store the constraints here.
1872         (PartialContainer.DefineTypeParameters): New public method;
1873         resolve the type parameter's constraints here.  Note that the
1874         PartialContainer doesn't have an EmitContext anymore, so we must
1875         do this in the ClassPart.
1876
1877 2005-03-09  Raja R Harinath  <rharinath@novell.com>
1878
1879         Clean up a few partial-class semantics.  
1880         Fixes test-357.cs and cs1618-2.cs.
1881         * cs-parser.jay (struct_declaration): Use 'current_class' as
1882         parent of newly-created struct.  Remove call to Register ().
1883         Use 'pop_current_class' to complete handing the current struct.
1884         (interface_declaration): Likewise.
1885         (class_declaration): Likewise.
1886         (enum_declaration): Use 'current_class' as parent of newly created
1887         enum.
1888         (delegate_declaration): Likewise.
1889         (pop_current_class): New function.  This is used to handle closing
1890         up the 'current_class' and 'current_container', and pointing them
1891         to the enclosing class/container.
1892         (CSharpParser): Initialize 'current_class' too.
1893         * decl.cs (MemberCore): Add check for invariant: a partial
1894         container is not a parsed entity, and thus does not enclose any
1895         parsed members.
1896         (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
1897         (DeclSpace.BaseTypeExpr): Use it.
1898         (DeclSpace.LookupType): Add check for invariant.
1899         * class.cs (TypeContainer): Add check for invariant: a nested
1900         class should have the same NamespaceEntry as its enclosing class.
1901         (TypeContainer.EmitFieldInitializers): Make virtual.
1902         (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
1903         MemberCore.
1904         (TypeContainer.Register): Remove.
1905         (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
1906         null.  Use TypeResolveEmitContext for resolving base types and
1907         interfaces.  Move initialization of Parts.TypeBuilder here from
1908         ...
1909         (TypeContainer.DefineNestedTypes): ... here.
1910         (PartialContainer): Take a Namespace not a NamespaceEntry.
1911         (PartialContainer.Create): Don't use Register.  Call the
1912         appropriate Add... function directly.
1913         (ClassPart): Take both the PartialContainer and the enclosing
1914         class as constructor arguments.
1915         (ClassPart.EmitFieldInitializers): Override.
1916         (ClassPart.PartFindNestedTypes): Remove.
1917         (FieldBase.GetInitializerExpression): Resolve the initializer
1918         expression in the emit context of the enclosing class.
1919         * tree.cs (RootTypes): Remove Register ().
1920         
1921 2005-03-08  Marek Safar  <marek.safar@seznam.cz>
1922
1923         * cs-parser.jay: Removed CS0134.
1924         
1925         * driver.cs: Removed CS1901.
1926         
1927         * expression.cs (SizeOf.DoResolve): Don't report CS0233
1928         for predefined types.
1929
1930 2005-03-07  Duncan Mak  <duncan@novell.com>
1931
1932         * codegen.cs (Save):  Catch UnauthorizedAccessException as
1933         well. Fixes bug #73454.
1934
1935 2005-03-07  Marek Safar  <marek.safar@seznam.cz>
1936
1937         * cs-tokenizer.cs (xtoken): Add CS1035.
1938         
1939         * class.cs (MethodData.Define): Add CS0683.
1940         (FieldMember.ctor): Add CS0681.
1941
1942 2005-03-07  Raja R Harinath  <rharinath@novell.com>
1943
1944         * ecore.cs (SimpleName.DoResolve): Rename from
1945         SimpleName.DoResolveAllowStatic.
1946         (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
1947         Pass 'intermediate' flag to MemberStaticCheck.
1948         (SimpleName.MemberStaticCheck): Skip "static check" only in case
1949         of "intermediate" lookups via MemberAccess.
1950         (SimpleName.IdenticalNameAndTypeName): New.  Carved out of ...
1951         * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
1952
1953 2005-03-07  Raja R Harinath  <rharinath@novell.com>
1954
1955         Fix #73394.
1956         * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
1957         slipped in because of variable names that are identical to a
1958         builtin type's BCL equivalent ('string String;', 'int Int32;').
1959         (PropertyExpr.EmitInstance): Likewise.
1960
1961 2005-03-04  Marek Safar  <marek.safar@seznam.cz>
1962
1963         * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
1964         
1965         * report.cs (warning_ignore_table): Made public.
1966
1967 2005-03-04  Raja R Harinath  <rharinath@novell.com>
1968
1969         Fix #73282.
1970         * class.cs (MethodData.Emit): Pass 'container' to
1971         container.GetObsoleteAttribute instead of 'container.Parent'.
1972
1973 2005-03-03  Marek Safar  <marek.safar@seznam.cz>
1974
1975         * cs-parser.jay: Add 1534 error test.
1976
1977         * iterators.cs (Yield.CheckContext): Add error 1629.
1978         (Iterator.ctor): Save unsafe modifier.
1979         (MoveNextMethod.DoEmit): Restore unsafe context.
1980
1981         * namespace.cs (UsingAlias): Better error message.
1982
1983 2005-03-03  Dan Winship  <danw@novell.com>
1984
1985         * convert.cs (Error_CannotImplicitConversion): fix two bugs in
1986         the warning message [#73219]
1987
1988 2005-03-03  Raja R Harinath  <rharinath@novell.com>
1989
1990         Fix compile with MCS 1.0.0.0.
1991         * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
1992         w_restore to not depend on string constant folding.
1993
1994 2005-03-03  Raja R Harinath  <rharinath@novell.com>
1995
1996         * decl.cs (DeclSpace.LookupType): Remove 'silent' argument.  Move
1997         CS0246 check to users who passed 'silent = false'.
1998         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
1999         check.
2000         (SimpleName.SimpleNameResolve): Update.
2001         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
2002         (MemberAccess.IdenticalNameAndTypeName): Update.
2003         * doc.cs (FindDocumentedTypeNonArray): Update.
2004
2005 2005-03-03  Raja R Harinath  <rharinath@novell.com>     
2006
2007         * codegen.cs (EmitContext): Remove ResolvingTypeTree.
2008         * parameters.cs (ComputeAndDefineParameters): Remove.
2009         * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
2010         * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
2011         Use GetParameterInfo.
2012
2013 2005-03-02  Marek Safar  <marek.safar@seznam.cz>
2014
2015         * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
2016
2017 2005-03-02  Raja R Harinath  <rharinath@novell.com>
2018
2019         Unify DeclSpace.LookupType and DeclSpace.FindType.
2020         * decl.cs (DeclSpace.FindNestedType): New virtual function.  This
2021         is in charge of defining nested types on demand.
2022         (DeclSpace.LookupType): Use it when the current_type is a
2023         TypeBuilder.  Use LookupTypeDirect for reflected types.
2024         (DeclSpace.FindType): Remove.
2025         (DeclSpace.LookupInterfaceOrClass): Likewise.
2026         (DeclSpace.DefineTypeAndParents): Likewise.
2027         * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
2028         DeclSpace.LookupType.
2029         * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
2030         * typemanager.cs (LookupType): Simplify.
2031         (AddUserType): Remove type from negative_hits.
2032         * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
2033         * class.cs (TypeContainer.FindMembers): Move handling of nested
2034         types ...
2035         (TypeContainer.FindMembers_NestedTypes): ... here.
2036         (TypeContainer.FindNestedType): Implement override.
2037         (ClassPart.FindNestedType): Delegate to PartialContainer.
2038         (ClassPart.PartFindNestedType): Looks up the nested types of the
2039         part alone.
2040
2041 2005-04-14  Martin Baulig  <martin@ximian.com>
2042
2043         * generic.cs (ConstructedType): Moved all the type lookup and
2044         nested class logic into SimpleName.
2045         (ConstructedType.ResolveConstructedType): Our underlying type is
2046         already fully resolved; all the type lookup stuff is in
2047         SimpleName.
2048
2049         * ecore.cs (SimpleName.ResolveAsTypeStep): Resolve nested
2050         constructed types here instead of in ConstructedType.
2051
2052         * decl.cs (MemberName.GetTypeExpression): Always create a
2053         SimpleName, not a ConstructedType.
2054         (DeclSpace.ResolveNestedType): Removed; this is now in SimpleName.
2055
2056 2005-03-02  Martin Baulig  <martin@ximian.com>
2057
2058         * class.cs (TypeContainer.DoDefineMembers): We also need a default
2059         static constructor in static classes.
2060
2061 2005-03-01  Zoltan Varga  <vargaz@freemail.hu>
2062
2063         * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
2064         sizeParamIndex is not specified.
2065
2066 2005-03-01  Marek Safar  <marek.safar@seznam.cz>
2067
2068         Fix #73117
2069         * report.cs (WarningMessage.IsEnabled): Missing null check.
2070
2071 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
2072
2073         * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
2074         in the fields and not in the properties.
2075
2076 2005-02-28  Zoltan Varga  <vargaz@freemail.hu>
2077
2078         * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex 
2079         fields as well.
2080
2081 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
2082
2083         * attribute.cs: Small refactoring (improved robustness).
2084         (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
2085         (ValidateGuid): Removed.
2086         (Resolve): Removed referenced to above mentioned.
2087         (GetAttributeUsage): Made private and changed to work without
2088         class assistance.
2089         (GetIndexerAttributeValue): Don't crash.
2090         (GetConditionalAttributeValue): Ditto.
2091         (GetClsCompliantAttributeValue): Ditto.
2092         (ExtractSecurityPermissionSet): All attributes exceptions are
2093         error 648.
2094         (GetPropertyValue): New helper.
2095         (GetMethodImplOptions): New method.
2096         (DefinePInvokeMethod): Reuse common code. Implemented handling of
2097         some missing properties.
2098         
2099         * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
2100         (Method.ApplyAttributeBuilder): Updated.
2101         
2102         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
2103         exception.
2104
2105 2005-02-28  Raja R Harinath  <rharinath@novell.com>
2106
2107         Fix #73052.
2108         * report.cs (Report.SymbolRelatedToPreviousError): Handle
2109         non-simple types (array, pointer, reference).
2110
2111 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
2112
2113         * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
2114
2115         * class.cs (MethodCore.IsDuplicateImplementation): Special error
2116         for operators.
2117         (Method.CheckBase): Catch wrong destructor here.
2118         (MethodData.Define): Add errors 550, 668.
2119
2120         * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
2121
2122         * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
2123
2124         * pending.cs (VerifyPendingMethods): Add error 551.
2125
2126         * typemanager.cs (CSharpName): Next error report helper.
2127
2128 2005-02-25  Marek Safar  <marek.safar@seznam.cz>
2129
2130         * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
2131         attributes. Removed useless attribute double check.
2132         It saves almost 2MBs for corlib.
2133
2134 2005-02-25  Raja R Harinath  <rharinath@novell.com>
2135
2136         Fix #72924.
2137         * statement.cs (ExpressionStatement.Resolve): Make robust to being
2138         called twice in case of error.
2139
2140 2005-02-23  Chris Toshok  <toshok@ximian.com>
2141
2142         Fix compiler portions of #72827.
2143         * statement.cs (Block.Emit): call Begin/EndScope on the
2144         EmitContext instead of the ILGenerator.
2145
2146         * codegen.cs (EmitContext.BeginScope): new method, call
2147         ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
2148         we have one.)
2149         (EmitContext.BeginScope): same, but EndScope and CloseScope
2150
2151         * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
2152         offset and call the superclass's OpenScope(int) with it.
2153         (SymbolWriter.CloseScope): get the current il
2154         offset and call superclass's CloseScope(int) with it.
2155
2156 2005-02-23  Marek Safar  <marek.safar@seznam.cz>
2157
2158         * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
2159         CS1677 for out and ref as well.
2160
2161         * class.cs (Method.Define): Add error CS1599 detection.
2162         
2163         * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
2164         
2165         * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
2166         
2167         * delegate.cs (Delegate.Define): Add error CS1599 detection.
2168         
2169         * support.cs.cs (ModifierDesc): New helper method.
2170
2171 2005-02-23  Raja R Harinath  <rharinath@novell.com>
2172             Abin Thomas  <projectmonokochi@rediffmail.com>
2173             Anoob V E  <projectmonokochi@rediffmail.com>
2174             Harilal P R  <projectmonokochi@rediffmail.com>
2175
2176         Fix #57851, #72718.
2177         * class.cs (ConstructorBuilder.Resolve): Make sure that the second
2178         MemberLookup (used for error reporting) actually returns a result.
2179         Fix error report number (122, not 112).
2180
2181 2005-02-22  Abin Thomas  <projectmonokochi@rediffmail.com>
2182             Anoob V E  <projectmonokochi@rediffmail.com>
2183             Harilal P R  <projectmonokochi@rediffmail.com>
2184
2185         Fix #71134.
2186         * pending.cs (PendingImplementation.GetAbstractMethods):
2187         Find NonPublic members too.
2188
2189 2005-02-22  Marek Safar  <marek.safar@seznam.cz>
2190
2191         * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
2192         Fixed error 217.
2193         
2194         * class.cs (MethodCore.CheckMethodAgainstBase):
2195         Add error 239 report.
2196
2197 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
2198
2199         * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
2200         
2201         * class.cs (Operator.Define): Add error 217 report.
2202         
2203 2005-02-21  Raja R Harinath  <rharinath@novell.com>
2204
2205         Fix #68955.
2206         * expression.cs (Invocation.IsApplicable): Make public.
2207         (Invocation.IsParamsMethodApplicable): Likewise.
2208         * delegate.cs (Delegate.VerifyApplicability): Don't use
2209         Invocation.VerifyArgumentCompat for parameter applicability
2210         testing.  Use Invocation.IsApplicable and
2211         Invocation.IsParamsMethodApplicable.
2212
2213 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
2214
2215         * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
2216         
2217         * class.cs (Operator.Define): Add error 217 report.
2218         
2219 2005-02-21  Raja R Harinath  <rharinath@novell.com>
2220
2221         * namespace.cs (UsingEntry.Resolve): Undo change below.
2222
2223 2005-02-21  Raja R Harinath  <rharinath@novell.com>
2224
2225         Fix #72756.
2226         * ecore.cs (Expression.MemberLookupFailed): Add argument to
2227         disable the error message when the extended MemberLookup also
2228         fails.
2229         (Expression.MemberLookupFinal): Update.
2230         (SimpleName.DoSimpleNameResolve): Update.
2231         * expression.cs (MemberAccess.ResolveNamespaceOrType):
2232         Don't use MemberLookupFinal.
2233         (New.DoResolve): Update.
2234         (BaseAccess.CommonResolve): Update.
2235
2236 2005-02-21  Raja R Harinath  <rharinath@novell.com>
2237
2238         Fix #72732.
2239         * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
2240         occured previously, don't resolve again.
2241
2242 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
2243
2244         Fix #69949
2245         * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
2246         argument. Call ResolveAttributeUsage for unresolved.
2247         when types doesn't match ctor arguments.
2248         
2249         * class.cs (DoDefineMembers.TypeContainer): Removed safety check
2250         for nested attribute classes.
2251         (Class.attribute_usage): Removed.
2252         (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
2253         for attribute class.
2254         
2255         * ecore.cs (IsAttribute): Removed.
2256         
2257         * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
2258         
2259         * rootcontext.cs (RegisterAttribute): Removed, attributes are
2260         now normal types.
2261         (attribute_types): Removed.
2262         (EmitCode): Global attributes are emited as the latest.
2263
2264 2005-02-18  Marek Safar  <marek.safar@seznam.cz>
2265
2266         * class.cs (EmitFieldInitializers): Don't emit field initializer
2267         for default values when optimilization is on.
2268         
2269         * constant.cs (Constant.IsDefaultValue): New property.
2270         
2271         * driver.cs: Add /optimize handling.
2272         
2273         * constant.cs,
2274         * ecore.cs,
2275         * literal.cs: Implement new IsDefaultValue property.
2276         
2277         * rootcontext.cs (Optimize): New field, holds /optimize option.
2278
2279 2005-02-18  Raja R Harinath  <rharinath@novell.com>
2280
2281         Fix crasher in re-opened #72347.
2282         * namespace.cs (Namespace.Lookup): Return null if
2283         DeclSpace.DefineType returns null.
2284
2285         Fix #72678.
2286         * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
2287
2288 2005-02-18  Raja R Harinath  <rharinath@novell.com>
2289
2290         Fix remainder of #63202.  Change semantics of DoResolveLValue: it
2291         now returns null if it cannot resolve to an lvalue.
2292         * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
2293         (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
2294         returned null.  Remove check for SimpleName.
2295         (EventExpr.DoResolveLValue): New.
2296         * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
2297         * expression.cs (Argument.Error_LValueRequired): New.  Move CS1510
2298         error from ...
2299         (Argument.Resolve): ... here.  Use it.  Use DoResolveLValue to
2300         avoid CS0131 error.
2301         (Unary.ResolveOperator): Move CS0211 check ...
2302         (Unary.DoResolve): ... here.  Use DoResolveLValue to avoid
2303         CS0131 error.
2304         (Unary.DoResolveLValue): Simplify.
2305         (AddressOf.DoResolveLValue): New.
2306         (ArrayAccess.DoResolveLValue): New.
2307
2308 2005-02-16  Marek Safar  <marek.safar@seznam.cz>
2309
2310         * attribute.cs (Attribute.Resolve): Add arguments casting for
2311         when types doesn't match ctor arguments.
2312
2313 2005-02-16  Raja R Harinath  <rharinath@novell.com>
2314
2315         Fix parts of #63202.
2316         * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
2317         lookup of operator in base type.  Ensure that all checks happen
2318         when the operator resolves to an "op_..." method.
2319
2320 2005-02-15  Raja R Harinath  <rharinath@novell.com>
2321
2322         Fix #71992.
2323         * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
2324         'ignore_cs0104' parameter.  Pass it to ...
2325         (NamespaceEntry.Lookup): ... this.
2326         * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
2327         * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
2328         (TypeLookupExpression.DoResolveAsTypeStep): Update.
2329         * expression.cs (MemberAccess.IdenticalNameAndTypeName):
2330         Update.  Request that cs0104 errors be ignored.
2331         (ComposedCast.ResolveAsTypeStep): Update.
2332
2333 2005-02-14  Raja R Harinath  <rharinath@novell.com>
2334
2335         Fix #59209.
2336         * expression.cs (Invocation.BetterFunction): Remove support for
2337         comparing virtual functions and their overrides.
2338         (Invocation.IsOverride): New.
2339         (Invocation.OverloadResolve): Don't consider 'override' functions
2340         during candidate selection.  Store them in a lookaside list.
2341         If the selected method is a 'virtual' function, use the list to
2342         find any overrides that are closer to the LHS type.
2343
2344 2005-02-14  Marek Safar  <marek.safar@seznam.cz>
2345
2346         * expression.cs (New.DoResolve): Add complex core type reduction.
2347         (New.Constantify): Converts complex core type syntax like 'new int ()'
2348         to simple constant.
2349         
2350 2005-02-14  Raja R Harinath  <rharinath@novell.com>
2351
2352         * decl.cs (EntryType.EntryType): New constructor to create an
2353         updated copy of a cache entry.
2354         (MemberCache.AddMethods): Use it.
2355         (MemberCache.ClearDeclaredOnly): Remove.
2356         (MemberCache.MemberCache): Update.
2357
2358 2005-02-11  Miguel de Icaza  <miguel@novell.com>
2359
2360         * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
2361         variable.  This one is represents the actual low-level declaration
2362         of the method, as opposed to the semantic level `IsStatic'.   
2363
2364         An anonymous method which is hosted into a static method might be
2365         actually an instance method.  IsStatic would reflect the
2366         container, while MethodIsStatic represents the actual code
2367         generated.
2368
2369         * expression.cs (ParameterReference): Use the new MethodIsStatic
2370         instead of IsStatic.
2371
2372         * anonymous.cs (AnonymousMethod.Compatible): Pass the
2373         Modifiers.STATIC to the Anonymous' Method EmitContext if static is
2374         set on the current EmitContext. 
2375
2376         * expression.cs (Cast): Overload DoResolveLValue so we can pass
2377         resolve our casted expression as an LValue.  This triggers the
2378         proper LValue processing that is later required by Assign.
2379
2380         This fixes 72347.
2381
2382         * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
2383
2384 2005-02-11  Marek Safar  <marek.safar@seznam.cz>
2385
2386         C# 2.0 Fixed buffer implementation
2387
2388         * anonymous.cs: Update after RegisterHelperClass renaming.
2389
2390         * attribute.cs (AttributeTester.fixed_buffer_cache):
2391         Cache of external fixed buffers.
2392         (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
2393         implementation if field is fixed buffer else null.
2394
2395         * class.cs
2396         (TypeContainer.AddField): Accept FieldMember instead of Field.
2397         (FieldBase.IsFieldClsCompliant): Extracted code from
2398         VerifyClsCompliance descendant customization.
2399         (FixedField): New class handles fixed buffer fields.
2400         (FixedFieldExternal): Keeps information about imported fixed
2401         buffer.
2402         (IFixedField): Make access to internal or external fixed buffer
2403         same.
2404
2405         * cs-parser.jay: Add fixed buffer parsing.
2406
2407         * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
2408         buffer.
2409
2410         * expression.cs (Indirection): Extended implementation to accept
2411         fixed buffer field.
2412         (PointerArithmetic.Emit): Get element from fixed buffer as well.
2413         (ElementAccess.MakePointerAccess): Get type as parameter.
2414         (DoResolve): Add fixed buffer field expression conversion.
2415         (DoResolveLValue): Ditto.
2416         (FixedBufferPtr): New class. Moved most of original ArrayPtr.
2417         (ArrayPtr): Derives from FixedBufferPtr.
2418         (ArrayPtr.Emit): Add extra emit for array elements.
2419
2420         * flowanalysis.cs.cs (StructInfo): Use FieldMember.
2421
2422         * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
2423         for compiler generated types.
2424         (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
2425
2426         * statement.cs (Fixed): Refactored to be easier add fixed buffer
2427         and consume less memory.
2428         (Fixed.Resolve): Add fixed buffer case.
2429
2430         * typemanager.cs (compiler_generated_attr_ctor,
2431         fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
2432         (HasElementType): Add our own implementation to work on every
2433         runtime.
2434
2435 2005-02-11  Miguel de Icaza  <miguel@novell.com>
2436
2437         * anonymous.cs (CaptureContext): Track whether `this' has been
2438         referenced.   
2439
2440         * expression.cs (This.ResolveBase): Call CaptureThis.  Before we
2441         only captured `this' if it was implicitly done (instance
2442         methods/variables were used). 
2443
2444         * codegen.cs (EmitContext.CaptureThis): New method to flag that
2445         `this' must be captured.
2446
2447 2005-01-30  Miguel de Icaza  <miguel@novell.com>
2448  
2449         * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
2450         is null it means that there has been no need to capture anything,
2451         so we just create a sibling.
2452
2453         Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
2454
2455         Just a partial fix.  The other half is fairly elusive.
2456         
2457 2005-02-10  Raja R Harinath  <rharinath@novell.com>
2458
2459         Fix #52586, cs0121-4.cs.
2460         * decl.cs (MemberCache.DeepCopy): Rename from SetupCache.  Take
2461         and return a hashtable.
2462         (MemberCache.ClearDeclaredOnly): New.
2463         (MemberCache.MemberCache): Update to change.  Make a deep copy of
2464         the method_hash of a base type too.
2465         (MemberCache.AddMethods): Adapt to having a deep copy of the base
2466         type methods.  Overwrite entries with the same MethodHandle so
2467         that the ReflectedType is correct.  The process leaves in base
2468         virtual functions and their overrides as distinct entries.
2469         (CacheEntry): Now a class instead of a struct.  It shouldn't alter
2470         matters since it was boxed in a ArrayList before.
2471         (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
2472         modifier.
2473         * expression.cs (Invocation.BetterFunction): Simplify.  Handle the
2474         case of a virtual function and its override (choose the overload
2475         as better).
2476         (Invocation.OverloadResolve): Avoid 'override' members during
2477         'applicable_type' calculation.
2478
2479 2005-03-28  Raja R Harinath  <rharinath@novell.com>
2480
2481         * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
2482         (TypeHandle.TypeHandle): Use LookupMemberCache rather than
2483         GetTypeHandle.  It is possible for a reflected type to derive from
2484         a TypeBuilder (e.g., int[] derives from the TypeBuilder
2485         System.Array during mscorlib compilation).
2486         * decl.cs (MemberCache.MemberCache): If the base cache doesn't
2487         contain a method_hash, don't create one either.  Don't create a
2488         deep copy of the base cache's method_hash.
2489         (MemberCache.SetupCache): Rename back from DeepCopy.
2490         (MemberCache.AddMethods): Rewrite, now that method_hash isn't
2491         already initialized.  If we see an override function, add its
2492         underlying base virtual function to the member_hash too.
2493
2494 2005-02-09  Raja R Harinath  <rharinath@novell.com>
2495
2496         Combine two near-redundant caches.
2497         * typemanager.cs (method_params): Rename from method_internal_params.
2498         (TypeManager.GetParameterData): New.  Replace
2499         Invocation.GetParameterData.
2500         (TypeManager.LookupParametersByBuilder): Remove.
2501         * expression.cs (Invocation.method_parameter_cache): Remove.
2502         (Invocation.GetParameterData): Remove.
2503         Update to changes.
2504         * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
2505         Update to changes.
2506
2507 2005-02-08  Raja R Harinath  <rharinath@novell.com>
2508
2509         Fix #72015.
2510         * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
2511         TypeManager.multicast_delegate_type is null, resolve it by looking
2512         up "System.MulticastDelegate".
2513         * rootcontext.cs (RootContext.ResolveCore): Simplify.
2514
2515 2005-02-07  Abin Thomas (NOSIP)  <projectmonokochi@rediffmail.com>
2516             Anoob V.E (NOSIP)  <projectmonokochi@rediffmail.com>
2517             Harilal P.R (NOSIP)  <projectmonokochi@rediffmail.com>
2518
2519         Fix cs0164.cs.
2520         * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
2521         (LabeledStatement.AddReference): New.  Set 'referenced'.
2522         (Goto.Resolve): Use it.
2523
2524 2005-02-05  John Luke  <john.luke@gmail.com>
2525
2526         * driver.cs: remove duplicate -doc line in Usage ()
2527
2528 2005-02-04  Raja R Harinath  <rharinath@novell.com>
2529
2530         * location.cs (Location.AddFile): Fix CS2002 error report.
2531
2532 2005-02-02  Martin Baulig  <martin@ximian.com>
2533
2534         * delegate.cs (Delegate.DefineType): Report an internal error if
2535         TypeManager.multicast_delegate_type is null.  See bug #72015 for
2536         details.        
2537
2538 2005-02-02  Raja R Harinath  <rharinath@novell.com>
2539
2540         Fix a crasher in a variant of #31984.
2541         * const.cs (Constant.CheckBase): New override that defers the
2542         new-or-override check in case the base type hasn't been populated
2543         yet.
2544         (Constant.Define): Ensure the new-or-override check is performed.
2545
2546 2005-02-01  Duncan Mak  <duncan@ximian.com>
2547
2548         * const.cs (LookupConstantValue): Check that `ce' is not null
2549         before calling GetValue ().
2550
2551 2005-02-01  Raja R Harinath  <rharinath@novell.com>
2552
2553         Fix test-334.cs (#69519).
2554         * cs-parser.jay (using_alias_directive): Pass in an expression to
2555         NamespaceEntry.UsingAlias.
2556         (using_namespace_directive): Pass in an expression to
2557         NamespaceEntry.Using.
2558         (namespace_name): Don't flatten to a string.
2559         * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
2560         (NamespaceEntry.AliasEntry.Resolve): Lookup using
2561         ResolveAsTypeStep.
2562         (NamespaceEntry.UsingEntry): Likewise.
2563         (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
2564         changes.
2565         (NamespaceEntry.LookupForUsing): Remove.
2566         (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
2567         names.
2568         (NamespaceEntry.Lookup): Remove support for dotted names.
2569
2570 2005-02-01  Raja R Harinath  <rharinath@novell.com>
2571
2572         * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
2573         split into two.
2574         (NamespaceEntry.ImplicitParent): Compute on demand.
2575         (NamespaceEntry.Doppelganger): New implicit namespace-entry that
2576         parallels the current.
2577         (NamespaceEntry.LookupForUsing): Use it.
2578         (NamespaceEntry.Lookup): If the current namespace-entry is
2579         implicit, don't search aliases and using tables.
2580
2581 2005-02-01  Raja R Harinath  <rharinath@novell.com>
2582
2583         Fix #31984.
2584         * class.cs (TypeContainer.DoDefineMembers): Don't initialize
2585         BaseCache here.
2586         (TypeContainer.BaseCache): Compute on demand.
2587         (TypeContainer.FindMembers): Define constants and types if they're
2588         not already created.
2589         (FieldMember.Define): Move resetting of ec.InUnsafe before error
2590         check.
2591         * const.cs (Constant.Define): Make idempotent.
2592
2593 2005-01-29  Miguel de Icaza  <miguel@novell.com>
2594
2595         * pending.cs: Produce better code (no nops produced by using Ldarg
2596         + value).
2597         
2598         * pending.cs (PendingImplementation.DefineProxy): It was not `arg
2599         i - 1' it should be arg + 1.
2600
2601         Fixes bug #71819.
2602
2603 2005-01-28  Raja R Harinath  <rharinath@novell.com>
2604
2605         * attribute.cs (Attribute.CheckAttributeType): Make private
2606         non-virtual.
2607         (Attribute.ResolveType): Make virtual.
2608         (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
2609         handling of RootContext.Tree.Types.
2610
2611 2005-01-27  Raja R Harinath  <rharinath@novell.com>
2612
2613         Update attribute-handling to use the SimpleName/MemberAccess
2614         mechanisms.
2615         * cs-parser.jay (attribute): Pass in an expression to the
2616         constructors of Attribute and GlobalAttribute.
2617         * attribute.cs (Attribute): Take an expression for the name.
2618         (Attribute.ResolvePossibleAttributeTypes): New.  Resolves the
2619         passed in attribute name expression.
2620         (Attribute.CheckAttributeType): Use it.
2621         * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
2622         * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
2623         (MemberAccess.ResolveNamespaceOrType): ... here.  Add 'silent'
2624         argument to prevent error messages if the lookup fails.
2625
2626 2005-01-27  Marek Safar  <marek.safar@seznam.cz>
2627
2628         * expression.cs (Indirection): Implemented IVariable interface
2629         to support indirection in AddressOf operator.
2630         (PointerArithmetic.Emit): Add optimalization for case where
2631         result can be precomputed.
2632
2633 2005-01-26  Martin Baulig  <martin@ximian.com>
2634
2635         * class.cs (TypeContainer.AttributeTargets): Return the correct
2636         AttributeTargets depending on our `Kind' instead of throwing an
2637         exception; fixes #71632.
2638
2639 2005-01-26  Marek Safar  <marek.safar@seznam.cz>
2640
2641         Fix #71257
2642         * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
2643         constant members.
2644
2645 2005-03-17  Martin Baulig  <martin@ximian.com>
2646
2647         * anonymous.cs (AnonymousMethod.method_modifiers): Change default
2648         from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'.  Fixes #73260.
2649
2650 2005-03-17  Martin Baulig  <martin@ximian.com>
2651
2652         * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
2653         to bool so we can return an error condition.
2654         (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
2655         returned an error.
2656
2657 2005-03-17  Martin Baulig  <martin@ximian.com>
2658
2659         * generic.cs (TypeMananager.IsIEnumerable): New public method.
2660
2661         * convert.cs (Convert.ImplicitReferenceConversion(Exists)): Allow
2662         converting from an array-type of T to `IEnumerable<T>'.
2663
2664 2005-03-16  Martin Baulig  <martin@ximian.com>
2665
2666         * generic.cs (Nullable.Unwrap): Implement IAssignMethod.
2667         (Nullable.LiftedUnaryMutator): New public class.
2668
2669         * expression.cs (UnaryMutator.DoResolve): Added support for
2670         Nullable Types.
2671
2672 2005-03-14  Martin Baulig  <martin@ximian.com>
2673
2674         * generic.cs (Nullable.NullCoalescingOperator): Implemented.
2675
2676 2005-03-14  Martin Baulig  <martin@ximian.com>
2677
2678         * generic.cs (Nullable.LiftedBinaryOperator): Added support for
2679         the comparision operators `<', `>', `<=' and `>='.
2680
2681 2005-03-13  Martin Baulig  <martin@ximian.com>
2682
2683         * generic.cs
2684         (Nullable.NullLiteral): Renamed to `Nullable.NullableLiteral' to
2685         avoid confusion with the `NullLiteral'.
2686         (Nullable.LiftedBinaryOperator): Correctly implement `==' and '!='.
2687
2688 2005-03-13  Martin Baulig  <martin@ximian.com>
2689
2690         * expression.cs (Binary.ResolveOperator): For `==' and `!=', allow
2691         comparing arbitrary types with the null literal.
2692
2693 2005-03-13  Martin Baulig  <martin@ximian.com>
2694
2695         * generic.cs (Nullable.LiftedBinaryOperator): Add support for the
2696         boolean operators '&&', '||', '&' and '|'.
2697         (Nullable.OperatorTrueOrFalse): New public class.
2698
2699         * ecore.cs (Expression.GetOperatorTrue/False): Return an `Expression'
2700         instead of a `StaticCallExpr'; added support for nullables.
2701
2702 2005-03-10  Martin Baulig  <martin@ximian.com>
2703
2704         * expression.cs
2705         (ArrayAccess.EmitDynamicInitializers): Use `etype.IsValueType'
2706         rather than `etype.IsSubclassOf (TypeManager.value_type)'.      
2707
2708 2005-03-07  Martin Baulig  <martin@ximian.com>
2709
2710         * generic.cs (Nullable.Unwrap): Implement IMemoryLocation and make
2711         it work if `expr' is not an IMemoryLocation.
2712         (Nullable.Lifted): Implement IMemoryLocation.
2713         (Nullable.LiftedConversion.ResolveUnderlying): Use the correct
2714         target type.
2715
2716 2005-03-05  Martin Baulig  <martin@ximian.com>
2717
2718         * generic.cs (Nullable.Unwrap, Wrap): New protected classes.
2719         (Nullable.Lifted): New abstract class; rewrote the lifted conversions.
2720         (Nullable): Added support for lifted unary and binary operators.
2721
2722         * expression.cs (Unary.DoResolve): Added support for nullable types.
2723         (Binary.DoResolve): Likewise.
2724         (Conditional.DoResolve): Likewise.
2725
2726 2005-03-02  Martin Baulig  <martin@ximian.com>
2727
2728         * decl.cs (DeclSpace.SetParameterInfo): Make this virtual.
2729
2730         * class.cs (ClassPart.SetParameterInfo): Override this.
2731         (PartialContainer.SetParameterInfo): Override this.
2732         (TypeContainer.CheckConstraints): New protected method.
2733         (PartialContainer.CheckConstraints): Override this and check
2734         whether the same contraints were specified in all parts of a
2735         partial generic type definition.
2736         (PartialContainer.UpdateConstraints): New public method.
2737
2738         * generic.cs (TypeParameter.UpdateConstraints): New public method.
2739
2740 2005-03-02  Martin Baulig  <martin@ximian.com>
2741
2742         Committing a patch from Carlos Alberto Cortez to fix #72887.
2743
2744         * convert.cs (Convert.ExplicitReferenceConversionExists): Allow
2745         casts from `T []' to `int []'.
2746
2747 2005-03-02  Martin Baulig  <martin@ximian.com>
2748
2749         * generic.cs (TypeManager.IsEqual): Make this symmetric.
2750
2751         * expression.cs (Binary.ResolveOperator): When resolving a
2752         BinaryDelegate, use `TypeManager.IsEqual (l, r)' rather than just
2753         `=='.  Fixes #71866.  See gen-127.cs.
2754
2755 2005-03-02  Martin Baulig  <martin@ximian.com>
2756
2757         * class.cs (TypeContainer.DoDefineMembers): We also need a default
2758         static constructor in static classes.
2759
2760 2005-03-02  Martin Baulig  <martin@ximian.com>
2761
2762         * generic.cs
2763         (NullableType.Name, NullableType.FullName): Add a "?" to the name.
2764         (Nullable.LiftedConversion): Added support for user-defined
2765         conversions.
2766
2767         * cs-tokenizer.cs (Tokenizer.PutbackCloseParens): New public method.
2768
2769         * cs-parser.jay: Use ComposedCast everywhere instead of
2770         NullableType, so we don't need to check for NullableType
2771         everywhere.
2772         (conditional_expression): Added `INTERR CLOSE_PARENS' rule for the
2773         case where we'll be resolved into a `parenthesized_expression_0'
2774         afterwards.
2775
2776         * convert.cs
2777         (Convert.UserDefinedConversion): Added nullable conversions.
2778
2779 2005-02-28  Martin Baulig  <martin@ximian.com>
2780
2781         * generic.cs (TypeManager.IsNullableType): New static method.
2782         (Nullable): New abstract class.
2783         (Nullable.NullLiteral): New public class.
2784         (Nullable.LiftedConversion): New public class.
2785
2786         * cs-parser.jay (non_expression_type): Changed `builtin_types' to
2787         `builtin_types opt_nullable'.
2788
2789         * convert.cs
2790         (Convert.ImplicitConversionStandard): Added nullable conversions.
2791         (Convert.ExplicitConversionStandard): Likewise.
2792         (Convert.ExplicitConversion): Likewise.
2793
2794 2005-02-26  Martin Baulig  <martin@ximian.com>
2795
2796         * expression.cs (ComposedCast.DoResolveAsTypeStep): Allow `dim' to
2797         begin with a "?", for instance "?[]".  Don't do a type lookup if
2798         `dim' is empty.
2799
2800 2005-02-25  Martin Baulig  <martin@ximian.com>
2801
2802         The first part of Nullable Types :-)
2803
2804         * generic.cs (NullableType): New public class.
2805         (NullCoalescingOperator): New public class.
2806         (TypeArguments.Resolve): Add a CS0306 check.
2807
2808         * cs-parser.jay (opt_error_modifier): Removed, this was unused.
2809         (opt_nullable): New rule.
2810         (type): Added `opt_nullable' to `namespace_or_type_name',
2811         `builtin_types' and `pointer_type'.
2812         (array_type): Added `opt_nullable'.
2813         (opt_rank_specifier_or_nullable): New rule; this is the
2814         combination of `opt_rank_specifier' and `opt_nullable'.
2815         (opt_error): New rule; catch errors here.
2816         (nullable_type_or_conditional): New rule; we use this to check for
2817         nullable and still detect the conditional operator.
2818         (local_variable_type): Use `opt_rank_specifier_or_nullable'
2819         instead `opt_rank_specifier'.
2820
2821         * expression.cs (ComposedCast.DoResolveAsTypeStep): Added support
2822         for nullables.
2823
2824 2005-02-24  Martin Baulig  <martin@ximian.com>
2825
2826         * README, README.Changes: Removed; they're old and obsolete.
2827
2828 2005-02-22  Martin Baulig  <martin@ximian.com>
2829
2830         * generic.cs (TypeParameter.Resolve): If resolving the constraints
2831         returned an error, set `constraints' to null to avoid a crash
2832         later on.
2833         (TypeParameter.ResolveType): Likewise.
2834
2835 2005-02-22  Martin Baulig  <martin@ximian.com>
2836
2837         * generic.cs
2838         (Constraints.ResolveTypes): Protect against being called twice.
2839         (Constraints.CheckInterfaceMethod): Don't call ResolveTypes().
2840         (TypeParameter.ResolveType): New public method; calls
2841         constraints.ResolveTypes().
2842         (TypeParameter.DefineType): Moved constraints.ResolveType() out
2843         into the new ResolveType().
2844         (GenericMethod.Define): Call ResolveType() on all our
2845         TypeParameter's.        
2846
2847 2005-02-21  Martin Baulig  <martin@ximian.com>
2848
2849         * generic.cs
2850         (TypeManager.generic_nullable_type): New static public field.
2851         (TypeManager.InitGenericCoreType): Lookup "System.Nullable`1".
2852
2853         * rootcontext.cs
2854         (RootContext.ResolveCore): Resolve "System.Nullable`1".
2855
2856 2005-02-15  Martin Baulig  <martin@ximian.com>
2857
2858         * generic.cs (ConstructedType.Constraints): Correctly check
2859         constraints if the argument type is a type parameter; fixes
2860         #72326. 
2861
2862 2005-02-02  Martin Baulig  <martin@ximian.com>
2863
2864         * delegate.cs (Delegate.DefineType): Report an internal error if
2865         TypeManager.multicast_delegate_type is null.  See bug #72015 for
2866         details.        
2867
2868 2005-01-29  Miguel de Icaza  <miguel@novell.com>
2869
2870         * pending.cs: Produce better code (no nops produced by using Ldarg
2871         + value).
2872         
2873         * pending.cs (PendingImplementation.DefineProxy): It was not `arg
2874         i - 1' it should be arg + 1.
2875
2876         Fixes bug #71819.
2877         
2878 2005-01-26  Martin Baulig  <martin@ximian.com>
2879
2880         * cs-parser.jay (indexer_declarator): Don't report an error if we
2881         have type parameters since we can be an explicit interface
2882         implementation; fixes #71449.
2883
2884 2005-01-26  Martin Baulig  <martin@ximian.com>
2885
2886         * class.cs (TypeContainer.AttributeTargets): Return the correct
2887         AttributeTargets depending on our `Kind' instead of throwing an
2888         exception; fixes #71632.
2889
2890 2005-01-26  Martin Baulig  <martin@ximian.com>
2891
2892         * delegate.cs (Delegate.DefineType): Correctly define our type
2893         parameters.  Fixes #71483.
2894
2895 2005-01-25  Raja R Harinath  <rharinath@novell.com>
2896
2897         Fix #71602.
2898         * expression.cs (MemberAccess.DoResolve): Don't complain with
2899         cs0572 when the LHS of a member access has identical name and type
2900         name.
2901
2902 2005-01-25  Marek Safar  <marek.safar@seznam.cz>
2903
2904         Fix #71651, #71675
2905         * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
2906         CreatePermission.
2907         Create custom PermissionSet only for PermissionSetAttribute.
2908
2909 2005-01-24  Marek Safar  <marek.safar@seznam.cz>
2910
2911         Fix #71649
2912         * class.cs (StaticClass.DefineContainerMembers): Enable enums and
2913         delegates in static class.
2914
2915 2005-01-24  Martin Baulig  <martin@ximian.com>
2916
2917         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
2918         merging an implicit block, just use its reachability.
2919
2920         * statement.cs (Block.Resolve): Make the unreachable code check
2921         work wrt. implicit blocks; see test-337 from #63842.
2922
2923 2005-01-21  Alp Toker  <alp@atoker.com>
2924  
2925         * cs-parser.jay: destructor_declaration's container is PartialContainer
2926         not Class when partial types are used, so use Kind prop instead of
2927         'is'.
2928         
2929 2005-01-22  Miguel de Icaza  <miguel@ximian.com>
2930
2931         * cs-parser.jay: Improve error reporting when an interface
2932         declares new types.
2933
2934 2005-01-20  Dick Porter  <dick@ximian.com>
2935
2936         * support.cs: SeekableStreamReader fix from Sandor Dobos
2937         (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
2938         chars are read.  Fixes bug 70369.
2939
2940 2005-01-20  Raja R Harinath  <rharinath@novell.com>
2941
2942         * cs-parser.jay (catch_clause): Simplify current_block handling
2943         somewhat.
2944
2945 2005-01-17  Miguel de Icaza  <miguel@ximian.com>
2946
2947         * convert.cs (ImplicitStandardConversionExists): Synchronize the
2948         code with ImplicitStandardConversion to handle the implicit
2949         conversion of method groups into valid delegate invocations. 
2950
2951         The problem is that in parameter handling we were using this code
2952         path.  Fixes bug #64698
2953
2954 2005-01-19  Raja R Harinath  <rharinath@novell.com>
2955
2956         * cs-parser.jay: Fix several infelicities.
2957         - Avoid assigning to the parser value stack.  Code like 
2958           '$3 = null' is unclean.  Synthesize a value for the code block
2959           instead. 
2960         - Avoid using oob_stack for storing location information.  Use ...
2961         (_mark_): ... this.  New (empty) rule.  Saves the current location
2962         in $$.
2963         (foreach_statement): Avoid using oob_stack for current_block
2964         handling.  Use technique used in for_statement and
2965         using_statement.  Synthesize a value for the code block to store
2966         additional intermediate information.
2967
2968 2005-01-13  Miguel de Icaza  <miguel@ximian.com>
2969
2970         * ecore.cs (IsAccessorAccessible): Accessibility to private fields
2971         of a different type is only allowed to private fields of a
2972         containing type, not on fields of a base class.
2973
2974         See test-174.cs and error cs0122-9.cs
2975
2976 2005-01-13  Raja R Harinath  <rharinath@novell.com>
2977
2978         Fix test-335.cs (bug #58126).
2979         * cs-parser.jay (argument): Split out non-expression parts of the
2980         rule into 'non_simple_argument'.
2981         (invocation_expression): Support parenthesized invocations with
2982         multiple arguments, and with single non-simple arguments.
2983
2984 2005-01-13  Raja R Harinath  <rharinath@novell.com>
2985
2986         * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
2987         places.
2988
2989 2005-01-12  Raja R Harinath  <rharinath@novell.com>
2990
2991         Fix cs0038-1.cs, cs1640-6.cs.
2992         * ecore.cs (Expression.Resolve): Remove special-case for
2993         SimpleName in error-handling.
2994         (Expression.almostMatchedMembers): Relax access permission to
2995         protected.
2996         (Expression.MemberLookupFailed): Handle duplicates in
2997         almostMatchedMembers list.
2998         (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
2999         * expression.cs (New.DoResolve): Report CS1540 for more cases.
3000         * typemanager.cs (GetFullNameSignature): Use the MethodBase
3001         overload if the passed in MemberInfo is a MethodBase.
3002
3003 2005-01-25  Martin Baulig  <martin@ximian.com>
3004
3005         * doc.cs
3006         (DocUtil.emptyParamList): Removed; use `Type.EmptyTypes' instead.
3007
3008 2005-01-12  Marek Safar  <marek.safar@seznam.cz>
3009
3010         Fix #70749
3011         * attribute.cs (ExtractSecurityPermissionSet): Don't report error
3012         for non-CAS & merge permission sets properly.
3013
3014 2005-01-11  Raja R Harinath  <rharinath@novell.com>
3015
3016         Improve standard-compliance of simple name and member access 
3017         resolution.  Fixes bugs #52697, #57200, #67520, #69519.
3018         * ecore.cs (FullNamedExpression): New abstract base class 
3019         for Namespaces and TypeExpressions.
3020         (ResolveFlags.SimpleName): Remove.
3021         (SimpleName): Remove support for dotted names.
3022         (SimpleName.ResolveAsTypeStep): Simplify.  Now just a wrapper to 
3023         DeclSpace.FindType and DeclSpace.LookupType.
3024         (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
3025         (Expression.ExprClassName): Make member function.
3026         * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
3027         a namespace.  Remove creation of dotted "SimpleName"s.
3028         (MemberAccess.DoResolve): Likewise.
3029         * decl.cs (DeclSpace.Cache): Make private.
3030         (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
3031         (DeclSpace.FindType): Update.
3032         (DeclSpace.LookupType): Move here from RootContext.  Return a 
3033         FullNamedExpression.
3034         * namespace.cs (Namespace): Derive from FullNamedExpression
3035         so that it can be part of expression resolution.
3036         (Namespace.Lookup): Return an FullNamedExpression.
3037         (NamespaceEntry.LookupAlias): Lookup aliases only in current
3038         namespace.
3039         * rootcontext.cs (NamespaceLookup): Remove.
3040         (LookupType): Move to DeclSpace.
3041         * attribute.cs (CheckAttributeType): Update.
3042         * doc.cs (FindDocumentedType): Remove allowAlias argument.
3043         (FindDocumentedTypeNonArray): Likewise.
3044
3045 2005-01-11  Raja R Harinath  <rharinath@novell.com>
3046
3047         Fix cs0509.cs, cs1632.cs.
3048         * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
3049         is the same as IsInterface.
3050         (TypeContainer.GetClassBases): Likewise.
3051         * statement.cs (LabeledStatement.ig): New field.
3052         (LabeledStatement.LabelTarget): Save ILGenerator which created the
3053         label.
3054         (LabeledStatement.DoEmit): Check that the label was created with
3055         the same ILGenerator.
3056
3057 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
3058
3059         Fix #71058
3060         * attribute.cs (GetMethodObsoleteAttribute): Need to transform
3061         accessors to its properties.
3062
3063         * ecore.cs (PropertyExpr): Add AccessorTable to help track back
3064         from accessors to property.
3065         
3066 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
3067
3068         Fix #70722
3069         * class.cs (MethodCore.CheckBase): Test base method obsoleteness
3070         only for overrides.
3071         
3072 2005-01-08  Miguel de Icaza  <miguel@ximian.com>
3073
3074         * attribute.cs: Check for null and empty strings.  
3075
3076         I have lost another battle to Paolo.
3077
3078 2005-01-07  Marek Safar  <marek.safar@seznam.cz>
3079
3080         Fix #70942
3081         * class.cs (PropertyMethod): Set Parent field in ctors.
3082         (SetMethod.InternalParameters): Add unsafe switch hack.
3083         Override MarkForDuplicationCheck where it is appropriate.
3084
3085         * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
3086         It says whether container allows members with the same name.
3087         Base default is no.
3088         (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
3089         Removed is_method parameter.
3090
3091 2005-01-06  Duncan Mak  <duncan@ximian.com>
3092
3093         * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
3094         because the previous change led to incorrect reporting of CS1032
3095         ("Cannot define/undefine preprocessor symbols after first token in
3096         file"). Instead of using `tokens_seen' as the only flag that
3097         triggers CS1040, introduce `comments_seen'. This new flag is used
3098         to signify having seen comments on the current line, so it is
3099         unset after a newline.
3100
3101 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
3102
3103         * doc.cs : When searching for a type, find nested type too.
3104           This fixes bug #71040.
3105
3106 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
3107
3108         * doc.cs :
3109           - Warn missing member comment on those classes which also does not
3110             have doc comments. Fixed bug #71041.
3111           - Don't warn missing doc comment on default constructor.
3112             Fixed bug #71042.
3113
3114 2005-01-06  Duncan Mak  <duncan@ximian.com>
3115
3116         * cs-tokenizer.cs (xtoken): After handling traditional C-style
3117         comments, set `tokens_seen' to true. This allows us to detect
3118         misplaced preprocessor directives (i.e. not at the beginning of
3119         the a line, nor after whitespaces). In that case, report error
3120         CS1040. This fixes bug #56460.
3121
3122         * cs-parser.jay (interface_member_declaration): Add checks for
3123         IsExplicitImpl, and report CS0541 error if an interface member is
3124         defined as an explicit interface declaration.
3125
3126 2005-01-06  Marek Safar  <marek.safar@seznam.cz>
3127
3128         Fix #70817
3129         * class.cs (PropertyMethod): Set Parent field in ctors.
3130         (SetMethod.InternalParameters): Add unsafe switch hack.
3131         
3132         * decl.cs (MemberCore.Parent): Cannot be readonly.
3133
3134 2005-01-06  Raja R Harinath  <rharinath@novell.com>
3135
3136         * decl.cs (DeclSpace.ResolveType): Remove.
3137         (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
3138         Merge in code from ...
3139         (DeclSpace.GetTypeResolvingEmitContext): ... here.  Remove.
3140         * class.cs, enum.cs: Update to changes.
3141
3142 2005-01-06  Miguel de Icaza  <miguel@ximian.com>
3143
3144         * anonymous.cs: Ensure that we init the scope of our parent if it
3145         has not been initialized yet.
3146
3147 2004-12-30  Duncan Mak  <duncan@ximian.com>
3148
3149         * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
3150         if field.FieldBuilder is null. Fixes #70758.
3151
3152         * convert.cs: Fixed some typos and updated some of the comments.
3153         (ImplicitStandardConversionExists):
3154         (TryImplicitIntConversion): If `target_type' is an interface and
3155         the type of `ic' implements this interface, return true or a new
3156         BoxedCast instead of null. This fixes #70468.
3157
3158 2004-12-29  Duncan Mak  <duncan@ximian.com>
3159
3160         * expression.cs (Argument.Emit): Check that Expr is
3161         IMemoryLocation before casting to it, and report CS1510 otherwise.
3162
3163         This fixes #70402.
3164
3165 2004-12-21  Ben Maurer  <bmaurer@ximian.com>
3166
3167         * statement.cs (Block.ThisVariable): remove the recursion here, to
3168         make the --profile more sane.
3169
3170 2004-12-17  Carlos Cortez <calberto.cortez@gmail.com>
3171
3172         * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
3173         assembly, by JB Evain.
3174
3175 2004-12-17  Raja R Harinath  <rharinath@novell.com>
3176
3177         * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs, 
3178           rootcontext.cs, typemanager.cs: Make nomenclature consistent.
3179         "parent" refers to enclosing type/class.  "base" refers to superclass.
3180
3181 2004-12-17  Raja R Harinath  <rharinath@novell.com>
3182
3183         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
3184         Ensure that we only have GlobalAttributes.
3185         * attribute.cs (Attribute.Emit): Make non-virtual.
3186         (GlobalAttribute.Emit): Remove.
3187         (Attribute.Resolve): Make virtual.
3188         (GlobalAttribute.Resolve): New.  Set Rootcontext.Tree.Types.NamespaceEntry.
3189         (Attribute.GetConditionalAttributeValue): Take an EmitContext as
3190         the argument. Don't create one.
3191         (Attribute.GetObsoleteAttribute): Likewise.
3192         (Attribute.GetClsCompliantAttributeValue): Likewise.
3193         * class.cs, decl.cs: Update to changes.
3194
3195 2004-12-17  Marek Safar  <marek.safar@seznam.cz>
3196
3197         * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
3198         
3199         * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
3200         
3201         * statement.cs (Foreach.Resolve): Add error 186 report.
3202
3203 2004-12-16  Marek Safar  <marek.safar@seznam.cz>
3204
3205         * expression.cs (Conditional.DoResolve): Add warning 429.
3206         
3207         * statement.cs (If.Resolve): Add warning 665.
3208
3209 2004-12-16  Raja R Harinath  <rharinath@novell.com>
3210
3211         New invariant: RootContext.Tree.Types.NamespaceEntry == null
3212         except when in the parser, and in GlobalAttribute.
3213         * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
3214         * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
3215         RootContext.Tree.Types.NamespaceEntry once work is done.
3216         (GlobalAttribute.Emit): New.  Wrapper for Attribute.Emit, but sets
3217         and resets RootContext.Tree.Types.NamespaceEntry.
3218
3219 2004-12-15  Marek Safar  <marek.safar@seznam.cz>
3220
3221         * cs-parser.jay: Don't create a block for every variable.
3222
3223 2004-12-14  Miguel de Icaza  <miguel@ximian.com>
3224
3225         * location.cs: Provide extra information.
3226
3227         * statement.cs: The instance is not `ldarg_0.THIS' when accessing
3228         variables from the captured environment, it is the ldarg_0.
3229
3230 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
3231
3232         * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
3233         find a conclusion.
3234         
3235         * class.cs: Changed warning level for 169 to avoid developer
3236         displeasure from warning flooding. It will be changed back when they
3237         fix most of current BCL warnings.
3238         
3239         * RootContext.cs: Pushed default WarningLevel to 3.
3240         
3241         * statement.cs: Removed unused variable.
3242
3243 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
3244
3245         * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
3246         (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
3247         Add error 502 report.
3248         (StaticClass.DefineType): Add error 441 report.
3249         (Class.AllowedModifiersProp): New virtual property as temporary
3250         extension to AllowedModifiers.
3251         (Class.DefineType): Add error 418 report. Moved ModFlags check here
3252         to share implementation with StaticClass and don't call virtual
3253         methods from ctor.
3254         
3255         * driver.cs (MainDriver): Add error 1558 test.
3256
3257         * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
3258         report. Moved error 36 test here.
3259
3260         * statement.cs (Throw.Resolve): Add error 724 report.
3261
3262         * typemanager.cs: Add out_attribute_type core type.
3263         
3264 2004-12-13  Marek Safar  <marek.safar@seznam.cz>
3265
3266         * class.cs (TypeContainer.VerifyClsCompliance): Add error
3267         3018 report.
3268         (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
3269
3270         * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
3271         3017 report.
3272         
3273         * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
3274
3275         * parameter.cs (ReturnParameter.ApplyAttributeBuilder): 
3276         Add error 3023 report.
3277         (Parameter.ApplyAttributeBuilder): Add error 3022 report.
3278
3279         * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
3280         implementation.
3281
3282 2004-12-12  John Luke  <john.luke@gmail.com>
3283
3284         * driver.cs (AddArgs): take -- into account when
3285         adding arguments, fixes bug 65710 
3286
3287 2004-12-12  Martin Baulig  <martin@ximian.com>
3288
3289         * expression.cs (Unary.TryReduceNegative): Added support for
3290         SByteConstant and ByteConstant.
3291         (Unary.Reduce): Check error values from TryReduceNegative().
3292
3293 2004-12-10  Marek Safar  <marek.safar@seznam.cz>
3294
3295         * attributes.cs (Attribute.Resolve): Avoid multiple error report
3296         and report exception as error 182.
3297
3298 2004-12-10  Raja R Harinath  <rharinath@novell.com>
3299
3300         * driver.cs (Main): Fix message when there are warnings.
3301
3302 2004-12-09  Miguel de Icaza  <miguel@ximian.com>
3303
3304         * delegate.cs: Fixed my fix from yesterday, sorry about that.
3305
3306 2004-12-09  Marek Safar  <marek.safar@seznam.cz>
3307
3308         * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs: 
3309         Reduced number of warnings.
3310         
3311         * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
3312
3313 2004-12-08  Miguel de Icaza  <miguel@ximian.com>
3314
3315         * driver.cs: Removed message.
3316
3317         * delegate.cs: Fix bug introduced in 1.1.x: 70219.
3318
3319 2004-12-08    <vargaz@freemail.hu>
3320
3321         * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
3322
3323 2004-12-08  Martin Baulig  <martin@ximian.com>
3324
3325         * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
3326         instead of a CS3002 for properties and indexer.
3327
3328 2004-12-08  Martin Baulig  <martin@ximian.com>
3329
3330         * decl.cs (MemberName.ToString): Make this work again.
3331
3332 2004-12-08  Marek Safar  <marek.safar@seznam.cz>
3333
3334         * attribute.cs (Resolve): Add error 591 detection.
3335
3336         * class.cs (FieldMember.Define): Add error 1547 detection.
3337         (Indexer.Define): Add error 620 detection.
3338         (Operator.Define): Add error 590 detection.
3339
3340         * ecore.cs: Missing argument for error 79.
3341
3342         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
3343         detection.
3344
3345 2004-12-07  Marek Safar  <marek.safar@seznam.cz>
3346
3347         Fix #70106
3348         * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
3349         only.
3350
3351 2004-12-07  Atsushi Enomoto  <atsushi@ximian.com>
3352
3353         * cs-parser.jay : handle doc comments on implicit/explicit operators.
3354           Some operator comments were suppressed.
3355         * doc.cs : Implicit/explicit operator name in doc comments are like
3356           "op_Explicit(type)~returnType", so added suffix handling.
3357
3358 2005-01-21  Alp Toker  <alp@atoker.com>
3359
3360         * cs-parser.jay: destructor_declaration's container is PartialContainer
3361         not Class when partial types are used, so use Kind prop instead of 'is'.
3362
3363 2004-12-12  Martin Baulig  <martin@ximian.com>
3364
3365         * expression.cs (Unary.TryReduceNegative): Added support for
3366         SByteConstant and ByteConstant.
3367         (Unary.Reduce): Check error values from TryReduceNegative().
3368
3369 2004-12-11  Martin Baulig  <martin@ximian.com>
3370
3371         * support.cs (ReflectionParameters.ParameterName): If we have a
3372         `gpd', call `ParameterName' on it.
3373
3374         * parameter.cs (Parameter.GetParameterAttributes): New static method.
3375
3376         * pending.cs (PendingImplementation.DefineProxy): Call
3377         DefineParameter() for all of the MethodBuilder's arguments.
3378
3379 2004-12-09  Martin Baulig  <martin@ximian.com>
3380
3381         * doc.cs (DocUtil): Make this a static class.
3382
3383 2004-12-09  Martin Baulig  <martin@ximian.com>
3384
3385         * expression.cs (Invocation.InferType): Moved the type inference
3386         implementation into TypeManager.
3387
3388         * generics.cs (TypeManager): Moved the type inference
3389         implementation here.
3390
3391 2004-12-09  Martin Baulig  <martin@ximian.com>
3392
3393         * typemanager.cs (TypeManager): Make this a partial class.
3394
3395         * generics.cs
3396         (TypeManager): Move the generics part of `TypeManager' here.
3397
3398 2004-12-08  Martin Baulig  <martin@ximian.com>
3399
3400         * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
3401         instead of a CS3002 for properties and indexer.  Added CS3024
3402         check for generic interfaces.
3403
3404         * attributes.cs (AttributeTester.AnalyzeTypeCompliance): Generic
3405         instances are not CLS-compliant.
3406
3407 2004-12-08  Martin Baulig  <martin@ximian.com>
3408
3409         * cs-parser.jay
3410         (void_pointer_expression): New rule for `void*', `void**' etc.
3411         (typeof_expression): Add `void_pointer_expression'; fixes #66846.       
3412
3413 2004-12-08  Martin Baulig  <martin@ximian.com>
3414
3415         * expression.cs (Invocation.InferType): Removed the hack for
3416         MethodCore.MayUnify().  
3417
3418         * typemanager.cs (TypeManager.MayBecomeEqualGenericTypes): Make
3419         this actually work.
3420
3421         * class.cs (MethodCore.MayUnify): Use
3422         TypeManager.MayBecomeEqualGenericTypes().       
3423
3424 2004-12-08  Martin Baulig  <martin@ximian.com>
3425
3426         * expression.cs (Is.DoResolve, As.DoResolve): If we're a type
3427         parameter, box it.  Fixes #69233.
3428
3429 2004-12-08  Martin Baulig  <martin@ximian.com>
3430
3431         * generic.cs (ConstructedType.CheckConstraints): Valuetypes always
3432         have the ctor constraint.  Fixes #68326.
3433
3434 2004-12-07  Atsushi Enomoto  <atsushi@ximian.com>
3435
3436         * cs-parser.jay : interface comment was not consumed because of
3437           extra opt_semicolon before doc handling.
3438
3439 2004-12-03  Raja R Harinath  <rharinath@novell.com>
3440
3441         Fix test-327.cs, test-328.cs, and put in early infrastructure
3442         for eventually fixing #52697.
3443         * namespace.cs (NamespaceEntry.LookupForUsing): New method.
3444         (NamespaceEntry.LookupNamespaceOrType): New method, refactored
3445         from other methods.
3446         (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
3447         (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
3448         (VerifyUsing, error246): Update.
3449         * rootcontext.cs (RootContext.NamespaceLookup): Just use
3450         'NamespaceEntry.LookupNamespaceOrType'.
3451
3452 2004-12-07  Martin Baulig  <martin@ximian.com>
3453
3454         * driver.cs: Call it "BETA SOFTWARE" :-)
3455
3456 2004-12-06  Raja R Harinath  <rharinath@novell.com>
3457
3458         Fix crash on cs0657-17.cs.
3459         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
3460         Use RootContext.Tree.Types, not 'new RootTypes ()'.
3461         * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
3462         the case where the NamespaceEntry gets overwritten.
3463
3464 2004-12-06  Marek Safar  <marek.safar@seznam.cz>
3465
3466         Fixed #69195, #56821
3467         * ecore.cs (ResolveBoolean): Tiny refactoring.
3468
3469         * expression.cs (Binary.DoResolve): Add warning 429 and skipping
3470         of right expression resolving when left is false constant and
3471         operator is LogicalAnd OR true constant and operator is LogicalOr.
3472
3473         * statement.cs (ResolveUnreachable): Always reports warning.
3474
3475 2004-12-05  Miguel de Icaza  <miguel@ximian.com>
3476
3477         * class.cs: Distinguish between 1721 and 1722 (just a little help
3478         for the programmer).
3479
3480 2004-12-03  Miguel de Icaza  <miguel@ximian.com>
3481
3482         * delegate.cs: Only allow this on new versions of the language. 
3483
3484 2004-12-02  Duncan Mak  <duncan@ximian.com>
3485
3486         * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
3487         Expression class.
3488         (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
3489         here as a static method. Take an additional bool out parameter
3490         `must_do_cs1540_check' for signaling to InstanceResolve.
3491         (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
3492         member field from PropertyExpr class and made it an argument of
3493         the method instead.
3494         (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
3495         check for MarshalByRefObject, and report CS0122 instead of CS1540.
3496         (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
3497         and `remove_accessor' as well as InstanceResolve: report CS0122
3498         where applicable.
3499
3500         Fixes #70129.
3501
3502 2004-12-07  Martin Baulig  <martin@ximian.com>
3503
3504         * decl.cs (DeclSpace.AddToContainer): Report correct errors CS0694
3505         and CS0692 where appropriate.
3506
3507 2004-12-06  Martin Baulig  <martin@ximian.com>
3508
3509         * class.cs (MethodCore.MayUnify): Moved the CS0408 check here from
3510         IsDuplicateImplementation() and improved it.
3511
3512         * expression.cs (Invocation.InferTypeArguments): Added
3513         `Type[] inferred_class_types' argument (for MethodCore.MayUnify)
3514         and removed the "ref" modifier from `infered_types'.
3515
3516         * decl.cs (MemberName.ToString): Removed the exception.
3517
3518 2004-12-03  Atsushi Enomoto  <atsushi@ximian.com>
3519
3520         * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
3521           comments are allowed.
3522
3523 2004-12-03  Carlos Alberto Cortez <calberto.cortez@gmail.com>
3524
3525         * delegate.cs: Add checks for subtypes in paramaters and return values
3526         in VerifyMethod () to add support for Covariance/Contravariance
3527         in delegates.
3528         
3529 2004-12-02  Miguel de Icaza  <miguel@ximian.com>
3530
3531         * report.cs: Remove extra closing parenthesis.
3532
3533         * convert.cs (Error_CannotImplicitConversion): If the name of the
3534         types are the same, provide some extra information.
3535
3536 2004-12-02  Marek Safar  <marek.safar@seznam.cz>
3537
3538         Fix bug #70102
3539         * attribute.cs (Resolve): Improved implementation of params
3540         attribute arguments.
3541
3542         * support.cs (ParameterData): Add HasParams to be faster.
3543
3544 2004-12-02  Atsushi Enomoto  <atsushi@ximian.com>
3545
3546         all things are for /doc support:
3547
3548         * doc.cs: new file that supports XML documentation generation.
3549         * mcs.exe.sources: added doc.cs.
3550         * driver.cs:
3551           Handle /doc command line option.
3552           Report error 2006 instead of 5 for missing file name for /doc.
3553           Generate XML documentation when required, after type resolution.
3554         * cs-tokenizer.cs:
3555           Added support for picking up documentation (/// and /** ... */),
3556           including a new XmlCommentState enumeration.
3557         * cs-parser.jay:
3558           Added lines to fill Documentation element for field, constant,
3559           property, indexer, method, constructor, destructor, operator, event
3560           and class, struct, interface, delegate, enum.
3561           Added lines to warn incorrect comment.
3562         * rootcontext.cs :
3563           Added Documentation field (passed only when /doc was specified).
3564         * decl.cs:
3565           Added DocComment, DocCommentHeader, GenerateDocComment() and
3566           OnGenerateDocComment() and some supporting private members for
3567           /doc feature to MemberCore.
3568         * class.cs:
3569           Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
3570         * delegate.cs:
3571           Added overriden DocCommentHeader.
3572         * enum.cs:
3573           Added overriden DocCommentHeader and GenerateDocComment().
3574
3575 2004-12-01  Miguel de Icaza  <miguel@ximian.com>
3576
3577         * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
3578         unwrapping the enumeration values, chain to
3579         DoConstantNumericPromotions again, so we can promote things to the
3580         fundamental types (takes care of enums that are bytes, sbytes).
3581
3582         Fixes bug #62054.
3583
3584 2004-12-01  Raja R Harinath  <rharinath@novell.com>
3585
3586         * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
3587         Fix long-standing bug in type-lookup.  Use FindType instead of
3588         LookupType when ec.ResolvingTypeTree.
3589         (Attribute.ResolveType, Attribute.Resolve)
3590         (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
3591         Update to changes.
3592         (Attributes.Search): Remove internal version.  Update.
3593         (Attributes.SearchMulti): Update.
3594         (Attributes.GetClsCompliantAttribute): Remove.
3595         (Attributes.GetIndexerNameAttribute): Remove.
3596         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
3597         (DeclSpace.GetClsCompliantAttributeValue): Likewise.
3598         * class.cs (Indexer.Define): Likewise.
3599
3600 2004-12-01  Marek Safar  <marek.safar@seznam.cz>
3601
3602         Fix bug #68790
3603         * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
3604         MarshallByReference members access.
3605
3606         * expression.cs: Use CheckMarshallByRefAccess;
3607         Better error CS0197 message.
3608
3609         * report.cs: Print whole related error message.
3610
3611 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
3612
3613         * class (GetClassBases): Better error 60 report.
3614         (EventProperty): Disabled warning 67 detection.
3615
3616 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
3617
3618         Fix bug #60324
3619         * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
3620
3621         * constant.cs (DecimalConstant.Emit): Don't use int ctor for
3622         precise values.
3623
3624 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
3625
3626         Fix bug #49488
3627         * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
3628
3629         * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
3630
3631 2004-11-26  Miguel de Icaza  <miguel@ximian.com>
3632
3633         * attribute.cs (Attribute.Resolve): Refine error reporting and
3634         report a cs0117 if the identifier does not exist, to distinguish
3635         from 0617 which is a miss-use of the actual identifier.
3636
3637         * ecore.cs (EventExpr.Emit): Refine error report and distinguish
3638         between cs0070 and cs0079.
3639
3640         * class.cs (MemberBase.DoDefine): When reporting a wrong
3641         accessibility level, we use MethodCore to compare instead of
3642         Method (this was a regression in some refactoring effort).
3643
3644         So now we correctly report cs0056 again.
3645
3646         * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
3647         testing the target_type (which was known to be object_type) and
3648         not the source type (which is anonymous_method).
3649
3650         Fixed reporting of error cs1660.
3651
3652         * expression.cs (UserCast.Source): Expose the underlying cast.
3653
3654         * statement.cs (Switch.SwitchGoverningType): Sort the list of
3655         allowed types to find a match to int32 first (most common).
3656
3657         In addition, it ignores any ImplicitUserConversions that did an
3658         internal implicit conversion (as the switch statement allows only
3659         one integral conversion to exist).
3660
3661         * class.cs (PartialContainer.Create): rename `name' to
3662         `member_name' for clarity.  Then replace the string calls with a
3663         call to MemberName.GetPartialName, as now using
3664         MemberName.ToString is an error (this is due to the side effects
3665         it had, that were fixed in the past).
3666
3667         This will restore the error reporting on a number of partial class
3668         errors that were missusing this (and getting an exception as a
3669         results, which is now just a plain textual warning, because
3670         yyparse debug output would crash otherwise).
3671
3672 2004-11-26  Raja R Harinath  <rharinath@novell.com>
3673
3674         * Makefile (PROGRAM_INSTALL_DIR): Remove.
3675
3676 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
3677
3678         * rootcontext.cs (LookupType): Make sure to cache lookups that
3679         don't give us a negative result. This saves about 5% of corlib
3680         compilation time.
3681
3682 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
3683
3684         * report.cs (AbstractMessage.Print): messages are sent to stderr
3685
3686         * class.cs (TypeContainer.GetClassBases): It is an error to have a
3687         non-interface in the list of interfaces (at this point, either
3688         parent was properly set, or a base class is being listed in the
3689         interfaces section).
3690
3691         This flags error 1722, and resolves the crash from bug 69259.
3692
3693 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
3694
3695         * statement.cs (Using.EmitExpressionFinally): make this work right
3696         for valuetypes. Fixes 69926.
3697
3698 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
3699
3700         * const.cs (Const.ChangeType): Cope with the "0 literal can be
3701         converted to an enum" here, before we try to change the underlying
3702         type.  This code exists, but it is a different code path than the
3703         one used while encoding constants.
3704
3705         (ImplicitReferenceConversionExists): In addition, resynchronized
3706         the code here, so it matches the same code in
3707         ImplicitReferenceConversionExists for the `from any class-type S
3708         to any interface-type T'.       
3709
3710 2004-11-25  Marek Safar  <marek.safar@seznam.cz>
3711
3712         * cfold.cs (BinaryFold): Add addition for DecimalConstant.
3713
3714 2004-11-24  Miguel de Icaza  <miguel@ximian.com>
3715
3716         * cs-parser.jay: Use verbosity accordingly. 
3717
3718 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
3719
3720         * expression.cs (Unary.ResolveOperator): Do not report warning;
3721         AddressOf reads from variable.
3722         
3723         (LocalVariableReferences.DoResolveBase): Improved my previous fix.
3724
3725 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
3726
3727         Fix bug #69462
3728
3729         * attribute.cs (Attributable): Removed CheckTargets.
3730         (Attributes.Emit): Explicit attribute targets are tested here.
3731
3732         * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
3733         not enabled for interfaces.
3734
3735         * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
3736         (GetAssemblyName): Ouch next bug there.
3737
3738 2004-11-23  Carlos Alberto Cortez <calberto.cortez@gmail.com>
3739
3740         * expression.cs: Error 275 added.
3741         
3742 2004-11-23  Marek Safar  <marek.safar@seznam.cz>
3743
3744         Fix bug #69177 (Implemented decimal constant support)
3745
3746         * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
3747         (BinaryFold): Add DecimalConstant.
3748
3749         * const.cs (Define): Decimal constant 
3750         (is not constant.
3751         (ChangeType): Add decimal type handling.
3752         (LookupConstantValue): Don't set value for decimal type but
3753         emit DecimalConstantAttribute. Needed for constant optimization.
3754
3755         * constant.cs (ToDecimal): New method.
3756         (ConvertToDecimal): New method.
3757         (IntConstant): Implemented ConvertToDecimal.
3758         (DecimalConstant.Emit): Emit optimized version for decimals in
3759         int range.
3760
3761         * expression.cs (ResolveOperator): Changed order of constant
3762         reduction to work correctly with native types which have
3763         overloaded operators.
3764         (ResolveMemberAccess): Extract constant value from attribute
3765         for decimal type.
3766
3767         * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
3768
3769         * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
3770         void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
3771         (ChangeType): Decimal is special.
3772         (TypeToCoreType): Add decimal type.
3773
3774 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
3775
3776         * convert.cs (ImplicitConversionRequired): Add error cs0642 for
3777         decimal types.
3778
3779 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
3780
3781         * class.cs (EventField.ApplyAttributeBuilder): Fix error
3782         test cs1667-5.cs.
3783
3784 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
3785
3786         * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
3787
3788         * pending.cs (PendingImplementation): Grab only interfaces.
3789
3790 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
3791
3792         * statement.cs (ForeachHelperMethods): Add location member and
3793         error 202 detection.
3794
3795 2004-11-18  Marek Safar  <marek.safar@seznam.cz>
3796
3797         * expression.cs (DoResolveBase): Fixed wrong warning for out
3798         variables.
3799
3800 2004-12-04  Martin Baulig  <martin@ximian.com>
3801
3802         * convert.cs (Convert.TypeParameter_to_Null): Use the constraints
3803         to check whether the conversion is ok.
3804
3805         * typemanager.cs (TypeManager.GetTypeArguments): Just return
3806         `Type.EmptyTypes' if we're not a generic TypeContainer.
3807
3808 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
3809
3810         * convert.cs (ImplicitReferenceConversionExists): A surprisingly
3811         old bug: when converting from the null literal to a pointer,
3812         return an EmptyCast, not the NullLiteral.
3813
3814         This fixes #69921, the recent null_type changes probably made this
3815         bug more prominent.
3816
3817 2004-12-03  Martin Baulig  <martin@ximian.com>
3818
3819         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
3820         method as our child, call AnonymousMethod.Compatible() on it.
3821
3822 2004-12-02  Miguel de Icaza  <miguel@ximian.com>
3823
3824         * class.cs (FieldBase): Use an unused bit field from the field to
3825         encode the `has_offset' property from the FieldMember.  This saves
3826         a couple of Ks on bootstrap compilation.
3827
3828         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
3829         method as our child, return the AnonymousMethod resolved
3830         expression.
3831
3832         * expression.cs (New.DoResolve): Allow return values from
3833         NewDelegate to also include AnonymousMethods.
3834
3835         Fixes #70150.
3836
3837 2004-11-29  Raja R Harinath  <rharinath@novell.com>
3838
3839         * decl.cs (MemberCore.MemberName): Remove readonly to fix an error
3840         cs1648 report.
3841         * rootcontext.cs (ResolveCore::interfaces_first_stage): Add
3842         System.Runtime.InteropServices._Exception, since it's a base
3843         interface of the core type System.Exception in the net_2_0 profile.
3844
3845 2004-11-27  Martin Baulig  <martin@ximian.com>
3846
3847         * ecore.cs (Expression.StoreFromPtr): Use `stobj' for generic parameters.
3848
3849 2004-11-26  Raja R Harinath  <rharinath@novell.com>
3850
3851         * Makefile: Convert to use executable.make.
3852         * gmcs.exe.sources: New.
3853
3854 2004-11-25  Martin Baulig  <martin@ximian.com>
3855
3856         * expression.cs (Invocation.InferType): Added support for byref types.
3857
3858 2004-11-25  Martin Baulig  <martin@ximian.com>
3859
3860         * statement.cs (Foreach.FetchMethodMoveNext): Wrap `mi.ReturnType'
3861         in TypeManager.TypeToCoreType().
3862
3863 2004-11-25  Martin Baulig  <martin@ximian.com>
3864
3865         * iterators.cs (Iterator.DoDefineMembers): Override and lookup the
3866         "Dispose" method from the `current_type'.
3867         (Iterator.EmitMoveNext): Use the `dispose_method' we looked up in
3868         DoDefineMembers() instead of using the MethodBuilder; this is
3869         required for generic iterators.
3870
3871         * class.cs (TypeContainer.DoDefineMembers): Make this virtual.
3872
3873 2004-11-24  Martin Baulig  <martin@ximian.com>
3874
3875         * ecore.cs (Expression.LoadFromPtr): Use `ldobj' for generic parameters.
3876
3877 2004-11-20  Martin Baulig  <martin@ximian.com>
3878
3879         * expression.cs (Invocation.InferType): Correctly infer generic
3880         instances; see gen-103.cs.
3881         (Invocation.InferTypeArguments): If a generic method doesn't have
3882         any unbound type parameters, we don't need to infer anything.
3883
3884 2004-11-19  Raja R Harinath  <rharinath@novell.com>
3885
3886         * Makefile (gmcs.exe): Update to new location of bootstrap mcs.exe.
3887
3888 2004-11-17  Raja R Harinath  <rharinath@novell.com>
3889
3890         * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
3891         (TypeHandle.GetMemberCache): New.
3892         (TypeHandle.TypeHandle): Update.
3893         (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
3894         (TypeManager.LookupParentInterfacesCache):
3895         Rename from LookupInterfaceCache.  Optimize slightly.
3896         (TypeManager.MemberLookup_FindMembers): Update.
3897         * decl.cs (MemberCache.MemberCache): Set Container to null in the
3898         multi-type variant.
3899         (AddCacheContents): Rename from AddHashtable.
3900         * class.cs (TypeContainer.parent_container): Remove.
3901         (TypeContainer.VerifyClsCompliance): Don't use parent_container.
3902         (TypeContainer.DoDefineMembers): Don't initialize it.
3903         Update to name changes.
3904         
3905 2004-11-17  Miguel de Icaza  <miguel@ximian.com>
3906
3907         * class.cs (MethodCore.CheckAccessModifiers): New helper routine
3908         that factors the code to check access modifiers on override.  
3909
3910         (PropertyBase): Use the code here.
3911
3912         Patch from Lluis S'anchez, fixes bug #69361.
3913
3914 2004-11-15  Miguel de Icaza  <miguel@ximian.com>
3915
3916         * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
3917         routine that is used to report the use of a captured variable
3918         whose address has been taken.
3919
3920         There are two checks: one when variables are being captured and
3921         the other check is when the address of a variable is taken. 
3922         
3923         (because an anonymous methods might be resolved before *or* after
3924         the address has been taken) and 
3925
3926         * expression.cs (Conditional.DoResolve): Remove the special
3927         casing that Martin added to trueExpr and falseExpr being both
3928         NullLiteral.  We get the right behavior now just by introducing
3929         the null_type into the compiler. 
3930
3931         * convert.cs (ExplicitConversion): Change the code to use
3932         null_type instead of testing `expr is NullLiteral'.
3933         (ImplicitConversionStandard): use null_type too.
3934         (ImplicitReferenceConversionExists): use null_type too.
3935         (ImplicitReferenceConversion): use null_type too.
3936
3937         * literal.cs: The type of `NullLiteral' is now null_type instead
3938         of object_type. 
3939         (Resolve): Set the type here.
3940
3941         * typemanager.cs: Introduce null_type.
3942
3943 2004-11-18  Martin Baulig  <martin@ximian.com>
3944
3945         * rootcontext.cs
3946         (RootContext.LookupType): Return a `Type', not a `TypeExpr'.
3947
3948 2004-11-18  Martin Baulig  <martin@ximian.com>
3949
3950         * ecore.cs (TypeExpr.DoResolveAsTypeStep): Make this protected.
3951
3952 2004-11-18  Martin Baulig  <martin@ximian.com>
3953
3954         * generic.cs (Constraints.Resolve): Take an `EmitContext' instead
3955         of a `DeclSpace'.  If one of our constraints is a `ConstructedType',
3956         call ResolveConstructedType() on it to resolve it without checking
3957         constraints.
3958         (Constraints.ResolveTypes): Check them here.
3959         (ConstructedType.DoResolveAsTypeStep): Fully resolve ourselves,
3960         but don't check constraints.
3961         (ConstructedType.ResolveAsTypeTerminal): Override this and also
3962         check constraints here.
3963         (ConstructedType.ResolveConstructedType): New public method.  This
3964         is called from DoResolveAsTypeStep() and Constraints.Resolve() to
3965         resolve ourselves without checking constraints.
3966
3967         * ecore.cs (Expression.ResolveAsTypeTerminal): Make this virtual.
3968
3969 2004-11-18  Martin Baulig  <martin@ximian.com>
3970
3971         * decl.cs
3972         (DeclSpace.CurrentType): Changed type from `TypeExpr' to `Type'.
3973
3974         * delegate.cs (Delegate.DefineType): Always create the EmitContext.
3975
3976 2004-11-18  Martin Baulig  <martin@ximian.com>
3977
3978         * ecore.cs (TypeExpr.ResolveType): Removed.
3979         (Expression.ResolveAsTypeTerminal): We always return a fully
3980         resolved `TypeExpr', so we can just access its `Type'.
3981
3982         * class.cs (TypeContainer.DefineType): Resolve `CurrentType' here.
3983
3984 2004-11-17  Martin Baulig  <martin@ximian.com>
3985
3986         * ecore.cs (IAlias.Type): Replaced with ResolveAsType() to make
3987         sure we don't return any unresolved TypeExpr's.
3988         (TypeAliasExpression): The .ctor now takes an `IAlias' instead of
3989         a `TypeExpr'.
3990         (Expression.ResolveAsTypeTerminal): Make sure `te.Type != null'.
3991
3992         * expression.cs (MemberAccess.ResolveAsTypeStep): Don't return any
3993         unresolved `ConstructedType's.
3994
3995 2004-11-17  Martin Baulig  <martin@ximian.com>
3996
3997         * ecore.cs (TypeExpr.ResolveType): Don't make this virtual.
3998
3999 2004-11-17  Martin Baulig  <martin@ximian.com>
4000
4001         * ecore.cs
4002         (Expression.ResolveAsTypeTerminal): Removed the `bool silent' argument.
4003
4004         * decl.cs (DeclSpace.ResolveType): Removed.
4005         (DeclSpace.ResolveTypeExpr): Removed the `bool silent' argument.
4006
4007 2004-11-17  Martin Baulig  <martin@ximian.com>
4008
4009         * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
4010         direction, like FindMembers() does.  Fixes #69546, testcase is in
4011         test-315.cs.    
4012
4013 2004-11-16  Martin Baulig  <martin@ximian.com>
4014
4015         This is based on a patch from Marek Safar, see bug #69082.
4016         Fixes bugs #63705 and #67130.
4017
4018         * typemanager.cs (TypeManager.LookupInterfaceCache): New public
4019         method; create a MemberCache for an interface type and cache the
4020         result.
4021
4022         * decl.cs (IMemberContainer.ParentContainer): Removed.
4023         (IMemberContainer.ParentCache): New property.
4024         (MemberCache.SetupCacheForInterface): Removed.
4025         (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
4026         to create a cache for an interface's "parent".
4027
4028         * class.cs (TypeContainer.DoDefineMembers): Setup cache for
4029         interfaces too.
4030
4031 2004-11-14  Ben Maurer  <bmaurer@ximian.com>
4032
4033         * statement.cs: Avoid adding bools to a hashtable.
4034
4035 2004-11-15  Martin Baulig  <martin@ximian.com>
4036
4037         * decl.cs (MemberName.GetPartialName): Removed, use GetTypeName() instead.
4038
4039 2004-11-11  Martin Baulig  <martin@ximian.com>
4040
4041         * typemanager.cs (TypeManager.GetMethodName): New method.
4042
4043         * class.cs (MethodData.Define): Include the generic arity in the
4044         name of an explicit interface; also add it to the method name.
4045
4046         * pending.cs (PendingImplementation.InterfaceMethod): The method
4047         name now includes the generic arity.
4048
4049 2004-11-07  Miguel de Icaza  <miguel@ximian.com>
4050
4051         * expression.cs (Invocation.OverloadResolve): Flag error if we are
4052         calling an unsafe method from a safe location.
4053
4054 2004-11-06  Marek Safar  <marek.safar@seznam.cz>
4055
4056         Fix #69167
4057         * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
4058
4059 2004-11-06  Miguel de Icaza  <miguel@ximian.com>
4060
4061         * namespace.cs (VerifyUsing): use GetPartialName instead of
4062         ToString. 
4063
4064 2004-11-05  Miguel de Icaza  <miguel@ximian.com>
4065
4066         * statement.cs (Return.Resolve): Fix regression in typo: if
4067         `in_exc', we have to request a NeedReturnLabel, this was a typo
4068         introduced in the anonymous method check-in.  Fixes #69131.
4069
4070         * Indexers were using the ShortName when defining themselves,
4071         causing a regression in the compiler bootstrap when applying the
4072         patch from 2004-11-02 (first part), now they use their full name
4073         and the bug is gone.
4074
4075 2004-11-04  Zoltan Varga  <vargaz@freemail.hu>
4076
4077         * driver.cs: Strip the path from the names of embedded resources. Fixes
4078         #68519.
4079
4080 2004-11-04  Raja R Harinath  <rharinath@novell.com>
4081
4082         Fix error message regression: cs0104-2.cs.
4083         * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
4084         (AliasEntry.Resolve): Update.
4085         * rootcontext.cs (RootContext.NamespaceLookup): Update.  Remove
4086         'silent' flag.
4087         (RootContext.LookupType): Update.
4088
4089 2004-11-03  Carlos Alberto Cortez <carlos@unixmexico.org>
4090
4091         * cs-parser.jay: Add support for handling accessor modifiers
4092         * class: Add support port accessor modifiers and error checking,
4093         define PropertyMethod.Define as virtual (not abstract anymore)
4094         * ecore.cs: Add checking for proeprties access with access modifiers
4095         * iterators.cs: Modify Accessor constructor call based in the modified
4096         constructor
4097 2004-11-02  Ben Maurer  <bmaurer@ximian.com>
4098
4099         * expression.cs (StringConcat): Handle being called twice,
4100         as when we have a concat in a field init with more than two
4101         ctors in the class
4102
4103 2004-11-02  Miguel de Icaza  <miguel@ximian.com>
4104
4105         * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
4106         special case explicit implementations, we should always produce
4107         the .property or .event declaration.
4108         
4109         * decl.cs (MemberName): Renamed GetFullName to GetPartialName
4110         since it will not return correct data if people use this
4111         unresolved in the presence of using statements (see test-313).
4112
4113         * class.cs (MethodData.Define): If we are an explicit interface
4114         implementation, set the method name to the full name of the
4115         interface plus the name of the method.  
4116
4117         Notice that using the method.MethodName.GetFullName() does not
4118         work, as it will only contain the name as declared on the source
4119         file (it can be a shorthand in the presence of using statements)
4120         and not the fully qualifed type name, for example:
4121
4122         using System;
4123
4124         class D : ICloneable {
4125                 object ICloneable.Clone ()  {
4126                 }
4127         }
4128
4129         Would produce a method called `ICloneable.Clone' instead of
4130         `System.ICloneable.Clone'.
4131
4132         * namespace.cs (Alias.Resolve): Use GetPartialName.
4133         
4134 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
4135
4136         * cs-parser.jay: Add error 1055 report.
4137
4138 2004-11-01  Miguel de Icaza  <miguel@ximian.com>
4139
4140         * assign.cs (Assign.DoResolve): Only do the transform of
4141         assignment into a New if the types are compatible, if not, fall
4142         through and let the implicit code deal with the errors and with
4143         the necessary conversions. 
4144
4145 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
4146
4147         * cs-parser.jay: Add error 1031 report.
4148
4149         * cs-tokenizer.cs: Add location for error 1038.
4150
4151 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
4152
4153         * cs-parser.jay: Add error 1016 report.
4154
4155 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
4156
4157         * cs-parser.jay: Add errors 1575,1611 report.
4158
4159 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
4160
4161         * cs-parser.jay: Add error 1001 report.
4162
4163 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
4164
4165         Fix #68850
4166         * attribute.cs (GetMarshal): Add method argument for
4167         caller identification.
4168
4169         * class.cs, codegen.cs, enum.cs, parameter.cs: Added
4170         agument for GetMarshal and RuntimeMissingSupport.
4171
4172 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
4173
4174         * attribute.cs (ExtractSecurityPermissionSet): Removed
4175         TypeManager.code_access_permission_type.
4176
4177         * typemanager.cs: Removed TypeManager.code_access_permission_type.
4178
4179 2004-10-27  Miguel de Icaza  <miguel@ximian.com>
4180
4181         * expression.cs (LocalVariableReference.DoResolveLValue): Check
4182         for obsolete use of a variable here.   Fixes regression on errors
4183         cs0619-25 and cs0619-26.
4184
4185 2004-10-27  Marek Safar  <marek.safar@seznam.cz>
4186
4187         Fix #62358, implemented security attribute encoding.
4188
4189         * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
4190         Tests permitted SecurityAction for assembly or other types.
4191         (Assembly.ExtractSecurityPermissionSet): New method. Transforms
4192         data from SecurityPermissionAttribute to PermisionSet class.
4193
4194         * class.cs (ApplyAttributeBuilder): Added special handling
4195         for System.Security.Permissions.SecurityAttribute based types.
4196
4197         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
4198         special handling for System.Security.Permissions.SecurityAttribute
4199         based types.
4200
4201         * enum.cs (ApplyAttributeBuilder): Added special handling
4202         for System.Security.Permissions.SecurityAttribute based types.
4203
4204         * parameter.cs (ApplyAttributeBuilder): Added special handling
4205         for System.Security.Permissions.SecurityAttribute based types.
4206
4207         * rootcontext.cs: Next 2 core types.
4208
4209         * typemanager.cs (TypeManager.security_permission_attr_type):
4210         Built in type for the SecurityPermission Attribute.
4211         (code_access_permission_type): Build in type.
4212
4213 2004-10-17  Miguel de Icaza  <miguel@ximian.com>
4214
4215         * expression.cs (LocalVariableReference.DoResolveBase, Emit):
4216         Remove the tests for `ec.RemapToProxy' from here, and encapsulate
4217         all of this information into
4218         EmitContext.EmitCapturedVariableInstance.
4219         
4220         * codegen.cs (EmitCapturedVariableInstance): move here the
4221         funcionality of emitting an ldarg.0 in the presence of a
4222         remapping.   This centralizes the instance emit code.
4223
4224         (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
4225         then emit a load of this: it means that we have reached the
4226         topmost ScopeInfo: the one that contains the pointer to the
4227         instance of the class hosting the anonymous method.
4228
4229         * anonymous.cs (AddField, HaveCapturedFields): Propagate field
4230         captures to the topmost CaptureContext.
4231
4232 2004-10-12  Miguel de Icaza  <miguel@ximian.com>
4233
4234         * expression.cs (LocalVariableReference): Move the knowledge about
4235         the iterators into codegen's EmitCapturedVariableInstance.
4236
4237 2004-10-11  Miguel de Icaza  <miguel@ximian.com>
4238
4239         * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
4240         all code paths return a value from an anonymous method (it is the
4241         same as the 161 error, but for anonymous methods).
4242
4243 2004-10-08  Miguel de Icaza  <miguel@ximian.com>
4244
4245         The introduction of anonymous methods in the compiler changed
4246         various ways of doing things in the compiler.  The most
4247         significant one is the hard split between the resolution phase
4248         and the emission phases of the compiler.
4249
4250         For instance, routines that referenced local variables no
4251         longer can safely create temporary variables during the
4252         resolution phase: they must do so from the emission phase,
4253         since the variable might have been "captured", hence access to
4254         it can not be done with the local-variable operations from the runtime.
4255         
4256         * statement.cs 
4257
4258         (Block.Flags): New flag `IsTopLevel' to indicate that this block
4259         is a toplevel block.
4260
4261         (ToplevelBlock): A new kind of Block, these are the blocks that
4262         are created by the parser for all toplevel method bodies.  These
4263         include methods, accessors and anonymous methods.
4264
4265         These contain some extra information not found in regular blocks:
4266         A pointer to an optional CaptureContext (for tracking captured
4267         local variables and parameters).  A pointer to the parent
4268         ToplevelBlock.
4269         
4270         (Return.Resolve): Catch missmatches when returning a value from an
4271         anonymous method (error 1662).
4272         Invoke NeedReturnLabel from the Resolve phase instead of the emit
4273         phase.
4274
4275         (Break.Resolve): ditto.
4276
4277         (SwitchLabel): instead of defining the labels during the
4278         resolution phase, we now turned the public ILLabel and ILLabelCode
4279         labels into methods called GetILLabelCode() and GetILLabel() that
4280         only define the label during the Emit phase.
4281
4282         (GotoCase): Track the SwitchLabel instead of the computed label
4283         (its contained therein).  Emit the code by using
4284         SwitchLabel.GetILLabelCode ().
4285
4286         (LocalInfo.Flags.Captured): A new flag has been introduce to track
4287         whether the Local has been captured or not.
4288
4289         (LocalInfo.IsCaptured): New property, used to tell whether the
4290         local has been captured.
4291         
4292         * anonymous.cs: Vastly updated to contain the anonymous method
4293         support.
4294
4295         The main classes here are: CaptureContext which tracks any
4296         captured information for a toplevel block and ScopeInfo used to
4297         track the activation frames for various local variables.   
4298
4299         Each toplevel block has an optional capture context associated
4300         with it.  When a method contains an anonymous method both the
4301         toplevel method and the anonymous method will create a capture
4302         context.   When variables or parameters are captured, they are
4303         recorded on the CaptureContext that owns them, for example:
4304
4305         void Demo () {
4306              int a;
4307              MyDelegate d = delegate {
4308                  a = 1;
4309              }
4310         }
4311
4312         Here `a' will be recorded as captured on the toplevel
4313         CapturedContext, the inner captured context will not have anything
4314         (it will only have data if local variables or parameters from it
4315         are captured in a nested anonymous method.
4316
4317         The ScopeInfo is used to track the activation frames for local
4318         variables, for example:
4319
4320         for (int i = 0; i < 10; i++)
4321                 for (int j = 0; j < 10; j++){
4322                    MyDelegate d = delegate {
4323                         call (i, j);
4324                    }
4325                 }
4326
4327         At runtime this captures a single captured variable `i', but it
4328         captures 10 different versions of the variable `j'.  The variable
4329         `i' will be recorded on the toplevel ScopeInfo, while `j' will be
4330         recorded on a child.  
4331
4332         The toplevel ScopeInfo will also track information like the `this'
4333         pointer if instance variables were referenced (this is necessary
4334         as the anonymous method lives inside a nested class in the host
4335         type of the method). 
4336
4337         (AnonymousMethod): Expanded to track the Toplevel, implement
4338         `AnonymousMethod.Compatible' to tell whether an anonymous method
4339         can be converted to a target delegate type. 
4340
4341         The routine now also produces the anonymous method content
4342
4343         (AnonymousDelegate): A helper class that derives from
4344         DelegateCreation, this is used to generate the code necessary to
4345         produce the delegate for the anonymous method that was created. 
4346
4347         * assign.cs: API adjustments for new changes in
4348         Convert.ImplicitStandardConversionExists.
4349
4350         * class.cs: Adjustments to cope with the fact that now toplevel
4351         blocks are of type `ToplevelBlock'. 
4352
4353         * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
4354         insteda of standard blocks.
4355
4356         Flag errors if params arguments are passed to anonymous methods.
4357
4358         * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
4359         `CurrentAnonymousMethod' which points to the current Anonymous
4360         Method.  The variable points to the AnonymousMethod class that
4361         holds the code being compiled.  It is set in the new EmitContext
4362         created for the anonymous method.
4363
4364         (EmitContext.Phase): Introduce a variable and an enumeration to
4365         assist in enforcing some rules about when and where we are allowed
4366         to invoke certain methods (EmitContext.NeedsReturnLabel is the
4367         only one that enfonces this right now).
4368
4369         (EmitContext.HaveCaptureInfo): new helper method that returns
4370         whether we have a CapturedContext initialized.
4371
4372         (EmitContext.CaptureVariable): New method used to register that a
4373         LocalInfo must be flagged for capturing. 
4374
4375         (EmitContext.CapturedParameter): New method used to register that a
4376         parameters must be flagged for capturing. 
4377         
4378         (EmitContext.CapturedField): New method used to register that a
4379         field must be flagged for capturing. 
4380
4381         (EmitContext.HaveCapturedVariables,
4382         EmitContext.HaveCapturedFields): Return whether there are captured
4383         variables or fields. 
4384
4385         (EmitContext.EmitMethodHostInstance): This is used to emit the
4386         instance for the anonymous method.  The instance might be null
4387         (static methods), this (for anonymous methods that capture nothing
4388         and happen to live side-by-side with the current method body) or a
4389         more complicated expression if the method has a CaptureContext.
4390
4391         (EmitContext.EmitTopBlock): Routine that drives the emission of
4392         code: it will first resolve the top block, then emit any metadata
4393         and then emit the code.  The split is done so that we can extract
4394         any anonymous methods and flag any captured variables/parameters.
4395         
4396         (EmitContext.ResolveTopBlock): Triggers the resolution phase,
4397         during this phase, the ILGenerator should not be used as labels
4398         and local variables declared here might not be accessible to any
4399         code that is part of an anonymous method.  
4400
4401         Exceptions to this include the temporary variables that are
4402         created by some statements internally for holding temporary
4403         variables. 
4404         
4405         (EmitContext.EmitMeta): New routine, in charge of emitting all the
4406         metadata for a cb
4407
4408         (EmitContext.TemporaryReturn): This method is typically called
4409         from the Emit phase, and its the only place where we allow the
4410         ReturnLabel to be defined other than the EmitMeta.  The reason is
4411         that otherwise we would have to duplicate a lot of logic in the
4412         Resolve phases of various methods that today is on the Emit
4413         phase. 
4414
4415         (EmitContext.NeedReturnLabel): This no longer creates the label,
4416         as the ILGenerator is not valid during the resolve phase.
4417
4418         (EmitContext.EmitThis): Extended the knowledge in this class to
4419         work in anonymous methods in addition to iterators. 
4420
4421         (EmitContext.EmitCapturedVariableInstance): This emits whatever
4422         code is necessary on the stack to access the instance to a local
4423         variable (the variable will be accessed as a field).
4424
4425         (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
4426         EmitContext.EmitAddressOfParameter): Routines to support
4427         parameters (not completed at this point). 
4428         
4429         Removals: Removed RemapLocal and RemapLocalLValue.  We probably
4430         will also remove the parameters.
4431
4432         * convert.cs (Convert): Define a `ConstantEC' which points to a
4433         null.  This is just to prefity some code that uses
4434         ImplicitStandardConversion code and do not have an EmitContext
4435         handy.
4436
4437         The idea is to flag explicitly that at that point in time, it is
4438         known that the conversion will not trigger the delegate checking
4439         code in implicit conversions (which requires a valid
4440         EmitContext). 
4441
4442         Everywhere: pass new EmitContext parameter since
4443         ImplicitStandardConversionExists now requires it to check for
4444         anonymous method conversions. 
4445
4446         (Convert.ImplicitStandardConversionExists): If the type of an
4447         expression is the anonymous_method_type, and the type is a
4448         delegate, we invoke the AnonymousMethod.Compatible method to check
4449         whether an implicit conversion is possible. 
4450
4451         (Convert.ImplicitConversionStandard): Only do implicit method
4452         group conversions if the language level is not ISO_1.
4453
4454         * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
4455         MethodInfo for the Invoke method.  used by Delegate and
4456         AnonymousDelegate.
4457
4458         * expression.cs (Binary.DoNumericPromotions): only allow anonymous
4459         method conversions if the target type is a delegate.
4460
4461         Removed extra debugging nops.
4462
4463         (LocalVariableReference): Turn the `local_info' into a public
4464         field. 
4465
4466         Add `prepared' field, the same hack used for FieldExprs to cope
4467         with composed assignments, as Local variables do not necessarily
4468         operate purely on the stack as they used to: they can be captured
4469         fields. 
4470
4471         Add `temp' for a temporary result, like fields.
4472
4473         Refactor DoResolve and DoResolveLValue into DoResolveBase.
4474
4475         It now copes with Local variables that are captured and emits the
4476         proper instance variable to load it from a field in the captured
4477         case. 
4478
4479         (ParameterReference.DoResolveBase): During the resolve phase,
4480         capture parameters if we are in an anonymous method.
4481
4482         (ParameterReference.Emit, ParameterReference.AddressOf): If in an
4483         anonymous method, use the EmitContext helper routines to emit the
4484         parameter reference.
4485
4486         * iterators.cs: Set RemapToProxy to true/false during the
4487         EmitDispose class.
4488
4489         * parameters.cs (GetParameterByName): New helper method. 
4490
4491         * typemanager.cs (anonymous_method_type) a new type that
4492         represents an anonyous method.  This is always an internal type,
4493         used as a fencepost to test against the anonymous-methodness of an
4494         expression. 
4495         
4496 2004-10-20  Marek Safar  <marek.safar@seznam.cz>
4497
4498         * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
4499         561 report.
4500         (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
4501
4502 2004-11-10  Martin Baulig  <martin@ximian.com>
4503
4504         * expression.cs (Invocation.BetterFunction): If two methods have
4505         equal parameter types, but only one of them is generic, the
4506         non-generic one wins.
4507         (New.DoResolve): Don't set `is_struct' to false if we're a generic
4508         instance; just use `Type.IsValueType' to determine whether
4509         something is a struct or not.
4510         (MemberAccess.DoResolveAsTypeStep): Don't modify the `args' field,
4511         so we can be called multiple times.
4512
4513 2004-11-10  Martin Baulig  <martin@ximian.com>
4514
4515         * generic.cs (TypeParameter.DefineConstraints): New public method.
4516         (TypeParameter.CheckAccessLevel): Override this and return true.
4517         (ConstructedType.ResolveType): Renamed to DoResolveType(), don't
4518         override ResolveType() anymore.
4519         (ConstructedType.DoResolveAsTypeStep): Call DoResolveType() here.
4520
4521 2004-11-10  Martin Baulig  <martin@ximian.com>
4522
4523         * rootcontext.cs (RootContext.LookupType): If we're a nested type,
4524         call DeclSpace.ResolveNestedType() on it.
4525
4526 2004-11-10  Martin Baulig  <martin@ximian.com>
4527
4528         * support.cs (ReflectionParameters.ParameterModifier): If `gpd' is
4529         non-null, call ParameterModifier() on it.
4530
4531 2004-11-10  Martin Baulig  <martin@ximian.com>
4532
4533         * iterators.cs
4534         (Iterators): Added `current_type' and `this_type' fields.
4535         (Iterators.DefineIterator): Create a new EmitContext and store it
4536         in `ec'; compute `this_type'.
4537
4538 2004-11-10  Martin Baulig  <martin@ximian.com>
4539
4540         * typemanager.cs
4541         (TypeManager.IsPrivateAccessible): New public method.
4542         (Closure.Filter): Use IsPrivateAccessible() instead of IsEqual().
4543
4544 2004-11-10  Martin Baulig  <martin@ximian.com>
4545
4546         * class.cs (TypeContainer.DefineType): Call
4547         TypeBuilder.DefineGenericParameters() before resolving the type
4548         parameters.
4549         (MethodData.parent_method): New protected field.
4550         (MethodData..ctor): Added `MethodInfo parent_method' argument.
4551         (MethodData.Define): Compute `parent_method'.
4552
4553         * decl.cs
4554         (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
4555         (MemberCore.GetClsCompliantAttributeValue): Likewise.
4556         (DeclSpace.ec): New protected field; store the EmitContext here.
4557         (DeclSpace.EmitContext): New public property.
4558         (DeclSpace.ResolveType): Un-comment from the [Obsolte] attribute.
4559         (DeclSpace.ResolveNestedType): New public method.
4560         (DeclSpace.ResolveTypeExpr): Just call ResolveAsTypeTerminal() here.
4561         (DeclSpace.NestedAccessible): Added `Type tb' argument.
4562         (DeclSpace.FamilyAccessible): Likewise.
4563         (DeclSpace.FindType): Call ResolveNestedType() for nested types.
4564         (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
4565         EmitContext.
4566
4567         * delegate.cs (Delegate.Define): Store the EmitContext in the `ec'
4568         field.
4569
4570         * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
4571         (Enum.Emit): Don't create a new EmitContext.
4572
4573 2004-10-18  Martin Baulig  <martin@ximian.com>
4574
4575         * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
4576         `Type' directly, but call ResolveType() on it.
4577         (Catch.Resolve): Likewise.
4578         (Foreach.Resolve): Likewise.
4579
4580 2004-10-18  Martin Baulig  <martin@ximian.com>
4581
4582         * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
4583         `Type' directly, but call ResolveType() on it.
4584         (Probe.DoResolve): Likewise.
4585         (ArrayCreation.LookupType): Likewise.
4586         (TypeOf.DoResolve): Likewise.
4587         (SizeOf.DoResolve): Likewise.
4588
4589 2004-10-18  Raja R Harinath  <rharinath@novell.com>
4590
4591         * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
4592         the ResolveType.
4593
4594 2004-10-17  John Luke  <john.luke@gmail.com>
4595
4596         * class.cs (Operator.GetSignatureForError): use CSharpName
4597
4598         * parameter.cs (Parameter.GetSignatureForError): Returns
4599         correct name even if was not defined.
4600
4601 2004-10-13  Raja R Harinath  <rharinath@novell.com>
4602
4603         Fix #65816.
4604         * class.cs (TypeContainer.EmitContext): New property.
4605         (DefineNestedTypes): Create an emitcontext for each part.
4606         (MethodCore.DoDefineParameters): Use container's emitcontext.
4607         Pass type array to InternalParameters.
4608         (MemberBase.DoDefine): Use container's emitcontext.
4609         (FieldMember.Define): Likewise.
4610         (Event.Define): Likewise.
4611         (SetMethod.GetParameterInfo): Change argument to EmitContext.
4612         Pass type array to InternalParameters.
4613         (SetIndexerMethod.GetParameterInfo): Likewise.
4614         (SetMethod.Define): Pass emitcontext to GetParameterInfo.
4615         * delegate.cs (Define): Pass emitcontext to
4616         ComputeAndDefineParameterTypes and GetParameterInfo.  Pass type
4617         array to InternalParameters.
4618         * expression.cs (ParameterReference.DoResolveBase): Pass
4619         emitcontext to GetParameterInfo.
4620         (ComposedCast.DoResolveAsTypeStep): Remove check on
4621         ec.ResolvingTypeTree.
4622         * parameter.cs (Parameter.Resolve): Change argument to
4623         EmitContext.  Use ResolveAsTypeTerminal.
4624         (Parameter.GetSignature): Change argument to EmitContext.
4625         (Parameters.ComputeSignature): Likewise.
4626         (Parameters.ComputeParameterTypes): Likewise.
4627         (Parameters.GetParameterInfo): Likewise.
4628         (Parameters.ComputeAndDefineParameterTypes): Likewise.
4629         Re-use ComputeParameterTypes.  Set ec.ResolvingTypeTree.
4630         * support.cs (InternalParameters..ctor): Remove variant that takes
4631         a DeclSpace.
4632         * typemanager.cs (system_intptr_expr): New.
4633         (InitExpressionTypes): Initialize it.
4634
4635 2004-10-12  Chris Toshok  <toshok@ximian.com>
4636
4637         * cs-parser.jay: fix location for try_statement and catch_clause.
4638
4639 2004-10-18  Martin Baulig  <martin@ximian.com>
4640
4641         * class.cs (FieldMember.Define): Don't access the TypeExpr's
4642         `Type' directly, but call ResolveType() on it.
4643         (MemberBase.DoDefine): Likewise.
4644
4645         * expression.cs (New.DoResolve): Don't access the TypeExpr's
4646         `Type' directly, but call ResolveType() on it.
4647         (ComposedCast.DoResolveAsTypeStep): Likewise.
4648
4649         * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
4650         `Type' directly, but call ResolveType() on it.
4651
4652 2004-10-17  John Luke  <john.luke@gmail.com>
4653
4654         * class.cs (Operator.GetSignatureForError): use CSharpName
4655
4656         * parameter.cs (Parameter.GetSignatureForError): Returns
4657         correct name even if was not defined.
4658
4659 2004-10-13  Raja R Harinath  <rharinath@novell.com>
4660
4661         Fix #65816.
4662         * class.cs (TypeContainer.EmitContext): New property.
4663         (DefineNestedTypes): Create an emitcontext for each part.
4664         (MethodCore.DoDefineParameters): Use container's emitcontext.
4665         Pass type array to InternalParameters.
4666         (MemberBase.DoDefine): Use container's emitcontext.
4667         (FieldMember.Define): Likewise.
4668         (Event.Define): Likewise.
4669         (SetMethod.GetParameterInfo): Change argument to EmitContext.
4670         Pass type array to InternalParameters.
4671         (SetIndexerMethod.GetParameterInfo): Likewise.
4672         (SetMethod.Define): Pass emitcontext to GetParameterInfo.
4673         * delegate.cs (Define): Pass emitcontext to
4674         ComputeAndDefineParameterTypes and GetParameterInfo.  Pass type
4675         array to InternalParameters.
4676         * expression.cs (ParameterReference.DoResolveBase): Pass
4677         emitcontext to GetParameterInfo.
4678         (ComposedCast.DoResolveAsTypeStep): Remove check on
4679         ec.ResolvingTypeTree.
4680         * parameter.cs (Parameter.Resolve): Change argument to
4681         EmitContext.  Use ResolveAsTypeTerminal.
4682         (Parameter.GetSignature): Change argument to EmitContext.
4683         (Parameters.ComputeSignature): Likewise.
4684         (Parameters.ComputeParameterTypes): Likewise.
4685         (Parameters.GetParameterInfo): Likewise.
4686         (Parameters.ComputeAndDefineParameterTypes): Likewise.
4687         Re-use ComputeParameterTypes.  Set ec.ResolvingTypeTree.
4688         * support.cs (InternalParameters..ctor): Remove variant that takes
4689         a DeclSpace.
4690         * typemanager.cs (system_intptr_expr): New.
4691         (InitExpressionTypes): Initialize it.
4692
4693 2004-10-12  Chris Toshok  <toshok@ximian.com>
4694
4695         * cs-parser.jay: fix location for try_statement and catch_clause.
4696
4697 2004-10-07  Raja R Harinath  <rharinath@novell.com>
4698
4699         More DeclSpace.ResolveType avoidance.
4700         * decl.cs (MemberCore.InUnsafe): New property.
4701         * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal 
4702         with newly created EmitContext.
4703         (FieldMember.Define): Likewise.
4704         * delegate.cs (Delegate.Define): Likewise.
4705         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
4706         only if normal name-lookup fails.
4707         (TypeExpr.DoResolve): Enable error-checking.
4708         * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
4709         (SizeOf.DoResolve): Likewise.
4710         (ComposedCast.DoResolveAsTypeStep): Likewise.
4711         (StackAlloc.DoResolve): Likewise.
4712         * statement.cs (Block.Flags): Add new flag 'Unsafe'.
4713         (Block.Unsafe): New property.
4714         (Block.EmitMeta): Set ec.InUnsafe as appropriate.
4715         (Unsafe): Set 'unsafe' flag of contained block.
4716         (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
4717         (Fixed.Resolve): Likewise.
4718         (Catch.Resolve): Likewise.
4719         (Using.ResolveLocalVariableDecls): Likewise.
4720         (Foreach.Resolve): Likewise.
4721
4722 2004-10-05  John Luke <john.luke@gmail.com>
4723
4724         * cs-parser.jay: add location to error CS0175
4725
4726 2004-10-04  Miguel de Icaza  <miguel@ximian.com>
4727
4728         * ecore.cs (Expression.Constantity): Add support for turning null
4729         into a constant.
4730
4731         * const.cs (Const.Define): Allow constants to be reference types
4732         as long as the value is Null.
4733
4734 2004-10-04  Juraj Skripsky  <js@hotfeet.ch>
4735
4736         * namespace.cs (NamespaceEntry.Using): No matter which warning
4737         level is set, check if this namespace name has already been added.
4738
4739 2004-10-03 Ben Maurer  <bmaurer@ximian.com>
4740
4741         * expression.cs: reftype [!=]= null should always use br[true,false].
4742         # 67410
4743
4744 2004-10-03  Marek Safar  <marek.safar@seznam.cz>
4745
4746         Fix #67108
4747         * attribute.cs: Enum conversion moved to 
4748         GetAttributeArgumentExpression to be applied to the all
4749         expressions.
4750
4751 2004-10-01  Raja R Harinath  <rharinath@novell.com>
4752
4753         Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
4754         * class.c (TypeContainer.DefineType): Flag error if
4755         base types aren't accessible due to access permissions.
4756         * decl.cs (DeclSpace.ResolveType): Move logic to
4757         Expression.ResolveAsTypeTerminal.
4758         (DeclSpace.ResolveTypeExpr): Thin layer over
4759         Expression.ResolveAsTypeTerminal.
4760         (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
4761         Refactor code into NestedAccess.  Use it.
4762         (DeclSpace.NestedAccess): New.
4763         * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
4764         argument to silence errors.  Check access permissions.
4765         (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
4766         * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
4767         (Cast.DoResolve): Likewise.
4768         (New.DoResolve): Likewise.
4769         (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
4770         (TypeOf.DoResolve): Likewise.
4771
4772         * expression.cs (Invocation.BetterConversion): Return the Type of
4773         the better conversion.  Implement section 14.4.2.3 more faithfully.
4774         (Invocation.BetterFunction): Make boolean.  Make correspondence to
4775         section 14.4.2.2 explicit.
4776         (Invocation.OverloadResolve): Update.
4777         (Invocation): Remove is_base field.
4778         (Invocation.DoResolve): Don't use is_base.  Use mg.IsBase.
4779         (Invocation.Emit): Likewise.
4780
4781 2004-09-24  Marek Safar  <marek.safar@seznam.cz>
4782
4783         * cs-parser.jay: Reverted 642 warning fix.
4784
4785 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
4786
4787         Fix bug #66615
4788         * decl.cs (FindMemberWithSameName): Indexer can have more than
4789         1 argument.
4790
4791 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
4792
4793         * expression.cs (LocalVariableReference.DoResolveLValue):
4794         Do not report warning 219 for out values.
4795         (EmptyExpression.Null): New member to avoid extra allocations.
4796
4797 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
4798
4799         * cs-parser.jay: Fix wrong warning 642 report.
4800
4801         * cs-tokenizer.cs (CheckNextToken): New helper;
4802         Inspect next character if is same as expected.
4803
4804 2004-09-23  Martin Baulig  <martin@ximian.com>
4805
4806         * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
4807         (Convert.ImplicitReferenceConversionExists): Likewise.
4808
4809 2004-11-09  Raja R Harinath  <rharinath@novell.com>
4810
4811         * Makefile (DISTFILES): Comment out a few missing files.
4812
4813 2004-10-29  Raja R Harinath  <rharinath@novell.com>
4814
4815         * Makefile (bootstrap_libs,bootstrap_libfiles): New.
4816         (bootstrap-libs): New target.  Invokes the net_2_0_bootstrap profile.
4817         (gmcs.exe): Invoke bootstrap-libs.
4818         (clean-local): Clean the net_2_0_bootstrap profile too.
4819         (PROGRAM_INSTALL_DIR): New.
4820         (install-local): Use it.
4821
4822 2004-10-13  Martin Baulig  <martin@ximian.com>
4823
4824         * generic.cs (TypeManager.InflatedConstraints): New nested class.
4825         (TypeParameter.DefineType): If we're a method type parameter and
4826         that method is overriding something, "inflate" its constraints.
4827
4828 2004-10-12  Martin Baulig  <martin@ximian.com>
4829
4830         * expression.cs (MemberAccess.DoResolve): If we're a SimpleName
4831         and have type arguments, create and resolve a ConstructedType.
4832
4833 2004-10-12  Martin Baulig  <martin@ximian.com>
4834
4835         * decl.cs (MemberCache.FindMemberToOverride): Use
4836         TypeManager.IsEqual() to compare the parameters and Type.Equals()
4837         to compare the invocationType.
4838
4839         * typemanager.cs (TypeManager.IsEqual): Added support for arrays.
4840         When comparing two type parameters, only do the signature-only
4841         comparision for method type parameters.
4842
4843 2004-10-11  Martin Baulig  <martin@ximian.com>
4844
4845         * report.cs: Don't make --fatal abort on warnings, we have
4846         -warnaserror for that.
4847
4848 2004-10-11  Martin Baulig  <martin@ximian.com>
4849
4850         * typemanager.cs
4851         (TypeManager.IsEqualGenericType): Removed, use IsEqual() instead.
4852         (TypeManager.IsEqual): Call ourself recursively instead of using
4853         Type.IsEqual(). 
4854
4855 2004-10-11  Martin Baulig  <martin@ximian.com>
4856
4857         * class.cs (TypeContainer.DefineType): Only call TypeParameter.Define()
4858         on our own type parameters, not on the ones we inherit from a containing
4859         class.
4860
4861         * expression.cs (Invocation.InferType): Use `==', not `Equals()' for
4862         the comparision.
4863
4864         * generic.cs (TypeParameter.Define): We may only be called once.
4865
4866         * pending.cs (Pending.InterfaceMethod): Call TypeManager.Real_IsEqual()
4867         instead of TypeManager.IsEqual().
4868
4869 2004-09-28  Martin Baulig  <martin@ximian.com>
4870
4871         * generic.cs
4872         (GenericConstraints.EffectiveBaseClass): New public property.
4873         (TypeParameter.GenericConstraints): New public property.
4874         (ConstructedType.CheckConstraints): Improved.
4875
4876         * convert.cs (Convert.TypeParam_EffectiveBaseType): New private method.
4877         (Convert.TypeParameterConversion): New private method; use this in
4878         ImplicitReferenceConversion() and ImplicitReferenceConversionExists()
4879         for all conversions related to type parameters.
4880
4881 2004-09-24  Martin Baulig  <martin@ximian.com>
4882
4883         * convert.cs (Convert.ImplicitReferenceConversion): Added implicit
4884         type parameter conversions for type parameters which are known to
4885         be reference types.
4886
4887 2004-09-24  Martin Baulig  <martin@ximian.com>
4888
4889         * generic.cs (GenericConstraints): Added `IsReferenceType' and
4890         `IsValueType' properties.
4891
4892         * support.cs (ReflectionConstraints): Use
4893         Type.GetGenericParameterConstraints() instead of the old hack.
4894
4895 2004-09-24  Martin Baulig  <martin@ximian.com>
4896
4897         * generic.cs (GenericConstraints): Moved here and made it an
4898         abstract class.
4899
4900         * support.cs (GenericConstraints): Moved to generic.cs.
4901
4902 2004-09-24  Martin Baulig  <martin@ximian.com>
4903
4904         * support.cs
4905         (ReflectionConstraints): Un-nested this class and made it public.
4906
4907         * typemanager.cs
4908         (TypeManager.GetTypeParameterConstraints): New public method.
4909         (TypeManager.HasConstructorConstraint): Use the attributes.
4910
4911 2004-09-24  Martin Baulig  <martin@ximian.com>
4912
4913         * support.cs (GenericConstraints): Replaced `HasConstructor',
4914         `IsReferenceType' and `IsValueType' with `Attributes'.
4915         (ReflectionParameters.ReflectionConstraints): Removed the Create()
4916         method and made the .ctor public.
4917
4918         * generic.cs (Constraints.Attributes): New public property.
4919         (Constraints): Renamed `HasConstructor' -> `HasConstructorConstraint',
4920         `IsReferenceType' -> `HasReferenceTypeConstraint' and
4921         `IsValueType' -> `HasValueTypeConstraint'.
4922
4923 2004-09-23  Martin Baulig  <martin@ximian.com>
4924
4925         * generic.cs (Constraints): Reflect latest runtime changes.
4926
4927 2004-09-23  Martin Baulig  <martin@ximian.com>
4928
4929         * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
4930         (Convert.ImplicitReferenceConversionExists): Likewise.
4931
4932 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
4933
4934         * class.cs (Operator.Define): Add error 448 and 559 report.
4935         
4936 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
4937
4938         * class.cs (MemberBase.IsTypePermitted): New protected
4939         method for checking error CS0610.
4940
4941 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
4942
4943         * class.cs (TypeContainer.HasExplicitLayout): New property
4944         Returns whether container has StructLayout attribute set Explicit.
4945         (FieldMember): New abstract class for consts and fields.
4946         (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
4947         (Field): Reuse FieldMember.
4948
4949         * const.cs (Const): Reuse FieldMember.
4950
4951         * rootcontext.cs: EmitConstants call moved to class.
4952
4953 2004-09-22  Martin Baulig  <martin@ximian.com>
4954
4955         Marek and me just fixed one of our oldest bugs: #28562 :-)
4956
4957         * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
4958
4959         * attribute.cs (Attribute.GetAttributeArgumentExpression): If
4960         we're an EnumConstant, just return that.
4961         (Attribute.Resolve): GetAttributeArgumentExpression() may give us
4962         an EnumConstant.  In this case, we need to use GetValueAsEnumType()
4963         to get the value which'll actually be written into the attribute.
4964         However, we have to use GetValue() to access the attribute's value
4965         in the compiler.        
4966
4967 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
4968
4969         * constant.cs (Constant.IsNegative): New abstract property
4970         IsNegative.
4971
4972         * expression.cs (ArrayAccess.DoResolve): Add warning 251.
4973         (StackAlloc.DoResolve): Reused IsNegative.
4974
4975 2004-09-22  Martin Baulig  <martin@ximian.com>
4976
4977         * typemanager.cs (TypeManager.LookupGenericTypeContainer): New
4978         public method; like LookupTypeContainer, but also works for
4979         generic instances.
4980
4981         * report.cs (Report.SymbolRelatedToPreviousError): Use
4982         TypeManager.LookupGenericTypeContainer().       
4983
4984 2004-09-22  Martin Baulig  <martin@ximian.com>
4985
4986         Thanks to Peter Sestoft for this bug report.
4987
4988         * expression.cs (Conditional): If both the `trueExpr' and the
4989         `falseExpr' is a NullLiteral, return a NullLiteral.
4990
4991 2004-09-22  Martin Baulig  <martin@ximian.com>
4992
4993         * statement.cs (Foreach.EmitCollectionForeach): If we're in an
4994         iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
4995         for the "get_Current" call.
4996
4997 2004-09-21  Martin Baulig  <martin@ximian.com>
4998
4999         * convert.cs (Convert.ImplicitReferenceConversion): When
5000         converting to an interface type, first check whether we're
5001         converting from a reference type.
5002
5003 2004-09-14  Martin Baulig  <martin@ximian.com>
5004
5005         * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
5006
5007 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
5008
5009         Fixed bug #61902
5010         * codegen.cs (TestObsoleteMethodUsage): Trace when method is
5011         called and is obsolete then this member suppress message
5012         when call is inside next [Obsolete] method or type.
5013
5014         * expression.cs: Use TestObsoleteMethodUsage member.
5015
5016 2004-09-14  Martin Baulig  <martin@ximian.com>
5017
5018         * genericparser.cs: Removed.
5019
5020 2004-09-13  Marek Safar  <marek.safar@seznam.cz>
5021
5022         * class.cs (MethodCore.CheckBase): Fix bug #65757.
5023
5024 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
5025
5026         * attribute.cs (Attribute.Resolve): Add error 653 report.
5027
5028         * class.cs (Class.ApplyAttributeBuilder): Add error 641
5029         report.
5030         (Method.ApplyAttributeBuilder): Add error 685 report.
5031         (Operator.Define): Add error 564 report.
5032
5033         * cs-tokenizer.cs (handle_hex): Add error 1013 report.
5034
5035         * expression.cs (Invocation.DoResolve): Add error
5036         245 and 250 report.
5037
5038         * parameter.cs (Parameter.ApplyAttributeBuilder): Add
5039         error 674 report.
5040
5041 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
5042
5043         * class.cs (ConstructorInitializer.Resolve):
5044         Wrong error number (515->516).
5045
5046 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
5047
5048         * class.cs (Indexer.Define): Add error 631 report.
5049
5050 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
5051
5052         * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
5053
5054 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
5055
5056         * expression.cs (Probe.DoResolve): Add error CS0241 report.
5057
5058 2004-09-10  Marek Safar  <marek.safar@seznam.cz>
5059
5060         * cs-parser.jay: Added error CS0241 report.
5061
5062 2004-09-10  Raja R Harinath  <rharinath@novell.com>
5063
5064         * cs-parser.jay (fixed_statement): Introduce a scope for the
5065         declaration in the 'fixed' statement.
5066
5067 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
5068
5069         * cs-parser.jay: Added CS0230 error report.
5070
5071 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
5072
5073         * cs-parser.jay: Added errors CS0231 and CS0257 report.
5074
5075 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
5076
5077         * expression.cs (Argument.Resolve): Added error CS0192 and
5078         CS0199 report.
5079
5080 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
5081
5082         C# 2.0 #pragma warning feature
5083
5084         * cs-tokenizer.cs (PreProcessPragma): New method; 
5085         Handles #pragma directive.
5086
5087         * report.cs (WarningRegions): New class; Support
5088         class for #pragma warning directive. It tests whether
5089         warning is enabled for a given line.
5090
5091 2004-09-08  Miguel de Icaza  <miguel@ximian.com>
5092
5093         * const.cs: Add more descriptive error report, tahnks to
5094         Sebastien. 
5095
5096 2004-09-08  Marek Safar  <marek.safar@seznam.cz>
5097
5098         * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
5099
5100 2004-09-07  Miguel de Icaza  <miguel@ximian.com>
5101
5102         * expression.cs: Apply patch from Ben: Remove dead code from
5103         ArrayCreation, and remove the TurnintoConstant call in const.cs,
5104         as that code just threw an exception anwyays.
5105
5106         * const.cs: Remove the call to the turnintoconstant, for details
5107         see bug: #63144
5108         
5109         * literal.cs: The type of the null-literal is the null type;  So
5110         we use a placeholder type (literal.cs:System.Null, defined here)
5111         for it.
5112
5113         * expression.cs (Conditional.DoResolve): Remove some old code that
5114         is no longer needed, conversions have been fixed.
5115
5116         (ArrayCreationExpression.DoResolve): Return false if we fail to
5117         resolve the inner expression.
5118
5119 2004-09-07  Raja R Harinath  <rharinath@novell.com>
5120
5121         Fix test-290.cs.
5122         * cs-parser.jay (delegate_declaration): Record a delegate
5123         declaration as a type declaration.
5124         Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
5125
5126 2004-09-06  Miguel de Icaza  <miguel@ximian.com>
5127
5128         * parameter.cs: Do not crash if the type can not be resolved. 
5129
5130         * expression.cs: Report errors with unsafe pointers, fixes #64896
5131
5132 2004-09-06 Ben Maurer  <bmaurer@users.sourceforge.net>
5133
5134         * expression.cs: Pointer arith always needs to do a conv.i
5135         if the operand is a long. fix 65320
5136
5137 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
5138
5139         Fixed cs0619-37.cs, cs0619-38.cs
5140
5141         * enum.cs (GetObsoleteAttribute): Removed.
5142
5143         * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
5144         on Enum member is double staged. The first is tested member
5145         and then enum.
5146
5147 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
5148
5149         Fixed #56986, #63631, #65231
5150
5151         * class.cs: (TypeContainer.AddToMemberContainer): New method,
5152         adds member to name container.
5153         (TypeContainer.AddToTypeContainer): New method, adds type to
5154         name container.
5155         (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
5156         AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
5157         AddOperator): Simplified by reusing AddToMemberContainer.
5158         (TypeContainer.UserDefinedStaticConstructor): Changed to property
5159         instead of field.
5160         (Method.CheckForDuplications): Fixed implementation to test all
5161         possibilities.
5162         (MemberBase): Detection whether member is explicit interface
5163         implementation is now in constructor.
5164         (MemberBase.UpdateMemberName): Handles IndexerName.
5165         (Accessor): Changed to keep also location information.
5166         (AbstractPropertyEventMethod): Is derived from MemberCore.
5167         (AbstractPropertyEventMethod.IsDummy): Says whether accessor
5168         will be emited or not.
5169         (PropertyBase.AreAccessorsDuplicateImplementation):
5170         Tests whether accessors are not in collision with some method.
5171         (Operator): Is derived from MethodCore to simplify common
5172         operations.
5173
5174         * decl.cs (Flags.TestMethodDuplication): Test for duplication
5175         must be performed.
5176         (DeclSpace.AddToContainer): Adds the member to defined_names
5177         table. It tests for duplications and enclosing name conflicts.
5178
5179         * enum.cs (EnumMember): Clean up to reuse the base structures
5180
5181 2004-09-03  Martin Baulig  <martin@ximian.com>
5182
5183         Merged latest changes into gmcs.  Please keep this comment in
5184         here, it makes it easier for me to see what changed in MCS since
5185         the last time I merged.
5186
5187 2004-09-03  Martin Baulig  <martin@ximian.com>
5188
5189         * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
5190         into TypeContainer, to make partial classes work again.
5191
5192 2004-09-03  Martin Baulig  <martin@ximian.com>
5193
5194         * rootcontext.cs (RootContext.V2): Removed.
5195
5196 2004-03-23  Martin Baulig  <martin@ximian.com>
5197
5198         * expression.cs (Invocation.OverloadResolve): Added `bool
5199         may_fail' argument and use it instead of the Location.IsNull() hack.
5200
5201 2004-09-09  Martin Baulig  <martin@ximian.com>
5202
5203         * cs-parser.jay (namespace_declaration): Fixed CS0134 reporting.
5204
5205 2004-09-09  Martin Baulig  <martin@ximian.com>
5206
5207         * generic.cs (TypeParameter.DefineType): Added support for
5208         explicit interface methods.
5209
5210 2004-09-09  Martin Baulig  <martin@ximian.com>
5211
5212         * README.Changes: New document.  Started to list important changes
5213         between MCS and GMCS here.
5214
5215 2004-09-08  Martin Baulig  <martin@ximian.com>
5216
5217         * class.cs
5218         (TypeContainer.CheckRecursiveDefinition): New protected method.
5219         (TypeContainer.DefineType): Move the CS0146 check into
5220         CheckRecursiveDefinition().     
5221
5222 2004-09-06  Martin Baulig  <martin@ximian.com>
5223
5224         * generic.cs (ConstructedType.CheckConstraints): Allow builtin
5225         types for the constructor constraint.
5226
5227 2004-09-03  Martin Baulig  <martin@ximian.com>
5228
5229         * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
5230         into TypeContainer, to make partial classes work again.
5231
5232 2004-09-03  Martin Baulig  <martin@ximian.com>
5233
5234         * rootcontext.cs (RootContext.V2): Removed.
5235
5236 2004-03-23  Martin Baulig  <martin@ximian.com>
5237
5238         * expression.cs (Invocation.OverloadResolve): Added `bool
5239         may_fail' argument and use it instead of the Location.IsNull() hack.
5240
5241 2004-09-03  Martin Baulig  <martin@ximian.com>
5242
5243         Merged latest changes into gmcs.  Please keep this comment in
5244         here, it makes it easier for me to see what changed in MCS since
5245         the last time I merged.
5246
5247 2004-09-03  Raja R Harinath  <rharinath@novell.com>
5248
5249         Fix #61128.
5250         * expression.cs (BetterConversion): Don't allow either conversion 
5251         to be null.  Remove redundant implicit conversion test when 'q ==
5252         null' -- when this function is invoked, we already know that the
5253         implicit conversion exists.
5254         (BetterFunction): Assume that 'best' is non-null.  Remove
5255         redundant reimplementation of IsApplicable when 'best' is null.
5256         (IsParamsMethodApplicable, IsApplicable): Add new parameter for
5257         number of arguments.
5258         (IsAncestralType): Extract from OverloadResolve.
5259         (OverloadResolve): Make robust to the MethodGroupExpr being
5260         unsorted.  Implement all the logic of Section 14.5.5.1, and
5261         support overloading of methods from multiple applicable types.
5262         Clean up logic somewhat.  Don't pass null methods to BetterFunction.
5263
5264         * report.cs (SymbolRelatedToPreviousError): Cleanup output.
5265         (RealError, Warning): Append type of report to related symbol.
5266
5267 2004-09-03  Marek Safar  <marek.safar@seznam.cz>
5268
5269         * enum.cs: Fixed CLS-Compliance checks for enum members.
5270         Error tests cs3008-8.cs, cs3014-8.cs
5271
5272 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
5273
5274         Fixed bug #62342, #63102
5275         * class.cs: ImplementIndexer uses member.IsExplicitImpl
5276         like ImplementMethod.
5277
5278 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
5279
5280         * attribute.cs (Attribute.GetAttributeArgumentExpression):
5281         Fixed bug #65170.
5282
5283 2004-09-02  Martin Baulig  <martin@ximian.com>
5284
5285         * statement.cs (Using.EmitLocalVariableDeclFinally): Use
5286         TypeManager.GetArgumentTypes() rather than calling GetParameters()
5287         on the MethodBase.
5288
5289 2004-09-01  Marek Safar  <marek.safar@seznam.cz>
5290
5291         C# 2.0 Static classes implemented
5292
5293         * class.cs (TypeContainer): instance_constructors,
5294         initialized_fields, initialized_static_fields,
5295         default_constructor, base_inteface_types are protected to be
5296         accessible from StaticClass.
5297         (TypeContainer.DefineDefaultConstructor): New virtual method
5298         for custom default constructor generating
5299         (StaticClass): New class to handle "Static classes" feature.
5300
5301         * cs-parser.jay: Handle static keyword on class like instance
5302         of StaticClass.
5303
5304         * driver.cs: Added "/langversion" command line switch with two
5305         options (iso-1, default).
5306
5307 2004-08-31  Marek Safar  <marek.safar@seznam.cz>
5308
5309         * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
5310
5311 2004-08-31  Miguel de Icaza  <miguel@ximian.com>
5312
5313         * delegate.cs: Style.
5314
5315 2004-08-31 Ben Maurer  <bmaurer@users.sourceforge.net>
5316
5317         * delegate.cs: Add seperate instance expr field for miguel.
5318
5319 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
5320
5321         * PointerArithmetic (Resolve): make sure we are not doing
5322         pointer arith on void*. Also, make sure we are resolved
5323         by not setting eclass until resolve.
5324
5325         All callers: Make sure that PointerArithmetic gets resolved.
5326
5327 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
5328
5329         * ArrayCreation (LookupType): If the type does not resolve 
5330         to an array, give an error.
5331
5332 2004-08-27  Marek Safar  <marek.safar@seznam.cz>
5333
5334         * statement.cs (Try.Resolve): Fixed bug #64222
5335
5336 2004-08-27  Martin Baulig  <martin@ximian.com>
5337
5338         * class.cs
5339         (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
5340         crash here.     
5341
5342 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
5343
5344         * ecore.cs (Constantify): Get underlying type via
5345         System.Enum.GetUnderlyingType to avoid StackOverflow on the
5346         Windows in special cases.
5347
5348 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
5349
5350         * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
5351         for obtaining also private methods.
5352         (GetRemoveMethod): Used GetRemoveMethod (true)
5353         for obtaining also private methods.
5354
5355 2004-09-02  Martin Baulig  <martin@ximian.com>
5356
5357         * statement.cs (Using.EmitLocalVariableDeclFinally): Use
5358         TypeManager.GetArgumentTypes() rather than calling GetParameters()
5359         on the MethodBase.
5360
5361 2004-08-27  Martin Baulig  <martin@ximian.com>
5362
5363         * class.cs
5364         (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
5365         crash here.     
5366
5367 2004-08-25  Martin Baulig  <martin@ximian.com>
5368
5369         * support.cs (ReflectionParameters..ctor): If this is a generic
5370         method, retrieve and store its type parameters.
5371         (InternalParameters..ctor): Added `TypeParameter[]' argument.
5372         (ReflectionParameters.GenericConstraints): The argument specifies
5373         the type parameter, not the method parameter.
5374         (InternalParameters.GenericConstraints): Likewise.
5375
5376         * generic.cs (TypeParameter.DefineType): Correctly handle
5377         constraints wrt. generic methods in interfaces and their
5378         implementations.        
5379
5380 2004-08-24  Martin Baulig  <martin@ximian.com>
5381
5382         * generic.cs (TypeParameter.IsSubclassOf): New public method.
5383         (Constraints.IsSubclassOf): New internal method.
5384
5385         * typemanager.cs (TypeManager.FindMembers): Added special support
5386         for GenericTypeParameterBuilder's.      
5387         (TypeManager.IsSubclassOf, IsFamilyAccessible): Added support for
5388         type parameters.
5389
5390 2004-08-24  Martin Baulig  <martin@ximian.com>
5391
5392         * typemanager.cs
5393         (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
5394         this for accessibility checks.
5395         (TypeManager.IsSubclassOrNestedChildOf): Renamed to
5396         IsNestedFamilyAccessible.
5397         (TypeManager.IsSubclassOf): New method, do what the name actually
5398         says.   
5399
5400 2004-08-24  Martin Baulig  <martin@ximian.com>
5401
5402         * expression.cs (MemberAccess.DoResolve): When resolving ourselves
5403         as a SimpleName, include the generic arity.
5404
5405 2004-08-24  Martin Baulig  <martin@ximian.com>
5406
5407         * class.cs (Method.Define): Set MethodAttributes.SpecialName and
5408         MethodAttributes.HideBySig for operators.
5409
5410 2004-08-23  Martin Baulig  <martin@ximian.com>
5411
5412         Back to the old error reporting system :-)
5413
5414         * report.cs (Message): Removed.
5415         (Report.MessageData, ErrorData, WarningData): Removed.
5416         (Report.Error, Warning): Back to the old system.
5417
5418 2004-08-23  Martin Baulig  <martin@ximian.com>
5419
5420         * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
5421
5422         * class.cs (TypeContainer.ParentContainer): New public virtual
5423         method; replaces the explicit interface implementation.
5424         (ClassPart.ParentContainer): Override.
5425
5426 2004-08-23  Martin Baulig  <martin@ximian.com>
5427
5428         * statement.cs (Switch): Added support for constant switches; see
5429         #59428 or test-285.cs.
5430
5431 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
5432
5433         Fixed bug #62740.
5434         * statement.cs (GetEnumeratorFilter): Removed useless
5435         logic because C# specs is strict. GetEnumerator must be
5436         public.
5437
5438 2004-08-22  Martin Baulig  <martin@ximian.com>
5439
5440         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
5441         a switch and may break, reset the barrier.  Fixes #59867.
5442
5443 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
5444
5445         CLS-Compliance speed up (~5% for corlib)
5446
5447         * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
5448         New method. Tests container for CLS-Compliant names
5449
5450         * class.cs (TypeContainer.VerifyClsName): New method.
5451         Checks whether container name is CLS Compliant.
5452         (Constructor): Implements IMethodData.
5453
5454         * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
5455         low-case table for CLS Compliance test.
5456         (MemberCache.VerifyClsParameterConflict): New method.
5457         Checks method parameters for CS3006 error.
5458
5459         * enum.cs (EnumMember): Is derived from MemberCore.
5460         (Enum.VerifyClsName): Optimized for better performance.
5461
5462 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
5463
5464         * report.cs: Renamed Error_T to Error and changed all
5465         references.
5466
5467 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
5468
5469         * class.cs (TypeContainer.IndexerArrayList): New inner class
5470         container for indexers.
5471         (TypeContainer.DefaultIndexerName): New constant for default
5472         indexer name. Replaced all "Item" with this constant.
5473         (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
5474
5475         * typemanager.cs (TypeManager.default_member_ctor): Cache here
5476         DefaultMemberAttribute constructor.
5477
5478 2004-08-05  Martin Baulig  <martin@ximian.com>
5479
5480         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
5481         Fix bug #59429.
5482
5483 2004-08-05  Marek Safar  <marek.safar@seznam.cz>
5484
5485         * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
5486         multi platforms problem.
5487
5488         * compiler.csproj: Included shared files.
5489
5490 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
5491
5492         Fix bug 60333, 55971 in the more general way
5493         * attribute.cs (Attribute.GetAttributeArgumentExpression):
5494         Added arg_type argument for constant conversion.
5495         (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
5496
5497 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
5498
5499         Fix bug #59760
5500         * class.cs (TypeContainer ): New inner classes MethodArrayList, 
5501         OperatorArrayList, MethodCoreArrayList for typecontainer
5502         containers. Changed class member types to these new types.
5503         (MethodArrayList.DefineMembers): Added test for CS0659.
5504
5505 2004-08-04  Miguel de Icaza  <miguel@ximian.com>
5506
5507         * cfold.cs: Synchronize the folding with the code in expression.cs
5508         Binary.DoNumericPromotions for uint operands.
5509
5510         * attribute.cs: Revert patch from Raja, it introduced a regression
5511         while building Blam-1.2.1 (hard to isolate a test case).
5512
5513 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
5514
5515         Fix for #55382
5516         * class.cs:
5517         (TypeContainer.Define): Renamed to DefineContainerMembers because of
5518         name collision.
5519         (MethodCore.parent_method): New member. The method we're overriding
5520         if this is an override method.
5521         (MethodCore.CheckBase): Moved from Method class and made common.
5522         (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
5523         private.
5524         (MethodCore.CheckForDuplications): New abstract method. For custom
5525         member duplication search in a container
5526         (MethodCore.FindOutParentMethod): New abstract method. Gets parent
5527         method and its return type.
5528         (Event.conflict_symbol): New member. Symbol with same name in the
5529         parent class.
5530
5531         * decl.cs:
5532         (MemberCache.FindMemberWithSameName): New method. The method
5533         is looking for conflict with inherited symbols.
5534
5535 2004-08-04  Martin Baulig  <martin@ximian.com>
5536
5537         * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
5538
5539         * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
5540
5541 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
5542
5543         * report.cs (Message): New enum for better error, warning reference in
5544         the code.
5545         (MessageData): New inner abstract class. It generally handles printing of
5546         error and warning messages.
5547         Removed unused Error, Warning, Message methods.
5548
5549 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
5550
5551         Fix for cs0592-8.cs test
5552         * attribute.cs
5553         (Attributable.ValidAttributeTargets): Made public.
5554         (Attribute.ExplicitTarget): New member for explicit target value.
5555         (Attribute.CheckTargets): Now we translate explicit attribute
5556         target to Target here.
5557
5558 2004-08-03  Ben Maurer  <bmaurer@ximian.com>
5559
5560         * ecore.cs (MethodGroupExpr): new IsBase property.
5561
5562         * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
5563
5564         * delegate.cs (DelegateCreation): store a MethodGroupExpr
5565         rather than an instance expr.
5566
5567         (DelegateCreation.Emit): Use the method group rather than
5568         the instance expression. Also, if you have base.Foo as the
5569         method for a delegate, make sure to emit ldftn, not ldftnvirt.
5570
5571         (ResolveMethodGroupExpr): Use the MethodGroupExpr. 
5572
5573         (NewDelegate.DoResolve): Only check for the existance of Invoke
5574         if the method is going to be needed. Use MethodGroupExpr.
5575
5576         (NewDelegate.Emit): Remove, DelegateCreation implements this.   
5577
5578         * expression.cs: For pointer arith., make sure to use
5579         the size of the type, not the size of the pointer to
5580         the type.
5581
5582 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
5583
5584         Fix for #60722
5585         * class.cs (Class): Added error CS0502 test.
5586
5587 2004-08-03  John Luke  <jluke@cfl.rr.com>
5588             Raja R Harinath  <rharinath@novell.com>
5589
5590         Fix for #60997.
5591         * attribute.cs (Attribute.complained_before): New flag.
5592         (Attribute.ResolveType, Attribute.Resolve),
5593         (Attribute.DefinePInvokeMethod): Set it.
5594         (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
5595         
5596 2004-08-03  Martin Baulig  <martin@ximian.com>
5597
5598         * expression.cs (Binary.ResolveOperator): Don't abort if we can't
5599         use a user-defined operator; we still need to do numeric
5600         promotions in case one argument is a builtin type and the other
5601         one has an implicit conversion to that type.  Fixes #62322.
5602
5603 2004-08-18  Martin Baulig  <martin@ximian.com>
5604
5605         * class.cs (Method.Define): Use the correct method name when
5606         creating the MethodBuilder for a generic method.
5607
5608 2004-08-17  Martin Baulig  <martin@ximian.com>
5609
5610         * generic.cs (Constraints): Support type parameter constraints.
5611
5612 2004-08-16  Martin Baulig  <martin@ximian.com>
5613
5614         * cs-tokenizer.cs (Tokenizer.TypeOfParsing): New public property.
5615         (Token.GENERIC_DIMENSION): New token; this is returned if we
5616         encounter an unbound generic type in a typeof() expression.
5617
5618         * cs-parser.jay (opt_type_argument_list): Added GENERIC_DIMENSION;
5619         this token is only generated while parsing a typeof() expression.
5620         (typeof_expression): Removed the old unbound_type hack.
5621
5622         * generic.cs (TypeArguments.IsUnbound): New public property.
5623
5624         * decl.cs (MemberName): Added support for unbound types.
5625
5626 2004-08-14  Martin Baulig  <martin@ximian.com>
5627
5628         * typemanager.cs
5629         (TypeManager.IsEqualGenericInstance): New static method.
5630         (TypeManager.IsSubclassOrNestedChildOf, IsSubclassOf): This is
5631         just used to check accessibility, so follow the rules of 26.1.6.        
5632
5633         * expression.cs (MemberAccess.ResolveAsTypeStep): Return a
5634         ConstructedType instead of a TypeExpression if we have type arguments.
5635
5636         * cs-parser.jay (typeof_expression): Support unbound generic types.
5637
5638         * ecore.cs (UnboundTypeExpression): New public class.
5639
5640 2004-08-12  Martin Baulig  <martin@ximian.com>
5641
5642         * typemanager.cs (TypeManager.IsNestedChildOf): Use
5643         TypeManager.IsEqual() rather than `=='.
5644
5645         * decl.cs (DeclSpace.CheckAccessLevel): Use `tb.FullName' for
5646         generic instances as well.
5647
5648 2004-08-12  Martin Baulig  <martin@ximian.com>
5649
5650         * expression.cs (Invocation.InferType): We can only infer method
5651         type parameters.  Fixes #62647.
5652
5653 2004-08-11  Martin Baulig  <martin@ximian.com>
5654
5655         * class.cs (TypeContainer.DefineType): Create the TypeBuilder
5656         before resolving the base classes.
5657
5658 2004-08-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
5659
5660         * Makefile: install .mdb file too.
5661
5662 2004-08-05  Martin Baulig  <martin@ximian.com>
5663
5664         * ecore.cs (FieldExpr.DoResolveLValue): If we're resolving a field
5665         initializer, the current type is just the TypeBuilder, not the
5666         instantiated generic type.
5667         (FieldExpr.IsFieldInitializer): New public property.
5668
5669 2004-08-04  Martin Baulig  <martin@ximian.com>
5670
5671         * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
5672
5673         * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
5674
5675 2004-08-03  Martin Baulig  <martin@ximian.com>
5676
5677         * class.cs (MethodData.Define): If we're an explicit
5678         implementation, remove the generic arity from the type name.
5679
5680 2004-08-03  Martin Baulig  <martin@ximian.com>
5681
5682         * expression.cs (Binary.ResolveOperator): Don't abort if we can't
5683         use a user-defined operator; we still need to do numeric
5684         promotions in case one argument is a builtin type and the other
5685         one has an implicit conversion to that type.  Fixes #62322.
5686
5687 2004-08-02  Martin Baulig  <martin@ximian.com>
5688
5689         * class.cs (TypeContainer.ifaces): Make this a `Type[]', not a
5690         `TypeExpr[]' array.
5691         (TypeContainer.GetClassBases): Return the unexpanded list of
5692         interfaces; we expand them later.
5693         (TypeContainer.DefineType): After creating the TypeBuilder, call
5694         TypeManager.ExpandInterfaces() to get an expanded and resolved
5695         list of interfaces.
5696
5697         * ecore.cs (TypeExpr.GetInterfaces): Removed
5698
5699         * generics.cs (Constraints.InterfaceConstraints): Remove.
5700         (TypeParameter.DefineType): Call TypeManager.RegisterBuilder() to
5701         register the interface constraints.
5702
5703         * typemanager.cs
5704         (TypeManager.AddUserType): Removed the `ifaces' argument.
5705         (TypeManager.AddTypeParameter): Likewise.
5706         (TypeManager.AddUserInterface): Removed, was unused.
5707         (TypeManager.RegisterBuilder): Take a `Type[]' instead of a
5708         `TypeExpr[]' array for the interfaces.
5709         (TypeManager.ExpandInterfaces): Call this after the TypeBuilder
5710         has been defined, returns a list of the resolved interfaces types.
5711         (TypeManager.GetInterfaces): Return a `Type[]', not a `TypeExpr[]'.
5712         (TypeManager.GetExplicitInterfaces): Likewise.  
5713
5714 2004-08-02  Martin Baulig  <martin@ximian.com>
5715
5716         * expression.cs (Invocation.EmitCall): If we're invoking a method
5717         on a type parameter, use the new `Constrained' prefix opcode.
5718
5719 2004-08-02  Martin Baulig  <martin@ximian.com>
5720
5721         * statement.cs (LocalInfo.Flags): Added `IsThis'.
5722         (LocalInfo.IsThis): New public property.
5723         (Block.EmitMeta): Don't create a LocalBuilder for `this'.
5724
5725 2004-08-01  Martin Baulig  <martin@ximian.com>
5726
5727         * class.cs (TypeContainer.GetClassBases): Don't set the default
5728         here since we may get called from GetPartialBases().
5729         (TypeContainer.DefineType): If GetClassBases() didn't return a
5730         parent, use the default one.
5731
5732 2004-07-30  Martin Baulig  <martin@ximian.com>
5733
5734         * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
5735
5736         * class.cs (SourceMethod): New public class, derive from the
5737         symbol writer's ISourceMethod.
5738         (Method): Use the new symbol writer API.
5739
5740         * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
5741         as argument and use the new symbol writer.
5742
5743         * location.cs
5744         (SourceFile): Implement the symbol writer's ISourceFile.
5745         (Location.SymbolDocument): Removed.
5746         (Location.SourceFile): New public property.
5747
5748         * symbolwriter.cs: Use the new symbol writer API.
5749
5750 2004-07-30  Raja R Harinath  <rharinath@novell.com>
5751
5752         * Makefile (install-local): Remove.  Functionality moved to
5753         executable.make.
5754
5755 2004-07-28  Lluis Sanchez Gual  <lluis@novell.com>
5756
5757         * Makefile: Install mcs.exe.config file together with mcs.exe.
5758         * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
5759         correct runtime version.
5760         
5761 2004-07-25  Martin Baulig  <martin@ximian.com>
5762
5763         * class.cs
5764         (TypeContainer.RegisterOrder): Removed, this was unused.
5765         (TypeContainer, interface_order): Removed.
5766         (TypeContainer.AddClass, AddStruct, AddInterface): Take a
5767         TypeContainer as argument since we can also be called with a
5768         `PartialContainer' for a partial class/struct/interface.
5769         (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
5770         of checking whether we're an `Interface' - we could be a
5771         `PartialContainer'.
5772         (PartialContainer.Register): Override; call
5773         AddClass()/AddStruct()/AddInterface() on our parent.
5774
5775         * cs-parser.jay (interface_member_declaration): Add things to the
5776         `current_container', not the `current_class'.
5777
5778         * rootcontext.cs (RegisterOrder): The overloaded version which
5779         takes an `Interface' was unused, removed.
5780
5781         * typemanager.cs (TypeManager.LookupInterface): Return a
5782         `TypeContainer', not an `Interface'.
5783         (TypeManager.IsInterfaceType): The `builder_to_declspace' may
5784         contain a `PartialContainer' for an interface, so check it's
5785         `Kind' to figure out what it is.
5786
5787 2004-07-25  Martin Baulig  <martin@ximian.com>
5788
5789         * class.cs (Class.DefaultTypeAttributes): New public constant.
5790         (Struct.DefaultTypeAttributes): Likewise.
5791         (Interface.DefaultTypeAttributes): Likewise.
5792         (PartialContainer.TypeAttr): Override this and add the
5793         DefaultTypeAttributes.
5794
5795 2004-07-25  Martin Baulig  <martin@ximian.com>
5796
5797         * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
5798         we can just use the `Parent' field instead.
5799
5800 2004-07-25  Martin Baulig  <martin@ximian.com>
5801
5802         * class.cs (TypeContainer.Emit): Renamed to EmitType().
5803
5804 2004-07-25  Martin Baulig  <martin@ximian.com>
5805
5806         * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
5807         our parts before defining any methods.
5808         (TypeContainer.VerifyImplements): Make this virtual.
5809         (ClassPart.VerifyImplements): Override and call VerifyImplements()
5810         on our PartialContainer.
5811
5812 2004-07-25  Martin Baulig  <martin@ximian.com>
5813
5814         * iterators.cs (Iterator.Define): Renamed to DefineIterator().
5815
5816         * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
5817         argument, we can just use the `Parent' field instead.
5818
5819         * class.cs
5820         (MemberBase.CheckBase): Removed the `TypeContainer' argument.   
5821         (MemberBase.DoDefine): Likewise.
5822
5823 2004-07-24  Martin Baulig  <martin@ximian.com>
5824
5825         * decl.cs (MemberCore.Parent): New public field.
5826         (DeclSpace.Parent): Moved to MemberCore.
5827
5828         * class.cs (MethodCore.ds): Removed; use `Parent' instead.
5829         (MemberBase.ctor): Added TypeContainer argument, pass it to our
5830         parent's .ctor.
5831         (FieldBase, Field, Operator): Likewise.
5832         (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
5833         (EventField, Event): Likewise.
5834
5835 2004-07-23  Martin Baulig  <martin@ximian.com>
5836
5837         * class.cs (PartialContainer): New public class.
5838         (ClassPart): New public class.
5839         (TypeContainer): Added support for partial classes.
5840         (TypeContainer.GetClassBases): Splitted some of the functionality
5841         out into GetNormalBases() and GetPartialBases().
5842
5843         * cs-tokenizer.cs (Token.PARTIAL): New token.
5844         (Tokenizer.consume_identifier): Added some hacks to recognize
5845         `partial', but only if it's immediately followed by `class',
5846         `struct' or `interface'.
5847
5848         * cs-parser.jay: Added support for partial clases.
5849
5850 2004-07-23  Martin Baulig  <martin@ximian.com>
5851
5852         * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
5853         a `DeclSpace' and also made it readonly.
5854         (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
5855         (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
5856         (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
5857
5858         * cs-parser.jay: Pass the `current_class', not the
5859         `current_container' (at the moment, this is still the same thing)
5860         to a new Method, Property, Event, Indexer or Constructor.
5861
5862 2004-07-23  Martin Baulig  <martin@ximian.com>
5863
5864         * cs-parser.jay (CSharpParser): Added a new `current_class' field
5865         and removed the `current_interface' one.
5866         (struct_declaration, class_declaration, interface_declaration):
5867         Set `current_class' to the newly created class/struct/interface;
5868         set their `Bases' and call Register() before parsing their body.
5869
5870 2004-07-23  Martin Baulig  <martin@ximian.com>
5871
5872         * class.cs (Kind): New public enum.
5873         (TypeContainer): Made this class abstract.
5874         (TypeContainer.Kind): New public readonly field.
5875         (TypeContainer.CheckDef): New public method; moved here from
5876         cs-parser.jay.
5877         (TypeContainer.Register): New public abstract method.
5878         (TypeContainer.GetPendingImplementations): New public abstract
5879         method.
5880         (TypeContainer.GetClassBases): Removed the `is_class' and
5881         `is_iface' parameters.
5882         (TypeContainer.DefineNestedTypes): Formerly known as
5883         DoDefineType().
5884         (ClassOrStruct): Made this class abstract.
5885
5886         * tree.cs (RootTypes): New public type. 
5887
5888 2004-07-20  Martin Baulig  <martin@ximian.com>
5889
5890         * tree.cs (Tree.RecordNamespace): Removed.
5891         (Tree.Namespaces): Removed.
5892
5893         * rootcontext.cs (RootContext.IsNamespace): Removed.
5894
5895         * cs-parser.jay (namespace_declaration): Just create a new
5896         NamespaceEntry here.
5897
5898 2004-07-21  Lluis Sanchez Gual  <lluis@novell.com>
5899
5900         * Makefile: Install gmcs.exe.config file together with gmcs.exe.
5901         * gmcs.exe.config: Renamed from mcs.exe.config. Added supportedRuntime
5902         entry to make sure it runs in the correct runtime version.
5903         
5904 2004-07-18  Martin Baulig  <martin@ximian.com>
5905
5906         * generic.cs (ConstructedType.CheckConstraints): Improved
5907         constraints checking.
5908
5909 2004-07-18  Martin Baulig  <martin@ximian.com>
5910
5911         * expression.cs (Invocation.BetterMethod): Call
5912         TypeManager.TypeToCoreType() on all types and removed my previous
5913         hack; we're already doig the right thing here.
5914
5915 2004-07-17  Martin Baulig  <martin@ximian.com>
5916
5917         * decl.cs (MemberName.MakeName): Create the "class`1" names here.
5918
5919 2004-07-16  Martin Baulig  <martin@ximian.com>
5920
5921         * iterators.cs: Added generics support.
5922
5923 2004-07-16  Martin Baulig  <martin@ximian.com>
5924
5925         * iterators.cs: Rewrote this.  We're now using one single Proxy
5926         class for both the IEnumerable and the IEnumerator interface and
5927         `Iterator' derives from Class so we can use the high-level API.
5928
5929         * class.cs (TypeContainer.AddIterator): New method.
5930         (TypeContainer.DoDefineType): New protected virtual method, which
5931         is called from DefineType().
5932         (TypeContainer.DoDefineMembers): Call DefineType() and
5933         DefineMembers() on all our iterators.
5934         (TypeContainer.Emit): Call Emit() on all our iterators.
5935         (TypeContainer.CloseType): Call CloseType() on all our iterators.
5936
5937         * codegen.cs (EmitContext.CurrentIterator): New public field.
5938
5939 2004-07-15  Martin Baulig  <martin@ximian.com>
5940
5941         * typemanager.cs
5942         (TypeManager.not_supported_exception_type): New type.   
5943
5944 2004-07-14  Martin Baulig  <martin@ximian.com>
5945
5946         * typemanager.cs
5947         (TypeManager.generic_ienumerable_type): New type.
5948         (TypeManager.generic_ienumerator_type): New type.
5949
5950         * rootcontext.cs
5951         (RootContext.interfaces_first_stage): Added
5952         "System.Collections.Generic.IEnumerator`1" and
5953         "System.Collections.Generic.IEnumerable`1".     
5954
5955 2004-07-14  Martin Baulig  <martin@ximian.com>
5956
5957         * iterators.cs: Use real error numbers.
5958
5959 2004-07-14  Martin Baulig  <martin@ximian.com>
5960
5961         * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
5962         requires this to be a System.Collection.IEnumerable and not a
5963         class implementing that interface.
5964         (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.      
5965
5966 2004-07-13  Marek Safar  <marek.safar@seznam.cz>
5967
5968         * class.cs: Fixed previous fix, it broke some error tests.
5969
5970 2004-07-12  Martin Baulig  <martin@ximian.com>
5971
5972         * enum.cs (Enum.Define): Call Emit() to emit the attributes.
5973         Fixes #61293.
5974
5975 2004-07-14  Martin Baulig  <martin@ximian.com>
5976
5977         * decl.cs, expression.cs, generic.cs: Use a backqoute (`) and not
5978         an exclamation mark (!) for the generic arity to reflect the
5979         latest spec changes; ie. use "System.Collections.Generic.IList`1".
5980
5981 2004-07-13  Martin Baulig  <martin@ximian.com>
5982
5983         * cs-tokenizer.cs (Tokenizer.parse_less_than): Allow array rank
5984         specifiers being part of a type argument.
5985
5986 2004-07-13  Martin Baulig  <martin@ximian.com>
5987
5988         * expression.cs (MemberAccess.ResolveAsTypeStep): Use the full `!'
5989         name for generic types.
5990
5991 2004-07-13  Martin Baulig  <martin@ximian.com>
5992
5993         * assign.cs (Assign.DoResolve): Moved the CS0131 check up a little
5994         bit to fix #60119.
5995
5996 2004-07-09  Miguel de Icaza  <miguel@ximian.com>
5997
5998         * assign.cs (LocalTemporary): Add new argument: is_address,If
5999         `is_address' is true, then the value that we store is the address
6000         to the real value, and not the value itself.
6001         
6002         * ecore.cs (PropertyExpr): use the new local temporary
6003         stuff to allow us to handle X.Y += z (where X is a struct)
6004
6005 2004-07-08  Martin Baulig  <martin@ximian.com>
6006
6007         * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
6008         not always return, just like we're doing in Using.Resolve().
6009
6010 2004-07-07  Miguel de Icaza  <miguel@ximian.com>
6011
6012         * cs-parser.jay (fixed_statement): flag this as Pinned.
6013
6014 2004-07-06  Miguel de Icaza  <miguel@ximian.com>
6015
6016         * typemanager.cs (TypeManager): Removed MakePinned method, this
6017         mechanism is replaced with the .NET 2.x compatible mechanism of
6018         calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
6019
6020         * statement.cs (LocalInfo): Remove MakePinned, add Pinned property 
6021         Rename `Fixed' to `Pinned' as a flag, to distinguish from the
6022         `IsFixed' property which has a different meaning.
6023
6024 2004-07-02  Raja R Harinath  <rharinath@novell.com>
6025
6026         * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
6027         visible from inside a nested class, not just the names of the
6028         immediately enclosing class.
6029         Fix for bug #60730.
6030
6031 2004-06-24  Raja R Harinath  <rharinath@novell.com>
6032
6033         * expression.cs (BetterConversion): Remove buggy special-case
6034         handling of "implicit constant expression conversions".  At this
6035         point, we already know that the conversion is possible -- we're
6036         only checking to see which is better.
6037
6038 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
6039
6040         * cs-parser.jay: Added error CS0210 test.
6041
6042 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
6043
6044         * cs-parser.jay: Added error CS0134 test.
6045
6046 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
6047
6048         Fix bug #52507
6049         * cs-parser.jay: Added error CS0145 test.
6050
6051 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
6052
6053         * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
6054
6055 2004-06-23  Ben Maurer  <bmaurer@ximian.com>
6056         
6057         * expression.cs (StackAlloc.Resolve): The argument may not
6058         be a constant; deal with this case.
6059         
6060 2004-06-23  Marek Safar  <marek.safar@seznam.cz>
6061
6062         * attribute.cs (IndexerName_GetIndexerName): Renamed to
6063         GetIndexerAttributeValue.
6064         (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
6065
6066         * class.cs (Indexer.Define): Added error tests for CS0415,
6067         CS0609.
6068
6069 2004-06-23  Miguel de Icaza  <miguel@ximian.com>
6070
6071         * attribute.cs (Attribute.Resolve): Keep field code in sync with
6072         property code.
6073
6074 2004-06-23  Martin Baulig  <martin@ximian.com>
6075
6076         * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
6077         neither return nor throw, reset the barrier as well.  Fixes #60457.
6078
6079 2004-06-22  Atsushi Enomoto  <atsushi@ximian.com>
6080
6081         * class.cs : EventAttributes is now set to None by default.
6082           This fixes bug #60459.
6083
6084 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
6085
6086         Fix bug #60219
6087         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
6088         Don't throw exception but return null (it's sufficient now).
6089
6090 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
6091
6092         * typemanager.cs (GetArgumentTypes): Faster implementation.
6093
6094 2004-06-18  Martin Baulig  <martin@ximian.com>
6095
6096         * attribute.cs (Attribute.Resolve): Check whether we're an
6097         EmptyCast which a Constant child.  Fixes #60333.
6098
6099 2004-06-17  Ben Maurer  <bmaurer@ximian.com>
6100
6101         * statement.cs (EmitCollectionForeach): Account for the fact that
6102         not all valuetypes are in areas which we can take the address of.
6103         For these variables, we store to a temporary variable. Also, make
6104         sure that we dont emit a `callvirt' on a valuetype method.
6105
6106 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
6107
6108         * expression.cs (StackAlloc.DoReSolve): Added test for
6109         negative parameter (CS0247).
6110
6111 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
6112
6113         Fix bug #59792
6114         * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
6115
6116 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
6117
6118         Fix bug #59781
6119         * expression.cs: (Binary.DoNumericPromotions): Added conversion for
6120         ulong.
6121
6122 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
6123
6124         Fix bug #58254 & cs1555.cs, cs1556.cs
6125         * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
6126
6127 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
6128
6129         * cs-parser.jay: Added error CS1669 test for indexers.
6130
6131 2004-06-18  Martin Baulig  <martin@ximian.com>
6132
6133         * generics.cs (GenericMethod.ctor): Don't take an Attributes
6134         argument.  Fixes #60441.
6135
6136 2004-06-16  Ben Maurer  <bmaurer@ximian.com>
6137         * ecore.cs (MethodGroupExpr.Name): Revert Martin's patch.
6138         The name needs to have the actual name of the method in order
6139         for other tests (such as the one in OverloadResolve for Invoke
6140         on a delegate) to work. As well, it does not really help
6141         error reporting because the method group had multiple methods.
6142         * Makefile: Remove MCS_DEBUG, you can enable with the DEBUG_FLAGS.
6143         Make profiling work.
6144         
6145 2004-06-13  Martin Baulig  <martin@ximian.com>
6146
6147         * cs-parser.jay: Don't allow generic attributes.
6148
6149 2004-06-13  Martin Baulig  <martin@ximian.com>
6150
6151         * class.cs (MemberBase.DoDefineBase): New protected method.
6152         (MemberBase.DoDefine): Compute the `flags' in the new
6153         DoDefineBase() which must be called first.
6154         (Method.Define): Call DoDefineBase() first so we have the flags
6155         when defining the generic method.
6156
6157         * cs-parser.jay (interface_method_declaration): Support generic methods.
6158
6159 2004-06-13  Martin Baulig  <martin@ximian.com>
6160
6161         * decl.cs (TypeName): Removed.
6162         (MemberName): Removed TypeName and MemberNow; now we just have
6163         MemberName.
6164
6165         * cs-parser.jay: Don't distinguish between type arguments and type
6166         parameters in the grammar and simplified the rules a bit.  The
6167         reduce/reduce conflicts are now gone (except the one we inherited
6168         from mcs).
6169
6170 2004-06-11  Martin Baulig  <martin@ximian.com>
6171
6172         * expression.cs (Invocation.IsParamsMethodApplicable): We need to
6173         call this twice: for params and varargs methods.
6174
6175 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
6176
6177         * class.cs:
6178         (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
6179
6180 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
6181
6182         * attribute.cs (Attribute.GetValidTargets): Made public.
6183
6184         * class.cs: 
6185         (AbstractPropertyEventMethod): New class for better code sharing.
6186         (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
6187         CS1667 report.
6188         (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
6189
6190 2004-06-09  Martin Baulig  <martin@ximian.com>
6191
6192         * cs-parser.jay: Removed a reduce/reduce conflict.
6193
6194 2004-06-03  Martin Baulig  <martin@ximian.com>
6195
6196         * generic.cs (ConstructedType.GetMemberAccess): Renamed to
6197         GetSimpleName() and return a SimpleName.
6198
6199         * ecore.cs (SimpleName.Arguments): New public field.
6200         (SimpleName): Added overloaded ctor which takes an additional
6201         TypeArguments argument.
6202         (SimpleName.SimpleNameResolve): Added support for generic methods.
6203         (MethodGroupExpr.ResolveGeneric): New public method.  The code was
6204         formerly in MemberAccess.DoResolve(), but we also need it in
6205         SimpleNameResolve().
6206
6207         * expression.cs (MemberAccess.DoResolve): Use the new
6208         MethodGroupExpr.ResolveGeneric().       
6209
6210 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
6211
6212         * decl.cs: If possible, use lookuptypedirect here. We can only do
6213         this if there is no `.' after the namespace. Avoids using
6214         LookupType, which does lots of slow processing.
6215         (FindNestedType) New method, does what it says :-).
6216         * namespace.cs: use LookupTypeDirect.
6217         * rootcontext.cs: use membercache, if possible.
6218         * typemanager.cs (LookupTypeDirect): Cache negative hits too.
6219
6220 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
6221
6222         * expression.cs:
6223         According to the spec, 
6224
6225         In a member access of the form E.I, if E is a single identifier,
6226         and if the meaning of E as a simple-name (§7.5.2) is a constant,
6227         field, property, localvariable, or parameter with the same type as
6228         the meaning of E as a type-name (§3.8), then both possible
6229         meanings of E are permitted.
6230
6231         We did not check that E as a simple-name had the same type as E as
6232         a type name.
6233
6234         This trivial check gives us 5-7% on bootstrap time.
6235
6236 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
6237
6238         * expression.cs (Invocation.OverloadResolve): Avoid the
6239         use of hashtables and boxing here by allocating on demand.
6240
6241 2004-05-30  Martin Baulig  <martin@ximian.com>
6242
6243         * rootcontext.cs (RootContext.LookupType): Don't cache things if
6244         we're doing a silent lookup.  Don't try to lookup nested types in
6245         TypeManager.object_type (thanks to Ben Maurer).
6246
6247 2004-05-30  Martin Baulig  <martin@ximian.com>
6248
6249         Committing a patch from Ben Maurer.
6250
6251         * rootcontext.cs (RootContext.LookupType): Cache negative results.
6252
6253 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
6254
6255         * convert.cs: add a trivial cache for overload operator resolution.
6256
6257 2004-05-31  Marek Safar  <marek.safar@seznam.cz>
6258
6259         * attribute.cs
6260         (AttributeTester.GetObsoleteAttribute): Returns instance of
6261         ObsoleteAttribute when type is obsolete.
6262
6263         * class.cs
6264         (TypeContainer.VerifyObsoleteAttribute): Override.
6265         (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
6266         (MethodCode.VerifyObsoleteAttribute): Override.
6267         (MemberBase.VerifyObsoleteAttribute): Override.
6268
6269         * decl.cs
6270         (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
6271         and report proper error.
6272
6273         *delegate.cs
6274         (Delegate.VerifyObsoleteAttribute): Override.
6275
6276         * ecore.cs
6277         (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
6278         and report proper error.
6279         (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
6280
6281         * enum.cs
6282         (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
6283         and enum member.
6284
6285         * expression.cs
6286         (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
6287         New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
6288         Added test for ObsoleteAttribute.
6289
6290         * statement.cs
6291         (Catch): Derived from Statement.
6292
6293 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
6294
6295         * decl.cs: If possible, use lookuptypedirect here. We can only do
6296         this if there is no `.' after the namespace. Avoids using
6297         LookupType, which does lots of slow processing.
6298         (FindNestedType) New method, does what it says :-).
6299         * namespace.cs: use LookupTypeDirect.
6300         * rootcontext.cs: use membercache, if possible.
6301         * typemanager.cs (LookupTypeDirect): Cache negative hits too.
6302
6303 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
6304
6305         * expression.cs:
6306         According to the spec, 
6307
6308         In a member access of the form E.I, if E is a single identifier,
6309         and if the meaning of E as a simple-name (§7.5.2) is a constant,
6310         field, property, localvariable, or parameter with the same type as
6311         the meaning of E as a type-name (§3.8), then both possible
6312         meanings of E are permitted.
6313
6314         We did not check that E as a simple-name had the same type as E as
6315         a type name.
6316
6317         This trivial check gives us 5-7% on bootstrap time.
6318
6319 2004-05-30  Marek Safar  <marek.safar@seznam.cz>
6320
6321         Fixed bug #59071 & cs0160.cs
6322         * statement.cs (Try.Resolve): Check here whether order of catch
6323         clauses matches their dependencies.
6324
6325 2004-05-30  Marek Safar  <marek.safar@seznam.cz>
6326
6327         Fixed bug #58624
6328         * ecore.cs (SimpleName.SimpleNameResolve): Added test for
6329         unsafe type.
6330
6331 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
6332
6333         * expression.cs (Invocation.OverloadResolve): Avoid the
6334         use of hashtables and boxing here by allocating on demand.
6335
6336 2004-05-30  Martin Baulig  <martin@ximian.com>
6337
6338         * rootcontext.cs (RootContext.LookupType): Don't cache things if
6339         we're doing a silent lookup.  Don't try to lookup nested types in
6340         TypeManager.object_type (thanks to Ben Maurer).
6341
6342 2004-05-30  Martin Baulig  <martin@ximian.com>
6343
6344         Committing a patch from Ben Maurer.
6345
6346         * rootcontext.cs (RootContext.LookupType): Cache negative results.      
6347
6348 2004-05-29  Martin Baulig  <martin@ximian.com>
6349
6350         * class.cs (IMethodData.ShouldIgnore): New method.
6351
6352         * typemanager.cs (TypeManager.MethodFlags): Don't take a
6353         `Location' argument, we don't need it anywhere.  Use
6354         `IMethodData.ShouldIgnore ()' instead of
6355         `MethodData.GetMethodFlags ()'.
6356         (TypeManager.AddMethod): Removed.
6357         (TypeManager.AddMethod2): Renamed to AddMethod.
6358
6359 2004-05-29  Martin Baulig  <martin@ximian.com>
6360
6361         Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
6362
6363         * convert.cs (Convert.ImplicitReferenceConversion): If we're
6364         converting from a class type S to an interface type and we already
6365         have an object on the stack, don't box it again.  Fixes #52578.
6366
6367 2004-05-29  Martin Baulig  <martin@ximian.com>
6368
6369         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
6370         Added support for `params' parameters.  Fixes #59267.
6371
6372 2004-05-29  Martin Baulig  <martin@ximian.com>
6373
6374         * literal.cs (NullPointer): Provide a private .ctor which sets
6375         `type' to TypeManager.object_type.  Fixes #59048.
6376
6377 2004-05-29  Martin Baulig  <martin@ximian.com>
6378
6379         * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
6380         EventExpr, set `ee.InstanceExpression = left'.  Fixes #59188.
6381
6382         * ecore.cs (EventExpr.instance_expr): Make the field private.
6383
6384 2004-05-26  Marek Safar  <marek.safar@seznam.cz>
6385
6386         Fixed bug #50080 & cs0214-2.cs
6387         * expression.cs (Cast.DoResolve): Check unsafe context here.
6388         
6389         * statement.cs (Resolve.DoResolve): Likewise.
6390
6391 2004-05-26  Martin Baulig  <martin@ximian.com>
6392
6393         * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
6394
6395         * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
6396         (RootContext.LookupType): Pass down the `silent' flag.
6397
6398 2004-05-25  Martin Baulig  <martin@ximian.com>
6399
6400         * expression.cs
6401         (MethodGroupExpr.IdenticalTypeName): New public property.
6402         (Invocation.DoResolve): Don't report a CS0176 if the "instance"
6403         expression actually refers to a type.
6404
6405 2004-05-25  Martin Baulig  <martin@ximian.com>
6406
6407         * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
6408         for #56176 and made it actually work.
6409
6410 2004-05-25  Martin Baulig  <martin@ximian.com>
6411
6412         * ecore.cs (Expression.CacheTemporaries): Make this virtual.
6413         (FieldExpr, PropertyExpr): Override and implement
6414         CacheTemporaries.  Fixes #52279.
6415
6416 2004-05-25  Miguel de Icaza  <miguel@ximian.com>
6417
6418         * location.cs: In the new compiler listing a file twice is a
6419         warning, not an error.
6420
6421 2004-05-24  Martin Baulig  <martin@ximian.com>
6422
6423         * enum.cs (Enum.DefineType): For the `BaseType' to be a
6424         TypeLookupExpression; otherwise, report a CS1008.  Fixes #58571.
6425
6426 2004-05-24  Martin Baulig  <martin@ximian.com>
6427
6428         * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
6429         walking the `using' list.  Fixes #53921.
6430
6431 2004-05-24  Martin Baulig  <martin@ximian.com>
6432
6433         * const.cs (Const.LookupConstantValue): Added support for
6434         EmptyCast's; fixes #55251.
6435
6436 2004-05-24  Martin Baulig  <martin@ximian.com>
6437
6438         * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
6439         DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
6440         which does the CS0135 check.  The reason is that we first need to
6441         check whether the variable actually exists.
6442
6443 2004-05-24  Martin Baulig  <martin@ximian.com>
6444
6445         * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
6446         than RootContext.LookupType() to find the explicit interface
6447         type.  Fixes #58584.
6448
6449 2004-05-24  Raja R Harinath  <rharinath@novell.com>
6450
6451         * Makefile: Simplify.  Use executable.make.
6452         * mcs.exe.sources: New file.  List of sources of mcs.exe.
6453
6454 2004-05-24  Anders Carlsson  <andersca@gnome.org>
6455
6456         * decl.cs:
6457         * enum.cs:
6458         Use the invariant culture when doing String.Compare for CLS case
6459         sensitivity.
6460         
6461 2004-05-23  Martin Baulig  <martin@ximian.com>
6462
6463         * decl.cs (DeclSpace.FindType): Only check the `using' list if we
6464         don't have any dots.  Fixes #52622, added cs0246-8.cs.
6465
6466         * namespace.cs (NamespaceEntry.Lookup): Likewise.
6467
6468 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
6469
6470         * class.cs (MemberBase.Define): Reuse MemberType member for 
6471         resolved type. Other methods can use it too.
6472
6473 2004-05-23  Martin Baulig  <martin@ximian.com>
6474
6475         * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
6476         the variable also exists in the current block (otherwise, we need
6477         to report a CS0103).  Fixes #58670.
6478
6479 2004-05-23  Martin Baulig  <martin@ximian.com>
6480
6481         * flowanalysis.cs (Reachability.Reachable): Compute this
6482         on-the-fly rather than storing it as a field.
6483
6484 2004-05-23  Martin Baulig  <martin@ximian.com>
6485
6486         * flowanalysis.cs (Reachability.And): Manually compute the
6487         resulting `barrier' from the reachability.      
6488        
6489 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
6490
6491         Fix bug #57835
6492         * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
6493         instance of ObsoleteAttribute when symbol is obsolete.
6494
6495         * class.cs
6496         (IMethodData): Extended interface for ObsoleteAttribute support.
6497
6498 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
6499
6500         * attribute.cs: Fix bug #55970
6501
6502 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
6503
6504         Fix bug #52705
6505         * attribute.cs
6506         (GetObsoleteAttribute): New method. Creates the instance of
6507         ObsoleteAttribute.
6508         (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
6509         ObsoleteAttribute when member is obsolete.
6510         (AttributeTester.Report_ObsoleteMessage): Common method for
6511         Obsolete error/warning reporting.
6512
6513         * class.cs
6514         (TypeContainer.base_classs_type): New member for storing parent type.
6515
6516         * decl.cs
6517         (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
6518         for this MemberCore.
6519
6520 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
6521
6522         * attribute.cs, const.cs: Fix bug #58590
6523
6524 2004-05-21  Martin Baulig  <martin@ximian.com>
6525
6526         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
6527         out parameters if the end of the method is unreachable.  Fixes
6528         #58098. 
6529
6530 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
6531
6532         * codegen.cs, cs-parser.jay: Removed SetAttributes method.
6533         Hari was right, why extra method.
6534
6535 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
6536
6537         * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
6538
6539 2004-05-20  Martin Baulig  <martin@ximian.com>
6540
6541         * delegate.cs: Convert this file to Unix mode - like the original
6542         version in mcs is.
6543
6544 2004-05-20  Martin Baulig  <martin@ximian.com>
6545
6546         * attribute.cs: Convert this file to Unix mode - like the original
6547         version in mcs is.
6548
6549 2004-05-19  Marek Safar  <marek.safar@seznam.cz>
6550
6551        Fix bug #58688 (MCS does not report error when the same attribute
6552        is assigned twice)
6553
6554        * attribute.cs (Attribute.Emit): Distinction between null and default.
6555
6556 2004-05-19  Raja R Harinath  <rharinath@novell.com>
6557
6558        * cs-parser.jay (attribute): Create a GlobalAttribute for the case
6559        of a top-level attribute without an attribute target.
6560        * attribute.cs (Attribute.Error_AttributeConstructorMismatch): 
6561        Make non-static.
6562        (Attribute.Conditional_GetConditionName), 
6563        (Attribute.Obsolete_GetObsoleteMessage): Update.
6564        (Attribute.IndexerName_GetIndexerName): New.  Attribute-specific
6565        part of ScanForIndexerName.
6566        (Attribute.CanIgnoreInvalidAttribute): New function.
6567        (Attribute.ScanForIndexerName): Move to ...
6568        (Attributes.ScanForIndexerName): ... here.
6569        (Attributes.Attrs): Rename from now-misnamed AttributeSections.
6570        (Attributes.Search): New internal variant that can choose not to
6571        complain if types aren't resolved.  The original signature now
6572        complains.
6573        (Attributes.GetClsCompliantAttribute): Use internal variant, with
6574        complaints suppressed.
6575        (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
6576        only if it not useful.
6577        (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
6578        top-level for attributes that are shared between the assembly
6579        and a top-level class.
6580        * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
6581        * class.cs: Update to reflect changes.
6582        (DefineIndexers): Fuse loops.
6583        * codegen.cs (GetAssemblyName): Update to reflect changes.  Accept
6584        a couple more variants of attribute names.
6585
6586 2004-05-18  Marek Safar  <marek.safar@seznam.cz>
6587
6588         Fix bug #52585 (Implemented explicit attribute declaration)
6589
6590         * attribute.cs:
6591         (Attributable.ValidAttributeTargets): New abstract method. It gets
6592         list of valid attribute targets for explicit target declaration.
6593         (Attribute.Target): It holds target itself.
6594         (AttributeSection): Removed.
6595         (Attribute.CheckTargets): New method. It checks whether attribute
6596         target is valid for the current element.
6597
6598         * class.cs:
6599         (EventProperty): New class. For events that are declared like
6600         property (with add and remove accessors).
6601         (EventField): New class. For events that are declared like field.
6602         class.cs
6603
6604         * cs-parser.jay: Implemented explicit attribute target declaration.
6605
6606         * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:        
6607         Override ValidAttributeTargets.
6608
6609         * parameter.cs:
6610         (ReturnParameter): Class for applying custom attributes on 
6611         the return type.
6612         (ParameterAtribute): New class. Class for applying custom
6613         attributes on the parameter type.
6614
6615 2004-05-17  Miguel de Icaza  <miguel@ximian.com>
6616
6617         * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
6618         definitions. 
6619
6620         (Method): Allow UNSAFE here.
6621
6622         * modifiers.cs: Support unsafe reporting.
6623
6624 2004-05-17  Marek Safar  <marek.safar@seznam.cz>
6625
6626         * decl.cs: Fix bug #58478.
6627
6628 2004-05-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
6629
6630         * statement.cs: When checking for unreachable code on an EmptyStatement,
6631         set the location. Fixes bug #58488.
6632
6633 2004-05-13  Miguel de Icaza  <miguel@ximian.com>
6634
6635         * driver.cs: Add -pkg handling.
6636
6637         From Gonzalo: UseShelLExecute=false
6638
6639 2004-05-12  Marek Safar  <marek.safar@seznam.cz>
6640
6641         * attribute.cs:
6642         (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
6643         for attribute.
6644         (Attribute.IsClsCompliaceRequired): Moved to base for better
6645         accesibility.
6646         (Attribute.UsageAttribute): New property for AttributeUsageAttribute
6647         when attribute is AttributeUsageAttribute.
6648         (Attribute.GetValidTargets): Simplified.
6649         (Attribute.GetAttributeUsage): New method returns AttributeUsage
6650         attribute for this type.
6651         (Attribute.ApplyAttributes): Method renamed to Emit and make
6652         non-static.
6653         (GlobalAttributeSection): New class for special handling of global
6654         attributes (assembly, module).
6655         (AttributeSection.Emit): New method.
6656
6657         * class.cs: Implemented Attributable abstract methods.
6658         (MethodCore.LabelParameters): Moved to Parameter class.
6659         (Accessor): Is back simple class.
6660         (PropertyMethod): Implemented Attributable abstract class.
6661         (DelegateMethod): Implemented Attributable abstract class.
6662         (Event): New constructor for disctintion between normal Event
6663         and Event with accessors.
6664
6665         * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
6666
6667         * codegen.cs, const.cs, decl.cs, delegate.cs:
6668         (CommonAssemblyModulClass): Implemented Attributable abstract class
6669         and simplified.
6670
6671         * enum.cs: Implement IAttributeSupport interface.
6672         (EnumMember): New class for emum members. Implemented Attributable
6673         abstract class
6674
6675         * parameter.cs:
6676         (ParameterBase): Is abstract.
6677         (ReturnParameter): New class for easier [return:] attribute handling.
6678
6679         * typemanager.cs: Removed builder_to_attr.
6680
6681 2004-05-11  Raja R Harinath  <rharinath@novell.com>
6682
6683         Fix bug #57151.
6684         * attribute.cs (Attribute.GetPositionalValue): New function.
6685         * class.cs (TypeContainer.VerifyMembers): New function.
6686         (TypeContainer.Emit): Use it.
6687         (ClassOrStruct): New base class for Class and Struct.
6688         (ClassOrStruct.ApplyAttributeBuilder): New function.  Note if 
6689         StructLayout(LayoutKind.Explicit) was ascribed to the struct or
6690         class.
6691         (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
6692         then each non-static field should have a FieldOffset attribute.
6693         Otherwise, none of the fields should have a FieldOffset attribute.
6694         * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout 
6695         and FieldOffset attributes.
6696         * typemanager.cs (TypeManager.struct_layout_attribute_type)
6697         (TypeManager.field_offset_attribute_type): New core types.
6698         (TypeManager.InitCoreTypes): Initialize them.
6699
6700 2004-05-11  Michal Moskal  <malekith@pld-linux.org>
6701
6702         * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
6703         Return correct type.
6704         From bug #58270.
6705
6706 2004-05-09  Miguel de Icaza  <miguel@ximian.com>
6707
6708         * expression.cs (Binary.DoNumericPromotions): 0 long constant can
6709         be implicitly converted to ulong.
6710         
6711         * expression.cs: The logic for allowing operator &, | and ^ worked
6712         was wrong, it worked before because we did not report an error in
6713         an else branch.  Fixes 57895.
6714
6715         * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
6716         allow volatile fields to be reference types.
6717
6718 2004-05-07  Miguel de Icaza  <miguel@ximian.com>
6719
6720         * driver.cs: Add support for /debug-
6721
6722 2004-05-07  Raja R Harinath  <rharinath@novell.com>
6723
6724         * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType): 
6725         Add a 'complain' parameter to silence errors.
6726         (Attribute.Resolve): Update to changes.  Put in sanity check to catch
6727         silently overlooked type-resolutions.
6728         (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
6729         to reflect changes.
6730         (Attributes.Search): New function.
6731         (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
6732         (Attributes.GetAttributeFullName): Remove hack.
6733         * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes): 
6734         Update to reflect changes.
6735         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
6736         Use Attributes.Search instead of nested loops.
6737
6738 2004-05-07  Marek Safar  <marek.safar@seznam.cz>
6739
6740         * decl.cs:
6741         (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
6742         (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
6743         (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
6744
6745         * report.cs: (Report.Warning): Renamed to Warning_T because of
6746         parameter collision.
6747
6748 2004-05-05  Raja R Harinath  <rharinath@novell.com>
6749
6750         * expression.cs (MemberAccess.ResolveMemberAccess):
6751         Exit with non-zero status after Report.Error.
6752         * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
6753         Likewise.
6754         * typemanager.cs (TypeManager.CoreLookupType): Likewise.
6755
6756 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
6757
6758         * support.cs: Don't hang when the file is empty.
6759
6760 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
6761
6762         * support.cs: In SeekableStreamReader, compute the preamble size of the
6763           underlying stream. Position changes should take into account that initial
6764           count of bytes.
6765
6766 2004-05-03  Todd Berman  <tberman@sevenl.net>
6767
6768         * driver.cs: remove unused GetSysVersion function.
6769
6770 2004-05-03  Todd Berman  <tberman@sevenl.net>
6771
6772         * driver.cs: Remove the hack from saturday, as well as the hack
6773         from jackson (LoadAssemblyFromGac), also adds the CWD to the
6774         link_paths to get that bit proper.
6775
6776 2004-05-01  Todd Berman  <tberman@sevenl.net>
6777
6778         * driver.cs: Try a LoadFrom before a Load, this checks the current
6779         path. This is currently a bug in mono that is be fixed, however, this
6780         provides a workaround for now. This will be removed when the bug
6781         is fixed.
6782
6783 2004-05-01  Sebastien Pouliot  <sebastien@ximian.com>
6784
6785         * CryptoConvert.cs: Updated to latest version. Fix issue with 
6786         incomplete key pairs (#57941).
6787
6788 2004-05-01  Todd Berman  <tberman@sevenl.net>
6789
6790         * driver.cs: Remove '.' from path_chars, now System.* loads properly
6791         from the GAC
6792
6793 2004-04-30  Jackson Harper  <jackson@ximian.com>
6794
6795         * codegen.cs: Open keys readonly.
6796         
6797 2004-04-30  Gonzalo Paniagua Javier <gonzalo@ximian.com>
6798
6799         * typemanager.cs: don't report cyclic struct layout when a struct
6800         contains 2 or more fields of the same type. Failed for Pango.AttrShape
6801         which has 2 Pango.Rectangle fields.
6802
6803 2004-04-29 Ben Maurer  <bmaurer@users.sourceforge.net>
6804
6805         * expression.cs: Handle IntPtr comparisons with IL code
6806         rather than a method call.
6807
6808 2004-04-29  Martin Baulig  <martin@ximian.com>
6809
6810         * ecore.cs (PropertyExpr.FindAccessor): New private method.  Walk
6811         the list of PropertyInfo's in class hierarchy and find the
6812         accessor.  Fixes #56013.
6813
6814 2004-04-29  Martin Baulig  <martin@ximian.com>
6815
6816         * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
6817
6818 2004-04-29  Martin Baulig  <martin@ximian.com>
6819
6820         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
6821
6822         * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
6823
6824 2004-04-29  Martin Baulig  <martin@ximian.com>
6825
6826         * class.cs (ConstructorInitializer.Resolve): Check whether the
6827         parent .ctor is accessible.  Fixes #52146.
6828
6829 2004-04-29  Martin Baulig  <martin@ximian.com>
6830
6831         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
6832
6833         * statement.cs (Using.EmitLocalVariableDecls): Use
6834         TypeManager.idisposable_type, not typeof (IDisposable).
6835         (Foreach.EmitCollectionForeach): Added support for valuetypes.
6836
6837 2004-04-29  Martin Baulig  <martin@ximian.com>
6838
6839         * class.cs (Event.Define): Don't emit the field and don't set
6840         RTSpecialName and SpecialName for events on interfaces.  Fixes
6841         #57703. 
6842
6843 2004-04-29  Raja R Harinath  <rharinath@novell.com>
6844
6845         Refactor Attribute.ApplyAttributes.
6846         * attribute.cs (Attributable): New base class for objects that can
6847         have Attributes applied on them.
6848         (Attribute): Make AttributeUsage fields public.
6849         (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
6850         (Attribute.IsInternalCall): New property.
6851         (Attribute.UsageAttr): Convert to a public read-only property.
6852         (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
6853         (Attribute.ResolveType, Attribute.Resolve)
6854         (Attribute.ScanForIndexerName): Update to reflect changes.
6855         (Attribute.CheckAttributeTarget): Re-format.
6856         (Attribute.ApplyAttributes): Refactor, to various
6857         Attributable.ApplyAttributeBuilder methods.
6858         * decl.cs (MemberCore): Make Attributable.
6859         * class.cs (Accessor): Make Attributable.
6860         (MethodData.ApplyAttributes): Use proper attribute types, not
6861         attribute names.
6862         (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
6863         (TypeContainer.ApplyAttributeBuilder)
6864         (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
6865         (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)   
6866         (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
6867         (Operator.ApplyAttributeBuilder): New factored-out methods.
6868         * const.cs (Const.ApplyAttributeBuilder): Likewise.
6869         * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
6870         * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
6871         * parameter.cs (ParameterBase): New Attributable base class
6872         that can also represent Return types.
6873         (Parameter): Update to the changes.
6874
6875 2004-04-29  Jackson Harper  <jackson@ximian.com>
6876
6877         * driver.cs: Prefer the corlib system version when looking for
6878         assemblies in the GAC. This is still a hack, but its a better hack
6879         now.
6880         
6881 2004-04-29  Marek Safar  <marek.safar@seznam.cz>
6882
6883         * decl.cs, enum.cs: Improved error 3005 reporting.
6884   
6885         * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
6886         (related_symbols): New private member for list of symbols
6887         related to reported error/warning.
6888         
6889         * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
6890
6891 2004-04-29  Martin Baulig  <martin@ximian.com>
6892
6893         * ecore.cs (Expression.Constantify): If we're an enum and
6894         TypeManager.TypeToCoreType() doesn't give us another type, use
6895         t.UnderlyingSystemType.  Fixes #56178.  
6896
6897 2004-04-29  Martin Baulig  <martin@ximian.com>
6898
6899         * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
6900         interfaces and for each interface, only add members directly
6901         declared in that interface.  Fixes #53255.
6902
6903 2004-04-28  Martin Baulig  <martin@ximian.com>
6904
6905         * expression.cs (ConditionalLogicalOperator): Use a temporary
6906         variable for `left' to avoid that we evaluate it more than once;
6907         bug #52588.
6908
6909 2004-04-28  Martin Baulig  <martin@ximian.com>
6910
6911         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
6912         `void[]' (CS1547).
6913
6914 2004-04-28  Martin Baulig  <martin@ximian.com>
6915
6916         * statement.cs (LocalInfo.Resolve): Check whether the type is not
6917         void (CS1547).
6918
6919         * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
6920         whether the type is not void (CS1547).
6921
6922 2004-04-28  Martin Baulig  <martin@ximian.com>
6923
6924         * expression.cs (Unary.DoResolveLValue): Override this and report
6925         CS0131 for anything but Operator.Indirection.
6926
6927 2004-04-28  Martin Baulig  <martin@ximian.com>
6928
6929         Committing a patch from Ben Maurer; see bug #50820.
6930
6931         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
6932         check for classes.
6933
6934         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
6935         classes.        
6936
6937 2004-04-28  Martin Baulig  <martin@ximian.com>
6938
6939         Committing a patch from Ben Maurer; see bug #50820.
6940
6941         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
6942         check for classes.
6943
6944         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
6945         classes.        
6946
6947 2004-04-28  Martin Baulig  <martin@ximian.com>
6948
6949         * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
6950         (Block.AddLabel): Call DoLookupLabel() to only search in the
6951         current block.
6952
6953 2004-04-28  Martin Baulig  <martin@ximian.com>
6954
6955         * cfold.cs (ConstantFold.BinaryFold): Added special support for
6956         comparing StringConstants and NullLiterals in Equality and Inequality.
6957
6958 2004-04-28  Jackson Harper  <jackson@ximian.com>
6959
6960         * driver.cs: Attempt to load referenced assemblies from the
6961         GAC. This is the quick and dirty version of this method that
6962         doesnt take into account versions and just takes the first
6963         canidate found. Will be good enough for now as we will not have more
6964         then one version installed into the GAC until I update this method.
6965
6966 2004-04-28  Martin Baulig  <martin@ximian.com>
6967
6968         * typemanager.cs (TypeManager.CheckStructCycles): New public
6969         static method to check for cycles in the struct layout.
6970
6971         * rootcontext.cs (RootContext.PopulateTypes): Call
6972         TypeManager.CheckStructCycles() for each TypeContainer.
6973         [Note: We only need to visit each type once.]
6974
6975 2004-04-28  Martin Baulig  <martin@ximian.com>
6976
6977         * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
6978
6979         * const.cs (Const.LookupConstantValue): Return a `bool' signalling
6980         success and added `out object value'.  Use a `bool resolved' field
6981         to check whether we've already been called rather than
6982         `ConstantValue != null' since this breaks for NullLiterals.
6983
6984 2004-04-28  Raja R Harinath  <rharinath@novell.com>
6985
6986         * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
6987         setting of this flag, since the 'set' method may be non-public.
6988
6989 2004-04-28  Raja R Harinath  <rharinath@novell.com>
6990
6991         * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
6992         check on current_vector.Block.
6993
6994 2004-04-27  Martin Baulig  <martin@ximian.com>
6995
6996         * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
6997         a field initializer.  Fixes #56459.
6998
6999 2004-04-27  Martin Baulig  <martin@ximian.com>
7000
7001         * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
7002         we're not attempting to use an indexer.  Fixes #52154.
7003
7004 2004-04-27  Martin Baulig  <martin@ximian.com>
7005
7006         * statement.cs (Return): Don't create a return label if we don't
7007         need it; reverts my change from January 20th.  Thanks to Ben
7008         Maurer for this.
7009
7010 2004-04-27  Martin Baulig  <martin@ximian.com>
7011
7012         According to the spec, `goto' can only leave a nested scope, but
7013         never enter it.
7014
7015         * statement.cs (Block.LookupLabel): Only lookup in the current
7016         block, don't recurse into parent or child blocks.
7017         (Block.AddLabel): Check in parent and child blocks, report
7018         CS0140/CS0158 if we find a duplicate.
7019         (Block): Removed this indexer for label lookups.
7020         (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
7021         this already does the error reporting for us.
7022
7023         * flowanalysis.cs
7024         (FlowBranching.UsageVector.Block): New public variable; may be null.
7025         (FlowBranching.CreateSibling): Added `Block' argument.
7026         (FlowBranching.LookupLabel): New public virtual method.  Lookup a
7027         label for the target of a `goto' and check whether we're not
7028         leaving a `finally'.
7029
7030 2004-04-27  Martin Baulig  <martin@ximian.com>
7031
7032         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
7033         a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
7034         just for returns).
7035
7036 2004-04-27  Martin Baulig  <martin@ximian.com>
7037
7038         * statement.cs (Block.AddLabel): Also check for implicit blocks
7039         and added a CS0158 check.
7040
7041 2004-04-27  Martin Baulig  <martin@ximian.com>
7042
7043         * flowanalysis.cs (FlowBranchingLoop): New class.
7044         (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
7045         UsageVector's instead of an ArrayList.
7046         (FlowBranching.Label): Likewise.
7047         (FlowBranching.UsageVector.MergeBreakOrigins): New method.
7048         (FlowBranching.AddBreakVector): New method.
7049
7050 2004-04-27  Miguel de Icaza  <miguel@ximian.com>
7051
7052         * attribute.cs: Small regression fix: only convert the type if we
7053         the type is different, fixes System.Drawing build.
7054
7055 2004-04-27  Martin Baulig  <martin@ximian.com>
7056
7057         * attribute.cs (Attribute.Resolve): If we have a constant value
7058         for a named field or property, implicity convert it to the correct
7059         type.
7060
7061 2004-04-27  Raja R Harinath  <rharinath@novell.com>
7062
7063         * statement.cs (Block.Block): Implicit blocks share
7064         'child_variable_names' fields with parent blocks.
7065         (Block.AddChildVariableNames): Remove.
7066         (Block.AddVariable): Mark variable as "used by a child block" in
7067         every surrounding block.
7068         * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
7069         been used in a child block, complain about violation of "Invariant
7070         meaning in blocks" rule.
7071         * cs-parser.jay (declare_local_variables): Don't use
7072         AddChildVariableNames.
7073         (foreach_statement): Don't create an implicit block: 'foreach'
7074         introduces a scope.
7075
7076 2004-04-23  Miguel de Icaza  <miguel@ximian.com>
7077
7078         * convert.cs (ImplicitNumericConversion): 0 is also positive when
7079         converting from 0L to ulong.  Fixes 57522.
7080
7081 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
7082
7083         * decl.cs (FindMemberToOverride): Fix wrong warning for case when
7084         derived class hides via 'new' keyword field from base class (test-242.cs).
7085         TODO: Handle this in the more general way.
7086         
7087         * class.cs (CheckBase): Ditto.
7088
7089 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
7090
7091         * decl.cs (caching_flags): New member for storing cached values
7092         as bit flags.
7093         (MemberCore.Flags): New enum where bit flags for caching_flags
7094         are defined.
7095         (MemberCore.cls_compliance): Moved to caching_flags.
7096         (DeclSpace.Created): Moved to caching_flags.
7097
7098         * class.cs: Use caching_flags instead of DeclSpace.Created
7099         
7100 2004-04-21  Miguel de Icaza  <miguel@ximian.com>
7101
7102         * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
7103         if we are only a derived class, not a nested class.
7104
7105         * typemanager.cs: Same as above, but do this at the MemberLookup
7106         level (used by field and methods, properties are handled in
7107         PropertyExpr).   Allow for the qualified access if we are a nested
7108         method. 
7109
7110 2004-04-21  Marek Safar  <marek.safar@seznam.cz>
7111
7112         * class.cs: Refactoring.
7113         (IMethodData): New inteface; Holds links to parent members
7114         to avoid member duplication (reduced memory allocation).
7115         (Method): Implemented IMethodData interface.
7116         (PropertyBase): New inner classes for get/set methods.
7117         (PropertyBase.PropertyMethod): Implemented IMethodData interface
7118         (Event): New inner classes for add/remove methods.
7119         (Event.DelegateMethod): Implemented IMethodData interface.
7120
7121         * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
7122         EmitContext (related to class.cs refactoring).
7123
7124 2004-04-21  Raja R Harinath  <rharinath@novell.com>
7125
7126         * delegate.cs (Delegate.VerifyApplicability): If the number of
7127         arguments are the same as the number of parameters, first try to
7128         verify applicability ignoring  any 'params' modifier on the last
7129         parameter.
7130         Fixes #56442.
7131
7132 2004-04-08  Martin Baulig  <martin@ximian.com>
7133
7134         Merged latest changes into gmcs.  Please keep this comment in
7135         here, it makes it easier for me to see what changed in MCS since
7136         the last time I merged.
7137
7138 2004-04-16  Raja R Harinath  <rharinath@novell.com>
7139
7140         * class.cs (TypeContainer.AddIndexer): Use
7141         'ExplicitInterfaceName' to determine if interface name was
7142         explicitly specified.  'InterfaceType' is not initialized at this time.
7143         (TypeContainer.DefineIndexers): Remove use of temporary list.  The
7144         Indexers array is already in the required order.  Initialize
7145         'IndexerName' only if there are normal indexers.
7146         (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
7147         (TypeContainer.Emit): Emit DefaultMember attribute only if
7148         IndexerName is initialized.
7149         Fixes #56300.
7150
7151 2004-04-15  Benjamin Jemlich  <pcgod@gmx.net>
7152
7153         * enum.cs (Enum.DefineType): Don't allow char as type for enum.
7154         Fixes #57007
7155
7156 2004-04-15  Raja R Harinath  <rharinath@novell.com>
7157
7158         * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
7159         attributes.
7160         Fix for #56456.
7161
7162         * attribute.cs (Attribute.Resolve): Check for duplicate named
7163         attributes.
7164         Fix for #56463.
7165
7166 2004-04-15  Miguel de Icaza  <miguel@ximian.com>
7167
7168         * iterators.cs (MarkYield): track whether we are in an exception,
7169         and generate code accordingly.  Use a temporary value to store the
7170         result for our state.
7171
7172         I had ignored a bit the interaction of try/catch with iterators
7173         since their behavior was not entirely obvious, but now it is
7174         possible to verify that our behavior is the same as MS .NET 2.0
7175
7176         Fixes 54814
7177
7178 2004-04-14  Miguel de Icaza  <miguel@ximian.com>
7179
7180         * iterators.cs: Avoid creating temporaries if there is no work to
7181         do. 
7182
7183         * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
7184         Enumerations, use TypeManager.EnumToUnderlying and call
7185         recursively. 
7186
7187         Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
7188         bug #57013
7189
7190         (This.Emit): Use EmitContext.EmitThis to emit our
7191         instance variable.
7192
7193         (This.EmitAssign): Ditto.
7194
7195         * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
7196         codepaths, we will move all the functionality into
7197         Mono.CSharp.This 
7198
7199         (FieldExpr.EmitAssign): Ditto.
7200
7201         This fixes several hidden bugs that I uncovered while doing a code
7202         review of this today.
7203
7204         * codegen.cs (EmitThis): reworked so the semantics are more clear
7205         and also support value types "this" instances.
7206
7207         * iterators.cs: Changed so that for iterators in value types, we
7208         do not pass the value type as a parameter.  
7209
7210         Initialization of the enumerator helpers is now done in the caller
7211         instead of passing the parameters to the constructors and having
7212         the constructor set the fields.
7213
7214         The fields have now `assembly' visibility instead of private.
7215
7216 2004-04-11  Miguel de Icaza  <miguel@ximian.com>
7217
7218         * expression.cs (Argument.Resolve): Check if fields passed as ref
7219         or out are contained in a MarshalByRefObject.
7220
7221         * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
7222         another compiler type.
7223
7224 2004-04-06 Ben Maurer  <bmaurer@users.sourceforge.net>
7225
7226         * class.cs (Indexer.Define): use the new name checking method.
7227         Also, return false on an error.
7228         * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
7229         (is_identifier_[start/part]_character): make static.
7230
7231 2004-04-10  Miguel de Icaza  <miguel@ximian.com>
7232
7233         * expression.cs (Binary.ResolveOperator): Do no append strings
7234         twice: since we can be invoked more than once (array evaluation)
7235         on the same concatenation, take care of this here.  Based on a fix
7236         from Ben (bug #56454)
7237
7238 2004-04-08  Sebastien Pouliot  <sebastien@ximian.com>
7239
7240         * codegen.cs: Fix another case where CS1548 must be reported (when 
7241         delay-sign isn't specified and no private is available #56564). Fix
7242         loading the ECMA "key" to delay-sign an assembly. Report a CS1548 
7243         error when MCS is used on the MS runtime and we need to delay-sign 
7244         (which seems unsupported by AssemblyBuilder - see #56621).
7245
7246 2004-04-08  Marek Safar  <marek.safar@seznam.cz>
7247
7248         * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
7249         (TypeManager.ComputeNamespaces): Faster implementation for
7250         Microsoft runtime.
7251
7252         * compiler.csproj: Updated AssemblyName to mcs.
7253
7254 2004-05-11  Jackson Harper  <jackson@ximian.com>
7255
7256         * Makefile: Preserve MONO_PATH
7257         
7258 2004-05-11  Jackson Harper  <jackson@ximian.com>
7259
7260         * Makefile: Use mono and mcs to build gmcs
7261         
7262 2004-05-03  Miguel de Icaza  <miguel@ximian.com>
7263
7264         * codegen.cs: Add patch from Robert Shade
7265         <rshade@dvsconsulting.com>, use FileAccess.Read on the keyfile, to
7266         sync with mcs.
7267
7268 2004-05-02  Sebastien Pouliot  <sebastien@ximian.com>
7269
7270         * CryptoConvert.cs: Updated to latest version. Fix issue with 
7271         incomplete key pairs (#57941).
7272
7273 2004-04-08  Sebastien Pouliot  <sebastien@ximian.com>
7274
7275         * codegen.cs: Fix another case where CS1548 must be reported (when 
7276         delay-sign isn't specified and no private is available #56564). Fix
7277         loading the ECMA "key" to delay-sign an assembly. Report a CS1548 
7278         error when MCS is used on the MS runtime and we need to delay-sign 
7279         (which seems unsupported by AssemblyBuilder - see #56621).
7280
7281 2004-04-29  Jackson Harper  <jackson@ximian.com>
7282
7283         * Makefile: Set MONO_PATH to use the bootstrap corlib
7284         * driver.cs: Check the GAC for referenced assemblies.
7285                 
7286 2004-04-29  Martin Baulig  <martin@ximian.com>
7287
7288         * Makefile (gmcs.exe): Set MONO_PATH to use `../class/lib/net_2_0'.
7289
7290 2004-04-07  Martin Baulig  <martin@ximian.com>
7291
7292         * expression.cs (Binary.ResolveOperator): Added special case for
7293         Equality/Inequality between a type parameter and a null literal.
7294
7295 2004-04-07  Martin Baulig  <martin@ximian.com>
7296
7297         * convert.cs: Check null literal -> type parameter conversions.
7298
7299 2004-04-07  Martin Baulig  <martin@ximian.com>
7300
7301         * generic.cs (ConstructedType.CheckConstraints): Enforce the
7302         `class' and `struct' constraints.
7303
7304 2004-04-07  Martin Baulig  <martin@ximian.com>
7305
7306         * generic.cs (SpecialConstraint): New public enum.
7307         (Constraints.Resolve): Added support for the `class' and `struct'
7308         constraints.
7309
7310         * cs-parser.jay (type_parameter_constraint): Added support for the
7311         `class' and `struct' constraints.
7312
7313 2004-04-07  Martin Baulig  <martin@ximian.com>
7314
7315         * support.cs (GenericConstraints): Replaced `Types' by
7316         `ClassConstraint' and `InterfaceConstraints'; added
7317         `HasClassConstraint'.   
7318
7319 2004-04-07  Martin Baulig  <martin@ximian.com>
7320
7321         * generic.cs
7322         (Constraints.InterfaceConstraints): New public property.
7323         (Constraints.Types): Make this property public
7324         (TypeParameter): Implement IMemberContainer.
7325         (TypeParameter.Define): Take a `GenericTypeParameterBuilder'
7326         instead of a TypeBuilder/MethodBuilder; pass the interface
7327         constraints to TypeManager.AddTypeParameter().
7328         (TypeParameter.DefineType): Just take an EmitContext and no
7329         TypeBuilder/MethodBuilder.  Use the new public API.
7330
7331         * typemanager.cs (TypeManager.AddTypeParameter): Added
7332         `TypeExpr[]' argument; add the interfaces to the
7333         `builder_to_ifaces' hash.
7334         (TypeManager.LookupMemberContainer): For
7335         GenericTypeParameterBuilders, get the TypeParameter from the
7336         `builder_to_type_param'.
7337         (TypeManager.FindMembers): For GenericTypeParameterBuilders, get
7338         the TypeParameter and call FindMembers on it.
7339
7340 2004-04-07  Martin Baulig  <martin@ximian.com>
7341
7342         * class.cs
7343         (MethodCore.GenericMethod): Moved this field here from Method.
7344         (MethodCore.IsDuplicateImplementation): Take the number of type
7345         parameters into account if we're a generic method.
7346
7347         * expression.cs (Invocation.InferTypeArguments): Don't return true
7348         if `arguments' is null; we still need to check whether we actually
7349         don't need to infer anything in this case.
7350         (MemberAccess): Merged the functionality from GenericMemberAccess
7351         into this class.
7352
7353         * generic.cs (GenericMemberAccess): Removed.
7354
7355 2004-04-05  Martin Baulig  <martin@ximian.com>
7356
7357         * decl.cs (MemberCore): For generic classes, interfaces and
7358         structs, `Name' now includes the number of type parameters
7359         ("Stack!1.Node!1").
7360         (DeclSpace.FindType): Removed the `num_type_args' argument; we now
7361         encode the number of type arguments in the type name.
7362
7363         * expression.cs (Expression.MemberLookup): Removed the
7364         `num_type_args' argument; we now encode the number of type
7365         arguments in the type name.
7366
7367         * ecore.cs (SimpleName): Encode the number of type arguments in
7368         the type name itself.
7369
7370         * generic.cs (ConstructedType): Likewise.
7371
7372         * tree.cs (Tree.RecordDecl): Take a `string' instead of a
7373         `MemberName'; we now include the number of type parameters in the
7374         type name.
7375
7376         * typemanager.cs (TypeManager.CheckGeneric): Removed.
7377         (TypeManager.MemberLookup): Removed the
7378         `num_type_args' argument; we now encode the number of type
7379         arguments in the type name.     
7380
7381 2004-04-03  Martin Baulig  <martin@ximian.com>
7382
7383         * decl.cs (MemberCore.ctor): Take a MemberName instead of a sting.
7384         (MemberCore.MemberName): Moved here from MemberBase.
7385         (DeclSpace.SetParameterInfo): Just take the constraints as an
7386         ArrayList; we already have the type parameters in our
7387         `MemberName'; also do the CS0080 reporting here.
7388
7389         * cs-parser.jay (struct_declaration): Use `member_name' instead of
7390         `IDENTIFIER opt_type_parameter_list'; when constructing our
7391         `MemberName', it'll already include our type parameters.
7392         (class_declaration, interface_declaration): Likewise.
7393         (delegate_declaration): Likewise.
7394         (MakeName): Take a MemberName and return a MemberName.
7395         The following two changes are required to avoid shift/reduce conflicts:
7396         (member_name): Don't include a TypeName anymore; ie. this is now
7397         just 'IDENTIFIER opt_type_parameter_list'.
7398         (property_declaration, event_declaration): Use a
7399         `namespace_or_type_name' instead of a `member_name'.            
7400
7401 2004-04-03  Martin Baulig  <martin@ximian.com>
7402
7403         * decl.cs (MemberName): Renamed to `TypeName' and created a new
7404         `MemberName' class.
7405         (TypeName): Formerly known as MemberName.
7406
7407         * namespace.cs (NamespaceEntry.UsingAlias): Take a `TypeName'
7408         instead of a `MemberName'.
7409
7410         * cs-parser.jay (namespace_or_type_name): Create a TypeName.
7411         (member_name): New rule; create a MemberName.
7412
7413 2004-04-02  Martin Baulig  <martin@ximian.com>
7414
7415         * namespace.cs (NamespaceEntry.VerifyUsing): Added error checking
7416         (CS0305 and CS0308).
7417
7418 2004-04-02  Martin Baulig  <martin@ximian.com>
7419
7420         * generic.cs (GenericMemberAccess.ResolveAsTypeStep): Added
7421         support for nested types.
7422
7423 2004-04-02  Martin Baulig  <martin@ximian.com>
7424
7425         * ecore.cs (IAlias): New public interface.
7426         (TypeExpr, TypeExpression): Implement IAlias.
7427         (TypeAliasExpression): New public class.
7428
7429         * namespace.cs (Namespace): Implement IAlias.
7430         (Namespace.Lookup): Return an IAlias instead on an object.
7431         (Namespace.DefineName): Take an IAlias instead of an object.
7432         (NamespaceEntry.AliasEntry.Resolve): Return an IAlias instead of
7433         an object.
7434         (NamespaceEntry.UsingAlias): Take a Membername instead of an
7435         Expression.
7436         (NamespaceEntry.LookupAlias): Return an IAlias instead on an
7437         object.
7438         (NamespaceEntry.Lookup): Likewise.
7439
7440         * rootcontext.cs (RootContext.LookupType): Return a TypeExpr
7441         instead of a Type.      
7442
7443         * decl.cs (DeclSpace): Implement IAlias.
7444         (DeclSpace.LookupAlias): Return an IAlias instead of a string.
7445
7446         * generic.cs (ConstructedType): Improved error checking.
7447
7448 2004-04-02  Martin Baulig  <martin@ximian.com>
7449
7450         * convert.cs: Added type parameter conversions.
7451
7452         * ecore.cs
7453         (UnboxCast.Emit): Emit an `unbox.any' for type params.
7454         (ClassCast.Emit): If the source type is a type parameter, box it.
7455         If the target type is a type parameter, emit an `unbox.any'
7456         instead of a `classcast'.1      
7457
7458 2004-04-01  Martin Baulig  <martin@ximian.com>
7459
7460         * cs-tokenizer.cs (parse_less_than): Allow Token.DOT.
7461
7462 2004-04-01  Martin Baulig  <martin@ximian.com>
7463
7464         * generic.cs (ConstructedType.CheckConstraints): Use
7465         Convert.ImplicitStandardConversionExists(); user-defined implicit
7466         conversions are not allowed according to the spec.
7467
7468 2004-03-30  Martin Baulig  <martin@ximian.com>
7469
7470         * expression.cs (New): Added support for type parameters.
7471
7472         * typemanager.cs
7473         (TypeManager.activator_type): New public static field.
7474         (TypeManager.activator_create_instance): Likewise.
7475
7476 2004-03-30  Martin Baulig  <martin@ximian.com>
7477
7478         * typemanager.cs (TypeManager.HasConstructorConstraint): New
7479         public method.
7480
7481 2004-03-30  Martin Baulig  <martin@ximian.com>
7482
7483         * generic.cs (ConstructedType.CheckConstraints): Actually follow
7484         the spec here: the argument type must be convertible to the
7485         constraints.
7486
7487 2004-03-30  Martin Baulig  <martin@ximian.com>
7488
7489         * generic.cs
7490         (TypeParameter.Define, TypeParameter.DefineMethod): Call
7491         TypeManager.AddTypeParameter().
7492         (ConstructedType.CheckConstraints): Re-enable this and actually
7493         check whether we have a constructor constraint.
7494
7495         * typemanager.cs
7496         (TypeManager.builder_to_type_param): New static field.
7497         (TypeManager.AddTypeParameter): New static method.
7498         (TypeManager.LookupTypeParameter): New public method.
7499
7500 2004-03-30  Martin Baulig  <martin@ximian.com>
7501
7502         * generic.cs (TypeParameter.DefineType): Return a boolean and use
7503         the new API to actually define the constructor constraint.
7504
7505         * typemanager.cs
7506         (TypeManager.new_constraint_attr_type): New static field.
7507         (TypeManager.InitCoreTypes): Initialize it.
7508
7509 2004-03-30  Martin Baulig  <martin@ximian.com>
7510
7511         * generic.cs (Constraints): Completed error checking, use correct
7512         error numbers.
7513
7514 2004-03-29  Martin Baulig  <martin@ximian.com>
7515
7516         * delegate.cs (Delegate.VerifyMethod): Infer type arguments.
7517
7518         * expression.cs (Invocation.InferTypeArguments): Added overloaded
7519         public version which takes a `ParameterData pd' instead of an
7520         `ArrayList args'.
7521
7522 2004-03-29  Martin Baulig  <martin@ximian.com>
7523
7524         * typemanager.cs (TypeManager.IsGenericMethod): Take a MethodBase,
7525         not a MethodInfo.       
7526
7527 2004-03-29  Martin Baulig  <martin@ximian.com>
7528
7529         * expression.cs (Argument.ResolveMethodGroup): If we're a
7530         ConstructedType, call GetMemberAccess() on it.  
7531
7532 2004-03-29  Martin Baulig  <martin@ximian.com>
7533
7534         * class.cs (MethodBase.CheckGenericOverride): New abstract method.
7535         (MethodCore.CheckGenericOverride): When overriding a generic
7536         method, check whether the constraints match.
7537
7538         * support.cs (GenericConstraints): New public interface.
7539         (ParameterData.GenericConstraints): New public method.
7540
7541         * parameter.cs (Parameter.Resolve): Check whether we're a generic
7542         method parameter and compute our constraints if appropriate.
7543         (Parameter.GenericConstraints): New public property.
7544
7545         * generic.cs (Constraints): Implement GenericConstraints.
7546
7547 2004-03-29  Martin Baulig  <martin@ximian.com>
7548
7549         * decl.cs (MemberCache.FindMemberToOverride): Use
7550         `paramTypes [j].Equals (cmpAttrs [j])' instead of `=='.
7551
7552 2004-03-29  Martin Baulig  <martin@ximian.com>
7553
7554         * generic.cs (GenericMethod.Define): Resolve our type parameters.
7555
7556 2004-03-29  Martin Baulig  <martin@ximian.com>
7557
7558         * cs-parser.jay: Report CS0080 instead of -200 ("Constraints are
7559         not allowed on non-generic declarations").
7560
7561 2004-03-29  Martin Baulig  <martin@ximian.com>
7562
7563         * expression.cs (Invocation.InferTypeArguments): Added overloaded
7564         public version of this method.
7565
7566         * class.cs (MethodCore.IsDuplicateImplementation): Use
7567         Invocation.InferTypeArguments() to check this.
7568
7569 2004-03-29  Martin Baulig  <martin@ximian.com>
7570
7571         * convert.cs: Use TypeManager.IsDelegateType() instead of
7572         comparing types correctly.
7573
7574 2004-03-29  Martin Baulig  <martin@ximian.com>
7575
7576         * convert.cs: Use TypeManager.IsSubclassOf() instead of comparing
7577         types directly to make it work for generic instances.
7578
7579         * typemanager.cs (TypeManager.IsSubclassOf): New static method.
7580
7581 2004-03-29  Martin Baulig  <martin@ximian.com>
7582
7583         * typemanager.cs (TypeManager.MayBecomeEqualGenericTypes): Added
7584         support for arrays.     
7585
7586 2004-03-24  Martin Baulig  <martin@ximian.com>
7587
7588         * decl.cs (DeclSpace.FindType): Also use
7589         TypeManager.CheckGeneric() for types from the using clauses.
7590
7591 2004-03-23  Martin Baulig  <martin@ximian.com>
7592
7593         * expression.cs (Invocation.OverloadResolve): Added `bool
7594         may_fail' argument and use it instead of the Location.IsNull() hack.
7595
7596 2004-03-23  Martin Baulig  <martin@ximian.com>
7597
7598         * expression.cs (Invocation.InferType): Use correct type inference
7599         rules here.     
7600
7601 2004-03-23  Martin Baulig  <martin@ximian.com>
7602
7603         * ecore.cs (MethodGroupExpr.Name): Use
7604         TypeManager.CSharpSignature() instead of just the name.
7605
7606         * expression.cs (Invocation.OverloadResolve): Provide better error
7607         reporting.
7608         (Invocation.DoResolve): OverloadResolve() never returns null
7609         without reporting an error, so removed the error -6 reporting here.
7610
7611 2004-03-23  Martin Baulig  <martin@ximian.com>
7612
7613         * typemanager.cs (TypeManager.GetMethodFlags): Fixed the FIXME for
7614         generic methods.
7615
7616         * cs-parser.jay (delegate_declaration): Support generic delegates.
7617
7618         * delegate.cs: Support generic delegates.
7619
7620 2004-03-22  Martin Baulig  <martin@ximian.com>
7621
7622         * expression.cs (Invocation.InferParamsTypeArguments): New static
7623         method; does type inference for params arguments.
7624
7625 2004-03-21  Martin Baulig  <martin@ximian.com>
7626
7627         * typemanager.cs (TypeManager.IsGenericMethod): New public static
7628         method; checks whether a method is a generic method.    
7629
7630         * expression.cs (Invocation.InferTypeArguments): New static method;
7631         infer type arguments for generic method invocation.
7632
7633         * ecore.cs (MethodGroupExpr.HasTypeArguments): New public
7634         property; we set this to true if we're resolving a generic method
7635         invocation and the user specified type arguments, ie. we're not
7636         doing type inference.
7637
7638 2004-03-20  Martin Baulig  <martin@ximian.com>
7639
7640         * class.cs (MethodData.DeclaringType): New public property.
7641         (MethodData.Define): Set DeclaringType here.
7642         (Operator.Define): Use OperatorMethod.MethodData.DeclaringType
7643         instead of OperatorMethodBuilder.DeclaringType.
7644
7645 2004-03-20  Martin Baulig  <martin@ximian.com>
7646
7647         * cs-tokenizer.cs (xtoken): Return a special
7648         Token.DEFAULT_OPEN_PARENS for "`default' followed by open parens".
7649
7650         * cs-parser.jay (default_value_expression): Switch to the new
7651         syntax (14.5.13).
7652
7653 2004-03-19  Martin Baulig  <martin@ximian.com>
7654
7655         * decl.cs (MemberName): New class.  We use this to "construct"
7656         namespace_or_type_name's.
7657
7658         * generics.cs (TypeArguments.GetDeclarations): New public method;
7659         returns the type arguments as a string[] and reports a CS0081 if
7660         one of them is not an identifier.
7661
7662         * class.cs (MemberBase): The .ctor now takes the name as a
7663         MemberName instead of a string.
7664         (MemberBase.ExplicitInterfaceName): Changed type from string to
7665         Expression.
7666         (MemberBase.DoDefine): If we're an explicit implementation, the
7667         InterfaceType may be a generic instance.
7668
7669         * cs-parser.jay (namespace_or_type_name): Return a MemberName.
7670         (namespace_name): Call MemberName.GetName () to transform the
7671         MemberName into a string and ensure we don't have any type
7672         arguments.
7673         (type_name): Call MemberName.GetTypeExpression() to transfrom the
7674         MemberName into an expression.
7675         (method_header): Use namespace_or_type_name instead of member_name.     
7676
7677 2004-04-07  Miguel de Icaza  <miguel@ximian.com>
7678
7679         * rootcontext.cs: Add new types to the boot resolution.
7680
7681         * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
7682         MulticastDelegate is not allowed.
7683
7684         * typemanager.cs: Add new types to lookup: System.TypedReference
7685         and ArgIterator.
7686
7687         * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
7688         check for TypedReference or ArgIterator, they are not allowed. 
7689
7690         * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
7691         makes us properly catch 1510 in some conditions (see bug 56016 for
7692         details). 
7693
7694 2004-04-06  Bernie Solomon  <bernard@ugsolutions.com>
7695
7696         * CryptoConvert.cs: update from corlib version
7697         with endian fixes.
7698
7699 2004-04-05  Miguel de Icaza  <miguel@ximian.com>
7700
7701         * class.cs (Indexer.Define): Check indexername declaration
7702
7703 2004-04-05  Marek Safar  <marek.safar@seznam.cz>
7704
7705         * attribute.cs (IsClsCompliant): Fixed problem with handling
7706         all three states (compliant, not-compliant, undetected).
7707
7708 2004-03-30  Marek Safar  <marek.safar@seznam.cz>
7709
7710         * attribute.cs (Attribute): Location is now public.
7711         (Resolve): Store resolved arguments (pos_values) in attribute class.
7712         Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
7713         (GetClsCompliantAttributeValue): New method that gets
7714         CLSCompliantAttribute value.
7715         (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
7716         if exists else null.
7717         (AttributeTester): New class for CLS-Compliant verification routines.
7718
7719         * class.cs (Emit): Add CLS-Compliant verification.
7720         (Method.GetSignatureForError): Implemented.
7721         (Constructor.GetSignatureForError): Implemented
7722         (Constructor.HasCompliantArgs): Returns if constructor has
7723         CLS-Compliant arguments.
7724         (Constructor.Emit): Override.
7725         (Construcor.IsIdentifierClsCompliant): New method; For constructors
7726         is needed to test only parameters.
7727         (FieldBase.GetSignatureForError): Implemented.
7728         (TypeContainer): New member for storing base interfaces.
7729         (TypeContainer.FindMembers): Search in base interfaces too.
7730
7731         * codegen.cs (GetClsComplianceAttribute): New method that gets
7732         assembly or module CLSCompliantAttribute value.
7733         (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
7734         for assembly.
7735         (ModuleClass.Emit): Add error 3012 test.
7736
7737         * const.cs (Emit): Override and call base for CLS-Compliant tests.
7738
7739         * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
7740         state for all decl types.
7741         (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
7742         if CLS-Compliant tests are required.
7743         (IsClsCompliaceRequired): New method. Analyze whether code
7744         must be CLS-Compliant.
7745         (IsExposedFromAssembly): New method. Returns true when MemberCore
7746         is exposed from assembly.
7747         (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
7748         value or gets cached value.
7749         (HasClsCompliantAttribute): New method. Returns true if MemberCore
7750         is explicitly marked with CLSCompliantAttribute.
7751         (IsIdentifierClsCompliant): New abstract method. This method is
7752         used to testing error 3005.
7753         (IsIdentifierAndParamClsCompliant): New method. Common helper method
7754         for identifier and parameters CLS-Compliant testing.
7755         (VerifyClsCompliance): New method. The main virtual method for
7756         CLS-Compliant verifications.
7757         (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
7758         null. I don't know why is null (too many public members !).
7759         (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
7760         and get value of first CLSCompliantAttribute that found.
7761
7762         * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
7763         (VerifyClsCompliance): Override and add extra tests.
7764
7765         * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
7766         clscheck- disable CLS-Compliant verification event if assembly is has
7767         CLSCompliantAttribute(true).
7768
7769         * enum.cs (Emit): Override and call base for CLS-Compliant tests.
7770         ApllyAttribute is now called in emit section as in the other cases.
7771         Possible future Emit integration.
7772         (IsIdentifierClsCompliant): New override.
7773         (VerifyClsCompliance): New override.
7774         (GetEnumeratorName): Returns full enum name.
7775
7776         * parameter.cs (GetSignatureForError): Implemented.
7777
7778         * report.cs (WarningData): New struct for Warning message information.
7779         (LocationOfPreviousError): New method.
7780         (Warning): New method. Reports warning based on the warning table.
7781         (Error_T): New method. Reports error based on the error table.
7782
7783         * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
7784         verifications are done here.
7785
7786         * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
7787
7788         * typemanager.cs (cls_compliant_attribute_type): New member thath holds
7789         CLSCompliantAttribute.
7790         (all_imported_types): New member holds all imported types from other
7791         assemblies.
7792         (LoadAllImportedTypes): New method fills static table with exported types
7793         from all referenced assemblies.
7794         (Modules): New property returns all assembly modules.
7795
7796 2004-03-30  Miguel de Icaza  <miguel@ximian.com>
7797
7798         * cs-parser.jay: Add a rule to catch wrong event syntax instead of
7799         throwing a parser error.
7800
7801         * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
7802         which removes the hardcoded get_/set_ prefixes for properties, as
7803         IL allows for the properties to be named something else.  
7804
7805         Bug #56013
7806
7807         * expression.cs: Do not override operand before we know if it is
7808         non-null.  Fix 56207
7809
7810 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
7811
7812         * typemanager.cs: support for pinned variables.
7813
7814 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
7815
7816         * decl.cs, typemanager.cs: Avoid using an arraylist
7817         as a buffer if there is only one result set.
7818
7819 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
7820
7821         * expression.cs: Make sure you cant call a static method
7822         with an instance expression, bug #56174.
7823
7824 2004-03-29  Miguel de Icaza  <miguel@ximian.com>
7825
7826         * class.cs (IsDuplicateImplementation): Improve error reporting to
7827         flag 663 (method only differs in parameter modifier).
7828
7829         * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
7830         in preprocessor directives.
7831
7832         * location.cs (LookupFile): Allow for the empty path.
7833
7834         * attribute.cs (DefinePInvokeMethod): Fix 56148;  I would like a
7835         better approach for some of that patch, but its failing with the
7836         CharSet enumeration.  For now try/catch will do.
7837
7838         * typemanager.cs: Do not crash if a struct does not have fields.
7839         Fixes 56150.
7840
7841 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
7842
7843         * expression.cs: cs0213, cant fix a fixed expression.
7844         fixes 50231.
7845
7846 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
7847
7848         * cs-parser.jay: detect invalid embeded statements gracefully.
7849         bug #51113.
7850
7851 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
7852
7853         * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
7854         As a regex:
7855         s/
7856         the invocation type may not be a subclass of the tye of the item/
7857         The type of the item must be a subclass of the invocation item.
7858         /g
7859
7860         Fixes bug #50820.
7861
7862 2004-03-25  Sebastien Pouliot  <sebastien@ximian.com>
7863
7864         * attribute.cs: Added methods to get a string and a bool from an
7865         attribute. Required to information from AssemblyKeyFileAttribute,
7866         AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
7867         * codegen.cs: Modified AssemblyName creation to include support for
7868         strongnames. Catch additional exceptions to report them as CS1548.
7869         * compiler.csproj: Updated include CryptoConvert.cs.
7870         * compiler.csproj.user: Removed file - user specific configuration.
7871         * CryptoConvert.cs: New. A COPY of the class CryptoConvert from 
7872         Mono.Security assembly. The original class is maintained and tested in
7873         /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
7874         * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
7875         like CSC 8.0 (C# v2) supports.
7876         * Makefile: Added CryptoConvert.cs to mcs sources.
7877         * rootcontext.cs: Added new options for strongnames.
7878
7879 2004-03-24 Ben Maurer  <bmaurer@users.sourceforge.net>
7880
7881         * driver.cs: For --expect-error, report error code `2'
7882         if the program compiled with no errors, error code `1' if
7883         it compiled with an error other than the one expected.
7884
7885 2004-03-24  Sebastien Pouliot  <sebastien@ximian.com>
7886
7887         * compiler.csproj: Updated for Visual Studio .NET 2003.
7888         * compiler.csproj.user: Updated for Visual Studio .NET 2003.
7889         * compiler.sln: Updated for Visual Studio .NET 2003.
7890
7891 2004-03-24  Ravi Pratap M  <ravi@ximian.com>
7892
7893         * expression.cs: Fix bug #47234. We basically need to apply the
7894         rule that we prefer the conversion of null to a reference type
7895         when faced with a conversion to 'object' (csc behaviour).
7896
7897 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
7898
7899         * statement.cs: Shorter form for foreach, eliminates
7900         a local variable. r=Martin.
7901
7902 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
7903
7904         * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
7905         checks if we can use brtrue/brfalse to test for 0.
7906         * expression.cs: use the above in the test for using brtrue/brfalse.
7907         cleanup code a bit.
7908
7909 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
7910
7911         * expression.cs: Rewrite string concat stuff. Benefits:
7912
7913         - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
7914         - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
7915         rather than a concat chain.
7916
7917         * typemanager.cs: Add lookups for more concat overloads.
7918
7919 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
7920
7921         * expression.cs: Emit shorter il code for array init.
7922
7923         newarr
7924         dup
7925         // set 1
7926
7927         // set 2
7928
7929         newarr
7930         stloc.x
7931
7932         ldloc.x
7933         // set 1
7934
7935         ldloc.x
7936         // set 2
7937
7938 2004-03-22 Ben Maurer  <bmaurer@users.sourceforge.net>
7939
7940         * statement.cs: Before, two switch blocks would be merged if the
7941         total size of the blocks (end_item - begin_item + 1) was less than
7942         two times the combined sizes of the blocks.
7943
7944         Now, it will only merge if after the merge at least half of the
7945         slots are filled.
7946
7947         fixes 55885.
7948
7949 2004-03-20  Atsushi Enomoto  <atsushi@ximian.com>
7950
7951         * class.cs : csc build fix for GetMethods(). See bug #52503.
7952
7953 2004-03-20 Ben Maurer  <bmaurer@users.sourceforge.net>
7954
7955         * expression.cs: Make sure fp comparisons work with NaN.
7956         This fixes bug #54303. Mig approved this patch a long
7957         time ago, but we were not able to test b/c the runtime
7958         had a related bug.
7959
7960 2004-03-19  Miguel de Icaza  <miguel@ximian.com>
7961
7962         * ecore.cs (TypExpr.GetHashCode): implement this overload. 
7963
7964 2004-03-19  Martin Baulig  <martin@ximian.com>
7965
7966         * class.cs (MemberCore.IsDuplicateImplementation): Check whether
7967         two overloads may unify for some type parameter substitutions and
7968         report a CS0408 if appropriate.
7969
7970 2004-03-19  Martin Baulig  <martin@ximian.com>
7971
7972         * class.cs (MemberCore.IsDuplicateImplementation): Report the
7973         error here and not in our caller.
7974
7975 2004-03-19  Martin Baulig  <martin@ximian.com>
7976
7977         * interface.cs: Completely killed this file.
7978         (Interface): We're now a TypeContainer and live in class.cs.
7979
7980         * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
7981         argument; we're now also called for interfaces.
7982         (TypeContainer.DefineMembers): Allow this method being called
7983         multiple times.
7984         (TypeContainer.GetMethods): New public method; formerly known as
7985         Interface.GetMethod().  This is used by PendingImplementation.
7986         (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
7987         it's now private and non-static.
7988         (Interface): Moved this here; it's now implemented similar to
7989         Class and Struct.
7990         (Method, Property, Event, Indexer): Added `bool is_interface'
7991         argument to their .ctor's.
7992         (MemberBase.IsInterface): New public field.
7993
7994         * cs-parser.jay: Create normal Method, Property, Event, Indexer
7995         instances instead of InterfaceMethod, InterfaceProperty, etc.
7996         (opt_interface_base): Removed; we now use `opt_class_base' instead.
7997         (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
7998
7999 2004-03-19  Martin Baulig  <martin@ximian.com>
8000
8001         * class.cs (MethodCore.IsDuplicateImplementation): New private
8002         method which does the CS0111 checking.
8003         (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
8004         Use IsDuplicateImplementation().
8005
8006 2004-03-17 Ben Maurer  <bmaurer@users.sourceforge.net>
8007
8008         * decl.cs (FindMemberToOverride): New method to find the correct
8009         method or property to override in the base class.
8010         * class.cs
8011             - Make Method/Property use the above method to find the
8012               version in the base class.
8013             - Remove the InheritableMemberSignatureCompare as it is now
8014               dead code.
8015
8016         This patch makes large code bases much faster to compile, as it is
8017         O(n) rather than O(n^2) to do this validation.
8018
8019         Also, it fixes bug 52458 which is that nested classes are not
8020         taken into account when finding the base class member.
8021
8022         Reviewed/Approved by Martin.
8023
8024 2004-03-17  Martin Baulig  <martin@ximian.com>
8025
8026         * expression.cs (MemberAccess.DoResolve): Take the parent's number
8027         of type arguments into account; use the `real_num_type_args'
8028         approach like in DoResolveAsTypeStep().
8029
8030         * generic.cs (GenericMemberAccess.DoResolve): Make this work for
8031         nested types.
8032
8033 2004-03-17  Marek Safar  <marek.safar@seznam.cz>
8034
8035         * interface.cs: In all interface classes removed redundant
8036         member initialization.
8037
8038 2004-03-16  Martin Baulig  <martin@ximian.com>
8039
8040         * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
8041
8042 2004-03-15  Miguel de Icaza  <miguel@ximian.com>
8043
8044         * decl.cs (DefineTypeAndParents): New helper method to define a
8045         type's containers before the type itself is defined;  This is a
8046         bug exposed by the recent changes to Windows.Forms when an
8047         implemented interface was defined inside a class that had not been
8048         built yet.   
8049
8050         * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
8051
8052         (Check): Loop correctly to report errors modifiers
8053         (UNSAFE was not in the loop, since it was the same as TOP).
8054
8055         * interface.cs: Every interface member now takes a ModFlags,
8056         instead of a "is_new" bool, which we set on the base MemberCore. 
8057
8058         Every place where we called "UnsafeOk" in the interface, now we
8059         call the proper member (InterfaceMethod.UnsafeOK) instead to get
8060         the unsafe settings from the member declaration instead of the
8061         container interface. 
8062
8063         * cs-parser.jay (opt_new): Allow unsafe here per the spec. 
8064
8065         * pending.cs (TypeAndMethods): Add `get_indexer_name' and
8066         `set_indexer_name' to the pending bits (one per type).
8067
8068         We fixed a bug today that was picking the wrong method to
8069         override, since for properties the existing InterfaceMethod code
8070         basically ignored the method name.  Now we make sure that the
8071         method name is one of the valid indexer names.
8072
8073 2004-03-14  Gustavo Giráldez  <gustavo.giraldez@gmx.net>
8074  
8075         * support.cs (SeekableStreamReader): Keep track of stream byte
8076         positions and don't mix them with character offsets to the buffer.
8077
8078         Patch from Gustavo Giráldez
8079
8080 2004-03-15  Marek Safar  <marek.safar@seznam.cz>
8081
8082         * interface.cs (InterfaceSetGetBase): Removed double member
8083         initialization, base class does it as well.
8084
8085 2004-03-13  Martin Baulig  <martin@ximian.com>
8086
8087         * class.cs: Reverted Miguel's latest commit; it makes mcs crash
8088         when compiling corlib.
8089
8090 2004-03-13  Miguel de Icaza  <miguel@ximian.com>
8091
8092         * convert.cs (ExplicitConversion): We were reporting an error on
8093         certain conversions (object_type source to a value type, when the
8094         expression was `null') before we had a chance to pass it through
8095         the user defined conversions.
8096
8097         * driver.cs: Replace / and \ in resource specifications to dots.
8098         Fixes 50752
8099
8100         * class.cs: Add check for duplicate operators.  Fixes 52477
8101
8102 2004-03-11  Miguel de Icaza  <miguel@ximian.com>
8103
8104         * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
8105         that are in the middle of the statements, not only at the end.
8106         Fixes #54987
8107
8108         * class.cs (TypeContainer.AddField): No longer set the
8109         `HaveStaticConstructor' flag, now we call it
8110         `UserDefineStaticConstructor' to diferentiate the slightly
8111         semantic difference.
8112
8113         The situation is that we were not adding BeforeFieldInit (from
8114         Modifiers.TypeAttr) to classes that could have it.
8115         BeforeFieldInit should be set to classes that have no static
8116         constructor. 
8117
8118         See:
8119
8120         http://www.yoda.arachsys.com/csharp/beforefieldinit.html
8121
8122         And most importantly Zoltan's comment:
8123
8124         http://bugzilla.ximian.com/show_bug.cgi?id=44229
8125
8126         "I think beforefieldinit means 'it's ok to initialize the type sometime 
8127          before its static fields are used', i.e. initialization does not need
8128          to be triggered by the first access to the type. Setting this flag
8129          helps the JIT to compile better code, since it can run the static
8130          constructor at JIT time, and does not need to generate code to call it
8131          (possibly lots of times) at runtime. Unfortunately, mcs does not set
8132          this flag for lots of classes like String. 
8133          
8134          csc sets this flag if the type does not have an explicit static 
8135          constructor. The reasoning seems to be that if there are only static
8136          initalizers for a type, and no static constructor, then the programmer
8137          does not care when this initialization happens, so beforefieldinit
8138          can be used.
8139          
8140          This bug prevents the AOT compiler from being usable, since it 
8141          generates so many calls to mono_runtime_class_init that the AOT code
8142          is much slower than the JITted code. The JITted code is faster, 
8143          because it does not generate these calls if the vtable is type is
8144          already initialized, which is true in the majority of cases. But the
8145          AOT compiler can't do this."
8146
8147 2004-03-10  Miguel de Icaza  <miguel@ximian.com>
8148
8149         * class.cs (MethodData.Emit): Refactor the code so symbolic
8150         information is generated for destructors;  For some reasons we
8151         were taking a code path that did not generate symbolic information
8152         before. 
8153
8154 2004-03-11 Ben Maurer  <bmaurer@users.sourceforge.net>
8155
8156         * class.cs: Create a Constructor.CheckBase method that
8157         takes care of all validation type code. The method
8158         contains some code that was moved from Define.
8159
8160         It also includes new code that checks for duplicate ctors.
8161         This fixes bug #55148.
8162
8163 2004-03-09  Joshua Tauberer <tauberer@for.net>
8164
8165         * expression.cs (ArrayCreation): Fix: More than 6 nulls in
8166         a { ... }-style array creation invokes EmitStaticInitializers
8167         which is not good for reference-type arrays.  String, decimal
8168         and now null constants (NullCast) are not counted toward
8169         static initializers.
8170
8171 2004-03-05  Martin Baulig  <martin@ximian.com>
8172
8173         * location.cs (SourceFile.HasLineDirective): New public field;
8174         specifies whether the file contains or is referenced by a "#line"
8175         directive.
8176         (Location.DefineSymbolDocuments): Ignore source files which
8177         either contain or are referenced by a "#line" directive.        
8178
8179 2004-02-29  Ben Maurer <bmaurer@users.sourceforge.net>
8180
8181         * class.cs (Method.CheckBase): Avoid using FindMembers, we have
8182         direct access to our parent, so check the method inline there.
8183
8184 2004-02-27 Ben Maurer  <bmaurer@users.sourceforge.net>
8185
8186         * expression.cs (Invocation.EmitCall): Miguel's last commit
8187         caused a regression. If you had:
8188
8189             T t = null;
8190             t.Foo ();
8191
8192         In Foo the implict this would be null.
8193
8194 2004-02-27  Miguel de Icaza  <miguel@ximian.com>
8195
8196         * expression.cs (Invocation.EmitCall): If the method is not
8197         virtual, do not emit a CallVirt to it, use Call.
8198
8199         * typemanager.cs (GetFullNameSignature): Improve the method to
8200         cope with ".ctor" and replace it with the type name.
8201
8202         * class.cs (ConstructorInitializer.Resolve): Now the method takes
8203         as an argument the ConstructorBuilder where it is being defined,
8204         to catch the recursive constructor invocations.
8205
8206 2004-03-16  Martin Baulig  <martin@ximian.com>
8207
8208         * expression.cs (MemberAccess.DoResolve): If `expr' resolved to a
8209         ConstructedType, call ResolveType() on it to get the type rather
8210         than just using `expr.Type'.
8211
8212 2004-03-16  Martin Baulig  <martin@ximian.com>
8213
8214         * generics.cs (ConstructedType.GetMemberAccess): Take the
8215         EmitContext instead on the TypeExpr and use
8216         ec.TypeContainer.CurrentType/ec.ContainerType.
8217
8218 2004-03-16  Martin Baulig  <martin@ximian.com>
8219
8220         * ecore.cs (SimpleName.DoResolveAsTypeStep): Lookup type
8221         parameters before aliases.
8222
8223 2004-03-16  Martin Baulig  <martin@ximian.com>
8224
8225         * typemanager.cs (TypeManager.MayBecomeEqualGenericInstances):
8226         New oublic function; checks whether two generic instances may become
8227         equal under some instantiations (26.3.1).
8228
8229         * class.cs (TypeContainer.Define): Call
8230         TypeManager.MayBecomeEqualGenericInstances() and report CS0695 on
8231         error.
8232
8233 2004-03-16  Martin Baulig  <martin@ximian.com>
8234
8235         * class.cs (TypeContainer.GetClassBases): Moved
8236         Error_TypeParameterAsBase() here and also check whether the base
8237         class is not an attribute.
8238
8239 2004-03-16  Martin Baulig  <martin@ximian.com>
8240
8241         * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
8242
8243 2004-03-16  Martin Baulig  <martin@ximian.com>
8244
8245         * class.cs (Error_TypeParameterAsBase): Use correct error number
8246         here (CS0689).  
8247
8248 2004-03-16  Martin Baulig  <martin@ximian.com>
8249
8250         * decl.cs (DeclSpace.ResolveTypeExpr): Added more error checking
8251         for generics.
8252
8253         * generics.cs (ConstructedType.DoResolveAsTypeStep): Added better
8254         error reporting.
8255
8256 2004-03-15  Martin Baulig  <martin@ximian.com>
8257
8258         * typemanager.cs (TypeManager.GetFullName): New public method.
8259         (TypeManager.MemberLookup): Added `int_num_type_arguments'
8260         argument; only return members with the correct number of type
8261         arguments.
8262         (TypeManager.CheckGeneric): Allow -1 to bypass the check.
8263         (TypeManager.FilterWithClosure): Call CheckGeneric() to check
8264         whether the number of type arguments matches.
8265
8266         * generic.cs (GenericMemberAccess.ResolveAsTypeStep): Allow `expr'
8267         not being a ConstructedType; we can now do "typeof (Foo.Bar<U>)".
8268
8269         * expression.cs (MemberAccess): Added public `NumTypeArguments'
8270         field; it's set by the protected .ctor when we're actually a
8271         GenericMemberAccess.
8272         (MemberAccess.ResolveAsTypeStep): Compute the total number of type
8273         arguments and pass it to MemberLookupFinal ().
8274
8275         * ecore.cs (Expression.MemberLookup): Added `int
8276         num_type_arguments' argument; only return members with the correct
8277         number of type arguments.
8278         (Expression.MemberLookupFailed): Check whether the MemberLookup
8279         failed because we did not have the correct number of type
8280         arguments; report CS0305 in this case.
8281
8282         * decl.cs (DeclSpace.ResolveTypeExpr): Don't report an error if
8283         `e.ResolveAsTypeTerminal()' already did so.
8284
8285 2004-03-15  Martin Baulig  <martin@ximian.com>
8286
8287         * ecore.cs (Expression.ResolveLValue): Allow e.type being null if
8288         we're a ConstructedType; in this case, the caller must report an
8289         error (for instance CS0131).
8290
8291         * generic.cs (TypeArguments): Added Location argument to the .ctor.
8292         (TypeArguments.Resolve): Actually report errors here.
8293
8294 2004-03-15  Miguel de Icaza  <miguel@ximian.com>
8295
8296         * pending.cs (TypeAndMethods): Add `get_indexer_name' and
8297         `set_indexer_name' to the pending bits (one per type).
8298
8299         We fixed a bug today that was picking the wrong method to
8300         override, since for properties the existing InterfaceMethod code
8301         basically ignored the method name.  Now we make sure that the
8302         method name is one of the valid indexer names.
8303
8304 2004-03-15  Martin Baulig  <martin@ximian.com>
8305
8306         * typemanager.cs (TypeManager.IndexerPropertyName): Added support
8307         for generic instances.
8308
8309 2004-03-13  Martin Baulig  <martin@ximian.com>
8310
8311         * class.cs (TypeContainer.DefineType): Call
8312         TypeManager.AddUserType() immediately after creating the
8313         TypeBuilder; pass all type parameters when creating the
8314         CurrentType.
8315
8316         * decl.cs (DeclSpace.FindNestedType): New public method.
8317         (DeclSpace.FindType): Added `int num_type_args' argument; only
8318         return types with the correct number of type parameters.
8319         (DeclSpace.CountTypeParams): New public property.
8320
8321         * ecore.cs (SimpleName.ctor): Added overloaded version which takes
8322         the number of type parameters; defaults to zero.
8323
8324         * generic.cs (TypeArguments.Count): New public property.
8325         (ConstructedType.DoResolveAsTypeStep): First call
8326         ds.FindNestedType() to find out whether we're nested in the
8327         current generic type; in this case, we inherit all type parameters
8328         from the current class.
8329
8330         * rootcontext.cs (RootContext.NamespaceLookup): Added `int
8331         num_type_args' argument.
8332         (RootContext.LookupType): Added overloaded version which takes the
8333         number of type arguments; only return types with the correct
8334         number of type arguments.
8335
8336         * typemanager.cs (TypeManager.CheckGeneric): New public function;
8337         checks whether `Type t' has `int num_type_args'.
8338
8339 2004-03-13  Martin Baulig  <martin@ximian.com>
8340
8341         * generic.cs (GenericMethod.DefineType): New method; calls
8342         DefineType() on all the type parameters.
8343
8344         * class.cs (MethodData.ctor): Added `GenericMethod generic' argument.
8345         (MethodData.Define): If we're a generic method, call
8346         GenericMethod.DefineType() to define the type parameters.       
8347
8348 2004-03-10  Martin Baulig  <martin@ximian.com>
8349
8350         * pending.cs (Pending.InterfaceMethod): Use TypeManager.IsEqual()
8351         instead of IsAssignableFrom.    
8352
8353 2004-03-10  Martin Baulig  <martin@ximian.com>
8354
8355         * ecore.cs (FieldExpr.ctor): Use TypeManager.TypeToCoreType().
8356
8357         * support.cs (ParameterData.HasArrayParameter): New property.
8358         (ReflectionParameters.ctor): Take a MethodBase instead of a
8359         ParameterInfo[].  If we have any type parameters, get the generic
8360         method definition and ask it whether we have variable arguments.
8361
8362 2004-02-26  Miguel de Icaza  <miguel@ximian.com>
8363
8364         * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
8365         routines to check if a type is an enumerable/enumerator allow
8366         classes that implement the IEnumerable or IEnumerator interfaces.
8367
8368         * class.cs (Property, Operator): Implement IIteratorContainer, and
8369         implement SetYields.
8370
8371         (Property.Define): Do the block swapping for get_methods in the
8372         context of iterators.   We need to check if Properties also
8373         include indexers or not.
8374
8375         (Operator): Assign the Block before invoking the
8376         OperatorMethod.Define, so we can trigger the Iterator code
8377         replacement. 
8378
8379         * cs-parser.jay (SimpleIteratorContainer): new helper class.  Both
8380         Property and Operator classes are not created when we parse the
8381         declarator but until we have the block completed, so we use a
8382         singleton SimpleIteratorContainer.Simple to flag whether the
8383         SetYields has been invoked.
8384
8385         We propagate this setting then to the Property or the Operator to
8386         allow the `yield' to function.
8387
8388 2004-02-25  Marek Safar  <marek.safar@seznam.cz>
8389
8390         * codegen.cs: Implemented attribute support for modules.
8391         New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
8392         Assembly/Module functionality.
8393
8394         * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
8395         interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
8396         Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
8397
8398 2004-02-16  Marek Safar  <marek.safar@seznam.cz>
8399
8400         * interface.cs (FindMembers): The operation is performed on all base
8401         interfaces and not only on the first. It is required for future CLS Compliance patch.
8402
8403 2004-02-12 Ben Maurer  <bmaurer@users.sourceforge.net>
8404
8405         * statement.cs, codegen.cs:
8406         This patch deals with patterns such as:
8407
8408         public class List : IEnumerable {
8409
8410                 public MyEnumerator GetEnumerator () {
8411                         return new MyEnumerator(this);
8412                 }
8413
8414                 IEnumerator IEnumerable.GetEnumerator () {
8415                         ...
8416                 }
8417                 
8418                 public struct MyEnumerator : IEnumerator {
8419                         ...
8420                 }
8421         }
8422
8423         Before, there were a few things we did wrong:
8424         1) we would emit callvirt on a struct, which is illegal
8425         2) we emited ldarg when we needed to emit ldarga
8426         3) we would mistakenly call the interface methods on an enumerator
8427         type that derived from IEnumerator and was in another assembly. For example:
8428
8429         public class MyEnumerator : IEnumerator
8430
8431         Would have the interface methods called, even if there were public impls of the
8432         method. In a struct, this lead to invalid IL code.
8433
8434 2004-02-11  Marek Safar  <marek.safar@seznam.cz>
8435
8436         * const.cs: Const is now derived from FieldBase. Method EmitConstant name
8437           renamed to Emit.
8438
8439         * delegate.cs (Define): Fixed crash when delegate type is undefined.
8440
8441 2004-02-11  Miguel de Icaza  <miguel@ximian.com>
8442
8443         * cs-parser.jay: Fix small regression: we were not testing V2
8444         compiler features correctly.
8445
8446         * interface.cs: If the emit context is null, then create one
8447
8448 2004-02-09  Marek Safar  <marek.safar@seznam.cz>
8449
8450         * decl.cs (GetSignatureForError): New virtual method to get full name
8451           for error messages.
8452
8453         * attribute.cs (IAttributeSupport): New interface for attribute setting.
8454           Now it is possible to rewrite ApplyAttributes method to be less if/else.
8455
8456         * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
8457           Duplicated members and code in these classes has been removed.
8458           Better encapsulation in these classes.
8459
8460 2004-02-07  Miguel de Icaza  <miguel@ximian.com>
8461
8462         * assign.cs (Assign.DoResolve): When dealing with compound
8463         assignments, there is a new rule in ECMA C# 2.4 (might have been
8464         there before, but it is documented here) that states that in:
8465
8466         a op= b;
8467
8468         If b is of type int, and the `op' is a shift-operator, then the
8469         above is evaluated as:
8470
8471         a = (int) a op b 
8472
8473         * expression.cs (Binary.ResolveOperator): Instead of testing for
8474         int/uint/long/ulong, try to implicitly convert to any of those
8475         types and use that in pointer arithmetic.
8476
8477         * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
8478         method to print information for from the type, not from the
8479         null-method we were given.
8480
8481 2004-02-01  Duncan Mak  <duncan@ximian.com>
8482
8483         * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
8484         parsing for cmd, fixes bug #53694.
8485
8486 2004-02-04  Marek Safar  <marek.safar@seznam.cz>
8487
8488         * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
8489         in the member name duplication tests. Property and operator name duplication
8490         was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
8491
8492 2004-02-03  Marek Safar  <marek.safar@seznam.cz>
8493
8494         * interface.cs (PopulateMethod): Fixed crash when interface method
8495         returns not existing type (error test cs0246-3.cs).
8496
8497 2004-02-02  Ravi Pratap M <ravi@ximian.com>
8498
8499         * cs-parser.jay (interface_accessors): Re-write actions to also
8500         store attributes attached to get and set methods. Fix spelling
8501         while at it.
8502
8503         (inteface_property_declaration): Modify accordingly.
8504
8505         (InterfaceAccessorInfo): New helper class to store information to pass
8506         around between rules that use interface_accessors.
8507
8508         * interface.cs (Emit): Apply attributes on the get and set
8509         accessors of properties and indexers too.
8510
8511         * attribute.cs (ApplyAttributes): Modify accordingly to use the
8512         right MethodBuilder when applying attributes to the get and set accessors.
8513
8514 2004-01-31  Miguel de Icaza  <miguel@ximian.com>
8515
8516         * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
8517
8518 2004-01-26  Miguel de Icaza  <miguel@ximian.com>
8519
8520         * cs-tokenizer.cs: Handle #line hidden from PDC bits.
8521
8522 2004-01-25  Miguel de Icaza  <miguel@ximian.com>
8523
8524         * cs-parser.jay: Remove YIELD token, instead use the new grammar
8525         changes that treat `yield' specially when present before `break'
8526         or `return' tokens.
8527
8528         * cs-tokenizer.cs: yield is no longer a keyword.
8529
8530 2004-01-23  Marek Safar  <marek.safar@seznam.cz>
8531
8532         * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
8533         setting for default constructors.
8534         For default constructors are almost every time set wrong Modifier. The
8535         generated IL code has been alright. But inside mcs this values was
8536         wrong and this was reason why several of my CLS Compliance tests
8537         failed.
8538
8539 2004-02-27  Martin Baulig  <martin@ximian.com>
8540
8541         * generics.cs (ConstructedType.ResolveType): Make the nested type
8542         stuff actually work.
8543
8544 2004-02-25  Martin Baulig  <martin@ximian.com>
8545
8546         * decl.cs (DeclSpace.CurrentTypeParameters): New protected
8547         property; returns the type parameters just from the current type,
8548         ie. with the ones from outer classes.
8549         (DeclSpace.LookupGeneric): First search in the current class, then
8550         in outer classes.
8551         (DeclSpace.initialize_type_params): When hiding a type parameter
8552         from an outer class, put it into the `type_param_list' anyways.
8553
8554         * expression.cs (MemberAccess.expr): Made this field protected.
8555
8556         * class.cs (TypeContainer.Define): The `CurrentType' just contains
8557         the type parameters from the current class.
8558
8559         * generic.cs (ConstructedType.ResolveType): Support nested generic
8560         types by taking the type parameters which we inherit from outer
8561         classes into account.
8562         (GenericMemberAccess.ResolveAsTypeStep): Override this and added
8563         support for nested generic types.
8564
8565 2004-02-23  Martin Baulig  <martin@ximian.com>
8566
8567         * decl.cs (DeclSpace.IsGeneric): Make this a property instead of a
8568         field and check whether we're nested inside a generic type.
8569         (DeclSpace.ResolveType): If we're resolving to a generic type
8570         definition, create a ConstructedType and return its resolved type.
8571         (DeclSpace.initialize_type_params): New private method;
8572         initializes the `type_param_list' field from the type parameters
8573         from this and all enclosing classes.
8574         (DeclSpace.TypeParameters): Call initialize_type_params() unless
8575         we're already initialized.
8576
8577 2004-02-23  Martin Baulig  <martin@ximian.com>
8578
8579         * class.cs (Method.Define): Create the generic method before
8580         calling DoDefine().
8581         (Memberbase.DoDefine): Added DeclSpace argument (in addition to
8582         the TypeContainer one); we use this for generic methods.
8583
8584         * decl.cs (CheckAccessLevel): If we're a GenericMethod, use our
8585         parent's TypeBuilder.
8586
8587 2004-02-18  Martin Baulig  <martin@ximian.com>
8588
8589         * ecore.cs (FieldExpr.DoResolveLValue): Use TypeManager.IsEqual()
8590         to check for equality.
8591
8592 2004-02-05  Martin Baulig  <martin@ximian.com>
8593
8594         * ecore.cs (FieldExpr.DoResolveLValue): If we have an
8595         `ec.TypeContainer.CurrentType', use it instead of
8596         `ec.ContainerType' to check whether we're in the type's ctor.
8597
8598 2004-01-29  Martin Baulig  <martin@ximian.com>
8599
8600         * expression.cs (Invocation.DoResolve): If we're a
8601         `ConstructedType', then we're actually a generic method, so
8602         rewrite the expr as a GenericMemberAccess.
8603
8604         * cs-parser.jay (member_name): Don't use `namespace_or_type_name'
8605         here; manually parse it into a string.
8606
8607 2004-01-28  Martin Baulig  <martin@ximian.com>
8608
8609         * typemanager.cs (TypeManager.IsEqual): New static method.
8610         (TypeManager.FilterWithClosure): Call TypeManager.IsEqual() to
8611         check for equality instead of using `=='.
8612
8613 2004-01-26  Martin Baulig  <martin@ximian.com>
8614
8615         * decl.cs (DeclSpace.CurrentType): New public field.
8616
8617         * expression.cs (This.ResolveBase): If we have an
8618         `ec.TypeContainer.CurrentType', use it instead of
8619         `ec.ContainerType'.
8620
8621         * class.cs (TypeContainer.DefineType): If we're a generic type,
8622         create the `CurrentType' (unresolved).
8623         (TypeContainer.GenericType): New private field.
8624         (TypeContainer.DefineMembers): If we have a `CurrentType', resolve
8625         it and store it in `GenericType' before creating the MemberCache.
8626         (TypeContainer.GetMembers): If we have a `GenericType', call
8627         TypeManager.FindMembers() on it.
8628
8629         * interface.cs (Interface.GenericType): New private field.
8630         (Interface.DefineType): If we're a generic type, create the
8631         `CurrentType' (unresolved).
8632         (Interface.DefineMembers): If we have a `CurrentType', resolve it
8633         and store it in `GenericType' before creating the MemberCache.
8634         (Interface.GetMembers): If we have a `GenericType', call
8635         TypeManager.FindMembers() on it.
8636
8637 2004-01-22  Martin Baulig  <martin@ximian.com>
8638
8639         * cs-parser.jay (namespace_or_type_name): Return an Expression,
8640         not a QualifiedIdentifier.  This is what `type_name_expression'
8641         was previously doing.
8642         (type_name_expression): Removed; the code is now in
8643         `namespace_or_type_name'.
8644         (qualified_identifier): Removed, use `namespace_or_type_name'
8645         instead.
8646         (QualifiedIdentifier): Removed this class.      
8647
8648 2004-01-22  Martin Baulig  <martin@ximian.com>
8649
8650         * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
8651         not a string as alias name.
8652
8653 2004-01-21  Miguel de Icaza  <miguel@ximian.com>
8654
8655         * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
8656         #52730 bug, and instead compute correctly the need to use a
8657         temporary variable when requesting an address based on the
8658         static/instace modified of the field and the constructor.
8659  
8660 2004-01-21  Martin Baulig  <martin@ximian.com>
8661
8662         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
8663         class and namespace before looking up aliases.  Fixes #52517.
8664
8665 2004-01-21  Martin Baulig  <martin@ximian.com>
8666
8667         * flowanalysis.cs (UsageVector.Merge): Allow variables being
8668         assinged in a 'try'; fixes exception4.cs.
8669
8670 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
8671         * class.cs : Implemented parameter-less constructor for TypeContainer
8672
8673         * decl.cs: Attributes are now stored here. New property OptAttributes
8674
8675         * delegate.cs, enum.cs, interface.cs: Removed attribute member.
8676
8677         * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
8678
8679 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
8680
8681         * typemanager.cs (CSharpSignature): Now reports also inner class name.
8682           (CSharpSignature): New method for indexer and property signature.
8683
8684 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
8685
8686         * pending.cs (IsVirtualFilter): Faster implementation.
8687
8688 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
8689
8690         * typemanager.cs: Avoid inclusion of same assembly more than once.
8691
8692 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
8693
8694         * cs-parser.jay: Fixed problem where the last assembly attribute
8695           has been applied also to following declaration (class, struct, etc.)
8696           
8697 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
8698
8699         * class.cs: Added error CS0538, CS0539 reporting.
8700         Fixed crash on Microsoft runtime when field type is void.
8701
8702         * cs-parser.jay: Added error CS0537 reporting.
8703
8704         * pending.cs: Added error CS0535 reporting.
8705         Improved error report for errors CS0536, CS0534.
8706
8707 2004-01-20  Miguel de Icaza  <miguel@ximian.com>
8708
8709         Merge a few bits from the Anonymous Method MCS tree.
8710
8711         * statement.cs (ToplevelBlock): New class for toplevel methods,
8712         will hold anonymous methods, lifted variables.
8713
8714         * cs-parser.jay: Create toplevel blocks for delegates and for
8715         regular blocks of code. 
8716
8717 2004-01-20  Martin Baulig  <martin@ximian.com>
8718
8719         * codegen.cs (EmitContext): Removed `InTry', `InCatch',
8720         `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
8721         and `NeedExplicitReturn'; added `IsLastStatement'.
8722         (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
8723         have a `ReturnLabel' or we're not unreachable.
8724
8725         * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
8726         child's reachability; don't just override ours with it.  Fixes
8727         #58058 (lluis's example).
8728         (FlowBranching): Added public InTryOrCatch(), InCatch(),
8729         InFinally(), InLoop(), InSwitch() and
8730         BreakCrossesTryCatchBoundary() methods.
8731
8732         * statement.cs (Return): Do all error checking in Resolve().
8733         Unless we are the last statement in a top-level block, always
8734         create a return label and jump to it.
8735         (Break, Continue): Do all error checking in Resolve(); also make
8736         sure we aren't leaving a `finally'.
8737         (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
8738         statement in a top-level block.
8739         (Block.Flags): Added `IsDestructor'.
8740         (Block.IsDestructor): New public property.
8741
8742 2004-01-20  Martin Baulig  <martin@ximian.com>
8743
8744         * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
8745
8746 2004-01-20  Martin Baulig  <martin@ximian.com>
8747
8748         * statement.cs (Statement.ResolveUnreachable): New public method.
8749         (If, While): Do the dead-code elimination in Resolve(), not in Emit().
8750         (Block.Resolve): Resolve unreachable statements.
8751
8752 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
8753
8754         * expression.cs: We need to fix the case where we do
8755         not have a temp variable here.
8756
8757         * assign.cs: Only expression compound assignments need
8758         temporary variables.
8759
8760 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
8761
8762         * flowanalysis.cs: Reduce memory allocation in a few ways:
8763           - A block with no variables should not allocate a bit
8764             vector for itself.
8765           - A method with no out parameters does not need any tracking
8766             for assignment of the parameters, so we need not allocate
8767             any data for it.
8768           - The arrays:
8769                 public readonly Type[] VariableTypes;
8770                 public readonly string[] VariableNames;
8771             Are redundant. The data is already stored in the variable
8772             map, so we need not allocate another array for it.
8773           - We need to add alot of checks for if (params | locals) == null
8774             due to the first two changes.
8775
8776 2004-01-18  Miguel de Icaza  <miguel@ximian.com>
8777
8778         * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
8779         implement IMemoryLocation, we store a copy on a local variable and
8780         take the address of it.  Patch from Benjamin Jemlich
8781
8782         * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
8783         to use a special "type_name_expression" rule which reduces the
8784         number of "QualifiedIdentifier" classes created, and instead
8785         directly creates MemberAccess expressions.
8786
8787 2004-01-17  Miguel de Icaza  <miguel@ximian.com>
8788
8789         * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
8790         that fixes #52853.  Null literal assignment to ValueType
8791
8792         * class.cs (MethodData.Emit): Instead of checking the name of the
8793         method to determine if its a destructor, create a new derived
8794         class from Method called Destructor, and test for that.  
8795
8796         * cs-parser.jay: Create a Destructor object instead of a Method.  
8797
8798         Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
8799
8800         Fixes: 52933
8801
8802 2004-01-16  Miguel de Icaza  <miguel@ximian.com>
8803
8804         * expression.cs (Binary.ResolveOperator): Perform an implicit
8805         conversion from MethodGroups to their delegate types on the
8806         Addition operation.
8807
8808         * delegate.cs: Introduce a new class DelegateCreation that is the
8809         base class for `NewDelegate' and `ImplicitDelegateCreation',
8810         factor some code in here.
8811
8812         * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
8813         conversion from MethodGroups to compatible delegate types. 
8814
8815         * ecore.cs (Expression.Resolve): Do not flag error 654
8816         (Methodgroupd needs parenthesis) if running on the V2 compiler, as
8817         we allow conversions from MethodGroups to delegate types now.
8818
8819         * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
8820         assignments in v2 either.
8821
8822 2004-01-10  Miguel de Icaza  <miguel@ximian.com>
8823
8824         * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
8825         static read-only fields in ctors.
8826
8827         Applied patch from Benjamin Jemlich 
8828
8829         * expression.cs (UnaryMutator): Avoid leaking local variables. 
8830
8831 2004-01-09  Miguel de Icaza  <miguel@ximian.com>
8832
8833         * cs-tokenizer.cs (IsCastToken): Allow the various native types
8834         here to return true, as they can be used like this:
8835
8836                 (XXX) int.MEMBER ()
8837
8838         Fixed 49836 and all the other dups
8839
8840 2004-01-09  Zoltan Varga  <vargaz@freemail.hu>
8841
8842         * driver.cs: Implement /win32res and /win32icon.
8843
8844 2004-01-08  Miguel de Icaza  <miguel@ximian.com>
8845
8846         * cs-parser.jay: Add a rule to improve error handling for the
8847         common mistake of placing modifiers after the type.
8848
8849 2004-01-07  Miguel de Icaza  <miguel@ximian.com>
8850
8851         * cs-parser.jay (interface_event_declaration): Catch
8852         initialization of events on interfaces, and report cs0068
8853
8854         * cs-parser.jay (interface_event_declaration): Catch
8855         initialization of events. 
8856
8857         * ecore.cs: Better report missing constructors.
8858
8859         * expression.cs (Binary.ResolveOperator): My previous bug fix had
8860         the error reporting done in the wrong place.  Fix.
8861
8862         * expression.cs (Binary.ResolveOperator): Catch the 
8863         operator + (E x, E y) error earlier, and later allow for implicit
8864         conversions in operator +/- (E e, U x) from U to the underlying
8865         type of E.
8866
8867         * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
8868         52596, if the container class is abstract, the default constructor
8869         is protected otherwise its public (before, we were always public).
8870
8871         * statement.cs (Fixed.Resolve): Catch a couple more errors in the
8872         fixed statement.
8873
8874         (Using.EmitLocalVariableDecls): Applied patch from Benjamin
8875         Jemlich that fixes bug #52597, MCS was generating invalid code for
8876         idisposable structs.   Thanks to Ben for following up with this
8877         bug as well.
8878
8879 2004-01-06  Miguel de Icaza  <miguel@ximian.com>
8880
8881         * driver.cs: Allow assemblies without code to be generated, fixes
8882         52230.
8883
8884 2004-01-07  Nick Drochak <ndrochak@gol.com>
8885
8886         * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
8887
8888 2004-01-05  Miguel de Icaza  <miguel@ximian.com>
8889
8890         * cs-parser.jay: Add rules to improve error reporting if fields or
8891         methods are declared at the namespace level (error 116)
8892
8893         * Add rules to catch event add/remove
8894
8895 2004-01-04  David Sheldon <dave-mono@earth.li>
8896
8897   * expression.cs: Added matching ")" to error message for 
8898   CS0077
8899
8900 2004-01-03 Todd Berman <tberman@gentoo.org>
8901
8902         * ecore.cs, attribute.cs:
8903         Applying fix from #52429.
8904
8905 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
8906
8907         * ecore.cs, expression.cs, statement.cs:
8908         Total rewrite of how we handle branching. We
8909         now handle complex boolean expressions with fewer
8910         jumps. As well if (x == 0) no longer emits a ceq.
8911
8912         if (x is Foo) is much faster now, because we generate
8913         better code.
8914
8915         Overall, we get a pretty big improvement on our benchmark
8916         tests. The code we generate is smaller and more readable.
8917
8918         I did a full two-stage bootstrap. The patch was reviewed
8919         by Martin and Miguel.
8920
8921 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
8922
8923         * cs-parser.jay: Make primary_expression not take a QI.
8924         we dont need this because the member_access rule covers
8925         us here. So we replace the rule with just IDENTIFIER.
8926
8927         This has two good effects. First, we remove a s/r conflict.
8928         Second, we allocate many fewer QualifiedIdentifier objects.
8929
8930 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
8931
8932         * attribute.cs: Handle MarshalAs attributes as pseudo, and
8933         set the correct information via SRE. This prevents
8934         hanging on the MS runtime. Fixes #29374.
8935
8936 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
8937
8938         * convert.cs: correctly handle conversions to value types
8939         from Enum and ValueType as unboxing conversions.
8940
8941         Fixes bug #52569. Patch by Benjamin Jemlich.
8942
8943 2004-01-02  Ravi Pratap  <ravi@ximian.com>
8944
8945         * expression.cs (BetterConversion): Prefer int -> uint
8946         over int -> ulong (csc's behaviour). This fixed bug #52046.
8947
8948 2004-01-02 Ben Maurer  <bmaurer@users.sourceforge.net>
8949
8950         * decl.cs (MemberCache.FindMembers): now returns a
8951         MemberInfo [].
8952
8953         * typemanager.cs: In general, go with with ^^.
8954         (CopyNewMethods): take an IList.
8955         (RealMemberLookup): Only allocate an arraylist
8956         if we copy from two sets of methods.
8957
8958         This change basically does two things:
8959         1) Fewer array lists allocated due to CopyNewMethods.
8960         2) the explicit cast in MemberList costed ALOT.
8961
8962 2004-01-02  Zoltan Varga  <vargaz@freemail.hu>
8963
8964         * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
8965         a hashtable to avoid needless string allocations when an identifier is
8966         used more than once (the common case).
8967
8968 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
8969
8970         * pending.cs: MS's TypeBuilder.GetInterfaces ()
8971         is broken, it will not return anything. So, we
8972         have to use the information we have in mcs to
8973         do the task.
8974
8975         * typemanager.cs: Add a cache for GetInterfaces,
8976         since this will now be used more often (due to ^^)
8977
8978         (GetExplicitInterfaces) New method that gets the
8979         declared, not effective, interfaces on a type
8980         builder (eg, if you have interface IFoo, interface
8981         IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
8982         { IBar }.
8983
8984         This patch makes MCS able to bootstrap itself on
8985         Windows again.
8986
8987 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
8988
8989         * expression.cs: Remove the Nop's that Miguel put
8990         in by mistake.
8991
8992 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
8993
8994         * report.cs, codegen.cs: Give the real stack trace to
8995         the error when an exception is thrown.
8996
8997 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
8998
8999         * decl.cs: only allocate hashtables for ifaces if 
9000         it is an iface!
9001
9002 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
9003
9004         * expression.cs: fix the error from cs0121-2.cs
9005         (a parent interface has two child interfaces that
9006         have a function with the same name and 0 params
9007         and the function is called through the parent).
9008
9009 2003-12-30 Ben Maurer  <bmaurer@users.sourceforge.net>
9010
9011         * class.cs, rootcontext.cs, typmanager.cs: do not
9012         leak pointers.
9013
9014 2003-12-28 Ben Maurer  <bmaurer@users.sourceforge.net>
9015
9016         * codegen.cs: remove stack for the ec flow branching.
9017         It is already a linked list, so no need.
9018
9019 2003-12-27 Ben Maurer  <bmaurer@users.sourceforge.net>
9020
9021         * Makefile: Allow custom profiler here.
9022
9023 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
9024
9025         * typemanager.cs (LookupType):
9026           - Use a static char [], because split takes
9027             a param array for args, so it was allocating
9028             every time.
9029           - Do not store true in a hashtable, it boxes.
9030
9031 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
9032
9033         * flowanalysis.cs: bytify common enums.
9034
9035 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
9036
9037         * modifiers.cs: Add a new set of flags for the
9038         flags allowed on explicit interface impls.
9039         * cs-parser.jay: catch the use of modifiers in
9040         interfaces correctly.
9041         * class.cs: catch private void IFoo.Blah ().
9042
9043         All related to bug #50572.
9044
9045 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
9046
9047         * decl.cs: Rewrite the consistant accessability checking.
9048         Accessability is not linear, it must be implemented in
9049         a tableish way. Fixes #49704.
9050
9051 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
9052
9053         * expression.cs: Handle negation in a checked context.
9054         We must use subtraction from zero. Fixes #38674.
9055
9056 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
9057
9058         * class.cs: Ignore static void main in DLLs.
9059         * rootcontext.cs: Handle the target type here,
9060         since we are have to access it from class.cs
9061         * driver.cs: account for the above.
9062
9063 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
9064
9065         * report.cs: Give line numbers and files if available.
9066
9067 2003-12-20  Zoltan Varga  <vargaz@freemail.hu>
9068
9069         * driver.cs: Implement /addmodule.
9070
9071         * typemanager.cs:  Change 'modules' field so it now contains Modules not
9072         ModuleBuilders.
9073
9074 2003-12-20  Martin Baulig  <martin@ximian.com>
9075
9076         * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
9077         (FieldBase.IsAssigned): Removed this field.
9078         (FieldBase.SetAssigned): New public method.
9079         (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
9080
9081 2003-12-20  Martin Baulig  <martin@ximian.com>
9082
9083         * expression.cs (LocalVariableReference.DoResolve): Don't set
9084         `vi.Used' if we're called from DoResolveLValue().
9085
9086         * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
9087         returns the usage vector it just merged into the current one -
9088         pass this one to UsageWarning().
9089         (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
9090         of the `EmitContext', don't call this recursively on our children.
9091
9092 2003-12-19  Zoltan Varga  <vargaz@freemail.hu>
9093
9094         * driver.cs: Implement /target:module.
9095
9096 2003-12-18  Zoltan Varga  <vargaz@freemail.hu>
9097
9098         * support.cs (CharArrayHashtable): New helper class.
9099
9100         * cs-tokenizer.cs: Store keywords in a hashtable indexed by 
9101         char arrays, not strings, so we can avoid creating a string in
9102         consume_identifier if the identifier is a keyword.
9103
9104 2003-12-16  Martin Baulig  <martin@ximian.com>
9105
9106         * statement.cs (LocalInfo.Assigned): Removed this property.
9107         (LocalInfo.Flags): Removed `Assigned'.
9108         (LocalInfo.IsAssigned): New public method; takes the EmitContext
9109         and uses flow analysis.
9110         (Block.UsageWarning): Made this method private.
9111         (Block.Resolve): Call UsageWarning() if appropriate.
9112
9113         * expression.cs (LocalVariableReference.DoResolve): Always set
9114         LocalInfo.Used here.
9115
9116 2003-12-13  Martin Baulig  <martin@ximian.com>
9117
9118         * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
9119         any value here; we're now using flow analysis to figure out
9120         whether a statement/block returns a value.
9121
9122 2003-12-13  Martin Baulig  <martin@ximian.com>
9123
9124         * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
9125         working again.
9126         (FlowBranching.MergeFinally): Don't call
9127         `branching.CheckOutParameters()' here, this is called in
9128         MergeTopBlock().
9129         (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
9130         when adding the `finally' vector.       
9131
9132 2003-12-13  Martin Baulig  <martin@ximian.com>
9133
9134         * flowanalysis.cs
9135         (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
9136         actually work and also fix #48962.
9137
9138 2003-12-12 Ben Maurer  <bmaurer@users.sourceforge.net>
9139
9140         * decl.cs: Do not check System.Object for nested types,
9141         since we know it does not have any. Big bang for buck:
9142
9143         BEFORE:
9144            Run 1:   8.35 seconds
9145            Run 2:   8.32 seconds
9146            corlib:  17.99 seconds
9147         AFTER:
9148            Run 1:   8.17 seconds
9149            Run 2:   8.17 seconds
9150            corlib:  17.39 seconds
9151
9152 2003-12-11 Ben Maurer  <bmaurer@users.sourceforge.net>
9153
9154         * class.cs (FindMembers): Allocate arraylists on demand. Most of the
9155         time we are returning 0 members, so we save alot here.
9156
9157 2003-12-11  Martin Baulig  <martin@ximian.com>
9158
9159         * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
9160         `MergeChild()', also just take the `FlowBranching' as argument;
9161         call Merge() on it and return the result.
9162         (FlowBranching.Merge): We don't need to do anything if we just
9163         have one sibling.
9164
9165 2003-12-11  Martin Baulig  <martin@ximian.com>
9166
9167         * flowanalysis.cs: Use a list of `UsageVector's instead of storing
9168         them in an `ArrayList' to reduce memory usage.  Thanks to Ben
9169         Maurer for this idea.
9170
9171 2003-12-11  Martin Baulig  <martin@ximian.com>
9172
9173         * flowanalysis.cs (MergeResult): This class is now gone; we now
9174         use the `UsageVector' for this.  The reason for this is that if a
9175         branching just has one sibling, we don't need to "merge" them at
9176         all - that's the next step to do.
9177         (FlowBranching.Merge): We now return a `UsageVector' instead of a
9178         `MergeResult'.
9179
9180 2003-12-11  Martin Baulig  <martin@ximian.com>
9181
9182         Reworked flow analyis and made it more precise and bug-free.  The
9183         most important change is that we're now using a special `Reachability'
9184         class instead of having "magic" meanings of `FlowReturns'.  I'll
9185         do some more cleanups and optimizations and also add some more
9186         documentation this week.
9187
9188         * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
9189         largely reworked this class.
9190         (FlowReturns): Removed `Unreachable' and `Exception'; we now use
9191         the new `Reachability' class instead of having "magic" values here.
9192         (FlowBranching): We're now using an instance of `Reachability'
9193         instead of having separate `Returns', `Breaks' etc. fields.
9194
9195         * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
9196         based on flow analysis; ignore the return value of block.Emit ().
9197
9198 2003-12-10  Zoltan Varga  <vargaz@freemail.hu>
9199
9200         * driver.cs typemanager.cs: Find the mono extensions to corlib even
9201         if they are private.
9202
9203 2003-12-09  Martin Baulig  <martin@ximian.com>
9204
9205         * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
9206         call them directly on the UsageVector.
9207
9208 2003-12-09  Martin Baulig  <martin@ximian.com>
9209
9210         * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
9211         Changed return type from `FlowReturns' to `Reachability'.
9212
9213 2003-12-09  Martin Baulig  <martin@ximian.com>
9214
9215         * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
9216         (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
9217         `Reachable' fields with a single `Reachability' one.
9218
9219 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
9220
9221         * class.cs (FindMembers): Remove foreach's.
9222
9223         Bootstrap times:
9224
9225         BEFORE
9226                 Run 1:   8.74 seconds
9227                 Run 2:   8.71 seconds
9228
9229         AFTER
9230                 Run 1:   8.64 seconds
9231                 Run 2:   8.58 seconds
9232
9233
9234 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
9235
9236         * cs-parser.jay:
9237         * gen-treedump.cs:
9238         * statement.cs:
9239         This patch does a few things:
9240                 1. EmptyStatement is now a singleton, so it is never reallocated.
9241                 2. All blah is EmptyStatement constructs have been changed to
9242                    blah == EmptyStatement.Value, which is much faster and valid
9243                    now that EmptyStatement is a singleton.
9244                 3. When resolving a block, rather than allocating a new array for
9245                    the non-empty statements, empty statements are replaced with
9246                    EmptyStatement.Value
9247                 4. Some recursive functions have been made non-recursive.
9248         Mainly the performance impact is from (3), however (1) and (2) are needed for
9249         this to work. (4) does not make a big difference in normal situations, however
9250         it makes the profile look saner.
9251
9252         Bootstrap times:
9253
9254         BEFORE
9255         9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
9256         9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
9257         Total memory allocated: 56397 KB
9258
9259         AFTER
9260         9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
9261         8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
9262         Total memory allocated: 55666 KB
9263
9264 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
9265
9266         * support.cs: Rewrite DoubleHash to use its own impl. Is faster
9267         than the hashtable in a hashtable version
9268
9269         * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
9270         we always end up concating a string. This results in a huge perf
9271         loss, because many strings have to be tracked by the GC. In this
9272         patch, we first use a hashtable that works with two keys, so that
9273         the strings do not need to be concat'ed.
9274
9275         Bootstrap times:
9276         BEFORE
9277                 Run 1:   8.74 seconds
9278                 Run 2:   8.71 seconds
9279
9280         AFTER
9281                 Run 1:   8.65 seconds
9282                 Run 2:   8.56 seconds
9283
9284 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
9285
9286         * Makefile: Add a new target `do-time' that does a quick and simple
9287         profile, leaving easy to parse output.
9288
9289 2003-12-08  Zoltan Varga  <vargaz@freemail.hu>
9290
9291         * codegen.cs (Init): Create the dynamic assembly with 
9292         AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
9293
9294 2003-12-02 Ben Maurer  <bmaurer@users.sourceforge.net>
9295
9296         * support.cs: Make the PtrHashtable use only one
9297         instance of its comparer.
9298
9299 2003-11-30  Zoltan Varga  <vargaz@freemail.hu>
9300
9301         * typemanager.cs: Fix lookup of GetNamespaces.
9302
9303 2003-11-29  Miguel de Icaza  <miguel@ximian.com>
9304
9305         * expression.cs: Removed redundant line.
9306
9307         * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
9308         ArrayLists, use for loops with bounds.  
9309
9310         * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
9311         arraylist.
9312
9313         * expression.cs (Invocation.OverloadResolve): Avoid foreach on
9314         arraylists, use for loop with bounds.
9315
9316         The above three changes give us a 0.071 second performance
9317         improvement out of 3.294 seconds down to 3.223.  On my machine
9318         the above changes reduced the memory usage by 1,387 KB during
9319         compiler bootstrap.
9320
9321         * cs-parser.jay (QualifiedIdentifier): New class used to represent
9322         QualifiedIdentifiers.  Before we created a new string through
9323         concatenation, and mostly later on, the result would be
9324         manipulated by DecomposeQI through string manipulation.
9325
9326         This reduced the compiler memory usage for bootstrapping from
9327         59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
9328         compile times in 0.05 seconds.
9329
9330 2003-11-28  Dick Porter  <dick@ximian.com>
9331
9332         * support.cs: Do string compares with the Invariant culture.
9333
9334         * rootcontext.cs: 
9335         * gen-treedump.cs: 
9336         * expression.cs: 
9337         * driver.cs: 
9338         * decl.cs: 
9339         * codegen.cs: 
9340         * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
9341         the comparison is done with the Invariant culture.
9342
9343 2003-11-27  Miguel de Icaza  <miguel@ximian.com>
9344
9345         * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
9346         GetEnumerator method.
9347
9348         (ProbeCollectionType): Iterate starting at the most specific type
9349         upwards looking for a GetEnumerator
9350
9351         * expression.cs: Shift count can be up to 31 for int/uint and 63
9352         for long/ulong.
9353
9354 2003-11-26  Miguel de Icaza  <miguel@ximian.com>
9355
9356         * statement.cs (Block.LookupLabel): Also look for the label on the
9357         children blocks.  Use a hash table to keep track of visited
9358         nodes. 
9359
9360         * cfold.cs (IntConstant to UIntConstant mapping): Only return if
9361         we actually did transform the other operand, otherwise fall back
9362         to the common codepath that casts to long.
9363
9364         * cs-tokenizer.cs: Use the same code pattern as the int case.
9365         Maybe I should do the parsing myself, and avoid depending on the
9366         Parse routines to get this done.
9367
9368 2003-11-25  Miguel de Icaza  <miguel@ximian.com>
9369
9370         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
9371         which fixes bug 51347.  This time test it.
9372
9373         * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
9374         attributes for example can not tell the difference between these.
9375         The difference was only a syntax feature of the language. 
9376
9377         * attribute.cs: Apply attributes to delegates.
9378
9379         * delegate.cs: Call the apply attributes method.
9380
9381 2003-11-24  Miguel de Icaza  <miguel@ximian.com>
9382
9383         * convert.cs (TryImplicitIntConversion): One line bug fix: we were
9384         comparing 0 vs Byte.MinValue, not the value
9385
9386         (ImplicitConversionRequired): When reporting a conversion error,
9387         use error 31 to print out the constant error instead of the
9388         simpler 29.
9389
9390         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
9391         which fixes bug 51347.
9392
9393 2003-11-22  Miguel de Icaza  <miguel@ximian.com>
9394
9395         * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen) 
9396         which fixes the -warnaserror command line option.
9397
9398 2003-11-21  Miguel de Icaza  <miguel@ximian.com>
9399
9400         * cfold.cs (DoNumericPromotions): During constant folding of
9401         additions on UIntConstant, special case intconstants with
9402         IntConstants like we do on the expression binary operator. 
9403
9404 2003-11-12  Miguel de Icaza  <miguel@ximian.com>
9405
9406         * convert.cs (ImplicitReferenceConversion): We were missing a case
9407         (System.Enum are not value types or class types, so we need to
9408         classify them separatedly).
9409
9410         * driver.cs: We do not support error 2007.
9411
9412 2003-11-12 Jackson Harper <jackson@ximian.com>
9413
9414         * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
9415         system directory. Also use the full file name so users can
9416         libraries names mscorlib-o-tron.dll in a non system dir.
9417         
9418 2004-01-04  David Sheldon <dave-mono@earth.li>
9419
9420         * expression.cs: Added matching ")" to error message for CS0077.
9421
9422 2003-12-19  Martin Baulig  <martin@ximian.com>
9423
9424         * typemanager.cs (TypeManager.IsEqualGenericType): New public
9425         static method; see documentation in the method.
9426         (TypeManager.IsSubclassOrNestedChild): Allow IsEqualGenericType().
9427
9428         * convert.cs (Convert.ImplicitReferenceConversion,
9429         Convert.ImplicitReferenceConversionExists): Add support for
9430         generic type declarations; see gen-36.cs.
9431
9432 2003-12-19  Martin Baulig  <martin@ximian.com>
9433
9434         * pending.cs (Pending.InterfaceMethod): Use
9435         `Type.IsAssignableFrom()' instead of `=='.
9436
9437 2003-12-18  Martin Baulig  <martin@ximian.com>
9438
9439         * decl.cs (DeclSpace.AsAccessible): Check for array, pointer and
9440         byref types first.
9441
9442         * convert.cs (Convert.ImplicitStandardConversionExists): Use
9443         `expr_type.Equals (target_type)' instead of `=='.
9444
9445 2003-12-08  Martin Baulig  <martin@ximian.com>
9446
9447         * generics.cs (Constraints.Types): Removed.
9448         (Constraints.Resolve): Just resolve everything to TypeExpr's, not
9449         to Type's.
9450         (Constraints.ResolveTypes): New public method; resolves the
9451         TypeExpr's to Type's.
9452         (TypeParameter.Define): TypeBuilder.DefineGenericParameter() no
9453         longer takes the constraints.
9454         (TypeParameter.DefineMethod): Likewise.
9455         (TypeParameter.DefineType): New public method.  Calls
9456         `TypeBuilder/MethodBuilder.SetGenericParameterConstraints()' to set
9457         the constraints.
9458
9459 2003-12-08  Martin Baulig  <martin@ximian.com>
9460
9461         * convert.cs (Convert.ImplicitConversionStandard): Use
9462         `expr_type.Equals (target_type)' instead of `=='.
9463
9464 2003-12-08  Martin Baulig  <martin@ximian.com>
9465
9466         * typemanager.cs (TypeManager.GetReferenceType): Call
9467         `Type.MakeByRefType ()'.
9468
9469 2003-12-08  Martin Baulig  <martin@ximian.com>
9470
9471         * cs-parser.jay, cs-tokenizer.cs: `where' is not a keyword, it
9472         just has some special meaning in some situations.  For instance,
9473         it is allowed to use `where' as the name of a variable etc.
9474
9475 2003-12-04  Martin Baulig  <martin@ximian.com>
9476
9477         * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
9478         `Type.MakeArrayType()' for array types.
9479
9480 2003-11-18  Miguel de Icaza  <miguel@ximian.com>
9481
9482         * expression.cs (Invocation.VerifyArgumentsCompat): Remove
9483         debugging message.
9484
9485         (SizeOf.DoResolve): assign the `type_queried' field.  This gets
9486         corlib to compile.
9487
9488 2003-11-16  Martin Baulig  <martin@ximian.com>
9489
9490         * codegen.cs (EmitContext.IsGeneric): Removed.
9491
9492         * ecore.cs (SimpleName.ResolveAsTypeStep): Always call
9493         ResolveGeneric() on the DeclSpace.
9494
9495 2003-11-16  Martin Baulig  <martin@ximian.com>
9496
9497         * generic.cs (TypeArguments.Resolve):
9498         `Expression.ResolveAsTypeTerminal()' returns a TypeExpr; call
9499         `ResolveType()' on it to get the Type.
9500
9501 2003-11-15  Martin Baulig  <martin@ximian.com>
9502
9503         * generic.cs (ConstructedType.GetInterfaces): Override this.
9504
9505 2003-11-14  Martin Baulig  <martin@ximian.com>
9506
9507         * interface.cs (Interface.DefineType): Define all type parameters
9508         before adding the interfaces we inherit.
9509
9510 2003-11-11  Martin Baulig  <martin@ximian.com>
9511
9512         * generic.cs (ConstructedType.ResolveType): Always call
9513         `gt.BindGenericParameters (atypes)'; also if `args.HasTypeArguments'.
9514
9515 2003-11-10  Martin Baulig  <martin@ximian.com>
9516
9517         * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
9518         (TypeManager.InitCoreTypes): Initialize them here, but instead of
9519         calling `ResolveType()' on them, directly assign their `Type'.
9520
9521 2003-11-08  Martin Baulig  <martin@ximian.com>
9522
9523         * generic.cs (ConstructedType): Override `IsClass' etc.
9524
9525 2003-11-08  Martin Baulig  <martin@ximian.com>
9526
9527         * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
9528         return value and the `out parent' parameter.
9529         (TypeContainer.DefineType): Moved the CS0644 check into
9530         GetClassBases().  Don't pass the interface types to the
9531         `builder.DefineType()'/`builder.DefineNestedType()', but resolve
9532         them later and then call `TypeBuilder.AddInterfaceImplementation()'.
9533
9534         * ecore.cs (TypeExpr.IsAttribute): New property.
9535         (TypeExpr.GetInterfaces): New method.
9536
9537         * interface.cs (Interface.GetInterfaceTypeByName): Return a
9538         TypeExpr instead of a Type.
9539         (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
9540         (Interface.DefineType): Don't pass the interface types to the
9541         `builder.Definetype()'/`builder.DefineNestedType()', but resolve
9542         them later and then call `TypeBulider.AddInterfaceImplementation()'.
9543
9544         * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
9545         instead of a `Type[]'.
9546         (TypeManager.RegisterBuilder): Likewise.
9547         (TypeManager.AddUserInterface): Likewise.
9548         (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
9549         `Type[]' and also return a `TypeExpr[]'.
9550         (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
9551
9552 2003-11-08  Martin Baulig  <martin@ximian.com>
9553
9554         * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
9555         Expression.     
9556
9557 2003-11-08  Martin Baulig  <martin@ximian.com>
9558
9559         * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
9560         TypeManager.ResolveExpressionTypes().
9561
9562         * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
9563         instead of an Expression.
9564         (TypeExpr): This is now an abstract base class for `TypeExpression'.
9565         (TypeExpression): New public class; formerly known as `TypeExpr'.
9566
9567         * expression.cs (ComposedCast): Derive from TypeExpr.
9568
9569         * typemanager.cs (TypeManager.system_*_expr): These are now
9570         TypExpr's instead of Expression's.
9571         (TypeManager.ResolveExpressionTypes): New public static function;
9572         called from DeclSpace.GetTypeResolveEmitContext() to resolve all
9573         of them.        
9574
9575 2003-11-06  Miguel de Icaza  <miguel@ximian.com>
9576
9577         * expression.cs (New.DoResolve): Do not dereference value that
9578         might be a null return.
9579
9580         * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
9581         sure that the constant value has the right type.  Fixes an
9582         unreported bug, similar to 50425.
9583
9584         * const.cs (Const.LookupConstantValue): Call
9585         ImplicitStandardConversionExists before doing a conversion to
9586         avoid havng the TypeManager.ChangeType do conversions.
9587
9588         Reduced the number of casts used
9589
9590         (Const.ChangeType): New routine to enable reuse of the constant
9591         type changing code from statement.
9592
9593         * typemanager.cs (ChangeType): Move common initialization to
9594         static global variables.
9595
9596         Fixes #50425.
9597
9598         * convert.cs (ImplicitReferenceConversion): Somehow we allowed
9599         every value type to go through, even if it was void.  Fix that. 
9600
9601         * cs-tokenizer.cs: Use is_identifier_start_character on the start
9602         character of the define, and the is_identifier_part_character for
9603         the rest of the string.
9604
9605 2003-11-05  Miguel de Icaza  <miguel@ximian.com>
9606
9607         * expression.cs (UnaryMutator.EmitCode): When I updated
9608         LocalVariableReference.DoResolve, I overdid it, and dropped an
9609         optimization done on local variable references.
9610
9611 2003-11-04  Miguel de Icaza  <miguel@ximian.com>
9612
9613         * ecore.cs: Convert the return from Ldlen into an int.
9614
9615 2003-10-20  Miguel de Icaza  <miguel@ximian.com>
9616
9617         * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
9618         the accessibility, this is a special case for toplevel non-public
9619         classes (internal for instance).
9620
9621 2003-10-20  Nick Drochak <ndrochak@gol.com>
9622
9623         * ecore.cs: Fix typo and build.  Needed another right paren.
9624
9625 2003-10-19  Miguel de Icaza  <miguel@ximian.com>
9626
9627         * ecore.cs: Applied fix from Ben Maurer.   We were handling in the
9628         `internal' case regular and protected, but not allowing protected
9629         to be evaluated later.  Bug 49840
9630
9631 2003-10-15  Miguel de Icaza  <miguel@ximian.com>
9632
9633         * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
9634         to kb.Nlast, and not the kb.nFirst to isolate the switch
9635         statement.
9636
9637         Extract the underlying type, so enumerations of long/ulong are
9638         treated like long/ulong.
9639
9640 2003-10-14  Miguel de Icaza  <miguel@ximian.com>
9641
9642         * expression.cs (New): Overload the meaning of RequestedType to
9643         track the possible creation of the NewDelegate type, since
9644         DoResolve is invoked more than once for new constructors on field
9645         initialization.
9646
9647         See bugs: #48800 and #37014
9648
9649         * cs-parser.jay (declare_local_constants): Take an arraylist
9650         instead of a single constant.
9651
9652         (local_constant_declaration): It should take a
9653         constant_declarators, not a constant_declarator.  Fixes 49487
9654
9655         * convert.cs: Fix error report.
9656
9657 2003-10-13 Jackson Harper <jackson@ximian.com>
9658
9659         * typemanager.cs (TypeToCoreType): Add float and double this fixes
9660         bug #49611
9661         
9662 2003-11-03  Martin Baulig  <martin@ximian.com>
9663
9664         * expression.cs (ArrayAccess.GetStoreOpcode): Added
9665         `out bool has_type_arg'; if set, we need to pass the type to
9666         ig.Emit().
9667         (ArrayAccess.GetStoreOpcode, ArrayAccess.EmitLoadOpcode): Use
9668         Stelem_Any/Ldelem_Any for generic parameters.   
9669
9670 2003-11-02  Martin Baulig  <martin@ximian.com>
9671
9672         * expression.cs (Invocation.EmitCall): Use
9673         `TypeManager.IsValueType()' to check whether it's a value type.
9674         Don't set `struct_call' when calling a method on a type parameter.
9675
9676 2003-11-02  Martin Baulig  <martin@ximian.com>
9677
9678         * generics.cs (ConstructedType.Resolve): Renamed to ResolveType()
9679         and removed the TypeBuilder argument.
9680
9681         * typemanager.cs (TypeManager.IsValueType): Return
9682         `t.IsGenericParameter || t.IsValueType'.
9683
9684 2003-10-25  Martin Baulig  <martin@ximian.com>
9685
9686         * decl.cs (DeclSpace.ResolveType): If we're a ConstructedType,
9687         call ConstructedType.Resolve() on it.
9688
9689         * generic.cs (ConstructedType.Resolve): Set `type' on success.
9690
9691 2003-10-25  Martin Baulig  <martin@ximian.com>
9692
9693         * class.cs (TypeContainer.GetClassBases): Changed
9694         `out Type parent' into `out TypeExpr parent'.  Moved CS0644 and
9695         CS8214 reporting here.
9696         (TypeContainer.DefineType): GetClassBases() gives us a `TypeExpr'
9697         instead of a `Type' for our parent.  In case of a recursive
9698         declaration (see tests/gen-23.cs for an example), our parent is a
9699         ConstructedType and it doesn't have its type set.  So, first
9700         create our own TypeBuilder, then call constructed.Resolve() to get
9701         the parent's type and finally TypeBuilder.SetParent() it.
9702
9703         * ecore.cs (TypeExpr.Name): New public virtual property.
9704
9705         * generic.cs
9706         (ConstructedType): We're now a TypeExpr and not just an Expression.
9707         (ConstructedType.ResolveAsTypeStep): Don't resolve our type
9708         arguments here; this is done later.
9709         (ConstructedType.Resolve): New public method to resolve the type
9710         arguments and bind them.
9711
9712 2003-10-21  Martin Baulig  <martin@ximian.com>
9713
9714         * convert.cs: Use `TypeManager.IsValueType' instead of
9715         'type.IsValueType' everywhere.
9716
9717         * typemanager.cs (TypeManager.IsValueType): Return true for type
9718         parameters.  The reason for this is that we need to box a type
9719         parameter when converting it to a reference type.
9720
9721         * cs-parser.jay: Added support for default value expressions.
9722
9723         * generics.cs (DefaultValueExpression): New public class.       
9724
9725 2003-10-17  Martin Baulig  <martin@ximian.com>
9726
9727         * generic.cs (Constraints.Resolve): Take a DecpSpace instead of a
9728         TypeContainer so we can also use this for Interfaces.
9729         (TypeParameter.Resolve): Likewise.
9730
9731         * interface.cs (Interface.DefineType): Added support for generic
9732         interfaces.
9733
9734         * cs-parser.jay: Added support for generic structs and interfaces.
9735
9736 2003-10-17  Martin Baulig  <martin@ximian.com>
9737
9738         * generic.cs (GenericMemberAccess.DoResolve): We can now actually
9739         call generic methods :-)
9740
9741 2003-10-16  Martin Baulig  <martin@ximian.com>
9742
9743         * cs-parser.jay (namespace_or_type_name): Only create a
9744         GenericMemberAccess if we actually have type arguments.
9745
9746 2003-10-13  Martin Baulig  <martin@ximian.com>
9747
9748         * class.cs (Method.Define): If we're a generic method, call
9749         TypeBuilder.DefineGenericMethod () before resolving
9750         the parameters.
9751         (MethodData): Added .ctor which takes an additional MethodBuilder
9752         argument; this is used for generic methods.
9753         (MethodData.Define): Call `builder.SetGenericMethodSignature()' if
9754         we already have a MethodBuilder.
9755
9756 2003-10-10  Martin Baulig  <martin@ximian.com>
9757
9758         * class.cs (Method): Added .ctor which takes a `GenericMethod'
9759         instead of a `DeclSpace'.  This is used for generic methods.
9760
9761         * cs-parser.jay (method_header): Added support for generic
9762         methods; create a `GenericMethod' instance and pass it to the
9763         `Method's .ctor; it'll be used as the `DeclSpace' to lookup
9764         parameters and locals.
9765
9766         * decl.cs (DeclSpace.SetParameterInfo): Removed Location argument
9767         since we already have the location.  Check whether we're a generic
9768         type declaration or a generic method and create the correct type
9769         parameter.
9770
9771         * generic.cs (TypeParameter.DefineMethod): New public method.
9772         (GenericMethod): New public class; derives from DeclSpace and is
9773         used for generic methods.       
9774
9775 2003-10-09  Martin Baulig  <martin@ximian.com>
9776
9777         * class.cs (MethodCore): Added additional `DeclSpace ds' argument
9778         to the .ctor.
9779         (MethodCore.DoDefineParameters): Removed the TypeContainer
9780         argument; use the DeclSpace which was passed to the .ctor instead.
9781         (MethodCore.CheckParameter): Take a DeclSpace instead of a
9782         TypeContainer; we only need a DeclSpace here.
9783
9784 2003-10-09  Martin Baulig  <martin@ximian.com>
9785
9786         * class.cs (MethodData): Added additional `DeclSpace ds' argument
9787         to the .ctor.
9788         (MethodData.Define, MethodData.Emit): Pass the `ds' to the
9789         EmitContext's .ctor.    
9790
9791 2003-10-09  Martin Baulig  <martin@ximian.com>
9792
9793         * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
9794         (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
9795         AsAccessible(), moved them as well.
9796
9797         * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
9798
9799 2003-10-07  Miguel de Icaza  <miguel@ximian.com>
9800
9801         * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
9802         generation for >=, as spotted by Paolo, bug 48679.  
9803         Patch from David Waite.
9804
9805         * cs-tokenizer.cs: Add handling for #pragma.
9806
9807         * cs-parser.jay: Allow for both yield and yield return in the
9808         syntax.  The anti-cobolization of C# fight will go on!
9809
9810         * class.cs (TypeBuilder.DefineType): Catch error condition here
9811         (Parent.DefineType erroring out and returning null).
9812
9813         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
9814         coping with enumerations variables, we were mistakenly processing
9815         them as a regular value type instead of built-in types.  Fixes the
9816         bug #48063
9817
9818         * typemanager.cs (IsBuiltinOrEnum): New method.
9819
9820 2003-09-30  Miguel de Icaza  <miguel@ximian.com>
9821
9822         * cs-parser.jay: Upgrade: yield now needs the return clause.
9823
9824 2003-10-08  Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
9825
9826         * cs-parser.jay : Renamed yyName to yyNames related to jay.
9827
9828 2003-09-29  Martin Baulig  <martin@ximian.com>
9829
9830         * typemanager.cs (TypeManager.GetMethodFlags): Added support for
9831         inflated generic methods.
9832
9833         * generics.cs (ConstructedType): Distinguish between open and
9834         closed constructed types; correctly resolve the arguments.
9835
9836 2003-09-22  Martin Baulig  <martin@ximian.com>
9837
9838         * generic.cs (ConstructedType.ResolveAsTypeCheck): Check whether
9839         all type arguments meet their constraints.
9840
9841 2003-09-19  Martin Baulig  <martin@ximian.com>
9842
9843         * decl.cs (MemberCache.SetupCacheForInterface): Take a
9844         `MemberCache parent' argument.  Normally, an interface doesn't
9845         have a parent type except System.Object, but we use this in gmcs
9846         for generic type parameters.
9847
9848 2003-09-18  Martin Baulig  <martin@ximian.com>
9849
9850         * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
9851         on `type.IsInterface'; don't check whether the type has a parent
9852         to determine whether it's an interface.
9853
9854 2003-09-17  Martin Baulig  <martin@ximian.com>
9855
9856         * generic.cs (ConstructedType.ToString): Always use `name' as the
9857         type name.
9858
9859 2003-09-15  Martin Baulig  <martin@ximian.com>
9860
9861         * cs-parser.jay: Fix grammar wrt. type_parameter_constraints.
9862
9863         * generic.cs (Constraints.Resolve): New public method; this is
9864         called to resolve the constraint types and to check whether all
9865         the constraints are correct.
9866         (Constraints.Types): New public property.
9867         (TypeParameter.Resolve): New public method; resolves all the
9868         type's constraints.
9869
9870         * class.cs (TypeContainer.DefineType): Call
9871         TypeParameter.Resolve() before actually defining the type.
9872
9873 2003-09-15  Martin Baulig  <martin@ximian.com>
9874
9875         * class.cs (TypeContainer.DefineType): Added an error flag to
9876         avoid reporting duplicate CS0146's ("class definition is
9877         circular.").
9878
9879         * driver.cs (Driver.MainDriver): Abort if
9880         RootContext.ResolveTree() reported any errors.
9881
9882 2003-09-07  Martin Baulig  <martin@ximian.com>
9883
9884         * report.cs (Error, Warning): Added overloaded versions which take
9885         a `params object[] args' and call String.Format().
9886
9887 2003-09-07  Martin Baulig  <martin@ximian.com>
9888
9889         * decl.cs (DeclSpace..ctor): Don't call
9890         NamespaceEntry.DefineName() here; do it in RecordDecl() which is
9891         called from Tree.RecordDecl().  Fixes the CS0101 reporting.
9892         (DeclSpace.RecordDecl): New method.
9893
9894         * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
9895
9896 2003-09-02  Ravi Pratap  <ravi@ximian.com>
9897
9898         * attribute.cs (CheckAttributeTarget): Ensure that we allow return
9899         value attributes to be applied to ParameterBuilders.
9900
9901         * class.cs (MethodCore.LabelParameters): Make static and more
9902         generic so that it can be used from other places - like interface
9903         methods, for instance.
9904
9905         * interface.cs (Interface.Emit): Call LabelParameters before
9906         emitting attributes on the InterfaceMethod.
9907
9908 2003-09-07  Martin Baulig  <martin@ximian.com>
9909
9910         * generic.cs (ConstructedType.ResolveAsTypeStep): Report a CS8217
9911         if the number of type parameters doesn't match.
9912
9913 2003-09-04  Martin Baulig  <martin@ximian.com>
9914
9915         * expression.cs (ComposedCast.ResolveAsTypeStep): Added support
9916         for arrays of generic type params (ie. `!0[]').
9917
9918 2003-09-04  Martin Baulig  <martin@ximian.com>
9919
9920         * class.cs (TypeContainer.AsAccessible): Ignore generic parameters
9921         for the moment.
9922
9923 2003-09-04  Martin Baulig  <martin@ximian.com>
9924
9925         * decl.cs (DeclSpace.LookupGeneric): New method.
9926         (DeclSpace.CheckAccessLevel): Ignore generic parameters for the
9927         moment.
9928
9929         * generic.cs (TypeParameterExpr): Take a TypeParameter as
9930         argument, not just a string.
9931         (TypeParameter.Define): New public method; this is called to
9932         actually define the generic parameter; after this, you can use the
9933         new `Type' property to get the type.
9934
9935 2003-09-04  Martin Baulig  <martin@ximian.com>
9936
9937         * decl.cs (DeclSpace.SetParameterInfo): The `constraints' argument
9938         is now an ArrayList; initialize the result of the `TypeParameters'
9939         property here.
9940         (DeclSpace.GetGenericData): Removed.
9941         (DeclSpace.LookupGeneric): Temporarily removed; we need to
9942         implement this in a different way.
9943         (DeclSpace.GetTypeParameters): Removed; there's now a
9944         `TypeParameters' property.
9945         (DeclSpace.TypeParameters): New public property.
9946
9947         * generic.cs (Constraints): Make this class public.
9948         (TypeParameter): New public class.
9949
9950 2003-09-04  Martin Baulig  <martin@ximian.com>
9951
9952         * decl.cs (DeclSpace.GetTypeParameters): New method to return the
9953         generic parameters.
9954
9955         * class.cs (TypeContainer.DefineType): Call
9956         TypeBuilder.DefineGenericParameter () on all generic parameters if
9957         this is a generic type.
9958
9959 2003-08-28  Martin Baulig  <martin@ximian.com>
9960
9961         * sample-stack.il: Compile this with ilasm: "ilasm /dll
9962         sample-stack.il".
9963
9964         * sample-hello.cs: Compile this with gmcs: "gmcs
9965         /r:sample-stack.dll sample-hello.cs".
9966
9967 2003-08-28  Martin Baulig  <martin@ximian.com>
9968
9969         * generic.cs (ConstructedType.ResolveAsTypeStep): Actually bind
9970         the parameters to the generic type.
9971
9972 2003-08-28  Martin Baulig  <martin@ximian.com>
9973
9974         * cs-tokenizer.cs (parse_less_than): Also allow all builtin types.
9975
9976 2003-08-28  Martin Baulig  <martin@ximian.com>
9977
9978         * cs-parser.jay (opt_type_argument_list): Use
9979         `OP_GENERICS_LT type_arguments OP_GENERICS_GT'.
9980         (primary_expression): Replace `qualified_identifier' with `type_name'.
9981         (type_parameter_list): Use `OP_GENERICS_LT type_parameters OP_GENERICS_GT'.
9982
9983         * cs-tokenizer.cs (is_punct): When reading a `<', invoke a custom
9984         parser to check whether it is syntactically a type parameter list;
9985         return OP_GENERICS_LT/OP_GENERICS_GT instead of OP_LT/OP_GT in
9986         this case.
9987
9988 2003-08-26  Martin Baulig  <martin@ximian.com>
9989
9990         * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
9991         resolving aliases; fixes #47927.
9992
9993 2003-08-26  Martin Baulig  <martin@ximian.com>
9994
9995         * statement.cs (Using.DoResolve): This is internally emitting a
9996         try/finally clause, so we need to set ec.NeedExplicitReturn if we
9997         do not always return.  Fixes #47681.
9998
9999 2003-08-26  Martin Baulig  <martin@ximian.com>
10000
10001         * decl.cs (MemberCore): Moved WarningNotHiding(),
10002         Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
10003         into MemberBase.
10004         (AdditionResult): Make this nested in DeclSpace.
10005         (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
10006         argument; call NamespaceEntry.Define() unless we're nested in a
10007         class or struct.
10008
10009         * namespace.cs (Namespace.DefineName): New public function.  This
10010         is called from DeclSpace's .ctor to add 
10011         (Namespace.Lookup): Include DeclSpaces in the lookup.
10012
10013         * class.cs (Operator): Derive from MemberBase, not MemberCore.
10014
10015         * const.cs (Const): Derive from MemberBase, not MemberCore.     
10016
10017 2003-08-25  Martin Baulig  <martin@ximian.com>
10018
10019         * convert.cs (Convert.ExplicitReferenceConversion): When
10020         converting from an interface type to a class, unbox if the target
10021         type is a struct type.  Fixes #47822.
10022
10023 2003-08-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10024
10025         * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
10026         #47854.
10027
10028 2003-08-22  Martin Baulig  <martin@ximian.com>
10029
10030         * class.cs (TypeManager.DefineType): When defining a nested type,
10031         call DefineType() on our parent; fixes #47801.
10032
10033 2003-08-22  Martin Baulig  <martin@ximian.com>
10034
10035         * class.cs (MethodData.Define): While checking if a method is an
10036         interface implementation, improve the test a bit more to fix #47654.
10037
10038 2003-08-22  Martin Baulig  <martin@ximian.com>
10039
10040         * expression.cs (Probe.DoResolve): Check whether `expr' resolved
10041         correctly; fixes #47722.
10042
10043 2003-08-22  Martin Baulig  <martin@ximian.com>
10044
10045         * expression.cs (UnaryMutator.ResolveVariable): If the target is a
10046         LocalVariableReference, ensure it's not read-only.  Fixes #47536.
10047
10048         * statement.cs (Fixed.DoResolve): Make all variables read-only. 
10049
10050 2003-08-22  Martin Baulig  <martin@ximian.com>
10051
10052         * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
10053         can only be assigned in static constructors.  Fixes #47161.
10054
10055 2003-08-22  Martin Baulig  <martin@ximian.com>
10056
10057         Rewrote and improved the flow analysis code.
10058
10059         * flowbranching.cs (FlowBranching): Make this class abstract.
10060         (FlowBranching.CreateBranching): New static function to create a
10061         new flow branching.
10062         (FlowBranchingBlock, FlowBranchingException): New classes.
10063         (FlowBranching.UsageVector.Type): New public readonly field.
10064         (FlowBranching.UsageVector.Breaks): Removed the setter.
10065         (FlowBranching.UsageVector.Returns): Removed the setter.
10066         (FlowBranching.UsageVector): Added Break(), Return(),
10067         NeverReachable() and Throw() methods to modify the reachability.
10068         (FlowBranching.UsageVector.MergeChildren): Removed, this is now
10069         done by FlowBranching.Merge().
10070         (FlowBranching.UsageVector.MergeChild): New method; merges the
10071         merge result into the current vector.
10072         (FlowBranching.Merge): New abstract method to merge a branching.
10073
10074 2003-08-12  Martin Baulig  <martin@ximian.com>
10075
10076         * expression.cs (Indirection.CacheTemporaries): Create the
10077         LocalTemporary with the pointer type, not its element type.
10078
10079 2003-08-10  Miguel de Icaza  <miguel@ximian.com>
10080
10081         * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
10082         token was a keyword or not.
10083
10084         Add `error' options where an IDENTIFIER was expected;  Provide
10085         CheckToken and CheckIdentifierToken convenience error reporting
10086         functions. 
10087
10088         Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
10089
10090         * decl.cs: Rename `NamespaceEntry Namespace' public field into
10091         NameSpaceEntry NameSpaceEntry.
10092
10093         (LookupInterfaceOrClass): Avoid creating a full qualified name
10094         from namespace and name: avoid doing lookups when we know the
10095         namespace is non-existant.   Use new Tree.LookupByNamespace which
10096         looks up DeclSpaces based on their namespace, name pair.
10097
10098         * driver.cs: Provide a new `parser verbose' to display the
10099         exception thrown during parsing.  This is turned off by default
10100         now, so the output of a failure from mcs is more graceful.
10101
10102         * namespace.cs: Track all the namespaces defined in a hashtable
10103         for quick lookup.
10104
10105         (IsNamespace): New method
10106
10107 2003-08-09  Miguel de Icaza  <miguel@ximian.com>
10108
10109         * namespace.cs: Remove redundant call;  Avoid using MakeFQN when
10110         we know that we need to concatenate (full typename can never be
10111         null). 
10112
10113         * class.cs: ditto.
10114
10115         * statement.cs: Use a bitfield;  Do not initialize to null things
10116         which are done by the constructor by default.
10117
10118         * cs-parser.jay: bug fix, parameter was 4, not 3.
10119
10120         * expression.cs: Just use the property;
10121
10122         * statement.cs: No need for GetVariableInfo method.
10123
10124 2003-08-08  Martin Baulig  <martin@ximian.com>
10125
10126         * flowanalysis.cs (FlowReturns): This is now nested in the
10127         `FlowBranching' class.
10128         (MyBitVector): Moved this here from statement.cs.
10129         (FlowBranching.SiblingType): New enum type.
10130         (FlowBranching.CreateSibling): Added `SiblingType' argument.
10131
10132 2003-08-07  Martin Baulig  <martin@ximian.com>
10133
10134         * flowanalysis.cs (FlowBranchingType): This is now nested in the
10135         `FlowBranching' class and called `BranchingType'.
10136
10137 2003-08-07  Martin Baulig  <martin@ximian.com>
10138
10139         * flowanalysis.cs: Moved all the control flow analysis code into
10140         its own file.
10141
10142 2003-08-07  Martin Baulig  <martin@ximian.com>
10143
10144         * assign.cs (Assign.DoResolve): `target' must either be an
10145         IAssignMethod or an EventAccess; report a CS0131 otherwise.  Fixes
10146         #37319.
10147
10148 2003-08-07  Miguel de Icaza  <miguel@ximian.com>
10149
10150         * expression.cs (BinaryMethod): This kind of expression is created by the
10151         Binary class if it determines that the operator has to be handled
10152         by a method.
10153
10154         (BinaryDelegate): This kind of expression is created if we are
10155         dealing with a + or - operator on delegates.
10156
10157         (Binary): remove method, argumetns, and DelegateOperator: when
10158         dealing with methods, 
10159
10160         * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
10161
10162         * statement.cs (Block): use bitfields for the three extra booleans
10163         we had in use.   Remove unused topblock parameter.
10164
10165         * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
10166
10167         * assign.cs: Drop extra unneeded tests.
10168
10169 2003-08-06  Miguel de Icaza  <miguel@ximian.com>
10170
10171         * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
10172
10173         * statement.cs (Foreach): Use VariableStorage instead of
10174         LocalBuilders.   
10175
10176         * codegen.cs (VariableStorage): New class used by clients that
10177         require a variable stored: locals or fields for variables that
10178         need to live across yield.
10179
10180         Maybe provide a convenience api for EmitThis+EmitLoad?
10181
10182         (GetTemporaryLocal, FreeTemporaryLocal): Recycle
10183         these bad boys.
10184
10185 2003-08-05  Miguel de Icaza  <miguel@ximian.com>
10186
10187         * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
10188         RemapParameterLValue): New methods that are used to turn a
10189         precomputed FieldInfo into an expression like this:
10190
10191                 instance.FieldInfo
10192
10193         The idea is to use this instead of making LocalVariableReference
10194         have more than one meaning.
10195
10196         * cs-parser.jay: Add error production to BASE.
10197
10198         * ecore.cs: Deal with TypeManager.GetField returning null, which
10199         is now a valid return value.
10200
10201         (FieldExprNoAddress): New expression for Fields whose address can
10202         not be taken.
10203
10204         * expression.cs (LocalVariableReference): During the resolve
10205         phases, create new expressions if we are in a remapping context.
10206         Remove code that dealt with remapping here.
10207
10208         (ParameterReference): same.
10209
10210         (ProxyInstance): New expression, like the `This' expression, but
10211         it is born fully resolved.  We know what we are doing, so remove
10212         the errors that are targeted to user-provided uses of `this'.
10213
10214         * statement.cs (Foreach): our variable is now stored as an
10215         Expression;  During resolution, follow the protocol, dont just
10216         assume it will return this.
10217
10218 2003-08-06  Martin Baulig  <martin@ximian.com>
10219
10220         * support.cs (SeekableStreamReader.cs): New public class.
10221
10222         * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
10223         SeekableStreamReader instead of the normal StreamReader.
10224
10225 2003-08-04  Martin Baulig  <martin@ximian.com>
10226
10227         * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
10228         CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
10229         deambiguate casts and delegate invocations.
10230         (parenthesized_expression): Use the new tokens to ensure this is
10231         not a cast of method invocation.
10232
10233         * cs-tokenizer.cs (is_punct): Return one of the new special tokens
10234         when reading a `)' and Deambiguate_CloseParens () was previously
10235         called.
10236
10237         * expression.cs (ParenthesizedExpression): New class.  This is
10238         just used for the CS0075 test.
10239         (Binary.DoResolve): Check for CS0075.   
10240
10241 2003-07-29  Ravi Pratap  <ravi@ximian.com>
10242
10243         * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
10244         Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
10245         reference comparison.
10246
10247         (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
10248         examine the ReturnType for equality - this is necessary in the
10249         cases of implicit and explicit operators whose signature also
10250         includes the return type.
10251
10252 2003-07-26  Miguel de Icaza  <miguel@ximian.com>
10253
10254         * namespace.cs: Cache the result of the namespace computation,
10255         instead of computing it every time.
10256
10257 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
10258
10259         * decl.cs: Use a global arraylist that we reuse over invocations
10260         to avoid excesive memory consumption.  Reduces memory usage on an
10261         mcs compile by one meg (45 average).
10262
10263         * typemanager.cs (LookupTypeReflection): In .NET pointers are
10264         private, work around that.
10265
10266 2003-07-23  Miguel de Icaza  <miguel@ximian.com>
10267
10268         * literal.cs (IntLiteral): Define Zero and One static literals. 
10269
10270         * cs-parser.jay (integer_literal): use static literals to reduce
10271         memory usage for the most used literals (0, 1 and -1).  211kb
10272         reduced in memory usage.
10273
10274         Replace all calls to `new ArrayList' with `new
10275         ArrayList(4)' which is a good average number for most allocations,
10276         and also requires only 16 bytes of memory for its buffer by
10277         default. 
10278
10279         This reduced MCS memory usage in seven megabytes for the RSS after
10280         bootstrapping.
10281
10282 2003-07-28  Ravi Pratap  <ravi@ximian.com>
10283
10284         * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
10285         handle params methods the correct way by forming only one
10286         applicable set with params and normal methods in them. Earlier we
10287         were looking at params methods only if we found no normal methods
10288         which was not the correct thing to do.
10289
10290         (Invocation.BetterFunction): Take separate arguments indicating
10291         when candidate and the best method are params methods in their
10292         expanded form.
10293
10294         This fixes bugs #43367 and #46199.
10295
10296         * attribute.cs: Documentation updates.
10297
10298         (CheckAttribute): Rename to CheckAttributeTarget.
10299         (GetValidPlaces): Rename to GetValidTargets.
10300
10301         * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
10302         bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
10303
10304         Fixes bug #44468.
10305
10306 2003-07-28  Miguel de Icaza  <miguel@ximian.com>
10307
10308         * codegen.cs: Compute IsGeneric correctly.
10309
10310         * cs-parser.jay: Introduce OP_GENERIC_LT for the grammar ambiguity
10311         resolution. 
10312
10313         Bring back (temporarily) OP_LEFT_SHIFT, OP_RIGHT_SHIFT,
10314         OP_SHIFT_RIGHT_ASSIGN, OP_SHIFT_LEFT_ASSIGN.  There were too many
10315         regressions, and I was chasing more bugs than I required.
10316
10317         * interface.cs: Use expressions for base type names (like classes
10318         and structs have been doing for a while now), and resolve that.
10319         This patch should probably go into head as well.
10320
10321         This makes it one less user of FindType.
10322
10323 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
10324
10325         This compiler can not self host currently.  Need to fix that.
10326         
10327         * Makefile: compile to `gmcs.exe'
10328
10329         * driver.cs: Turn on v2 by default on gmcs.
10330
10331         * generic.cs (ConstructedType): Does no longer take a container
10332         type argument;  That will be taken care of later.
10333
10334         (ConstructedType.DoResolve, ConstructedType.ResolveAsTypeStep):
10335         Use SimpleName to resolve for now, so we can continue the work on
10336         the parser, until we get Type.GetType that understands generics.
10337
10338         (ConstructedType.ToString): Implement
10339
10340         (TypeArguments.Resolve): Resolve the child expressions as types. 
10341         
10342         * cs-parser.jay: Rename interface_constraints to
10343         type_parameter_constraints
10344
10345         (namespace_or_type_name): Only use constructed types for the basic
10346         construction, we will deal with identifier<...> later.
10347
10348         (type/type_name): No longer call DecomposeQI, as
10349         namespace_or_type_name is always decoded now.
10350         
10351 2003-07-22  Ravi Pratap  <ravi@ximian.com>
10352
10353         * expression.cs (Invocation.OverloadResolve): Follow the spec more
10354         closely: we eliminate methods in base types when we have an
10355         applicable method in a top-level type.
10356
10357         Please see section 14.5.5.1 for an exact description of what goes
10358         on. 
10359
10360         This fixes bug #45127 and a host of other related to corlib compilation.
10361
10362         * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
10363         array is the method corresponding to the top-level type (this is
10364         because of the changes made to icall.c) so we change this
10365         accordingly.
10366
10367         (MethodGroupExpr.Name): This too.
10368
10369         * typemanager.cs (GetElementType): New method which does the right
10370         thing when compiling corlib. 
10371
10372         * everywhere: Make use of the above in the relevant places.
10373
10374 2003-07-22  Martin Baulig  <martin@ximian.com>
10375
10376         * cs-parser.jay (invocation_expression): Moved
10377         `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
10378         `cast_expression', but create a InvocationOrCast which later
10379         resolves to either an Invocation or a Cast.
10380
10381         * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
10382         method; call this before EmitStatement() to make sure that this
10383         expression can be used as a statement.
10384
10385         * expression.cs (InvocationOrCast): New class; resolves to either
10386         an Invocation or a Cast.
10387
10388         * statement.cs (StatementExpression): Call ResolveStatement() on
10389         the ExpressionStatement before emitting it.
10390
10391 2003-07-21  Martin Baulig  <martin@ximian.com>
10392
10393         * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
10394         `ref' and `out' attributes match; fixes #46220.
10395         (MemberAccess.ResolveMemberAccess): You can't reference a type
10396         through an expression; fixes #33180.
10397         (Indexers.GetIndexersForType): Don't return the indexers from
10398         interfaces the class implements; fixes #46502.
10399
10400 2003-07-21  Martin Baulig  <martin@ximian.com>
10401
10402         * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
10403         CS0661 checks; fixes bug #30442.
10404
10405 2003-07-21  Martin Baulig  <martin@ximian.com>
10406
10407         * decl.cs (AdditionResult): Added `Error'.
10408
10409         * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
10410
10411         * typemanager.cs (TypeManager.ChangeType): Catch exceptions; makes
10412         cs0031.cs actually work.
10413
10414  2003-07-20  Miguel de Icaza  <miguel@ximian.com>
10415  
10416         * cs-parser.jay (namespace_name): do not use
10417         namespace_or_type_name, use qualified_identifier, because
10418         namespace_or_type_name will soon return a composed expression
10419         instead of a string.
10420  
10421         (namespace_or_type_name): Instead of returning a string, now this
10422         production returns an expression.
10423  
10424         * codegen.cs (EmitContext): Setup IsGeneric property based on
10425         whether our DeclSpace is generic, our the method is generic.
10426  
10427         * modifier.cs (Modifiers.METHOD_GENERIC): New definition, use if
10428         the method is generic.
10429  
10430         * cs-parser.jay (type_arguments, opt_type_argument_list,
10431         type_parameters, type_parameter_list, opt_type_parameter_list,
10432         type_parameter,, opt_type_parameter_constraints_clauses,
10433         type_parameter_constraints_clauses,
10434         type_parameter_constraint_clause, type_parameter_constraint,
10435         interface_constraints): Add new production
10436  
10437         * decl.cs (DeclSpace): IsGeneric, flag to track whether this
10438         DeclSpace is generic or not.
10439  
10440         (DeclSpace.SetParameterInfo): New routine, used to set the
10441         parameter info for a type.
10442  
10443         (DeclSpace.LookupGeneric): Lookups a name, and if it is a generic,
10444         returns a GenericTypeExpr
10445  
10446         * ecore.cs (SimpleName.ResolveAsTypeStep): If our container is
10447         generic, lookup the generic argument.
10448  
10449         * attribute.cs: Do not allow TypeParameterExpressions in
10450         Attributes.
10451  
10452         * class.cs: Do not allow the Main method to be defined in a
10453         Generic container.
10454  
10455         * expression.cs (SizeOf): Do not allow generic types to be used as
10456         arguments to sizeof.
10457  
10458         * typemanager.cs (IsGeneric): Wrapper for Reflection when we have
10459         it: whether a type is generic or not.  Only works for types we are
10460         currently building for now.
10461         
10462 2003-07-20  Martin Baulig  <martin@ximian.com>
10463
10464         * namespace.cs: Fixed that bug which caused a crash when compiling
10465         the debugger's GUI.
10466
10467 2003-07-20  Miguel de Icaza  <miguel@ximian.com>
10468
10469         * typemanager.cs (LookupTypeReflection): Never expose types which
10470         are NotPublic, NestedPrivate, NestedAssembly, or
10471         NestedFamANDAssem.  We used to return these, and later do a check
10472         that would report a meaningful error, but the problem is that we
10473         would not get the real match, if there was a name override.
10474
10475 2003-07-18  Miguel de Icaza  <miguel@ximian.com>
10476
10477         * namespace.cs (Namespace, Name): Do not compute the namespace
10478         name dynamically, compute it in the constructor.  This reduced
10479         memory usage by 1697 KB.
10480
10481         * driver.cs: Use --pause to pause at the end.
10482
10483 2003-07-17  Peter Williams  <peter@newton.cx>
10484
10485         * Makefile: Change the name of the test target so that it doesn't
10486         conflict with the recursive test target.
10487
10488 2003-07-17  Miguel de Icaza  <miguel@ximian.com>
10489
10490         * expression.cs (LocalVariableReference.Emit, EmitAssign,
10491         AddressOf): Do not use EmitThis, that was wrong, use the actual
10492         this pointer.
10493
10494 2003-07-15  Miguel de Icaza  <miguel@ximian.com>
10495
10496         * class.cs (MethodData.Define): While checking if a method is an
10497         interface implementation, improve the test: If we are not public
10498         (use new test here: use the computed MethodAttributes directly,
10499         instead of the parsed modifier flags) check if the `implementing'
10500         method comes from an interface or not.
10501
10502         * pending.cs (VerifyPendingMethods): Slightly better error
10503         message.
10504
10505         * makefile: add test target that does the mcs bootstrap.
10506
10507 2003-07-16  Ravi Pratap  <ravi@ximian.com>
10508
10509         * interface.cs (Define): Do nothing here since there are no
10510         members to populate etc. Move the attribute emission out of here
10511         since this was just totally the wrong place to put it. Attribute
10512         application happens during the 'Emit' phase, not in the 'Define'
10513         phase.
10514
10515         (Emit): Add this method and move the attribute emission here
10516
10517         * rootcontext.cs (EmitCode): Call the Emit method on interface
10518         types too.
10519
10520 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
10521
10522         * expression.cs (OverloadResolve): Report error only if Location
10523         is not 'Null' which means that there was a probe going on.
10524
10525 2003-07-14  Martin Baulig  <martin@ximian.com>
10526
10527         * expression.cs (ConditionalLogicalOperator): New public class to
10528         implement user defined conditional logical operators.
10529         This is section 14.11.2 in the spec and bug #40505.
10530
10531 2003-07-14  Martin Baulig  <martin@ximian.com>
10532
10533         * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
10534
10535 2003-07-14  Martin Baulig  <martin@ximian.com>
10536
10537         * codegen.cs (EmitContext.InFixedInitializer): New public field.
10538
10539         * ecore.cs (IVariable.VerifyFixed): New interface method.
10540
10541         * expression.cs (Unary.ResolveOperator): When resolving the `&'
10542         operator, check whether the variable is actually fixed.  Fixes bug
10543         #36055.  Set a variable definitely assigned when taking its
10544         address as required by the spec.
10545
10546         * statement.cs (LocalInfo.IsFixed): New field.
10547         (LocalInfo.MakePinned): Set `IsFixed' to true.
10548
10549 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
10550
10551         * attribute.cs (Attribute.Resolve): While doing a Member lookup
10552         for .ctors, ensure that we only ask for members declared in the
10553         attribute type (BindingFlags.DeclaredOnly).
10554
10555         Fixes bug #43632.
10556
10557         * expression.cs (Error_WrongNumArguments): Report error 1501
10558         correctly the way CSC does.
10559
10560 2003-07-13  Martin Baulig  <martin@ximian.com>
10561
10562         * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
10563         lookup on the fully qualified name, to make things like "X.X" work
10564         where "X.X" is a fully qualified type name, but we also have a
10565         namespace "X" in the using list.  Fixes #41975.
10566
10567 2003-07-13  Martin Baulig  <martin@ximian.com>
10568
10569         * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
10570         function. If we're a CompoundAssign, we need to create an embedded
10571         CompoundAssign, not an embedded Assign.
10572         (Assign.DoResolve): Make this work for embedded CompoundAssign's.
10573         Fixes #45854.
10574
10575 2003-07-13  Martin Baulig  <martin@ximian.com>
10576
10577         * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
10578         work to fix bug #46088.
10579
10580 2003-07-13  Ravi Pratap <ravi@ximian.com>
10581
10582         * class.cs (Operator.Emit): Do not emit attributes here - it is
10583         taken care of by the Method class that we delegate too. This takes
10584         care of bug #45876.
10585
10586 2003-07-10  Martin Baulig  <martin@ximian.com>
10587
10588         * expression.cs (TypeOfVoid): New class.
10589         (TypeOf): Report a CS0673 if it's System.Void.  Fixes #42264.
10590
10591 2003-07-10  Martin Baulig  <martin@ximian.com>
10592
10593         * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
10594         bug #35957.
10595
10596 2003-07-10  Martin Baulig  <martin@ximian.com>
10597
10598         * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
10599         not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
10600
10601         * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
10602
10603         * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
10604
10605 2003-07-10  Martin Baulig  <martin@ximian.com>
10606
10607         * expression.cs (ArrayCreation): Don't use a byte blob for arrays
10608         of decimal.  Fixes #42850.
10609
10610         NOTE: I also fixed the created byte blob, but this doesn't work on
10611         the MS runtime and csc never produces any byte blobs for decimal
10612         arrays.
10613
10614 2003-07-10  Martin Baulig  <martin@ximian.com>
10615
10616         * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
10617         structs; fixes #32068.
10618         (Block.AddChildVariableNames): Fixed #44302.
10619
10620 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10621
10622         * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
10623
10624 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
10625
10626         * attribute.cs: And this test is onger needed.
10627
10628 2003-07-08  Martin Baulig  <martin@ximian.com>
10629
10630         * rootcontext.cs (RootContext.NamespaceLookup): Ignore
10631         inaccessible types.  Fixes #36313.
10632
10633         * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
10634
10635         * namespace.cs (NamespaceEntry): Create implicit entries for all
10636         namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
10637         implicit entries for N1.N2 and N1.
10638
10639 2003-07-08  Martin Baulig  <martin@ximian.com>
10640
10641         Rewrote the handling of namespaces to fix a lot of the issues
10642         wrt. `using' aliases etc.
10643
10644         * namespace.cs (Namespace): Splitted this class into a
10645         per-assembly `Namespace' and a per-file `NamespaceEntry'.
10646
10647         * typemanager.cs (TypeManager.IsNamespace): Removed.
10648         (TypeManager.ComputeNamespaces): Only compute namespaces from
10649         loaded assemblies here, not the namespaces from the assembly we're
10650         currently compiling.
10651
10652 2003-07-08  Martin Baulig  <martin@ximian.com>
10653
10654         * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
10655
10656 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
10657
10658         * typemanager.cs: Reverted patch from Gonzalo, my previous patch
10659         already fixed it.  
10660
10661         I thought about the memory savings here, but LookupTypeReflection
10662         is used under already very constrained scenarios.  Compiling
10663         corlib or mcs only exposes one hit, so it would not really reduce
10664         any memory consumption.
10665
10666 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10667
10668         * typemanager.cs: fixes bug #45889 by only adding public types from
10669         other assemblies to the list of known types.
10670
10671 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
10672
10673         * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
10674         on the type we resolved.
10675
10676 2003-07-05  Martin Baulig  <martin@ximian.com>
10677
10678         * pending.cs (PendingImplementation.ParentImplements): Don't
10679         create the proxy if the parent is abstract.
10680
10681         * class.cs (TypeContainer.DefineIndexers): Process explicit
10682         interface implementations first.  Fixes #37714.
10683
10684 2003-07-04  Miguel de Icaza  <miguel@ximian.com>
10685
10686         * expression.cs (MemberAccess.ResolveMemberAccess): Events are
10687         defined recursively;  but since we modify the input parameters
10688         (left is set to `this' temporarily), we reset this value if the
10689         left_is_explicit is false, which gives the original semantics to
10690         the code.  
10691
10692         * literal.cs (NullPointer): new class used to represent a null
10693         literal in a pointer context.
10694
10695         * convert.cs (Convert.ImplicitReferenceConversion): Is the target
10696         type is a pointer, use a NullPointer object instead of a
10697         NullLiteral.   Closes 43687
10698
10699         (ExplicitConversion): Convert pointer values using
10700         the conv opcode to the proper type.
10701
10702         * ecore.cs (New): change ValueTypeVariable property into a method,
10703         that returns whether the valuetype is suitable for being used.
10704
10705         * expression.cs (Binary.DoNumericPromotions): Only return if we
10706         the int constant was a valid uint, and we can return both left and
10707         right as uints.  If not, we continue processing, to trigger the
10708         type conversion.  This fixes 39018.
10709
10710         * statement.cs (Block.EmitMeta): During constant resolution, set
10711         the CurrentBlock property on the emitcontext, so that we resolve
10712         constants propertly.
10713
10714 2003-07-02  Martin Baulig  <martin@ximian.com>
10715
10716         * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
10717         (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
10718
10719         * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
10720         than emitting it here.
10721
10722         * statement.cs: Fixed some more flow analysis bugs.
10723
10724 2003-07-02  Martin Baulig  <martin@ximian.com>
10725
10726         * class.cs (MethodData.Define): When implementing interface
10727         methods, set Final unless we're Virtual.
10728
10729         * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
10730         check work for interface methods.
10731
10732 2003-07-01  Martin Baulig  <martin@ximian.com>
10733
10734         * ecore.cs (EmitContext.This): Replaced this property with a
10735         GetThis() method which takes a Location argument.  This ensures
10736         that we get the correct error location for a CS0188.
10737
10738 2003-07-01  Miguel de Icaza  <miguel@ximian.com>
10739
10740         * ecore.cs: (Convert.ConvertIntLiteral): Add test for
10741         ImplicitStandardConversion.
10742
10743         * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
10744
10745 2003-07-01  Zoltan Varga  <vargaz@freemail.hu>
10746
10747         * expression.cs (ResolveOperator): Fix Concat (string, string, string)
10748         optimization.
10749
10750 2003-06-30  Miguel de Icaza  <miguel@ximian.com>
10751
10752         * class.cs (Constructor.Define): Turn off initlocals for unsafe
10753         constructors.
10754
10755         (MethodData.Define): Turn off initlocals for unsafe methods.
10756
10757 2003-06-29  Miguel de Icaza  <miguel@ximian.com>
10758
10759         * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
10760         complete;  Fixes #37521.
10761
10762         * delegate.cs: Use Modifiers.TypeAttr to compute the
10763         TypeAttributes, instead of rolling our own.  This makes the flags
10764         correct for the delegates.
10765
10766 2003-06-28  Miguel de Icaza  <miguel@ximian.com>
10767
10768         * class.cs (Constructor.Define): Set the private flag for static
10769         constructors as well.
10770
10771         * cs-parser.jay (statement_expression): Set the return value to
10772         null, to avoid a crash when we catch an error.
10773
10774 2003-06-24  Miguel de Icaza  <miguel@ximian.com>
10775
10776         * cs-parser.jay: Applied patch from Jackson that adds support for
10777         extern and unsafe modifiers to destructor declarations.
10778
10779         * expression.cs: Report error 21 if the user is trying to index a
10780         System.Array.
10781
10782         * driver.cs: Add an error message, suggested by the bug report.
10783
10784         * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
10785         if we do not have a ": this ()" constructor initializer.  Fixes 45149
10786
10787 2003-06-14  Miguel de Icaza  <miguel@ximian.com>
10788
10789         * namespace.cs: Add some information to reduce FAQs.
10790
10791 2003-06-13  Miguel de Icaza  <miguel@ximian.com>
10792
10793         * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
10794         underlying enumeration types.  Fixes #43915.
10795
10796         * expression.cs: Treat ushort/short as legal values to be used in
10797         bitwise operations.
10798
10799 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
10800
10801         * delegate.cs: transfer custom attributes for paramenters from
10802         the delegate declaration to Invoke and BeginInvoke.
10803
10804 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
10805
10806         * attribute.cs: handle custom marshalers and emit marshal info
10807         for fields, too.
10808
10809 2003-05-28  Hector E. Gomez Morales  <hgomez_36@flashmail.com>
10810
10811         * makefile.gnu: Added anonymous.cs to the compiler sources.
10812
10813 2003-05-28  Miguel de Icaza  <miguel@ximian.com>
10814
10815         * iterators.cs: Change the name of the proxy class to include two
10816         underscores.
10817
10818         * cs-parser.jay: Update grammar to include anonymous methods.
10819
10820         * anonymous.cs: new file.
10821
10822 2003-05-27  Miguel de Icaza  <miguel@ximian.com>
10823
10824         * class.cs (Field.Define): Add missing test for pointers and
10825         safety. 
10826
10827 2003-05-27  Ravi Pratap  <ravi@ximian.com>
10828
10829         * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
10830         we use the stobj opcode.
10831
10832         (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
10833         since it wasn't the correct fix. 
10834
10835         It still is puzzling that we are required to use stobj for IntPtr
10836         which seems to be a ValueType.
10837
10838 2003-05-26  Miguel de Icaza  <miguel@ximian.com>
10839
10840         * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
10841         during regular simple name resolution.   Now, the trick is that
10842         instead of returning for processing the simplename, we do a
10843         TypeManager.LookupType (ie, a rooted lookup as opposed to a
10844         contextual lookup type).   If a match is found, return that, if
10845         not, return for further composition.
10846
10847         This fixes long-standing 30485.
10848
10849         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
10850         using the address to initialize an object, do an Stobj instead of
10851         using the regular Stelem.
10852
10853         (IndexerAccess.Emit, IndexerAccess.EmitAssign):
10854         Pass `is_base_indexer' to Invocation.EmitCall instead of false.
10855         Because if we are a BaseIndexerAccess that value will be true.
10856         Fixes 43643.
10857
10858         * statement.cs (GotoCase.Resolve): Return after reporting an
10859         error, do not attempt to continue. 
10860
10861         * expression.cs (PointerArithmetic.Emit): If our operand is a
10862         long, convert our constants to match the operand before
10863         multiplying.  Convert to I type before adding.   Fixes 43670.
10864
10865 2003-05-14  Ravi Pratap  <ravi@ximian.com>
10866
10867         * enum.cs (ImplicitConversionExists) : Rename to
10868         ImplicitEnumConversionExists to remove ambiguity. 
10869
10870         * ecore.cs (NullCast): New type of cast expression class which
10871         basically is very similar to EmptyCast with the difference being
10872         it still is a constant since it is used only to cast a null to
10873         something else
10874         (eg. (string) null)
10875
10876         * convert.cs (ImplicitReferenceConversion): When casting a null
10877         literal, we return a NullCast.
10878
10879         * literal.cs (NullLiteralTyped): Remove - I don't see why this
10880         should be around anymore.
10881
10882         The renaming (reported was slightly wrong). Corrections:
10883
10884         ConvertImplicitStandard -> ImplicitConversionStandard
10885         ConvertExplicitStandard -> ExplicitConversionStandard
10886
10887         * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
10888         before passing them in !
10889
10890         * convert.cs (ImplicitConversionStandard): When comparing for
10891         equal expr and target types, ensure that expr is not a
10892         NullLiteral.
10893
10894         In general, we must not be checking (expr_type ==
10895         target_type) in the top level conversion methods
10896         (ImplicitConversion, ExplicitConversion etc). This checking is
10897         done in the methods that they delegate to.
10898
10899 2003-05-20  Miguel de Icaza  <miguel@ximian.com>
10900
10901         * convert.cs: Move Error_CannotConvertType,
10902         ImplicitReferenceConversion, ImplicitReferenceConversionExists,
10903         ImplicitNumericConversion, ImplicitConversionExists,
10904         ImplicitUserConversionExists, StandardConversionExists,
10905         FindMostEncompassedType, FindMostSpecificSource,
10906         FindMostSpecificTarget, ImplicitUserConversion,
10907         ExplicitUserConversion, GetConversionOperators,
10908         UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
10909         TryImplicitIntConversion, Error_CannotConvertImplicit,
10910         ConvertImplicitRequired, ConvertNumericExplicit,
10911         ExplicitReferenceConversionExists, ConvertReferenceExplicit,
10912         ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
10913         its own file.
10914
10915         Perform the following renames:
10916
10917         StandardConversionExists -> ImplicitStandardConversionExists
10918         ConvertImplicit -> ImplicitConversion
10919         ConvertImplicitStandard -> ImplicitStandardConversion
10920         TryImplicitIntConversion -> ImplicitIntConversion
10921         ConvertImplicitRequired -> ImplicitConversionRequired
10922         ConvertNumericExplicit -> ExplicitNumericConversion
10923         ConvertReferenceExplicit -> ExplicitReferenceConversion
10924         ConvertExplicit -> ExplicitConversion
10925         ConvertExplicitStandard -> ExplicitStandardConversion
10926
10927 2003-05-19  Martin Baulig  <martin@ximian.com>
10928
10929         * statement.cs (TypeInfo.StructInfo): Made this type protected.
10930         (TypeInfo): Added support for structs having structs as fields.
10931
10932         * ecore.cs (FieldExpr): Implement IVariable.
10933         (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
10934         VariableInfo for the field.
10935
10936 2003-05-18  Martin Baulig  <martin@ximian.com>
10937
10938         * expression.cs (This.DoResolve): Report a CS0027 if we're
10939         emitting a field initializer.
10940
10941 2003-05-18  Martin Baulig  <martin@ximian.com>
10942
10943         * expression.cs (This.ResolveBase): New public function.
10944         (This.DoResolve): Check for CS0188.
10945
10946         * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
10947         This.Resolve().
10948
10949         * ecore.cs (MethodGroupExpr.DoResolve): Set the
10950         `instance_expression' to null if we don't have any non-static
10951         methods.
10952
10953 2003-05-18  Martin Baulig  <martin@ximian.com>
10954
10955         Reworked the way how local variables and parameters are handled by
10956         the flow analysis code.
10957
10958         * statement.cs (TypeInfo, VariableMap): New public classes.
10959         (VariableInfo): New public class.  This is now responsible for
10960         checking whether a variable has been assigned.  It is used for
10961         parameters and local variables.
10962         (Block.EmitMeta): Take the InternalParameters as argument; compute
10963         the layout of the flow vectors here.
10964         (Block.LocalMap, Block.ParameterMap): New public properties.
10965         (FlowBranching): The .ctor doesn't get the InternalParameters
10966         anymore since Block.EmitMeta() now computes the layout of the flow
10967         vector.
10968         (MyStructInfo): This class is now known as `StructInfo' and nested
10969         in `TypeInfo'; we don't access this directly anymore.
10970
10971         * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
10972         property and removed IsAssigned(), IsFieldAssigned(),
10973         SetAssigned() and SetFieldAssigned(); we now call them on the
10974         VariableInfo so we don't need to duplicate this code everywhere.
10975
10976         * expression.cs (ParameterReference): Added `Block block' argument
10977         to the .ctor.
10978         (LocalVariableReference, ParameterReference, This): The new
10979         VariableInfo class is now responsible for all the definite
10980         assignment stuff.
10981
10982         * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
10983         IsParameterAssigned, SetParameterAssigned): Removed.
10984
10985 2003-05-18  Martin Baulig  <martin@ximian.com>
10986
10987         * typemanager.cs (InitCoreTypes): Try calling
10988         SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
10989         the 3-args-version.  Corlib now also needs our `void_type'.
10990         (GetMethod): Added overloaded version which takes an optional
10991         `bool report_errors' to allow lookups of optional methods.
10992
10993 2003-05-12  Martin Baulig  <martin@ximian.com>
10994
10995         * statement.cs (VariableInfo): Renamed to LocalInfo since it's
10996         only used for locals and not for parameters.
10997
10998 2003-05-12  Miguel de Icaza  <miguel@ximian.com>
10999
11000         * support.cs (InternalParameters.ParameterType): Return the
11001         ExternalType of the parameter.
11002
11003         * parameter.cs (Parameter.ExternalType): drop the two arguments,
11004         they were unused.
11005
11006 2003-05-11  Miguel de Icaza  <miguel@ximian.com>
11007
11008         * class.cs (MethodData.Define): Do not set the `newslot' on
11009         interface members, if they are also flagged as "override".
11010
11011         * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
11012         better code for ++i and i++.  This only works for static fields
11013         and local variables.
11014
11015         * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
11016         want to pull the DeclSpace out of the builder_to_declspace instead
11017         of the TypeBuilder (like in TypeContainer.FindMembers).
11018
11019         * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
11020         instead of LookupTypeContainer.  Fixes the crash on .NET for
11021         looking up interface members.
11022
11023         * const.cs: Create our own emit context during the Definition
11024         stage, so that constants are evaluated in the proper context, when
11025         a recursive definition happens.
11026
11027 2003-05-11  Martin Baulig  <martin@ximian.com>
11028
11029         * statement.cs (Block.CreateSwitchBlock): New method.  Creates a
11030         new block for a switch section.
11031         (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
11032         the adding/lookup in the switch block.  Fixes #39828.
11033
11034 2003-05-09  Miguel de Icaza  <miguel@ximian.com>
11035
11036         * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
11037         functionality: I needed to convert the data after I had performed
11038         the add/sub operation into the operands type size.
11039
11040         * ecore.cs (ImplicitReferenceConversion): When boxing an interface
11041         pass the type for the box operation, otherwise the resulting
11042         object would have been of type object.
11043
11044         (BoxedCast): Add constructor to specify the type to box as.
11045
11046 2003-05-07  Miguel de Icaza  <miguel@ximian.com>
11047
11048         * iterators.cs: I was reusing the `count' variable inadvertently,
11049         take steps to not allow this to happen.
11050
11051 2003-05-06  Miguel de Icaza  <miguel@ximian.com>
11052
11053         * attribute.cs (Attribute.Resolve): Params attributes are encoded
11054         by creating an array at the point where the params starts and
11055         putting all those arguments there, then adjusting the size of the
11056         array.
11057
11058 2003-05-05  Miguel de Icaza  <miguel@ximian.com>
11059
11060         * expression.cs (New.AddressOf): Implement interface
11061         IMemoryLocation.  This is used when the `new' operator is used in
11062         the context of an invocation to a method on a value type.
11063
11064         See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
11065         example. 
11066
11067         * namespace.cs: Also check the using aliases here.
11068
11069         * driver.cs: Move the test for using validity after the types have
11070         been entered, so we do a single pass that also includes the using
11071         aliases. 
11072
11073         * statement.cs (Try.Resolve): Avoid crashing if there is a failure
11074         in the regular case.   CreateSiblingForFinally is doing extra
11075         error checking.
11076
11077         * attribute.cs (GetAttributeArgumentExpression): Store the result
11078         on an out value, and use the return value to indicate failure
11079         instead of using null (which is a valid return for Constant.GetValue).
11080
11081         * statement.cs: Perform the analysis flow for the increment
11082         portion after the statement, because this will be the real flow of
11083         execution.  Fixes #42385
11084
11085         * codegen.cs (EmitContext.EmitArgument,
11086         EmitContext.EmitStoreArgument): New helper functions when the
11087         RemapToProxy flag is set.
11088
11089         * expression.cs (ParameterReference.EmitLdarg): Expose this useful
11090         function.
11091
11092         Add support for remapping parameters. 
11093
11094         * iterators.cs: Propagate parameter values;  Store parameter
11095         values in the proxy classes.
11096
11097 2003-05-04  Miguel de Icaza  <miguel@ximian.com>
11098
11099         * ecore.cs (FieldExpr): Fix an obvious bug.  static fields do not
11100         need a proxy reference;  I do not know what I was thinking
11101
11102         * cs-parser.jay (constructor_initializer): catch another error,
11103         and display nice message.
11104
11105         (field_declaration): catch void field declaration
11106         to flag a better error. 
11107
11108         * class.cs (MemberBase.CheckBase): Report an error instead of a
11109         warning if a new protected member is declared in a struct. 
11110         (Field.Define): catch the error of readonly/volatile.
11111
11112         * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
11113
11114         (FieldExpr.AddressOf): ditto.  Catch error where the address of a
11115         volatile variable is taken
11116
11117 2003-05-02  Miguel de Icaza  <miguel@ximian.com>
11118
11119         * statement.cs (Fixed.Resolve): Report an error if we are not in
11120         an unsafe context.
11121
11122 2003-05-01  Miguel de Icaza  <miguel@ximian.com>
11123
11124         * typemanager.cs: reuse the code that handles type clashes for
11125         delegates and enumerations.
11126
11127         * class.cs (Report28): Always report.
11128
11129         * expression.cs (EncodeAsAttribute): Allow nulls here.
11130
11131 2003-04-28  Miguel de Icaza  <miguel@ximian.com>
11132
11133         * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
11134         the functionality for testing whether an expression is valid for
11135         an attribute here.  Also handle the case of arrays of elements
11136         being stored. 
11137
11138         * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
11139         encoding a linear array into an array of objects that are suitable
11140         to be passed to an CustomAttributeBuilder.
11141
11142         * delegate.cs: Check unsafe types being used outside of an Unsafe context.
11143
11144         * ecore.cs: (FieldExpr): Handle field remapping here.
11145
11146         * iteratators.cs: Pass the instance variable (if the method is an
11147         instance method) to the constructors, so we can access the field
11148         variables on the class.
11149
11150         TODO: Test this with structs.  I think the THIS variable on
11151         structs might have to be a pointer, and not a refenrece
11152
11153 2003-04-27  Miguel de Icaza  <miguel@ximian.com>
11154
11155         * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
11156         local variables to fields in a proxy class.
11157
11158         * iterators.cs (PopulateProxy): Rename our internal fields to
11159         <XXX>.  
11160         Create a <THIS> field if we are an instance method, so we can
11161         reference our parent container variables.
11162         (MapVariable): Called back from the EmitContext code to enter a
11163         new variable to field mapping into the proxy class (we just create
11164         a FieldBuilder).
11165
11166         * expression.cs
11167         (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
11168         for using the remapped locals to fields.
11169
11170         I placed the code here, because that gives the same semantics to
11171         local variables, and only changes the Emit code.
11172
11173         * statement.cs (Fixed.Resolve): it is not allowed to have fixed
11174         statements inside iterators.
11175         (VariableInfo): Add a FieldBuilder for the cases when we are
11176         remapping local variables to fields in a proxy class
11177
11178         * ecore.cs (SimpleNameResolve): Avoid testing two times for
11179         current_block != null.
11180
11181         * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
11182         not cope with strings, as it has been moved to the
11183         TableSwitchEmit.  Fixed bug in switch generation.
11184
11185         * expression.cs (New.DoResolve): Provide more context for the user
11186         when reporting an error.
11187
11188         * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
11189         pointers. 
11190
11191         * expression.cs (MemberAccess.DoResolve): When we get a type back,
11192         check the permissions for it.  Note than in a type-resolution
11193         context the check was already present in DeclSpace.ResolveType,
11194         but was missing from the MemberAccess.
11195
11196         (ArrayCreation.CheckIndices): warn if the user has
11197         more nested levels of expressions, but there are no more
11198         dimensions specified.  Avoids crash on bug 41906.
11199
11200 2003-04-26  Miguel de Icaza  <miguel@ximian.com>
11201
11202         * statement.cs (Block): replace Implicit bool, for a generic
11203         flags.   
11204         New flag: `Unchecked'.  This is used during the EmitMeta phase
11205         (which is out-of-line with the regular Resolve/Emit process for a
11206         statement, as this is done ahead of time, but still gets a chance
11207         to call constant resolve).
11208
11209         (Block.Flags): new enum for adding a new flag.
11210
11211         (Block.EmitMeta): track the state of unchecked.
11212
11213         (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
11214         to enable constant resolution to work there as well.
11215
11216 2003-04-22  Miguel de Icaza  <miguel@ximian.com>
11217
11218         * typemanager.cs (ienumerable_type): Also look up
11219         System.Collections.IEnumerable. 
11220
11221 2003-04-21  Miguel de Icaza  <miguel@ximian.com>
11222
11223         TODO: Test more than one conditional per method.
11224
11225         * class.cs (Indexer.Define): Report the location where the user is
11226         referencing the unsupported feature.
11227
11228         (MethodData): Overload the use of `conditionals' to
11229         minimize the creation of needless ArrayLists.   This saves roughly
11230         212kb on my machine.
11231
11232         (Method): Implement the new IIteratorContainer interface.
11233         (Method.SetYields): Implement the method by setting the ModFlags
11234         to contain METHOD_YIELDS.
11235
11236         * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
11237         which just got set to null.
11238
11239         * iterators.cs: New file.
11240
11241         (Yield, YieldBreak): New statements.
11242
11243         * statement.cs (Return.Resolve): Flag an error if we are used in
11244         an iterator method.
11245
11246         * codegen.cs (InIterator): New flag set if the code is being
11247         compiled in an iterator method.
11248
11249         * modifiers.cs: New flag METHOD_YIELDS.  This modifier is an
11250         internal modifier, and we just use it to avoid adding extra
11251         fields, as this is seldom used.  
11252
11253         * cs-parser.jay: Add yield_statement (yield and yield break).
11254
11255         * driver.cs: New flag -v2 to turn on version 2 features. 
11256
11257         * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
11258         hashtable when v2 is enabled.
11259
11260 2003-04-20  Miguel de Icaza  <miguel@ximian.com>
11261
11262         * typemanager.cs (TypeManager.NamespaceClash): Use to check if
11263         there is already a namespace defined with this name.
11264
11265         (TypeManager.InitCoreTypes): Remove the temporary workaround, as
11266         people upgraded their corlibs.
11267
11268         (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
11269         always use fully qualified types, no need to use the compiler
11270         front end.
11271
11272         (TypeManager.IsNamespace): Use binarysearch.
11273
11274         * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
11275         AddDelegate): I did not quite use the new IsValid API properly: I
11276         have to pass the short-name and the fullname.  I was passing only
11277         the basename instead of the fullname sometimes. 
11278
11279         (TypeContainer.DefineType): call NamespaceClash.
11280
11281         * interface.cs (Interface.DefineType): use NamespaceClash before
11282         defining the type.
11283
11284         * delegate.cs (Delegate.DefineType): use NamespaceClash before
11285         defining the type.
11286
11287         * enum.cs: (Enum.DefineType): use NamespaceClash before
11288         defining the type.
11289
11290         * typemanager.cs (: 3-line patch that gives us some tasty 11%
11291         speed increase.  First, use the negative_hits cache when we get a
11292         negative.  Second, add the type with its full original name
11293         instead of the new . and + encoded name (reflection uses + to
11294         separate type from a nested type).  Use LookupTypeReflection
11295         directly which bypasses the type->name hashtable (that we already
11296         know does not contain the type.
11297
11298         * decl.cs (DeclSpace.ResolveTypeExpr): track the
11299         location/container type. 
11300
11301         * driver.cs: When passing utf8, use directly the UTF8Encoding.
11302
11303 2003-04-19  Miguel de Icaza  <miguel@ximian.com>
11304
11305         * decl.cs (ResolveTypeExpr): Mirror check acess here too.
11306
11307         * delegate.cs (NewDelegate.Resolve): Test whether an instance
11308         method is being referenced in the method group from a static
11309         context, and report error 120 if so.
11310
11311         * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
11312         Error118. 
11313
11314         * typemanager.cs: Add intermediate namespaces (if a namespace A.B
11315         is created, we create the A namespace).
11316
11317         * cs-parser.jay: A namespace also introduces a DeclarationFound.
11318         Fixes #41591
11319
11320 2003-04-18  Miguel de Icaza  <miguel@ximian.com>
11321
11322         * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
11323         invocation to ModuleBuilder.GetType with the same values will
11324         return a new type instance, so we need to cache its return
11325         values. 
11326
11327         * expression.cs (Binary.ResolveOperator): Only allow the compare
11328         operators on enums if they are of the same type.
11329
11330         * ecore.cs (Expression.ImplicitReferenceConversion): handle target
11331         types of ValueType on their own case.  Before we were giving them
11332         the same treatment as objects.
11333
11334         * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
11335         fullname.  Short name is used to compare against container name.
11336         Fullname is used to check against defined namespace names.
11337
11338         * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
11339         AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
11340
11341         (Method.CheckBase): Call parent.
11342         (MemberBase.CheckBase): Check for protected members on sealed
11343         classes.
11344         (PropertyBase.CheckBase): Call parent.
11345         (Field.Define): Call parent.
11346
11347         * report.cs: Negative error codes are now mapped to 8000 - code,
11348         so that the display is render more nicely.
11349
11350         * typemanager.cs: Do not use try/catch, instead report a regular
11351         error. 
11352
11353         (GetPointerType, GetReferenceType): These methods provide
11354         mechanisms to obtain the T* and T& from a T.  We had the code
11355         previously scattered around the code base, and it also used
11356         TypeManager.LookupType that would go through plenty of caches.
11357         This one goes directly to the type source.
11358
11359         In some places we did the Type.GetType followed by
11360         ModuleBuilder.GetType, but not in others, so this unifies the
11361         processing as well.
11362
11363         * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
11364         statements now that we have namespace information.
11365
11366         * typemanager.cs (IsNamespace): New method, returns whether the
11367         string presented is a namespace or not.
11368
11369         (ComputeNamespaces): New public entry point, computes the list of
11370         available namespaces, using the GetNamespaces API call in Mono, or
11371         the slower version in MS.NET.   
11372
11373         Now before we start the semantic analysis phase, we have a
11374         complete list of namespaces including everything that the user has
11375         provided.
11376
11377         Deleted old code to cache namespaces in .nsc files.
11378
11379 2003-04-17  Miguel de Icaza  <miguel@ximian.com>
11380
11381         * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
11382         class/struct location definition Location for the implicit
11383         constructor location.
11384
11385         (Operator.Define): Use the location of the operator for the
11386         implicit Method definition.
11387
11388         (Constructor.Emit): use the constructor location for the implicit
11389         base initializer constructor.
11390
11391         * ecore.cs: Remove ITypeExpression.  This interface is now gone,
11392         and the Expression class now contains two new methods:
11393
11394         ResolveAsTypeStep and ResolveAsTypeTerminal.  This is used to
11395         isolate type lookup from the rest of the resolution process.
11396
11397         Since we use Expressions to hold type definitions due to the way
11398         we parse the input we have historically overloaded Resolve to
11399         perform the Type lookups if a special flag is passed.  Now this is
11400         eliminated and two methods take their place. 
11401
11402         The differences in the two methods between xStep and xTerminal is
11403         that xStep is involved in our current lookup system that uses
11404         SimpleNames to compose a name, while xTerminal is used just to
11405         catch the case where the simplename lookup failed.
11406
11407 2003-04-16  Miguel de Icaza  <miguel@ximian.com>
11408
11409         * expression.cs (ResolveMemberAccess): Remove redundant code.
11410         TypeExpr expressions are always born fully resolved.
11411
11412         * interface.cs (PopulateMethod): Do not lookup the types twice.
11413         We were doing it once during SemanticAnalysis and once during
11414         PopulateMethod.
11415
11416         * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
11417         in local variable type definitions, were being returned as a
11418         SimpleName (we decomposed everything into a string), that is
11419         because primary_expression was being used instead of a type in the
11420         grammar (reduce/reduce conflicts).
11421
11422         The part that was wrong is that we converted the expression into a
11423         string (an oversimplification in one hand, compounded with primary
11424         expressions doing string concatenation).
11425
11426         So things like:
11427
11428         A.B.C [] x;
11429
11430         Would return "A.B.C[]" as a SimpleName.  This stopped things like
11431         using clauses from working on this particular context.  And a type
11432         was being matched directly against "A.B.C[]".
11433
11434         We now use the correct approach, and allow for ComposedCast to be
11435         part of the unary expression.  So the "A.B.C []" become a composed
11436         cast of "A.B.C" (as a nested group of MemberAccess with a
11437         SimpleName at the end) plus the rank composition "[]". 
11438
11439         Also fixes 35567
11440
11441 2003-04-10  Miguel de Icaza  <miguel@ximian.com>
11442
11443         * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
11444         for the access level checking.
11445
11446         * class.cs: Cosmetic changes.  Renamed `TypeContainer parent' to
11447         `TypeContainer container', because I kept getting confused when I
11448         was debugging this code.
11449
11450         * expression.cs (Indexers): Instead of tracking getters/setters,
11451         we now track them in parallel.  We create one arraylist less, but
11452         most importantly it is possible now for the LValue code to find a
11453         matching get for a set.
11454
11455         (IndexerAccess.DoResolveLValue): Update the code.
11456         GetIndexersForType has been modified already to extract all the
11457         indexers from a type.  The code assumed it did not.
11458
11459         Also make the code set the correct return type for the indexer.
11460         This was fixed a long time ago for properties, but was missing for
11461         indexers.  It used to be void_type.
11462
11463         (Binary.Emit): Test first for doubles instead of
11464         floats, as they are more common.
11465
11466         (Binary.EmitBranchable): Use the .un version of the branch opcodes
11467         when dealing with floats and the <=, >= operators.  This fixes bug
11468         #39314 
11469
11470         * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
11471         to load the array value by emitting a load on the foreach variable
11472         type.  This was incorrect.  
11473
11474         We now emit the code to load an element using the the array
11475         variable type, and then we emit the conversion operator.
11476
11477         Fixed #40176
11478
11479 2003-04-10  Zoltan Varga  <vargaz@freemail.hu>
11480
11481         * attribute.cs: Avoid allocation of ArrayLists in the common case.
11482
11483 2003-04-09  Miguel de Icaza  <miguel@ximian.com>
11484
11485         * class.cs (MethodSignature.InheritableMemberSignatureCompare):
11486         test for protection before we test for signatures. 
11487
11488         (MethodSignature.ToString): implement.
11489
11490         * expression.cs (Unary.TryReduceNegative): Add missing minus sign
11491         to the case where we reduced into a LongConstant.
11492
11493         * decl.cs (CheckAccessLevel): If the type is an array, we can not
11494         depend on whether the information is acurrate, because the
11495         Microsoft runtime will always claim that the array type is public,
11496         regardless of the real state.
11497
11498         If the type is a pointer, another problem happens: the type is
11499         reported as non-public in Microsoft.  
11500
11501         In both cases we have to call CheckAccessLevel recursively with
11502         the underlying type as the argument to be tested.
11503
11504 2003-04-08  Miguel de Icaza  <miguel@ximian.com>
11505
11506         * assign.cs (Assign.Emit): If we are dealing with a compound
11507         assignment expression, we should use the code path that stores the
11508         intermediate result in a temporary value.  This fixes #40903.
11509
11510         *expression.cs (Indirection.ToString): Provide ToString method for
11511         debugging. 
11512
11513 2003-04-08  Zoltan Varga  <vargaz@freemail.hu>
11514
11515         * class.cs: Null out fields holding references to Block objects so
11516         they can be garbage collected.
11517
11518         * expression.cs (OverloadResolve): Remove unused local.
11519
11520 2003-04-07  Martin Baulig  <martin@ximian.com>
11521
11522         * codegen.cs (EmitContext.CurrentFile): New public field.
11523         (EmitContext.Mark): Use the CurrentFile to check whether the
11524         location is in the correct file.
11525         (EmitContext.EmitTopBlock): Initialize CurrentFile here.
11526
11527 2003-04-07  Martin Baulig  <martin@ximian.com>
11528
11529         * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
11530
11531         * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
11532         location.  [FIXME: The location argument which gets passed to this
11533         method is sometimes wrong!]
11534
11535 2003-04-07  Nick Drochak <ndrochak@gol.com>
11536
11537         * codegen.cs: Be more verbose when we can't find the symbol writer dll.
11538
11539 2003-04-07  Miguel de Icaza  <miguel@ximian.com>
11540
11541         * expression.cs (Indirection.EmitAssign): We were using the
11542         temporary, but returning immediately instead of continuing the
11543         EmitAssing flow.
11544
11545 2003-04-06  Martin Baulig  <martin@ximian.com>
11546
11547         * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
11548         if it's a nested child, but also deriving from the outer class.
11549         See test 190.cs.
11550
11551         * typemanager.cs (IsNestedChildOf): Make this work if it's a
11552         nested child, but also deriving from the outer class.  See
11553         test-190.cs.
11554         (FilterWithClosure): We may access private members of the outer
11555         class if we're a nested child and deriving from the outer class.
11556         (RealMemberLookup): Only set `closure_private_ok' if the
11557         `original_bf' contained BindingFlags.NonPublic.
11558
11559 2003-04-05  Martin Baulig  <martin@ximian.com>
11560
11561         * expression.cs (SizeOf.DoResolve): Use ResolveTypeExpr, so we can
11562         probe if its a type parameter, and if so, flag an error.
11563
11564         * decl.cs: Move here the SetParameterInfo code from class.cs.
11565         Handle IsGeneric here.
11566
11567         Handle a variety of errors in the parameter info definition.
11568
11569         * ecore.cs (SimpleName.DoResolveType): Handle look ups for generic
11570         type parameters here.
11571
11572         * cs-parser.jay (class_declaration): report errors for parameters
11573         here as well.
11574
11575 2003-01-21  Miguel de Icaza  <miguel@ximian.com>
11576
11577         * generic.cs: New file, contains support code for generics.
11578
11579         * cs-parser.jay: Remove OP_SHIFT_LEFT, OP_SHIFT_RIGHT,
11580         OP_SHIFT_LEFT_ASSIGN, OP_SHIFT_RIGHT_ASSIGN.
11581
11582         Update parser for the above removals.
11583
11584         * cs-tokenizer.cs: Do not handle <<= or >>= specially.  This is
11585         now taken care of in the parser.
11586
11587 2003-04-02  Miguel de Icaza  <miguel@ximian.com>
11588
11589         * class.cs (Event.Define): Do not allow abstract events to have
11590         initializers. 
11591
11592 2003-04-01  Miguel de Icaza  <miguel@ximian.com>
11593
11594         * cs-parser.jay: Add error productions for ADD/REMOVE missing a
11595         block in event declarations.
11596
11597         * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
11598         value type, get its address.
11599
11600         * expression.cs (Is.Emit): For action `LeaveOnStack' we were
11601         leaving a class on the stack instead of a boolean value (int
11602         0/1).  Change the code so we compare against null, and then the
11603         result against zero.
11604
11605         * class.cs (TypeContainer.GetClassBases): We were checking for the
11606         parent class being sealed too late.
11607
11608         * expression.cs (Binary.Emit): For <= and >= when dealing with
11609         floating point values, use cgt.un and clt.un instead of cgt and
11610         clt alone.
11611
11612 2003-04-01  Zoltan Varga  <vargaz@freemail.hu>
11613
11614         * statement.cs: Apply the same optimization as MS: skip the 
11615         GetEnumerator returning an IEnumerator, and use the one returning a 
11616         CharEnumerator instead. This allows us to avoid the try-finally block 
11617         and the boxing.
11618
11619 2003-03-31  Gaurav Vaish <gvaish_mono@lycos.com>
11620
11621         * cs-parser.jay: Attributes cannot be applied to
11622                          namespaces. Fixes #40473
11623
11624 2003-03-31  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11625
11626         * class.cs:
11627         (Add*): check if the name is valid using the full name for constants,
11628         fields, properties and events.
11629
11630 2003-03-28  Miguel de Icaza  <miguel@ximian.com>
11631
11632         * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
11633         char constants to be part of the enumeration.
11634
11635         * expression.cs (Conditional.DoResolve): Add support for operator
11636         true. Implements the missing functionality from 14.12
11637
11638         * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
11639         operator true/false as required by the spec.
11640
11641         * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
11642         implicit conversion to boolean.
11643
11644         * statement.cs (Statement.ResolveBoolean): A boolean expression is
11645         also one where the type implements `operator true'. 
11646
11647         * ecore.cs (Expression.GetOperatorTrue): New helper routine to
11648         get an expression that will invoke operator true based on an
11649         expression.  
11650
11651         (GetConversionOperators): Removed the hack that called op_True
11652         here.  
11653
11654         (Expression.ResolveBoolean): Move this from Statement.
11655
11656 2003-03-17  Miguel de Icaza  <miguel@ximian.com>
11657
11658         * ecore.cs (FieldExpr): do not allow initialization of initonly
11659         fields on derived classes
11660
11661 2003-03-13  Martin Baulig  <martin@ximian.com>
11662
11663         * statement.cs (Block.Emit): Call ig.BeginScope() and
11664         ig.EndScope() when compiling with debugging info; call
11665         LocalBuilder.SetLocalSymInfo _after_ opening the scope.
11666
11667 2003-03-08  Miguel de Icaza  <miguel@ximian.com>
11668
11669         * expression.cs (Indexers): Do not construct immediately, allow
11670         for new members to be appended as we go.  Fixes 38143
11671
11672 2003-03-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11673
11674         * expression.cs: save/restore context when resolving an unchecked
11675         expression.
11676
11677 2003-03-05  Miguel de Icaza  <miguel@ximian.com>
11678
11679         * cfold.cs: Catch division by zero in modulus operator during
11680         constant folding.
11681
11682 2003-03-03  Miguel de Icaza  <miguel@ximian.com>
11683
11684         * interface.cs (Interface.DefineMembers): Avoid defining members
11685         twice. 
11686
11687 2003-02-27  Miguel de Icaza  <miguel@ximian.com>
11688
11689         * driver.cs: handle the +/- options for -noconfig
11690
11691         * statement.cs (Unckeched.Resolve): Also track the state of
11692         unchecked in the Resolve phase.
11693
11694 2003-02-27  Martin Baulig  <martin@ximian.com>
11695
11696         * ecore.cs (Expression.MemberLookup): Don't create a
11697         MethodGroupExpr for something which is not a method.  Fixes #38291.
11698
11699 2003-02-25  Miguel de Icaza  <miguel@ximian.com>
11700
11701         * class.cs (MemberBase.CheckParameters): Also check that the type
11702         is unmanaged if it is a pointer.
11703
11704         * expression.cs (SizeOf.Resolve): Add location information.
11705
11706         * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
11707         a managed type is declared.
11708
11709         * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
11710         parameter modifiers as well.  Fixes bug 38606
11711
11712         * class.cs: Very sad.  Am backing out the speed up changes
11713         introduced by the ArrayList -> Array in the TypeContainer, as they
11714         were not actually that much faster, and introduced a bug (no error
11715         reports on duplicated methods).
11716
11717         * assign.cs (CompoundAssign.DoLResolve): Resolve the original
11718         source first, this will guarantee that we have a valid expression
11719         before calling in lower levels functions that will require a
11720         resolved object.  Then use this original_source in the
11721         target.ResolveLValue instead of the original source that was
11722         passed to us.
11723
11724         Another change.  Use target.Resolve instead of LValueResolve.
11725         Although we are resolving for LValues, we will let the Assign code
11726         take care of that (it will be called again from Resolve).  This
11727         basically allows code like this:
11728
11729         class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
11730         class Y { void A (X x) { x [0] += o; }
11731
11732         The problem was that the indexer was trying to resolve for
11733         set_Item (idx, object o) and never finding one.  The real set_Item
11734         was set_Item (idx, X).  By delaying the process we get the right
11735         semantics. 
11736
11737         Fixes bug 36505
11738
11739 2003-02-23  Martin Baulig  <martin@ximian.com>
11740
11741         * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
11742         while calling DoEmit ().
11743
11744         * codegen.cs (EmitContext.Mark): Don't mark locations in other
11745         source files; if you use the #line directive inside a method, the
11746         compiler stops emitting line numbers for the debugger until it
11747         reaches the end of the method or another #line directive which
11748         restores the original file.
11749
11750 2003-02-23  Martin Baulig  <martin@ximian.com>
11751
11752         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
11753
11754 2003-02-23  Martin Baulig  <martin@ximian.com>
11755
11756         * statement.cs (Block.AddChildVariableNames): We need to call this
11757         recursively, not just for our immediate children.
11758
11759 2003-02-23  Martin Baulig  <martin@ximian.com>
11760
11761         * class.cs (Event.Define): Always make the field private, like csc does.
11762
11763         * typemanager.cs (TypeManager.RealMemberLookup): Make events
11764         actually work, fixes bug #37521.
11765
11766 2003-02-23  Miguel de Icaza  <miguel@ximian.com>
11767
11768         * delegate.cs: When creating the various temporary "Parameters"
11769         classes, make sure that we call the ComputeAndDefineParameterTypes
11770         on those new parameters (just like we do with the formal ones), to
11771         allow them to be resolved in the context of the DeclSpace.
11772
11773         This fixes the bug that Dick observed in Bugzilla #38530.
11774
11775 2003-02-22  Miguel de Icaza  <miguel@ximian.com>
11776
11777         * expression.cs (ResolveMemberAccess): When resolving a constant,
11778         do not attempt to pull a constant if the value was not able to
11779         generate a valid constant.
11780
11781         * const.cs (LookupConstantValue): Do not report more errors than required.
11782
11783 2003-02-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11784
11785         * expression.cs: fixes bug #38328.
11786
11787 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
11788
11789         * class.cs: Changed all the various members that can be part of a
11790         class from being an ArrayList to be an Array of the right type.
11791         During the DefineType type_list, interface_list, delegate_list and
11792         enum_list are turned into types, interfaces, delegates and enums
11793         arrays.  
11794
11795         And during the member population, indexer_list, event_list,
11796         constant_list, field_list, instance_constructor_list, method_list,
11797         operator_list and property_list are turned into their real arrays.
11798
11799         Although we could probably perform this operation earlier, for
11800         good error reporting we need to keep the lists and remove the
11801         lists for longer than required.
11802
11803         This optimization was triggered by Paolo profiling the compiler
11804         speed on the output of `gen-sample-program.pl' perl script. 
11805
11806         * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
11807         not crash in methods like MemberLookupFailed that use this field.  
11808
11809         This problem arises when the compiler fails to resolve a type
11810         during interface type definition for example.
11811
11812 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
11813
11814         * expression.cs (Indexers.GetIndexersForType): Interfaces do not
11815         inherit from System.Object, so we have to stop at null, not only
11816         when reaching System.Object.
11817
11818 2003-02-17  Miguel de Icaza  <miguel@ximian.com>
11819
11820         * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
11821         DeclaredOnly because the parent indexer might have had a different
11822         name, but did not loop until the top of the hierarchy was reached.
11823
11824         The problem this one fixes is 35492: when a class implemented an
11825         indexer from an interface, we were getting the interface method
11826         (which was abstract) and we were flagging an error (can not invoke
11827         abstract method).
11828
11829         This also keeps bug 33089 functioning, and test-148 functioning.
11830
11831         * typemanager.cs (IsSpecialMethod): The correct way of figuring
11832         out if a method is special is to see if it is declared in a
11833         property or event, or whether it is one of the predefined operator
11834         names.   This should fix correctly #36804.
11835
11836 2003-02-15  Miguel de Icaza  <miguel@ximian.com>
11837
11838         The goal here is to remove the dependency on EmptyCast.Peel ().
11839         Killing it completely.
11840
11841         The problem is that currently in a number of places where
11842         constants are expected, we have to "probe" for an EmptyCast, and
11843         Peel, which is not the correct thing to do, as this will be
11844         repetitive and will likely lead to errors. 
11845
11846         The idea is to remove any EmptyCasts that are used in casts that
11847         can be reduced to constants, so we only have to cope with
11848         constants. 
11849
11850         This bug hunt was triggered by Bug 37363 and the desire to remove
11851         the duplicate pattern where we were "peeling" emptycasts to check
11852         whether they were constants.  Now constants will always be
11853         constants.
11854
11855         * ecore.cs: Use an enumconstant here instead of wrapping with
11856         EmptyCast.  
11857
11858         * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
11859         throwing me off.  By handling this we can get rid of a few hacks.
11860
11861         * statement.cs (Switch): Removed Peel() code.
11862
11863 2003-02-14  Miguel de Icaza  <miguel@ximian.com>
11864
11865         * class.cs: Location information for error 508
11866
11867         * expression.cs (New.DoResolve): Add a guard against double
11868         resolution of an expression.  
11869
11870         The New DoResolve might be called twice when initializing field
11871         expressions (see EmitFieldInitializers, the call to
11872         GetInitializerExpression will perform a resolve on the expression,
11873         and later the assign will trigger another resolution
11874
11875         This leads to bugs (#37014)
11876
11877         * delegate.cs: The signature for EndInvoke should contain any ref
11878         or out parameters as well.  We were not doing this in the past. 
11879
11880         * class.cs (Field.Define): Do not overwrite the type definition
11881         inside the `volatile' group.  Turns out that volatile enumerations
11882         were changing the type here to perform a validity test, which
11883         broke conversions. 
11884
11885 2003-02-12  Miguel de Icaza  <miguel@ximian.com>
11886
11887         * ecore.cs (FieldExpr.AddressOf): In the particular case of This
11888         and structs, we do not want to load the instance variable
11889
11890         (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
11891         enum_type has to be handled like an object reference (implicit
11892         conversions exists from this to object), but the regular IsClass
11893         and IsValueType tests will never return true for this one.
11894
11895         Also we use TypeManager.IsValueType instead of type.IsValueType,
11896         just for consistency with the rest of the code (this is only
11897         needed if we ever use the construct exposed by test-180.cs inside
11898         corlib, which we dont today).
11899
11900 2003-02-12  Zoltan Varga  <vargaz@freemail.hu>
11901
11902         * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
11903         just InternalCall.
11904
11905 2003-02-09  Martin Baulig  <martin@ximian.com>
11906
11907         * namespace.cs (Namespace..ctor): Added SourceFile argument.
11908         (Namespace.DefineNamespaces): New static public method; this is
11909         called when we're compiling with debugging to add all namespaces
11910         to the symbol file.
11911
11912         * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
11913         pass it to the Namespace's .ctor.
11914
11915         * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
11916         and MethodBase arguments; pass the namespace ID to the symwriter;
11917         pass the MethodBase instead of the token to the symwriter.
11918         (SymbolWriter.DefineNamespace): New method to add a namespace to
11919         the symbol file.
11920
11921 2003-02-09  Martin Baulig  <martin@ximian.com>
11922
11923         * symbolwriter.cs: New file.  This is a wrapper around
11924         ISymbolWriter with a cleaner API.  We'll dynamically Invoke()
11925         methods here in near future.
11926
11927 2003-02-09  Martin Baulig  <martin@ximian.com>
11928
11929         * codegen.cs (EmitContext.Mark): Just pass the arguments to
11930         ILGenerator.MarkSequencePoint() which are actually used by the
11931         symbol writer.
11932
11933 2003-02-09  Martin Baulig  <martin@ximian.com>
11934
11935         * location.cs (SourceFile): New public sealed class.  This
11936         contains the name and an index which is used in the location's token.
11937         (Location): Reserve an appropriate number of bits in the token for
11938         the source file instead of walking over that list, this gives us a
11939         really huge performance improvement when compiling with debugging.
11940
11941         * driver.cs (Driver.parse, Driver.tokenize_file): Take a
11942         `SourceFile' argument instead of a string.
11943         (Driver.ProcessFile): Add all the files via Location.AddFile(),
11944         but don't parse/tokenize here, we need to generate the list of all
11945         source files before we do that.
11946         (Driver.ProcessFiles): New static function.  Parses/tokenizes all
11947         the files.
11948
11949         * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
11950         instead of a string.
11951
11952         * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
11953         of a string.
11954
11955 2003-02-09  Martin Baulig  <martin@ximian.com>
11956
11957         * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
11958         filename on `#line default'.
11959
11960 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
11961
11962         * statement.cs: don't clear the pinned var when the fixed statement
11963         returns from the method (fixes bug#37752).
11964
11965 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
11966
11967         * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban) 
11968         to IsValueType.
11969
11970 2003-02-07  Martin Baulig  <martin@ximian.com>
11971
11972         * driver.cs: Removed the `--debug-args' command line argument.
11973
11974         * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
11975         automatically by the AsssemblyBuilder.
11976         (CodeGen.InitializeSymbolWriter): We don't need to call any
11977         initialization function on the symbol writer anymore.  This method
11978         doesn't take any arguments.
11979
11980 2003-02-03  Miguel de Icaza  <miguel@ximian.com>
11981
11982         * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
11983         from referenced assemblies as well.
11984
11985 2003-02-02  Martin Baulig  <martin@ximian.com>
11986
11987         * class.cs (MethodData.Emit): Generate debugging info for external methods.
11988
11989 2003-02-02  Martin Baulig  <martin@ximian.com>
11990
11991         * class.cs (Constructor.Emit): Open the symbol writer before
11992         emitting the constructor initializer.
11993         (ConstructorInitializer.Emit): Call ec.Mark() to allow
11994         single-stepping through constructor initializers.
11995
11996 2003-01-30  Miguel de Icaza  <miguel@ximian.com>
11997
11998         * class.cs: Handle error 549: do not allow virtual methods in
11999         sealed classes. 
12000
12001 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
12002
12003         * decl.cs: Check access levels when resolving types
12004
12005 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
12006
12007         * statement.cs: Add parameters and locals set in catch blocks that might 
12008         return to set vector
12009
12010 2003-01-29  Miguel de Icaza  <miguel@ximian.com>
12011
12012         * class.cs (Operator): Set the SpecialName flags for operators.
12013
12014         * expression.cs (Invocation.DoResolve): Only block calls to
12015         accessors and operators on SpecialName methods.
12016
12017         (Cast.TryReduce): Handle conversions from char constants.
12018
12019
12020 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
12021
12022         * statement.cs: small memory and time optimization in FlowBranching.
12023
12024 2003-01-28  Pedro Mart  <yoros@wanadoo.es>
12025
12026         * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
12027         problem that the last fix but in the other sid (Set).
12028
12029         * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
12030         access when there is no indexer in the hierarchy.
12031
12032 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
12033
12034         * class.cs: Combine some if statements.
12035
12036 2003-01-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12037
12038         * driver.cs: fixed bug #37187.
12039
12040 2003-01-27  Pedro Martinez Juliá  <yoros@wanadoo.es>
12041
12042         * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
12043         any indexer, it's needed to build a list with all the indexers in the
12044         hierarchy (AllGetters), else we have problems. Fixes #35653.
12045
12046 2003-01-23  Miguel de Icaza  <miguel@ximian.com>
12047
12048         * class.cs (MethodData.Define): It is wrong for an interface
12049         implementation to be static in both cases: explicit and implicit.
12050         We were only handling this in one case.
12051
12052         Improve the if situation there to not have negations.
12053
12054         * class.cs (Field.Define): Turns out that we do not need to check
12055         the unsafe bit on field definition, only on usage.  Remove the test.
12056
12057 2003-01-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12058
12059         * driver.cs: use assembly.Location instead of Codebase (the latest
12060         patch made mcs fail when using MS assemblies).
12061
12062 2003-01-21  Tim Haynes <thaynes@openlinksw.com>
12063
12064         * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
12065         get the path to *corlib.dll.
12066
12067 2003-01-21  Nick Drochak <ndrochak@gol.com>
12068
12069         * cs-tokenizer.cs:
12070         * pending.cs:
12071         * typemanager.cs: Remove compiler warnings
12072
12073 2003-01-20  Duncan Mak  <duncan@ximian.com>
12074
12075         * AssemblyInfo.cs: Bump the version number to 0.19.
12076
12077 2003-01-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12078
12079         * cs-tokenizer.cs: little fixes to line numbering when #line is used.
12080
12081 2003-01-18  Zoltan Varga  <vargaz@freemail.hu>
12082
12083         * class.cs (Constructor::Emit): Emit debugging info for constructors.
12084
12085 2003-01-17  Miguel de Icaza  <miguel@ximian.com>
12086
12087         * cs-parser.jay: Small fix: we were not comparing the constructor
12088         name correctly.   Thanks to Zoltan for the initial pointer.
12089
12090 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
12091
12092         * cs-tokenizer.cs: Set file name when specified with #line
12093
12094 2003-01-15  Miguel de Icaza  <miguel@ximian.com>
12095
12096         * cs-parser.jay: Only perform the constructor checks here if we
12097         are named like the class;  This will help provider a better
12098         error.  The constructor path is taken when a type definition is
12099         not found, but most likely the user forgot to add the type, so
12100         report that rather than the constructor error.
12101
12102 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
12103
12104         * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
12105         allocations.
12106
12107 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
12108
12109         * cs-parser.jay: Add cleanup call.
12110
12111 2003-01-13  Duncan Mak  <duncan@ximian.com>
12112
12113         * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
12114         consistent with other methods.
12115
12116 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
12117
12118         * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
12119
12120 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
12121
12122         * attribute.cs: only set GuidAttr to true when we have a
12123         GuidAttribute.
12124
12125 2003-01-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12126
12127         * ecore.cs:
12128         * expression.cs:
12129         * typemanager.cs: fixes to allow mcs compile corlib with the new
12130         Type.IsSubclassOf fix.
12131
12132 2003-01-08  Miguel de Icaza  <miguel@ximian.com>
12133
12134         * expression.cs (LocalVariableReference.DoResolve): Classify a
12135         constant as a value, not as a variable.   Also, set the type for
12136         the variable.
12137
12138         * cs-parser.jay (fixed_statement): take a type instead of a
12139         pointer_type, so we can produce a better error message later.
12140
12141         * statement.cs (Fixed.Resolve): Flag types that are not pointers
12142         as an error.  
12143
12144         (For.DoEmit): Make inifinite loops have a
12145         non-conditional branch back.
12146
12147         (Fixed.DoEmit): First populate the pinned variables, then emit the
12148         statement, then clear the variables.  Before I was emitting the
12149         code once for each fixed piece.
12150
12151
12152 2003-01-08  Martin Baulig  <martin@ximian.com>
12153
12154         * statement.cs (FlowBranching.MergeChild): A break in a
12155         SWITCH_SECTION does not leave a loop.  Fixes #36155.
12156
12157 2003-01-08  Martin Baulig  <martin@ximian.com>
12158
12159         * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
12160         lives in the same number space than `param_map'.  Fixes #36154.
12161
12162 2003-01-07  Miguel de Icaza  <miguel@ximian.com>
12163
12164         * cs-parser.jay (constructor_declaration): Set the
12165         Constructor.ModFlags before probing for it.  This makes the
12166         compiler report 514, 515 and 132 (the code was there, but got
12167         broken). 
12168
12169         * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
12170         (GotoDefault.Resolve): Set `Returns' to ALWAYS.
12171         (GotoCase.Resolve): Set `Returns' to ALWAYS.
12172
12173 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
12174
12175         * enum.cs: create the enum static fields using the enum type.
12176
12177 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
12178
12179         * class.cs: don't try to create the ParamBuilder for the return
12180         type if it's not needed (and handle it breaking for the ms runtime
12181         anyway).
12182
12183 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
12184
12185         * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
12186
12187 2002-12-29  Miguel de Icaza  <miguel@ximian.com>
12188
12189         * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
12190         the command.   This showed up while compiling the JANET source
12191         code, which used \r as its only newline separator.
12192
12193 2002-12-28  Miguel de Icaza  <miguel@ximian.com>
12194
12195         * class.cs (Method.Define): If we are an operator (because it
12196         reuses our code), then set the SpecialName and HideBySig.  #36128
12197
12198 2002-12-22  Miguel de Icaza  <miguel@ximian.com>
12199
12200         * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
12201         exception, report error 120 `object reference required'.
12202
12203         * driver.cs: Add --pause option, used during to measure the size
12204         of the process as it goes with --timestamp.
12205
12206         * expression.cs (Invocation.DoResolve): Do not allow methods with
12207         SpecialName to be invoked.
12208
12209 2002-12-21  Miguel de Icaza  <miguel@ximian.com>
12210
12211         * cs-tokenizer.cs: Small fix to the parser: compute the ascii
12212         number before adding it.
12213
12214 2002-12-21  Ravi Pratap  <ravi@ximian.com>
12215
12216         * ecore.cs (StandardImplicitConversion): When in an unsafe
12217         context, we allow conversion between void * to any other pointer
12218         type. This fixes bug #35973.
12219
12220 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
12221
12222         * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
12223         is not thrown when extensionless outputs are used 
12224
12225 2002-12-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12226
12227         * rootcontext.cs: fixed compilation of corlib.
12228
12229 2002-12-19  Miguel de Icaza  <miguel@ximian.com>
12230
12231         * attribute.cs (Attributes.Contains): Add new method.
12232
12233         * class.cs (MethodCore.LabelParameters): if the parameter is an
12234         `out' parameter, check that no attribute `[In]' has been passed.
12235
12236         * enum.cs: Handle the `value__' name in an enumeration.
12237
12238 2002-12-14  Jaroslaw Kowalski <jarek@atm.com.pl>
12239
12240         * decl.cs: Added special case to allow overrides on "protected
12241         internal" methods
12242
12243 2002-12-18  Ravi Pratap  <ravi@ximian.com>
12244
12245         * attribute.cs (Attributes.AddAttributeSection): Rename to this
12246         since it makes much more sense.
12247
12248         (Attributes.ctor): Don't require a Location parameter.
12249
12250         * rootcontext.cs (AddGlobalAttributeSection): Rename again.
12251
12252         * attribute.cs (ApplyAttributes): Remove extra Location parameters
12253         since we already have that information per attribute.
12254
12255         * everywhere : make appropriate changes.
12256
12257         * class.cs (LabelParameters): Write the code which actually
12258         applies attributes to the return type. We can't do this on the MS
12259         .NET runtime so we flag a warning in the case an exception is
12260         thrown.
12261
12262 2002-12-18  Miguel de Icaza  <miguel@ximian.com>
12263
12264         * const.cs: Handle implicit null conversions here too.
12265
12266 2002-12-17  Ravi Pratap  <ravi@ximian.com>
12267
12268         * class.cs (MethodCore.LabelParameters): Remove the extra
12269         Type [] parameter since it is completely unnecessary. Instead
12270         pass in the method's attributes so that we can extract
12271         the "return" attribute.
12272
12273 2002-12-17  Miguel de Icaza  <miguel@ximian.com>
12274
12275         * cs-parser.jay (parse): Use Report.Error to flag errors instead
12276         of ignoring it and letting the compile continue.
12277
12278         * typemanager.cs (ChangeType): use an extra argument to return an
12279         error condition instead of throwing an exception.
12280
12281 2002-12-15  Miguel de Icaza  <miguel@ximian.com>
12282
12283         * expression.cs (Unary.TryReduce): mimic the code for the regular
12284         code path.  Perform an implicit cast in the cases where we can
12285         implicitly convert to one of the integral types, and then reduce
12286         based on that constant.   This fixes bug #35483.
12287
12288 2002-12-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12289
12290         * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
12291
12292 2002-12-13  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12293
12294         * namespace.cs: fixed bug #35489.
12295
12296 2002-12-12  Miguel de Icaza  <miguel@ximian.com>
12297
12298         * class.cs: Remove some dead code.
12299
12300         * cs-parser.jay: Estimate the number of methods needed
12301         (RootContext.MethodCount);
12302
12303         * cs-tokenizer.cs: Use char arrays for parsing identifiers and
12304         numbers instead of StringBuilders.
12305
12306         * support.cs (PtrHashtable): Add constructor with initial size;
12307         We can now reduce reallocations of the method table.
12308
12309 2002-12-10  Ravi Pratap  <ravi@ximian.com>
12310
12311         * attribute.cs (ApplyAttributes): Keep track of the emitted
12312         attributes on a per-target basis. This fixes bug #35413.
12313
12314 2002-12-10  Miguel de Icaza  <miguel@ximian.com>
12315
12316         * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
12317         default to the Windows 1252 encoding.
12318
12319         (UnixParseOption): Support version, thanks to Alp for the missing
12320         pointer. 
12321
12322         * AssemblyInfo.cs: Add nice assembly information.
12323
12324         * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
12325         (bug 35169).
12326
12327         * cs-parser.jay: Allow a trailing comma before the close bracked
12328         in the attribute_section production.
12329
12330         * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
12331         address of the instance was being taken, I will take this out,
12332         because we take the address of the object immediately here.
12333
12334 2002-12-09  Ravi Pratap  <ravi@ximian.com>
12335
12336         * typemanager.cs (AreMultipleAllowed): Take care of the most
12337         obvious case where attribute type is not in the current assembly -
12338         stupid me ;-)
12339
12340 2002-12-08  Miguel de Icaza  <miguel@ximian.com>
12341
12342         * ecore.cs (SimpleName.DoResolve): First perform lookups on using
12343         definitions, instead of doing that afterwards.  
12344
12345         Also we use a nice little hack, depending on the constructor, we
12346         know if we are a "composed" name or a simple name.  Hence, we
12347         avoid the IndexOf test, and we avoid 
12348
12349         * codegen.cs: Add code to assist in a bug reporter to track down
12350         the source of a compiler crash. 
12351
12352 2002-12-07  Ravi Pratap  <ravi@ximian.com>
12353
12354         * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
12355         types have been emitted for a given element and flag an error
12356         if something which does not have AllowMultiple set is used more
12357         than once.
12358
12359         * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
12360         attribute types and their corresponding AllowMultiple properties
12361
12362         (AreMultipleAllowed): Check the property for a given type.
12363
12364         * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
12365         property in the case we have a TypeContainer.
12366
12367         (Attributes.AddAttribute): Detect duplicates and just skip on
12368         adding them. This trivial fix catches a pretty gross error in our
12369         attribute emission - global attributes were being emitted twice!
12370
12371         Bugzilla bug #33187 is now fixed.
12372
12373 2002-12-06  Miguel de Icaza  <miguel@ximian.com>
12374
12375         * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
12376         instead of pp_and).
12377
12378         * expression.cs (Binary.ResolveOperator): I can only use the
12379         Concat (string, string, string) and Concat (string, string,
12380         string, string) if the child is actually a concatenation of
12381         strings. 
12382
12383 2002-12-04  Miguel de Icaza  <miguel@ximian.com>
12384
12385         * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
12386         context where we need a 2-character lookahead.
12387
12388         * pending.cs (PendingImplementation): Rework so we can keep track
12389         of interface types all the time, and flag those which were
12390         implemented by parents as optional.
12391
12392 2002-12-03  Miguel de Icaza  <miguel@ximian.com>
12393
12394         * expression.cs (Binary.ResolveOperator): Use
12395         String.Concat(string,string,string) or
12396         String.Concat(string,string,string,string) when possible. 
12397
12398         * typemanager: More helper methods.
12399
12400
12401 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
12402
12403         * pending.cs: remove the bogus return from GetMissingInterfaces()
12404         (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
12405
12406 2002-12-02  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12407
12408         * namespace.cs: avoid duplicated 'using xxx' being added to
12409         using_clauses. This prevents mcs from issuing and 'ambiguous type' error
12410         when we get more than one 'using' statement for the same namespace.
12411         Report a CS0105 warning for it.
12412
12413 2002-11-30  Miguel de Icaza  <miguel@ximian.com>
12414
12415         * cs-tokenizer.cs (consume_identifier): use read directly, instead
12416         of calling getChar/putback, uses internal knowledge of it.    
12417
12418         (xtoken): Reorder tokenizer so most common patterns are checked
12419         first.  This reduces the compilation time in another 5% (from 8.11s
12420         average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
12421
12422         The parsing time is 22% of the compilation in mcs, and from that
12423         64% is spent on the tokenization process.  
12424
12425         I tried using a binary search for keywords, but this is slower
12426         than the hashtable.  Another option would be to do a couple of
12427         things:
12428
12429                 * Not use a StringBuilder, instead use an array of chars,
12430                   with a set value.  Notice that this way we could catch
12431                   the 645 error without having to do it *afterwards*.
12432
12433                 * We could write a hand-parser to avoid the hashtable
12434                   compares altogether.
12435
12436         The identifier consumption process takes 37% of the tokenization
12437         time.  Another 15% is spent on is_number.  56% of the time spent
12438         on is_number is spent on Int64.Parse:
12439
12440                 * We could probably choose based on the string length to
12441                   use Int32.Parse or Int64.Parse and avoid all the 64-bit
12442                   computations. 
12443
12444         Another 3% is spend on wrapping `xtoken' in the `token' function.
12445
12446         Handle 0xa0 as whitespace (#34752)
12447
12448 2002-11-26  Miguel de Icaza  <miguel@ximian.com>
12449
12450         * typemanager.cs (IsCLRType): New routine to tell whether a type
12451         is one of the builtin types.  
12452
12453         Maybe it needs to use TypeCodes to be faster.  Maybe we could use
12454         typecode in more places instead of doing pointer comparissions.
12455         We could leverage some knowledge about the way the typecodes are
12456         laid out.
12457
12458         New code to cache namespaces in assemblies, it is currently not
12459         invoked, to be used soon.
12460
12461         * decl.cs (DeclSpace.MakeFQN): Simple optimization.
12462
12463         * expression.cs (Binary.ResolveOperator): specially handle
12464         strings, and do not perform user-defined operator overloading for
12465         built-in types.
12466
12467 2002-11-24  Miguel de Icaza  <miguel@ximian.com>
12468
12469         * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
12470         internalcall as it is a pretty simple operation;  Avoid whenever
12471         possible to call Char.IsLetter.
12472
12473         (consume_identifier): Cut by half the number of
12474         hashtable calls by merging the is_keyword and GetKeyword behavior.
12475
12476         Do not short-circuit, because if we do, we
12477         report errors (ie, #if false && true would produce an invalid
12478         directive error);
12479
12480
12481 2002-11-24  Martin Baulig  <martin@ximian.com>
12482
12483         * expression.cs (Cast.TryReduce): If we're in checked syntax,
12484         check constant ranges and report a CS0221.  Fixes #33186.
12485
12486 2002-11-24  Martin Baulig  <martin@ximian.com>
12487
12488         * cs-parser.jay: Make this work for uninitialized variable
12489         declarations in the `for' initializer.  Fixes #32416.
12490
12491 2002-11-24  Martin Baulig  <martin@ximian.com>
12492
12493         * ecore.cs (Expression.ConvertExplicit): Make casting from/to
12494         System.Enum actually work.  Fixes bug #32269, added verify-6.cs.
12495
12496 2002-11-24  Martin Baulig  <martin@ximian.com>
12497
12498         * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
12499         argument; if true, we also check for user-defined conversions.
12500         This is only needed if both arguments are of a user-defined type.
12501         Fixes #30443, added test-175.cs.
12502         (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
12503
12504         * ecore.cs (Expression.ImplicitUserConversionExists): New method.
12505
12506 2002-11-24  Martin Baulig  <martin@ximian.com>
12507
12508         * expression.cs (ArrayAccess.GetStoreOpcode): New public static
12509         function to get the store opcode.
12510         (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
12511         only emit the Ldelema if the store opcode is Stobj.  You must run
12512         both test-34 and test-167 to test this.  Fixes #34529.
12513
12514 2002-11-23  Martin Baulig  <martin@ximian.com>
12515
12516         * ecore.cs (Expression.MemberLookup): Added additional
12517         `qualifier_type' argument which is used when we're being called
12518         from MemberAccess.DoResolve() and null if we're called from a
12519         SimpleName lookup.
12520         (Expression.MemberLookupFailed): New method to report errors; this
12521         does the CS1540 check and reports the correct error message.
12522
12523         * typemanager.cs (MemberLookup): Added additional `qualifier_type'
12524         argument for the CS1540 check and redone the way how we're dealing
12525         with private members.  See the comment in the source code for details.
12526         (FilterWithClosure): Reverted this back to revision 1.197; renamed
12527         `closure_start_type' to `closure_qualifier_type' and check whether
12528         it's not null.  It was not this filter being broken, it was just
12529         being called with the wrong arguments.
12530
12531         * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
12532         and pass it the correct `qualifier_type'; this also does the error
12533         handling for us.
12534
12535 2002-11-22  Miguel de Icaza  <miguel@ximian.com>
12536
12537         * expression.cs (Invocation.EmitParams): If the we are dealing
12538         with a non-built-in value type, load its address as well.
12539
12540         (ArrayCreation): Use a a pretty constant instead
12541         of the hardcoded value 2.   Use 6 instead of 2 for the number of
12542         static initializers.  
12543
12544         (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
12545         because they are not really value types, just glorified integers. 
12546
12547         * driver.cs: Do not append .exe, the CSC compiler does not do it.
12548
12549         * ecore.cs: Remove redundant code for enumerations, make them use
12550         the same code path as everything else, fixes the casting issue
12551         with enumerations in Windows.Forms.
12552
12553         * attribute.cs: Do only cast to string if it is a string, the
12554         validation happens later.
12555
12556         * typemanager.cs: Temproary hack to avoid a bootstrap issue until
12557         people upgrade their corlibs.
12558
12559         * ecore.cs: Oops, enumerations were not following the entire code path
12560
12561 2002-11-21  Miguel de Icaza  <miguel@ximian.com>
12562
12563         * typemanager.cs (FilterWithClosure): Commented out the test for
12564         1540 in typemanager.cs, as it has problems when accessing
12565         protected methods from a parent class (see test-174.cs). 
12566
12567         * attribute.cs (Attribute.ValidateGuid): new method.
12568         (Attribute.Resolve): Use above.
12569
12570 2002-11-19  Miguel de Icaza  <miguel@ximian.com>
12571
12572         * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
12573
12574         * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
12575         handling for enumerations, as we only needed the TypeContainer
12576         functionality to begin with (this is required for the fix below to
12577         work for enums that reference constants in a container class for
12578         example). 
12579
12580         * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
12581
12582         * enum.cs (Enum.Define): Use `this' instead of parent, so we have
12583         a valid TypeBuilder to perform lookups on.o
12584
12585         * class.cs (InheritableMemberSignatureCompare): Use true in the
12586         call to GetGetMethod and GetSetMethod, because we are comparing
12587         the signature, and we need to get the methods *even* if they are
12588         private. 
12589
12590         (PropertyBase.CheckBase): ditto.
12591
12592         * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
12593         GotoCase.Resolve): Use Peel on EmpytCasts.
12594
12595         * ecore.cs (EmptyCast): drop child, add Peel method.
12596
12597 2002-11-17  Martin Baulig  <martin@ximian.com>
12598
12599         * ecore.cs (EmptyCast.Child): New public property.
12600
12601         * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
12602         label resolved to an EmptyCast.  Fixes #34162.
12603         (GotoCase.Resolve): Likewise.
12604         (Block.EmitMeta): Likewise.
12605
12606 2002-11-17  Martin Baulig  <martin@ximian.com>
12607
12608         * expression.cs (Invocation.BetterConversion): Prefer int over
12609         uint; short over ushort; long over ulong for integer literals.
12610         Use ImplicitConversionExists instead of StandardConversionExists
12611         since we also need to check for user-defined implicit conversions.
12612         Fixes #34165.  Added test-173.cs.
12613
12614 2002-11-16  Martin Baulig  <martin@ximian.com>
12615
12616         * expression.cs (Binary.EmitBranchable): Eliminate comparisions
12617         with the `true' and `false' literals.  Fixes #33151.
12618
12619 2002-11-16  Martin Baulig  <martin@ximian.com>
12620
12621         * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
12622         October 22nd; don't do the cs1540 check for static members.
12623
12624         * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
12625         now using our own filter here and doing the cs1540 check again.
12626
12627 2002-11-16  Martin Baulig  <martin@ximian.com>
12628
12629         * support.cs (InternalParameters): Don't crash if we don't have
12630         any fixed parameters.  Fixes #33532.
12631
12632 2002-11-16  Martin Baulig  <martin@ximian.com>
12633
12634         * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
12635         when looking up static methods to make this work on Windows.
12636         Fixes #33773.
12637
12638 2002-11-16  Martin Baulig  <martin@ximian.com>
12639
12640         * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
12641         a setter rather than using PropertyInfo.CanWrite.
12642
12643 2002-11-15  Nick Drochak  <ndrochak@gol.com>
12644
12645         * class.cs: Allow acces to block member by subclasses. Fixes build
12646         breaker.
12647
12648 2002-11-14  Martin Baulig  <martin@ximian.com>
12649
12650         * class.cs (Constructor.Emit): Added the extern/block check.
12651         Fixes bug #33678.
12652
12653 2002-11-14  Martin Baulig  <martin@ximian.com>
12654
12655         * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
12656         iteration while looking for indexers, this is needed because the
12657         indexer may have a different name in our base classes.  Fixed the
12658         error reporting (no indexers at all, not get accessor, no
12659         overloaded match).  Fixes bug #33089.
12660         (IndexerAccess.DoResolveLValue): Likewise.
12661
12662 2002-11-14  Martin Baulig  <martin@ximian.com>
12663
12664         * class.cs (PropertyBase.CheckBase): Make this work for multiple
12665         indexers.  Fixes the first part of bug #33089.
12666         (MethodSignature.InheritableMemberSignatureCompare): Added support
12667         for properties.
12668
12669 2002-11-13  Ravi Pratap  <ravi@ximian.com>
12670
12671         * attribute.cs (Attribute.Resolve): Catch the
12672         NullReferenceException and report it since it isn't supposed to
12673         happen. 
12674
12675 2002-11-12  Miguel de Icaza  <miguel@ximian.com>
12676
12677         * expression.cs (Binary.EmitBranchable): Also handle the cases for
12678         LogicalOr and LogicalAnd that can benefit from recursively
12679         handling EmitBranchable.  The code now should be nice for Paolo.
12680
12681 2002-11-08  Miguel de Icaza  <miguel@ximian.com>
12682
12683         * typemanager.cs (LookupType): Added a negative-hit hashtable for
12684         the Type lookups, as we perform quite a number of lookups on
12685         non-Types.  This can be removed once we can deterministically tell
12686         whether we have a type or a namespace in advance.
12687
12688         But this might require special hacks from our corlib.
12689
12690         * TODO: updated.
12691
12692         * ecore.cs (TryImplicitIntConversion): Handle conversions to float
12693         and double which avoids a conversion from an integer to a double.
12694
12695         * expression.cs: tiny optimization, avoid calling IsConstant,
12696         because it effectively performs the lookup twice.
12697
12698 2002-11-06  Miguel de Icaza  <miguel@ximian.com>
12699
12700         But a bogus return here to keep the semantics of the old code
12701         until the Mono runtime is fixed.
12702
12703         * pending.cs (GetMissingInterfaces): New method used to remove all
12704         the interfaces that are already implemented by our parent
12705         classes from the list of pending methods. 
12706
12707         * interface.cs: Add checks for calls after ResolveTypeExpr.
12708
12709 2002-11-05  Miguel de Icaza  <miguel@ximian.com>
12710
12711         * class.cs (Class.Emit): Report warning 67: event not used if the
12712         warning level is beyond 3.
12713
12714         * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
12715         being a NullLiteral.
12716
12717         * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
12718         specifiers. 
12719
12720         * class.cs (TypeContainer.GetClassBases): Cover a missing code
12721         path that might fail if a type can not be resolved.
12722
12723         * expression.cs (Binary.Emit): Emit unsigned versions of the
12724         operators. 
12725
12726         * driver.cs: use error 5.
12727
12728 2002-11-02  Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
12729
12730         * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
12731
12732 2002-11-01  Miguel de Icaza  <miguel@ximian.com>
12733
12734         * cs-parser.jay (switch_section): A beautiful patch from Martin
12735         Baulig that fixed 33094.
12736
12737 2002-10-31  Miguel de Icaza  <miguel@ximian.com>
12738
12739         * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
12740         Check whether the base is abstract and report an error if so.
12741
12742         * expression.cs (IndexerAccess.DoResolveLValue,
12743         IndexerAccess.DoResolve): ditto. 
12744
12745         (Invocation.DoResolve): ditto.
12746
12747         (Invocation.FullMethodDesc): Improve the report string.
12748
12749         * statement.cs (Block): Eliminate IsVariableDefined as it is
12750         basically just a wrapper for GetVariableInfo.
12751
12752         * ecore.cs (SimpleName): Use new 
12753
12754         * support.cs (ReflectionParamter.ParameterType): We unwrap the
12755         type, as we return the actual parameter ref/unref state on a
12756         different call.
12757
12758 2002-10-30  Miguel de Icaza  <miguel@ximian.com>
12759
12760         * support.cs: Return proper flags REF/OUT fixing the previous
12761         commit.  
12762
12763         * expression.cs: Reverted last patch, that was wrong.  Is_ref is
12764         not used to mean `ref' but `ref or out' in ParameterReference
12765
12766         * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
12767         full type signature instead of calling TypeManger.CSharpName
12768         ourselves. 
12769
12770         * support.cs (InternalParameters.ParameterDesc): Do not compare
12771         directly to the modflags, because REF/OUT will actually be bitsets
12772         if set. 
12773
12774         * delegate.cs (VerifyMethod): Check also the modifiers.
12775
12776         * cs-tokenizer.cs: Fix bug where floating point values with an
12777         exponent where a sign was missing was ignored.
12778
12779         * driver.cs: Allow multiple assemblies to be specified in a single
12780         /r: argument
12781
12782 2002-10-28  Miguel de Icaza  <miguel@ximian.com>
12783
12784         * cs-parser.jay: Ugly.  We had to add a multiplicative_expression,
12785         because identifiers after a parenthesis would end up in this kind
12786         of production, and we needed to desamiguate it for having casts
12787         like:
12788
12789                 (UserDefinedType *) xxx
12790
12791 2002-10-24  Miguel de Icaza  <miguel@ximian.com>
12792
12793         * typemanager.cs (RealMemberLookup): when we deal with a subclass,
12794         we should set on the Bindingflags.NonPublic, but not turn on
12795         private_ok.  private_ok controls whether a Private member is
12796         returned (this is chekced on the filter routine), while the
12797         BindingFlags.NonPublic just controls whether private/protected
12798         will be allowed.   This fixes the problem part of the problem of
12799         private properties being allowed to be used in derived classes.
12800
12801         * expression.cs (BaseAccess): Provide an DoResolveLValue method,
12802         so we can call the children DoResolveLValue method (this will
12803         properly signal errors on lvalue assignments to base properties)
12804
12805         * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
12806         getter are null, and we have a property info, we know that this
12807         happened because the lookup failed, so we report an error 122 for
12808         protection level violation.
12809
12810         We also silently return if setter and getter are null in the
12811         resolve functions, this condition only happens if we have flagged
12812         the error before.  This is the other half of the problem. 
12813
12814         (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
12815         not have accessibility information, that is why we were returning
12816         true in the filter function in typemanager.cs.
12817
12818         To properly report 122 (property is inaccessible because of its
12819         protection level) correctly, we report this error in ResolveAccess
12820         by failing if both the setter and the getter are lacking (ie, the
12821         lookup failed). 
12822
12823         DoResolve and DoLResolve have been modified to check for both
12824         setter/getter being null and returning silently, the reason being
12825         that I did not want to put the knowledge about this error in upper
12826         layers, like:
12827
12828         int old = Report.Errors;
12829         x = new PropertyExpr (...);
12830         if (old != Report.Errors)
12831                 return null;
12832         else
12833                 return x;
12834
12835         So the property expr is returned, but it is invalid, so the error
12836         will be flagged during the resolve process. 
12837
12838         * class.cs: Remove InheritablePropertySignatureCompare from the
12839         class, as we no longer depend on the property signature to compute
12840         whether it is possible to implement a method or not.
12841
12842         The reason is that calling PropertyInfo.GetGetMethod will return
12843         null (in .NET, in Mono it works, and we should change this), in
12844         cases where the Get Method does not exist in that particular
12845         class.
12846
12847         So this code:
12848
12849         class X { public virtual int A { get { return 1; } } }
12850         class Y : X { }
12851         class Z : Y { public override int A { get { return 2; } } }
12852
12853         Would fail in Z because the parent (Y) would not have the property
12854         defined.  So we avoid this completely now (because the alternative
12855         fix was ugly and slow), and we now depend exclusively on the
12856         method names.
12857
12858         (PropertyBase.CheckBase): Use a method-base mechanism to find our
12859         reference method, instead of using the property.
12860
12861         * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
12862         routines are gone now.
12863
12864         * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
12865         names, they were incorrectly named.
12866
12867         * cs-tokenizer.cs: Return are more gentle token on failure. 
12868
12869         * pending.cs (PendingImplementation.InterfaceMethod): This routine
12870         had an out-of-sync index variable, which caused it to remove from
12871         the list of pending methods the wrong method sometimes.
12872
12873 2002-10-22  Miguel de Icaza  <miguel@ximian.com>
12874
12875         * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
12876         CanWrite, because those refer to this particular instance of the
12877         property, and do not take into account the fact that we can
12878         override single members of a property.
12879
12880         Constructor requires an EmitContext.  The resolution process does
12881         not happen here, but we need to compute the accessors before,
12882         because the resolution does not always happen for properties.
12883
12884         * typemanager.cs (RealMemberLookup): Set private_ok if we are a
12885         subclass, before we did not update this flag, but we did update
12886         bindingflags. 
12887
12888         (GetAccessors): Drop this routine, as it did not work in the
12889         presence of partially overwritten set/get methods. 
12890
12891         Notice that this broke the cs1540 detection, but that will require
12892         more thinking. 
12893
12894 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12895
12896         * class.cs:
12897         * codegen.cs:
12898         * driver.cs: issue a warning instead of an error if we don't support
12899         debugging for the platform. Also ignore a couple of errors that may
12900         arise when trying to write the symbols. Undo my previous patch.
12901
12902 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12903
12904         * driver.cs: ignore /debug switch except for Unix platforms.
12905
12906 2002-10-23  Nick Drochak  <ndrochak@gol.com>
12907
12908         * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
12909
12910 2002-10-21  Miguel de Icaza  <miguel@ximian.com>
12911
12912         * driver.cs: Do not make mcs-debug conditional, so we do not break
12913         builds that use it.
12914
12915         * statement.cs (UsageVector.MergeChildren): I would like Martin to
12916         review this patch.  But basically after all the children variables
12917         have been merged, the value of "Breaks" was not being set to
12918         new_breaks for Switch blocks.  I think that it should be set after
12919         it has executed.  Currently I set this to the value of new_breaks,
12920         but only if new_breaks is FlowReturn.ALWAYS, which is a bit
12921         conservative, but I do not understand this code very well.
12922
12923         I did not break anything in the build, so that is good ;-)
12924
12925         * cs-tokenizer.cs: Also allow \r in comments as a line separator.
12926
12927 2002-10-20  Mark Crichton  <crichton@gimp.org>
12928
12929         * cfold.cs: Fixed compile blocker.  Really fixed it this time.
12930
12931 2002-10-20  Nick Drochak  <ndrochak@gol.com>
12932
12933         * cfold.cs: Fixed compile blocker.
12934
12935 2002-10-20  Miguel de Icaza  <miguel@ximian.com>
12936
12937         * driver.cs: I was chekcing the key, not the file.
12938
12939 2002-10-19  Ravi Pratap  <ravi@ximian.com>
12940
12941         * ecore.cs (UserDefinedConversion): Get rid of the bogus error
12942         message that we were generating - we just need to silently return
12943         a null.
12944
12945 2002-10-19  Miguel de Icaza  <miguel@ximian.com>
12946
12947         * class.cs (Event.Define): Change my previous commit, as this
12948         breaks the debugger.  This is a temporary hack, as it seems like
12949         the compiler is generating events incorrectly to begin with.
12950
12951         * expression.cs (Binary.ResolveOperator): Added support for 
12952         "U operator - (E x, E y)"
12953
12954         * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
12955         y)".
12956
12957         * ecore.cs (FieldExpr.AddressOf): We had a special code path for
12958         init-only variables, but this path did not take into account that
12959         there might be also instance readonly variables.  Correct this
12960         problem. 
12961
12962         This fixes bug 32253
12963
12964         * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
12965         delegates as well.
12966
12967         * driver.cs: Change the extension for modules to `netmodule'
12968
12969         * cs-parser.jay: Improved slightly the location tracking for
12970         the debugger symbols.
12971
12972         * class.cs (Event.Define): Use Modifiers.FieldAttr on the
12973         modifiers that were specified instead of the hardcoded value
12974         (FamAndAssem).  This was basically ignoring the static modifier,
12975         and others.  Fixes 32429.
12976
12977         * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
12978         fixed a bug in the process (32476)
12979
12980         * expression.cs (ArrayAccess.EmitAssign): Patch from
12981         hwang_rob@yahoo.ca that fixes bug 31834.3
12982
12983 2002-10-18  Miguel de Icaza  <miguel@ximian.com>
12984
12985         * driver.cs: Make the module extension .netmodule.
12986
12987 2002-10-16  Miguel de Icaza  <miguel@ximian.com>
12988
12989         * driver.cs: Report an error if the resource file is not found
12990         instead of crashing.
12991
12992         * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
12993         false, like Emit does.
12994
12995 2002-10-16  Nick Drochak  <ndrochak@gol.com>
12996
12997         * typemanager.cs: Remove unused private member.  Also reported mcs
12998         bug to report this as a warning like csc.
12999
13000 2002-10-15  Martin Baulig  <martin@gnome.org>
13001
13002         * statement.cs (Statement.Emit): Made this a virtual method; emits
13003         the line number info and calls DoEmit().
13004         (Statement.DoEmit): New protected abstract method, formerly knows
13005         as Statement.Emit().
13006
13007         * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
13008
13009 2002-10-11  Miguel de Icaza  <miguel@ximian.com>
13010
13011         * class.cs: Following the comment from 2002-09-26 to AddMethod, I
13012         have fixed a remaining problem: not every AddXXXX was adding a
13013         fully qualified name.  
13014
13015         Now everyone registers a fully qualified name in the DeclSpace as
13016         being defined instead of the partial name.  
13017
13018         Downsides: we are slower than we need to be due to the excess
13019         copies and the names being registered this way.  
13020
13021         The reason for this is that we currently depend (on the corlib
13022         bootstrap for instance) that types are fully qualified, because
13023         we dump all the types in the namespace, and we should really have
13024         types inserted into the proper namespace, so we can only store the
13025         basenames in the defined_names array.
13026
13027 2002-10-10  Martin Baulig  <martin@gnome.org>
13028
13029         * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
13030         from bug #31834, see the bug report for a testcase which is
13031         miscompiled.
13032
13033 2002-10-10  Martin Baulig  <martin@gnome.org>
13034
13035         * codegen.cs (EmitContext.Breaks): Removed, we're now using the
13036         flow analysis code for this.
13037
13038         * statement.cs (Do, While, For): Tell the flow analysis code about
13039         infinite loops.
13040         (FlowBranching.UsageVector): Added support for infinite loops.
13041         (Block.Resolve): Moved the dead code elimination here and use flow
13042         analysis to do it.
13043
13044 2002-10-09  Miguel de Icaza  <miguel@ximian.com>
13045
13046         * class.cs (Field.Define): Catch cycles on struct type
13047         definitions. 
13048
13049         * typemanager.cs (IsUnmanagedtype): Do not recursively check
13050         fields if the fields are static.  We only need to check instance
13051         fields. 
13052
13053         * expression.cs (As.DoResolve): Test for reference type.
13054
13055         * statement.cs (Using.ResolveExpression): Use
13056         ConvertImplicitRequired, not ConvertImplicit which reports an
13057         error on failture
13058         (Using.ResolveLocalVariableDecls): ditto.
13059
13060         * expression.cs (Binary.ResolveOperator): Report errors in a few
13061         places where we had to.
13062
13063         * typemanager.cs (IsUnmanagedtype): Finish implementation.
13064
13065 2002-10-08  Miguel de Icaza  <miguel@ximian.com>
13066
13067         * expression.cs: Use StoreFromPtr instead of extracting the type
13068         and then trying to use Stelem.  Patch is from hwang_rob@yahoo.ca
13069
13070         * ecore.cs (ImplicitReferenceConversion): It is possible to assign
13071         an enumeration value to a System.Enum, but System.Enum is not a
13072         value type, but an class type, so we need to box.
13073
13074         (Expression.ConvertExplicit): One codepath could return
13075         errors but not flag them.  Fix this.  Fixes #31853
13076
13077         * parameter.cs (Resolve): Do not allow void as a parameter type.
13078
13079 2002-10-06  Martin Baulig  <martin@gnome.org>
13080
13081         * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
13082         if it's a class type and not a struct.  Fixes #31815.
13083
13084 2002-10-06  Martin Baulig  <martin@gnome.org>
13085
13086         * statement.cs: Reworked the flow analysis code a bit to make it
13087         usable for dead code elimination.
13088
13089 2002-10-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13090
13091         * cs-parser.jay: allow empty source files. Fixes bug #31781.
13092
13093 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
13094
13095         * expression.cs (ComposedCast.DoResolveType): A quick workaround
13096         to fix the test 165, will investigate deeper.
13097
13098 2002-10-04  Martin Baulig  <martin@gnome.org>
13099
13100         * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
13101         finally blocks actually work.
13102         (Try.Resolve): We don't need to create a sibling for `finally' if
13103         there is no finally block.
13104
13105 2002-10-04  Martin Baulig  <martin@gnome.org>
13106
13107         * class.cs (Constructor.Define): The default accessibility for a
13108         non-default constructor is private, not public.
13109
13110 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
13111
13112         * class.cs (Constructor): Make AllowedModifiers public, add
13113         EXTERN.
13114
13115         * cs-parser.jay: Perform the modifiers test here, as the
13116         constructor for the Constructor class usually receives a zero
13117         because of the way we create it (first we create, later we
13118         customize, and we were never checking the modifiers).
13119
13120         * typemanager.cs (Typemanager.LookupTypeDirect): This new function
13121         is a version of LookupTypeReflection that includes the type-name
13122         cache.  This can be used as a fast path for functions that know
13123         the fully qualified name and are only calling into *.GetType() to
13124         obtain a composed type.
13125
13126         This is also used by TypeManager.LookupType during its type
13127         composition.
13128
13129         (LookupType): We now also track the real type name, as sometimes
13130         we can get a quey for the real type name from things like
13131         ComposedCast.  This fixes bug 31422.
13132
13133         * expression.cs (ComposedCast.Resolve): Since we are obtaining a
13134         complete type fullname, it does not have to go through the type
13135         resolution system to obtain the composed version of the type (for
13136         obtaining arrays or pointers).
13137
13138         (Conditional.Emit): Use the EmitBoolExpression to
13139         generate nicer code, as requested by Paolo.
13140
13141         (ArrayCreation.CheckIndices): Use the patch from
13142         hwang_rob@yahoo.ca to validate the array initializers. 
13143
13144 2002-10-03  Miguel de Icaza  <miguel@ximian.com>
13145
13146         * class.cs (ConstructorInitializer.Emit): simplify code by using
13147         Invocation.EmitCall, and at the same time, fix the bugs in calling
13148         parent constructors that took variable arguments. 
13149
13150         * ecore.cs (Expression.ConvertNumericExplicit,
13151         Expression.ImplicitNumericConversion): Remove the code that
13152         manually wrapped decimal (InternalTypeConstructor call is now gone
13153         as well).
13154
13155         * expression.cs (Cast.TryReduce): Also handle decimal types when
13156         trying to perform a constant fold on the type.
13157
13158         * typemanager.cs (IsUnmanagedtype): Partially implemented.
13159
13160         * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
13161         that only turned off an error report, and did nothing else. 
13162
13163 2002-10-02  Miguel de Icaza  <miguel@ximian.com>
13164
13165         * driver.cs: Handle and ignore /fullpaths
13166
13167 2002-10-01  Miguel de Icaza  <miguel@ximian.com>
13168
13169         * expression.cs (Binary.ResolveOperator): Catch the case where
13170         DoNumericPromotions returns true, 
13171
13172         (Binary.DoNumericPromotions): Simplify the code, and the tests.
13173
13174 2002-09-27  Miguel de Icaza  <miguel@ximian.com>
13175
13176         * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
13177         report error 70.
13178
13179 2002-09-26  Miguel de Icaza  <miguel@ximian.com>
13180
13181         * ecore.cs (ConvertNumericExplicit): It is not enough that the
13182         conversion exists, but it is also required that the conversion be
13183         performed.  This manifested in "(Type64Enum) 2".  
13184
13185         * class.cs (TypeManager.AddMethod): The fix is not to change
13186         AddEnum, because that one was using a fully qualified name (every
13187         DeclSpace derivative does), but to change the AddMethod routine
13188         that was using an un-namespaced name.  This now correctly reports
13189         the duplicated name.
13190
13191         Revert patch until I can properly fix it.  The issue
13192         is that we have a shared Type space across all namespaces
13193         currently, which is wrong.
13194
13195         Options include making the Namespace a DeclSpace, and merge
13196         current_namespace/current_container in the parser.
13197
13198 2002-09-25  Miguel de Icaza  <miguel@ximian.com>
13199
13200         * cs-parser.jay: Improve error reporting when we get a different
13201         kind of expression in local_variable_type and
13202         local_variable_pointer_type. 
13203
13204         Propagate this to avoid missleading errors being reported.
13205
13206         * ecore.cs (ImplicitReferenceConversion): treat
13207         TypeManager.value_type as a target just like object_type.   As
13208         code like this:
13209
13210         ValueType v = 1;
13211
13212         Is valid, and needs to result in the int 1 being boxed before it
13213         is assigned to the value type v.
13214
13215         * class.cs (TypeContainer.AddEnum): Use the basename, not the name
13216         to validate the enumeration name.
13217
13218         * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
13219         EmitDynamicInitializers for the criteria to use Ldelema.  Thanks
13220         to hwang_rob@yahoo.ca for finding the bug and providing a patch.
13221
13222         * ecore.cs (TryImplicitIntConversion): When doing an
13223         implicit-enumeration-conversion, check if the type is 64-bits and
13224         perform a conversion before passing to EnumConstant.
13225
13226 2002-09-23  Miguel de Icaza  <miguel@ximian.com>
13227
13228         * decl.cs (Error_AmbiguousTypeReference); New routine used to
13229         report ambiguous type references.  Unlike the MS version, we
13230         report what the ambiguity is.   Innovation at work ;-)
13231
13232         (DeclSpace.FindType): Require a location argument to
13233         display when we display an ambiguous error.
13234
13235         * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
13236
13237         * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
13238
13239         * expression.cs (EmitDynamicInitializers): Apply patch from
13240         hwang_rob@yahoo.ca that fixes the order in which we emit our
13241         initializers. 
13242
13243 2002-09-21  Martin Baulig  <martin@gnome.org>
13244
13245         * delegate.cs (Delegate.VerifyApplicability): Make this work if the
13246         delegate takes no arguments.
13247
13248 2002-09-20  Miguel de Icaza  <miguel@ximian.com>
13249
13250         * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
13251         from integers.
13252
13253         * expression.cs: Extract the underlying type.
13254
13255         * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
13256
13257         * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
13258
13259 2002-09-19  Miguel de Icaza  <miguel@ximian.com>
13260
13261         * class.cs (TypeContainer.DefineType): We can not use the nice
13262         PackingSize with the size set to 1 DefineType method, because it
13263         will not allow us to define the interfaces that the struct
13264         implements.
13265
13266         This completes the fixing of bug 27287
13267
13268         * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
13269         means also structs.  This fixes part of the problem. 
13270         (Expresion.ImplicitReferenceConversionExists): ditto.
13271
13272         * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
13273         error if there were no errors reported during the type lookup
13274         process, to avoid duplicates or redundant errors.  Without this
13275         you would get an ambiguous errors plus a type not found.  We have
13276         beaten the user enough with the first error.  
13277
13278         (DeclSparce.FindType): Emit a warning if we have an ambiguous
13279         reference. 
13280
13281         * ecore.cs (SimpleName.DoResolveType): If an error is emitted
13282         during the resolution process, stop the lookup, this avoids
13283         repeated error reports (same error twice).
13284
13285         * rootcontext.cs: Emit a warning if we have an ambiguous reference.
13286
13287         * typemanager.cs (LookupType): Redo the type lookup code to match
13288         the needs of System.Reflection.  
13289
13290         The issue is that System.Reflection requires references to nested
13291         types to begin with a "+" sign instead of a dot.  So toplevel
13292         types look like: "NameSpace.TopLevelClass", and nested ones look
13293         like "Namespace.TopLevelClass+Nested", with arbitrary nesting
13294         levels. 
13295
13296 2002-09-19  Martin Baulig  <martin@gnome.org>
13297
13298         * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
13299         says that a method always returns or always throws an exception,
13300         don't report the CS0161.
13301
13302         * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
13303         set `Returns = new_returns'.
13304
13305 2002-09-19  Martin Baulig  <martin@gnome.org>
13306
13307         * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
13308         to an enum constant, check for a CS0176.
13309
13310 2002-09-18  Miguel de Icaza  <miguel@ximian.com>
13311
13312         * class.cs (TypeContainer.CheckPairedOperators): Now we check
13313         for operators that must be in pairs and report errors.
13314
13315         * ecore.cs (SimpleName.DoResolveType): During the initial type
13316         resolution process, when we define types recursively, we must
13317         check first for types in our current scope before we perform
13318         lookups in the enclosing scopes.
13319
13320         * expression.cs (MakeByteBlob): Handle Decimal blobs.
13321
13322         (Invocation.VerifyArgumentsCompat): Call
13323         TypeManager.TypeToCoreType on the parameter_type.GetElementType.
13324         I thought we were supposed to always call this, but there are a
13325         few places in the code where we dont do it.
13326
13327 2002-09-17  Miguel de Icaza  <miguel@ximian.com>
13328
13329         * driver.cs: Add support in -linkres and -resource to specify the
13330         name of the identifier.
13331
13332 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
13333
13334         * ecore.cs (StandardConversionExists): Sync with the conversion
13335         code: allow anything-* to void* conversions.
13336
13337         (FindMostSpecificSource): Use an Expression argument
13338         instead of a Type, because we might be handed over a Literal which
13339         gets a few more implicit conversions that plain types do not.  So
13340         this information was being lost.
13341
13342         Also, we drop the temporary type-holder expression when not
13343         required.
13344
13345 2002-09-17  Martin Baulig  <martin@gnome.org>
13346
13347         * class.cs (PropertyBase.CheckBase): Don't check the base class if
13348         this is an explicit interface implementation.
13349
13350 2002-09-17  Martin Baulig  <martin@gnome.org>
13351
13352         * class.cs (PropertyBase.CheckBase): Make this work for indexers with
13353         different `IndexerName' attributes.
13354
13355         * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
13356         (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
13357         virtual CommonResolve().
13358
13359 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
13360
13361         * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
13362         and convert that to the UnderlyingType.
13363
13364         * statement.cs (Foreach.Resolve): Indexers are just like variables
13365         or PropertyAccesses.
13366
13367         * cs-tokenizer.cs (consume_string): Track line numbers and columns
13368         inside quoted strings, we were not doing this before.
13369
13370 2002-09-16  Martin Baulig  <martin@gnome.org>
13371
13372         * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
13373         resolve it.  This is needed for the definite assignment check of the
13374         instance expression, fixes bug #29846.
13375         (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
13376
13377 2002-09-16  Nick Drochak  <ndrochak@gol.com>
13378
13379         * parameter.cs: Fix compile error.  Cannot reference static member
13380         from an instance object.  Is this an mcs bug?
13381
13382 2002-09-14  Martin Baulig  <martin@gnome.org>
13383
13384         * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
13385         multiple times.  Fixes bug #30295, added test-166.cs.
13386
13387 2002-09-14  Martin Baulig  <martin@gnome.org>
13388
13389         * statement.cs (Block.Emit): Don't emit unreachable code.
13390         (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
13391         `break' statements.
13392         (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
13393
13394 2002-09-14  Martin Baulig  <martin@gnome.org>
13395
13396         * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
13397         is set.
13398
13399 2002-09-14  Martin Baulig  <martin@gnome.org>
13400
13401         * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
13402         if `type == parent' since in this case `type.IsSubclassOf (parent)' will
13403         be false on the ms runtime.
13404
13405 2002-09-13  Martin Baulig  <martin@gnome.org>
13406
13407         * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
13408         the CS0038 error message.
13409
13410 2002-09-12  Miguel de Icaza  <miguel@ximian.com>
13411
13412         * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
13413         constant inside, return it.
13414
13415 2002-09-12  Martin Baulig  <martin@gnome.org>
13416
13417         * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
13418         implicit conversion can be done between enum types.
13419
13420         * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
13421         check whether an implicit conversion to the current enum's UnderlyingType
13422         exists and report an error if not.
13423
13424         * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
13425         without debugging support.
13426
13427         * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
13428         Fixes bug #30235.  Thanks to Ricardo Fernández Pascual.
13429
13430 2002-09-12  Martin Baulig  <martin@gnome.org>
13431
13432         * typemanager.cs (TypeManager.IsNestedChildOf): New method.
13433
13434         * ecore.cs (IMemberExpr.DeclaringType): New property.
13435         (SimpleName.SimpleNameResolve): Check whether we're accessing a
13436         nonstatic member of an outer type (CS0038).
13437
13438 2002-09-11  Miguel de Icaza  <miguel@ximian.com>
13439
13440         * driver.cs: Activate the using-error detector at warning level
13441         4 (at least for MS-compatible APIs).
13442
13443         * namespace.cs (VerifyUsing): Small buglett fix.
13444
13445         * pending.cs (PendingImplementation): pass the container pointer. 
13446
13447         * interface.cs (GetMethods): Allow for recursive definition.  Long
13448         term, I would like to move every type to support recursive
13449         definitions, not the current ordering mechanism that we have right
13450         now.
13451
13452         The situation is this: Attributes are handled before interfaces,
13453         so we can apply attributes to interfaces.  But some attributes
13454         implement interfaces, we will now handle the simple cases
13455         (recursive definitions will just get an error).  
13456
13457         * parameter.cs: Only invalidate types at the end if we fail to
13458         lookup all types.  
13459
13460 2002-09-09  Martin Baulig  <martin@gnome.org>
13461
13462         * ecore.cs (PropertyExpr.Emit): Also check for
13463         TypeManager.system_int_array_get_length so this'll also work when
13464         compiling corlib.  Fixes #30003.
13465
13466 2002-09-09  Martin Baulig  <martin@gnome.org>
13467
13468         * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
13469         and throw an exception if we can't get the type's size.  Fixed #30040,
13470         added test-165.cs.
13471
13472 2002-09-09  Martin Baulig  <martin@gnome.org>
13473
13474         * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
13475
13476         * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
13477         context.  Fixes bug #30027.
13478
13479         * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
13480         virtual functions.  Fixes bug #30043, added test-164.cs.
13481
13482 2002-09-08  Ravi Pratap  <ravi@ximian.com>
13483
13484         * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
13485
13486 2002-09-08  Nick Drochak  <ndrochak@gol.com>
13487
13488         * driver.cs: Use an object to get the windows codepage since it's not a
13489         static property.
13490
13491 2002-09-08  Miguel de Icaza  <miguel@ximian.com>
13492
13493         * statement.cs (For.Emit): for infinite loops (test == null)
13494         return whether there is a break inside, not always "true".
13495
13496         * namespace.cs (UsingEntry): New struct to hold the name of the
13497         using definition, the location where it is defined, and whether it
13498         has been used in a successful type lookup.
13499
13500         * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
13501         strings.
13502
13503         * decl.cs: ditto.
13504
13505 2002-09-06  Ravi Pratap  <ravi@ximian.com>
13506
13507         * attribute.cs : Fix incorrect code which relied on catching
13508         a NullReferenceException to detect a null being passed in
13509         where an object was expected.
13510
13511 2002-09-06  Miguel de Icaza  <miguel@ximian.com>
13512
13513         * statement.cs (Try): flag the catch variable as assigned
13514
13515         * expression.cs (Cast): Simplified by using ResolveType instead of
13516         manually resolving.
13517
13518         * statement.cs (Catch): Fix bug by using ResolveType.
13519
13520 2002-09-06  Ravi Pratap  <ravi@ximian.com>
13521
13522         * expression.cs (BetterConversion): Special case for when we have
13523         a NullLiteral as the argument and we have to choose between string
13524         and object types - we choose string the way csc does.
13525
13526         * attribute.cs (Attribute.Resolve): Catch the
13527         NullReferenceException and report error #182 since the Mono
13528         runtime no more has the bug and having this exception raised means
13529         we tried to select a constructor which takes an object and is
13530         passed a null.
13531
13532 2002-09-05  Ravi Pratap  <ravi@ximian.com>
13533
13534         * expression.cs (Invocation.OverloadResolve): Flag a nicer error
13535         message (1502, 1503) when we can't locate a method after overload
13536         resolution. This is much more informative and closes the bug
13537         Miguel reported.
13538
13539         * interface.cs (PopulateMethod): Return if there are no argument
13540         types. Fixes a NullReferenceException bug.
13541
13542         * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
13543         expressions too. Previously we were checking only in one place for
13544         positional arguments leaving out named arguments.
13545
13546         * ecore.cs (ImplicitNumericConversion): Conversion from underlying
13547         type to the enum type is not allowed. Remove code corresponding to
13548         that.
13549
13550         (ConvertNumericExplicit): Allow explicit conversions from
13551         the underlying type to enum type. This precisely follows the spec
13552         and closes a bug filed by Gonzalo.
13553
13554 2002-09-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13555
13556         * compiler.csproj:
13557         * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
13558
13559 2002-09-03  Miguel de Icaza  <miguel@ximian.com>
13560
13561         * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
13562         it was important that we stored the right value after the
13563         reduction in `converted'.
13564
13565 2002-09-04  Martin Baulig  <martin@gnome.org>
13566
13567         * location.cs (Location.SymbolDocument): Use full pathnames for the
13568         source files.
13569
13570 2002-08-30  Miguel de Icaza  <miguel@ximian.com>
13571
13572         * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
13573         of the expression resolve mechanism, because that will catch the
13574         SimpleName error failures.
13575
13576         (Conditional): If we can not resolve the
13577         expression, return, do not crash.
13578
13579 2002-08-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13580
13581         * cs-tokenizer.cs:
13582         (location): display token name instead of its number.
13583
13584 2002-08-28  Martin Baulig  <martin@gnome.org>
13585
13586         * expression.cs (Binary.ResolveOperator): Don't silently return
13587         but return an error if an operator cannot be applied between two
13588         enum types.
13589
13590 2002-08-28  Martin Baulig  <martin@gnome.org>
13591
13592         * class.cs (Constructor.Define): Set the permission attributes
13593         correctly instead of making all constructors public.
13594
13595 2002-08-28  Martin Baulig  <martin@gnome.org>
13596
13597         * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
13598         for private members before reporting a CS0103; if we find anything,
13599         it's a CS0122.
13600
13601 2002-08-28  Martin Baulig  <martin@gnome.org>
13602
13603         * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
13604         to check whether `closure_start_type == closure_invocation_type',
13605         we also need to check whether `m.DeclaringType == closure_invocation_type'
13606         before bypassing the permission checks.  We might be accessing
13607         protected/private members from the base class.
13608         (TypeManager.RealMemberLookup): Only set private_ok if private
13609         members were requested via BindingFlags.NonPublic.
13610
13611         * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
13612
13613         * expression.cs (MemberAccess.ResolveMemberAccess): Set
13614         MethodGroupExpr.IsExplicitImpl if appropriate.
13615         (Invocation.DoResolve): Don't report the CS0120 for explicit
13616         interface implementations.
13617
13618 2002-08-27  Martin Baulig  <martin@gnome.org>
13619
13620         * expression.cs (Invocation.DoResolve): If this is a static
13621         method and we don't have an InstanceExpression, we must report
13622         a CS0120.
13623
13624 2002-08-25  Martin Baulig  <martin@gnome.org>
13625
13626         * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
13627         `==' between a valuetype and an object.
13628
13629 2002-08-25  Miguel de Icaza  <miguel@ximian.com>
13630
13631         * ecore.cs (TypeExpr): Provide a ToString method.
13632
13633 2002-08-24  Martin Baulig  <martin@gnome.org>
13634
13635         * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
13636         now called proggie.dbg and it's a binary file.
13637
13638 2002-08-23  Martin Baulig  <martin@gnome.org>
13639
13640         * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
13641
13642 2002-08-23  Martin Baulig  <martin@gnome.org>
13643
13644         * struct.cs (MyStructInfo.ctor): Make this work with empty
13645         structs; it's not allowed to use foreach() on null.
13646
13647 2002-08-23  Martin Baulig  <martin@gnome.org>
13648
13649         * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
13650         writer the full pathname of the generated assembly.
13651
13652 2002-08-23  Martin Baulig  <martin@gnome.org>
13653
13654         * statements.cs (FlowBranching.UsageVector.MergeChildren):
13655         A `finally' block never returns or breaks; improved handling of
13656         unreachable code.
13657
13658 2002-08-23  Martin Baulig  <martin@gnome.org>
13659
13660         * statement.cs (Throw.Resolve): Allow `throw null'.
13661
13662 2002-08-23  Martin Baulig  <martin@gnome.org>
13663
13664         * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
13665         EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
13666         `ee.EventInfo.DeclaringType == ec.ContainerType'.  The
13667         MemberLookup would return a wrong event if this is an explicit
13668         interface implementation and the class has an event with the same
13669         name.
13670
13671 2002-08-23  Martin Baulig  <martin@gnome.org>
13672
13673         * statement.cs (Block.AddChildVariableNames): New public method.
13674         (Block.AddChildVariableName): Likewise.
13675         (Block.IsVariableNameUsedInChildBlock): Likewise.
13676         (Block.AddVariable): Check whether a variable name has already
13677         been used in a child block.
13678
13679         * cs-parser.jay (declare_local_variables): Mark all variable names
13680         from the current block as being used in a child block in the
13681         implicit block.
13682
13683 2002-08-23  Martin Baulig  <martin@gnome.org>
13684
13685         * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
13686         find the symbol writer.
13687
13688         * driver.cs: csc also allows the arguments to /define being
13689         separated by commas, not only by semicolons.
13690
13691 2002-08-23  Martin Baulig  <martin@gnome.org>
13692
13693         * interface.cs (Interface.GetMembers): Added static check for events.
13694
13695 2002-08-15  Martin Baulig  <martin@gnome.org>
13696
13697         * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
13698         call, use ec.ContainerType.BaseType as queried_type and invocation_type.
13699
13700         * ecore.cs (Expression.MemberLookup): Added documentation and explained
13701         why the MethodData.EmitDestructor() change was necessary.
13702
13703 2002-08-20  Martin Baulig  <martin@gnome.org>
13704
13705         * class.cs (TypeContainer.FindMembers): Added static check for events.
13706
13707         * decl.cs (MemberCache.AddMembers): Handle events like normal members.
13708
13709         * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
13710         use Type.GetEvents(), not Type.FindMembers().
13711
13712 2002-08-20  Martin Baulig  <martin@gnome.org>
13713
13714         * decl.cs (MemberCache): Added a special method cache which will
13715         be used for method-only searched.  This ensures that a method
13716         search will return a MethodInfo with the correct ReflectedType for
13717         inherited methods.      
13718
13719 2002-08-20  Martin Baulig  <martin@gnome.org>
13720
13721         * decl.cs (DeclSpace.FindMembers): Made this public.
13722
13723 2002-08-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13724
13725         * delegate.cs: fixed build on windows.
13726         [FIXME:  Filed as bug #29150: MCS must report these errors.]
13727
13728 2002-08-19  Ravi Pratap  <ravi@ximian.com>
13729
13730         * ecore.cs (StandardConversionExists): Return a false
13731         if we are trying to convert the void type to anything else
13732         since that is not allowed.
13733
13734         * delegate.cs (DelegateInvocation.DoResolve): Ensure that
13735         we flag error 70 in the event an event is trying to be accessed
13736         directly from outside the declaring type.
13737
13738 2002-08-20  Martin Baulig  <martin@gnome.org>
13739
13740         * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
13741         MemberCache from typemanager.cs to decl.cs.
13742
13743 2002-08-19  Martin Baulig  <martin@gnome.org>
13744
13745         * class.cs (TypeContainer): Implement IMemberContainer.
13746         (TypeContainer.DefineMembers): Create the MemberCache.
13747         (TypeContainer.FindMembers): Do better BindingFlags checking; only
13748         return public members if BindingFlags.Public was given, check
13749         whether members are static.
13750
13751 2002-08-16  Martin Baulig  <martin@gnome.org>
13752
13753         * decl.cs (DeclSpace.Define): Splitted this in Define and
13754         DefineMembers.  DefineMembers is called first and initializes the
13755         MemberCache.
13756
13757         * rootcontext.cs (RootContext.DefineMembers): New function.  Calls
13758         DefineMembers() on all our DeclSpaces.
13759
13760         * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
13761         but call DefineMembers() on all nested interfaces.  We call their
13762         Define() in our new Define() function.
13763
13764         * interface.cs (Interface): Implement IMemberContainer.
13765         (Interface.Define): Moved all code except the attribute stuf to
13766         DefineMembers().
13767         (Interface.DefineMembers): Initialize the member cache.
13768
13769         * typemanager.cs (IMemberFinder): Removed this interface, we don't
13770         need this anymore since we can use MemberCache.FindMembers directly.
13771
13772 2002-08-19  Martin Baulig  <martin@gnome.org>
13773
13774         * typemanager.cs (MemberCache): When creating the cache for an
13775         interface type, add all inherited members.
13776         (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
13777         to `out bool used_cache' and documented it.
13778         (TypeManager.MemberLookup): If we already used the cache in the first
13779         iteration, we don't need to do the interfaces check.
13780
13781 2002-08-19  Martin Baulig  <martin@gnome.org>
13782
13783         * decl.cs (DeclSpace.FindMembers): New abstract method.  Moved this
13784         here from IMemberFinder and don't implement this interface anymore.
13785         (DeclSpace.MemberCache): Moved here from IMemberFinder.
13786
13787         * typemanager.cs (IMemberFinder): This interface is now only used by
13788         classes which actually support the member cache.
13789         (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
13790         since we only put DeclSpaces into this Hashtable.
13791         (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
13792         a dynamic type and TypeHandle.GetTypeHandle() otherwise.
13793
13794 2002-08-16  Martin Baulig  <martin@gnome.org>
13795
13796         * typemanager.cs (ICachingMemberFinder): Removed.
13797         (IMemberFinder.MemberCache): New property.
13798         (TypeManager.FindMembers): Merged this with RealFindMembers().
13799         This function will never be called from TypeManager.MemberLookup()
13800         so we can't use the cache here, just the IMemberFinder.
13801         (TypeManager.MemberLookup_FindMembers): Check whether the
13802         IMemberFinder has a MemberCache and call the cache's FindMembers
13803         function.
13804         (MemberCache): Rewrote larger parts of this yet another time and
13805         cleaned it up a bit.
13806
13807 2002-08-15  Miguel de Icaza  <miguel@ximian.com>
13808
13809         * driver.cs (LoadArgs): Support quoting.
13810
13811         (Usage): Show the CSC-like command line arguments.
13812
13813         Improved a few error messages.
13814
13815 2002-08-15  Martin Baulig  <martin@gnome.org>
13816
13817         * typemanager.cs (IMemberContainer.Type): New property.
13818         (IMemberContainer.IsInterface): New property.
13819
13820         The following changes are conditional to BROKEN_RUNTIME, which is
13821         defined at the top of the file.
13822
13823         * typemanager.cs (MemberCache.MemberCache): Don't add the base
13824         class'es members, but add all members from TypeHandle.ObjectType
13825         if we're an interface.
13826         (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
13827         is the current type.
13828         (MemberCache.CacheEntry.Container): Removed this field.
13829         (TypeHandle.GetMembers): Include inherited members.
13830
13831 2002-08-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13832
13833         * typemanager.cs: fixed compilation and added a comment on a field that
13834         is never used.
13835
13836 2002-08-15  Martin Baulig  <martin@gnome.org>
13837
13838         * class.cs (ConstructorInitializer.Resolve): In the
13839         Expression.MemberLookup call, use the queried_type as
13840         invocation_type.
13841
13842         * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
13843         declared' attribute, it's always true.
13844         (IMemberContainer.Parent, IMemberContainer.Name): New properties.
13845         (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
13846         temporary wrapper for FindMembers which tells MemberLookup whether
13847         members from the base classes are included in the return value.
13848         This will go away soon.
13849         (TypeManager.MemberLookup): Use this temporary hack here; once the
13850         new MemberCache is completed, we don't need to do the DeclaredOnly
13851         looping here anymore since the MemberCache will take care of this.
13852         (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
13853         (MemberCache): When creating the MemberCache for a class, get
13854         members from the current class and all its base classes.
13855         (MemberCache.CacheEntry.Container): New field.  This is a
13856         temporary hack until the Mono runtime is fixed to distinguish
13857         between ReflectedType and DeclaringType.  It allows us to use MCS
13858         with both the MS runtime and the unfixed Mono runtime without
13859         problems and without accecting performance.
13860         (MemberCache.SearchMembers): The DeclaredOnly looping from
13861         TypeManager.MemberLookup is now done here.      
13862
13863 2002-08-14  Martin Baulig  <martin@gnome.org>
13864
13865         * statement.cs (MyStructInfo.MyStructInfo): Don't call
13866         Type.GetFields on dynamic types but get the fields from the
13867         corresponding TypeContainer.
13868         (MyStructInfo.GetStructInfo): Added check for enum types.
13869
13870         * typemanager.cs (MemberList.IsSynchronized): Implemented.
13871         (MemberList.SyncRoot): Implemented.
13872         (TypeManager.FilterWithClosure): No need to check permissions if
13873         closure_start_type == closure_invocation_type, don't crash if
13874         closure_invocation_type is null.
13875
13876 2002-08-13  Martin Baulig  <martin@gnome.org>
13877
13878         Rewrote TypeContainer.FindMembers to use a member cache.  This
13879         gives us a speed increase of about 35% for the self-hosting MCS
13880         build and of about 15-20% for the class libs (both on GNU/Linux).
13881
13882         * report.cs (Timer): New class to get enhanced profiling.  This
13883         whole class is "TIMER" conditional since it remarkably slows down
13884         compilation speed.
13885
13886         * class.cs (MemberList): New class.  This is an IList wrapper
13887         which we're now using instead of passing MemberInfo[]'s around to
13888         avoid copying this array unnecessarily.
13889         (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
13890         (ICachingMemberFinder, IMemberContainer): New interface.
13891         (TypeManager.FilterWithClosure): If `criteria' is null, the name
13892         has already been checked, otherwise use it for the name comparision.
13893         (TypeManager.FindMembers): Renamed to RealMemberFinder and
13894         provided wrapper which tries to use ICachingMemberFinder.FindMembers
13895         if possible.  Returns a MemberList, not a MemberInfo [].
13896         (TypeHandle): New class, implements IMemberContainer.  We create
13897         one instance of this class per type, it contains a MemberCache
13898         which is used to do the member lookups.
13899         (MemberCache): New class.  Each instance of this class contains
13900         all members of a type and a name-based hash table.
13901         (MemberCache.FindMembers): This is our new member lookup
13902         function.  First, it looks up all members of the requested name in
13903         the hash table.  Then, it walks this list and sorts out all
13904         applicable members and returns them.
13905
13906 2002-08-13  Martin Baulig  <martin@gnome.org>
13907
13908         In addition to a nice code cleanup, this gives us a performance
13909         increase of about 1.4% on GNU/Linux - not much, but it's already
13910         half a second for the self-hosting MCS compilation.
13911
13912         * typemanager.cs (IMemberFinder): New interface.  It is used by
13913         TypeManager.FindMembers to call FindMembers on a TypeContainer,
13914         Enum, Delegate or Interface.
13915         (TypeManager.finder_to_member_finder): New PtrHashtable.
13916         (TypeManager.finder_to_container): Removed.
13917         (TypeManager.finder_to_delegate): Removed.
13918         (TypeManager.finder_to_interface): Removed.
13919         (TypeManager.finder_to_enum): Removed.
13920
13921         * interface.cs (Interface): Implement IMemberFinder.
13922
13923         * delegate.cs (Delegate): Implement IMemberFinder.
13924
13925         * enum.cs (Enum): Implement IMemberFinder.
13926
13927         * class.cs (TypeContainer): Implement IMemberFinder.
13928
13929 2002-08-12  Martin Baulig  <martin@gnome.org>
13930
13931         * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
13932
13933 2002-08-12  Martin Baulig  <martin@gnome.org>
13934
13935         * ecore.cs (ITypeExpression): New interface for expressions which
13936         resolve to a type.
13937         (TypeExpression): Renamed to TypeLookupExpression.
13938         (Expression.DoResolve): If we're doing a types-only lookup, the
13939         expression must implement the ITypeExpression interface and we
13940         call DoResolveType() on it.
13941         (SimpleName): Implement the new ITypeExpression interface.
13942         (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
13943         hack, the situation that we're only looking up types can't happen
13944         anymore when this method is called.  Moved the type lookup code to
13945         DoResolveType() and call it.
13946         (SimpleName.DoResolveType): This ITypeExpression interface method
13947         is now doing the types-only lookup.
13948         (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
13949         (ResolveFlags): Added MaskExprClass.
13950
13951         * expression.cs (MemberAccess): Implement the ITypeExpression
13952         interface.
13953         (MemberAccess.DoResolve): Added support for a types-only lookup
13954         when we're called via ITypeExpression.DoResolveType().
13955         (ComposedCast): Implement the ITypeExpression interface.
13956
13957         * codegen.cs (EmitContext.OnlyLookupTypes): Removed.  Call
13958         Expression.Resolve() with ResolveFlags.Type instead.
13959
13960 2002-08-12  Martin Baulig  <martin@gnome.org>
13961
13962         * interface.cs (Interface.Define): Apply attributes.
13963
13964         * attribute.cs (Attribute.ApplyAttributes): Added support for
13965         interface attributes.
13966
13967 2002-08-11  Martin Baulig  <martin@gnome.org>
13968
13969         * statement.cs (Block.Emit): Only check the "this" variable if we
13970         do not always throw an exception.
13971
13972         * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
13973         whether the property has a set accessor.
13974
13975 2002-08-11  Martin Baulig  <martin@gnome.org>
13976
13977         Added control flow analysis support for structs.
13978
13979         * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
13980         with control flow analysis turned off.
13981         (IVariable): New interface.
13982         (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
13983         returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
13984         (FieldExpr.DoResolve): Resolve the instance expression with flow
13985         analysis turned off and do the definite assignment check after the
13986         resolving when we know what the expression will resolve to.
13987
13988         * expression.cs (LocalVariableReference, ParameterReference):
13989         Implement the new IVariable interface, only call the flow analysis
13990         code if ec.DoFlowAnalysis is true.
13991         (This): Added constructor which takes a Block argument.  Implement
13992         the new IVariable interface.
13993         (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
13994         DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
13995         This does the definite assignment checks for struct members.
13996
13997         * class.cs (Constructor.Emit): If this is a non-static `struct'
13998         constructor which doesn't have any initializer, call
13999         Block.AddThisVariable() to tell the flow analysis code that all
14000         struct elements must be initialized before control returns from
14001         the constructor.
14002
14003         * statement.cs (MyStructInfo): New public class.
14004         (UsageVector.this [VariableInfo vi]): Added `int field_idx'
14005         argument to this indexer.  If non-zero, check an individual struct
14006         member, not the whole struct.
14007         (FlowBranching.CheckOutParameters): Check struct members.
14008         (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
14009         overloaded versions of these methods which take an additional
14010         `int field_idx' argument to check struct members.
14011         (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
14012         overloaded versions of these methods which take an additional
14013         `string field_name' argument to check struct member.s
14014         (VariableInfo): Implement the IVariable interface.
14015         (VariableInfo.StructInfo): New public property.  Returns the
14016         MyStructInfo instance of the variable if it's a struct or null.
14017         (Block.AddThisVariable): New public method.  This is called from
14018         Constructor.Emit() for non-static `struct' constructor which do
14019         not have any initializer.  It creates a special variable for the
14020         "this" instance variable which will be checked by the flow
14021         analysis code to ensure that all of the struct's fields are
14022         initialized before control returns from the constructor.
14023         (UsageVector): Added support for struct members.  If a
14024         variable/parameter is a struct with N members, we reserve a slot
14025         in the usage vector for each member.  A struct is considered fully
14026         initialized if either the struct itself (slot 0) or all its
14027         members are initialized.
14028
14029 2002-08-08  Martin Baulig  <martin@gnome.org>
14030
14031         * driver.cs (Driver.MainDriver): Only report an error CS5001
14032         if there were no compilation errors.
14033
14034         * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
14035         `UnsafeContext' property to determine whether the parent is in
14036         unsafe context rather than checking the parent's ModFlags:
14037         classes nested in an unsafe class are unsafe as well.
14038
14039 2002-08-08  Martin Baulig  <martin@gnome.org>
14040
14041         * statement.cs (UsageVector.MergeChildren): Distinguish between
14042         `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
14043         we return.  Added test17() and test18() to test-154.cs.
14044
14045 2002-08-08  Martin Baulig  <martin@gnome.org>
14046
14047         * typemanager.cs (TypeManager.FilterWithClosure): If we have
14048         Family access, make sure the invoking type isn't a subclass of the
14049         queried type (that'd be a CS1540).
14050
14051         * ecore.cs (Expression.MemberLookup): Added overloaded version of
14052         this method which takes an additional `Type invocation_type'.
14053
14054         * expression.cs (BaseAccess.DoResolve): Use the base type as
14055         invocation and query type.
14056         (MemberAccess.DoResolve): If the lookup failed and we're about to
14057         report a CS0122, try a lookup with the ec.ContainerType - if this
14058         succeeds, we must report a CS1540.
14059
14060 2002-08-08  Martin Baulig  <martin@gnome.org>
14061
14062         * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
14063         (MethodGroupExpr): Implement the IMemberExpr interface.
14064
14065         * expression (MemberAccess.ResolveMemberAccess): No need to have
14066         any special code for MethodGroupExprs anymore, they're now
14067         IMemberExprs.   
14068
14069 2002-08-08  Martin Baulig  <martin@gnome.org>
14070
14071         * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
14072         Family, FamANDAssem and FamORAssem permissions.
14073         (TypeManager.IsSubclassOrNestedChildOf): New public method.
14074
14075 2002-08-08  Martin Baulig  <martin@gnome.org>
14076
14077         * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
14078         (UsageVector.MergeChildren): `break' breaks unless we're in a switch
14079         or loop block.
14080
14081 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
14082
14083         * driver.cs: implemented /resource option to embed managed resources.
14084
14085 2002-08-07  Martin Baulig  <martin@gnome.org>
14086
14087         * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
14088         (FieldBase.HasFieldInitializer): New public property.
14089         (FieldBase.GetInitializerExpression): New public method.  Resolves and
14090         returns the field initializer and makes sure it is only resolved once.
14091         (TypeContainer.EmitFieldInitializers): Call
14092         FieldBase.GetInitializerExpression to get the initializer, this ensures
14093         that it isn't resolved multiple times.
14094
14095         * codegen.cs (EmitContext): Added `bool IsFieldInitialier'.  This tells
14096         the resolving process (SimpleName/MemberLookup) that we're currently
14097         emitting a field initializer (which must not access any instance members,
14098         this is an error CS0236).
14099
14100         * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
14101         argument, if the `IsFieldInitializer' flag is set, we must report and
14102         error CS0236 and not an error CS0120.   
14103
14104 2002-08-07  Martin Baulig  <martin@gnome.org>
14105
14106         * ecore.cs (IMemberExpr): New public interface.
14107         (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
14108         (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
14109         if the expression is an IMemberExpr.
14110
14111         * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
14112         to be null, implicitly default to `this' if we're non-static in
14113         this case.  Simplified the code a lot by using the new IMemberExpr
14114         interface.  Also fixed bug #28176 here.
14115
14116 2002-08-06  Martin Baulig  <martin@gnome.org>
14117
14118         * cs-parser.jay (SimpleLookup): Removed.  We need to create
14119         ParameterReferences during semantic analysis so that we can do a
14120         type-only search when resolving Cast, TypeOf and SizeOf.
14121         (block): Pass the `current_local_parameters' to the Block's
14122         constructor.
14123
14124         * class.cs (ConstructorInitializer): Added `Parameters parameters'
14125         argument to the constructor.
14126         (ConstructorInitializer.Resolve): Create a temporary implicit
14127         block with the parameters.
14128
14129         * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
14130         references here if we aren't doing a type-only search.
14131
14132         * statement.cs (Block): Added constructor which takes a
14133         `Parameters parameters' argument.
14134         (Block.Parameters): New public property.
14135
14136         * support.cs (InternalParameters.Parameters): Renamed `parameters'
14137         to `Parameters' and made it public readonly.
14138
14139 2002-08-06  Martin Baulig  <martin@gnome.org>
14140
14141         * ecore.cs (Expression.Warning): Made this public as well.
14142
14143         * report.cs (Report.Debug): Print the contents of collections.
14144
14145 2002-08-06  Martin Baulig  <martin@gnome.org>
14146
14147         * ecore.cs (Expression.ResolveFlags): New [Flags] enum.  This is
14148         used to tell Resolve() which kinds of expressions it may return.
14149         (Expression.Resolve): Added overloaded version of this method which
14150         takes a `ResolveFlags flags' argument.  This can be used to tell
14151         Resolve() which kinds of expressions it may return.  Reports a
14152         CS0118 on error.
14153         (Expression.ResolveWithSimpleName): Removed, use Resolve() with
14154         ResolveFlags.SimpleName.
14155         (Expression.Error118): Added overloaded version of this method which
14156         takes a `ResolveFlags flags' argument.  It uses the flags to determine
14157         which kinds of expressions are allowed.
14158
14159         * expression.cs (Argument.ResolveMethodGroup): New public method.
14160         Resolves an argument, but allows a MethodGroup to be returned.
14161         This is used when invoking a delegate.
14162
14163         * TODO: Updated a bit.
14164
14165 2002-08-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14166
14167         Fixed compilation with csc.
14168
14169         * ecore.cs: Expression.Error made public. Is this correct? Should
14170         Warning be made public too?
14171
14172         * expression.cs: use ea.Location instead of ea.loc.
14173         [FIXME:  Filed as bug #28607: MCS must report these errors.]
14174
14175 2002-08-06  Martin Baulig  <martin@gnome.org>
14176
14177         * ecore.cs (Expression.loc): Moved the location here instead of
14178         duplicating it in all derived classes.
14179         (Expression.Location): New public property.
14180         (Expression.Error, Expression.Warning): Made them non-static and
14181         removed the location argument.
14182         (Expression.Warning): Added overloaded version which takes an
14183         `int level' argument.
14184         (Expression.Error118): Make this non-static and removed the
14185         expression and location arguments.
14186         (TypeExpr): Added location argument to the constructor.
14187
14188         * expression.cs (StaticCallExpr): Added location argument to
14189         the constructor.
14190         (Indirection, PointerArithmetic): Likewise.
14191         (CheckedExpr, UnCheckedExpr): Likewise.
14192         (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
14193         (StringPtr): Likewise.
14194
14195
14196 2002-08-05  Martin Baulig  <martin@gnome.org>
14197
14198         * expression.cs (BaseAccess.DoResolve): Actually report errors.
14199
14200         * assign.cs (Assign.DoResolve): Check whether the source
14201         expression is a value or variable.
14202
14203         * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
14204         while resolving the corresponding blocks.
14205
14206         * interface.cs (Interface.GetInterfaceTypeByName): Actually report
14207         an error, don't silently return null.
14208
14209         * statement.cs (Block.AddVariable): Do the error reporting here
14210         and distinguish between CS0128 and CS0136.
14211         (Block.DoResolve): Report all unused labels (warning CS0164).
14212         (LabeledStatement): Pass the location to the constructor.
14213         (LabeledStatement.HasBeenReferenced): New property.
14214         (LabeledStatement.Resolve): Set it to true here.
14215
14216         * statement.cs (Return.Emit): Return success even after reporting
14217         a type mismatch error (CS0126 or CS0127), this is what csc does and
14218         it avoids confusing the users with any consecutive errors.
14219
14220 2002-08-05  Martin Baulig  <martin@gnome.org>
14221
14222         * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
14223
14224         * const.cs (Const.LookupConstantValue): Catch circular definitions.
14225
14226         * expression.cs (MemberAccess.DoResolve): Silently return if an
14227         error has already been reported.
14228
14229         * ecore.cs (Expression.MemberLookupFinal): Silently return if an
14230         error has already been reported.
14231
14232 2002-08-05  Martin Baulig  <martin@gnome.org>
14233
14234         * statement.cs (UsageVector): Only initialize the `parameters'
14235         vector if we actually have any "out" parameters.
14236
14237 2002-08-05  Martin Baulig  <martin@gnome.org>
14238
14239         * expression.cs (Binary.ResolveOperator): When combining delegates,
14240         they must have the same type.
14241
14242 2002-08-05  Martin Baulig  <martin@gnome.org>
14243
14244         * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
14245         PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
14246         work with the ms runtime and we also don't need it: if we're a
14247         PropertyBuilder and not in the `indexer_arguments' hash, then we
14248         are a property and not an indexer.
14249
14250         * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
14251         Type.IsPointer and Type.IsByRef instead of Type.HasElementType
14252         since the latter one doesn't work with the ms runtime.
14253
14254 2002-08-03  Martin Baulig  <martin@gnome.org>
14255
14256         Fixed bugs #27998 and #22735.
14257
14258         * class.cs (Method.IsOperator): New public field.
14259         (Method.CheckBase): Report CS0111 if there's already a method
14260         with the same parameters in the current class.  Report CS0508 when
14261         attempting to change the return type of an inherited method.
14262         (MethodData.Emit): Report CS0179 if a method doesn't have a body
14263         and it's not marked abstract or extern.
14264         (PropertyBase): New abstract base class for Property and Indexer.
14265         (PropertyBase.CheckBase): Moved here from Property and made it work
14266         for indexers.
14267         (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
14268         the same so we can reuse it there.
14269         (Property, Indexer): Derive from PropertyBase.
14270         (MethodSignature.inheritable_property_signature_filter): New delegate
14271         to find properties and indexers.
14272
14273         * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
14274         argument and improved error reporting.
14275
14276         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
14277         EmptyReadOnlyParameters and made it a property.
14278
14279         * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
14280         version of this method which takes a `PropertyInfo indexer'.
14281         (TypeManager.RegisterIndexer): New method.
14282
14283         * class.cs: Added myself as author of this file :-)
14284
14285 2002-08-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14286
14287         * class.cs: fixed compilation on windoze.
14288
14289 2002-08-03  Martin Baulig  <martin@gnome.org>
14290
14291         * interface.cs (Interface.GetInterfaceBases): Check whether all
14292         base interfaces are at least as accessible than the current one.
14293
14294         * class.cs (TypeContainer.GetClassBases): Check whether base types
14295         are at least as accessible than the current type.
14296         (TypeContainer.AsAccessible): Implemented and made non-static.
14297         (MemberBase.CheckParameters): Report errors if the accessibility
14298         checks fail.
14299
14300         * delegate.cs (Delegate.Delegate): The default visibility is
14301         internal for top-level types and private for nested types.
14302         (Delegate.Define): Report errors if the accessibility checks fail.
14303
14304         * enum.cs (Enum.Enum): The default visibility is internal for
14305         top-level types and private for nested types.
14306         (Enum.DefineType): Compute the correct visibility.
14307
14308         * modifiers.cs (Modifiers.TypeAttr): Added a version of this
14309         function which takes a `bool is_toplevel' instead of a TypeContainer.
14310
14311         * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
14312         builtin type.
14313
14314 2002-08-02  Martin Baulig  <martin@gnome.org>
14315
14316         * expression.cs (LocalVariableReferenc): Added constructor which
14317         takes additional `VariableInfo vi' and `bool is_readonly' arguments.
14318         (LocalVariableReference.IsReadOnly): New property.
14319         (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
14320         variable is readonly, use our own readonly flag to do this; you can
14321         use the new constructor to get a writable reference to a read-only
14322         variable.
14323
14324         * cs-parser.jay (foreach_statement, using_statement): Get a writable
14325         reference to the local variable.
14326
14327 2002-08-01  Miguel de Icaza  <miguel@ximian.com>
14328
14329         * rootcontext.cs (ResolveCore): Also include System.Exception
14330
14331         * statement.cs (Block.Emit): Do not emit the dead-code warnings if
14332         we reach an EmptyStatement.
14333
14334         (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
14335         is also fine.
14336
14337         * expression.cs (Binary.ResolveOperator): Check error result in
14338         two places.
14339
14340         use brtrue/brfalse directly and avoid compares to null.
14341
14342 2002-08-02  Martin Baulig  <martin@gnome.org>
14343
14344         * class.cs (TypeContainer.Define): Define all nested interfaces here.
14345         Fixes bug #28407, added test-155.cs.
14346
14347 2002-08-01  Martin Baulig  <martin@gnome.org>
14348
14349         * class.cs (Event.EmitDefaultMethod): Make this work with static
14350         events.  Fixes #28311, added verify-3.cs.
14351
14352 2002-08-01  Martin Baulig  <martin@gnome.org>
14353
14354         * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
14355         `is_disposable' fields.
14356         (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
14357         `hm.is_disposable' if we're using the collection pattern.
14358         (Foreach.EmitCollectionForeach): Use the correct type for the
14359         enumerator's local variable, only emit the try/finally block if
14360         necessary (fixes #27713).
14361
14362 2002-08-01  Martin Baulig  <martin@gnome.org>
14363
14364         * ecore.cs (Expression.report118): Renamed to Error118 and made
14365         it public static.
14366
14367         * statement.cs (Throw.Resolve): Check whether the expression is of
14368         the correct type (CS0118) and whether the type derives from
14369         System.Exception (CS0155).
14370         (Catch.Resolve): New method.  Do the type lookup here and check
14371         whether it derives from System.Exception (CS0155).
14372         (Catch.CatchType, Catch.IsGeneral): New public properties.
14373
14374         * typemanager.cs (TypeManager.exception_type): Added.
14375
14376 2002-07-31  Miguel de Icaza  <miguel@ximian.com>
14377
14378         * driver.cs: Updated About function.
14379
14380 2002-07-31  Martin Baulig  <martin@gnome.org>
14381
14382         Implemented Control Flow Analysis.
14383
14384         * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
14385         (EmitContext.CurrentBranching): Added.
14386         (EmitContext.StartFlowBranching): Added.
14387         (EmitContext.EndFlowBranching): Added.
14388         (EmitContext.KillFlowBranching): Added.
14389         (EmitContext.IsVariableAssigned): Added.
14390         (EmitContext.SetVariableAssigned): Added.
14391         (EmitContext.IsParameterAssigned): Added.
14392         (EmitContext.SetParameterAssigned): Added.
14393         (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
14394         Added control flow analysis stuff here.
14395
14396         * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
14397         resolve the expression as lvalue.
14398         (LocalVariableReference.DoResolve): Check whether the variable has
14399         already been assigned.
14400         (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
14401         the parameter as assigned here.
14402         (ParameterReference.DoResolve): Check whether the parameter has already
14403         been assigned.
14404         (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
14405         expression as lvalue.
14406
14407         * statement.cs (FlowBranching): New class for the flow analysis code.
14408         (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
14409         (LabeledStatement.IsDefined): New public property.
14410         (LabeledStatement.AddUsageVector): New public method to tell flow
14411         analyis that the label may be reached via a forward jump.
14412         (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
14413         flow analysis.
14414         (VariableInfo.Number): New public field.  This is used by flow analysis
14415         to number all locals of a block.
14416         (Block.CountVariables): New public property.  This is the number of
14417         local variables in this block (including the locals from all parent
14418         blocks).
14419         (Block.EmitMeta): Number all the variables.
14420
14421         * statement.cs: Added flow analysis support to all classes.
14422
14423 2002-07-31  Martin Baulig  <martin@gnome.org>
14424
14425         * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
14426         To get debugging messages, compile mcs with /define:MCS_DEBUG and
14427         then use this argument.
14428
14429         * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
14430
14431         * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
14432         use this to specify /define options.
14433
14434 2002-07-29  Martin Baulig  <martin@gnome.org>
14435
14436         * statement.cs (Fixed): Moved all code that does variable lookups
14437         and resolvings from Emit to Resolve.
14438
14439         * statement.cs (For): Moved all code that does variable lookups
14440         and resolvings from Emit to Resolve.
14441
14442         * statement.cs (Using): Moved all code that does variable lookups
14443         and resolvings from Emit to Resolve.
14444
14445 2002-07-29  Martin Baulig  <martin@gnome.org>
14446
14447         * attribute.cs (Attribute.Resolve): Explicitly catch a
14448         System.NullReferenceException when creating the
14449         CustromAttributeBuilder and report a different warning message.
14450
14451 2002-07-29  Martin Baulig  <martin@gnome.org>
14452
14453         * support.cs (ParameterData.ParameterName): Added method to
14454         get the name of a parameter.
14455
14456         * typemanager.cs (TypeManager.IsValueType): New public method.
14457
14458 2002-07-29  Martin Baulig  <martin@gnome.org>
14459
14460         * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'.  This
14461         is a flag which specifies that it's either ref or out.
14462         (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
14463         the out parameter to `out Parameter.Modifier mod', also set the
14464         Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
14465
14466         * support.cs (InternalParameters.ParameterModifier): Distinguish
14467         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
14468         Parameter.Modifier.ISBYREF flag if it's either ref or out.
14469
14470         * expression.cs (Argument.GetParameterModifier): Distinguish
14471         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
14472         Parameter.Modifier.ISBYREF flag if it's either ref or out.
14473
14474 2002-07-29  Martin Baulig  <martin@gnome.org>
14475
14476         * expression.cs (ParameterReference.ParameterReference): Added
14477         `Location loc' argument to the constructor.
14478
14479         * cs-parser.jay: Pass location to ParameterReference.
14480
14481 2002-07-28  Miguel de Icaza  <miguel@ximian.com>
14482
14483         * statement.cs (Try): Initialize the location.
14484
14485         * cs-parser.jay: pass location to Try.
14486
14487         * expression.cs (Unary.Reduce): Change the prototype to return
14488         whether a constant fold could be performed or not.  The result is
14489         returned in an out parameters.  In the case of Indirection and
14490         AddressOf, we want to perform the full tests.
14491
14492 2002-07-26  Miguel de Icaza  <miguel@ximian.com>
14493
14494         * statement.cs (Statement.Emit): Flag dead code.
14495
14496 2002-07-27  Andrew Birkett  <andy@nobugs.org>
14497
14498         * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
14499
14500 2002-07-27  Martin Baulig  <martin@gnome.org>
14501
14502         * class.cs (MethodData.Define): Put back call to
14503         TypeManager.AddMethod(), accidentally commented this out.
14504
14505         * report.cs (Debug): New public method to print debugging information,
14506         this is `[Conditional ("DEBUG")]'.
14507
14508 2002-07-26  Martin Baulig  <martin@gnome.org>
14509
14510         * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
14511         (switch_statement): Push the current_block to the switch_stack and
14512         pop it again when we're done with the switch.
14513         (switch_section): The new block is a child of the current_block.
14514         Fixes bug #24007, added test-152.cs.
14515
14516 2002-07-27  Martin Baulig  <martin@gnome.org>
14517
14518         * expression.cs (Invocation.EmitArguments): When calling a varargs
14519         function with only its fixed arguments, we need to pass an empty
14520         array.
14521
14522 2002-07-27  Martin Baulig  <martin@gnome.org>
14523
14524         Mono 0.13 has been released.
14525
14526 2002-07-25  Miguel de Icaza  <miguel@ximian.com>
14527
14528         * driver.cs: Rename --resource to --linkres, because that is what
14529         we do currently, we dont support --resource yet.
14530
14531         * cs-tokenizer.cs: Fix test for reporting endif mismatches.
14532
14533 2002-07-25  Martin Baulig  <martin@gnome.org>
14534
14535         * class.cs (MethodData): New public class.  This is a `method builder'
14536         class for a method or one accessor of a Property/Indexer/Event.
14537         (MethodData.GetMethodFlags): Moved here from MemberBase.
14538         (MethodData.ApplyAttributes): Likewise.
14539         (MethodData.ApplyObsoleteAttribute): Likewise.
14540         (MethodData.ApplyConditionalAttribute): Likewise.
14541         (MethodData.ApplyDllImportAttribute): Likewise.
14542         (MethodData.CheckAbstractAndExternal): Likewise.
14543         (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
14544         (MethodData.Emit): Formerly known as Method.Emit().
14545         (MemberBase): Moved everything which was specific to a single
14546         accessor/method to MethodData.
14547         (Method): Create a new MethodData and call Define() and Emit() on it.
14548         (Property, Indexer, Event): Create a new MethodData objects for each
14549         accessor and call Define() and Emit() on them.
14550
14551 2002-07-25  Martin Baulig  <martin@gnome.org>
14552
14553         Made MethodCore derive from MemberBase to reuse the code from there.
14554         MemberBase now also checks for attributes.
14555
14556         * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
14557         (MemberBase.GetMethodFlags): Moved here from class Method and marked
14558         as virtual.
14559         (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
14560         `CallingConventions cc' and `Attributes opt_attrs' arguments.
14561         (MemberBase.ApplyAttributes): New virtual method; applies the
14562         attributes to a method or accessor.
14563         (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
14564         (MemberBase.ApplyConditionalAttribute): Likewise.
14565         (MemberBase.ApplyDllImportAttribute): Likewise.
14566         (MemberBase.CheckAbstractAndExternal): Likewise.
14567         (MethodCore.ParameterTypes): This is now a property instead of a
14568         method, it's initialized from DoDefineParameters().
14569         (MethodCore.ParameterInfo): Removed the set accessor.
14570         (MethodCore.DoDefineParameters): New protected virtual method to
14571         initialize ParameterTypes and ParameterInfo.
14572         (Method.GetReturnType): We can now simply return the MemberType.
14573         (Method.GetMethodFlags): Override the MemberBase version and add
14574         the conditional flags.
14575         (Method.CheckBase): Moved some code from Define() here, call
14576         DoDefineParameters() here.
14577         (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
14578         here to avoid some larger code duplication.
14579         (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
14580         ensure that abstract and external accessors don't declare a body.
14581
14582         * attribute.cs (Attribute.GetValidPieces): Make this actually work:
14583         `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
14584         lookup in the attribute's parent classes, so we need to abort as soon
14585         as we found the first match.
14586         (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
14587         the attribute has no arguments.
14588
14589         * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
14590         of a Method.
14591
14592 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14593
14594         * cs-parser.jay: reverted previous patch.
14595
14596 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14597
14598         * cs-parser.jay: fixed bug #22119.
14599
14600 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14601
14602         * attribute.cs: fixed compilation. The error was:
14603         "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must 
14604         be assigned to before control leaves the current method."
14605         [FIXME:  Filed as bug #28186: MCS must report this error.]
14606
14607 2002-07-25  Martin Baulig  <martin@gnome.org>
14608
14609         * attribute.cs (Attribute.Conditional_GetConditionName): New static
14610         method to pull the condition name ouf of a Conditional attribute.
14611         (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
14612         the obsolete message and error flag out of an Obsolete attribute.
14613
14614         * class.cs (Method.GetMethodFlags): New public method to get the
14615         TypeManager.MethodFlags for this method.
14616         (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
14617         private methods.
14618         (Method.Define): Get and apply the Obsolete and Conditional attributes;
14619         if we're overriding a virtual function, set the new private variable
14620         `parent_method'; call the new TypeManager.AddMethod().
14621
14622         * typemanager.cs (TypeManager.AddMethod): New static method.  Stores
14623         the MethodBuilder and the Method in a PtrHashtable.
14624         (TypeManager.builder_to_method): Added for this purpose.
14625         (TypeManager.MethodFlags): Added IsObsoleteError.
14626         (TypeManager.GetMethodFlags): Added `Location loc' argument.  Lookup
14627         Obsolete and Conditional arguments in MethodBuilders.  If we discover
14628         an Obsolete attribute, emit an appropriate warning 618 / error 619 with
14629         the message from the attribute.
14630
14631 2002-07-24  Martin Baulig  <martin@gnome.org>
14632
14633         * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
14634         preprocessor directives, ensure that the argument to #define/#undef is
14635         exactly one identifier and that it's actually an identifier.
14636
14637         Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
14638         did not work ....
14639
14640 2002-07-24  Martin Baulig  <martin@gnome.org>
14641
14642         * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
14643         initialize it to TypeManager.object_type in the constructor.
14644         (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
14645         of the `hm.get_current' method if we're using the collection pattern.
14646         (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
14647         for the explicit conversion to make it work when we're using the collection
14648         pattern and the `Current' property has a different return type than `object'.
14649         Fixes #27713.
14650
14651 2002-07-24  Martin Baulig  <martin@gnome.org>
14652
14653         * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
14654         does not match, but don't report any errors.  This method is called in
14655         order for all methods in a MethodGroupExpr until a matching method is
14656         found, so we don't want to bail out if the first method doesn't match.
14657         (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
14658         matches, report the 123.  Fixes #28070.
14659
14660 2002-07-24  Martin Baulig  <martin@gnome.org>
14661
14662         * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
14663         TypeManager.TypeToCoreType() to the top of the method so the
14664         following equality checks will work.  Fixes #28107.
14665
14666 2002-07-24  Martin Baulig  <martin@gnome.org>
14667
14668         * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
14669         operand is of type uint, and the other operand is of type sbyte,
14670         short or int, the operands are converted to type long." -
14671         Actually do what this comment already told us.  Fixes bug #28106,
14672         added test-150.cs.
14673
14674 2002-07-24  Martin Baulig  <martin@gnome.org>
14675
14676         * class.cs (MethodBase): New abstract class.  This is now a base
14677         class for Property, Indexer and Event to avoid some code duplication
14678         in their Define() and DefineMethods() methods.
14679         (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
14680         generic methods for Define() and DefineMethods().
14681         (FieldBase): Derive from MemberBase, not MemberCore.
14682         (Property): Derive from MemberBase, not MemberCore.
14683         (Property.DefineMethod): Moved all the code from this method to the
14684         new MethodBase.DefineAccessor(), just call it with appropriate
14685         argumetnts.
14686         (Property.Define): Call the new Property.DoDefine(), this does some
14687         sanity checks and we don't need to duplicate the code everywhere.
14688         (Event): Derive from MemberBase, not MemberCore.
14689         (Event.Define): Use the new MethodBase.DefineAccessor() to define the
14690         accessors, this will also make them work with interface events.
14691         (Indexer): Derive from MemberBase, not MemberCore.
14692         (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
14693         (Indexer.Define): Use the new MethodBase functions.
14694
14695         * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
14696         argument to the constructor.
14697         (Interface.FindMembers): Added support for interface events.
14698         (Interface.PopluateEvent): Implemented.
14699
14700         Added test-149.cs for this.  This also fixes bugs #26067 and #24256.
14701
14702 2002-07-22  Miguel de Icaza  <miguel@ximian.com>
14703
14704         * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
14705         but this is required to check for a method name being the same as
14706         the containing class.  
14707
14708         Handle this now.
14709
14710 2002-07-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14711
14712         * interface.cs: initialize variable.
14713
14714 2002-07-23  Martin Baulig  <martin@gnome.org>
14715
14716         Implemented the IndexerName attribute in interfaces.
14717
14718         * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
14719         name if this is an explicit interface implementation.
14720         (Indexer.InterfaceIndexerName): New public variable.  If we're
14721         implementing an interface indexer, this is the IndexerName in that
14722         interface.  Otherwise, it's the IndexerName.
14723         (Indexer.DefineMethod): If we're implementing interface indexer,
14724         set InterfaceIndexerName.  Use the new Pending.IsInterfaceIndexer
14725         and Pending.ImplementIndexer methods.
14726         (Indexer.Define): Also define the PropertyBuilder if we're
14727         implementing an interface indexer and this is neither an explicit
14728         interface implementation nor do the IndexerName match the one in
14729         the interface.
14730
14731         * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
14732         If a method is defined here, then we always need to create a proxy
14733         for it.  This is used when implementing interface indexers.
14734         (Pending.IsInterfaceIndexer): New public method.
14735         (Pending.ImplementIndexer): New public method.
14736         (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
14737         This is used when implementing interface indexers to define a proxy
14738         if necessary.
14739         (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
14740         define a proxy if necessary.
14741
14742         * interface.cs (Interface.IndexerName): New public variable.
14743         (Interface.PopulateIndexer): Set the IndexerName.
14744         (Interface.DefineIndexers): New private method.  Populate all the
14745         indexers and make sure their IndexerNames match.
14746
14747         * typemanager.cs (IndexerPropertyName): Added support for interface
14748         indexers.
14749
14750 2002-07-22  Martin Baulig  <martin@gnome.org>
14751
14752         * codegen.cs (EmitContext.HasReturnLabel): New public variable.
14753         (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
14754         ret if HasReturnLabel.
14755         (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
14756         variables.
14757
14758         * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
14759         and set the ec.LoopBeginTryCatchLevel.
14760         (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
14761         (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
14762         the current ec.TryCatchLevel, the branch goes out of an exception
14763         block.  In this case, we need to use Leave and not Br.
14764
14765 2002-07-22  Martin Baulig  <martin@gnome.org>
14766
14767         * statement.cs (Try.Emit): Emit an explicit ret after the end of the
14768         block unless the block does not always return or it is contained in
14769         another try { ... } catch { ... } block.  Fixes bug #26506.
14770         Added verify-1.cs to the test suite.
14771
14772 2002-07-22  Martin Baulig  <martin@gnome.org>
14773
14774         * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
14775         then we do not always return.  Fixes bug #24985.
14776
14777 2002-07-22  Martin Baulig  <martin@gnome.org>
14778
14779         * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
14780         lookup on a per-class level; ie. walk up the class hierarchy until we
14781         found at least one applicable method, then choose the best among them.
14782         Fixes bug #24463 and test-29.cs.
14783
14784 2002-07-22  Martin Baulig  <martin@gnome.org>
14785
14786         * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
14787         return types of the methods.  The return type is not part of the
14788         signature and we must not check it to make the `new' modifier work.
14789         Fixes bug #27999, also added test-147.cs.
14790         (TypeManager.TypeToCoreType): Added TypeManager.type_type.
14791
14792         * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
14793         on the method's return type.
14794
14795 2002-07-21  Martin Baulig  <martin@gnome.org>
14796
14797         * assign.cs: Make this work if the rightmost source is a constant and
14798         we need to do an implicit type conversion.  Also adding a few more tests
14799         to test-38.cs which should have caught this.
14800
14801         * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
14802         target in the makefile for this.  The makefile.gnu is primarily intended
14803         for end-users who don't want to debug the compiler.
14804
14805 2002-07-21  Martin Baulig  <martin@gnome.org>
14806
14807         * assign.cs: Improved the Assign class so it can now handle embedded
14808         assignments (X = Y = Z = something).  As a side-effect this'll now also
14809         consume less local variables.  test-38.cs now passes with MCS, added
14810         a few new test cases to that test.
14811
14812 2002-07-20  Martin Baulig  <martin@gnome.org>
14813
14814         * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
14815         instructions.  Fixes bug #27977, also added test-146.cs.
14816
14817 2002-07-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14818
14819         * cs-tokenizer.cs: fixed getHex ().
14820
14821 2002-07-19  Martin Baulig  <martin@gnome.org>
14822
14823         * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
14824         not Type.GetType() to lookup the array type.  This is needed when
14825         we're constructing an array of a user-defined type.
14826         (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
14827         single-dimensional arrays, but also for single-dimensial arrays of
14828         type decimal.
14829
14830 2002-07-19  Martin Baulig  <martin@gnome.org>
14831
14832         * expression.cs (New.DoEmit): Create a new LocalTemporary each time
14833         this function is called, it's not allowed to share LocalBuilders
14834         among ILGenerators.
14835
14836 2002-07-19  Martin Baulig  <martin@gnome.org>
14837
14838         * expression.cs (Argument.Resolve): Report an error 118 when trying
14839         to pass a type as argument.
14840
14841 2002-07-18  Martin Baulig  <martin@gnome.org>
14842
14843         * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
14844         Conv_R_Un for the signed `long' type.
14845
14846 2002-07-15  Miguel de Icaza  <miguel@ximian.com>
14847
14848         * expression.cs (MemberAccess.DoResolve): Do not reuse the field
14849         `expr' for the temporary result, as that will fail if we do
14850         multiple resolves on the same expression.
14851
14852 2002-07-05  Miguel de Icaza  <miguel@ximian.com>
14853
14854         * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
14855         ec.TypeContainer for looking up aliases. 
14856
14857         * class.cs (TypeContainer): Remove LookupAlias from here.
14858
14859         * decl.cs (DeclSpace); Move here.
14860
14861 2002-07-01  Miguel de Icaza  <miguel@ximian.com>
14862
14863         * class.cs (FindMembers): Only call filter if the constructor
14864         bulider is not null.
14865
14866         Also handle delegates in `NestedTypes' now.  Now we will perform
14867         type lookups using the standard resolution process.  This also
14868         fixes a bug.
14869
14870         * decl.cs (DeclSpace.ResolveType): New type resolution routine.
14871         This uses Expressions (the limited kind that can be parsed by the
14872         tree) instead of strings.
14873
14874         * expression.cs (ComposedCast.ToString): Implement, used to flag
14875         errors since now we have to render expressions.
14876
14877         (ArrayCreation): Kill FormElementType.  Use ComposedCasts in
14878         FormArrayType. 
14879
14880         * ecore.cs (SimpleName.ToString): ditto.
14881
14882         * cs-parser.jay: Instead of using strings to assemble types, use
14883         Expressions to assemble the type (using SimpleName, ComposedCast,
14884         MemberAccess).  This should fix the type lookups in declarations,
14885         because we were using a different code path for this.
14886
14887         * statement.cs (Block.Resolve): Continue processing statements
14888         even when there is an error.
14889
14890 2002-07-17  Miguel de Icaza  <miguel@ximian.com>
14891
14892         * class.cs (Event.Define): Also remove the `remove' method from
14893         the list of pending items.
14894
14895         * expression.cs (ParameterReference): Use ldarg.N (0..3) to
14896         generate more compact code. 
14897
14898 2002-07-17  Martin Baulig  <martin@gnome.org>
14899
14900         * const.cs (Const.LookupConstantValue): Add support for constant
14901         `unchecked' and `checked' expressions.
14902         Also adding test case test-140.cs for this.
14903
14904 2002-07-17  Martin Baulig  <martin@gnome.org>
14905
14906         * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
14907         check whether mi.ReturnType implements the IEnumerator interface; the
14908         `==' and the IsAssignableFrom() will fail in this situation.
14909
14910 2002-07-16  Ravi Pratap  <ravi@ximian.com>
14911
14912         * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix 
14913         here too.
14914
14915 2002-07-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14916
14917         * expression.cs: fixed bug #27811.
14918
14919 2002-07-14  Miguel de Icaza  <miguel@ximian.com>
14920
14921         * expression.cs (ParameterReference.AddressOf): Patch from Paolo
14922         Molaro: when we are a ref, the value already contains a pointer
14923         value, do not take the address of it.
14924
14925 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
14926         * removed mb-parser.jay and mb-tokenizer.cs
14927
14928 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
14929
14930         * expression.cs: check against the building corlib void type.
14931
14932 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
14933
14934         * ecore.cs: fix for valuetype static readonly fields: when 
14935         initializing them, we need their address, not the address of a copy.
14936
14937 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
14938
14939         * typemanager.cs: register also enum_type in corlib.
14940
14941 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
14942
14943         * class.cs: allow calling this (but not base) initializers in structs.
14944
14945 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
14946
14947         * ecore.cs: make sure we compare against the building base types
14948         in GetTypeSize ().
14949
14950 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
14951
14952         * typemanager.cs: fix TypeToCoreType() to handle void and object
14953         (corlib gets no more typerefs after this change).
14954
14955 2002-07-12  Miguel de Icaza  <miguel@ximian.com>
14956
14957         * expression.cs (ArrayCreation.EmitArrayArguments): use
14958         Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
14959
14960         (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
14961         Conv_Ovf_I_Un for the array arguments.  Even if C# allows longs as
14962         array indexes, the runtime actually forbids them.
14963
14964         * ecore.cs (ExpressionToArrayArgument): Move the conversion code
14965         for array arguments here.
14966
14967         * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
14968         instead of the default for ValueTypes.
14969
14970         (New.DoEmit): Use IsValueType instead of
14971         IsSubclassOf (value_type)
14972         (New.DoResolve): ditto.
14973         (Invocation.EmitCall): ditto.
14974
14975         * assign.cs (Assign): ditto.
14976
14977         * statement.cs (Unsafe): Ok, so I got the semantics wrong.
14978         Statements *are* currently doing part of their resolution during
14979         Emit.  
14980
14981         Expressions do always resolve during resolve, but statements are
14982         only required to propagate resolution to their children.
14983
14984 2002-07-11  Miguel de Icaza  <miguel@ximian.com>
14985
14986         * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
14987
14988         (LoadAssembly): Do not add the dll if it is already specified
14989
14990         (MainDriver): Add the System directory to the link path at the end,
14991         after all the other -L arguments. 
14992
14993         * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
14994         wrong opcode for loading bytes and bools (ldelem.i1 instead of
14995         ldelem.u1) and using the opposite for sbytes.
14996
14997         This fixes Digger, and we can finally run it.
14998
14999         * driver.cs (UnixParseOption): Move the option parsing here.  
15000         (CSCParseOption): Implement CSC-like parsing of options.
15001
15002         We now support both modes of operation, the old Unix way, and the
15003         new CSC-like way.  This should help those who wanted to make cross
15004         platform makefiles.
15005
15006         The only thing broken is that /r:, /reference: and /lib: are not
15007         implemented, because I want to make those have the same semantics
15008         as the CSC compiler has, and kill once and for all the confussion
15009         around this.   Will be doing this tomorrow.
15010
15011         * statement.cs (Unsafe.Resolve): The state is checked during
15012         resolve, not emit, so we have to set the flags for IsUnsfe here.
15013
15014 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
15015
15016         * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
15017         not catch the Error_ObjectRefRequired in SimpleName (as it is
15018         possible to have a class/instance variable name that later gets
15019         deambiguated), we have to check this here.      
15020
15021 2002-07-10  Ravi Pratap  <ravi@ximian.com>
15022
15023         * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
15024         make static and put into Expression.
15025
15026         (Event.Define): Register the private field of the event with the 
15027         TypeManager so that GetFieldFromEvent can get at it.
15028
15029         (TypeManager.RegisterPrivateFieldOfEvent): Implement to
15030         keep track of the private field associated with an event which
15031         has no accessors.
15032
15033         (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
15034         private field.
15035
15036         * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
15037
15038 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
15039
15040         * expression.cs (Binary.EmitBranchable): this routine emits the
15041         Binary expression in a branchable context.  This basically means:
15042         we need to branch somewhere, not just get the value on the stack.
15043
15044         This works together with Statement.EmitBoolExpression.
15045
15046         * statement.cs (Statement.EmitBoolExpression): Use
15047         EmitBranchable. 
15048
15049 2002-07-09  Miguel de Icaza  <miguel@ximian.com>
15050
15051         * statement.cs (For): Reduce the number of jumps in loops.
15052
15053         (For): Implement loop inversion for the For statement.
15054
15055         (Break): We can be breaking out of a Try/Catch controlled section
15056         (foreach might have an implicit try/catch clause), so we need to
15057         use Leave instead of Br.
15058
15059         * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
15060         now).  If the instace expression supports IMemoryLocation, we use
15061         the AddressOf method from the IMemoryLocation to extract the
15062         address instead of emitting the instance.
15063
15064         This showed up with `This', as we were emitting the instance
15065         always (Emit) instead of the Address of This.  Particularly
15066         interesting when This is a value type, as we dont want the Emit
15067         effect (which was to load the object).
15068
15069 2002-07-08  Miguel de Icaza  <miguel@ximian.com>
15070
15071         * attribute.cs: Pass the entry point to the DefinePInvokeMethod
15072
15073         * statement.cs (Checked): Set the CheckedState during the resolve
15074         process too, as the ConvCast operations track the checked state on
15075         the resolve process, and not emit.
15076
15077         * cs-parser.jay (namespace_member_declaration): Flag that we have
15078         found a declaration when we do.  This is used to flag error 1529
15079
15080         * driver.cs: Report ok when we display the help only.
15081
15082 2002-07-06  Andrew Birkett  <adb@tardis.ed.ac.uk>
15083
15084         * cs-tokenizer.cs (xtoken): Improve handling of string literals.
15085
15086 2002-07-04  Miguel de Icaza  <miguel@ximian.com>
15087
15088         * cs-tokenizer.cs (define): We also have to track locally the
15089         defines.  AllDefines is just used for the Conditional Attribute,
15090         but we also need the local defines for the current source code. 
15091
15092 2002-07-03  Miguel de Icaza  <miguel@ximian.com>
15093
15094         * statement.cs (While, For, Do): These loops can exit through a
15095         Break statement, use this information to tell whether the
15096         statement is the last piece of code.
15097
15098         (Break): Flag that we break.
15099
15100         * codegen.cs (EmitContexts): New `Breaks' state variable.
15101
15102 2002-07-03  Martin Baulig  <martin@gnome.org>
15103
15104         * class.cs (TypeContainer.MethodModifiersValid): Allow override
15105         modifiers in method declarations in structs.  Otherwise, you won't
15106         be able to override things like Object.Equals().
15107
15108 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
15109
15110         * class.cs (Method, Property, Indexer): Do not allow the public
15111         modifier to be used in explicit interface implementations.
15112
15113         (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
15114         override modifiers in method declarations in structs
15115
15116 2002-07-02   Andrew Birkett <adb@tardis.ed.ac.uk>
15117
15118         * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
15119         integer or real overflow, report an error
15120
15121 2002-07-02  Martin Baulig  <martin@gnome.org>
15122
15123         * typemanager.cs (TypeManager.InitCoreTypes): When compiling
15124         corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
15125         to tell the runtime about our newly created System.Object and
15126         System.ValueType types.
15127
15128 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
15129
15130         * expression.cs (This): Use Stobj/Ldobj when we are a member of a
15131         struct instead of Ldarg/Starg.
15132
15133 2002-07-02  Martin Baulig  <martin@gnome.org>
15134
15135         * expression.cs (Indirection.Indirection): Call
15136         TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
15137
15138 2002-07-02  Martin Baulig  <martin@gnome.org>
15139
15140         * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
15141         ValueType, call TypeManager.TypeToCoreType() on it.
15142         (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
15143         the OpCodes.Newarr argument.
15144
15145 2002-07-02  Martin Baulig  <martin@gnome.org>
15146
15147         * expression.cs (Invocation.EmitCall): When compiling corlib,
15148         replace all calls to the system's System.Array type to calls to
15149         the newly created one.
15150
15151         * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
15152         System.Array methods.
15153         (TypeManager.InitCoreTypes): When compiling corlib, get the methods
15154         from the system's System.Array type which must be replaced.
15155
15156 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
15157
15158         * typemanager.cs: load unverifiable_code_ctor so we can build
15159         corlib using the correct type. Avoid using GetTypeCode() with
15160         TypeBuilders.
15161         * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
15162         TypeManager.object_type to allow building corlib.
15163
15164 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
15165
15166         * ecore.cs: handle System.Enum separately in LoadFromPtr().
15167
15168 2002-07-01  Martin Baulig  <martin@gnome.org>
15169
15170         * class.cs: Make the last change actually work, we need to check
15171         whether `ifaces != null' to avoid a crash.
15172
15173 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
15174
15175         * class.cs: when we build structs without fields that implement
15176         interfaces, we need to add the interfaces separately, since there is
15177         no API to both set the size and add the interfaces at type creation
15178         time.
15179
15180 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
15181
15182         * expression.cs: the dimension arguments to the array constructors
15183         need to be converted if they are a long.
15184
15185 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
15186
15187         * class.cs: don't emit ldarg.0 if there is no parent constructor
15188         (fixes showstopper for corlib).
15189
15190 2002-06-29  Martin Baulig  <martin@gnome.org>
15191
15192         MCS now compiles corlib on GNU/Linux :-)
15193
15194         * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
15195         ie. check for MethodImplOptions.InternalCall.
15196
15197         * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
15198         and TypeManager.attribute_type are null, so we must explicitly check
15199         whether parent is not null to find out whether it's an attribute type.
15200         (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
15201         and SetBuilder, not only if the property is neither abstract nor external.
15202         This is necessary to set the MethodImplOptions on the accessor methods.
15203         (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
15204         SetBuilder, see Property.Emit().
15205
15206         * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
15207         populate "System.Object", "System.ValueType" and "System.Attribute" since
15208         they've already been populated from BootCorlib_PopulateCoreTypes().
15209
15210 2002-06-29  Martin Baulig  <martin@gnome.org>
15211
15212         * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
15213         is the NullLiteral, we also need to make sure that target_type is not
15214         an enum type.   
15215
15216 2002-06-29  Martin Baulig  <martin@gnome.org>
15217
15218         * rootcontext.cs (RootContext.ResolveCore): We must initialize
15219         `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
15220         before calling BootstrapCorlib_ResolveDelegate ().
15221
15222 2002-06-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15223
15224         * statement.cs: fixed build-breaker. All tests passed ok.
15225
15226 2002-06-27  Martin Baulig  <martin@gnome.org>
15227
15228         * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
15229         for System.Decimal when compiling corlib.
15230
15231 2002-06-27  Martin Baulig  <martin@gnome.org>
15232
15233         * statement.cs (Switch.TableSwitchEmit): Make this work with empty
15234         switch blocks which contain nothing but a default clause.
15235
15236 2002-06-26  Andrew  <adb@tardis.ed.ac.uk>
15237
15238        * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
15239
15240 2002-06-27  Martin Baulig  <martin@gnome.org>
15241
15242         * ecore.cs (PropertyExpr.PropertyExpr): Call
15243         TypeManager.TypeToCoreType() on the `pi.PropertyType'.
15244
15245         * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
15246         is already a TypeBuilder.
15247
15248 2002-06-27  Martin Baulig  <martin@gnome.org>
15249
15250         * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
15251         `target_type == TypeManager.array_type', not IsAssignableFrom() in
15252         the "from an array-type to System.Array" case.  This makes it work
15253         when compiling corlib.
15254
15255 2002-06-27  Martin Baulig  <martin@gnome.org>
15256
15257         * ecore.cs (Expression.SimpleNameResolve): If the expression is a
15258         non-static PropertyExpr, set its InstanceExpression.  This makes
15259         the `ICollection.Count' property work in System/Array.cs.
15260
15261 2002-06-25  Andrew Birkett  <adb@tardis.ed.ac.uk>
15262
15263         * driver.cs: Made error handling more consistent.  Errors now
15264         tracked by Report class, so many methods which used to return int
15265         now return void.  Main() now prints success/failure and 
15266         errors/warnings message.
15267
15268         Renamed '--probe' compiler argument to '--expect-error'.  Removed
15269         the magic number return values (123 and 124).  Now, if the
15270         expected error occurs, the compiler exits with success (exit value
15271         0).  If the compilation completes without seeing that particular
15272         error, the compiler exits with failure (exit value 1).  The
15273         makefile in mcs/errors has been changed to handle the new behaviour.
15274
15275         * report.cs: Made 'expected error' number a property and renamed
15276         it from 'Probe' to 'ExpectedError'.
15277
15278         * genericparser.cs: Removed error handling support, since it is
15279         now all done by Report class.
15280
15281         * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
15282         class, so parse() no longer returns an int.
15283
15284         * namespace.cs: Use Report.Error instead of GenericParser.error
15285
15286 2002-06-22  Miguel de Icaza  <miguel@ximian.com>
15287
15288         * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
15289         TypeContainer.AddOperator): At the front of the list put the
15290         explicit implementations, so they get resolved/defined first. 
15291
15292 2002-06-21  Miguel de Icaza  <miguel@ximian.com>
15293
15294         * class.cs (TypeContainer.VerifyImplements): Verifies that a given
15295         interface type is implemented by this TypeContainer.  Used during
15296         explicit interface implementation.
15297
15298         (Property.Define, Indexer.Define, Method.Define): Validate that
15299         the given interface in the explicit implementation is one of the
15300         base classes for the containing type.
15301
15302         Also if we are explicitly implementing an interface, but there is
15303         no match in the pending implementation table, report an error.
15304
15305         (Property.Define): Only define the property if we are
15306         not explicitly implementing a property from an interface.  Use the
15307         correct name also for those properties (the same CSC uses,
15308         although that is really not needed).
15309
15310         (Property.Emit): Do not emit attributes for explicitly implemented
15311         properties, as there is no TypeBuilder.
15312
15313         (Indexer.Emit): ditto.
15314
15315         Hiding then means that we do not really *implement* a pending
15316         implementation, which makes code fail.
15317
15318 2002-06-22  Martin Baulig  <martin@gnome.org>
15319
15320         * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
15321         the return value of Object.GetType().  [FIXME: we need to do this whenever
15322         we get a type back from the reflection library].
15323
15324 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
15325
15326         * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
15327
15328 2002-06-20  Miguel de Icaza  <miguel@ximian.com>
15329
15330         * attribute.cs: Return null if we can not look up the type.
15331
15332         * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
15333         the interface types found.
15334
15335         * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
15336         interface types found.
15337
15338         * typemanager.cs (GetInterfaces): Make this routine returns alll
15339         the interfaces and work around the lame differences between
15340         System.Type and System.Reflection.Emit.TypeBuilder in the results
15341         result for GetInterfaces.
15342
15343         (ExpandInterfaces): Given an array of interface types, expand and
15344         eliminate repeated ocurrences of an interface.  This expands in
15345         context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
15346         be IA, IB, IC.
15347
15348 2002-06-21  Martin Baulig  <martin@gnome.org>
15349
15350         * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
15351         on System.Enum.
15352
15353 2002-06-21  Martin Baulig  <martin@gnome.org>
15354
15355         * typemanager.cs (TypeManager.TypeToCoreType): New function.  When compiling corlib
15356         and called with one of the core types, return the corresponding typebuilder for
15357         that type.
15358
15359         * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
15360         element type.
15361
15362 2002-06-21  Martin Baulig  <martin@gnome.org>
15363
15364         * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
15365         `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
15366         (Expression.ConvertReferenceExplicit): Likewise.
15367
15368         * expression.cs (ElementAccess.DoResolve): Likewise.
15369         (ElementAccess.DoResolveLValue): Likewise.
15370
15371 2002-06-10  Martin Baulig  <martin@gnome.org>
15372
15373         * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
15374         add the "value" parameter to the parameter list.
15375
15376         * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
15377         to our caller.
15378
15379 2002-06-19  Miguel de Icaza  <miguel@ximian.com>
15380
15381         * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
15382         the argument to an int, uint, long or ulong, per the spec.  Also
15383         catch negative constants in array creation.
15384
15385 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
15386
15387         * class.cs: do not allow the same interface to appear twice in
15388         the definition list.
15389
15390 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
15391
15392         * ecore.cs: don't use ldlen with System.Array.
15393
15394 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
15395
15396         * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
15397
15398 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
15399
15400         * modifiers.cs: produce correct field attributes for protected
15401         internal. Easy fix so miguel can work on ther harder stuff:-)
15402
15403 2002-06-18  Miguel de Icaza  <miguel@ximian.com>
15404
15405         * pending.cs: New file.  Move the code from class.cs here.
15406         Support clearning the pending flag for all methods (when not doing
15407         explicit interface implementation).
15408
15409 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
15410
15411         * rootcontext.cs: added a couple more types needed to bootstrap.
15412
15413 2002-06-17  Miguel de Icaza  <miguel@ximian.com>
15414
15415         * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
15416         constructor in the type, instead of any constructor in the type
15417         hierarchy.  Thanks to Paolo for finding this bug (it showed up as
15418         a bug in the Mono runtime when applying the params attribute). 
15419
15420 2002-06-16  Rafael Teixeira  <rafaelteixeirabr@hotmail.com>
15421         * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
15422
15423 2002-06-14  Rachel Hestilow  <hestilow@ximian.com>
15424
15425         * expression.cs (Unary.ResolveOperator): Use TypeManager
15426         to resolve the type.
15427
15428 2002-06-13  Ravi Pratap  <ravi@ximian.com>
15429
15430         * cs-parser.jay (enum_member_declaration): Pass in the attributes
15431         attached.
15432
15433         * enum.cs (AddEnumMember): Add support to store the attributes associated 
15434         with each member too.
15435
15436         * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
15437         field builders too - this takes care of the enum member case.
15438
15439 2002-06-10  Rachel Hestilow  <hestilow@ximian.com>
15440
15441         * typemanager.cs (TypeManager.VerifyUnManaged): Allow
15442         address-of operator on both value types and pointers.
15443
15444 2002-06-10  Martin Baulig  <martin@gnome.org>
15445
15446         * interface.cs (Interface.PopulateIndexer): Add the indexer's
15447         PropertyBuilder to the `property_builders' list.
15448
15449         * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
15450         (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
15451         `lookup_type' and all its interfaces.  Unfortunately, Type.FindMembers() won't
15452         find any indexers which are inherited from an interface.
15453
15454 2002-06-09  Martin Baulig  <martin@gnome.org>
15455
15456         * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
15457         the same type as the constant if necessary.  There's also a test-130.cs
15458         for this.
15459
15460         * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
15461
15462         * typemanager.cs (TypeManager.ChangeType): Previously known as
15463         Enum.ChangeEnumType().
15464
15465 2002-06-09  Martin Baulig  <martin@gnome.org>
15466
15467         * expression.cs (Cast.TryReduce): Added support for consts.
15468
15469 2002-06-08  Ravi Pratap  <ravi@ximian.com>
15470
15471         * class.cs (Accessor): Hold attributes information so we can pass
15472         it along.
15473
15474         * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
15475         Modify to pass in attributes attached to the methods.
15476
15477         (add_accessor_declaration, remove_accessor_declaration): Ditto.
15478
15479         * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
15480         to handle the Accessor kind :-)
15481
15482         * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
15483
15484 2002-06-08  Martin Baulig  <martin@gnome.org>
15485
15486         * expression.cs (Unary.TryReduceNegative): Added support for
15487         ULongConstants.
15488
15489 2002-06-08  Martin Baulig  <martin@gnome.org>
15490
15491         * enum.cs (Enum.LookupEnumValue): Don't report an error if the
15492         name can't be found in the `defined_names' - the caller will do a
15493         MemberLookup in this case and thus find methods in System.Enum
15494         such as Enum.IsDefined().
15495
15496 2002-06-08  Martin Baulig  <martin@gnome.org>
15497
15498         * enum.cs (Enum.ChangeEnumType): This is a custom version of
15499         Convert.ChangeType() which works with TypeBuilder created types.
15500         (Enum.LookupEnumValue, Enum.Define): Use it here.
15501
15502         * class.cs (TypeContainer.RegisterRequiredImplementations): Added
15503         `TypeBuilder.BaseType != null' check.
15504         (TypeContainer.FindMembers): Only lookup parent members if we
15505         actually have a parent.
15506         (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
15507         (ConstructorInitializer.Resolve): Likewise.
15508
15509         * interface.cs (Interface.FindMembers): Added
15510         `TypeBuilder.BaseType != null' check.
15511
15512         * rootcontext.cs (RootContext.ResolveCore): Added
15513         "System.Runtime.CompilerServices.IndexerNameAttribute" to
15514         classes_second_stage.
15515
15516         * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
15517         debug_type and trace_type when compiling with --nostdlib.       
15518
15519 2002-06-07  Martin Baulig  <martin@gnome.org>
15520
15521         * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
15522         (AddField): Set it to true when adding a non-static field.
15523         (DefineType): Use `have_nonstatic_fields' to find out whether we
15524         have non-static fields, not `Fields != null'.
15525
15526 2002-06-02  Miguel de Icaza  <miguel@ximian.com>
15527
15528         * ecore.cs (SimpleNameResolve): Removed simple bug (we were
15529         dereferencing a null on the static-field code path)
15530
15531 2002-05-30  Martin Baulig  <martin@gnome.org>
15532
15533         * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
15534         to take command line arguments.  Use reflection to call the new
15535         custom `Initialize' function on the symbol writer and pass it the
15536         command line arguments.
15537
15538         * driver.cs (--debug-args): New command line argument to pass command
15539         line arguments to the symbol writer.
15540
15541 2002-05-28  Miguel de Icaza  <miguel@ximian.com>
15542
15543         * assign.cs (DoResolve): Forgot to do the implicit conversion to
15544         the target type for indexers and properties.  Thanks to Joe for
15545         catching this.
15546
15547 2002-05-27  Miguel de Icaza  <miguel@ximian.com>
15548
15549         * typemanager.cs (MethodFlags): returns the method flags
15550         (Obsolete/ShouldIgnore) that control warning emission and whether
15551         the invocation should be made, or ignored. 
15552
15553         * expression.cs (Invocation.Emit): Remove previous hack, we should
15554         not do this on matching a base type, we should do this based on an attribute
15555
15556         Only emit calls to System.Diagnostics.Debug and
15557         System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
15558         on the command line.
15559
15560         * rootcontext.cs: Global settings for tracing and debugging.
15561
15562         * cs-tokenizer.cs (define): New utility function to track
15563         defines.   Set the global settings for TRACE and DEBUG if found.
15564
15565 2002-05-25  Ravi Pratap  <ravi@ximian.com>
15566
15567         * interface.cs (Populate*): Pass in the TypeContainer as well as
15568         the DeclSpace as parameters so that we can create EmitContexts and
15569         then use that to apply attributes etc.
15570
15571         (PopulateMethod, PopulateEvent, PopulateProperty)
15572         (PopulateIndexer): Apply attributes everywhere.
15573
15574         * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
15575         etc.
15576
15577         (ApplyAttributes): Update accordingly.
15578
15579         We now apply interface attributes for all members too.
15580
15581 2002-05-26  Miguel de Icaza  <miguel@ximian.com>
15582
15583         * class.cs (Indexer.Define); Correctly check if we are explicit
15584         implementation (instead of checking the Name for a ".", we
15585         directly look up if the InterfaceType was specified).
15586
15587         Delay the creation of the PropertyBuilder.
15588
15589         Only create the PropertyBuilder if we are not an explicit
15590         interface implementation.   This means that explicit interface
15591         implementation members do not participate in regular function
15592         lookups, and hence fixes another major ambiguity problem in
15593         overload resolution (that was the visible effect).
15594
15595         (DefineMethod): Return whether we are doing an interface
15596         implementation. 
15597
15598         * typemanager.cs: Temporary hack until we get attributes in
15599         interfaces (Ravi is working on that) and we get IndexerName
15600         support in interfaces.
15601
15602         * interface.cs: Register the indexers as properties.
15603
15604         * attribute.cs (Attribute.Resolve): Catch the error, and emit a
15605         warning, I have verified that this is a bug in the .NET runtime
15606         (JavaScript suffers of the same problem).
15607
15608         * typemanager.cs (MemberLookup): When looking up members for
15609         interfaces, the parent of an interface is the implicit
15610         System.Object (so we succeed in searches of Object methods in an
15611         interface method invocation.  Example:  IEnumerable x;  x.ToString
15612         ()) 
15613
15614 2002-05-25  Miguel de Icaza  <miguel@ximian.com>
15615
15616         * class.cs (Event): Events should also register if they do
15617         implement the methods that an interface requires.
15618
15619         * typemanager.cs (MemberLookup); use the new GetInterfaces
15620         method. 
15621
15622         (GetInterfaces): The code used to lookup interfaces for a type is
15623         used in more than one place, factor it here. 
15624
15625         * driver.cs: Track the errors at the bottom of the file, we kept
15626         on going.
15627
15628         * delegate.cs (NewDelegate.Emit): We have to emit a null as the
15629         instance if the method we are calling is static!
15630
15631 2002-05-24  Miguel de Icaza  <miguel@ximian.com>
15632
15633         * attribute.cs (ApplyAttributes): Make this function filter out
15634         the IndexerName attribute (as that attribute in reality is never
15635         applied) and return the string constant for the IndexerName
15636         attribute. 
15637
15638         * class.cs (TypeContainer.Emit): Validate that all the indexers
15639         have the same IndexerName attribute, and if so, set the
15640         DefaultName attribute on the class. 
15641
15642         * typemanager.cs: The return value might contain other stuff (not
15643         only methods).  For instance, consider a method with an "Item"
15644         property and an Item method.
15645
15646         * class.cs: If there is a problem with the parameter types,
15647         return. 
15648
15649 2002-05-24  Ravi Pratap  <ravi@ximian.com>
15650
15651         * ecore.cs (ImplicitConversionExists): Wrapper function which also
15652         looks at user defined conversion after making a call to 
15653         StandardConversionExists - we need this for overload resolution.
15654
15655         * expression.cs : Update accordingly the various method calls.
15656
15657         This fixes 2 bugs filed against implicit user defined conversions 
15658
15659 2002-05-22  Miguel de Icaza  <miguel@ximian.com>
15660
15661         * statement.cs: Track the result of the assignment.
15662
15663 2002-05-21  Miguel de Icaza  <miguel@ximian.com>
15664
15665         * expression.cs (MemberAccess): Improved error reporting for
15666         inaccessible members.
15667
15668 2002-05-22  Martin Baulig  <martin@gnome.org>
15669
15670         * makefile (mcs-mono2.exe): New target.  This is mcs compiled with
15671         itself with debugging support.
15672
15673 2002-05-22  Martin Baulig  <martin@gnome.org>
15674
15675         * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
15676         Removed, this isn't needed anymore.
15677
15678 2002-05-20  Martin Baulig  <martin@gnome.org>
15679
15680         * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
15681         be underlying type for an enum.
15682
15683 2002-05-20  Miguel de Icaza  <miguel@ximian.com>
15684
15685         * typemanager.cs (InitEnumUnderlyingTypes): New helper function
15686         that splits out the loading of just the core types.
15687
15688         * rootcontext.cs (ResolveCore): Split the struct resolution in
15689         two, so we can load the enumeration underlying types before any
15690         enums are used.
15691
15692         * expression.cs (Is): Bandaid until we fix properly Switch (see
15693         bug #24985 for details).
15694
15695         * typemanager.cs (ImplementsInterface): The hashtable will contain
15696         a null if there are no interfaces implemented.
15697
15698 2002-05-18  Miguel de Icaza  <miguel@ximian.com>
15699
15700         * cs-parser.jay (indexer_declarator): It is fine to have array
15701         parameters
15702
15703 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
15704
15705         * typemanager.cs: (RegisterBuilder): New function used to register
15706         TypeBuilders that implement interfaces.  Since
15707         TypeBuilder.GetInterfaces (as usual) does not work with lame
15708         Reflection.Emit. 
15709         (AddUserType): register interfaces.
15710
15711         (ImplementsInterface): Use the builder_to_ifaces hash if we are
15712         dealing with TypeBuilder.  Also, arrays are showing up as
15713         SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
15714         methods can not be invoked on them!
15715
15716         * ecore.cs (ExplicitReferenceConversionExists): Made public.
15717         (ImplicitReferenceConversionExists): Split out from
15718         StandardConversionExists. 
15719
15720         * expression.cs (As): We were only implementing one of the three
15721         cases for the as operator.  We now implement them all.
15722         (Is): Implement the various other cases for Is as well.
15723
15724         * typemanager.cs (CACHE): New define used to control if we want or
15725         not the FindMembers cache.  Seems to have a negative impact on
15726         performance currently
15727
15728         (MemberLookup): Nested types have full acess to
15729         enclosing type members
15730
15731         Remove code that coped with instance/static returns for events, we
15732         now catch this in RealFindMembers.
15733
15734         (RealFindMembers): only perform static lookup if the instance
15735         lookup did not return a type or an event.  
15736
15737 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
15738
15739         * assign.cs (CompoundAssign): We pass more semantic information
15740         now to Compound Assignments than we did before: now we have all
15741         the information at hand, and now we resolve the target *before* we
15742         do the expression expansion, which allows the "CacheValue" method
15743         to have the effect we intended (before, a [x] += 1 would generate
15744         two differen ArrayAccess expressions from the ElementAccess,
15745         during the resolution process).
15746
15747         (CompoundAssign.DoResolve): Resolve target and original_source here.
15748
15749 2002-05-16  Miguel de Icaza  <miguel@ximian.com>
15750
15751         * expression.cs (ArrayAccess): dropped debugging information. 
15752
15753         * typemanager.cs: Small bug fix: I was always returning i_members,
15754         instead of one of i_members or s_members (depending on which had
15755         the content).
15756
15757         * assign.cs (IAssignMethod.CacheTemporaries): New method.  This
15758         method is invoked before any code generation takes place, and it
15759         is a mechanism to inform that the expression will be invoked more
15760         than once, and that the method should use temporary values to
15761         avoid having side effects
15762
15763         (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
15764
15765         * ecore.cs (Expression.CacheTemporaries): Provide empty default
15766         implementation.
15767
15768         * expression.cs (Indirection, ArrayAccess): Add support for
15769         CacheTemporaries in these two bad boys. 
15770
15771         * ecore.cs (LoadFromPtr): figure out on our own if we need to use
15772         ldobj or ldind_ref.  
15773         (StoreFromPtr): Handle stobj as well.
15774
15775         * expression.cs (UnaryMutator): Share more code.
15776
15777         * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
15778         down: I was not tracking the Filter function as well, which
15779         was affecting the results of the cache.
15780
15781 2002-05-15  Miguel de Icaza  <miguel@ximian.com>
15782
15783         * attribute.cs: Remove the hack to handle the CharSet property on
15784         StructLayouts. 
15785
15786 2002-05-14  Miguel de Icaza  <miguel@ximian.com>
15787
15788         * attribute.cs (DoResolve): More uglyness, we now only try to
15789         resolve the attribute partially, to extract the CharSet
15790         information (only if we are a StructLayout attribute).  Otherwise 
15791
15792         (GetExtraTypeInfo): Add some code to conditionally kill in the
15793         future this.   I am more and more convinced that the .NET
15794         framework has special code to handle the attribute setting on
15795         certain elements.
15796
15797         * expression.cs (IsParamsMethodApplicable): Revert my previous
15798         foreach change here, it was wrong.
15799
15800 2002-05-13  Miguel de Icaza  <miguel@ximian.com>
15801
15802         * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
15803         (pp_expr): do not abort on unknown input, just return.
15804         (eval): abort if there are pending chars.
15805
15806         * attribute.cs (Attribute.Resolve): Positional parameters are
15807         optional.  Deal with that case.
15808
15809         * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
15810         the Ansi/Unicode/Auto information for the type.
15811
15812         (TypeContainer.DefineType): instantiate the EmitContext here, as
15813         we will be using it during the type definition (to resolve
15814         attributes) and during the emit phase.
15815
15816         * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
15817         to pull type information out of the attributes
15818
15819         (Attribute.Resolve): track the constructor builder, and allow for
15820         multiple invocations (structs and classes will use this).
15821
15822         * ecore.cs (MemberLookupFinal): new version with all the
15823         parameters customizable.
15824
15825         * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
15826         constructors.  Return if the result value is null (as the error
15827         would have been flagged already by MemberLookupFinal)
15828
15829         Do not allow instances of abstract classes or interfaces to be
15830         created.
15831
15832         * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
15833         We have to compare the assembly property here when dealing with
15834         FamANDAssem and Assembly access modifiers, because we might be
15835         creating an assembly from *modules* (that means that we are not
15836         getting TypeBuilders for types defined in other modules that are
15837         part of this assembly).
15838
15839         (Method.Emit): If the method is marked abstract and has a body,
15840         emit an error. 
15841
15842         (TypeContainer.DefineMembers): If both the defined member and the
15843         parent name match are methods, then do not emit any warnings: let
15844         the Method.Define routine take care of flagging warnings.  But if
15845         there is a mismatch (method overrides something else, or method is
15846         overriwritten by something, then emit warning).
15847
15848         (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
15849         set to null, this means `do not check for the return type on the
15850         signature'. 
15851
15852         (Method.Define): set the return type for the method signature to
15853         null, so that we get methods with the same name and parameters and
15854         different return types.  This is used to flag warning 114 (you are
15855         hiding a method, and you probably want to use the new/override
15856         keywords instead).
15857
15858         * typemanager.cs (MemberLookup): Implemented proper access
15859         control, closing a long standing set of bug reports.  The problem
15860         was that the Framework only has two bits: Public and NonPublic,
15861         and NonPublic includes private and protected methods, but we need
15862         to enforce the FamANDAssem, FamOrAssem and Family. 
15863
15864 2002-05-11  Miguel de Icaza  <miguel@ximian.com>
15865
15866         * statement.cs (GotoCase): Return true: Ammounts to giving up
15867         knowledge on whether we return or not, and letting the other case
15868         be responsible for it.
15869
15870 2002-05-10  Miguel de Icaza  <miguel@ximian.com>
15871
15872         * driver.cs: Do not load directories for each file processed, only
15873         do it if there is a pattern.
15874
15875         * ecore.cs: Report readonly assigns here as well, as we might have
15876         been resolved only by MemberAccess.
15877
15878         (SimpleName.SimpleNameResolve): Also be useful for LValue
15879         resolution.   We need this to propagate assign to local readonly variables
15880
15881         * typemanager.cs: Use a ptrhashtable for the criteria, because we
15882         do not want to reuse potential criteria memory.
15883
15884         * class.cs (MyEventBuilder): Set reflected_type;
15885
15886         * ecore.cs (Constantify): Added support for constifying bools.
15887
15888         (RootContext.LookupType): Added a cache for values looked up in
15889         the declaration space.
15890
15891         * typemanager.cs (FindMembers): Now is a front-end to
15892         RealFindMembers, and provides a two-level hashtable-based cache to
15893         the request.  
15894
15895         15% performance improvement: from 22.5 to 19.2 seconds.
15896
15897         * expression.cs (IsParamsMethodApplicable): use foreach.
15898         (Invocation.DoResolve): ditto.
15899         (New.DoResolve): ditto.
15900         (ArrayCreation.DoResolve): ditto.
15901
15902         * ecore.cs (FindMostEncompassingType): use foreach.
15903
15904         * delegate.cs (NewDelegate.DoResolve): Use foreach
15905
15906         * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
15907         (RemoveMethods): use foreach.
15908
15909         * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
15910         nested foreach statements instead of for, and also break out of
15911         the inner loop once a match is found.
15912
15913         (Invocation.OverloadResolve): Use foreach, simplify the code. 
15914
15915 2002-05-08  Miguel de Icaza  <miguel@ximian.com>
15916
15917         * cfold.cs (BinaryFold): During an enumeration evaluation context,
15918         we actually unwrap the expression to allow for extra information
15919         to be extracted. 
15920
15921         * expression.cs: Use Shr_Un on unsigned operations. 
15922
15923 2002-05-08  Ravi Pratap  <ravi@ximian.com>
15924
15925         * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of 
15926         applicable operators was not being considered correctly. This closes
15927         the bug Miguel reported.
15928
15929 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
15930
15931         * attribute.cs: check that the type derives from System.Attribute
15932         and report the correct error in that case (moved the duplicate code to
15933         its own method, too).
15934
15935 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
15936
15937         * attribute.cs: lookup attribute type name as the spec says: first the
15938         bare attribute name and then name + "Attribute" (nant compiles with
15939         mcs after this fix).
15940
15941 2002-05-07  Miguel de Icaza  <miguel@ximian.com>
15942
15943         * expression.cs (Unary.TryReduceNegative): Ah!  Tricky!  Tricky!
15944         Because of the way we parse things, we should try to see if a
15945         UIntConstant can fit in an integer.
15946
15947 2002-05-07  Ravi Pratap  <ravi@ximian.com>
15948
15949         * ecore.cs (GetConversionOperators): Do not pick up op_True operators
15950         when we are in an explicit context.
15951
15952         (ConvertReferenceExplicit): When converting from Iface type S to Class
15953         T make sure the rules are implemented as an OR.
15954
15955         * parameter.cs (ParameterType): Make it a property for now although the
15956         purpose really isn't anything immediate.
15957
15958         * expression.cs (Is*Applicable): Do better checking on the parameter type
15959         of a ref/out parameter. The ones from the system assemblies are already 
15960         marked with the correct type so we don't need to do any correction.
15961
15962         * ecore.cs (StandardConversionExists): Conversion from Interface types to 
15963         the object type is standard too so include that.
15964
15965 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
15966
15967         * ecore.cs (StandardConversionExists): Augment with missing code:
15968         deal with IntConstant, LongConstants and Enumerations.
15969
15970         * assign.cs: Report the error, instead of failing silently
15971
15972         * rootcontext.cs (AddGlobalAttributes): Track attributes on the
15973         typecontainer that they are declared, because the
15974         typecontainer/namespace will have the list of using clauses that
15975         need to be applied.
15976
15977         Assembly Attributes were escaping the normal registration
15978         mechanism. 
15979
15980         (EmitCode): Apply attributes within an EmitContext that represents
15981         the container they were declared on.
15982
15983         * cs-parser.jay: Track bases for structs.  How did I get this wrong?
15984
15985 2002-05-06  Ravi Pratap  <ravi@ximian.com>
15986
15987         * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
15988         Revamp completely - make much cleaner as we now operate only
15989         on a set of Types.
15990
15991         (FindMostSpecificSource, FindMostSpecificTarget): New methods
15992         to implement the logic detailed in the spec more correctly.
15993
15994         (UserDefinedConversion): Update accordingly.
15995
15996 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
15997
15998         * statement.cs: Return flow analysis information up.
15999
16000         * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
16001         and the default.
16002
16003         (token): Do not consume an extra character before calling
16004         decimal_digits.
16005
16006 2002-05-06  Piers Haken <piersh@friskit.com>
16007
16008         * cs-parser.jay: add 'override' attribute to System.Object.Finalize
16009
16010 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
16011
16012         * class.cs (Constructor.Emit): Set the IsStatic flag in the
16013         EmitContext during the instance constructor initializer
16014         resolution, to stop access to instance variables.
16015
16016         This is mandated by the spec, last paragraph of the `constructor
16017         initializers' section. 
16018
16019 2002-05-05  Miguel de Icaza  <miguel@ximian.com>
16020
16021         * cs-parser.jay, class.cs (Accessor): new class used to represent
16022         an accessor (get or set).  In the past we used `null' to represent
16023         a missing accessor.  But this is ambiguous because there was no
16024         way to tell in abstract indexers/properties if one of them was
16025         specified.
16026
16027         Now there is a way of addressing that.
16028
16029         * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
16030         instead of FindMembers.
16031
16032         * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
16033         the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
16034
16035         * attribute.cs: Treat indexers and properties as the same in terms
16036         of applying attributes
16037
16038         * ecore.cs (FindMostEncompassedType): Use statically initialized
16039         EmptyExpressions()s like we do elsewhere to avoid creating useless
16040         objects (and we take this out of the tight loop).
16041
16042         (GetConversionOperators): Move the code to extract the actual
16043         operators to a separate routine to clean things up.
16044
16045 2002-05-04  Miguel de Icaza  <miguel@ximian.com>
16046
16047         * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
16048         events are always registered FieldBuilders.
16049
16050         * class.cs (FieldBase): New class shared by Fields 
16051
16052         * delegate.cs: If we are a toplevel delegate, use our full name.
16053         If we are a nested delegate, then only use our tail name.
16054
16055 2002-05-02  Ravi Pratap  <ravi@ximian.com>
16056
16057         * expression.cs (IsApplicable): Ensure that we add the "&" to
16058         ref/out types before comparing it with the type of the argument.
16059
16060         (IsParamsMethodApplicable): Ditto.
16061
16062         (Argument.Type): Use TypeManager.LookupType instead of Type.GetType - 
16063         silly me ;-)
16064
16065         * delegate.cs : Handle the case when we have more than one applicable
16066         method. Flag an error only when we finish checking all.
16067
16068 2002-05-02  Miguel de Icaza  <miguel@ximian.com>
16069
16070         * expression.cs: Add support for boolean static initializers.
16071
16072 2002-05-01  Miguel de Icaza  <miguel@ximian.com>
16073
16074         * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
16075
16076         * parameter.cs (ComputeParameterTypes,
16077         ComputeAndDefineParameterTypes): Better error handling: now we
16078         clear the `types' cache if we fail during any of the type lookups.
16079         We also return the status code correctly to our caller
16080
16081         * delegate.cs: If we fail to define a delegate, abort the extra
16082         steps. 
16083
16084         * expression.cs (Binary.ResolveOperator): for
16085         operator==(object,object) and operator !=(object, object) we also
16086         have to verify that there is an implicit conversion from one to
16087         the other.
16088
16089         (ArrayAccess.DoResolve): Array Access can operate on
16090         non-variables. 
16091
16092 2002-04-30  Miguel de Icaza  <miguel@ximian.com>
16093
16094         * assign.cs (CompoundAssign): A new class used as a "flag" that
16095         the assignment actually is happening as part of a compound
16096         assignment operator.
16097
16098         During compound assignment, a few new rules exist to enable things
16099         like:
16100
16101         byte b |= 1 + 2
16102
16103         From the spec:
16104
16105         x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
16106         to the type of x) if y is implicitly convertible to the type of x,
16107         and the operator is a builtin operator and the return type of the
16108         operator is explicitly convertible to the type of x. 
16109
16110         * rootcontext.cs: Reset warning level to 2.  4 catches various
16111         "interesting" features in mcs, we must clean this up at some
16112         point, but currently am trying to kill other bugs ;-)
16113
16114         * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
16115         in container classes as well.  
16116
16117         * expression.cs (Binary.ResolveOperator): Handle string case
16118         before anything else (as operator overloading does emit an error
16119         before doing anything else).
16120
16121         This code could go away when we move to a table driven model, but
16122         i could not come up with a good plan last night.
16123
16124 2002-04-30  Lawrence Pit <loz@cable.a2000.nl>
16125
16126         * typemanager.cs (CSharpName): reimplementation using regex.
16127         * class.cs: added null check for fields in Emit
16128         * rootcontext.cs: set warninglevel to 4
16129
16130 2002-04-29  Miguel de Icaza  <miguel@ximian.com>
16131
16132         * typemanager.cs (CSharpName): reimplemented with Lupus
16133         suggestion.
16134
16135 2002-04-28  Miguel de Icaza  <miguel@ximian.com>
16136
16137         * statement.cs (If): correclty implement Resolve, because we were
16138         not catching sem errors in there.  The same process is needed
16139         everywhere else. 
16140         (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
16141
16142
16143         (Statement.Warning_DeadCodeFound): Factorize code.
16144         (While): Report dead code here too.
16145
16146         (Statement): Added Resolve virtual method to allow
16147         for resolution split from the emit code.
16148
16149 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
16150
16151         * statement.cs (EmitBoolExpression): No longer try to resolve the
16152         expression here.    
16153         (MakeBoolean): New utility function that resolve, implicitly
16154         converts to boolean and tags the expression. 
16155
16156
16157         (If, Do): Implement dead code elimination.
16158         (While): Implement loop inversion
16159
16160         (Do, While, For, If): Resolve the expression prior to calling our
16161         code generation.
16162
16163 2002-04-22  Lawrence Pit <loz@cable.a2000.nl>
16164
16165         * class.cs:
16166           - added method Report28 (warning: program has more than one entry point)
16167           - added method IsEntryPoint, implements paragraph 10.1 of the spec
16168           - modified method Method.Define, the part at the end of the method
16169
16170         * rootcontext.cs: added static public Location EntryPointLocation;
16171           
16172         * ../errors/cs0028.cs : Add test case for the above warning.              
16173
16174         * typemanager.cs:
16175           - modified method CSharpName to allow arrays of primitive type to
16176             be printed nicely (e.g. instead of System.Int32[][] it now prints
16177             int[][])
16178           - added method CSharpSignature: returns the signature of a method
16179             in string format to be used in reporting errors, warnings, etc.
16180
16181         * support.cs: InternalParameters.ParameterDesc variable tmp initialized
16182         with String.Empty.
16183
16184 2002-04-26  Ravi Pratap  <ravi@ximian.com>
16185
16186         * delegate.cs (Define): Fix extremely silly bug where I was
16187         setting the type of the 'object' parameter of the BeginInvoke
16188         method to System.IAsyncResult instead of System.Object ;-)
16189
16190 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
16191
16192         * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
16193         here. 
16194
16195         (Constructor.Emit): return if we fail to initialize the
16196         constructor.  Another door closed!  
16197
16198         * expression.cs (New.DoResolve): Improve error message (from -6 to
16199         1501).  Use DeclaredOnly lookup to find the exact constructor.
16200
16201         * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
16202         loop.  This is useful.
16203
16204         * cs-parser.jay: Adjust the default parameters so that destructors
16205         have the proper signature.
16206
16207 2002-04-26  Martin Baulig  <martin@gnome.org>
16208
16209         * driver.cs (LoadAssembly): If `assembly' contains any characters
16210         which are only valid in path names and not in assembly names
16211         (currently slash, backslash and point), use Assembly.LoadFrom ()
16212         instead of Assembly.Load () on the `assembly' (before iteration
16213         over the link_paths).
16214
16215 2002-04-26  Martin Baulig  <martin@gnome.org>
16216
16217         * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
16218
16219 2002-04-25  Miguel de Icaza  <miguel@ximian.com>
16220
16221         * class.cs (Property): use the new typemanager.MemberLookup
16222
16223         (TypeContainer.MemberLookup): Implement using the
16224         TypeManager.MemberLookup now. 
16225
16226         * typemanager.cs: Make MemberLookup a function of the TypeManager,
16227         and return MemberInfos, so that these can be used without an
16228         EmitContext (what we had before).
16229
16230 2002-04-24  Miguel de Icaza  <miguel@ximian.com>
16231
16232         * expression.cs: Fix the case where the argument to params if the
16233         type of the params.  I omitted handling this before.   Fixed
16234
16235 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
16236
16237         * driver.cs: Call BootCorlib_PopulateCoreType
16238
16239         * class.cs (Property.CheckBase): Check for properties only, not
16240         for all members. 
16241
16242         * interface.cs: Temporary hack: try/catch around the
16243         CustomAttributeBuilder, because I am getting an exception that I
16244         do not understand.
16245
16246         * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
16247         types whose definitions are required to be there (attributes are
16248         defined before standard types).
16249
16250         Compute definitions as we boot the various types, as they are used
16251         immediately (value_type class will need object_type, but if we do
16252         not initialize object_type, we will pass a null, which will let
16253         the runtime pick the System.Object from the existing corlib, which
16254         is not what we want).
16255
16256 2002-04-22  Patrik Torstensson <totte@labs2.com>
16257
16258         * cs-tokenizer.cs: fixed a number of trim() issues.
16259
16260 2002-04-22  Ravi Pratap  <ravi@ximian.com>
16261
16262         * expression.cs (Argument.Type): Ensure that we return the correct
16263         type when we have out or ref parameters [in which case we 
16264         append a "&"].
16265
16266 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
16267
16268         * class.cs (Property, Indexer): Allow extern modifier in there. 
16269
16270         * typemanager.cs (InitBaseTypes): Initializes object_type and
16271         value_type, since those will be used early on during the bootstrap
16272         process to compile corlib.
16273
16274         (InitCoreTypes): Move code from here to InitBaseTypes.
16275
16276 2002-04-21  Miguel de Icaza  <miguel@ximian.com>
16277
16278         * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
16279         single-dimension arrays as using the ldlen opcode.  
16280
16281         Daniel Lewis discovered this optimization.  
16282
16283         * typemanager.cs: Add signature for System.Array::get_Length
16284
16285 2002-04-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16286
16287         * statement.cs: report the error when the foreach does not apply to an
16288         array nor a collection.
16289
16290 2002-04-19  Miguel de Icaza  <miguel@ximian.com>
16291
16292         * expression.cs: Add implicit conversions to the operator ~.
16293
16294         * constant.cs (DecimalConstant.Emit): Emit decimal value.
16295
16296         * typemanager.cs: Locate the decimal constructor.
16297
16298 2002-04-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16299
16300         * attribute.cs: use the new property of TypeOf.
16301         * expression.cs: added 'get' property around typearg.
16302
16303         These changes fix a build breaker reported by NickD. Is this the
16304         correct way to fix?  If not, please, revert my changes and make it
16305         work :-).
16306
16307 2002-04-17  Miguel de Icaza  <miguel@ximian.com>
16308
16309         * attribute.cs: Add support for typeof in attribute invocations.
16310         I am not sure that this is right though.
16311
16312 2002-04-14  Duncan Mak  <duncan@ximian.com>
16313
16314         * cfold.cs (BinaryFold): Catch DivideByZeroException in the
16315         Binary.Operator.Division case.
16316
16317 2002-04-13  Ravi Pratap  <ravi@ximian.com>
16318
16319         * class.cs (DefineType): Ensure that we do a proper check on
16320         attribute types and also register it with the TypeManager.
16321
16322         (TypeContainer.Targets): The default for attribute types is
16323         AttributeTargets.All.
16324
16325         * attribute.cs (ApplyAttributes): Registering the attribute type
16326         is done elsewhere, not when we discover we have a Usage attribute.
16327
16328 2002-04-12  Ravi Pratap  <ravi@ximian.com>
16329
16330         * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
16331         and get rid of is_delegate parameter.
16332
16333         * everywhere : update.
16334
16335 2002-04-12  Ravi Pratap  <ravi@ximian.com>
16336
16337         * cs-parser.jay (compilation_unit): Revamp completely to use
16338         some new ideas that I got from Rhys' grammar to solve the problems
16339         with assembly level attributes.
16340
16341         (outer_declaration): New grammar production.
16342
16343         (attribute_sections): Add.
16344
16345         (opt_attributes): Base on attribute_sections
16346
16347         (namespace_declaration): Allow opt_attributes to tackle the case
16348         when we have assembly level attributes - we are clever in this
16349         regard now ;-)
16350
16351         * attribute.cs (ApplyAttributes): Do not worry about assembly 
16352         attributes in the non-global context.
16353
16354         * rootcontext.cs (AddGlobalAttributes): Go back to using this
16355         instead of SetGlobalAttributes.
16356
16357         * class.cs, rootcontext.cs : Ensure we define and generate 
16358         attribute types before anything else.
16359
16360         * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
16361         and flag the new error -20 for the case when the attribute type
16362         does not have valid targets specified. csc does not catch this.
16363
16364         * ../errors/errors.txt : update for error # -20
16365
16366 2002-04-11  Ravi Pratap  <ravi@ximian.com>
16367
16368         * support.cs (InternalParameters.ParameterModifier): Do some null
16369         checking and return sane values.
16370
16371         * class.cs (Method.Define): If we are a PInvoke method, ensure
16372         that we are static and extern. Report error # 601
16373
16374         * ../errors/cs0601.cs : Add test case for the above error.
16375
16376 2002-04-07  Ravi Pratap  <ravi@ximian.com>
16377
16378         * rootcontext.cs (attribute_types): We need to keep type of
16379         all attribute types separately and emit code for them first.
16380
16381         (RegisterAttribute) : Implement.
16382
16383         * class.cs (DefineType): Check if the current Type is a custom
16384         attribute type and register it accordingly.
16385
16386         * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
16387         adding the first attribute twice and rename to
16388
16389         (SetGlobalAttributes): this.
16390
16391         * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
16392         lookups.
16393
16394         * attribute.cs (ApplyAttributes): Take an additional argument telling us
16395         if we are processing global arguments. Hmm, I am unsure of this.
16396
16397 2002-04-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16398
16399         * expression.cs: added static array of strings to avoid calling
16400         Enum.ToString () for Operator in Binary. Significant recover of
16401         performance.
16402
16403 2002-04-10  Miguel de Icaza  <miguel@ximian.com>
16404
16405         * class.cs (FindMembers): Allow the Builders of the various
16406         members to be null.  If they are skip them.  This only happens
16407         during the PInvoke declaration.
16408
16409 2002-04-09  Miguel de Icaza  <miguel@ximian.com>
16410
16411         * parameter.cs (Parameters.ComputeParameterTypes): Flag the
16412         failure, so we do not keep going afterwards.
16413
16414         * expression.cs: (Invocation.OverloadResolve): I believe Ravi
16415         wanted to pass `false' as the `is_delegate' argument.  If this is
16416         the case, why not use delegate_type == null to mean `is_delegate =
16417         false' and anything else as is_delegate = true.
16418
16419 Tue Apr  9 05:40:12  2002 Piers Haken <piersh@friskit.com>
16420
16421         * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
16422         code for the section, not the beginning of the tests.
16423
16424 2002-04-08  Miguel de Icaza  <miguel@ximian.com>
16425
16426         * cfold.cs: Handle operator + (Enum x, Underlying x) 
16427
16428         * expression.cs (Binary): same.  Warn about errors where we have
16429         Enum/Enum in operator + as well.
16430
16431 Mon Apr  8 06:29:03  2002 Piers Haken <piersh@friskit.com>
16432
16433         * statement.cs:
16434                 - added support for switch(bool)
16435                 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
16436                 - add TableSwitchEmit() to handle table-based switch statements
16437
16438 2002-04-05  Ravi Pratap  <ravi@ximian.com>
16439
16440         * expression.cs (Invocation.OverloadResolve): Factor out code which
16441         does parameter compatibility checking with arguments so that we can 
16442         re-use the code even from Delegate.VerifyApplicability
16443
16444         (VerifyArgumentsCompat): Move above code here.
16445
16446         * delegate.cs (VerifyApplicability): Get rid of duplicate code
16447         and instead make a call to the above method.
16448
16449 2002-03-31  Ravi Pratap  <ravi@ximian.com>
16450
16451         * typemanager.cs (attribute_type): Corresponds to System.Attribute.
16452         We use it to keep track of classes which are attribute types.
16453
16454 2002-04-02  Miguel de Icaza  <miguel@ximian.com>
16455
16456         * delegate.cs (Delegate.Define): Correctly define the types in the
16457         presence of fixed and array parameters.
16458
16459         * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
16460         doing FindMembers.
16461
16462         * ecore.cs (Expression.MemberLookup): Reset binding flags to not
16463         include NonPublic after the first iteration.
16464
16465         * class.cs (Indexer.CheckBase): Only check if both parents are
16466         non-null. 
16467
16468         * cs-parser.jay (accessor_body): If empty, set to null.
16469
16470         * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
16471         same code path here to resolve constants names that we did have in
16472         MemberAccess.DoResolve.  There is too much code duplicated here.
16473
16474 2002-04-01  Miguel de Icaza  <miguel@ximian.com>
16475
16476         * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
16477
16478         * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
16479         to MakeUnionSet.
16480
16481         * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
16482         tokens, numbers and strings.
16483
16484         * ecore.cs (MethodGroupExpr): Make Emit warn about missing
16485         parenthesis.
16486
16487         * delegate.cs: Use ComputeAndDefineParameterTypes for both the
16488         asyncronous parameters and the regular parameters.  
16489
16490         * codegen.cs (CodeGen.Init): Use the constructor that allows us to
16491         specify the target directory.
16492
16493         * expression.cs: (This.DoResolve): Simplify
16494         (As.Emit): Optimize, do not generate IsInst if the expression is
16495         always of the given type.
16496
16497         (Is.DoResolve): Bug fix, we were reporting both always/never for
16498         the is expression.
16499
16500         * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
16501         creating too many unnecessary arrays.
16502
16503 2002-03-31  Miguel de Icaza  <miguel@ximian.com>
16504
16505         * class.cs (EmitFieldInitializer): Use Assign expression to assign
16506         fields instead of rolling our own initializer.   Takes care of all
16507         implicit conversions, and drops unnecessary static checks/argument.
16508
16509 2002-03-31  Dick Porter  <dick@ximian.com>
16510
16511         * driver.cs: use the GetDirectories() return values properly, and
16512         use "/" as path separator.
16513
16514 2002-03-30  Miguel de Icaza  <miguel@ximian.com>
16515
16516         * expression.cs (Unary): Optimize - - expr into expr.
16517         (Binary): Optimize a + (-b) into a -b.
16518
16519         * codegen.cs (CodeGen): Made all methods static.
16520
16521 2002-03-29  Miguel de Icaza  <miguel@ximian.com>
16522
16523         * rootcontext.cs: 
16524
16525         * decl.cs: Rename `definition' into `TypeBuilder' and drop the
16526         TypeBuilder property.
16527
16528         * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
16529         instead. 
16530
16531         * tree.cs: Removed the various RecordXXXX, and replaced with a
16532         single RecordDecl.  Removed all the accessor methods, and just
16533         left a single access point Type 
16534
16535         * enum.cs: Rename DefineEnum to DefineType.
16536
16537         * decl.cs: New abstract method `DefineType' used to unify the
16538         Defines for Enumerations, Interfaces, TypeContainers and
16539         Delegates.
16540
16541         (FindType): Moved LookupInterfaceOrClass here.  Moved the
16542         LookupBaseClasses method that used to live in class.cs and
16543         interface.cs here, and renamed to FindType.
16544
16545         * delegate.cs: Implement DefineType.  Take advantage of the
16546         refactored pattern for locating the parent builder without taking
16547         the parent_builder argument (which we know does not work if we are
16548         nested, and triggering a toplevel definition).
16549
16550 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
16551
16552         * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
16553         accessibility of a member has changed during override and report
16554         an error if so.
16555
16556         * class.cs (Method.Define, Property.Define): Only complain on
16557         overrides if the method is private, any other accessibility is
16558         fine (and since we just checked the permission is the same, we are
16559         good to go).
16560
16561         * cs-tokenizer.cs: only line, region, endregion, if, endif, else
16562         and elif are processed always.  The other pre-processing
16563         directives are only processed if we are "taking" the path
16564
16565 2002-03-29  Martin Baulig  <martin@gnome.org>
16566
16567         * class.cs (Method.Emit): Only emit symbolic debugging info if the
16568         current location is not Null.
16569
16570         * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
16571         a separate method so we can profile it.
16572
16573         * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
16574         `span.Seconds' are just seconds, but no minutes or hours.
16575         (MainDriver): Profile the CodeGen.SaveSymbols calls.
16576
16577 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
16578
16579         * class.cs (Method.Define), (Property.Define), (Indexer.Define):
16580         Remove the gratuitous set of Final:
16581
16582                                 // If an interface implementation, then we can set Final.
16583                                 if (((flags & MethodAttributes.Abstract) == 0) &&
16584                                     implementing.DeclaringType.IsInterface)
16585                                         flags |= MethodAttributes.Final;
16586
16587         I do not know what I was smoking when I used that.
16588
16589
16590         * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
16591         step into fixing the name resolution issues for delegates and
16592         unifying the toplevel name resolution.
16593
16594 2002-03-28  Martin Baulig  <martin@gnome.org>
16595
16596         * class.cs (Method.Emit): If we have a symbol writer, call its
16597         OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
16598         tell it about the current method.
16599
16600         * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
16601         writer that we're going to emit the first byte of IL code for a new
16602         statement (a new source line).
16603         (EmitContext.EmitTopBlock): If we have a symbol writer, call
16604         EmitContext.Mark() before emitting any code.
16605
16606         * location.cs (SymbolDocument): Return null when we're Null.
16607
16608         * statement.cs (Statement): Moved the `Location loc' variable here.
16609         (Statement.EmitBoolExpression): If we have a symbol writer, call
16610         ec.Mark() before emitting any code to tell it that we're at the
16611         beginning of a new statement.
16612         (StatementExpression): Added `Location' argument to the constructor.
16613         (Block): Added public readonly variable `StartLocation' and public
16614         variable `EndLocation'.  The latter is to be set using SetEndLocation().
16615         (Block): Added constructor which takes a start and end location.
16616         (Block.SetEndLocation): New method. This sets the end location.
16617         (Block.EmitMeta): If we have a symbol writer, tell it the names of the
16618         local variables we create.
16619         (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
16620         each statement and do also mark the begin and end of the block.
16621
16622         * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
16623         tell it the current lexer.Location, use Location.Null for the end of the
16624         block.
16625         (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
16626         current block, set its end location using SetEndLocation().
16627         (statement_expression): StatementExpression constructor now takes the
16628         lexer.Location as additional argument.
16629         (for_statement, declare_local_variables): Likewise.
16630         (declare_local_variables): When creating a new implicit block, use the
16631         new Block constructor and pass it the lexer.Location.
16632
16633 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
16634
16635         * ecore.cs (Expression.MemberLookup): On interfaces, lookup
16636         members also on the parent interfaces recursively.
16637
16638 2002-03-27  Miguel de Icaza  <miguel@ximian.com>
16639
16640         * report.cs: Use new formats, since Gonzalo finished the missing
16641         bits. 
16642
16643         * expression.cs (Binary.ResolveOperator): added missing operator|
16644         operator& and operator^ for bool/bool.
16645
16646         * cs-parser.jay: CheckDef now takes a Location argument that is
16647         used to report errors more precisly (instead of reporting the end
16648         of a definition, we try to track something which is a lot closer
16649         to the source of the problem).
16650
16651         * cs-tokenizer.cs: Track global token use, so we can properly flag
16652         the use of #define/#undef after the first token has been seen.
16653
16654         Also, rename the reportXXXX to Error_DescriptiveName
16655
16656         * decl.cs (DeclSpace.IsTopLevel): Move property here from
16657         TypeContainer, so that Enum and Interface can use this too.
16658
16659         * class.cs (TypeContainer.LookupInterfaceOrClass,
16660         GetInterfaceOrClass, GetClassBases, DefineType): Drop the
16661         `builder' argument.  Typically this was used to pass the parent
16662         builder (a ModuleBuilder or a TypeBuilder from whoever triggered
16663         the definition).  
16664
16665         The problem is that a nested class could trigger the definition of
16666         a toplevel class, and the builder would be obviously wrong in that
16667         case. 
16668
16669         So we drop this argument, and we compute dynamically the
16670         TypeBuilder/ModuleBuilder (the correct information was available
16671         to us anyways from DeclSpace.Parent)
16672
16673         * interface.cs (Interface.DefineInterface): Drop builder
16674         parameter cleanup like class.cs
16675
16676         * enum.cs (Enum.DefineEnum): Drop builder parameter.  Clean up
16677         like class.cs
16678
16679         * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
16680         values. 
16681
16682         (Try.Emit): Propagate the returns value from the statement.
16683
16684         (Return.Emit): Even if we are leavning 
16685
16686         * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
16687
16688         * modifiers.cs: Fix the computation of MethodAttributes flags.
16689
16690 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
16691
16692         * driver.cs: allow compilation of files that start with '/'.
16693         Add a default case when checking the argument of --target.
16694
16695 2002-03-25  Miguel de Icaza  <miguel@ximian.com>
16696
16697         * interface.cs: Implement the same search algorithm for types in
16698         the interface code.
16699
16700         * delegate.cs: Do not allow multiple definition.
16701
16702         * Recovered ChangeLog that got accidentally amputated
16703
16704         * interface.cs (Interface.DefineInterface): Prevent from double definitions.
16705
16706         * rootcontext.cs: Load manually enum to allow core classes to
16707         contain enumerations.
16708
16709         * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
16710         Update to new static methods in TypeManager.
16711
16712         * typemanager.cs (GetMethod, GetConstructor): Use our
16713         implementation of FindMembers to find the members, since during
16714         corlib compilation, the types are TypeBuilders and GetMethod and
16715         GetConstructor do not work.
16716
16717         Make all methods in TypeManager static.
16718
16719         (InitCodeHelpers): Split the functionality from
16720         the InitCodeTypes function.
16721
16722         * driver.cs: Call InitCodeHelpers after we have populated the
16723         types. 
16724
16725         * cs-parser.jay (delegate_declaration): we did not used to compute
16726         the delegate name correctly for void delegates.
16727
16728 2002-03-24  Miguel de Icaza  <miguel@ximian.com>
16729
16730         * rootcontext.cs (RootContext): Init the interface_resolve_order
16731         and type_container_resolve_order always.
16732
16733         (ResolveCore, BootstrapCorlib_ResolveClass,
16734         BootstrapCorlib_ResolveStruct): New functions to bootstrap the
16735         compiler when compiling with --nostdlib
16736
16737         * class.cs (TypeContainer.DefineType): Check that our parent is
16738         not null.  This test is most important when we are bootstraping
16739         the core types.
16740
16741         * codegen.cs: Split out the symbol writing code.
16742
16743 2002-03-25  Martin Baulig  <martin@gnome.org>
16744
16745         * driver.cs (-g): Made -g an alias for --debug.
16746
16747 2002-03-24  Martin Baulig  <martin@gnome.org>
16748
16749         * codegen.cs (SymbolWriter): New public variable. Returns the
16750         current symbol writer.
16751         (CodeGen): Added `bool want_debugging_support' argument to the
16752          constructor. If true, tell the ModuleBuild that we want debugging
16753         support and ask it for the ISymbolWriter.
16754         (Save): If we have a symbol writer, call it's Close() method after
16755         saving the assembly.
16756
16757         * driver.c (--debug): New command line argument to create a
16758         debugger information file.
16759
16760         * location.cs (SymbolDocument): New public property. Returns an
16761         ISymbolDocumentWriter object for the current source file or null
16762         if we don't have a symbol writer.
16763
16764 2002-03-21  Miguel de Icaza  <miguel@ximian.com>
16765
16766         * driver.cs (LoadAssembly): Correctly return when all the paths
16767         have been tried and not before.
16768
16769         * statement.cs (Switch.Emit): return the actual coverage for this
16770         statement (returns/not-returns)
16771
16772         (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
16773         switch of the statement if we are the last switch section.  That
16774         kills two problems: try/catch problems (we used to emit an empty
16775         nop at the end) and switch statements where all branches would
16776         return. 
16777
16778 2002-03-19  Miguel de Icaza  <miguel@ximian.com>
16779
16780         * driver.cs: Add default assemblies (the equivalent to the
16781         Microsoft CSC.RSP file)
16782
16783         * cs-tokenizer.cs: When updating `cols and setting it to zero,
16784         also update tokens_seen and set it to false.
16785
16786         * driver.cs: Implement --recurse for Mike.
16787
16788         * driver.cs (SplitPathAndPattern): Small bug fix, I was not
16789         correctly splitting out the paths.
16790
16791 2002-03-18  Miguel de Icaza  <miguel@ximian.com>
16792
16793         * interface.cs (Interface.PopulateProperty): Instead of using
16794         `parent' as the declaration space for the set parameters, use
16795         `this' 
16796
16797         * support.cs (InternalParameters): InternalParameters constructor
16798         takes a DeclSpace instead of a TypeContainer.
16799
16800         * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
16801         types are being initialized, load the address of it before calling
16802         the function.  
16803
16804         (New): Provide a mechanism to disable the generation of local
16805         value type temporaries when the caller will be providing us with
16806         an address to store it.
16807
16808         (ArrayCreation.EmitDynamicInitializers): Use it.
16809
16810 2002-03-17  Miguel de Icaza  <miguel@ximian.com>
16811
16812         * expression.cs (Invocation.EmitArguments): Only probe for array
16813         property if there is more than one argument.  Sorry about that.
16814
16815         * class.cs (Invocation.EmitArguments): Fix to emit arguments for
16816         empty param arrays.
16817
16818         * class.cs (Method.LabelParameters): Fix incorrect code path that
16819         prevented the `ParamArrayAttribute' from being applied to the
16820         params attribute.
16821
16822 2002-03-16  Miguel de Icaza  <miguel@ximian.com>
16823
16824         * support.cs (ReflectionParameters): Correctly compute whether the
16825         last argument is a params array.  Fixes the problem with
16826         string.Split ('a')
16827
16828         * typemanager.cs: Make the assemblies array always be non-null
16829         (empty, but non-null)
16830
16831         * tree.cs (RecordDecl): New function that abstracts the recording
16832         of names.  This reports error 101, and provides a pointer to the
16833         previous declaration.  Fixes a crash in the compiler.
16834
16835         * cs-parser.jay (constructor_declaration): Update to new grammar,
16836         and provide a constructor_body that can be empty.
16837
16838 2002-03-15  Miguel de Icaza  <miguel@ximian.com>
16839
16840         * driver.cs: Add support for --resources.
16841
16842         * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
16843         Make all types for the various array helper methods be integer.
16844
16845         * ecore.cs (Expression.ConvertNumericExplicit): Pass the
16846         CheckState to ConvCast.
16847
16848         (ConvCast): Now it takes a `checked' state argument, to avoid
16849         depending on the emit context for the conversion, and just using
16850         the resolve time setting.
16851
16852         * expression.cs (ArrayCreation.EmitArrayArguments): New function,
16853         instead of Invocation.EmitArguments.  We do not emit the original
16854         arguments, instead we emit those which have been converted to
16855         unsigned int expressions.
16856
16857         * statement.cs (Block.EmitMeta): Drop tracking of indexes.
16858
16859         * codegen.cs: ditto.
16860
16861         * expression.cs (LocalVariableReference): Drop the use of the
16862         Store function that depended on the variable index.
16863
16864         * statement.cs (VariableInfo): Drop the `Idx' property from this
16865         class, as this is not taking into account the indexes for
16866         temporaries tat we generate during the execution, getting the
16867         indexes wrong.
16868
16869         * class.cs: First emit class initializers, then call the parent
16870         constructor. 
16871
16872         * expression.cs (Binary): Fix opcode emision.
16873         (UnaryMutator.EmitCode): Support checked code generation
16874
16875         * ecore.cs (MemberLookup): TypeManager.FindMembers will return
16876         matches for events for both the Static and Instance scans,
16877         pointing to the same element.   Fix that.
16878
16879 2002-03-14  Miguel de Icaza  <miguel@ximian.com>
16880
16881         * rootcontext.cs (ResolveTree): Always set the
16882         interface_resolve_order, because nested interfaces will be calling
16883         into us.
16884
16885         * class.cs (GetInterfaceOrClass): Track the same resolution
16886         process used by TypeManager.LookupType.  This fixes the nested
16887         type lookups in class declarations (separate path from
16888         LookupType). 
16889
16890         (TypeContainer.DefineType): Also define nested interfaces.
16891         (TypeContainer.RegisterOrder): New public function used to
16892         register the order in which child interfaces need to be closed.
16893
16894         Nested interfaces need to be closed after their parents have been
16895         created. 
16896
16897         * interface.cs (InterfaceAttr): Put all the logic for computing
16898         the interface attribute here. 
16899
16900         (DefineInterface): Register our interface order with the
16901         RootContext or with the TypeContainer depending on the case.
16902
16903 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
16904
16905         * cs-parser.jay: rework foreach statement to work with the new
16906         changes to the policy on SimpleNames.
16907
16908         * report.cs: support Stacktrace on warnings as well.
16909
16910         * makefile: drop --unsafe and /unsafe from the compile.
16911
16912 2002-03-13  Ravi Pratap  <ravi@ximian.com>
16913
16914         * ecore.cs (StandardConversionExists): Modify to take an Expression
16915         as the first parameter. Ensure we do null -> reference type conversion
16916         checking.
16917
16918         * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
16919         temporary Expression objects.
16920
16921 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
16922
16923         * interface.cs: workaround bug in method overloading resolution
16924         (there is already a bugzilla bug for it).
16925
16926 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
16927
16928         We could also solve this problem by having a separate path for
16929         performing type lookups, instead of DoResolve, we could have a
16930         ResolveType entry point, and only participating pieces of the
16931         production (simplename, deref, array) would implement this. 
16932
16933         * codegen.cs (EmitContext): New field OnlyLookupTypes used to
16934         signal SimpleName to only resolve type names and not attempt to
16935         resolve anything else.
16936
16937         * expression.cs (Cast): Set the flag.
16938
16939         * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
16940
16941         * class.cs: Only report 108 if there is no `new' modifier.
16942
16943         * cs-parser.jay: rework foreach statement to work with the new
16944         changes to the policy on SimpleNames.
16945         
16946         * report.cs: support Stacktrace on warnings as well.
16947
16948         * makefile: drop --unsafe and /unsafe from the compile.
16949
16950 2002-03-11  Miguel de Icaza  <miguel@ximian.com>
16951
16952         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
16953         lookups here, instead of doing that at parse time.  This means
16954         that our grammar will not introduce `LocalVariableReferences' as
16955         expressions at this point.  That solves the problem of code like
16956         this:
16957
16958         class X {
16959            static void Main ()
16960            { int X = 1;
16961             { X x = null }}}
16962
16963         This is only half the fix.  The full fix requires parameters to
16964         also be handled in this way.
16965
16966         * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
16967         makes the use more obvious of the DeclSpace.  The
16968         ec.TypeContainer.TypeBuilder is now only used to pull the
16969         TypeBuilder for it.
16970
16971         My theory is that I can get rid of the TypeBuilder completely from
16972         the EmitContext, and have typecasts where it is used (from
16973         DeclSpace to where it matters).  
16974
16975         The only pending problem is that the code that implements Aliases
16976         is on TypeContainer, and probably should go in DeclSpace.
16977
16978         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
16979         lookups here, instead of doing that at parse time.  This means
16980         that our grammar will not introduce `LocalVariableReferences' as
16981         expressions at this point.  That solves the problem of code like
16982         this:
16983
16984         class X {
16985            static void Main ()
16986            { int X = 1;
16987             { X x = null }}}
16988
16989         This is only half the fix.  The full fix requires parameters to
16990         also be handled in this way.
16991
16992         * class.cs (Property.DefineMethod): When implementing an interface
16993         method, set newslot, when implementing an abstract method, do not
16994         set the flag (before we tried never setting it, or always setting
16995         it, which is the difference).
16996         (Indexer.DefineMethod): same.
16997         (Method.DefineMethod): same.
16998
16999         * ecore.cs: Only set the status used flag if we get back a Field.
17000
17001         * attribute.cs: Temporary hack, so Paolo can keep working.
17002
17003 2002-03-08  Ravi Pratap  <ravi@ximian.com>
17004
17005         * attribute.cs (Attribute.UnmanagedType): This is to keep track of
17006         the unmanaged type in the case we have a MarshalAs attribute.
17007
17008         (Resolve): Handle the case when we are parsing the special MarshalAs
17009         attribute [we need to store the unmanaged type to use later]
17010
17011         * typemanager.cs (marshal_as_attr_type): Built in type for the 
17012         MarshalAs Attribute.
17013
17014         * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute 
17015         on parameters and accordingly set the marshalling info.
17016
17017 2002-03-09  Miguel de Icaza  <miguel@ximian.com>
17018
17019         * class.cs: Optimizing slightly by removing redundant code after
17020         we switched to the `NoTypes' return value.
17021         (Property.DefineMethod): use NoTypes here too.
17022
17023         This fixes the bug I introduced in my last batch of changes.
17024
17025 2002-03-05  Ravi Pratap  <ravi@ximian.com>
17026
17027         * tree.cs (RecordEnum): Add. We now keep track of enums too.
17028
17029         * class.cs (LookupInterfaceOrClass): Check against the list of recorded
17030         Enums since those are types too. 
17031
17032         * cs-parser.jay (enum_declaration): Record enums as we parse them.
17033
17034         * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined 
17035         thanks to a call during the lookup process.
17036
17037 2002-03-07  Miguel de Icaza  <miguel@ximian.com>
17038
17039         * statement.cs (Foreach): Lots of work to accomodate a particular
17040         kind of foreach statement that I had not kept in mind.  It is
17041         possible to have foreachs on classes that provide a GetEnumerator
17042         method that return objects that implement the "pattern" for using
17043         a foreach, there is no need to support GetEnumerator
17044         specifically. 
17045
17046         This is needed to compile nant.
17047
17048         * decl.cs: Only report 114 if the member is not `Finalize' and if
17049         the warning level is at least 2.
17050
17051         * class.cs: Moved the compare function from Method to
17052         MethodSignature. 
17053
17054         (MethodSignature.InheritableMemberSignatureCompare): Add new
17055         filter function that is used to extract inheritable methods from a
17056         class. 
17057
17058         (Method.Define): Use the new `inheritable_method_signature_filter'
17059         delegate
17060
17061         * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
17062         command. 
17063
17064 2002-03-06  Miguel de Icaza  <miguel@ximian.com>
17065
17066         * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
17067
17068         * cs-parser.jay: Add opt_semicolon to the interface declaration.
17069
17070         * expression.cs: Pass location information to
17071         ConvertImplicitStandard. 
17072
17073         * class.cs: Added debugging code to track return values from
17074         interfaces. 
17075
17076 2002-03-05  Miguel de Icaza  <miguel@ximian.com>
17077
17078         * expression.cs (Is.DoResolve): If either side of the `is' is an
17079         interface, do not flag the warning.
17080
17081         * ecore.cs (ImplicitReferenceConversion): We need a separate test
17082         for interfaces
17083
17084         * report.cs: Allow for --fatal to be used with --probe.
17085
17086         * typemanager.cs (NoTypes): Move the definition for the empty Type
17087         array here. 
17088
17089         * class.cs (TypeContainer.FindMembers): Also look for methods defined by
17090         properties. 
17091         (TypeContainer.DefineProxy): New function used to proxy to parent
17092         implementations when implementing interfaces.
17093         (TypeContainer.ParentImplements): used to lookup if our parent
17094         implements a public function that is required by an interface.
17095         (TypeContainer.VerifyPendingMethods): Hook this up.
17096
17097         * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
17098         `modules' and `assemblies' arraylists into arrays.  We only grow
17099         these are the very early start up of the program, so this improves
17100         the speedof LookupType (nicely measured).
17101
17102         * expression.cs (MakeByteBlob): Replaced unsafe code with
17103         BitConverter, as suggested by Paolo.
17104
17105         * cfold.cs (ConstantFold.Binary): Special case: perform constant
17106         folding of string concatenation, but if either side is a string,
17107         and the other is not, then return null, and let the runtime use
17108         the concatenation on the string plus the object (using
17109         `Object.ToString'). 
17110
17111 2002-03-04  Miguel de Icaza  <miguel@ximian.com>
17112
17113         Constant Folding has been implemented now.
17114
17115         * expression.cs (Unary.Reduce): Do not throw an exception, catch
17116         the error instead on types that are not supported in one's
17117         complement. 
17118
17119         * constant.cs (Constant and all children): New set of functions to
17120         perform implict and explicit conversions.
17121
17122         * ecore.cs (EnumConstant): Implement the new functions to perform
17123         conversion by proxying to the child expression.
17124
17125         * codegen.cs: (ConstantCheckState): Constant evaluation has its
17126         own separate setting that can not be turned off from the command
17127         line using --unchecked or --checked and is only controlled using
17128         the checked/unchecked statements and expressions.  This setting is
17129         used by the constant folder to flag errors.
17130
17131         * expression.cs (CheckedExpr, UncheckedExpr): Set the
17132         ConstantCheckState as well.   
17133
17134         During Resolve, they also have to flag the state, because the
17135         constant folder runs completely in the Resolve phase.
17136
17137         * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
17138         well.
17139
17140 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
17141
17142         * cfold.cs: New file, this file contains the constant folder.
17143
17144         * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
17145         argument to track whether we are using the resulting address to
17146         load or store a value and provide better error messages. 
17147
17148         (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
17149         new AddressOf arguments.
17150
17151         * statement.cs (Foreach.EmitCollectionForeach): Update
17152
17153         * expression.cs (Argument.Emit): Call AddressOf with proper
17154         arguments to track usage.
17155
17156         (New.DoEmit): Call AddressOf with new arguments.
17157
17158         (Unary.Emit): Adjust AddressOf call.
17159
17160 2002-03-01  Ravi Pratap  <ravi@ximian.com>
17161
17162         * cs-parser.jay (member_access): Change the case for pre-defined types
17163         to use a MemberAccess instead of a SimpleName. Thanks to Felix again for 
17164         this suggestion.
17165
17166         * class.cs (Operator::Emit): If we are abstract or extern, we don't have
17167         a method body.
17168
17169         * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
17170         essentially like methods and apply attributes like MethodImplOptions to them too.
17171
17172         * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
17173         not being null.
17174
17175         * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
17176         DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
17177         is the DeclSpace.
17178
17179         * Update code everywhere accordingly.
17180
17181         * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
17182
17183         * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
17184
17185 2002-02-28  Ravi Pratap  <ravi@ximian.com>
17186
17187         * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
17188         try performing lookups against those instead of jumping straight into using
17189         the 'using' clauses.
17190
17191         (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
17192
17193         (LookupType): Perform lookups in implicit parents too.
17194
17195         * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
17196         sequence as RootContext.LookupType. 
17197
17198         * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries 
17199         the various cases of namespace lookups into this method.
17200
17201 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
17202
17203         * cs-parser.jay: Add support for [Attribute ()] (empty arguments
17204         in positional arguments)
17205
17206         * class.cs (Operator): Update the AllowedModifiers to contain
17207         extern. 
17208
17209         * cs-parser.jay: Update operator declaration to allow for the
17210         operator body to be empty.
17211
17212         * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
17213         values. 
17214
17215 2002-02-27  Miguel de Icaza  <miguel@ximian.com>
17216
17217         * class.cs (Method.Emit): Label parameters.
17218
17219         * driver.cs: Return 1 or 0 as the program exit code.
17220
17221 2002-02-26  Miguel de Icaza  <miguel@ximian.com>
17222
17223         * expression.cs: Special case the `null' object when trying to
17224         auto-compute the type, as anything can be explicitly converted to
17225         that. 
17226
17227         * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
17228         spotting this Paolo.
17229
17230         (Expression.ImplicitNumericConversion): Perform comparissions of
17231         the type using the underlying type in the case of an enumeration
17232         rather than using the enumeration type for the compare.
17233
17234         Cope with the underlying == type case, which is not possible to
17235         catch before. 
17236
17237         (Expression.ConvertNumericExplicit): Perform comparissions of
17238         the type using the underlying type in the case of an enumeration
17239         rather than using the enumeration type for the compare.
17240
17241         * driver.cs: If the user does not supply an extension, assume .exe
17242
17243         * cs-parser.jay (if_statement): Rewrote so that we can track the
17244         location for the if statement.
17245
17246         * expression.cs (Binary.ConstantFold): Only concat strings when
17247         the operation is "+", not everything ;-)
17248
17249         * statement.cs (Statement.EmitBoolExpression): Take a location
17250         argument. 
17251         (If, While, Do): Track location.
17252
17253         * expression.cs (Binary.ResolveOperator): In the object + string
17254         case, I was missing a call to ConvertImplicit
17255
17256 2002-02-25  Ravi Pratap  <ravi@ximian.com>
17257
17258         * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
17259         Location arguments. Ensure we use RootContext.LookupType to do our work
17260         and not try to do a direct Type.GetType and ModuleBuilder.GetType
17261
17262         * interface.cs (PopulateMethod): Handle the type of the parameter being
17263         null gracefully.
17264
17265         * expression.cs (Invocation.BetterFunction): Handle the case when we 
17266         have a params method with no fixed arguments and a call is made with no
17267         arguments.
17268
17269 2002-02-25  Miguel de Icaza  <miguel@ximian.com>
17270
17271         * cs-tokenizer.cs: Add support for the quote-escape-sequence in
17272         the verbatim-string-literal
17273
17274         * support.cs (InternalParameters.ParameterModifier): handle null
17275         fixed parameters.
17276         (InternalParameters.ParameterType): ditto.
17277
17278         * parameter.cs (VerifyArgs): Also check if the fixed parameter is
17279         duplicating the name of the variable parameter.
17280         (GetParameterByName): Fix bug where we were not looking up array
17281         paramters if they were the only present (thanks Paolo!).
17282         (GetParameterInfo): We only have an empty set of types if both
17283         fixed and array are set to null.
17284         (GetParameterInfo-idx): Handle FixedParameter == null
17285
17286         * cs-parser.jay: Handle the case where there is no catch
17287         statements (missing null test).
17288
17289 2002-02-22  Miguel de Icaza  <miguel@ximian.com>
17290
17291         * driver.cs (MainDriver): Be conservative on our command line
17292         handling.
17293
17294         Catch DirectoryNotFoundException when calling GetFiles.
17295
17296         (SplitPathAndPattern): Used to split the input specification into
17297         a path and a pattern that we can feed to Directory.GetFiles.
17298
17299 2002-02-21  Miguel de Icaza  <miguel@ximian.com>
17300
17301         * statement.cs (Fixed): Implement the last case of the Fixed
17302         statement (string handling).
17303
17304         * expression.cs (StringPtr): New class used to return a char * to
17305         a string;  Used by the Fixed statement.
17306
17307         * typemanager.cs: Add char_ptr_type.  Add get_OffsetToStringData method.
17308
17309         * expression.cs (Binary.ResolveOperator): Remove redundant
17310         MemberLookup pn parent type.
17311         Optimize union call, we do not need a union if the types are the same.
17312         (Unary.ResolveOperator): REmove redundant MemberLookup on parent
17313         type.
17314
17315         Specialize the use of MemberLookup everywhere, instead of using
17316         the default settings. 
17317
17318         (StackAlloc): Implement stackalloc keyword.
17319
17320         * cs-parser.jay: Add rule to parse stackalloc.
17321
17322         * driver.cs: Handle /h, /help, /?
17323
17324         * expression.cs (MakeByteBlob): Removed the hacks we had in place
17325         before we supported unsafe code.
17326
17327         * makefile: add --unsafe to the self compilation of mcs.
17328
17329 2002-02-20  Miguel de Icaza  <miguel@ximian.com>
17330
17331         * expression.cs (PointerArithmetic): New class that is used to
17332         perform pointer arithmetic.
17333         (Binary.Resolve): Handle pointer arithmetic
17334         Handle pointer comparission.
17335         (ArrayPtr): Utility expression class that is used to take the
17336         address of an array.
17337
17338         (ElementAccess): Implement array access for pointers
17339
17340         * statement.cs (Fixed): Implement fixed statement for arrays, we
17341         are missing one more case before we are done.
17342
17343         * expression.cs (Indirection): Implement EmitAssign and set the
17344         ExprClass to Variable.  This allows pointer dereferences to be
17345         treated as variables, and to have values assigned to them.
17346
17347         * ecore.cs (Expression.StoreFromPtr): New utility function to
17348         store values dereferencing.
17349
17350 2002-02-20  Ravi Pratap  <ravi@ximian.com>
17351
17352         * expression.cs (Binary.ResolveOperator): Ensure that we are
17353         not trying to operate on a void type - this fixes the reported
17354         bug.
17355
17356         * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
17357         the parent implementation is sealed.
17358
17359         * ../errors/cs0239.cs : Add.
17360
17361         * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
17362
17363         * typemanager.cs (unverifiable_code_type): Corresponds to 
17364         System.Security.UnverifiableCodeAttribute. We need to emit this for modules
17365         which have unsafe code in them.
17366
17367         * rootcontext.cs (EmitCode): Emit the above attribute when we are in an 
17368         unsafe context.
17369
17370 2002-02-19  Miguel de Icaza  <miguel@ximian.com>
17371
17372         * cs-tokenizer.cs: Add support for @"litreal strings"
17373
17374         Make tokenizer accept pre-processor directives
17375         on any column (remove the old C-like limitation). 
17376
17377         * rootcontext.cs (EmitCode): Emit any global attributes.
17378         (AddGlobalAttributes): Used to keep track of assembly attributes. 
17379
17380         * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
17381
17382         * cs-parser.jay: Add support for global attributes.  
17383
17384 2002-02-17  Miguel de Icaza  <miguel@ximian.com>
17385
17386         * expression.cs (Indirection): New helper class.  Unary will
17387         create Indirection classes to be able to implement the
17388         IMemoryLocation interface on it.
17389
17390 2002-02-16  Miguel de Icaza  <miguel@ximian.com>
17391
17392         * cs-parser.jay (fixed_statement): reference the right statement.
17393
17394         * statement.cs (Fixed.Emit): Finish implementing the fixed
17395         statement for the &x case.
17396
17397 2002-02-14  Miguel de Icaza  <miguel@ximian.com>
17398
17399         * class.cs (Property.Define, Method.Define): Remove newslot when
17400         `implementing'.  
17401
17402         * modifiers.cs: My use of NewSlot when `Abstract' was set was
17403         wrong.  NewSlot should only be used if the `new' keyword is present.
17404
17405         * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
17406         locating our system dir.  Sorry about this.
17407
17408 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
17409
17410         * driver.cs (GetSystemDir): Compute correctly the location of our
17411         system assemblies.  I was using the compiler directory instead of
17412         the library directory.
17413
17414 2002-02-13  Ravi Pratap  <ravi@ximian.com>
17415
17416         * expression.cs (BetterFunction): Put back in what Miguel commented out
17417         since it is the correct fix. The problem is elsewhere ;-)
17418
17419         (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
17420         parameters of the parms method are themselves compatible or not !
17421
17422         (StandardConversionExists): Fix very dangerous bug where we were forgetting
17423         to check that a class implements an interface before saying that an implicit
17424         conversion was allowed. Use ImplementsInterface to do the checking.
17425
17426 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
17427
17428         * class.cs (Method.Define): Track whether we are an explicit
17429         implementation or not.  And only call DefineMethodOverride if we
17430         are an explicit implementation.
17431
17432         (Property.DefineMethod): Ditto.
17433
17434 2002-02-11  Ravi Pratap  <ravi@ximian.com>
17435
17436         * expression.cs (BetterFunction): Catch hideous bug which was
17437          preventing us from detecting ambiguous calls due to implicit casts i.e
17438         cs0121.
17439
17440 2002-01-29  Miguel de Icaza  <miguel@ximian.com>
17441
17442         * support.cs (Pair): Remove un-needed method.  I figured why I was
17443         getting the error in cs-parser.jay, the variable in a foreach loop
17444         is readonly, and the compiler does not really treat this as a variable.
17445
17446         * cs-parser.jay (fixed_statement): Fix grammar.  Use ASSIGN
17447         instead of EQUALS in grammar.  
17448
17449         * typemanager.cs (VerifyUnmanaged): Report correct error (208)
17450
17451         * expression.cs (Unary.DoResolve): Check whether the argument is
17452         managed or not.
17453
17454 2002-01-28  Miguel de Icaza  <miguel@ximian.com>
17455
17456         * support.cs: Api for Pair to set a value.  Despite the fact that
17457         the variables are public the MS C# compiler refuses to compile
17458         code that accesses the field if the variable is part of a foreach
17459         statement. 
17460
17461         * statement.cs (Fixed): Begin implementation of the fixed
17462         statement.
17463
17464         (Block.AddVariable): Return the VariableInfo on success and null
17465         on failure instead of true/false. 
17466
17467         * cs-parser.jay (foreach): Catch errors on variables already
17468         defined (we were ignoring this value before) and properly unwind
17469         the block hierarchy
17470
17471         (fixed_statement): grammar for the fixed statement.
17472
17473 2002-01-25  Miguel de Icaza  <miguel@ximian.com>
17474
17475         * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
17476         pointer types to be incretemented.
17477
17478         (SizeOf): Implement.
17479
17480         * cs-parser.jay (pointer_member_access): Implement
17481         expr->IDENTIFIER production.
17482
17483         * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
17484         MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
17485         on safe contexts.
17486
17487         (Unary): Implement indirection.
17488
17489         * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
17490         use in non-unsafe context).
17491
17492         (SimpleName.DoResolve): Check for pointers in field access on safe
17493         contexts. 
17494
17495         (Expression.LoadFromPtr): Factor the load-indirect code in this
17496         function.  This was duplicated in UnboxCast and ParameterReference
17497
17498 2002-01-24  Miguel de Icaza  <miguel@ximian.com>
17499
17500         * expression.cs (ComposedCast): report an error if a pointer cast
17501         is used in a safe region.
17502
17503         * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
17504         pointer type casts in unsafe context.
17505
17506         * codegen.cs (EmitContext): Set up IsUnsafe.
17507
17508         * cs-parser.jay (non_expression_type): Add productions for pointer
17509         casts. 
17510
17511         * expression.cs (Invocation.EmitCall): Remove chunk of buggy
17512         code.  We should not use force into static mode if the method is
17513         not virtual.  Fixes bug in MIS
17514
17515         * statement.cs (Do.Emit, While.Emit, For.Emit,
17516         Statement.EmitBoolExpression): Add support to Do and While to
17517         propagate infinite loop as `I do return' semantics.
17518
17519         Improve the For case to also test for boolean constants.
17520
17521         * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
17522         to the list of attributes we can add.
17523
17524         Remove `EmitContext' argument.
17525
17526         * class.cs (Method.Define): Apply parameter attributes.
17527         (Constructor.Define): Apply parameter attributes.
17528         (MethodCore.LabelParameters): Move here the core of labeling
17529         parameters. 
17530
17531         * support.cs (ReflectionParameters.ParameterModifier,
17532         InternalParameters.ParameterModifier): Use IsByRef on the type and
17533         only return the OUT bit for these parameters instead of in/out/ref
17534         flags.
17535
17536         This is because I miss-understood things.  The ParameterInfo.IsIn
17537         and IsOut represent whether the parameter has the [In] and [Out]
17538         attributes set.  
17539
17540 2002-01-22  Miguel de Icaza  <miguel@ximian.com>
17541
17542         * ecore.cs (FieldExpr.Emit): Release temporaries.
17543
17544         * assign.cs (LocalTemporary.Release): new function.
17545
17546         * codegen.cs (EmitContext.GetTemporaryStorage,
17547         EmitContext.FreeTemporaryStorage): Rework the way we deal with
17548         temporary storage.  Now we can "put back" localbuilders when we
17549         are done with them
17550
17551 2002-01-21  Miguel de Icaza  <miguel@ximian.com>
17552
17553         * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
17554         need to make a copy of the variable to generate verifiable code.
17555
17556 2002-01-19  Miguel de Icaza  <miguel@ximian.com>
17557
17558         * driver.cs: Compute dynamically the system directory.
17559
17560         * ecore.cs (CopyNewMethods): reworked, exposed, made public.
17561         Slower, but more generally useful.  Used by the abstract
17562         registering implementation. 
17563
17564         * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
17565         the rules for the special rule on Type/instances.  First check if
17566         we have the same name, and if so, try that special static path
17567         rather than the instance path.
17568
17569 2002-01-18  Miguel de Icaza  <miguel@ximian.com>
17570
17571         * cs-parser.jay: Emit 642 (warning: possible empty statement) for
17572         for, while and if.
17573
17574         * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
17575         Enum, ValueType, Delegate or Array for non-corlib compiles.
17576
17577         * cs-tokenizer.cs: Catch long identifiers (645)
17578
17579         * typemanager.cs (IndexerPropetyName): Ravi never tested this
17580         piece of code.
17581
17582         * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
17583         fix, we were returning too early, so we were not registering
17584         pending methods from abstract classes.
17585
17586         Do not register pending methods if the class is abstract.
17587
17588         * expression.cs (Conditional.DoResolve): Report circular implicit
17589         conversions when we neecd to compute it for conditional
17590         expressions. 
17591
17592         (Is.DoResolve): If the expression is always of the provided type,
17593         flag warning 183.  If the expression can not ever be of the
17594         provided type flag warning 184.
17595
17596         * class.cs: Catch 169 as well.
17597
17598         * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
17599         read. 
17600
17601 2002-01-18  Nick Drochak  <ndrochak@gol.com>
17602
17603         * makefile: remove path to beta2 csc.exe.  path to csc.exe must be in PATH instead.
17604
17605 2002-01-17  Miguel de Icaza  <miguel@ximian.com>
17606
17607         * interface.cs: (PopulateMethod): Check for pointers being defined
17608         only if the unsafe context is active.
17609         (PopulateProperty): ditto.
17610         (PopulateIndexer): ditto.
17611
17612         * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
17613         specified.  If pointers are present, make sure that they are
17614         present in an unsafe context.
17615         (Constructor, Constructor.Define): ditto.
17616         (Field, Field.Define): ditto.
17617         (Property, Property.Define): ditto.
17618         (Event, Event.Define): ditto.
17619
17620         * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
17621         hashtable if there are classes or structs defined.
17622
17623         * expression.cs (LocalVariableReference.DoResolve): Simplify this
17624         code, as the constant resolution moved.
17625
17626         * statement.cs (Block.EmitMeta): Resolve all constants as we emit
17627         the metadata, so we can flag error 133. 
17628
17629         * decl.cs (MemberCore.UnsafeOK): New function to test that a
17630         pointer is being declared in an unsafe context.
17631
17632 2002-01-16  Miguel de Icaza  <miguel@ximian.com>
17633
17634         * modifiers.cs (Modifiers.Check): Require a Location argument.
17635         Report error 227 for Unsafe use.
17636
17637         * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
17638
17639         * statement.cs (For.Emit): If the test is null, then report that
17640         we do `return', as we wont reach anything afterwards.
17641
17642         (Switch.SwitchGoverningType): Track the expression that matched
17643         the conversion.
17644
17645         * driver.cs: Allow negative numbers as an error code to flag.
17646
17647         * cs-parser.jay: Handle 1551.
17648
17649         * namespace.cs: Add 1537 checking (repeated using alias namespaces).
17650
17651 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
17652
17653         * cs-parser.jay: Report 1518 (type declaration can only contain
17654         class, struct, interface, enum or delegate)
17655
17656         (switch_label): Report 1523 (keywords `case' or `default' must
17657         preced code)
17658
17659         (opt_switch_sections): Report 1522 (empty switch)
17660
17661         * driver.cs: Report 1515 (response file specified multiple times)
17662         Report 1516 (Source file specified multiple times).
17663
17664         * expression.cs (Argument.Resolve): Signal 1510
17665
17666         (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
17667         access not allowed in static code)
17668
17669 2002-01-11  Ravi Pratap  <ravi@ximian.com>
17670
17671         * typemanager.cs (IsPointerType): Utility method which we are going
17672         to need a lot.
17673
17674         * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
17675         the object type, so we take care of that.
17676
17677         * expression.cs (FullMethodDesc): Also include the return type in descriptions.
17678
17679         * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
17680         added to non-params parameters :-)
17681
17682         * typemanager.cs (CSharpName): Include 'void' type too. 
17683
17684         (void_ptr_type): Include in the set of core types.
17685
17686         * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of 
17687         duplicating code.
17688
17689         (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have 
17690         an unsafe context.
17691
17692         * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had 
17693         completely forgotten about it.
17694
17695 2002-01-10  Ravi Pratap  <ravi@ximian.com>
17696
17697         * cs-parser.jay (pointer_type): Add. This begins our implementation
17698         of parsing rules for unsafe code.
17699
17700         (unsafe_statement): Implement.
17701
17702         (embedded_statement): Modify to include the above.
17703
17704         * statement.cs (Unsafe): Implement new class for unsafe blocks.
17705
17706         * codegen.cs (EmitContext.InUnsafe): Add. This determines
17707         if the current context is an unsafe one.
17708
17709         * cs-parser.jay (local_variable_pointer_type): Since local variable types
17710         are handled differently, we need separate rules for them.
17711
17712         (local_variable_declaration): Update to use local_variable_pointer_type
17713         to allow variable declarations of unmanaged pointer types.
17714
17715         * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
17716         in unsafe contexts.
17717
17718         * ../errors/cs0214.cs : Add.
17719
17720 2002-01-16  Nick Drochak  <ndrochak@gol.com>
17721
17722         * makefile: remove 'response' file when cleaning.
17723
17724 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
17725
17726         * cs-parser.jay: Report 1524.
17727
17728 2002-01-14  Miguel de Icaza  <miguel@ximian.com>
17729
17730         * typemanager.cs (RegisterMethod): drop checking if we have
17731         registered this from here
17732
17733 2002-01-12  Miguel de Icaza  <miguel@ximian.com>
17734
17735         * class.cs (Method.EmitDestructor): Implement calling our base
17736         destructor. 
17737
17738         * statement.cs (Try.Emit): Fix to reset the InFinally to the old
17739         value of InFinally.
17740
17741         * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
17742         this routine and will wrap the call in a try/catch block.  Deal
17743         with the case.
17744
17745 2002-01-11  Miguel de Icaza  <miguel@ximian.com>
17746
17747         * ecore.cs (Expression.MemberLookup): instead of taking a
17748         parameter `same_type' that was used to tell whether we could
17749         access private members we compute our containing type from the
17750         EmitContext.
17751
17752         (FieldExpr): Added partial support for volatile fields.  This does
17753         not work for volatile fields exposed from assemblies, as I can not
17754         figure out how to extract the modreq from it.
17755
17756         Updated all the source files to use this.
17757
17758         * codegen.cs (EmitContext): Compute ContainerType ahead of time,
17759         because it is referenced by MemberLookup very often. 
17760
17761 2002-01-09  Ravi Pratap  <ravi@ximian.com>
17762
17763         * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
17764         TypeBuilder.GetCustomAttributes to retrieve what we need.
17765
17766         Get rid of redundant default_member_attr_type as this is the same as
17767         default_member_type which already exists.
17768
17769         * interface.cs, attribute.cs : Update accordingly.
17770
17771 2002-01-08  Miguel de Icaza  <miguel@ximian.com>
17772
17773         * typemanager.cs: Enable IndexerPropertyName again.  It does not
17774         work for TYpeBuilders though.  Ravi, can you please fix this?
17775
17776         * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
17777
17778         * expression.cs (Argument.Emit): Handle the case of ref objects
17779         being passed to ref functions;  
17780
17781         (ParameterReference.EmitLoad): Loads the content of the pointer
17782         without dereferencing.
17783
17784 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
17785
17786         * cs-tokenizer.cs: Implemented the pre-processing expressions.
17787
17788 2002-01-08  Ravi Pratap  <ravi@ximian.com>
17789
17790         * class.cs (Indexer.DefineMethod): Incorporate the interface
17791         type in the name of the method if we are doing explicit interface
17792         implementation.
17793
17794         * expression.cs (ConversionExists): Remove as it is completely obsolete.
17795
17796         (BetterConversion): Fix extremely trivial bug where we were referring to
17797         ConversionExists instead of StandardConversionExists ! Hooray, things are fine
17798         again !
17799
17800         * ../errors/bug16.cs : Add although we have fixed it.
17801
17802 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
17803
17804         * expression.cs (BaseIndexer): Begin implementation.
17805
17806         * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
17807
17808         * cs-parser.jay (indexer_declarator): Use qualified_identifier
17809         production directly to remove a shift/reduce, and implement
17810         explicit interface implementation.
17811
17812         * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
17813         after a floating point suffix.
17814
17815         * expression.cs (DoNumericPromotions): Improved the conversion for
17816         uint/uint.  If we have a constant, we avoid doing a typecast to a
17817         larger type.
17818
17819         * class.cs (Indexer): Implement explicit interface implementation
17820         for indexers.
17821
17822 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
17823
17824         * class.cs: make the default instance constructor public and hidebysig.
17825
17826 2001-01-03  Ravi Pratap  <ravi@ximian.com>
17827
17828         * interface.cs (EmitDefaultMemberAttr): Make this helper method static
17829         so we can call it from elsewhere.
17830
17831         * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
17832         we emit it internally if the class has a defined indexer; otherwise the user
17833         emits it by decorating the class definition with the DefaultMemberAttribute.
17834
17835         * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
17836         attribute is not used on a type which defines an indexer.
17837
17838         * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
17839         character when we skip whitespace.
17840
17841         * ../errors/cs0646.cs : Add.
17842
17843 2002-01-03  Miguel de Icaza  <miguel@ximian.com>
17844
17845         * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
17846         again. 
17847
17848         * makefile: Add practical target `mcs3.exe' which builds the third
17849         generation compiler. 
17850
17851         * expression.cs (New): Fix structures constructor calling.
17852
17853         * class.cs (Property, Method, Indexer): Emit Final flag on the
17854         method if we are an interface implementation and we are not
17855         abstract. 
17856
17857         * ecore.cs (PropertyExpr): New public field `IsBase', tells
17858         whether this property is referencing a `base' method.
17859
17860         * expression.cs (Invocation.EmitCall): take an extra argument:
17861         is_base, this is used to determine whether the `call' or
17862         `callvirt' opcode should be used.
17863
17864
17865         * delegate.cs: update EmitCall.
17866
17867         * class.cs (Method.Define): Set NewSlot for the cases where we are
17868         not implementing an interface method.
17869
17870         (Property.Define): ditto.
17871
17872 2002-01-02  Miguel de Icaza  <miguel@ximian.com>
17873
17874         * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
17875         'r'.  Allows mcs to parse itself fully.
17876
17877 2002-01-02  Ravi Pratap  <ravi@ximian.com>
17878
17879         * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
17880         of the number of initializers that require the InitializeArray method.
17881
17882         (CheckIndices): Store the Expression in all cases - not the plain value. Also
17883         update the above field where necessary.
17884
17885         (MakeByteBlob): Update accordingly.
17886
17887         (DoEmit): Call EmitStaticInitializers only if the number of initializers is 
17888         greater than 2.
17889
17890         (EmitDynamicInitializers): Update in accordance with the new optimization.
17891
17892         (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
17893         same OpCode applies.
17894
17895         * cs-parser.jay : Fix some glaring errors I introduced.
17896
17897 2002-01-01  Ravi Pratap  <ravi@ximian.com> 
17898
17899         * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
17900         so that we can check for name clashes there too.
17901
17902         * typemanager.cs (default_member_attr_type): The attribute that we need to emit
17903         for interface indexers.
17904
17905         * interfaces.cs (Define): Emit the default member attribute.
17906
17907         * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
17908         variable was being referred to while setting the value ;-)
17909
17910 2002-01-01  Miguel de Icaza  <miguel@ximian.com>
17911
17912         * expression.cs (MakeByteBlob): Optimize: we do not need to fill
17913         byte-by-byte information when we know the data is zero.
17914
17915         Make the block always a multiple of 4, because
17916         DefineInitializedData has a bug.
17917
17918         * assign.cs: Fix, we should assign from the temporary, not from
17919         the source. 
17920
17921         * expression.cs (MakeByteBlob): Fix my incorrect code.
17922
17923 2001-12-31  Miguel de Icaza  <miguel@ximian.com>
17924
17925         * typemanager.cs (EnumToUnderlying): This function is used to get
17926         the underlying type from an enumeration, because it does not
17927         always work. 
17928
17929         * constant.cs: Use the I4_S form for values between -128 and 127.
17930
17931         * statement.cs (Block.LookupLabel): Looks up a label.
17932         (Block): Drop support for labeled blocks.
17933
17934         (LabeledStatement): New kind of statement that represents a label
17935         only.
17936
17937         (Goto): Finally implement this bad boy.
17938
17939         * cs-parser.jay: Update to reflect new mechanism to implement
17940         labels.
17941
17942 2001-12-30  Miguel de Icaza  <miguel@ximian.com>
17943
17944         * codegen.cs (EmitContext.This): a codegen property that keeps the
17945         a single instance of this instead of creating many different this
17946         instances. 
17947
17948         * delegate.cs (Delegate.DoResolve): Update to use the property;
17949
17950         * ecore.cs (SimpleName.SimpleNameResolve): Ditto
17951
17952         * expression.cs (BaseAccess.DoResolve): Ditto.
17953
17954 2001-12-29  Ravi Pratap  <ravi@ximian.com>
17955
17956         * typemanager.cs (methodimpl_attr_type): Add to hold the type
17957         corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
17958
17959         (InitCoreTypes): Update accordingly.
17960
17961         * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
17962         so we can quickly store the state.
17963
17964         (ApplyAttributes): Set the correct implementation flags
17965         for InternalCall methods.
17966
17967 2001-12-29  Miguel de Icaza  <miguel@ximian.com>
17968
17969         * expression.cs (EmitCall): if a method is not virtual, then do
17970         not use callvirt on it.
17971
17972         (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
17973         user defined stuff) requires the use of stobj, which takes an
17974         address on the stack instead of an array and an index.  So emit
17975         the Ldelema operation for it.
17976
17977         (EmitStoreOpcode): Use stobj for valuetypes.
17978
17979         (UnaryMutator.EmitCode): Use the right 1 value depending on
17980         whether we are dealing with int64/uint64, float or doubles.
17981
17982         * class.cs (TypeContainer.AddConstructor): Fix the logic to define
17983         constructors that I implemented last night.
17984
17985         (Constructor.IsDefault): Fix to work properly for static
17986         constructors.
17987
17988         * cs-parser.jay (CheckDef): report method signature errors.
17989         Update error number 103 to be 132.
17990
17991         * decl.cs: New AdditionResult enumeration value: MethodExists.
17992         Although we do this check for methods later on in the semantic
17993         analysis, catching repeated default constructors is so easy that
17994         we catch these here. 
17995
17996         * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
17997         promotions code.
17998
17999         (ParameterReference.EmitAssign, Emit): handle
18000         bools as bytes.
18001
18002         (ArrayAccess.EmitLoadOpcode): Handle bool type here.
18003         (ArrayAccess.EmitStoreOpcode): ditto.
18004
18005         * cs-tokenizer.cs (is_punct): Eliminated empty computation.
18006
18007         * expression.cs (MakeByteBlob): Complete all the missing types
18008         (uint, short, ushort, byte, sbyte)
18009
18010         * class.cs: Only init instance field initializers on instance
18011         constructors. 
18012
18013         Rename `constructors' to instance_constructors. 
18014
18015         (TypeContainer.AddConstructor): Only add constructors to the list
18016         if it is not static.
18017
18018         Make sure that we handle default_static_constructor independently
18019         everywhere where we handle instance_constructors
18020
18021 2001-12-28  Miguel de Icaza  <miguel@ximian.com>
18022
18023         * class.cs: Do not lookup or create a base initializer for a
18024         static constructor.
18025
18026         (ConstructorInitializer.Resolve): use the proper type to lookup
18027         for constructors.
18028
18029         * cs-parser.jay: Report error 1585 (modifiers between type and name).
18030
18031         * enum.cs, interface.cs: Remove CloseType, this is taken care by
18032         in DeclSpace. 
18033
18034         * decl.cs: CloseType is now an virtual method, the default
18035         implementation just closes this type.
18036
18037 2001-12-28  Ravi Pratap  <ravi@ximian.com>
18038
18039         * attribute.cs (DefinePInvokeMethod): Set the implementation flags
18040         to PreserveSig by default. Also emit HideBySig on such methods.
18041
18042         Basically, set the defaults to standard values.
18043
18044         * expression.cs (Invocation.BetterFunction): We need to make sure that for each
18045         argument, if candidate is better, it can't be worse than the best !
18046
18047         (Invocation): Re-write bits to differentiate between methods being
18048         applicable in their expanded form and their normal form - for params
18049         methods of course.
18050
18051         Get rid of use_standard everywhere as only standard conversions are allowed
18052         in overload resolution. 
18053
18054         More spec conformance.
18055
18056 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
18057
18058         * driver.cs: Add --timestamp, to see where the compiler spends
18059         most of its time.
18060
18061         * ecore.cs (SimpleName.DoResolve): Do not create an implicit
18062         `this' in static code.
18063
18064         (SimpleName.DoResolve): Implement in terms of a helper function
18065         that allows static-references to be passed upstream to
18066         MemberAccess.
18067
18068         (Expression.ResolveWithSimpleName): Resolve specially simple
18069         names when called by MemberAccess to implement the special
18070         semantics. 
18071
18072         (Expression.ImplicitReferenceConversion): Handle conversions from
18073         Null to reference types before others, as Null's type is
18074         System.Object. 
18075
18076         * expression.cs (Invocation.EmitCall): Handle the special case of
18077         calling methods declared on a reference type from a ValueType
18078         (Base classes System.Object and System.Enum)
18079
18080         (MemberAccess.Resolve): Only perform lookups on Enumerations if
18081         the left hand side is a TypeExpr, not on every enumeration. 
18082
18083         (Binary.Resolve): If types are reference types, then do a cast to
18084         object on operators != and == of both arguments.
18085
18086         * typemanager.cs (FindMembers): Extract instance and static
18087         members if requested.
18088
18089         * interface.cs (PopulateProperty): Use void_type instead of null
18090         as the return type for the setter method.
18091
18092         (PopulateIndexer): ditto.
18093
18094 2001-12-27  Ravi Pratap  <ravi@ximian.com>
18095
18096         * support.cs (ReflectionParameters): Fix minor bug where we
18097         were examining the wrong parameter for the ParamArray attribute.
18098
18099         Cope with requests for the type of the parameter at position
18100         greater than the params parameter's. We now return the element
18101         type of the params array as that makes more sense.
18102
18103         * expression.cs (Invocation.IsParamsMethodApplicable): Update 
18104         accordingly as we no longer have to extract the element type
18105         ourselves.
18106
18107         (Invocation.OverloadResolve): Update.
18108
18109 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
18110
18111         * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
18112         against IEnumerator, test whether the return value is a descendant
18113         of the IEnumerator interface.
18114
18115         * class.cs (Indexer.Define): Use an auxiliary method to implement
18116         the other bits of the method definition.  Begin support for
18117         explicit interface implementation.
18118
18119         (Property.DefineMethod): Use TypeManager.void_type instead of null
18120         for an empty return value.
18121
18122 2001-12-26  Miguel de Icaza  <miguel@ximian.com>
18123
18124         * expression.cs (MemberAccess.ResolveMemberAccess): if we are
18125         dealing with a FieldExpr which is composed of a FieldBuilder, in
18126         the code path we did extract the constant, but we should have
18127         obtained the underlying value to be able to cast it (otherwise we
18128         end up in an infinite loop, this is what Ravi was running into).
18129
18130         (ArrayCreation.UpdateIndices): Arrays might be empty.
18131
18132         (MemberAccess.ResolveMemberAccess): Add support for section
18133         14.5.4.1 that deals with the special case of E.I when E is a type
18134         and something else, that I can be a reference to a static member.
18135
18136         (ArrayCreation.MakeByteBlob): It is not an error to not be able to
18137         handle a particular array type to create byte blobs, it is just
18138         something we dont generate byteblobs for.
18139
18140         * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
18141         arguments. 
18142
18143         * location.cs (Push): remove the key from the hashtable that we
18144         are about to add.   This happens for empty files.
18145
18146         * driver.cs: Dispose files after we have parsed them.
18147
18148         (tokenize): new function that only runs the tokenizer on its
18149         input, for speed testing.
18150
18151 2001-12-26  Ravi Pratap  <ravi@ximian.com>
18152
18153         * class.cs (Event.Define): Define the private field only if there
18154         are no accessors defined.
18155
18156         * expression.cs (ResolveMemberAccess): If there is no associated
18157         field with the event, that means we have an event defined with its
18158         own accessors and we should flag error cs0070 since transforming
18159         ourselves into a field is not valid in that case.
18160
18161         * ecore.cs (SimpleName.DoResolve): Same as above.
18162
18163         * attribute.cs (DefinePInvokeMethod): Set the default calling convention
18164         and charset to sane values.
18165
18166 2001-12-25  Ravi Pratap  <ravi@ximian.com>
18167
18168         * assign.cs (DoResolve): Perform check on events only if they 
18169         are being accessed outside the declaring type.
18170
18171         * cs-parser.jay (event_declarations): Update rules to correctly
18172         set the type of the implicit parameter etc.
18173
18174         (add_accessor, remove_accessor): Set current local parameters.
18175
18176         * expression.cs (Binary): For delegate addition and subtraction,
18177         cast the return value from the method into the appropriate delegate
18178         type.
18179
18180 2001-12-24  Ravi Pratap  <ravi@ximian.com>
18181
18182         * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
18183         of these as the workaround is unnecessary.
18184
18185         * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
18186         delegate data - none of that is needed at all.
18187
18188         Re-write bits to extract the instance expression and the delegate method
18189         correctly.
18190
18191         * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator 
18192         on delegates too.
18193
18194         * attribute.cs (ApplyAttributes): New method to take care of common tasks
18195         of attaching attributes instead of duplicating code everywhere.
18196
18197         * everywhere : Update code to do attribute emission using the above method.
18198
18199 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
18200
18201         * expression.cs (IsParamsMethodApplicable): if there are not
18202         parameters, return immediately.
18203
18204         * ecore.cs: The 0 literal can be implicity converted to an enum
18205         type. 
18206
18207         (SimpleName.DoResolve): First lookup the type, then lookup the
18208         members. 
18209
18210         (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
18211         want to get its address.  If the InstanceExpression is not
18212         addressable, store the result in a temporary variable, then get
18213         the address of it.
18214
18215         * codegen.cs: Only display 219 errors on warning level or above. 
18216
18217         * expression.cs (ArrayAccess): Make it implement the
18218         IMemoryLocation interface.
18219
18220         (Binary.DoResolve): handle the operator == (object a, object b)
18221         and operator != (object a, object b) without incurring into a
18222         BoxedCast (because 5 != o should never be performed).
18223
18224         Handle binary enumerator operators.
18225
18226         (EmitLoadOpcode): Use Ldelema if the object we are loading is a
18227         value type, otherwise use Ldelem_ref.
18228
18229         Use precomputed names;
18230
18231         (AddressOf): Implement address of
18232
18233         * cs-parser.jay (labeled_statement): Fix recursive block
18234         addition by reworking the production.
18235
18236         * expression.cs (New.DoEmit): New has a special case:
18237                 
18238                  If we are dealing with a ValueType, we have a few
18239                  situations to deal with:
18240                 
18241                     * The target of New is a ValueType variable, that is
18242                       easy, we just pass this as the variable reference
18243                 
18244                     * The target of New is being passed as an argument,
18245                       to a boxing operation or a function that takes a
18246                       ValueType.
18247                 
18248                       In this case, we need to create a temporary variable
18249                       that is the argument of New.
18250
18251
18252 2001-12-23  Ravi Pratap  <ravi@ximian.com>
18253
18254         * rootcontext.cs (LookupType): Check that current_type is not null before
18255         going about looking at nested types.
18256
18257         * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
18258         not implement the IAssignMethod interface any more.
18259
18260         * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
18261         where we tranform them into FieldExprs if they are being resolved from within
18262         the declaring type.
18263
18264         * ecore.cs (SimpleName.DoResolve): Do the same here.
18265
18266         * assign.cs (DoResolve, Emit): Clean up code considerably. 
18267
18268         * ../errors/bug10.cs : Add.
18269
18270         * ../errors/cs0070.cs : Add.
18271
18272         * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
18273
18274         * assign.cs : Get rid of EventIsLocal everywhere.
18275
18276 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
18277
18278         * ecore.cs (ConvertIntLiteral): finished the implementation.
18279
18280         * statement.cs (SwitchLabel): Convert the value we are using as a
18281         key before looking up the table.
18282
18283 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
18284
18285         * codegen.cs (EmitTopBlock): Require a Location argument now.
18286
18287         * cs-parser.jay (constructor_declarator): We need to setup
18288         current_local_parameters before we parse the
18289         opt_constructor_initializer, to allow the variables to be bound
18290         to the constructor arguments.
18291
18292         * rootcontext.cs (LookupType): First lookup nested classes in our
18293         class and our parents before we go looking outside our class.
18294
18295         * expression.cs (ConstantFold): Extract/debox the values at the
18296         beginnning. 
18297
18298         * rootcontext.cs (EmitCode): Resolve the constants first before we
18299         resolve the types.  This is not really needed, but it helps debugging.
18300
18301         * statement.cs: report location.
18302
18303         * cs-parser.jay: pass location to throw statement.
18304
18305         * driver.cs: Small bug fix.
18306
18307         * report.cs: Updated format to be 4-zero filled digits.
18308
18309 2001-12-22  Ravi Pratap  <ravi@ximian.com>
18310
18311         * expression.cs (CheckIndices): Fix minor bug where the wrong
18312         variable was being referred to ;-)
18313
18314         (DoEmit): Do not call EmitStaticInitializers when the 
18315         underlying type is System.Object.
18316
18317 2001-12-21  Ravi Pratap  <ravi@ximian.com>
18318
18319         * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
18320         and do the usual workaround for SRE.
18321
18322         * class.cs (MyEventBuilder.EventType): New member to get at the type
18323         of the event, quickly.
18324
18325         * expression.cs (Binary.ResolveOperator): Handle delegate addition.
18326
18327         * assign.cs (Assign.DoResolve): Handle the case when the target
18328         is an EventExpr and perform the necessary checks.
18329
18330         * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
18331         interface.
18332
18333         (SimpleName.MemberStaticCheck): Include check for EventExpr.
18334
18335         (EventExpr): Set the type in the constructor itself since we 
18336         are meant to be born fully resolved.
18337
18338         (EventExpr.Define): Revert code I wrote earlier.
18339                 
18340         * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
18341         instance expression is null. The instance expression is a This in that case
18342         or a null, depending on whether it is a static method or not.
18343
18344         Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
18345         refers to more than one method.
18346
18347         * assign.cs (DoResolve): Check whether the event belongs to the same Type container
18348         and accordingly flag errors.
18349
18350 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
18351
18352         * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
18353
18354 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
18355
18356         * location.cs (ToString): Provide useful rutine.
18357
18358 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
18359
18360         * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
18361         objects, return the actual integral boxed.
18362
18363         * statement.cs (SwitchLabel): define an ILLabel for each
18364         SwitchLabel. 
18365
18366         (Switch.CheckSwitch): If the value is a Literal, extract
18367         the underlying literal.
18368
18369         Also in the unused hashtable we had, add the SwitchLabel so we can
18370         quickly look this value up.
18371
18372         * constant.cs: Implement a bunch of new constants.  Rewrite
18373         Literal based on this.  Made changes everywhere to adapt to this.
18374
18375         * expression.cs (Expression.MakeByteBlob): Optimize routine by
18376         dereferencing array only once, and also copes with enumrations.
18377
18378         bytes are two bytes wide, not one.
18379
18380         (Cast): Perform constant conversions.
18381
18382         * ecore.cs (TryImplicitIntConversion): Return literals instead of
18383         wrappers to the literals here.
18384
18385         * expression.cs (DoNumericPromotions): long literals can converted
18386         to ulong implicity (this is taken care of elsewhere, but I was
18387         missing this spot).
18388
18389         * ecore.cs (Expression.Literalize): Make the return type Literal,
18390         to improve type checking.
18391
18392         * rootcontext.cs: Lookup for nested classes in our class hierarchy.
18393
18394 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
18395
18396         * literal.cs: Revert code from ravi that checked the bounds.  The
18397         bounds are sane by the definition of the type itself. 
18398
18399         * typemanager.cs: Fix implementation of ImplementsInterface.  We
18400         need to actually look up in our parent hierarchy for interfaces
18401         implemented. 
18402
18403         * const.cs: Use the underlying type for enumerations
18404
18405         * delegate.cs: Compute the basename for the delegate creation,
18406         that should fix the delegate test case, and restore the correct
18407         Type Lookup semantics in rootcontext
18408
18409         * rootcontext.cs: Revert Ravi's last patch.  The correct way of
18410         referencing a nested type with the Reflection API is using the "+"
18411         sign. 
18412
18413         * cs-parser.jay: Do not require EOF token at the end.
18414
18415 2001-12-20  Ravi Pratap  <ravi@ximian.com>
18416
18417         * rootcontext.cs (LookupType): Concatenate type names with
18418         a '.' instead of a '+' The test suite passes again.
18419
18420         * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
18421         field of the enumeration.
18422
18423         * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
18424         the case when the member is an EventExpr.
18425
18426         * ecore.cs (EventExpr.InstanceExpression): Every event which is not
18427         static has an associated instance expression.
18428
18429         * typemanager.cs (RegisterEvent): The usual workaround, now for events.
18430
18431         (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
18432
18433         * class.cs (Event.Define): Register event and perform appropriate checks
18434         for error #111.
18435
18436         We define the Add and Remove methods even if the use provides none because
18437         in that case, we provide default implementations ourselves.
18438
18439         Define a private field of the type of the event. This is done by the CSC compiler
18440         and we should be doing it too ;-)
18441
18442         * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
18443         More methods we use in code we generate.
18444
18445         (multicast_delegate_type, delegate_type): Two separate types since the distinction
18446         is important.
18447
18448         (InitCoreTypes): Update accordingly for the above.
18449
18450         * class.cs (Event.Emit): Generate code for default accessors that we provide
18451
18452         (EmitDefaultMethod): Do the job in the above.
18453
18454         * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the 
18455         appropriate place.
18456
18457 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
18458
18459         * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
18460         builders even if we were missing one.
18461
18462         * interface.cs, class.cs, enum.cs: When calling DefineNestedType
18463         pass the Basename as our class name instead of the Name.  The
18464         basename will be correctly composed for us.
18465
18466         * parameter.cs (Paramters): Now takes a Location argument.
18467
18468         * decl.cs (DeclSpace.LookupType): Removed convenience function and
18469         make all the code call directly LookupType in RootContext and take
18470         this chance to pass the Location information everywhere.
18471
18472         * Everywhere: pass Location information.
18473
18474 2001-12-19  Miguel de Icaza  <miguel@ximian.com>
18475
18476         * class.cs (Constructor.Define): Updated way of detecting the
18477         length of the parameters.
18478
18479         (TypeContainer.DefineType): Use basename as the type name for
18480         nested types.
18481
18482         (TypeContainer.Define): Do not recursively define types here, as
18483         definition is taken care in order by the RootContext.
18484
18485         * tree.cs: Keep track of namespaces in a per-file basis.
18486
18487         * parameter.cs (Parameter.ComputeSignature): Update to use
18488         DeclSpace. 
18489
18490         (Parameters.GetSignature): ditto.
18491
18492         * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
18493         instead of a TypeContainer.
18494
18495         (Interface.SemanticAnalysis): Use `this' instead of our parent to
18496         resolve names.  Because we need to be resolve in our context, not
18497         our parents.
18498
18499         * driver.cs: Implement response files.
18500
18501         * class.cs (TypeContainer.DefineType): If we are defined, do not
18502         redefine ourselves.
18503
18504         (Event.Emit): Emit the code for add/remove handlers.
18505         (Event.Define): Save the MethodBuilders for add/remove.
18506
18507         * typemanager.cs: Use pair here too.
18508
18509         * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
18510         DictionaryEntry requires the first argument to be non-null.  
18511
18512         (enum_declaration): Compute full name for registering the
18513         enumeration.
18514
18515         (delegate_declaration): Instead of using
18516         formal_parameter_list, use opt_formal_parameter_list as the list
18517         can be empty.
18518
18519         * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
18520         (EventParsing): New property that controls whether `add' and
18521         `remove' are returned as tokens or identifiers (for events);
18522
18523 2001-12-19  Ravi Pratap  <ravi@ximian.com>
18524
18525         * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
18526         use MyEventBuilder only and let it wrap the real builder for us.
18527
18528         (MyEventBuilder): Revamp constructor etc.
18529
18530         Implement all operations that we perform on EventBuilder in precisely the same
18531         way here too.
18532
18533         (FindMembers): Update to use the EventBuilder member.
18534
18535         (Event.Emit): Update accordingly.
18536
18537 2001-12-18  Ravi Pratap  <ravi@ximian.com>
18538
18539         * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
18540         by calling the appropriate methods.
18541
18542         (GetCustomAttributes): Make stubs as they cannot possibly do anything
18543         useful.
18544
18545         (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
18546
18547 2001-12-17  Ravi Pratap  <ravi@ximian.com>
18548
18549         * delegate.cs (Delegate.Populate): Check that the return type
18550         and various parameters types are indeed accessible.
18551
18552         * class.cs (Constructor.Define): Same here.
18553
18554         (Field.Define): Ditto.
18555
18556         (Event.Define): Ditto.
18557
18558         (Operator.Define): Check that the underlying Method defined itself
18559         correctly - so it's MethodBuilder should not be null.
18560
18561         * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
18562         expression happens to be null.
18563
18564         * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
18565         members but as of now we don't seem to be able to do anything really useful with it.
18566
18567         (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
18568         not the EventBuilder.
18569
18570 2001-12-18  Miguel de Icaza  <miguel@ximian.com>
18571
18572         * cs-tokenizer.cs: Add support for defines.
18573         Add support for #if, #elif, #else, #endif
18574
18575         (eval_var): evaluates a variable.
18576         (eval): stubbed for evaluating functions.
18577
18578         * cs-parser.jay: Pass the defines information
18579
18580         * driver.cs: Add --define command line option.
18581
18582         * decl.cs: Move MemberCore here.
18583
18584         Make it the base class for DeclSpace.  This allows us to catch and
18585         report 108 and 109 for everything now.
18586
18587         * class.cs (TypeContainer.Define): Extract all the members
18588         before populating and emit the warning 108 (new keyword required
18589         to override) instead of having each member implement this.
18590
18591         (MemberCore.Define): New abstract method, we will be using this in
18592         the warning reporting engine in Populate.
18593
18594         (Operator.Define): Adjust to new MemberCore protocol. 
18595
18596         * const.cs (Const): This does not derive from Expression, it is a
18597         temporary object we use to create fields, it is a MemberCore. 
18598
18599         * class.cs (Method.Define): Allow the entry point to be in a
18600         specific class.
18601
18602         * driver.cs: Rewrite the argument handler to clean it up a bit.
18603
18604         * rootcontext.cs: Made it just an auxiliary namespace feature by
18605         making everything static.
18606
18607         * driver.cs: Adapt code to use RootContext type name instead of
18608         instance variable.
18609
18610         * delegate.cs: Remove RootContext argument.
18611
18612         * class.cs: (Struct, TypeContainer, Class): Remove RootContext
18613         argument. 
18614
18615         * class.cs (Event.Define): The lookup can fail.
18616
18617         * cs-tokenizer.cs: Begin implementation of pre-procesor. 
18618
18619         * expression.cs: Resolve the this instance before invoking the code.
18620
18621 2001-12-17  Miguel de Icaza  <miguel@ximian.com>
18622
18623         * cs-parser.jay: Add a production in element_access that allows
18624         the thing to become a "type" reference.  This way we can parse
18625         things like "(string [])" as a type.
18626
18627         Note that this still does not handle the more complex rules of
18628         casts. 
18629
18630
18631         * delegate.cs (Delegate.Populate): Register the delegage constructor builder here. 
18632
18633         * ecore.cs: (CopyNewMethods): new utility function used to
18634         assemble the list of methods from running FindMembers.
18635
18636         (MemberLookup): Rework FindMembers so that 
18637
18638 2001-12-16  Miguel de Icaza  <miguel@ximian.com>
18639
18640         * class.cs (TypeContainer): Remove Delegates who fail to be
18641         defined.
18642
18643         * delegate.cs (Populate): Verify that we dont get null return
18644         values.   TODO: Check for AsAccessible.
18645
18646         * cs-parser.jay: Use basename to emit error 574 (destructor should
18647         have the same name as container class), not the full name.
18648
18649         * cs-tokenizer.cs (adjust_int): Fit the integer in the best
18650         possible representation.  
18651
18652         Also implements integer type suffixes U and L.
18653
18654 2001-12-15  Miguel de Icaza  <miguel@ximian.com>
18655
18656         * expression.cs (ArrayCreation.DoResolve): We need to do the
18657         argument resolution *always*.
18658
18659         * decl.cs: Make this hold the namespace.  Hold the root context as
18660         well.
18661         (LookupType): Move here.
18662
18663         * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
18664
18665         * location.cs (Row, Name): Fixed the code, it was always returning
18666         references to the first file.
18667
18668         * interface.cs: Register properties defined through interfaces.
18669
18670         * driver.cs: Add support for globbing on the command line
18671
18672         * class.cs (Field): Make it derive from MemberCore as well.
18673         (Event): ditto.
18674
18675 2001-12-15  Ravi Pratap  <ravi@ximian.com>
18676
18677         * class.cs (Event::Define): Check that the type of the event is a delegate
18678         type else flag error #66.
18679
18680         Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
18681         same.
18682
18683         * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
18684         values of EntryPoint, CharSet etc etc.
18685
18686         Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
18687
18688         * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
18689         be null and we should ignore this. I am not sure if this is really clean. Apparently,
18690         there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
18691         which needs this to do its work.
18692
18693         * ../errors/cs0066.cs : Add.
18694
18695 2001-12-14  Miguel de Icaza  <miguel@ximian.com>
18696
18697         * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
18698         helper functions.
18699
18700         * class.cs: (MethodSignature.MethodSignature): Removed hack that
18701         clears out the parameters field.
18702         (MemberSignatureCompare): Cleanup
18703
18704         (MemberCore): New base class used to share code between MethodCore
18705         and Property.
18706
18707         (RegisterRequiredImplementations) BindingFlags.Public requires
18708         either BindingFlags.Instace or Static.  Use instance here.
18709
18710         (Property): Refactored code to cope better with the full spec.
18711
18712         * parameter.cs (GetParameterInfo): Return an empty array instead
18713         of null on error.
18714
18715         * class.cs (Property): Abstract or extern properties have no bodies.
18716
18717         * parameter.cs (GetParameterInfo): return a zero-sized array.
18718
18719         * class.cs (TypeContainer.MethodModifiersValid): Move all the
18720         method modifier validation to the typecontainer so we can reuse
18721         this on properties.
18722
18723         (MethodCore.ParameterTypes): return an empty sized array of types.
18724
18725         (Property.Define): Test property modifier validity.
18726
18727         Add tests for sealed/override too.
18728
18729         (Method.Emit): abstract or extern methods have no bodies.
18730
18731 2001-12-14  Ravi Pratap  <ravi@ximian.com>
18732
18733         * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
18734         thing.
18735
18736         (Method::Define, ::Emit): Modify accordingly.
18737
18738         * expression.cs (Invocation::OverloadResolve): Handle error # 121.
18739
18740         (ArrayCreation::MakeByteBlob): Handle floats and doubles.
18741
18742         * makefile: Pass in /unsafe.
18743
18744 2001-12-13  Miguel de Icaza  <miguel@ximian.com>
18745
18746         * class.cs (MakeKey): Kill routine.
18747
18748         * class.cs (TypeContainer.Define): Correctly define explicit
18749         method implementations (they require the full interface name plus
18750         the method name).
18751
18752         * typemanager.cs: Deply the PtrHashtable here and stop using the
18753         lame keys.  Things work so much better.
18754
18755         This of course broke everyone who depended on `RegisterMethod' to
18756         do the `test for existance' test.  This has to be done elsewhere.
18757
18758         * support.cs (PtrHashtable): A hashtable that avoid comparing with
18759         the object stupid Equals method (because, that like fails all over
18760         the place).  We still do not use it.
18761
18762         * class.cs (TypeContainer.SetRequiredInterface,
18763         TypeContainer.RequireMethods): Killed these two routines and moved
18764         all the functionality to RegisterRequiredImplementations.
18765
18766         (TypeContainer.RegisterRequiredImplementations): This routine now
18767         registers all the implementations required in an array for the
18768         interfaces and abstract methods.  We use an array of structures
18769         which can be computed ahead of time to reduce memory usage and we
18770         also assume that lookups are cheap as most classes will not
18771         implement too many interfaces.
18772
18773         We also avoid creating too many MethodSignatures.
18774
18775         (TypeContainer.IsInterfaceMethod): Update and optionally does not
18776         clear the "pending" bit if we find that there are problems with
18777         the declaration.
18778
18779         (TypeContainer.VerifyPendingMethods): Update to report errors of
18780         methods that look like implementations but are not.
18781
18782         (TypeContainer.Define): Add support for explicit interface method
18783         implementation. 
18784
18785 2001-12-12  Miguel de Icaza  <miguel@ximian.com>
18786
18787         * typemanager.cs: Keep track of the parameters here instead of
18788         being a feature of the TypeContainer.
18789
18790         * class.cs: Drop the registration of parameters here, as
18791         InterfaceMethods are also interface declarations.
18792
18793         * delegate.cs: Register methods with the TypeManager not only with
18794         the TypeContainer.  This code was buggy.
18795
18796         * interface.cs: Full registation here.
18797
18798 2001-12-11  Miguel de Icaza  <miguel@ximian.com>
18799
18800         * expression.cs: Remove reducer for binary expressions, it can not
18801         be done this way.
18802
18803         * const.cs: Put here the code that used to go into constant.cs
18804
18805         * constant.cs: Put here the code for constants, this is a new base
18806         class for Literals.
18807
18808         * literal.cs: Make Literal derive from Constant.
18809
18810 2001-12-09  Miguel de Icaza  <miguel@ximian.com>
18811
18812         * statement.cs (Return.Emit): Report error 157 if the user
18813         attempts to return from a finally block.
18814
18815         (Return.Emit): Instead of emitting a return, jump to the end of
18816         the function.
18817
18818         * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
18819         LocalBuilder to store the result of the function.  ReturnLabel is
18820         the target where we jump.
18821
18822
18823 2001-12-09  Radek Doulik  <rodo@ximian.com>
18824
18825         * cs-parser.jay: remember alias in current namespace
18826
18827         * ecore.cs (SimpleName::DoResolve): use aliases for types or
18828         namespaces
18829
18830         * class.cs (LookupAlias): lookup alias in my_namespace
18831
18832         * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
18833         aliases hashtable
18834         (LookupAlias): lookup alias in this and if needed in parent
18835         namespaces
18836
18837 2001-12-08  Miguel de Icaza  <miguel@ximian.com>
18838
18839         * support.cs: 
18840
18841         * rootcontext.cs: (ModuleBuilder) Made static, first step into
18842         making things static.  I need this to avoid passing the
18843         TypeContainer when calling ParameterType.
18844
18845         * support.cs (InternalParameters.ParameterType): Remove ugly hack
18846         that did string manipulation to compute the type and then call
18847         GetType.  Use Parameter.ParameterType instead.
18848
18849         * cs-tokenizer.cs: Consume the suffix for floating values.
18850
18851         * expression.cs (ParameterReference): figure out whether this is a
18852         reference parameter or not.  Kill an extra variable by computing
18853         the arg_idx during emission.
18854
18855         * parameter.cs (Parameters.GetParameterInfo): New overloaded
18856         function that returns whether a parameter is an out/ref value or not.
18857
18858         (Parameter.ParameterType): The type of the parameter (base,
18859         without ref/out applied).
18860
18861         (Parameter.Resolve): Perform resolution here.
18862         (Parameter.ExternalType): The full type (with ref/out applied).
18863
18864         * statement.cs (Using.Emit, Using.EmitExpression): Implement
18865         support for expressions on the using statement.
18866
18867 2001-12-07  Miguel de Icaza  <miguel@ximian.com>
18868
18869         * statement.cs (Using.EmitLocalVariableDecls): Split the
18870         localvariable handling of the using statement.
18871
18872         (Block.EmitMeta): Keep track of variable count across blocks.  We
18873         were reusing slots on separate branches of blocks.
18874
18875         (Try.Emit): Emit the general code block, we were not emitting it. 
18876
18877         Check the type of the declaration to be an IDisposable or
18878         something that can be implicity converted to it. 
18879
18880         Emit conversions if required.
18881
18882         * ecore.cs (EmptyExpression): New utility class.
18883         (Expression.ImplicitConversionExists): New utility function.
18884
18885 2001-12-06  Miguel de Icaza  <miguel@ximian.com>
18886
18887         * statement.cs (Using): Implement.
18888
18889         * expression.cs (LocalVariableReference): Support read only variables.
18890
18891         * statement.cs: Remove the explicit emit for the Leave opcode.
18892         (VariableInfo): Add a readonly field.
18893
18894 2001-12-05  Miguel de Icaza  <miguel@ximian.com>
18895
18896         * ecore.cs (ConvCast): new class used to encapsulate the various
18897         explicit integer conversions that works in both checked and
18898         unchecked contexts.
18899
18900         (Expression.ConvertNumericExplicit): Use new ConvCast class to
18901         properly generate the overflow opcodes.
18902
18903 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
18904
18905         * statement.cs: The correct type for the EmptyExpression is the
18906         element_type, not the variable type.  Ravi pointed this out.
18907
18908 2001-12-04  Ravi Pratap  <ravi@ximian.com>
18909
18910         * class.cs (Method::Define): Handle PInvoke methods specially
18911         by using DefinePInvokeMethod instead of the usual one.
18912
18913         * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
18914         above to do the task of extracting information and defining the method.
18915
18916 2001-12-04  Ravi Pratap  <ravi@ximian.com>
18917
18918         * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
18919         of the condition for string type.
18920
18921         (Emit): Move that here. 
18922
18923         (ArrayCreation::CheckIndices): Keep string literals in their expression
18924         form.
18925
18926         (EmitDynamicInitializers): Handle strings appropriately.
18927
18928 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
18929
18930         * codegen.cs (EmitContext): Replace multiple variables with a
18931         single pointer to the current Switch statement.
18932
18933         * statement.cs (GotoDefault, Switch): Adjust to cleaned up
18934         EmitContext.
18935
18936 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
18937
18938         * statement.cs 
18939
18940         * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
18941         default'.
18942
18943         (Foreach.Emit): Foreach on arrays was not setting
18944         up the loop variables (for break/continue).
18945
18946         (GotoCase): Semi-implented.
18947
18948 2001-12-03  Ravi Pratap  <ravi@ximian.com>
18949
18950         * attribute.cs (CheckAttribute): Handle system attributes by using
18951         Attribute.GetAttributes to examine information we need.
18952
18953         (GetValidPlaces): Same here.
18954
18955         * class.cs (Method::Define): Catch invalid use of extern and abstract together.
18956
18957         * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
18958
18959         * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
18960
18961         (Method::Define): Set appropriate flags if we have a DllImport attribute.
18962
18963         (Method::Emit): Handle the case when we are a PInvoke method.
18964
18965 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
18966
18967         * expression.cs: Use ResolveWithSimpleName on compound names.
18968
18969 2001-12-02  Ravi Pratap  <ravi@ximian.com>
18970
18971         * constant.cs (EmitConstant): Make sure we resolve the associated expression
18972         before trying to reduce it.
18973
18974         * typemanager.cs (RegisterConstant, LookupConstant): Implement.
18975
18976         * constant.cs (LookupConstantValue): Implement.
18977
18978         (EmitConstant): Use the above in emitting the constant.
18979
18980         * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
18981         that are user-defined by doing a LookupConstantValue on them.
18982
18983         (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
18984         too, like above.
18985
18986 2001-11-29  Miguel de Icaza  <miguel@ximian.com>
18987
18988         * expression.cs (BaseAccess, BaseIndexer): Also split this out.
18989
18990         (BaseAccess.DoResolve): Implement.
18991
18992         (MemberAccess.DoResolve): Split this routine into a
18993         ResolveMemberAccess routine that can be used independently
18994
18995 2001-11-28  Miguel de Icaza  <miguel@ximian.com>
18996
18997         * expression.cs (Probe, Is, As): Split Probe in two classes Is and
18998         As that share bits of the implementation.  Is returns a boolean,
18999         while As returns the Type that is being probed.
19000
19001 2001-12-01  Ravi Pratap  <ravi@ximian.com>
19002
19003         * enum.cs (LookupEnumValue): Re-write various bits, return an object value
19004         instead of a Literal - much easier.
19005
19006         (EnumInTransit): Remove - utterly useless :-)
19007
19008         (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
19009
19010         * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
19011
19012         * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
19013         chain when we have no associated expression.
19014
19015 2001-11-30  Ravi Pratap  <ravi@ximian.com>
19016
19017         * constant.cs (Define): Use Location while reporting the errror.
19018
19019         Also emit a warning when 'new' is used and there is no inherited
19020         member to hide.
19021
19022         * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being 
19023         populated.
19024
19025         (LookupEnumValue): Implement to lookup an enum member's value and define it
19026         if necessary.
19027
19028         (Populate): Re-write accordingly to use the above routine.
19029
19030 2001-11-27  Miguel de Icaza  <miguel@ximian.com>
19031
19032         * expression.cs (This): Fix prototype for DoResolveLValue to
19033         override the base class DoResolveLValue.
19034
19035         * cs-parser.cs: Report errors cs574 and cs575 (destructor
19036         declarations) 
19037
19038         * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
19039         (we need to load the address of the field here).  This fixes
19040         test-22. 
19041
19042         (FieldExpr.DoResolveLValue): Call the DoResolve
19043         function to initialize the Instance expression.
19044
19045         * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
19046         correctly the GetEnumerator operation on a value type.
19047
19048         * cs-parser.jay: Add more simple parsing error catches.
19049
19050         * statement.cs (Switch): Add support for string switches.
19051         Handle null specially.
19052
19053         * literal.cs (NullLiteral): Make NullLiteral objects singletons. 
19054
19055 2001-11-28  Ravi Pratap  <ravi@ximian.com>
19056
19057         * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
19058
19059         (declare_local_constant): New helper function.
19060
19061         * statement.cs (AddConstant): Keep a separate record of constants
19062
19063         (IsConstant): Implement to determine if a variable is a constant.
19064
19065         (GetConstantExpression): Implement.
19066
19067         * expression.cs (LocalVariableReference): Handle the case when it is a constant.
19068
19069         * statement.cs (IsVariableDefined): Re-write.
19070
19071 2001-11-27  Ravi Pratap  <ravi@ximian.com>
19072
19073         * class.cs (TypeContainer::FindMembers): Look for constants
19074         in the case when we are looking for MemberTypes.Field
19075
19076         * expression.cs (MemberAccess::DoResolve): Check that in the
19077         case we are a FieldExpr and a Literal, we are not being accessed
19078         by an instance reference.
19079
19080         * cs-parser.jay (local_constant_declaration): Implement.
19081
19082         (declaration_statement): Implement for constant declarations.
19083
19084 2001-11-26  Miguel de Icaza  <miguel@ximian.com>
19085
19086         * statement.cs (Switch): Catch double defaults.
19087
19088         (Switch): More work on the switch() statement
19089         implementation.  It works for integral values now, need to finish
19090         string support.
19091
19092
19093 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
19094
19095         * ecore.cs (Expression.ConvertIntLiteral): New function to convert
19096         integer literals into other integer literals.  To be used by
19097         switch. 
19098
19099 2001-11-24  Ravi Pratap  <ravi@ximian.com>
19100
19101         * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
19102         some memory.
19103
19104         (EmitDynamicInitializers): Cope with the above since we extract data
19105         directly from ArrayData now.
19106
19107         (ExpectInitializers): Keep track of whether initializers are mandatory
19108         or not.
19109
19110         (Bounds): Make it a hashtable to prevent the same dimension being 
19111         recorded for every element in that dimension.
19112
19113         (EmitDynamicInitializers): Fix bug which prevented the Set array method
19114         from being found.
19115
19116         Also fix bug which was causing the indices to be emitted in the reverse
19117         order.
19118
19119 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
19120
19121         * expression.cs (ArrayCreation): Implement the bits that Ravi left
19122         unfinished.  They do not work, because the underlying code is
19123         sloppy.
19124
19125 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
19126
19127         * cs-parser.jay: Remove bogus fixme.
19128
19129         * statement.cs (Switch, SwitchSection, SwithLabel): Started work
19130         on Switch statement.
19131
19132 2001-11-23  Ravi Pratap  <ravi@ximian.com>
19133
19134         * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
19135         the same. 
19136
19137         * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
19138         parameter. Apparently, any expression is allowed. 
19139
19140         (ValidateInitializers): Update accordingly.
19141
19142         (CheckIndices): Fix some tricky bugs thanks to recursion.
19143
19144         * delegate.cs (NewDelegate::DoResolve): Re-write large portions as 
19145         I was being completely brain-dead.
19146
19147         (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
19148         and re-write acordingly.
19149
19150         (DelegateInvocation): Re-write accordingly.
19151
19152         * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
19153
19154         (MakeByteBlob): Handle types more correctly.
19155
19156         * expression.cs (ArrayCreation:Emit): Write preliminary code to do
19157         initialization from expressions but it is incomplete because I am a complete
19158         Dodo :-|
19159
19160 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
19161
19162         * statement.cs (If.Emit): Fix a bug that generated incorrect code
19163         on If.  Basically, we have to return `true' (ie, we do return to
19164         our caller) only if both branches of the if return.
19165
19166         * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
19167         short-circuit operators, handle them as short circuit operators. 
19168
19169         (Cast.DoResolve): Resolve type.
19170         (Cast.Cast): Take an expression as the target type.
19171
19172         * cs-parser.jay (cast_expression): Remove old hack that only
19173         allowed a limited set of types to be handled.  Now we take a
19174         unary_expression and we resolve to a type during semantic
19175         analysis.
19176
19177         Use the grammar productions from Rhys to handle casts (this is
19178         not complete like Rhys syntax yet, we fail to handle that corner
19179         case that C# has regarding (-x), but we will get there.
19180
19181 2001-11-22  Ravi Pratap  <ravi@ximian.com>
19182
19183         * class.cs (EmitFieldInitializer): Take care of the case when we have a
19184         field which is an array type.
19185
19186         * cs-parser.jay (declare_local_variables): Support array initialization too.
19187
19188         * typemanager.cs (MakeKey): Implement.
19189
19190         (everywhere): Use the above appropriately.
19191
19192         * cs-parser.jay (for_statement): Update for array initialization while
19193         declaring variables.
19194
19195         * ecore.cs : The error message was correct, it's the variable's names that
19196         were misleading ;-) Make the code more readable.
19197
19198         (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
19199         the correct type etc.
19200
19201         (ConvertExplicit): Handle Enum types by examining the underlying type.
19202
19203 2001-11-21  Ravi Pratap  <ravi@ximian.com>
19204
19205         * parameter.cs (GetCallingConvention): Always return
19206         CallingConventions.Standard for now.
19207
19208 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
19209
19210         * expression.cs (Binary.ResolveOperator): Update the values of `l'
19211         and `r' after calling DoNumericPromotions.
19212
19213         * ecore.cs: Fix error message (the types were in the wrong order).
19214
19215         * statement.cs (Foreach.ProbeCollectionType): Need to pass
19216         BindingFlags.Instance as well 
19217
19218         * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
19219         implicit int literal conversion in an empty cast so that we
19220         propagate the right type upstream.
19221
19222         (UnboxCast): new class used to unbox value types.
19223         (Expression.ConvertExplicit): Add explicit type conversions done
19224         by unboxing.
19225
19226         (Expression.ImplicitNumericConversion): Oops, forgot to test for
19227         the target type before applying the implicit LongLiterals to ULong
19228         literal cast.
19229
19230 2001-11-21  Miguel de Icaza  <miguel@ximian.com>
19231
19232         * cs-parser.jay (for_statement): Reworked the way For works: now
19233         we declare manually any variables that are introduced in
19234         for_initializer to solve the problem of having out-of-band code
19235         emition (that is what got for broken).
19236
19237         (declaration_statement): Perform the actual variable declaration
19238         that used to be done in local_variable_declaration here.
19239
19240         (local_variable_declaration): Do not declare anything, just pass
19241         the information on a DictionaryEntry
19242
19243 2001-11-20  Ravi Pratap  <ravi@ximian.com>
19244
19245         * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
19246         re-write of the logic to now make it recursive.
19247
19248         (UpdateIndices): Re-write accordingly.
19249
19250         Store element data in a separate ArrayData list in the above methods.
19251
19252         (MakeByteBlob): Implement to dump the array data into a byte array.
19253
19254 2001-11-19  Ravi Pratap  <ravi@ximian.com>
19255
19256         * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
19257         into CheckIndices.
19258
19259         * constant.cs (Define): Implement.
19260
19261         (EmitConstant): Re-write fully.
19262
19263         Pass in location info.
19264
19265         * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
19266         respectively.
19267
19268         * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
19269         DictionaryEntry since we need location info too.
19270
19271         (constant_declaration): Update accordingly.
19272
19273         * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
19274         code into another method : UpdateIndices.
19275
19276 2001-11-18  Ravi Pratap  <ravi@ximian.com>
19277
19278         * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
19279         some type checking etc.
19280
19281 2001-11-17  Ravi Pratap  <ravi@ximian.com>
19282
19283         * expression.cs (ArrayCreation::ValidateInitializers): Implement
19284         bits to provide dimension info if the user skips doing that.
19285
19286         Update second constructor to store the rank correctly.
19287
19288 2001-11-16  Ravi Pratap  <ravi@ximian.com>
19289
19290         * expression.cs (ArrayCreation::ValidateInitializers): Poke around
19291         and try to implement.
19292
19293         * ../errors/cs0150.cs : Add.
19294
19295         * ../errors/cs0178.cs : Add.
19296
19297 2001-11-16  Miguel de Icaza  <miguel@ximian.com>
19298
19299         * statement.cs: Implement foreach on multi-dimensional arrays. 
19300
19301         * parameter.cs (Parameters.GetParameterByName): Also lookup the
19302         name of the params argument.
19303
19304         * expression.cs: Use EmitStoreOpcode to get the right opcode while
19305         initializing the array.
19306
19307         (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
19308         we can use this elsewhere.
19309
19310         * statement.cs: Finish implementation of foreach for single
19311         dimension arrays.
19312
19313         * cs-parser.jay: Use an out-of-band stack to pass information
19314         around, I wonder why I need this.
19315
19316         foreach_block: Make the new foreach_block the current_block.
19317
19318         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
19319         function used to return a static Parameters structure.  Used for
19320         empty parameters, as those are created very frequently.
19321
19322         * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
19323
19324 2001-11-15  Ravi Pratap  <ravi@ximian.com>
19325
19326         * interface.cs : Default modifier is private, not public. The
19327         make verify test passes again.
19328
19329 2001-11-15  Ravi Pratap  <ravi@ximian.com>
19330
19331         * support.cs (ReflectionParameters): Fix logic to determine
19332         whether the last parameter is a params one. Test 9 passes again.
19333
19334         * delegate.cs (Populate): Register the builders we define with
19335         RegisterParameterForBuilder. Test 19 passes again.
19336
19337         * cs-parser.jay (property_declaration): Reference $6 instead
19338         of $$ to get at the location.
19339
19340         (indexer_declaration): Similar stuff.
19341
19342         (attribute): Ditto.
19343
19344         * class.cs (Property): Register parameters for the Get and Set methods
19345         if they exist. Test 23 passes again.
19346
19347         * expression.cs (ArrayCreation::Emit): Pass null for the method in the
19348         call to EmitArguments as we are sure there aren't any params arguments. 
19349         Test 32 passes again.
19350
19351         * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
19352         IndexOutOfRangeException. 
19353
19354         * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
19355         Test 33 now passes again.
19356
19357 2001-11-15  Miguel de Icaza  <miguel@ximian.com>
19358
19359         * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
19360         broke a bunch of things.  Will have to come up with a better way
19361         of tracking locations.
19362
19363         * statement.cs: Implemented foreach for single dimension arrays.
19364
19365 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
19366
19367         * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
19368         an error.  This removes the lookup from the critical path.
19369
19370         * cs-parser.jay: Removed use of temporary_loc, which is completely
19371         broken. 
19372
19373 2001-11-14  Miguel de Icaza  <miguel@ximian.com>
19374
19375         * support.cs (ReflectionParameters.ParameterModifier): Report
19376         whether the argument is a PARAMS argument or not.
19377
19378         * class.cs: Set the attribute `ParamArrayAttribute' on the
19379         parameter argument.
19380
19381         * typemanager.cs: Define param_array_type (ParamArrayAttribute)
19382         and cons_param_array_attribute (ConstructorInfo for
19383         ParamArrayAttribute)., 
19384
19385         * codegen.cs: Emit the return using the `Return' statement, that
19386         way we can report the error correctly for missing return values. 
19387
19388         * class.cs (Method.Emit): Clean up.
19389
19390         * expression.cs (Argument.Resolve): Take another argument: the
19391         location where this argument is used.  Notice that this is not
19392         part of the "Argument" class as to reduce the size of the
19393         structure (we know the approximate location anyways).
19394
19395         Test if the argument is a variable-reference, if not, then
19396         complain with a 206.
19397
19398         (Argument.Emit): Emit addresses of variables.
19399
19400         (Argument.FullDesc): Simplify.
19401
19402         (Invocation.DoResolve): Update for Argument.Resolve.
19403
19404         (ElementAccess.DoResolve): ditto.
19405
19406         * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
19407         method should be virtual, as this method is always virtual.
19408
19409         (NewDelegate.DoResolve): Update for Argument.Resolve.
19410
19411         * class.cs (ConstructorInitializer.DoResolve): ditto.
19412
19413         * attribute.cs (Attribute.Resolve): ditto.
19414
19415 2001-11-13  Miguel de Icaza  <miguel@ximian.com>
19416
19417         * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
19418
19419         * expression.cs (ParameterReference): Drop IStackStorage and implement
19420         IAssignMethod instead. 
19421
19422         (LocalVariableReference): ditto.
19423
19424         * ecore.cs (FieldExpr): Drop IStackStorage and implement
19425         IAssignMethod instead. 
19426
19427 2001-11-13  Miguel de Icaza <miguel@ximian.com>
19428
19429         * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
19430         enumerations that are used in heavily used structures derive from
19431         byte in a laughable and pathetic attempt to reduce memory usage.
19432         This is the kind of pre-optimzations that you should not do at
19433         home without adult supervision.
19434
19435         * expression.cs (UnaryMutator): New class, used to handle ++ and
19436         -- separatedly from the other unary operators.  Cleans up the
19437         code, and kills the ExpressionStatement dependency in Unary.
19438
19439         (Unary): Removed `method' and `Arguments' from this class, making
19440         it smaller, and moving it all to SimpleCall, so I can reuse this
19441         code in other locations and avoid creating a lot of transient data
19442         strucutres when not required.
19443
19444         * cs-parser.jay: Adjust for new changes.
19445
19446 2001-11-11  Miguel de Icaza  <miguel@ximian.com>
19447
19448         * enum.cs (Enum.Populate): If there is a failure during
19449         definition, return
19450
19451         * cs-parser.jay (opt_enum_base): we used to catch type errors
19452         here, but this is really incorrect.  The type error should be
19453         catched during semantic analysis.
19454
19455 2001-12-11  Ravi Pratap  <ravi@ximian.com>
19456
19457         * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
19458         current_local_parameters as expected since I, in my stupidity, had forgotten
19459         to do this :-)
19460
19461         * attribute.cs (GetValidPlaces): Fix stupid bug.
19462
19463         * class.cs (Method::Emit): Perform check on applicability of attributes.
19464
19465         (Constructor::Emit): Ditto.
19466
19467         (Field::Emit): Ditto.
19468
19469         (Field.Location): Store location information.
19470
19471         (Property, Event, Indexer, Operator): Ditto.
19472
19473         * cs-parser.jay (field_declaration): Pass in location for each field.
19474
19475         * ../errors/cs0592.cs : Add.
19476
19477 2001-11-12  Ravi Pratap  <ravi@ximian.com>
19478
19479         * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
19480
19481         (InitCoreTypes): Update accordingly.
19482
19483         (RegisterAttrType, LookupAttr): Implement.
19484
19485         * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
19486         info about the same.
19487
19488         (Resolve): Update to populate the above as necessary.
19489
19490         (Error592): Helper.
19491
19492         (GetValidPlaces): Helper to the above.
19493
19494         (CheckAttribute): Implement to perform validity of attributes on declarative elements.
19495
19496         * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
19497
19498 2001-11-12  Ravi Pratap  <ravi@ximian.com>
19499
19500         * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
19501
19502         * ../errors/cs0617.cs : Add.
19503
19504 2001-11-11  Ravi Pratap  <ravi@ximian.com>
19505
19506         * enum.cs (Emit): Rename to Populate to be more consistent with what
19507         we expect it to do and when exactly it is called.
19508
19509         * class.cs, rootcontext.cs : Update accordingly.
19510
19511         * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
19512         FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
19513
19514         * enum.cs (Populate): Register fields with TypeManager.RegisterField.
19515
19516         * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
19517         of a fieldinfo using the above, when dealing with a FieldBuilder.
19518
19519 2001-11-10  Ravi Pratap  <ravi@ximian.com>
19520
19521         * ../errors/cs0031.cs : Add.
19522
19523         * ../errors/cs1008.cs : Add.
19524
19525         * ../errrors/cs0543.cs : Add.
19526
19527         * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
19528         enum type.
19529
19530         (FindMembers): Implement.
19531
19532         * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
19533         enums and delegates too.
19534
19535         (enum_types): Rename to builder_to_enum.
19536
19537         (delegate_types): Rename to builder_to_delegate.
19538
19539         * delegate.cs (FindMembers): Implement.
19540
19541 2001-11-09  Ravi Pratap  <ravi@ximian.com>
19542
19543         * typemanager.cs (IsEnumType): Implement.
19544
19545         * enum.cs (Emit): Re-write parts to account for the underlying type
19546         better and perform checking etc.
19547
19548         (GetNextDefaultValue): Helper to ensure we don't overshoot max value
19549         of the underlying type.
19550
19551         * literal.cs (GetValue methods everywhere): Perform bounds checking and return
19552         value
19553
19554         * enum.cs (error31): Helper to report error #31.
19555
19556         * cs-parser.jay (enum_declaration): Store location of each member too.
19557
19558         * enum.cs (member_to_location): New hashtable. 
19559
19560         (AddEnumMember): Update location hashtable.
19561
19562         (Emit): Use the location of each member while reporting errors.
19563
19564 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
19565
19566         * cs-parser.jay: A for_initializer if is a
19567         local_variable_declaration really ammount to have an implicit
19568         block with the variable declaration and no initializer for for.
19569
19570         * statement.cs (For.Emit): Cope with null initializers.
19571
19572         This fixes the infinite loop on for initializers.
19573
19574 2001-11-08  Miguel de Icaza  <miguel@ximian.com>
19575
19576         * enum.cs: More cleanup.
19577
19578         * ecore.cs: Remove dead code.
19579
19580         * class.cs (Property.Emit): More simplification.
19581         (Event.Emit): ditto.
19582
19583         Reworked to have less levels of indentation.
19584
19585 2001-11-08  Ravi Pratap  <ravi@ximian.com>
19586
19587         * class.cs (Property): Emit attributes.
19588
19589         (Field): Ditto.
19590
19591         (Event): Ditto.
19592
19593         (Indexer): Ditto.
19594
19595         (Operator): Ditto.
19596
19597         * enum.cs (Emit): Ditto.
19598
19599         * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
19600         Enums too.
19601
19602         * class.cs (Field, Event, etc.): Move attribute generation into the
19603         Emit method everywhere.
19604
19605         * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
19606         we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
19607         as we had no way of defining nested enums !
19608
19609         * rootcontext.cs : Adjust code accordingly.
19610
19611         * typemanager.cs (AddEnumType): To keep track of enum types separately.
19612
19613 2001-11-07  Ravi Pratap  <ravi@ximian.com>
19614
19615         * expression.cs (EvalConstantExpression): Move into ecore.cs
19616
19617         * enum.cs (Enum): Rename some members and make them public and readonly
19618         according to our convention.
19619
19620         * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
19621         nothing else.
19622
19623         * enum.cs (Enum::Define): Use the above instead of TypeAttr.
19624
19625         (Enum::Emit): Write a simple version for now which doesn't try to compute
19626         expressions. I shall modify this to be more robust in just a while.
19627
19628         * class.cs (TypeContainer::Emit): Make sure we include Enums too.
19629
19630         (TypeContainer::CloseType): Create the Enum types too.
19631
19632         * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
19633
19634         * expression.cs (EvalConstantExpression): Get rid of completely.
19635
19636         * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
19637         user-defined values and other cases.
19638
19639         (IsValidEnumLiteral): Helper function.
19640
19641         * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing 
19642         out there in the case we had a literal FieldExpr.
19643
19644         (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
19645
19646         (Literalize): Revamp a bit to take two arguments.
19647
19648         (EnumLiteral): New class which derives from Literal to wrap enum literals.
19649
19650 2001-11-06  Ravi Pratap  <ravi@ximian.com>
19651
19652         * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
19653
19654         * expression.cs (ArrayCreation::ValidateInitializers): Implement.
19655
19656         (Resolve): Use the above to ensure we have proper initializers.
19657
19658 2001-11-05  Ravi Pratap  <ravi@ximian.com>
19659
19660         * expression.cs (Expression::EvalConstantExpression): New method to 
19661         evaluate constant expressions.
19662
19663         * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
19664
19665 2001-11-07  Miguel de Icaza  <miguel@ximian.com>
19666
19667         * expression.cs (ArrayCreation.Emit): Some bits to initialize data
19668         in an array.
19669
19670         (Binary.ResolveOperator): Handle operator != (object a, object b)
19671         and operator == (object a, object b);
19672
19673         (Binary.DoNumericPromotions): Indicate whether the numeric
19674         promotion was possible.
19675
19676         (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
19677         Implement.  
19678
19679         Made the ArrayAccess implement interface IAssignMethod instead of
19680         IStackStore as the order in which arguments are passed reflects
19681         this.
19682
19683         * assign.cs: Instead of using expr.ExprClass to select the way of
19684         assinging, probe for the IStackStore/IAssignMethod interfaces.
19685
19686         * typemanager.cs: Load InitializeArray definition.
19687
19688         * rootcontext.cs (RootContext.MakeStaticData): Used to define
19689         static data that can be used to initialize arrays. 
19690
19691 2001-11-05  Miguel de Icaza  <miguel@ximian.com>
19692
19693         * expression.cs: Handle operator== and operator!= for booleans.
19694
19695         (Conditioal.Reduce): Implement reducer for the ?: operator.
19696
19697         (Conditional.Resolve): Implement dead code elimination.
19698
19699         (Binary.Resolve): Catch string literals and return a new
19700         concatenated string.
19701
19702         (Unary.Reduce): Implement reduction of unary expressions.
19703
19704         * ecore.cs: Split out the expression core handling here.
19705
19706         (Expression.Reduce): New method used to perform constant folding
19707         and CSE.  This is needed to support constant-expressions. 
19708
19709         * statement.cs (Statement.EmitBoolExpression): Pass true and false
19710         targets, and optimize for !x.
19711
19712 2001-11-04  Ravi Pratap  <ravi@ximian.com>
19713
19714         * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
19715         of an attribute gives us a CustomAttributeBuilder which we use accordingly to
19716         set custom atttributes.
19717
19718         * literal.cs (Literal::GetValue): New abstract method to return the actual
19719         value of the literal, cast as an object.
19720
19721         (*Literal): Implement GetValue method.
19722
19723         * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
19724         expressions to the arraylist but objects of type Argument.
19725
19726         * class.cs (TypeContainer::Emit): Emit our attributes too.
19727
19728         (Method::Emit, Constructor::Emit): Ditto.
19729
19730         * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
19731         to be ignoring earlier.
19732
19733 2001-11-03  Ravi Pratap  <ravi@ximian.com>
19734
19735         * attribute.cs (AttributeSection::Define): Implement to do the business
19736         of constructing a CustomAttributeBuilder.
19737
19738         (Attribute): New trivial class. Increases readability of code.  
19739
19740         * cs-parser.jay : Update accordingly.
19741
19742         (positional_argument_list, named_argument_list, named_argument): New rules
19743
19744         (attribute_arguments): Use the above so that we are more correct.
19745
19746 2001-11-02  Ravi Pratap  <ravi@ximian.com>
19747
19748         * expression.cs (Invocation::IsParamsMethodApplicable): Implement
19749         to perform all checks for a method with a params parameter.
19750
19751         (Invocation::OverloadResolve): Update to use the above method and therefore
19752         cope correctly with params method invocations.
19753
19754         * support.cs (InternalParameters::ParameterDesc): Provide a desc for 
19755         params too.
19756
19757         * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
19758         constructors in our parent too because we can't afford to miss out on 
19759         protected ones ;-)
19760
19761         * attribute.cs (AttributeSection): New name for the class Attribute
19762
19763         Other trivial changes to improve readability.
19764
19765         * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
19766         use the new class names.
19767
19768 2001-11-01  Ravi Pratap  <ravi@ximian.com>
19769
19770         * class.cs (Method::Define): Complete definition for params types too
19771
19772         (Indexer::Define): Ditto.
19773
19774         * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
19775         Cope everywhere with a request for info about the array parameter.
19776
19777 2001-11-01  Ravi Pratap  <ravi@ximian.com>
19778
19779         * tree.cs (RecordNamespace): Fix up to check for the correct key.
19780
19781         * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in 
19782         local_variable_type to extract the string corresponding to the type.
19783
19784         (local_variable_type): Fixup the action to use the new helper method.
19785
19786         * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to 
19787         go.
19788
19789         * expression.cs : Clean out code which uses the above.
19790
19791 2001-10-31  Ravi Pratap  <ravi@ximian.com>
19792
19793         * typemanager.cs (RegisterMethod): Check if we already have an existing key
19794         and bale out if necessary by returning a false.
19795
19796         (RegisterProperty): Ditto.
19797
19798         * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
19799         and print out appropriate error messages.
19800
19801         * interface.cs (everywhere): Ditto.
19802
19803         * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
19804         location to constructor.
19805
19806         * class.cs (Property, Event, Indexer): Update accordingly.
19807
19808         * ../errors/cs111.cs : Added.
19809
19810         * expression.cs (Invocation::IsApplicable): New static method to determine applicability
19811         of a method, as laid down by the spec.
19812
19813         (Invocation::OverloadResolve): Use the above method.
19814
19815 2001-10-31  Ravi Pratap  <ravi@ximian.com>
19816
19817         * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
19818         now take a TypeContainer and a Parameters object.
19819
19820         (ParameterData): Modify return type of ParameterModifier method to be 
19821         Parameter.Modifier and not a string.
19822
19823         (ReflectionParameters, InternalParameters): Update accordingly.
19824
19825         * expression.cs (Argument::GetParameterModifier): Same here.
19826
19827         * support.cs (InternalParameters::ParameterType): Find a better way of determining
19828         if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
19829         symbol in it at all so maybe this is only for now.
19830
19831 2001-10-30  Ravi Pratap  <ravi@ximian.com>
19832
19833         * support.cs (InternalParameters): Constructor now takes an extra argument 
19834         which is the actual Parameters class.
19835
19836         (ParameterDesc): Update to provide info on ref/out modifiers.
19837
19838         * class.cs (everywhere): Update call to InternalParameters to pass in
19839         the second argument too.
19840
19841         * support.cs (ParameterData): Add ParameterModifier, which is a method 
19842         to return the modifier info [ref/out etc]
19843
19844         (InternalParameters, ReflectionParameters): Implement the above.
19845
19846         * expression.cs (Argument::ParameterModifier): Similar function to return
19847         info about the argument's modifiers.
19848
19849         (Invocation::OverloadResolve): Update to take into account matching modifiers 
19850         too.
19851
19852         * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
19853         a new SetFormalParameters object which we pass to InternalParameters.
19854
19855 2001-10-30  Ravi Pratap  <ravi@ximian.com>
19856
19857         * expression.cs (NewArray): Merge into the ArrayCreation class.
19858
19859 2001-10-29  Ravi Pratap  <ravi@ximian.com>
19860
19861         * expression.cs (NewArray): Merge classes NewBuiltinArray and 
19862         NewUserdefinedArray into one as there wasn't much of a use in having
19863         two separate ones.
19864
19865         * expression.cs (Argument): Change field's name to ArgType from Type.
19866
19867         (Type): New readonly property which returns the proper type, taking into 
19868         account ref/out modifiers.
19869
19870         (everywhere): Adjust code accordingly for the above.
19871
19872         * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
19873         whether we are emitting for a ref or out parameter.
19874
19875         * expression.cs (Argument::Emit): Use the above field to set the state.
19876
19877         (LocalVariableReference::Emit): Update to honour the flag and emit the
19878         right stuff.
19879
19880         * parameter.cs (Attributes): Set the correct flags for ref parameters.
19881
19882         * expression.cs (Argument::FullDesc): New function to provide a full desc.
19883
19884         * support.cs (ParameterData): Add method ParameterDesc to the interface.
19885
19886         (ReflectionParameters, InternalParameters): Implement the above method.
19887
19888         * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
19889         reporting errors.
19890
19891         (Invocation::FullMethodDesc): Ditto. 
19892
19893 2001-10-29  Miguel de Icaza  <miguel@ximian.com>
19894
19895         * cs-parser.jay: Add extra production for the second form of array
19896         creation. 
19897
19898         * expression.cs (ArrayCreation): Update to reflect the above
19899         change. 
19900
19901         * Small changes to prepare for Array initialization.
19902
19903 2001-10-28  Miguel de Icaza  <miguel@ximian.com>
19904
19905         * typemanager.cs (ImplementsInterface): interface might be null;
19906         Deal with this problem;
19907
19908         Also, we do store negative hits on the cache (null values), so use
19909         this instead of calling t.GetInterfaces on the type everytime.
19910
19911 2001-10-28  Ravi Pratap  <ravi@ximian.com>
19912
19913         * typemanager.cs (IsBuiltinType): New method to help determine the same.
19914
19915         * expression.cs (New::DoResolve): Get rid of array creation code and instead
19916         split functionality out into different classes.
19917
19918         (New::FormArrayType): Move into NewBuiltinArray.
19919
19920         (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
19921         quite useless.
19922
19923         (NewBuiltinArray): New class to handle creation of built-in arrays.
19924
19925         (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
19926         account creation of one-dimensional arrays.
19927
19928         (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
19929
19930         (NewUserdefinedArray::DoResolve): Implement.
19931
19932         * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
19933
19934         * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
19935         we maintain inside the TypeManager. This is necessary to perform lookups on the
19936         module builder.
19937
19938         (LookupType): Update to perform GetType on the module builders too.     
19939
19940         * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
19941
19942         * exprssion.cs (NewUserdefinedArray::Emit): Implement.
19943
19944 2001-10-23  Ravi Pratap  <ravi@ximian.com>
19945
19946         * expression.cs (New::DoResolve): Implement guts of array creation.
19947
19948         (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
19949
19950 2001-10-27  Miguel de Icaza  <miguel@ximian.com>
19951
19952         * expression.cs: Fix bug I introduced lsat night that broke
19953         Delegates. 
19954
19955         (Expression.Resolve): Report a 246 error (can not resolve name)
19956         if we find a SimpleName in the stream.
19957
19958         (Expression.ResolveLValue): Ditto.
19959
19960         (Expression.ResolveWithSimpleName): This function is a variant of
19961         ResolveName, this one allows SimpleNames to be returned without a
19962         warning.  The only consumer of SimpleNames is MemberAccess
19963
19964 2001-10-26  Miguel de Icaza  <miguel@ximian.com>
19965
19966         * expression.cs (Invocation::DoResolve): Catch SimpleNames that
19967         might arrive here.  I have my doubts that this is correct.
19968
19969         * statement.cs (Lock): Implement lock statement.
19970
19971         * cs-parser.jay: Small fixes to support `lock' and `using'
19972
19973         * cs-tokenizer.cs: Remove extra space
19974
19975         * driver.cs: New flag --checked, allows to turn on integer math
19976         checking. 
19977
19978         * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
19979         Threading.Monitor.Exit 
19980
19981 2001-10-23  Miguel de Icaza  <miguel@ximian.com>
19982
19983         * expression.cs (IndexerAccess::DoResolveLValue): Set the
19984         Expression Class to be IndexerAccess.
19985
19986         Notice that Indexer::DoResolve sets the eclass to Value.
19987
19988 2001-10-22  Miguel de Icaza  <miguel@ximian.com>
19989
19990         * class.cs (TypeContainer::Emit): Emit code for indexers.
19991
19992         * assign.cs (IAssignMethod): New interface implemented by Indexers
19993         and Properties for handling assignment.
19994
19995         (Assign::Emit): Simplify and reuse code. 
19996
19997         * expression.cs (IndexerAccess, PropertyExpr): Implement
19998         IAssignMethod, clean up old code. 
19999
20000 2001-10-22  Ravi Pratap  <ravi@ximian.com>
20001
20002         * typemanager.cs (ImplementsInterface): New method to determine if a type
20003         implements a given interface. Provides a nice cache too.
20004
20005         * expression.cs (ImplicitReferenceConversion): Update checks to use the above
20006         method.
20007
20008         (ConvertReferenceExplicit): Ditto.
20009
20010         * delegate.cs (Delegate::Populate): Update to define the parameters on the 
20011         various methods, with correct names etc.
20012
20013         * class.cs (Operator::OpType): New members Operator.UnaryPlus and 
20014         Operator.UnaryNegation.
20015
20016         * cs-parser.jay (operator_declarator): Be a little clever in the case where
20017         we have a unary plus or minus operator.
20018
20019         * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and 
20020         UnaryMinus.
20021
20022         * everywhere : update accordingly.
20023
20024         * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
20025         respectively.
20026
20027         * class.cs (Method::Define): For the case where we are implementing a method
20028         inherited from an interface, we need to set the MethodAttributes.Final flag too. 
20029         Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
20030
20031 2001-10-21  Ravi Pratap  <ravi@ximian.com>
20032
20033         * interface.cs (FindMembers): Implement to work around S.R.E
20034         lameness.
20035
20036         * typemanager.cs (IsInterfaceType): Implement.
20037
20038         (FindMembers): Update to handle interface types too.
20039
20040         * expression.cs (ImplicitReferenceConversion): Re-write bits which
20041         use IsAssignableFrom as that is not correct - it doesn't work.
20042
20043         * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
20044         and accordingly override EmitStatement.
20045
20046         * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
20047         using the correct logic :-)
20048
20049 2001-10-19  Ravi Pratap  <ravi@ximian.com>
20050
20051         * ../errors/cs-11.cs : Add to demonstrate error -11 
20052
20053 2001-10-17  Miguel de Icaza  <miguel@ximian.com>
20054
20055         * assign.cs (Assign::Resolve): Resolve right hand side first, and
20056         then pass this as a hint to ResolveLValue.
20057
20058         * expression.cs (FieldExpr): Add Location information
20059
20060         (FieldExpr::LValueResolve): Report assignment to readonly
20061         variable. 
20062
20063         (Expression::ExprClassFromMemberInfo): Pass location information.
20064
20065         (Expression::ResolveLValue): Add new method that resolves an
20066         LValue. 
20067
20068         (Expression::DoResolveLValue): Default invocation calls
20069         DoResolve. 
20070
20071         (Indexers): New class used to keep track of indexers in a given
20072         Type. 
20073
20074         (IStackStore): Renamed from LValue, as it did not really describe
20075         what this did.  Also ResolveLValue is gone from this interface and
20076         now is part of Expression.
20077
20078         (ElementAccess): Depending on the element access type
20079
20080         * typemanager.cs: Add `indexer_name_type' as a Core type
20081         (System.Runtime.CompilerServices.IndexerNameAttribute)
20082
20083         * statement.cs (Goto): Take a location.
20084
20085 2001-10-18  Ravi Pratap  <ravi@ximian.com>
20086
20087         * delegate.cs (Delegate::VerifyDelegate): New method to verify
20088         if two delegates are compatible.
20089
20090         (NewDelegate::DoResolve): Update to take care of the case when
20091         we instantiate a delegate from another delegate.
20092
20093         * typemanager.cs (FindMembers): Don't even try to look up members
20094         of Delegate types for now.
20095
20096 2001-10-18  Ravi Pratap  <ravi@ximian.com>
20097
20098         * delegate.cs (NewDelegate): New class to take care of delegate
20099         instantiation.
20100
20101         * expression.cs (New): Split the delegate related code out into 
20102         the NewDelegate class.
20103
20104         * delegate.cs (DelegateInvocation): New class to handle delegate 
20105         invocation.
20106
20107         * expression.cs (Invocation): Split out delegate related code into
20108         the DelegateInvocation class.
20109
20110 2001-10-17  Ravi Pratap  <ravi@ximian.com>
20111
20112         * expression.cs (New::DoResolve): Implement delegate creation fully
20113         and according to the spec.
20114
20115         (New::DoEmit): Update to handle delegates differently.
20116
20117         (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
20118         because of which we were printing out arguments in reverse order !
20119
20120         * delegate.cs (VerifyMethod): Implement to check if the given method
20121         matches the delegate.
20122
20123         (FullDelegateDesc): Implement.
20124
20125         (VerifyApplicability): Implement.
20126
20127         * expression.cs (Invocation::DoResolve): Update to accordingly handle
20128         delegate invocations too.
20129
20130         (Invocation::Emit): Ditto.
20131
20132         * ../errors/cs1593.cs : Added.
20133
20134         * ../errors/cs1594.cs : Added.
20135
20136         * delegate.cs (InstanceExpression, TargetMethod): New properties.
20137
20138 2001-10-16  Ravi Pratap  <ravi@ximian.com>
20139
20140         * typemanager.cs (intptr_type): Core type for System.IntPtr
20141
20142         (InitCoreTypes): Update for the same.
20143
20144         (iasyncresult_type, asynccallback_type): Ditto.
20145
20146         * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
20147         correct.
20148
20149         * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
20150         too.
20151
20152         * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
20153         the builders for the 4 members of a delegate type :-)
20154
20155         (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
20156         type.
20157
20158         * expression.cs (New::DoResolve): Implement guts for delegate creation.
20159
20160         * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
20161
20162 2001-10-15  Miguel de Icaza  <miguel@ximian.com>
20163
20164         * statement.cs (Break::Emit): Implement.   
20165         (Continue::Emit): Implement.
20166
20167         (For::Emit): Track old being/end loops;  Set Begin loop, ack end loop
20168         (While::Emit): Track old being/end loops;  Set Begin loop, ack end loop
20169         (Do::Emit): Track old being/end loops;  Set Begin loop, ack end loop
20170         (Foreach::Emit): Track old being/end loops;  Set Begin loop, ack
20171         end loop
20172
20173         * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
20174         properties that track the label for the current loop (begin of the
20175         loop and end of the loop).
20176
20177 2001-10-15  Ravi Pratap  <ravi@ximian.com>
20178
20179         * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
20180         use of emitting anything at all.
20181
20182         * class.cs, rootcontext.cs : Get rid of calls to the same.
20183
20184         * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
20185
20186         (Populate): Define the constructor correctly and set the implementation
20187         attributes.
20188
20189         * typemanager.cs (delegate_types): New hashtable to hold delegates that
20190         have been defined.
20191
20192         (AddDelegateType): Implement.
20193
20194         (IsDelegateType): Implement helper method.
20195
20196         * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
20197
20198         * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
20199         and accordingly handle it.
20200
20201         * delegate.cs (Populate): Take TypeContainer argument.
20202         Implement bits to define the Invoke method. However, I still haven't figured out
20203         how to take care of the native int bit :-(
20204
20205         * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-) 
20206         Qualify the name of the delegate, not its return type !
20207
20208         * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
20209         conversion.
20210
20211         (StandardConversionExists): Checking for array types turns out to be recursive.
20212
20213         (ConvertReferenceExplicit): Implement array conversion.
20214
20215         (ExplicitReferenceConversionExists): New method to determine precisely that :-)
20216
20217 2001-10-12  Ravi Pratap  <ravi@ximian.com>
20218
20219         * cs-parser.jay (delegate_declaration): Store the fully qualified
20220         name as it is a type declaration.
20221
20222         * delegate.cs (ReturnType, Name): Rename members to these. Make them 
20223         readonly.
20224
20225         (DefineDelegate): Renamed from Define. Does the same thing essentially,
20226         as TypeContainer::DefineType.
20227
20228         (Populate): Method in which all the definition of the various methods (Invoke)
20229         etc is done.
20230
20231         (Emit): Emit any code, if necessary. I am not sure about this really, but let's
20232         see.
20233
20234         (CloseDelegate): Finally creates the delegate.
20235
20236         * class.cs (TypeContainer::DefineType): Update to define delegates.
20237         (Populate, Emit and CloseType): Do the same thing here too.
20238
20239         * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
20240         delegates in all these operations.
20241
20242 2001-10-14  Miguel de Icaza  <miguel@ximian.com>
20243
20244         * expression.cs: LocalTemporary: a new expression used to
20245         reference a temporary that has been created.
20246
20247         * assign.cs: Handle PropertyAccess back here, so that we can
20248         provide the proper semantic access to properties.
20249
20250         * expression.cs (Expression::ConvertReferenceExplicit): Implement
20251         a few more explicit conversions. 
20252
20253         * modifiers.cs: `NEW' modifier maps to HideBySig.
20254
20255         * expression.cs (PropertyExpr): Make this into an
20256         ExpressionStatement, and support the EmitStatement code path. 
20257
20258         Perform get/set error checking, clean up the interface.
20259
20260         * assign.cs: recognize PropertyExprs as targets, and if so, turn
20261         them into toplevel access objects.
20262
20263 2001-10-12  Miguel de Icaza  <miguel@ximian.com>
20264
20265         * expression.cs: PropertyExpr::PropertyExpr: use work around the
20266         SRE.
20267
20268         * typemanager.cs: Keep track here of our PropertyBuilders again to
20269         work around lameness in SRE.
20270
20271 2001-10-11  Miguel de Icaza  <miguel@ximian.com>
20272
20273         * expression.cs (LValue::LValueResolve): New method in the
20274         interface, used to perform a second resolution pass for LValues. 
20275
20276         (This::DoResolve): Catch the use of this in static methods.
20277
20278         (This::LValueResolve): Implement.
20279
20280         (This::Store): Remove warning, assigning to `this' in structures
20281         is 
20282
20283         (Invocation::Emit): Deal with invocation of
20284         methods on value types.  We need to pass the address to structure
20285         methods rather than the object itself.  (The equivalent code to
20286         emit "this" for structures leaves the entire structure on the
20287         stack instead of a pointer to it). 
20288
20289         (ParameterReference::DoResolve): Compute the real index for the
20290         argument based on whether the method takes or not a `this' pointer
20291         (ie, the method is static).
20292
20293         * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
20294         value types returned from functions when we need to invoke a
20295         method on the sturcture.
20296
20297
20298 2001-10-11  Ravi Pratap  <ravi@ximian.com>
20299
20300         * class.cs (TypeContainer::DefineType): Method to actually do the business of
20301         defining the type in the Modulebuilder or Typebuilder. This is to take
20302         care of nested types which need to be defined on the TypeBuilder using
20303         DefineNestedMethod.
20304
20305         (TypeContainer::GetClassBases): Implement. Essentially the code from the 
20306         methods in RootContext, only ported to be part of TypeContainer.
20307
20308         (TypeContainer::GetInterfaceOrClass): Ditto.
20309
20310         (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
20311
20312         * interface.cs (Interface::DefineInterface): New method. Does exactly
20313         what RootContext.CreateInterface did earlier, only it takes care of nested types 
20314         too.
20315
20316         (Interface::GetInterfaces): Move from RootContext here and port.
20317
20318         (Interface::GetInterfaceByName): Same here.
20319
20320         * rootcontext.cs (ResolveTree): Re-write.
20321
20322         (PopulateTypes): Re-write.
20323
20324         * class.cs (TypeContainer::Populate): Populate nested types too.
20325         (TypeContainer::Emit): Emit nested members too.
20326
20327         * typemanager.cs (AddUserType): Do not make use of the FullName property,
20328         instead just use the name argument passed in as it is already fully
20329         qualified.
20330
20331         (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
20332         to TypeContainer mapping to see if a type is user-defined.
20333
20334         * class.cs (TypeContainer::CloseType): Implement. 
20335
20336         (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
20337         the default constructor.
20338
20339         (TypeContainer::Populate): Fix minor bug which led to creating default constructors
20340         twice.
20341
20342         (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
20343
20344         * interface.cs (CloseType): Create the type here.
20345
20346         * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
20347         the hierarchy.
20348
20349         Remove all the methods which are now in TypeContainer.
20350
20351 2001-10-10  Ravi Pratap  <ravi@ximian.com>
20352
20353         * delegate.cs (Define): Re-write bits to define the delegate
20354         correctly.
20355
20356 2001-10-10  Miguel de Icaza  <miguel@ximian.com>
20357
20358         * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
20359
20360         * expression.cs (ImplicitReferenceConversion): handle null as well
20361         as a source to convert to any reference type.
20362
20363         * statement.cs (Return): Perform any implicit conversions to
20364         expected return type.  
20365
20366         Validate use of return statement.  
20367
20368         * codegen.cs (EmitContext): Pass the expected return type here.
20369
20370         * class.cs (Method, Constructor, Property): Pass expected return
20371         type to EmitContext.
20372
20373 2001-10-09  Miguel de Icaza  <miguel@ximian.com>
20374
20375         * expression.cs: Make DoResolve take an EmitContext instead of a
20376         TypeContainer.
20377
20378         Replaced `l' and `location' for `loc', for consistency.
20379
20380         (Error, Warning): Remove unneeded Tc argument.
20381
20382         * assign.cs, literal.cs, constant.cs: Update to new calling
20383         convention. 
20384
20385         * codegen.cs: EmitContext now contains a flag indicating whether
20386         code is being generated in a static method or not.
20387
20388         * cs-parser.jay: DecomposeQI, new function that replaces the old
20389         QualifiedIdentifier.  Now we always decompose the assembled
20390         strings from qualified_identifier productions into a group of
20391         memberaccesses.
20392
20393 2001-10-08  Miguel de Icaza  <miguel@ximian.com>
20394
20395         * rootcontext.cs: Deal with field-less struct types correctly now
20396         by passing the size option to Define Type.
20397
20398         * class.cs: Removed hack that created one static field. 
20399
20400 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
20401
20402         * statement.cs: Moved most of the code generation here. 
20403
20404 2001-10-09  Ravi Pratap  <ravi@ximian.com>
20405
20406         * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
20407         seem very right.
20408
20409         (ElementAccess): Remove useless bits for now - keep checks as the spec
20410         says.
20411
20412 2001-10-08  Ravi Pratap  <ravi@ximian.com>
20413
20414         * expression.cs (ElementAccess::DoResolve): Remove my crap code
20415         and start performing checks according to the spec.
20416
20417 2001-10-07  Ravi Pratap  <ravi@ximian.com>
20418
20419         * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
20420         rank_specifiers instead.
20421
20422         (rank_specifiers): Change the order in which the rank specifiers are stored
20423
20424         (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
20425
20426         * expression.cs (ElementAccess): Implement the LValue interface too.
20427
20428 2001-10-06  Ravi Pratap  <ravi@ximian.com>
20429
20430         * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
20431         except that user defined conversions are not included.
20432
20433         (UserDefinedConversion): Update to use the ConvertExplicitStandard to 
20434         perform the conversion of the return type, if necessary.
20435
20436         (New::DoResolve): Check whether we are creating an array or an object
20437         and accordingly do the needful.
20438
20439         (New::Emit): Same here.
20440
20441         (New::DoResolve): Implement guts of array creation.
20442
20443         (New::FormLookupType): Helper function.
20444
20445 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
20446
20447         * codegen.cs: Removed most of the code generation here, and move the
20448         corresponding code generation bits to the statement classes. 
20449
20450         Added support for try/catch/finalize and throw.
20451
20452         * cs-parser.jay: Added support for try/catch/finalize.
20453
20454         * class.cs: Catch static methods having the flags override,
20455         virtual or abstract.
20456
20457         * expression.cs (UserCast): This user cast was not really doing
20458         what it was supposed to do.  Which is to be born in fully resolved
20459         state.  Parts of the resolution were being performed at Emit time! 
20460
20461         Fixed this code.
20462
20463 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
20464
20465         * expression.cs: Implicity convert the result from UserCast.
20466
20467 2001-10-05  Ravi Pratap  <ravi@ximian.com>
20468
20469         * expression.cs (Expression::FindMostEncompassingType): Fix bug which
20470         prevented it from working correctly. 
20471
20472         (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
20473         merely ConvertImplicit.
20474
20475 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
20476
20477         * typemanager.cs: Make the LookupTypeContainer function static,
20478         and not per-instance.  
20479
20480         * class.cs: Make static FindMembers (the one that takes a Type
20481         argument). 
20482
20483         * codegen.cs: Add EmitForeach here.
20484
20485         * cs-parser.jay: Make foreach a toplevel object instead of the
20486         inline expansion, as we need to perform semantic analysis on it. 
20487
20488 2001-10-05  Ravi Pratap  <ravi@ximian.com>
20489
20490         * expression.cs (Expression::ImplicitUserConversion): Rename to
20491         UserDefinedConversion.
20492
20493         (Expression::UserDefinedConversion): Take an extra argument specifying 
20494         whether we look for explicit user conversions too.
20495
20496         (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
20497
20498         (UserDefinedConversion): Incorporate support for user defined explicit conversions.
20499
20500         (ExplicitUserConversion): Make it a call to UserDefinedConversion
20501         with the appropriate arguments.
20502
20503         * cs-parser.jay (cast_expression): Record location too.
20504
20505         * expression.cs (Cast): Record location info.
20506
20507         (Expression::ConvertExplicit): Take location argument.
20508
20509         (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
20510         to determine if we are doing explicit conversions.
20511
20512         (UserCast::Emit): Update accordingly.
20513
20514         (Expression::ConvertExplicit): Report an error if everything fails.
20515
20516         * ../errors/cs0030.cs : Add.
20517
20518 2001-10-04  Miguel de Icaza  <miguel@ximian.com>
20519
20520         * modifiers.cs: If the ABSTRACT keyword is present, also set the
20521         virtual and newslot bits. 
20522
20523         * class.cs (TypeContainer::RegisterRequiredImplementations):
20524         Record methods we need.
20525
20526         (TypeContainer::MakeKey): Helper function to make keys for
20527         MethodBases, since the Methodbase key is useless.
20528
20529         (TypeContainer::Populate): Call RegisterRequiredImplementations
20530         before defining the methods.   
20531
20532         Create a mapping for method_builders_to_methods ahead of time
20533         instead of inside a tight loop.
20534
20535         (::RequireMethods):  Accept an object as the data to set into the
20536         hashtable so we can report interface vs abstract method mismatch.
20537
20538 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
20539
20540         * report.cs: Make all of it static.
20541
20542         * rootcontext.cs: Drop object_type and value_type computations, as
20543         we have those in the TypeManager anyways.
20544
20545         Drop report instance variable too, now it is a global.
20546
20547         * driver.cs: Use try/catch on command line handling.
20548
20549         Add --probe option to debug the error reporting system with a test
20550         suite. 
20551
20552         * report.cs: Add support for exiting program when a probe
20553         condition is reached.
20554
20555 2001-10-03  Ravi Pratap  <ravi@ximian.com>
20556
20557         * expression.cs (Binary::DoNumericPromotions): Fix the case when
20558         we do a forcible conversion regardless of type, to check if 
20559         ForceConversion returns a null.
20560
20561         (Binary::error19): Use location to report error.
20562
20563         (Unary::error23): Use location here too.
20564
20565         * ../errors/cs0019.cs : Check in.
20566
20567         * ../errors/cs0023.cs : Check in.
20568
20569         * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
20570         case of a non-null MethodInfo object with a length of 0 !
20571
20572         (Binary::ResolveOperator): Flag error if overload resolution fails to find
20573         an applicable member - according to the spec :-)
20574         Also fix logic to find members in base types.
20575
20576         (Unary::ResolveOperator): Same here.
20577
20578         (Unary::report23): Change name to error23 and make first argument a TypeContainer
20579         as I was getting thoroughly confused between this and error19 :-)
20580
20581         * expression.cs (Expression::ImplicitUserConversion): Re-write fully
20582         (::FindMostEncompassedType): Implement.
20583         (::FindMostEncompassingType): Implement.
20584         (::StandardConversionExists): Implement.
20585
20586         (UserImplicitCast): Re-vamp. We now need info about most specific
20587         source and target types so that we can do the necessary conversions.
20588
20589         (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
20590         mathematical union with no duplicates.
20591
20592 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
20593
20594         * rootcontext.cs (RootContext::PopulateTypes): Populate containers
20595         in order from base classes to child classes, so that we can in
20596         child classes look up in our parent for method names and
20597         attributes (required for handling abstract, virtual, new, override
20598         constructs: we need to instrospect our base class, and if we dont
20599         populate the classes in order, the introspection might be
20600         incorrect.  For example, a method could query its parent before
20601         the parent has any methods and would determine that the parent has
20602         no abstract methods (while it could have had them)).
20603
20604         (RootContext::CreateType): Record the order in which we define the
20605         classes.
20606
20607 2001-10-02  Miguel de Icaza  <miguel@ximian.com>
20608
20609         * class.cs (TypeContainer::Populate): Also method definitions can
20610         fail now, keep track of this.
20611
20612         (TypeContainer::FindMembers): Implement support for
20613         DeclaredOnly/noDeclaredOnly flag.
20614
20615         (Constructor::Emit) Return the ConstructorBuilder.
20616
20617         (Method::Emit) Return the MethodBuilder. 
20618         Check for abstract or virtual methods to be public.
20619
20620         * rootcontext.cs (RootContext::CreateType): Register all the
20621         abstract methods required for the class to be complete and the
20622         interface methods that must be implemented. 
20623
20624         * cs-parser.jay: Report error 501 (method requires body if it is
20625         not marked abstract or extern).
20626
20627         * expression.cs (TypeOf::Emit): Implement.
20628
20629         * typemanager.cs: runtime_handle_type, new global type.
20630
20631         * class.cs (Property::Emit): Generate code for properties.
20632
20633 2001-10-02  Ravi Pratap  <ravi@ximian.com>
20634
20635         * expression.cs (Unary::ResolveOperator): Find operators on base type
20636         too - we now conform exactly to the spec.
20637
20638         (Binary::ResolveOperator): Same here.
20639
20640         * class.cs (Operator::Define): Fix minor quirk in the tests.
20641
20642         * ../errors/cs0215.cs : Added.
20643
20644         * ../errors/cs0556.cs : Added.
20645
20646         * ../errors/cs0555.cs : Added.
20647
20648 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
20649
20650         * cs-tokenizer.cs: Reimplemented Location to be a struct with a
20651         single integer which is really efficient
20652
20653 2001-10-01  Ravi Pratap  <ravi@ximian.com>
20654
20655         *  expression.cs (Expression::ImplicitUserConversion): Use location
20656         even in the case when we are examining True operators.
20657  
20658         * class.cs (Operator::Define): Perform extensive checks to conform
20659         with the rules for operator overloading in the spec.
20660
20661         * expression.cs (Expression::ImplicitReferenceConversion): Implement
20662         some of the other conversions mentioned in the spec.
20663
20664         * typemanager.cs (array_type): New static member for the System.Array built-in
20665         type.
20666
20667         (cloneable_interface): For System.ICloneable interface.
20668
20669         * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
20670         we start resolving the tree and populating types.
20671
20672         * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
20673  
20674 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
20675
20676         * expression.cs (Expression::ExprClassFromMemberInfo,
20677         Expression::Literalize): Create literal expressions from
20678         FieldInfos which are literals.
20679
20680         (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
20681         type casts, because they were wrong.  The test suite in tests
20682         caught these ones.
20683
20684         (ImplicitNumericConversion): ushort to ulong requires a widening
20685         cast. 
20686
20687         Int32 constant to long requires widening cast as well.
20688
20689         * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
20690         for integers because the type on the stack is not i4.
20691
20692 2001-09-30  Miguel de Icaza  <miguel@ximian.com>
20693
20694         * expression.cs (report118): require location argument. 
20695
20696         * parameter.cs: Do not dereference potential null value.
20697
20698         * class.cs: Catch methods that lack the `new' keyword when
20699         overriding a name.  Report warnings when `new' is used without
20700         anything being there to override.
20701
20702         * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
20703
20704         * class.cs: Only add constructor to hashtable if it is non-null
20705         (as now constructors can fail on define).
20706
20707         (TypeManager, Class, Struct): Take location arguments.
20708
20709         Catch field instance initialization in structs as errors.
20710
20711         accepting_filter: a new filter for FindMembers that is static so
20712         that we dont create an instance per invocation.
20713
20714         (Constructor::Define): Catch errors where a struct constructor is
20715         parameterless 
20716
20717         * cs-parser.jay: Pass location information for various new
20718         constructs. 
20719
20720         * delegate.cs (Delegate): take a location argument.
20721
20722         * driver.cs: Do not call EmitCode if there were problesm in the
20723         Definition of the types, as many Builders wont be there. 
20724
20725         * decl.cs (Decl::Decl): Require a location argument.
20726
20727         * cs-tokenizer.cs: Handle properly hex constants that can not fit
20728         into integers, and find the most appropiate integer for it.
20729
20730         * literal.cs: Implement ULongLiteral.
20731
20732         * rootcontext.cs: Provide better information about the location of
20733         failure when CreateType fails.
20734
20735 2001-09-29  Miguel de Icaza  <miguel@ximian.com>
20736
20737         * rootcontext.cs (RootContext::PopulateTypes): Populates structs
20738         as well.
20739
20740         * expression.cs (Binary::CheckShiftArguments): Add missing type
20741         computation.
20742         (Binary::ResolveOperator): Add type to the logical and and logical
20743         or, Bitwise And/Or and Exclusive Or code paths, it was missing
20744         before.
20745
20746         (Binary::DoNumericPromotions): In the case where either argument
20747         is ulong (and most signed types combined with ulong cause an
20748         error) perform implicit integer constant conversions as well.
20749
20750 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
20751
20752         * expression.cs (UserImplicitCast): Method should always be
20753         non-null. 
20754         (Invocation::BetterConversion): Simplified test for IntLiteral.
20755
20756         (Expression::ImplicitNumericConversion): Split this routine out.
20757         Put the code that performs implicit constant integer conversions
20758         here. 
20759
20760         (Expression::Resolve): Become a wrapper around DoResolve so we can
20761         check eclass and type being set after resolve.
20762
20763         (Invocation::Badness): Remove this dead function
20764
20765         (Binary::ResolveOperator): Do not compute the expensive argumnets
20766         unless we have a union for it.
20767
20768         (Probe::Emit): Is needs to do an isinst and then
20769         compare against null.
20770
20771         (::CanConvert): Added Location argument.  If the Location argument
20772         is null (Location.Null), then we do not report errors.  This is
20773         used by the `probe' mechanism of the Explicit conversion.  We do
20774         not want to generate an error for something that the user
20775         explicitly requested to be casted.  But the pipeline for an
20776         explicit cast first tests for potential implicit casts.
20777
20778         So for now, if the Location is null, it means `Probe only' to
20779         avoid adding another argument.   Might have to revise this
20780         strategy later.
20781
20782         (ClassCast): New class used to type cast objects into arbitrary
20783         classes (used in Explicit Reference Conversions).
20784
20785         Implement `as' as well.
20786
20787         Reverted all the patches from Ravi below: they were broken:
20788
20789                 * The use of `level' as a mechanism to stop recursive
20790                   invocations is wrong.  That was there just to catch the
20791                   bug with a strack trace but not as a way of addressing
20792                   the problem.
20793
20794                   To fix the problem we have to *understand* what is going
20795                   on and the interactions and come up with a plan, not
20796                   just get things going.
20797
20798                 * The use of the type conversion cache that I proposed
20799                   last night had an open topic: How does this work across
20800                   protection domains.  A user defined conversion might not
20801                   be public in the location where we are applying the
20802                   conversion, a different conversion might be selected
20803                   (ie, private A->B (better) but public B->A (worse),
20804                   inside A, A->B applies, but outside it, B->A will
20805                   apply).
20806
20807                 * On top of that (ie, even if the above is solved),
20808                   conversions in a cache need to be abstract.  Ie, `To
20809                   convert from an Int to a Short use an OpcodeCast', not
20810                   `To convert from an Int to a Short use the OpcodeCast on
20811                   the variable 5' (which is what this patch was doing).
20812
20813 2001-09-28  Ravi Pratap  <ravi@ximian.com>
20814
20815         * expression.cs (Invocation::ConversionExists): Re-write to use
20816         the conversion cache
20817
20818         (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
20819         cache all conversions done, not just user-defined ones.
20820
20821         (Invocation::BetterConversion): The real culprit. Use ConversionExists
20822         to determine if a conversion exists instead of acutually trying to 
20823         perform the conversion. It's faster too.
20824
20825         (Expression::ConvertExplicit): Modify to use ConversionExists to check
20826         and only then attempt the implicit conversion.
20827
20828 2001-09-28  Ravi Pratap  <ravi@ximian.com>
20829
20830         * expression.cs (ConvertImplicit): Use a cache for conversions
20831         already found. Check level of recursion and bail out if necessary.
20832
20833 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
20834
20835         * typemanager.cs (string_concat_string_string, string_concat_object_object):
20836         Export standard methods that we expect for string operations.
20837
20838         * statement.cs (Block::UsageWarning): Track usage of variables and
20839         report the errors for not used variables.
20840
20841         * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
20842         operator. 
20843
20844 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
20845
20846         * codegen.cs: remove unnneded code 
20847
20848         * expression.cs: Removed BuiltinTypeAccess class
20849
20850         Fix the order in which implicit conversions are
20851         done.  
20852
20853         The previous fixed dropped support for boxed conversions (adding a
20854         test to the test suite now)
20855
20856         (UserImplicitCast::CanConvert): Remove test for source being null,
20857         that code is broken.  We should not feed a null to begin with, if
20858         we do, then we should track the bug where the problem originates
20859         and not try to cover it up here.
20860
20861         Return a resolved expression of type UserImplicitCast on success
20862         rather than true/false.  Ravi: this is what I was talking about,
20863         the pattern is to use a static method as a "constructor" for
20864         objects. 
20865
20866         Also, do not create arguments until the very last minute,
20867         otherwise we always create the arguments even for lookups that
20868         will never be performed. 
20869
20870         (UserImplicitCast::Resolve): Eliminate, objects of type
20871         UserImplicitCast are born in a fully resolved state. 
20872
20873         * typemanager.cs (InitCoreTypes): Init also value_type
20874         (System.ValueType). 
20875
20876         * expression.cs (Cast::Resolve): First resolve the child expression.
20877
20878         (LValue): Add new method AddressOf to be used by
20879         the `&' operator.  
20880
20881         Change the argument of Store to take an EmitContext instead of an
20882         ILGenerator, because things like FieldExpr need to be able to call
20883         their children expression to generate the instance code. 
20884
20885         (Expression::Error, Expression::Warning): Sugar functions for
20886         reporting errors.
20887
20888         (Expression::MemberLookup): Accept a TypeContainer instead of a
20889         Report as the first argument.
20890
20891         (Expression::ResolvePrimary): Killed.  I still want to improve
20892         this as currently the code is just not right.
20893
20894         (Expression::ResolveMemberAccess): Simplify, but it is still
20895         wrong. 
20896
20897         (Unary::Resolve): Catch errors in AddressOf operators.
20898
20899         (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
20900         index to a byte for the short-version, or the compiler will choose
20901         the wrong Emit call, which generates the wrong data.
20902
20903         (ParameterReference::Emit, ::Store): same.
20904
20905         (FieldExpr::AddressOf): Implement.
20906
20907         * typemanager.cs: TypeManager: made public variable instead of
20908         property.
20909
20910         * driver.cs: document --fatal.
20911
20912         * report.cs (ErrorMessage, WarningMessage): new names for the old
20913         Error and Warning classes.
20914
20915         * cs-parser.jay (member_access): Turn built-in access to types
20916         into a normal simplename
20917
20918 2001-09-27  Ravi Pratap  <ravi@ximian.com>
20919
20920         * expression.cs (Invocation::BetterConversion): Fix to cope
20921         with q being null, since this was introducing a bug.
20922
20923         * expression.cs (ConvertImplicit): Do built-in conversions first.
20924
20925 2001-09-27  Ravi Pratap  <ravi@ximian.com>
20926
20927         * expression.cs (UserImplicitCast::Resolve): Fix bug.
20928
20929 2001-09-27  Ravi Pratap  <ravi@ximian.com>
20930
20931         * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
20932         I had introduced long ago (what's new ?).
20933
20934         * expression.cs (UserImplicitCast::CanConvert): Static method to do 
20935         the work of all the checking. 
20936         (ConvertImplicit): Call CanConvert and only then create object if necessary.
20937         (UserImplicitCast::CanConvert, ::Resolve): Re-write.
20938
20939         (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
20940         that is the right way. 
20941
20942         (Invocation::MakeUnionSet): Convenience function to make unions of sets for 
20943         overloading resolution. Use everywhere instead of cutting and pasting code.
20944
20945         (Binary::ResolveOperator): Use MakeUnionSet.
20946
20947         (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when 
20948         we have to convert to bool types. Not complete yet.
20949
20950 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
20951
20952         * typemanager.cs (TypeManager::CSharpName): support ushort.
20953
20954         * expression.cs (Expression::TryImplicitIntConversion): Attempts
20955         to provide an expression that performsn an implicit constant int
20956         conversion (section 6.1.6).
20957         (Expression::ConvertImplicitRequired): Reworked to include
20958         implicit constant expression conversions.
20959
20960         (Expression::ConvertNumericExplicit): Finished.
20961
20962         (Invocation::Emit): If InstanceExpression is null, then it means
20963         that we perform a call on this.
20964
20965 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
20966
20967         * expression.cs (Unary::Emit): Remove some dead code.
20968         (Probe): Implement Resolve and Emit for `is'.
20969         (Expression::ConvertImplicitRequired): Attempt to do constant
20970         expression conversions here.  Maybe should be moved to
20971         ConvertImplicit, but I am not sure.
20972         (Expression::ImplicitLongConstantConversionPossible,
20973         Expression::ImplicitIntConstantConversionPossible): New functions
20974         that tell whether is it possible to apply an implicit constant
20975         expression conversion.
20976
20977         (ConvertNumericExplicit): Started work on explicit numeric
20978         conversions.
20979
20980         * cs-parser.jay: Update operator constants.
20981
20982         * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
20983         (Parameters::GetSignature): Hook up VerifyArgs here.
20984         (Parameters::VerifyArgs): Verifies that no two arguments have the
20985         same name. 
20986
20987         * class.cs (Operator): Update the operator names to reflect the
20988         ones that the spec expects (as we are just stringizing the
20989         operator names).
20990
20991         * expression.cs (Unary::ResolveOperator): Fix bug: Use
20992         MethodInfo's ReturnType instead of LookupMethodByBuilder as the
20993         previous usage did only work for our methods.
20994         (Expression::ConvertImplicit): Handle decimal implicit numeric
20995         conversions as well.
20996         (Expression::InternalTypeConstructor): Used to invoke constructors
20997         on internal types for default promotions.
20998
20999         (Unary::Emit): Implement special handling for the pre/post
21000         increment/decrement for overloaded operators, as they need to have
21001         the same semantics as the other operators.
21002
21003         (Binary::ResolveOperator): ditto.
21004         (Invocation::ConversionExists): ditto.
21005         (UserImplicitCast::Resolve): ditto.
21006
21007 2001-09-26  Ravi Pratap  <ravi@ximian.com>
21008
21009         * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
21010         operator, return after emitting body. Regression tests pass again !
21011
21012         * expression.cs (ConvertImplicit): Take TypeContainer as first argument
21013         (Unary::ForceConversion, Binary::ForceConversion): Ditto.
21014         (Invocation::OverloadResolve): Ditto.
21015         (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
21016
21017         * everywhere : update calls to the above methods accordingly.
21018
21019 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
21020
21021         * assign.cs (Assign): Make it inherit from ExpressionStatement.
21022
21023         * expression.cs (ExpressionStatement): New base class used for
21024         expressions that can appear in statements, so that we can provide
21025         an alternate path to generate expression that do not leave a value
21026         on the stack.
21027
21028         (Expression::Emit, and all the derivatives): We no longer return
21029         whether a value is left on the stack or not.  Every expression
21030         after being emitted leaves a single value on the stack.
21031
21032         * codegen.cs (EmitContext::EmitStatementExpression): Use the
21033         facilties of ExpressionStatement if possible.
21034
21035         * cs-parser.jay: Update statement_expression.
21036
21037 2001-09-25  Miguel de Icaza  <miguel@ximian.com>
21038
21039         * driver.cs: Change the wording of message
21040
21041 2001-09-25  Ravi Pratap  <ravi@ximian.com>
21042
21043         * expression.cs (Binary::ResolveOperator): Had forgottten to set 
21044         the type of the expression to the return type of the method if
21045         we have an overloaded operator match ! The regression tests pass again !
21046         (Unary::ResolveOperator): Ditto.
21047
21048         * expression.cs (Invocation::ConversionExists): Correct the member lookup
21049         to find "op_Implicit", not "implicit" ;-)
21050         (UserImplicitCast): New class to take care of user-defined implicit conversions.
21051         (ConvertImplicit, ForceConversion): Take TypeContainer argument
21052
21053         * everywhere : Correct calls to the above accordingly.
21054
21055         * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
21056         (ConvertImplicit): Do user-defined conversion if it exists.
21057
21058 2001-09-24  Miguel de Icaza  <miguel@ximian.com>
21059
21060         * assign.cs: track location.
21061         (Resolve): Use implicit conversions on assignment.
21062
21063         * literal.cs: Oops.  Not good, Emit of short access values should
21064         pass (Bytes) or the wrong argument will be selected.
21065
21066         * expression.cs (Unary::Emit): Emit code for -expr.
21067
21068         (Unary::ResolveOperator): Handle `Substract' for non-constants
21069         (substract from zero from the non-constants).
21070         Deal with Doubles as well. 
21071
21072         (Expression::ConvertImplicitRequired): New routine that reports an
21073         error if no implicit conversion exists. 
21074
21075         (Invocation::OverloadResolve): Store the converted implicit
21076         expressions if we make them
21077
21078 2001-09-24  Ravi Pratap  <ravi@ximian.com>
21079
21080         * class.cs (ConstructorInitializer): Take a Location argument.
21081         (ConstructorBaseInitializer): Same here.
21082         (ConstructorThisInitializer): Same here.
21083
21084         * cs-parser.jay : Update all calls accordingly.
21085
21086         * expression.cs (Unary, Binary, New): Take location argument.
21087         Update accordingly everywhere.
21088
21089         * cs-parser.jay : Update all calls to the above to take a location
21090         argument.
21091
21092         * class.cs : Ditto.
21093
21094 2001-09-24  Ravi Pratap  <ravi@ximian.com>
21095
21096         * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
21097         (Invocation::BetterConversion): Same here
21098         (Invocation::ConversionExists): Ditto.
21099
21100         (Invocation::ConversionExists): Implement.
21101
21102 2001-09-22  Ravi Pratap  <ravi@ximian.com>
21103
21104         * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
21105         Also take an additional TypeContainer argument.
21106
21107         * All over : Pass in TypeContainer as argument to OverloadResolve.
21108
21109         * typemanager.cs (CSharpName): Update to check for the string type and return
21110         that too.
21111
21112         * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
21113         a given method.
21114
21115 2001-09-21  Ravi Pratap  <ravi@ximian.com>
21116
21117         * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
21118         (Invocation::BetterFunction): Implement.
21119         (Invocation::BetterConversion): Implement.
21120         (Invocation::ConversionExists): Skeleton, no implementation yet.
21121
21122         Okay, things work fine !
21123
21124 2001-09-21  Miguel de Icaza  <miguel@ximian.com>
21125
21126         * typemanager.cs: declare and load enum_type, delegate_type and
21127         void_type. 
21128
21129         * expression.cs (Expression::Emit): Now emit returns a value that
21130         tells whether a value is left on the stack or not.  This strategy
21131         might be reveted tomorrow with a mechanism that would address
21132         multiple assignments.
21133         (Expression::report118): Utility routine to report mismatches on
21134         the ExprClass.
21135
21136         (Unary::Report23): Report impossible type/operator combination
21137         utility function.
21138
21139         (Unary::IsIncrementableNumber): Whether the type can be
21140         incremented or decremented with add.
21141         (Unary::ResolveOperator): Also allow enumerations to be bitwise
21142         complemented. 
21143         (Unary::ResolveOperator): Implement ++, !, ~,
21144
21145         (Invocation::Emit): Deal with new Emit convetion.
21146
21147         * All Expression derivatives: Updated their Emit method to return
21148         whether they leave values on the stack or not.
21149
21150         * codegen.cs (CodeGen::EmitStatement): Pop values left on the
21151         stack for expressions that are statements. 
21152
21153 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
21154
21155         * expression.cs (LValue): New interface.  Must be implemented by
21156         LValue objects.
21157         (LocalVariableReference, ParameterReference, FieldExpr): Implement
21158         LValue interface.
21159
21160         * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
21161         interface for generating code, simplifies the code.
21162
21163 2001-09-20  Ravi Pratap  <ravi@ximian.com>
21164
21165         * expression.cs (everywhere): Comment out return statements in ::Resolve
21166         methods to avoid the warnings.
21167
21168 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
21169
21170         * driver.cs (parse): Report error 2001 if we can not open the
21171         source file.
21172
21173         * expression.cs (SimpleName::ResolveSimpleName): Error if we can
21174         not resolve it.
21175
21176         * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
21177         object. 
21178
21179         * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
21180         otherwise nested blocks end up with the same index.
21181
21182         * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
21183
21184         * expression.cs:  Instead of having FIXMEs in the Resolve
21185         functions, throw exceptions so it is obvious that we are facing a
21186         bug. 
21187
21188         * cs-parser.jay (invocation_expression): Pass Location information.
21189
21190         * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
21191         Use a basename for those routines because .NET does not like paths
21192         on them. 
21193
21194         * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
21195         already defined.
21196
21197 2001-09-19  Miguel de Icaza  <miguel@ximian.com>
21198
21199         * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
21200         are loading the correct data types (throws an exception if not).
21201         (TypeManager::InitCoreTypes): Use CoreLookupType
21202
21203         * expression.cs (Unary::ResolveOperator): return the child
21204         expression for expressions which are just +expr.
21205         (Unary::ResolveOperator): Return negative literals for -LITERAL
21206         expressions (otherwise they are Unary {Literal}).
21207         (Invocation::Badness): Take into account `Implicit constant
21208         expression conversions'.
21209
21210         * literal.cs (LongLiteral): Implement long literal class.
21211         (IntLiteral): export the `Value' of the intliteral. 
21212
21213 2001-09-19  Ravi Pratap  <ravi@ximian.com>
21214
21215         * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
21216
21217         * class.cs (Operator::Define): Change the methodname prefix to 'op_' 
21218         instead of 'Operator'
21219
21220         * expression.cs (Binary::ResolveOperator): Update accordingly.
21221         (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
21222         and 'Minus'
21223
21224         * cs-parser.jay (unary_expression): Update to use the new names.
21225
21226         * gen-treedump.cs (GetUnary): Same here.
21227
21228         * expression.cs (Unary::Resolve): Implement.
21229         (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded 
21230         operators are found instead of making noise ;-)
21231         (Unary::ResolveOperator): New method to do precisely the same thing which
21232         Binary::ResolveOperator does for Binary expressions.
21233         (Unary.method, .Arguments): Add.
21234         (Unary::OperName): Implement.   
21235         (Unary::ForceConversion): Copy and Paste !
21236
21237         * class.cs (Operator::Define): Fix a small bug for the case when we have 
21238         a unary operator.
21239
21240         * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
21241         for the inbuilt operators. Only overloading works for now ;-)
21242
21243 2001-09-18  Miguel de Icaza  <miguel@ximian.com>
21244
21245         * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
21246         UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
21247
21248         * expression.cs (This::Emit): Implement. 
21249         (This::Resolve): Implement.
21250         (TypeOf:Resolve): Implement.
21251         (Expression::ResolveSimpleName): Add an implicit this to instance
21252         field references. 
21253         (MemberAccess::Resolve): Deal with Parameters and Fields. 
21254         Bind instance variable to Field expressions.
21255         (FieldExpr::Instance): New field used to track the expression that
21256         represents the object instance.
21257         (FieldExpr::Resolve): Track potential errors from MemberLookup not
21258         binding 
21259         (FieldExpr::Emit): Implement.
21260
21261         * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
21262         the last instruction contains a return opcode to avoid generating
21263         the last `ret' instruction (this generates correct code, and it is
21264         nice to pass the peverify output).
21265
21266         * class.cs (TypeContainer::EmitFieldInitializers): Implement field
21267         initializer for static and instance variables.
21268         (Constructor::Emit): Allow initializer to be null in the case of
21269         static constructors.  Only emit initializer for instance
21270         constructors. 
21271
21272         (TypeContainer::FindMembers): Return a null array if there are no
21273         matches.
21274
21275         Also fix the code for the MemberTypes.Method branch, as it was not
21276         scanning that for operators (or tried to access null variables before).
21277
21278         * assign.cs (Assign::Emit): Handle instance and static fields. 
21279
21280         * TODO: Updated.
21281
21282         * driver.cs: Stop compilation if there are parse errors.
21283
21284         * cs-parser.jay (constructor_declaration): Provide default base
21285         initializer for non-static constructors.
21286         (constructor_declarator): Do not provide a default base
21287         initializers if none was specified.
21288         Catch the fact that constructors should not have parameters.
21289
21290         * class.cs: Do not emit parent class initializers for static
21291         constructors, that should be flagged as an error.
21292
21293 2001-09-18  Ravi Pratap  <ravi@ximian.com>
21294
21295         * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
21296         Move back code into TypeContainer::Populate.
21297
21298 2001-09-18  Ravi Pratap  <ravi@ximian.com>
21299
21300         * class.cs (TypeContainer::AddConstructor): Fix the check to
21301         compare against Name, not Basename. 
21302         (Operator::OpType): Change Plus and Minus to Add and Subtract.
21303
21304         * cs-parser.jay : Update accordingly.
21305
21306         * class.cs (TypeContainer::FindMembers): For the case where we are searching
21307         for methods, don't forget to look into the operators too.
21308         (RegisterMethodBuilder): Helper method to take care of this for
21309         methods, constructors and operators.
21310         (Operator::Define): Completely revamp.
21311         (Operator.OperatorMethod, MethodName): New fields.
21312         (TypeContainer::Populate): Move the registering of builders into
21313         RegisterMethodBuilder.
21314         (Operator::Emit): Re-write.
21315
21316         * expression.cs (Binary::Emit): Comment out code path to emit method
21317         invocation stuff for the case when we have a user defined operator. I am
21318         just not able to get it right !
21319
21320 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
21321
21322         * expression.cs (Expression::OverloadResolve): Drop TypeContainer
21323         argument. 
21324
21325         (Expression::MemberLookup): Provide a version that allows to
21326         specify the MemberTypes and BindingFlags. 
21327
21328         * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
21329         so it was not fetching variable information from outer blocks.
21330
21331         * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
21332         Beforefieldinit as it was buggy.
21333
21334         * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
21335         that Ravi put here.  
21336
21337         * class.cs (Constructor::Emit): Only emit if block is not null.
21338         (TypeContainer::EmitDefaultConstructor): Removed routine, now we
21339         deal with this by semantically definining it as if the user had
21340         done it.
21341
21342         (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
21343         constructors as we now "emit" them at a higher level.
21344
21345         (TypeContainer::DefineDefaultConstructor): Used to define the
21346         default constructors if none was provided.
21347
21348         (ConstructorInitializer): Add methods Resolve and Emit. 
21349
21350         * expression.cs: Cast to ConstructorInfo instead of MethodInfo
21351
21352 2001-09-17  Ravi Pratap  <ravi@ximian.com>
21353
21354         * class.cs (TypeContainer::EmitDefaultConstructor): Register
21355         the default constructor builder with our hashtable for methodbuilders
21356         to methodcores.
21357
21358         * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
21359         and argument_count is 0 in which case we have a match.
21360         (Binary::ResolveOperator): More null checking and miscellaneous coding
21361         style cleanup.
21362
21363 2001-09-17  Ravi Pratap  <ravi@ximian.com>
21364
21365         * rootcontext.cs (IsNameSpace): Compare against null.
21366
21367         * everywhere : Correct spelling to 'Greater' and to 'Subtract'
21368
21369         * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
21370         and Unary::Operator.
21371
21372         * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
21373         accordingly.
21374
21375         * expression.cs (Binary::method): New member to hold the MethodBase for the case when
21376         we have overloaded operators.
21377         (Binary::ResolveOperator): Implement the part which does the operator overload
21378         resolution.
21379
21380         * class.cs (Operator::Emit): Implement.
21381         (TypeContainer::Emit): Emit the operators we have too.
21382
21383         * expression.cs (Binary::Emit): Update to emit the appropriate code for
21384         the case when we have a user-defined operator.
21385
21386 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
21387
21388         * rootcontext.cs: Fix bug: tree.Namespaces might be null.
21389
21390 2001-09-16  Ravi Pratap  <ravi@ximian.com>
21391
21392         * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
21393         (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
21394         (Constructor::Emit): Implement.
21395         (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
21396         if we have no work to do. 
21397         (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's 
21398         Emit method.
21399
21400         * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
21401         (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
21402
21403         * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
21404         of parent.parent.
21405
21406 2001-09-15  Ravi Pratap  <ravi@ximian.com>
21407
21408         * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
21409         in the source.
21410         (Tree::RecordNamespace): Method to do what the name says ;-)
21411         (Tree::Namespaces): Property to get at the namespaces hashtable.
21412
21413         * cs-parser.jay (namespace_declaration): Call RecordNamespace to 
21414         keep track.
21415
21416         * rootcontext.cs (IsNamespace): Fixed it :-)
21417
21418 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
21419
21420         * class.cs (TypeContainer::FindMembers): Add support for
21421         constructors. 
21422         (MethodCore): New class that encapsulates both the shared aspects
21423         of a Constructor and a Method.  
21424         (Method, Constructor): Factored pieces into MethodCore.
21425
21426         * driver.cs: Added --fatal which makes errors throw exceptions.
21427         Load System assembly as well as part of the standard library.
21428
21429         * report.cs: Allow throwing exceptions on errors for debugging.
21430
21431         * modifiers.cs: Do not use `parent', instead use the real type
21432         container to evaluate permission settings.
21433
21434         * class.cs: Put Ravi's patch back in.  He is right, and we will
21435         have to cope with the
21436
21437 2001-09-14  Ravi Pratap  <ravi@ximian.com>
21438
21439         * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
21440         FamORAssem, not FamANDAssem.
21441
21442 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
21443
21444         * driver.cs: Added --parse option that only parses its input files
21445         and terminates.
21446
21447         * class.cs: Reverted last change from Ravi to IsTopLevel.  That is
21448         incorrect.  IsTopLevel is not used to tell whether an object is
21449         root_types or not (that can be achieved by testing this ==
21450         root_types).  But to see if this is a top-level *class* (not
21451         necessarly our "toplevel" container). 
21452
21453 2001-09-14  Ravi Pratap  <ravi@ximian.com>
21454
21455         * enum.cs (Enum::Define): Modify to call the Lookup method on the
21456         parent instead of a direct call to GetType.
21457
21458 2001-09-14  Ravi Pratap  <ravi@ximian.com>
21459
21460         * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
21461         Modifiers.TypeAttr. This should just be a call to that method.
21462
21463         * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
21464         object so that we can determine if we are top-level or not.
21465
21466         * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the 
21467         TypeContainer too.
21468
21469         * enum.cs (Enum::Define): Ditto.
21470
21471         * modifiers.cs (FieldAttr): Re-write.
21472
21473         * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
21474         (TypeContainer::HaveStaticConstructor): New property to provide access
21475         to precisely that info.
21476
21477         * modifiers.cs (MethodAttr): Re-write.
21478         (EventAttr): Remove altogether as there seems to be no ostensible use for it.
21479
21480         * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
21481         of top-level types as claimed.
21482
21483 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
21484
21485         * expression.cs (MemberLookup): Fruitless attempt to lookup
21486         constructors.  Maybe I need to emit default constructors?  That
21487         might be it (currently .NET emits this for me automatically).
21488         (Invocation::OverloadResolve): Cope with Arguments == null.
21489         (Invocation::EmitArguments): new function, shared by the new
21490         constructor and us.
21491         (Invocation::Emit): Handle static and instance methods.  Emit
21492         proper call instruction for virtual or non-virtual invocations.
21493         (New::Emit): Implement.
21494         (New::Resolve): Implement.
21495         (MemberAccess:Resolve): Implement.
21496         (MethodGroupExpr::InstanceExpression): used conforming to the spec
21497         to track instances.
21498         (FieldExpr::Resolve): Set type.
21499
21500         * support.cs: Handle empty arguments.
21501                 
21502         * cs-parser.jay (CompositeLookup, QualifierIdentifier,
21503         SimpleLookup): Auxiliary routines to help parse a qualifier
21504         identifier.  
21505
21506         Update qualifier_identifier rule.
21507
21508         * codegen.cs: Removed debugging messages.
21509
21510         * class.cs: Make this a global thing, this acts just as a "key" to
21511         objects that we might have around.
21512
21513         (Populate): Only initialize method_builders_to_methods once.
21514
21515         * expression.cs (PropertyExpr): Initialize type from the
21516         PropertyType. 
21517
21518         * codegen.cs (EmitContext::EmitBoolExpression): Use propper
21519         Resolve pattern.  Attempt to implicitly convert value to boolean.
21520         Emit code.
21521
21522         * expression.cs: Set the type for the int32/int32 argument case.
21523         (Binary::ResolveOperator): Set the return type to boolean for
21524         comparission operators
21525
21526         * typemanager.cs: Remove debugging print code.
21527
21528         (Invocation::Resolve): resolve type.
21529
21530         * class.cs: Allocate a MemberInfo of the correct size, as the code
21531         elsewhere depends on the test to reflect the correct contents.
21532
21533         (Method::) Keep track of parameters, due to System.Reflection holes
21534
21535         (TypeContainer::Populate): Keep track of MethodBuilders to Method
21536         mapping here.
21537
21538         (TypeContainer::FindMembers): Use ArrayList and then copy an array
21539         of the exact size and return that.
21540
21541         (Class::LookupMethodByBuilder): New function that maps
21542         MethodBuilders to its methods.  Required to locate the information
21543         on methods because System.Reflection bit us again.
21544
21545         * support.cs: New file, contains an interface ParameterData and
21546         two implementations: ReflectionParameters and InternalParameters
21547         used to access Parameter information.  We will need to grow this
21548         as required.
21549
21550         * expression.cs (Invocation::GetParameterData): implement a cache
21551         and a wrapper around the ParameterData creation for methods. 
21552         (Invocation::OverloadResolve): Use new code.
21553
21554 2001-09-13  Ravi Pratap  <ravi@ximian.com>
21555
21556         * class.cs (TypeContainer::EmitField): Remove and move into 
21557         (Field::Define): here and modify accordingly.
21558         (Field.FieldBuilder): New member.
21559         (TypeContainer::Populate): Update accordingly.
21560         (TypeContainer::FindMembers): Implement.
21561
21562 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
21563
21564         * statement.cs: (VariableInfo::VariableType): New field to be
21565         initialized with the full type once it is resolved. 
21566
21567 2001-09-12  Miguel de Icaza  <miguel@ximian.com>
21568
21569         * parameter.cs (GetParameterInfo): Use a type cache to compute
21570         things only once, and to reuse this information
21571
21572         * expression.cs (LocalVariableReference::Emit): Implement.
21573         (OpcodeCast::Emit): fix.
21574
21575         (ParameterReference::Resolve): Implement.
21576         (ParameterReference::Emit): Implement.
21577
21578         * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
21579         that are expressions need to stay as Expressions.
21580
21581         * typemanager.cs (CSharpName): Returns the C# name of a type if
21582         possible. 
21583
21584         * expression.cs (Expression::ConvertImplicit): New function that
21585         implements implicit type conversions.
21586
21587         (Expression::ImplicitReferenceConversion): Implements implicit
21588         reference conversions.
21589
21590         (EmptyCast): New type for transparent casts.
21591
21592         (OpcodeCast): New type for casts of types that are performed with
21593         a sequence of bytecodes.
21594
21595         (BoxedCast): New type used for casting value types into reference
21596         types.  Emits a box opcode.
21597
21598         (Binary::DoNumericPromotions): Implements numeric promotions of
21599         and computation of the Binary::Type.
21600
21601         (Binary::EmitBranchable): Optimization.
21602
21603         (Binary::Emit): Implement code emission for expressions.
21604
21605         * typemanager.cs (TypeManager): Added two new core types: sbyte
21606         and byte.
21607
21608 2001-09-12  Ravi Pratap  <ravi@ximian.com>
21609
21610         * class.cs (TypeContainer::FindMembers): Method which does exactly
21611         what Type.FindMembers does, only we don't have to use reflection. No
21612         implementation yet.
21613
21614         * typemanager.cs (typecontainers): New hashtable to hold the corresponding
21615         typecontainer objects as we need to get at them.
21616         (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
21617
21618         * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
21619         typecontainer object.
21620
21621         * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
21622         of just a Report object.
21623
21624 2001-09-11  Ravi Pratap  <ravi@ximian.com>
21625
21626         * class.cs (Event::Define): Go back to using the prefixes "add_" and
21627         "remove_"
21628         (TypeContainer::Populate): Now define the delegates of the type too.
21629         (TypeContainer.Delegates): Property to access the list of delegates defined
21630         in the type.
21631
21632         * delegates.cs (Delegate::Define): Implement partially.
21633
21634         * modifiers.cs (TypeAttr): Handle more flags.
21635
21636 2001-09-11  Ravi Pratap  <ravi@ximian.com>
21637
21638         * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
21639         and not <=
21640         (Operator::Define): Re-write logic to get types by using the LookupType method
21641         instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
21642         (Indexer::Define): Ditto.
21643         (Event::Define): Ditto.
21644         (Property::Define): Ditto.
21645
21646 2001-09-10  Ravi Pratap  <ravi@ximian.com>
21647
21648         * class.cs (TypeContainer::Populate): Now define operators too. 
21649         (TypeContainer.Operators): New property to access the list of operators
21650         in a type.
21651         (Operator.OperatorMethodBuilder): New member to hold the method builder
21652         for the operator we are defining.
21653         (Operator::Define): Implement.
21654
21655 2001-09-10  Ravi Pratap  <ravi@ximian.com>
21656
21657         * class.cs (Event::Define): Make the prefixes of the accessor methods
21658         addOn_ and removeOn_ 
21659
21660         * genericparser.cs (GenericParser::error): Overloaded method to handle the case
21661         of the location being passed in too. Ideally, this should go later since all
21662         error reporting should be done through the Report object.
21663
21664         * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
21665         (Populate): Iterate thru the indexers we have and define them too.
21666         (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
21667         for the get and set accessors.
21668         (Indexer::Define): Implement.
21669
21670 2001-09-09  Miguel de Icaza  <miguel@ximian.com>
21671
21672         * expression.cs (Binary::Resolve): Beginning of it.  I scratched
21673         my previous implementation, did not work.
21674
21675         * typemanager.cs: Add a couple of missing types (the longs).
21676
21677         * literal.cs: Use TypeManager.bool_type instead of getting it.
21678
21679         * expression.cs (EventExpr): New kind of expressions.
21680         (Expressio::ExprClassFromMemberInfo): finish
21681
21682 2001-09-08  Miguel de Icaza  <miguel@ximian.com>
21683
21684         * assign.cs: Emit stores to static fields differently.
21685
21686 2001-09-08  Ravi Pratap  <ravi@ximian.com>
21687
21688         * Merge in changes and adjust code to tackle conflicts. Backed out my
21689         code in Assign::Resolve ;-) 
21690
21691 2001-09-08  Ravi Pratap  <ravi@ximian.com>
21692
21693         * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
21694         instead Report.Error and also pass in the location.
21695         (CSharpParser::Lexer): New readonly property to return the reference
21696         to the Tokenizer object.
21697         (declare_local_variables): Use Report.Error with location instead of plain 
21698         old error.
21699         (CheckDef): Ditto.
21700
21701         * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
21702         (Operator.CheckBinaryOperator): Ditto.
21703
21704         * cs-parser.jay (operator_declarator): Update accordingly.
21705
21706         * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
21707         (CheckBinaryOperator): Same here.
21708
21709         * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
21710         on the name without any prefixes of namespace names etc. This is because we
21711         already might have something already fully qualified like 
21712         'System.Console.WriteLine'
21713
21714         * assign.cs (Resolve): Begin implementation. Stuck ;-)
21715
21716 2001-09-07  Ravi Pratap  <ravi@ximian.com>
21717
21718         * cs-tokenizer.cs (location): Return a string which also contains
21719         the file name.
21720
21721         * expression.cs (ElementAccess): New class for expressions of the
21722         type 'element access.'
21723         (BaseAccess): New class for expressions of the type 'base access.'
21724         (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
21725         respectively.
21726
21727         * cs-parser.jay (element_access): Implement action.
21728         (base_access): Implement actions.
21729         (checked_expression, unchecked_expression): Implement.
21730
21731         * cs-parser.jay (local_variable_type): Correct and implement.
21732         (type_suffixes, type_suffix_list, type_suffix): Implement actions.
21733
21734         * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
21735
21736         * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
21737         name and the specifiers.
21738
21739         * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
21740
21741         * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of 
21742         making them all public ;-)
21743
21744         * cs-parser.jay (error): Remove entirely as we have an implementation in the base
21745         class anyways.
21746
21747 2001-09-07  Miguel de Icaza  <miguel@ximian.com>
21748
21749         * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
21750         PropertyExprs.
21751         (FieldExpr, PropertyExprs): New resolved expressions.
21752         (SimpleName::MemberStaticCheck): Perform static checks for access
21753         to non-static fields on static methods. Maybe this should be
21754         generalized for MemberAccesses. 
21755         (SimpleName::ResolveSimpleName): More work on simple name
21756         resolution. 
21757
21758         * cs-parser.jay (primary_expression/qualified_identifier): track
21759         the parameter index.
21760
21761         * codegen.cs (CodeGen::Save): Catch save exception, report error.
21762         (EmitContext::EmitBoolExpression): Chain to expression generation
21763         instead of temporary hack.
21764         (::EmitStatementExpression): Put generic expression code generation.
21765
21766         * assign.cs (Assign::Emit): Implement variable assignments to
21767         local variables, parameters and fields.
21768
21769 2001-09-06  Miguel de Icaza  <miguel@ximian.com>
21770
21771         * statement.cs (Block::GetVariableInfo): New method, returns the
21772         VariableInfo for a variable name in a block.
21773         (Block::GetVariableType): Implement in terms of GetVariableInfo
21774
21775         * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
21776         DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
21777
21778 2001-09-06  Ravi Pratap  <ravi@ximian.com>
21779
21780         * cs-parser.jay (operator_declaration): Continue on my quest : update
21781         to take attributes argument.
21782         (event_declaration): Ditto.
21783         (enum_declaration): Ditto.
21784         (indexer_declaration): Ditto.
21785
21786         * class.cs (Operator::Operator): Update constructor accordingly.
21787         (Event::Event): Ditto.
21788
21789         * delegate.cs (Delegate::Delegate): Same here.
21790
21791         * enum.cs (Enum::Enum): Same here.
21792
21793 2001-09-05  Ravi Pratap  <ravi@ximian.com>
21794
21795         * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
21796
21797         * ../tests/cs0658.cs : New file to demonstrate error 0658.
21798
21799         * attribute.cs (Attributes): New class to encapsulate all attributes which were
21800         being passed around as an arraylist.
21801         (Attributes::AddAttribute): Method to add attribute sections.
21802
21803         * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
21804         (struct_declaration): Update accordingly.
21805         (constant_declaration): Update.
21806         (field_declaration): Update.
21807         (method_header): Update.
21808         (fixed_parameter): Update.
21809         (parameter_array): Ditto.
21810         (property_declaration): Ditto.
21811         (destructor_declaration): Ditto.
21812
21813         * class.cs (Struct::Struct): Update constructors accordingly.
21814         (Class::Class): Ditto.
21815         (Field::Field): Ditto.
21816         (Method::Method): Ditto.
21817         (Property::Property): Ditto.
21818         (TypeContainer::OptAttribute): update property's return type.
21819
21820         * interface.cs (Interface.opt_attributes): New member.
21821         (Interface::Interface): Update to take the extra Attributes argument.
21822
21823         * parameter.cs (Parameter::Parameter): Ditto.
21824
21825         * constant.cs (Constant::Constant): Ditto.
21826
21827         * interface.cs (InterfaceMemberBase): New OptAttributes field.
21828         (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take 
21829         the attributes as a parameter.
21830         (InterfaceProperty): Update constructor call.
21831         (InterfaceEvent): Ditto.
21832         (InterfaceMethod): Ditto.
21833         (InterfaceIndexer): Ditto.
21834
21835         * cs-parser.jay (interface_indexer_declaration): Update call to constructor to 
21836         pass the attributes too.
21837         (interface_event_declaration): Ditto.
21838         (interface_property_declaration): Ditto.
21839         (interface_method_declaration): Ditto.
21840         (interface_declaration): Ditto.
21841
21842 2001-09-05  Miguel de Icaza  <miguel@ximian.com>
21843
21844         * class.cs (Method::Define): Track the "static Main" definition to
21845         create an entry point. 
21846
21847         * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
21848         EntryPoint if we find it. 
21849
21850         * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
21851         (EmitContext::ig): Make this variable public.
21852
21853         * driver.cs: Make the default output file be the first file name
21854         with the .exe extension.  
21855
21856         Detect empty compilations
21857
21858         Handle various kinds of output targets.  Handle --target and
21859         rename -t to --dumper.
21860
21861         * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
21862         methods inherited from Expression return now an Expression.  This
21863         will is used during the tree rewriting as we resolve them during
21864         semantic analysis.
21865
21866         (Expression::MemberLookup): Implements the MemberLookup (7.3) from
21867         the spec.  Missing entirely is the information about
21868         accessability of elements of it.
21869
21870         (Expression::ExprClassFromMemberInfo): New constructor for
21871         Expressions that creates a fully initialized Expression based on
21872         a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
21873         a Type.
21874
21875         (Invocation::Resolve): Begin implementing resolution of invocations.
21876
21877         * literal.cs (StringLiteral):  Implement Emit.
21878
21879 2001-09-05  Ravi Pratap  <ravi@ximian.com>
21880
21881         * cs-parser.jay (error): Add new modifier because we are hiding an inherited
21882         member.
21883
21884 2001-09-04  Ravi Pratap  <ravi@ximian.com>
21885
21886         * cs-parser.jay (attribute_arguments): Implement actions.
21887         (attribute): Fix bug in production. Implement action.
21888         (attribute_list): Implement.
21889         (attribute_target): Implement.
21890         (attribute_target_specifier, opt_target_specifier): Implement
21891         (CheckAttributeTarget): New method to check if the attribute target
21892         is valid.
21893         (attribute_section): Implement.
21894         (opt_attributes): Implement.
21895
21896         * attribute.cs : New file to handle attributes.
21897         (Attribute): Class to hold attribute info.
21898
21899         * cs-parser.jay (opt_attribute_target_specifier): Remove production
21900         (attribute_section): Modify production to use 2 different rules to 
21901         achieve the same thing. 1 s/r conflict down !
21902         Clean out commented, useless, non-reducing dimension_separator rules.
21903
21904         * class.cs (TypeContainer.attributes): New member to hold list
21905         of attributes for a type.
21906         (Struct::Struct): Modify to take one more argument, the attribute list.
21907         (Class::Class): Ditto.
21908         (Field::Field): Ditto.
21909         (Method::Method): Ditto.
21910         (Property::Property): Ditto.
21911
21912         * cs-parser.jay (struct_declaration): Update constructor call to
21913         pass in the attributes too.
21914         (class_declaration): Ditto.
21915         (constant_declaration): Ditto.
21916         (field_declaration): Ditto.
21917         (method_header): Ditto.
21918         (fixed_parameter): Ditto.
21919         (parameter_array): Ditto.
21920         (property_declaration): Ditto.
21921
21922         * constant.cs (Constant::Constant): Update constructor similarly.
21923         Use System.Collections.
21924
21925         * parameter.cs (Parameter::Parameter): Update as above.
21926
21927 2001-09-02  Ravi Pratap  <ravi@ximian.com>
21928
21929         * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
21930         (TypeContainer.delegates): New member to hold list of delegates.
21931
21932         * cs-parser.jay (delegate_declaration): Implement the action correctly 
21933         this time as I seem to be on crack ;-)
21934
21935 2001-09-02  Miguel de Icaza  <miguel@ximian.com>
21936
21937         * rootcontext.cs (RootContext::IsNamespace): new function, used to
21938         tell whether an identifier represents a namespace.
21939
21940         * expression.cs (NamespaceExpr): A namespace expression, used only
21941         temporarly during expression resolution.
21942         (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
21943         utility functions to resolve names on expressions.
21944
21945 2001-09-01  Miguel de Icaza  <miguel@ximian.com>
21946
21947         * codegen.cs: Add hook for StatementExpressions. 
21948
21949         * class.cs: Fix inverted test for static flag in methods.
21950
21951 2001-09-02  Ravi Pratap  <ravi@ximian.com>
21952
21953         * class.cs (Operator::CheckUnaryOperator): Correct error number used
21954         to make it coincide with MS' number.
21955         (Operator::CheckBinaryOperator): Ditto.
21956
21957         * ../errors/errors.txt : Remove error numbers added earlier.
21958
21959         * ../errors/cs1019.cs : Test case for error # 1019
21960
21961         * ../errros/cs1020.cs : Test case for error # 1020
21962
21963         * cs-parser.jay : Clean out commented cruft.
21964         (dimension_separators, dimension_separator): Comment out. Ostensibly not
21965         used anywhere - non-reducing rule.
21966         (namespace_declarations): Non-reducing rule - comment out.
21967
21968         * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
21969         with TypeContainer::AddEnum.
21970
21971         * delegate.cs : New file for delegate handling classes.
21972         (Delegate): Class for declaring delegates.
21973
21974         * makefile : Update.
21975
21976         * cs-parser.jay (delegate_declaration): Implement.
21977
21978 2001-09-01  Ravi Pratap  <ravi@che.iitm.ac.in>
21979
21980         * class.cs (Event::Define): Implement.
21981         (Event.EventBuilder): New member.
21982
21983         * class.cs (TypeContainer::Populate): Update to define all enums and events
21984         we have.
21985         (Events): New property for the events arraylist we hold. Shouldn't we move to using
21986         readonly fields for all these cases ?
21987
21988 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
21989
21990         * class.cs (Property): Revamp to use the convention of making fields readonly.
21991         Accordingly modify code elsewhere.
21992
21993         * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
21994         the Define method of the Property class.
21995
21996         * class.cs : Clean up applied patch and update references to variables etc. Fix 
21997         trivial bug.
21998         (TypeContainer::Populate): Update to define all the properties we have. Also
21999         define all enumerations.
22000
22001         * enum.cs (Define): Implement.
22002
22003 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
22004
22005         * cs-parser.jay (overloadable_operator): The semantic value is an
22006         enum of the Operator class.
22007         (operator_declarator): Implement actions.
22008         (operator_declaration): Implement.
22009
22010         * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
22011         validity of definitions.
22012         (Operator::CheckBinaryOperator): Static method to check for binary operators
22013         (TypeContainer::AddOperator): New method to add an operator to a type.
22014
22015         * cs-parser.jay (indexer_declaration): Added line to actually call the
22016         AddIndexer method so it gets added ;-)
22017
22018         * ../errors/errors.txt : Update to include new error numbers. Are these numbers 
22019         already taken care of by the MS compiler ?  
22020
22021 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
22022
22023         * class.cs (Operator): New class for operator declarations.
22024         (Operator::OpType): Enum for the various operators.
22025
22026 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
22027
22028         * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
22029         ostensibly handle this in semantic analysis.
22030
22031         * cs-parser.jay (general_catch_clause): Comment out
22032         (specific_catch_clauses, specific_catch_clause): Ditto.
22033         (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
22034         (catch_args, opt_catch_args): New productions.
22035         (catch_clause): Rewrite to use the new productions above
22036         (catch_clauses): Modify accordingly.
22037         (opt_catch_clauses): New production to use in try_statement
22038         (try_statement): Revamp. Basically, we get rid of one unnecessary rule
22039         and re-write the code in the actions to extract the specific and
22040         general catch clauses by being a little smart ;-)
22041
22042         * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
22043         Hooray, try and catch statements parse fine !
22044
22045 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
22046
22047         * statement.cs (Block::GetVariableType): Fix logic to extract the type
22048         string from the hashtable of variables.
22049
22050         * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
22051         I end up making that mistake ;-)
22052         (catch_clauses): Fixed gross error which made Key and Value of the 
22053         DictionaryEntry the same : $1 !!
22054
22055 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
22056
22057         * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
22058
22059         * cs-parser.jay (event_declaration): Correct to remove the semicolon
22060         when the add and remove accessors are specified. 
22061
22062 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
22063
22064         * cs-parser.jay (IndexerDeclaration): New helper class to hold
22065         information about indexer_declarator.
22066         (indexer_declarator): Implement actions.
22067         (parsing_indexer): New local boolean used to keep track of whether
22068         we are parsing indexers or properties. This is necessary because 
22069         implicit_parameters come into picture even for the get accessor in the 
22070         case of an indexer.
22071         (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
22072
22073         * class.cs (Indexer): New class for indexer declarations.
22074         (TypeContainer::AddIndexer): New method to add an indexer to a type.
22075         (TypeContainer::indexers): New member to hold list of indexers for the
22076         type.
22077
22078 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
22079
22080         * cs-parser.jay (add_accessor_declaration): Implement action.
22081         (remove_accessor_declaration): Implement action.
22082         (event_accessors_declaration): Implement
22083         (variable_declarators): swap statements for first rule - trivial.
22084
22085         * class.cs (Event): New class to hold information about event
22086         declarations.
22087         (TypeContainer::AddEvent): New method to add an event to a type
22088         (TypeContainer::events): New member to hold list of events.
22089
22090         * cs-parser.jay (event_declaration): Implement actions.
22091
22092 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
22093
22094         * cs-parser.jay (dim_separators): Implement. Make it a string
22095         concatenating all the commas together, just as they appear.
22096         (opt_dim_separators): Modify accordingly
22097         (rank_specifiers): Update accordingly. Basically do the same
22098         thing - instead, collect the brackets here.
22099         (opt_rank_sepcifiers): Modify accordingly.
22100         (array_type): Modify to actually return the complete type string
22101         instead of ignoring the rank_specifiers.
22102         (expression_list): Implement to collect the expressions
22103         (variable_initializer): Implement. We make it a list of expressions
22104         essentially so that we can handle the array_initializer case neatly too.
22105         (variable_initializer_list): Implement.
22106         (array_initializer): Make it a list of variable_initializers
22107         (opt_array_initializer): Modify accordingly.
22108
22109         * expression.cs (New::NType): Add enumeration to help us
22110         keep track of whether we have an object/delegate creation
22111         or an array creation.
22112         (New:NewType, New::Rank, New::Indices, New::Initializers): New
22113         members to hold data about array creation.
22114         (New:New): Modify to update NewType
22115         (New:New): New Overloaded contructor for the array creation
22116         case.
22117
22118         * cs-parser.jay (array_creation_expression): Implement to call
22119         the overloaded New constructor.
22120
22121 2001-08-26  Ravi Pratap  <ravi@che.iitm.ac.in>
22122
22123         * class.cs (TypeContainer::Constructors): Return member
22124         constructors instead of returning null.
22125
22126 2001-08-26  Miguel de Icaza  <miguel@ximian.com>
22127
22128         * typemanager.cs (InitCoreTypes): Initialize the various core
22129         types after we have populated the type manager with the user
22130         defined types (this distinction will be important later while
22131         compiling corlib.dll)
22132
22133         * expression.cs, literal.cs, assign.cs, constant.cs: Started work
22134         on Expression Classification.  Now all expressions have a method
22135         `Resolve' and a method `Emit'.
22136
22137         * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
22138         generation from working.     Also add some temporary debugging
22139         code. 
22140
22141 2001-08-24  Miguel de Icaza  <miguel@ximian.com>
22142
22143         * codegen.cs: Lots of code generation pieces.  This is only the
22144         beginning, will continue tomorrow with more touches of polish.  We
22145         handle the fundamentals of if, while, do, for, return.  Others are
22146         trickier and I need to start working on invocations soon.
22147
22148         * gen-treedump.cs: Bug fix, use s.Increment here instead of
22149         s.InitStatement. 
22150
22151         * codegen.cs (EmitContext): New struct, used during code
22152         emission to keep a context.   Most of the code generation will be
22153         here. 
22154
22155         * cs-parser.jay: Add embedded blocks to the list of statements of
22156         this block.  So code generation proceeds in a top down fashion.
22157
22158 2001-08-23  Miguel de Icaza  <miguel@ximian.com>
22159
22160         * statement.cs: Add support for multiple child blocks.
22161
22162 2001-08-22  Miguel de Icaza  <miguel@ximian.com>
22163
22164         * codegen.cs (EmitCode): New function, will emit the code for a
22165         Block of code given a TypeContainer and its ILGenerator. 
22166
22167         * statement.cs (Block): Standard public readonly optimization.
22168         (Block::Block constructors): Link children. 
22169         (Block::Child): Child Linker.
22170         (Block::EmitVariables): Emits IL variable declarations.
22171
22172         * class.cs: Drop support for MethodGroups here, delay until
22173         Semantic Analysis.
22174         (Method::): Applied the same simplification that I did before, and
22175         move from Properties to public readonly fields.
22176         (Method::ParameterTypes): Returns the parameter types for the
22177         function, and implements a cache that will be useful later when I
22178         do error checking and the semantic analysis on the methods is
22179         performed.
22180         (Constructor::GetCallingConvention): Renamed from CallingConvetion
22181         and made a method, optional argument tells whether this is a class
22182         or a structure to apply the `has-this' bit.
22183         (Method::GetCallingConvention): Implement, returns the calling
22184         convention. 
22185         (Method::Define): Defines the type, a second pass is performed
22186         later to populate the methods.
22187
22188         (Constructor::ParameterTypes): implement a cache similar to the
22189         one on Method::ParameterTypes, useful later when we do semantic
22190         analysis. 
22191
22192         (TypeContainer::EmitMethod):  New method.  Emits methods.
22193
22194         * expression.cs: Removed MethodGroup class from here.
22195
22196         * parameter.cs (Parameters::GetCallingConvention): new method.
22197
22198 2001-08-21  Miguel de Icaza  <miguel@ximian.com>
22199
22200         * class.cs (TypeContainer::Populate): Drop RootContext from the
22201         argument. 
22202
22203         (Constructor::CallingConvention): Returns the calling convention.
22204         (Constructor::ParameterTypes): Returns the constructor parameter
22205         types. 
22206
22207         (TypeContainer::AddConstructor): Keep track of default constructor
22208         and the default static constructor.
22209
22210         (Constructor::) Another class that starts using `public readonly'
22211         instead of properties. 
22212
22213         (Constructor::IsDefault): Whether this is a default constructor. 
22214
22215         (Field::) use readonly public fields instead of properties also.
22216
22217         (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
22218         track of static constructors;  If none is used, turn on
22219         BeforeFieldInit in the TypeAttributes. 
22220
22221         * cs-parser.jay (opt_argument_list): now the return can be null
22222         for the cases where there are no arguments. 
22223
22224         (constructor_declarator): If there is no implicit `base' or
22225         `this', then invoke the default parent constructor. 
22226
22227         * modifiers.cs (MethodAttr): New static function maps a set of
22228         modifiers flags into a MethodAttributes enum
22229         (FieldAttr): renamed from `Map'.  So now we have FieldAttr,
22230         MethodAttr, TypeAttr to represent the various mappings where the
22231         modifiers are used.
22232         (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'  
22233
22234 2001-08-19  Miguel de Icaza  <miguel@ximian.com>
22235
22236         * parameter.cs (GetParameterInfo): Fix bug where there would be no
22237         method arguments.
22238
22239         * interface.cs (PopulateIndexer): Implemented the code generator
22240         for interface indexers.
22241
22242 2001-08-17  Miguel de Icaza  <miguel@ximian.com>
22243
22244         * interface.cs (InterfaceMemberBase): Now we track the new status
22245         here.  
22246
22247         (PopulateProperty): Implement property population.  Woohoo!  Got
22248         Methods and Properties going today. 
22249
22250         Removed all the properties for interfaces, and replaced them with
22251         `public readonly' fields. 
22252
22253 2001-08-16  Miguel de Icaza  <miguel@ximian.com>
22254
22255         * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
22256         initialize their hashtables/arraylists only when they are needed
22257         instead of doing this always.
22258
22259         * parameter.cs: Handle refs and out parameters.
22260
22261         * cs-parser.jay: Use an ArrayList to construct the arguments
22262         instead of the ParameterCollection, and then cast that to a
22263         Parameter[] array.
22264
22265         * parameter.cs: Drop the use of ParameterCollection and use
22266         instead arrays of Parameters.
22267
22268         (GetParameterInfo): Use the Type, not the Name when resolving
22269         types. 
22270
22271 2001-08-13  Miguel de Icaza  <miguel@ximian.com>
22272
22273         * parameter.cs: Eliminate the properties Name, Type and ModFlags,
22274         and instead use public readonly fields.
22275
22276         * class.cs: Put back walking code for type containers.
22277
22278 2001-08-11  Miguel de Icaza  <miguel@ximian.com>
22279
22280         * class.cs (MakeConstant): Code to define constants.
22281
22282         * rootcontext.cs (LookupType): New function.  Used to locate types 
22283
22284
22285 2001-08-08  Miguel de Icaza  <miguel@ximian.com>
22286
22287         * rootcontext.cs: OH MY!  My trick works!   It is amazing how nice
22288         this System.Reflection code is.  Kudos to Microsoft
22289
22290         * typemanager.cs: Implement a type cache and avoid loading all
22291         types at boot time.  Wrap in LookupType the internals.  This made
22292         the compiler so much faster.  Wow.  I rule!
22293
22294         * driver.cs: Make sure we always load mscorlib first (for
22295         debugging purposes, nothing really important).
22296
22297         * Renamespaced things that were on `CSC' to `CIR'.  Maybe I should
22298         have moved to `CSC' rather than `CIR'.  Oh man!  The confussion!  
22299
22300         * rootcontext.cs: Lookup types on their namespace;  Lookup types
22301         on namespaces that have been imported using the `using' keyword.
22302
22303         * class.cs (TypeContainer::TypeAttr): Virtualize.
22304         (Class::TypeAttr): Return attributes suitable for this bad boy.
22305         (Struct::TypeAttr): ditto.
22306         Handle nested classes.
22307         (TypeContainer::) Remove all the type visiting code, it is now
22308         replaced with the rootcontext.cs code
22309
22310         * rootcontext.cs (GetClassBases): Added support for structs. 
22311
22312 2001-08-06  Miguel de Icaza  <miguel@ximian.com>
22313
22314         * interface.cs, statement.cs, class.cs, parameter.cs,
22315         rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
22316         Drop use of TypeRefs, and use strings instead.
22317
22318 2001-08-04  Miguel de Icaza  <miguel@ximian.com>
22319
22320         * rootcontext.cs: 
22321
22322         * class.cs (Struct::Struct): set the SEALED flags after
22323         checking the modifiers.
22324         (TypeContainer::TypeAttr): new property, returns the
22325         TypeAttributes for a class.  
22326
22327         * cs-parser.jay (type_list): Oops, list production was creating a
22328         new list of base types.
22329
22330         * rootcontext.cs (StdLib): New property.
22331         (GetInterfaceTypeByName): returns an interface by type name, and
22332         encapsulates error handling here.
22333         (GetInterfaces): simplified.
22334         (ResolveTree): Encapsulated all the tree resolution here.
22335         (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
22336         types. 
22337
22338         * driver.cs: Add support for --nostdlib, to avoid loading the
22339         default assemblies.
22340         (Main): Do not put tree resolution here. 
22341
22342         * rootcontext.cs: Beginning of the class resolution.
22343
22344 2001-08-03  Miguel de Icaza  <miguel@ximian.com>
22345
22346         * rootcontext.cs: Provide better error reporting. 
22347
22348         * cs-parser.jay (interface_base): set our $$ to be interfaces.
22349
22350         * rootcontext.cs (CreateInterface): Handle the case where there
22351         are no parent interfaces.
22352
22353         (CloseTypes): Routine to flush types at the end.
22354         (CreateInterface): Track types.
22355         (GetInterfaces): Returns an array of Types from the list of
22356         defined interfaces.
22357
22358         * typemanager.c (AddUserType): Mechanism to track user types (puts
22359         the type on the global type hash, and allows us to close it at the
22360         end). 
22361
22362 2001-08-02  Miguel de Icaza  <miguel@ximian.com>
22363
22364         * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
22365         RecordInterface instead.
22366
22367         * cs-parser.jay: Updated to reflect changes above.
22368
22369         * decl.cs (Definition): Keep track of the TypeBuilder type that
22370         represents this type here.  Not sure we will use it in the long
22371         run, but wont hurt for now.
22372
22373         * driver.cs: Smaller changes to accomodate the new code.
22374
22375         Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
22376         when done. 
22377
22378         * rootcontext.cs (CreateInterface):  New method, used to create
22379         the System.TypeBuilder type for interfaces.
22380         (ResolveInterfaces): new entry point to resolve the interface
22381         hierarchy. 
22382         (CodeGen): Property, used to keep track of the code generator.
22383
22384 2001-07-26  Miguel de Icaza  <miguel@ximian.com>
22385
22386         * cs-parser.jay: Add a second production for delegate_declaration
22387         with `VOID'.
22388
22389         (enum_body): Put an opt_comma here instead of putting it on
22390         enum_body or enum_member_declarations so we can handle trailing
22391         commas on enumeration members.  Gets rid of a shift/reduce.
22392
22393         (type_list): Need a COMMA in the middle.
22394
22395         (indexer_declaration): Tell tokenizer to recognize get/set
22396
22397         * Remove old targets.
22398
22399         * Re-add the parser target.
22400
22401 2001-07-13  Simon Cozens <simon@simon-cozens.org>
22402
22403         * cs-parser.jay: Add precendence rules for a number of operators
22404         ot reduce the number of shift/reduce conflicts in the grammar.
22405
22406 2001-07-17  Miguel de Icaza  <miguel@ximian.com>
22407
22408         * tree.cs: moved IGenerator interface and renamed it to ITreeDump
22409         and put it here.
22410
22411         Get rid of old crufty code.
22412
22413         * rootcontext.cs: Use this to keep track of the parsed
22414         representation and the defined types available to the program. 
22415
22416         * gen-treedump.cs: adjust for new convention.
22417
22418         * type.cs: Split out the type manager, and the assembly builder
22419         from here. 
22420
22421         * typemanager.cs: the type manager will live here now.
22422
22423         * cil-codegen.cs: And the code generator here. 
22424
22425 2001-07-14  Sean MacIsaac  <macisaac@ximian.com>
22426
22427         * makefile: Fixed up for easy making.
22428
22429 2001-07-13  Simon Cozens <simon@simon-cozens.org>
22430
22431         * cs-parser.jay (rank_specifier): Remove a conflict by reordering
22432         the 
22433
22434         (unary_expression): Expand pre_increment_expression and
22435         post_decrement_expression to reduce a shift/reduce.
22436
22437 2001-07-11  Simon Cozens
22438
22439         * cs-tokenizer.cs: Hex numbers should begin with a 0.
22440
22441         Improve allow_keyword_as_indent name.
22442
22443 2001-06-19  Miguel de Icaza  <miguel@ximian.com>
22444
22445         * Adjustments for Beta2. 
22446
22447 2001-06-13  Miguel de Icaza  <miguel@ximian.com>
22448
22449         * decl.cs: Added `Define' abstract method.
22450         (InTransit): new property, used to catch recursive definitions. 
22451
22452         * interface.cs: Implement `Define'. 
22453
22454         * modifiers.cs: Map Modifiers.constants to
22455         System.Reflection.TypeAttribute flags.
22456
22457         * class.cs: Keep track of types and user-defined types.
22458         (BuilderInit): New method for creating an assembly
22459         (ResolveType): New function to launch the resolution process, only
22460         used by interfaces for now.
22461
22462         * cs-parser.jay: Keep track of Classes, Structs and Interfaces
22463         that are inserted into the name space. 
22464
22465 2001-06-08  Miguel de Icaza  <miguel@ximian.com>
22466
22467         * ARGH.  I have screwed up my tree so many times due to the use of
22468         rsync rather than using CVS.  Going to fix this at once. 
22469
22470         * driver.cs: Objetify driver.  Load assemblies, use assemblies to
22471         load types.
22472
22473 2001-06-07  Miguel de Icaza  <miguel@ximian.com>
22474
22475         * Experiment successful: Use System.Type rather that our own
22476         version of Type.  
22477
22478 2001-05-25  Miguel de Icaza  <miguel@ximian.com>
22479
22480         * cs-parser.jay: Removed nsAliases from here.
22481
22482         Use new namespaces, handle `using XXX;' 
22483
22484         * namespace.cs: Reimplemented namespace handling, use a recursive
22485         definition of the class.  Now we can keep track of using clauses
22486         and catch invalid using clauses.
22487
22488 2001-05-24  Miguel de Icaza  <miguel@ximian.com>
22489
22490         * gen-treedump.cs: Adapted for all the renaming.
22491
22492         * expression.cs (Expression): this class now has a Type property
22493         which returns an expression Type.
22494
22495         (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
22496         `Type', as this has a different meaning now in the base
22497
22498 2001-05-22  Miguel de Icaza  <miguel@ximian.com>
22499
22500         * interface.cs, class.cs: Removed from all the sources the
22501         references to signature computation, as we can not do method
22502         signature computation during the parsing time, as we are not
22503         trying to solve at that point distinguishing:
22504
22505         class X {
22506                 void a (Blah x) {}
22507                 void a (NS.Blah x) {}
22508         }
22509
22510         Which depending on the context might be valid or not, as we do not
22511         know if Blah is the same thing as NS.Blah at that point.
22512
22513         * Redid everything so the code uses TypeRefs now instead of
22514         Types.  TypeRefs are just temporary type placeholders, that need
22515         to be resolved.  They initially have a pointer to a string and the
22516         current scope in which they are used.  This is used later by the
22517         compiler to resolve the reference to an actual Type. 
22518
22519         * DeclSpace is no longer a CIR.Type, and neither are
22520         TypeContainers (Class and Struct) nor Interfaces nor Enums.  They
22521         are all DeclSpaces, but no Types. 
22522
22523         * type.cs (TypeRefManager): This implements the TypeRef manager,
22524         which keeps track of all the types that need to be resolved after
22525         the parsing has finished. 
22526
22527 2001-05-13  Miguel de Icaza  <miguel@ximian.com>
22528
22529         * ARGH.  We are going to have to store `foreach' as a class rather
22530         than resolving it, as we need to verify error 1579 after name
22531         resolution.   *OR* we could keep a flag that says `This request to
22532         IEnumerator comes from a foreach statement' which we can then use
22533         to generate the error.
22534
22535 2001-05-10  Miguel de Icaza  <miguel@ximian.com>
22536
22537         * class.cs (TypeContainer.AddMethod): we now add methods to the
22538         MethodGroup instead of the method hashtable.  
22539
22540         * expression.cs: Add MethodGroup abstraction, which gets us one
22541         step closer to the specification in the way we handle method
22542         declarations.  
22543
22544         * cs-parser.jay (primary_expression): qualified_identifier now
22545         tried to match up an identifier to a local variable reference or
22546         to a parameter reference.
22547
22548         current_local_parameters is now a parser global variable that
22549         points to the current parameters for the block, used during name
22550         lookup.
22551
22552         (property_declaration): Now creates an implicit `value' argument to
22553         the set accessor.
22554
22555 2001-05-09  Miguel de Icaza  <miguel@ximian.com>
22556
22557         * parameter.cs: Do not use `param' arguments as part of the
22558         signature, per the spec.
22559
22560 2001-05-08  Miguel de Icaza  <miguel@ximian.com>
22561
22562         * decl.cs: Base class for classes, structs and interfaces.  This
22563         is the "Declaration Space" 
22564
22565         * cs-parser.jay: Use CheckDef for checking declaration errors
22566         instead of having one on each function.
22567
22568         * class.cs: Factor out some code for handling error handling in
22569         accordance to the "Declarations" section in the "Basic Concepts"
22570         chapter in the ECMA C# spec.
22571
22572         * interface.cs: Make all interface member classes derive from
22573         InterfaceMemberBase.
22574
22575 2001-05-07  Miguel de Icaza  <miguel@ximian.com>
22576
22577         * Many things: all interfaces are parsed and generated in
22578         gen-treedump.  Support for member variables, constructors,
22579         destructors, properties, constants is there.
22580
22581         Beginning of the IL backend, but very little done, just there for
22582         testing purposes. 
22583
22584 2001-04-29  Miguel de Icaza  <miguel@ximian.com>
22585
22586         * cs-parser.jay: Fix labeled statement.
22587
22588         * cs-tokenizer.cs (escape): Escape " and ' always.
22589         ref_line, ref_name: keep track of the line/filename as instructed
22590         by #line by the compiler.
22591         Parse #line.
22592
22593 2001-04-27  Miguel de Icaza  <miguel@ximian.com>
22594
22595         * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
22596         to match the values in System.CodeDOM.
22597
22598         Divid renamed to Divide.
22599
22600         * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
22601         statements. 
22602         (Statements.set): remove.
22603
22604         * System.CodeDOM/CodeCatchClause.cs: always have a valid
22605         statements. 
22606
22607         * System.CodeDOM/CodeIfStatement.cs: trueStatements and
22608         falseStatements always have valid values. 
22609
22610         * cs-parser.jay: Use System.CodeDOM now.
22611