2005-08-26 Iain McCoy <iain@mccoy.id.au>
[mono.git] / mcs / gmcs / ChangeLog
1 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
2
3         * driver.cs : reverting default encoding change as well as mcs.
4
5 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
6
7         * driver.cs, support.cs : merged r48826.
8           Marek Safer wrote:
9           > could you integrate your mcs changes to gmcs otherwise
10           > gmcs cannot compile some files.
11
12 2005-08-20  Martin Baulig  <martin@ximian.com>
13
14         * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
15         scope if we don't already have it.
16
17         * expression.cs (Invocation.EmitCall): Use `ec.EmitThis ()' rather
18         than `ig.Emit (OpCodes.Ldarg_0)' to make it work inside iterators;
19         fixes #75867.
20
21 2005-07-31  Miguel de Icaza  <miguel@novell.com>
22
23         * statement.cs: Copy the local exception into the exception
24         captured local.  Fixes 75674
25
26 2005-07-15  Marek Safar  <marek.safar@seznam.cz>
27
28         * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
29         type as namespace.
30
31 2005-08-12  Martin Baulig  <martin@ximian.com>
32
33         * expression.cs (MemberAccess.ResolveNamespaceOrType): Only search
34         for nested types here to avoid hitting the cache too early.
35
36 2005-08-09  Miguel de Icaza  <miguel@novell.com>
37
38         * enum.cs: On the new compiler CLS error 3005 is now a warning not
39         an error. 
40
41 2005-08-03  Martin Baulig  <martin@ximian.com>
42
43         Make iterators in generic methods work; see gtest-191.cs.
44
45         * generic.cs
46         (Constraints.Resolve): Protect against being called twice.
47
48         * class.cs
49         (TypeContainer.GetClassBases): Make this `protected virtual'.
50
51         * iterator.cs (Iterator.ctor): Added `GenericMethod' argument.
52         (Iterator.GetClassBases): Override this and compute the base
53         classes here.
54         (Iterator.DefineNestedTypes): If we're a generic method, all our
55         method type parameters become class type parameters on the proxy
56         class.
57
58         * statement.cs
59         (ToplevelBlock.Parameters): Make this a property, not a field.
60         (ToplevelBlock.ResolveMeta): Update the `parameters' from the `ip'.
61
62 2005-08-03  Martin Baulig  <martin@ximian.com>
63
64         * typemanager.cs (TypeManager.IsSubclassOf): Use
65         `TypeManager.IsEqual' instead of `Type.Equals'; fixes gtest-190.cs.
66         (TypeManager.GetFullName_recursed): Improved.
67
68 2005-07-27  Carlos Alberto Cortez <calberto.cortez@gmail.com>
69
70         Fix #75417
71         * ecore.cs (Expression.IsAccessorAccessible): Change the check for
72         Private accessor case, using TypeManager.IsPrivateAccessible instead of
73         invocation_type == mi.DeclaringType, since the first one also checks
74         other condition used by generic instances.
75         
76 2005-07-27  Martin Baulig  <martin@ximian.com>
77
78         * anonymous.cs (CaptureContext.AddField): Added
79         `AnonymousContainer am' argument; compute its toplevel scope if
80         it's not already computed.  Fixes #75649.
81
82 2005-07-14  Marek Safar  <marek.safar@seznam.cz>
83
84         * attribute.cs (Attribute.ResolveAttributeType): Renamed from
85         CheckAttributeType and refactored.
86         (Attribute.ResolvePossibleAttributeType): Changed to reuse
87         ResolveAsTypeTerminal error handling.
88         (ResolveAsTypeTerminal): Introduced because of global attributes extra
89         handling.
90         (GetSignatureForError): Print errors in same way.
91
92         * class.cs,
93         * codegen.cs: Reflect attribute GetSignatureForError change.
94
95         * ecore.cs,
96         * expression.cs: Add silent parameter to ResolveAsTypeStep.
97
98         * namespace.cs (UsingEntry): Refactored to make fields private.
99
100         * assign.cs,
101         statement.cs: Error_UnexpectedKind has extra parameter.
102
103 2005-07-14  Raja R Harinath  <rharinath@novell.com>
104
105         * ecore.cs (IAlias): Remove.
106         * decl.cs (DeclSpace): Don't derive from IAlias.  Remove members
107         that implement the interface.
108         * namespace.cs (Namespace): Likewise.
109         (Namespace.declspaces): Renamed from 'defined_names'.
110         (Namespace.AddDeclSpace): Renamed from 'DefineName'.  Take a
111         DeclSpace instead of an IAlias.
112         * tree.cs (Tree.AddDecl): Update.
113
114 2005-07-12  Raja R Harinath  <rharinath@novell.com>
115
116         * statement.cs (Block.Flags); Remove HasVarargs.
117         (Block.HasVarargs): Move to ToplevelBlock.
118         (Block.ThisVariable, Block.AddThisVariable): Likewise.
119         (Block.Variables): Make protected.  Initialize variable hashtable
120         if necessary.
121         (Block.AddVariable): Update.
122         (Block.Resolve): Update to changes.
123         (ToplevelBlock.HasVarargs): New boolean.
124         (ToplevelBlock.ThisVariable): Move here from Block.
125         (ToplevelBlock.AddThisVariable): Likewise.
126         (ToplevelBlock.IsThisAssigned): New.  Forwards call to this_variable.
127         * expression.cs (This.ResolveBase): Update to changes.
128         (ArglistAccess.DoResolve): Likewise.
129
130 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
131
132         Fix #75321
133         * ecore.cs, class.cs: Use SetAssigned instead of direct access.
134
135         * class.cs (TypeContainer.VerifyMembers): Distinguish between
136         not used and not used & assigned.
137         (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
138
139 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
140
141         Fix #75053
142         * expression.cs (Is.DoResolve): null is never provided type.
143
144 2005-07-08  Marek Safar  <marek.safar@seznam.cz>
145
146         Fix #52496
147         * cs-parser.jay: Less strict event error rule to catch more errors.
148
149 2005-07-11  Martin Baulig  <martin@ximian.com>
150
151         * generic.cs (ConstructedType.CheckConstraints): Improve the check
152         for the constructor constraint: we do not only have to check
153         whether the class has a public constructor, but also ensure that
154         it's parameterless.  Fixes #75492.
155
156 2005-07-11  Martin Baulig  <martin@ximian.com>
157
158         * expression.cs (Binary.ResolveOperator): Only allow `==' and `!='
159         between type parameters if they either have the reference type
160         constraint or the class constraint.
161
162 2005-07-10  Kamil Skalski <nazgul@nemerle.org>
163
164         * generic.cs: Use MakeGenericType instead of BindGenericParameters.
165
166 2005-07-07  Marek Safar  <marek.safar@seznam.cz>
167
168         Fix #74975
169         * attribute.cs (orig_sec_assembly): Holds original version of assembly.
170         (ExtractSecurityPermissionSet): Cope with self referencing security
171         attributes properly.
172
173         * driver.cs (SetOutputFile): Made public property OutputFile.
174
175 2005-07-07  Raja R Harinath  <rharinath@novell.com>
176
177         Fix #75486.
178         * class.cs (TypeContainer.first_nonstatic_field): Rename from
179         has_nonstatic_fields.  Make into a FieldBase pointer.
180         (TypeContainer.AddField): Add CS0282 check.
181         (TypeContainer.EmitType): Update.
182
183 2005-07-06  Miguel de Icaza  <miguel@novell.com>
184
185         * cs-tokenizer.cs (consume_identifier): Do not create strings to
186         compare if they start with __.
187
188 2005-07-06  Raja R Harinath  <rharinath@novell.com>
189
190         * statement.cs (Switch.SwitchGoverningType): Only look at
191         UserCasts that don't need implicit standard conversions to one of
192         the allowed switch types (Fixes test-322.cs).
193         (LocalInfo.Resolve): Re-enable sanity-test.
194
195 2005-07-06  Marek Safar  <marek.safar@seznam.cz>
196
197         * cs-tokenizer.cs (consume_identifier): Detect double undescores
198         
199         * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
200         
201         * expression.cs (Invocation.DoResolve): Report error CS0245 here.
202
203 2005-07-06  Raja R Harinath  <rharinath@novell.com>
204
205         Fix #75472.
206         * ecore.cs (SimpleName.GetSignatureForError): Add.
207         * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
208         (MemberAccess.GetSignatureForError): Add.
209
210 2005-07-05  Marek Safar  <marek.safar@seznam.cz>
211  
212         The big error and warning messages review.
213         
214         * anonymous.cs,
215         * assign.cs,
216         * attribute.cs,
217         * class.cs,
218         * codegen.cs,
219         * convert.cs,
220         * cs-parser.jay,
221         * cs-tokenizer.cs,
222         * decl.cs,
223         * delegate.cs,
224         * doc.cs,
225         * driver.cs,
226         * ecore.cs,
227         * enum.cs,
228         * expression.cs,
229         * flowanalysis.cs,
230         * iterators.cs,
231         * literal.cs,
232         * location.cs,
233         * modifiers.cs,
234         * namespace.cs,
235         * parameter.cs,
236         * pending.cs,
237         * report.cs,
238         * rootcontext.cs,
239         * statement.cs,
240         * support.cs,
241         * tree.cs,
242         * typemanager.cs: Updated.
243         
244         * class.cs: (MethodCore.SetYields): Moved here to share.
245         (PropertyMethod.Define): Moved iterator setup here.
246         
247         * iterators.cs: Add orig_method to have full access to parent
248         container.
249
250 2005-07-05  Raja R Harinath  <rharinath@novell.com>
251
252         Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
253         * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
254         (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
255         variable of struct type.
256         * expression.cs (Unary.ResolveOperator): Update to change.
257         (Indirection.VerifyFixed): Likewise.
258         (LocalVariableReference.VerifyFixed): A local variable is always fixed.
259         (ParameterReference.VerifyFixed): Value parameters are fixed.
260         (This.VerifyFixed): Treat 'this' as a value parameter.
261         * statement.cs (LocalInfo.IsFixed): Remove.
262
263 2005-07-01  Martin Baulig  <martin@ximian.com>
264
265         * iterators.cs (Iterator.CapturedThisReference.Emit): Use
266         `ec.EmitThis ()' to get the correct scope.
267
268 2005-07-01  Martin Baulig  <martin@ximian.com>
269
270         * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
271         instance is a ParameterReference; fixes #75299.
272
273 2005-06-30  Raja R Harinath  <rharinath@novell.com>
274
275         Fix #75412.
276         * expression.cs (Indexers.map): Remove.
277         (Indexers.Append): Filter out inaccessible setters and getters.
278         (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
279
280         Fix #75283.
281         * ecore.cs (MemberExpr.EmitInstance): New.  Add CS0120 check.
282         Refactored from ...
283         (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
284         (FieldExpr.Emit, PropertyExpr.Emit): Update.
285         (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
286         * expression.cs (Invocation.EmitCall): Add CS0120 check.
287
288 2005-06-30  Marek Safar  <marek.safar@seznam.cz>
289
290         Fix #75322
291         * class.cs (FieldBase.GetInitializerExpression): One more field
292         for backup.
293
294 2005-06-28  Miguel de Icaza  <miguel@novell.com>
295
296         * pending.cs: Do not define a proxy if the base method is virtual,
297         it will be picked up by the runtime (bug 75270).
298
299 2005-07-08  Martin Baulig  <martin@ximian.com>
300
301         * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
302         handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
303
304 2005-07-07  Martin Baulig  <martin@ximian.com>
305
306         * generic.cs (ConstructedType.CheckConstraint): Use
307         ResolveAsTypeStep(), not ResolveAsTypeTerminal() so we're not
308         called recursively; fixes #75329.
309
310 2005-07-06  Martin Baulig  <martin@ximian.com>
311
312         * generic.cs (TypeManager.InferTypeArguments): Added support for
313         anonymous methods; fixes #75461.
314
315 2005-07-01  Martin Baulig  <martin@ximian.com>
316
317         * iterators.cs (Iterator.CapturedThisReference.Emit): Use
318         `ec.EmitThis ()' to get the correct scope.
319
320 2005-07-01  Martin Baulig  <martin@ximian.com>
321
322         * ecore.cs (FieldExpr.DoResolve): Only capture the field if it's
323         instance is `This'; fixes #75299.
324
325 2005-06-30  Martin Baulig  <martin@ximian.com>
326
327         * class.cs (Indexer): Implement IIteratorContainer; added support
328         for iterators in indexers.
329
330         * codegen.cs
331         (EmitContext.CurrentIterator): Make this a property, not a field.
332
333         * anonymous.cs (AnonymousContainer.Iterator): New public property.
334
335 2005-06-28  Miguel de Icaza  <miguel@novell.com>
336
337         * pending.cs: Do not define a proxy if the base method is virtual,
338         it will be picked up by the runtime (bug 75270).
339
340 2005-06-28  Martin Baulig  <martin@ximian.com>
341
342         * cs-parser.jay (interface_method_declaration): Avoid a
343         reduce/reduce conflict by moving some of the code into a separate
344         `interface_method_declaration_body' rule; fixes #75368.
345
346 2005-06-28  Martin Baulig  <martin@ximian.com>
347
348         * typemanager.cs (TypeManager.MemberLookup_FindMembers): Move the
349         array check after the check for TypeBuilder's.
350
351 2005-06-21  Raja R Harinath  <rharinath@novell.com>
352
353         * convert.cs (FindMostEncompassedType): Add two trivial special
354         cases (number_of_types == 0 || number_of_types == 1).
355         (FindMostEncompasingType): Likewise.
356
357 2005-06-17  Raja R Harinath  <rharinath@novell.com>
358
359         Some cleanups preparing for the fix of #75283.
360         * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
361         error testing.
362         (EventExpr.InstanceResolve): Likewise.
363         (EventExpr.DoResolve): Remove redundant checks.
364
365 2005-06-08  Miguel de Icaza  <miguel@novell.com>
366
367         * class.cs: Small fix.
368
369 2005-06-08  Raja R Harinath  <rharinath@novell.com>
370
371         Fix #75160.
372         * class.cs (GetPartialBases): Fix return value check of
373         part.GetClassBases.
374
375 2005-06-07  Raja R Harinath  <rharinath@novell.com>
376
377         Ensure that partial classes are registered in their enclosing
378         namespace.  Initial part of fix of #75160.
379         * tree.cs (Tree.RecordDecl): Add new namespace argument.
380         Register declspace with namespace here, not in
381         DeclSpace.RecordDecl.
382         * cs-parser.jay: Pass namespace to RecordDecl.
383         * class.cs (PartialContainer.Create): Likewise.
384         (ClassPart.DefineType): New sanity-check.  Throws an exception if
385         called.
386         * decl.cs (Declspace.RecordDecl): Remove.
387         * namespace.cs (NamespaceEntry.DefineName): Remove.
388
389 2005-06-06  Marek Safar  <marek.safar@seznam.cz>
390
391         * rootcontext.cs: Reset TargetExt as well.
392
393 2005-06-03  Raja R Harinath  <rharinath@novell.com>
394
395         * ecore.cs (Expression.Resolve): Emit CS0654 error when
396         -langversion:ISO-1.
397
398 2005-06-02  Raja R Harinath  <rharinath@novell.com>
399
400         Fix #75080, cs0119.cs.
401         * ecore.cs (Expression.ExprClassToResolveFlags): New.  Broken out
402         of ...
403         (Expression.Resolve): ... this.  Use it.  Remove bogus code
404         allowing ExprClass.Type and ExprClass.Namespace for
405         ResolveFlags.VariableOrValue.
406         (Expression.Resolve) [1-argument variant]: Change default resolve
407         flags based on language version.
408         (Expression.Error_UnexpectedKind): Use a simple string array
409         rather than an ArrayList.
410         * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
411         not ExprClass.Type.
412         (TypeOfVoid.DoResolve): Likewise.
413         (MemberAccess.DoResolve) [3-argument variant]: Make private.  Drop
414         flags argument -- it always has the same value.
415
416 2005-05-31  Raja R Harinath  <rharinath@novell.com>
417
418         Fix #75081.
419         * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
420         Use it in the error message.
421         * assign.cs, expression.cs, statement.cs: Update.
422
423 2005-05-30  Raja R Harinath  <rharinath@novell.com>
424
425         Fix #75088.
426         * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
427         the "almostMatchedMember" case too.
428         * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
429         that failed the accessibility checks to 'almost_match'.
430
431 2005-05-27  Vladimir Vukicevic  <vladimir@pobox.com>
432
433         * attribute.cs: Use internal MethodBuilder methods to set
434         ExactSpelling and SetLastError on PInvoke methods, instead
435         of passing them via charset.  Fixes #75060.
436
437 2005-05-27  Raja R Harinath  <rharinath@novell.com>
438
439         * parameter.cs (Parameter): Remove TODO comment.
440         (Parameter.DefineParameter): Remove Location parameter.
441         (Parameters.LabelParameters): Likewise.
442         * class.cs (Constructor.Emit): Update to change.
443         (MethodData.Emit): Likewise.
444         * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.  
445         * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
446
447 2005-05-27  Atsushi Enomoto  <atsushi@ximian.com>
448
449         * parameter.cs,
450           Removed Parameters.Location and added Parameter.Location instead.
451           Removed Location parameter from Emit() and GetSignature().
452         * anonymous.cs,
453           class.cs,
454           cs-parser.jay,
455           delegate.cs,
456           iterators.cs,
457           statement.cs :
458           Modified all related calls.
459
460 2005-06-21  Martin Baulig  <martin@ximian.com>
461
462         * generic.cs (NullCoalescingOperator.Emit): Make this work if the
463         left-hand side is not a nullable type; fixes #75328.
464
465 2005-06-21  Martin Baulig  <martin@ximian.com>
466
467         * typemanager.cs
468         (TypeManager.CSharpName): Use GetFullName() instead of `t.FullName'.
469         (TypeManager.GetFullNameSignature): Likewise.
470
471         * convert.cs (Convert.Error_CannotImplicitConversion): Compare
472         `source.FullName' and `target.FullName' to check whether there are
473         two conflicting definitions.
474
475 2005-06-21  Martin Baulig  <martin@ximian.com>
476
477         * convert.cs (Convert.ImplicitTypeParameterConversion): Always use
478         a BoxedCast - also for reference types - to be compatible with csc.
479
480 2005-06-21  Martin Baulig  <martin@ximian.com>
481
482         * expression.cs (MemberAccess.DoResolve): Add support for nested
483         types in a generic instance; fixes #75320.
484
485 2005-06-20  Martin Baulig  <martin@ximian.com>
486
487         * generic.cs (TypeManager.InferType): Also walk the class
488         hierarchy for generic instances; fixes #75261.
489
490 2005-06-17  Martin Baulig  <martin@ximian.com>
491
492         * typemanager.cs (TypeManager.IsBuiltinType): Use TypeToCoreType()
493         to make things work for corlib.
494
495 2005-06-15  Martin Baulig  <martin@ximian.com>
496
497         * attribute.cs (Attribute.CheckSecurityActionValidity): Remove the
498         obsolete `SecurityAction' values.
499
500 2005-06-06  Marek Safar  <marek.safar@seznam.cz>
501
502         * rootcontext.cs: Reset TargetExt as well.
503         
504 2005-06-09  Martin Baulig  <martin@ximian.com>
505
506         * delegate.cs (Delegate.VerifyMethod): Added
507         `MethodGroupExpr old_mg' argument; inherit its
508         `HasTypeParameters'; fix #75085.
509
510 2005-06-09  Martin Baulig  <martin@ximian.com>
511
512         * expression.cs (Invocation.OverloadResolve): Correctly handle
513         generic methods for the SetMemberIsUsed(); fix #75064.
514
515 2005-06-09  Martin Baulig  <martin@ximian.com>
516
517         * statement.cs (Throw.Resolve): Use TypeManager.IsSubclassOf();
518         fixes #75062.
519
520 2005-06-08  Martin Baulig  <martin@ximian.com>
521
522         * cs-parser.jay (nullable_type_or_conditional): If we put the
523         nullable back and our `type' is a `ComposedCast', remove the
524         nullable from it.  Fixes #75156.
525
526         * expression.cs (ComposedCast.RemoveNullable): New public method.
527
528 2005-06-08  Martin Baulig  <martin@ximian.com>
529
530         The big Iterators rewrite :-)
531
532         * iterators.cs: Rewrite this to use the anonymous methods framework.
533
534         * rootcontext.cs (RootContext.DefineTypes): Define Delegates
535         before the TypeContainers; see 2test-21.cs.
536
537         * class.cs
538         (TypeContainer.DefineType): Don't create a new EmitContext if we
539         already have one (this only happens if we're an Iterator).
540         (TypeContainer.Define): Also call Define() on all our iterators.
541         (Method.CreateEmitContext): Added support for iterators.
542
543         * anonymous.cs
544         (AnonymousContainer): New abstract base class for `AnonymousMethod'.
545         (AnonymousContainer.CreateMethodHost): Moved here from
546         AnonymousMethod and made abstract.
547         (AnonymousContainer.CreateScopeType): New abstract method.
548         (AnonymousContainer.IsIterator): New public property.
549         (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
550         get the ScopeTypeBuilder rather than manually defining it here. 
551         (ScopeInfo.EmitScopeInstance): New public method; correctly handle
552         iterators here.
553
554         * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
555         before RootContext.DefineTypes().
556
557         * codegen.cs (EmitContext.RemapToProxy): Removed.
558         (EmitContext.CurrentAnonymousMethod): Changed type from
559         AnonymousMethod -> AnonymousContainer.
560         (EmitContext.ResolveTopBlock): Protect from being called twice.
561         (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
562         (EmitContext.EmitThis): Removed the iterators hacks; use the
563         anonymous methods framework for that.
564
565         * statement.cs
566         (ToplevelBlock.Container): Make this a property, not a field.
567         (ToplevelBlock.ReParent): New public method; move the
568         ToplevelBlock into a new container.
569         (Foreach.TemporaryVariable): Simplify.
570
571 2005-06-05  Martin Baulig  <martin@ximian.com>
572
573         * statement.cs (LocalInfo.CompilerGenerated): New flag.
574         (Block.AddTemporaryVariable): New public method; creates a new
575         `LocalInfo' for a temporary variable.
576         (Block.EmitMeta): Create the LocalBuilders for all the temporary
577         variables here.
578         (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
579         non-iterator variables.
580
581 2005-06-05  Martin Baulig  <martin@ximian.com>
582
583         * statement.cs (Foreach.TemporaryVariable): Create the
584         LocalBuilder in the Emit phase and not in Resolve since in some
585         situations, we don't have an ILGenerator during Resolve; see
586         2test-19.cs for an example.
587
588 2005-06-04  Martin Baulig  <martin@ximian.com>
589
590         The big Foreach rewrite - Part II.
591
592         * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
593         with `PropertyInfo ienumerator_getcurrent'.
594
595         * codegen.cs (VariableStorage): Removed.
596
597         * statement.cs
598         (Foreach): Derive from Statement, not ExceptionStatement.
599         (Foreach.CollectionForeach): New nested class.  Moved all the code
600         dealing with collection foreach here.
601         (Foreach.ForeachHelperMethods): Removed.
602         (Foreach.TemporaryVariable): Implement IMemoryLocation.
603
604 2005-05-23  Martin Baulig  <martin@ximian.com>
605
606         * statement.cs (Try.DoResolve): Don't create a `finally' if we
607         don't need to.  Fix #75014.
608
609 2005-05-26  Raja R Harinath  <rharinath@novell.com>
610
611         Improve user-defined conversion handling.
612         * convert.cs (GetConversionOperators): Rewrite.  Return only the
613         applicable operators.
614         (AddConversionOperators): New.  Helper for GetConversionOperators.
615         (FindMostEncompassedType, FindMostEncompassingType): Verify that
616         there is only one most encompassed/encompassing type.
617         (FindMostSpecificSource, FindMostSpecificTarget): Remove
618         "applicable operator" handling.
619         (UserConversion): Move cache here from GetConversionOperators.
620         Directly cache the chosen operator, rather than the whole
621         MethodGroup.
622         (ExplicitNumericConversion): Fix buggy implementation of Decimal
623         case.  Allow conversion of decimal to sbyte and byte too.
624         * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
625         New static methods.  Used to avoid allocating EmptyExpressions in
626         convert.cs.
627
628 2005-05-24  Duncan Mak  <duncan@novell.com>
629
630         * ecore.cs (CastFromDecimal): New class for casting a decimal to
631         another class, used in Convert.ExplicitNumericConversion.
632         (CastToDecimal): New class, similar to above, but casts to
633         System.Decimal, used in Convert.ImplicitNumericConversion and also
634         in explicit convesion from double/float to decimal.
635
636         * convert.cs (ImplicitNumericConversion): Handle implicit
637         conversions to System.Decimal.
638         (ExplicitNumericConversion): handle explicit conversions to
639         System.Decimal.
640
641         This fixes #68711.
642         
643 2005-05-20  Miguel de Icaza  <miguel@novell.com>
644
645         * typemanager.cs: Do not throw an exception in the TypeBuilder
646         case, we take care of it on the TypeCode.
647
648 2005-05-17  Marek Safar  <marek.safar@seznam.cz>
649         
650         * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
651         is back.
652         
653         * cs-parser.jay: Catch more lexical errors.
654         
655         * report.cs: Add one more Error method.
656         
657         * rootcontext.cs,
658         * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
659
660 2005-05-20  Martin Baulig  <martin@ximian.com>
661
662         * class.cs (TypeContainer.CircularDepException): Removed.
663         (TypeContainer.DefineType): Removed the `InTransit' stuff.
664         (TypeContainer.CheckRecursiveDefinition): Check for circular class
665         (CS0146) and interface (CS0529) dependencies here.
666
667 2005-05-20  Martin Baulig  <martin@ximian.com>
668
669         * expression.cs (New.DoResolve): Move the CS0712 check above the
670         CS0144 check; otherwise it can never be reached.
671
672 2005-05-20  Martin Baulig  <martin@ximian.com>
673
674         * cs-parser.jay: Fix CS0080 check; add CS0231 and CS0257 from MCS.
675
676 2005-05-20  Martin Baulig  <martin@ximian.com>
677
678         * class.cs (TypeContainer.DefineType): Fix CS0698 check.
679
680         * typemanager.cs (TypeManager.IsAttributeType): New public method.
681
682 2005-05-19  Martin Baulig  <martin@ximian.com>
683
684         * delegate.cs
685         (ImplicitDelegateCreation.Check): Added `bool check_only' argument
686         to disable error reporting.
687
688         * convert.cs (Convert.ImplicitStandardConversionExists): Use it
689         here since we don't want to report an error; see the new test-336.cs.
690
691 2005-05-19  Raja R Harinath  <rharinath@novell.com>
692
693         * statement.cs (ToplevelBlock.GetParameterReference)
694         (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
695         Move here from class Block.
696         * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
697         * expression.cs (ParameterReference.DoResolveBase): Likewise.
698
699 2005-05-18  Martin Baulig  <martin@ximian.com>
700
701         Fix #74978.
702
703         * flowanalysis.cs
704         (FlowBranching.Reachability): Add non-static public And() and Or()
705         methods.
706         (FlowBranchingSwitch): New class; do the `break_origins' thing
707         like in FlowBranchingLoop.
708         (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
709         reachability, not just locals and parameters.
710         (FlowBranching.MergeChild): Remove some of the hacks for loop and
711         switch; MergeBreakOrigins() now takes care of that.
712
713 2005-05-18  Martin Baulig  <martin@ximian.com>
714
715         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
716         a loop and may leave it, reset the barrier; fixes #74974.
717
718 2005-05-16  Raja R Harinath  <rharinath@novell.com>
719
720         Fix test-382.cs.  Emit values of decimal constants.
721         * class.cs (TypeContainer.RegisterFieldForInitialization): New.
722         Carved out of ...
723         (TypeContainer.AddField): ... this.
724         (TypeContainer.EmitFieldInitializers): Allow the list of fields
725         with initializers to include 'Const's.
726         (ClassPart.RegisterFieldForInitialization): Forward to
727         PartialContainer.
728         * const.cs (Const.Const): Pass initializer to base class.
729         (Const.Define): In case of decimal constants, register them for
730         initialization in a static constructor.
731
732 2005-05-14  Martin Baulig  <martin@ximian.com>
733
734         * statement.cs (Block.Resolve): Correctly handle unreachable code;
735         do not call ResolveUnreachable() on unreachable statements in
736         here, see the comment in the source code.
737
738 2005-05-13  Raja R Harinath  <rharinath@novell.com>
739
740         Fix #74934.
741         * expression.cs (BinaryResolveOperator): If one of the operands of
742         an equality comparison is 'null' and the other is a pointer type,
743         convert the null to a NullPointer.
744         * convert.cs (ImplicitReferenceConversion): If the expression is a
745         NullLiteral and the target type is a pointer type, return a
746         NullPointer instead.
747         (ImplicitConversionStandard): Likewise.
748
749 2005-05-13  Marek Safar  <marek.safar@seznam.cz>
750         
751         * cs-parser.jay: Set readonly context based on special constructs.
752         
753         * expression.cs (LocalVariableReference.DoResolveBase): Improved
754         readonly variable error handling.
755         
756         * rootcontext.cs (EmitCode): Don't verify members when error
757         occurred.
758         
759         * statement.cs (LocalInfo): Add reaodnly context information.
760         (SetReadOnlyContext, GetReadOnlyContext): New methods.
761
762 2005-05-17  Martin Baulig  <martin@ximian.com>
763
764         * expression.cs (Argument.Resolve): Turn on flow analysis; fix
765         #70970. 
766
767 2005-05-13  Martin Baulig  <martin@ximian.com>
768
769         * statement.cs (Block.Resolve, ResolveUnreachable): Correctly
770         handle unreachable blocks.
771
772 2005-05-13  Martin Baulig  <martin@ximian.com>
773
774         * class.cs
775         (ConstructorInitializer.GetOverloadedConstructor): Don't crash.
776         (MethodCore.CheckCore): Use TypeManager.IsEqual(); fix #74904 and
777         #74905. 
778
779 2005-05-13  Martin Baulig  <martin@ximian.com>
780
781         * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
782         instance variable, not a local.  Fix #74873.
783         (Block.ResolveUnreachable): Set it to true here.
784
785 2005-05-12  Martin Baulig  <martin@ximian.com>
786
787         * cs-parser.jay (property_declaration): Pass the `current_class',
788         not the `current_container' to Property's .ctor.  Fixes #74912.
789
790 2005-05-11  Martin Baulig  <martin@ximian.com>
791
792         * typemanager.cs (Closure): Copy this from MCS and merge all the
793         GMCS-specific changes into it.
794
795 2005-05-12  Raja R Harinath  <harinath@gmail.com>
796
797         Fix #74920.
798         * typemanager.cs (unmanaged_enclosing_types): New.
799         (IsUnmanagedType): Avoid infloops by using
800         'unmanaged_enclosing_types' to talk with recursive invocations.
801
802 2005-05-11  Duncan Mak  <duncan@novell.com>
803
804         * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
805         continuing to process for 'arg'.
806         (handle_preprocessing_directive): Check the argument of the #endif
807         directive and report error CS1025 if there are any trailing
808         characters.
809
810         According to the C# spec, having even whitespace after the #endif
811         directive is illegal; however, because we call arg.TrimEnd ()
812         beforehand, we have the same behavior as csc, allowing whitespace
813         after the directive.
814
815         Fixes #74892.
816
817 2005-05-11  Marek Safar  <marek.safar@seznam.cz>
818
819         Fix #74863.
820         
821         * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
822         (Constructor.GetObsoleteAttribute): Implemented correctly.
823
824 2005-05-10  Martin Baulig  <martin@ximian.com>
825
826         * generic.cs (Constraints.Resolve): Report CS0246 if we cannot
827         resolve the type; fixes #74864.
828         (DefaultValueExpression): Create the LocalTemporary in Emit(), not
829         in DoResolve(); fixes #74862.
830
831 2005-05-10  Martin Baulig  <martin@ximian.com>
832
833         * support.cs (ReflectionParameters.ParameterModifier): Use
834         `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
835         and `ParameterAttributes.In'.  Fixes #74884.
836
837 2005-05-10  Martin Baulig  <martin@ximian.com>
838
839         * typemanager.cs (TypeManager.MemberLookup_FindMembers): Don't use
840         the cache if we're just looking for `MemberTypes.NestedType' in a
841         generic instance.
842
843         * ecore.cs (Expression.ResolveAsTypeTerminal): Don't check the
844         constraints if we're still resolving the type tree.
845         (Expression.MemberLookup): If we're resolving the type tree, only
846         look for `MemberTypes.NestedType' since we're only interested in
847         getting types.
848
849         * class.cs (TypeContainer.DefineType): Don't resolve the type
850         parameters here; do this later in ResolveType() after the type
851         tree has been resolved.
852         (TypeContainer.ResolveType): New public method; this is called
853         after the type tree is resolved and before the types are being
854         populated.  We resolve the generic constraints here.
855         (TypeContainer.DoDefineMember): Check the constraints on our base
856         class and interfaces.
857
858         * decl.cs (DeclSpace.ResolveBaseTypeExpr): Make this protected;
859         set the `ResolvingTypeTree' flag on the EmitContext.
860
861         * codegen.cs (EmitContext.ResolvingTypeTree): New public field.
862
863 2005-05-10  Marek Safar  <marek.safar@seznam.cz>
864
865         * class.cs (Method.Define): Catch attempt for Finalizer declaration.
866         
867         * expression.cs (Argument.GetParameterModifier): Turned to property.
868         (Invocation.Error_InvalidArguments): Add more descriptive errors.
869         
870         * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
871         its C# equivalent.
872         
873 2005-05-09  Raja R Harinath  <rharinath@novell.com>
874
875         Fix #74852.
876         * decl.cs (MemberCache.AddMethods): Register override methods,
877         rather than non-override methods.
878         * typemanager.cs (RegisterOverride): New.
879         (IsOverride): Update.
880
881 2005-05-09  Marek Safar  <marek.safar@seznam.cz>
882
883         * typemanager.cs (TypeManager): Moved InitGenerics to Reset method.
884
885 2005-05-06  Martin Baulig  <martin@ximian.com>
886
887         * attribute.cs
888         (Attributable.IsClsComplianceRequired): Fix typo in the method name.
889         (AttributeTester.AnalyzeTypeCompliance): Add generics support.
890
891 2005-05-09  Marek Safar  <marek.safar@seznam.cz>
892
893         Fix #73105.
894         
895         * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
896         recursive declaration.
897         
898         * statement.cs (Block.ResolveMeta): Report any error in resolving.
899         
900 2005-05-06  Marek Safar  <marek.safar@seznam.cz>
901
902         * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
903         
904         * expression.cs (Binary.DoResolve): (x && 0) is always 0.
905
906 2005-05-05  Raja R Harinath  <rharinath@novell.com>
907
908         Fix #74797.
909         * decl.cs (DeclSpace.FamilyAccessible): 
910         Use TypeManager.IsNestedFamilyAccessible.
911
912         Fix reopened #64812.
913         * typemanager.cs (Closure.Filter): Introduce checks for 'protected
914         internal'.
915
916 2005-05-04  Raja R Harinath  <rharinath@novell.com>
917             Abin Thomas  <projectmonokochi@rediffmail.com>
918             Anoob V E  <projectmonokochi@rediffmail.com>
919             Harilal P R  <projectmonokochi@rediffmail.com>
920
921         Fix #64812.
922         * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
923         allow access to all static members.
924
925 2005-05-04  Martin Baulig  <martin@ximian.com>
926
927         * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
928
929 2005-05-04  Martin Baulig  <martin@ximian.com>
930
931         Fix #74655.
932
933         * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
934         section at the end; make things work if `default' is not the last
935         section.        
936
937 2005-05-04  Martin Baulig  <martin@ximian.com>
938
939         Fix #70400.
940
941         * statement.cs (Switch): Replaced the `got_default' field with a
942         `default_section' one.
943         (Switch.CheckSwitch): Set `default_section' here.
944         (Switch.Resolve): If we're a constant switch and the constant is
945         not found, use the default section.
946
947 2005-05-03  Martin Baulig  <martin@ximian.com>
948
949         * expression.cs (ArrayAccess.EmitGetLength): New public method.
950
951         * statement.cs (Foreach.ArrayForeach): New nested class.
952         (Foreach.TemporaryVariable): New nested class.
953         (Foreach.EmitArrayForeach): Removed; this is now in the new
954         ArrayForeach class.
955
956 2005-05-03  Raja R Harinath  <rharinath@novell.com>
957
958         * pending.cs (BaseImplements): Move the #74773 fix here.  This is
959         more conservative.
960         (VerifyPendingMethods): Revert change below.
961
962         * typemanager.cs (IsOverride, RegisterNonOverride): New.
963         * decl.cs (MemberCache.AddMethod): Register "non-override" methods
964         that used to trigger warning -28.  Remove warning -28.
965         * expression.cs (Invocation.OverloadResolve): Use
966         TypeManager.IsOverride to distinguish override methods.
967
968         Fix #74773.
969         * pending.cs (VerifyPendingMethods): If a base type implements the
970         requested interface, don't bother checking individual methods of
971         the base type.  As a side-effect, this prevents the creation of
972         unnecessary proxies.
973
974 2005-05-02  Martin Baulig  <martin@ximian.com>
975
976         Fix #70182.
977
978         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
979         Also `And' the locals if the old vector is null.
980         (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
981         null; in this case we basically reset all the variables.        
982
983 2005-05-02  Martin Baulig  <martin@ximian.com>
984
985         Fix #74529.
986
987         * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
988         Added `FlowBranching branching' argument; always `and' the
989         variables instead of `or'ing them unless we're an infinite loop.
990
991         * statement.cs (While.Resolve): Create a new sibling unless we're
992         infinite.       
993
994 2005-05-02  Martin Baulig  <martin@ximian.com>
995
996         Fix #70140.
997
998         * class.cs (ConstructorInitializer.Resolve): Added `Block block'
999         arguments; use it instead of creating a new TopLevelBlock.
1000         (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
1001         our ConstructorInitializer.
1002
1003         * statement.cs
1004         (TopLevelBlock.TopLevelBranching): New public property.
1005         (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
1006         and create our `TopLevelBranching'.
1007
1008         * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
1009         anonymous method host, use `block.TopLevelBranching' rather than
1010         creating a new branching.
1011
1012 2005-04-20  Miguel de Icaza  <miguel@novell.com>
1013
1014         * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
1015         a ScopeInfo, if any of the current children is a child of the new
1016         entry, move those children there.
1017
1018 2005-04-30  Martin Baulig  <martin@ximian.com>
1019
1020         * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
1021         at the beginning of a SwitchSection.  Fix #73335.
1022
1023 2005-04-27  Marek Safar  <marek.safar@seznam.cz>
1024
1025         Fix #74378
1026         * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
1027         
1028         * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
1029         (FieldExpr.DoResolve): Obsolete members are ignored for field
1030         initializers.
1031         
1032 2005-04-26  Marek Safar  <marek.safar@seznam.cz>
1033
1034         * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
1035         of arrays detection.
1036
1037         * class.cs (Interface.VerifyClsCompliance): Add base interfaces
1038         verification.
1039         (Field.VerifyClsCompliance): Volatile fields are not compliant.
1040
1041         * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
1042         arrays report.
1043
1044 2005-04-25  Ben Maurer  <bmaurer@ximian.com>
1045
1046         * cs-parser.jay: Use the prefered version of -unsafe in error
1047         message.
1048
1049 2005-04-22  Marek Safar  <marek.safar@seznam.cz>
1050
1051         * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
1052         circumstances.
1053
1054 2005-04-20  John Luke  <john.luke@gmail.com>
1055
1056         * driver.cs: fix typo in error message, --outout to --output
1057
1058 2005-04-30  Martin Baulig  <martin@ximian.com>
1059
1060         * attribute.cs (Attribute.CheckSecurityActionValidity): Correctly
1061         handle the .NET 2.x security attributes.
1062
1063 2005-04-30  Martin Baulig  <martin@ximian.com>
1064
1065         * typemanager.cs
1066         (TypeManager.ExpandInterfaces): Don't add things twice.
1067
1068         * class.cs
1069         (TypeContainer.VerifyClsCompliance): Allow generic instances.
1070
1071 2005-04-29  Martin Baulig  <martin@ximian.com>
1072
1073         * generic.cs (Constraints.ResolveTypes): Expand interfaces.
1074
1075         * anonymous.cs: Added support for anonymous generic methods.
1076
1077 2005-04-29  Martin Baulig  <martin@ximian.com>
1078
1079         * typemanager.cs (TypeManager.GetInterfaces): Correctly handle
1080         generic instances.
1081
1082 2005-04-29  Martin Baulig  <martin@ximian.com>
1083
1084         * generic.cs (TypeManager.HasConstructorConstraint): Removed.
1085
1086         * expression.cs (New.DoResolve): Fix the CS0304 check.
1087
1088 2005-04-29  Martin Baulig  <martin@ximian.com>
1089
1090         * typemanager.cs (TypeManager.GetFullName): Updated to the new
1091         naming schema.
1092
1093         * class.cs (MethodCore.IsDuplicateImplementation): If we're an
1094         explicit interface implementation, compare the interface types.
1095         (MethodData.Define): Use the new naming scheme from the latest
1096         .NET 2.x beta2.
1097         (MemberBase.DoDefineBase): Resolve `InterfaceType' here.
1098
1099         * decl.cs (MemberName.GetMemberName): Removed.
1100         (MemberName.MethodName, FullName): New properties.
1101
1102 2005-04-25  Raja R Harinath  <rharinath@novell.com>
1103
1104         * gmcs.exe.config: Update v2.0.40607 -> v2.0.50215.
1105
1106 2005-04-22  Martin Baulig  <martin@ximian.com>
1107
1108         * generic.cs (GenericMethod): Create the EmitContext in the
1109         `Define()'; in `Define(MethodBuilder)', create the type parameters
1110         before calling `Define()'.  Fixes #73933.
1111
1112 2005-04-22  Martin Baulig  <martin@ximian.com>
1113
1114         * generic.cs
1115         (Constraints.Resolve): Make things work wrt. the new type lookup system.
1116         (ConstructedType.ResolveAsTypeTerminal): Don't override this.
1117
1118         * ecore.cs (Expression.ResolveAsTypeTerminal): If `te' is a
1119         ConstructedType, check its constraints.
1120
1121 2005-04-20  Marek Safar  <marek.safar@seznam.cz>
1122
1123         * codegen.cs (InRefOutArgumentResolving): New field.
1124         
1125         * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
1126         fields outside contructor.
1127         
1128         * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
1129         
1130 2005-04-19  Miguel de Icaza  <miguel@novell.com>
1131
1132         * anonymous.cs (CaptureContext.EmitParameterInstance): The
1133         parameter code was not completed ever, so it was not as up-to-date
1134         as local variables.  Must finish it.
1135
1136         The bug fix was to compare the Toplevel of the block, not the
1137         current block.  Thanks for Ben for pointing this out. 
1138
1139 2005-04-19  Raja R Harinath  <rharinath@novell.com>
1140
1141         * decl.cs (AddMethods): Use the declaring type of the problem
1142         method to determine if we want to squash a warning.
1143
1144 2005-04-19  Marek Safar  <marek.safar@seznam.cz>
1145
1146         * attribute.cs: Removed debug output.
1147
1148         * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
1149         
1150         * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
1151         Report.Stderr.
1152         
1153 2005-04-18  Raja R Harinath  <rharinath@novell.com>
1154
1155         Fix #74481.
1156         * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
1157         (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
1158         all null comparisons against reference types.
1159
1160 2005-04-18  Marek Safar  <marek.safar@seznam.cz>
1161
1162         Fix# 74565
1163         * class.cs (TypeContainer.CircularDepException) New nested
1164         exception class.
1165         (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
1166         (TypeContainer.DefineType): Removed error, reset InTransit before
1167         exit.
1168         (Class.DefineType): Throw exception when is in Transit.
1169         Catch exception and report error.
1170         (Struct.DefineType): Throw exception when is in Transit.
1171         Catch exception and report error.
1172         (Interface.DefineType): Throw exception when is in Transit.
1173         Catch exception and report error.
1174
1175         * codegen.cs: Add InCatch,InFinally to EmitContext to easily
1176         handle nested exception handlers.
1177
1178         * flowanalysis.cs (InTryWithCatch): New method, search for try with
1179         a catch.
1180
1181         * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
1182         InFinally and InCatch storage.
1183
1184         * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
1185         (Catch.Resolve): Set and Restore ec.InCatch.
1186         (Try.Resolve): Set and Restore ec.InFinally.
1187         (Try.HasCatch): True when try has catch.
1188
1189 2005-04-17  Atsushi Enomoto  <atsushi@ximian.com>
1190
1191         * doc.cs : In some cases FilterName returns MonoEvent and MonoField
1192           for the same event member, so exclude such cases from warning 419.
1193           Fixed bug #74633.
1194
1195 2005-04-16  Miguel de Icaza  <miguel@novell.com>
1196
1197         * expression.cs (Binary.ResolveOperator): Apply patch from John
1198         Luke to fix bug 59864: operators &, | and ^ on enumerations
1199         require that the same enum type on both sides.
1200
1201         * driver.cs: Add warnings to old flag usage, this is to assist
1202         people who produce Makefiles and hope that the Makefiles will be
1203         used on Windows.
1204
1205         * class.cs (TypeContainer.EmitType): Moved the definition of the
1206         special $PRIVATE$ field from the resolve phase to the Emit phase.
1207         During resolve we do not know if we are a struct with
1208         HasExplicitLayout, we know this only after the attributes for the
1209         type are emitted.
1210
1211         Set the FieldOffset to zero on the dummy field that we create for
1212         the class.   Fixes 74590.
1213
1214 2005-04-16  Raja R Harinath  <rharinath@novell.com>
1215
1216         Fix #73834.
1217         * ecore.cs (PropertyExpr.resolved): New.
1218         (DoResolve): Use it to handle a case of double resolution here.
1219         Handle a case of identical-name-and-type-name.
1220         * expression.cs (ArrayCreation.CheckIndices): Avoid double
1221         resolution by storing the results of expression resolution back
1222         into the "probes" array.
1223
1224 2005-04-15  Raja R Harinath  <rharinath@novell.com>
1225
1226         Fix cs0208-7.cs and cs0208-8.cs.
1227         * typemanager.cs (IsUnmanagedType): Arrays are not allowed
1228         (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0).  Improve
1229         error reporting to point out the reason a struct is not unmanaged.
1230
1231 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
1232
1233         * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and 
1234           just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
1235
1236 2005-04-13  Raja R Harinath  <rharinath@novell.com>
1237
1238         Fix #74528.
1239         * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
1240         IdenticalNameAndTypeName here.
1241         (EventExpr.InstanceResolve): Likewise.
1242
1243 2005-04-13  Marek Safar  <marek.safar@seznam.cz>
1244
1245         C# 2.0 DefaultCharSetAttribute implementation
1246         
1247         * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
1248         which allows us to set GlobalNamespace for every resolve.
1249         (Attribute.ResolveArguments): Cut from Resolve.
1250         (Attribute.GetCharSetValue): Returns CharSet named argument.
1251         (Attribute.DefinePInvokeMethod): Gets default charset from
1252         module settings.
1253         (GlobalAttribute.ResolveAsTypeStep): Override.
1254         (GlobalAttribute.ResolveArguments): Override.
1255         
1256         * class.cs (TypeAttr): Is protected.
1257         
1258         * codegen.cs (ModuleClass.DefaultCharSet): New member.
1259         (ModuleClass.DefaultCharSetType): New memeber.
1260         (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
1261         
1262         * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
1263         charset from module.
1264         
1265         * delegate.cs (TypeAttr): Override.
1266         (Delegate.DefineType): Use this TypeAttr.
1267         
1268         * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
1269         at very early stage (before types are defined) to resolve model
1270         module attributes. It will probably not work with corlib but it
1271         should be ok.
1272         
1273         * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
1274         charset from module.
1275         
1276         * typemanager.cs (default_charset_type): New type.
1277
1278 2005-04-13  Raja R Harinath  <rharinath@novell.com>
1279
1280         * decl.cs (MemberCache.AddMethods): Don't warn if
1281         System.Object.Finalize has buggy MethodAttributes.
1282
1283         * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
1284         removed below.
1285
1286 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
1287
1288         * doc.cs : detect ambiguous reference to overloaded members.
1289           Fixed bug #71603. MS 1.1 csc does not detect it.
1290
1291 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
1292
1293         * doc.cs : delegates must not be referenced with parameters.
1294           Fixed bug #71605.
1295
1296 2005-04-12  Miguel de Icaza  <miguel@novell.com>
1297
1298         * typemanager.cs (IsUnmanagedType): Arrays are allowed.
1299
1300 2005-04-10  Miguel de Icaza  <miguel@novell.com>
1301
1302         * driver.cs (MainDriver): Stop processing if the CLS stage found
1303         errors. 
1304
1305         (CompilerCallableEntryPoint.InvokeCompiler): Always
1306         reset after execution;   Take a TextWriter argument for the
1307         output.
1308
1309         * report.cs: Use the error stream instead of hardcoding stderr. 
1310
1311 2005-04-09  Miguel de Icaza  <miguel@novell.com>
1312
1313         * class.cs: Reduce code paths to test, too small of an
1314         optimization to make it worth the extra testing.  Always perform
1315         it. 
1316
1317 2005-04-08  Raja R Harinath  <rharinath@novell.com>
1318
1319         Fix #74510.
1320         * class.cs (OperatorArrayList.CheckPairedOperators): Skip
1321         operators that had errors reported on them.
1322
1323 2005-04-08  Marek Safar  <marek.safar@seznam.cz>
1324
1325         * attribute.cs (Attribute.IsValidArgumentType): Test valid named
1326         argument types.
1327         (Attribute.Resolve): Add named argument type checking.
1328         
1329         * class.cs (FixedField.Define): Use IsPrimitiveType
1330         
1331         * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
1332         
1333         * iterators.cs (Iterator.DefineIterator): Add check for arglist and
1334         unsafe parameter types.
1335         
1336         * statement.cs (Using.ResolveExpression): Add better error description.
1337         
1338         * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
1339         
1340 2005-04-08  Raja R Harinath  <rharinath@novell.com>
1341
1342         Fix #74484.
1343         * attribute.cs (Attribute.GetAttributeUsage): Resolve
1344         AttributeUsageAttribute in the emitcontext of the attribute class,
1345         not in the emitcontext of the attributable entity it was attached to.
1346         * cs-parser.jay: Use 'current_class', not 'current_container',
1347         when creating a GlobalAttribute.
1348
1349 2005-04-08  Alp Toker  <alp@atoker.com>
1350
1351         * pending.cs: The fix to #58413 failed to compile methods implementing
1352         interfaces with/without params modifiers and vice versa, even though
1353         params modifiers aren't part of the signature. Make the modifier check
1354         less strict as in csc.
1355
1356 2005-04-07  Abin Thomas  <projectmonokochi@rediffmail.com>
1357             Anoob V E  <projectmonokochi@rediffmail.com>
1358             Harilal P R  <projectmonokochi@rediffmail.com>
1359
1360         Fix #58413.
1361         * pending.cs (TypeAndMethods.mods): New.  Store the parameter
1362         modifiers of pending methods.
1363         (PendingImplementation.PendingImplementation): Initialize it.
1364         Add Parameter.Modifier [][] mods and initialize it with ParameterData.
1365         (PendingImplementation.InterFaceMethod): Repalce Type[] argument
1366         with ParameterData.  Add check for modifiers.
1367         * class.cs (MethodData.Define): Update to changes.
1368
1369 2005-04-07  Raja R Harinath  <rharinath@novell.com>
1370
1371         * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
1372
1373 2005-04-07  Marek Safar  <marek.safar@seznam.cz>
1374
1375         * class.cs (PropertyMethod.Define): Check private accessor in abstract
1376         property.
1377         
1378         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
1379         
1380         * rootcontext.cs,
1381         * typemanager.cs: Registered RequiredAttributeAttribute.
1382         
1383 2005-04-06  Marek Safar  <marek.safar@seznam.cz>
1384
1385         * class.cs (VerifyMembers): Doesn't need EmitContext argument.
1386         Warning CS0169 is back at level 3.
1387         (IMethodData.SetMemberIsUsed): New method.
1388         
1389         * decl.cs (IsUsed): New value; moved from FieldBase.Status
1390         (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
1391         
1392         * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
1393
1394         * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
1395         contants.
1396         (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
1397         is used.
1398         
1399         * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
1400         is used.
1401         
1402         * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
1403         to avoid the problems with nested types.
1404
1405 2005-04-05  Abin Thomas  <projectmonokochi@rediffmail.com>
1406             Anoob V.E  <projectmonokochi@rediffmail.com>
1407             Harilal P.R  <projectmonokochi@rediffmail.com>
1408             Raja R Harinath  <rharinath@novell.com>
1409
1410         Fix #73820.
1411         * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
1412         attribute.
1413         * typemanager (GetConstructor): Make public.
1414
1415 2005-04-05  John Luke  <john.luke@gmail.com>
1416             Raja R Harinath  <rharinath@novell.com>
1417
1418         Fix #62232.
1419         * typemanager.cs (IsUnmanagedType): Check non-public fields of a
1420         struct too.  Return false quicker in a few cases.
1421         (VerifyUnManaged): Use it.
1422
1423 2005-04-05  Raja R Harinath  <rharinath@novell.com>
1424
1425         Fix #74041.
1426         * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
1427         not 'unreachable_seen'.
1428
1429 2005-04-04  Marek Safar  <marek.safar@seznam.cz>
1430
1431         * attribute.cs (Attribute.GetValue): Removed unused.
1432         
1433         * codegen.cs (CodeGen.TrimExt): Removed unused.
1434         
1435         * cs-parser.jay (output): Removed unused.
1436         
1437         * cs-tokenizer.cs (hex_digits): Removed unused.
1438         
1439         * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
1440         
1441         * expression.cs (Indirection.LoadExprValue): Removed unused.
1442         (ArrayCreation.ExpressionToArrayArgument): Removed unused.
1443         
1444         * iterators.cs (Iterator.param_types): Removed unused.
1445         
1446         * statement.cs (Goto.block): Removed unused.
1447         (ToplevelBlock.did): Removed unused.
1448         (Switch.ResolveConstantSwitch): Removed unused.
1449
1450 2005-04-01  Ben Maurer  <bmaurer@ximian.com>
1451
1452         * rootcontext.cs: Allow mcs to bootstrap with the compilation
1453         resetting thingy.
1454
1455 2005-04-19  Martin Baulig  <martin@ximian.com>
1456
1457         Merged r42462 from MCS and made it work for GMCS.
1458
1459         * class.cs (MethodCore.ds): Moved this field to `MemberBase'.
1460
1461         * generic.cs (GenericMethod.Define): Removed `return_type' argument.
1462
1463 2005-04-01  Raja R Harinath  <rharinath@novell.com>
1464
1465         Fix #74232 and cs0208-3.cs.
1466         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
1467         * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
1468         unmanaged type.  Don't use FieldBuilders when 't' is a
1469         TypeBuilder.  Use ModFlags and MemberType fields.
1470         * class.cs (MemberBase.member_type): Rename from MemberType.
1471         (MemberBase.MemberType): New property.  Determines member_type on
1472         demand.
1473         (MemberBase.DoDefine): Don't initialize MemberType here.
1474         (FieldMember.Define): Likewise.
1475
1476 2005-04-01  Marek Safar  <marek.safar@seznam.cz>
1477
1478         Fix #74241
1479         * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
1480         Attributes are emitted there.
1481         
1482 2005-04-01  Raja R Harinath  <rharinath@novell.com>
1483
1484         * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
1485         keyword in 'partial enum' too.
1486         * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
1487         is not allowed).
1488         Report from Kamil Skalski <nazgul@omega.pl>.
1489
1490         Fix #74309.
1491         * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
1492         have partial containers too.
1493
1494         * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
1495         in block' checks to Block.CheckInvariantMeaningInBlock.
1496         * statement.cs (Block.GetKnownVariableInfo): Make private.
1497         (Block.IsVariableUsedInChildBlock): Remove.
1498         (Block.IsVariableUsedInBlock): Likewise.
1499         (Block.CheckInvariantMeaningInBlock): New.  Show location of
1500         conflicting declaration.
1501         (Block.AddVariable): Make error messages less long-winded and more
1502         specific.  Show location of conflicting declaration.
1503         * parameter.cs (Parameters.Location): New readonly property.
1504
1505 2005-03-31  Raja R Harinath  <rharinath@novell.com>
1506
1507         Clean up semantics of invoking ResolveMemberAccess.
1508         * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
1509         can have an instance, ensure that we pass in a non-TypeExpression
1510         to ResolveMemberAccess.  Tighten up IdenticalNameAndTypeName checks.
1511         (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
1512         argument.  Update to changes and simplify.
1513         (FieldExpr.Emitinstance): Remove CS0120 check.
1514         (PropertyExpr.EmitInstance): Likewise.
1515         * expression.cs (Argument.Resolve): Likewise.
1516         (Invocation.DoResolve): Update to changes in semantics of
1517         InstanceExpression.
1518
1519 2005-03-31  Marek Safar  <marek.safar@seznam.cz>
1520
1521         Fix #74241
1522         * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
1523         customization.
1524         
1525         * decl.cs (MemberCache.AddMethods): Fix infinite loop.
1526
1527 2005-03-31  Raja R Harinath  <rharinath@novell.com>
1528
1529         Fix difference in behaviour with commandline invocation.
1530         * driver.cs (Driver.Reset): New.
1531         (CompilerCallableEntryPoint): Call it.
1532
1533         * statement.cs (If.Resolve): Avoid spurious "uninitialized
1534         variable" warnings if the boolean expression failed to resolve.
1535
1536 2005-03-30  Sebastien Pouliot  <sebastien@ximian.com>
1537
1538         * attribute.cs: Fix the union of several permissions when some of them
1539         are unrestricted (so the result isn't an unrestricted permission set).
1540         Fix #74036.
1541
1542 2005-03-30  Raja R Harinath  <rharinath@novell.com>
1543
1544         * ecore.cs (MemberExpr): New class.  Convert from interface
1545         IMemberExpr.
1546         (MemberExpr.ResolveMemberAccess): Refactor and move here from
1547         MemberAccess.ResolveMemberAccess.  Tighten up pre-conditions and
1548         error checks.
1549         (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
1550         (MethodGroupExpr.IsExplicitImpl): Remove.
1551         (Expression.GetFieldFromEvent): Remove.
1552         (SimpleName.MemberStaticCheck): Remove.
1553         (SimpleName.DoSimpleNameResolve): Update to changes.
1554         * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
1555         (MemberAccess.IdenticalNameAndTypeName): Remove.
1556         (MemberAccess.error176): Move to MemberExpr.
1557         (MemberAccess.DoResolve): Update to changes.
1558         (BaseAccess.DoResolve): Likewise.
1559
1560 2005-03-30  Marek Safar  <marek.safar@seznam.cz>
1561
1562         C# 2.0 Conditional attribute class implementation
1563         
1564         * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
1565         Analyzes class whether it has attribute which has ConditionalAttribute
1566         and its condition is not defined.
1567         
1568         * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
1569         (Class.IsExcluded): New method. Search for at least one defined
1570         condition in ConditionalAttribute of attribute class.
1571
1572 2005-03-30  Raja R Harinath  <rharinath@novell.com>
1573
1574         * ecore.cs (PropertyExpr): Derive from Expression, not
1575         ExpressionStatement.
1576         (PropertyExpr.EmitStatement): Remove.
1577
1578 2005-03-29  Raja R Harinath  <rharinath@novell.com>
1579
1580         Fix #74060.
1581         * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
1582         internal field "value__" of an enum be private.  The examples for
1583         "value__" that I found on MSDN all used FieldAttributes.Private.
1584
1585         * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
1586         Don't mention IL method attribute names.
1587
1588         Fix #47991.  Remove a TODO.
1589         * statement.cs (Block.Toplevel): Make into a field.
1590         (Block.Parameters): Move into ToplevelBlock.
1591         (Block.known_variables): Rename from child_variable_names.
1592         (Block.Block): Remove variants that take Parameters.  Initialize
1593         'Toplevel' with the immediately surrounding toplevel block.
1594         (Block.AddKnownVariable): Rename from AddChildVariableName.  Add a
1595         LocalInfo parameter.
1596         (Block.GetKnownVariableInfo): New.
1597         (Block.IsVariableNameUsedInChildBlock): Update.
1598         (Block.IsVariableNameUsedInBlock): New.  Checks if a name is used in
1599         the block, even though it may not be in scope.
1600         (Block.AddVariable): Remove Parameters parameter.  Use
1601         Toplevel.Parameters instead.
1602         (Block.AddConstant): Remove Parameters parameter.
1603         (Block.GetParameterReference): Update to use Toplevel.Parameters.
1604         (Block.IsParamaterReference): Likewise.
1605         (Block.IsLocalParameter): Likewise.  Simplify a lot.
1606         (ToplevelBlock.Parameters): New.  Moved from Block.
1607         (ToplevelBlock.ToplevelBlock): Update to changes.  Always
1608         initialize Parameters to a non-null value.
1609         * cs-parser.jay: Update to changes.
1610         * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
1611         simple names that mean different things in the same block.  Use
1612         Block.IsVariableNameUsedInBlock.
1613
1614 2005-03-28  Raja R Harinath  <rharinath@novell.com>
1615
1616         * enum.cs (Enum.LookupEnumValue): Remove debugging code.
1617
1618 2005-03-26  Raja R Harinath  <harinath@acm.org>
1619
1620         Fix #73038.
1621         * assign.cs (Assign.DoResolve): When the RHS of an assignment
1622         fails to resolve, ensure that the LHS is still resolved as an
1623         lvalue.
1624
1625 2005-03-25  Raja R Harinath  <harinath@acm.org>
1626
1627         * enum.cs (Enum.DefineType): Set ec.InEnumContext and
1628         ec.ContainerType.
1629         (Enum.current_ec): Remove.
1630         (Enum.LookupEnumValue): Remove EmitContext argument.
1631         Just uses the one created during DefineType.
1632         (Enum.FindMembers): Update.
1633         * expression.cs (MemberAccess.DoResolve): Update.
1634
1635 2005-03-22  Marek Safar  <marek.safar@seznam.cz>
1636
1637         * assign.cs (Assign.DoResolve): Check for CS1717 when
1638         source and target are same (uses Equals).
1639
1640         * expression.cs (LocalVariableReference, ParameterReference,
1641         This): Implemented Equals, GetHashCode.
1642
1643         * statement.cs (Block.GetParameterReference): Removed useless
1644         local variable.
1645
1646 2005-03-22  Raja R Harinath  <rharinath@novell.com>
1647
1648         Fix cs0128.cs
1649         * statement.cs (Block.AddVariable): Ensure that we skip implicit
1650         blocks before deciding whether the error is cs0136 or cs0128.
1651
1652         * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
1653         (using_alias_directive, using_namespace_directive): Pass
1654         MemberName, not an expression to Namespace.UsingAlias and
1655         Namespace.Using.
1656         (MakeName): Use the MemberName of the namespace.
1657         * namespace.cs (Namespace.MemberName): New.
1658         (UsingEntry.UsingEntry): Take a MemberName, not an expression.
1659         (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
1660         Likewise.
1661         * decl.cs (MemberName.Name): Make readonly.
1662         (MemberName.FromDotted): New "constructor".
1663         (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
1664         (MemberCore.Name): Compute from MemberName on demand.
1665         (MemberCore.SetMemberName): Provide a way to change the
1666         MemberName.
1667         (MemberCore.AddToContainer): Don't take a fullname parameter.
1668         * class.cs (TypeContainer.AddToMemberContainer): Don't add the
1669         fully qualified name of the container to the member name.
1670         (TypeContainer.AddToTypeContainer): Use a fully qualified name
1671         only if the type is a member of the root container.
1672         (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
1673         MemberName.Left rather than searching for an embedded ".".
1674         (PartialContainer.CreatePart): Update to changes in RootContext.
1675         (MemberBase.ShortName): Turn into a property.  Use
1676         MemberCore.SetMemberName.
1677         (MemberBase.ExplicitInterfaceName): Remove.
1678         (MemberBase.UpdateMemberName): Remove.
1679         (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
1680         (PropertyBase.SetMemberName): New override.
1681         * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
1682         (Tree.GetDecl): New.
1683         (Tree.AllDecls): Rename from Decls.
1684         * attribute.cs, enum.cs, report.cs: Update to changes.
1685         * driver.cs (MainDriver): Use MemberName.FromDotted on
1686         RootContext.MainClass.
1687
1688 2005-03-21  Marek Safar  <marek.safar@seznam.cz>
1689
1690         * class.cs (FixedField.Define): Check for CS1664 and more sanity
1691         checks.
1692
1693         * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
1694
1695 2005-03-18  Marek Safar  <marek.safar@seznam.cz>
1696
1697         * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
1698         property accessor modifiers.
1699
1700         * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
1701         fixed buffer attribute (CS1716).
1702         (PropertyMethod.HasCustomAccessModifier): When property accessor
1703         has custom modifier.
1704
1705         * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
1706         modifiers.
1707         (PropertyExpr.DoResolveLValue): Add CS0272.
1708
1709 2005-03-17  Miguel de Icaza  <miguel@novell.com>
1710
1711         * convert.cs: When converting to a pointer, use the proper Conv.U
1712         or Conv.I depending on the source data type.
1713
1714         * cs-tokenizer.cs: Make the size for large decimal constants,
1715         fixes #72957.
1716
1717 2005-03-17  Martin Baulig  <martin@ximian.com>
1718
1719         * anonymous.cs (AnonymousMethod.method_modifiers): Change default
1720         from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'.  Fixes #73260.
1721
1722 2005-03-17  Martin Baulig  <martin@ximian.com>
1723
1724         * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
1725         to bool so we can return an error condition.
1726         (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
1727         returned an error.
1728
1729 2005-03-16  Zoltan Varga  <vargaz@freemail.hu>
1730
1731         * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
1732         attributes.
1733
1734 2005-03-16  Raja R Harinath  <rharinath@novell.com>
1735
1736         Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
1737         Refactor to avoid traversing the list of assemblies, and to avoid
1738         string concatenation.
1739         * typemanager.cs (guid_attr_type): Remove.
1740         (negative_hits, pointers, references): Remove hashes.
1741         (type_hash): New.
1742         (GetConstructedType): New.  Uses type_hash to handle constructed
1743         types (arrays, references, pointers).
1744         (GetReferenceType, GetPointerType): Use it.
1745         (GetNestedType): New.  Uses type_hash to handle nested types of
1746         reflected types.
1747         (LookupType, LookupTypeDirect): Remove.
1748         (CoreLookupType): Inline parts of old LookupTypeDirect code.  Use
1749         'types' hash and LookupTypeReflection directly.
1750         (params_string, params_object): Use GetConstructedType.
1751         * namespace.cs (Namespace.cached_types): New.  Cache of reflected
1752         top-level types.
1753         (Namespace.Lookup): Use cached_types.
1754         (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
1755         provided by old TypeManager.LookupType.
1756         * rootcontext.cs (MakeFQN): Remove.
1757         * decl.cs (DeclSpace.MakeFQN): Likewise.
1758         (DeclSpace.LookupType): Use TypeManager.GetNestedType.
1759         * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
1760         TypeManager.GetConstructedType.
1761         * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
1762
1763 2005-04-16  Zoltan Varga  <vargaz@freemail.hu>
1764
1765         * cs-parser.jay: Fix build.
1766
1767 2005-03-15  Marek Safar  <marek.safar@seznam.cz>
1768
1769         * class.cs (TypeContainer.CircularDepException) New nested
1770         (MethodCore.CheckBase): Report CS1715 for properties and indexers.
1771
1772         * cs-parser.jay: Reports CS1527 for any namespace element.
1773
1774         * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
1775         Added CS0407.
1776
1777         * expression.cs (ParameterReference.IsAssigned): Changed error to
1778         CS0269.
1779         (Error_WrongNumArguments): Moved CS0245 detection here.
1780
1781         * statement.cs (Return.Resolve): Add CS1622 report.
1782
1783 2005-03-11  Marek Safar  <marek.safar@seznam.cz>
1784
1785         * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
1786
1787 2005-03-11  Zoltan Varga  <vargaz@freemail.hu>
1788
1789         * attribute.cs expression.cs: Get rid of some allocations.
1790
1791 2004-03-11  Atsushi Enomoto  <atsushi@ximian.com>
1792
1793         * doc.cs : just eliminate the latest change.
1794
1795 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
1796
1797         * doc.cs : commented out the latest change. It breaks xml-030.cs
1798
1799 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
1800
1801         * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
1802           fail. So invoke CreateType() in FindDocumentedType().
1803
1804 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
1805
1806         * cs-tokenizer.cs : added IsKeyword().
1807         * doc.cs : Detect keyword incorrectly used as identifier.
1808           Allow identifiers prefixed by @.
1809
1810 2005-03-10  Marek Safar  <marek.safar@seznam.cz>
1811
1812         * attributes.cs (Attributes.Emit): Continue after CheckTargets.
1813         It caused exception in namespace resolving (again!).
1814         
1815         * class.cs (Class.ctor): Removed exit.
1816         (PropertyMethod.ctor): ditto.
1817         
1818         * codegen.cs (Codegen.Reset): Reset static data.
1819         (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
1820         
1821         * cs-tokenizer.cs (Cleanup): Removed.
1822         
1823         * driver.cs (GetSystemDir): Rewrote to one line command.
1824         It caused problem with unloaded dynamic modules.
1825         (UnixParseOption): Removed Exit.
1826         (CompilerCallableEntryPoint.InvokeCompiler): Make static.
1827         (CompilerCallableEntryPoint.Reset): Reset suitable static data.
1828         Now can be mcs used as library.
1829         
1830         * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
1831         empty location.
1832         
1833         * location.cs (Reset): Reset static data.
1834         
1835         * namespace.cs (Reset): Reset static data.
1836         
1837         * report.cs (Report.Reset): Reset static data.
1838         
1839         * rootcontext.cs (RootContext.Reset): Reset static data.
1840         
1841         * tree.cs (RootTypes.ctor): Use Location.Null
1842         
1843         * typemanager.cs (TypeManager.Reset): Reset static data.
1844         (CoreLookupType): Removed Exit.
1845         (TypeHandle.Reset): Reset static data.
1846         
1847 2005-03-10  Raja R Harinath  <rharinath@novell.com>
1848
1849         Fix #73516.
1850         * typemanager.cs (ComputeNamespaces): Import namespaces from
1851         referenced modules too.
1852
1853 2005-03-09  Raja R Harinath  <rharinath@novell.com>
1854
1855         * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
1856         than '.'.
1857
1858 2005-03-09  Raja R Harinath  <rharinath@novell.com>
1859
1860         * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
1861         enclosing DeclSpace.  This ensures that a name-lookup populates
1862         more caches and there are fewer 'TypeExpression's.  Carve out
1863         nested type lookup into ...
1864         (LookupNestedTypeInHierarchy): ... this.
1865
1866 2005-04-15  Martin Baulig  <martin@ximian.com>
1867
1868         Merged r41590 from MCS and make it work in the generics land.
1869
1870         * generic.cs (TypeParameter.UpdateConstraints): Removed the
1871         `check' argument.
1872
1873         * class.cs (PartialContainer.UpdateConstraints): Removed.
1874         (PartialContainer.CheckConstraints): Removed.
1875         (PartialContainer.SetParameterInfo): Store the constraints here.
1876         (PartialContainer.DefineTypeParameters): New public method;
1877         resolve the type parameter's constraints here.  Note that the
1878         PartialContainer doesn't have an EmitContext anymore, so we must
1879         do this in the ClassPart.
1880
1881 2005-03-09  Raja R Harinath  <rharinath@novell.com>
1882
1883         Clean up a few partial-class semantics.  
1884         Fixes test-357.cs and cs1618-2.cs.
1885         * cs-parser.jay (struct_declaration): Use 'current_class' as
1886         parent of newly-created struct.  Remove call to Register ().
1887         Use 'pop_current_class' to complete handing the current struct.
1888         (interface_declaration): Likewise.
1889         (class_declaration): Likewise.
1890         (enum_declaration): Use 'current_class' as parent of newly created
1891         enum.
1892         (delegate_declaration): Likewise.
1893         (pop_current_class): New function.  This is used to handle closing
1894         up the 'current_class' and 'current_container', and pointing them
1895         to the enclosing class/container.
1896         (CSharpParser): Initialize 'current_class' too.
1897         * decl.cs (MemberCore): Add check for invariant: a partial
1898         container is not a parsed entity, and thus does not enclose any
1899         parsed members.
1900         (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
1901         (DeclSpace.BaseTypeExpr): Use it.
1902         (DeclSpace.LookupType): Add check for invariant.
1903         * class.cs (TypeContainer): Add check for invariant: a nested
1904         class should have the same NamespaceEntry as its enclosing class.
1905         (TypeContainer.EmitFieldInitializers): Make virtual.
1906         (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
1907         MemberCore.
1908         (TypeContainer.Register): Remove.
1909         (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
1910         null.  Use TypeResolveEmitContext for resolving base types and
1911         interfaces.  Move initialization of Parts.TypeBuilder here from
1912         ...
1913         (TypeContainer.DefineNestedTypes): ... here.
1914         (PartialContainer): Take a Namespace not a NamespaceEntry.
1915         (PartialContainer.Create): Don't use Register.  Call the
1916         appropriate Add... function directly.
1917         (ClassPart): Take both the PartialContainer and the enclosing
1918         class as constructor arguments.
1919         (ClassPart.EmitFieldInitializers): Override.
1920         (ClassPart.PartFindNestedTypes): Remove.
1921         (FieldBase.GetInitializerExpression): Resolve the initializer
1922         expression in the emit context of the enclosing class.
1923         * tree.cs (RootTypes): Remove Register ().
1924         
1925 2005-03-08  Marek Safar  <marek.safar@seznam.cz>
1926
1927         * cs-parser.jay: Removed CS0134.
1928         
1929         * driver.cs: Removed CS1901.
1930         
1931         * expression.cs (SizeOf.DoResolve): Don't report CS0233
1932         for predefined types.
1933
1934 2005-03-07  Duncan Mak  <duncan@novell.com>
1935
1936         * codegen.cs (Save):  Catch UnauthorizedAccessException as
1937         well. Fixes bug #73454.
1938
1939 2005-03-07  Marek Safar  <marek.safar@seznam.cz>
1940
1941         * cs-tokenizer.cs (xtoken): Add CS1035.
1942         
1943         * class.cs (MethodData.Define): Add CS0683.
1944         (FieldMember.ctor): Add CS0681.
1945
1946 2005-03-07  Raja R Harinath  <rharinath@novell.com>
1947
1948         * ecore.cs (SimpleName.DoResolve): Rename from
1949         SimpleName.DoResolveAllowStatic.
1950         (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
1951         Pass 'intermediate' flag to MemberStaticCheck.
1952         (SimpleName.MemberStaticCheck): Skip "static check" only in case
1953         of "intermediate" lookups via MemberAccess.
1954         (SimpleName.IdenticalNameAndTypeName): New.  Carved out of ...
1955         * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
1956
1957 2005-03-07  Raja R Harinath  <rharinath@novell.com>
1958
1959         Fix #73394.
1960         * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
1961         slipped in because of variable names that are identical to a
1962         builtin type's BCL equivalent ('string String;', 'int Int32;').
1963         (PropertyExpr.EmitInstance): Likewise.
1964
1965 2005-03-04  Marek Safar  <marek.safar@seznam.cz>
1966
1967         * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
1968         
1969         * report.cs (warning_ignore_table): Made public.
1970
1971 2005-03-04  Raja R Harinath  <rharinath@novell.com>
1972
1973         Fix #73282.
1974         * class.cs (MethodData.Emit): Pass 'container' to
1975         container.GetObsoleteAttribute instead of 'container.Parent'.
1976
1977 2005-03-03  Marek Safar  <marek.safar@seznam.cz>
1978
1979         * cs-parser.jay: Add 1534 error test.
1980
1981         * iterators.cs (Yield.CheckContext): Add error 1629.
1982         (Iterator.ctor): Save unsafe modifier.
1983         (MoveNextMethod.DoEmit): Restore unsafe context.
1984
1985         * namespace.cs (UsingAlias): Better error message.
1986
1987 2005-03-03  Dan Winship  <danw@novell.com>
1988
1989         * convert.cs (Error_CannotImplicitConversion): fix two bugs in
1990         the warning message [#73219]
1991
1992 2005-03-03  Raja R Harinath  <rharinath@novell.com>
1993
1994         Fix compile with MCS 1.0.0.0.
1995         * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
1996         w_restore to not depend on string constant folding.
1997
1998 2005-03-03  Raja R Harinath  <rharinath@novell.com>
1999
2000         * decl.cs (DeclSpace.LookupType): Remove 'silent' argument.  Move
2001         CS0246 check to users who passed 'silent = false'.
2002         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
2003         check.
2004         (SimpleName.SimpleNameResolve): Update.
2005         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
2006         (MemberAccess.IdenticalNameAndTypeName): Update.
2007         * doc.cs (FindDocumentedTypeNonArray): Update.
2008
2009 2005-03-03  Raja R Harinath  <rharinath@novell.com>     
2010
2011         * codegen.cs (EmitContext): Remove ResolvingTypeTree.
2012         * parameters.cs (ComputeAndDefineParameters): Remove.
2013         * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
2014         * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
2015         Use GetParameterInfo.
2016
2017 2005-03-02  Marek Safar  <marek.safar@seznam.cz>
2018
2019         * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
2020
2021 2005-03-02  Raja R Harinath  <rharinath@novell.com>
2022
2023         Unify DeclSpace.LookupType and DeclSpace.FindType.
2024         * decl.cs (DeclSpace.FindNestedType): New virtual function.  This
2025         is in charge of defining nested types on demand.
2026         (DeclSpace.LookupType): Use it when the current_type is a
2027         TypeBuilder.  Use LookupTypeDirect for reflected types.
2028         (DeclSpace.FindType): Remove.
2029         (DeclSpace.LookupInterfaceOrClass): Likewise.
2030         (DeclSpace.DefineTypeAndParents): Likewise.
2031         * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
2032         DeclSpace.LookupType.
2033         * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
2034         * typemanager.cs (LookupType): Simplify.
2035         (AddUserType): Remove type from negative_hits.
2036         * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
2037         * class.cs (TypeContainer.FindMembers): Move handling of nested
2038         types ...
2039         (TypeContainer.FindMembers_NestedTypes): ... here.
2040         (TypeContainer.FindNestedType): Implement override.
2041         (ClassPart.FindNestedType): Delegate to PartialContainer.
2042         (ClassPart.PartFindNestedType): Looks up the nested types of the
2043         part alone.
2044
2045 2005-04-14  Martin Baulig  <martin@ximian.com>
2046
2047         * generic.cs (ConstructedType): Moved all the type lookup and
2048         nested class logic into SimpleName.
2049         (ConstructedType.ResolveConstructedType): Our underlying type is
2050         already fully resolved; all the type lookup stuff is in
2051         SimpleName.
2052
2053         * ecore.cs (SimpleName.ResolveAsTypeStep): Resolve nested
2054         constructed types here instead of in ConstructedType.
2055
2056         * decl.cs (MemberName.GetTypeExpression): Always create a
2057         SimpleName, not a ConstructedType.
2058         (DeclSpace.ResolveNestedType): Removed; this is now in SimpleName.
2059
2060 2005-03-02  Martin Baulig  <martin@ximian.com>
2061
2062         * class.cs (TypeContainer.DoDefineMembers): We also need a default
2063         static constructor in static classes.
2064
2065 2005-03-01  Zoltan Varga  <vargaz@freemail.hu>
2066
2067         * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
2068         sizeParamIndex is not specified.
2069
2070 2005-03-01  Marek Safar  <marek.safar@seznam.cz>
2071
2072         Fix #73117
2073         * report.cs (WarningMessage.IsEnabled): Missing null check.
2074
2075 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
2076
2077         * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
2078         in the fields and not in the properties.
2079
2080 2005-02-28  Zoltan Varga  <vargaz@freemail.hu>
2081
2082         * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex 
2083         fields as well.
2084
2085 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
2086
2087         * attribute.cs: Small refactoring (improved robustness).
2088         (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
2089         (ValidateGuid): Removed.
2090         (Resolve): Removed referenced to above mentioned.
2091         (GetAttributeUsage): Made private and changed to work without
2092         class assistance.
2093         (GetIndexerAttributeValue): Don't crash.
2094         (GetConditionalAttributeValue): Ditto.
2095         (GetClsCompliantAttributeValue): Ditto.
2096         (ExtractSecurityPermissionSet): All attributes exceptions are
2097         error 648.
2098         (GetPropertyValue): New helper.
2099         (GetMethodImplOptions): New method.
2100         (DefinePInvokeMethod): Reuse common code. Implemented handling of
2101         some missing properties.
2102         
2103         * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
2104         (Method.ApplyAttributeBuilder): Updated.
2105         
2106         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
2107         exception.
2108
2109 2005-02-28  Raja R Harinath  <rharinath@novell.com>
2110
2111         Fix #73052.
2112         * report.cs (Report.SymbolRelatedToPreviousError): Handle
2113         non-simple types (array, pointer, reference).
2114
2115 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
2116
2117         * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
2118
2119         * class.cs (MethodCore.IsDuplicateImplementation): Special error
2120         for operators.
2121         (Method.CheckBase): Catch wrong destructor here.
2122         (MethodData.Define): Add errors 550, 668.
2123
2124         * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
2125
2126         * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
2127
2128         * pending.cs (VerifyPendingMethods): Add error 551.
2129
2130         * typemanager.cs (CSharpName): Next error report helper.
2131
2132 2005-02-25  Marek Safar  <marek.safar@seznam.cz>
2133
2134         * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
2135         attributes. Removed useless attribute double check.
2136         It saves almost 2MBs for corlib.
2137
2138 2005-02-25  Raja R Harinath  <rharinath@novell.com>
2139
2140         Fix #72924.
2141         * statement.cs (ExpressionStatement.Resolve): Make robust to being
2142         called twice in case of error.
2143
2144 2005-02-23  Chris Toshok  <toshok@ximian.com>
2145
2146         Fix compiler portions of #72827.
2147         * statement.cs (Block.Emit): call Begin/EndScope on the
2148         EmitContext instead of the ILGenerator.
2149
2150         * codegen.cs (EmitContext.BeginScope): new method, call
2151         ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
2152         we have one.)
2153         (EmitContext.BeginScope): same, but EndScope and CloseScope
2154
2155         * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
2156         offset and call the superclass's OpenScope(int) with it.
2157         (SymbolWriter.CloseScope): get the current il
2158         offset and call superclass's CloseScope(int) with it.
2159
2160 2005-02-23  Marek Safar  <marek.safar@seznam.cz>
2161
2162         * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
2163         CS1677 for out and ref as well.
2164
2165         * class.cs (Method.Define): Add error CS1599 detection.
2166         
2167         * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
2168         
2169         * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
2170         
2171         * delegate.cs (Delegate.Define): Add error CS1599 detection.
2172         
2173         * support.cs.cs (ModifierDesc): New helper method.
2174
2175 2005-02-23  Raja R Harinath  <rharinath@novell.com>
2176             Abin Thomas  <projectmonokochi@rediffmail.com>
2177             Anoob V E  <projectmonokochi@rediffmail.com>
2178             Harilal P R  <projectmonokochi@rediffmail.com>
2179
2180         Fix #57851, #72718.
2181         * class.cs (ConstructorBuilder.Resolve): Make sure that the second
2182         MemberLookup (used for error reporting) actually returns a result.
2183         Fix error report number (122, not 112).
2184
2185 2005-02-22  Abin Thomas  <projectmonokochi@rediffmail.com>
2186             Anoob V E  <projectmonokochi@rediffmail.com>
2187             Harilal P R  <projectmonokochi@rediffmail.com>
2188
2189         Fix #71134.
2190         * pending.cs (PendingImplementation.GetAbstractMethods):
2191         Find NonPublic members too.
2192
2193 2005-02-22  Marek Safar  <marek.safar@seznam.cz>
2194
2195         * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
2196         Fixed error 217.
2197         
2198         * class.cs (MethodCore.CheckMethodAgainstBase):
2199         Add error 239 report.
2200
2201 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
2202
2203         * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
2204         
2205         * class.cs (Operator.Define): Add error 217 report.
2206         
2207 2005-02-21  Raja R Harinath  <rharinath@novell.com>
2208
2209         Fix #68955.
2210         * expression.cs (Invocation.IsApplicable): Make public.
2211         (Invocation.IsParamsMethodApplicable): Likewise.
2212         * delegate.cs (Delegate.VerifyApplicability): Don't use
2213         Invocation.VerifyArgumentCompat for parameter applicability
2214         testing.  Use Invocation.IsApplicable and
2215         Invocation.IsParamsMethodApplicable.
2216
2217 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
2218
2219         * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
2220         
2221         * class.cs (Operator.Define): Add error 217 report.
2222         
2223 2005-02-21  Raja R Harinath  <rharinath@novell.com>
2224
2225         * namespace.cs (UsingEntry.Resolve): Undo change below.
2226
2227 2005-02-21  Raja R Harinath  <rharinath@novell.com>
2228
2229         Fix #72756.
2230         * ecore.cs (Expression.MemberLookupFailed): Add argument to
2231         disable the error message when the extended MemberLookup also
2232         fails.
2233         (Expression.MemberLookupFinal): Update.
2234         (SimpleName.DoSimpleNameResolve): Update.
2235         * expression.cs (MemberAccess.ResolveNamespaceOrType):
2236         Don't use MemberLookupFinal.
2237         (New.DoResolve): Update.
2238         (BaseAccess.CommonResolve): Update.
2239
2240 2005-02-21  Raja R Harinath  <rharinath@novell.com>
2241
2242         Fix #72732.
2243         * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
2244         occured previously, don't resolve again.
2245
2246 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
2247
2248         Fix #69949
2249         * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
2250         argument. Call ResolveAttributeUsage for unresolved.
2251         when types doesn't match ctor arguments.
2252         
2253         * class.cs (DoDefineMembers.TypeContainer): Removed safety check
2254         for nested attribute classes.
2255         (Class.attribute_usage): Removed.
2256         (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
2257         for attribute class.
2258         
2259         * ecore.cs (IsAttribute): Removed.
2260         
2261         * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
2262         
2263         * rootcontext.cs (RegisterAttribute): Removed, attributes are
2264         now normal types.
2265         (attribute_types): Removed.
2266         (EmitCode): Global attributes are emited as the latest.
2267
2268 2005-02-18  Marek Safar  <marek.safar@seznam.cz>
2269
2270         * class.cs (EmitFieldInitializers): Don't emit field initializer
2271         for default values when optimilization is on.
2272         
2273         * constant.cs (Constant.IsDefaultValue): New property.
2274         
2275         * driver.cs: Add /optimize handling.
2276         
2277         * constant.cs,
2278         * ecore.cs,
2279         * literal.cs: Implement new IsDefaultValue property.
2280         
2281         * rootcontext.cs (Optimize): New field, holds /optimize option.
2282
2283 2005-02-18  Raja R Harinath  <rharinath@novell.com>
2284
2285         Fix crasher in re-opened #72347.
2286         * namespace.cs (Namespace.Lookup): Return null if
2287         DeclSpace.DefineType returns null.
2288
2289         Fix #72678.
2290         * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
2291
2292 2005-02-18  Raja R Harinath  <rharinath@novell.com>
2293
2294         Fix remainder of #63202.  Change semantics of DoResolveLValue: it
2295         now returns null if it cannot resolve to an lvalue.
2296         * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
2297         (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
2298         returned null.  Remove check for SimpleName.
2299         (EventExpr.DoResolveLValue): New.
2300         * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
2301         * expression.cs (Argument.Error_LValueRequired): New.  Move CS1510
2302         error from ...
2303         (Argument.Resolve): ... here.  Use it.  Use DoResolveLValue to
2304         avoid CS0131 error.
2305         (Unary.ResolveOperator): Move CS0211 check ...
2306         (Unary.DoResolve): ... here.  Use DoResolveLValue to avoid
2307         CS0131 error.
2308         (Unary.DoResolveLValue): Simplify.
2309         (AddressOf.DoResolveLValue): New.
2310         (ArrayAccess.DoResolveLValue): New.
2311
2312 2005-02-16  Marek Safar  <marek.safar@seznam.cz>
2313
2314         * attribute.cs (Attribute.Resolve): Add arguments casting for
2315         when types doesn't match ctor arguments.
2316
2317 2005-02-16  Raja R Harinath  <rharinath@novell.com>
2318
2319         Fix parts of #63202.
2320         * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
2321         lookup of operator in base type.  Ensure that all checks happen
2322         when the operator resolves to an "op_..." method.
2323
2324 2005-02-15  Raja R Harinath  <rharinath@novell.com>
2325
2326         Fix #71992.
2327         * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
2328         'ignore_cs0104' parameter.  Pass it to ...
2329         (NamespaceEntry.Lookup): ... this.
2330         * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
2331         * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
2332         (TypeLookupExpression.DoResolveAsTypeStep): Update.
2333         * expression.cs (MemberAccess.IdenticalNameAndTypeName):
2334         Update.  Request that cs0104 errors be ignored.
2335         (ComposedCast.ResolveAsTypeStep): Update.
2336
2337 2005-02-14  Raja R Harinath  <rharinath@novell.com>
2338
2339         Fix #59209.
2340         * expression.cs (Invocation.BetterFunction): Remove support for
2341         comparing virtual functions and their overrides.
2342         (Invocation.IsOverride): New.
2343         (Invocation.OverloadResolve): Don't consider 'override' functions
2344         during candidate selection.  Store them in a lookaside list.
2345         If the selected method is a 'virtual' function, use the list to
2346         find any overrides that are closer to the LHS type.
2347
2348 2005-02-14  Marek Safar  <marek.safar@seznam.cz>
2349
2350         * expression.cs (New.DoResolve): Add complex core type reduction.
2351         (New.Constantify): Converts complex core type syntax like 'new int ()'
2352         to simple constant.
2353         
2354 2005-02-14  Raja R Harinath  <rharinath@novell.com>
2355
2356         * decl.cs (EntryType.EntryType): New constructor to create an
2357         updated copy of a cache entry.
2358         (MemberCache.AddMethods): Use it.
2359         (MemberCache.ClearDeclaredOnly): Remove.
2360         (MemberCache.MemberCache): Update.
2361
2362 2005-02-11  Miguel de Icaza  <miguel@novell.com>
2363
2364         * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
2365         variable.  This one is represents the actual low-level declaration
2366         of the method, as opposed to the semantic level `IsStatic'.   
2367
2368         An anonymous method which is hosted into a static method might be
2369         actually an instance method.  IsStatic would reflect the
2370         container, while MethodIsStatic represents the actual code
2371         generated.
2372
2373         * expression.cs (ParameterReference): Use the new MethodIsStatic
2374         instead of IsStatic.
2375
2376         * anonymous.cs (AnonymousMethod.Compatible): Pass the
2377         Modifiers.STATIC to the Anonymous' Method EmitContext if static is
2378         set on the current EmitContext. 
2379
2380         * expression.cs (Cast): Overload DoResolveLValue so we can pass
2381         resolve our casted expression as an LValue.  This triggers the
2382         proper LValue processing that is later required by Assign.
2383
2384         This fixes 72347.
2385
2386         * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
2387
2388 2005-02-11  Marek Safar  <marek.safar@seznam.cz>
2389
2390         C# 2.0 Fixed buffer implementation
2391
2392         * anonymous.cs: Update after RegisterHelperClass renaming.
2393
2394         * attribute.cs (AttributeTester.fixed_buffer_cache):
2395         Cache of external fixed buffers.
2396         (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
2397         implementation if field is fixed buffer else null.
2398
2399         * class.cs
2400         (TypeContainer.AddField): Accept FieldMember instead of Field.
2401         (FieldBase.IsFieldClsCompliant): Extracted code from
2402         VerifyClsCompliance descendant customization.
2403         (FixedField): New class handles fixed buffer fields.
2404         (FixedFieldExternal): Keeps information about imported fixed
2405         buffer.
2406         (IFixedField): Make access to internal or external fixed buffer
2407         same.
2408
2409         * cs-parser.jay: Add fixed buffer parsing.
2410
2411         * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
2412         buffer.
2413
2414         * expression.cs (Indirection): Extended implementation to accept
2415         fixed buffer field.
2416         (PointerArithmetic.Emit): Get element from fixed buffer as well.
2417         (ElementAccess.MakePointerAccess): Get type as parameter.
2418         (DoResolve): Add fixed buffer field expression conversion.
2419         (DoResolveLValue): Ditto.
2420         (FixedBufferPtr): New class. Moved most of original ArrayPtr.
2421         (ArrayPtr): Derives from FixedBufferPtr.
2422         (ArrayPtr.Emit): Add extra emit for array elements.
2423
2424         * flowanalysis.cs.cs (StructInfo): Use FieldMember.
2425
2426         * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
2427         for compiler generated types.
2428         (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
2429
2430         * statement.cs (Fixed): Refactored to be easier add fixed buffer
2431         and consume less memory.
2432         (Fixed.Resolve): Add fixed buffer case.
2433
2434         * typemanager.cs (compiler_generated_attr_ctor,
2435         fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
2436         (HasElementType): Add our own implementation to work on every
2437         runtime.
2438
2439 2005-02-11  Miguel de Icaza  <miguel@novell.com>
2440
2441         * anonymous.cs (CaptureContext): Track whether `this' has been
2442         referenced.   
2443
2444         * expression.cs (This.ResolveBase): Call CaptureThis.  Before we
2445         only captured `this' if it was implicitly done (instance
2446         methods/variables were used). 
2447
2448         * codegen.cs (EmitContext.CaptureThis): New method to flag that
2449         `this' must be captured.
2450
2451 2005-01-30  Miguel de Icaza  <miguel@novell.com>
2452  
2453         * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
2454         is null it means that there has been no need to capture anything,
2455         so we just create a sibling.
2456
2457         Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
2458
2459         Just a partial fix.  The other half is fairly elusive.
2460         
2461 2005-02-10  Raja R Harinath  <rharinath@novell.com>
2462
2463         Fix #52586, cs0121-4.cs.
2464         * decl.cs (MemberCache.DeepCopy): Rename from SetupCache.  Take
2465         and return a hashtable.
2466         (MemberCache.ClearDeclaredOnly): New.
2467         (MemberCache.MemberCache): Update to change.  Make a deep copy of
2468         the method_hash of a base type too.
2469         (MemberCache.AddMethods): Adapt to having a deep copy of the base
2470         type methods.  Overwrite entries with the same MethodHandle so
2471         that the ReflectedType is correct.  The process leaves in base
2472         virtual functions and their overrides as distinct entries.
2473         (CacheEntry): Now a class instead of a struct.  It shouldn't alter
2474         matters since it was boxed in a ArrayList before.
2475         (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
2476         modifier.
2477         * expression.cs (Invocation.BetterFunction): Simplify.  Handle the
2478         case of a virtual function and its override (choose the overload
2479         as better).
2480         (Invocation.OverloadResolve): Avoid 'override' members during
2481         'applicable_type' calculation.
2482
2483 2005-03-28  Raja R Harinath  <rharinath@novell.com>
2484
2485         * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
2486         (TypeHandle.TypeHandle): Use LookupMemberCache rather than
2487         GetTypeHandle.  It is possible for a reflected type to derive from
2488         a TypeBuilder (e.g., int[] derives from the TypeBuilder
2489         System.Array during mscorlib compilation).
2490         * decl.cs (MemberCache.MemberCache): If the base cache doesn't
2491         contain a method_hash, don't create one either.  Don't create a
2492         deep copy of the base cache's method_hash.
2493         (MemberCache.SetupCache): Rename back from DeepCopy.
2494         (MemberCache.AddMethods): Rewrite, now that method_hash isn't
2495         already initialized.  If we see an override function, add its
2496         underlying base virtual function to the member_hash too.
2497
2498 2005-02-09  Raja R Harinath  <rharinath@novell.com>
2499
2500         Combine two near-redundant caches.
2501         * typemanager.cs (method_params): Rename from method_internal_params.
2502         (TypeManager.GetParameterData): New.  Replace
2503         Invocation.GetParameterData.
2504         (TypeManager.LookupParametersByBuilder): Remove.
2505         * expression.cs (Invocation.method_parameter_cache): Remove.
2506         (Invocation.GetParameterData): Remove.
2507         Update to changes.
2508         * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
2509         Update to changes.
2510
2511 2005-02-08  Raja R Harinath  <rharinath@novell.com>
2512
2513         Fix #72015.
2514         * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
2515         TypeManager.multicast_delegate_type is null, resolve it by looking
2516         up "System.MulticastDelegate".
2517         * rootcontext.cs (RootContext.ResolveCore): Simplify.
2518
2519 2005-02-07  Abin Thomas (NOSIP)  <projectmonokochi@rediffmail.com>
2520             Anoob V.E (NOSIP)  <projectmonokochi@rediffmail.com>
2521             Harilal P.R (NOSIP)  <projectmonokochi@rediffmail.com>
2522
2523         Fix cs0164.cs.
2524         * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
2525         (LabeledStatement.AddReference): New.  Set 'referenced'.
2526         (Goto.Resolve): Use it.
2527
2528 2005-02-05  John Luke  <john.luke@gmail.com>
2529
2530         * driver.cs: remove duplicate -doc line in Usage ()
2531
2532 2005-02-04  Raja R Harinath  <rharinath@novell.com>
2533
2534         * location.cs (Location.AddFile): Fix CS2002 error report.
2535
2536 2005-02-02  Martin Baulig  <martin@ximian.com>
2537
2538         * delegate.cs (Delegate.DefineType): Report an internal error if
2539         TypeManager.multicast_delegate_type is null.  See bug #72015 for
2540         details.        
2541
2542 2005-02-02  Raja R Harinath  <rharinath@novell.com>
2543
2544         Fix a crasher in a variant of #31984.
2545         * const.cs (Constant.CheckBase): New override that defers the
2546         new-or-override check in case the base type hasn't been populated
2547         yet.
2548         (Constant.Define): Ensure the new-or-override check is performed.
2549
2550 2005-02-01  Duncan Mak  <duncan@ximian.com>
2551
2552         * const.cs (LookupConstantValue): Check that `ce' is not null
2553         before calling GetValue ().
2554
2555 2005-02-01  Raja R Harinath  <rharinath@novell.com>
2556
2557         Fix test-334.cs (#69519).
2558         * cs-parser.jay (using_alias_directive): Pass in an expression to
2559         NamespaceEntry.UsingAlias.
2560         (using_namespace_directive): Pass in an expression to
2561         NamespaceEntry.Using.
2562         (namespace_name): Don't flatten to a string.
2563         * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
2564         (NamespaceEntry.AliasEntry.Resolve): Lookup using
2565         ResolveAsTypeStep.
2566         (NamespaceEntry.UsingEntry): Likewise.
2567         (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
2568         changes.
2569         (NamespaceEntry.LookupForUsing): Remove.
2570         (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
2571         names.
2572         (NamespaceEntry.Lookup): Remove support for dotted names.
2573
2574 2005-02-01  Raja R Harinath  <rharinath@novell.com>
2575
2576         * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
2577         split into two.
2578         (NamespaceEntry.ImplicitParent): Compute on demand.
2579         (NamespaceEntry.Doppelganger): New implicit namespace-entry that
2580         parallels the current.
2581         (NamespaceEntry.LookupForUsing): Use it.
2582         (NamespaceEntry.Lookup): If the current namespace-entry is
2583         implicit, don't search aliases and using tables.
2584
2585 2005-02-01  Raja R Harinath  <rharinath@novell.com>
2586
2587         Fix #31984.
2588         * class.cs (TypeContainer.DoDefineMembers): Don't initialize
2589         BaseCache here.
2590         (TypeContainer.BaseCache): Compute on demand.
2591         (TypeContainer.FindMembers): Define constants and types if they're
2592         not already created.
2593         (FieldMember.Define): Move resetting of ec.InUnsafe before error
2594         check.
2595         * const.cs (Constant.Define): Make idempotent.
2596
2597 2005-01-29  Miguel de Icaza  <miguel@novell.com>
2598
2599         * pending.cs: Produce better code (no nops produced by using Ldarg
2600         + value).
2601         
2602         * pending.cs (PendingImplementation.DefineProxy): It was not `arg
2603         i - 1' it should be arg + 1.
2604
2605         Fixes bug #71819.
2606
2607 2005-01-28  Raja R Harinath  <rharinath@novell.com>
2608
2609         * attribute.cs (Attribute.CheckAttributeType): Make private
2610         non-virtual.
2611         (Attribute.ResolveType): Make virtual.
2612         (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
2613         handling of RootContext.Tree.Types.
2614
2615 2005-01-27  Raja R Harinath  <rharinath@novell.com>
2616
2617         Update attribute-handling to use the SimpleName/MemberAccess
2618         mechanisms.
2619         * cs-parser.jay (attribute): Pass in an expression to the
2620         constructors of Attribute and GlobalAttribute.
2621         * attribute.cs (Attribute): Take an expression for the name.
2622         (Attribute.ResolvePossibleAttributeTypes): New.  Resolves the
2623         passed in attribute name expression.
2624         (Attribute.CheckAttributeType): Use it.
2625         * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
2626         * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
2627         (MemberAccess.ResolveNamespaceOrType): ... here.  Add 'silent'
2628         argument to prevent error messages if the lookup fails.
2629
2630 2005-01-27  Marek Safar  <marek.safar@seznam.cz>
2631
2632         * expression.cs (Indirection): Implemented IVariable interface
2633         to support indirection in AddressOf operator.
2634         (PointerArithmetic.Emit): Add optimalization for case where
2635         result can be precomputed.
2636
2637 2005-01-26  Martin Baulig  <martin@ximian.com>
2638
2639         * class.cs (TypeContainer.AttributeTargets): Return the correct
2640         AttributeTargets depending on our `Kind' instead of throwing an
2641         exception; fixes #71632.
2642
2643 2005-01-26  Marek Safar  <marek.safar@seznam.cz>
2644
2645         Fix #71257
2646         * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
2647         constant members.
2648
2649 2005-03-17  Martin Baulig  <martin@ximian.com>
2650
2651         * anonymous.cs (AnonymousMethod.method_modifiers): Change default
2652         from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'.  Fixes #73260.
2653
2654 2005-03-17  Martin Baulig  <martin@ximian.com>
2655
2656         * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
2657         to bool so we can return an error condition.
2658         (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
2659         returned an error.
2660
2661 2005-03-17  Martin Baulig  <martin@ximian.com>
2662
2663         * generic.cs (TypeMananager.IsIEnumerable): New public method.
2664
2665         * convert.cs (Convert.ImplicitReferenceConversion(Exists)): Allow
2666         converting from an array-type of T to `IEnumerable<T>'.
2667
2668 2005-03-16  Martin Baulig  <martin@ximian.com>
2669
2670         * generic.cs (Nullable.Unwrap): Implement IAssignMethod.
2671         (Nullable.LiftedUnaryMutator): New public class.
2672
2673         * expression.cs (UnaryMutator.DoResolve): Added support for
2674         Nullable Types.
2675
2676 2005-03-14  Martin Baulig  <martin@ximian.com>
2677
2678         * generic.cs (Nullable.NullCoalescingOperator): Implemented.
2679
2680 2005-03-14  Martin Baulig  <martin@ximian.com>
2681
2682         * generic.cs (Nullable.LiftedBinaryOperator): Added support for
2683         the comparision operators `<', `>', `<=' and `>='.
2684
2685 2005-03-13  Martin Baulig  <martin@ximian.com>
2686
2687         * generic.cs
2688         (Nullable.NullLiteral): Renamed to `Nullable.NullableLiteral' to
2689         avoid confusion with the `NullLiteral'.
2690         (Nullable.LiftedBinaryOperator): Correctly implement `==' and '!='.
2691
2692 2005-03-13  Martin Baulig  <martin@ximian.com>
2693
2694         * expression.cs (Binary.ResolveOperator): For `==' and `!=', allow
2695         comparing arbitrary types with the null literal.
2696
2697 2005-03-13  Martin Baulig  <martin@ximian.com>
2698
2699         * generic.cs (Nullable.LiftedBinaryOperator): Add support for the
2700         boolean operators '&&', '||', '&' and '|'.
2701         (Nullable.OperatorTrueOrFalse): New public class.
2702
2703         * ecore.cs (Expression.GetOperatorTrue/False): Return an `Expression'
2704         instead of a `StaticCallExpr'; added support for nullables.
2705
2706 2005-03-10  Martin Baulig  <martin@ximian.com>
2707
2708         * expression.cs
2709         (ArrayAccess.EmitDynamicInitializers): Use `etype.IsValueType'
2710         rather than `etype.IsSubclassOf (TypeManager.value_type)'.      
2711
2712 2005-03-07  Martin Baulig  <martin@ximian.com>
2713
2714         * generic.cs (Nullable.Unwrap): Implement IMemoryLocation and make
2715         it work if `expr' is not an IMemoryLocation.
2716         (Nullable.Lifted): Implement IMemoryLocation.
2717         (Nullable.LiftedConversion.ResolveUnderlying): Use the correct
2718         target type.
2719
2720 2005-03-05  Martin Baulig  <martin@ximian.com>
2721
2722         * generic.cs (Nullable.Unwrap, Wrap): New protected classes.
2723         (Nullable.Lifted): New abstract class; rewrote the lifted conversions.
2724         (Nullable): Added support for lifted unary and binary operators.
2725
2726         * expression.cs (Unary.DoResolve): Added support for nullable types.
2727         (Binary.DoResolve): Likewise.
2728         (Conditional.DoResolve): Likewise.
2729
2730 2005-03-02  Martin Baulig  <martin@ximian.com>
2731
2732         * decl.cs (DeclSpace.SetParameterInfo): Make this virtual.
2733
2734         * class.cs (ClassPart.SetParameterInfo): Override this.
2735         (PartialContainer.SetParameterInfo): Override this.
2736         (TypeContainer.CheckConstraints): New protected method.
2737         (PartialContainer.CheckConstraints): Override this and check
2738         whether the same contraints were specified in all parts of a
2739         partial generic type definition.
2740         (PartialContainer.UpdateConstraints): New public method.
2741
2742         * generic.cs (TypeParameter.UpdateConstraints): New public method.
2743
2744 2005-03-02  Martin Baulig  <martin@ximian.com>
2745
2746         Committing a patch from Carlos Alberto Cortez to fix #72887.
2747
2748         * convert.cs (Convert.ExplicitReferenceConversionExists): Allow
2749         casts from `T []' to `int []'.
2750
2751 2005-03-02  Martin Baulig  <martin@ximian.com>
2752
2753         * generic.cs (TypeManager.IsEqual): Make this symmetric.
2754
2755         * expression.cs (Binary.ResolveOperator): When resolving a
2756         BinaryDelegate, use `TypeManager.IsEqual (l, r)' rather than just
2757         `=='.  Fixes #71866.  See gen-127.cs.
2758
2759 2005-03-02  Martin Baulig  <martin@ximian.com>
2760
2761         * class.cs (TypeContainer.DoDefineMembers): We also need a default
2762         static constructor in static classes.
2763
2764 2005-03-02  Martin Baulig  <martin@ximian.com>
2765
2766         * generic.cs
2767         (NullableType.Name, NullableType.FullName): Add a "?" to the name.
2768         (Nullable.LiftedConversion): Added support for user-defined
2769         conversions.
2770
2771         * cs-tokenizer.cs (Tokenizer.PutbackCloseParens): New public method.
2772
2773         * cs-parser.jay: Use ComposedCast everywhere instead of
2774         NullableType, so we don't need to check for NullableType
2775         everywhere.
2776         (conditional_expression): Added `INTERR CLOSE_PARENS' rule for the
2777         case where we'll be resolved into a `parenthesized_expression_0'
2778         afterwards.
2779
2780         * convert.cs
2781         (Convert.UserDefinedConversion): Added nullable conversions.
2782
2783 2005-02-28  Martin Baulig  <martin@ximian.com>
2784
2785         * generic.cs (TypeManager.IsNullableType): New static method.
2786         (Nullable): New abstract class.
2787         (Nullable.NullLiteral): New public class.
2788         (Nullable.LiftedConversion): New public class.
2789
2790         * cs-parser.jay (non_expression_type): Changed `builtin_types' to
2791         `builtin_types opt_nullable'.
2792
2793         * convert.cs
2794         (Convert.ImplicitConversionStandard): Added nullable conversions.
2795         (Convert.ExplicitConversionStandard): Likewise.
2796         (Convert.ExplicitConversion): Likewise.
2797
2798 2005-02-26  Martin Baulig  <martin@ximian.com>
2799
2800         * expression.cs (ComposedCast.DoResolveAsTypeStep): Allow `dim' to
2801         begin with a "?", for instance "?[]".  Don't do a type lookup if
2802         `dim' is empty.
2803
2804 2005-02-25  Martin Baulig  <martin@ximian.com>
2805
2806         The first part of Nullable Types :-)
2807
2808         * generic.cs (NullableType): New public class.
2809         (NullCoalescingOperator): New public class.
2810         (TypeArguments.Resolve): Add a CS0306 check.
2811
2812         * cs-parser.jay (opt_error_modifier): Removed, this was unused.
2813         (opt_nullable): New rule.
2814         (type): Added `opt_nullable' to `namespace_or_type_name',
2815         `builtin_types' and `pointer_type'.
2816         (array_type): Added `opt_nullable'.
2817         (opt_rank_specifier_or_nullable): New rule; this is the
2818         combination of `opt_rank_specifier' and `opt_nullable'.
2819         (opt_error): New rule; catch errors here.
2820         (nullable_type_or_conditional): New rule; we use this to check for
2821         nullable and still detect the conditional operator.
2822         (local_variable_type): Use `opt_rank_specifier_or_nullable'
2823         instead `opt_rank_specifier'.
2824
2825         * expression.cs (ComposedCast.DoResolveAsTypeStep): Added support
2826         for nullables.
2827
2828 2005-02-24  Martin Baulig  <martin@ximian.com>
2829
2830         * README, README.Changes: Removed; they're old and obsolete.
2831
2832 2005-02-22  Martin Baulig  <martin@ximian.com>
2833
2834         * generic.cs (TypeParameter.Resolve): If resolving the constraints
2835         returned an error, set `constraints' to null to avoid a crash
2836         later on.
2837         (TypeParameter.ResolveType): Likewise.
2838
2839 2005-02-22  Martin Baulig  <martin@ximian.com>
2840
2841         * generic.cs
2842         (Constraints.ResolveTypes): Protect against being called twice.
2843         (Constraints.CheckInterfaceMethod): Don't call ResolveTypes().
2844         (TypeParameter.ResolveType): New public method; calls
2845         constraints.ResolveTypes().
2846         (TypeParameter.DefineType): Moved constraints.ResolveType() out
2847         into the new ResolveType().
2848         (GenericMethod.Define): Call ResolveType() on all our
2849         TypeParameter's.        
2850
2851 2005-02-21  Martin Baulig  <martin@ximian.com>
2852
2853         * generic.cs
2854         (TypeManager.generic_nullable_type): New static public field.
2855         (TypeManager.InitGenericCoreType): Lookup "System.Nullable`1".
2856
2857         * rootcontext.cs
2858         (RootContext.ResolveCore): Resolve "System.Nullable`1".
2859
2860 2005-02-15  Martin Baulig  <martin@ximian.com>
2861
2862         * generic.cs (ConstructedType.Constraints): Correctly check
2863         constraints if the argument type is a type parameter; fixes
2864         #72326. 
2865
2866 2005-02-02  Martin Baulig  <martin@ximian.com>
2867
2868         * delegate.cs (Delegate.DefineType): Report an internal error if
2869         TypeManager.multicast_delegate_type is null.  See bug #72015 for
2870         details.        
2871
2872 2005-01-29  Miguel de Icaza  <miguel@novell.com>
2873
2874         * pending.cs: Produce better code (no nops produced by using Ldarg
2875         + value).
2876         
2877         * pending.cs (PendingImplementation.DefineProxy): It was not `arg
2878         i - 1' it should be arg + 1.
2879
2880         Fixes bug #71819.
2881         
2882 2005-01-26  Martin Baulig  <martin@ximian.com>
2883
2884         * cs-parser.jay (indexer_declarator): Don't report an error if we
2885         have type parameters since we can be an explicit interface
2886         implementation; fixes #71449.
2887
2888 2005-01-26  Martin Baulig  <martin@ximian.com>
2889
2890         * class.cs (TypeContainer.AttributeTargets): Return the correct
2891         AttributeTargets depending on our `Kind' instead of throwing an
2892         exception; fixes #71632.
2893
2894 2005-01-26  Martin Baulig  <martin@ximian.com>
2895
2896         * delegate.cs (Delegate.DefineType): Correctly define our type
2897         parameters.  Fixes #71483.
2898
2899 2005-01-25  Raja R Harinath  <rharinath@novell.com>
2900
2901         Fix #71602.
2902         * expression.cs (MemberAccess.DoResolve): Don't complain with
2903         cs0572 when the LHS of a member access has identical name and type
2904         name.
2905
2906 2005-01-25  Marek Safar  <marek.safar@seznam.cz>
2907
2908         Fix #71651, #71675
2909         * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
2910         CreatePermission.
2911         Create custom PermissionSet only for PermissionSetAttribute.
2912
2913 2005-01-24  Marek Safar  <marek.safar@seznam.cz>
2914
2915         Fix #71649
2916         * class.cs (StaticClass.DefineContainerMembers): Enable enums and
2917         delegates in static class.
2918
2919 2005-01-24  Martin Baulig  <martin@ximian.com>
2920
2921         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
2922         merging an implicit block, just use its reachability.
2923
2924         * statement.cs (Block.Resolve): Make the unreachable code check
2925         work wrt. implicit blocks; see test-337 from #63842.
2926
2927 2005-01-21  Alp Toker  <alp@atoker.com>
2928  
2929         * cs-parser.jay: destructor_declaration's container is PartialContainer
2930         not Class when partial types are used, so use Kind prop instead of
2931         'is'.
2932         
2933 2005-01-22  Miguel de Icaza  <miguel@ximian.com>
2934
2935         * cs-parser.jay: Improve error reporting when an interface
2936         declares new types.
2937
2938 2005-01-20  Dick Porter  <dick@ximian.com>
2939
2940         * support.cs: SeekableStreamReader fix from Sandor Dobos
2941         (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
2942         chars are read.  Fixes bug 70369.
2943
2944 2005-01-20  Raja R Harinath  <rharinath@novell.com>
2945
2946         * cs-parser.jay (catch_clause): Simplify current_block handling
2947         somewhat.
2948
2949 2005-01-17  Miguel de Icaza  <miguel@ximian.com>
2950
2951         * convert.cs (ImplicitStandardConversionExists): Synchronize the
2952         code with ImplicitStandardConversion to handle the implicit
2953         conversion of method groups into valid delegate invocations. 
2954
2955         The problem is that in parameter handling we were using this code
2956         path.  Fixes bug #64698
2957
2958 2005-01-19  Raja R Harinath  <rharinath@novell.com>
2959
2960         * cs-parser.jay: Fix several infelicities.
2961         - Avoid assigning to the parser value stack.  Code like 
2962           '$3 = null' is unclean.  Synthesize a value for the code block
2963           instead. 
2964         - Avoid using oob_stack for storing location information.  Use ...
2965         (_mark_): ... this.  New (empty) rule.  Saves the current location
2966         in $$.
2967         (foreach_statement): Avoid using oob_stack for current_block
2968         handling.  Use technique used in for_statement and
2969         using_statement.  Synthesize a value for the code block to store
2970         additional intermediate information.
2971
2972 2005-01-13  Miguel de Icaza  <miguel@ximian.com>
2973
2974         * ecore.cs (IsAccessorAccessible): Accessibility to private fields
2975         of a different type is only allowed to private fields of a
2976         containing type, not on fields of a base class.
2977
2978         See test-174.cs and error cs0122-9.cs
2979
2980 2005-01-13  Raja R Harinath  <rharinath@novell.com>
2981
2982         Fix test-335.cs (bug #58126).
2983         * cs-parser.jay (argument): Split out non-expression parts of the
2984         rule into 'non_simple_argument'.
2985         (invocation_expression): Support parenthesized invocations with
2986         multiple arguments, and with single non-simple arguments.
2987
2988 2005-01-13  Raja R Harinath  <rharinath@novell.com>
2989
2990         * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
2991         places.
2992
2993 2005-01-12  Raja R Harinath  <rharinath@novell.com>
2994
2995         Fix cs0038-1.cs, cs1640-6.cs.
2996         * ecore.cs (Expression.Resolve): Remove special-case for
2997         SimpleName in error-handling.
2998         (Expression.almostMatchedMembers): Relax access permission to
2999         protected.
3000         (Expression.MemberLookupFailed): Handle duplicates in
3001         almostMatchedMembers list.
3002         (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
3003         * expression.cs (New.DoResolve): Report CS1540 for more cases.
3004         * typemanager.cs (GetFullNameSignature): Use the MethodBase
3005         overload if the passed in MemberInfo is a MethodBase.
3006
3007 2005-01-25  Martin Baulig  <martin@ximian.com>
3008
3009         * doc.cs
3010         (DocUtil.emptyParamList): Removed; use `Type.EmptyTypes' instead.
3011
3012 2005-01-12  Marek Safar  <marek.safar@seznam.cz>
3013
3014         Fix #70749
3015         * attribute.cs (ExtractSecurityPermissionSet): Don't report error
3016         for non-CAS & merge permission sets properly.
3017
3018 2005-01-11  Raja R Harinath  <rharinath@novell.com>
3019
3020         Improve standard-compliance of simple name and member access 
3021         resolution.  Fixes bugs #52697, #57200, #67520, #69519.
3022         * ecore.cs (FullNamedExpression): New abstract base class 
3023         for Namespaces and TypeExpressions.
3024         (ResolveFlags.SimpleName): Remove.
3025         (SimpleName): Remove support for dotted names.
3026         (SimpleName.ResolveAsTypeStep): Simplify.  Now just a wrapper to 
3027         DeclSpace.FindType and DeclSpace.LookupType.
3028         (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
3029         (Expression.ExprClassName): Make member function.
3030         * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
3031         a namespace.  Remove creation of dotted "SimpleName"s.
3032         (MemberAccess.DoResolve): Likewise.
3033         * decl.cs (DeclSpace.Cache): Make private.
3034         (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
3035         (DeclSpace.FindType): Update.
3036         (DeclSpace.LookupType): Move here from RootContext.  Return a 
3037         FullNamedExpression.
3038         * namespace.cs (Namespace): Derive from FullNamedExpression
3039         so that it can be part of expression resolution.
3040         (Namespace.Lookup): Return an FullNamedExpression.
3041         (NamespaceEntry.LookupAlias): Lookup aliases only in current
3042         namespace.
3043         * rootcontext.cs (NamespaceLookup): Remove.
3044         (LookupType): Move to DeclSpace.
3045         * attribute.cs (CheckAttributeType): Update.
3046         * doc.cs (FindDocumentedType): Remove allowAlias argument.
3047         (FindDocumentedTypeNonArray): Likewise.
3048
3049 2005-01-11  Raja R Harinath  <rharinath@novell.com>
3050
3051         Fix cs0509.cs, cs1632.cs.
3052         * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
3053         is the same as IsInterface.
3054         (TypeContainer.GetClassBases): Likewise.
3055         * statement.cs (LabeledStatement.ig): New field.
3056         (LabeledStatement.LabelTarget): Save ILGenerator which created the
3057         label.
3058         (LabeledStatement.DoEmit): Check that the label was created with
3059         the same ILGenerator.
3060
3061 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
3062
3063         Fix #71058
3064         * attribute.cs (GetMethodObsoleteAttribute): Need to transform
3065         accessors to its properties.
3066
3067         * ecore.cs (PropertyExpr): Add AccessorTable to help track back
3068         from accessors to property.
3069         
3070 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
3071
3072         Fix #70722
3073         * class.cs (MethodCore.CheckBase): Test base method obsoleteness
3074         only for overrides.
3075         
3076 2005-01-08  Miguel de Icaza  <miguel@ximian.com>
3077
3078         * attribute.cs: Check for null and empty strings.  
3079
3080         I have lost another battle to Paolo.
3081
3082 2005-01-07  Marek Safar  <marek.safar@seznam.cz>
3083
3084         Fix #70942
3085         * class.cs (PropertyMethod): Set Parent field in ctors.
3086         (SetMethod.InternalParameters): Add unsafe switch hack.
3087         Override MarkForDuplicationCheck where it is appropriate.
3088
3089         * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
3090         It says whether container allows members with the same name.
3091         Base default is no.
3092         (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
3093         Removed is_method parameter.
3094
3095 2005-01-06  Duncan Mak  <duncan@ximian.com>
3096
3097         * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
3098         because the previous change led to incorrect reporting of CS1032
3099         ("Cannot define/undefine preprocessor symbols after first token in
3100         file"). Instead of using `tokens_seen' as the only flag that
3101         triggers CS1040, introduce `comments_seen'. This new flag is used
3102         to signify having seen comments on the current line, so it is
3103         unset after a newline.
3104
3105 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
3106
3107         * doc.cs : When searching for a type, find nested type too.
3108           This fixes bug #71040.
3109
3110 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
3111
3112         * doc.cs :
3113           - Warn missing member comment on those classes which also does not
3114             have doc comments. Fixed bug #71041.
3115           - Don't warn missing doc comment on default constructor.
3116             Fixed bug #71042.
3117
3118 2005-01-06  Duncan Mak  <duncan@ximian.com>
3119
3120         * cs-tokenizer.cs (xtoken): After handling traditional C-style
3121         comments, set `tokens_seen' to true. This allows us to detect
3122         misplaced preprocessor directives (i.e. not at the beginning of
3123         the a line, nor after whitespaces). In that case, report error
3124         CS1040. This fixes bug #56460.
3125
3126         * cs-parser.jay (interface_member_declaration): Add checks for
3127         IsExplicitImpl, and report CS0541 error if an interface member is
3128         defined as an explicit interface declaration.
3129
3130 2005-01-06  Marek Safar  <marek.safar@seznam.cz>
3131
3132         Fix #70817
3133         * class.cs (PropertyMethod): Set Parent field in ctors.
3134         (SetMethod.InternalParameters): Add unsafe switch hack.
3135         
3136         * decl.cs (MemberCore.Parent): Cannot be readonly.
3137
3138 2005-01-06  Raja R Harinath  <rharinath@novell.com>
3139
3140         * decl.cs (DeclSpace.ResolveType): Remove.
3141         (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
3142         Merge in code from ...
3143         (DeclSpace.GetTypeResolvingEmitContext): ... here.  Remove.
3144         * class.cs, enum.cs: Update to changes.
3145
3146 2005-01-06  Miguel de Icaza  <miguel@ximian.com>
3147
3148         * anonymous.cs: Ensure that we init the scope of our parent if it
3149         has not been initialized yet.
3150
3151 2004-12-30  Duncan Mak  <duncan@ximian.com>
3152
3153         * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
3154         if field.FieldBuilder is null. Fixes #70758.
3155
3156         * convert.cs: Fixed some typos and updated some of the comments.
3157         (ImplicitStandardConversionExists):
3158         (TryImplicitIntConversion): If `target_type' is an interface and
3159         the type of `ic' implements this interface, return true or a new
3160         BoxedCast instead of null. This fixes #70468.
3161
3162 2004-12-29  Duncan Mak  <duncan@ximian.com>
3163
3164         * expression.cs (Argument.Emit): Check that Expr is
3165         IMemoryLocation before casting to it, and report CS1510 otherwise.
3166
3167         This fixes #70402.
3168
3169 2004-12-21  Ben Maurer  <bmaurer@ximian.com>
3170
3171         * statement.cs (Block.ThisVariable): remove the recursion here, to
3172         make the --profile more sane.
3173
3174 2004-12-17  Carlos Cortez <calberto.cortez@gmail.com>
3175
3176         * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
3177         assembly, by JB Evain.
3178
3179 2004-12-17  Raja R Harinath  <rharinath@novell.com>
3180
3181         * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs, 
3182           rootcontext.cs, typemanager.cs: Make nomenclature consistent.
3183         "parent" refers to enclosing type/class.  "base" refers to superclass.
3184
3185 2004-12-17  Raja R Harinath  <rharinath@novell.com>
3186
3187         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
3188         Ensure that we only have GlobalAttributes.
3189         * attribute.cs (Attribute.Emit): Make non-virtual.
3190         (GlobalAttribute.Emit): Remove.
3191         (Attribute.Resolve): Make virtual.
3192         (GlobalAttribute.Resolve): New.  Set Rootcontext.Tree.Types.NamespaceEntry.
3193         (Attribute.GetConditionalAttributeValue): Take an EmitContext as
3194         the argument. Don't create one.
3195         (Attribute.GetObsoleteAttribute): Likewise.
3196         (Attribute.GetClsCompliantAttributeValue): Likewise.
3197         * class.cs, decl.cs: Update to changes.
3198
3199 2004-12-17  Marek Safar  <marek.safar@seznam.cz>
3200
3201         * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
3202         
3203         * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
3204         
3205         * statement.cs (Foreach.Resolve): Add error 186 report.
3206
3207 2004-12-16  Marek Safar  <marek.safar@seznam.cz>
3208
3209         * expression.cs (Conditional.DoResolve): Add warning 429.
3210         
3211         * statement.cs (If.Resolve): Add warning 665.
3212
3213 2004-12-16  Raja R Harinath  <rharinath@novell.com>
3214
3215         New invariant: RootContext.Tree.Types.NamespaceEntry == null
3216         except when in the parser, and in GlobalAttribute.
3217         * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
3218         * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
3219         RootContext.Tree.Types.NamespaceEntry once work is done.
3220         (GlobalAttribute.Emit): New.  Wrapper for Attribute.Emit, but sets
3221         and resets RootContext.Tree.Types.NamespaceEntry.
3222
3223 2004-12-15  Marek Safar  <marek.safar@seznam.cz>
3224
3225         * cs-parser.jay: Don't create a block for every variable.
3226
3227 2004-12-14  Miguel de Icaza  <miguel@ximian.com>
3228
3229         * location.cs: Provide extra information.
3230
3231         * statement.cs: The instance is not `ldarg_0.THIS' when accessing
3232         variables from the captured environment, it is the ldarg_0.
3233
3234 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
3235
3236         * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
3237         find a conclusion.
3238         
3239         * class.cs: Changed warning level for 169 to avoid developer
3240         displeasure from warning flooding. It will be changed back when they
3241         fix most of current BCL warnings.
3242         
3243         * RootContext.cs: Pushed default WarningLevel to 3.
3244         
3245         * statement.cs: Removed unused variable.
3246
3247 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
3248
3249         * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
3250         (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
3251         Add error 502 report.
3252         (StaticClass.DefineType): Add error 441 report.
3253         (Class.AllowedModifiersProp): New virtual property as temporary
3254         extension to AllowedModifiers.
3255         (Class.DefineType): Add error 418 report. Moved ModFlags check here
3256         to share implementation with StaticClass and don't call virtual
3257         methods from ctor.
3258         
3259         * driver.cs (MainDriver): Add error 1558 test.
3260
3261         * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
3262         report. Moved error 36 test here.
3263
3264         * statement.cs (Throw.Resolve): Add error 724 report.
3265
3266         * typemanager.cs: Add out_attribute_type core type.
3267         
3268 2004-12-13  Marek Safar  <marek.safar@seznam.cz>
3269
3270         * class.cs (TypeContainer.VerifyClsCompliance): Add error
3271         3018 report.
3272         (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
3273
3274         * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
3275         3017 report.
3276         
3277         * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
3278
3279         * parameter.cs (ReturnParameter.ApplyAttributeBuilder): 
3280         Add error 3023 report.
3281         (Parameter.ApplyAttributeBuilder): Add error 3022 report.
3282
3283         * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
3284         implementation.
3285
3286 2004-12-12  John Luke  <john.luke@gmail.com>
3287
3288         * driver.cs (AddArgs): take -- into account when
3289         adding arguments, fixes bug 65710 
3290
3291 2004-12-12  Martin Baulig  <martin@ximian.com>
3292
3293         * expression.cs (Unary.TryReduceNegative): Added support for
3294         SByteConstant and ByteConstant.
3295         (Unary.Reduce): Check error values from TryReduceNegative().
3296
3297 2004-12-10  Marek Safar  <marek.safar@seznam.cz>
3298
3299         * attributes.cs (Attribute.Resolve): Avoid multiple error report
3300         and report exception as error 182.
3301
3302 2004-12-10  Raja R Harinath  <rharinath@novell.com>
3303
3304         * driver.cs (Main): Fix message when there are warnings.
3305
3306 2004-12-09  Miguel de Icaza  <miguel@ximian.com>
3307
3308         * delegate.cs: Fixed my fix from yesterday, sorry about that.
3309
3310 2004-12-09  Marek Safar  <marek.safar@seznam.cz>
3311
3312         * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs: 
3313         Reduced number of warnings.
3314         
3315         * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
3316
3317 2004-12-08  Miguel de Icaza  <miguel@ximian.com>
3318
3319         * driver.cs: Removed message.
3320
3321         * delegate.cs: Fix bug introduced in 1.1.x: 70219.
3322
3323 2004-12-08    <vargaz@freemail.hu>
3324
3325         * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
3326
3327 2004-12-08  Martin Baulig  <martin@ximian.com>
3328
3329         * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
3330         instead of a CS3002 for properties and indexer.
3331
3332 2004-12-08  Martin Baulig  <martin@ximian.com>
3333
3334         * decl.cs (MemberName.ToString): Make this work again.
3335
3336 2004-12-08  Marek Safar  <marek.safar@seznam.cz>
3337
3338         * attribute.cs (Resolve): Add error 591 detection.
3339
3340         * class.cs (FieldMember.Define): Add error 1547 detection.
3341         (Indexer.Define): Add error 620 detection.
3342         (Operator.Define): Add error 590 detection.
3343
3344         * ecore.cs: Missing argument for error 79.
3345
3346         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
3347         detection.
3348
3349 2004-12-07  Marek Safar  <marek.safar@seznam.cz>
3350
3351         Fix #70106
3352         * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
3353         only.
3354
3355 2004-12-07  Atsushi Enomoto  <atsushi@ximian.com>
3356
3357         * cs-parser.jay : handle doc comments on implicit/explicit operators.
3358           Some operator comments were suppressed.
3359         * doc.cs : Implicit/explicit operator name in doc comments are like
3360           "op_Explicit(type)~returnType", so added suffix handling.
3361
3362 2005-01-21  Alp Toker  <alp@atoker.com>
3363
3364         * cs-parser.jay: destructor_declaration's container is PartialContainer
3365         not Class when partial types are used, so use Kind prop instead of 'is'.
3366
3367 2004-12-12  Martin Baulig  <martin@ximian.com>
3368
3369         * expression.cs (Unary.TryReduceNegative): Added support for
3370         SByteConstant and ByteConstant.
3371         (Unary.Reduce): Check error values from TryReduceNegative().
3372
3373 2004-12-11  Martin Baulig  <martin@ximian.com>
3374
3375         * support.cs (ReflectionParameters.ParameterName): If we have a
3376         `gpd', call `ParameterName' on it.
3377
3378         * parameter.cs (Parameter.GetParameterAttributes): New static method.
3379
3380         * pending.cs (PendingImplementation.DefineProxy): Call
3381         DefineParameter() for all of the MethodBuilder's arguments.
3382
3383 2004-12-09  Martin Baulig  <martin@ximian.com>
3384
3385         * doc.cs (DocUtil): Make this a static class.
3386
3387 2004-12-09  Martin Baulig  <martin@ximian.com>
3388
3389         * expression.cs (Invocation.InferType): Moved the type inference
3390         implementation into TypeManager.
3391
3392         * generics.cs (TypeManager): Moved the type inference
3393         implementation here.
3394
3395 2004-12-09  Martin Baulig  <martin@ximian.com>
3396
3397         * typemanager.cs (TypeManager): Make this a partial class.
3398
3399         * generics.cs
3400         (TypeManager): Move the generics part of `TypeManager' here.
3401
3402 2004-12-08  Martin Baulig  <martin@ximian.com>
3403
3404         * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
3405         instead of a CS3002 for properties and indexer.  Added CS3024
3406         check for generic interfaces.
3407
3408         * attributes.cs (AttributeTester.AnalyzeTypeCompliance): Generic
3409         instances are not CLS-compliant.
3410
3411 2004-12-08  Martin Baulig  <martin@ximian.com>
3412
3413         * cs-parser.jay
3414         (void_pointer_expression): New rule for `void*', `void**' etc.
3415         (typeof_expression): Add `void_pointer_expression'; fixes #66846.       
3416
3417 2004-12-08  Martin Baulig  <martin@ximian.com>
3418
3419         * expression.cs (Invocation.InferType): Removed the hack for
3420         MethodCore.MayUnify().  
3421
3422         * typemanager.cs (TypeManager.MayBecomeEqualGenericTypes): Make
3423         this actually work.
3424
3425         * class.cs (MethodCore.MayUnify): Use
3426         TypeManager.MayBecomeEqualGenericTypes().       
3427
3428 2004-12-08  Martin Baulig  <martin@ximian.com>
3429
3430         * expression.cs (Is.DoResolve, As.DoResolve): If we're a type
3431         parameter, box it.  Fixes #69233.
3432
3433 2004-12-08  Martin Baulig  <martin@ximian.com>
3434
3435         * generic.cs (ConstructedType.CheckConstraints): Valuetypes always
3436         have the ctor constraint.  Fixes #68326.
3437
3438 2004-12-07  Atsushi Enomoto  <atsushi@ximian.com>
3439
3440         * cs-parser.jay : interface comment was not consumed because of
3441           extra opt_semicolon before doc handling.
3442
3443 2004-12-03  Raja R Harinath  <rharinath@novell.com>
3444
3445         Fix test-327.cs, test-328.cs, and put in early infrastructure
3446         for eventually fixing #52697.
3447         * namespace.cs (NamespaceEntry.LookupForUsing): New method.
3448         (NamespaceEntry.LookupNamespaceOrType): New method, refactored
3449         from other methods.
3450         (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
3451         (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
3452         (VerifyUsing, error246): Update.
3453         * rootcontext.cs (RootContext.NamespaceLookup): Just use
3454         'NamespaceEntry.LookupNamespaceOrType'.
3455
3456 2004-12-07  Martin Baulig  <martin@ximian.com>
3457
3458         * driver.cs: Call it "BETA SOFTWARE" :-)
3459
3460 2004-12-06  Raja R Harinath  <rharinath@novell.com>
3461
3462         Fix crash on cs0657-17.cs.
3463         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
3464         Use RootContext.Tree.Types, not 'new RootTypes ()'.
3465         * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
3466         the case where the NamespaceEntry gets overwritten.
3467
3468 2004-12-06  Marek Safar  <marek.safar@seznam.cz>
3469
3470         Fixed #69195, #56821
3471         * ecore.cs (ResolveBoolean): Tiny refactoring.
3472
3473         * expression.cs (Binary.DoResolve): Add warning 429 and skipping
3474         of right expression resolving when left is false constant and
3475         operator is LogicalAnd OR true constant and operator is LogicalOr.
3476
3477         * statement.cs (ResolveUnreachable): Always reports warning.
3478
3479 2004-12-05  Miguel de Icaza  <miguel@ximian.com>
3480
3481         * class.cs: Distinguish between 1721 and 1722 (just a little help
3482         for the programmer).
3483
3484 2004-12-03  Miguel de Icaza  <miguel@ximian.com>
3485
3486         * delegate.cs: Only allow this on new versions of the language. 
3487
3488 2004-12-02  Duncan Mak  <duncan@ximian.com>
3489
3490         * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
3491         Expression class.
3492         (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
3493         here as a static method. Take an additional bool out parameter
3494         `must_do_cs1540_check' for signaling to InstanceResolve.
3495         (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
3496         member field from PropertyExpr class and made it an argument of
3497         the method instead.
3498         (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
3499         check for MarshalByRefObject, and report CS0122 instead of CS1540.
3500         (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
3501         and `remove_accessor' as well as InstanceResolve: report CS0122
3502         where applicable.
3503
3504         Fixes #70129.
3505
3506 2004-12-07  Martin Baulig  <martin@ximian.com>
3507
3508         * decl.cs (DeclSpace.AddToContainer): Report correct errors CS0694
3509         and CS0692 where appropriate.
3510
3511 2004-12-06  Martin Baulig  <martin@ximian.com>
3512
3513         * class.cs (MethodCore.MayUnify): Moved the CS0408 check here from
3514         IsDuplicateImplementation() and improved it.
3515
3516         * expression.cs (Invocation.InferTypeArguments): Added
3517         `Type[] inferred_class_types' argument (for MethodCore.MayUnify)
3518         and removed the "ref" modifier from `infered_types'.
3519
3520         * decl.cs (MemberName.ToString): Removed the exception.
3521
3522 2004-12-03  Atsushi Enomoto  <atsushi@ximian.com>
3523
3524         * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
3525           comments are allowed.
3526
3527 2004-12-03  Carlos Alberto Cortez <calberto.cortez@gmail.com>
3528
3529         * delegate.cs: Add checks for subtypes in paramaters and return values
3530         in VerifyMethod () to add support for Covariance/Contravariance
3531         in delegates.
3532         
3533 2004-12-02  Miguel de Icaza  <miguel@ximian.com>
3534
3535         * report.cs: Remove extra closing parenthesis.
3536
3537         * convert.cs (Error_CannotImplicitConversion): If the name of the
3538         types are the same, provide some extra information.
3539
3540 2004-12-02  Marek Safar  <marek.safar@seznam.cz>
3541
3542         Fix bug #70102
3543         * attribute.cs (Resolve): Improved implementation of params
3544         attribute arguments.
3545
3546         * support.cs (ParameterData): Add HasParams to be faster.
3547
3548 2004-12-02  Atsushi Enomoto  <atsushi@ximian.com>
3549
3550         all things are for /doc support:
3551
3552         * doc.cs: new file that supports XML documentation generation.
3553         * mcs.exe.sources: added doc.cs.
3554         * driver.cs:
3555           Handle /doc command line option.
3556           Report error 2006 instead of 5 for missing file name for /doc.
3557           Generate XML documentation when required, after type resolution.
3558         * cs-tokenizer.cs:
3559           Added support for picking up documentation (/// and /** ... */),
3560           including a new XmlCommentState enumeration.
3561         * cs-parser.jay:
3562           Added lines to fill Documentation element for field, constant,
3563           property, indexer, method, constructor, destructor, operator, event
3564           and class, struct, interface, delegate, enum.
3565           Added lines to warn incorrect comment.
3566         * rootcontext.cs :
3567           Added Documentation field (passed only when /doc was specified).
3568         * decl.cs:
3569           Added DocComment, DocCommentHeader, GenerateDocComment() and
3570           OnGenerateDocComment() and some supporting private members for
3571           /doc feature to MemberCore.
3572         * class.cs:
3573           Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
3574         * delegate.cs:
3575           Added overriden DocCommentHeader.
3576         * enum.cs:
3577           Added overriden DocCommentHeader and GenerateDocComment().
3578
3579 2004-12-01  Miguel de Icaza  <miguel@ximian.com>
3580
3581         * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
3582         unwrapping the enumeration values, chain to
3583         DoConstantNumericPromotions again, so we can promote things to the
3584         fundamental types (takes care of enums that are bytes, sbytes).
3585
3586         Fixes bug #62054.
3587
3588 2004-12-01  Raja R Harinath  <rharinath@novell.com>
3589
3590         * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
3591         Fix long-standing bug in type-lookup.  Use FindType instead of
3592         LookupType when ec.ResolvingTypeTree.
3593         (Attribute.ResolveType, Attribute.Resolve)
3594         (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
3595         Update to changes.
3596         (Attributes.Search): Remove internal version.  Update.
3597         (Attributes.SearchMulti): Update.
3598         (Attributes.GetClsCompliantAttribute): Remove.
3599         (Attributes.GetIndexerNameAttribute): Remove.
3600         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
3601         (DeclSpace.GetClsCompliantAttributeValue): Likewise.
3602         * class.cs (Indexer.Define): Likewise.
3603
3604 2004-12-01  Marek Safar  <marek.safar@seznam.cz>
3605
3606         Fix bug #68790
3607         * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
3608         MarshallByReference members access.
3609
3610         * expression.cs: Use CheckMarshallByRefAccess;
3611         Better error CS0197 message.
3612
3613         * report.cs: Print whole related error message.
3614
3615 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
3616
3617         * class (GetClassBases): Better error 60 report.
3618         (EventProperty): Disabled warning 67 detection.
3619
3620 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
3621
3622         Fix bug #60324
3623         * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
3624
3625         * constant.cs (DecimalConstant.Emit): Don't use int ctor for
3626         precise values.
3627
3628 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
3629
3630         Fix bug #49488
3631         * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
3632
3633         * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
3634
3635 2004-11-26  Miguel de Icaza  <miguel@ximian.com>
3636
3637         * attribute.cs (Attribute.Resolve): Refine error reporting and
3638         report a cs0117 if the identifier does not exist, to distinguish
3639         from 0617 which is a miss-use of the actual identifier.
3640
3641         * ecore.cs (EventExpr.Emit): Refine error report and distinguish
3642         between cs0070 and cs0079.
3643
3644         * class.cs (MemberBase.DoDefine): When reporting a wrong
3645         accessibility level, we use MethodCore to compare instead of
3646         Method (this was a regression in some refactoring effort).
3647
3648         So now we correctly report cs0056 again.
3649
3650         * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
3651         testing the target_type (which was known to be object_type) and
3652         not the source type (which is anonymous_method).
3653
3654         Fixed reporting of error cs1660.
3655
3656         * expression.cs (UserCast.Source): Expose the underlying cast.
3657
3658         * statement.cs (Switch.SwitchGoverningType): Sort the list of
3659         allowed types to find a match to int32 first (most common).
3660
3661         In addition, it ignores any ImplicitUserConversions that did an
3662         internal implicit conversion (as the switch statement allows only
3663         one integral conversion to exist).
3664
3665         * class.cs (PartialContainer.Create): rename `name' to
3666         `member_name' for clarity.  Then replace the string calls with a
3667         call to MemberName.GetPartialName, as now using
3668         MemberName.ToString is an error (this is due to the side effects
3669         it had, that were fixed in the past).
3670
3671         This will restore the error reporting on a number of partial class
3672         errors that were missusing this (and getting an exception as a
3673         results, which is now just a plain textual warning, because
3674         yyparse debug output would crash otherwise).
3675
3676 2004-11-26  Raja R Harinath  <rharinath@novell.com>
3677
3678         * Makefile (PROGRAM_INSTALL_DIR): Remove.
3679
3680 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
3681
3682         * rootcontext.cs (LookupType): Make sure to cache lookups that
3683         don't give us a negative result. This saves about 5% of corlib
3684         compilation time.
3685
3686 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
3687
3688         * report.cs (AbstractMessage.Print): messages are sent to stderr
3689
3690         * class.cs (TypeContainer.GetClassBases): It is an error to have a
3691         non-interface in the list of interfaces (at this point, either
3692         parent was properly set, or a base class is being listed in the
3693         interfaces section).
3694
3695         This flags error 1722, and resolves the crash from bug 69259.
3696
3697 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
3698
3699         * statement.cs (Using.EmitExpressionFinally): make this work right
3700         for valuetypes. Fixes 69926.
3701
3702 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
3703
3704         * const.cs (Const.ChangeType): Cope with the "0 literal can be
3705         converted to an enum" here, before we try to change the underlying
3706         type.  This code exists, but it is a different code path than the
3707         one used while encoding constants.
3708
3709         (ImplicitReferenceConversionExists): In addition, resynchronized
3710         the code here, so it matches the same code in
3711         ImplicitReferenceConversionExists for the `from any class-type S
3712         to any interface-type T'.       
3713
3714 2004-11-25  Marek Safar  <marek.safar@seznam.cz>
3715
3716         * cfold.cs (BinaryFold): Add addition for DecimalConstant.
3717
3718 2004-11-24  Miguel de Icaza  <miguel@ximian.com>
3719
3720         * cs-parser.jay: Use verbosity accordingly. 
3721
3722 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
3723
3724         * expression.cs (Unary.ResolveOperator): Do not report warning;
3725         AddressOf reads from variable.
3726         
3727         (LocalVariableReferences.DoResolveBase): Improved my previous fix.
3728
3729 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
3730
3731         Fix bug #69462
3732
3733         * attribute.cs (Attributable): Removed CheckTargets.
3734         (Attributes.Emit): Explicit attribute targets are tested here.
3735
3736         * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
3737         not enabled for interfaces.
3738
3739         * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
3740         (GetAssemblyName): Ouch next bug there.
3741
3742 2004-11-23  Carlos Alberto Cortez <calberto.cortez@gmail.com>
3743
3744         * expression.cs: Error 275 added.
3745         
3746 2004-11-23  Marek Safar  <marek.safar@seznam.cz>
3747
3748         Fix bug #69177 (Implemented decimal constant support)
3749
3750         * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
3751         (BinaryFold): Add DecimalConstant.
3752
3753         * const.cs (Define): Decimal constant 
3754         (is not constant.
3755         (ChangeType): Add decimal type handling.
3756         (LookupConstantValue): Don't set value for decimal type but
3757         emit DecimalConstantAttribute. Needed for constant optimization.
3758
3759         * constant.cs (ToDecimal): New method.
3760         (ConvertToDecimal): New method.
3761         (IntConstant): Implemented ConvertToDecimal.
3762         (DecimalConstant.Emit): Emit optimized version for decimals in
3763         int range.
3764
3765         * expression.cs (ResolveOperator): Changed order of constant
3766         reduction to work correctly with native types which have
3767         overloaded operators.
3768         (ResolveMemberAccess): Extract constant value from attribute
3769         for decimal type.
3770
3771         * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
3772
3773         * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
3774         void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
3775         (ChangeType): Decimal is special.
3776         (TypeToCoreType): Add decimal type.
3777
3778 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
3779
3780         * convert.cs (ImplicitConversionRequired): Add error cs0642 for
3781         decimal types.
3782
3783 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
3784
3785         * class.cs (EventField.ApplyAttributeBuilder): Fix error
3786         test cs1667-5.cs.
3787
3788 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
3789
3790         * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
3791
3792         * pending.cs (PendingImplementation): Grab only interfaces.
3793
3794 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
3795
3796         * statement.cs (ForeachHelperMethods): Add location member and
3797         error 202 detection.
3798
3799 2004-11-18  Marek Safar  <marek.safar@seznam.cz>
3800
3801         * expression.cs (DoResolveBase): Fixed wrong warning for out
3802         variables.
3803
3804 2004-12-04  Martin Baulig  <martin@ximian.com>
3805
3806         * convert.cs (Convert.TypeParameter_to_Null): Use the constraints
3807         to check whether the conversion is ok.
3808
3809         * typemanager.cs (TypeManager.GetTypeArguments): Just return
3810         `Type.EmptyTypes' if we're not a generic TypeContainer.
3811
3812 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
3813
3814         * convert.cs (ImplicitReferenceConversionExists): A surprisingly
3815         old bug: when converting from the null literal to a pointer,
3816         return an EmptyCast, not the NullLiteral.
3817
3818         This fixes #69921, the recent null_type changes probably made this
3819         bug more prominent.
3820
3821 2004-12-03  Martin Baulig  <martin@ximian.com>
3822
3823         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
3824         method as our child, call AnonymousMethod.Compatible() on it.
3825
3826 2004-12-02  Miguel de Icaza  <miguel@ximian.com>
3827
3828         * class.cs (FieldBase): Use an unused bit field from the field to
3829         encode the `has_offset' property from the FieldMember.  This saves
3830         a couple of Ks on bootstrap compilation.
3831
3832         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
3833         method as our child, return the AnonymousMethod resolved
3834         expression.
3835
3836         * expression.cs (New.DoResolve): Allow return values from
3837         NewDelegate to also include AnonymousMethods.
3838
3839         Fixes #70150.
3840
3841 2004-11-29  Raja R Harinath  <rharinath@novell.com>
3842
3843         * decl.cs (MemberCore.MemberName): Remove readonly to fix an error
3844         cs1648 report.
3845         * rootcontext.cs (ResolveCore::interfaces_first_stage): Add
3846         System.Runtime.InteropServices._Exception, since it's a base
3847         interface of the core type System.Exception in the net_2_0 profile.
3848
3849 2004-11-27  Martin Baulig  <martin@ximian.com>
3850
3851         * ecore.cs (Expression.StoreFromPtr): Use `stobj' for generic parameters.
3852
3853 2004-11-26  Raja R Harinath  <rharinath@novell.com>
3854
3855         * Makefile: Convert to use executable.make.
3856         * gmcs.exe.sources: New.
3857
3858 2004-11-25  Martin Baulig  <martin@ximian.com>
3859
3860         * expression.cs (Invocation.InferType): Added support for byref types.
3861
3862 2004-11-25  Martin Baulig  <martin@ximian.com>
3863
3864         * statement.cs (Foreach.FetchMethodMoveNext): Wrap `mi.ReturnType'
3865         in TypeManager.TypeToCoreType().
3866
3867 2004-11-25  Martin Baulig  <martin@ximian.com>
3868
3869         * iterators.cs (Iterator.DoDefineMembers): Override and lookup the
3870         "Dispose" method from the `current_type'.
3871         (Iterator.EmitMoveNext): Use the `dispose_method' we looked up in
3872         DoDefineMembers() instead of using the MethodBuilder; this is
3873         required for generic iterators.
3874
3875         * class.cs (TypeContainer.DoDefineMembers): Make this virtual.
3876
3877 2004-11-24  Martin Baulig  <martin@ximian.com>
3878
3879         * ecore.cs (Expression.LoadFromPtr): Use `ldobj' for generic parameters.
3880
3881 2004-11-20  Martin Baulig  <martin@ximian.com>
3882
3883         * expression.cs (Invocation.InferType): Correctly infer generic
3884         instances; see gen-103.cs.
3885         (Invocation.InferTypeArguments): If a generic method doesn't have
3886         any unbound type parameters, we don't need to infer anything.
3887
3888 2004-11-19  Raja R Harinath  <rharinath@novell.com>
3889
3890         * Makefile (gmcs.exe): Update to new location of bootstrap mcs.exe.
3891
3892 2004-11-17  Raja R Harinath  <rharinath@novell.com>
3893
3894         * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
3895         (TypeHandle.GetMemberCache): New.
3896         (TypeHandle.TypeHandle): Update.
3897         (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
3898         (TypeManager.LookupParentInterfacesCache):
3899         Rename from LookupInterfaceCache.  Optimize slightly.
3900         (TypeManager.MemberLookup_FindMembers): Update.
3901         * decl.cs (MemberCache.MemberCache): Set Container to null in the
3902         multi-type variant.
3903         (AddCacheContents): Rename from AddHashtable.
3904         * class.cs (TypeContainer.parent_container): Remove.
3905         (TypeContainer.VerifyClsCompliance): Don't use parent_container.
3906         (TypeContainer.DoDefineMembers): Don't initialize it.
3907         Update to name changes.
3908         
3909 2004-11-17  Miguel de Icaza  <miguel@ximian.com>
3910
3911         * class.cs (MethodCore.CheckAccessModifiers): New helper routine
3912         that factors the code to check access modifiers on override.  
3913
3914         (PropertyBase): Use the code here.
3915
3916         Patch from Lluis S'anchez, fixes bug #69361.
3917
3918 2004-11-15  Miguel de Icaza  <miguel@ximian.com>
3919
3920         * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
3921         routine that is used to report the use of a captured variable
3922         whose address has been taken.
3923
3924         There are two checks: one when variables are being captured and
3925         the other check is when the address of a variable is taken. 
3926         
3927         (because an anonymous methods might be resolved before *or* after
3928         the address has been taken) and 
3929
3930         * expression.cs (Conditional.DoResolve): Remove the special
3931         casing that Martin added to trueExpr and falseExpr being both
3932         NullLiteral.  We get the right behavior now just by introducing
3933         the null_type into the compiler. 
3934
3935         * convert.cs (ExplicitConversion): Change the code to use
3936         null_type instead of testing `expr is NullLiteral'.
3937         (ImplicitConversionStandard): use null_type too.
3938         (ImplicitReferenceConversionExists): use null_type too.
3939         (ImplicitReferenceConversion): use null_type too.
3940
3941         * literal.cs: The type of `NullLiteral' is now null_type instead
3942         of object_type. 
3943         (Resolve): Set the type here.
3944
3945         * typemanager.cs: Introduce null_type.
3946
3947 2004-11-18  Martin Baulig  <martin@ximian.com>
3948
3949         * rootcontext.cs
3950         (RootContext.LookupType): Return a `Type', not a `TypeExpr'.
3951
3952 2004-11-18  Martin Baulig  <martin@ximian.com>
3953
3954         * ecore.cs (TypeExpr.DoResolveAsTypeStep): Make this protected.
3955
3956 2004-11-18  Martin Baulig  <martin@ximian.com>
3957
3958         * generic.cs (Constraints.Resolve): Take an `EmitContext' instead
3959         of a `DeclSpace'.  If one of our constraints is a `ConstructedType',
3960         call ResolveConstructedType() on it to resolve it without checking
3961         constraints.
3962         (Constraints.ResolveTypes): Check them here.
3963         (ConstructedType.DoResolveAsTypeStep): Fully resolve ourselves,
3964         but don't check constraints.
3965         (ConstructedType.ResolveAsTypeTerminal): Override this and also
3966         check constraints here.
3967         (ConstructedType.ResolveConstructedType): New public method.  This
3968         is called from DoResolveAsTypeStep() and Constraints.Resolve() to
3969         resolve ourselves without checking constraints.
3970
3971         * ecore.cs (Expression.ResolveAsTypeTerminal): Make this virtual.
3972
3973 2004-11-18  Martin Baulig  <martin@ximian.com>
3974
3975         * decl.cs
3976         (DeclSpace.CurrentType): Changed type from `TypeExpr' to `Type'.
3977
3978         * delegate.cs (Delegate.DefineType): Always create the EmitContext.
3979
3980 2004-11-18  Martin Baulig  <martin@ximian.com>
3981
3982         * ecore.cs (TypeExpr.ResolveType): Removed.
3983         (Expression.ResolveAsTypeTerminal): We always return a fully
3984         resolved `TypeExpr', so we can just access its `Type'.
3985
3986         * class.cs (TypeContainer.DefineType): Resolve `CurrentType' here.
3987
3988 2004-11-17  Martin Baulig  <martin@ximian.com>
3989
3990         * ecore.cs (IAlias.Type): Replaced with ResolveAsType() to make
3991         sure we don't return any unresolved TypeExpr's.
3992         (TypeAliasExpression): The .ctor now takes an `IAlias' instead of
3993         a `TypeExpr'.
3994         (Expression.ResolveAsTypeTerminal): Make sure `te.Type != null'.
3995
3996         * expression.cs (MemberAccess.ResolveAsTypeStep): Don't return any
3997         unresolved `ConstructedType's.
3998
3999 2004-11-17  Martin Baulig  <martin@ximian.com>
4000
4001         * ecore.cs (TypeExpr.ResolveType): Don't make this virtual.
4002
4003 2004-11-17  Martin Baulig  <martin@ximian.com>
4004
4005         * ecore.cs
4006         (Expression.ResolveAsTypeTerminal): Removed the `bool silent' argument.
4007
4008         * decl.cs (DeclSpace.ResolveType): Removed.
4009         (DeclSpace.ResolveTypeExpr): Removed the `bool silent' argument.
4010
4011 2004-11-17  Martin Baulig  <martin@ximian.com>
4012
4013         * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
4014         direction, like FindMembers() does.  Fixes #69546, testcase is in
4015         test-315.cs.    
4016
4017 2004-11-16  Martin Baulig  <martin@ximian.com>
4018
4019         This is based on a patch from Marek Safar, see bug #69082.
4020         Fixes bugs #63705 and #67130.
4021
4022         * typemanager.cs (TypeManager.LookupInterfaceCache): New public
4023         method; create a MemberCache for an interface type and cache the
4024         result.
4025
4026         * decl.cs (IMemberContainer.ParentContainer): Removed.
4027         (IMemberContainer.ParentCache): New property.
4028         (MemberCache.SetupCacheForInterface): Removed.
4029         (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
4030         to create a cache for an interface's "parent".
4031
4032         * class.cs (TypeContainer.DoDefineMembers): Setup cache for
4033         interfaces too.
4034
4035 2004-11-14  Ben Maurer  <bmaurer@ximian.com>
4036
4037         * statement.cs: Avoid adding bools to a hashtable.
4038
4039 2004-11-15  Martin Baulig  <martin@ximian.com>
4040
4041         * decl.cs (MemberName.GetPartialName): Removed, use GetTypeName() instead.
4042
4043 2004-11-11  Martin Baulig  <martin@ximian.com>
4044
4045         * typemanager.cs (TypeManager.GetMethodName): New method.
4046
4047         * class.cs (MethodData.Define): Include the generic arity in the
4048         name of an explicit interface; also add it to the method name.
4049
4050         * pending.cs (PendingImplementation.InterfaceMethod): The method
4051         name now includes the generic arity.
4052
4053 2004-11-07  Miguel de Icaza  <miguel@ximian.com>
4054
4055         * expression.cs (Invocation.OverloadResolve): Flag error if we are
4056         calling an unsafe method from a safe location.
4057
4058 2004-11-06  Marek Safar  <marek.safar@seznam.cz>
4059
4060         Fix #69167
4061         * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
4062
4063 2004-11-06  Miguel de Icaza  <miguel@ximian.com>
4064
4065         * namespace.cs (VerifyUsing): use GetPartialName instead of
4066         ToString. 
4067
4068 2004-11-05  Miguel de Icaza  <miguel@ximian.com>
4069
4070         * statement.cs (Return.Resolve): Fix regression in typo: if
4071         `in_exc', we have to request a NeedReturnLabel, this was a typo
4072         introduced in the anonymous method check-in.  Fixes #69131.
4073
4074         * Indexers were using the ShortName when defining themselves,
4075         causing a regression in the compiler bootstrap when applying the
4076         patch from 2004-11-02 (first part), now they use their full name
4077         and the bug is gone.
4078
4079 2004-11-04  Zoltan Varga  <vargaz@freemail.hu>
4080
4081         * driver.cs: Strip the path from the names of embedded resources. Fixes
4082         #68519.
4083
4084 2004-11-04  Raja R Harinath  <rharinath@novell.com>
4085
4086         Fix error message regression: cs0104-2.cs.
4087         * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
4088         (AliasEntry.Resolve): Update.
4089         * rootcontext.cs (RootContext.NamespaceLookup): Update.  Remove
4090         'silent' flag.
4091         (RootContext.LookupType): Update.
4092
4093 2004-11-03  Carlos Alberto Cortez <carlos@unixmexico.org>
4094
4095         * cs-parser.jay: Add support for handling accessor modifiers
4096         * class: Add support port accessor modifiers and error checking,
4097         define PropertyMethod.Define as virtual (not abstract anymore)
4098         * ecore.cs: Add checking for proeprties access with access modifiers
4099         * iterators.cs: Modify Accessor constructor call based in the modified
4100         constructor
4101 2004-11-02  Ben Maurer  <bmaurer@ximian.com>
4102
4103         * expression.cs (StringConcat): Handle being called twice,
4104         as when we have a concat in a field init with more than two
4105         ctors in the class
4106
4107 2004-11-02  Miguel de Icaza  <miguel@ximian.com>
4108
4109         * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
4110         special case explicit implementations, we should always produce
4111         the .property or .event declaration.
4112         
4113         * decl.cs (MemberName): Renamed GetFullName to GetPartialName
4114         since it will not return correct data if people use this
4115         unresolved in the presence of using statements (see test-313).
4116
4117         * class.cs (MethodData.Define): If we are an explicit interface
4118         implementation, set the method name to the full name of the
4119         interface plus the name of the method.  
4120
4121         Notice that using the method.MethodName.GetFullName() does not
4122         work, as it will only contain the name as declared on the source
4123         file (it can be a shorthand in the presence of using statements)
4124         and not the fully qualifed type name, for example:
4125
4126         using System;
4127
4128         class D : ICloneable {
4129                 object ICloneable.Clone ()  {
4130                 }
4131         }
4132
4133         Would produce a method called `ICloneable.Clone' instead of
4134         `System.ICloneable.Clone'.
4135
4136         * namespace.cs (Alias.Resolve): Use GetPartialName.
4137         
4138 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
4139
4140         * cs-parser.jay: Add error 1055 report.
4141
4142 2004-11-01  Miguel de Icaza  <miguel@ximian.com>
4143
4144         * assign.cs (Assign.DoResolve): Only do the transform of
4145         assignment into a New if the types are compatible, if not, fall
4146         through and let the implicit code deal with the errors and with
4147         the necessary conversions. 
4148
4149 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
4150
4151         * cs-parser.jay: Add error 1031 report.
4152
4153         * cs-tokenizer.cs: Add location for error 1038.
4154
4155 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
4156
4157         * cs-parser.jay: Add error 1016 report.
4158
4159 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
4160
4161         * cs-parser.jay: Add errors 1575,1611 report.
4162
4163 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
4164
4165         * cs-parser.jay: Add error 1001 report.
4166
4167 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
4168
4169         Fix #68850
4170         * attribute.cs (GetMarshal): Add method argument for
4171         caller identification.
4172
4173         * class.cs, codegen.cs, enum.cs, parameter.cs: Added
4174         agument for GetMarshal and RuntimeMissingSupport.
4175
4176 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
4177
4178         * attribute.cs (ExtractSecurityPermissionSet): Removed
4179         TypeManager.code_access_permission_type.
4180
4181         * typemanager.cs: Removed TypeManager.code_access_permission_type.
4182
4183 2004-10-27  Miguel de Icaza  <miguel@ximian.com>
4184
4185         * expression.cs (LocalVariableReference.DoResolveLValue): Check
4186         for obsolete use of a variable here.   Fixes regression on errors
4187         cs0619-25 and cs0619-26.
4188
4189 2004-10-27  Marek Safar  <marek.safar@seznam.cz>
4190
4191         Fix #62358, implemented security attribute encoding.
4192
4193         * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
4194         Tests permitted SecurityAction for assembly or other types.
4195         (Assembly.ExtractSecurityPermissionSet): New method. Transforms
4196         data from SecurityPermissionAttribute to PermisionSet class.
4197
4198         * class.cs (ApplyAttributeBuilder): Added special handling
4199         for System.Security.Permissions.SecurityAttribute based types.
4200
4201         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
4202         special handling for System.Security.Permissions.SecurityAttribute
4203         based types.
4204
4205         * enum.cs (ApplyAttributeBuilder): Added special handling
4206         for System.Security.Permissions.SecurityAttribute based types.
4207
4208         * parameter.cs (ApplyAttributeBuilder): Added special handling
4209         for System.Security.Permissions.SecurityAttribute based types.
4210
4211         * rootcontext.cs: Next 2 core types.
4212
4213         * typemanager.cs (TypeManager.security_permission_attr_type):
4214         Built in type for the SecurityPermission Attribute.
4215         (code_access_permission_type): Build in type.
4216
4217 2004-10-17  Miguel de Icaza  <miguel@ximian.com>
4218
4219         * expression.cs (LocalVariableReference.DoResolveBase, Emit):
4220         Remove the tests for `ec.RemapToProxy' from here, and encapsulate
4221         all of this information into
4222         EmitContext.EmitCapturedVariableInstance.
4223         
4224         * codegen.cs (EmitCapturedVariableInstance): move here the
4225         funcionality of emitting an ldarg.0 in the presence of a
4226         remapping.   This centralizes the instance emit code.
4227
4228         (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
4229         then emit a load of this: it means that we have reached the
4230         topmost ScopeInfo: the one that contains the pointer to the
4231         instance of the class hosting the anonymous method.
4232
4233         * anonymous.cs (AddField, HaveCapturedFields): Propagate field
4234         captures to the topmost CaptureContext.
4235
4236 2004-10-12  Miguel de Icaza  <miguel@ximian.com>
4237
4238         * expression.cs (LocalVariableReference): Move the knowledge about
4239         the iterators into codegen's EmitCapturedVariableInstance.
4240
4241 2004-10-11  Miguel de Icaza  <miguel@ximian.com>
4242
4243         * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
4244         all code paths return a value from an anonymous method (it is the
4245         same as the 161 error, but for anonymous methods).
4246
4247 2004-10-08  Miguel de Icaza  <miguel@ximian.com>
4248
4249         The introduction of anonymous methods in the compiler changed
4250         various ways of doing things in the compiler.  The most
4251         significant one is the hard split between the resolution phase
4252         and the emission phases of the compiler.
4253
4254         For instance, routines that referenced local variables no
4255         longer can safely create temporary variables during the
4256         resolution phase: they must do so from the emission phase,
4257         since the variable might have been "captured", hence access to
4258         it can not be done with the local-variable operations from the runtime.
4259         
4260         * statement.cs 
4261
4262         (Block.Flags): New flag `IsTopLevel' to indicate that this block
4263         is a toplevel block.
4264
4265         (ToplevelBlock): A new kind of Block, these are the blocks that
4266         are created by the parser for all toplevel method bodies.  These
4267         include methods, accessors and anonymous methods.
4268
4269         These contain some extra information not found in regular blocks:
4270         A pointer to an optional CaptureContext (for tracking captured
4271         local variables and parameters).  A pointer to the parent
4272         ToplevelBlock.
4273         
4274         (Return.Resolve): Catch missmatches when returning a value from an
4275         anonymous method (error 1662).
4276         Invoke NeedReturnLabel from the Resolve phase instead of the emit
4277         phase.
4278
4279         (Break.Resolve): ditto.
4280
4281         (SwitchLabel): instead of defining the labels during the
4282         resolution phase, we now turned the public ILLabel and ILLabelCode
4283         labels into methods called GetILLabelCode() and GetILLabel() that
4284         only define the label during the Emit phase.
4285
4286         (GotoCase): Track the SwitchLabel instead of the computed label
4287         (its contained therein).  Emit the code by using
4288         SwitchLabel.GetILLabelCode ().
4289
4290         (LocalInfo.Flags.Captured): A new flag has been introduce to track
4291         whether the Local has been captured or not.
4292
4293         (LocalInfo.IsCaptured): New property, used to tell whether the
4294         local has been captured.
4295         
4296         * anonymous.cs: Vastly updated to contain the anonymous method
4297         support.
4298
4299         The main classes here are: CaptureContext which tracks any
4300         captured information for a toplevel block and ScopeInfo used to
4301         track the activation frames for various local variables.   
4302
4303         Each toplevel block has an optional capture context associated
4304         with it.  When a method contains an anonymous method both the
4305         toplevel method and the anonymous method will create a capture
4306         context.   When variables or parameters are captured, they are
4307         recorded on the CaptureContext that owns them, for example:
4308
4309         void Demo () {
4310              int a;
4311              MyDelegate d = delegate {
4312                  a = 1;
4313              }
4314         }
4315
4316         Here `a' will be recorded as captured on the toplevel
4317         CapturedContext, the inner captured context will not have anything
4318         (it will only have data if local variables or parameters from it
4319         are captured in a nested anonymous method.
4320
4321         The ScopeInfo is used to track the activation frames for local
4322         variables, for example:
4323
4324         for (int i = 0; i < 10; i++)
4325                 for (int j = 0; j < 10; j++){
4326                    MyDelegate d = delegate {
4327                         call (i, j);
4328                    }
4329                 }
4330
4331         At runtime this captures a single captured variable `i', but it
4332         captures 10 different versions of the variable `j'.  The variable
4333         `i' will be recorded on the toplevel ScopeInfo, while `j' will be
4334         recorded on a child.  
4335
4336         The toplevel ScopeInfo will also track information like the `this'
4337         pointer if instance variables were referenced (this is necessary
4338         as the anonymous method lives inside a nested class in the host
4339         type of the method). 
4340
4341         (AnonymousMethod): Expanded to track the Toplevel, implement
4342         `AnonymousMethod.Compatible' to tell whether an anonymous method
4343         can be converted to a target delegate type. 
4344
4345         The routine now also produces the anonymous method content
4346
4347         (AnonymousDelegate): A helper class that derives from
4348         DelegateCreation, this is used to generate the code necessary to
4349         produce the delegate for the anonymous method that was created. 
4350
4351         * assign.cs: API adjustments for new changes in
4352         Convert.ImplicitStandardConversionExists.
4353
4354         * class.cs: Adjustments to cope with the fact that now toplevel
4355         blocks are of type `ToplevelBlock'. 
4356
4357         * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
4358         insteda of standard blocks.
4359
4360         Flag errors if params arguments are passed to anonymous methods.
4361
4362         * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
4363         `CurrentAnonymousMethod' which points to the current Anonymous
4364         Method.  The variable points to the AnonymousMethod class that
4365         holds the code being compiled.  It is set in the new EmitContext
4366         created for the anonymous method.
4367
4368         (EmitContext.Phase): Introduce a variable and an enumeration to
4369         assist in enforcing some rules about when and where we are allowed
4370         to invoke certain methods (EmitContext.NeedsReturnLabel is the
4371         only one that enfonces this right now).
4372
4373         (EmitContext.HaveCaptureInfo): new helper method that returns
4374         whether we have a CapturedContext initialized.
4375
4376         (EmitContext.CaptureVariable): New method used to register that a
4377         LocalInfo must be flagged for capturing. 
4378
4379         (EmitContext.CapturedParameter): New method used to register that a
4380         parameters must be flagged for capturing. 
4381         
4382         (EmitContext.CapturedField): New method used to register that a
4383         field must be flagged for capturing. 
4384
4385         (EmitContext.HaveCapturedVariables,
4386         EmitContext.HaveCapturedFields): Return whether there are captured
4387         variables or fields. 
4388
4389         (EmitContext.EmitMethodHostInstance): This is used to emit the
4390         instance for the anonymous method.  The instance might be null
4391         (static methods), this (for anonymous methods that capture nothing
4392         and happen to live side-by-side with the current method body) or a
4393         more complicated expression if the method has a CaptureContext.
4394
4395         (EmitContext.EmitTopBlock): Routine that drives the emission of
4396         code: it will first resolve the top block, then emit any metadata
4397         and then emit the code.  The split is done so that we can extract
4398         any anonymous methods and flag any captured variables/parameters.
4399         
4400         (EmitContext.ResolveTopBlock): Triggers the resolution phase,
4401         during this phase, the ILGenerator should not be used as labels
4402         and local variables declared here might not be accessible to any
4403         code that is part of an anonymous method.  
4404
4405         Exceptions to this include the temporary variables that are
4406         created by some statements internally for holding temporary
4407         variables. 
4408         
4409         (EmitContext.EmitMeta): New routine, in charge of emitting all the
4410         metadata for a cb
4411
4412         (EmitContext.TemporaryReturn): This method is typically called
4413         from the Emit phase, and its the only place where we allow the
4414         ReturnLabel to be defined other than the EmitMeta.  The reason is
4415         that otherwise we would have to duplicate a lot of logic in the
4416         Resolve phases of various methods that today is on the Emit
4417         phase. 
4418
4419         (EmitContext.NeedReturnLabel): This no longer creates the label,
4420         as the ILGenerator is not valid during the resolve phase.
4421
4422         (EmitContext.EmitThis): Extended the knowledge in this class to
4423         work in anonymous methods in addition to iterators. 
4424
4425         (EmitContext.EmitCapturedVariableInstance): This emits whatever
4426         code is necessary on the stack to access the instance to a local
4427         variable (the variable will be accessed as a field).
4428
4429         (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
4430         EmitContext.EmitAddressOfParameter): Routines to support
4431         parameters (not completed at this point). 
4432         
4433         Removals: Removed RemapLocal and RemapLocalLValue.  We probably
4434         will also remove the parameters.
4435
4436         * convert.cs (Convert): Define a `ConstantEC' which points to a
4437         null.  This is just to prefity some code that uses
4438         ImplicitStandardConversion code and do not have an EmitContext
4439         handy.
4440
4441         The idea is to flag explicitly that at that point in time, it is
4442         known that the conversion will not trigger the delegate checking
4443         code in implicit conversions (which requires a valid
4444         EmitContext). 
4445
4446         Everywhere: pass new EmitContext parameter since
4447         ImplicitStandardConversionExists now requires it to check for
4448         anonymous method conversions. 
4449
4450         (Convert.ImplicitStandardConversionExists): If the type of an
4451         expression is the anonymous_method_type, and the type is a
4452         delegate, we invoke the AnonymousMethod.Compatible method to check
4453         whether an implicit conversion is possible. 
4454
4455         (Convert.ImplicitConversionStandard): Only do implicit method
4456         group conversions if the language level is not ISO_1.
4457
4458         * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
4459         MethodInfo for the Invoke method.  used by Delegate and
4460         AnonymousDelegate.
4461
4462         * expression.cs (Binary.DoNumericPromotions): only allow anonymous
4463         method conversions if the target type is a delegate.
4464
4465         Removed extra debugging nops.
4466
4467         (LocalVariableReference): Turn the `local_info' into a public
4468         field. 
4469
4470         Add `prepared' field, the same hack used for FieldExprs to cope
4471         with composed assignments, as Local variables do not necessarily
4472         operate purely on the stack as they used to: they can be captured
4473         fields. 
4474
4475         Add `temp' for a temporary result, like fields.
4476
4477         Refactor DoResolve and DoResolveLValue into DoResolveBase.
4478
4479         It now copes with Local variables that are captured and emits the
4480         proper instance variable to load it from a field in the captured
4481         case. 
4482
4483         (ParameterReference.DoResolveBase): During the resolve phase,
4484         capture parameters if we are in an anonymous method.
4485
4486         (ParameterReference.Emit, ParameterReference.AddressOf): If in an
4487         anonymous method, use the EmitContext helper routines to emit the
4488         parameter reference.
4489
4490         * iterators.cs: Set RemapToProxy to true/false during the
4491         EmitDispose class.
4492
4493         * parameters.cs (GetParameterByName): New helper method. 
4494
4495         * typemanager.cs (anonymous_method_type) a new type that
4496         represents an anonyous method.  This is always an internal type,
4497         used as a fencepost to test against the anonymous-methodness of an
4498         expression. 
4499         
4500 2004-10-20  Marek Safar  <marek.safar@seznam.cz>
4501
4502         * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
4503         561 report.
4504         (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
4505
4506 2004-11-10  Martin Baulig  <martin@ximian.com>
4507
4508         * expression.cs (Invocation.BetterFunction): If two methods have
4509         equal parameter types, but only one of them is generic, the
4510         non-generic one wins.
4511         (New.DoResolve): Don't set `is_struct' to false if we're a generic
4512         instance; just use `Type.IsValueType' to determine whether
4513         something is a struct or not.
4514         (MemberAccess.DoResolveAsTypeStep): Don't modify the `args' field,
4515         so we can be called multiple times.
4516
4517 2004-11-10  Martin Baulig  <martin@ximian.com>
4518
4519         * generic.cs (TypeParameter.DefineConstraints): New public method.
4520         (TypeParameter.CheckAccessLevel): Override this and return true.
4521         (ConstructedType.ResolveType): Renamed to DoResolveType(), don't
4522         override ResolveType() anymore.
4523         (ConstructedType.DoResolveAsTypeStep): Call DoResolveType() here.
4524
4525 2004-11-10  Martin Baulig  <martin@ximian.com>
4526
4527         * rootcontext.cs (RootContext.LookupType): If we're a nested type,
4528         call DeclSpace.ResolveNestedType() on it.
4529
4530 2004-11-10  Martin Baulig  <martin@ximian.com>
4531
4532         * support.cs (ReflectionParameters.ParameterModifier): If `gpd' is
4533         non-null, call ParameterModifier() on it.
4534
4535 2004-11-10  Martin Baulig  <martin@ximian.com>
4536
4537         * iterators.cs
4538         (Iterators): Added `current_type' and `this_type' fields.
4539         (Iterators.DefineIterator): Create a new EmitContext and store it
4540         in `ec'; compute `this_type'.
4541
4542 2004-11-10  Martin Baulig  <martin@ximian.com>
4543
4544         * typemanager.cs
4545         (TypeManager.IsPrivateAccessible): New public method.
4546         (Closure.Filter): Use IsPrivateAccessible() instead of IsEqual().
4547
4548 2004-11-10  Martin Baulig  <martin@ximian.com>
4549
4550         * class.cs (TypeContainer.DefineType): Call
4551         TypeBuilder.DefineGenericParameters() before resolving the type
4552         parameters.
4553         (MethodData.parent_method): New protected field.
4554         (MethodData..ctor): Added `MethodInfo parent_method' argument.
4555         (MethodData.Define): Compute `parent_method'.
4556
4557         * decl.cs
4558         (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
4559         (MemberCore.GetClsCompliantAttributeValue): Likewise.
4560         (DeclSpace.ec): New protected field; store the EmitContext here.
4561         (DeclSpace.EmitContext): New public property.
4562         (DeclSpace.ResolveType): Un-comment from the [Obsolte] attribute.
4563         (DeclSpace.ResolveNestedType): New public method.
4564         (DeclSpace.ResolveTypeExpr): Just call ResolveAsTypeTerminal() here.
4565         (DeclSpace.NestedAccessible): Added `Type tb' argument.
4566         (DeclSpace.FamilyAccessible): Likewise.
4567         (DeclSpace.FindType): Call ResolveNestedType() for nested types.
4568         (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
4569         EmitContext.
4570
4571         * delegate.cs (Delegate.Define): Store the EmitContext in the `ec'
4572         field.
4573
4574         * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
4575         (Enum.Emit): Don't create a new EmitContext.
4576
4577 2004-10-18  Martin Baulig  <martin@ximian.com>
4578
4579         * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
4580         `Type' directly, but call ResolveType() on it.
4581         (Catch.Resolve): Likewise.
4582         (Foreach.Resolve): Likewise.
4583
4584 2004-10-18  Martin Baulig  <martin@ximian.com>
4585
4586         * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
4587         `Type' directly, but call ResolveType() on it.
4588         (Probe.DoResolve): Likewise.
4589         (ArrayCreation.LookupType): Likewise.
4590         (TypeOf.DoResolve): Likewise.
4591         (SizeOf.DoResolve): Likewise.
4592
4593 2004-10-18  Raja R Harinath  <rharinath@novell.com>
4594
4595         * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
4596         the ResolveType.
4597
4598 2004-10-17  John Luke  <john.luke@gmail.com>
4599
4600         * class.cs (Operator.GetSignatureForError): use CSharpName
4601
4602         * parameter.cs (Parameter.GetSignatureForError): Returns
4603         correct name even if was not defined.
4604
4605 2004-10-13  Raja R Harinath  <rharinath@novell.com>
4606
4607         Fix #65816.
4608         * class.cs (TypeContainer.EmitContext): New property.
4609         (DefineNestedTypes): Create an emitcontext for each part.
4610         (MethodCore.DoDefineParameters): Use container's emitcontext.
4611         Pass type array to InternalParameters.
4612         (MemberBase.DoDefine): Use container's emitcontext.
4613         (FieldMember.Define): Likewise.
4614         (Event.Define): Likewise.
4615         (SetMethod.GetParameterInfo): Change argument to EmitContext.
4616         Pass type array to InternalParameters.
4617         (SetIndexerMethod.GetParameterInfo): Likewise.
4618         (SetMethod.Define): Pass emitcontext to GetParameterInfo.
4619         * delegate.cs (Define): Pass emitcontext to
4620         ComputeAndDefineParameterTypes and GetParameterInfo.  Pass type
4621         array to InternalParameters.
4622         * expression.cs (ParameterReference.DoResolveBase): Pass
4623         emitcontext to GetParameterInfo.
4624         (ComposedCast.DoResolveAsTypeStep): Remove check on
4625         ec.ResolvingTypeTree.
4626         * parameter.cs (Parameter.Resolve): Change argument to
4627         EmitContext.  Use ResolveAsTypeTerminal.
4628         (Parameter.GetSignature): Change argument to EmitContext.
4629         (Parameters.ComputeSignature): Likewise.
4630         (Parameters.ComputeParameterTypes): Likewise.
4631         (Parameters.GetParameterInfo): Likewise.
4632         (Parameters.ComputeAndDefineParameterTypes): Likewise.
4633         Re-use ComputeParameterTypes.  Set ec.ResolvingTypeTree.
4634         * support.cs (InternalParameters..ctor): Remove variant that takes
4635         a DeclSpace.
4636         * typemanager.cs (system_intptr_expr): New.
4637         (InitExpressionTypes): Initialize it.
4638
4639 2004-10-12  Chris Toshok  <toshok@ximian.com>
4640
4641         * cs-parser.jay: fix location for try_statement and catch_clause.
4642
4643 2004-10-18  Martin Baulig  <martin@ximian.com>
4644
4645         * class.cs (FieldMember.Define): Don't access the TypeExpr's
4646         `Type' directly, but call ResolveType() on it.
4647         (MemberBase.DoDefine): Likewise.
4648
4649         * expression.cs (New.DoResolve): Don't access the TypeExpr's
4650         `Type' directly, but call ResolveType() on it.
4651         (ComposedCast.DoResolveAsTypeStep): Likewise.
4652
4653         * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
4654         `Type' directly, but call ResolveType() on it.
4655
4656 2004-10-17  John Luke  <john.luke@gmail.com>
4657
4658         * class.cs (Operator.GetSignatureForError): use CSharpName
4659
4660         * parameter.cs (Parameter.GetSignatureForError): Returns
4661         correct name even if was not defined.
4662
4663 2004-10-13  Raja R Harinath  <rharinath@novell.com>
4664
4665         Fix #65816.
4666         * class.cs (TypeContainer.EmitContext): New property.
4667         (DefineNestedTypes): Create an emitcontext for each part.
4668         (MethodCore.DoDefineParameters): Use container's emitcontext.
4669         Pass type array to InternalParameters.
4670         (MemberBase.DoDefine): Use container's emitcontext.
4671         (FieldMember.Define): Likewise.
4672         (Event.Define): Likewise.
4673         (SetMethod.GetParameterInfo): Change argument to EmitContext.
4674         Pass type array to InternalParameters.
4675         (SetIndexerMethod.GetParameterInfo): Likewise.
4676         (SetMethod.Define): Pass emitcontext to GetParameterInfo.
4677         * delegate.cs (Define): Pass emitcontext to
4678         ComputeAndDefineParameterTypes and GetParameterInfo.  Pass type
4679         array to InternalParameters.
4680         * expression.cs (ParameterReference.DoResolveBase): Pass
4681         emitcontext to GetParameterInfo.
4682         (ComposedCast.DoResolveAsTypeStep): Remove check on
4683         ec.ResolvingTypeTree.
4684         * parameter.cs (Parameter.Resolve): Change argument to
4685         EmitContext.  Use ResolveAsTypeTerminal.
4686         (Parameter.GetSignature): Change argument to EmitContext.
4687         (Parameters.ComputeSignature): Likewise.
4688         (Parameters.ComputeParameterTypes): Likewise.
4689         (Parameters.GetParameterInfo): Likewise.
4690         (Parameters.ComputeAndDefineParameterTypes): Likewise.
4691         Re-use ComputeParameterTypes.  Set ec.ResolvingTypeTree.
4692         * support.cs (InternalParameters..ctor): Remove variant that takes
4693         a DeclSpace.
4694         * typemanager.cs (system_intptr_expr): New.
4695         (InitExpressionTypes): Initialize it.
4696
4697 2004-10-12  Chris Toshok  <toshok@ximian.com>
4698
4699         * cs-parser.jay: fix location for try_statement and catch_clause.
4700
4701 2004-10-07  Raja R Harinath  <rharinath@novell.com>
4702
4703         More DeclSpace.ResolveType avoidance.
4704         * decl.cs (MemberCore.InUnsafe): New property.
4705         * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal 
4706         with newly created EmitContext.
4707         (FieldMember.Define): Likewise.
4708         * delegate.cs (Delegate.Define): Likewise.
4709         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
4710         only if normal name-lookup fails.
4711         (TypeExpr.DoResolve): Enable error-checking.
4712         * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
4713         (SizeOf.DoResolve): Likewise.
4714         (ComposedCast.DoResolveAsTypeStep): Likewise.
4715         (StackAlloc.DoResolve): Likewise.
4716         * statement.cs (Block.Flags): Add new flag 'Unsafe'.
4717         (Block.Unsafe): New property.
4718         (Block.EmitMeta): Set ec.InUnsafe as appropriate.
4719         (Unsafe): Set 'unsafe' flag of contained block.
4720         (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
4721         (Fixed.Resolve): Likewise.
4722         (Catch.Resolve): Likewise.
4723         (Using.ResolveLocalVariableDecls): Likewise.
4724         (Foreach.Resolve): Likewise.
4725
4726 2004-10-05  John Luke <john.luke@gmail.com>
4727
4728         * cs-parser.jay: add location to error CS0175
4729
4730 2004-10-04  Miguel de Icaza  <miguel@ximian.com>
4731
4732         * ecore.cs (Expression.Constantity): Add support for turning null
4733         into a constant.
4734
4735         * const.cs (Const.Define): Allow constants to be reference types
4736         as long as the value is Null.
4737
4738 2004-10-04  Juraj Skripsky  <js@hotfeet.ch>
4739
4740         * namespace.cs (NamespaceEntry.Using): No matter which warning
4741         level is set, check if this namespace name has already been added.
4742
4743 2004-10-03 Ben Maurer  <bmaurer@ximian.com>
4744
4745         * expression.cs: reftype [!=]= null should always use br[true,false].
4746         # 67410
4747
4748 2004-10-03  Marek Safar  <marek.safar@seznam.cz>
4749
4750         Fix #67108
4751         * attribute.cs: Enum conversion moved to 
4752         GetAttributeArgumentExpression to be applied to the all
4753         expressions.
4754
4755 2004-10-01  Raja R Harinath  <rharinath@novell.com>
4756
4757         Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
4758         * class.c (TypeContainer.DefineType): Flag error if
4759         base types aren't accessible due to access permissions.
4760         * decl.cs (DeclSpace.ResolveType): Move logic to
4761         Expression.ResolveAsTypeTerminal.
4762         (DeclSpace.ResolveTypeExpr): Thin layer over
4763         Expression.ResolveAsTypeTerminal.
4764         (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
4765         Refactor code into NestedAccess.  Use it.
4766         (DeclSpace.NestedAccess): New.
4767         * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
4768         argument to silence errors.  Check access permissions.
4769         (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
4770         * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
4771         (Cast.DoResolve): Likewise.
4772         (New.DoResolve): Likewise.
4773         (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
4774         (TypeOf.DoResolve): Likewise.
4775
4776         * expression.cs (Invocation.BetterConversion): Return the Type of
4777         the better conversion.  Implement section 14.4.2.3 more faithfully.
4778         (Invocation.BetterFunction): Make boolean.  Make correspondence to
4779         section 14.4.2.2 explicit.
4780         (Invocation.OverloadResolve): Update.
4781         (Invocation): Remove is_base field.
4782         (Invocation.DoResolve): Don't use is_base.  Use mg.IsBase.
4783         (Invocation.Emit): Likewise.
4784
4785 2004-09-24  Marek Safar  <marek.safar@seznam.cz>
4786
4787         * cs-parser.jay: Reverted 642 warning fix.
4788
4789 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
4790
4791         Fix bug #66615
4792         * decl.cs (FindMemberWithSameName): Indexer can have more than
4793         1 argument.
4794
4795 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
4796
4797         * expression.cs (LocalVariableReference.DoResolveLValue):
4798         Do not report warning 219 for out values.
4799         (EmptyExpression.Null): New member to avoid extra allocations.
4800
4801 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
4802
4803         * cs-parser.jay: Fix wrong warning 642 report.
4804
4805         * cs-tokenizer.cs (CheckNextToken): New helper;
4806         Inspect next character if is same as expected.
4807
4808 2004-09-23  Martin Baulig  <martin@ximian.com>
4809
4810         * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
4811         (Convert.ImplicitReferenceConversionExists): Likewise.
4812
4813 2004-11-09  Raja R Harinath  <rharinath@novell.com>
4814
4815         * Makefile (DISTFILES): Comment out a few missing files.
4816
4817 2004-10-29  Raja R Harinath  <rharinath@novell.com>
4818
4819         * Makefile (bootstrap_libs,bootstrap_libfiles): New.
4820         (bootstrap-libs): New target.  Invokes the net_2_0_bootstrap profile.
4821         (gmcs.exe): Invoke bootstrap-libs.
4822         (clean-local): Clean the net_2_0_bootstrap profile too.
4823         (PROGRAM_INSTALL_DIR): New.
4824         (install-local): Use it.
4825
4826 2004-10-13  Martin Baulig  <martin@ximian.com>
4827
4828         * generic.cs (TypeManager.InflatedConstraints): New nested class.
4829         (TypeParameter.DefineType): If we're a method type parameter and
4830         that method is overriding something, "inflate" its constraints.
4831
4832 2004-10-12  Martin Baulig  <martin@ximian.com>
4833
4834         * expression.cs (MemberAccess.DoResolve): If we're a SimpleName
4835         and have type arguments, create and resolve a ConstructedType.
4836
4837 2004-10-12  Martin Baulig  <martin@ximian.com>
4838
4839         * decl.cs (MemberCache.FindMemberToOverride): Use
4840         TypeManager.IsEqual() to compare the parameters and Type.Equals()
4841         to compare the invocationType.
4842
4843         * typemanager.cs (TypeManager.IsEqual): Added support for arrays.
4844         When comparing two type parameters, only do the signature-only
4845         comparision for method type parameters.
4846
4847 2004-10-11  Martin Baulig  <martin@ximian.com>
4848
4849         * report.cs: Don't make --fatal abort on warnings, we have
4850         -warnaserror for that.
4851
4852 2004-10-11  Martin Baulig  <martin@ximian.com>
4853
4854         * typemanager.cs
4855         (TypeManager.IsEqualGenericType): Removed, use IsEqual() instead.
4856         (TypeManager.IsEqual): Call ourself recursively instead of using
4857         Type.IsEqual(). 
4858
4859 2004-10-11  Martin Baulig  <martin@ximian.com>
4860
4861         * class.cs (TypeContainer.DefineType): Only call TypeParameter.Define()
4862         on our own type parameters, not on the ones we inherit from a containing
4863         class.
4864
4865         * expression.cs (Invocation.InferType): Use `==', not `Equals()' for
4866         the comparision.
4867
4868         * generic.cs (TypeParameter.Define): We may only be called once.
4869
4870         * pending.cs (Pending.InterfaceMethod): Call TypeManager.Real_IsEqual()
4871         instead of TypeManager.IsEqual().
4872
4873 2004-09-28  Martin Baulig  <martin@ximian.com>
4874
4875         * generic.cs
4876         (GenericConstraints.EffectiveBaseClass): New public property.
4877         (TypeParameter.GenericConstraints): New public property.
4878         (ConstructedType.CheckConstraints): Improved.
4879
4880         * convert.cs (Convert.TypeParam_EffectiveBaseType): New private method.
4881         (Convert.TypeParameterConversion): New private method; use this in
4882         ImplicitReferenceConversion() and ImplicitReferenceConversionExists()
4883         for all conversions related to type parameters.
4884
4885 2004-09-24  Martin Baulig  <martin@ximian.com>
4886
4887         * convert.cs (Convert.ImplicitReferenceConversion): Added implicit
4888         type parameter conversions for type parameters which are known to
4889         be reference types.
4890
4891 2004-09-24  Martin Baulig  <martin@ximian.com>
4892
4893         * generic.cs (GenericConstraints): Added `IsReferenceType' and
4894         `IsValueType' properties.
4895
4896         * support.cs (ReflectionConstraints): Use
4897         Type.GetGenericParameterConstraints() instead of the old hack.
4898
4899 2004-09-24  Martin Baulig  <martin@ximian.com>
4900
4901         * generic.cs (GenericConstraints): Moved here and made it an
4902         abstract class.
4903
4904         * support.cs (GenericConstraints): Moved to generic.cs.
4905
4906 2004-09-24  Martin Baulig  <martin@ximian.com>
4907
4908         * support.cs
4909         (ReflectionConstraints): Un-nested this class and made it public.
4910
4911         * typemanager.cs
4912         (TypeManager.GetTypeParameterConstraints): New public method.
4913         (TypeManager.HasConstructorConstraint): Use the attributes.
4914
4915 2004-09-24  Martin Baulig  <martin@ximian.com>
4916
4917         * support.cs (GenericConstraints): Replaced `HasConstructor',
4918         `IsReferenceType' and `IsValueType' with `Attributes'.
4919         (ReflectionParameters.ReflectionConstraints): Removed the Create()
4920         method and made the .ctor public.
4921
4922         * generic.cs (Constraints.Attributes): New public property.
4923         (Constraints): Renamed `HasConstructor' -> `HasConstructorConstraint',
4924         `IsReferenceType' -> `HasReferenceTypeConstraint' and
4925         `IsValueType' -> `HasValueTypeConstraint'.
4926
4927 2004-09-23  Martin Baulig  <martin@ximian.com>
4928
4929         * generic.cs (Constraints): Reflect latest runtime changes.
4930
4931 2004-09-23  Martin Baulig  <martin@ximian.com>
4932
4933         * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
4934         (Convert.ImplicitReferenceConversionExists): Likewise.
4935
4936 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
4937
4938         * class.cs (Operator.Define): Add error 448 and 559 report.
4939         
4940 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
4941
4942         * class.cs (MemberBase.IsTypePermitted): New protected
4943         method for checking error CS0610.
4944
4945 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
4946
4947         * class.cs (TypeContainer.HasExplicitLayout): New property
4948         Returns whether container has StructLayout attribute set Explicit.
4949         (FieldMember): New abstract class for consts and fields.
4950         (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
4951         (Field): Reuse FieldMember.
4952
4953         * const.cs (Const): Reuse FieldMember.
4954
4955         * rootcontext.cs: EmitConstants call moved to class.
4956
4957 2004-09-22  Martin Baulig  <martin@ximian.com>
4958
4959         Marek and me just fixed one of our oldest bugs: #28562 :-)
4960
4961         * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
4962
4963         * attribute.cs (Attribute.GetAttributeArgumentExpression): If
4964         we're an EnumConstant, just return that.
4965         (Attribute.Resolve): GetAttributeArgumentExpression() may give us
4966         an EnumConstant.  In this case, we need to use GetValueAsEnumType()
4967         to get the value which'll actually be written into the attribute.
4968         However, we have to use GetValue() to access the attribute's value
4969         in the compiler.        
4970
4971 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
4972
4973         * constant.cs (Constant.IsNegative): New abstract property
4974         IsNegative.
4975
4976         * expression.cs (ArrayAccess.DoResolve): Add warning 251.
4977         (StackAlloc.DoResolve): Reused IsNegative.
4978
4979 2004-09-22  Martin Baulig  <martin@ximian.com>
4980
4981         * typemanager.cs (TypeManager.LookupGenericTypeContainer): New
4982         public method; like LookupTypeContainer, but also works for
4983         generic instances.
4984
4985         * report.cs (Report.SymbolRelatedToPreviousError): Use
4986         TypeManager.LookupGenericTypeContainer().       
4987
4988 2004-09-22  Martin Baulig  <martin@ximian.com>
4989
4990         Thanks to Peter Sestoft for this bug report.
4991
4992         * expression.cs (Conditional): If both the `trueExpr' and the
4993         `falseExpr' is a NullLiteral, return a NullLiteral.
4994
4995 2004-09-22  Martin Baulig  <martin@ximian.com>
4996
4997         * statement.cs (Foreach.EmitCollectionForeach): If we're in an
4998         iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
4999         for the "get_Current" call.
5000
5001 2004-09-21  Martin Baulig  <martin@ximian.com>
5002
5003         * convert.cs (Convert.ImplicitReferenceConversion): When
5004         converting to an interface type, first check whether we're
5005         converting from a reference type.
5006
5007 2004-09-14  Martin Baulig  <martin@ximian.com>
5008
5009         * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
5010
5011 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
5012
5013         Fixed bug #61902
5014         * codegen.cs (TestObsoleteMethodUsage): Trace when method is
5015         called and is obsolete then this member suppress message
5016         when call is inside next [Obsolete] method or type.
5017
5018         * expression.cs: Use TestObsoleteMethodUsage member.
5019
5020 2004-09-14  Martin Baulig  <martin@ximian.com>
5021
5022         * genericparser.cs: Removed.
5023
5024 2004-09-13  Marek Safar  <marek.safar@seznam.cz>
5025
5026         * class.cs (MethodCore.CheckBase): Fix bug #65757.
5027
5028 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
5029
5030         * attribute.cs (Attribute.Resolve): Add error 653 report.
5031
5032         * class.cs (Class.ApplyAttributeBuilder): Add error 641
5033         report.
5034         (Method.ApplyAttributeBuilder): Add error 685 report.
5035         (Operator.Define): Add error 564 report.
5036
5037         * cs-tokenizer.cs (handle_hex): Add error 1013 report.
5038
5039         * expression.cs (Invocation.DoResolve): Add error
5040         245 and 250 report.
5041
5042         * parameter.cs (Parameter.ApplyAttributeBuilder): Add
5043         error 674 report.
5044
5045 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
5046
5047         * class.cs (ConstructorInitializer.Resolve):
5048         Wrong error number (515->516).
5049
5050 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
5051
5052         * class.cs (Indexer.Define): Add error 631 report.
5053
5054 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
5055
5056         * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
5057
5058 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
5059
5060         * expression.cs (Probe.DoResolve): Add error CS0241 report.
5061
5062 2004-09-10  Marek Safar  <marek.safar@seznam.cz>
5063
5064         * cs-parser.jay: Added error CS0241 report.
5065
5066 2004-09-10  Raja R Harinath  <rharinath@novell.com>
5067
5068         * cs-parser.jay (fixed_statement): Introduce a scope for the
5069         declaration in the 'fixed' statement.
5070
5071 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
5072
5073         * cs-parser.jay: Added CS0230 error report.
5074
5075 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
5076
5077         * cs-parser.jay: Added errors CS0231 and CS0257 report.
5078
5079 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
5080
5081         * expression.cs (Argument.Resolve): Added error CS0192 and
5082         CS0199 report.
5083
5084 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
5085
5086         C# 2.0 #pragma warning feature
5087
5088         * cs-tokenizer.cs (PreProcessPragma): New method; 
5089         Handles #pragma directive.
5090
5091         * report.cs (WarningRegions): New class; Support
5092         class for #pragma warning directive. It tests whether
5093         warning is enabled for a given line.
5094
5095 2004-09-08  Miguel de Icaza  <miguel@ximian.com>
5096
5097         * const.cs: Add more descriptive error report, tahnks to
5098         Sebastien. 
5099
5100 2004-09-08  Marek Safar  <marek.safar@seznam.cz>
5101
5102         * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
5103
5104 2004-09-07  Miguel de Icaza  <miguel@ximian.com>
5105
5106         * expression.cs: Apply patch from Ben: Remove dead code from
5107         ArrayCreation, and remove the TurnintoConstant call in const.cs,
5108         as that code just threw an exception anwyays.
5109
5110         * const.cs: Remove the call to the turnintoconstant, for details
5111         see bug: #63144
5112         
5113         * literal.cs: The type of the null-literal is the null type;  So
5114         we use a placeholder type (literal.cs:System.Null, defined here)
5115         for it.
5116
5117         * expression.cs (Conditional.DoResolve): Remove some old code that
5118         is no longer needed, conversions have been fixed.
5119
5120         (ArrayCreationExpression.DoResolve): Return false if we fail to
5121         resolve the inner expression.
5122
5123 2004-09-07  Raja R Harinath  <rharinath@novell.com>
5124
5125         Fix test-290.cs.
5126         * cs-parser.jay (delegate_declaration): Record a delegate
5127         declaration as a type declaration.
5128         Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
5129
5130 2004-09-06  Miguel de Icaza  <miguel@ximian.com>
5131
5132         * parameter.cs: Do not crash if the type can not be resolved. 
5133
5134         * expression.cs: Report errors with unsafe pointers, fixes #64896
5135
5136 2004-09-06 Ben Maurer  <bmaurer@users.sourceforge.net>
5137
5138         * expression.cs: Pointer arith always needs to do a conv.i
5139         if the operand is a long. fix 65320
5140
5141 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
5142
5143         Fixed cs0619-37.cs, cs0619-38.cs
5144
5145         * enum.cs (GetObsoleteAttribute): Removed.
5146
5147         * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
5148         on Enum member is double staged. The first is tested member
5149         and then enum.
5150
5151 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
5152
5153         Fixed #56986, #63631, #65231
5154
5155         * class.cs: (TypeContainer.AddToMemberContainer): New method,
5156         adds member to name container.
5157         (TypeContainer.AddToTypeContainer): New method, adds type to
5158         name container.
5159         (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
5160         AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
5161         AddOperator): Simplified by reusing AddToMemberContainer.
5162         (TypeContainer.UserDefinedStaticConstructor): Changed to property
5163         instead of field.
5164         (Method.CheckForDuplications): Fixed implementation to test all
5165         possibilities.
5166         (MemberBase): Detection whether member is explicit interface
5167         implementation is now in constructor.
5168         (MemberBase.UpdateMemberName): Handles IndexerName.
5169         (Accessor): Changed to keep also location information.
5170         (AbstractPropertyEventMethod): Is derived from MemberCore.
5171         (AbstractPropertyEventMethod.IsDummy): Says whether accessor
5172         will be emited or not.
5173         (PropertyBase.AreAccessorsDuplicateImplementation):
5174         Tests whether accessors are not in collision with some method.
5175         (Operator): Is derived from MethodCore to simplify common
5176         operations.
5177
5178         * decl.cs (Flags.TestMethodDuplication): Test for duplication
5179         must be performed.
5180         (DeclSpace.AddToContainer): Adds the member to defined_names
5181         table. It tests for duplications and enclosing name conflicts.
5182
5183         * enum.cs (EnumMember): Clean up to reuse the base structures
5184
5185 2004-09-03  Martin Baulig  <martin@ximian.com>
5186
5187         Merged latest changes into gmcs.  Please keep this comment in
5188         here, it makes it easier for me to see what changed in MCS since
5189         the last time I merged.
5190
5191 2004-09-03  Martin Baulig  <martin@ximian.com>
5192
5193         * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
5194         into TypeContainer, to make partial classes work again.
5195
5196 2004-09-03  Martin Baulig  <martin@ximian.com>
5197
5198         * rootcontext.cs (RootContext.V2): Removed.
5199
5200 2004-03-23  Martin Baulig  <martin@ximian.com>
5201
5202         * expression.cs (Invocation.OverloadResolve): Added `bool
5203         may_fail' argument and use it instead of the Location.IsNull() hack.
5204
5205 2004-09-09  Martin Baulig  <martin@ximian.com>
5206
5207         * cs-parser.jay (namespace_declaration): Fixed CS0134 reporting.
5208
5209 2004-09-09  Martin Baulig  <martin@ximian.com>
5210
5211         * generic.cs (TypeParameter.DefineType): Added support for
5212         explicit interface methods.
5213
5214 2004-09-09  Martin Baulig  <martin@ximian.com>
5215
5216         * README.Changes: New document.  Started to list important changes
5217         between MCS and GMCS here.
5218
5219 2004-09-08  Martin Baulig  <martin@ximian.com>
5220
5221         * class.cs
5222         (TypeContainer.CheckRecursiveDefinition): New protected method.
5223         (TypeContainer.DefineType): Move the CS0146 check into
5224         CheckRecursiveDefinition().     
5225
5226 2004-09-06  Martin Baulig  <martin@ximian.com>
5227
5228         * generic.cs (ConstructedType.CheckConstraints): Allow builtin
5229         types for the constructor constraint.
5230
5231 2004-09-03  Martin Baulig  <martin@ximian.com>
5232
5233         * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
5234         into TypeContainer, to make partial classes work again.
5235
5236 2004-09-03  Martin Baulig  <martin@ximian.com>
5237
5238         * rootcontext.cs (RootContext.V2): Removed.
5239
5240 2004-03-23  Martin Baulig  <martin@ximian.com>
5241
5242         * expression.cs (Invocation.OverloadResolve): Added `bool
5243         may_fail' argument and use it instead of the Location.IsNull() hack.
5244
5245 2004-09-03  Martin Baulig  <martin@ximian.com>
5246
5247         Merged latest changes into gmcs.  Please keep this comment in
5248         here, it makes it easier for me to see what changed in MCS since
5249         the last time I merged.
5250
5251 2004-09-03  Raja R Harinath  <rharinath@novell.com>
5252
5253         Fix #61128.
5254         * expression.cs (BetterConversion): Don't allow either conversion 
5255         to be null.  Remove redundant implicit conversion test when 'q ==
5256         null' -- when this function is invoked, we already know that the
5257         implicit conversion exists.
5258         (BetterFunction): Assume that 'best' is non-null.  Remove
5259         redundant reimplementation of IsApplicable when 'best' is null.
5260         (IsParamsMethodApplicable, IsApplicable): Add new parameter for
5261         number of arguments.
5262         (IsAncestralType): Extract from OverloadResolve.
5263         (OverloadResolve): Make robust to the MethodGroupExpr being
5264         unsorted.  Implement all the logic of Section 14.5.5.1, and
5265         support overloading of methods from multiple applicable types.
5266         Clean up logic somewhat.  Don't pass null methods to BetterFunction.
5267
5268         * report.cs (SymbolRelatedToPreviousError): Cleanup output.
5269         (RealError, Warning): Append type of report to related symbol.
5270
5271 2004-09-03  Marek Safar  <marek.safar@seznam.cz>
5272
5273         * enum.cs: Fixed CLS-Compliance checks for enum members.
5274         Error tests cs3008-8.cs, cs3014-8.cs
5275
5276 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
5277
5278         Fixed bug #62342, #63102
5279         * class.cs: ImplementIndexer uses member.IsExplicitImpl
5280         like ImplementMethod.
5281
5282 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
5283
5284         * attribute.cs (Attribute.GetAttributeArgumentExpression):
5285         Fixed bug #65170.
5286
5287 2004-09-02  Martin Baulig  <martin@ximian.com>
5288
5289         * statement.cs (Using.EmitLocalVariableDeclFinally): Use
5290         TypeManager.GetArgumentTypes() rather than calling GetParameters()
5291         on the MethodBase.
5292
5293 2004-09-01  Marek Safar  <marek.safar@seznam.cz>
5294
5295         C# 2.0 Static classes implemented
5296
5297         * class.cs (TypeContainer): instance_constructors,
5298         initialized_fields, initialized_static_fields,
5299         default_constructor, base_inteface_types are protected to be
5300         accessible from StaticClass.
5301         (TypeContainer.DefineDefaultConstructor): New virtual method
5302         for custom default constructor generating
5303         (StaticClass): New class to handle "Static classes" feature.
5304
5305         * cs-parser.jay: Handle static keyword on class like instance
5306         of StaticClass.
5307
5308         * driver.cs: Added "/langversion" command line switch with two
5309         options (iso-1, default).
5310
5311 2004-08-31  Marek Safar  <marek.safar@seznam.cz>
5312
5313         * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
5314
5315 2004-08-31  Miguel de Icaza  <miguel@ximian.com>
5316
5317         * delegate.cs: Style.
5318
5319 2004-08-31 Ben Maurer  <bmaurer@users.sourceforge.net>
5320
5321         * delegate.cs: Add seperate instance expr field for miguel.
5322
5323 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
5324
5325         * PointerArithmetic (Resolve): make sure we are not doing
5326         pointer arith on void*. Also, make sure we are resolved
5327         by not setting eclass until resolve.
5328
5329         All callers: Make sure that PointerArithmetic gets resolved.
5330
5331 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
5332
5333         * ArrayCreation (LookupType): If the type does not resolve 
5334         to an array, give an error.
5335
5336 2004-08-27  Marek Safar  <marek.safar@seznam.cz>
5337
5338         * statement.cs (Try.Resolve): Fixed bug #64222
5339
5340 2004-08-27  Martin Baulig  <martin@ximian.com>
5341
5342         * class.cs
5343         (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
5344         crash here.     
5345
5346 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
5347
5348         * ecore.cs (Constantify): Get underlying type via
5349         System.Enum.GetUnderlyingType to avoid StackOverflow on the
5350         Windows in special cases.
5351
5352 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
5353
5354         * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
5355         for obtaining also private methods.
5356         (GetRemoveMethod): Used GetRemoveMethod (true)
5357         for obtaining also private methods.
5358
5359 2004-09-02  Martin Baulig  <martin@ximian.com>
5360
5361         * statement.cs (Using.EmitLocalVariableDeclFinally): Use
5362         TypeManager.GetArgumentTypes() rather than calling GetParameters()
5363         on the MethodBase.
5364
5365 2004-08-27  Martin Baulig  <martin@ximian.com>
5366
5367         * class.cs
5368         (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
5369         crash here.     
5370
5371 2004-08-25  Martin Baulig  <martin@ximian.com>
5372
5373         * support.cs (ReflectionParameters..ctor): If this is a generic
5374         method, retrieve and store its type parameters.
5375         (InternalParameters..ctor): Added `TypeParameter[]' argument.
5376         (ReflectionParameters.GenericConstraints): The argument specifies
5377         the type parameter, not the method parameter.
5378         (InternalParameters.GenericConstraints): Likewise.
5379
5380         * generic.cs (TypeParameter.DefineType): Correctly handle
5381         constraints wrt. generic methods in interfaces and their
5382         implementations.        
5383
5384 2004-08-24  Martin Baulig  <martin@ximian.com>
5385
5386         * generic.cs (TypeParameter.IsSubclassOf): New public method.
5387         (Constraints.IsSubclassOf): New internal method.
5388
5389         * typemanager.cs (TypeManager.FindMembers): Added special support
5390         for GenericTypeParameterBuilder's.      
5391         (TypeManager.IsSubclassOf, IsFamilyAccessible): Added support for
5392         type parameters.
5393
5394 2004-08-24  Martin Baulig  <martin@ximian.com>
5395
5396         * typemanager.cs
5397         (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
5398         this for accessibility checks.
5399         (TypeManager.IsSubclassOrNestedChildOf): Renamed to
5400         IsNestedFamilyAccessible.
5401         (TypeManager.IsSubclassOf): New method, do what the name actually
5402         says.   
5403
5404 2004-08-24  Martin Baulig  <martin@ximian.com>
5405
5406         * expression.cs (MemberAccess.DoResolve): When resolving ourselves
5407         as a SimpleName, include the generic arity.
5408
5409 2004-08-24  Martin Baulig  <martin@ximian.com>
5410
5411         * class.cs (Method.Define): Set MethodAttributes.SpecialName and
5412         MethodAttributes.HideBySig for operators.
5413
5414 2004-08-23  Martin Baulig  <martin@ximian.com>
5415
5416         Back to the old error reporting system :-)
5417
5418         * report.cs (Message): Removed.
5419         (Report.MessageData, ErrorData, WarningData): Removed.
5420         (Report.Error, Warning): Back to the old system.
5421
5422 2004-08-23  Martin Baulig  <martin@ximian.com>
5423
5424         * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
5425
5426         * class.cs (TypeContainer.ParentContainer): New public virtual
5427         method; replaces the explicit interface implementation.
5428         (ClassPart.ParentContainer): Override.
5429
5430 2004-08-23  Martin Baulig  <martin@ximian.com>
5431
5432         * statement.cs (Switch): Added support for constant switches; see
5433         #59428 or test-285.cs.
5434
5435 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
5436
5437         Fixed bug #62740.
5438         * statement.cs (GetEnumeratorFilter): Removed useless
5439         logic because C# specs is strict. GetEnumerator must be
5440         public.
5441
5442 2004-08-22  Martin Baulig  <martin@ximian.com>
5443
5444         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
5445         a switch and may break, reset the barrier.  Fixes #59867.
5446
5447 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
5448
5449         CLS-Compliance speed up (~5% for corlib)
5450
5451         * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
5452         New method. Tests container for CLS-Compliant names
5453
5454         * class.cs (TypeContainer.VerifyClsName): New method.
5455         Checks whether container name is CLS Compliant.
5456         (Constructor): Implements IMethodData.
5457
5458         * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
5459         low-case table for CLS Compliance test.
5460         (MemberCache.VerifyClsParameterConflict): New method.
5461         Checks method parameters for CS3006 error.
5462
5463         * enum.cs (EnumMember): Is derived from MemberCore.
5464         (Enum.VerifyClsName): Optimized for better performance.
5465
5466 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
5467
5468         * report.cs: Renamed Error_T to Error and changed all
5469         references.
5470
5471 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
5472
5473         * class.cs (TypeContainer.IndexerArrayList): New inner class
5474         container for indexers.
5475         (TypeContainer.DefaultIndexerName): New constant for default
5476         indexer name. Replaced all "Item" with this constant.
5477         (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
5478
5479         * typemanager.cs (TypeManager.default_member_ctor): Cache here
5480         DefaultMemberAttribute constructor.
5481
5482 2004-08-05  Martin Baulig  <martin@ximian.com>
5483
5484         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
5485         Fix bug #59429.
5486
5487 2004-08-05  Marek Safar  <marek.safar@seznam.cz>
5488
5489         * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
5490         multi platforms problem.
5491
5492         * compiler.csproj: Included shared files.
5493
5494 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
5495
5496         Fix bug 60333, 55971 in the more general way
5497         * attribute.cs (Attribute.GetAttributeArgumentExpression):
5498         Added arg_type argument for constant conversion.
5499         (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
5500
5501 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
5502
5503         Fix bug #59760
5504         * class.cs (TypeContainer ): New inner classes MethodArrayList, 
5505         OperatorArrayList, MethodCoreArrayList for typecontainer
5506         containers. Changed class member types to these new types.
5507         (MethodArrayList.DefineMembers): Added test for CS0659.
5508
5509 2004-08-04  Miguel de Icaza  <miguel@ximian.com>
5510
5511         * cfold.cs: Synchronize the folding with the code in expression.cs
5512         Binary.DoNumericPromotions for uint operands.
5513
5514         * attribute.cs: Revert patch from Raja, it introduced a regression
5515         while building Blam-1.2.1 (hard to isolate a test case).
5516
5517 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
5518
5519         Fix for #55382
5520         * class.cs:
5521         (TypeContainer.Define): Renamed to DefineContainerMembers because of
5522         name collision.
5523         (MethodCore.parent_method): New member. The method we're overriding
5524         if this is an override method.
5525         (MethodCore.CheckBase): Moved from Method class and made common.
5526         (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
5527         private.
5528         (MethodCore.CheckForDuplications): New abstract method. For custom
5529         member duplication search in a container
5530         (MethodCore.FindOutParentMethod): New abstract method. Gets parent
5531         method and its return type.
5532         (Event.conflict_symbol): New member. Symbol with same name in the
5533         parent class.
5534
5535         * decl.cs:
5536         (MemberCache.FindMemberWithSameName): New method. The method
5537         is looking for conflict with inherited symbols.
5538
5539 2004-08-04  Martin Baulig  <martin@ximian.com>
5540
5541         * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
5542
5543         * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
5544
5545 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
5546
5547         * report.cs (Message): New enum for better error, warning reference in
5548         the code.
5549         (MessageData): New inner abstract class. It generally handles printing of
5550         error and warning messages.
5551         Removed unused Error, Warning, Message methods.
5552
5553 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
5554
5555         Fix for cs0592-8.cs test
5556         * attribute.cs
5557         (Attributable.ValidAttributeTargets): Made public.
5558         (Attribute.ExplicitTarget): New member for explicit target value.
5559         (Attribute.CheckTargets): Now we translate explicit attribute
5560         target to Target here.
5561
5562 2004-08-03  Ben Maurer  <bmaurer@ximian.com>
5563
5564         * ecore.cs (MethodGroupExpr): new IsBase property.
5565
5566         * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
5567
5568         * delegate.cs (DelegateCreation): store a MethodGroupExpr
5569         rather than an instance expr.
5570
5571         (DelegateCreation.Emit): Use the method group rather than
5572         the instance expression. Also, if you have base.Foo as the
5573         method for a delegate, make sure to emit ldftn, not ldftnvirt.
5574
5575         (ResolveMethodGroupExpr): Use the MethodGroupExpr. 
5576
5577         (NewDelegate.DoResolve): Only check for the existance of Invoke
5578         if the method is going to be needed. Use MethodGroupExpr.
5579
5580         (NewDelegate.Emit): Remove, DelegateCreation implements this.   
5581
5582         * expression.cs: For pointer arith., make sure to use
5583         the size of the type, not the size of the pointer to
5584         the type.
5585
5586 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
5587
5588         Fix for #60722
5589         * class.cs (Class): Added error CS0502 test.
5590
5591 2004-08-03  John Luke  <jluke@cfl.rr.com>
5592             Raja R Harinath  <rharinath@novell.com>
5593
5594         Fix for #60997.
5595         * attribute.cs (Attribute.complained_before): New flag.
5596         (Attribute.ResolveType, Attribute.Resolve),
5597         (Attribute.DefinePInvokeMethod): Set it.
5598         (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
5599         
5600 2004-08-03  Martin Baulig  <martin@ximian.com>
5601
5602         * expression.cs (Binary.ResolveOperator): Don't abort if we can't
5603         use a user-defined operator; we still need to do numeric
5604         promotions in case one argument is a builtin type and the other
5605         one has an implicit conversion to that type.  Fixes #62322.
5606
5607 2004-08-18  Martin Baulig  <martin@ximian.com>
5608
5609         * class.cs (Method.Define): Use the correct method name when
5610         creating the MethodBuilder for a generic method.
5611
5612 2004-08-17  Martin Baulig  <martin@ximian.com>
5613
5614         * generic.cs (Constraints): Support type parameter constraints.
5615
5616 2004-08-16  Martin Baulig  <martin@ximian.com>
5617
5618         * cs-tokenizer.cs (Tokenizer.TypeOfParsing): New public property.
5619         (Token.GENERIC_DIMENSION): New token; this is returned if we
5620         encounter an unbound generic type in a typeof() expression.
5621
5622         * cs-parser.jay (opt_type_argument_list): Added GENERIC_DIMENSION;
5623         this token is only generated while parsing a typeof() expression.
5624         (typeof_expression): Removed the old unbound_type hack.
5625
5626         * generic.cs (TypeArguments.IsUnbound): New public property.
5627
5628         * decl.cs (MemberName): Added support for unbound types.
5629
5630 2004-08-14  Martin Baulig  <martin@ximian.com>
5631
5632         * typemanager.cs
5633         (TypeManager.IsEqualGenericInstance): New static method.
5634         (TypeManager.IsSubclassOrNestedChildOf, IsSubclassOf): This is
5635         just used to check accessibility, so follow the rules of 26.1.6.        
5636
5637         * expression.cs (MemberAccess.ResolveAsTypeStep): Return a
5638         ConstructedType instead of a TypeExpression if we have type arguments.
5639
5640         * cs-parser.jay (typeof_expression): Support unbound generic types.
5641
5642         * ecore.cs (UnboundTypeExpression): New public class.
5643
5644 2004-08-12  Martin Baulig  <martin@ximian.com>
5645
5646         * typemanager.cs (TypeManager.IsNestedChildOf): Use
5647         TypeManager.IsEqual() rather than `=='.
5648
5649         * decl.cs (DeclSpace.CheckAccessLevel): Use `tb.FullName' for
5650         generic instances as well.
5651
5652 2004-08-12  Martin Baulig  <martin@ximian.com>
5653
5654         * expression.cs (Invocation.InferType): We can only infer method
5655         type parameters.  Fixes #62647.
5656
5657 2004-08-11  Martin Baulig  <martin@ximian.com>
5658
5659         * class.cs (TypeContainer.DefineType): Create the TypeBuilder
5660         before resolving the base classes.
5661
5662 2004-08-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
5663
5664         * Makefile: install .mdb file too.
5665
5666 2004-08-05  Martin Baulig  <martin@ximian.com>
5667
5668         * ecore.cs (FieldExpr.DoResolveLValue): If we're resolving a field
5669         initializer, the current type is just the TypeBuilder, not the
5670         instantiated generic type.
5671         (FieldExpr.IsFieldInitializer): New public property.
5672
5673 2004-08-04  Martin Baulig  <martin@ximian.com>
5674
5675         * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
5676
5677         * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
5678
5679 2004-08-03  Martin Baulig  <martin@ximian.com>
5680
5681         * class.cs (MethodData.Define): If we're an explicit
5682         implementation, remove the generic arity from the type name.
5683
5684 2004-08-03  Martin Baulig  <martin@ximian.com>
5685
5686         * expression.cs (Binary.ResolveOperator): Don't abort if we can't
5687         use a user-defined operator; we still need to do numeric
5688         promotions in case one argument is a builtin type and the other
5689         one has an implicit conversion to that type.  Fixes #62322.
5690
5691 2004-08-02  Martin Baulig  <martin@ximian.com>
5692
5693         * class.cs (TypeContainer.ifaces): Make this a `Type[]', not a
5694         `TypeExpr[]' array.
5695         (TypeContainer.GetClassBases): Return the unexpanded list of
5696         interfaces; we expand them later.
5697         (TypeContainer.DefineType): After creating the TypeBuilder, call
5698         TypeManager.ExpandInterfaces() to get an expanded and resolved
5699         list of interfaces.
5700
5701         * ecore.cs (TypeExpr.GetInterfaces): Removed
5702
5703         * generics.cs (Constraints.InterfaceConstraints): Remove.
5704         (TypeParameter.DefineType): Call TypeManager.RegisterBuilder() to
5705         register the interface constraints.
5706
5707         * typemanager.cs
5708         (TypeManager.AddUserType): Removed the `ifaces' argument.
5709         (TypeManager.AddTypeParameter): Likewise.
5710         (TypeManager.AddUserInterface): Removed, was unused.
5711         (TypeManager.RegisterBuilder): Take a `Type[]' instead of a
5712         `TypeExpr[]' array for the interfaces.
5713         (TypeManager.ExpandInterfaces): Call this after the TypeBuilder
5714         has been defined, returns a list of the resolved interfaces types.
5715         (TypeManager.GetInterfaces): Return a `Type[]', not a `TypeExpr[]'.
5716         (TypeManager.GetExplicitInterfaces): Likewise.  
5717
5718 2004-08-02  Martin Baulig  <martin@ximian.com>
5719
5720         * expression.cs (Invocation.EmitCall): If we're invoking a method
5721         on a type parameter, use the new `Constrained' prefix opcode.
5722
5723 2004-08-02  Martin Baulig  <martin@ximian.com>
5724
5725         * statement.cs (LocalInfo.Flags): Added `IsThis'.
5726         (LocalInfo.IsThis): New public property.
5727         (Block.EmitMeta): Don't create a LocalBuilder for `this'.
5728
5729 2004-08-01  Martin Baulig  <martin@ximian.com>
5730
5731         * class.cs (TypeContainer.GetClassBases): Don't set the default
5732         here since we may get called from GetPartialBases().
5733         (TypeContainer.DefineType): If GetClassBases() didn't return a
5734         parent, use the default one.
5735
5736 2004-07-30  Martin Baulig  <martin@ximian.com>
5737
5738         * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
5739
5740         * class.cs (SourceMethod): New public class, derive from the
5741         symbol writer's ISourceMethod.
5742         (Method): Use the new symbol writer API.
5743
5744         * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
5745         as argument and use the new symbol writer.
5746
5747         * location.cs
5748         (SourceFile): Implement the symbol writer's ISourceFile.
5749         (Location.SymbolDocument): Removed.
5750         (Location.SourceFile): New public property.
5751
5752         * symbolwriter.cs: Use the new symbol writer API.
5753
5754 2004-07-30  Raja R Harinath  <rharinath@novell.com>
5755
5756         * Makefile (install-local): Remove.  Functionality moved to
5757         executable.make.
5758
5759 2004-07-28  Lluis Sanchez Gual  <lluis@novell.com>
5760
5761         * Makefile: Install mcs.exe.config file together with mcs.exe.
5762         * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
5763         correct runtime version.
5764         
5765 2004-07-25  Martin Baulig  <martin@ximian.com>
5766
5767         * class.cs
5768         (TypeContainer.RegisterOrder): Removed, this was unused.
5769         (TypeContainer, interface_order): Removed.
5770         (TypeContainer.AddClass, AddStruct, AddInterface): Take a
5771         TypeContainer as argument since we can also be called with a
5772         `PartialContainer' for a partial class/struct/interface.
5773         (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
5774         of checking whether we're an `Interface' - we could be a
5775         `PartialContainer'.
5776         (PartialContainer.Register): Override; call
5777         AddClass()/AddStruct()/AddInterface() on our parent.
5778
5779         * cs-parser.jay (interface_member_declaration): Add things to the
5780         `current_container', not the `current_class'.
5781
5782         * rootcontext.cs (RegisterOrder): The overloaded version which
5783         takes an `Interface' was unused, removed.
5784
5785         * typemanager.cs (TypeManager.LookupInterface): Return a
5786         `TypeContainer', not an `Interface'.
5787         (TypeManager.IsInterfaceType): The `builder_to_declspace' may
5788         contain a `PartialContainer' for an interface, so check it's
5789         `Kind' to figure out what it is.
5790
5791 2004-07-25  Martin Baulig  <martin@ximian.com>
5792
5793         * class.cs (Class.DefaultTypeAttributes): New public constant.
5794         (Struct.DefaultTypeAttributes): Likewise.
5795         (Interface.DefaultTypeAttributes): Likewise.
5796         (PartialContainer.TypeAttr): Override this and add the
5797         DefaultTypeAttributes.
5798
5799 2004-07-25  Martin Baulig  <martin@ximian.com>
5800
5801         * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
5802         we can just use the `Parent' field instead.
5803
5804 2004-07-25  Martin Baulig  <martin@ximian.com>
5805
5806         * class.cs (TypeContainer.Emit): Renamed to EmitType().
5807
5808 2004-07-25  Martin Baulig  <martin@ximian.com>
5809
5810         * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
5811         our parts before defining any methods.
5812         (TypeContainer.VerifyImplements): Make this virtual.
5813         (ClassPart.VerifyImplements): Override and call VerifyImplements()
5814         on our PartialContainer.
5815
5816 2004-07-25  Martin Baulig  <martin@ximian.com>
5817
5818         * iterators.cs (Iterator.Define): Renamed to DefineIterator().
5819
5820         * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
5821         argument, we can just use the `Parent' field instead.
5822
5823         * class.cs
5824         (MemberBase.CheckBase): Removed the `TypeContainer' argument.   
5825         (MemberBase.DoDefine): Likewise.
5826
5827 2004-07-24  Martin Baulig  <martin@ximian.com>
5828
5829         * decl.cs (MemberCore.Parent): New public field.
5830         (DeclSpace.Parent): Moved to MemberCore.
5831
5832         * class.cs (MethodCore.ds): Removed; use `Parent' instead.
5833         (MemberBase.ctor): Added TypeContainer argument, pass it to our
5834         parent's .ctor.
5835         (FieldBase, Field, Operator): Likewise.
5836         (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
5837         (EventField, Event): Likewise.
5838
5839 2004-07-23  Martin Baulig  <martin@ximian.com>
5840
5841         * class.cs (PartialContainer): New public class.
5842         (ClassPart): New public class.
5843         (TypeContainer): Added support for partial classes.
5844         (TypeContainer.GetClassBases): Splitted some of the functionality
5845         out into GetNormalBases() and GetPartialBases().
5846
5847         * cs-tokenizer.cs (Token.PARTIAL): New token.
5848         (Tokenizer.consume_identifier): Added some hacks to recognize
5849         `partial', but only if it's immediately followed by `class',
5850         `struct' or `interface'.
5851
5852         * cs-parser.jay: Added support for partial clases.
5853
5854 2004-07-23  Martin Baulig  <martin@ximian.com>
5855
5856         * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
5857         a `DeclSpace' and also made it readonly.
5858         (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
5859         (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
5860         (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
5861
5862         * cs-parser.jay: Pass the `current_class', not the
5863         `current_container' (at the moment, this is still the same thing)
5864         to a new Method, Property, Event, Indexer or Constructor.
5865
5866 2004-07-23  Martin Baulig  <martin@ximian.com>
5867
5868         * cs-parser.jay (CSharpParser): Added a new `current_class' field
5869         and removed the `current_interface' one.
5870         (struct_declaration, class_declaration, interface_declaration):
5871         Set `current_class' to the newly created class/struct/interface;
5872         set their `Bases' and call Register() before parsing their body.
5873
5874 2004-07-23  Martin Baulig  <martin@ximian.com>
5875
5876         * class.cs (Kind): New public enum.
5877         (TypeContainer): Made this class abstract.
5878         (TypeContainer.Kind): New public readonly field.
5879         (TypeContainer.CheckDef): New public method; moved here from
5880         cs-parser.jay.
5881         (TypeContainer.Register): New public abstract method.
5882         (TypeContainer.GetPendingImplementations): New public abstract
5883         method.
5884         (TypeContainer.GetClassBases): Removed the `is_class' and
5885         `is_iface' parameters.
5886         (TypeContainer.DefineNestedTypes): Formerly known as
5887         DoDefineType().
5888         (ClassOrStruct): Made this class abstract.
5889
5890         * tree.cs (RootTypes): New public type. 
5891
5892 2004-07-20  Martin Baulig  <martin@ximian.com>
5893
5894         * tree.cs (Tree.RecordNamespace): Removed.
5895         (Tree.Namespaces): Removed.
5896
5897         * rootcontext.cs (RootContext.IsNamespace): Removed.
5898
5899         * cs-parser.jay (namespace_declaration): Just create a new
5900         NamespaceEntry here.
5901
5902 2004-07-21  Lluis Sanchez Gual  <lluis@novell.com>
5903
5904         * Makefile: Install gmcs.exe.config file together with gmcs.exe.
5905         * gmcs.exe.config: Renamed from mcs.exe.config. Added supportedRuntime
5906         entry to make sure it runs in the correct runtime version.
5907         
5908 2004-07-18  Martin Baulig  <martin@ximian.com>
5909
5910         * generic.cs (ConstructedType.CheckConstraints): Improved
5911         constraints checking.
5912
5913 2004-07-18  Martin Baulig  <martin@ximian.com>
5914
5915         * expression.cs (Invocation.BetterMethod): Call
5916         TypeManager.TypeToCoreType() on all types and removed my previous
5917         hack; we're already doig the right thing here.
5918
5919 2004-07-17  Martin Baulig  <martin@ximian.com>
5920
5921         * decl.cs (MemberName.MakeName): Create the "class`1" names here.
5922
5923 2004-07-16  Martin Baulig  <martin@ximian.com>
5924
5925         * iterators.cs: Added generics support.
5926
5927 2004-07-16  Martin Baulig  <martin@ximian.com>
5928
5929         * iterators.cs: Rewrote this.  We're now using one single Proxy
5930         class for both the IEnumerable and the IEnumerator interface and
5931         `Iterator' derives from Class so we can use the high-level API.
5932
5933         * class.cs (TypeContainer.AddIterator): New method.
5934         (TypeContainer.DoDefineType): New protected virtual method, which
5935         is called from DefineType().
5936         (TypeContainer.DoDefineMembers): Call DefineType() and
5937         DefineMembers() on all our iterators.
5938         (TypeContainer.Emit): Call Emit() on all our iterators.
5939         (TypeContainer.CloseType): Call CloseType() on all our iterators.
5940
5941         * codegen.cs (EmitContext.CurrentIterator): New public field.
5942
5943 2004-07-15  Martin Baulig  <martin@ximian.com>
5944
5945         * typemanager.cs
5946         (TypeManager.not_supported_exception_type): New type.   
5947
5948 2004-07-14  Martin Baulig  <martin@ximian.com>
5949
5950         * typemanager.cs
5951         (TypeManager.generic_ienumerable_type): New type.
5952         (TypeManager.generic_ienumerator_type): New type.
5953
5954         * rootcontext.cs
5955         (RootContext.interfaces_first_stage): Added
5956         "System.Collections.Generic.IEnumerator`1" and
5957         "System.Collections.Generic.IEnumerable`1".     
5958
5959 2004-07-14  Martin Baulig  <martin@ximian.com>
5960
5961         * iterators.cs: Use real error numbers.
5962
5963 2004-07-14  Martin Baulig  <martin@ximian.com>
5964
5965         * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
5966         requires this to be a System.Collection.IEnumerable and not a
5967         class implementing that interface.
5968         (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.      
5969
5970 2004-07-13  Marek Safar  <marek.safar@seznam.cz>
5971
5972         * class.cs: Fixed previous fix, it broke some error tests.
5973
5974 2004-07-12  Martin Baulig  <martin@ximian.com>
5975
5976         * enum.cs (Enum.Define): Call Emit() to emit the attributes.
5977         Fixes #61293.
5978
5979 2004-07-14  Martin Baulig  <martin@ximian.com>
5980
5981         * decl.cs, expression.cs, generic.cs: Use a backqoute (`) and not
5982         an exclamation mark (!) for the generic arity to reflect the
5983         latest spec changes; ie. use "System.Collections.Generic.IList`1".
5984
5985 2004-07-13  Martin Baulig  <martin@ximian.com>
5986
5987         * cs-tokenizer.cs (Tokenizer.parse_less_than): Allow array rank
5988         specifiers being part of a type argument.
5989
5990 2004-07-13  Martin Baulig  <martin@ximian.com>
5991
5992         * expression.cs (MemberAccess.ResolveAsTypeStep): Use the full `!'
5993         name for generic types.
5994
5995 2004-07-13  Martin Baulig  <martin@ximian.com>
5996
5997         * assign.cs (Assign.DoResolve): Moved the CS0131 check up a little
5998         bit to fix #60119.
5999
6000 2004-07-09  Miguel de Icaza  <miguel@ximian.com>
6001
6002         * assign.cs (LocalTemporary): Add new argument: is_address,If
6003         `is_address' is true, then the value that we store is the address
6004         to the real value, and not the value itself.
6005         
6006         * ecore.cs (PropertyExpr): use the new local temporary
6007         stuff to allow us to handle X.Y += z (where X is a struct)
6008
6009 2004-07-08  Martin Baulig  <martin@ximian.com>
6010
6011         * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
6012         not always return, just like we're doing in Using.Resolve().
6013
6014 2004-07-07  Miguel de Icaza  <miguel@ximian.com>
6015
6016         * cs-parser.jay (fixed_statement): flag this as Pinned.
6017
6018 2004-07-06  Miguel de Icaza  <miguel@ximian.com>
6019
6020         * typemanager.cs (TypeManager): Removed MakePinned method, this
6021         mechanism is replaced with the .NET 2.x compatible mechanism of
6022         calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
6023
6024         * statement.cs (LocalInfo): Remove MakePinned, add Pinned property 
6025         Rename `Fixed' to `Pinned' as a flag, to distinguish from the
6026         `IsFixed' property which has a different meaning.
6027
6028 2004-07-02  Raja R Harinath  <rharinath@novell.com>
6029
6030         * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
6031         visible from inside a nested class, not just the names of the
6032         immediately enclosing class.
6033         Fix for bug #60730.
6034
6035 2004-06-24  Raja R Harinath  <rharinath@novell.com>
6036
6037         * expression.cs (BetterConversion): Remove buggy special-case
6038         handling of "implicit constant expression conversions".  At this
6039         point, we already know that the conversion is possible -- we're
6040         only checking to see which is better.
6041
6042 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
6043
6044         * cs-parser.jay: Added error CS0210 test.
6045
6046 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
6047
6048         * cs-parser.jay: Added error CS0134 test.
6049
6050 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
6051
6052         Fix bug #52507
6053         * cs-parser.jay: Added error CS0145 test.
6054
6055 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
6056
6057         * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
6058
6059 2004-06-23  Ben Maurer  <bmaurer@ximian.com>
6060         
6061         * expression.cs (StackAlloc.Resolve): The argument may not
6062         be a constant; deal with this case.
6063         
6064 2004-06-23  Marek Safar  <marek.safar@seznam.cz>
6065
6066         * attribute.cs (IndexerName_GetIndexerName): Renamed to
6067         GetIndexerAttributeValue.
6068         (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
6069
6070         * class.cs (Indexer.Define): Added error tests for CS0415,
6071         CS0609.
6072
6073 2004-06-23  Miguel de Icaza  <miguel@ximian.com>
6074
6075         * attribute.cs (Attribute.Resolve): Keep field code in sync with
6076         property code.
6077
6078 2004-06-23  Martin Baulig  <martin@ximian.com>
6079
6080         * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
6081         neither return nor throw, reset the barrier as well.  Fixes #60457.
6082
6083 2004-06-22  Atsushi Enomoto  <atsushi@ximian.com>
6084
6085         * class.cs : EventAttributes is now set to None by default.
6086           This fixes bug #60459.
6087
6088 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
6089
6090         Fix bug #60219
6091         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
6092         Don't throw exception but return null (it's sufficient now).
6093
6094 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
6095
6096         * typemanager.cs (GetArgumentTypes): Faster implementation.
6097
6098 2004-06-18  Martin Baulig  <martin@ximian.com>
6099
6100         * attribute.cs (Attribute.Resolve): Check whether we're an
6101         EmptyCast which a Constant child.  Fixes #60333.
6102
6103 2004-06-17  Ben Maurer  <bmaurer@ximian.com>
6104
6105         * statement.cs (EmitCollectionForeach): Account for the fact that
6106         not all valuetypes are in areas which we can take the address of.
6107         For these variables, we store to a temporary variable. Also, make
6108         sure that we dont emit a `callvirt' on a valuetype method.
6109
6110 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
6111
6112         * expression.cs (StackAlloc.DoReSolve): Added test for
6113         negative parameter (CS0247).
6114
6115 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
6116
6117         Fix bug #59792
6118         * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
6119
6120 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
6121
6122         Fix bug #59781
6123         * expression.cs: (Binary.DoNumericPromotions): Added conversion for
6124         ulong.
6125
6126 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
6127
6128         Fix bug #58254 & cs1555.cs, cs1556.cs
6129         * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
6130
6131 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
6132
6133         * cs-parser.jay: Added error CS1669 test for indexers.
6134
6135 2004-06-18  Martin Baulig  <martin@ximian.com>
6136
6137         * generics.cs (GenericMethod.ctor): Don't take an Attributes
6138         argument.  Fixes #60441.
6139
6140 2004-06-16  Ben Maurer  <bmaurer@ximian.com>
6141         * ecore.cs (MethodGroupExpr.Name): Revert Martin's patch.
6142         The name needs to have the actual name of the method in order
6143         for other tests (such as the one in OverloadResolve for Invoke
6144         on a delegate) to work. As well, it does not really help
6145         error reporting because the method group had multiple methods.
6146         * Makefile: Remove MCS_DEBUG, you can enable with the DEBUG_FLAGS.
6147         Make profiling work.
6148         
6149 2004-06-13  Martin Baulig  <martin@ximian.com>
6150
6151         * cs-parser.jay: Don't allow generic attributes.
6152
6153 2004-06-13  Martin Baulig  <martin@ximian.com>
6154
6155         * class.cs (MemberBase.DoDefineBase): New protected method.
6156         (MemberBase.DoDefine): Compute the `flags' in the new
6157         DoDefineBase() which must be called first.
6158         (Method.Define): Call DoDefineBase() first so we have the flags
6159         when defining the generic method.
6160
6161         * cs-parser.jay (interface_method_declaration): Support generic methods.
6162
6163 2004-06-13  Martin Baulig  <martin@ximian.com>
6164
6165         * decl.cs (TypeName): Removed.
6166         (MemberName): Removed TypeName and MemberNow; now we just have
6167         MemberName.
6168
6169         * cs-parser.jay: Don't distinguish between type arguments and type
6170         parameters in the grammar and simplified the rules a bit.  The
6171         reduce/reduce conflicts are now gone (except the one we inherited
6172         from mcs).
6173
6174 2004-06-11  Martin Baulig  <martin@ximian.com>
6175
6176         * expression.cs (Invocation.IsParamsMethodApplicable): We need to
6177         call this twice: for params and varargs methods.
6178
6179 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
6180
6181         * class.cs:
6182         (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
6183
6184 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
6185
6186         * attribute.cs (Attribute.GetValidTargets): Made public.
6187
6188         * class.cs: 
6189         (AbstractPropertyEventMethod): New class for better code sharing.
6190         (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
6191         CS1667 report.
6192         (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
6193
6194 2004-06-09  Martin Baulig  <martin@ximian.com>
6195
6196         * cs-parser.jay: Removed a reduce/reduce conflict.
6197
6198 2004-06-03  Martin Baulig  <martin@ximian.com>
6199
6200         * generic.cs (ConstructedType.GetMemberAccess): Renamed to
6201         GetSimpleName() and return a SimpleName.
6202
6203         * ecore.cs (SimpleName.Arguments): New public field.
6204         (SimpleName): Added overloaded ctor which takes an additional
6205         TypeArguments argument.
6206         (SimpleName.SimpleNameResolve): Added support for generic methods.
6207         (MethodGroupExpr.ResolveGeneric): New public method.  The code was
6208         formerly in MemberAccess.DoResolve(), but we also need it in
6209         SimpleNameResolve().
6210
6211         * expression.cs (MemberAccess.DoResolve): Use the new
6212         MethodGroupExpr.ResolveGeneric().       
6213
6214 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
6215
6216         * decl.cs: If possible, use lookuptypedirect here. We can only do
6217         this if there is no `.' after the namespace. Avoids using
6218         LookupType, which does lots of slow processing.
6219         (FindNestedType) New method, does what it says :-).
6220         * namespace.cs: use LookupTypeDirect.
6221         * rootcontext.cs: use membercache, if possible.
6222         * typemanager.cs (LookupTypeDirect): Cache negative hits too.
6223
6224 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
6225
6226         * expression.cs:
6227         According to the spec, 
6228
6229         In a member access of the form E.I, if E is a single identifier,
6230         and if the meaning of E as a simple-name (§7.5.2) is a constant,
6231         field, property, localvariable, or parameter with the same type as
6232         the meaning of E as a type-name (§3.8), then both possible
6233         meanings of E are permitted.
6234
6235         We did not check that E as a simple-name had the same type as E as
6236         a type name.
6237
6238         This trivial check gives us 5-7% on bootstrap time.
6239
6240 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
6241
6242         * expression.cs (Invocation.OverloadResolve): Avoid the
6243         use of hashtables and boxing here by allocating on demand.
6244
6245 2004-05-30  Martin Baulig  <martin@ximian.com>
6246
6247         * rootcontext.cs (RootContext.LookupType): Don't cache things if
6248         we're doing a silent lookup.  Don't try to lookup nested types in
6249         TypeManager.object_type (thanks to Ben Maurer).
6250
6251 2004-05-30  Martin Baulig  <martin@ximian.com>
6252
6253         Committing a patch from Ben Maurer.
6254
6255         * rootcontext.cs (RootContext.LookupType): Cache negative results.
6256
6257 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
6258
6259         * convert.cs: add a trivial cache for overload operator resolution.
6260
6261 2004-05-31  Marek Safar  <marek.safar@seznam.cz>
6262
6263         * attribute.cs
6264         (AttributeTester.GetObsoleteAttribute): Returns instance of
6265         ObsoleteAttribute when type is obsolete.
6266
6267         * class.cs
6268         (TypeContainer.VerifyObsoleteAttribute): Override.
6269         (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
6270         (MethodCode.VerifyObsoleteAttribute): Override.
6271         (MemberBase.VerifyObsoleteAttribute): Override.
6272
6273         * decl.cs
6274         (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
6275         and report proper error.
6276
6277         *delegate.cs
6278         (Delegate.VerifyObsoleteAttribute): Override.
6279
6280         * ecore.cs
6281         (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
6282         and report proper error.
6283         (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
6284
6285         * enum.cs
6286         (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
6287         and enum member.
6288
6289         * expression.cs
6290         (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
6291         New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
6292         Added test for ObsoleteAttribute.
6293
6294         * statement.cs
6295         (Catch): Derived from Statement.
6296
6297 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
6298
6299         * decl.cs: If possible, use lookuptypedirect here. We can only do
6300         this if there is no `.' after the namespace. Avoids using
6301         LookupType, which does lots of slow processing.
6302         (FindNestedType) New method, does what it says :-).
6303         * namespace.cs: use LookupTypeDirect.
6304         * rootcontext.cs: use membercache, if possible.
6305         * typemanager.cs (LookupTypeDirect): Cache negative hits too.
6306
6307 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
6308
6309         * expression.cs:
6310         According to the spec, 
6311
6312         In a member access of the form E.I, if E is a single identifier,
6313         and if the meaning of E as a simple-name (§7.5.2) is a constant,
6314         field, property, localvariable, or parameter with the same type as
6315         the meaning of E as a type-name (§3.8), then both possible
6316         meanings of E are permitted.
6317
6318         We did not check that E as a simple-name had the same type as E as
6319         a type name.
6320
6321         This trivial check gives us 5-7% on bootstrap time.
6322
6323 2004-05-30  Marek Safar  <marek.safar@seznam.cz>
6324
6325         Fixed bug #59071 & cs0160.cs
6326         * statement.cs (Try.Resolve): Check here whether order of catch
6327         clauses matches their dependencies.
6328
6329 2004-05-30  Marek Safar  <marek.safar@seznam.cz>
6330
6331         Fixed bug #58624
6332         * ecore.cs (SimpleName.SimpleNameResolve): Added test for
6333         unsafe type.
6334
6335 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
6336
6337         * expression.cs (Invocation.OverloadResolve): Avoid the
6338         use of hashtables and boxing here by allocating on demand.
6339
6340 2004-05-30  Martin Baulig  <martin@ximian.com>
6341
6342         * rootcontext.cs (RootContext.LookupType): Don't cache things if
6343         we're doing a silent lookup.  Don't try to lookup nested types in
6344         TypeManager.object_type (thanks to Ben Maurer).
6345
6346 2004-05-30  Martin Baulig  <martin@ximian.com>
6347
6348         Committing a patch from Ben Maurer.
6349
6350         * rootcontext.cs (RootContext.LookupType): Cache negative results.      
6351
6352 2004-05-29  Martin Baulig  <martin@ximian.com>
6353
6354         * class.cs (IMethodData.ShouldIgnore): New method.
6355
6356         * typemanager.cs (TypeManager.MethodFlags): Don't take a
6357         `Location' argument, we don't need it anywhere.  Use
6358         `IMethodData.ShouldIgnore ()' instead of
6359         `MethodData.GetMethodFlags ()'.
6360         (TypeManager.AddMethod): Removed.
6361         (TypeManager.AddMethod2): Renamed to AddMethod.
6362
6363 2004-05-29  Martin Baulig  <martin@ximian.com>
6364
6365         Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
6366
6367         * convert.cs (Convert.ImplicitReferenceConversion): If we're
6368         converting from a class type S to an interface type and we already
6369         have an object on the stack, don't box it again.  Fixes #52578.
6370
6371 2004-05-29  Martin Baulig  <martin@ximian.com>
6372
6373         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
6374         Added support for `params' parameters.  Fixes #59267.
6375
6376 2004-05-29  Martin Baulig  <martin@ximian.com>
6377
6378         * literal.cs (NullPointer): Provide a private .ctor which sets
6379         `type' to TypeManager.object_type.  Fixes #59048.
6380
6381 2004-05-29  Martin Baulig  <martin@ximian.com>
6382
6383         * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
6384         EventExpr, set `ee.InstanceExpression = left'.  Fixes #59188.
6385
6386         * ecore.cs (EventExpr.instance_expr): Make the field private.
6387
6388 2004-05-26  Marek Safar  <marek.safar@seznam.cz>
6389
6390         Fixed bug #50080 & cs0214-2.cs
6391         * expression.cs (Cast.DoResolve): Check unsafe context here.
6392         
6393         * statement.cs (Resolve.DoResolve): Likewise.
6394
6395 2004-05-26  Martin Baulig  <martin@ximian.com>
6396
6397         * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
6398
6399         * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
6400         (RootContext.LookupType): Pass down the `silent' flag.
6401
6402 2004-05-25  Martin Baulig  <martin@ximian.com>
6403
6404         * expression.cs
6405         (MethodGroupExpr.IdenticalTypeName): New public property.
6406         (Invocation.DoResolve): Don't report a CS0176 if the "instance"
6407         expression actually refers to a type.
6408
6409 2004-05-25  Martin Baulig  <martin@ximian.com>
6410
6411         * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
6412         for #56176 and made it actually work.
6413
6414 2004-05-25  Martin Baulig  <martin@ximian.com>
6415
6416         * ecore.cs (Expression.CacheTemporaries): Make this virtual.
6417         (FieldExpr, PropertyExpr): Override and implement
6418         CacheTemporaries.  Fixes #52279.
6419
6420 2004-05-25  Miguel de Icaza  <miguel@ximian.com>
6421
6422         * location.cs: In the new compiler listing a file twice is a
6423         warning, not an error.
6424
6425 2004-05-24  Martin Baulig  <martin@ximian.com>
6426
6427         * enum.cs (Enum.DefineType): For the `BaseType' to be a
6428         TypeLookupExpression; otherwise, report a CS1008.  Fixes #58571.
6429
6430 2004-05-24  Martin Baulig  <martin@ximian.com>
6431
6432         * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
6433         walking the `using' list.  Fixes #53921.
6434
6435 2004-05-24  Martin Baulig  <martin@ximian.com>
6436
6437         * const.cs (Const.LookupConstantValue): Added support for
6438         EmptyCast's; fixes #55251.
6439
6440 2004-05-24  Martin Baulig  <martin@ximian.com>
6441
6442         * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
6443         DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
6444         which does the CS0135 check.  The reason is that we first need to
6445         check whether the variable actually exists.
6446
6447 2004-05-24  Martin Baulig  <martin@ximian.com>
6448
6449         * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
6450         than RootContext.LookupType() to find the explicit interface
6451         type.  Fixes #58584.
6452
6453 2004-05-24  Raja R Harinath  <rharinath@novell.com>
6454
6455         * Makefile: Simplify.  Use executable.make.
6456         * mcs.exe.sources: New file.  List of sources of mcs.exe.
6457
6458 2004-05-24  Anders Carlsson  <andersca@gnome.org>
6459
6460         * decl.cs:
6461         * enum.cs:
6462         Use the invariant culture when doing String.Compare for CLS case
6463         sensitivity.
6464         
6465 2004-05-23  Martin Baulig  <martin@ximian.com>
6466
6467         * decl.cs (DeclSpace.FindType): Only check the `using' list if we
6468         don't have any dots.  Fixes #52622, added cs0246-8.cs.
6469
6470         * namespace.cs (NamespaceEntry.Lookup): Likewise.
6471
6472 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
6473
6474         * class.cs (MemberBase.Define): Reuse MemberType member for 
6475         resolved type. Other methods can use it too.
6476
6477 2004-05-23  Martin Baulig  <martin@ximian.com>
6478
6479         * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
6480         the variable also exists in the current block (otherwise, we need
6481         to report a CS0103).  Fixes #58670.
6482
6483 2004-05-23  Martin Baulig  <martin@ximian.com>
6484
6485         * flowanalysis.cs (Reachability.Reachable): Compute this
6486         on-the-fly rather than storing it as a field.
6487
6488 2004-05-23  Martin Baulig  <martin@ximian.com>
6489
6490         * flowanalysis.cs (Reachability.And): Manually compute the
6491         resulting `barrier' from the reachability.      
6492        
6493 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
6494
6495         Fix bug #57835
6496         * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
6497         instance of ObsoleteAttribute when symbol is obsolete.
6498
6499         * class.cs
6500         (IMethodData): Extended interface for ObsoleteAttribute support.
6501
6502 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
6503
6504         * attribute.cs: Fix bug #55970
6505
6506 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
6507
6508         Fix bug #52705
6509         * attribute.cs
6510         (GetObsoleteAttribute): New method. Creates the instance of
6511         ObsoleteAttribute.
6512         (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
6513         ObsoleteAttribute when member is obsolete.
6514         (AttributeTester.Report_ObsoleteMessage): Common method for
6515         Obsolete error/warning reporting.
6516
6517         * class.cs
6518         (TypeContainer.base_classs_type): New member for storing parent type.
6519
6520         * decl.cs
6521         (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
6522         for this MemberCore.
6523
6524 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
6525
6526         * attribute.cs, const.cs: Fix bug #58590
6527
6528 2004-05-21  Martin Baulig  <martin@ximian.com>
6529
6530         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
6531         out parameters if the end of the method is unreachable.  Fixes
6532         #58098. 
6533
6534 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
6535
6536         * codegen.cs, cs-parser.jay: Removed SetAttributes method.
6537         Hari was right, why extra method.
6538
6539 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
6540
6541         * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
6542
6543 2004-05-20  Martin Baulig  <martin@ximian.com>
6544
6545         * delegate.cs: Convert this file to Unix mode - like the original
6546         version in mcs is.
6547
6548 2004-05-20  Martin Baulig  <martin@ximian.com>
6549
6550         * attribute.cs: Convert this file to Unix mode - like the original
6551         version in mcs is.
6552
6553 2004-05-19  Marek Safar  <marek.safar@seznam.cz>
6554
6555        Fix bug #58688 (MCS does not report error when the same attribute
6556        is assigned twice)
6557
6558        * attribute.cs (Attribute.Emit): Distinction between null and default.
6559
6560 2004-05-19  Raja R Harinath  <rharinath@novell.com>
6561
6562        * cs-parser.jay (attribute): Create a GlobalAttribute for the case
6563        of a top-level attribute without an attribute target.
6564        * attribute.cs (Attribute.Error_AttributeConstructorMismatch): 
6565        Make non-static.
6566        (Attribute.Conditional_GetConditionName), 
6567        (Attribute.Obsolete_GetObsoleteMessage): Update.
6568        (Attribute.IndexerName_GetIndexerName): New.  Attribute-specific
6569        part of ScanForIndexerName.
6570        (Attribute.CanIgnoreInvalidAttribute): New function.
6571        (Attribute.ScanForIndexerName): Move to ...
6572        (Attributes.ScanForIndexerName): ... here.
6573        (Attributes.Attrs): Rename from now-misnamed AttributeSections.
6574        (Attributes.Search): New internal variant that can choose not to
6575        complain if types aren't resolved.  The original signature now
6576        complains.
6577        (Attributes.GetClsCompliantAttribute): Use internal variant, with
6578        complaints suppressed.
6579        (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
6580        only if it not useful.
6581        (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
6582        top-level for attributes that are shared between the assembly
6583        and a top-level class.
6584        * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
6585        * class.cs: Update to reflect changes.
6586        (DefineIndexers): Fuse loops.
6587        * codegen.cs (GetAssemblyName): Update to reflect changes.  Accept
6588        a couple more variants of attribute names.
6589
6590 2004-05-18  Marek Safar  <marek.safar@seznam.cz>
6591
6592         Fix bug #52585 (Implemented explicit attribute declaration)
6593
6594         * attribute.cs:
6595         (Attributable.ValidAttributeTargets): New abstract method. It gets
6596         list of valid attribute targets for explicit target declaration.
6597         (Attribute.Target): It holds target itself.
6598         (AttributeSection): Removed.
6599         (Attribute.CheckTargets): New method. It checks whether attribute
6600         target is valid for the current element.
6601
6602         * class.cs:
6603         (EventProperty): New class. For events that are declared like
6604         property (with add and remove accessors).
6605         (EventField): New class. For events that are declared like field.
6606         class.cs
6607
6608         * cs-parser.jay: Implemented explicit attribute target declaration.
6609
6610         * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:        
6611         Override ValidAttributeTargets.
6612
6613         * parameter.cs:
6614         (ReturnParameter): Class for applying custom attributes on 
6615         the return type.
6616         (ParameterAtribute): New class. Class for applying custom
6617         attributes on the parameter type.
6618
6619 2004-05-17  Miguel de Icaza  <miguel@ximian.com>
6620
6621         * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
6622         definitions. 
6623
6624         (Method): Allow UNSAFE here.
6625
6626         * modifiers.cs: Support unsafe reporting.
6627
6628 2004-05-17  Marek Safar  <marek.safar@seznam.cz>
6629
6630         * decl.cs: Fix bug #58478.
6631
6632 2004-05-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
6633
6634         * statement.cs: When checking for unreachable code on an EmptyStatement,
6635         set the location. Fixes bug #58488.
6636
6637 2004-05-13  Miguel de Icaza  <miguel@ximian.com>
6638
6639         * driver.cs: Add -pkg handling.
6640
6641         From Gonzalo: UseShelLExecute=false
6642
6643 2004-05-12  Marek Safar  <marek.safar@seznam.cz>
6644
6645         * attribute.cs:
6646         (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
6647         for attribute.
6648         (Attribute.IsClsCompliaceRequired): Moved to base for better
6649         accesibility.
6650         (Attribute.UsageAttribute): New property for AttributeUsageAttribute
6651         when attribute is AttributeUsageAttribute.
6652         (Attribute.GetValidTargets): Simplified.
6653         (Attribute.GetAttributeUsage): New method returns AttributeUsage
6654         attribute for this type.
6655         (Attribute.ApplyAttributes): Method renamed to Emit and make
6656         non-static.
6657         (GlobalAttributeSection): New class for special handling of global
6658         attributes (assembly, module).
6659         (AttributeSection.Emit): New method.
6660
6661         * class.cs: Implemented Attributable abstract methods.
6662         (MethodCore.LabelParameters): Moved to Parameter class.
6663         (Accessor): Is back simple class.
6664         (PropertyMethod): Implemented Attributable abstract class.
6665         (DelegateMethod): Implemented Attributable abstract class.
6666         (Event): New constructor for disctintion between normal Event
6667         and Event with accessors.
6668
6669         * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
6670
6671         * codegen.cs, const.cs, decl.cs, delegate.cs:
6672         (CommonAssemblyModulClass): Implemented Attributable abstract class
6673         and simplified.
6674
6675         * enum.cs: Implement IAttributeSupport interface.
6676         (EnumMember): New class for emum members. Implemented Attributable
6677         abstract class
6678
6679         * parameter.cs:
6680         (ParameterBase): Is abstract.
6681         (ReturnParameter): New class for easier [return:] attribute handling.
6682
6683         * typemanager.cs: Removed builder_to_attr.
6684
6685 2004-05-11  Raja R Harinath  <rharinath@novell.com>
6686
6687         Fix bug #57151.
6688         * attribute.cs (Attribute.GetPositionalValue): New function.
6689         * class.cs (TypeContainer.VerifyMembers): New function.
6690         (TypeContainer.Emit): Use it.
6691         (ClassOrStruct): New base class for Class and Struct.
6692         (ClassOrStruct.ApplyAttributeBuilder): New function.  Note if 
6693         StructLayout(LayoutKind.Explicit) was ascribed to the struct or
6694         class.
6695         (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
6696         then each non-static field should have a FieldOffset attribute.
6697         Otherwise, none of the fields should have a FieldOffset attribute.
6698         * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout 
6699         and FieldOffset attributes.
6700         * typemanager.cs (TypeManager.struct_layout_attribute_type)
6701         (TypeManager.field_offset_attribute_type): New core types.
6702         (TypeManager.InitCoreTypes): Initialize them.
6703
6704 2004-05-11  Michal Moskal  <malekith@pld-linux.org>
6705
6706         * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
6707         Return correct type.
6708         From bug #58270.
6709
6710 2004-05-09  Miguel de Icaza  <miguel@ximian.com>
6711
6712         * expression.cs (Binary.DoNumericPromotions): 0 long constant can
6713         be implicitly converted to ulong.
6714         
6715         * expression.cs: The logic for allowing operator &, | and ^ worked
6716         was wrong, it worked before because we did not report an error in
6717         an else branch.  Fixes 57895.
6718
6719         * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
6720         allow volatile fields to be reference types.
6721
6722 2004-05-07  Miguel de Icaza  <miguel@ximian.com>
6723
6724         * driver.cs: Add support for /debug-
6725
6726 2004-05-07  Raja R Harinath  <rharinath@novell.com>
6727
6728         * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType): 
6729         Add a 'complain' parameter to silence errors.
6730         (Attribute.Resolve): Update to changes.  Put in sanity check to catch
6731         silently overlooked type-resolutions.
6732         (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
6733         to reflect changes.
6734         (Attributes.Search): New function.
6735         (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
6736         (Attributes.GetAttributeFullName): Remove hack.
6737         * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes): 
6738         Update to reflect changes.
6739         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
6740         Use Attributes.Search instead of nested loops.
6741
6742 2004-05-07  Marek Safar  <marek.safar@seznam.cz>
6743
6744         * decl.cs:
6745         (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
6746         (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
6747         (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
6748
6749         * report.cs: (Report.Warning): Renamed to Warning_T because of
6750         parameter collision.
6751
6752 2004-05-05  Raja R Harinath  <rharinath@novell.com>
6753
6754         * expression.cs (MemberAccess.ResolveMemberAccess):
6755         Exit with non-zero status after Report.Error.
6756         * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
6757         Likewise.
6758         * typemanager.cs (TypeManager.CoreLookupType): Likewise.
6759
6760 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
6761
6762         * support.cs: Don't hang when the file is empty.
6763
6764 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
6765
6766         * support.cs: In SeekableStreamReader, compute the preamble size of the
6767           underlying stream. Position changes should take into account that initial
6768           count of bytes.
6769
6770 2004-05-03  Todd Berman  <tberman@sevenl.net>
6771
6772         * driver.cs: remove unused GetSysVersion function.
6773
6774 2004-05-03  Todd Berman  <tberman@sevenl.net>
6775
6776         * driver.cs: Remove the hack from saturday, as well as the hack
6777         from jackson (LoadAssemblyFromGac), also adds the CWD to the
6778         link_paths to get that bit proper.
6779
6780 2004-05-01  Todd Berman  <tberman@sevenl.net>
6781
6782         * driver.cs: Try a LoadFrom before a Load, this checks the current
6783         path. This is currently a bug in mono that is be fixed, however, this
6784         provides a workaround for now. This will be removed when the bug
6785         is fixed.
6786
6787 2004-05-01  Sebastien Pouliot  <sebastien@ximian.com>
6788
6789         * CryptoConvert.cs: Updated to latest version. Fix issue with 
6790         incomplete key pairs (#57941).
6791
6792 2004-05-01  Todd Berman  <tberman@sevenl.net>
6793
6794         * driver.cs: Remove '.' from path_chars, now System.* loads properly
6795         from the GAC
6796
6797 2004-04-30  Jackson Harper  <jackson@ximian.com>
6798
6799         * codegen.cs: Open keys readonly.
6800         
6801 2004-04-30  Gonzalo Paniagua Javier <gonzalo@ximian.com>
6802
6803         * typemanager.cs: don't report cyclic struct layout when a struct
6804         contains 2 or more fields of the same type. Failed for Pango.AttrShape
6805         which has 2 Pango.Rectangle fields.
6806
6807 2004-04-29 Ben Maurer  <bmaurer@users.sourceforge.net>
6808
6809         * expression.cs: Handle IntPtr comparisons with IL code
6810         rather than a method call.
6811
6812 2004-04-29  Martin Baulig  <martin@ximian.com>
6813
6814         * ecore.cs (PropertyExpr.FindAccessor): New private method.  Walk
6815         the list of PropertyInfo's in class hierarchy and find the
6816         accessor.  Fixes #56013.
6817
6818 2004-04-29  Martin Baulig  <martin@ximian.com>
6819
6820         * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
6821
6822 2004-04-29  Martin Baulig  <martin@ximian.com>
6823
6824         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
6825
6826         * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
6827
6828 2004-04-29  Martin Baulig  <martin@ximian.com>
6829
6830         * class.cs (ConstructorInitializer.Resolve): Check whether the
6831         parent .ctor is accessible.  Fixes #52146.
6832
6833 2004-04-29  Martin Baulig  <martin@ximian.com>
6834
6835         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
6836
6837         * statement.cs (Using.EmitLocalVariableDecls): Use
6838         TypeManager.idisposable_type, not typeof (IDisposable).
6839         (Foreach.EmitCollectionForeach): Added support for valuetypes.
6840
6841 2004-04-29  Martin Baulig  <martin@ximian.com>
6842
6843         * class.cs (Event.Define): Don't emit the field and don't set
6844         RTSpecialName and SpecialName for events on interfaces.  Fixes
6845         #57703. 
6846
6847 2004-04-29  Raja R Harinath  <rharinath@novell.com>
6848
6849         Refactor Attribute.ApplyAttributes.
6850         * attribute.cs (Attributable): New base class for objects that can
6851         have Attributes applied on them.
6852         (Attribute): Make AttributeUsage fields public.
6853         (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
6854         (Attribute.IsInternalCall): New property.
6855         (Attribute.UsageAttr): Convert to a public read-only property.
6856         (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
6857         (Attribute.ResolveType, Attribute.Resolve)
6858         (Attribute.ScanForIndexerName): Update to reflect changes.
6859         (Attribute.CheckAttributeTarget): Re-format.
6860         (Attribute.ApplyAttributes): Refactor, to various
6861         Attributable.ApplyAttributeBuilder methods.
6862         * decl.cs (MemberCore): Make Attributable.
6863         * class.cs (Accessor): Make Attributable.
6864         (MethodData.ApplyAttributes): Use proper attribute types, not
6865         attribute names.
6866         (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
6867         (TypeContainer.ApplyAttributeBuilder)
6868         (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
6869         (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)   
6870         (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
6871         (Operator.ApplyAttributeBuilder): New factored-out methods.
6872         * const.cs (Const.ApplyAttributeBuilder): Likewise.
6873         * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
6874         * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
6875         * parameter.cs (ParameterBase): New Attributable base class
6876         that can also represent Return types.
6877         (Parameter): Update to the changes.
6878
6879 2004-04-29  Jackson Harper  <jackson@ximian.com>
6880
6881         * driver.cs: Prefer the corlib system version when looking for
6882         assemblies in the GAC. This is still a hack, but its a better hack
6883         now.
6884         
6885 2004-04-29  Marek Safar  <marek.safar@seznam.cz>
6886
6887         * decl.cs, enum.cs: Improved error 3005 reporting.
6888   
6889         * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
6890         (related_symbols): New private member for list of symbols
6891         related to reported error/warning.
6892         
6893         * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
6894
6895 2004-04-29  Martin Baulig  <martin@ximian.com>
6896
6897         * ecore.cs (Expression.Constantify): If we're an enum and
6898         TypeManager.TypeToCoreType() doesn't give us another type, use
6899         t.UnderlyingSystemType.  Fixes #56178.  
6900
6901 2004-04-29  Martin Baulig  <martin@ximian.com>
6902
6903         * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
6904         interfaces and for each interface, only add members directly
6905         declared in that interface.  Fixes #53255.
6906
6907 2004-04-28  Martin Baulig  <martin@ximian.com>
6908
6909         * expression.cs (ConditionalLogicalOperator): Use a temporary
6910         variable for `left' to avoid that we evaluate it more than once;
6911         bug #52588.
6912
6913 2004-04-28  Martin Baulig  <martin@ximian.com>
6914
6915         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
6916         `void[]' (CS1547).
6917
6918 2004-04-28  Martin Baulig  <martin@ximian.com>
6919
6920         * statement.cs (LocalInfo.Resolve): Check whether the type is not
6921         void (CS1547).
6922
6923         * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
6924         whether the type is not void (CS1547).
6925
6926 2004-04-28  Martin Baulig  <martin@ximian.com>
6927
6928         * expression.cs (Unary.DoResolveLValue): Override this and report
6929         CS0131 for anything but Operator.Indirection.
6930
6931 2004-04-28  Martin Baulig  <martin@ximian.com>
6932
6933         Committing a patch from Ben Maurer; see bug #50820.
6934
6935         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
6936         check for classes.
6937
6938         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
6939         classes.        
6940
6941 2004-04-28  Martin Baulig  <martin@ximian.com>
6942
6943         Committing a patch from Ben Maurer; see bug #50820.
6944
6945         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
6946         check for classes.
6947
6948         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
6949         classes.        
6950
6951 2004-04-28  Martin Baulig  <martin@ximian.com>
6952
6953         * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
6954         (Block.AddLabel): Call DoLookupLabel() to only search in the
6955         current block.
6956
6957 2004-04-28  Martin Baulig  <martin@ximian.com>
6958
6959         * cfold.cs (ConstantFold.BinaryFold): Added special support for
6960         comparing StringConstants and NullLiterals in Equality and Inequality.
6961
6962 2004-04-28  Jackson Harper  <jackson@ximian.com>
6963
6964         * driver.cs: Attempt to load referenced assemblies from the
6965         GAC. This is the quick and dirty version of this method that
6966         doesnt take into account versions and just takes the first
6967         canidate found. Will be good enough for now as we will not have more
6968         then one version installed into the GAC until I update this method.
6969
6970 2004-04-28  Martin Baulig  <martin@ximian.com>
6971
6972         * typemanager.cs (TypeManager.CheckStructCycles): New public
6973         static method to check for cycles in the struct layout.
6974
6975         * rootcontext.cs (RootContext.PopulateTypes): Call
6976         TypeManager.CheckStructCycles() for each TypeContainer.
6977         [Note: We only need to visit each type once.]
6978
6979 2004-04-28  Martin Baulig  <martin@ximian.com>
6980
6981         * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
6982
6983         * const.cs (Const.LookupConstantValue): Return a `bool' signalling
6984         success and added `out object value'.  Use a `bool resolved' field
6985         to check whether we've already been called rather than
6986         `ConstantValue != null' since this breaks for NullLiterals.
6987
6988 2004-04-28  Raja R Harinath  <rharinath@novell.com>
6989
6990         * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
6991         setting of this flag, since the 'set' method may be non-public.
6992
6993 2004-04-28  Raja R Harinath  <rharinath@novell.com>
6994
6995         * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
6996         check on current_vector.Block.
6997
6998 2004-04-27  Martin Baulig  <martin@ximian.com>
6999
7000         * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
7001         a field initializer.  Fixes #56459.
7002
7003 2004-04-27  Martin Baulig  <martin@ximian.com>
7004
7005         * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
7006         we're not attempting to use an indexer.  Fixes #52154.
7007
7008 2004-04-27  Martin Baulig  <martin@ximian.com>
7009
7010         * statement.cs (Return): Don't create a return label if we don't
7011         need it; reverts my change from January 20th.  Thanks to Ben
7012         Maurer for this.
7013
7014 2004-04-27  Martin Baulig  <martin@ximian.com>
7015
7016         According to the spec, `goto' can only leave a nested scope, but
7017         never enter it.
7018
7019         * statement.cs (Block.LookupLabel): Only lookup in the current
7020         block, don't recurse into parent or child blocks.
7021         (Block.AddLabel): Check in parent and child blocks, report
7022         CS0140/CS0158 if we find a duplicate.
7023         (Block): Removed this indexer for label lookups.
7024         (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
7025         this already does the error reporting for us.
7026
7027         * flowanalysis.cs
7028         (FlowBranching.UsageVector.Block): New public variable; may be null.
7029         (FlowBranching.CreateSibling): Added `Block' argument.
7030         (FlowBranching.LookupLabel): New public virtual method.  Lookup a
7031         label for the target of a `goto' and check whether we're not
7032         leaving a `finally'.
7033
7034 2004-04-27  Martin Baulig  <martin@ximian.com>
7035
7036         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
7037         a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
7038         just for returns).
7039
7040 2004-04-27  Martin Baulig  <martin@ximian.com>
7041
7042         * statement.cs (Block.AddLabel): Also check for implicit blocks
7043         and added a CS0158 check.
7044
7045 2004-04-27  Martin Baulig  <martin@ximian.com>
7046
7047         * flowanalysis.cs (FlowBranchingLoop): New class.
7048         (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
7049         UsageVector's instead of an ArrayList.
7050         (FlowBranching.Label): Likewise.
7051         (FlowBranching.UsageVector.MergeBreakOrigins): New method.
7052         (FlowBranching.AddBreakVector): New method.
7053
7054 2004-04-27  Miguel de Icaza  <miguel@ximian.com>
7055
7056         * attribute.cs: Small regression fix: only convert the type if we
7057         the type is different, fixes System.Drawing build.
7058
7059 2004-04-27  Martin Baulig  <martin@ximian.com>
7060
7061         * attribute.cs (Attribute.Resolve): If we have a constant value
7062         for a named field or property, implicity convert it to the correct
7063         type.
7064
7065 2004-04-27  Raja R Harinath  <rharinath@novell.com>
7066
7067         * statement.cs (Block.Block): Implicit blocks share
7068         'child_variable_names' fields with parent blocks.
7069         (Block.AddChildVariableNames): Remove.
7070         (Block.AddVariable): Mark variable as "used by a child block" in
7071         every surrounding block.
7072         * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
7073         been used in a child block, complain about violation of "Invariant
7074         meaning in blocks" rule.
7075         * cs-parser.jay (declare_local_variables): Don't use
7076         AddChildVariableNames.
7077         (foreach_statement): Don't create an implicit block: 'foreach'
7078         introduces a scope.
7079
7080 2004-04-23  Miguel de Icaza  <miguel@ximian.com>
7081
7082         * convert.cs (ImplicitNumericConversion): 0 is also positive when
7083         converting from 0L to ulong.  Fixes 57522.
7084
7085 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
7086
7087         * decl.cs (FindMemberToOverride): Fix wrong warning for case when
7088         derived class hides via 'new' keyword field from base class (test-242.cs).
7089         TODO: Handle this in the more general way.
7090         
7091         * class.cs (CheckBase): Ditto.
7092
7093 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
7094
7095         * decl.cs (caching_flags): New member for storing cached values
7096         as bit flags.
7097         (MemberCore.Flags): New enum where bit flags for caching_flags
7098         are defined.
7099         (MemberCore.cls_compliance): Moved to caching_flags.
7100         (DeclSpace.Created): Moved to caching_flags.
7101
7102         * class.cs: Use caching_flags instead of DeclSpace.Created
7103         
7104 2004-04-21  Miguel de Icaza  <miguel@ximian.com>
7105
7106         * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
7107         if we are only a derived class, not a nested class.
7108
7109         * typemanager.cs: Same as above, but do this at the MemberLookup
7110         level (used by field and methods, properties are handled in
7111         PropertyExpr).   Allow for the qualified access if we are a nested
7112         method. 
7113
7114 2004-04-21  Marek Safar  <marek.safar@seznam.cz>
7115
7116         * class.cs: Refactoring.
7117         (IMethodData): New inteface; Holds links to parent members
7118         to avoid member duplication (reduced memory allocation).
7119         (Method): Implemented IMethodData interface.
7120         (PropertyBase): New inner classes for get/set methods.
7121         (PropertyBase.PropertyMethod): Implemented IMethodData interface
7122         (Event): New inner classes for add/remove methods.
7123         (Event.DelegateMethod): Implemented IMethodData interface.
7124
7125         * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
7126         EmitContext (related to class.cs refactoring).
7127
7128 2004-04-21  Raja R Harinath  <rharinath@novell.com>
7129
7130         * delegate.cs (Delegate.VerifyApplicability): If the number of
7131         arguments are the same as the number of parameters, first try to
7132         verify applicability ignoring  any 'params' modifier on the last
7133         parameter.
7134         Fixes #56442.
7135
7136 2004-04-08  Martin Baulig  <martin@ximian.com>
7137
7138         Merged latest changes into gmcs.  Please keep this comment in
7139         here, it makes it easier for me to see what changed in MCS since
7140         the last time I merged.
7141
7142 2004-04-16  Raja R Harinath  <rharinath@novell.com>
7143
7144         * class.cs (TypeContainer.AddIndexer): Use
7145         'ExplicitInterfaceName' to determine if interface name was
7146         explicitly specified.  'InterfaceType' is not initialized at this time.
7147         (TypeContainer.DefineIndexers): Remove use of temporary list.  The
7148         Indexers array is already in the required order.  Initialize
7149         'IndexerName' only if there are normal indexers.
7150         (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
7151         (TypeContainer.Emit): Emit DefaultMember attribute only if
7152         IndexerName is initialized.
7153         Fixes #56300.
7154
7155 2004-04-15  Benjamin Jemlich  <pcgod@gmx.net>
7156
7157         * enum.cs (Enum.DefineType): Don't allow char as type for enum.
7158         Fixes #57007
7159
7160 2004-04-15  Raja R Harinath  <rharinath@novell.com>
7161
7162         * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
7163         attributes.
7164         Fix for #56456.
7165
7166         * attribute.cs (Attribute.Resolve): Check for duplicate named
7167         attributes.
7168         Fix for #56463.
7169
7170 2004-04-15  Miguel de Icaza  <miguel@ximian.com>
7171
7172         * iterators.cs (MarkYield): track whether we are in an exception,
7173         and generate code accordingly.  Use a temporary value to store the
7174         result for our state.
7175
7176         I had ignored a bit the interaction of try/catch with iterators
7177         since their behavior was not entirely obvious, but now it is
7178         possible to verify that our behavior is the same as MS .NET 2.0
7179
7180         Fixes 54814
7181
7182 2004-04-14  Miguel de Icaza  <miguel@ximian.com>
7183
7184         * iterators.cs: Avoid creating temporaries if there is no work to
7185         do. 
7186
7187         * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
7188         Enumerations, use TypeManager.EnumToUnderlying and call
7189         recursively. 
7190
7191         Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
7192         bug #57013
7193
7194         (This.Emit): Use EmitContext.EmitThis to emit our
7195         instance variable.
7196
7197         (This.EmitAssign): Ditto.
7198
7199         * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
7200         codepaths, we will move all the functionality into
7201         Mono.CSharp.This 
7202
7203         (FieldExpr.EmitAssign): Ditto.
7204
7205         This fixes several hidden bugs that I uncovered while doing a code
7206         review of this today.
7207
7208         * codegen.cs (EmitThis): reworked so the semantics are more clear
7209         and also support value types "this" instances.
7210
7211         * iterators.cs: Changed so that for iterators in value types, we
7212         do not pass the value type as a parameter.  
7213
7214         Initialization of the enumerator helpers is now done in the caller
7215         instead of passing the parameters to the constructors and having
7216         the constructor set the fields.
7217
7218         The fields have now `assembly' visibility instead of private.
7219
7220 2004-04-11  Miguel de Icaza  <miguel@ximian.com>
7221
7222         * expression.cs (Argument.Resolve): Check if fields passed as ref
7223         or out are contained in a MarshalByRefObject.
7224
7225         * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
7226         another compiler type.
7227
7228 2004-04-06 Ben Maurer  <bmaurer@users.sourceforge.net>
7229
7230         * class.cs (Indexer.Define): use the new name checking method.
7231         Also, return false on an error.
7232         * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
7233         (is_identifier_[start/part]_character): make static.
7234
7235 2004-04-10  Miguel de Icaza  <miguel@ximian.com>
7236
7237         * expression.cs (Binary.ResolveOperator): Do no append strings
7238         twice: since we can be invoked more than once (array evaluation)
7239         on the same concatenation, take care of this here.  Based on a fix
7240         from Ben (bug #56454)
7241
7242 2004-04-08  Sebastien Pouliot  <sebastien@ximian.com>
7243
7244         * codegen.cs: Fix another case where CS1548 must be reported (when 
7245         delay-sign isn't specified and no private is available #56564). Fix
7246         loading the ECMA "key" to delay-sign an assembly. Report a CS1548 
7247         error when MCS is used on the MS runtime and we need to delay-sign 
7248         (which seems unsupported by AssemblyBuilder - see #56621).
7249
7250 2004-04-08  Marek Safar  <marek.safar@seznam.cz>
7251
7252         * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
7253         (TypeManager.ComputeNamespaces): Faster implementation for
7254         Microsoft runtime.
7255
7256         * compiler.csproj: Updated AssemblyName to mcs.
7257
7258 2004-05-11  Jackson Harper  <jackson@ximian.com>
7259
7260         * Makefile: Preserve MONO_PATH
7261         
7262 2004-05-11  Jackson Harper  <jackson@ximian.com>
7263
7264         * Makefile: Use mono and mcs to build gmcs
7265         
7266 2004-05-03  Miguel de Icaza  <miguel@ximian.com>
7267
7268         * codegen.cs: Add patch from Robert Shade
7269         <rshade@dvsconsulting.com>, use FileAccess.Read on the keyfile, to
7270         sync with mcs.
7271
7272 2004-05-02  Sebastien Pouliot  <sebastien@ximian.com>
7273
7274         * CryptoConvert.cs: Updated to latest version. Fix issue with 
7275         incomplete key pairs (#57941).
7276
7277 2004-04-08  Sebastien Pouliot  <sebastien@ximian.com>
7278
7279         * codegen.cs: Fix another case where CS1548 must be reported (when 
7280         delay-sign isn't specified and no private is available #56564). Fix
7281         loading the ECMA "key" to delay-sign an assembly. Report a CS1548 
7282         error when MCS is used on the MS runtime and we need to delay-sign 
7283         (which seems unsupported by AssemblyBuilder - see #56621).
7284
7285 2004-04-29  Jackson Harper  <jackson@ximian.com>
7286
7287         * Makefile: Set MONO_PATH to use the bootstrap corlib
7288         * driver.cs: Check the GAC for referenced assemblies.
7289                 
7290 2004-04-29  Martin Baulig  <martin@ximian.com>
7291
7292         * Makefile (gmcs.exe): Set MONO_PATH to use `../class/lib/net_2_0'.
7293
7294 2004-04-07  Martin Baulig  <martin@ximian.com>
7295
7296         * expression.cs (Binary.ResolveOperator): Added special case for
7297         Equality/Inequality between a type parameter and a null literal.
7298
7299 2004-04-07  Martin Baulig  <martin@ximian.com>
7300
7301         * convert.cs: Check null literal -> type parameter conversions.
7302
7303 2004-04-07  Martin Baulig  <martin@ximian.com>
7304
7305         * generic.cs (ConstructedType.CheckConstraints): Enforce the
7306         `class' and `struct' constraints.
7307
7308 2004-04-07  Martin Baulig  <martin@ximian.com>
7309
7310         * generic.cs (SpecialConstraint): New public enum.
7311         (Constraints.Resolve): Added support for the `class' and `struct'
7312         constraints.
7313
7314         * cs-parser.jay (type_parameter_constraint): Added support for the
7315         `class' and `struct' constraints.
7316
7317 2004-04-07  Martin Baulig  <martin@ximian.com>
7318
7319         * support.cs (GenericConstraints): Replaced `Types' by
7320         `ClassConstraint' and `InterfaceConstraints'; added
7321         `HasClassConstraint'.   
7322
7323 2004-04-07  Martin Baulig  <martin@ximian.com>
7324
7325         * generic.cs
7326         (Constraints.InterfaceConstraints): New public property.
7327         (Constraints.Types): Make this property public
7328         (TypeParameter): Implement IMemberContainer.
7329         (TypeParameter.Define): Take a `GenericTypeParameterBuilder'
7330         instead of a TypeBuilder/MethodBuilder; pass the interface
7331         constraints to TypeManager.AddTypeParameter().
7332         (TypeParameter.DefineType): Just take an EmitContext and no
7333         TypeBuilder/MethodBuilder.  Use the new public API.
7334
7335         * typemanager.cs (TypeManager.AddTypeParameter): Added
7336         `TypeExpr[]' argument; add the interfaces to the
7337         `builder_to_ifaces' hash.
7338         (TypeManager.LookupMemberContainer): For
7339         GenericTypeParameterBuilders, get the TypeParameter from the
7340         `builder_to_type_param'.
7341         (TypeManager.FindMembers): For GenericTypeParameterBuilders, get
7342         the TypeParameter and call FindMembers on it.
7343
7344 2004-04-07  Martin Baulig  <martin@ximian.com>
7345
7346         * class.cs
7347         (MethodCore.GenericMethod): Moved this field here from Method.
7348         (MethodCore.IsDuplicateImplementation): Take the number of type
7349         parameters into account if we're a generic method.
7350
7351         * expression.cs (Invocation.InferTypeArguments): Don't return true
7352         if `arguments' is null; we still need to check whether we actually
7353         don't need to infer anything in this case.
7354         (MemberAccess): Merged the functionality from GenericMemberAccess
7355         into this class.
7356
7357         * generic.cs (GenericMemberAccess): Removed.
7358
7359 2004-04-05  Martin Baulig  <martin@ximian.com>
7360
7361         * decl.cs (MemberCore): For generic classes, interfaces and
7362         structs, `Name' now includes the number of type parameters
7363         ("Stack!1.Node!1").
7364         (DeclSpace.FindType): Removed the `num_type_args' argument; we now
7365         encode the number of type arguments in the type name.
7366
7367         * expression.cs (Expression.MemberLookup): Removed the
7368         `num_type_args' argument; we now encode the number of type
7369         arguments in the type name.
7370
7371         * ecore.cs (SimpleName): Encode the number of type arguments in
7372         the type name itself.
7373
7374         * generic.cs (ConstructedType): Likewise.
7375
7376         * tree.cs (Tree.RecordDecl): Take a `string' instead of a
7377         `MemberName'; we now include the number of type parameters in the
7378         type name.
7379
7380         * typemanager.cs (TypeManager.CheckGeneric): Removed.
7381         (TypeManager.MemberLookup): Removed the
7382         `num_type_args' argument; we now encode the number of type
7383         arguments in the type name.     
7384
7385 2004-04-03  Martin Baulig  <martin@ximian.com>
7386
7387         * decl.cs (MemberCore.ctor): Take a MemberName instead of a sting.
7388         (MemberCore.MemberName): Moved here from MemberBase.
7389         (DeclSpace.SetParameterInfo): Just take the constraints as an
7390         ArrayList; we already have the type parameters in our
7391         `MemberName'; also do the CS0080 reporting here.
7392
7393         * cs-parser.jay (struct_declaration): Use `member_name' instead of
7394         `IDENTIFIER opt_type_parameter_list'; when constructing our
7395         `MemberName', it'll already include our type parameters.
7396         (class_declaration, interface_declaration): Likewise.
7397         (delegate_declaration): Likewise.
7398         (MakeName): Take a MemberName and return a MemberName.
7399         The following two changes are required to avoid shift/reduce conflicts:
7400         (member_name): Don't include a TypeName anymore; ie. this is now
7401         just 'IDENTIFIER opt_type_parameter_list'.
7402         (property_declaration, event_declaration): Use a
7403         `namespace_or_type_name' instead of a `member_name'.            
7404
7405 2004-04-03  Martin Baulig  <martin@ximian.com>
7406
7407         * decl.cs (MemberName): Renamed to `TypeName' and created a new
7408         `MemberName' class.
7409         (TypeName): Formerly known as MemberName.
7410
7411         * namespace.cs (NamespaceEntry.UsingAlias): Take a `TypeName'
7412         instead of a `MemberName'.
7413
7414         * cs-parser.jay (namespace_or_type_name): Create a TypeName.
7415         (member_name): New rule; create a MemberName.
7416
7417 2004-04-02  Martin Baulig  <martin@ximian.com>
7418
7419         * namespace.cs (NamespaceEntry.VerifyUsing): Added error checking
7420         (CS0305 and CS0308).
7421
7422 2004-04-02  Martin Baulig  <martin@ximian.com>
7423
7424         * generic.cs (GenericMemberAccess.ResolveAsTypeStep): Added
7425         support for nested types.
7426
7427 2004-04-02  Martin Baulig  <martin@ximian.com>
7428
7429         * ecore.cs (IAlias): New public interface.
7430         (TypeExpr, TypeExpression): Implement IAlias.
7431         (TypeAliasExpression): New public class.
7432
7433         * namespace.cs (Namespace): Implement IAlias.
7434         (Namespace.Lookup): Return an IAlias instead on an object.
7435         (Namespace.DefineName): Take an IAlias instead of an object.
7436         (NamespaceEntry.AliasEntry.Resolve): Return an IAlias instead of
7437         an object.
7438         (NamespaceEntry.UsingAlias): Take a Membername instead of an
7439         Expression.
7440         (NamespaceEntry.LookupAlias): Return an IAlias instead on an
7441         object.
7442         (NamespaceEntry.Lookup): Likewise.
7443
7444         * rootcontext.cs (RootContext.LookupType): Return a TypeExpr
7445         instead of a Type.      
7446
7447         * decl.cs (DeclSpace): Implement IAlias.
7448         (DeclSpace.LookupAlias): Return an IAlias instead of a string.
7449
7450         * generic.cs (ConstructedType): Improved error checking.
7451
7452 2004-04-02  Martin Baulig  <martin@ximian.com>
7453
7454         * convert.cs: Added type parameter conversions.
7455
7456         * ecore.cs
7457         (UnboxCast.Emit): Emit an `unbox.any' for type params.
7458         (ClassCast.Emit): If the source type is a type parameter, box it.
7459         If the target type is a type parameter, emit an `unbox.any'
7460         instead of a `classcast'.1      
7461
7462 2004-04-01  Martin Baulig  <martin@ximian.com>
7463
7464         * cs-tokenizer.cs (parse_less_than): Allow Token.DOT.
7465
7466 2004-04-01  Martin Baulig  <martin@ximian.com>
7467
7468         * generic.cs (ConstructedType.CheckConstraints): Use
7469         Convert.ImplicitStandardConversionExists(); user-defined implicit
7470         conversions are not allowed according to the spec.
7471
7472 2004-03-30  Martin Baulig  <martin@ximian.com>
7473
7474         * expression.cs (New): Added support for type parameters.
7475
7476         * typemanager.cs
7477         (TypeManager.activator_type): New public static field.
7478         (TypeManager.activator_create_instance): Likewise.
7479
7480 2004-03-30  Martin Baulig  <martin@ximian.com>
7481
7482         * typemanager.cs (TypeManager.HasConstructorConstraint): New
7483         public method.
7484
7485 2004-03-30  Martin Baulig  <martin@ximian.com>
7486
7487         * generic.cs (ConstructedType.CheckConstraints): Actually follow
7488         the spec here: the argument type must be convertible to the
7489         constraints.
7490
7491 2004-03-30  Martin Baulig  <martin@ximian.com>
7492
7493         * generic.cs
7494         (TypeParameter.Define, TypeParameter.DefineMethod): Call
7495         TypeManager.AddTypeParameter().
7496         (ConstructedType.CheckConstraints): Re-enable this and actually
7497         check whether we have a constructor constraint.
7498
7499         * typemanager.cs
7500         (TypeManager.builder_to_type_param): New static field.
7501         (TypeManager.AddTypeParameter): New static method.
7502         (TypeManager.LookupTypeParameter): New public method.
7503
7504 2004-03-30  Martin Baulig  <martin@ximian.com>
7505
7506         * generic.cs (TypeParameter.DefineType): Return a boolean and use
7507         the new API to actually define the constructor constraint.
7508
7509         * typemanager.cs
7510         (TypeManager.new_constraint_attr_type): New static field.
7511         (TypeManager.InitCoreTypes): Initialize it.
7512
7513 2004-03-30  Martin Baulig  <martin@ximian.com>
7514
7515         * generic.cs (Constraints): Completed error checking, use correct
7516         error numbers.
7517
7518 2004-03-29  Martin Baulig  <martin@ximian.com>
7519
7520         * delegate.cs (Delegate.VerifyMethod): Infer type arguments.
7521
7522         * expression.cs (Invocation.InferTypeArguments): Added overloaded
7523         public version which takes a `ParameterData pd' instead of an
7524         `ArrayList args'.
7525
7526 2004-03-29  Martin Baulig  <martin@ximian.com>
7527
7528         * typemanager.cs (TypeManager.IsGenericMethod): Take a MethodBase,
7529         not a MethodInfo.       
7530
7531 2004-03-29  Martin Baulig  <martin@ximian.com>
7532
7533         * expression.cs (Argument.ResolveMethodGroup): If we're a
7534         ConstructedType, call GetMemberAccess() on it.  
7535
7536 2004-03-29  Martin Baulig  <martin@ximian.com>
7537
7538         * class.cs (MethodBase.CheckGenericOverride): New abstract method.
7539         (MethodCore.CheckGenericOverride): When overriding a generic
7540         method, check whether the constraints match.
7541
7542         * support.cs (GenericConstraints): New public interface.
7543         (ParameterData.GenericConstraints): New public method.
7544
7545         * parameter.cs (Parameter.Resolve): Check whether we're a generic
7546         method parameter and compute our constraints if appropriate.
7547         (Parameter.GenericConstraints): New public property.
7548
7549         * generic.cs (Constraints): Implement GenericConstraints.
7550
7551 2004-03-29  Martin Baulig  <martin@ximian.com>
7552
7553         * decl.cs (MemberCache.FindMemberToOverride): Use
7554         `paramTypes [j].Equals (cmpAttrs [j])' instead of `=='.
7555
7556 2004-03-29  Martin Baulig  <martin@ximian.com>
7557
7558         * generic.cs (GenericMethod.Define): Resolve our type parameters.
7559
7560 2004-03-29  Martin Baulig  <martin@ximian.com>
7561
7562         * cs-parser.jay: Report CS0080 instead of -200 ("Constraints are
7563         not allowed on non-generic declarations").
7564
7565 2004-03-29  Martin Baulig  <martin@ximian.com>
7566
7567         * expression.cs (Invocation.InferTypeArguments): Added overloaded
7568         public version of this method.
7569
7570         * class.cs (MethodCore.IsDuplicateImplementation): Use
7571         Invocation.InferTypeArguments() to check this.
7572
7573 2004-03-29  Martin Baulig  <martin@ximian.com>
7574
7575         * convert.cs: Use TypeManager.IsDelegateType() instead of
7576         comparing types correctly.
7577
7578 2004-03-29  Martin Baulig  <martin@ximian.com>
7579
7580         * convert.cs: Use TypeManager.IsSubclassOf() instead of comparing
7581         types directly to make it work for generic instances.
7582
7583         * typemanager.cs (TypeManager.IsSubclassOf): New static method.
7584
7585 2004-03-29  Martin Baulig  <martin@ximian.com>
7586
7587         * typemanager.cs (TypeManager.MayBecomeEqualGenericTypes): Added
7588         support for arrays.     
7589
7590 2004-03-24  Martin Baulig  <martin@ximian.com>
7591
7592         * decl.cs (DeclSpace.FindType): Also use
7593         TypeManager.CheckGeneric() for types from the using clauses.
7594
7595 2004-03-23  Martin Baulig  <martin@ximian.com>
7596
7597         * expression.cs (Invocation.OverloadResolve): Added `bool
7598         may_fail' argument and use it instead of the Location.IsNull() hack.
7599
7600 2004-03-23  Martin Baulig  <martin@ximian.com>
7601
7602         * expression.cs (Invocation.InferType): Use correct type inference
7603         rules here.     
7604
7605 2004-03-23  Martin Baulig  <martin@ximian.com>
7606
7607         * ecore.cs (MethodGroupExpr.Name): Use
7608         TypeManager.CSharpSignature() instead of just the name.
7609
7610         * expression.cs (Invocation.OverloadResolve): Provide better error
7611         reporting.
7612         (Invocation.DoResolve): OverloadResolve() never returns null
7613         without reporting an error, so removed the error -6 reporting here.
7614
7615 2004-03-23  Martin Baulig  <martin@ximian.com>
7616
7617         * typemanager.cs (TypeManager.GetMethodFlags): Fixed the FIXME for
7618         generic methods.
7619
7620         * cs-parser.jay (delegate_declaration): Support generic delegates.
7621
7622         * delegate.cs: Support generic delegates.
7623
7624 2004-03-22  Martin Baulig  <martin@ximian.com>
7625
7626         * expression.cs (Invocation.InferParamsTypeArguments): New static
7627         method; does type inference for params arguments.
7628
7629 2004-03-21  Martin Baulig  <martin@ximian.com>
7630
7631         * typemanager.cs (TypeManager.IsGenericMethod): New public static
7632         method; checks whether a method is a generic method.    
7633
7634         * expression.cs (Invocation.InferTypeArguments): New static method;
7635         infer type arguments for generic method invocation.
7636
7637         * ecore.cs (MethodGroupExpr.HasTypeArguments): New public
7638         property; we set this to true if we're resolving a generic method
7639         invocation and the user specified type arguments, ie. we're not
7640         doing type inference.
7641
7642 2004-03-20  Martin Baulig  <martin@ximian.com>
7643
7644         * class.cs (MethodData.DeclaringType): New public property.
7645         (MethodData.Define): Set DeclaringType here.
7646         (Operator.Define): Use OperatorMethod.MethodData.DeclaringType
7647         instead of OperatorMethodBuilder.DeclaringType.
7648
7649 2004-03-20  Martin Baulig  <martin@ximian.com>
7650
7651         * cs-tokenizer.cs (xtoken): Return a special
7652         Token.DEFAULT_OPEN_PARENS for "`default' followed by open parens".
7653
7654         * cs-parser.jay (default_value_expression): Switch to the new
7655         syntax (14.5.13).
7656
7657 2004-03-19  Martin Baulig  <martin@ximian.com>
7658
7659         * decl.cs (MemberName): New class.  We use this to "construct"
7660         namespace_or_type_name's.
7661
7662         * generics.cs (TypeArguments.GetDeclarations): New public method;
7663         returns the type arguments as a string[] and reports a CS0081 if
7664         one of them is not an identifier.
7665
7666         * class.cs (MemberBase): The .ctor now takes the name as a
7667         MemberName instead of a string.
7668         (MemberBase.ExplicitInterfaceName): Changed type from string to
7669         Expression.
7670         (MemberBase.DoDefine): If we're an explicit implementation, the
7671         InterfaceType may be a generic instance.
7672
7673         * cs-parser.jay (namespace_or_type_name): Return a MemberName.
7674         (namespace_name): Call MemberName.GetName () to transform the
7675         MemberName into a string and ensure we don't have any type
7676         arguments.
7677         (type_name): Call MemberName.GetTypeExpression() to transfrom the
7678         MemberName into an expression.
7679         (method_header): Use namespace_or_type_name instead of member_name.     
7680
7681 2004-04-07  Miguel de Icaza  <miguel@ximian.com>
7682
7683         * rootcontext.cs: Add new types to the boot resolution.
7684
7685         * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
7686         MulticastDelegate is not allowed.
7687
7688         * typemanager.cs: Add new types to lookup: System.TypedReference
7689         and ArgIterator.
7690
7691         * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
7692         check for TypedReference or ArgIterator, they are not allowed. 
7693
7694         * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
7695         makes us properly catch 1510 in some conditions (see bug 56016 for
7696         details). 
7697
7698 2004-04-06  Bernie Solomon  <bernard@ugsolutions.com>
7699
7700         * CryptoConvert.cs: update from corlib version
7701         with endian fixes.
7702
7703 2004-04-05  Miguel de Icaza  <miguel@ximian.com>
7704
7705         * class.cs (Indexer.Define): Check indexername declaration
7706
7707 2004-04-05  Marek Safar  <marek.safar@seznam.cz>
7708
7709         * attribute.cs (IsClsCompliant): Fixed problem with handling
7710         all three states (compliant, not-compliant, undetected).
7711
7712 2004-03-30  Marek Safar  <marek.safar@seznam.cz>
7713
7714         * attribute.cs (Attribute): Location is now public.
7715         (Resolve): Store resolved arguments (pos_values) in attribute class.
7716         Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
7717         (GetClsCompliantAttributeValue): New method that gets
7718         CLSCompliantAttribute value.
7719         (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
7720         if exists else null.
7721         (AttributeTester): New class for CLS-Compliant verification routines.
7722
7723         * class.cs (Emit): Add CLS-Compliant verification.
7724         (Method.GetSignatureForError): Implemented.
7725         (Constructor.GetSignatureForError): Implemented
7726         (Constructor.HasCompliantArgs): Returns if constructor has
7727         CLS-Compliant arguments.
7728         (Constructor.Emit): Override.
7729         (Construcor.IsIdentifierClsCompliant): New method; For constructors
7730         is needed to test only parameters.
7731         (FieldBase.GetSignatureForError): Implemented.
7732         (TypeContainer): New member for storing base interfaces.
7733         (TypeContainer.FindMembers): Search in base interfaces too.
7734
7735         * codegen.cs (GetClsComplianceAttribute): New method that gets
7736         assembly or module CLSCompliantAttribute value.
7737         (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
7738         for assembly.
7739         (ModuleClass.Emit): Add error 3012 test.
7740
7741         * const.cs (Emit): Override and call base for CLS-Compliant tests.
7742
7743         * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
7744         state for all decl types.
7745         (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
7746         if CLS-Compliant tests are required.
7747         (IsClsCompliaceRequired): New method. Analyze whether code
7748         must be CLS-Compliant.
7749         (IsExposedFromAssembly): New method. Returns true when MemberCore
7750         is exposed from assembly.
7751         (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
7752         value or gets cached value.
7753         (HasClsCompliantAttribute): New method. Returns true if MemberCore
7754         is explicitly marked with CLSCompliantAttribute.
7755         (IsIdentifierClsCompliant): New abstract method. This method is
7756         used to testing error 3005.
7757         (IsIdentifierAndParamClsCompliant): New method. Common helper method
7758         for identifier and parameters CLS-Compliant testing.
7759         (VerifyClsCompliance): New method. The main virtual method for
7760         CLS-Compliant verifications.
7761         (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
7762         null. I don't know why is null (too many public members !).
7763         (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
7764         and get value of first CLSCompliantAttribute that found.
7765
7766         * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
7767         (VerifyClsCompliance): Override and add extra tests.
7768
7769         * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
7770         clscheck- disable CLS-Compliant verification event if assembly is has
7771         CLSCompliantAttribute(true).
7772
7773         * enum.cs (Emit): Override and call base for CLS-Compliant tests.
7774         ApllyAttribute is now called in emit section as in the other cases.
7775         Possible future Emit integration.
7776         (IsIdentifierClsCompliant): New override.
7777         (VerifyClsCompliance): New override.
7778         (GetEnumeratorName): Returns full enum name.
7779
7780         * parameter.cs (GetSignatureForError): Implemented.
7781
7782         * report.cs (WarningData): New struct for Warning message information.
7783         (LocationOfPreviousError): New method.
7784         (Warning): New method. Reports warning based on the warning table.
7785         (Error_T): New method. Reports error based on the error table.
7786
7787         * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
7788         verifications are done here.
7789
7790         * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
7791
7792         * typemanager.cs (cls_compliant_attribute_type): New member thath holds
7793         CLSCompliantAttribute.
7794         (all_imported_types): New member holds all imported types from other
7795         assemblies.
7796         (LoadAllImportedTypes): New method fills static table with exported types
7797         from all referenced assemblies.
7798         (Modules): New property returns all assembly modules.
7799
7800 2004-03-30  Miguel de Icaza  <miguel@ximian.com>
7801
7802         * cs-parser.jay: Add a rule to catch wrong event syntax instead of
7803         throwing a parser error.
7804
7805         * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
7806         which removes the hardcoded get_/set_ prefixes for properties, as
7807         IL allows for the properties to be named something else.  
7808
7809         Bug #56013
7810
7811         * expression.cs: Do not override operand before we know if it is
7812         non-null.  Fix 56207
7813
7814 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
7815
7816         * typemanager.cs: support for pinned variables.
7817
7818 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
7819
7820         * decl.cs, typemanager.cs: Avoid using an arraylist
7821         as a buffer if there is only one result set.
7822
7823 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
7824
7825         * expression.cs: Make sure you cant call a static method
7826         with an instance expression, bug #56174.
7827
7828 2004-03-29  Miguel de Icaza  <miguel@ximian.com>
7829
7830         * class.cs (IsDuplicateImplementation): Improve error reporting to
7831         flag 663 (method only differs in parameter modifier).
7832
7833         * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
7834         in preprocessor directives.
7835
7836         * location.cs (LookupFile): Allow for the empty path.
7837
7838         * attribute.cs (DefinePInvokeMethod): Fix 56148;  I would like a
7839         better approach for some of that patch, but its failing with the
7840         CharSet enumeration.  For now try/catch will do.
7841
7842         * typemanager.cs: Do not crash if a struct does not have fields.
7843         Fixes 56150.
7844
7845 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
7846
7847         * expression.cs: cs0213, cant fix a fixed expression.
7848         fixes 50231.
7849
7850 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
7851
7852         * cs-parser.jay: detect invalid embeded statements gracefully.
7853         bug #51113.
7854
7855 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
7856
7857         * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
7858         As a regex:
7859         s/
7860         the invocation type may not be a subclass of the tye of the item/
7861         The type of the item must be a subclass of the invocation item.
7862         /g
7863
7864         Fixes bug #50820.
7865
7866 2004-03-25  Sebastien Pouliot  <sebastien@ximian.com>
7867
7868         * attribute.cs: Added methods to get a string and a bool from an
7869         attribute. Required to information from AssemblyKeyFileAttribute,
7870         AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
7871         * codegen.cs: Modified AssemblyName creation to include support for
7872         strongnames. Catch additional exceptions to report them as CS1548.
7873         * compiler.csproj: Updated include CryptoConvert.cs.
7874         * compiler.csproj.user: Removed file - user specific configuration.
7875         * CryptoConvert.cs: New. A COPY of the class CryptoConvert from 
7876         Mono.Security assembly. The original class is maintained and tested in
7877         /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
7878         * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
7879         like CSC 8.0 (C# v2) supports.
7880         * Makefile: Added CryptoConvert.cs to mcs sources.
7881         * rootcontext.cs: Added new options for strongnames.
7882
7883 2004-03-24 Ben Maurer  <bmaurer@users.sourceforge.net>
7884
7885         * driver.cs: For --expect-error, report error code `2'
7886         if the program compiled with no errors, error code `1' if
7887         it compiled with an error other than the one expected.
7888
7889 2004-03-24  Sebastien Pouliot  <sebastien@ximian.com>
7890
7891         * compiler.csproj: Updated for Visual Studio .NET 2003.
7892         * compiler.csproj.user: Updated for Visual Studio .NET 2003.
7893         * compiler.sln: Updated for Visual Studio .NET 2003.
7894
7895 2004-03-24  Ravi Pratap M  <ravi@ximian.com>
7896
7897         * expression.cs: Fix bug #47234. We basically need to apply the
7898         rule that we prefer the conversion of null to a reference type
7899         when faced with a conversion to 'object' (csc behaviour).
7900
7901 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
7902
7903         * statement.cs: Shorter form for foreach, eliminates
7904         a local variable. r=Martin.
7905
7906 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
7907
7908         * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
7909         checks if we can use brtrue/brfalse to test for 0.
7910         * expression.cs: use the above in the test for using brtrue/brfalse.
7911         cleanup code a bit.
7912
7913 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
7914
7915         * expression.cs: Rewrite string concat stuff. Benefits:
7916
7917         - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
7918         - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
7919         rather than a concat chain.
7920
7921         * typemanager.cs: Add lookups for more concat overloads.
7922
7923 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
7924
7925         * expression.cs: Emit shorter il code for array init.
7926
7927         newarr
7928         dup
7929         // set 1
7930
7931         // set 2
7932
7933         newarr
7934         stloc.x
7935
7936         ldloc.x
7937         // set 1
7938
7939         ldloc.x
7940         // set 2
7941
7942 2004-03-22 Ben Maurer  <bmaurer@users.sourceforge.net>
7943
7944         * statement.cs: Before, two switch blocks would be merged if the
7945         total size of the blocks (end_item - begin_item + 1) was less than
7946         two times the combined sizes of the blocks.
7947
7948         Now, it will only merge if after the merge at least half of the
7949         slots are filled.
7950
7951         fixes 55885.
7952
7953 2004-03-20  Atsushi Enomoto  <atsushi@ximian.com>
7954
7955         * class.cs : csc build fix for GetMethods(). See bug #52503.
7956
7957 2004-03-20 Ben Maurer  <bmaurer@users.sourceforge.net>
7958
7959         * expression.cs: Make sure fp comparisons work with NaN.
7960         This fixes bug #54303. Mig approved this patch a long
7961         time ago, but we were not able to test b/c the runtime
7962         had a related bug.
7963
7964 2004-03-19  Miguel de Icaza  <miguel@ximian.com>
7965
7966         * ecore.cs (TypExpr.GetHashCode): implement this overload. 
7967
7968 2004-03-19  Martin Baulig  <martin@ximian.com>
7969
7970         * class.cs (MemberCore.IsDuplicateImplementation): Check whether
7971         two overloads may unify for some type parameter substitutions and
7972         report a CS0408 if appropriate.
7973
7974 2004-03-19  Martin Baulig  <martin@ximian.com>
7975
7976         * class.cs (MemberCore.IsDuplicateImplementation): Report the
7977         error here and not in our caller.
7978
7979 2004-03-19  Martin Baulig  <martin@ximian.com>
7980
7981         * interface.cs: Completely killed this file.
7982         (Interface): We're now a TypeContainer and live in class.cs.
7983
7984         * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
7985         argument; we're now also called for interfaces.
7986         (TypeContainer.DefineMembers): Allow this method being called
7987         multiple times.
7988         (TypeContainer.GetMethods): New public method; formerly known as
7989         Interface.GetMethod().  This is used by PendingImplementation.
7990         (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
7991         it's now private and non-static.
7992         (Interface): Moved this here; it's now implemented similar to
7993         Class and Struct.
7994         (Method, Property, Event, Indexer): Added `bool is_interface'
7995         argument to their .ctor's.
7996         (MemberBase.IsInterface): New public field.
7997
7998         * cs-parser.jay: Create normal Method, Property, Event, Indexer
7999         instances instead of InterfaceMethod, InterfaceProperty, etc.
8000         (opt_interface_base): Removed; we now use `opt_class_base' instead.
8001         (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
8002
8003 2004-03-19  Martin Baulig  <martin@ximian.com>
8004
8005         * class.cs (MethodCore.IsDuplicateImplementation): New private
8006         method which does the CS0111 checking.
8007         (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
8008         Use IsDuplicateImplementation().
8009
8010 2004-03-17 Ben Maurer  <bmaurer@users.sourceforge.net>
8011
8012         * decl.cs (FindMemberToOverride): New method to find the correct
8013         method or property to override in the base class.
8014         * class.cs
8015             - Make Method/Property use the above method to find the
8016               version in the base class.
8017             - Remove the InheritableMemberSignatureCompare as it is now
8018               dead code.
8019
8020         This patch makes large code bases much faster to compile, as it is
8021         O(n) rather than O(n^2) to do this validation.
8022
8023         Also, it fixes bug 52458 which is that nested classes are not
8024         taken into account when finding the base class member.
8025
8026         Reviewed/Approved by Martin.
8027
8028 2004-03-17  Martin Baulig  <martin@ximian.com>
8029
8030         * expression.cs (MemberAccess.DoResolve): Take the parent's number
8031         of type arguments into account; use the `real_num_type_args'
8032         approach like in DoResolveAsTypeStep().
8033
8034         * generic.cs (GenericMemberAccess.DoResolve): Make this work for
8035         nested types.
8036
8037 2004-03-17  Marek Safar  <marek.safar@seznam.cz>
8038
8039         * interface.cs: In all interface classes removed redundant
8040         member initialization.
8041
8042 2004-03-16  Martin Baulig  <martin@ximian.com>
8043
8044         * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
8045
8046 2004-03-15  Miguel de Icaza  <miguel@ximian.com>
8047
8048         * decl.cs (DefineTypeAndParents): New helper method to define a
8049         type's containers before the type itself is defined;  This is a
8050         bug exposed by the recent changes to Windows.Forms when an
8051         implemented interface was defined inside a class that had not been
8052         built yet.   
8053
8054         * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
8055
8056         (Check): Loop correctly to report errors modifiers
8057         (UNSAFE was not in the loop, since it was the same as TOP).
8058
8059         * interface.cs: Every interface member now takes a ModFlags,
8060         instead of a "is_new" bool, which we set on the base MemberCore. 
8061
8062         Every place where we called "UnsafeOk" in the interface, now we
8063         call the proper member (InterfaceMethod.UnsafeOK) instead to get
8064         the unsafe settings from the member declaration instead of the
8065         container interface. 
8066
8067         * cs-parser.jay (opt_new): Allow unsafe here per the spec. 
8068
8069         * pending.cs (TypeAndMethods): Add `get_indexer_name' and
8070         `set_indexer_name' to the pending bits (one per type).
8071
8072         We fixed a bug today that was picking the wrong method to
8073         override, since for properties the existing InterfaceMethod code
8074         basically ignored the method name.  Now we make sure that the
8075         method name is one of the valid indexer names.
8076
8077 2004-03-14  Gustavo Giráldez  <gustavo.giraldez@gmx.net>
8078  
8079         * support.cs (SeekableStreamReader): Keep track of stream byte
8080         positions and don't mix them with character offsets to the buffer.
8081
8082         Patch from Gustavo Giráldez
8083
8084 2004-03-15  Marek Safar  <marek.safar@seznam.cz>
8085
8086         * interface.cs (InterfaceSetGetBase): Removed double member
8087         initialization, base class does it as well.
8088
8089 2004-03-13  Martin Baulig  <martin@ximian.com>
8090
8091         * class.cs: Reverted Miguel's latest commit; it makes mcs crash
8092         when compiling corlib.
8093
8094 2004-03-13  Miguel de Icaza  <miguel@ximian.com>
8095
8096         * convert.cs (ExplicitConversion): We were reporting an error on
8097         certain conversions (object_type source to a value type, when the
8098         expression was `null') before we had a chance to pass it through
8099         the user defined conversions.
8100
8101         * driver.cs: Replace / and \ in resource specifications to dots.
8102         Fixes 50752
8103
8104         * class.cs: Add check for duplicate operators.  Fixes 52477
8105
8106 2004-03-11  Miguel de Icaza  <miguel@ximian.com>
8107
8108         * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
8109         that are in the middle of the statements, not only at the end.
8110         Fixes #54987
8111
8112         * class.cs (TypeContainer.AddField): No longer set the
8113         `HaveStaticConstructor' flag, now we call it
8114         `UserDefineStaticConstructor' to diferentiate the slightly
8115         semantic difference.
8116
8117         The situation is that we were not adding BeforeFieldInit (from
8118         Modifiers.TypeAttr) to classes that could have it.
8119         BeforeFieldInit should be set to classes that have no static
8120         constructor. 
8121
8122         See:
8123
8124         http://www.yoda.arachsys.com/csharp/beforefieldinit.html
8125
8126         And most importantly Zoltan's comment:
8127
8128         http://bugzilla.ximian.com/show_bug.cgi?id=44229
8129
8130         "I think beforefieldinit means 'it's ok to initialize the type sometime 
8131          before its static fields are used', i.e. initialization does not need
8132          to be triggered by the first access to the type. Setting this flag
8133          helps the JIT to compile better code, since it can run the static
8134          constructor at JIT time, and does not need to generate code to call it
8135          (possibly lots of times) at runtime. Unfortunately, mcs does not set
8136          this flag for lots of classes like String. 
8137          
8138          csc sets this flag if the type does not have an explicit static 
8139          constructor. The reasoning seems to be that if there are only static
8140          initalizers for a type, and no static constructor, then the programmer
8141          does not care when this initialization happens, so beforefieldinit
8142          can be used.
8143          
8144          This bug prevents the AOT compiler from being usable, since it 
8145          generates so many calls to mono_runtime_class_init that the AOT code
8146          is much slower than the JITted code. The JITted code is faster, 
8147          because it does not generate these calls if the vtable is type is
8148          already initialized, which is true in the majority of cases. But the
8149          AOT compiler can't do this."
8150
8151 2004-03-10  Miguel de Icaza  <miguel@ximian.com>
8152
8153         * class.cs (MethodData.Emit): Refactor the code so symbolic
8154         information is generated for destructors;  For some reasons we
8155         were taking a code path that did not generate symbolic information
8156         before. 
8157
8158 2004-03-11 Ben Maurer  <bmaurer@users.sourceforge.net>
8159
8160         * class.cs: Create a Constructor.CheckBase method that
8161         takes care of all validation type code. The method
8162         contains some code that was moved from Define.
8163
8164         It also includes new code that checks for duplicate ctors.
8165         This fixes bug #55148.
8166
8167 2004-03-09  Joshua Tauberer <tauberer@for.net>
8168
8169         * expression.cs (ArrayCreation): Fix: More than 6 nulls in
8170         a { ... }-style array creation invokes EmitStaticInitializers
8171         which is not good for reference-type arrays.  String, decimal
8172         and now null constants (NullCast) are not counted toward
8173         static initializers.
8174
8175 2004-03-05  Martin Baulig  <martin@ximian.com>
8176
8177         * location.cs (SourceFile.HasLineDirective): New public field;
8178         specifies whether the file contains or is referenced by a "#line"
8179         directive.
8180         (Location.DefineSymbolDocuments): Ignore source files which
8181         either contain or are referenced by a "#line" directive.        
8182
8183 2004-02-29  Ben Maurer <bmaurer@users.sourceforge.net>
8184
8185         * class.cs (Method.CheckBase): Avoid using FindMembers, we have
8186         direct access to our parent, so check the method inline there.
8187
8188 2004-02-27 Ben Maurer  <bmaurer@users.sourceforge.net>
8189
8190         * expression.cs (Invocation.EmitCall): Miguel's last commit
8191         caused a regression. If you had:
8192
8193             T t = null;
8194             t.Foo ();
8195
8196         In Foo the implict this would be null.
8197
8198 2004-02-27  Miguel de Icaza  <miguel@ximian.com>
8199
8200         * expression.cs (Invocation.EmitCall): If the method is not
8201         virtual, do not emit a CallVirt to it, use Call.
8202
8203         * typemanager.cs (GetFullNameSignature): Improve the method to
8204         cope with ".ctor" and replace it with the type name.
8205
8206         * class.cs (ConstructorInitializer.Resolve): Now the method takes
8207         as an argument the ConstructorBuilder where it is being defined,
8208         to catch the recursive constructor invocations.
8209
8210 2004-03-16  Martin Baulig  <martin@ximian.com>
8211
8212         * expression.cs (MemberAccess.DoResolve): If `expr' resolved to a
8213         ConstructedType, call ResolveType() on it to get the type rather
8214         than just using `expr.Type'.
8215
8216 2004-03-16  Martin Baulig  <martin@ximian.com>
8217
8218         * generics.cs (ConstructedType.GetMemberAccess): Take the
8219         EmitContext instead on the TypeExpr and use
8220         ec.TypeContainer.CurrentType/ec.ContainerType.
8221
8222 2004-03-16  Martin Baulig  <martin@ximian.com>
8223
8224         * ecore.cs (SimpleName.DoResolveAsTypeStep): Lookup type
8225         parameters before aliases.
8226
8227 2004-03-16  Martin Baulig  <martin@ximian.com>
8228
8229         * typemanager.cs (TypeManager.MayBecomeEqualGenericInstances):
8230         New oublic function; checks whether two generic instances may become
8231         equal under some instantiations (26.3.1).
8232
8233         * class.cs (TypeContainer.Define): Call
8234         TypeManager.MayBecomeEqualGenericInstances() and report CS0695 on
8235         error.
8236
8237 2004-03-16  Martin Baulig  <martin@ximian.com>
8238
8239         * class.cs (TypeContainer.GetClassBases): Moved
8240         Error_TypeParameterAsBase() here and also check whether the base
8241         class is not an attribute.
8242
8243 2004-03-16  Martin Baulig  <martin@ximian.com>
8244
8245         * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
8246
8247 2004-03-16  Martin Baulig  <martin@ximian.com>
8248
8249         * class.cs (Error_TypeParameterAsBase): Use correct error number
8250         here (CS0689).  
8251
8252 2004-03-16  Martin Baulig  <martin@ximian.com>
8253
8254         * decl.cs (DeclSpace.ResolveTypeExpr): Added more error checking
8255         for generics.
8256
8257         * generics.cs (ConstructedType.DoResolveAsTypeStep): Added better
8258         error reporting.
8259
8260 2004-03-15  Martin Baulig  <martin@ximian.com>
8261
8262         * typemanager.cs (TypeManager.GetFullName): New public method.
8263         (TypeManager.MemberLookup): Added `int_num_type_arguments'
8264         argument; only return members with the correct number of type
8265         arguments.
8266         (TypeManager.CheckGeneric): Allow -1 to bypass the check.
8267         (TypeManager.FilterWithClosure): Call CheckGeneric() to check
8268         whether the number of type arguments matches.
8269
8270         * generic.cs (GenericMemberAccess.ResolveAsTypeStep): Allow `expr'
8271         not being a ConstructedType; we can now do "typeof (Foo.Bar<U>)".
8272
8273         * expression.cs (MemberAccess): Added public `NumTypeArguments'
8274         field; it's set by the protected .ctor when we're actually a
8275         GenericMemberAccess.
8276         (MemberAccess.ResolveAsTypeStep): Compute the total number of type
8277         arguments and pass it to MemberLookupFinal ().
8278
8279         * ecore.cs (Expression.MemberLookup): Added `int
8280         num_type_arguments' argument; only return members with the correct
8281         number of type arguments.
8282         (Expression.MemberLookupFailed): Check whether the MemberLookup
8283         failed because we did not have the correct number of type
8284         arguments; report CS0305 in this case.
8285
8286         * decl.cs (DeclSpace.ResolveTypeExpr): Don't report an error if
8287         `e.ResolveAsTypeTerminal()' already did so.
8288
8289 2004-03-15  Martin Baulig  <martin@ximian.com>
8290
8291         * ecore.cs (Expression.ResolveLValue): Allow e.type being null if
8292         we're a ConstructedType; in this case, the caller must report an
8293         error (for instance CS0131).
8294
8295         * generic.cs (TypeArguments): Added Location argument to the .ctor.
8296         (TypeArguments.Resolve): Actually report errors here.
8297
8298 2004-03-15  Miguel de Icaza  <miguel@ximian.com>
8299
8300         * pending.cs (TypeAndMethods): Add `get_indexer_name' and
8301         `set_indexer_name' to the pending bits (one per type).
8302
8303         We fixed a bug today that was picking the wrong method to
8304         override, since for properties the existing InterfaceMethod code
8305         basically ignored the method name.  Now we make sure that the
8306         method name is one of the valid indexer names.
8307
8308 2004-03-15  Martin Baulig  <martin@ximian.com>
8309
8310         * typemanager.cs (TypeManager.IndexerPropertyName): Added support
8311         for generic instances.
8312
8313 2004-03-13  Martin Baulig  <martin@ximian.com>
8314
8315         * class.cs (TypeContainer.DefineType): Call
8316         TypeManager.AddUserType() immediately after creating the
8317         TypeBuilder; pass all type parameters when creating the
8318         CurrentType.
8319
8320         * decl.cs (DeclSpace.FindNestedType): New public method.
8321         (DeclSpace.FindType): Added `int num_type_args' argument; only
8322         return types with the correct number of type parameters.
8323         (DeclSpace.CountTypeParams): New public property.
8324
8325         * ecore.cs (SimpleName.ctor): Added overloaded version which takes
8326         the number of type parameters; defaults to zero.
8327
8328         * generic.cs (TypeArguments.Count): New public property.
8329         (ConstructedType.DoResolveAsTypeStep): First call
8330         ds.FindNestedType() to find out whether we're nested in the
8331         current generic type; in this case, we inherit all type parameters
8332         from the current class.
8333
8334         * rootcontext.cs (RootContext.NamespaceLookup): Added `int
8335         num_type_args' argument.
8336         (RootContext.LookupType): Added overloaded version which takes the
8337         number of type arguments; only return types with the correct
8338         number of type arguments.
8339
8340         * typemanager.cs (TypeManager.CheckGeneric): New public function;
8341         checks whether `Type t' has `int num_type_args'.
8342
8343 2004-03-13  Martin Baulig  <martin@ximian.com>
8344
8345         * generic.cs (GenericMethod.DefineType): New method; calls
8346         DefineType() on all the type parameters.
8347
8348         * class.cs (MethodData.ctor): Added `GenericMethod generic' argument.
8349         (MethodData.Define): If we're a generic method, call
8350         GenericMethod.DefineType() to define the type parameters.       
8351
8352 2004-03-10  Martin Baulig  <martin@ximian.com>
8353
8354         * pending.cs (Pending.InterfaceMethod): Use TypeManager.IsEqual()
8355         instead of IsAssignableFrom.    
8356
8357 2004-03-10  Martin Baulig  <martin@ximian.com>
8358
8359         * ecore.cs (FieldExpr.ctor): Use TypeManager.TypeToCoreType().
8360
8361         * support.cs (ParameterData.HasArrayParameter): New property.
8362         (ReflectionParameters.ctor): Take a MethodBase instead of a
8363         ParameterInfo[].  If we have any type parameters, get the generic
8364         method definition and ask it whether we have variable arguments.
8365
8366 2004-02-26  Miguel de Icaza  <miguel@ximian.com>
8367
8368         * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
8369         routines to check if a type is an enumerable/enumerator allow
8370         classes that implement the IEnumerable or IEnumerator interfaces.
8371
8372         * class.cs (Property, Operator): Implement IIteratorContainer, and
8373         implement SetYields.
8374
8375         (Property.Define): Do the block swapping for get_methods in the
8376         context of iterators.   We need to check if Properties also
8377         include indexers or not.
8378
8379         (Operator): Assign the Block before invoking the
8380         OperatorMethod.Define, so we can trigger the Iterator code
8381         replacement. 
8382
8383         * cs-parser.jay (SimpleIteratorContainer): new helper class.  Both
8384         Property and Operator classes are not created when we parse the
8385         declarator but until we have the block completed, so we use a
8386         singleton SimpleIteratorContainer.Simple to flag whether the
8387         SetYields has been invoked.
8388
8389         We propagate this setting then to the Property or the Operator to
8390         allow the `yield' to function.
8391
8392 2004-02-25  Marek Safar  <marek.safar@seznam.cz>
8393
8394         * codegen.cs: Implemented attribute support for modules.
8395         New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
8396         Assembly/Module functionality.
8397
8398         * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
8399         interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
8400         Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
8401
8402 2004-02-16  Marek Safar  <marek.safar@seznam.cz>
8403
8404         * interface.cs (FindMembers): The operation is performed on all base
8405         interfaces and not only on the first. It is required for future CLS Compliance patch.
8406
8407 2004-02-12 Ben Maurer  <bmaurer@users.sourceforge.net>
8408
8409         * statement.cs, codegen.cs:
8410         This patch deals with patterns such as:
8411
8412         public class List : IEnumerable {
8413
8414                 public MyEnumerator GetEnumerator () {
8415                         return new MyEnumerator(this);
8416                 }
8417
8418                 IEnumerator IEnumerable.GetEnumerator () {
8419                         ...
8420                 }
8421                 
8422                 public struct MyEnumerator : IEnumerator {
8423                         ...
8424                 }
8425         }
8426
8427         Before, there were a few things we did wrong:
8428         1) we would emit callvirt on a struct, which is illegal
8429         2) we emited ldarg when we needed to emit ldarga
8430         3) we would mistakenly call the interface methods on an enumerator
8431         type that derived from IEnumerator and was in another assembly. For example:
8432
8433         public class MyEnumerator : IEnumerator
8434
8435         Would have the interface methods called, even if there were public impls of the
8436         method. In a struct, this lead to invalid IL code.
8437
8438 2004-02-11  Marek Safar  <marek.safar@seznam.cz>
8439
8440         * const.cs: Const is now derived from FieldBase. Method EmitConstant name
8441           renamed to Emit.
8442
8443         * delegate.cs (Define): Fixed crash when delegate type is undefined.
8444
8445 2004-02-11  Miguel de Icaza  <miguel@ximian.com>
8446
8447         * cs-parser.jay: Fix small regression: we were not testing V2
8448         compiler features correctly.
8449
8450         * interface.cs: If the emit context is null, then create one
8451
8452 2004-02-09  Marek Safar  <marek.safar@seznam.cz>
8453
8454         * decl.cs (GetSignatureForError): New virtual method to get full name
8455           for error messages.
8456
8457         * attribute.cs (IAttributeSupport): New interface for attribute setting.
8458           Now it is possible to rewrite ApplyAttributes method to be less if/else.
8459
8460         * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
8461           Duplicated members and code in these classes has been removed.
8462           Better encapsulation in these classes.
8463
8464 2004-02-07  Miguel de Icaza  <miguel@ximian.com>
8465
8466         * assign.cs (Assign.DoResolve): When dealing with compound
8467         assignments, there is a new rule in ECMA C# 2.4 (might have been
8468         there before, but it is documented here) that states that in:
8469
8470         a op= b;
8471
8472         If b is of type int, and the `op' is a shift-operator, then the
8473         above is evaluated as:
8474
8475         a = (int) a op b 
8476
8477         * expression.cs (Binary.ResolveOperator): Instead of testing for
8478         int/uint/long/ulong, try to implicitly convert to any of those
8479         types and use that in pointer arithmetic.
8480
8481         * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
8482         method to print information for from the type, not from the
8483         null-method we were given.
8484
8485 2004-02-01  Duncan Mak  <duncan@ximian.com>
8486
8487         * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
8488         parsing for cmd, fixes bug #53694.
8489
8490 2004-02-04  Marek Safar  <marek.safar@seznam.cz>
8491
8492         * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
8493         in the member name duplication tests. Property and operator name duplication
8494         was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
8495
8496 2004-02-03  Marek Safar  <marek.safar@seznam.cz>
8497
8498         * interface.cs (PopulateMethod): Fixed crash when interface method
8499         returns not existing type (error test cs0246-3.cs).
8500
8501 2004-02-02  Ravi Pratap M <ravi@ximian.com>
8502
8503         * cs-parser.jay (interface_accessors): Re-write actions to also
8504         store attributes attached to get and set methods. Fix spelling
8505         while at it.
8506
8507         (inteface_property_declaration): Modify accordingly.
8508
8509         (InterfaceAccessorInfo): New helper class to store information to pass
8510         around between rules that use interface_accessors.
8511
8512         * interface.cs (Emit): Apply attributes on the get and set
8513         accessors of properties and indexers too.
8514
8515         * attribute.cs (ApplyAttributes): Modify accordingly to use the
8516         right MethodBuilder when applying attributes to the get and set accessors.
8517
8518 2004-01-31  Miguel de Icaza  <miguel@ximian.com>
8519
8520         * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
8521
8522 2004-01-26  Miguel de Icaza  <miguel@ximian.com>
8523
8524         * cs-tokenizer.cs: Handle #line hidden from PDC bits.
8525
8526 2004-01-25  Miguel de Icaza  <miguel@ximian.com>
8527
8528         * cs-parser.jay: Remove YIELD token, instead use the new grammar
8529         changes that treat `yield' specially when present before `break'
8530         or `return' tokens.
8531
8532         * cs-tokenizer.cs: yield is no longer a keyword.
8533
8534 2004-01-23  Marek Safar  <marek.safar@seznam.cz>
8535
8536         * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
8537         setting for default constructors.
8538         For default constructors are almost every time set wrong Modifier. The
8539         generated IL code has been alright. But inside mcs this values was
8540         wrong and this was reason why several of my CLS Compliance tests
8541         failed.
8542
8543 2004-02-27  Martin Baulig  <martin@ximian.com>
8544
8545         * generics.cs (ConstructedType.ResolveType): Make the nested type
8546         stuff actually work.
8547
8548 2004-02-25  Martin Baulig  <martin@ximian.com>
8549
8550         * decl.cs (DeclSpace.CurrentTypeParameters): New protected
8551         property; returns the type parameters just from the current type,
8552         ie. with the ones from outer classes.
8553         (DeclSpace.LookupGeneric): First search in the current class, then
8554         in outer classes.
8555         (DeclSpace.initialize_type_params): When hiding a type parameter
8556         from an outer class, put it into the `type_param_list' anyways.
8557
8558         * expression.cs (MemberAccess.expr): Made this field protected.
8559
8560         * class.cs (TypeContainer.Define): The `CurrentType' just contains
8561         the type parameters from the current class.
8562
8563         * generic.cs (ConstructedType.ResolveType): Support nested generic
8564         types by taking the type parameters which we inherit from outer
8565         classes into account.
8566         (GenericMemberAccess.ResolveAsTypeStep): Override this and added
8567         support for nested generic types.
8568
8569 2004-02-23  Martin Baulig  <martin@ximian.com>
8570
8571         * decl.cs (DeclSpace.IsGeneric): Make this a property instead of a
8572         field and check whether we're nested inside a generic type.
8573         (DeclSpace.ResolveType): If we're resolving to a generic type
8574         definition, create a ConstructedType and return its resolved type.
8575         (DeclSpace.initialize_type_params): New private method;
8576         initializes the `type_param_list' field from the type parameters
8577         from this and all enclosing classes.
8578         (DeclSpace.TypeParameters): Call initialize_type_params() unless
8579         we're already initialized.
8580
8581 2004-02-23  Martin Baulig  <martin@ximian.com>
8582
8583         * class.cs (Method.Define): Create the generic method before
8584         calling DoDefine().
8585         (Memberbase.DoDefine): Added DeclSpace argument (in addition to
8586         the TypeContainer one); we use this for generic methods.
8587
8588         * decl.cs (CheckAccessLevel): If we're a GenericMethod, use our
8589         parent's TypeBuilder.
8590
8591 2004-02-18  Martin Baulig  <martin@ximian.com>
8592
8593         * ecore.cs (FieldExpr.DoResolveLValue): Use TypeManager.IsEqual()
8594         to check for equality.
8595
8596 2004-02-05  Martin Baulig  <martin@ximian.com>
8597
8598         * ecore.cs (FieldExpr.DoResolveLValue): If we have an
8599         `ec.TypeContainer.CurrentType', use it instead of
8600         `ec.ContainerType' to check whether we're in the type's ctor.
8601
8602 2004-01-29  Martin Baulig  <martin@ximian.com>
8603
8604         * expression.cs (Invocation.DoResolve): If we're a
8605         `ConstructedType', then we're actually a generic method, so
8606         rewrite the expr as a GenericMemberAccess.
8607
8608         * cs-parser.jay (member_name): Don't use `namespace_or_type_name'
8609         here; manually parse it into a string.
8610
8611 2004-01-28  Martin Baulig  <martin@ximian.com>
8612
8613         * typemanager.cs (TypeManager.IsEqual): New static method.
8614         (TypeManager.FilterWithClosure): Call TypeManager.IsEqual() to
8615         check for equality instead of using `=='.
8616
8617 2004-01-26  Martin Baulig  <martin@ximian.com>
8618
8619         * decl.cs (DeclSpace.CurrentType): New public field.
8620
8621         * expression.cs (This.ResolveBase): If we have an
8622         `ec.TypeContainer.CurrentType', use it instead of
8623         `ec.ContainerType'.
8624
8625         * class.cs (TypeContainer.DefineType): If we're a generic type,
8626         create the `CurrentType' (unresolved).
8627         (TypeContainer.GenericType): New private field.
8628         (TypeContainer.DefineMembers): If we have a `CurrentType', resolve
8629         it and store it in `GenericType' before creating the MemberCache.
8630         (TypeContainer.GetMembers): If we have a `GenericType', call
8631         TypeManager.FindMembers() on it.
8632
8633         * interface.cs (Interface.GenericType): New private field.
8634         (Interface.DefineType): If we're a generic type, create the
8635         `CurrentType' (unresolved).
8636         (Interface.DefineMembers): If we have a `CurrentType', resolve it
8637         and store it in `GenericType' before creating the MemberCache.
8638         (Interface.GetMembers): If we have a `GenericType', call
8639         TypeManager.FindMembers() on it.
8640
8641 2004-01-22  Martin Baulig  <martin@ximian.com>
8642
8643         * cs-parser.jay (namespace_or_type_name): Return an Expression,
8644         not a QualifiedIdentifier.  This is what `type_name_expression'
8645         was previously doing.
8646         (type_name_expression): Removed; the code is now in
8647         `namespace_or_type_name'.
8648         (qualified_identifier): Removed, use `namespace_or_type_name'
8649         instead.
8650         (QualifiedIdentifier): Removed this class.      
8651
8652 2004-01-22  Martin Baulig  <martin@ximian.com>
8653
8654         * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
8655         not a string as alias name.
8656
8657 2004-01-21  Miguel de Icaza  <miguel@ximian.com>
8658
8659         * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
8660         #52730 bug, and instead compute correctly the need to use a
8661         temporary variable when requesting an address based on the
8662         static/instace modified of the field and the constructor.
8663  
8664 2004-01-21  Martin Baulig  <martin@ximian.com>
8665
8666         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
8667         class and namespace before looking up aliases.  Fixes #52517.
8668
8669 2004-01-21  Martin Baulig  <martin@ximian.com>
8670
8671         * flowanalysis.cs (UsageVector.Merge): Allow variables being
8672         assinged in a 'try'; fixes exception4.cs.
8673
8674 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
8675         * class.cs : Implemented parameter-less constructor for TypeContainer
8676
8677         * decl.cs: Attributes are now stored here. New property OptAttributes
8678
8679         * delegate.cs, enum.cs, interface.cs: Removed attribute member.
8680
8681         * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
8682
8683 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
8684
8685         * typemanager.cs (CSharpSignature): Now reports also inner class name.
8686           (CSharpSignature): New method for indexer and property signature.
8687
8688 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
8689
8690         * pending.cs (IsVirtualFilter): Faster implementation.
8691
8692 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
8693
8694         * typemanager.cs: Avoid inclusion of same assembly more than once.
8695
8696 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
8697
8698         * cs-parser.jay: Fixed problem where the last assembly attribute
8699           has been applied also to following declaration (class, struct, etc.)
8700           
8701 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
8702
8703         * class.cs: Added error CS0538, CS0539 reporting.
8704         Fixed crash on Microsoft runtime when field type is void.
8705
8706         * cs-parser.jay: Added error CS0537 reporting.
8707
8708         * pending.cs: Added error CS0535 reporting.
8709         Improved error report for errors CS0536, CS0534.
8710
8711 2004-01-20  Miguel de Icaza  <miguel@ximian.com>
8712
8713         Merge a few bits from the Anonymous Method MCS tree.
8714
8715         * statement.cs (ToplevelBlock): New class for toplevel methods,
8716         will hold anonymous methods, lifted variables.
8717
8718         * cs-parser.jay: Create toplevel blocks for delegates and for
8719         regular blocks of code. 
8720
8721 2004-01-20  Martin Baulig  <martin@ximian.com>
8722
8723         * codegen.cs (EmitContext): Removed `InTry', `InCatch',
8724         `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
8725         and `NeedExplicitReturn'; added `IsLastStatement'.
8726         (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
8727         have a `ReturnLabel' or we're not unreachable.
8728
8729         * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
8730         child's reachability; don't just override ours with it.  Fixes
8731         #58058 (lluis's example).
8732         (FlowBranching): Added public InTryOrCatch(), InCatch(),
8733         InFinally(), InLoop(), InSwitch() and
8734         BreakCrossesTryCatchBoundary() methods.
8735
8736         * statement.cs (Return): Do all error checking in Resolve().
8737         Unless we are the last statement in a top-level block, always
8738         create a return label and jump to it.
8739         (Break, Continue): Do all error checking in Resolve(); also make
8740         sure we aren't leaving a `finally'.
8741         (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
8742         statement in a top-level block.
8743         (Block.Flags): Added `IsDestructor'.
8744         (Block.IsDestructor): New public property.
8745
8746 2004-01-20  Martin Baulig  <martin@ximian.com>
8747
8748         * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
8749
8750 2004-01-20  Martin Baulig  <martin@ximian.com>
8751
8752         * statement.cs (Statement.ResolveUnreachable): New public method.
8753         (If, While): Do the dead-code elimination in Resolve(), not in Emit().
8754         (Block.Resolve): Resolve unreachable statements.
8755
8756 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
8757
8758         * expression.cs: We need to fix the case where we do
8759         not have a temp variable here.
8760
8761         * assign.cs: Only expression compound assignments need
8762         temporary variables.
8763
8764 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
8765
8766         * flowanalysis.cs: Reduce memory allocation in a few ways:
8767           - A block with no variables should not allocate a bit
8768             vector for itself.
8769           - A method with no out parameters does not need any tracking
8770             for assignment of the parameters, so we need not allocate
8771             any data for it.
8772           - The arrays:
8773                 public readonly Type[] VariableTypes;
8774                 public readonly string[] VariableNames;
8775             Are redundant. The data is already stored in the variable
8776             map, so we need not allocate another array for it.
8777           - We need to add alot of checks for if (params | locals) == null
8778             due to the first two changes.
8779
8780 2004-01-18  Miguel de Icaza  <miguel@ximian.com>
8781
8782         * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
8783         implement IMemoryLocation, we store a copy on a local variable and
8784         take the address of it.  Patch from Benjamin Jemlich
8785
8786         * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
8787         to use a special "type_name_expression" rule which reduces the
8788         number of "QualifiedIdentifier" classes created, and instead
8789         directly creates MemberAccess expressions.
8790
8791 2004-01-17  Miguel de Icaza  <miguel@ximian.com>
8792
8793         * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
8794         that fixes #52853.  Null literal assignment to ValueType
8795
8796         * class.cs (MethodData.Emit): Instead of checking the name of the
8797         method to determine if its a destructor, create a new derived
8798         class from Method called Destructor, and test for that.  
8799
8800         * cs-parser.jay: Create a Destructor object instead of a Method.  
8801
8802         Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
8803
8804         Fixes: 52933
8805
8806 2004-01-16  Miguel de Icaza  <miguel@ximian.com>
8807
8808         * expression.cs (Binary.ResolveOperator): Perform an implicit
8809         conversion from MethodGroups to their delegate types on the
8810         Addition operation.
8811
8812         * delegate.cs: Introduce a new class DelegateCreation that is the
8813         base class for `NewDelegate' and `ImplicitDelegateCreation',
8814         factor some code in here.
8815
8816         * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
8817         conversion from MethodGroups to compatible delegate types. 
8818
8819         * ecore.cs (Expression.Resolve): Do not flag error 654
8820         (Methodgroupd needs parenthesis) if running on the V2 compiler, as
8821         we allow conversions from MethodGroups to delegate types now.
8822
8823         * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
8824         assignments in v2 either.
8825
8826 2004-01-10  Miguel de Icaza  <miguel@ximian.com>
8827
8828         * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
8829         static read-only fields in ctors.
8830
8831         Applied patch from Benjamin Jemlich 
8832
8833         * expression.cs (UnaryMutator): Avoid leaking local variables. 
8834
8835 2004-01-09  Miguel de Icaza  <miguel@ximian.com>
8836
8837         * cs-tokenizer.cs (IsCastToken): Allow the various native types
8838         here to return true, as they can be used like this:
8839
8840                 (XXX) int.MEMBER ()
8841
8842         Fixed 49836 and all the other dups
8843
8844 2004-01-09  Zoltan Varga  <vargaz@freemail.hu>
8845
8846         * driver.cs: Implement /win32res and /win32icon.
8847
8848 2004-01-08  Miguel de Icaza  <miguel@ximian.com>
8849
8850         * cs-parser.jay: Add a rule to improve error handling for the
8851         common mistake of placing modifiers after the type.
8852
8853 2004-01-07  Miguel de Icaza  <miguel@ximian.com>
8854
8855         * cs-parser.jay (interface_event_declaration): Catch
8856         initialization of events on interfaces, and report cs0068
8857
8858         * cs-parser.jay (interface_event_declaration): Catch
8859         initialization of events. 
8860
8861         * ecore.cs: Better report missing constructors.
8862
8863         * expression.cs (Binary.ResolveOperator): My previous bug fix had
8864         the error reporting done in the wrong place.  Fix.
8865
8866         * expression.cs (Binary.ResolveOperator): Catch the 
8867         operator + (E x, E y) error earlier, and later allow for implicit
8868         conversions in operator +/- (E e, U x) from U to the underlying
8869         type of E.
8870
8871         * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
8872         52596, if the container class is abstract, the default constructor
8873         is protected otherwise its public (before, we were always public).
8874
8875         * statement.cs (Fixed.Resolve): Catch a couple more errors in the
8876         fixed statement.
8877
8878         (Using.EmitLocalVariableDecls): Applied patch from Benjamin
8879         Jemlich that fixes bug #52597, MCS was generating invalid code for
8880         idisposable structs.   Thanks to Ben for following up with this
8881         bug as well.
8882
8883 2004-01-06  Miguel de Icaza  <miguel@ximian.com>
8884
8885         * driver.cs: Allow assemblies without code to be generated, fixes
8886         52230.
8887
8888 2004-01-07  Nick Drochak <ndrochak@gol.com>
8889
8890         * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
8891
8892 2004-01-05  Miguel de Icaza  <miguel@ximian.com>
8893
8894         * cs-parser.jay: Add rules to improve error reporting if fields or
8895         methods are declared at the namespace level (error 116)
8896
8897         * Add rules to catch event add/remove
8898
8899 2004-01-04  David Sheldon <dave-mono@earth.li>
8900
8901   * expression.cs: Added matching ")" to error message for 
8902   CS0077
8903
8904 2004-01-03 Todd Berman <tberman@gentoo.org>
8905
8906         * ecore.cs, attribute.cs:
8907         Applying fix from #52429.
8908
8909 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
8910
8911         * ecore.cs, expression.cs, statement.cs:
8912         Total rewrite of how we handle branching. We
8913         now handle complex boolean expressions with fewer
8914         jumps. As well if (x == 0) no longer emits a ceq.
8915
8916         if (x is Foo) is much faster now, because we generate
8917         better code.
8918
8919         Overall, we get a pretty big improvement on our benchmark
8920         tests. The code we generate is smaller and more readable.
8921
8922         I did a full two-stage bootstrap. The patch was reviewed
8923         by Martin and Miguel.
8924
8925 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
8926
8927         * cs-parser.jay: Make primary_expression not take a QI.
8928         we dont need this because the member_access rule covers
8929         us here. So we replace the rule with just IDENTIFIER.
8930
8931         This has two good effects. First, we remove a s/r conflict.
8932         Second, we allocate many fewer QualifiedIdentifier objects.
8933
8934 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
8935
8936         * attribute.cs: Handle MarshalAs attributes as pseudo, and
8937         set the correct information via SRE. This prevents
8938         hanging on the MS runtime. Fixes #29374.
8939
8940 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
8941
8942         * convert.cs: correctly handle conversions to value types
8943         from Enum and ValueType as unboxing conversions.
8944
8945         Fixes bug #52569. Patch by Benjamin Jemlich.
8946
8947 2004-01-02  Ravi Pratap  <ravi@ximian.com>
8948
8949         * expression.cs (BetterConversion): Prefer int -> uint
8950         over int -> ulong (csc's behaviour). This fixed bug #52046.
8951
8952 2004-01-02 Ben Maurer  <bmaurer@users.sourceforge.net>
8953
8954         * decl.cs (MemberCache.FindMembers): now returns a
8955         MemberInfo [].
8956
8957         * typemanager.cs: In general, go with with ^^.
8958         (CopyNewMethods): take an IList.
8959         (RealMemberLookup): Only allocate an arraylist
8960         if we copy from two sets of methods.
8961
8962         This change basically does two things:
8963         1) Fewer array lists allocated due to CopyNewMethods.
8964         2) the explicit cast in MemberList costed ALOT.
8965
8966 2004-01-02  Zoltan Varga  <vargaz@freemail.hu>
8967
8968         * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
8969         a hashtable to avoid needless string allocations when an identifier is
8970         used more than once (the common case).
8971
8972 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
8973
8974         * pending.cs: MS's TypeBuilder.GetInterfaces ()
8975         is broken, it will not return anything. So, we
8976         have to use the information we have in mcs to
8977         do the task.
8978
8979         * typemanager.cs: Add a cache for GetInterfaces,
8980         since this will now be used more often (due to ^^)
8981
8982         (GetExplicitInterfaces) New method that gets the
8983         declared, not effective, interfaces on a type
8984         builder (eg, if you have interface IFoo, interface
8985         IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
8986         { IBar }.
8987
8988         This patch makes MCS able to bootstrap itself on
8989         Windows again.
8990
8991 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
8992
8993         * expression.cs: Remove the Nop's that Miguel put
8994         in by mistake.
8995
8996 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
8997
8998         * report.cs, codegen.cs: Give the real stack trace to
8999         the error when an exception is thrown.
9000
9001 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
9002
9003         * decl.cs: only allocate hashtables for ifaces if 
9004         it is an iface!
9005
9006 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
9007
9008         * expression.cs: fix the error from cs0121-2.cs
9009         (a parent interface has two child interfaces that
9010         have a function with the same name and 0 params
9011         and the function is called through the parent).
9012
9013 2003-12-30 Ben Maurer  <bmaurer@users.sourceforge.net>
9014
9015         * class.cs, rootcontext.cs, typmanager.cs: do not
9016         leak pointers.
9017
9018 2003-12-28 Ben Maurer  <bmaurer@users.sourceforge.net>
9019
9020         * codegen.cs: remove stack for the ec flow branching.
9021         It is already a linked list, so no need.
9022
9023 2003-12-27 Ben Maurer  <bmaurer@users.sourceforge.net>
9024
9025         * Makefile: Allow custom profiler here.
9026
9027 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
9028
9029         * typemanager.cs (LookupType):
9030           - Use a static char [], because split takes
9031             a param array for args, so it was allocating
9032             every time.
9033           - Do not store true in a hashtable, it boxes.
9034
9035 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
9036
9037         * flowanalysis.cs: bytify common enums.
9038
9039 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
9040
9041         * modifiers.cs: Add a new set of flags for the
9042         flags allowed on explicit interface impls.
9043         * cs-parser.jay: catch the use of modifiers in
9044         interfaces correctly.
9045         * class.cs: catch private void IFoo.Blah ().
9046
9047         All related to bug #50572.
9048
9049 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
9050
9051         * decl.cs: Rewrite the consistant accessability checking.
9052         Accessability is not linear, it must be implemented in
9053         a tableish way. Fixes #49704.
9054
9055 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
9056
9057         * expression.cs: Handle negation in a checked context.
9058         We must use subtraction from zero. Fixes #38674.
9059
9060 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
9061
9062         * class.cs: Ignore static void main in DLLs.
9063         * rootcontext.cs: Handle the target type here,
9064         since we are have to access it from class.cs
9065         * driver.cs: account for the above.
9066
9067 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
9068
9069         * report.cs: Give line numbers and files if available.
9070
9071 2003-12-20  Zoltan Varga  <vargaz@freemail.hu>
9072
9073         * driver.cs: Implement /addmodule.
9074
9075         * typemanager.cs:  Change 'modules' field so it now contains Modules not
9076         ModuleBuilders.
9077
9078 2003-12-20  Martin Baulig  <martin@ximian.com>
9079
9080         * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
9081         (FieldBase.IsAssigned): Removed this field.
9082         (FieldBase.SetAssigned): New public method.
9083         (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
9084
9085 2003-12-20  Martin Baulig  <martin@ximian.com>
9086
9087         * expression.cs (LocalVariableReference.DoResolve): Don't set
9088         `vi.Used' if we're called from DoResolveLValue().
9089
9090         * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
9091         returns the usage vector it just merged into the current one -
9092         pass this one to UsageWarning().
9093         (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
9094         of the `EmitContext', don't call this recursively on our children.
9095
9096 2003-12-19  Zoltan Varga  <vargaz@freemail.hu>
9097
9098         * driver.cs: Implement /target:module.
9099
9100 2003-12-18  Zoltan Varga  <vargaz@freemail.hu>
9101
9102         * support.cs (CharArrayHashtable): New helper class.
9103
9104         * cs-tokenizer.cs: Store keywords in a hashtable indexed by 
9105         char arrays, not strings, so we can avoid creating a string in
9106         consume_identifier if the identifier is a keyword.
9107
9108 2003-12-16  Martin Baulig  <martin@ximian.com>
9109
9110         * statement.cs (LocalInfo.Assigned): Removed this property.
9111         (LocalInfo.Flags): Removed `Assigned'.
9112         (LocalInfo.IsAssigned): New public method; takes the EmitContext
9113         and uses flow analysis.
9114         (Block.UsageWarning): Made this method private.
9115         (Block.Resolve): Call UsageWarning() if appropriate.
9116
9117         * expression.cs (LocalVariableReference.DoResolve): Always set
9118         LocalInfo.Used here.
9119
9120 2003-12-13  Martin Baulig  <martin@ximian.com>
9121
9122         * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
9123         any value here; we're now using flow analysis to figure out
9124         whether a statement/block returns a value.
9125
9126 2003-12-13  Martin Baulig  <martin@ximian.com>
9127
9128         * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
9129         working again.
9130         (FlowBranching.MergeFinally): Don't call
9131         `branching.CheckOutParameters()' here, this is called in
9132         MergeTopBlock().
9133         (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
9134         when adding the `finally' vector.       
9135
9136 2003-12-13  Martin Baulig  <martin@ximian.com>
9137
9138         * flowanalysis.cs
9139         (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
9140         actually work and also fix #48962.
9141
9142 2003-12-12 Ben Maurer  <bmaurer@users.sourceforge.net>
9143
9144         * decl.cs: Do not check System.Object for nested types,
9145         since we know it does not have any. Big bang for buck:
9146
9147         BEFORE:
9148            Run 1:   8.35 seconds
9149            Run 2:   8.32 seconds
9150            corlib:  17.99 seconds
9151         AFTER:
9152            Run 1:   8.17 seconds
9153            Run 2:   8.17 seconds
9154            corlib:  17.39 seconds
9155
9156 2003-12-11 Ben Maurer  <bmaurer@users.sourceforge.net>
9157
9158         * class.cs (FindMembers): Allocate arraylists on demand. Most of the
9159         time we are returning 0 members, so we save alot here.
9160
9161 2003-12-11  Martin Baulig  <martin@ximian.com>
9162
9163         * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
9164         `MergeChild()', also just take the `FlowBranching' as argument;
9165         call Merge() on it and return the result.
9166         (FlowBranching.Merge): We don't need to do anything if we just
9167         have one sibling.
9168
9169 2003-12-11  Martin Baulig  <martin@ximian.com>
9170
9171         * flowanalysis.cs: Use a list of `UsageVector's instead of storing
9172         them in an `ArrayList' to reduce memory usage.  Thanks to Ben
9173         Maurer for this idea.
9174
9175 2003-12-11  Martin Baulig  <martin@ximian.com>
9176
9177         * flowanalysis.cs (MergeResult): This class is now gone; we now
9178         use the `UsageVector' for this.  The reason for this is that if a
9179         branching just has one sibling, we don't need to "merge" them at
9180         all - that's the next step to do.
9181         (FlowBranching.Merge): We now return a `UsageVector' instead of a
9182         `MergeResult'.
9183
9184 2003-12-11  Martin Baulig  <martin@ximian.com>
9185
9186         Reworked flow analyis and made it more precise and bug-free.  The
9187         most important change is that we're now using a special `Reachability'
9188         class instead of having "magic" meanings of `FlowReturns'.  I'll
9189         do some more cleanups and optimizations and also add some more
9190         documentation this week.
9191
9192         * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
9193         largely reworked this class.
9194         (FlowReturns): Removed `Unreachable' and `Exception'; we now use
9195         the new `Reachability' class instead of having "magic" values here.
9196         (FlowBranching): We're now using an instance of `Reachability'
9197         instead of having separate `Returns', `Breaks' etc. fields.
9198
9199         * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
9200         based on flow analysis; ignore the return value of block.Emit ().
9201
9202 2003-12-10  Zoltan Varga  <vargaz@freemail.hu>
9203
9204         * driver.cs typemanager.cs: Find the mono extensions to corlib even
9205         if they are private.
9206
9207 2003-12-09  Martin Baulig  <martin@ximian.com>
9208
9209         * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
9210         call them directly on the UsageVector.
9211
9212 2003-12-09  Martin Baulig  <martin@ximian.com>
9213
9214         * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
9215         Changed return type from `FlowReturns' to `Reachability'.
9216
9217 2003-12-09  Martin Baulig  <martin@ximian.com>
9218
9219         * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
9220         (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
9221         `Reachable' fields with a single `Reachability' one.
9222
9223 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
9224
9225         * class.cs (FindMembers): Remove foreach's.
9226
9227         Bootstrap times:
9228
9229         BEFORE
9230                 Run 1:   8.74 seconds
9231                 Run 2:   8.71 seconds
9232
9233         AFTER
9234                 Run 1:   8.64 seconds
9235                 Run 2:   8.58 seconds
9236
9237
9238 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
9239
9240         * cs-parser.jay:
9241         * gen-treedump.cs:
9242         * statement.cs:
9243         This patch does a few things:
9244                 1. EmptyStatement is now a singleton, so it is never reallocated.
9245                 2. All blah is EmptyStatement constructs have been changed to
9246                    blah == EmptyStatement.Value, which is much faster and valid
9247                    now that EmptyStatement is a singleton.
9248                 3. When resolving a block, rather than allocating a new array for
9249                    the non-empty statements, empty statements are replaced with
9250                    EmptyStatement.Value
9251                 4. Some recursive functions have been made non-recursive.
9252         Mainly the performance impact is from (3), however (1) and (2) are needed for
9253         this to work. (4) does not make a big difference in normal situations, however
9254         it makes the profile look saner.
9255
9256         Bootstrap times:
9257
9258         BEFORE
9259         9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
9260         9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
9261         Total memory allocated: 56397 KB
9262
9263         AFTER
9264         9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
9265         8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
9266         Total memory allocated: 55666 KB
9267
9268 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
9269
9270         * support.cs: Rewrite DoubleHash to use its own impl. Is faster
9271         than the hashtable in a hashtable version
9272
9273         * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
9274         we always end up concating a string. This results in a huge perf
9275         loss, because many strings have to be tracked by the GC. In this
9276         patch, we first use a hashtable that works with two keys, so that
9277         the strings do not need to be concat'ed.
9278
9279         Bootstrap times:
9280         BEFORE
9281                 Run 1:   8.74 seconds
9282                 Run 2:   8.71 seconds
9283
9284         AFTER
9285                 Run 1:   8.65 seconds
9286                 Run 2:   8.56 seconds
9287
9288 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
9289
9290         * Makefile: Add a new target `do-time' that does a quick and simple
9291         profile, leaving easy to parse output.
9292
9293 2003-12-08  Zoltan Varga  <vargaz@freemail.hu>
9294
9295         * codegen.cs (Init): Create the dynamic assembly with 
9296         AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
9297
9298 2003-12-02 Ben Maurer  <bmaurer@users.sourceforge.net>
9299
9300         * support.cs: Make the PtrHashtable use only one
9301         instance of its comparer.
9302
9303 2003-11-30  Zoltan Varga  <vargaz@freemail.hu>
9304
9305         * typemanager.cs: Fix lookup of GetNamespaces.
9306
9307 2003-11-29  Miguel de Icaza  <miguel@ximian.com>
9308
9309         * expression.cs: Removed redundant line.
9310
9311         * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
9312         ArrayLists, use for loops with bounds.  
9313
9314         * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
9315         arraylist.
9316
9317         * expression.cs (Invocation.OverloadResolve): Avoid foreach on
9318         arraylists, use for loop with bounds.
9319
9320         The above three changes give us a 0.071 second performance
9321         improvement out of 3.294 seconds down to 3.223.  On my machine
9322         the above changes reduced the memory usage by 1,387 KB during
9323         compiler bootstrap.
9324
9325         * cs-parser.jay (QualifiedIdentifier): New class used to represent
9326         QualifiedIdentifiers.  Before we created a new string through
9327         concatenation, and mostly later on, the result would be
9328         manipulated by DecomposeQI through string manipulation.
9329
9330         This reduced the compiler memory usage for bootstrapping from
9331         59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
9332         compile times in 0.05 seconds.
9333
9334 2003-11-28  Dick Porter  <dick@ximian.com>
9335
9336         * support.cs: Do string compares with the Invariant culture.
9337
9338         * rootcontext.cs: 
9339         * gen-treedump.cs: 
9340         * expression.cs: 
9341         * driver.cs: 
9342         * decl.cs: 
9343         * codegen.cs: 
9344         * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
9345         the comparison is done with the Invariant culture.
9346
9347 2003-11-27  Miguel de Icaza  <miguel@ximian.com>
9348
9349         * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
9350         GetEnumerator method.
9351
9352         (ProbeCollectionType): Iterate starting at the most specific type
9353         upwards looking for a GetEnumerator
9354
9355         * expression.cs: Shift count can be up to 31 for int/uint and 63
9356         for long/ulong.
9357
9358 2003-11-26  Miguel de Icaza  <miguel@ximian.com>
9359
9360         * statement.cs (Block.LookupLabel): Also look for the label on the
9361         children blocks.  Use a hash table to keep track of visited
9362         nodes. 
9363
9364         * cfold.cs (IntConstant to UIntConstant mapping): Only return if
9365         we actually did transform the other operand, otherwise fall back
9366         to the common codepath that casts to long.
9367
9368         * cs-tokenizer.cs: Use the same code pattern as the int case.
9369         Maybe I should do the parsing myself, and avoid depending on the
9370         Parse routines to get this done.
9371
9372 2003-11-25  Miguel de Icaza  <miguel@ximian.com>
9373
9374         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
9375         which fixes bug 51347.  This time test it.
9376
9377         * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
9378         attributes for example can not tell the difference between these.
9379         The difference was only a syntax feature of the language. 
9380
9381         * attribute.cs: Apply attributes to delegates.
9382
9383         * delegate.cs: Call the apply attributes method.
9384
9385 2003-11-24  Miguel de Icaza  <miguel@ximian.com>
9386
9387         * convert.cs (TryImplicitIntConversion): One line bug fix: we were
9388         comparing 0 vs Byte.MinValue, not the value
9389
9390         (ImplicitConversionRequired): When reporting a conversion error,
9391         use error 31 to print out the constant error instead of the
9392         simpler 29.
9393
9394         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
9395         which fixes bug 51347.
9396
9397 2003-11-22  Miguel de Icaza  <miguel@ximian.com>
9398
9399         * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen) 
9400         which fixes the -warnaserror command line option.
9401
9402 2003-11-21  Miguel de Icaza  <miguel@ximian.com>
9403
9404         * cfold.cs (DoNumericPromotions): During constant folding of
9405         additions on UIntConstant, special case intconstants with
9406         IntConstants like we do on the expression binary operator. 
9407
9408 2003-11-12  Miguel de Icaza  <miguel@ximian.com>
9409
9410         * convert.cs (ImplicitReferenceConversion): We were missing a case
9411         (System.Enum are not value types or class types, so we need to
9412         classify them separatedly).
9413
9414         * driver.cs: We do not support error 2007.
9415
9416 2003-11-12 Jackson Harper <jackson@ximian.com>
9417
9418         * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
9419         system directory. Also use the full file name so users can
9420         libraries names mscorlib-o-tron.dll in a non system dir.
9421         
9422 2004-01-04  David Sheldon <dave-mono@earth.li>
9423
9424         * expression.cs: Added matching ")" to error message for CS0077.
9425
9426 2003-12-19  Martin Baulig  <martin@ximian.com>
9427
9428         * typemanager.cs (TypeManager.IsEqualGenericType): New public
9429         static method; see documentation in the method.
9430         (TypeManager.IsSubclassOrNestedChild): Allow IsEqualGenericType().
9431
9432         * convert.cs (Convert.ImplicitReferenceConversion,
9433         Convert.ImplicitReferenceConversionExists): Add support for
9434         generic type declarations; see gen-36.cs.
9435
9436 2003-12-19  Martin Baulig  <martin@ximian.com>
9437
9438         * pending.cs (Pending.InterfaceMethod): Use
9439         `Type.IsAssignableFrom()' instead of `=='.
9440
9441 2003-12-18  Martin Baulig  <martin@ximian.com>
9442
9443         * decl.cs (DeclSpace.AsAccessible): Check for array, pointer and
9444         byref types first.
9445
9446         * convert.cs (Convert.ImplicitStandardConversionExists): Use
9447         `expr_type.Equals (target_type)' instead of `=='.
9448
9449 2003-12-08  Martin Baulig  <martin@ximian.com>
9450
9451         * generics.cs (Constraints.Types): Removed.
9452         (Constraints.Resolve): Just resolve everything to TypeExpr's, not
9453         to Type's.
9454         (Constraints.ResolveTypes): New public method; resolves the
9455         TypeExpr's to Type's.
9456         (TypeParameter.Define): TypeBuilder.DefineGenericParameter() no
9457         longer takes the constraints.
9458         (TypeParameter.DefineMethod): Likewise.
9459         (TypeParameter.DefineType): New public method.  Calls
9460         `TypeBuilder/MethodBuilder.SetGenericParameterConstraints()' to set
9461         the constraints.
9462
9463 2003-12-08  Martin Baulig  <martin@ximian.com>
9464
9465         * convert.cs (Convert.ImplicitConversionStandard): Use
9466         `expr_type.Equals (target_type)' instead of `=='.
9467
9468 2003-12-08  Martin Baulig  <martin@ximian.com>
9469
9470         * typemanager.cs (TypeManager.GetReferenceType): Call
9471         `Type.MakeByRefType ()'.
9472
9473 2003-12-08  Martin Baulig  <martin@ximian.com>
9474
9475         * cs-parser.jay, cs-tokenizer.cs: `where' is not a keyword, it
9476         just has some special meaning in some situations.  For instance,
9477         it is allowed to use `where' as the name of a variable etc.
9478
9479 2003-12-04  Martin Baulig  <martin@ximian.com>
9480
9481         * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
9482         `Type.MakeArrayType()' for array types.
9483
9484 2003-11-18  Miguel de Icaza  <miguel@ximian.com>
9485
9486         * expression.cs (Invocation.VerifyArgumentsCompat): Remove
9487         debugging message.
9488
9489         (SizeOf.DoResolve): assign the `type_queried' field.  This gets
9490         corlib to compile.
9491
9492 2003-11-16  Martin Baulig  <martin@ximian.com>
9493
9494         * codegen.cs (EmitContext.IsGeneric): Removed.
9495
9496         * ecore.cs (SimpleName.ResolveAsTypeStep): Always call
9497         ResolveGeneric() on the DeclSpace.
9498
9499 2003-11-16  Martin Baulig  <martin@ximian.com>
9500
9501         * generic.cs (TypeArguments.Resolve):
9502         `Expression.ResolveAsTypeTerminal()' returns a TypeExpr; call
9503         `ResolveType()' on it to get the Type.
9504
9505 2003-11-15  Martin Baulig  <martin@ximian.com>
9506
9507         * generic.cs (ConstructedType.GetInterfaces): Override this.
9508
9509 2003-11-14  Martin Baulig  <martin@ximian.com>
9510
9511         * interface.cs (Interface.DefineType): Define all type parameters
9512         before adding the interfaces we inherit.
9513
9514 2003-11-11  Martin Baulig  <martin@ximian.com>
9515
9516         * generic.cs (ConstructedType.ResolveType): Always call
9517         `gt.BindGenericParameters (atypes)'; also if `args.HasTypeArguments'.
9518
9519 2003-11-10  Martin Baulig  <martin@ximian.com>
9520
9521         * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
9522         (TypeManager.InitCoreTypes): Initialize them here, but instead of
9523         calling `ResolveType()' on them, directly assign their `Type'.
9524
9525 2003-11-08  Martin Baulig  <martin@ximian.com>
9526
9527         * generic.cs (ConstructedType): Override `IsClass' etc.
9528
9529 2003-11-08  Martin Baulig  <martin@ximian.com>
9530
9531         * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
9532         return value and the `out parent' parameter.
9533         (TypeContainer.DefineType): Moved the CS0644 check into
9534         GetClassBases().  Don't pass the interface types to the
9535         `builder.DefineType()'/`builder.DefineNestedType()', but resolve
9536         them later and then call `TypeBuilder.AddInterfaceImplementation()'.
9537
9538         * ecore.cs (TypeExpr.IsAttribute): New property.
9539         (TypeExpr.GetInterfaces): New method.
9540
9541         * interface.cs (Interface.GetInterfaceTypeByName): Return a
9542         TypeExpr instead of a Type.
9543         (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
9544         (Interface.DefineType): Don't pass the interface types to the
9545         `builder.Definetype()'/`builder.DefineNestedType()', but resolve
9546         them later and then call `TypeBulider.AddInterfaceImplementation()'.
9547
9548         * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
9549         instead of a `Type[]'.
9550         (TypeManager.RegisterBuilder): Likewise.
9551         (TypeManager.AddUserInterface): Likewise.
9552         (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
9553         `Type[]' and also return a `TypeExpr[]'.
9554         (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
9555
9556 2003-11-08  Martin Baulig  <martin@ximian.com>
9557
9558         * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
9559         Expression.     
9560
9561 2003-11-08  Martin Baulig  <martin@ximian.com>
9562
9563         * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
9564         TypeManager.ResolveExpressionTypes().
9565
9566         * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
9567         instead of an Expression.
9568         (TypeExpr): This is now an abstract base class for `TypeExpression'.
9569         (TypeExpression): New public class; formerly known as `TypeExpr'.
9570
9571         * expression.cs (ComposedCast): Derive from TypeExpr.
9572
9573         * typemanager.cs (TypeManager.system_*_expr): These are now
9574         TypExpr's instead of Expression's.
9575         (TypeManager.ResolveExpressionTypes): New public static function;
9576         called from DeclSpace.GetTypeResolveEmitContext() to resolve all
9577         of them.        
9578
9579 2003-11-06  Miguel de Icaza  <miguel@ximian.com>
9580
9581         * expression.cs (New.DoResolve): Do not dereference value that
9582         might be a null return.
9583
9584         * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
9585         sure that the constant value has the right type.  Fixes an
9586         unreported bug, similar to 50425.
9587
9588         * const.cs (Const.LookupConstantValue): Call
9589         ImplicitStandardConversionExists before doing a conversion to
9590         avoid havng the TypeManager.ChangeType do conversions.
9591
9592         Reduced the number of casts used
9593
9594         (Const.ChangeType): New routine to enable reuse of the constant
9595         type changing code from statement.
9596
9597         * typemanager.cs (ChangeType): Move common initialization to
9598         static global variables.
9599
9600         Fixes #50425.
9601
9602         * convert.cs (ImplicitReferenceConversion): Somehow we allowed
9603         every value type to go through, even if it was void.  Fix that. 
9604
9605         * cs-tokenizer.cs: Use is_identifier_start_character on the start
9606         character of the define, and the is_identifier_part_character for
9607         the rest of the string.
9608
9609 2003-11-05  Miguel de Icaza  <miguel@ximian.com>
9610
9611         * expression.cs (UnaryMutator.EmitCode): When I updated
9612         LocalVariableReference.DoResolve, I overdid it, and dropped an
9613         optimization done on local variable references.
9614
9615 2003-11-04  Miguel de Icaza  <miguel@ximian.com>
9616
9617         * ecore.cs: Convert the return from Ldlen into an int.
9618
9619 2003-10-20  Miguel de Icaza  <miguel@ximian.com>
9620
9621         * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
9622         the accessibility, this is a special case for toplevel non-public
9623         classes (internal for instance).
9624
9625 2003-10-20  Nick Drochak <ndrochak@gol.com>
9626
9627         * ecore.cs: Fix typo and build.  Needed another right paren.
9628
9629 2003-10-19  Miguel de Icaza  <miguel@ximian.com>
9630
9631         * ecore.cs: Applied fix from Ben Maurer.   We were handling in the
9632         `internal' case regular and protected, but not allowing protected
9633         to be evaluated later.  Bug 49840
9634
9635 2003-10-15  Miguel de Icaza  <miguel@ximian.com>
9636
9637         * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
9638         to kb.Nlast, and not the kb.nFirst to isolate the switch
9639         statement.
9640
9641         Extract the underlying type, so enumerations of long/ulong are
9642         treated like long/ulong.
9643
9644 2003-10-14  Miguel de Icaza  <miguel@ximian.com>
9645
9646         * expression.cs (New): Overload the meaning of RequestedType to
9647         track the possible creation of the NewDelegate type, since
9648         DoResolve is invoked more than once for new constructors on field
9649         initialization.
9650
9651         See bugs: #48800 and #37014
9652
9653         * cs-parser.jay (declare_local_constants): Take an arraylist
9654         instead of a single constant.
9655
9656         (local_constant_declaration): It should take a
9657         constant_declarators, not a constant_declarator.  Fixes 49487
9658
9659         * convert.cs: Fix error report.
9660
9661 2003-10-13 Jackson Harper <jackson@ximian.com>
9662
9663         * typemanager.cs (TypeToCoreType): Add float and double this fixes
9664         bug #49611
9665         
9666 2003-11-03  Martin Baulig  <martin@ximian.com>
9667
9668         * expression.cs (ArrayAccess.GetStoreOpcode): Added
9669         `out bool has_type_arg'; if set, we need to pass the type to
9670         ig.Emit().
9671         (ArrayAccess.GetStoreOpcode, ArrayAccess.EmitLoadOpcode): Use
9672         Stelem_Any/Ldelem_Any for generic parameters.   
9673
9674 2003-11-02  Martin Baulig  <martin@ximian.com>
9675
9676         * expression.cs (Invocation.EmitCall): Use
9677         `TypeManager.IsValueType()' to check whether it's a value type.
9678         Don't set `struct_call' when calling a method on a type parameter.
9679
9680 2003-11-02  Martin Baulig  <martin@ximian.com>
9681
9682         * generics.cs (ConstructedType.Resolve): Renamed to ResolveType()
9683         and removed the TypeBuilder argument.
9684
9685         * typemanager.cs (TypeManager.IsValueType): Return
9686         `t.IsGenericParameter || t.IsValueType'.
9687
9688 2003-10-25  Martin Baulig  <martin@ximian.com>
9689
9690         * decl.cs (DeclSpace.ResolveType): If we're a ConstructedType,
9691         call ConstructedType.Resolve() on it.
9692
9693         * generic.cs (ConstructedType.Resolve): Set `type' on success.
9694
9695 2003-10-25  Martin Baulig  <martin@ximian.com>
9696
9697         * class.cs (TypeContainer.GetClassBases): Changed
9698         `out Type parent' into `out TypeExpr parent'.  Moved CS0644 and
9699         CS8214 reporting here.
9700         (TypeContainer.DefineType): GetClassBases() gives us a `TypeExpr'
9701         instead of a `Type' for our parent.  In case of a recursive
9702         declaration (see tests/gen-23.cs for an example), our parent is a
9703         ConstructedType and it doesn't have its type set.  So, first
9704         create our own TypeBuilder, then call constructed.Resolve() to get
9705         the parent's type and finally TypeBuilder.SetParent() it.
9706
9707         * ecore.cs (TypeExpr.Name): New public virtual property.
9708
9709         * generic.cs
9710         (ConstructedType): We're now a TypeExpr and not just an Expression.
9711         (ConstructedType.ResolveAsTypeStep): Don't resolve our type
9712         arguments here; this is done later.
9713         (ConstructedType.Resolve): New public method to resolve the type
9714         arguments and bind them.
9715
9716 2003-10-21  Martin Baulig  <martin@ximian.com>
9717
9718         * convert.cs: Use `TypeManager.IsValueType' instead of
9719         'type.IsValueType' everywhere.
9720
9721         * typemanager.cs (TypeManager.IsValueType): Return true for type
9722         parameters.  The reason for this is that we need to box a type
9723         parameter when converting it to a reference type.
9724
9725         * cs-parser.jay: Added support for default value expressions.
9726
9727         * generics.cs (DefaultValueExpression): New public class.       
9728
9729 2003-10-17  Martin Baulig  <martin@ximian.com>
9730
9731         * generic.cs (Constraints.Resolve): Take a DecpSpace instead of a
9732         TypeContainer so we can also use this for Interfaces.
9733         (TypeParameter.Resolve): Likewise.
9734
9735         * interface.cs (Interface.DefineType): Added support for generic
9736         interfaces.
9737
9738         * cs-parser.jay: Added support for generic structs and interfaces.
9739
9740 2003-10-17  Martin Baulig  <martin@ximian.com>
9741
9742         * generic.cs (GenericMemberAccess.DoResolve): We can now actually
9743         call generic methods :-)
9744
9745 2003-10-16  Martin Baulig  <martin@ximian.com>
9746
9747         * cs-parser.jay (namespace_or_type_name): Only create a
9748         GenericMemberAccess if we actually have type arguments.
9749
9750 2003-10-13  Martin Baulig  <martin@ximian.com>
9751
9752         * class.cs (Method.Define): If we're a generic method, call
9753         TypeBuilder.DefineGenericMethod () before resolving
9754         the parameters.
9755         (MethodData): Added .ctor which takes an additional MethodBuilder
9756         argument; this is used for generic methods.
9757         (MethodData.Define): Call `builder.SetGenericMethodSignature()' if
9758         we already have a MethodBuilder.
9759
9760 2003-10-10  Martin Baulig  <martin@ximian.com>
9761
9762         * class.cs (Method): Added .ctor which takes a `GenericMethod'
9763         instead of a `DeclSpace'.  This is used for generic methods.
9764
9765         * cs-parser.jay (method_header): Added support for generic
9766         methods; create a `GenericMethod' instance and pass it to the
9767         `Method's .ctor; it'll be used as the `DeclSpace' to lookup
9768         parameters and locals.
9769
9770         * decl.cs (DeclSpace.SetParameterInfo): Removed Location argument
9771         since we already have the location.  Check whether we're a generic
9772         type declaration or a generic method and create the correct type
9773         parameter.
9774
9775         * generic.cs (TypeParameter.DefineMethod): New public method.
9776         (GenericMethod): New public class; derives from DeclSpace and is
9777         used for generic methods.       
9778
9779 2003-10-09  Martin Baulig  <martin@ximian.com>
9780
9781         * class.cs (MethodCore): Added additional `DeclSpace ds' argument
9782         to the .ctor.
9783         (MethodCore.DoDefineParameters): Removed the TypeContainer
9784         argument; use the DeclSpace which was passed to the .ctor instead.
9785         (MethodCore.CheckParameter): Take a DeclSpace instead of a
9786         TypeContainer; we only need a DeclSpace here.
9787
9788 2003-10-09  Martin Baulig  <martin@ximian.com>
9789
9790         * class.cs (MethodData): Added additional `DeclSpace ds' argument
9791         to the .ctor.
9792         (MethodData.Define, MethodData.Emit): Pass the `ds' to the
9793         EmitContext's .ctor.    
9794
9795 2003-10-09  Martin Baulig  <martin@ximian.com>
9796
9797         * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
9798         (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
9799         AsAccessible(), moved them as well.
9800
9801         * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
9802
9803 2003-10-07  Miguel de Icaza  <miguel@ximian.com>
9804
9805         * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
9806         generation for >=, as spotted by Paolo, bug 48679.  
9807         Patch from David Waite.
9808
9809         * cs-tokenizer.cs: Add handling for #pragma.
9810
9811         * cs-parser.jay: Allow for both yield and yield return in the
9812         syntax.  The anti-cobolization of C# fight will go on!
9813
9814         * class.cs (TypeBuilder.DefineType): Catch error condition here
9815         (Parent.DefineType erroring out and returning null).
9816
9817         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
9818         coping with enumerations variables, we were mistakenly processing
9819         them as a regular value type instead of built-in types.  Fixes the
9820         bug #48063
9821
9822         * typemanager.cs (IsBuiltinOrEnum): New method.
9823
9824 2003-09-30  Miguel de Icaza  <miguel@ximian.com>
9825
9826         * cs-parser.jay: Upgrade: yield now needs the return clause.
9827
9828 2003-10-08  Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
9829
9830         * cs-parser.jay : Renamed yyName to yyNames related to jay.
9831
9832 2003-09-29  Martin Baulig  <martin@ximian.com>
9833
9834         * typemanager.cs (TypeManager.GetMethodFlags): Added support for
9835         inflated generic methods.
9836
9837         * generics.cs (ConstructedType): Distinguish between open and
9838         closed constructed types; correctly resolve the arguments.
9839
9840 2003-09-22  Martin Baulig  <martin@ximian.com>
9841
9842         * generic.cs (ConstructedType.ResolveAsTypeCheck): Check whether
9843         all type arguments meet their constraints.
9844
9845 2003-09-19  Martin Baulig  <martin@ximian.com>
9846
9847         * decl.cs (MemberCache.SetupCacheForInterface): Take a
9848         `MemberCache parent' argument.  Normally, an interface doesn't
9849         have a parent type except System.Object, but we use this in gmcs
9850         for generic type parameters.
9851
9852 2003-09-18  Martin Baulig  <martin@ximian.com>
9853
9854         * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
9855         on `type.IsInterface'; don't check whether the type has a parent
9856         to determine whether it's an interface.
9857
9858 2003-09-17  Martin Baulig  <martin@ximian.com>
9859
9860         * generic.cs (ConstructedType.ToString): Always use `name' as the
9861         type name.
9862
9863 2003-09-15  Martin Baulig  <martin@ximian.com>
9864
9865         * cs-parser.jay: Fix grammar wrt. type_parameter_constraints.
9866
9867         * generic.cs (Constraints.Resolve): New public method; this is
9868         called to resolve the constraint types and to check whether all
9869         the constraints are correct.
9870         (Constraints.Types): New public property.
9871         (TypeParameter.Resolve): New public method; resolves all the
9872         type's constraints.
9873
9874         * class.cs (TypeContainer.DefineType): Call
9875         TypeParameter.Resolve() before actually defining the type.
9876
9877 2003-09-15  Martin Baulig  <martin@ximian.com>
9878
9879         * class.cs (TypeContainer.DefineType): Added an error flag to
9880         avoid reporting duplicate CS0146's ("class definition is
9881         circular.").
9882
9883         * driver.cs (Driver.MainDriver): Abort if
9884         RootContext.ResolveTree() reported any errors.
9885
9886 2003-09-07  Martin Baulig  <martin@ximian.com>
9887
9888         * report.cs (Error, Warning): Added overloaded versions which take
9889         a `params object[] args' and call String.Format().
9890
9891 2003-09-07  Martin Baulig  <martin@ximian.com>
9892
9893         * decl.cs (DeclSpace..ctor): Don't call
9894         NamespaceEntry.DefineName() here; do it in RecordDecl() which is
9895         called from Tree.RecordDecl().  Fixes the CS0101 reporting.
9896         (DeclSpace.RecordDecl): New method.
9897
9898         * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
9899
9900 2003-09-02  Ravi Pratap  <ravi@ximian.com>
9901
9902         * attribute.cs (CheckAttributeTarget): Ensure that we allow return
9903         value attributes to be applied to ParameterBuilders.
9904
9905         * class.cs (MethodCore.LabelParameters): Make static and more
9906         generic so that it can be used from other places - like interface
9907         methods, for instance.
9908
9909         * interface.cs (Interface.Emit): Call LabelParameters before
9910         emitting attributes on the InterfaceMethod.
9911
9912 2003-09-07  Martin Baulig  <martin@ximian.com>
9913
9914         * generic.cs (ConstructedType.ResolveAsTypeStep): Report a CS8217
9915         if the number of type parameters doesn't match.
9916
9917 2003-09-04  Martin Baulig  <martin@ximian.com>
9918
9919         * expression.cs (ComposedCast.ResolveAsTypeStep): Added support
9920         for arrays of generic type params (ie. `!0[]').
9921
9922 2003-09-04  Martin Baulig  <martin@ximian.com>
9923
9924         * class.cs (TypeContainer.AsAccessible): Ignore generic parameters
9925         for the moment.
9926
9927 2003-09-04  Martin Baulig  <martin@ximian.com>
9928
9929         * decl.cs (DeclSpace.LookupGeneric): New method.
9930         (DeclSpace.CheckAccessLevel): Ignore generic parameters for the
9931         moment.
9932
9933         * generic.cs (TypeParameterExpr): Take a TypeParameter as
9934         argument, not just a string.
9935         (TypeParameter.Define): New public method; this is called to
9936         actually define the generic parameter; after this, you can use the
9937         new `Type' property to get the type.
9938
9939 2003-09-04  Martin Baulig  <martin@ximian.com>
9940
9941         * decl.cs (DeclSpace.SetParameterInfo): The `constraints' argument
9942         is now an ArrayList; initialize the result of the `TypeParameters'
9943         property here.
9944         (DeclSpace.GetGenericData): Removed.
9945         (DeclSpace.LookupGeneric): Temporarily removed; we need to
9946         implement this in a different way.
9947         (DeclSpace.GetTypeParameters): Removed; there's now a
9948         `TypeParameters' property.
9949         (DeclSpace.TypeParameters): New public property.
9950
9951         * generic.cs (Constraints): Make this class public.
9952         (TypeParameter): New public class.
9953
9954 2003-09-04  Martin Baulig  <martin@ximian.com>
9955
9956         * decl.cs (DeclSpace.GetTypeParameters): New method to return the
9957         generic parameters.
9958
9959         * class.cs (TypeContainer.DefineType): Call
9960         TypeBuilder.DefineGenericParameter () on all generic parameters if
9961         this is a generic type.
9962
9963 2003-08-28  Martin Baulig  <martin@ximian.com>
9964
9965         * sample-stack.il: Compile this with ilasm: "ilasm /dll
9966         sample-stack.il".
9967
9968         * sample-hello.cs: Compile this with gmcs: "gmcs
9969         /r:sample-stack.dll sample-hello.cs".
9970
9971 2003-08-28  Martin Baulig  <martin@ximian.com>
9972
9973         * generic.cs (ConstructedType.ResolveAsTypeStep): Actually bind
9974         the parameters to the generic type.
9975
9976 2003-08-28  Martin Baulig  <martin@ximian.com>
9977
9978         * cs-tokenizer.cs (parse_less_than): Also allow all builtin types.
9979
9980 2003-08-28  Martin Baulig  <martin@ximian.com>
9981
9982         * cs-parser.jay (opt_type_argument_list): Use
9983         `OP_GENERICS_LT type_arguments OP_GENERICS_GT'.
9984         (primary_expression): Replace `qualified_identifier' with `type_name'.
9985         (type_parameter_list): Use `OP_GENERICS_LT type_parameters OP_GENERICS_GT'.
9986
9987         * cs-tokenizer.cs (is_punct): When reading a `<', invoke a custom
9988         parser to check whether it is syntactically a type parameter list;
9989         return OP_GENERICS_LT/OP_GENERICS_GT instead of OP_LT/OP_GT in
9990         this case.
9991
9992 2003-08-26  Martin Baulig  <martin@ximian.com>
9993
9994         * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
9995         resolving aliases; fixes #47927.
9996
9997 2003-08-26  Martin Baulig  <martin@ximian.com>
9998
9999         * statement.cs (Using.DoResolve): This is internally emitting a
10000         try/finally clause, so we need to set ec.NeedExplicitReturn if we
10001         do not always return.  Fixes #47681.
10002
10003 2003-08-26  Martin Baulig  <martin@ximian.com>
10004
10005         * decl.cs (MemberCore): Moved WarningNotHiding(),
10006         Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
10007         into MemberBase.
10008         (AdditionResult): Make this nested in DeclSpace.
10009         (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
10010         argument; call NamespaceEntry.Define() unless we're nested in a
10011         class or struct.
10012
10013         * namespace.cs (Namespace.DefineName): New public function.  This
10014         is called from DeclSpace's .ctor to add 
10015         (Namespace.Lookup): Include DeclSpaces in the lookup.
10016
10017         * class.cs (Operator): Derive from MemberBase, not MemberCore.
10018
10019         * const.cs (Const): Derive from MemberBase, not MemberCore.     
10020
10021 2003-08-25  Martin Baulig  <martin@ximian.com>
10022
10023         * convert.cs (Convert.ExplicitReferenceConversion): When
10024         converting from an interface type to a class, unbox if the target
10025         type is a struct type.  Fixes #47822.
10026
10027 2003-08-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10028
10029         * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
10030         #47854.
10031
10032 2003-08-22  Martin Baulig  <martin@ximian.com>
10033
10034         * class.cs (TypeManager.DefineType): When defining a nested type,
10035         call DefineType() on our parent; fixes #47801.
10036
10037 2003-08-22  Martin Baulig  <martin@ximian.com>
10038
10039         * class.cs (MethodData.Define): While checking if a method is an
10040         interface implementation, improve the test a bit more to fix #47654.
10041
10042 2003-08-22  Martin Baulig  <martin@ximian.com>
10043
10044         * expression.cs (Probe.DoResolve): Check whether `expr' resolved
10045         correctly; fixes #47722.
10046
10047 2003-08-22  Martin Baulig  <martin@ximian.com>
10048
10049         * expression.cs (UnaryMutator.ResolveVariable): If the target is a
10050         LocalVariableReference, ensure it's not read-only.  Fixes #47536.
10051
10052         * statement.cs (Fixed.DoResolve): Make all variables read-only. 
10053
10054 2003-08-22  Martin Baulig  <martin@ximian.com>
10055
10056         * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
10057         can only be assigned in static constructors.  Fixes #47161.
10058
10059 2003-08-22  Martin Baulig  <martin@ximian.com>
10060
10061         Rewrote and improved the flow analysis code.
10062
10063         * flowbranching.cs (FlowBranching): Make this class abstract.
10064         (FlowBranching.CreateBranching): New static function to create a
10065         new flow branching.
10066         (FlowBranchingBlock, FlowBranchingException): New classes.
10067         (FlowBranching.UsageVector.Type): New public readonly field.
10068         (FlowBranching.UsageVector.Breaks): Removed the setter.
10069         (FlowBranching.UsageVector.Returns): Removed the setter.
10070         (FlowBranching.UsageVector): Added Break(), Return(),
10071         NeverReachable() and Throw() methods to modify the reachability.
10072         (FlowBranching.UsageVector.MergeChildren): Removed, this is now
10073         done by FlowBranching.Merge().
10074         (FlowBranching.UsageVector.MergeChild): New method; merges the
10075         merge result into the current vector.
10076         (FlowBranching.Merge): New abstract method to merge a branching.
10077
10078 2003-08-12  Martin Baulig  <martin@ximian.com>
10079
10080         * expression.cs (Indirection.CacheTemporaries): Create the
10081         LocalTemporary with the pointer type, not its element type.
10082
10083 2003-08-10  Miguel de Icaza  <miguel@ximian.com>
10084
10085         * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
10086         token was a keyword or not.
10087
10088         Add `error' options where an IDENTIFIER was expected;  Provide
10089         CheckToken and CheckIdentifierToken convenience error reporting
10090         functions. 
10091
10092         Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
10093
10094         * decl.cs: Rename `NamespaceEntry Namespace' public field into
10095         NameSpaceEntry NameSpaceEntry.
10096
10097         (LookupInterfaceOrClass): Avoid creating a full qualified name
10098         from namespace and name: avoid doing lookups when we know the
10099         namespace is non-existant.   Use new Tree.LookupByNamespace which
10100         looks up DeclSpaces based on their namespace, name pair.
10101
10102         * driver.cs: Provide a new `parser verbose' to display the
10103         exception thrown during parsing.  This is turned off by default
10104         now, so the output of a failure from mcs is more graceful.
10105
10106         * namespace.cs: Track all the namespaces defined in a hashtable
10107         for quick lookup.
10108
10109         (IsNamespace): New method
10110
10111 2003-08-09  Miguel de Icaza  <miguel@ximian.com>
10112
10113         * namespace.cs: Remove redundant call;  Avoid using MakeFQN when
10114         we know that we need to concatenate (full typename can never be
10115         null). 
10116
10117         * class.cs: ditto.
10118
10119         * statement.cs: Use a bitfield;  Do not initialize to null things
10120         which are done by the constructor by default.
10121
10122         * cs-parser.jay: bug fix, parameter was 4, not 3.
10123
10124         * expression.cs: Just use the property;
10125
10126         * statement.cs: No need for GetVariableInfo method.
10127
10128 2003-08-08  Martin Baulig  <martin@ximian.com>
10129
10130         * flowanalysis.cs (FlowReturns): This is now nested in the
10131         `FlowBranching' class.
10132         (MyBitVector): Moved this here from statement.cs.
10133         (FlowBranching.SiblingType): New enum type.
10134         (FlowBranching.CreateSibling): Added `SiblingType' argument.
10135
10136 2003-08-07  Martin Baulig  <martin@ximian.com>
10137
10138         * flowanalysis.cs (FlowBranchingType): This is now nested in the
10139         `FlowBranching' class and called `BranchingType'.
10140
10141 2003-08-07  Martin Baulig  <martin@ximian.com>
10142
10143         * flowanalysis.cs: Moved all the control flow analysis code into
10144         its own file.
10145
10146 2003-08-07  Martin Baulig  <martin@ximian.com>
10147
10148         * assign.cs (Assign.DoResolve): `target' must either be an
10149         IAssignMethod or an EventAccess; report a CS0131 otherwise.  Fixes
10150         #37319.
10151
10152 2003-08-07  Miguel de Icaza  <miguel@ximian.com>
10153
10154         * expression.cs (BinaryMethod): This kind of expression is created by the
10155         Binary class if it determines that the operator has to be handled
10156         by a method.
10157
10158         (BinaryDelegate): This kind of expression is created if we are
10159         dealing with a + or - operator on delegates.
10160
10161         (Binary): remove method, argumetns, and DelegateOperator: when
10162         dealing with methods, 
10163
10164         * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
10165
10166         * statement.cs (Block): use bitfields for the three extra booleans
10167         we had in use.   Remove unused topblock parameter.
10168
10169         * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
10170
10171         * assign.cs: Drop extra unneeded tests.
10172
10173 2003-08-06  Miguel de Icaza  <miguel@ximian.com>
10174
10175         * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
10176
10177         * statement.cs (Foreach): Use VariableStorage instead of
10178         LocalBuilders.   
10179
10180         * codegen.cs (VariableStorage): New class used by clients that
10181         require a variable stored: locals or fields for variables that
10182         need to live across yield.
10183
10184         Maybe provide a convenience api for EmitThis+EmitLoad?
10185
10186         (GetTemporaryLocal, FreeTemporaryLocal): Recycle
10187         these bad boys.
10188
10189 2003-08-05  Miguel de Icaza  <miguel@ximian.com>
10190
10191         * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
10192         RemapParameterLValue): New methods that are used to turn a
10193         precomputed FieldInfo into an expression like this:
10194
10195                 instance.FieldInfo
10196
10197         The idea is to use this instead of making LocalVariableReference
10198         have more than one meaning.
10199
10200         * cs-parser.jay: Add error production to BASE.
10201
10202         * ecore.cs: Deal with TypeManager.GetField returning null, which
10203         is now a valid return value.
10204
10205         (FieldExprNoAddress): New expression for Fields whose address can
10206         not be taken.
10207
10208         * expression.cs (LocalVariableReference): During the resolve
10209         phases, create new expressions if we are in a remapping context.
10210         Remove code that dealt with remapping here.
10211
10212         (ParameterReference): same.
10213
10214         (ProxyInstance): New expression, like the `This' expression, but
10215         it is born fully resolved.  We know what we are doing, so remove
10216         the errors that are targeted to user-provided uses of `this'.
10217
10218         * statement.cs (Foreach): our variable is now stored as an
10219         Expression;  During resolution, follow the protocol, dont just
10220         assume it will return this.
10221
10222 2003-08-06  Martin Baulig  <martin@ximian.com>
10223
10224         * support.cs (SeekableStreamReader.cs): New public class.
10225
10226         * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
10227         SeekableStreamReader instead of the normal StreamReader.
10228
10229 2003-08-04  Martin Baulig  <martin@ximian.com>
10230
10231         * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
10232         CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
10233         deambiguate casts and delegate invocations.
10234         (parenthesized_expression): Use the new tokens to ensure this is
10235         not a cast of method invocation.
10236
10237         * cs-tokenizer.cs (is_punct): Return one of the new special tokens
10238         when reading a `)' and Deambiguate_CloseParens () was previously
10239         called.
10240
10241         * expression.cs (ParenthesizedExpression): New class.  This is
10242         just used for the CS0075 test.
10243         (Binary.DoResolve): Check for CS0075.   
10244
10245 2003-07-29  Ravi Pratap  <ravi@ximian.com>
10246
10247         * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
10248         Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
10249         reference comparison.
10250
10251         (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
10252         examine the ReturnType for equality - this is necessary in the
10253         cases of implicit and explicit operators whose signature also
10254         includes the return type.
10255
10256 2003-07-26  Miguel de Icaza  <miguel@ximian.com>
10257
10258         * namespace.cs: Cache the result of the namespace computation,
10259         instead of computing it every time.
10260
10261 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
10262
10263         * decl.cs: Use a global arraylist that we reuse over invocations
10264         to avoid excesive memory consumption.  Reduces memory usage on an
10265         mcs compile by one meg (45 average).
10266
10267         * typemanager.cs (LookupTypeReflection): In .NET pointers are
10268         private, work around that.
10269
10270 2003-07-23  Miguel de Icaza  <miguel@ximian.com>
10271
10272         * literal.cs (IntLiteral): Define Zero and One static literals. 
10273
10274         * cs-parser.jay (integer_literal): use static literals to reduce
10275         memory usage for the most used literals (0, 1 and -1).  211kb
10276         reduced in memory usage.
10277
10278         Replace all calls to `new ArrayList' with `new
10279         ArrayList(4)' which is a good average number for most allocations,
10280         and also requires only 16 bytes of memory for its buffer by
10281         default. 
10282
10283         This reduced MCS memory usage in seven megabytes for the RSS after
10284         bootstrapping.
10285
10286 2003-07-28  Ravi Pratap  <ravi@ximian.com>
10287
10288         * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
10289         handle params methods the correct way by forming only one
10290         applicable set with params and normal methods in them. Earlier we
10291         were looking at params methods only if we found no normal methods
10292         which was not the correct thing to do.
10293
10294         (Invocation.BetterFunction): Take separate arguments indicating
10295         when candidate and the best method are params methods in their
10296         expanded form.
10297
10298         This fixes bugs #43367 and #46199.
10299
10300         * attribute.cs: Documentation updates.
10301
10302         (CheckAttribute): Rename to CheckAttributeTarget.
10303         (GetValidPlaces): Rename to GetValidTargets.
10304
10305         * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
10306         bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
10307
10308         Fixes bug #44468.
10309
10310 2003-07-28  Miguel de Icaza  <miguel@ximian.com>
10311
10312         * codegen.cs: Compute IsGeneric correctly.
10313
10314         * cs-parser.jay: Introduce OP_GENERIC_LT for the grammar ambiguity
10315         resolution. 
10316
10317         Bring back (temporarily) OP_LEFT_SHIFT, OP_RIGHT_SHIFT,
10318         OP_SHIFT_RIGHT_ASSIGN, OP_SHIFT_LEFT_ASSIGN.  There were too many
10319         regressions, and I was chasing more bugs than I required.
10320
10321         * interface.cs: Use expressions for base type names (like classes
10322         and structs have been doing for a while now), and resolve that.
10323         This patch should probably go into head as well.
10324
10325         This makes it one less user of FindType.
10326
10327 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
10328
10329         This compiler can not self host currently.  Need to fix that.
10330         
10331         * Makefile: compile to `gmcs.exe'
10332
10333         * driver.cs: Turn on v2 by default on gmcs.
10334
10335         * generic.cs (ConstructedType): Does no longer take a container
10336         type argument;  That will be taken care of later.
10337
10338         (ConstructedType.DoResolve, ConstructedType.ResolveAsTypeStep):
10339         Use SimpleName to resolve for now, so we can continue the work on
10340         the parser, until we get Type.GetType that understands generics.
10341
10342         (ConstructedType.ToString): Implement
10343
10344         (TypeArguments.Resolve): Resolve the child expressions as types. 
10345         
10346         * cs-parser.jay: Rename interface_constraints to
10347         type_parameter_constraints
10348
10349         (namespace_or_type_name): Only use constructed types for the basic
10350         construction, we will deal with identifier<...> later.
10351
10352         (type/type_name): No longer call DecomposeQI, as
10353         namespace_or_type_name is always decoded now.
10354         
10355 2003-07-22  Ravi Pratap  <ravi@ximian.com>
10356
10357         * expression.cs (Invocation.OverloadResolve): Follow the spec more
10358         closely: we eliminate methods in base types when we have an
10359         applicable method in a top-level type.
10360
10361         Please see section 14.5.5.1 for an exact description of what goes
10362         on. 
10363
10364         This fixes bug #45127 and a host of other related to corlib compilation.
10365
10366         * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
10367         array is the method corresponding to the top-level type (this is
10368         because of the changes made to icall.c) so we change this
10369         accordingly.
10370
10371         (MethodGroupExpr.Name): This too.
10372
10373         * typemanager.cs (GetElementType): New method which does the right
10374         thing when compiling corlib. 
10375
10376         * everywhere: Make use of the above in the relevant places.
10377
10378 2003-07-22  Martin Baulig  <martin@ximian.com>
10379
10380         * cs-parser.jay (invocation_expression): Moved
10381         `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
10382         `cast_expression', but create a InvocationOrCast which later
10383         resolves to either an Invocation or a Cast.
10384
10385         * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
10386         method; call this before EmitStatement() to make sure that this
10387         expression can be used as a statement.
10388
10389         * expression.cs (InvocationOrCast): New class; resolves to either
10390         an Invocation or a Cast.
10391
10392         * statement.cs (StatementExpression): Call ResolveStatement() on
10393         the ExpressionStatement before emitting it.
10394
10395 2003-07-21  Martin Baulig  <martin@ximian.com>
10396
10397         * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
10398         `ref' and `out' attributes match; fixes #46220.
10399         (MemberAccess.ResolveMemberAccess): You can't reference a type
10400         through an expression; fixes #33180.
10401         (Indexers.GetIndexersForType): Don't return the indexers from
10402         interfaces the class implements; fixes #46502.
10403
10404 2003-07-21  Martin Baulig  <martin@ximian.com>
10405
10406         * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
10407         CS0661 checks; fixes bug #30442.
10408
10409 2003-07-21  Martin Baulig  <martin@ximian.com>
10410
10411         * decl.cs (AdditionResult): Added `Error'.
10412
10413         * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
10414
10415         * typemanager.cs (TypeManager.ChangeType): Catch exceptions; makes
10416         cs0031.cs actually work.
10417
10418  2003-07-20  Miguel de Icaza  <miguel@ximian.com>
10419  
10420         * cs-parser.jay (namespace_name): do not use
10421         namespace_or_type_name, use qualified_identifier, because
10422         namespace_or_type_name will soon return a composed expression
10423         instead of a string.
10424  
10425         (namespace_or_type_name): Instead of returning a string, now this
10426         production returns an expression.
10427  
10428         * codegen.cs (EmitContext): Setup IsGeneric property based on
10429         whether our DeclSpace is generic, our the method is generic.
10430  
10431         * modifier.cs (Modifiers.METHOD_GENERIC): New definition, use if
10432         the method is generic.
10433  
10434         * cs-parser.jay (type_arguments, opt_type_argument_list,
10435         type_parameters, type_parameter_list, opt_type_parameter_list,
10436         type_parameter,, opt_type_parameter_constraints_clauses,
10437         type_parameter_constraints_clauses,
10438         type_parameter_constraint_clause, type_parameter_constraint,
10439         interface_constraints): Add new production
10440  
10441         * decl.cs (DeclSpace): IsGeneric, flag to track whether this
10442         DeclSpace is generic or not.
10443  
10444         (DeclSpace.SetParameterInfo): New routine, used to set the
10445         parameter info for a type.
10446  
10447         (DeclSpace.LookupGeneric): Lookups a name, and if it is a generic,
10448         returns a GenericTypeExpr
10449  
10450         * ecore.cs (SimpleName.ResolveAsTypeStep): If our container is
10451         generic, lookup the generic argument.
10452  
10453         * attribute.cs: Do not allow TypeParameterExpressions in
10454         Attributes.
10455  
10456         * class.cs: Do not allow the Main method to be defined in a
10457         Generic container.
10458  
10459         * expression.cs (SizeOf): Do not allow generic types to be used as
10460         arguments to sizeof.
10461  
10462         * typemanager.cs (IsGeneric): Wrapper for Reflection when we have
10463         it: whether a type is generic or not.  Only works for types we are
10464         currently building for now.
10465         
10466 2003-07-20  Martin Baulig  <martin@ximian.com>
10467
10468         * namespace.cs: Fixed that bug which caused a crash when compiling
10469         the debugger's GUI.
10470
10471 2003-07-20  Miguel de Icaza  <miguel@ximian.com>
10472
10473         * typemanager.cs (LookupTypeReflection): Never expose types which
10474         are NotPublic, NestedPrivate, NestedAssembly, or
10475         NestedFamANDAssem.  We used to return these, and later do a check
10476         that would report a meaningful error, but the problem is that we
10477         would not get the real match, if there was a name override.
10478
10479 2003-07-18  Miguel de Icaza  <miguel@ximian.com>
10480
10481         * namespace.cs (Namespace, Name): Do not compute the namespace
10482         name dynamically, compute it in the constructor.  This reduced
10483         memory usage by 1697 KB.
10484
10485         * driver.cs: Use --pause to pause at the end.
10486
10487 2003-07-17  Peter Williams  <peter@newton.cx>
10488
10489         * Makefile: Change the name of the test target so that it doesn't
10490         conflict with the recursive test target.
10491
10492 2003-07-17  Miguel de Icaza  <miguel@ximian.com>
10493
10494         * expression.cs (LocalVariableReference.Emit, EmitAssign,
10495         AddressOf): Do not use EmitThis, that was wrong, use the actual
10496         this pointer.
10497
10498 2003-07-15  Miguel de Icaza  <miguel@ximian.com>
10499
10500         * class.cs (MethodData.Define): While checking if a method is an
10501         interface implementation, improve the test: If we are not public
10502         (use new test here: use the computed MethodAttributes directly,
10503         instead of the parsed modifier flags) check if the `implementing'
10504         method comes from an interface or not.
10505
10506         * pending.cs (VerifyPendingMethods): Slightly better error
10507         message.
10508
10509         * makefile: add test target that does the mcs bootstrap.
10510
10511 2003-07-16  Ravi Pratap  <ravi@ximian.com>
10512
10513         * interface.cs (Define): Do nothing here since there are no
10514         members to populate etc. Move the attribute emission out of here
10515         since this was just totally the wrong place to put it. Attribute
10516         application happens during the 'Emit' phase, not in the 'Define'
10517         phase.
10518
10519         (Emit): Add this method and move the attribute emission here
10520
10521         * rootcontext.cs (EmitCode): Call the Emit method on interface
10522         types too.
10523
10524 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
10525
10526         * expression.cs (OverloadResolve): Report error only if Location
10527         is not 'Null' which means that there was a probe going on.
10528
10529 2003-07-14  Martin Baulig  <martin@ximian.com>
10530
10531         * expression.cs (ConditionalLogicalOperator): New public class to
10532         implement user defined conditional logical operators.
10533         This is section 14.11.2 in the spec and bug #40505.
10534
10535 2003-07-14  Martin Baulig  <martin@ximian.com>
10536
10537         * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
10538
10539 2003-07-14  Martin Baulig  <martin@ximian.com>
10540
10541         * codegen.cs (EmitContext.InFixedInitializer): New public field.
10542
10543         * ecore.cs (IVariable.VerifyFixed): New interface method.
10544
10545         * expression.cs (Unary.ResolveOperator): When resolving the `&'
10546         operator, check whether the variable is actually fixed.  Fixes bug
10547         #36055.  Set a variable definitely assigned when taking its
10548         address as required by the spec.
10549
10550         * statement.cs (LocalInfo.IsFixed): New field.
10551         (LocalInfo.MakePinned): Set `IsFixed' to true.
10552
10553 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
10554
10555         * attribute.cs (Attribute.Resolve): While doing a Member lookup
10556         for .ctors, ensure that we only ask for members declared in the
10557         attribute type (BindingFlags.DeclaredOnly).
10558
10559         Fixes bug #43632.
10560
10561         * expression.cs (Error_WrongNumArguments): Report error 1501
10562         correctly the way CSC does.
10563
10564 2003-07-13  Martin Baulig  <martin@ximian.com>
10565
10566         * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
10567         lookup on the fully qualified name, to make things like "X.X" work
10568         where "X.X" is a fully qualified type name, but we also have a
10569         namespace "X" in the using list.  Fixes #41975.
10570
10571 2003-07-13  Martin Baulig  <martin@ximian.com>
10572
10573         * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
10574         function. If we're a CompoundAssign, we need to create an embedded
10575         CompoundAssign, not an embedded Assign.
10576         (Assign.DoResolve): Make this work for embedded CompoundAssign's.
10577         Fixes #45854.
10578
10579 2003-07-13  Martin Baulig  <martin@ximian.com>
10580
10581         * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
10582         work to fix bug #46088.
10583
10584 2003-07-13  Ravi Pratap <ravi@ximian.com>
10585
10586         * class.cs (Operator.Emit): Do not emit attributes here - it is
10587         taken care of by the Method class that we delegate too. This takes
10588         care of bug #45876.
10589
10590 2003-07-10  Martin Baulig  <martin@ximian.com>
10591
10592         * expression.cs (TypeOfVoid): New class.
10593         (TypeOf): Report a CS0673 if it's System.Void.  Fixes #42264.
10594
10595 2003-07-10  Martin Baulig  <martin@ximian.com>
10596
10597         * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
10598         bug #35957.
10599
10600 2003-07-10  Martin Baulig  <martin@ximian.com>
10601
10602         * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
10603         not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
10604
10605         * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
10606
10607         * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
10608
10609 2003-07-10  Martin Baulig  <martin@ximian.com>
10610
10611         * expression.cs (ArrayCreation): Don't use a byte blob for arrays
10612         of decimal.  Fixes #42850.
10613
10614         NOTE: I also fixed the created byte blob, but this doesn't work on
10615         the MS runtime and csc never produces any byte blobs for decimal
10616         arrays.
10617
10618 2003-07-10  Martin Baulig  <martin@ximian.com>
10619
10620         * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
10621         structs; fixes #32068.
10622         (Block.AddChildVariableNames): Fixed #44302.
10623
10624 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10625
10626         * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
10627
10628 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
10629
10630         * attribute.cs: And this test is onger needed.
10631
10632 2003-07-08  Martin Baulig  <martin@ximian.com>
10633
10634         * rootcontext.cs (RootContext.NamespaceLookup): Ignore
10635         inaccessible types.  Fixes #36313.
10636
10637         * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
10638
10639         * namespace.cs (NamespaceEntry): Create implicit entries for all
10640         namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
10641         implicit entries for N1.N2 and N1.
10642
10643 2003-07-08  Martin Baulig  <martin@ximian.com>
10644
10645         Rewrote the handling of namespaces to fix a lot of the issues
10646         wrt. `using' aliases etc.
10647
10648         * namespace.cs (Namespace): Splitted this class into a
10649         per-assembly `Namespace' and a per-file `NamespaceEntry'.
10650
10651         * typemanager.cs (TypeManager.IsNamespace): Removed.
10652         (TypeManager.ComputeNamespaces): Only compute namespaces from
10653         loaded assemblies here, not the namespaces from the assembly we're
10654         currently compiling.
10655
10656 2003-07-08  Martin Baulig  <martin@ximian.com>
10657
10658         * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
10659
10660 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
10661
10662         * typemanager.cs: Reverted patch from Gonzalo, my previous patch
10663         already fixed it.  
10664
10665         I thought about the memory savings here, but LookupTypeReflection
10666         is used under already very constrained scenarios.  Compiling
10667         corlib or mcs only exposes one hit, so it would not really reduce
10668         any memory consumption.
10669
10670 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10671
10672         * typemanager.cs: fixes bug #45889 by only adding public types from
10673         other assemblies to the list of known types.
10674
10675 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
10676
10677         * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
10678         on the type we resolved.
10679
10680 2003-07-05  Martin Baulig  <martin@ximian.com>
10681
10682         * pending.cs (PendingImplementation.ParentImplements): Don't
10683         create the proxy if the parent is abstract.
10684
10685         * class.cs (TypeContainer.DefineIndexers): Process explicit
10686         interface implementations first.  Fixes #37714.
10687
10688 2003-07-04  Miguel de Icaza  <miguel@ximian.com>
10689
10690         * expression.cs (MemberAccess.ResolveMemberAccess): Events are
10691         defined recursively;  but since we modify the input parameters
10692         (left is set to `this' temporarily), we reset this value if the
10693         left_is_explicit is false, which gives the original semantics to
10694         the code.  
10695
10696         * literal.cs (NullPointer): new class used to represent a null
10697         literal in a pointer context.
10698
10699         * convert.cs (Convert.ImplicitReferenceConversion): Is the target
10700         type is a pointer, use a NullPointer object instead of a
10701         NullLiteral.   Closes 43687
10702
10703         (ExplicitConversion): Convert pointer values using
10704         the conv opcode to the proper type.
10705
10706         * ecore.cs (New): change ValueTypeVariable property into a method,
10707         that returns whether the valuetype is suitable for being used.
10708
10709         * expression.cs (Binary.DoNumericPromotions): Only return if we
10710         the int constant was a valid uint, and we can return both left and
10711         right as uints.  If not, we continue processing, to trigger the
10712         type conversion.  This fixes 39018.
10713
10714         * statement.cs (Block.EmitMeta): During constant resolution, set
10715         the CurrentBlock property on the emitcontext, so that we resolve
10716         constants propertly.
10717
10718 2003-07-02  Martin Baulig  <martin@ximian.com>
10719
10720         * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
10721         (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
10722
10723         * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
10724         than emitting it here.
10725
10726         * statement.cs: Fixed some more flow analysis bugs.
10727
10728 2003-07-02  Martin Baulig  <martin@ximian.com>
10729
10730         * class.cs (MethodData.Define): When implementing interface
10731         methods, set Final unless we're Virtual.
10732
10733         * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
10734         check work for interface methods.
10735
10736 2003-07-01  Martin Baulig  <martin@ximian.com>
10737
10738         * ecore.cs (EmitContext.This): Replaced this property with a
10739         GetThis() method which takes a Location argument.  This ensures
10740         that we get the correct error location for a CS0188.
10741
10742 2003-07-01  Miguel de Icaza  <miguel@ximian.com>
10743
10744         * ecore.cs: (Convert.ConvertIntLiteral): Add test for
10745         ImplicitStandardConversion.
10746
10747         * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
10748
10749 2003-07-01  Zoltan Varga  <vargaz@freemail.hu>
10750
10751         * expression.cs (ResolveOperator): Fix Concat (string, string, string)
10752         optimization.
10753
10754 2003-06-30  Miguel de Icaza  <miguel@ximian.com>
10755
10756         * class.cs (Constructor.Define): Turn off initlocals for unsafe
10757         constructors.
10758
10759         (MethodData.Define): Turn off initlocals for unsafe methods.
10760
10761 2003-06-29  Miguel de Icaza  <miguel@ximian.com>
10762
10763         * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
10764         complete;  Fixes #37521.
10765
10766         * delegate.cs: Use Modifiers.TypeAttr to compute the
10767         TypeAttributes, instead of rolling our own.  This makes the flags
10768         correct for the delegates.
10769
10770 2003-06-28  Miguel de Icaza  <miguel@ximian.com>
10771
10772         * class.cs (Constructor.Define): Set the private flag for static
10773         constructors as well.
10774
10775         * cs-parser.jay (statement_expression): Set the return value to
10776         null, to avoid a crash when we catch an error.
10777
10778 2003-06-24  Miguel de Icaza  <miguel@ximian.com>
10779
10780         * cs-parser.jay: Applied patch from Jackson that adds support for
10781         extern and unsafe modifiers to destructor declarations.
10782
10783         * expression.cs: Report error 21 if the user is trying to index a
10784         System.Array.
10785
10786         * driver.cs: Add an error message, suggested by the bug report.
10787
10788         * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
10789         if we do not have a ": this ()" constructor initializer.  Fixes 45149
10790
10791 2003-06-14  Miguel de Icaza  <miguel@ximian.com>
10792
10793         * namespace.cs: Add some information to reduce FAQs.
10794
10795 2003-06-13  Miguel de Icaza  <miguel@ximian.com>
10796
10797         * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
10798         underlying enumeration types.  Fixes #43915.
10799
10800         * expression.cs: Treat ushort/short as legal values to be used in
10801         bitwise operations.
10802
10803 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
10804
10805         * delegate.cs: transfer custom attributes for paramenters from
10806         the delegate declaration to Invoke and BeginInvoke.
10807
10808 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
10809
10810         * attribute.cs: handle custom marshalers and emit marshal info
10811         for fields, too.
10812
10813 2003-05-28  Hector E. Gomez Morales  <hgomez_36@flashmail.com>
10814
10815         * makefile.gnu: Added anonymous.cs to the compiler sources.
10816
10817 2003-05-28  Miguel de Icaza  <miguel@ximian.com>
10818
10819         * iterators.cs: Change the name of the proxy class to include two
10820         underscores.
10821
10822         * cs-parser.jay: Update grammar to include anonymous methods.
10823
10824         * anonymous.cs: new file.
10825
10826 2003-05-27  Miguel de Icaza  <miguel@ximian.com>
10827
10828         * class.cs (Field.Define): Add missing test for pointers and
10829         safety. 
10830
10831 2003-05-27  Ravi Pratap  <ravi@ximian.com>
10832
10833         * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
10834         we use the stobj opcode.
10835
10836         (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
10837         since it wasn't the correct fix. 
10838
10839         It still is puzzling that we are required to use stobj for IntPtr
10840         which seems to be a ValueType.
10841
10842 2003-05-26  Miguel de Icaza  <miguel@ximian.com>
10843
10844         * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
10845         during regular simple name resolution.   Now, the trick is that
10846         instead of returning for processing the simplename, we do a
10847         TypeManager.LookupType (ie, a rooted lookup as opposed to a
10848         contextual lookup type).   If a match is found, return that, if
10849         not, return for further composition.
10850
10851         This fixes long-standing 30485.
10852
10853         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
10854         using the address to initialize an object, do an Stobj instead of
10855         using the regular Stelem.
10856
10857         (IndexerAccess.Emit, IndexerAccess.EmitAssign):
10858         Pass `is_base_indexer' to Invocation.EmitCall instead of false.
10859         Because if we are a BaseIndexerAccess that value will be true.
10860         Fixes 43643.
10861
10862         * statement.cs (GotoCase.Resolve): Return after reporting an
10863         error, do not attempt to continue. 
10864
10865         * expression.cs (PointerArithmetic.Emit): If our operand is a
10866         long, convert our constants to match the operand before
10867         multiplying.  Convert to I type before adding.   Fixes 43670.
10868
10869 2003-05-14  Ravi Pratap  <ravi@ximian.com>
10870
10871         * enum.cs (ImplicitConversionExists) : Rename to
10872         ImplicitEnumConversionExists to remove ambiguity. 
10873
10874         * ecore.cs (NullCast): New type of cast expression class which
10875         basically is very similar to EmptyCast with the difference being
10876         it still is a constant since it is used only to cast a null to
10877         something else
10878         (eg. (string) null)
10879
10880         * convert.cs (ImplicitReferenceConversion): When casting a null
10881         literal, we return a NullCast.
10882
10883         * literal.cs (NullLiteralTyped): Remove - I don't see why this
10884         should be around anymore.
10885
10886         The renaming (reported was slightly wrong). Corrections:
10887
10888         ConvertImplicitStandard -> ImplicitConversionStandard
10889         ConvertExplicitStandard -> ExplicitConversionStandard
10890
10891         * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
10892         before passing them in !
10893
10894         * convert.cs (ImplicitConversionStandard): When comparing for
10895         equal expr and target types, ensure that expr is not a
10896         NullLiteral.
10897
10898         In general, we must not be checking (expr_type ==
10899         target_type) in the top level conversion methods
10900         (ImplicitConversion, ExplicitConversion etc). This checking is
10901         done in the methods that they delegate to.
10902
10903 2003-05-20  Miguel de Icaza  <miguel@ximian.com>
10904
10905         * convert.cs: Move Error_CannotConvertType,
10906         ImplicitReferenceConversion, ImplicitReferenceConversionExists,
10907         ImplicitNumericConversion, ImplicitConversionExists,
10908         ImplicitUserConversionExists, StandardConversionExists,
10909         FindMostEncompassedType, FindMostSpecificSource,
10910         FindMostSpecificTarget, ImplicitUserConversion,
10911         ExplicitUserConversion, GetConversionOperators,
10912         UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
10913         TryImplicitIntConversion, Error_CannotConvertImplicit,
10914         ConvertImplicitRequired, ConvertNumericExplicit,
10915         ExplicitReferenceConversionExists, ConvertReferenceExplicit,
10916         ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
10917         its own file.
10918
10919         Perform the following renames:
10920
10921         StandardConversionExists -> ImplicitStandardConversionExists
10922         ConvertImplicit -> ImplicitConversion
10923         ConvertImplicitStandard -> ImplicitStandardConversion
10924         TryImplicitIntConversion -> ImplicitIntConversion
10925         ConvertImplicitRequired -> ImplicitConversionRequired
10926         ConvertNumericExplicit -> ExplicitNumericConversion
10927         ConvertReferenceExplicit -> ExplicitReferenceConversion
10928         ConvertExplicit -> ExplicitConversion
10929         ConvertExplicitStandard -> ExplicitStandardConversion
10930
10931 2003-05-19  Martin Baulig  <martin@ximian.com>
10932
10933         * statement.cs (TypeInfo.StructInfo): Made this type protected.
10934         (TypeInfo): Added support for structs having structs as fields.
10935
10936         * ecore.cs (FieldExpr): Implement IVariable.
10937         (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
10938         VariableInfo for the field.
10939
10940 2003-05-18  Martin Baulig  <martin@ximian.com>
10941
10942         * expression.cs (This.DoResolve): Report a CS0027 if we're
10943         emitting a field initializer.
10944
10945 2003-05-18  Martin Baulig  <martin@ximian.com>
10946
10947         * expression.cs (This.ResolveBase): New public function.
10948         (This.DoResolve): Check for CS0188.
10949
10950         * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
10951         This.Resolve().
10952
10953         * ecore.cs (MethodGroupExpr.DoResolve): Set the
10954         `instance_expression' to null if we don't have any non-static
10955         methods.
10956
10957 2003-05-18  Martin Baulig  <martin@ximian.com>
10958
10959         Reworked the way how local variables and parameters are handled by
10960         the flow analysis code.
10961
10962         * statement.cs (TypeInfo, VariableMap): New public classes.
10963         (VariableInfo): New public class.  This is now responsible for
10964         checking whether a variable has been assigned.  It is used for
10965         parameters and local variables.
10966         (Block.EmitMeta): Take the InternalParameters as argument; compute
10967         the layout of the flow vectors here.
10968         (Block.LocalMap, Block.ParameterMap): New public properties.
10969         (FlowBranching): The .ctor doesn't get the InternalParameters
10970         anymore since Block.EmitMeta() now computes the layout of the flow
10971         vector.
10972         (MyStructInfo): This class is now known as `StructInfo' and nested
10973         in `TypeInfo'; we don't access this directly anymore.
10974
10975         * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
10976         property and removed IsAssigned(), IsFieldAssigned(),
10977         SetAssigned() and SetFieldAssigned(); we now call them on the
10978         VariableInfo so we don't need to duplicate this code everywhere.
10979
10980         * expression.cs (ParameterReference): Added `Block block' argument
10981         to the .ctor.
10982         (LocalVariableReference, ParameterReference, This): The new
10983         VariableInfo class is now responsible for all the definite
10984         assignment stuff.
10985
10986         * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
10987         IsParameterAssigned, SetParameterAssigned): Removed.
10988
10989 2003-05-18  Martin Baulig  <martin@ximian.com>
10990
10991         * typemanager.cs (InitCoreTypes): Try calling
10992         SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
10993         the 3-args-version.  Corlib now also needs our `void_type'.
10994         (GetMethod): Added overloaded version which takes an optional
10995         `bool report_errors' to allow lookups of optional methods.
10996
10997 2003-05-12  Martin Baulig  <martin@ximian.com>
10998
10999         * statement.cs (VariableInfo): Renamed to LocalInfo since it's
11000         only used for locals and not for parameters.
11001
11002 2003-05-12  Miguel de Icaza  <miguel@ximian.com>
11003
11004         * support.cs (InternalParameters.ParameterType): Return the
11005         ExternalType of the parameter.
11006
11007         * parameter.cs (Parameter.ExternalType): drop the two arguments,
11008         they were unused.
11009
11010 2003-05-11  Miguel de Icaza  <miguel@ximian.com>
11011
11012         * class.cs (MethodData.Define): Do not set the `newslot' on
11013         interface members, if they are also flagged as "override".
11014
11015         * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
11016         better code for ++i and i++.  This only works for static fields
11017         and local variables.
11018
11019         * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
11020         want to pull the DeclSpace out of the builder_to_declspace instead
11021         of the TypeBuilder (like in TypeContainer.FindMembers).
11022
11023         * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
11024         instead of LookupTypeContainer.  Fixes the crash on .NET for
11025         looking up interface members.
11026
11027         * const.cs: Create our own emit context during the Definition
11028         stage, so that constants are evaluated in the proper context, when
11029         a recursive definition happens.
11030
11031 2003-05-11  Martin Baulig  <martin@ximian.com>
11032
11033         * statement.cs (Block.CreateSwitchBlock): New method.  Creates a
11034         new block for a switch section.
11035         (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
11036         the adding/lookup in the switch block.  Fixes #39828.
11037
11038 2003-05-09  Miguel de Icaza  <miguel@ximian.com>
11039
11040         * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
11041         functionality: I needed to convert the data after I had performed
11042         the add/sub operation into the operands type size.
11043
11044         * ecore.cs (ImplicitReferenceConversion): When boxing an interface
11045         pass the type for the box operation, otherwise the resulting
11046         object would have been of type object.
11047
11048         (BoxedCast): Add constructor to specify the type to box as.
11049
11050 2003-05-07  Miguel de Icaza  <miguel@ximian.com>
11051
11052         * iterators.cs: I was reusing the `count' variable inadvertently,
11053         take steps to not allow this to happen.
11054
11055 2003-05-06  Miguel de Icaza  <miguel@ximian.com>
11056
11057         * attribute.cs (Attribute.Resolve): Params attributes are encoded
11058         by creating an array at the point where the params starts and
11059         putting all those arguments there, then adjusting the size of the
11060         array.
11061
11062 2003-05-05  Miguel de Icaza  <miguel@ximian.com>
11063
11064         * expression.cs (New.AddressOf): Implement interface
11065         IMemoryLocation.  This is used when the `new' operator is used in
11066         the context of an invocation to a method on a value type.
11067
11068         See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
11069         example. 
11070
11071         * namespace.cs: Also check the using aliases here.
11072
11073         * driver.cs: Move the test for using validity after the types have
11074         been entered, so we do a single pass that also includes the using
11075         aliases. 
11076
11077         * statement.cs (Try.Resolve): Avoid crashing if there is a failure
11078         in the regular case.   CreateSiblingForFinally is doing extra
11079         error checking.
11080
11081         * attribute.cs (GetAttributeArgumentExpression): Store the result
11082         on an out value, and use the return value to indicate failure
11083         instead of using null (which is a valid return for Constant.GetValue).
11084
11085         * statement.cs: Perform the analysis flow for the increment
11086         portion after the statement, because this will be the real flow of
11087         execution.  Fixes #42385
11088
11089         * codegen.cs (EmitContext.EmitArgument,
11090         EmitContext.EmitStoreArgument): New helper functions when the
11091         RemapToProxy flag is set.
11092
11093         * expression.cs (ParameterReference.EmitLdarg): Expose this useful
11094         function.
11095
11096         Add support for remapping parameters. 
11097
11098         * iterators.cs: Propagate parameter values;  Store parameter
11099         values in the proxy classes.
11100
11101 2003-05-04  Miguel de Icaza  <miguel@ximian.com>
11102
11103         * ecore.cs (FieldExpr): Fix an obvious bug.  static fields do not
11104         need a proxy reference;  I do not know what I was thinking
11105
11106         * cs-parser.jay (constructor_initializer): catch another error,
11107         and display nice message.
11108
11109         (field_declaration): catch void field declaration
11110         to flag a better error. 
11111
11112         * class.cs (MemberBase.CheckBase): Report an error instead of a
11113         warning if a new protected member is declared in a struct. 
11114         (Field.Define): catch the error of readonly/volatile.
11115
11116         * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
11117
11118         (FieldExpr.AddressOf): ditto.  Catch error where the address of a
11119         volatile variable is taken
11120
11121 2003-05-02  Miguel de Icaza  <miguel@ximian.com>
11122
11123         * statement.cs (Fixed.Resolve): Report an error if we are not in
11124         an unsafe context.
11125
11126 2003-05-01  Miguel de Icaza  <miguel@ximian.com>
11127
11128         * typemanager.cs: reuse the code that handles type clashes for
11129         delegates and enumerations.
11130
11131         * class.cs (Report28): Always report.
11132
11133         * expression.cs (EncodeAsAttribute): Allow nulls here.
11134
11135 2003-04-28  Miguel de Icaza  <miguel@ximian.com>
11136
11137         * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
11138         the functionality for testing whether an expression is valid for
11139         an attribute here.  Also handle the case of arrays of elements
11140         being stored. 
11141
11142         * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
11143         encoding a linear array into an array of objects that are suitable
11144         to be passed to an CustomAttributeBuilder.
11145
11146         * delegate.cs: Check unsafe types being used outside of an Unsafe context.
11147
11148         * ecore.cs: (FieldExpr): Handle field remapping here.
11149
11150         * iteratators.cs: Pass the instance variable (if the method is an
11151         instance method) to the constructors, so we can access the field
11152         variables on the class.
11153
11154         TODO: Test this with structs.  I think the THIS variable on
11155         structs might have to be a pointer, and not a refenrece
11156
11157 2003-04-27  Miguel de Icaza  <miguel@ximian.com>
11158
11159         * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
11160         local variables to fields in a proxy class.
11161
11162         * iterators.cs (PopulateProxy): Rename our internal fields to
11163         <XXX>.  
11164         Create a <THIS> field if we are an instance method, so we can
11165         reference our parent container variables.
11166         (MapVariable): Called back from the EmitContext code to enter a
11167         new variable to field mapping into the proxy class (we just create
11168         a FieldBuilder).
11169
11170         * expression.cs
11171         (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
11172         for using the remapped locals to fields.
11173
11174         I placed the code here, because that gives the same semantics to
11175         local variables, and only changes the Emit code.
11176
11177         * statement.cs (Fixed.Resolve): it is not allowed to have fixed
11178         statements inside iterators.
11179         (VariableInfo): Add a FieldBuilder for the cases when we are
11180         remapping local variables to fields in a proxy class
11181
11182         * ecore.cs (SimpleNameResolve): Avoid testing two times for
11183         current_block != null.
11184
11185         * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
11186         not cope with strings, as it has been moved to the
11187         TableSwitchEmit.  Fixed bug in switch generation.
11188
11189         * expression.cs (New.DoResolve): Provide more context for the user
11190         when reporting an error.
11191
11192         * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
11193         pointers. 
11194
11195         * expression.cs (MemberAccess.DoResolve): When we get a type back,
11196         check the permissions for it.  Note than in a type-resolution
11197         context the check was already present in DeclSpace.ResolveType,
11198         but was missing from the MemberAccess.
11199
11200         (ArrayCreation.CheckIndices): warn if the user has
11201         more nested levels of expressions, but there are no more
11202         dimensions specified.  Avoids crash on bug 41906.
11203
11204 2003-04-26  Miguel de Icaza  <miguel@ximian.com>
11205
11206         * statement.cs (Block): replace Implicit bool, for a generic
11207         flags.   
11208         New flag: `Unchecked'.  This is used during the EmitMeta phase
11209         (which is out-of-line with the regular Resolve/Emit process for a
11210         statement, as this is done ahead of time, but still gets a chance
11211         to call constant resolve).
11212
11213         (Block.Flags): new enum for adding a new flag.
11214
11215         (Block.EmitMeta): track the state of unchecked.
11216
11217         (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
11218         to enable constant resolution to work there as well.
11219
11220 2003-04-22  Miguel de Icaza  <miguel@ximian.com>
11221
11222         * typemanager.cs (ienumerable_type): Also look up
11223         System.Collections.IEnumerable. 
11224
11225 2003-04-21  Miguel de Icaza  <miguel@ximian.com>
11226
11227         TODO: Test more than one conditional per method.
11228
11229         * class.cs (Indexer.Define): Report the location where the user is
11230         referencing the unsupported feature.
11231
11232         (MethodData): Overload the use of `conditionals' to
11233         minimize the creation of needless ArrayLists.   This saves roughly
11234         212kb on my machine.
11235
11236         (Method): Implement the new IIteratorContainer interface.
11237         (Method.SetYields): Implement the method by setting the ModFlags
11238         to contain METHOD_YIELDS.
11239
11240         * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
11241         which just got set to null.
11242
11243         * iterators.cs: New file.
11244
11245         (Yield, YieldBreak): New statements.
11246
11247         * statement.cs (Return.Resolve): Flag an error if we are used in
11248         an iterator method.
11249
11250         * codegen.cs (InIterator): New flag set if the code is being
11251         compiled in an iterator method.
11252
11253         * modifiers.cs: New flag METHOD_YIELDS.  This modifier is an
11254         internal modifier, and we just use it to avoid adding extra
11255         fields, as this is seldom used.  
11256
11257         * cs-parser.jay: Add yield_statement (yield and yield break).
11258
11259         * driver.cs: New flag -v2 to turn on version 2 features. 
11260
11261         * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
11262         hashtable when v2 is enabled.
11263
11264 2003-04-20  Miguel de Icaza  <miguel@ximian.com>
11265
11266         * typemanager.cs (TypeManager.NamespaceClash): Use to check if
11267         there is already a namespace defined with this name.
11268
11269         (TypeManager.InitCoreTypes): Remove the temporary workaround, as
11270         people upgraded their corlibs.
11271
11272         (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
11273         always use fully qualified types, no need to use the compiler
11274         front end.
11275
11276         (TypeManager.IsNamespace): Use binarysearch.
11277
11278         * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
11279         AddDelegate): I did not quite use the new IsValid API properly: I
11280         have to pass the short-name and the fullname.  I was passing only
11281         the basename instead of the fullname sometimes. 
11282
11283         (TypeContainer.DefineType): call NamespaceClash.
11284
11285         * interface.cs (Interface.DefineType): use NamespaceClash before
11286         defining the type.
11287
11288         * delegate.cs (Delegate.DefineType): use NamespaceClash before
11289         defining the type.
11290
11291         * enum.cs: (Enum.DefineType): use NamespaceClash before
11292         defining the type.
11293
11294         * typemanager.cs (: 3-line patch that gives us some tasty 11%
11295         speed increase.  First, use the negative_hits cache when we get a
11296         negative.  Second, add the type with its full original name
11297         instead of the new . and + encoded name (reflection uses + to
11298         separate type from a nested type).  Use LookupTypeReflection
11299         directly which bypasses the type->name hashtable (that we already
11300         know does not contain the type.
11301
11302         * decl.cs (DeclSpace.ResolveTypeExpr): track the
11303         location/container type. 
11304
11305         * driver.cs: When passing utf8, use directly the UTF8Encoding.
11306
11307 2003-04-19  Miguel de Icaza  <miguel@ximian.com>
11308
11309         * decl.cs (ResolveTypeExpr): Mirror check acess here too.
11310
11311         * delegate.cs (NewDelegate.Resolve): Test whether an instance
11312         method is being referenced in the method group from a static
11313         context, and report error 120 if so.
11314
11315         * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
11316         Error118. 
11317
11318         * typemanager.cs: Add intermediate namespaces (if a namespace A.B
11319         is created, we create the A namespace).
11320
11321         * cs-parser.jay: A namespace also introduces a DeclarationFound.
11322         Fixes #41591
11323
11324 2003-04-18  Miguel de Icaza  <miguel@ximian.com>
11325
11326         * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
11327         invocation to ModuleBuilder.GetType with the same values will
11328         return a new type instance, so we need to cache its return
11329         values. 
11330
11331         * expression.cs (Binary.ResolveOperator): Only allow the compare
11332         operators on enums if they are of the same type.
11333
11334         * ecore.cs (Expression.ImplicitReferenceConversion): handle target
11335         types of ValueType on their own case.  Before we were giving them
11336         the same treatment as objects.
11337
11338         * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
11339         fullname.  Short name is used to compare against container name.
11340         Fullname is used to check against defined namespace names.
11341
11342         * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
11343         AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
11344
11345         (Method.CheckBase): Call parent.
11346         (MemberBase.CheckBase): Check for protected members on sealed
11347         classes.
11348         (PropertyBase.CheckBase): Call parent.
11349         (Field.Define): Call parent.
11350
11351         * report.cs: Negative error codes are now mapped to 8000 - code,
11352         so that the display is render more nicely.
11353
11354         * typemanager.cs: Do not use try/catch, instead report a regular
11355         error. 
11356
11357         (GetPointerType, GetReferenceType): These methods provide
11358         mechanisms to obtain the T* and T& from a T.  We had the code
11359         previously scattered around the code base, and it also used
11360         TypeManager.LookupType that would go through plenty of caches.
11361         This one goes directly to the type source.
11362
11363         In some places we did the Type.GetType followed by
11364         ModuleBuilder.GetType, but not in others, so this unifies the
11365         processing as well.
11366
11367         * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
11368         statements now that we have namespace information.
11369
11370         * typemanager.cs (IsNamespace): New method, returns whether the
11371         string presented is a namespace or not.
11372
11373         (ComputeNamespaces): New public entry point, computes the list of
11374         available namespaces, using the GetNamespaces API call in Mono, or
11375         the slower version in MS.NET.   
11376
11377         Now before we start the semantic analysis phase, we have a
11378         complete list of namespaces including everything that the user has
11379         provided.
11380
11381         Deleted old code to cache namespaces in .nsc files.
11382
11383 2003-04-17  Miguel de Icaza  <miguel@ximian.com>
11384
11385         * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
11386         class/struct location definition Location for the implicit
11387         constructor location.
11388
11389         (Operator.Define): Use the location of the operator for the
11390         implicit Method definition.
11391
11392         (Constructor.Emit): use the constructor location for the implicit
11393         base initializer constructor.
11394
11395         * ecore.cs: Remove ITypeExpression.  This interface is now gone,
11396         and the Expression class now contains two new methods:
11397
11398         ResolveAsTypeStep and ResolveAsTypeTerminal.  This is used to
11399         isolate type lookup from the rest of the resolution process.
11400
11401         Since we use Expressions to hold type definitions due to the way
11402         we parse the input we have historically overloaded Resolve to
11403         perform the Type lookups if a special flag is passed.  Now this is
11404         eliminated and two methods take their place. 
11405
11406         The differences in the two methods between xStep and xTerminal is
11407         that xStep is involved in our current lookup system that uses
11408         SimpleNames to compose a name, while xTerminal is used just to
11409         catch the case where the simplename lookup failed.
11410
11411 2003-04-16  Miguel de Icaza  <miguel@ximian.com>
11412
11413         * expression.cs (ResolveMemberAccess): Remove redundant code.
11414         TypeExpr expressions are always born fully resolved.
11415
11416         * interface.cs (PopulateMethod): Do not lookup the types twice.
11417         We were doing it once during SemanticAnalysis and once during
11418         PopulateMethod.
11419
11420         * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
11421         in local variable type definitions, were being returned as a
11422         SimpleName (we decomposed everything into a string), that is
11423         because primary_expression was being used instead of a type in the
11424         grammar (reduce/reduce conflicts).
11425
11426         The part that was wrong is that we converted the expression into a
11427         string (an oversimplification in one hand, compounded with primary
11428         expressions doing string concatenation).
11429
11430         So things like:
11431
11432         A.B.C [] x;
11433
11434         Would return "A.B.C[]" as a SimpleName.  This stopped things like
11435         using clauses from working on this particular context.  And a type
11436         was being matched directly against "A.B.C[]".
11437
11438         We now use the correct approach, and allow for ComposedCast to be
11439         part of the unary expression.  So the "A.B.C []" become a composed
11440         cast of "A.B.C" (as a nested group of MemberAccess with a
11441         SimpleName at the end) plus the rank composition "[]". 
11442
11443         Also fixes 35567
11444
11445 2003-04-10  Miguel de Icaza  <miguel@ximian.com>
11446
11447         * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
11448         for the access level checking.
11449
11450         * class.cs: Cosmetic changes.  Renamed `TypeContainer parent' to
11451         `TypeContainer container', because I kept getting confused when I
11452         was debugging this code.
11453
11454         * expression.cs (Indexers): Instead of tracking getters/setters,
11455         we now track them in parallel.  We create one arraylist less, but
11456         most importantly it is possible now for the LValue code to find a
11457         matching get for a set.
11458
11459         (IndexerAccess.DoResolveLValue): Update the code.
11460         GetIndexersForType has been modified already to extract all the
11461         indexers from a type.  The code assumed it did not.
11462
11463         Also make the code set the correct return type for the indexer.
11464         This was fixed a long time ago for properties, but was missing for
11465         indexers.  It used to be void_type.
11466
11467         (Binary.Emit): Test first for doubles instead of
11468         floats, as they are more common.
11469
11470         (Binary.EmitBranchable): Use the .un version of the branch opcodes
11471         when dealing with floats and the <=, >= operators.  This fixes bug
11472         #39314 
11473
11474         * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
11475         to load the array value by emitting a load on the foreach variable
11476         type.  This was incorrect.  
11477
11478         We now emit the code to load an element using the the array
11479         variable type, and then we emit the conversion operator.
11480
11481         Fixed #40176
11482
11483 2003-04-10  Zoltan Varga  <vargaz@freemail.hu>
11484
11485         * attribute.cs: Avoid allocation of ArrayLists in the common case.
11486
11487 2003-04-09  Miguel de Icaza  <miguel@ximian.com>
11488
11489         * class.cs (MethodSignature.InheritableMemberSignatureCompare):
11490         test for protection before we test for signatures. 
11491
11492         (MethodSignature.ToString): implement.
11493
11494         * expression.cs (Unary.TryReduceNegative): Add missing minus sign
11495         to the case where we reduced into a LongConstant.
11496
11497         * decl.cs (CheckAccessLevel): If the type is an array, we can not
11498         depend on whether the information is acurrate, because the
11499         Microsoft runtime will always claim that the array type is public,
11500         regardless of the real state.
11501
11502         If the type is a pointer, another problem happens: the type is
11503         reported as non-public in Microsoft.  
11504
11505         In both cases we have to call CheckAccessLevel recursively with
11506         the underlying type as the argument to be tested.
11507
11508 2003-04-08  Miguel de Icaza  <miguel@ximian.com>
11509
11510         * assign.cs (Assign.Emit): If we are dealing with a compound
11511         assignment expression, we should use the code path that stores the
11512         intermediate result in a temporary value.  This fixes #40903.
11513
11514         *expression.cs (Indirection.ToString): Provide ToString method for
11515         debugging. 
11516
11517 2003-04-08  Zoltan Varga  <vargaz@freemail.hu>
11518
11519         * class.cs: Null out fields holding references to Block objects so
11520         they can be garbage collected.
11521
11522         * expression.cs (OverloadResolve): Remove unused local.
11523
11524 2003-04-07  Martin Baulig  <martin@ximian.com>
11525
11526         * codegen.cs (EmitContext.CurrentFile): New public field.
11527         (EmitContext.Mark): Use the CurrentFile to check whether the
11528         location is in the correct file.
11529         (EmitContext.EmitTopBlock): Initialize CurrentFile here.
11530
11531 2003-04-07  Martin Baulig  <martin@ximian.com>
11532
11533         * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
11534
11535         * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
11536         location.  [FIXME: The location argument which gets passed to this
11537         method is sometimes wrong!]
11538
11539 2003-04-07  Nick Drochak <ndrochak@gol.com>
11540
11541         * codegen.cs: Be more verbose when we can't find the symbol writer dll.
11542
11543 2003-04-07  Miguel de Icaza  <miguel@ximian.com>
11544
11545         * expression.cs (Indirection.EmitAssign): We were using the
11546         temporary, but returning immediately instead of continuing the
11547         EmitAssing flow.
11548
11549 2003-04-06  Martin Baulig  <martin@ximian.com>
11550
11551         * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
11552         if it's a nested child, but also deriving from the outer class.
11553         See test 190.cs.
11554
11555         * typemanager.cs (IsNestedChildOf): Make this work if it's a
11556         nested child, but also deriving from the outer class.  See
11557         test-190.cs.
11558         (FilterWithClosure): We may access private members of the outer
11559         class if we're a nested child and deriving from the outer class.
11560         (RealMemberLookup): Only set `closure_private_ok' if the
11561         `original_bf' contained BindingFlags.NonPublic.
11562
11563 2003-04-05  Martin Baulig  <martin@ximian.com>
11564
11565         * expression.cs (SizeOf.DoResolve): Use ResolveTypeExpr, so we can
11566         probe if its a type parameter, and if so, flag an error.
11567
11568         * decl.cs: Move here the SetParameterInfo code from class.cs.
11569         Handle IsGeneric here.
11570
11571         Handle a variety of errors in the parameter info definition.
11572
11573         * ecore.cs (SimpleName.DoResolveType): Handle look ups for generic
11574         type parameters here.
11575
11576         * cs-parser.jay (class_declaration): report errors for parameters
11577         here as well.
11578
11579 2003-01-21  Miguel de Icaza  <miguel@ximian.com>
11580
11581         * generic.cs: New file, contains support code for generics.
11582
11583         * cs-parser.jay: Remove OP_SHIFT_LEFT, OP_SHIFT_RIGHT,
11584         OP_SHIFT_LEFT_ASSIGN, OP_SHIFT_RIGHT_ASSIGN.
11585
11586         Update parser for the above removals.
11587
11588         * cs-tokenizer.cs: Do not handle <<= or >>= specially.  This is
11589         now taken care of in the parser.
11590
11591 2003-04-02  Miguel de Icaza  <miguel@ximian.com>
11592
11593         * class.cs (Event.Define): Do not allow abstract events to have
11594         initializers. 
11595
11596 2003-04-01  Miguel de Icaza  <miguel@ximian.com>
11597
11598         * cs-parser.jay: Add error productions for ADD/REMOVE missing a
11599         block in event declarations.
11600
11601         * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
11602         value type, get its address.
11603
11604         * expression.cs (Is.Emit): For action `LeaveOnStack' we were
11605         leaving a class on the stack instead of a boolean value (int
11606         0/1).  Change the code so we compare against null, and then the
11607         result against zero.
11608
11609         * class.cs (TypeContainer.GetClassBases): We were checking for the
11610         parent class being sealed too late.
11611
11612         * expression.cs (Binary.Emit): For <= and >= when dealing with
11613         floating point values, use cgt.un and clt.un instead of cgt and
11614         clt alone.
11615
11616 2003-04-01  Zoltan Varga  <vargaz@freemail.hu>
11617
11618         * statement.cs: Apply the same optimization as MS: skip the 
11619         GetEnumerator returning an IEnumerator, and use the one returning a 
11620         CharEnumerator instead. This allows us to avoid the try-finally block 
11621         and the boxing.
11622
11623 2003-03-31  Gaurav Vaish <gvaish_mono@lycos.com>
11624
11625         * cs-parser.jay: Attributes cannot be applied to
11626                          namespaces. Fixes #40473
11627
11628 2003-03-31  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11629
11630         * class.cs:
11631         (Add*): check if the name is valid using the full name for constants,
11632         fields, properties and events.
11633
11634 2003-03-28  Miguel de Icaza  <miguel@ximian.com>
11635
11636         * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
11637         char constants to be part of the enumeration.
11638
11639         * expression.cs (Conditional.DoResolve): Add support for operator
11640         true. Implements the missing functionality from 14.12
11641
11642         * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
11643         operator true/false as required by the spec.
11644
11645         * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
11646         implicit conversion to boolean.
11647
11648         * statement.cs (Statement.ResolveBoolean): A boolean expression is
11649         also one where the type implements `operator true'. 
11650
11651         * ecore.cs (Expression.GetOperatorTrue): New helper routine to
11652         get an expression that will invoke operator true based on an
11653         expression.  
11654
11655         (GetConversionOperators): Removed the hack that called op_True
11656         here.  
11657
11658         (Expression.ResolveBoolean): Move this from Statement.
11659
11660 2003-03-17  Miguel de Icaza  <miguel@ximian.com>
11661
11662         * ecore.cs (FieldExpr): do not allow initialization of initonly
11663         fields on derived classes
11664
11665 2003-03-13  Martin Baulig  <martin@ximian.com>
11666
11667         * statement.cs (Block.Emit): Call ig.BeginScope() and
11668         ig.EndScope() when compiling with debugging info; call
11669         LocalBuilder.SetLocalSymInfo _after_ opening the scope.
11670
11671 2003-03-08  Miguel de Icaza  <miguel@ximian.com>
11672
11673         * expression.cs (Indexers): Do not construct immediately, allow
11674         for new members to be appended as we go.  Fixes 38143
11675
11676 2003-03-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11677
11678         * expression.cs: save/restore context when resolving an unchecked
11679         expression.
11680
11681 2003-03-05  Miguel de Icaza  <miguel@ximian.com>
11682
11683         * cfold.cs: Catch division by zero in modulus operator during
11684         constant folding.
11685
11686 2003-03-03  Miguel de Icaza  <miguel@ximian.com>
11687
11688         * interface.cs (Interface.DefineMembers): Avoid defining members
11689         twice. 
11690
11691 2003-02-27  Miguel de Icaza  <miguel@ximian.com>
11692
11693         * driver.cs: handle the +/- options for -noconfig
11694
11695         * statement.cs (Unckeched.Resolve): Also track the state of
11696         unchecked in the Resolve phase.
11697
11698 2003-02-27  Martin Baulig  <martin@ximian.com>
11699
11700         * ecore.cs (Expression.MemberLookup): Don't create a
11701         MethodGroupExpr for something which is not a method.  Fixes #38291.
11702
11703 2003-02-25  Miguel de Icaza  <miguel@ximian.com>
11704
11705         * class.cs (MemberBase.CheckParameters): Also check that the type
11706         is unmanaged if it is a pointer.
11707
11708         * expression.cs (SizeOf.Resolve): Add location information.
11709
11710         * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
11711         a managed type is declared.
11712
11713         * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
11714         parameter modifiers as well.  Fixes bug 38606
11715
11716         * class.cs: Very sad.  Am backing out the speed up changes
11717         introduced by the ArrayList -> Array in the TypeContainer, as they
11718         were not actually that much faster, and introduced a bug (no error
11719         reports on duplicated methods).
11720
11721         * assign.cs (CompoundAssign.DoLResolve): Resolve the original
11722         source first, this will guarantee that we have a valid expression
11723         before calling in lower levels functions that will require a
11724         resolved object.  Then use this original_source in the
11725         target.ResolveLValue instead of the original source that was
11726         passed to us.
11727
11728         Another change.  Use target.Resolve instead of LValueResolve.
11729         Although we are resolving for LValues, we will let the Assign code
11730         take care of that (it will be called again from Resolve).  This
11731         basically allows code like this:
11732
11733         class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
11734         class Y { void A (X x) { x [0] += o; }
11735
11736         The problem was that the indexer was trying to resolve for
11737         set_Item (idx, object o) and never finding one.  The real set_Item
11738         was set_Item (idx, X).  By delaying the process we get the right
11739         semantics. 
11740
11741         Fixes bug 36505
11742
11743 2003-02-23  Martin Baulig  <martin@ximian.com>
11744
11745         * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
11746         while calling DoEmit ().
11747
11748         * codegen.cs (EmitContext.Mark): Don't mark locations in other
11749         source files; if you use the #line directive inside a method, the
11750         compiler stops emitting line numbers for the debugger until it
11751         reaches the end of the method or another #line directive which
11752         restores the original file.
11753
11754 2003-02-23  Martin Baulig  <martin@ximian.com>
11755
11756         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
11757
11758 2003-02-23  Martin Baulig  <martin@ximian.com>
11759
11760         * statement.cs (Block.AddChildVariableNames): We need to call this
11761         recursively, not just for our immediate children.
11762
11763 2003-02-23  Martin Baulig  <martin@ximian.com>
11764
11765         * class.cs (Event.Define): Always make the field private, like csc does.
11766
11767         * typemanager.cs (TypeManager.RealMemberLookup): Make events
11768         actually work, fixes bug #37521.
11769
11770 2003-02-23  Miguel de Icaza  <miguel@ximian.com>
11771
11772         * delegate.cs: When creating the various temporary "Parameters"
11773         classes, make sure that we call the ComputeAndDefineParameterTypes
11774         on those new parameters (just like we do with the formal ones), to
11775         allow them to be resolved in the context of the DeclSpace.
11776
11777         This fixes the bug that Dick observed in Bugzilla #38530.
11778
11779 2003-02-22  Miguel de Icaza  <miguel@ximian.com>
11780
11781         * expression.cs (ResolveMemberAccess): When resolving a constant,
11782         do not attempt to pull a constant if the value was not able to
11783         generate a valid constant.
11784
11785         * const.cs (LookupConstantValue): Do not report more errors than required.
11786
11787 2003-02-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11788
11789         * expression.cs: fixes bug #38328.
11790
11791 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
11792
11793         * class.cs: Changed all the various members that can be part of a
11794         class from being an ArrayList to be an Array of the right type.
11795         During the DefineType type_list, interface_list, delegate_list and
11796         enum_list are turned into types, interfaces, delegates and enums
11797         arrays.  
11798
11799         And during the member population, indexer_list, event_list,
11800         constant_list, field_list, instance_constructor_list, method_list,
11801         operator_list and property_list are turned into their real arrays.
11802
11803         Although we could probably perform this operation earlier, for
11804         good error reporting we need to keep the lists and remove the
11805         lists for longer than required.
11806
11807         This optimization was triggered by Paolo profiling the compiler
11808         speed on the output of `gen-sample-program.pl' perl script. 
11809
11810         * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
11811         not crash in methods like MemberLookupFailed that use this field.  
11812
11813         This problem arises when the compiler fails to resolve a type
11814         during interface type definition for example.
11815
11816 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
11817
11818         * expression.cs (Indexers.GetIndexersForType): Interfaces do not
11819         inherit from System.Object, so we have to stop at null, not only
11820         when reaching System.Object.
11821
11822 2003-02-17  Miguel de Icaza  <miguel@ximian.com>
11823
11824         * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
11825         DeclaredOnly because the parent indexer might have had a different
11826         name, but did not loop until the top of the hierarchy was reached.
11827
11828         The problem this one fixes is 35492: when a class implemented an
11829         indexer from an interface, we were getting the interface method
11830         (which was abstract) and we were flagging an error (can not invoke
11831         abstract method).
11832
11833         This also keeps bug 33089 functioning, and test-148 functioning.
11834
11835         * typemanager.cs (IsSpecialMethod): The correct way of figuring
11836         out if a method is special is to see if it is declared in a
11837         property or event, or whether it is one of the predefined operator
11838         names.   This should fix correctly #36804.
11839
11840 2003-02-15  Miguel de Icaza  <miguel@ximian.com>
11841
11842         The goal here is to remove the dependency on EmptyCast.Peel ().
11843         Killing it completely.
11844
11845         The problem is that currently in a number of places where
11846         constants are expected, we have to "probe" for an EmptyCast, and
11847         Peel, which is not the correct thing to do, as this will be
11848         repetitive and will likely lead to errors. 
11849
11850         The idea is to remove any EmptyCasts that are used in casts that
11851         can be reduced to constants, so we only have to cope with
11852         constants. 
11853
11854         This bug hunt was triggered by Bug 37363 and the desire to remove
11855         the duplicate pattern where we were "peeling" emptycasts to check
11856         whether they were constants.  Now constants will always be
11857         constants.
11858
11859         * ecore.cs: Use an enumconstant here instead of wrapping with
11860         EmptyCast.  
11861
11862         * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
11863         throwing me off.  By handling this we can get rid of a few hacks.
11864
11865         * statement.cs (Switch): Removed Peel() code.
11866
11867 2003-02-14  Miguel de Icaza  <miguel@ximian.com>
11868
11869         * class.cs: Location information for error 508
11870
11871         * expression.cs (New.DoResolve): Add a guard against double
11872         resolution of an expression.  
11873
11874         The New DoResolve might be called twice when initializing field
11875         expressions (see EmitFieldInitializers, the call to
11876         GetInitializerExpression will perform a resolve on the expression,
11877         and later the assign will trigger another resolution
11878
11879         This leads to bugs (#37014)
11880
11881         * delegate.cs: The signature for EndInvoke should contain any ref
11882         or out parameters as well.  We were not doing this in the past. 
11883
11884         * class.cs (Field.Define): Do not overwrite the type definition
11885         inside the `volatile' group.  Turns out that volatile enumerations
11886         were changing the type here to perform a validity test, which
11887         broke conversions. 
11888
11889 2003-02-12  Miguel de Icaza  <miguel@ximian.com>
11890
11891         * ecore.cs (FieldExpr.AddressOf): In the particular case of This
11892         and structs, we do not want to load the instance variable
11893
11894         (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
11895         enum_type has to be handled like an object reference (implicit
11896         conversions exists from this to object), but the regular IsClass
11897         and IsValueType tests will never return true for this one.
11898
11899         Also we use TypeManager.IsValueType instead of type.IsValueType,
11900         just for consistency with the rest of the code (this is only
11901         needed if we ever use the construct exposed by test-180.cs inside
11902         corlib, which we dont today).
11903
11904 2003-02-12  Zoltan Varga  <vargaz@freemail.hu>
11905
11906         * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
11907         just InternalCall.
11908
11909 2003-02-09  Martin Baulig  <martin@ximian.com>
11910
11911         * namespace.cs (Namespace..ctor): Added SourceFile argument.
11912         (Namespace.DefineNamespaces): New static public method; this is
11913         called when we're compiling with debugging to add all namespaces
11914         to the symbol file.
11915
11916         * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
11917         pass it to the Namespace's .ctor.
11918
11919         * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
11920         and MethodBase arguments; pass the namespace ID to the symwriter;
11921         pass the MethodBase instead of the token to the symwriter.
11922         (SymbolWriter.DefineNamespace): New method to add a namespace to
11923         the symbol file.
11924
11925 2003-02-09  Martin Baulig  <martin@ximian.com>
11926
11927         * symbolwriter.cs: New file.  This is a wrapper around
11928         ISymbolWriter with a cleaner API.  We'll dynamically Invoke()
11929         methods here in near future.
11930
11931 2003-02-09  Martin Baulig  <martin@ximian.com>
11932
11933         * codegen.cs (EmitContext.Mark): Just pass the arguments to
11934         ILGenerator.MarkSequencePoint() which are actually used by the
11935         symbol writer.
11936
11937 2003-02-09  Martin Baulig  <martin@ximian.com>
11938
11939         * location.cs (SourceFile): New public sealed class.  This
11940         contains the name and an index which is used in the location's token.
11941         (Location): Reserve an appropriate number of bits in the token for
11942         the source file instead of walking over that list, this gives us a
11943         really huge performance improvement when compiling with debugging.
11944
11945         * driver.cs (Driver.parse, Driver.tokenize_file): Take a
11946         `SourceFile' argument instead of a string.
11947         (Driver.ProcessFile): Add all the files via Location.AddFile(),
11948         but don't parse/tokenize here, we need to generate the list of all
11949         source files before we do that.
11950         (Driver.ProcessFiles): New static function.  Parses/tokenizes all
11951         the files.
11952
11953         * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
11954         instead of a string.
11955
11956         * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
11957         of a string.
11958
11959 2003-02-09  Martin Baulig  <martin@ximian.com>
11960
11961         * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
11962         filename on `#line default'.
11963
11964 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
11965
11966         * statement.cs: don't clear the pinned var when the fixed statement
11967         returns from the method (fixes bug#37752).
11968
11969 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
11970
11971         * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban) 
11972         to IsValueType.
11973
11974 2003-02-07  Martin Baulig  <martin@ximian.com>
11975
11976         * driver.cs: Removed the `--debug-args' command line argument.
11977
11978         * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
11979         automatically by the AsssemblyBuilder.
11980         (CodeGen.InitializeSymbolWriter): We don't need to call any
11981         initialization function on the symbol writer anymore.  This method
11982         doesn't take any arguments.
11983
11984 2003-02-03  Miguel de Icaza  <miguel@ximian.com>
11985
11986         * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
11987         from referenced assemblies as well.
11988
11989 2003-02-02  Martin Baulig  <martin@ximian.com>
11990
11991         * class.cs (MethodData.Emit): Generate debugging info for external methods.
11992
11993 2003-02-02  Martin Baulig  <martin@ximian.com>
11994
11995         * class.cs (Constructor.Emit): Open the symbol writer before
11996         emitting the constructor initializer.
11997         (ConstructorInitializer.Emit): Call ec.Mark() to allow
11998         single-stepping through constructor initializers.
11999
12000 2003-01-30  Miguel de Icaza  <miguel@ximian.com>
12001
12002         * class.cs: Handle error 549: do not allow virtual methods in
12003         sealed classes. 
12004
12005 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
12006
12007         * decl.cs: Check access levels when resolving types
12008
12009 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
12010
12011         * statement.cs: Add parameters and locals set in catch blocks that might 
12012         return to set vector
12013
12014 2003-01-29  Miguel de Icaza  <miguel@ximian.com>
12015
12016         * class.cs (Operator): Set the SpecialName flags for operators.
12017
12018         * expression.cs (Invocation.DoResolve): Only block calls to
12019         accessors and operators on SpecialName methods.
12020
12021         (Cast.TryReduce): Handle conversions from char constants.
12022
12023
12024 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
12025
12026         * statement.cs: small memory and time optimization in FlowBranching.
12027
12028 2003-01-28  Pedro Mart  <yoros@wanadoo.es>
12029
12030         * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
12031         problem that the last fix but in the other sid (Set).
12032
12033         * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
12034         access when there is no indexer in the hierarchy.
12035
12036 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
12037
12038         * class.cs: Combine some if statements.
12039
12040 2003-01-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12041
12042         * driver.cs: fixed bug #37187.
12043
12044 2003-01-27  Pedro Martinez Juliá  <yoros@wanadoo.es>
12045
12046         * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
12047         any indexer, it's needed to build a list with all the indexers in the
12048         hierarchy (AllGetters), else we have problems. Fixes #35653.
12049
12050 2003-01-23  Miguel de Icaza  <miguel@ximian.com>
12051
12052         * class.cs (MethodData.Define): It is wrong for an interface
12053         implementation to be static in both cases: explicit and implicit.
12054         We were only handling this in one case.
12055
12056         Improve the if situation there to not have negations.
12057
12058         * class.cs (Field.Define): Turns out that we do not need to check
12059         the unsafe bit on field definition, only on usage.  Remove the test.
12060
12061 2003-01-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12062
12063         * driver.cs: use assembly.Location instead of Codebase (the latest
12064         patch made mcs fail when using MS assemblies).
12065
12066 2003-01-21  Tim Haynes <thaynes@openlinksw.com>
12067
12068         * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
12069         get the path to *corlib.dll.
12070
12071 2003-01-21  Nick Drochak <ndrochak@gol.com>
12072
12073         * cs-tokenizer.cs:
12074         * pending.cs:
12075         * typemanager.cs: Remove compiler warnings
12076
12077 2003-01-20  Duncan Mak  <duncan@ximian.com>
12078
12079         * AssemblyInfo.cs: Bump the version number to 0.19.
12080
12081 2003-01-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12082
12083         * cs-tokenizer.cs: little fixes to line numbering when #line is used.
12084
12085 2003-01-18  Zoltan Varga  <vargaz@freemail.hu>
12086
12087         * class.cs (Constructor::Emit): Emit debugging info for constructors.
12088
12089 2003-01-17  Miguel de Icaza  <miguel@ximian.com>
12090
12091         * cs-parser.jay: Small fix: we were not comparing the constructor
12092         name correctly.   Thanks to Zoltan for the initial pointer.
12093
12094 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
12095
12096         * cs-tokenizer.cs: Set file name when specified with #line
12097
12098 2003-01-15  Miguel de Icaza  <miguel@ximian.com>
12099
12100         * cs-parser.jay: Only perform the constructor checks here if we
12101         are named like the class;  This will help provider a better
12102         error.  The constructor path is taken when a type definition is
12103         not found, but most likely the user forgot to add the type, so
12104         report that rather than the constructor error.
12105
12106 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
12107
12108         * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
12109         allocations.
12110
12111 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
12112
12113         * cs-parser.jay: Add cleanup call.
12114
12115 2003-01-13  Duncan Mak  <duncan@ximian.com>
12116
12117         * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
12118         consistent with other methods.
12119
12120 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
12121
12122         * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
12123
12124 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
12125
12126         * attribute.cs: only set GuidAttr to true when we have a
12127         GuidAttribute.
12128
12129 2003-01-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12130
12131         * ecore.cs:
12132         * expression.cs:
12133         * typemanager.cs: fixes to allow mcs compile corlib with the new
12134         Type.IsSubclassOf fix.
12135
12136 2003-01-08  Miguel de Icaza  <miguel@ximian.com>
12137
12138         * expression.cs (LocalVariableReference.DoResolve): Classify a
12139         constant as a value, not as a variable.   Also, set the type for
12140         the variable.
12141
12142         * cs-parser.jay (fixed_statement): take a type instead of a
12143         pointer_type, so we can produce a better error message later.
12144
12145         * statement.cs (Fixed.Resolve): Flag types that are not pointers
12146         as an error.  
12147
12148         (For.DoEmit): Make inifinite loops have a
12149         non-conditional branch back.
12150
12151         (Fixed.DoEmit): First populate the pinned variables, then emit the
12152         statement, then clear the variables.  Before I was emitting the
12153         code once for each fixed piece.
12154
12155
12156 2003-01-08  Martin Baulig  <martin@ximian.com>
12157
12158         * statement.cs (FlowBranching.MergeChild): A break in a
12159         SWITCH_SECTION does not leave a loop.  Fixes #36155.
12160
12161 2003-01-08  Martin Baulig  <martin@ximian.com>
12162
12163         * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
12164         lives in the same number space than `param_map'.  Fixes #36154.
12165
12166 2003-01-07  Miguel de Icaza  <miguel@ximian.com>
12167
12168         * cs-parser.jay (constructor_declaration): Set the
12169         Constructor.ModFlags before probing for it.  This makes the
12170         compiler report 514, 515 and 132 (the code was there, but got
12171         broken). 
12172
12173         * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
12174         (GotoDefault.Resolve): Set `Returns' to ALWAYS.
12175         (GotoCase.Resolve): Set `Returns' to ALWAYS.
12176
12177 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
12178
12179         * enum.cs: create the enum static fields using the enum type.
12180
12181 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
12182
12183         * class.cs: don't try to create the ParamBuilder for the return
12184         type if it's not needed (and handle it breaking for the ms runtime
12185         anyway).
12186
12187 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
12188
12189         * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
12190
12191 2002-12-29  Miguel de Icaza  <miguel@ximian.com>
12192
12193         * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
12194         the command.   This showed up while compiling the JANET source
12195         code, which used \r as its only newline separator.
12196
12197 2002-12-28  Miguel de Icaza  <miguel@ximian.com>
12198
12199         * class.cs (Method.Define): If we are an operator (because it
12200         reuses our code), then set the SpecialName and HideBySig.  #36128
12201
12202 2002-12-22  Miguel de Icaza  <miguel@ximian.com>
12203
12204         * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
12205         exception, report error 120 `object reference required'.
12206
12207         * driver.cs: Add --pause option, used during to measure the size
12208         of the process as it goes with --timestamp.
12209
12210         * expression.cs (Invocation.DoResolve): Do not allow methods with
12211         SpecialName to be invoked.
12212
12213 2002-12-21  Miguel de Icaza  <miguel@ximian.com>
12214
12215         * cs-tokenizer.cs: Small fix to the parser: compute the ascii
12216         number before adding it.
12217
12218 2002-12-21  Ravi Pratap  <ravi@ximian.com>
12219
12220         * ecore.cs (StandardImplicitConversion): When in an unsafe
12221         context, we allow conversion between void * to any other pointer
12222         type. This fixes bug #35973.
12223
12224 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
12225
12226         * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
12227         is not thrown when extensionless outputs are used 
12228
12229 2002-12-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12230
12231         * rootcontext.cs: fixed compilation of corlib.
12232
12233 2002-12-19  Miguel de Icaza  <miguel@ximian.com>
12234
12235         * attribute.cs (Attributes.Contains): Add new method.
12236
12237         * class.cs (MethodCore.LabelParameters): if the parameter is an
12238         `out' parameter, check that no attribute `[In]' has been passed.
12239
12240         * enum.cs: Handle the `value__' name in an enumeration.
12241
12242 2002-12-14  Jaroslaw Kowalski <jarek@atm.com.pl>
12243
12244         * decl.cs: Added special case to allow overrides on "protected
12245         internal" methods
12246
12247 2002-12-18  Ravi Pratap  <ravi@ximian.com>
12248
12249         * attribute.cs (Attributes.AddAttributeSection): Rename to this
12250         since it makes much more sense.
12251
12252         (Attributes.ctor): Don't require a Location parameter.
12253
12254         * rootcontext.cs (AddGlobalAttributeSection): Rename again.
12255
12256         * attribute.cs (ApplyAttributes): Remove extra Location parameters
12257         since we already have that information per attribute.
12258
12259         * everywhere : make appropriate changes.
12260
12261         * class.cs (LabelParameters): Write the code which actually
12262         applies attributes to the return type. We can't do this on the MS
12263         .NET runtime so we flag a warning in the case an exception is
12264         thrown.
12265
12266 2002-12-18  Miguel de Icaza  <miguel@ximian.com>
12267
12268         * const.cs: Handle implicit null conversions here too.
12269
12270 2002-12-17  Ravi Pratap  <ravi@ximian.com>
12271
12272         * class.cs (MethodCore.LabelParameters): Remove the extra
12273         Type [] parameter since it is completely unnecessary. Instead
12274         pass in the method's attributes so that we can extract
12275         the "return" attribute.
12276
12277 2002-12-17  Miguel de Icaza  <miguel@ximian.com>
12278
12279         * cs-parser.jay (parse): Use Report.Error to flag errors instead
12280         of ignoring it and letting the compile continue.
12281
12282         * typemanager.cs (ChangeType): use an extra argument to return an
12283         error condition instead of throwing an exception.
12284
12285 2002-12-15  Miguel de Icaza  <miguel@ximian.com>
12286
12287         * expression.cs (Unary.TryReduce): mimic the code for the regular
12288         code path.  Perform an implicit cast in the cases where we can
12289         implicitly convert to one of the integral types, and then reduce
12290         based on that constant.   This fixes bug #35483.
12291
12292 2002-12-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12293
12294         * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
12295
12296 2002-12-13  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12297
12298         * namespace.cs: fixed bug #35489.
12299
12300 2002-12-12  Miguel de Icaza  <miguel@ximian.com>
12301
12302         * class.cs: Remove some dead code.
12303
12304         * cs-parser.jay: Estimate the number of methods needed
12305         (RootContext.MethodCount);
12306
12307         * cs-tokenizer.cs: Use char arrays for parsing identifiers and
12308         numbers instead of StringBuilders.
12309
12310         * support.cs (PtrHashtable): Add constructor with initial size;
12311         We can now reduce reallocations of the method table.
12312
12313 2002-12-10  Ravi Pratap  <ravi@ximian.com>
12314
12315         * attribute.cs (ApplyAttributes): Keep track of the emitted
12316         attributes on a per-target basis. This fixes bug #35413.
12317
12318 2002-12-10  Miguel de Icaza  <miguel@ximian.com>
12319
12320         * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
12321         default to the Windows 1252 encoding.
12322
12323         (UnixParseOption): Support version, thanks to Alp for the missing
12324         pointer. 
12325
12326         * AssemblyInfo.cs: Add nice assembly information.
12327
12328         * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
12329         (bug 35169).
12330
12331         * cs-parser.jay: Allow a trailing comma before the close bracked
12332         in the attribute_section production.
12333
12334         * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
12335         address of the instance was being taken, I will take this out,
12336         because we take the address of the object immediately here.
12337
12338 2002-12-09  Ravi Pratap  <ravi@ximian.com>
12339
12340         * typemanager.cs (AreMultipleAllowed): Take care of the most
12341         obvious case where attribute type is not in the current assembly -
12342         stupid me ;-)
12343
12344 2002-12-08  Miguel de Icaza  <miguel@ximian.com>
12345
12346         * ecore.cs (SimpleName.DoResolve): First perform lookups on using
12347         definitions, instead of doing that afterwards.  
12348
12349         Also we use a nice little hack, depending on the constructor, we
12350         know if we are a "composed" name or a simple name.  Hence, we
12351         avoid the IndexOf test, and we avoid 
12352
12353         * codegen.cs: Add code to assist in a bug reporter to track down
12354         the source of a compiler crash. 
12355
12356 2002-12-07  Ravi Pratap  <ravi@ximian.com>
12357
12358         * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
12359         types have been emitted for a given element and flag an error
12360         if something which does not have AllowMultiple set is used more
12361         than once.
12362
12363         * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
12364         attribute types and their corresponding AllowMultiple properties
12365
12366         (AreMultipleAllowed): Check the property for a given type.
12367
12368         * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
12369         property in the case we have a TypeContainer.
12370
12371         (Attributes.AddAttribute): Detect duplicates and just skip on
12372         adding them. This trivial fix catches a pretty gross error in our
12373         attribute emission - global attributes were being emitted twice!
12374
12375         Bugzilla bug #33187 is now fixed.
12376
12377 2002-12-06  Miguel de Icaza  <miguel@ximian.com>
12378
12379         * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
12380         instead of pp_and).
12381
12382         * expression.cs (Binary.ResolveOperator): I can only use the
12383         Concat (string, string, string) and Concat (string, string,
12384         string, string) if the child is actually a concatenation of
12385         strings. 
12386
12387 2002-12-04  Miguel de Icaza  <miguel@ximian.com>
12388
12389         * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
12390         context where we need a 2-character lookahead.
12391
12392         * pending.cs (PendingImplementation): Rework so we can keep track
12393         of interface types all the time, and flag those which were
12394         implemented by parents as optional.
12395
12396 2002-12-03  Miguel de Icaza  <miguel@ximian.com>
12397
12398         * expression.cs (Binary.ResolveOperator): Use
12399         String.Concat(string,string,string) or
12400         String.Concat(string,string,string,string) when possible. 
12401
12402         * typemanager: More helper methods.
12403
12404
12405 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
12406
12407         * pending.cs: remove the bogus return from GetMissingInterfaces()
12408         (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
12409
12410 2002-12-02  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12411
12412         * namespace.cs: avoid duplicated 'using xxx' being added to
12413         using_clauses. This prevents mcs from issuing and 'ambiguous type' error
12414         when we get more than one 'using' statement for the same namespace.
12415         Report a CS0105 warning for it.
12416
12417 2002-11-30  Miguel de Icaza  <miguel@ximian.com>
12418
12419         * cs-tokenizer.cs (consume_identifier): use read directly, instead
12420         of calling getChar/putback, uses internal knowledge of it.    
12421
12422         (xtoken): Reorder tokenizer so most common patterns are checked
12423         first.  This reduces the compilation time in another 5% (from 8.11s
12424         average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
12425
12426         The parsing time is 22% of the compilation in mcs, and from that
12427         64% is spent on the tokenization process.  
12428
12429         I tried using a binary search for keywords, but this is slower
12430         than the hashtable.  Another option would be to do a couple of
12431         things:
12432
12433                 * Not use a StringBuilder, instead use an array of chars,
12434                   with a set value.  Notice that this way we could catch
12435                   the 645 error without having to do it *afterwards*.
12436
12437                 * We could write a hand-parser to avoid the hashtable
12438                   compares altogether.
12439
12440         The identifier consumption process takes 37% of the tokenization
12441         time.  Another 15% is spent on is_number.  56% of the time spent
12442         on is_number is spent on Int64.Parse:
12443
12444                 * We could probably choose based on the string length to
12445                   use Int32.Parse or Int64.Parse and avoid all the 64-bit
12446                   computations. 
12447
12448         Another 3% is spend on wrapping `xtoken' in the `token' function.
12449
12450         Handle 0xa0 as whitespace (#34752)
12451
12452 2002-11-26  Miguel de Icaza  <miguel@ximian.com>
12453
12454         * typemanager.cs (IsCLRType): New routine to tell whether a type
12455         is one of the builtin types.  
12456
12457         Maybe it needs to use TypeCodes to be faster.  Maybe we could use
12458         typecode in more places instead of doing pointer comparissions.
12459         We could leverage some knowledge about the way the typecodes are
12460         laid out.
12461
12462         New code to cache namespaces in assemblies, it is currently not
12463         invoked, to be used soon.
12464
12465         * decl.cs (DeclSpace.MakeFQN): Simple optimization.
12466
12467         * expression.cs (Binary.ResolveOperator): specially handle
12468         strings, and do not perform user-defined operator overloading for
12469         built-in types.
12470
12471 2002-11-24  Miguel de Icaza  <miguel@ximian.com>
12472
12473         * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
12474         internalcall as it is a pretty simple operation;  Avoid whenever
12475         possible to call Char.IsLetter.
12476
12477         (consume_identifier): Cut by half the number of
12478         hashtable calls by merging the is_keyword and GetKeyword behavior.
12479
12480         Do not short-circuit, because if we do, we
12481         report errors (ie, #if false && true would produce an invalid
12482         directive error);
12483
12484
12485 2002-11-24  Martin Baulig  <martin@ximian.com>
12486
12487         * expression.cs (Cast.TryReduce): If we're in checked syntax,
12488         check constant ranges and report a CS0221.  Fixes #33186.
12489
12490 2002-11-24  Martin Baulig  <martin@ximian.com>
12491
12492         * cs-parser.jay: Make this work for uninitialized variable
12493         declarations in the `for' initializer.  Fixes #32416.
12494
12495 2002-11-24  Martin Baulig  <martin@ximian.com>
12496
12497         * ecore.cs (Expression.ConvertExplicit): Make casting from/to
12498         System.Enum actually work.  Fixes bug #32269, added verify-6.cs.
12499
12500 2002-11-24  Martin Baulig  <martin@ximian.com>
12501
12502         * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
12503         argument; if true, we also check for user-defined conversions.
12504         This is only needed if both arguments are of a user-defined type.
12505         Fixes #30443, added test-175.cs.
12506         (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
12507
12508         * ecore.cs (Expression.ImplicitUserConversionExists): New method.
12509
12510 2002-11-24  Martin Baulig  <martin@ximian.com>
12511
12512         * expression.cs (ArrayAccess.GetStoreOpcode): New public static
12513         function to get the store opcode.
12514         (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
12515         only emit the Ldelema if the store opcode is Stobj.  You must run
12516         both test-34 and test-167 to test this.  Fixes #34529.
12517
12518 2002-11-23  Martin Baulig  <martin@ximian.com>
12519
12520         * ecore.cs (Expression.MemberLookup): Added additional
12521         `qualifier_type' argument which is used when we're being called
12522         from MemberAccess.DoResolve() and null if we're called from a
12523         SimpleName lookup.
12524         (Expression.MemberLookupFailed): New method to report errors; this
12525         does the CS1540 check and reports the correct error message.
12526
12527         * typemanager.cs (MemberLookup): Added additional `qualifier_type'
12528         argument for the CS1540 check and redone the way how we're dealing
12529         with private members.  See the comment in the source code for details.
12530         (FilterWithClosure): Reverted this back to revision 1.197; renamed
12531         `closure_start_type' to `closure_qualifier_type' and check whether
12532         it's not null.  It was not this filter being broken, it was just
12533         being called with the wrong arguments.
12534
12535         * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
12536         and pass it the correct `qualifier_type'; this also does the error
12537         handling for us.
12538
12539 2002-11-22  Miguel de Icaza  <miguel@ximian.com>
12540
12541         * expression.cs (Invocation.EmitParams): If the we are dealing
12542         with a non-built-in value type, load its address as well.
12543
12544         (ArrayCreation): Use a a pretty constant instead
12545         of the hardcoded value 2.   Use 6 instead of 2 for the number of
12546         static initializers.  
12547
12548         (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
12549         because they are not really value types, just glorified integers. 
12550
12551         * driver.cs: Do not append .exe, the CSC compiler does not do it.
12552
12553         * ecore.cs: Remove redundant code for enumerations, make them use
12554         the same code path as everything else, fixes the casting issue
12555         with enumerations in Windows.Forms.
12556
12557         * attribute.cs: Do only cast to string if it is a string, the
12558         validation happens later.
12559
12560         * typemanager.cs: Temproary hack to avoid a bootstrap issue until
12561         people upgrade their corlibs.
12562
12563         * ecore.cs: Oops, enumerations were not following the entire code path
12564
12565 2002-11-21  Miguel de Icaza  <miguel@ximian.com>
12566
12567         * typemanager.cs (FilterWithClosure): Commented out the test for
12568         1540 in typemanager.cs, as it has problems when accessing
12569         protected methods from a parent class (see test-174.cs). 
12570
12571         * attribute.cs (Attribute.ValidateGuid): new method.
12572         (Attribute.Resolve): Use above.
12573
12574 2002-11-19  Miguel de Icaza  <miguel@ximian.com>
12575
12576         * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
12577
12578         * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
12579         handling for enumerations, as we only needed the TypeContainer
12580         functionality to begin with (this is required for the fix below to
12581         work for enums that reference constants in a container class for
12582         example). 
12583
12584         * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
12585
12586         * enum.cs (Enum.Define): Use `this' instead of parent, so we have
12587         a valid TypeBuilder to perform lookups on.o
12588
12589         * class.cs (InheritableMemberSignatureCompare): Use true in the
12590         call to GetGetMethod and GetSetMethod, because we are comparing
12591         the signature, and we need to get the methods *even* if they are
12592         private. 
12593
12594         (PropertyBase.CheckBase): ditto.
12595
12596         * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
12597         GotoCase.Resolve): Use Peel on EmpytCasts.
12598
12599         * ecore.cs (EmptyCast): drop child, add Peel method.
12600
12601 2002-11-17  Martin Baulig  <martin@ximian.com>
12602
12603         * ecore.cs (EmptyCast.Child): New public property.
12604
12605         * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
12606         label resolved to an EmptyCast.  Fixes #34162.
12607         (GotoCase.Resolve): Likewise.
12608         (Block.EmitMeta): Likewise.
12609
12610 2002-11-17  Martin Baulig  <martin@ximian.com>
12611
12612         * expression.cs (Invocation.BetterConversion): Prefer int over
12613         uint; short over ushort; long over ulong for integer literals.
12614         Use ImplicitConversionExists instead of StandardConversionExists
12615         since we also need to check for user-defined implicit conversions.
12616         Fixes #34165.  Added test-173.cs.
12617
12618 2002-11-16  Martin Baulig  <martin@ximian.com>
12619
12620         * expression.cs (Binary.EmitBranchable): Eliminate comparisions
12621         with the `true' and `false' literals.  Fixes #33151.
12622
12623 2002-11-16  Martin Baulig  <martin@ximian.com>
12624
12625         * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
12626         October 22nd; don't do the cs1540 check for static members.
12627
12628         * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
12629         now using our own filter here and doing the cs1540 check again.
12630
12631 2002-11-16  Martin Baulig  <martin@ximian.com>
12632
12633         * support.cs (InternalParameters): Don't crash if we don't have
12634         any fixed parameters.  Fixes #33532.
12635
12636 2002-11-16  Martin Baulig  <martin@ximian.com>
12637
12638         * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
12639         when looking up static methods to make this work on Windows.
12640         Fixes #33773.
12641
12642 2002-11-16  Martin Baulig  <martin@ximian.com>
12643
12644         * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
12645         a setter rather than using PropertyInfo.CanWrite.
12646
12647 2002-11-15  Nick Drochak  <ndrochak@gol.com>
12648
12649         * class.cs: Allow acces to block member by subclasses. Fixes build
12650         breaker.
12651
12652 2002-11-14  Martin Baulig  <martin@ximian.com>
12653
12654         * class.cs (Constructor.Emit): Added the extern/block check.
12655         Fixes bug #33678.
12656
12657 2002-11-14  Martin Baulig  <martin@ximian.com>
12658
12659         * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
12660         iteration while looking for indexers, this is needed because the
12661         indexer may have a different name in our base classes.  Fixed the
12662         error reporting (no indexers at all, not get accessor, no
12663         overloaded match).  Fixes bug #33089.
12664         (IndexerAccess.DoResolveLValue): Likewise.
12665
12666 2002-11-14  Martin Baulig  <martin@ximian.com>
12667
12668         * class.cs (PropertyBase.CheckBase): Make this work for multiple
12669         indexers.  Fixes the first part of bug #33089.
12670         (MethodSignature.InheritableMemberSignatureCompare): Added support
12671         for properties.
12672
12673 2002-11-13  Ravi Pratap  <ravi@ximian.com>
12674
12675         * attribute.cs (Attribute.Resolve): Catch the
12676         NullReferenceException and report it since it isn't supposed to
12677         happen. 
12678
12679 2002-11-12  Miguel de Icaza  <miguel@ximian.com>
12680
12681         * expression.cs (Binary.EmitBranchable): Also handle the cases for
12682         LogicalOr and LogicalAnd that can benefit from recursively
12683         handling EmitBranchable.  The code now should be nice for Paolo.
12684
12685 2002-11-08  Miguel de Icaza  <miguel@ximian.com>
12686
12687         * typemanager.cs (LookupType): Added a negative-hit hashtable for
12688         the Type lookups, as we perform quite a number of lookups on
12689         non-Types.  This can be removed once we can deterministically tell
12690         whether we have a type or a namespace in advance.
12691
12692         But this might require special hacks from our corlib.
12693
12694         * TODO: updated.
12695
12696         * ecore.cs (TryImplicitIntConversion): Handle conversions to float
12697         and double which avoids a conversion from an integer to a double.
12698
12699         * expression.cs: tiny optimization, avoid calling IsConstant,
12700         because it effectively performs the lookup twice.
12701
12702 2002-11-06  Miguel de Icaza  <miguel@ximian.com>
12703
12704         But a bogus return here to keep the semantics of the old code
12705         until the Mono runtime is fixed.
12706
12707         * pending.cs (GetMissingInterfaces): New method used to remove all
12708         the interfaces that are already implemented by our parent
12709         classes from the list of pending methods. 
12710
12711         * interface.cs: Add checks for calls after ResolveTypeExpr.
12712
12713 2002-11-05  Miguel de Icaza  <miguel@ximian.com>
12714
12715         * class.cs (Class.Emit): Report warning 67: event not used if the
12716         warning level is beyond 3.
12717
12718         * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
12719         being a NullLiteral.
12720
12721         * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
12722         specifiers. 
12723
12724         * class.cs (TypeContainer.GetClassBases): Cover a missing code
12725         path that might fail if a type can not be resolved.
12726
12727         * expression.cs (Binary.Emit): Emit unsigned versions of the
12728         operators. 
12729
12730         * driver.cs: use error 5.
12731
12732 2002-11-02  Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
12733
12734         * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
12735
12736 2002-11-01  Miguel de Icaza  <miguel@ximian.com>
12737
12738         * cs-parser.jay (switch_section): A beautiful patch from Martin
12739         Baulig that fixed 33094.
12740
12741 2002-10-31  Miguel de Icaza  <miguel@ximian.com>
12742
12743         * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
12744         Check whether the base is abstract and report an error if so.
12745
12746         * expression.cs (IndexerAccess.DoResolveLValue,
12747         IndexerAccess.DoResolve): ditto. 
12748
12749         (Invocation.DoResolve): ditto.
12750
12751         (Invocation.FullMethodDesc): Improve the report string.
12752
12753         * statement.cs (Block): Eliminate IsVariableDefined as it is
12754         basically just a wrapper for GetVariableInfo.
12755
12756         * ecore.cs (SimpleName): Use new 
12757
12758         * support.cs (ReflectionParamter.ParameterType): We unwrap the
12759         type, as we return the actual parameter ref/unref state on a
12760         different call.
12761
12762 2002-10-30  Miguel de Icaza  <miguel@ximian.com>
12763
12764         * support.cs: Return proper flags REF/OUT fixing the previous
12765         commit.  
12766
12767         * expression.cs: Reverted last patch, that was wrong.  Is_ref is
12768         not used to mean `ref' but `ref or out' in ParameterReference
12769
12770         * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
12771         full type signature instead of calling TypeManger.CSharpName
12772         ourselves. 
12773
12774         * support.cs (InternalParameters.ParameterDesc): Do not compare
12775         directly to the modflags, because REF/OUT will actually be bitsets
12776         if set. 
12777
12778         * delegate.cs (VerifyMethod): Check also the modifiers.
12779
12780         * cs-tokenizer.cs: Fix bug where floating point values with an
12781         exponent where a sign was missing was ignored.
12782
12783         * driver.cs: Allow multiple assemblies to be specified in a single
12784         /r: argument
12785
12786 2002-10-28  Miguel de Icaza  <miguel@ximian.com>
12787
12788         * cs-parser.jay: Ugly.  We had to add a multiplicative_expression,
12789         because identifiers after a parenthesis would end up in this kind
12790         of production, and we needed to desamiguate it for having casts
12791         like:
12792
12793                 (UserDefinedType *) xxx
12794
12795 2002-10-24  Miguel de Icaza  <miguel@ximian.com>
12796
12797         * typemanager.cs (RealMemberLookup): when we deal with a subclass,
12798         we should set on the Bindingflags.NonPublic, but not turn on
12799         private_ok.  private_ok controls whether a Private member is
12800         returned (this is chekced on the filter routine), while the
12801         BindingFlags.NonPublic just controls whether private/protected
12802         will be allowed.   This fixes the problem part of the problem of
12803         private properties being allowed to be used in derived classes.
12804
12805         * expression.cs (BaseAccess): Provide an DoResolveLValue method,
12806         so we can call the children DoResolveLValue method (this will
12807         properly signal errors on lvalue assignments to base properties)
12808
12809         * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
12810         getter are null, and we have a property info, we know that this
12811         happened because the lookup failed, so we report an error 122 for
12812         protection level violation.
12813
12814         We also silently return if setter and getter are null in the
12815         resolve functions, this condition only happens if we have flagged
12816         the error before.  This is the other half of the problem. 
12817
12818         (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
12819         not have accessibility information, that is why we were returning
12820         true in the filter function in typemanager.cs.
12821
12822         To properly report 122 (property is inaccessible because of its
12823         protection level) correctly, we report this error in ResolveAccess
12824         by failing if both the setter and the getter are lacking (ie, the
12825         lookup failed). 
12826
12827         DoResolve and DoLResolve have been modified to check for both
12828         setter/getter being null and returning silently, the reason being
12829         that I did not want to put the knowledge about this error in upper
12830         layers, like:
12831
12832         int old = Report.Errors;
12833         x = new PropertyExpr (...);
12834         if (old != Report.Errors)
12835                 return null;
12836         else
12837                 return x;
12838
12839         So the property expr is returned, but it is invalid, so the error
12840         will be flagged during the resolve process. 
12841
12842         * class.cs: Remove InheritablePropertySignatureCompare from the
12843         class, as we no longer depend on the property signature to compute
12844         whether it is possible to implement a method or not.
12845
12846         The reason is that calling PropertyInfo.GetGetMethod will return
12847         null (in .NET, in Mono it works, and we should change this), in
12848         cases where the Get Method does not exist in that particular
12849         class.
12850
12851         So this code:
12852
12853         class X { public virtual int A { get { return 1; } } }
12854         class Y : X { }
12855         class Z : Y { public override int A { get { return 2; } } }
12856
12857         Would fail in Z because the parent (Y) would not have the property
12858         defined.  So we avoid this completely now (because the alternative
12859         fix was ugly and slow), and we now depend exclusively on the
12860         method names.
12861
12862         (PropertyBase.CheckBase): Use a method-base mechanism to find our
12863         reference method, instead of using the property.
12864
12865         * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
12866         routines are gone now.
12867
12868         * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
12869         names, they were incorrectly named.
12870
12871         * cs-tokenizer.cs: Return are more gentle token on failure. 
12872
12873         * pending.cs (PendingImplementation.InterfaceMethod): This routine
12874         had an out-of-sync index variable, which caused it to remove from
12875         the list of pending methods the wrong method sometimes.
12876
12877 2002-10-22  Miguel de Icaza  <miguel@ximian.com>
12878
12879         * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
12880         CanWrite, because those refer to this particular instance of the
12881         property, and do not take into account the fact that we can
12882         override single members of a property.
12883
12884         Constructor requires an EmitContext.  The resolution process does
12885         not happen here, but we need to compute the accessors before,
12886         because the resolution does not always happen for properties.
12887
12888         * typemanager.cs (RealMemberLookup): Set private_ok if we are a
12889         subclass, before we did not update this flag, but we did update
12890         bindingflags. 
12891
12892         (GetAccessors): Drop this routine, as it did not work in the
12893         presence of partially overwritten set/get methods. 
12894
12895         Notice that this broke the cs1540 detection, but that will require
12896         more thinking. 
12897
12898 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12899
12900         * class.cs:
12901         * codegen.cs:
12902         * driver.cs: issue a warning instead of an error if we don't support
12903         debugging for the platform. Also ignore a couple of errors that may
12904         arise when trying to write the symbols. Undo my previous patch.
12905
12906 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12907
12908         * driver.cs: ignore /debug switch except for Unix platforms.
12909
12910 2002-10-23  Nick Drochak  <ndrochak@gol.com>
12911
12912         * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
12913
12914 2002-10-21  Miguel de Icaza  <miguel@ximian.com>
12915
12916         * driver.cs: Do not make mcs-debug conditional, so we do not break
12917         builds that use it.
12918
12919         * statement.cs (UsageVector.MergeChildren): I would like Martin to
12920         review this patch.  But basically after all the children variables
12921         have been merged, the value of "Breaks" was not being set to
12922         new_breaks for Switch blocks.  I think that it should be set after
12923         it has executed.  Currently I set this to the value of new_breaks,
12924         but only if new_breaks is FlowReturn.ALWAYS, which is a bit
12925         conservative, but I do not understand this code very well.
12926
12927         I did not break anything in the build, so that is good ;-)
12928
12929         * cs-tokenizer.cs: Also allow \r in comments as a line separator.
12930
12931 2002-10-20  Mark Crichton  <crichton@gimp.org>
12932
12933         * cfold.cs: Fixed compile blocker.  Really fixed it this time.
12934
12935 2002-10-20  Nick Drochak  <ndrochak@gol.com>
12936
12937         * cfold.cs: Fixed compile blocker.
12938
12939 2002-10-20  Miguel de Icaza  <miguel@ximian.com>
12940
12941         * driver.cs: I was chekcing the key, not the file.
12942
12943 2002-10-19  Ravi Pratap  <ravi@ximian.com>
12944
12945         * ecore.cs (UserDefinedConversion): Get rid of the bogus error
12946         message that we were generating - we just need to silently return
12947         a null.
12948
12949 2002-10-19  Miguel de Icaza  <miguel@ximian.com>
12950
12951         * class.cs (Event.Define): Change my previous commit, as this
12952         breaks the debugger.  This is a temporary hack, as it seems like
12953         the compiler is generating events incorrectly to begin with.
12954
12955         * expression.cs (Binary.ResolveOperator): Added support for 
12956         "U operator - (E x, E y)"
12957
12958         * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
12959         y)".
12960
12961         * ecore.cs (FieldExpr.AddressOf): We had a special code path for
12962         init-only variables, but this path did not take into account that
12963         there might be also instance readonly variables.  Correct this
12964         problem. 
12965
12966         This fixes bug 32253
12967
12968         * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
12969         delegates as well.
12970
12971         * driver.cs: Change the extension for modules to `netmodule'
12972
12973         * cs-parser.jay: Improved slightly the location tracking for
12974         the debugger symbols.
12975
12976         * class.cs (Event.Define): Use Modifiers.FieldAttr on the
12977         modifiers that were specified instead of the hardcoded value
12978         (FamAndAssem).  This was basically ignoring the static modifier,
12979         and others.  Fixes 32429.
12980
12981         * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
12982         fixed a bug in the process (32476)
12983
12984         * expression.cs (ArrayAccess.EmitAssign): Patch from
12985         hwang_rob@yahoo.ca that fixes bug 31834.3
12986
12987 2002-10-18  Miguel de Icaza  <miguel@ximian.com>
12988
12989         * driver.cs: Make the module extension .netmodule.
12990
12991 2002-10-16  Miguel de Icaza  <miguel@ximian.com>
12992
12993         * driver.cs: Report an error if the resource file is not found
12994         instead of crashing.
12995
12996         * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
12997         false, like Emit does.
12998
12999 2002-10-16  Nick Drochak  <ndrochak@gol.com>
13000
13001         * typemanager.cs: Remove unused private member.  Also reported mcs
13002         bug to report this as a warning like csc.
13003
13004 2002-10-15  Martin Baulig  <martin@gnome.org>
13005
13006         * statement.cs (Statement.Emit): Made this a virtual method; emits
13007         the line number info and calls DoEmit().
13008         (Statement.DoEmit): New protected abstract method, formerly knows
13009         as Statement.Emit().
13010
13011         * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
13012
13013 2002-10-11  Miguel de Icaza  <miguel@ximian.com>
13014
13015         * class.cs: Following the comment from 2002-09-26 to AddMethod, I
13016         have fixed a remaining problem: not every AddXXXX was adding a
13017         fully qualified name.  
13018
13019         Now everyone registers a fully qualified name in the DeclSpace as
13020         being defined instead of the partial name.  
13021
13022         Downsides: we are slower than we need to be due to the excess
13023         copies and the names being registered this way.  
13024
13025         The reason for this is that we currently depend (on the corlib
13026         bootstrap for instance) that types are fully qualified, because
13027         we dump all the types in the namespace, and we should really have
13028         types inserted into the proper namespace, so we can only store the
13029         basenames in the defined_names array.
13030
13031 2002-10-10  Martin Baulig  <martin@gnome.org>
13032
13033         * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
13034         from bug #31834, see the bug report for a testcase which is
13035         miscompiled.
13036
13037 2002-10-10  Martin Baulig  <martin@gnome.org>
13038
13039         * codegen.cs (EmitContext.Breaks): Removed, we're now using the
13040         flow analysis code for this.
13041
13042         * statement.cs (Do, While, For): Tell the flow analysis code about
13043         infinite loops.
13044         (FlowBranching.UsageVector): Added support for infinite loops.
13045         (Block.Resolve): Moved the dead code elimination here and use flow
13046         analysis to do it.
13047
13048 2002-10-09  Miguel de Icaza  <miguel@ximian.com>
13049
13050         * class.cs (Field.Define): Catch cycles on struct type
13051         definitions. 
13052
13053         * typemanager.cs (IsUnmanagedtype): Do not recursively check
13054         fields if the fields are static.  We only need to check instance
13055         fields. 
13056
13057         * expression.cs (As.DoResolve): Test for reference type.
13058
13059         * statement.cs (Using.ResolveExpression): Use
13060         ConvertImplicitRequired, not ConvertImplicit which reports an
13061         error on failture
13062         (Using.ResolveLocalVariableDecls): ditto.
13063
13064         * expression.cs (Binary.ResolveOperator): Report errors in a few
13065         places where we had to.
13066
13067         * typemanager.cs (IsUnmanagedtype): Finish implementation.
13068
13069 2002-10-08  Miguel de Icaza  <miguel@ximian.com>
13070
13071         * expression.cs: Use StoreFromPtr instead of extracting the type
13072         and then trying to use Stelem.  Patch is from hwang_rob@yahoo.ca
13073
13074         * ecore.cs (ImplicitReferenceConversion): It is possible to assign
13075         an enumeration value to a System.Enum, but System.Enum is not a
13076         value type, but an class type, so we need to box.
13077
13078         (Expression.ConvertExplicit): One codepath could return
13079         errors but not flag them.  Fix this.  Fixes #31853
13080
13081         * parameter.cs (Resolve): Do not allow void as a parameter type.
13082
13083 2002-10-06  Martin Baulig  <martin@gnome.org>
13084
13085         * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
13086         if it's a class type and not a struct.  Fixes #31815.
13087
13088 2002-10-06  Martin Baulig  <martin@gnome.org>
13089
13090         * statement.cs: Reworked the flow analysis code a bit to make it
13091         usable for dead code elimination.
13092
13093 2002-10-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13094
13095         * cs-parser.jay: allow empty source files. Fixes bug #31781.
13096
13097 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
13098
13099         * expression.cs (ComposedCast.DoResolveType): A quick workaround
13100         to fix the test 165, will investigate deeper.
13101
13102 2002-10-04  Martin Baulig  <martin@gnome.org>
13103
13104         * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
13105         finally blocks actually work.
13106         (Try.Resolve): We don't need to create a sibling for `finally' if
13107         there is no finally block.
13108
13109 2002-10-04  Martin Baulig  <martin@gnome.org>
13110
13111         * class.cs (Constructor.Define): The default accessibility for a
13112         non-default constructor is private, not public.
13113
13114 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
13115
13116         * class.cs (Constructor): Make AllowedModifiers public, add
13117         EXTERN.
13118
13119         * cs-parser.jay: Perform the modifiers test here, as the
13120         constructor for the Constructor class usually receives a zero
13121         because of the way we create it (first we create, later we
13122         customize, and we were never checking the modifiers).
13123
13124         * typemanager.cs (Typemanager.LookupTypeDirect): This new function
13125         is a version of LookupTypeReflection that includes the type-name
13126         cache.  This can be used as a fast path for functions that know
13127         the fully qualified name and are only calling into *.GetType() to
13128         obtain a composed type.
13129
13130         This is also used by TypeManager.LookupType during its type
13131         composition.
13132
13133         (LookupType): We now also track the real type name, as sometimes
13134         we can get a quey for the real type name from things like
13135         ComposedCast.  This fixes bug 31422.
13136
13137         * expression.cs (ComposedCast.Resolve): Since we are obtaining a
13138         complete type fullname, it does not have to go through the type
13139         resolution system to obtain the composed version of the type (for
13140         obtaining arrays or pointers).
13141
13142         (Conditional.Emit): Use the EmitBoolExpression to
13143         generate nicer code, as requested by Paolo.
13144
13145         (ArrayCreation.CheckIndices): Use the patch from
13146         hwang_rob@yahoo.ca to validate the array initializers. 
13147
13148 2002-10-03  Miguel de Icaza  <miguel@ximian.com>
13149
13150         * class.cs (ConstructorInitializer.Emit): simplify code by using
13151         Invocation.EmitCall, and at the same time, fix the bugs in calling
13152         parent constructors that took variable arguments. 
13153
13154         * ecore.cs (Expression.ConvertNumericExplicit,
13155         Expression.ImplicitNumericConversion): Remove the code that
13156         manually wrapped decimal (InternalTypeConstructor call is now gone
13157         as well).
13158
13159         * expression.cs (Cast.TryReduce): Also handle decimal types when
13160         trying to perform a constant fold on the type.
13161
13162         * typemanager.cs (IsUnmanagedtype): Partially implemented.
13163
13164         * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
13165         that only turned off an error report, and did nothing else. 
13166
13167 2002-10-02  Miguel de Icaza  <miguel@ximian.com>
13168
13169         * driver.cs: Handle and ignore /fullpaths
13170
13171 2002-10-01  Miguel de Icaza  <miguel@ximian.com>
13172
13173         * expression.cs (Binary.ResolveOperator): Catch the case where
13174         DoNumericPromotions returns true, 
13175
13176         (Binary.DoNumericPromotions): Simplify the code, and the tests.
13177
13178 2002-09-27  Miguel de Icaza  <miguel@ximian.com>
13179
13180         * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
13181         report error 70.
13182
13183 2002-09-26  Miguel de Icaza  <miguel@ximian.com>
13184
13185         * ecore.cs (ConvertNumericExplicit): It is not enough that the
13186         conversion exists, but it is also required that the conversion be
13187         performed.  This manifested in "(Type64Enum) 2".  
13188
13189         * class.cs (TypeManager.AddMethod): The fix is not to change
13190         AddEnum, because that one was using a fully qualified name (every
13191         DeclSpace derivative does), but to change the AddMethod routine
13192         that was using an un-namespaced name.  This now correctly reports
13193         the duplicated name.
13194
13195         Revert patch until I can properly fix it.  The issue
13196         is that we have a shared Type space across all namespaces
13197         currently, which is wrong.
13198
13199         Options include making the Namespace a DeclSpace, and merge
13200         current_namespace/current_container in the parser.
13201
13202 2002-09-25  Miguel de Icaza  <miguel@ximian.com>
13203
13204         * cs-parser.jay: Improve error reporting when we get a different
13205         kind of expression in local_variable_type and
13206         local_variable_pointer_type. 
13207
13208         Propagate this to avoid missleading errors being reported.
13209
13210         * ecore.cs (ImplicitReferenceConversion): treat
13211         TypeManager.value_type as a target just like object_type.   As
13212         code like this:
13213
13214         ValueType v = 1;
13215
13216         Is valid, and needs to result in the int 1 being boxed before it
13217         is assigned to the value type v.
13218
13219         * class.cs (TypeContainer.AddEnum): Use the basename, not the name
13220         to validate the enumeration name.
13221
13222         * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
13223         EmitDynamicInitializers for the criteria to use Ldelema.  Thanks
13224         to hwang_rob@yahoo.ca for finding the bug and providing a patch.
13225
13226         * ecore.cs (TryImplicitIntConversion): When doing an
13227         implicit-enumeration-conversion, check if the type is 64-bits and
13228         perform a conversion before passing to EnumConstant.
13229
13230 2002-09-23  Miguel de Icaza  <miguel@ximian.com>
13231
13232         * decl.cs (Error_AmbiguousTypeReference); New routine used to
13233         report ambiguous type references.  Unlike the MS version, we
13234         report what the ambiguity is.   Innovation at work ;-)
13235
13236         (DeclSpace.FindType): Require a location argument to
13237         display when we display an ambiguous error.
13238
13239         * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
13240
13241         * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
13242
13243         * expression.cs (EmitDynamicInitializers): Apply patch from
13244         hwang_rob@yahoo.ca that fixes the order in which we emit our
13245         initializers. 
13246
13247 2002-09-21  Martin Baulig  <martin@gnome.org>
13248
13249         * delegate.cs (Delegate.VerifyApplicability): Make this work if the
13250         delegate takes no arguments.
13251
13252 2002-09-20  Miguel de Icaza  <miguel@ximian.com>
13253
13254         * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
13255         from integers.
13256
13257         * expression.cs: Extract the underlying type.
13258
13259         * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
13260
13261         * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
13262
13263 2002-09-19  Miguel de Icaza  <miguel@ximian.com>
13264
13265         * class.cs (TypeContainer.DefineType): We can not use the nice
13266         PackingSize with the size set to 1 DefineType method, because it
13267         will not allow us to define the interfaces that the struct
13268         implements.
13269
13270         This completes the fixing of bug 27287
13271
13272         * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
13273         means also structs.  This fixes part of the problem. 
13274         (Expresion.ImplicitReferenceConversionExists): ditto.
13275
13276         * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
13277         error if there were no errors reported during the type lookup
13278         process, to avoid duplicates or redundant errors.  Without this
13279         you would get an ambiguous errors plus a type not found.  We have
13280         beaten the user enough with the first error.  
13281
13282         (DeclSparce.FindType): Emit a warning if we have an ambiguous
13283         reference. 
13284
13285         * ecore.cs (SimpleName.DoResolveType): If an error is emitted
13286         during the resolution process, stop the lookup, this avoids
13287         repeated error reports (same error twice).
13288
13289         * rootcontext.cs: Emit a warning if we have an ambiguous reference.
13290
13291         * typemanager.cs (LookupType): Redo the type lookup code to match
13292         the needs of System.Reflection.  
13293
13294         The issue is that System.Reflection requires references to nested
13295         types to begin with a "+" sign instead of a dot.  So toplevel
13296         types look like: "NameSpace.TopLevelClass", and nested ones look
13297         like "Namespace.TopLevelClass+Nested", with arbitrary nesting
13298         levels. 
13299
13300 2002-09-19  Martin Baulig  <martin@gnome.org>
13301
13302         * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
13303         says that a method always returns or always throws an exception,
13304         don't report the CS0161.
13305
13306         * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
13307         set `Returns = new_returns'.
13308
13309 2002-09-19  Martin Baulig  <martin@gnome.org>
13310
13311         * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
13312         to an enum constant, check for a CS0176.
13313
13314 2002-09-18  Miguel de Icaza  <miguel@ximian.com>
13315
13316         * class.cs (TypeContainer.CheckPairedOperators): Now we check
13317         for operators that must be in pairs and report errors.
13318
13319         * ecore.cs (SimpleName.DoResolveType): During the initial type
13320         resolution process, when we define types recursively, we must
13321         check first for types in our current scope before we perform
13322         lookups in the enclosing scopes.
13323
13324         * expression.cs (MakeByteBlob): Handle Decimal blobs.
13325
13326         (Invocation.VerifyArgumentsCompat): Call
13327         TypeManager.TypeToCoreType on the parameter_type.GetElementType.
13328         I thought we were supposed to always call this, but there are a
13329         few places in the code where we dont do it.
13330
13331 2002-09-17  Miguel de Icaza  <miguel@ximian.com>
13332
13333         * driver.cs: Add support in -linkres and -resource to specify the
13334         name of the identifier.
13335
13336 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
13337
13338         * ecore.cs (StandardConversionExists): Sync with the conversion
13339         code: allow anything-* to void* conversions.
13340
13341         (FindMostSpecificSource): Use an Expression argument
13342         instead of a Type, because we might be handed over a Literal which
13343         gets a few more implicit conversions that plain types do not.  So
13344         this information was being lost.
13345
13346         Also, we drop the temporary type-holder expression when not
13347         required.
13348
13349 2002-09-17  Martin Baulig  <martin@gnome.org>
13350
13351         * class.cs (PropertyBase.CheckBase): Don't check the base class if
13352         this is an explicit interface implementation.
13353
13354 2002-09-17  Martin Baulig  <martin@gnome.org>
13355
13356         * class.cs (PropertyBase.CheckBase): Make this work for indexers with
13357         different `IndexerName' attributes.
13358
13359         * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
13360         (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
13361         virtual CommonResolve().
13362
13363 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
13364
13365         * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
13366         and convert that to the UnderlyingType.
13367
13368         * statement.cs (Foreach.Resolve): Indexers are just like variables
13369         or PropertyAccesses.
13370
13371         * cs-tokenizer.cs (consume_string): Track line numbers and columns
13372         inside quoted strings, we were not doing this before.
13373
13374 2002-09-16  Martin Baulig  <martin@gnome.org>
13375
13376         * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
13377         resolve it.  This is needed for the definite assignment check of the
13378         instance expression, fixes bug #29846.
13379         (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
13380
13381 2002-09-16  Nick Drochak  <ndrochak@gol.com>
13382
13383         * parameter.cs: Fix compile error.  Cannot reference static member
13384         from an instance object.  Is this an mcs bug?
13385
13386 2002-09-14  Martin Baulig  <martin@gnome.org>
13387
13388         * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
13389         multiple times.  Fixes bug #30295, added test-166.cs.
13390
13391 2002-09-14  Martin Baulig  <martin@gnome.org>
13392
13393         * statement.cs (Block.Emit): Don't emit unreachable code.
13394         (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
13395         `break' statements.
13396         (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
13397
13398 2002-09-14  Martin Baulig  <martin@gnome.org>
13399
13400         * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
13401         is set.
13402
13403 2002-09-14  Martin Baulig  <martin@gnome.org>
13404
13405         * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
13406         if `type == parent' since in this case `type.IsSubclassOf (parent)' will
13407         be false on the ms runtime.
13408
13409 2002-09-13  Martin Baulig  <martin@gnome.org>
13410
13411         * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
13412         the CS0038 error message.
13413
13414 2002-09-12  Miguel de Icaza  <miguel@ximian.com>
13415
13416         * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
13417         constant inside, return it.
13418
13419 2002-09-12  Martin Baulig  <martin@gnome.org>
13420
13421         * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
13422         implicit conversion can be done between enum types.
13423
13424         * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
13425         check whether an implicit conversion to the current enum's UnderlyingType
13426         exists and report an error if not.
13427
13428         * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
13429         without debugging support.
13430
13431         * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
13432         Fixes bug #30235.  Thanks to Ricardo Fernández Pascual.
13433
13434 2002-09-12  Martin Baulig  <martin@gnome.org>
13435
13436         * typemanager.cs (TypeManager.IsNestedChildOf): New method.
13437
13438         * ecore.cs (IMemberExpr.DeclaringType): New property.
13439         (SimpleName.SimpleNameResolve): Check whether we're accessing a
13440         nonstatic member of an outer type (CS0038).
13441
13442 2002-09-11  Miguel de Icaza  <miguel@ximian.com>
13443
13444         * driver.cs: Activate the using-error detector at warning level
13445         4 (at least for MS-compatible APIs).
13446
13447         * namespace.cs (VerifyUsing): Small buglett fix.
13448
13449         * pending.cs (PendingImplementation): pass the container pointer. 
13450
13451         * interface.cs (GetMethods): Allow for recursive definition.  Long
13452         term, I would like to move every type to support recursive
13453         definitions, not the current ordering mechanism that we have right
13454         now.
13455
13456         The situation is this: Attributes are handled before interfaces,
13457         so we can apply attributes to interfaces.  But some attributes
13458         implement interfaces, we will now handle the simple cases
13459         (recursive definitions will just get an error).  
13460
13461         * parameter.cs: Only invalidate types at the end if we fail to
13462         lookup all types.  
13463
13464 2002-09-09  Martin Baulig  <martin@gnome.org>
13465
13466         * ecore.cs (PropertyExpr.Emit): Also check for
13467         TypeManager.system_int_array_get_length so this'll also work when
13468         compiling corlib.  Fixes #30003.
13469
13470 2002-09-09  Martin Baulig  <martin@gnome.org>
13471
13472         * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
13473         and throw an exception if we can't get the type's size.  Fixed #30040,
13474         added test-165.cs.
13475
13476 2002-09-09  Martin Baulig  <martin@gnome.org>
13477
13478         * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
13479
13480         * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
13481         context.  Fixes bug #30027.
13482
13483         * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
13484         virtual functions.  Fixes bug #30043, added test-164.cs.
13485
13486 2002-09-08  Ravi Pratap  <ravi@ximian.com>
13487
13488         * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
13489
13490 2002-09-08  Nick Drochak  <ndrochak@gol.com>
13491
13492         * driver.cs: Use an object to get the windows codepage since it's not a
13493         static property.
13494
13495 2002-09-08  Miguel de Icaza  <miguel@ximian.com>
13496
13497         * statement.cs (For.Emit): for infinite loops (test == null)
13498         return whether there is a break inside, not always "true".
13499
13500         * namespace.cs (UsingEntry): New struct to hold the name of the
13501         using definition, the location where it is defined, and whether it
13502         has been used in a successful type lookup.
13503
13504         * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
13505         strings.
13506
13507         * decl.cs: ditto.
13508
13509 2002-09-06  Ravi Pratap  <ravi@ximian.com>
13510
13511         * attribute.cs : Fix incorrect code which relied on catching
13512         a NullReferenceException to detect a null being passed in
13513         where an object was expected.
13514
13515 2002-09-06  Miguel de Icaza  <miguel@ximian.com>
13516
13517         * statement.cs (Try): flag the catch variable as assigned
13518
13519         * expression.cs (Cast): Simplified by using ResolveType instead of
13520         manually resolving.
13521
13522         * statement.cs (Catch): Fix bug by using ResolveType.
13523
13524 2002-09-06  Ravi Pratap  <ravi@ximian.com>
13525
13526         * expression.cs (BetterConversion): Special case for when we have
13527         a NullLiteral as the argument and we have to choose between string
13528         and object types - we choose string the way csc does.
13529
13530         * attribute.cs (Attribute.Resolve): Catch the
13531         NullReferenceException and report error #182 since the Mono
13532         runtime no more has the bug and having this exception raised means
13533         we tried to select a constructor which takes an object and is
13534         passed a null.
13535
13536 2002-09-05  Ravi Pratap  <ravi@ximian.com>
13537
13538         * expression.cs (Invocation.OverloadResolve): Flag a nicer error
13539         message (1502, 1503) when we can't locate a method after overload
13540         resolution. This is much more informative and closes the bug
13541         Miguel reported.
13542
13543         * interface.cs (PopulateMethod): Return if there are no argument
13544         types. Fixes a NullReferenceException bug.
13545
13546         * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
13547         expressions too. Previously we were checking only in one place for
13548         positional arguments leaving out named arguments.
13549
13550         * ecore.cs (ImplicitNumericConversion): Conversion from underlying
13551         type to the enum type is not allowed. Remove code corresponding to
13552         that.
13553
13554         (ConvertNumericExplicit): Allow explicit conversions from
13555         the underlying type to enum type. This precisely follows the spec
13556         and closes a bug filed by Gonzalo.
13557
13558 2002-09-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13559
13560         * compiler.csproj:
13561         * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
13562
13563 2002-09-03  Miguel de Icaza  <miguel@ximian.com>
13564
13565         * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
13566         it was important that we stored the right value after the
13567         reduction in `converted'.
13568
13569 2002-09-04  Martin Baulig  <martin@gnome.org>
13570
13571         * location.cs (Location.SymbolDocument): Use full pathnames for the
13572         source files.
13573
13574 2002-08-30  Miguel de Icaza  <miguel@ximian.com>
13575
13576         * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
13577         of the expression resolve mechanism, because that will catch the
13578         SimpleName error failures.
13579
13580         (Conditional): If we can not resolve the
13581         expression, return, do not crash.
13582
13583 2002-08-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13584
13585         * cs-tokenizer.cs:
13586         (location): display token name instead of its number.
13587
13588 2002-08-28  Martin Baulig  <martin@gnome.org>
13589
13590         * expression.cs (Binary.ResolveOperator): Don't silently return
13591         but return an error if an operator cannot be applied between two
13592         enum types.
13593
13594 2002-08-28  Martin Baulig  <martin@gnome.org>
13595
13596         * class.cs (Constructor.Define): Set the permission attributes
13597         correctly instead of making all constructors public.
13598
13599 2002-08-28  Martin Baulig  <martin@gnome.org>
13600
13601         * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
13602         for private members before reporting a CS0103; if we find anything,
13603         it's a CS0122.
13604
13605 2002-08-28  Martin Baulig  <martin@gnome.org>
13606
13607         * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
13608         to check whether `closure_start_type == closure_invocation_type',
13609         we also need to check whether `m.DeclaringType == closure_invocation_type'
13610         before bypassing the permission checks.  We might be accessing
13611         protected/private members from the base class.
13612         (TypeManager.RealMemberLookup): Only set private_ok if private
13613         members were requested via BindingFlags.NonPublic.
13614
13615         * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
13616
13617         * expression.cs (MemberAccess.ResolveMemberAccess): Set
13618         MethodGroupExpr.IsExplicitImpl if appropriate.
13619         (Invocation.DoResolve): Don't report the CS0120 for explicit
13620         interface implementations.
13621
13622 2002-08-27  Martin Baulig  <martin@gnome.org>
13623
13624         * expression.cs (Invocation.DoResolve): If this is a static
13625         method and we don't have an InstanceExpression, we must report
13626         a CS0120.
13627
13628 2002-08-25  Martin Baulig  <martin@gnome.org>
13629
13630         * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
13631         `==' between a valuetype and an object.
13632
13633 2002-08-25  Miguel de Icaza  <miguel@ximian.com>
13634
13635         * ecore.cs (TypeExpr): Provide a ToString method.
13636
13637 2002-08-24  Martin Baulig  <martin@gnome.org>
13638
13639         * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
13640         now called proggie.dbg and it's a binary file.
13641
13642 2002-08-23  Martin Baulig  <martin@gnome.org>
13643
13644         * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
13645
13646 2002-08-23  Martin Baulig  <martin@gnome.org>
13647
13648         * struct.cs (MyStructInfo.ctor): Make this work with empty
13649         structs; it's not allowed to use foreach() on null.
13650
13651 2002-08-23  Martin Baulig  <martin@gnome.org>
13652
13653         * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
13654         writer the full pathname of the generated assembly.
13655
13656 2002-08-23  Martin Baulig  <martin@gnome.org>
13657
13658         * statements.cs (FlowBranching.UsageVector.MergeChildren):
13659         A `finally' block never returns or breaks; improved handling of
13660         unreachable code.
13661
13662 2002-08-23  Martin Baulig  <martin@gnome.org>
13663
13664         * statement.cs (Throw.Resolve): Allow `throw null'.
13665
13666 2002-08-23  Martin Baulig  <martin@gnome.org>
13667
13668         * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
13669         EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
13670         `ee.EventInfo.DeclaringType == ec.ContainerType'.  The
13671         MemberLookup would return a wrong event if this is an explicit
13672         interface implementation and the class has an event with the same
13673         name.
13674
13675 2002-08-23  Martin Baulig  <martin@gnome.org>
13676
13677         * statement.cs (Block.AddChildVariableNames): New public method.
13678         (Block.AddChildVariableName): Likewise.
13679         (Block.IsVariableNameUsedInChildBlock): Likewise.
13680         (Block.AddVariable): Check whether a variable name has already
13681         been used in a child block.
13682
13683         * cs-parser.jay (declare_local_variables): Mark all variable names
13684         from the current block as being used in a child block in the
13685         implicit block.
13686
13687 2002-08-23  Martin Baulig  <martin@gnome.org>
13688
13689         * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
13690         find the symbol writer.
13691
13692         * driver.cs: csc also allows the arguments to /define being
13693         separated by commas, not only by semicolons.
13694
13695 2002-08-23  Martin Baulig  <martin@gnome.org>
13696
13697         * interface.cs (Interface.GetMembers): Added static check for events.
13698
13699 2002-08-15  Martin Baulig  <martin@gnome.org>
13700
13701         * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
13702         call, use ec.ContainerType.BaseType as queried_type and invocation_type.
13703
13704         * ecore.cs (Expression.MemberLookup): Added documentation and explained
13705         why the MethodData.EmitDestructor() change was necessary.
13706
13707 2002-08-20  Martin Baulig  <martin@gnome.org>
13708
13709         * class.cs (TypeContainer.FindMembers): Added static check for events.
13710
13711         * decl.cs (MemberCache.AddMembers): Handle events like normal members.
13712
13713         * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
13714         use Type.GetEvents(), not Type.FindMembers().
13715
13716 2002-08-20  Martin Baulig  <martin@gnome.org>
13717
13718         * decl.cs (MemberCache): Added a special method cache which will
13719         be used for method-only searched.  This ensures that a method
13720         search will return a MethodInfo with the correct ReflectedType for
13721         inherited methods.      
13722
13723 2002-08-20  Martin Baulig  <martin@gnome.org>
13724
13725         * decl.cs (DeclSpace.FindMembers): Made this public.
13726
13727 2002-08-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13728
13729         * delegate.cs: fixed build on windows.
13730         [FIXME:  Filed as bug #29150: MCS must report these errors.]
13731
13732 2002-08-19  Ravi Pratap  <ravi@ximian.com>
13733
13734         * ecore.cs (StandardConversionExists): Return a false
13735         if we are trying to convert the void type to anything else
13736         since that is not allowed.
13737
13738         * delegate.cs (DelegateInvocation.DoResolve): Ensure that
13739         we flag error 70 in the event an event is trying to be accessed
13740         directly from outside the declaring type.
13741
13742 2002-08-20  Martin Baulig  <martin@gnome.org>
13743
13744         * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
13745         MemberCache from typemanager.cs to decl.cs.
13746
13747 2002-08-19  Martin Baulig  <martin@gnome.org>
13748
13749         * class.cs (TypeContainer): Implement IMemberContainer.
13750         (TypeContainer.DefineMembers): Create the MemberCache.
13751         (TypeContainer.FindMembers): Do better BindingFlags checking; only
13752         return public members if BindingFlags.Public was given, check
13753         whether members are static.
13754
13755 2002-08-16  Martin Baulig  <martin@gnome.org>
13756
13757         * decl.cs (DeclSpace.Define): Splitted this in Define and
13758         DefineMembers.  DefineMembers is called first and initializes the
13759         MemberCache.
13760
13761         * rootcontext.cs (RootContext.DefineMembers): New function.  Calls
13762         DefineMembers() on all our DeclSpaces.
13763
13764         * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
13765         but call DefineMembers() on all nested interfaces.  We call their
13766         Define() in our new Define() function.
13767
13768         * interface.cs (Interface): Implement IMemberContainer.
13769         (Interface.Define): Moved all code except the attribute stuf to
13770         DefineMembers().
13771         (Interface.DefineMembers): Initialize the member cache.
13772
13773         * typemanager.cs (IMemberFinder): Removed this interface, we don't
13774         need this anymore since we can use MemberCache.FindMembers directly.
13775
13776 2002-08-19  Martin Baulig  <martin@gnome.org>
13777
13778         * typemanager.cs (MemberCache): When creating the cache for an
13779         interface type, add all inherited members.
13780         (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
13781         to `out bool used_cache' and documented it.
13782         (TypeManager.MemberLookup): If we already used the cache in the first
13783         iteration, we don't need to do the interfaces check.
13784
13785 2002-08-19  Martin Baulig  <martin@gnome.org>
13786
13787         * decl.cs (DeclSpace.FindMembers): New abstract method.  Moved this
13788         here from IMemberFinder and don't implement this interface anymore.
13789         (DeclSpace.MemberCache): Moved here from IMemberFinder.
13790
13791         * typemanager.cs (IMemberFinder): This interface is now only used by
13792         classes which actually support the member cache.
13793         (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
13794         since we only put DeclSpaces into this Hashtable.
13795         (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
13796         a dynamic type and TypeHandle.GetTypeHandle() otherwise.
13797
13798 2002-08-16  Martin Baulig  <martin@gnome.org>
13799
13800         * typemanager.cs (ICachingMemberFinder): Removed.
13801         (IMemberFinder.MemberCache): New property.
13802         (TypeManager.FindMembers): Merged this with RealFindMembers().
13803         This function will never be called from TypeManager.MemberLookup()
13804         so we can't use the cache here, just the IMemberFinder.
13805         (TypeManager.MemberLookup_FindMembers): Check whether the
13806         IMemberFinder has a MemberCache and call the cache's FindMembers
13807         function.
13808         (MemberCache): Rewrote larger parts of this yet another time and
13809         cleaned it up a bit.
13810
13811 2002-08-15  Miguel de Icaza  <miguel@ximian.com>
13812
13813         * driver.cs (LoadArgs): Support quoting.
13814
13815         (Usage): Show the CSC-like command line arguments.
13816
13817         Improved a few error messages.
13818
13819 2002-08-15  Martin Baulig  <martin@gnome.org>
13820
13821         * typemanager.cs (IMemberContainer.Type): New property.
13822         (IMemberContainer.IsInterface): New property.
13823
13824         The following changes are conditional to BROKEN_RUNTIME, which is
13825         defined at the top of the file.
13826
13827         * typemanager.cs (MemberCache.MemberCache): Don't add the base
13828         class'es members, but add all members from TypeHandle.ObjectType
13829         if we're an interface.
13830         (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
13831         is the current type.
13832         (MemberCache.CacheEntry.Container): Removed this field.
13833         (TypeHandle.GetMembers): Include inherited members.
13834
13835 2002-08-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13836
13837         * typemanager.cs: fixed compilation and added a comment on a field that
13838         is never used.
13839
13840 2002-08-15  Martin Baulig  <martin@gnome.org>
13841
13842         * class.cs (ConstructorInitializer.Resolve): In the
13843         Expression.MemberLookup call, use the queried_type as
13844         invocation_type.
13845
13846         * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
13847         declared' attribute, it's always true.
13848         (IMemberContainer.Parent, IMemberContainer.Name): New properties.
13849         (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
13850         temporary wrapper for FindMembers which tells MemberLookup whether
13851         members from the base classes are included in the return value.
13852         This will go away soon.
13853         (TypeManager.MemberLookup): Use this temporary hack here; once the
13854         new MemberCache is completed, we don't need to do the DeclaredOnly
13855         looping here anymore since the MemberCache will take care of this.
13856         (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
13857         (MemberCache): When creating the MemberCache for a class, get
13858         members from the current class and all its base classes.
13859         (MemberCache.CacheEntry.Container): New field.  This is a
13860         temporary hack until the Mono runtime is fixed to distinguish
13861         between ReflectedType and DeclaringType.  It allows us to use MCS
13862         with both the MS runtime and the unfixed Mono runtime without
13863         problems and without accecting performance.
13864         (MemberCache.SearchMembers): The DeclaredOnly looping from
13865         TypeManager.MemberLookup is now done here.      
13866
13867 2002-08-14  Martin Baulig  <martin@gnome.org>
13868
13869         * statement.cs (MyStructInfo.MyStructInfo): Don't call
13870         Type.GetFields on dynamic types but get the fields from the
13871         corresponding TypeContainer.
13872         (MyStructInfo.GetStructInfo): Added check for enum types.
13873
13874         * typemanager.cs (MemberList.IsSynchronized): Implemented.
13875         (MemberList.SyncRoot): Implemented.
13876         (TypeManager.FilterWithClosure): No need to check permissions if
13877         closure_start_type == closure_invocation_type, don't crash if
13878         closure_invocation_type is null.
13879
13880 2002-08-13  Martin Baulig  <martin@gnome.org>
13881
13882         Rewrote TypeContainer.FindMembers to use a member cache.  This
13883         gives us a speed increase of about 35% for the self-hosting MCS
13884         build and of about 15-20% for the class libs (both on GNU/Linux).
13885
13886         * report.cs (Timer): New class to get enhanced profiling.  This
13887         whole class is "TIMER" conditional since it remarkably slows down
13888         compilation speed.
13889
13890         * class.cs (MemberList): New class.  This is an IList wrapper
13891         which we're now using instead of passing MemberInfo[]'s around to
13892         avoid copying this array unnecessarily.
13893         (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
13894         (ICachingMemberFinder, IMemberContainer): New interface.
13895         (TypeManager.FilterWithClosure): If `criteria' is null, the name
13896         has already been checked, otherwise use it for the name comparision.
13897         (TypeManager.FindMembers): Renamed to RealMemberFinder and
13898         provided wrapper which tries to use ICachingMemberFinder.FindMembers
13899         if possible.  Returns a MemberList, not a MemberInfo [].
13900         (TypeHandle): New class, implements IMemberContainer.  We create
13901         one instance of this class per type, it contains a MemberCache
13902         which is used to do the member lookups.
13903         (MemberCache): New class.  Each instance of this class contains
13904         all members of a type and a name-based hash table.
13905         (MemberCache.FindMembers): This is our new member lookup
13906         function.  First, it looks up all members of the requested name in
13907         the hash table.  Then, it walks this list and sorts out all
13908         applicable members and returns them.
13909
13910 2002-08-13  Martin Baulig  <martin@gnome.org>
13911
13912         In addition to a nice code cleanup, this gives us a performance
13913         increase of about 1.4% on GNU/Linux - not much, but it's already
13914         half a second for the self-hosting MCS compilation.
13915
13916         * typemanager.cs (IMemberFinder): New interface.  It is used by
13917         TypeManager.FindMembers to call FindMembers on a TypeContainer,
13918         Enum, Delegate or Interface.
13919         (TypeManager.finder_to_member_finder): New PtrHashtable.
13920         (TypeManager.finder_to_container): Removed.
13921         (TypeManager.finder_to_delegate): Removed.
13922         (TypeManager.finder_to_interface): Removed.
13923         (TypeManager.finder_to_enum): Removed.
13924
13925         * interface.cs (Interface): Implement IMemberFinder.
13926
13927         * delegate.cs (Delegate): Implement IMemberFinder.
13928
13929         * enum.cs (Enum): Implement IMemberFinder.
13930
13931         * class.cs (TypeContainer): Implement IMemberFinder.
13932
13933 2002-08-12  Martin Baulig  <martin@gnome.org>
13934
13935         * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
13936
13937 2002-08-12  Martin Baulig  <martin@gnome.org>
13938
13939         * ecore.cs (ITypeExpression): New interface for expressions which
13940         resolve to a type.
13941         (TypeExpression): Renamed to TypeLookupExpression.
13942         (Expression.DoResolve): If we're doing a types-only lookup, the
13943         expression must implement the ITypeExpression interface and we
13944         call DoResolveType() on it.
13945         (SimpleName): Implement the new ITypeExpression interface.
13946         (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
13947         hack, the situation that we're only looking up types can't happen
13948         anymore when this method is called.  Moved the type lookup code to
13949         DoResolveType() and call it.
13950         (SimpleName.DoResolveType): This ITypeExpression interface method
13951         is now doing the types-only lookup.
13952         (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
13953         (ResolveFlags): Added MaskExprClass.
13954
13955         * expression.cs (MemberAccess): Implement the ITypeExpression
13956         interface.
13957         (MemberAccess.DoResolve): Added support for a types-only lookup
13958         when we're called via ITypeExpression.DoResolveType().
13959         (ComposedCast): Implement the ITypeExpression interface.
13960
13961         * codegen.cs (EmitContext.OnlyLookupTypes): Removed.  Call
13962         Expression.Resolve() with ResolveFlags.Type instead.
13963
13964 2002-08-12  Martin Baulig  <martin@gnome.org>
13965
13966         * interface.cs (Interface.Define): Apply attributes.
13967
13968         * attribute.cs (Attribute.ApplyAttributes): Added support for
13969         interface attributes.
13970
13971 2002-08-11  Martin Baulig  <martin@gnome.org>
13972
13973         * statement.cs (Block.Emit): Only check the "this" variable if we
13974         do not always throw an exception.
13975
13976         * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
13977         whether the property has a set accessor.
13978
13979 2002-08-11  Martin Baulig  <martin@gnome.org>
13980
13981         Added control flow analysis support for structs.
13982
13983         * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
13984         with control flow analysis turned off.
13985         (IVariable): New interface.
13986         (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
13987         returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
13988         (FieldExpr.DoResolve): Resolve the instance expression with flow
13989         analysis turned off and do the definite assignment check after the
13990         resolving when we know what the expression will resolve to.
13991
13992         * expression.cs (LocalVariableReference, ParameterReference):
13993         Implement the new IVariable interface, only call the flow analysis
13994         code if ec.DoFlowAnalysis is true.
13995         (This): Added constructor which takes a Block argument.  Implement
13996         the new IVariable interface.
13997         (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
13998         DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
13999         This does the definite assignment checks for struct members.
14000
14001         * class.cs (Constructor.Emit): If this is a non-static `struct'
14002         constructor which doesn't have any initializer, call
14003         Block.AddThisVariable() to tell the flow analysis code that all
14004         struct elements must be initialized before control returns from
14005         the constructor.
14006
14007         * statement.cs (MyStructInfo): New public class.
14008         (UsageVector.this [VariableInfo vi]): Added `int field_idx'
14009         argument to this indexer.  If non-zero, check an individual struct
14010         member, not the whole struct.
14011         (FlowBranching.CheckOutParameters): Check struct members.
14012         (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
14013         overloaded versions of these methods which take an additional
14014         `int field_idx' argument to check struct members.
14015         (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
14016         overloaded versions of these methods which take an additional
14017         `string field_name' argument to check struct member.s
14018         (VariableInfo): Implement the IVariable interface.
14019         (VariableInfo.StructInfo): New public property.  Returns the
14020         MyStructInfo instance of the variable if it's a struct or null.
14021         (Block.AddThisVariable): New public method.  This is called from
14022         Constructor.Emit() for non-static `struct' constructor which do
14023         not have any initializer.  It creates a special variable for the
14024         "this" instance variable which will be checked by the flow
14025         analysis code to ensure that all of the struct's fields are
14026         initialized before control returns from the constructor.
14027         (UsageVector): Added support for struct members.  If a
14028         variable/parameter is a struct with N members, we reserve a slot
14029         in the usage vector for each member.  A struct is considered fully
14030         initialized if either the struct itself (slot 0) or all its
14031         members are initialized.
14032
14033 2002-08-08  Martin Baulig  <martin@gnome.org>
14034
14035         * driver.cs (Driver.MainDriver): Only report an error CS5001
14036         if there were no compilation errors.
14037
14038         * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
14039         `UnsafeContext' property to determine whether the parent is in
14040         unsafe context rather than checking the parent's ModFlags:
14041         classes nested in an unsafe class are unsafe as well.
14042
14043 2002-08-08  Martin Baulig  <martin@gnome.org>
14044
14045         * statement.cs (UsageVector.MergeChildren): Distinguish between
14046         `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
14047         we return.  Added test17() and test18() to test-154.cs.
14048
14049 2002-08-08  Martin Baulig  <martin@gnome.org>
14050
14051         * typemanager.cs (TypeManager.FilterWithClosure): If we have
14052         Family access, make sure the invoking type isn't a subclass of the
14053         queried type (that'd be a CS1540).
14054
14055         * ecore.cs (Expression.MemberLookup): Added overloaded version of
14056         this method which takes an additional `Type invocation_type'.
14057
14058         * expression.cs (BaseAccess.DoResolve): Use the base type as
14059         invocation and query type.
14060         (MemberAccess.DoResolve): If the lookup failed and we're about to
14061         report a CS0122, try a lookup with the ec.ContainerType - if this
14062         succeeds, we must report a CS1540.
14063
14064 2002-08-08  Martin Baulig  <martin@gnome.org>
14065
14066         * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
14067         (MethodGroupExpr): Implement the IMemberExpr interface.
14068
14069         * expression (MemberAccess.ResolveMemberAccess): No need to have
14070         any special code for MethodGroupExprs anymore, they're now
14071         IMemberExprs.   
14072
14073 2002-08-08  Martin Baulig  <martin@gnome.org>
14074
14075         * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
14076         Family, FamANDAssem and FamORAssem permissions.
14077         (TypeManager.IsSubclassOrNestedChildOf): New public method.
14078
14079 2002-08-08  Martin Baulig  <martin@gnome.org>
14080
14081         * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
14082         (UsageVector.MergeChildren): `break' breaks unless we're in a switch
14083         or loop block.
14084
14085 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
14086
14087         * driver.cs: implemented /resource option to embed managed resources.
14088
14089 2002-08-07  Martin Baulig  <martin@gnome.org>
14090
14091         * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
14092         (FieldBase.HasFieldInitializer): New public property.
14093         (FieldBase.GetInitializerExpression): New public method.  Resolves and
14094         returns the field initializer and makes sure it is only resolved once.
14095         (TypeContainer.EmitFieldInitializers): Call
14096         FieldBase.GetInitializerExpression to get the initializer, this ensures
14097         that it isn't resolved multiple times.
14098
14099         * codegen.cs (EmitContext): Added `bool IsFieldInitialier'.  This tells
14100         the resolving process (SimpleName/MemberLookup) that we're currently
14101         emitting a field initializer (which must not access any instance members,
14102         this is an error CS0236).
14103
14104         * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
14105         argument, if the `IsFieldInitializer' flag is set, we must report and
14106         error CS0236 and not an error CS0120.   
14107
14108 2002-08-07  Martin Baulig  <martin@gnome.org>
14109
14110         * ecore.cs (IMemberExpr): New public interface.
14111         (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
14112         (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
14113         if the expression is an IMemberExpr.
14114
14115         * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
14116         to be null, implicitly default to `this' if we're non-static in
14117         this case.  Simplified the code a lot by using the new IMemberExpr
14118         interface.  Also fixed bug #28176 here.
14119
14120 2002-08-06  Martin Baulig  <martin@gnome.org>
14121
14122         * cs-parser.jay (SimpleLookup): Removed.  We need to create
14123         ParameterReferences during semantic analysis so that we can do a
14124         type-only search when resolving Cast, TypeOf and SizeOf.
14125         (block): Pass the `current_local_parameters' to the Block's
14126         constructor.
14127
14128         * class.cs (ConstructorInitializer): Added `Parameters parameters'
14129         argument to the constructor.
14130         (ConstructorInitializer.Resolve): Create a temporary implicit
14131         block with the parameters.
14132
14133         * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
14134         references here if we aren't doing a type-only search.
14135
14136         * statement.cs (Block): Added constructor which takes a
14137         `Parameters parameters' argument.
14138         (Block.Parameters): New public property.
14139
14140         * support.cs (InternalParameters.Parameters): Renamed `parameters'
14141         to `Parameters' and made it public readonly.
14142
14143 2002-08-06  Martin Baulig  <martin@gnome.org>
14144
14145         * ecore.cs (Expression.Warning): Made this public as well.
14146
14147         * report.cs (Report.Debug): Print the contents of collections.
14148
14149 2002-08-06  Martin Baulig  <martin@gnome.org>
14150
14151         * ecore.cs (Expression.ResolveFlags): New [Flags] enum.  This is
14152         used to tell Resolve() which kinds of expressions it may return.
14153         (Expression.Resolve): Added overloaded version of this method which
14154         takes a `ResolveFlags flags' argument.  This can be used to tell
14155         Resolve() which kinds of expressions it may return.  Reports a
14156         CS0118 on error.
14157         (Expression.ResolveWithSimpleName): Removed, use Resolve() with
14158         ResolveFlags.SimpleName.
14159         (Expression.Error118): Added overloaded version of this method which
14160         takes a `ResolveFlags flags' argument.  It uses the flags to determine
14161         which kinds of expressions are allowed.
14162
14163         * expression.cs (Argument.ResolveMethodGroup): New public method.
14164         Resolves an argument, but allows a MethodGroup to be returned.
14165         This is used when invoking a delegate.
14166
14167         * TODO: Updated a bit.
14168
14169 2002-08-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14170
14171         Fixed compilation with csc.
14172
14173         * ecore.cs: Expression.Error made public. Is this correct? Should
14174         Warning be made public too?
14175
14176         * expression.cs: use ea.Location instead of ea.loc.
14177         [FIXME:  Filed as bug #28607: MCS must report these errors.]
14178
14179 2002-08-06  Martin Baulig  <martin@gnome.org>
14180
14181         * ecore.cs (Expression.loc): Moved the location here instead of
14182         duplicating it in all derived classes.
14183         (Expression.Location): New public property.
14184         (Expression.Error, Expression.Warning): Made them non-static and
14185         removed the location argument.
14186         (Expression.Warning): Added overloaded version which takes an
14187         `int level' argument.
14188         (Expression.Error118): Make this non-static and removed the
14189         expression and location arguments.
14190         (TypeExpr): Added location argument to the constructor.
14191
14192         * expression.cs (StaticCallExpr): Added location argument to
14193         the constructor.
14194         (Indirection, PointerArithmetic): Likewise.
14195         (CheckedExpr, UnCheckedExpr): Likewise.
14196         (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
14197         (StringPtr): Likewise.
14198
14199
14200 2002-08-05  Martin Baulig  <martin@gnome.org>
14201
14202         * expression.cs (BaseAccess.DoResolve): Actually report errors.
14203
14204         * assign.cs (Assign.DoResolve): Check whether the source
14205         expression is a value or variable.
14206
14207         * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
14208         while resolving the corresponding blocks.
14209
14210         * interface.cs (Interface.GetInterfaceTypeByName): Actually report
14211         an error, don't silently return null.
14212
14213         * statement.cs (Block.AddVariable): Do the error reporting here
14214         and distinguish between CS0128 and CS0136.
14215         (Block.DoResolve): Report all unused labels (warning CS0164).
14216         (LabeledStatement): Pass the location to the constructor.
14217         (LabeledStatement.HasBeenReferenced): New property.
14218         (LabeledStatement.Resolve): Set it to true here.
14219
14220         * statement.cs (Return.Emit): Return success even after reporting
14221         a type mismatch error (CS0126 or CS0127), this is what csc does and
14222         it avoids confusing the users with any consecutive errors.
14223
14224 2002-08-05  Martin Baulig  <martin@gnome.org>
14225
14226         * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
14227
14228         * const.cs (Const.LookupConstantValue): Catch circular definitions.
14229
14230         * expression.cs (MemberAccess.DoResolve): Silently return if an
14231         error has already been reported.
14232
14233         * ecore.cs (Expression.MemberLookupFinal): Silently return if an
14234         error has already been reported.
14235
14236 2002-08-05  Martin Baulig  <martin@gnome.org>
14237
14238         * statement.cs (UsageVector): Only initialize the `parameters'
14239         vector if we actually have any "out" parameters.
14240
14241 2002-08-05  Martin Baulig  <martin@gnome.org>
14242
14243         * expression.cs (Binary.ResolveOperator): When combining delegates,
14244         they must have the same type.
14245
14246 2002-08-05  Martin Baulig  <martin@gnome.org>
14247
14248         * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
14249         PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
14250         work with the ms runtime and we also don't need it: if we're a
14251         PropertyBuilder and not in the `indexer_arguments' hash, then we
14252         are a property and not an indexer.
14253
14254         * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
14255         Type.IsPointer and Type.IsByRef instead of Type.HasElementType
14256         since the latter one doesn't work with the ms runtime.
14257
14258 2002-08-03  Martin Baulig  <martin@gnome.org>
14259
14260         Fixed bugs #27998 and #22735.
14261
14262         * class.cs (Method.IsOperator): New public field.
14263         (Method.CheckBase): Report CS0111 if there's already a method
14264         with the same parameters in the current class.  Report CS0508 when
14265         attempting to change the return type of an inherited method.
14266         (MethodData.Emit): Report CS0179 if a method doesn't have a body
14267         and it's not marked abstract or extern.
14268         (PropertyBase): New abstract base class for Property and Indexer.
14269         (PropertyBase.CheckBase): Moved here from Property and made it work
14270         for indexers.
14271         (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
14272         the same so we can reuse it there.
14273         (Property, Indexer): Derive from PropertyBase.
14274         (MethodSignature.inheritable_property_signature_filter): New delegate
14275         to find properties and indexers.
14276
14277         * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
14278         argument and improved error reporting.
14279
14280         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
14281         EmptyReadOnlyParameters and made it a property.
14282
14283         * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
14284         version of this method which takes a `PropertyInfo indexer'.
14285         (TypeManager.RegisterIndexer): New method.
14286
14287         * class.cs: Added myself as author of this file :-)
14288
14289 2002-08-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14290
14291         * class.cs: fixed compilation on windoze.
14292
14293 2002-08-03  Martin Baulig  <martin@gnome.org>
14294
14295         * interface.cs (Interface.GetInterfaceBases): Check whether all
14296         base interfaces are at least as accessible than the current one.
14297
14298         * class.cs (TypeContainer.GetClassBases): Check whether base types
14299         are at least as accessible than the current type.
14300         (TypeContainer.AsAccessible): Implemented and made non-static.
14301         (MemberBase.CheckParameters): Report errors if the accessibility
14302         checks fail.
14303
14304         * delegate.cs (Delegate.Delegate): The default visibility is
14305         internal for top-level types and private for nested types.
14306         (Delegate.Define): Report errors if the accessibility checks fail.
14307
14308         * enum.cs (Enum.Enum): The default visibility is internal for
14309         top-level types and private for nested types.
14310         (Enum.DefineType): Compute the correct visibility.
14311
14312         * modifiers.cs (Modifiers.TypeAttr): Added a version of this
14313         function which takes a `bool is_toplevel' instead of a TypeContainer.
14314
14315         * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
14316         builtin type.
14317
14318 2002-08-02  Martin Baulig  <martin@gnome.org>
14319
14320         * expression.cs (LocalVariableReferenc): Added constructor which
14321         takes additional `VariableInfo vi' and `bool is_readonly' arguments.
14322         (LocalVariableReference.IsReadOnly): New property.
14323         (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
14324         variable is readonly, use our own readonly flag to do this; you can
14325         use the new constructor to get a writable reference to a read-only
14326         variable.
14327
14328         * cs-parser.jay (foreach_statement, using_statement): Get a writable
14329         reference to the local variable.
14330
14331 2002-08-01  Miguel de Icaza  <miguel@ximian.com>
14332
14333         * rootcontext.cs (ResolveCore): Also include System.Exception
14334
14335         * statement.cs (Block.Emit): Do not emit the dead-code warnings if
14336         we reach an EmptyStatement.
14337
14338         (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
14339         is also fine.
14340
14341         * expression.cs (Binary.ResolveOperator): Check error result in
14342         two places.
14343
14344         use brtrue/brfalse directly and avoid compares to null.
14345
14346 2002-08-02  Martin Baulig  <martin@gnome.org>
14347
14348         * class.cs (TypeContainer.Define): Define all nested interfaces here.
14349         Fixes bug #28407, added test-155.cs.
14350
14351 2002-08-01  Martin Baulig  <martin@gnome.org>
14352
14353         * class.cs (Event.EmitDefaultMethod): Make this work with static
14354         events.  Fixes #28311, added verify-3.cs.
14355
14356 2002-08-01  Martin Baulig  <martin@gnome.org>
14357
14358         * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
14359         `is_disposable' fields.
14360         (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
14361         `hm.is_disposable' if we're using the collection pattern.
14362         (Foreach.EmitCollectionForeach): Use the correct type for the
14363         enumerator's local variable, only emit the try/finally block if
14364         necessary (fixes #27713).
14365
14366 2002-08-01  Martin Baulig  <martin@gnome.org>
14367
14368         * ecore.cs (Expression.report118): Renamed to Error118 and made
14369         it public static.
14370
14371         * statement.cs (Throw.Resolve): Check whether the expression is of
14372         the correct type (CS0118) and whether the type derives from
14373         System.Exception (CS0155).
14374         (Catch.Resolve): New method.  Do the type lookup here and check
14375         whether it derives from System.Exception (CS0155).
14376         (Catch.CatchType, Catch.IsGeneral): New public properties.
14377
14378         * typemanager.cs (TypeManager.exception_type): Added.
14379
14380 2002-07-31  Miguel de Icaza  <miguel@ximian.com>
14381
14382         * driver.cs: Updated About function.
14383
14384 2002-07-31  Martin Baulig  <martin@gnome.org>
14385
14386         Implemented Control Flow Analysis.
14387
14388         * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
14389         (EmitContext.CurrentBranching): Added.
14390         (EmitContext.StartFlowBranching): Added.
14391         (EmitContext.EndFlowBranching): Added.
14392         (EmitContext.KillFlowBranching): Added.
14393         (EmitContext.IsVariableAssigned): Added.
14394         (EmitContext.SetVariableAssigned): Added.
14395         (EmitContext.IsParameterAssigned): Added.
14396         (EmitContext.SetParameterAssigned): Added.
14397         (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
14398         Added control flow analysis stuff here.
14399
14400         * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
14401         resolve the expression as lvalue.
14402         (LocalVariableReference.DoResolve): Check whether the variable has
14403         already been assigned.
14404         (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
14405         the parameter as assigned here.
14406         (ParameterReference.DoResolve): Check whether the parameter has already
14407         been assigned.
14408         (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
14409         expression as lvalue.
14410
14411         * statement.cs (FlowBranching): New class for the flow analysis code.
14412         (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
14413         (LabeledStatement.IsDefined): New public property.
14414         (LabeledStatement.AddUsageVector): New public method to tell flow
14415         analyis that the label may be reached via a forward jump.
14416         (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
14417         flow analysis.
14418         (VariableInfo.Number): New public field.  This is used by flow analysis
14419         to number all locals of a block.
14420         (Block.CountVariables): New public property.  This is the number of
14421         local variables in this block (including the locals from all parent
14422         blocks).
14423         (Block.EmitMeta): Number all the variables.
14424
14425         * statement.cs: Added flow analysis support to all classes.
14426
14427 2002-07-31  Martin Baulig  <martin@gnome.org>
14428
14429         * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
14430         To get debugging messages, compile mcs with /define:MCS_DEBUG and
14431         then use this argument.
14432
14433         * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
14434
14435         * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
14436         use this to specify /define options.
14437
14438 2002-07-29  Martin Baulig  <martin@gnome.org>
14439
14440         * statement.cs (Fixed): Moved all code that does variable lookups
14441         and resolvings from Emit to Resolve.
14442
14443         * statement.cs (For): Moved all code that does variable lookups
14444         and resolvings from Emit to Resolve.
14445
14446         * statement.cs (Using): Moved all code that does variable lookups
14447         and resolvings from Emit to Resolve.
14448
14449 2002-07-29  Martin Baulig  <martin@gnome.org>
14450
14451         * attribute.cs (Attribute.Resolve): Explicitly catch a
14452         System.NullReferenceException when creating the
14453         CustromAttributeBuilder and report a different warning message.
14454
14455 2002-07-29  Martin Baulig  <martin@gnome.org>
14456
14457         * support.cs (ParameterData.ParameterName): Added method to
14458         get the name of a parameter.
14459
14460         * typemanager.cs (TypeManager.IsValueType): New public method.
14461
14462 2002-07-29  Martin Baulig  <martin@gnome.org>
14463
14464         * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'.  This
14465         is a flag which specifies that it's either ref or out.
14466         (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
14467         the out parameter to `out Parameter.Modifier mod', also set the
14468         Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
14469
14470         * support.cs (InternalParameters.ParameterModifier): 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         * expression.cs (Argument.GetParameterModifier): Distinguish
14475         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
14476         Parameter.Modifier.ISBYREF flag if it's either ref or out.
14477
14478 2002-07-29  Martin Baulig  <martin@gnome.org>
14479
14480         * expression.cs (ParameterReference.ParameterReference): Added
14481         `Location loc' argument to the constructor.
14482
14483         * cs-parser.jay: Pass location to ParameterReference.
14484
14485 2002-07-28  Miguel de Icaza  <miguel@ximian.com>
14486
14487         * statement.cs (Try): Initialize the location.
14488
14489         * cs-parser.jay: pass location to Try.
14490
14491         * expression.cs (Unary.Reduce): Change the prototype to return
14492         whether a constant fold could be performed or not.  The result is
14493         returned in an out parameters.  In the case of Indirection and
14494         AddressOf, we want to perform the full tests.
14495
14496 2002-07-26  Miguel de Icaza  <miguel@ximian.com>
14497
14498         * statement.cs (Statement.Emit): Flag dead code.
14499
14500 2002-07-27  Andrew Birkett  <andy@nobugs.org>
14501
14502         * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
14503
14504 2002-07-27  Martin Baulig  <martin@gnome.org>
14505
14506         * class.cs (MethodData.Define): Put back call to
14507         TypeManager.AddMethod(), accidentally commented this out.
14508
14509         * report.cs (Debug): New public method to print debugging information,
14510         this is `[Conditional ("DEBUG")]'.
14511
14512 2002-07-26  Martin Baulig  <martin@gnome.org>
14513
14514         * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
14515         (switch_statement): Push the current_block to the switch_stack and
14516         pop it again when we're done with the switch.
14517         (switch_section): The new block is a child of the current_block.
14518         Fixes bug #24007, added test-152.cs.
14519
14520 2002-07-27  Martin Baulig  <martin@gnome.org>
14521
14522         * expression.cs (Invocation.EmitArguments): When calling a varargs
14523         function with only its fixed arguments, we need to pass an empty
14524         array.
14525
14526 2002-07-27  Martin Baulig  <martin@gnome.org>
14527
14528         Mono 0.13 has been released.
14529
14530 2002-07-25  Miguel de Icaza  <miguel@ximian.com>
14531
14532         * driver.cs: Rename --resource to --linkres, because that is what
14533         we do currently, we dont support --resource yet.
14534
14535         * cs-tokenizer.cs: Fix test for reporting endif mismatches.
14536
14537 2002-07-25  Martin Baulig  <martin@gnome.org>
14538
14539         * class.cs (MethodData): New public class.  This is a `method builder'
14540         class for a method or one accessor of a Property/Indexer/Event.
14541         (MethodData.GetMethodFlags): Moved here from MemberBase.
14542         (MethodData.ApplyAttributes): Likewise.
14543         (MethodData.ApplyObsoleteAttribute): Likewise.
14544         (MethodData.ApplyConditionalAttribute): Likewise.
14545         (MethodData.ApplyDllImportAttribute): Likewise.
14546         (MethodData.CheckAbstractAndExternal): Likewise.
14547         (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
14548         (MethodData.Emit): Formerly known as Method.Emit().
14549         (MemberBase): Moved everything which was specific to a single
14550         accessor/method to MethodData.
14551         (Method): Create a new MethodData and call Define() and Emit() on it.
14552         (Property, Indexer, Event): Create a new MethodData objects for each
14553         accessor and call Define() and Emit() on them.
14554
14555 2002-07-25  Martin Baulig  <martin@gnome.org>
14556
14557         Made MethodCore derive from MemberBase to reuse the code from there.
14558         MemberBase now also checks for attributes.
14559
14560         * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
14561         (MemberBase.GetMethodFlags): Moved here from class Method and marked
14562         as virtual.
14563         (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
14564         `CallingConventions cc' and `Attributes opt_attrs' arguments.
14565         (MemberBase.ApplyAttributes): New virtual method; applies the
14566         attributes to a method or accessor.
14567         (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
14568         (MemberBase.ApplyConditionalAttribute): Likewise.
14569         (MemberBase.ApplyDllImportAttribute): Likewise.
14570         (MemberBase.CheckAbstractAndExternal): Likewise.
14571         (MethodCore.ParameterTypes): This is now a property instead of a
14572         method, it's initialized from DoDefineParameters().
14573         (MethodCore.ParameterInfo): Removed the set accessor.
14574         (MethodCore.DoDefineParameters): New protected virtual method to
14575         initialize ParameterTypes and ParameterInfo.
14576         (Method.GetReturnType): We can now simply return the MemberType.
14577         (Method.GetMethodFlags): Override the MemberBase version and add
14578         the conditional flags.
14579         (Method.CheckBase): Moved some code from Define() here, call
14580         DoDefineParameters() here.
14581         (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
14582         here to avoid some larger code duplication.
14583         (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
14584         ensure that abstract and external accessors don't declare a body.
14585
14586         * attribute.cs (Attribute.GetValidPieces): Make this actually work:
14587         `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
14588         lookup in the attribute's parent classes, so we need to abort as soon
14589         as we found the first match.
14590         (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
14591         the attribute has no arguments.
14592
14593         * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
14594         of a Method.
14595
14596 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14597
14598         * cs-parser.jay: reverted previous patch.
14599
14600 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14601
14602         * cs-parser.jay: fixed bug #22119.
14603
14604 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14605
14606         * attribute.cs: fixed compilation. The error was:
14607         "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must 
14608         be assigned to before control leaves the current method."
14609         [FIXME:  Filed as bug #28186: MCS must report this error.]
14610
14611 2002-07-25  Martin Baulig  <martin@gnome.org>
14612
14613         * attribute.cs (Attribute.Conditional_GetConditionName): New static
14614         method to pull the condition name ouf of a Conditional attribute.
14615         (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
14616         the obsolete message and error flag out of an Obsolete attribute.
14617
14618         * class.cs (Method.GetMethodFlags): New public method to get the
14619         TypeManager.MethodFlags for this method.
14620         (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
14621         private methods.
14622         (Method.Define): Get and apply the Obsolete and Conditional attributes;
14623         if we're overriding a virtual function, set the new private variable
14624         `parent_method'; call the new TypeManager.AddMethod().
14625
14626         * typemanager.cs (TypeManager.AddMethod): New static method.  Stores
14627         the MethodBuilder and the Method in a PtrHashtable.
14628         (TypeManager.builder_to_method): Added for this purpose.
14629         (TypeManager.MethodFlags): Added IsObsoleteError.
14630         (TypeManager.GetMethodFlags): Added `Location loc' argument.  Lookup
14631         Obsolete and Conditional arguments in MethodBuilders.  If we discover
14632         an Obsolete attribute, emit an appropriate warning 618 / error 619 with
14633         the message from the attribute.
14634
14635 2002-07-24  Martin Baulig  <martin@gnome.org>
14636
14637         * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
14638         preprocessor directives, ensure that the argument to #define/#undef is
14639         exactly one identifier and that it's actually an identifier.
14640
14641         Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
14642         did not work ....
14643
14644 2002-07-24  Martin Baulig  <martin@gnome.org>
14645
14646         * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
14647         initialize it to TypeManager.object_type in the constructor.
14648         (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
14649         of the `hm.get_current' method if we're using the collection pattern.
14650         (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
14651         for the explicit conversion to make it work when we're using the collection
14652         pattern and the `Current' property has a different return type than `object'.
14653         Fixes #27713.
14654
14655 2002-07-24  Martin Baulig  <martin@gnome.org>
14656
14657         * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
14658         does not match, but don't report any errors.  This method is called in
14659         order for all methods in a MethodGroupExpr until a matching method is
14660         found, so we don't want to bail out if the first method doesn't match.
14661         (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
14662         matches, report the 123.  Fixes #28070.
14663
14664 2002-07-24  Martin Baulig  <martin@gnome.org>
14665
14666         * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
14667         TypeManager.TypeToCoreType() to the top of the method so the
14668         following equality checks will work.  Fixes #28107.
14669
14670 2002-07-24  Martin Baulig  <martin@gnome.org>
14671
14672         * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
14673         operand is of type uint, and the other operand is of type sbyte,
14674         short or int, the operands are converted to type long." -
14675         Actually do what this comment already told us.  Fixes bug #28106,
14676         added test-150.cs.
14677
14678 2002-07-24  Martin Baulig  <martin@gnome.org>
14679
14680         * class.cs (MethodBase): New abstract class.  This is now a base
14681         class for Property, Indexer and Event to avoid some code duplication
14682         in their Define() and DefineMethods() methods.
14683         (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
14684         generic methods for Define() and DefineMethods().
14685         (FieldBase): Derive from MemberBase, not MemberCore.
14686         (Property): Derive from MemberBase, not MemberCore.
14687         (Property.DefineMethod): Moved all the code from this method to the
14688         new MethodBase.DefineAccessor(), just call it with appropriate
14689         argumetnts.
14690         (Property.Define): Call the new Property.DoDefine(), this does some
14691         sanity checks and we don't need to duplicate the code everywhere.
14692         (Event): Derive from MemberBase, not MemberCore.
14693         (Event.Define): Use the new MethodBase.DefineAccessor() to define the
14694         accessors, this will also make them work with interface events.
14695         (Indexer): Derive from MemberBase, not MemberCore.
14696         (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
14697         (Indexer.Define): Use the new MethodBase functions.
14698
14699         * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
14700         argument to the constructor.
14701         (Interface.FindMembers): Added support for interface events.
14702         (Interface.PopluateEvent): Implemented.
14703
14704         Added test-149.cs for this.  This also fixes bugs #26067 and #24256.
14705
14706 2002-07-22  Miguel de Icaza  <miguel@ximian.com>
14707
14708         * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
14709         but this is required to check for a method name being the same as
14710         the containing class.  
14711
14712         Handle this now.
14713
14714 2002-07-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14715
14716         * interface.cs: initialize variable.
14717
14718 2002-07-23  Martin Baulig  <martin@gnome.org>
14719
14720         Implemented the IndexerName attribute in interfaces.
14721
14722         * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
14723         name if this is an explicit interface implementation.
14724         (Indexer.InterfaceIndexerName): New public variable.  If we're
14725         implementing an interface indexer, this is the IndexerName in that
14726         interface.  Otherwise, it's the IndexerName.
14727         (Indexer.DefineMethod): If we're implementing interface indexer,
14728         set InterfaceIndexerName.  Use the new Pending.IsInterfaceIndexer
14729         and Pending.ImplementIndexer methods.
14730         (Indexer.Define): Also define the PropertyBuilder if we're
14731         implementing an interface indexer and this is neither an explicit
14732         interface implementation nor do the IndexerName match the one in
14733         the interface.
14734
14735         * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
14736         If a method is defined here, then we always need to create a proxy
14737         for it.  This is used when implementing interface indexers.
14738         (Pending.IsInterfaceIndexer): New public method.
14739         (Pending.ImplementIndexer): New public method.
14740         (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
14741         This is used when implementing interface indexers to define a proxy
14742         if necessary.
14743         (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
14744         define a proxy if necessary.
14745
14746         * interface.cs (Interface.IndexerName): New public variable.
14747         (Interface.PopulateIndexer): Set the IndexerName.
14748         (Interface.DefineIndexers): New private method.  Populate all the
14749         indexers and make sure their IndexerNames match.
14750
14751         * typemanager.cs (IndexerPropertyName): Added support for interface
14752         indexers.
14753
14754 2002-07-22  Martin Baulig  <martin@gnome.org>
14755
14756         * codegen.cs (EmitContext.HasReturnLabel): New public variable.
14757         (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
14758         ret if HasReturnLabel.
14759         (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
14760         variables.
14761
14762         * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
14763         and set the ec.LoopBeginTryCatchLevel.
14764         (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
14765         (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
14766         the current ec.TryCatchLevel, the branch goes out of an exception
14767         block.  In this case, we need to use Leave and not Br.
14768
14769 2002-07-22  Martin Baulig  <martin@gnome.org>
14770
14771         * statement.cs (Try.Emit): Emit an explicit ret after the end of the
14772         block unless the block does not always return or it is contained in
14773         another try { ... } catch { ... } block.  Fixes bug #26506.
14774         Added verify-1.cs to the test suite.
14775
14776 2002-07-22  Martin Baulig  <martin@gnome.org>
14777
14778         * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
14779         then we do not always return.  Fixes bug #24985.
14780
14781 2002-07-22  Martin Baulig  <martin@gnome.org>
14782
14783         * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
14784         lookup on a per-class level; ie. walk up the class hierarchy until we
14785         found at least one applicable method, then choose the best among them.
14786         Fixes bug #24463 and test-29.cs.
14787
14788 2002-07-22  Martin Baulig  <martin@gnome.org>
14789
14790         * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
14791         return types of the methods.  The return type is not part of the
14792         signature and we must not check it to make the `new' modifier work.
14793         Fixes bug #27999, also added test-147.cs.
14794         (TypeManager.TypeToCoreType): Added TypeManager.type_type.
14795
14796         * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
14797         on the method's return type.
14798
14799 2002-07-21  Martin Baulig  <martin@gnome.org>
14800
14801         * assign.cs: Make this work if the rightmost source is a constant and
14802         we need to do an implicit type conversion.  Also adding a few more tests
14803         to test-38.cs which should have caught this.
14804
14805         * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
14806         target in the makefile for this.  The makefile.gnu is primarily intended
14807         for end-users who don't want to debug the compiler.
14808
14809 2002-07-21  Martin Baulig  <martin@gnome.org>
14810
14811         * assign.cs: Improved the Assign class so it can now handle embedded
14812         assignments (X = Y = Z = something).  As a side-effect this'll now also
14813         consume less local variables.  test-38.cs now passes with MCS, added
14814         a few new test cases to that test.
14815
14816 2002-07-20  Martin Baulig  <martin@gnome.org>
14817
14818         * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
14819         instructions.  Fixes bug #27977, also added test-146.cs.
14820
14821 2002-07-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14822
14823         * cs-tokenizer.cs: fixed getHex ().
14824
14825 2002-07-19  Martin Baulig  <martin@gnome.org>
14826
14827         * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
14828         not Type.GetType() to lookup the array type.  This is needed when
14829         we're constructing an array of a user-defined type.
14830         (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
14831         single-dimensional arrays, but also for single-dimensial arrays of
14832         type decimal.
14833
14834 2002-07-19  Martin Baulig  <martin@gnome.org>
14835
14836         * expression.cs (New.DoEmit): Create a new LocalTemporary each time
14837         this function is called, it's not allowed to share LocalBuilders
14838         among ILGenerators.
14839
14840 2002-07-19  Martin Baulig  <martin@gnome.org>
14841
14842         * expression.cs (Argument.Resolve): Report an error 118 when trying
14843         to pass a type as argument.
14844
14845 2002-07-18  Martin Baulig  <martin@gnome.org>
14846
14847         * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
14848         Conv_R_Un for the signed `long' type.
14849
14850 2002-07-15  Miguel de Icaza  <miguel@ximian.com>
14851
14852         * expression.cs (MemberAccess.DoResolve): Do not reuse the field
14853         `expr' for the temporary result, as that will fail if we do
14854         multiple resolves on the same expression.
14855
14856 2002-07-05  Miguel de Icaza  <miguel@ximian.com>
14857
14858         * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
14859         ec.TypeContainer for looking up aliases. 
14860
14861         * class.cs (TypeContainer): Remove LookupAlias from here.
14862
14863         * decl.cs (DeclSpace); Move here.
14864
14865 2002-07-01  Miguel de Icaza  <miguel@ximian.com>
14866
14867         * class.cs (FindMembers): Only call filter if the constructor
14868         bulider is not null.
14869
14870         Also handle delegates in `NestedTypes' now.  Now we will perform
14871         type lookups using the standard resolution process.  This also
14872         fixes a bug.
14873
14874         * decl.cs (DeclSpace.ResolveType): New type resolution routine.
14875         This uses Expressions (the limited kind that can be parsed by the
14876         tree) instead of strings.
14877
14878         * expression.cs (ComposedCast.ToString): Implement, used to flag
14879         errors since now we have to render expressions.
14880
14881         (ArrayCreation): Kill FormElementType.  Use ComposedCasts in
14882         FormArrayType. 
14883
14884         * ecore.cs (SimpleName.ToString): ditto.
14885
14886         * cs-parser.jay: Instead of using strings to assemble types, use
14887         Expressions to assemble the type (using SimpleName, ComposedCast,
14888         MemberAccess).  This should fix the type lookups in declarations,
14889         because we were using a different code path for this.
14890
14891         * statement.cs (Block.Resolve): Continue processing statements
14892         even when there is an error.
14893
14894 2002-07-17  Miguel de Icaza  <miguel@ximian.com>
14895
14896         * class.cs (Event.Define): Also remove the `remove' method from
14897         the list of pending items.
14898
14899         * expression.cs (ParameterReference): Use ldarg.N (0..3) to
14900         generate more compact code. 
14901
14902 2002-07-17  Martin Baulig  <martin@gnome.org>
14903
14904         * const.cs (Const.LookupConstantValue): Add support for constant
14905         `unchecked' and `checked' expressions.
14906         Also adding test case test-140.cs for this.
14907
14908 2002-07-17  Martin Baulig  <martin@gnome.org>
14909
14910         * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
14911         check whether mi.ReturnType implements the IEnumerator interface; the
14912         `==' and the IsAssignableFrom() will fail in this situation.
14913
14914 2002-07-16  Ravi Pratap  <ravi@ximian.com>
14915
14916         * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix 
14917         here too.
14918
14919 2002-07-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14920
14921         * expression.cs: fixed bug #27811.
14922
14923 2002-07-14  Miguel de Icaza  <miguel@ximian.com>
14924
14925         * expression.cs (ParameterReference.AddressOf): Patch from Paolo
14926         Molaro: when we are a ref, the value already contains a pointer
14927         value, do not take the address of it.
14928
14929 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
14930         * removed mb-parser.jay and mb-tokenizer.cs
14931
14932 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
14933
14934         * expression.cs: check against the building corlib void type.
14935
14936 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
14937
14938         * ecore.cs: fix for valuetype static readonly fields: when 
14939         initializing them, we need their address, not the address of a copy.
14940
14941 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
14942
14943         * typemanager.cs: register also enum_type in corlib.
14944
14945 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
14946
14947         * class.cs: allow calling this (but not base) initializers in structs.
14948
14949 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
14950
14951         * ecore.cs: make sure we compare against the building base types
14952         in GetTypeSize ().
14953
14954 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
14955
14956         * typemanager.cs: fix TypeToCoreType() to handle void and object
14957         (corlib gets no more typerefs after this change).
14958
14959 2002-07-12  Miguel de Icaza  <miguel@ximian.com>
14960
14961         * expression.cs (ArrayCreation.EmitArrayArguments): use
14962         Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
14963
14964         (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
14965         Conv_Ovf_I_Un for the array arguments.  Even if C# allows longs as
14966         array indexes, the runtime actually forbids them.
14967
14968         * ecore.cs (ExpressionToArrayArgument): Move the conversion code
14969         for array arguments here.
14970
14971         * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
14972         instead of the default for ValueTypes.
14973
14974         (New.DoEmit): Use IsValueType instead of
14975         IsSubclassOf (value_type)
14976         (New.DoResolve): ditto.
14977         (Invocation.EmitCall): ditto.
14978
14979         * assign.cs (Assign): ditto.
14980
14981         * statement.cs (Unsafe): Ok, so I got the semantics wrong.
14982         Statements *are* currently doing part of their resolution during
14983         Emit.  
14984
14985         Expressions do always resolve during resolve, but statements are
14986         only required to propagate resolution to their children.
14987
14988 2002-07-11  Miguel de Icaza  <miguel@ximian.com>
14989
14990         * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
14991
14992         (LoadAssembly): Do not add the dll if it is already specified
14993
14994         (MainDriver): Add the System directory to the link path at the end,
14995         after all the other -L arguments. 
14996
14997         * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
14998         wrong opcode for loading bytes and bools (ldelem.i1 instead of
14999         ldelem.u1) and using the opposite for sbytes.
15000
15001         This fixes Digger, and we can finally run it.
15002
15003         * driver.cs (UnixParseOption): Move the option parsing here.  
15004         (CSCParseOption): Implement CSC-like parsing of options.
15005
15006         We now support both modes of operation, the old Unix way, and the
15007         new CSC-like way.  This should help those who wanted to make cross
15008         platform makefiles.
15009
15010         The only thing broken is that /r:, /reference: and /lib: are not
15011         implemented, because I want to make those have the same semantics
15012         as the CSC compiler has, and kill once and for all the confussion
15013         around this.   Will be doing this tomorrow.
15014
15015         * statement.cs (Unsafe.Resolve): The state is checked during
15016         resolve, not emit, so we have to set the flags for IsUnsfe here.
15017
15018 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
15019
15020         * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
15021         not catch the Error_ObjectRefRequired in SimpleName (as it is
15022         possible to have a class/instance variable name that later gets
15023         deambiguated), we have to check this here.      
15024
15025 2002-07-10  Ravi Pratap  <ravi@ximian.com>
15026
15027         * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
15028         make static and put into Expression.
15029
15030         (Event.Define): Register the private field of the event with the 
15031         TypeManager so that GetFieldFromEvent can get at it.
15032
15033         (TypeManager.RegisterPrivateFieldOfEvent): Implement to
15034         keep track of the private field associated with an event which
15035         has no accessors.
15036
15037         (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
15038         private field.
15039
15040         * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
15041
15042 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
15043
15044         * expression.cs (Binary.EmitBranchable): this routine emits the
15045         Binary expression in a branchable context.  This basically means:
15046         we need to branch somewhere, not just get the value on the stack.
15047
15048         This works together with Statement.EmitBoolExpression.
15049
15050         * statement.cs (Statement.EmitBoolExpression): Use
15051         EmitBranchable. 
15052
15053 2002-07-09  Miguel de Icaza  <miguel@ximian.com>
15054
15055         * statement.cs (For): Reduce the number of jumps in loops.
15056
15057         (For): Implement loop inversion for the For statement.
15058
15059         (Break): We can be breaking out of a Try/Catch controlled section
15060         (foreach might have an implicit try/catch clause), so we need to
15061         use Leave instead of Br.
15062
15063         * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
15064         now).  If the instace expression supports IMemoryLocation, we use
15065         the AddressOf method from the IMemoryLocation to extract the
15066         address instead of emitting the instance.
15067
15068         This showed up with `This', as we were emitting the instance
15069         always (Emit) instead of the Address of This.  Particularly
15070         interesting when This is a value type, as we dont want the Emit
15071         effect (which was to load the object).
15072
15073 2002-07-08  Miguel de Icaza  <miguel@ximian.com>
15074
15075         * attribute.cs: Pass the entry point to the DefinePInvokeMethod
15076
15077         * statement.cs (Checked): Set the CheckedState during the resolve
15078         process too, as the ConvCast operations track the checked state on
15079         the resolve process, and not emit.
15080
15081         * cs-parser.jay (namespace_member_declaration): Flag that we have
15082         found a declaration when we do.  This is used to flag error 1529
15083
15084         * driver.cs: Report ok when we display the help only.
15085
15086 2002-07-06  Andrew Birkett  <adb@tardis.ed.ac.uk>
15087
15088         * cs-tokenizer.cs (xtoken): Improve handling of string literals.
15089
15090 2002-07-04  Miguel de Icaza  <miguel@ximian.com>
15091
15092         * cs-tokenizer.cs (define): We also have to track locally the
15093         defines.  AllDefines is just used for the Conditional Attribute,
15094         but we also need the local defines for the current source code. 
15095
15096 2002-07-03  Miguel de Icaza  <miguel@ximian.com>
15097
15098         * statement.cs (While, For, Do): These loops can exit through a
15099         Break statement, use this information to tell whether the
15100         statement is the last piece of code.
15101
15102         (Break): Flag that we break.
15103
15104         * codegen.cs (EmitContexts): New `Breaks' state variable.
15105
15106 2002-07-03  Martin Baulig  <martin@gnome.org>
15107
15108         * class.cs (TypeContainer.MethodModifiersValid): Allow override
15109         modifiers in method declarations in structs.  Otherwise, you won't
15110         be able to override things like Object.Equals().
15111
15112 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
15113
15114         * class.cs (Method, Property, Indexer): Do not allow the public
15115         modifier to be used in explicit interface implementations.
15116
15117         (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
15118         override modifiers in method declarations in structs
15119
15120 2002-07-02   Andrew Birkett <adb@tardis.ed.ac.uk>
15121
15122         * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
15123         integer or real overflow, report an error
15124
15125 2002-07-02  Martin Baulig  <martin@gnome.org>
15126
15127         * typemanager.cs (TypeManager.InitCoreTypes): When compiling
15128         corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
15129         to tell the runtime about our newly created System.Object and
15130         System.ValueType types.
15131
15132 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
15133
15134         * expression.cs (This): Use Stobj/Ldobj when we are a member of a
15135         struct instead of Ldarg/Starg.
15136
15137 2002-07-02  Martin Baulig  <martin@gnome.org>
15138
15139         * expression.cs (Indirection.Indirection): Call
15140         TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
15141
15142 2002-07-02  Martin Baulig  <martin@gnome.org>
15143
15144         * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
15145         ValueType, call TypeManager.TypeToCoreType() on it.
15146         (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
15147         the OpCodes.Newarr argument.
15148
15149 2002-07-02  Martin Baulig  <martin@gnome.org>
15150
15151         * expression.cs (Invocation.EmitCall): When compiling corlib,
15152         replace all calls to the system's System.Array type to calls to
15153         the newly created one.
15154
15155         * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
15156         System.Array methods.
15157         (TypeManager.InitCoreTypes): When compiling corlib, get the methods
15158         from the system's System.Array type which must be replaced.
15159
15160 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
15161
15162         * typemanager.cs: load unverifiable_code_ctor so we can build
15163         corlib using the correct type. Avoid using GetTypeCode() with
15164         TypeBuilders.
15165         * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
15166         TypeManager.object_type to allow building corlib.
15167
15168 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
15169
15170         * ecore.cs: handle System.Enum separately in LoadFromPtr().
15171
15172 2002-07-01  Martin Baulig  <martin@gnome.org>
15173
15174         * class.cs: Make the last change actually work, we need to check
15175         whether `ifaces != null' to avoid a crash.
15176
15177 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
15178
15179         * class.cs: when we build structs without fields that implement
15180         interfaces, we need to add the interfaces separately, since there is
15181         no API to both set the size and add the interfaces at type creation
15182         time.
15183
15184 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
15185
15186         * expression.cs: the dimension arguments to the array constructors
15187         need to be converted if they are a long.
15188
15189 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
15190
15191         * class.cs: don't emit ldarg.0 if there is no parent constructor
15192         (fixes showstopper for corlib).
15193
15194 2002-06-29  Martin Baulig  <martin@gnome.org>
15195
15196         MCS now compiles corlib on GNU/Linux :-)
15197
15198         * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
15199         ie. check for MethodImplOptions.InternalCall.
15200
15201         * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
15202         and TypeManager.attribute_type are null, so we must explicitly check
15203         whether parent is not null to find out whether it's an attribute type.
15204         (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
15205         and SetBuilder, not only if the property is neither abstract nor external.
15206         This is necessary to set the MethodImplOptions on the accessor methods.
15207         (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
15208         SetBuilder, see Property.Emit().
15209
15210         * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
15211         populate "System.Object", "System.ValueType" and "System.Attribute" since
15212         they've already been populated from BootCorlib_PopulateCoreTypes().
15213
15214 2002-06-29  Martin Baulig  <martin@gnome.org>
15215
15216         * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
15217         is the NullLiteral, we also need to make sure that target_type is not
15218         an enum type.   
15219
15220 2002-06-29  Martin Baulig  <martin@gnome.org>
15221
15222         * rootcontext.cs (RootContext.ResolveCore): We must initialize
15223         `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
15224         before calling BootstrapCorlib_ResolveDelegate ().
15225
15226 2002-06-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15227
15228         * statement.cs: fixed build-breaker. All tests passed ok.
15229
15230 2002-06-27  Martin Baulig  <martin@gnome.org>
15231
15232         * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
15233         for System.Decimal when compiling corlib.
15234
15235 2002-06-27  Martin Baulig  <martin@gnome.org>
15236
15237         * statement.cs (Switch.TableSwitchEmit): Make this work with empty
15238         switch blocks which contain nothing but a default clause.
15239
15240 2002-06-26  Andrew  <adb@tardis.ed.ac.uk>
15241
15242        * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
15243
15244 2002-06-27  Martin Baulig  <martin@gnome.org>
15245
15246         * ecore.cs (PropertyExpr.PropertyExpr): Call
15247         TypeManager.TypeToCoreType() on the `pi.PropertyType'.
15248
15249         * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
15250         is already a TypeBuilder.
15251
15252 2002-06-27  Martin Baulig  <martin@gnome.org>
15253
15254         * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
15255         `target_type == TypeManager.array_type', not IsAssignableFrom() in
15256         the "from an array-type to System.Array" case.  This makes it work
15257         when compiling corlib.
15258
15259 2002-06-27  Martin Baulig  <martin@gnome.org>
15260
15261         * ecore.cs (Expression.SimpleNameResolve): If the expression is a
15262         non-static PropertyExpr, set its InstanceExpression.  This makes
15263         the `ICollection.Count' property work in System/Array.cs.
15264
15265 2002-06-25  Andrew Birkett  <adb@tardis.ed.ac.uk>
15266
15267         * driver.cs: Made error handling more consistent.  Errors now
15268         tracked by Report class, so many methods which used to return int
15269         now return void.  Main() now prints success/failure and 
15270         errors/warnings message.
15271
15272         Renamed '--probe' compiler argument to '--expect-error'.  Removed
15273         the magic number return values (123 and 124).  Now, if the
15274         expected error occurs, the compiler exits with success (exit value
15275         0).  If the compilation completes without seeing that particular
15276         error, the compiler exits with failure (exit value 1).  The
15277         makefile in mcs/errors has been changed to handle the new behaviour.
15278
15279         * report.cs: Made 'expected error' number a property and renamed
15280         it from 'Probe' to 'ExpectedError'.
15281
15282         * genericparser.cs: Removed error handling support, since it is
15283         now all done by Report class.
15284
15285         * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
15286         class, so parse() no longer returns an int.
15287
15288         * namespace.cs: Use Report.Error instead of GenericParser.error
15289
15290 2002-06-22  Miguel de Icaza  <miguel@ximian.com>
15291
15292         * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
15293         TypeContainer.AddOperator): At the front of the list put the
15294         explicit implementations, so they get resolved/defined first. 
15295
15296 2002-06-21  Miguel de Icaza  <miguel@ximian.com>
15297
15298         * class.cs (TypeContainer.VerifyImplements): Verifies that a given
15299         interface type is implemented by this TypeContainer.  Used during
15300         explicit interface implementation.
15301
15302         (Property.Define, Indexer.Define, Method.Define): Validate that
15303         the given interface in the explicit implementation is one of the
15304         base classes for the containing type.
15305
15306         Also if we are explicitly implementing an interface, but there is
15307         no match in the pending implementation table, report an error.
15308
15309         (Property.Define): Only define the property if we are
15310         not explicitly implementing a property from an interface.  Use the
15311         correct name also for those properties (the same CSC uses,
15312         although that is really not needed).
15313
15314         (Property.Emit): Do not emit attributes for explicitly implemented
15315         properties, as there is no TypeBuilder.
15316
15317         (Indexer.Emit): ditto.
15318
15319         Hiding then means that we do not really *implement* a pending
15320         implementation, which makes code fail.
15321
15322 2002-06-22  Martin Baulig  <martin@gnome.org>
15323
15324         * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
15325         the return value of Object.GetType().  [FIXME: we need to do this whenever
15326         we get a type back from the reflection library].
15327
15328 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
15329
15330         * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
15331
15332 2002-06-20  Miguel de Icaza  <miguel@ximian.com>
15333
15334         * attribute.cs: Return null if we can not look up the type.
15335
15336         * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
15337         the interface types found.
15338
15339         * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
15340         interface types found.
15341
15342         * typemanager.cs (GetInterfaces): Make this routine returns alll
15343         the interfaces and work around the lame differences between
15344         System.Type and System.Reflection.Emit.TypeBuilder in the results
15345         result for GetInterfaces.
15346
15347         (ExpandInterfaces): Given an array of interface types, expand and
15348         eliminate repeated ocurrences of an interface.  This expands in
15349         context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
15350         be IA, IB, IC.
15351
15352 2002-06-21  Martin Baulig  <martin@gnome.org>
15353
15354         * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
15355         on System.Enum.
15356
15357 2002-06-21  Martin Baulig  <martin@gnome.org>
15358
15359         * typemanager.cs (TypeManager.TypeToCoreType): New function.  When compiling corlib
15360         and called with one of the core types, return the corresponding typebuilder for
15361         that type.
15362
15363         * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
15364         element type.
15365
15366 2002-06-21  Martin Baulig  <martin@gnome.org>
15367
15368         * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
15369         `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
15370         (Expression.ConvertReferenceExplicit): Likewise.
15371
15372         * expression.cs (ElementAccess.DoResolve): Likewise.
15373         (ElementAccess.DoResolveLValue): Likewise.
15374
15375 2002-06-10  Martin Baulig  <martin@gnome.org>
15376
15377         * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
15378         add the "value" parameter to the parameter list.
15379
15380         * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
15381         to our caller.
15382
15383 2002-06-19  Miguel de Icaza  <miguel@ximian.com>
15384
15385         * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
15386         the argument to an int, uint, long or ulong, per the spec.  Also
15387         catch negative constants in array creation.
15388
15389 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
15390
15391         * class.cs: do not allow the same interface to appear twice in
15392         the definition list.
15393
15394 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
15395
15396         * ecore.cs: don't use ldlen with System.Array.
15397
15398 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
15399
15400         * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
15401
15402 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
15403
15404         * modifiers.cs: produce correct field attributes for protected
15405         internal. Easy fix so miguel can work on ther harder stuff:-)
15406
15407 2002-06-18  Miguel de Icaza  <miguel@ximian.com>
15408
15409         * pending.cs: New file.  Move the code from class.cs here.
15410         Support clearning the pending flag for all methods (when not doing
15411         explicit interface implementation).
15412
15413 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
15414
15415         * rootcontext.cs: added a couple more types needed to bootstrap.
15416
15417 2002-06-17  Miguel de Icaza  <miguel@ximian.com>
15418
15419         * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
15420         constructor in the type, instead of any constructor in the type
15421         hierarchy.  Thanks to Paolo for finding this bug (it showed up as
15422         a bug in the Mono runtime when applying the params attribute). 
15423
15424 2002-06-16  Rafael Teixeira  <rafaelteixeirabr@hotmail.com>
15425         * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
15426
15427 2002-06-14  Rachel Hestilow  <hestilow@ximian.com>
15428
15429         * expression.cs (Unary.ResolveOperator): Use TypeManager
15430         to resolve the type.
15431
15432 2002-06-13  Ravi Pratap  <ravi@ximian.com>
15433
15434         * cs-parser.jay (enum_member_declaration): Pass in the attributes
15435         attached.
15436
15437         * enum.cs (AddEnumMember): Add support to store the attributes associated 
15438         with each member too.
15439
15440         * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
15441         field builders too - this takes care of the enum member case.
15442
15443 2002-06-10  Rachel Hestilow  <hestilow@ximian.com>
15444
15445         * typemanager.cs (TypeManager.VerifyUnManaged): Allow
15446         address-of operator on both value types and pointers.
15447
15448 2002-06-10  Martin Baulig  <martin@gnome.org>
15449
15450         * interface.cs (Interface.PopulateIndexer): Add the indexer's
15451         PropertyBuilder to the `property_builders' list.
15452
15453         * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
15454         (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
15455         `lookup_type' and all its interfaces.  Unfortunately, Type.FindMembers() won't
15456         find any indexers which are inherited from an interface.
15457
15458 2002-06-09  Martin Baulig  <martin@gnome.org>
15459
15460         * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
15461         the same type as the constant if necessary.  There's also a test-130.cs
15462         for this.
15463
15464         * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
15465
15466         * typemanager.cs (TypeManager.ChangeType): Previously known as
15467         Enum.ChangeEnumType().
15468
15469 2002-06-09  Martin Baulig  <martin@gnome.org>
15470
15471         * expression.cs (Cast.TryReduce): Added support for consts.
15472
15473 2002-06-08  Ravi Pratap  <ravi@ximian.com>
15474
15475         * class.cs (Accessor): Hold attributes information so we can pass
15476         it along.
15477
15478         * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
15479         Modify to pass in attributes attached to the methods.
15480
15481         (add_accessor_declaration, remove_accessor_declaration): Ditto.
15482
15483         * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
15484         to handle the Accessor kind :-)
15485
15486         * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
15487
15488 2002-06-08  Martin Baulig  <martin@gnome.org>
15489
15490         * expression.cs (Unary.TryReduceNegative): Added support for
15491         ULongConstants.
15492
15493 2002-06-08  Martin Baulig  <martin@gnome.org>
15494
15495         * enum.cs (Enum.LookupEnumValue): Don't report an error if the
15496         name can't be found in the `defined_names' - the caller will do a
15497         MemberLookup in this case and thus find methods in System.Enum
15498         such as Enum.IsDefined().
15499
15500 2002-06-08  Martin Baulig  <martin@gnome.org>
15501
15502         * enum.cs (Enum.ChangeEnumType): This is a custom version of
15503         Convert.ChangeType() which works with TypeBuilder created types.
15504         (Enum.LookupEnumValue, Enum.Define): Use it here.
15505
15506         * class.cs (TypeContainer.RegisterRequiredImplementations): Added
15507         `TypeBuilder.BaseType != null' check.
15508         (TypeContainer.FindMembers): Only lookup parent members if we
15509         actually have a parent.
15510         (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
15511         (ConstructorInitializer.Resolve): Likewise.
15512
15513         * interface.cs (Interface.FindMembers): Added
15514         `TypeBuilder.BaseType != null' check.
15515
15516         * rootcontext.cs (RootContext.ResolveCore): Added
15517         "System.Runtime.CompilerServices.IndexerNameAttribute" to
15518         classes_second_stage.
15519
15520         * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
15521         debug_type and trace_type when compiling with --nostdlib.       
15522
15523 2002-06-07  Martin Baulig  <martin@gnome.org>
15524
15525         * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
15526         (AddField): Set it to true when adding a non-static field.
15527         (DefineType): Use `have_nonstatic_fields' to find out whether we
15528         have non-static fields, not `Fields != null'.
15529
15530 2002-06-02  Miguel de Icaza  <miguel@ximian.com>
15531
15532         * ecore.cs (SimpleNameResolve): Removed simple bug (we were
15533         dereferencing a null on the static-field code path)
15534
15535 2002-05-30  Martin Baulig  <martin@gnome.org>
15536
15537         * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
15538         to take command line arguments.  Use reflection to call the new
15539         custom `Initialize' function on the symbol writer and pass it the
15540         command line arguments.
15541
15542         * driver.cs (--debug-args): New command line argument to pass command
15543         line arguments to the symbol writer.
15544
15545 2002-05-28  Miguel de Icaza  <miguel@ximian.com>
15546
15547         * assign.cs (DoResolve): Forgot to do the implicit conversion to
15548         the target type for indexers and properties.  Thanks to Joe for
15549         catching this.
15550
15551 2002-05-27  Miguel de Icaza  <miguel@ximian.com>
15552
15553         * typemanager.cs (MethodFlags): returns the method flags
15554         (Obsolete/ShouldIgnore) that control warning emission and whether
15555         the invocation should be made, or ignored. 
15556
15557         * expression.cs (Invocation.Emit): Remove previous hack, we should
15558         not do this on matching a base type, we should do this based on an attribute
15559
15560         Only emit calls to System.Diagnostics.Debug and
15561         System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
15562         on the command line.
15563
15564         * rootcontext.cs: Global settings for tracing and debugging.
15565
15566         * cs-tokenizer.cs (define): New utility function to track
15567         defines.   Set the global settings for TRACE and DEBUG if found.
15568
15569 2002-05-25  Ravi Pratap  <ravi@ximian.com>
15570
15571         * interface.cs (Populate*): Pass in the TypeContainer as well as
15572         the DeclSpace as parameters so that we can create EmitContexts and
15573         then use that to apply attributes etc.
15574
15575         (PopulateMethod, PopulateEvent, PopulateProperty)
15576         (PopulateIndexer): Apply attributes everywhere.
15577
15578         * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
15579         etc.
15580
15581         (ApplyAttributes): Update accordingly.
15582
15583         We now apply interface attributes for all members too.
15584
15585 2002-05-26  Miguel de Icaza  <miguel@ximian.com>
15586
15587         * class.cs (Indexer.Define); Correctly check if we are explicit
15588         implementation (instead of checking the Name for a ".", we
15589         directly look up if the InterfaceType was specified).
15590
15591         Delay the creation of the PropertyBuilder.
15592
15593         Only create the PropertyBuilder if we are not an explicit
15594         interface implementation.   This means that explicit interface
15595         implementation members do not participate in regular function
15596         lookups, and hence fixes another major ambiguity problem in
15597         overload resolution (that was the visible effect).
15598
15599         (DefineMethod): Return whether we are doing an interface
15600         implementation. 
15601
15602         * typemanager.cs: Temporary hack until we get attributes in
15603         interfaces (Ravi is working on that) and we get IndexerName
15604         support in interfaces.
15605
15606         * interface.cs: Register the indexers as properties.
15607
15608         * attribute.cs (Attribute.Resolve): Catch the error, and emit a
15609         warning, I have verified that this is a bug in the .NET runtime
15610         (JavaScript suffers of the same problem).
15611
15612         * typemanager.cs (MemberLookup): When looking up members for
15613         interfaces, the parent of an interface is the implicit
15614         System.Object (so we succeed in searches of Object methods in an
15615         interface method invocation.  Example:  IEnumerable x;  x.ToString
15616         ()) 
15617
15618 2002-05-25  Miguel de Icaza  <miguel@ximian.com>
15619
15620         * class.cs (Event): Events should also register if they do
15621         implement the methods that an interface requires.
15622
15623         * typemanager.cs (MemberLookup); use the new GetInterfaces
15624         method. 
15625
15626         (GetInterfaces): The code used to lookup interfaces for a type is
15627         used in more than one place, factor it here. 
15628
15629         * driver.cs: Track the errors at the bottom of the file, we kept
15630         on going.
15631
15632         * delegate.cs (NewDelegate.Emit): We have to emit a null as the
15633         instance if the method we are calling is static!
15634
15635 2002-05-24  Miguel de Icaza  <miguel@ximian.com>
15636
15637         * attribute.cs (ApplyAttributes): Make this function filter out
15638         the IndexerName attribute (as that attribute in reality is never
15639         applied) and return the string constant for the IndexerName
15640         attribute. 
15641
15642         * class.cs (TypeContainer.Emit): Validate that all the indexers
15643         have the same IndexerName attribute, and if so, set the
15644         DefaultName attribute on the class. 
15645
15646         * typemanager.cs: The return value might contain other stuff (not
15647         only methods).  For instance, consider a method with an "Item"
15648         property and an Item method.
15649
15650         * class.cs: If there is a problem with the parameter types,
15651         return. 
15652
15653 2002-05-24  Ravi Pratap  <ravi@ximian.com>
15654
15655         * ecore.cs (ImplicitConversionExists): Wrapper function which also
15656         looks at user defined conversion after making a call to 
15657         StandardConversionExists - we need this for overload resolution.
15658
15659         * expression.cs : Update accordingly the various method calls.
15660
15661         This fixes 2 bugs filed against implicit user defined conversions 
15662
15663 2002-05-22  Miguel de Icaza  <miguel@ximian.com>
15664
15665         * statement.cs: Track the result of the assignment.
15666
15667 2002-05-21  Miguel de Icaza  <miguel@ximian.com>
15668
15669         * expression.cs (MemberAccess): Improved error reporting for
15670         inaccessible members.
15671
15672 2002-05-22  Martin Baulig  <martin@gnome.org>
15673
15674         * makefile (mcs-mono2.exe): New target.  This is mcs compiled with
15675         itself with debugging support.
15676
15677 2002-05-22  Martin Baulig  <martin@gnome.org>
15678
15679         * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
15680         Removed, this isn't needed anymore.
15681
15682 2002-05-20  Martin Baulig  <martin@gnome.org>
15683
15684         * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
15685         be underlying type for an enum.
15686
15687 2002-05-20  Miguel de Icaza  <miguel@ximian.com>
15688
15689         * typemanager.cs (InitEnumUnderlyingTypes): New helper function
15690         that splits out the loading of just the core types.
15691
15692         * rootcontext.cs (ResolveCore): Split the struct resolution in
15693         two, so we can load the enumeration underlying types before any
15694         enums are used.
15695
15696         * expression.cs (Is): Bandaid until we fix properly Switch (see
15697         bug #24985 for details).
15698
15699         * typemanager.cs (ImplementsInterface): The hashtable will contain
15700         a null if there are no interfaces implemented.
15701
15702 2002-05-18  Miguel de Icaza  <miguel@ximian.com>
15703
15704         * cs-parser.jay (indexer_declarator): It is fine to have array
15705         parameters
15706
15707 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
15708
15709         * typemanager.cs: (RegisterBuilder): New function used to register
15710         TypeBuilders that implement interfaces.  Since
15711         TypeBuilder.GetInterfaces (as usual) does not work with lame
15712         Reflection.Emit. 
15713         (AddUserType): register interfaces.
15714
15715         (ImplementsInterface): Use the builder_to_ifaces hash if we are
15716         dealing with TypeBuilder.  Also, arrays are showing up as
15717         SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
15718         methods can not be invoked on them!
15719
15720         * ecore.cs (ExplicitReferenceConversionExists): Made public.
15721         (ImplicitReferenceConversionExists): Split out from
15722         StandardConversionExists. 
15723
15724         * expression.cs (As): We were only implementing one of the three
15725         cases for the as operator.  We now implement them all.
15726         (Is): Implement the various other cases for Is as well.
15727
15728         * typemanager.cs (CACHE): New define used to control if we want or
15729         not the FindMembers cache.  Seems to have a negative impact on
15730         performance currently
15731
15732         (MemberLookup): Nested types have full acess to
15733         enclosing type members
15734
15735         Remove code that coped with instance/static returns for events, we
15736         now catch this in RealFindMembers.
15737
15738         (RealFindMembers): only perform static lookup if the instance
15739         lookup did not return a type or an event.  
15740
15741 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
15742
15743         * assign.cs (CompoundAssign): We pass more semantic information
15744         now to Compound Assignments than we did before: now we have all
15745         the information at hand, and now we resolve the target *before* we
15746         do the expression expansion, which allows the "CacheValue" method
15747         to have the effect we intended (before, a [x] += 1 would generate
15748         two differen ArrayAccess expressions from the ElementAccess,
15749         during the resolution process).
15750
15751         (CompoundAssign.DoResolve): Resolve target and original_source here.
15752
15753 2002-05-16  Miguel de Icaza  <miguel@ximian.com>
15754
15755         * expression.cs (ArrayAccess): dropped debugging information. 
15756
15757         * typemanager.cs: Small bug fix: I was always returning i_members,
15758         instead of one of i_members or s_members (depending on which had
15759         the content).
15760
15761         * assign.cs (IAssignMethod.CacheTemporaries): New method.  This
15762         method is invoked before any code generation takes place, and it
15763         is a mechanism to inform that the expression will be invoked more
15764         than once, and that the method should use temporary values to
15765         avoid having side effects
15766
15767         (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
15768
15769         * ecore.cs (Expression.CacheTemporaries): Provide empty default
15770         implementation.
15771
15772         * expression.cs (Indirection, ArrayAccess): Add support for
15773         CacheTemporaries in these two bad boys. 
15774
15775         * ecore.cs (LoadFromPtr): figure out on our own if we need to use
15776         ldobj or ldind_ref.  
15777         (StoreFromPtr): Handle stobj as well.
15778
15779         * expression.cs (UnaryMutator): Share more code.
15780
15781         * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
15782         down: I was not tracking the Filter function as well, which
15783         was affecting the results of the cache.
15784
15785 2002-05-15  Miguel de Icaza  <miguel@ximian.com>
15786
15787         * attribute.cs: Remove the hack to handle the CharSet property on
15788         StructLayouts. 
15789
15790 2002-05-14  Miguel de Icaza  <miguel@ximian.com>
15791
15792         * attribute.cs (DoResolve): More uglyness, we now only try to
15793         resolve the attribute partially, to extract the CharSet
15794         information (only if we are a StructLayout attribute).  Otherwise 
15795
15796         (GetExtraTypeInfo): Add some code to conditionally kill in the
15797         future this.   I am more and more convinced that the .NET
15798         framework has special code to handle the attribute setting on
15799         certain elements.
15800
15801         * expression.cs (IsParamsMethodApplicable): Revert my previous
15802         foreach change here, it was wrong.
15803
15804 2002-05-13  Miguel de Icaza  <miguel@ximian.com>
15805
15806         * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
15807         (pp_expr): do not abort on unknown input, just return.
15808         (eval): abort if there are pending chars.
15809
15810         * attribute.cs (Attribute.Resolve): Positional parameters are
15811         optional.  Deal with that case.
15812
15813         * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
15814         the Ansi/Unicode/Auto information for the type.
15815
15816         (TypeContainer.DefineType): instantiate the EmitContext here, as
15817         we will be using it during the type definition (to resolve
15818         attributes) and during the emit phase.
15819
15820         * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
15821         to pull type information out of the attributes
15822
15823         (Attribute.Resolve): track the constructor builder, and allow for
15824         multiple invocations (structs and classes will use this).
15825
15826         * ecore.cs (MemberLookupFinal): new version with all the
15827         parameters customizable.
15828
15829         * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
15830         constructors.  Return if the result value is null (as the error
15831         would have been flagged already by MemberLookupFinal)
15832
15833         Do not allow instances of abstract classes or interfaces to be
15834         created.
15835
15836         * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
15837         We have to compare the assembly property here when dealing with
15838         FamANDAssem and Assembly access modifiers, because we might be
15839         creating an assembly from *modules* (that means that we are not
15840         getting TypeBuilders for types defined in other modules that are
15841         part of this assembly).
15842
15843         (Method.Emit): If the method is marked abstract and has a body,
15844         emit an error. 
15845
15846         (TypeContainer.DefineMembers): If both the defined member and the
15847         parent name match are methods, then do not emit any warnings: let
15848         the Method.Define routine take care of flagging warnings.  But if
15849         there is a mismatch (method overrides something else, or method is
15850         overriwritten by something, then emit warning).
15851
15852         (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
15853         set to null, this means `do not check for the return type on the
15854         signature'. 
15855
15856         (Method.Define): set the return type for the method signature to
15857         null, so that we get methods with the same name and parameters and
15858         different return types.  This is used to flag warning 114 (you are
15859         hiding a method, and you probably want to use the new/override
15860         keywords instead).
15861
15862         * typemanager.cs (MemberLookup): Implemented proper access
15863         control, closing a long standing set of bug reports.  The problem
15864         was that the Framework only has two bits: Public and NonPublic,
15865         and NonPublic includes private and protected methods, but we need
15866         to enforce the FamANDAssem, FamOrAssem and Family. 
15867
15868 2002-05-11  Miguel de Icaza  <miguel@ximian.com>
15869
15870         * statement.cs (GotoCase): Return true: Ammounts to giving up
15871         knowledge on whether we return or not, and letting the other case
15872         be responsible for it.
15873
15874 2002-05-10  Miguel de Icaza  <miguel@ximian.com>
15875
15876         * driver.cs: Do not load directories for each file processed, only
15877         do it if there is a pattern.
15878
15879         * ecore.cs: Report readonly assigns here as well, as we might have
15880         been resolved only by MemberAccess.
15881
15882         (SimpleName.SimpleNameResolve): Also be useful for LValue
15883         resolution.   We need this to propagate assign to local readonly variables
15884
15885         * typemanager.cs: Use a ptrhashtable for the criteria, because we
15886         do not want to reuse potential criteria memory.
15887
15888         * class.cs (MyEventBuilder): Set reflected_type;
15889
15890         * ecore.cs (Constantify): Added support for constifying bools.
15891
15892         (RootContext.LookupType): Added a cache for values looked up in
15893         the declaration space.
15894
15895         * typemanager.cs (FindMembers): Now is a front-end to
15896         RealFindMembers, and provides a two-level hashtable-based cache to
15897         the request.  
15898
15899         15% performance improvement: from 22.5 to 19.2 seconds.
15900
15901         * expression.cs (IsParamsMethodApplicable): use foreach.
15902         (Invocation.DoResolve): ditto.
15903         (New.DoResolve): ditto.
15904         (ArrayCreation.DoResolve): ditto.
15905
15906         * ecore.cs (FindMostEncompassingType): use foreach.
15907
15908         * delegate.cs (NewDelegate.DoResolve): Use foreach
15909
15910         * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
15911         (RemoveMethods): use foreach.
15912
15913         * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
15914         nested foreach statements instead of for, and also break out of
15915         the inner loop once a match is found.
15916
15917         (Invocation.OverloadResolve): Use foreach, simplify the code. 
15918
15919 2002-05-08  Miguel de Icaza  <miguel@ximian.com>
15920
15921         * cfold.cs (BinaryFold): During an enumeration evaluation context,
15922         we actually unwrap the expression to allow for extra information
15923         to be extracted. 
15924
15925         * expression.cs: Use Shr_Un on unsigned operations. 
15926
15927 2002-05-08  Ravi Pratap  <ravi@ximian.com>
15928
15929         * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of 
15930         applicable operators was not being considered correctly. This closes
15931         the bug Miguel reported.
15932
15933 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
15934
15935         * attribute.cs: check that the type derives from System.Attribute
15936         and report the correct error in that case (moved the duplicate code to
15937         its own method, too).
15938
15939 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
15940
15941         * attribute.cs: lookup attribute type name as the spec says: first the
15942         bare attribute name and then name + "Attribute" (nant compiles with
15943         mcs after this fix).
15944
15945 2002-05-07  Miguel de Icaza  <miguel@ximian.com>
15946
15947         * expression.cs (Unary.TryReduceNegative): Ah!  Tricky!  Tricky!
15948         Because of the way we parse things, we should try to see if a
15949         UIntConstant can fit in an integer.
15950
15951 2002-05-07  Ravi Pratap  <ravi@ximian.com>
15952
15953         * ecore.cs (GetConversionOperators): Do not pick up op_True operators
15954         when we are in an explicit context.
15955
15956         (ConvertReferenceExplicit): When converting from Iface type S to Class
15957         T make sure the rules are implemented as an OR.
15958
15959         * parameter.cs (ParameterType): Make it a property for now although the
15960         purpose really isn't anything immediate.
15961
15962         * expression.cs (Is*Applicable): Do better checking on the parameter type
15963         of a ref/out parameter. The ones from the system assemblies are already 
15964         marked with the correct type so we don't need to do any correction.
15965
15966         * ecore.cs (StandardConversionExists): Conversion from Interface types to 
15967         the object type is standard too so include that.
15968
15969 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
15970
15971         * ecore.cs (StandardConversionExists): Augment with missing code:
15972         deal with IntConstant, LongConstants and Enumerations.
15973
15974         * assign.cs: Report the error, instead of failing silently
15975
15976         * rootcontext.cs (AddGlobalAttributes): Track attributes on the
15977         typecontainer that they are declared, because the
15978         typecontainer/namespace will have the list of using clauses that
15979         need to be applied.
15980
15981         Assembly Attributes were escaping the normal registration
15982         mechanism. 
15983
15984         (EmitCode): Apply attributes within an EmitContext that represents
15985         the container they were declared on.
15986
15987         * cs-parser.jay: Track bases for structs.  How did I get this wrong?
15988
15989 2002-05-06  Ravi Pratap  <ravi@ximian.com>
15990
15991         * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
15992         Revamp completely - make much cleaner as we now operate only
15993         on a set of Types.
15994
15995         (FindMostSpecificSource, FindMostSpecificTarget): New methods
15996         to implement the logic detailed in the spec more correctly.
15997
15998         (UserDefinedConversion): Update accordingly.
15999
16000 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
16001
16002         * statement.cs: Return flow analysis information up.
16003
16004         * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
16005         and the default.
16006
16007         (token): Do not consume an extra character before calling
16008         decimal_digits.
16009
16010 2002-05-06  Piers Haken <piersh@friskit.com>
16011
16012         * cs-parser.jay: add 'override' attribute to System.Object.Finalize
16013
16014 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
16015
16016         * class.cs (Constructor.Emit): Set the IsStatic flag in the
16017         EmitContext during the instance constructor initializer
16018         resolution, to stop access to instance variables.
16019
16020         This is mandated by the spec, last paragraph of the `constructor
16021         initializers' section. 
16022
16023 2002-05-05  Miguel de Icaza  <miguel@ximian.com>
16024
16025         * cs-parser.jay, class.cs (Accessor): new class used to represent
16026         an accessor (get or set).  In the past we used `null' to represent
16027         a missing accessor.  But this is ambiguous because there was no
16028         way to tell in abstract indexers/properties if one of them was
16029         specified.
16030
16031         Now there is a way of addressing that.
16032
16033         * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
16034         instead of FindMembers.
16035
16036         * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
16037         the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
16038
16039         * attribute.cs: Treat indexers and properties as the same in terms
16040         of applying attributes
16041
16042         * ecore.cs (FindMostEncompassedType): Use statically initialized
16043         EmptyExpressions()s like we do elsewhere to avoid creating useless
16044         objects (and we take this out of the tight loop).
16045
16046         (GetConversionOperators): Move the code to extract the actual
16047         operators to a separate routine to clean things up.
16048
16049 2002-05-04  Miguel de Icaza  <miguel@ximian.com>
16050
16051         * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
16052         events are always registered FieldBuilders.
16053
16054         * class.cs (FieldBase): New class shared by Fields 
16055
16056         * delegate.cs: If we are a toplevel delegate, use our full name.
16057         If we are a nested delegate, then only use our tail name.
16058
16059 2002-05-02  Ravi Pratap  <ravi@ximian.com>
16060
16061         * expression.cs (IsApplicable): Ensure that we add the "&" to
16062         ref/out types before comparing it with the type of the argument.
16063
16064         (IsParamsMethodApplicable): Ditto.
16065
16066         (Argument.Type): Use TypeManager.LookupType instead of Type.GetType - 
16067         silly me ;-)
16068
16069         * delegate.cs : Handle the case when we have more than one applicable
16070         method. Flag an error only when we finish checking all.
16071
16072 2002-05-02  Miguel de Icaza  <miguel@ximian.com>
16073
16074         * expression.cs: Add support for boolean static initializers.
16075
16076 2002-05-01  Miguel de Icaza  <miguel@ximian.com>
16077
16078         * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
16079
16080         * parameter.cs (ComputeParameterTypes,
16081         ComputeAndDefineParameterTypes): Better error handling: now we
16082         clear the `types' cache if we fail during any of the type lookups.
16083         We also return the status code correctly to our caller
16084
16085         * delegate.cs: If we fail to define a delegate, abort the extra
16086         steps. 
16087
16088         * expression.cs (Binary.ResolveOperator): for
16089         operator==(object,object) and operator !=(object, object) we also
16090         have to verify that there is an implicit conversion from one to
16091         the other.
16092
16093         (ArrayAccess.DoResolve): Array Access can operate on
16094         non-variables. 
16095
16096 2002-04-30  Miguel de Icaza  <miguel@ximian.com>
16097
16098         * assign.cs (CompoundAssign): A new class used as a "flag" that
16099         the assignment actually is happening as part of a compound
16100         assignment operator.
16101
16102         During compound assignment, a few new rules exist to enable things
16103         like:
16104
16105         byte b |= 1 + 2
16106
16107         From the spec:
16108
16109         x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
16110         to the type of x) if y is implicitly convertible to the type of x,
16111         and the operator is a builtin operator and the return type of the
16112         operator is explicitly convertible to the type of x. 
16113
16114         * rootcontext.cs: Reset warning level to 2.  4 catches various
16115         "interesting" features in mcs, we must clean this up at some
16116         point, but currently am trying to kill other bugs ;-)
16117
16118         * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
16119         in container classes as well.  
16120
16121         * expression.cs (Binary.ResolveOperator): Handle string case
16122         before anything else (as operator overloading does emit an error
16123         before doing anything else).
16124
16125         This code could go away when we move to a table driven model, but
16126         i could not come up with a good plan last night.
16127
16128 2002-04-30  Lawrence Pit <loz@cable.a2000.nl>
16129
16130         * typemanager.cs (CSharpName): reimplementation using regex.
16131         * class.cs: added null check for fields in Emit
16132         * rootcontext.cs: set warninglevel to 4
16133
16134 2002-04-29  Miguel de Icaza  <miguel@ximian.com>
16135
16136         * typemanager.cs (CSharpName): reimplemented with Lupus
16137         suggestion.
16138
16139 2002-04-28  Miguel de Icaza  <miguel@ximian.com>
16140
16141         * statement.cs (If): correclty implement Resolve, because we were
16142         not catching sem errors in there.  The same process is needed
16143         everywhere else. 
16144         (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
16145
16146
16147         (Statement.Warning_DeadCodeFound): Factorize code.
16148         (While): Report dead code here too.
16149
16150         (Statement): Added Resolve virtual method to allow
16151         for resolution split from the emit code.
16152
16153 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
16154
16155         * statement.cs (EmitBoolExpression): No longer try to resolve the
16156         expression here.    
16157         (MakeBoolean): New utility function that resolve, implicitly
16158         converts to boolean and tags the expression. 
16159
16160
16161         (If, Do): Implement dead code elimination.
16162         (While): Implement loop inversion
16163
16164         (Do, While, For, If): Resolve the expression prior to calling our
16165         code generation.
16166
16167 2002-04-22  Lawrence Pit <loz@cable.a2000.nl>
16168
16169         * class.cs:
16170           - added method Report28 (warning: program has more than one entry point)
16171           - added method IsEntryPoint, implements paragraph 10.1 of the spec
16172           - modified method Method.Define, the part at the end of the method
16173
16174         * rootcontext.cs: added static public Location EntryPointLocation;
16175           
16176         * ../errors/cs0028.cs : Add test case for the above warning.              
16177
16178         * typemanager.cs:
16179           - modified method CSharpName to allow arrays of primitive type to
16180             be printed nicely (e.g. instead of System.Int32[][] it now prints
16181             int[][])
16182           - added method CSharpSignature: returns the signature of a method
16183             in string format to be used in reporting errors, warnings, etc.
16184
16185         * support.cs: InternalParameters.ParameterDesc variable tmp initialized
16186         with String.Empty.
16187
16188 2002-04-26  Ravi Pratap  <ravi@ximian.com>
16189
16190         * delegate.cs (Define): Fix extremely silly bug where I was
16191         setting the type of the 'object' parameter of the BeginInvoke
16192         method to System.IAsyncResult instead of System.Object ;-)
16193
16194 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
16195
16196         * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
16197         here. 
16198
16199         (Constructor.Emit): return if we fail to initialize the
16200         constructor.  Another door closed!  
16201
16202         * expression.cs (New.DoResolve): Improve error message (from -6 to
16203         1501).  Use DeclaredOnly lookup to find the exact constructor.
16204
16205         * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
16206         loop.  This is useful.
16207
16208         * cs-parser.jay: Adjust the default parameters so that destructors
16209         have the proper signature.
16210
16211 2002-04-26  Martin Baulig  <martin@gnome.org>
16212
16213         * driver.cs (LoadAssembly): If `assembly' contains any characters
16214         which are only valid in path names and not in assembly names
16215         (currently slash, backslash and point), use Assembly.LoadFrom ()
16216         instead of Assembly.Load () on the `assembly' (before iteration
16217         over the link_paths).
16218
16219 2002-04-26  Martin Baulig  <martin@gnome.org>
16220
16221         * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
16222
16223 2002-04-25  Miguel de Icaza  <miguel@ximian.com>
16224
16225         * class.cs (Property): use the new typemanager.MemberLookup
16226
16227         (TypeContainer.MemberLookup): Implement using the
16228         TypeManager.MemberLookup now. 
16229
16230         * typemanager.cs: Make MemberLookup a function of the TypeManager,
16231         and return MemberInfos, so that these can be used without an
16232         EmitContext (what we had before).
16233
16234 2002-04-24  Miguel de Icaza  <miguel@ximian.com>
16235
16236         * expression.cs: Fix the case where the argument to params if the
16237         type of the params.  I omitted handling this before.   Fixed
16238
16239 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
16240
16241         * driver.cs: Call BootCorlib_PopulateCoreType
16242
16243         * class.cs (Property.CheckBase): Check for properties only, not
16244         for all members. 
16245
16246         * interface.cs: Temporary hack: try/catch around the
16247         CustomAttributeBuilder, because I am getting an exception that I
16248         do not understand.
16249
16250         * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
16251         types whose definitions are required to be there (attributes are
16252         defined before standard types).
16253
16254         Compute definitions as we boot the various types, as they are used
16255         immediately (value_type class will need object_type, but if we do
16256         not initialize object_type, we will pass a null, which will let
16257         the runtime pick the System.Object from the existing corlib, which
16258         is not what we want).
16259
16260 2002-04-22  Patrik Torstensson <totte@labs2.com>
16261
16262         * cs-tokenizer.cs: fixed a number of trim() issues.
16263
16264 2002-04-22  Ravi Pratap  <ravi@ximian.com>
16265
16266         * expression.cs (Argument.Type): Ensure that we return the correct
16267         type when we have out or ref parameters [in which case we 
16268         append a "&"].
16269
16270 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
16271
16272         * class.cs (Property, Indexer): Allow extern modifier in there. 
16273
16274         * typemanager.cs (InitBaseTypes): Initializes object_type and
16275         value_type, since those will be used early on during the bootstrap
16276         process to compile corlib.
16277
16278         (InitCoreTypes): Move code from here to InitBaseTypes.
16279
16280 2002-04-21  Miguel de Icaza  <miguel@ximian.com>
16281
16282         * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
16283         single-dimension arrays as using the ldlen opcode.  
16284
16285         Daniel Lewis discovered this optimization.  
16286
16287         * typemanager.cs: Add signature for System.Array::get_Length
16288
16289 2002-04-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16290
16291         * statement.cs: report the error when the foreach does not apply to an
16292         array nor a collection.
16293
16294 2002-04-19  Miguel de Icaza  <miguel@ximian.com>
16295
16296         * expression.cs: Add implicit conversions to the operator ~.
16297
16298         * constant.cs (DecimalConstant.Emit): Emit decimal value.
16299
16300         * typemanager.cs: Locate the decimal constructor.
16301
16302 2002-04-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16303
16304         * attribute.cs: use the new property of TypeOf.
16305         * expression.cs: added 'get' property around typearg.
16306
16307         These changes fix a build breaker reported by NickD. Is this the
16308         correct way to fix?  If not, please, revert my changes and make it
16309         work :-).
16310
16311 2002-04-17  Miguel de Icaza  <miguel@ximian.com>
16312
16313         * attribute.cs: Add support for typeof in attribute invocations.
16314         I am not sure that this is right though.
16315
16316 2002-04-14  Duncan Mak  <duncan@ximian.com>
16317
16318         * cfold.cs (BinaryFold): Catch DivideByZeroException in the
16319         Binary.Operator.Division case.
16320
16321 2002-04-13  Ravi Pratap  <ravi@ximian.com>
16322
16323         * class.cs (DefineType): Ensure that we do a proper check on
16324         attribute types and also register it with the TypeManager.
16325
16326         (TypeContainer.Targets): The default for attribute types is
16327         AttributeTargets.All.
16328
16329         * attribute.cs (ApplyAttributes): Registering the attribute type
16330         is done elsewhere, not when we discover we have a Usage attribute.
16331
16332 2002-04-12  Ravi Pratap  <ravi@ximian.com>
16333
16334         * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
16335         and get rid of is_delegate parameter.
16336
16337         * everywhere : update.
16338
16339 2002-04-12  Ravi Pratap  <ravi@ximian.com>
16340
16341         * cs-parser.jay (compilation_unit): Revamp completely to use
16342         some new ideas that I got from Rhys' grammar to solve the problems
16343         with assembly level attributes.
16344
16345         (outer_declaration): New grammar production.
16346
16347         (attribute_sections): Add.
16348
16349         (opt_attributes): Base on attribute_sections
16350
16351         (namespace_declaration): Allow opt_attributes to tackle the case
16352         when we have assembly level attributes - we are clever in this
16353         regard now ;-)
16354
16355         * attribute.cs (ApplyAttributes): Do not worry about assembly 
16356         attributes in the non-global context.
16357
16358         * rootcontext.cs (AddGlobalAttributes): Go back to using this
16359         instead of SetGlobalAttributes.
16360
16361         * class.cs, rootcontext.cs : Ensure we define and generate 
16362         attribute types before anything else.
16363
16364         * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
16365         and flag the new error -20 for the case when the attribute type
16366         does not have valid targets specified. csc does not catch this.
16367
16368         * ../errors/errors.txt : update for error # -20
16369
16370 2002-04-11  Ravi Pratap  <ravi@ximian.com>
16371
16372         * support.cs (InternalParameters.ParameterModifier): Do some null
16373         checking and return sane values.
16374
16375         * class.cs (Method.Define): If we are a PInvoke method, ensure
16376         that we are static and extern. Report error # 601
16377
16378         * ../errors/cs0601.cs : Add test case for the above error.
16379
16380 2002-04-07  Ravi Pratap  <ravi@ximian.com>
16381
16382         * rootcontext.cs (attribute_types): We need to keep type of
16383         all attribute types separately and emit code for them first.
16384
16385         (RegisterAttribute) : Implement.
16386
16387         * class.cs (DefineType): Check if the current Type is a custom
16388         attribute type and register it accordingly.
16389
16390         * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
16391         adding the first attribute twice and rename to
16392
16393         (SetGlobalAttributes): this.
16394
16395         * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
16396         lookups.
16397
16398         * attribute.cs (ApplyAttributes): Take an additional argument telling us
16399         if we are processing global arguments. Hmm, I am unsure of this.
16400
16401 2002-04-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16402
16403         * expression.cs: added static array of strings to avoid calling
16404         Enum.ToString () for Operator in Binary. Significant recover of
16405         performance.
16406
16407 2002-04-10  Miguel de Icaza  <miguel@ximian.com>
16408
16409         * class.cs (FindMembers): Allow the Builders of the various
16410         members to be null.  If they are skip them.  This only happens
16411         during the PInvoke declaration.
16412
16413 2002-04-09  Miguel de Icaza  <miguel@ximian.com>
16414
16415         * parameter.cs (Parameters.ComputeParameterTypes): Flag the
16416         failure, so we do not keep going afterwards.
16417
16418         * expression.cs: (Invocation.OverloadResolve): I believe Ravi
16419         wanted to pass `false' as the `is_delegate' argument.  If this is
16420         the case, why not use delegate_type == null to mean `is_delegate =
16421         false' and anything else as is_delegate = true.
16422
16423 Tue Apr  9 05:40:12  2002 Piers Haken <piersh@friskit.com>
16424
16425         * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
16426         code for the section, not the beginning of the tests.
16427
16428 2002-04-08  Miguel de Icaza  <miguel@ximian.com>
16429
16430         * cfold.cs: Handle operator + (Enum x, Underlying x) 
16431
16432         * expression.cs (Binary): same.  Warn about errors where we have
16433         Enum/Enum in operator + as well.
16434
16435 Mon Apr  8 06:29:03  2002 Piers Haken <piersh@friskit.com>
16436
16437         * statement.cs:
16438                 - added support for switch(bool)
16439                 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
16440                 - add TableSwitchEmit() to handle table-based switch statements
16441
16442 2002-04-05  Ravi Pratap  <ravi@ximian.com>
16443
16444         * expression.cs (Invocation.OverloadResolve): Factor out code which
16445         does parameter compatibility checking with arguments so that we can 
16446         re-use the code even from Delegate.VerifyApplicability
16447
16448         (VerifyArgumentsCompat): Move above code here.
16449
16450         * delegate.cs (VerifyApplicability): Get rid of duplicate code
16451         and instead make a call to the above method.
16452
16453 2002-03-31  Ravi Pratap  <ravi@ximian.com>
16454
16455         * typemanager.cs (attribute_type): Corresponds to System.Attribute.
16456         We use it to keep track of classes which are attribute types.
16457
16458 2002-04-02  Miguel de Icaza  <miguel@ximian.com>
16459
16460         * delegate.cs (Delegate.Define): Correctly define the types in the
16461         presence of fixed and array parameters.
16462
16463         * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
16464         doing FindMembers.
16465
16466         * ecore.cs (Expression.MemberLookup): Reset binding flags to not
16467         include NonPublic after the first iteration.
16468
16469         * class.cs (Indexer.CheckBase): Only check if both parents are
16470         non-null. 
16471
16472         * cs-parser.jay (accessor_body): If empty, set to null.
16473
16474         * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
16475         same code path here to resolve constants names that we did have in
16476         MemberAccess.DoResolve.  There is too much code duplicated here.
16477
16478 2002-04-01  Miguel de Icaza  <miguel@ximian.com>
16479
16480         * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
16481
16482         * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
16483         to MakeUnionSet.
16484
16485         * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
16486         tokens, numbers and strings.
16487
16488         * ecore.cs (MethodGroupExpr): Make Emit warn about missing
16489         parenthesis.
16490
16491         * delegate.cs: Use ComputeAndDefineParameterTypes for both the
16492         asyncronous parameters and the regular parameters.  
16493
16494         * codegen.cs (CodeGen.Init): Use the constructor that allows us to
16495         specify the target directory.
16496
16497         * expression.cs: (This.DoResolve): Simplify
16498         (As.Emit): Optimize, do not generate IsInst if the expression is
16499         always of the given type.
16500
16501         (Is.DoResolve): Bug fix, we were reporting both always/never for
16502         the is expression.
16503
16504         * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
16505         creating too many unnecessary arrays.
16506
16507 2002-03-31  Miguel de Icaza  <miguel@ximian.com>
16508
16509         * class.cs (EmitFieldInitializer): Use Assign expression to assign
16510         fields instead of rolling our own initializer.   Takes care of all
16511         implicit conversions, and drops unnecessary static checks/argument.
16512
16513 2002-03-31  Dick Porter  <dick@ximian.com>
16514
16515         * driver.cs: use the GetDirectories() return values properly, and
16516         use "/" as path separator.
16517
16518 2002-03-30  Miguel de Icaza  <miguel@ximian.com>
16519
16520         * expression.cs (Unary): Optimize - - expr into expr.
16521         (Binary): Optimize a + (-b) into a -b.
16522
16523         * codegen.cs (CodeGen): Made all methods static.
16524
16525 2002-03-29  Miguel de Icaza  <miguel@ximian.com>
16526
16527         * rootcontext.cs: 
16528
16529         * decl.cs: Rename `definition' into `TypeBuilder' and drop the
16530         TypeBuilder property.
16531
16532         * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
16533         instead. 
16534
16535         * tree.cs: Removed the various RecordXXXX, and replaced with a
16536         single RecordDecl.  Removed all the accessor methods, and just
16537         left a single access point Type 
16538
16539         * enum.cs: Rename DefineEnum to DefineType.
16540
16541         * decl.cs: New abstract method `DefineType' used to unify the
16542         Defines for Enumerations, Interfaces, TypeContainers and
16543         Delegates.
16544
16545         (FindType): Moved LookupInterfaceOrClass here.  Moved the
16546         LookupBaseClasses method that used to live in class.cs and
16547         interface.cs here, and renamed to FindType.
16548
16549         * delegate.cs: Implement DefineType.  Take advantage of the
16550         refactored pattern for locating the parent builder without taking
16551         the parent_builder argument (which we know does not work if we are
16552         nested, and triggering a toplevel definition).
16553
16554 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
16555
16556         * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
16557         accessibility of a member has changed during override and report
16558         an error if so.
16559
16560         * class.cs (Method.Define, Property.Define): Only complain on
16561         overrides if the method is private, any other accessibility is
16562         fine (and since we just checked the permission is the same, we are
16563         good to go).
16564
16565         * cs-tokenizer.cs: only line, region, endregion, if, endif, else
16566         and elif are processed always.  The other pre-processing
16567         directives are only processed if we are "taking" the path
16568
16569 2002-03-29  Martin Baulig  <martin@gnome.org>
16570
16571         * class.cs (Method.Emit): Only emit symbolic debugging info if the
16572         current location is not Null.
16573
16574         * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
16575         a separate method so we can profile it.
16576
16577         * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
16578         `span.Seconds' are just seconds, but no minutes or hours.
16579         (MainDriver): Profile the CodeGen.SaveSymbols calls.
16580
16581 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
16582
16583         * class.cs (Method.Define), (Property.Define), (Indexer.Define):
16584         Remove the gratuitous set of Final:
16585
16586                                 // If an interface implementation, then we can set Final.
16587                                 if (((flags & MethodAttributes.Abstract) == 0) &&
16588                                     implementing.DeclaringType.IsInterface)
16589                                         flags |= MethodAttributes.Final;
16590
16591         I do not know what I was smoking when I used that.
16592
16593
16594         * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
16595         step into fixing the name resolution issues for delegates and
16596         unifying the toplevel name resolution.
16597
16598 2002-03-28  Martin Baulig  <martin@gnome.org>
16599
16600         * class.cs (Method.Emit): If we have a symbol writer, call its
16601         OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
16602         tell it about the current method.
16603
16604         * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
16605         writer that we're going to emit the first byte of IL code for a new
16606         statement (a new source line).
16607         (EmitContext.EmitTopBlock): If we have a symbol writer, call
16608         EmitContext.Mark() before emitting any code.
16609
16610         * location.cs (SymbolDocument): Return null when we're Null.
16611
16612         * statement.cs (Statement): Moved the `Location loc' variable here.
16613         (Statement.EmitBoolExpression): If we have a symbol writer, call
16614         ec.Mark() before emitting any code to tell it that we're at the
16615         beginning of a new statement.
16616         (StatementExpression): Added `Location' argument to the constructor.
16617         (Block): Added public readonly variable `StartLocation' and public
16618         variable `EndLocation'.  The latter is to be set using SetEndLocation().
16619         (Block): Added constructor which takes a start and end location.
16620         (Block.SetEndLocation): New method. This sets the end location.
16621         (Block.EmitMeta): If we have a symbol writer, tell it the names of the
16622         local variables we create.
16623         (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
16624         each statement and do also mark the begin and end of the block.
16625
16626         * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
16627         tell it the current lexer.Location, use Location.Null for the end of the
16628         block.
16629         (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
16630         current block, set its end location using SetEndLocation().
16631         (statement_expression): StatementExpression constructor now takes the
16632         lexer.Location as additional argument.
16633         (for_statement, declare_local_variables): Likewise.
16634         (declare_local_variables): When creating a new implicit block, use the
16635         new Block constructor and pass it the lexer.Location.
16636
16637 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
16638
16639         * ecore.cs (Expression.MemberLookup): On interfaces, lookup
16640         members also on the parent interfaces recursively.
16641
16642 2002-03-27  Miguel de Icaza  <miguel@ximian.com>
16643
16644         * report.cs: Use new formats, since Gonzalo finished the missing
16645         bits. 
16646
16647         * expression.cs (Binary.ResolveOperator): added missing operator|
16648         operator& and operator^ for bool/bool.
16649
16650         * cs-parser.jay: CheckDef now takes a Location argument that is
16651         used to report errors more precisly (instead of reporting the end
16652         of a definition, we try to track something which is a lot closer
16653         to the source of the problem).
16654
16655         * cs-tokenizer.cs: Track global token use, so we can properly flag
16656         the use of #define/#undef after the first token has been seen.
16657
16658         Also, rename the reportXXXX to Error_DescriptiveName
16659
16660         * decl.cs (DeclSpace.IsTopLevel): Move property here from
16661         TypeContainer, so that Enum and Interface can use this too.
16662
16663         * class.cs (TypeContainer.LookupInterfaceOrClass,
16664         GetInterfaceOrClass, GetClassBases, DefineType): Drop the
16665         `builder' argument.  Typically this was used to pass the parent
16666         builder (a ModuleBuilder or a TypeBuilder from whoever triggered
16667         the definition).  
16668
16669         The problem is that a nested class could trigger the definition of
16670         a toplevel class, and the builder would be obviously wrong in that
16671         case. 
16672
16673         So we drop this argument, and we compute dynamically the
16674         TypeBuilder/ModuleBuilder (the correct information was available
16675         to us anyways from DeclSpace.Parent)
16676
16677         * interface.cs (Interface.DefineInterface): Drop builder
16678         parameter cleanup like class.cs
16679
16680         * enum.cs (Enum.DefineEnum): Drop builder parameter.  Clean up
16681         like class.cs
16682
16683         * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
16684         values. 
16685
16686         (Try.Emit): Propagate the returns value from the statement.
16687
16688         (Return.Emit): Even if we are leavning 
16689
16690         * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
16691
16692         * modifiers.cs: Fix the computation of MethodAttributes flags.
16693
16694 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
16695
16696         * driver.cs: allow compilation of files that start with '/'.
16697         Add a default case when checking the argument of --target.
16698
16699 2002-03-25  Miguel de Icaza  <miguel@ximian.com>
16700
16701         * interface.cs: Implement the same search algorithm for types in
16702         the interface code.
16703
16704         * delegate.cs: Do not allow multiple definition.
16705
16706         * Recovered ChangeLog that got accidentally amputated
16707
16708         * interface.cs (Interface.DefineInterface): Prevent from double definitions.
16709
16710         * rootcontext.cs: Load manually enum to allow core classes to
16711         contain enumerations.
16712
16713         * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
16714         Update to new static methods in TypeManager.
16715
16716         * typemanager.cs (GetMethod, GetConstructor): Use our
16717         implementation of FindMembers to find the members, since during
16718         corlib compilation, the types are TypeBuilders and GetMethod and
16719         GetConstructor do not work.
16720
16721         Make all methods in TypeManager static.
16722
16723         (InitCodeHelpers): Split the functionality from
16724         the InitCodeTypes function.
16725
16726         * driver.cs: Call InitCodeHelpers after we have populated the
16727         types. 
16728
16729         * cs-parser.jay (delegate_declaration): we did not used to compute
16730         the delegate name correctly for void delegates.
16731
16732 2002-03-24  Miguel de Icaza  <miguel@ximian.com>
16733
16734         * rootcontext.cs (RootContext): Init the interface_resolve_order
16735         and type_container_resolve_order always.
16736
16737         (ResolveCore, BootstrapCorlib_ResolveClass,
16738         BootstrapCorlib_ResolveStruct): New functions to bootstrap the
16739         compiler when compiling with --nostdlib
16740
16741         * class.cs (TypeContainer.DefineType): Check that our parent is
16742         not null.  This test is most important when we are bootstraping
16743         the core types.
16744
16745         * codegen.cs: Split out the symbol writing code.
16746
16747 2002-03-25  Martin Baulig  <martin@gnome.org>
16748
16749         * driver.cs (-g): Made -g an alias for --debug.
16750
16751 2002-03-24  Martin Baulig  <martin@gnome.org>
16752
16753         * codegen.cs (SymbolWriter): New public variable. Returns the
16754         current symbol writer.
16755         (CodeGen): Added `bool want_debugging_support' argument to the
16756          constructor. If true, tell the ModuleBuild that we want debugging
16757         support and ask it for the ISymbolWriter.
16758         (Save): If we have a symbol writer, call it's Close() method after
16759         saving the assembly.
16760
16761         * driver.c (--debug): New command line argument to create a
16762         debugger information file.
16763
16764         * location.cs (SymbolDocument): New public property. Returns an
16765         ISymbolDocumentWriter object for the current source file or null
16766         if we don't have a symbol writer.
16767
16768 2002-03-21  Miguel de Icaza  <miguel@ximian.com>
16769
16770         * driver.cs (LoadAssembly): Correctly return when all the paths
16771         have been tried and not before.
16772
16773         * statement.cs (Switch.Emit): return the actual coverage for this
16774         statement (returns/not-returns)
16775
16776         (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
16777         switch of the statement if we are the last switch section.  That
16778         kills two problems: try/catch problems (we used to emit an empty
16779         nop at the end) and switch statements where all branches would
16780         return. 
16781
16782 2002-03-19  Miguel de Icaza  <miguel@ximian.com>
16783
16784         * driver.cs: Add default assemblies (the equivalent to the
16785         Microsoft CSC.RSP file)
16786
16787         * cs-tokenizer.cs: When updating `cols and setting it to zero,
16788         also update tokens_seen and set it to false.
16789
16790         * driver.cs: Implement --recurse for Mike.
16791
16792         * driver.cs (SplitPathAndPattern): Small bug fix, I was not
16793         correctly splitting out the paths.
16794
16795 2002-03-18  Miguel de Icaza  <miguel@ximian.com>
16796
16797         * interface.cs (Interface.PopulateProperty): Instead of using
16798         `parent' as the declaration space for the set parameters, use
16799         `this' 
16800
16801         * support.cs (InternalParameters): InternalParameters constructor
16802         takes a DeclSpace instead of a TypeContainer.
16803
16804         * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
16805         types are being initialized, load the address of it before calling
16806         the function.  
16807
16808         (New): Provide a mechanism to disable the generation of local
16809         value type temporaries when the caller will be providing us with
16810         an address to store it.
16811
16812         (ArrayCreation.EmitDynamicInitializers): Use it.
16813
16814 2002-03-17  Miguel de Icaza  <miguel@ximian.com>
16815
16816         * expression.cs (Invocation.EmitArguments): Only probe for array
16817         property if there is more than one argument.  Sorry about that.
16818
16819         * class.cs (Invocation.EmitArguments): Fix to emit arguments for
16820         empty param arrays.
16821
16822         * class.cs (Method.LabelParameters): Fix incorrect code path that
16823         prevented the `ParamArrayAttribute' from being applied to the
16824         params attribute.
16825
16826 2002-03-16  Miguel de Icaza  <miguel@ximian.com>
16827
16828         * support.cs (ReflectionParameters): Correctly compute whether the
16829         last argument is a params array.  Fixes the problem with
16830         string.Split ('a')
16831
16832         * typemanager.cs: Make the assemblies array always be non-null
16833         (empty, but non-null)
16834
16835         * tree.cs (RecordDecl): New function that abstracts the recording
16836         of names.  This reports error 101, and provides a pointer to the
16837         previous declaration.  Fixes a crash in the compiler.
16838
16839         * cs-parser.jay (constructor_declaration): Update to new grammar,
16840         and provide a constructor_body that can be empty.
16841
16842 2002-03-15  Miguel de Icaza  <miguel@ximian.com>
16843
16844         * driver.cs: Add support for --resources.
16845
16846         * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
16847         Make all types for the various array helper methods be integer.
16848
16849         * ecore.cs (Expression.ConvertNumericExplicit): Pass the
16850         CheckState to ConvCast.
16851
16852         (ConvCast): Now it takes a `checked' state argument, to avoid
16853         depending on the emit context for the conversion, and just using
16854         the resolve time setting.
16855
16856         * expression.cs (ArrayCreation.EmitArrayArguments): New function,
16857         instead of Invocation.EmitArguments.  We do not emit the original
16858         arguments, instead we emit those which have been converted to
16859         unsigned int expressions.
16860
16861         * statement.cs (Block.EmitMeta): Drop tracking of indexes.
16862
16863         * codegen.cs: ditto.
16864
16865         * expression.cs (LocalVariableReference): Drop the use of the
16866         Store function that depended on the variable index.
16867
16868         * statement.cs (VariableInfo): Drop the `Idx' property from this
16869         class, as this is not taking into account the indexes for
16870         temporaries tat we generate during the execution, getting the
16871         indexes wrong.
16872
16873         * class.cs: First emit class initializers, then call the parent
16874         constructor. 
16875
16876         * expression.cs (Binary): Fix opcode emision.
16877         (UnaryMutator.EmitCode): Support checked code generation
16878
16879         * ecore.cs (MemberLookup): TypeManager.FindMembers will return
16880         matches for events for both the Static and Instance scans,
16881         pointing to the same element.   Fix that.
16882
16883 2002-03-14  Miguel de Icaza  <miguel@ximian.com>
16884
16885         * rootcontext.cs (ResolveTree): Always set the
16886         interface_resolve_order, because nested interfaces will be calling
16887         into us.
16888
16889         * class.cs (GetInterfaceOrClass): Track the same resolution
16890         process used by TypeManager.LookupType.  This fixes the nested
16891         type lookups in class declarations (separate path from
16892         LookupType). 
16893
16894         (TypeContainer.DefineType): Also define nested interfaces.
16895         (TypeContainer.RegisterOrder): New public function used to
16896         register the order in which child interfaces need to be closed.
16897
16898         Nested interfaces need to be closed after their parents have been
16899         created. 
16900
16901         * interface.cs (InterfaceAttr): Put all the logic for computing
16902         the interface attribute here. 
16903
16904         (DefineInterface): Register our interface order with the
16905         RootContext or with the TypeContainer depending on the case.
16906
16907 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
16908
16909         * cs-parser.jay: rework foreach statement to work with the new
16910         changes to the policy on SimpleNames.
16911
16912         * report.cs: support Stacktrace on warnings as well.
16913
16914         * makefile: drop --unsafe and /unsafe from the compile.
16915
16916 2002-03-13  Ravi Pratap  <ravi@ximian.com>
16917
16918         * ecore.cs (StandardConversionExists): Modify to take an Expression
16919         as the first parameter. Ensure we do null -> reference type conversion
16920         checking.
16921
16922         * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
16923         temporary Expression objects.
16924
16925 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
16926
16927         * interface.cs: workaround bug in method overloading resolution
16928         (there is already a bugzilla bug for it).
16929
16930 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
16931
16932         We could also solve this problem by having a separate path for
16933         performing type lookups, instead of DoResolve, we could have a
16934         ResolveType entry point, and only participating pieces of the
16935         production (simplename, deref, array) would implement this. 
16936
16937         * codegen.cs (EmitContext): New field OnlyLookupTypes used to
16938         signal SimpleName to only resolve type names and not attempt to
16939         resolve anything else.
16940
16941         * expression.cs (Cast): Set the flag.
16942
16943         * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
16944
16945         * class.cs: Only report 108 if there is no `new' modifier.
16946
16947         * cs-parser.jay: rework foreach statement to work with the new
16948         changes to the policy on SimpleNames.
16949         
16950         * report.cs: support Stacktrace on warnings as well.
16951
16952         * makefile: drop --unsafe and /unsafe from the compile.
16953
16954 2002-03-11  Miguel de Icaza  <miguel@ximian.com>
16955
16956         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
16957         lookups here, instead of doing that at parse time.  This means
16958         that our grammar will not introduce `LocalVariableReferences' as
16959         expressions at this point.  That solves the problem of code like
16960         this:
16961
16962         class X {
16963            static void Main ()
16964            { int X = 1;
16965             { X x = null }}}
16966
16967         This is only half the fix.  The full fix requires parameters to
16968         also be handled in this way.
16969
16970         * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
16971         makes the use more obvious of the DeclSpace.  The
16972         ec.TypeContainer.TypeBuilder is now only used to pull the
16973         TypeBuilder for it.
16974
16975         My theory is that I can get rid of the TypeBuilder completely from
16976         the EmitContext, and have typecasts where it is used (from
16977         DeclSpace to where it matters).  
16978
16979         The only pending problem is that the code that implements Aliases
16980         is on TypeContainer, and probably should go in DeclSpace.
16981
16982         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
16983         lookups here, instead of doing that at parse time.  This means
16984         that our grammar will not introduce `LocalVariableReferences' as
16985         expressions at this point.  That solves the problem of code like
16986         this:
16987
16988         class X {
16989            static void Main ()
16990            { int X = 1;
16991             { X x = null }}}
16992
16993         This is only half the fix.  The full fix requires parameters to
16994         also be handled in this way.
16995
16996         * class.cs (Property.DefineMethod): When implementing an interface
16997         method, set newslot, when implementing an abstract method, do not
16998         set the flag (before we tried never setting it, or always setting
16999         it, which is the difference).
17000         (Indexer.DefineMethod): same.
17001         (Method.DefineMethod): same.
17002
17003         * ecore.cs: Only set the status used flag if we get back a Field.
17004
17005         * attribute.cs: Temporary hack, so Paolo can keep working.
17006
17007 2002-03-08  Ravi Pratap  <ravi@ximian.com>
17008
17009         * attribute.cs (Attribute.UnmanagedType): This is to keep track of
17010         the unmanaged type in the case we have a MarshalAs attribute.
17011
17012         (Resolve): Handle the case when we are parsing the special MarshalAs
17013         attribute [we need to store the unmanaged type to use later]
17014
17015         * typemanager.cs (marshal_as_attr_type): Built in type for the 
17016         MarshalAs Attribute.
17017
17018         * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute 
17019         on parameters and accordingly set the marshalling info.
17020
17021 2002-03-09  Miguel de Icaza  <miguel@ximian.com>
17022
17023         * class.cs: Optimizing slightly by removing redundant code after
17024         we switched to the `NoTypes' return value.
17025         (Property.DefineMethod): use NoTypes here too.
17026
17027         This fixes the bug I introduced in my last batch of changes.
17028
17029 2002-03-05  Ravi Pratap  <ravi@ximian.com>
17030
17031         * tree.cs (RecordEnum): Add. We now keep track of enums too.
17032
17033         * class.cs (LookupInterfaceOrClass): Check against the list of recorded
17034         Enums since those are types too. 
17035
17036         * cs-parser.jay (enum_declaration): Record enums as we parse them.
17037
17038         * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined 
17039         thanks to a call during the lookup process.
17040
17041 2002-03-07  Miguel de Icaza  <miguel@ximian.com>
17042
17043         * statement.cs (Foreach): Lots of work to accomodate a particular
17044         kind of foreach statement that I had not kept in mind.  It is
17045         possible to have foreachs on classes that provide a GetEnumerator
17046         method that return objects that implement the "pattern" for using
17047         a foreach, there is no need to support GetEnumerator
17048         specifically. 
17049
17050         This is needed to compile nant.
17051
17052         * decl.cs: Only report 114 if the member is not `Finalize' and if
17053         the warning level is at least 2.
17054
17055         * class.cs: Moved the compare function from Method to
17056         MethodSignature. 
17057
17058         (MethodSignature.InheritableMemberSignatureCompare): Add new
17059         filter function that is used to extract inheritable methods from a
17060         class. 
17061
17062         (Method.Define): Use the new `inheritable_method_signature_filter'
17063         delegate
17064
17065         * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
17066         command. 
17067
17068 2002-03-06  Miguel de Icaza  <miguel@ximian.com>
17069
17070         * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
17071
17072         * cs-parser.jay: Add opt_semicolon to the interface declaration.
17073
17074         * expression.cs: Pass location information to
17075         ConvertImplicitStandard. 
17076
17077         * class.cs: Added debugging code to track return values from
17078         interfaces. 
17079
17080 2002-03-05  Miguel de Icaza  <miguel@ximian.com>
17081
17082         * expression.cs (Is.DoResolve): If either side of the `is' is an
17083         interface, do not flag the warning.
17084
17085         * ecore.cs (ImplicitReferenceConversion): We need a separate test
17086         for interfaces
17087
17088         * report.cs: Allow for --fatal to be used with --probe.
17089
17090         * typemanager.cs (NoTypes): Move the definition for the empty Type
17091         array here. 
17092
17093         * class.cs (TypeContainer.FindMembers): Also look for methods defined by
17094         properties. 
17095         (TypeContainer.DefineProxy): New function used to proxy to parent
17096         implementations when implementing interfaces.
17097         (TypeContainer.ParentImplements): used to lookup if our parent
17098         implements a public function that is required by an interface.
17099         (TypeContainer.VerifyPendingMethods): Hook this up.
17100
17101         * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
17102         `modules' and `assemblies' arraylists into arrays.  We only grow
17103         these are the very early start up of the program, so this improves
17104         the speedof LookupType (nicely measured).
17105
17106         * expression.cs (MakeByteBlob): Replaced unsafe code with
17107         BitConverter, as suggested by Paolo.
17108
17109         * cfold.cs (ConstantFold.Binary): Special case: perform constant
17110         folding of string concatenation, but if either side is a string,
17111         and the other is not, then return null, and let the runtime use
17112         the concatenation on the string plus the object (using
17113         `Object.ToString'). 
17114
17115 2002-03-04  Miguel de Icaza  <miguel@ximian.com>
17116
17117         Constant Folding has been implemented now.
17118
17119         * expression.cs (Unary.Reduce): Do not throw an exception, catch
17120         the error instead on types that are not supported in one's
17121         complement. 
17122
17123         * constant.cs (Constant and all children): New set of functions to
17124         perform implict and explicit conversions.
17125
17126         * ecore.cs (EnumConstant): Implement the new functions to perform
17127         conversion by proxying to the child expression.
17128
17129         * codegen.cs: (ConstantCheckState): Constant evaluation has its
17130         own separate setting that can not be turned off from the command
17131         line using --unchecked or --checked and is only controlled using
17132         the checked/unchecked statements and expressions.  This setting is
17133         used by the constant folder to flag errors.
17134
17135         * expression.cs (CheckedExpr, UncheckedExpr): Set the
17136         ConstantCheckState as well.   
17137
17138         During Resolve, they also have to flag the state, because the
17139         constant folder runs completely in the Resolve phase.
17140
17141         * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
17142         well.
17143
17144 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
17145
17146         * cfold.cs: New file, this file contains the constant folder.
17147
17148         * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
17149         argument to track whether we are using the resulting address to
17150         load or store a value and provide better error messages. 
17151
17152         (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
17153         new AddressOf arguments.
17154
17155         * statement.cs (Foreach.EmitCollectionForeach): Update
17156
17157         * expression.cs (Argument.Emit): Call AddressOf with proper
17158         arguments to track usage.
17159
17160         (New.DoEmit): Call AddressOf with new arguments.
17161
17162         (Unary.Emit): Adjust AddressOf call.
17163
17164 2002-03-01  Ravi Pratap  <ravi@ximian.com>
17165
17166         * cs-parser.jay (member_access): Change the case for pre-defined types
17167         to use a MemberAccess instead of a SimpleName. Thanks to Felix again for 
17168         this suggestion.
17169
17170         * class.cs (Operator::Emit): If we are abstract or extern, we don't have
17171         a method body.
17172
17173         * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
17174         essentially like methods and apply attributes like MethodImplOptions to them too.
17175
17176         * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
17177         not being null.
17178
17179         * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
17180         DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
17181         is the DeclSpace.
17182
17183         * Update code everywhere accordingly.
17184
17185         * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
17186
17187         * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
17188
17189 2002-02-28  Ravi Pratap  <ravi@ximian.com>
17190
17191         * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
17192         try performing lookups against those instead of jumping straight into using
17193         the 'using' clauses.
17194
17195         (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
17196
17197         (LookupType): Perform lookups in implicit parents too.
17198
17199         * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
17200         sequence as RootContext.LookupType. 
17201
17202         * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries 
17203         the various cases of namespace lookups into this method.
17204
17205 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
17206
17207         * cs-parser.jay: Add support for [Attribute ()] (empty arguments
17208         in positional arguments)
17209
17210         * class.cs (Operator): Update the AllowedModifiers to contain
17211         extern. 
17212
17213         * cs-parser.jay: Update operator declaration to allow for the
17214         operator body to be empty.
17215
17216         * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
17217         values. 
17218
17219 2002-02-27  Miguel de Icaza  <miguel@ximian.com>
17220
17221         * class.cs (Method.Emit): Label parameters.
17222
17223         * driver.cs: Return 1 or 0 as the program exit code.
17224
17225 2002-02-26  Miguel de Icaza  <miguel@ximian.com>
17226
17227         * expression.cs: Special case the `null' object when trying to
17228         auto-compute the type, as anything can be explicitly converted to
17229         that. 
17230
17231         * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
17232         spotting this Paolo.
17233
17234         (Expression.ImplicitNumericConversion): Perform comparissions of
17235         the type using the underlying type in the case of an enumeration
17236         rather than using the enumeration type for the compare.
17237
17238         Cope with the underlying == type case, which is not possible to
17239         catch before. 
17240
17241         (Expression.ConvertNumericExplicit): Perform comparissions of
17242         the type using the underlying type in the case of an enumeration
17243         rather than using the enumeration type for the compare.
17244
17245         * driver.cs: If the user does not supply an extension, assume .exe
17246
17247         * cs-parser.jay (if_statement): Rewrote so that we can track the
17248         location for the if statement.
17249
17250         * expression.cs (Binary.ConstantFold): Only concat strings when
17251         the operation is "+", not everything ;-)
17252
17253         * statement.cs (Statement.EmitBoolExpression): Take a location
17254         argument. 
17255         (If, While, Do): Track location.
17256
17257         * expression.cs (Binary.ResolveOperator): In the object + string
17258         case, I was missing a call to ConvertImplicit
17259
17260 2002-02-25  Ravi Pratap  <ravi@ximian.com>
17261
17262         * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
17263         Location arguments. Ensure we use RootContext.LookupType to do our work
17264         and not try to do a direct Type.GetType and ModuleBuilder.GetType
17265
17266         * interface.cs (PopulateMethod): Handle the type of the parameter being
17267         null gracefully.
17268
17269         * expression.cs (Invocation.BetterFunction): Handle the case when we 
17270         have a params method with no fixed arguments and a call is made with no
17271         arguments.
17272
17273 2002-02-25  Miguel de Icaza  <miguel@ximian.com>
17274
17275         * cs-tokenizer.cs: Add support for the quote-escape-sequence in
17276         the verbatim-string-literal
17277
17278         * support.cs (InternalParameters.ParameterModifier): handle null
17279         fixed parameters.
17280         (InternalParameters.ParameterType): ditto.
17281
17282         * parameter.cs (VerifyArgs): Also check if the fixed parameter is
17283         duplicating the name of the variable parameter.
17284         (GetParameterByName): Fix bug where we were not looking up array
17285         paramters if they were the only present (thanks Paolo!).
17286         (GetParameterInfo): We only have an empty set of types if both
17287         fixed and array are set to null.
17288         (GetParameterInfo-idx): Handle FixedParameter == null
17289
17290         * cs-parser.jay: Handle the case where there is no catch
17291         statements (missing null test).
17292
17293 2002-02-22  Miguel de Icaza  <miguel@ximian.com>
17294
17295         * driver.cs (MainDriver): Be conservative on our command line
17296         handling.
17297
17298         Catch DirectoryNotFoundException when calling GetFiles.
17299
17300         (SplitPathAndPattern): Used to split the input specification into
17301         a path and a pattern that we can feed to Directory.GetFiles.
17302
17303 2002-02-21  Miguel de Icaza  <miguel@ximian.com>
17304
17305         * statement.cs (Fixed): Implement the last case of the Fixed
17306         statement (string handling).
17307
17308         * expression.cs (StringPtr): New class used to return a char * to
17309         a string;  Used by the Fixed statement.
17310
17311         * typemanager.cs: Add char_ptr_type.  Add get_OffsetToStringData method.
17312
17313         * expression.cs (Binary.ResolveOperator): Remove redundant
17314         MemberLookup pn parent type.
17315         Optimize union call, we do not need a union if the types are the same.
17316         (Unary.ResolveOperator): REmove redundant MemberLookup on parent
17317         type.
17318
17319         Specialize the use of MemberLookup everywhere, instead of using
17320         the default settings. 
17321
17322         (StackAlloc): Implement stackalloc keyword.
17323
17324         * cs-parser.jay: Add rule to parse stackalloc.
17325
17326         * driver.cs: Handle /h, /help, /?
17327
17328         * expression.cs (MakeByteBlob): Removed the hacks we had in place
17329         before we supported unsafe code.
17330
17331         * makefile: add --unsafe to the self compilation of mcs.
17332
17333 2002-02-20  Miguel de Icaza  <miguel@ximian.com>
17334
17335         * expression.cs (PointerArithmetic): New class that is used to
17336         perform pointer arithmetic.
17337         (Binary.Resolve): Handle pointer arithmetic
17338         Handle pointer comparission.
17339         (ArrayPtr): Utility expression class that is used to take the
17340         address of an array.
17341
17342         (ElementAccess): Implement array access for pointers
17343
17344         * statement.cs (Fixed): Implement fixed statement for arrays, we
17345         are missing one more case before we are done.
17346
17347         * expression.cs (Indirection): Implement EmitAssign and set the
17348         ExprClass to Variable.  This allows pointer dereferences to be
17349         treated as variables, and to have values assigned to them.
17350
17351         * ecore.cs (Expression.StoreFromPtr): New utility function to
17352         store values dereferencing.
17353
17354 2002-02-20  Ravi Pratap  <ravi@ximian.com>
17355
17356         * expression.cs (Binary.ResolveOperator): Ensure that we are
17357         not trying to operate on a void type - this fixes the reported
17358         bug.
17359
17360         * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
17361         the parent implementation is sealed.
17362
17363         * ../errors/cs0239.cs : Add.
17364
17365         * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
17366
17367         * typemanager.cs (unverifiable_code_type): Corresponds to 
17368         System.Security.UnverifiableCodeAttribute. We need to emit this for modules
17369         which have unsafe code in them.
17370
17371         * rootcontext.cs (EmitCode): Emit the above attribute when we are in an 
17372         unsafe context.
17373
17374 2002-02-19  Miguel de Icaza  <miguel@ximian.com>
17375
17376         * cs-tokenizer.cs: Add support for @"litreal strings"
17377
17378         Make tokenizer accept pre-processor directives
17379         on any column (remove the old C-like limitation). 
17380
17381         * rootcontext.cs (EmitCode): Emit any global attributes.
17382         (AddGlobalAttributes): Used to keep track of assembly attributes. 
17383
17384         * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
17385
17386         * cs-parser.jay: Add support for global attributes.  
17387
17388 2002-02-17  Miguel de Icaza  <miguel@ximian.com>
17389
17390         * expression.cs (Indirection): New helper class.  Unary will
17391         create Indirection classes to be able to implement the
17392         IMemoryLocation interface on it.
17393
17394 2002-02-16  Miguel de Icaza  <miguel@ximian.com>
17395
17396         * cs-parser.jay (fixed_statement): reference the right statement.
17397
17398         * statement.cs (Fixed.Emit): Finish implementing the fixed
17399         statement for the &x case.
17400
17401 2002-02-14  Miguel de Icaza  <miguel@ximian.com>
17402
17403         * class.cs (Property.Define, Method.Define): Remove newslot when
17404         `implementing'.  
17405
17406         * modifiers.cs: My use of NewSlot when `Abstract' was set was
17407         wrong.  NewSlot should only be used if the `new' keyword is present.
17408
17409         * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
17410         locating our system dir.  Sorry about this.
17411
17412 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
17413
17414         * driver.cs (GetSystemDir): Compute correctly the location of our
17415         system assemblies.  I was using the compiler directory instead of
17416         the library directory.
17417
17418 2002-02-13  Ravi Pratap  <ravi@ximian.com>
17419
17420         * expression.cs (BetterFunction): Put back in what Miguel commented out
17421         since it is the correct fix. The problem is elsewhere ;-)
17422
17423         (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
17424         parameters of the parms method are themselves compatible or not !
17425
17426         (StandardConversionExists): Fix very dangerous bug where we were forgetting
17427         to check that a class implements an interface before saying that an implicit
17428         conversion was allowed. Use ImplementsInterface to do the checking.
17429
17430 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
17431
17432         * class.cs (Method.Define): Track whether we are an explicit
17433         implementation or not.  And only call DefineMethodOverride if we
17434         are an explicit implementation.
17435
17436         (Property.DefineMethod): Ditto.
17437
17438 2002-02-11  Ravi Pratap  <ravi@ximian.com>
17439
17440         * expression.cs (BetterFunction): Catch hideous bug which was
17441          preventing us from detecting ambiguous calls due to implicit casts i.e
17442         cs0121.
17443
17444 2002-01-29  Miguel de Icaza  <miguel@ximian.com>
17445
17446         * support.cs (Pair): Remove un-needed method.  I figured why I was
17447         getting the error in cs-parser.jay, the variable in a foreach loop
17448         is readonly, and the compiler does not really treat this as a variable.
17449
17450         * cs-parser.jay (fixed_statement): Fix grammar.  Use ASSIGN
17451         instead of EQUALS in grammar.  
17452
17453         * typemanager.cs (VerifyUnmanaged): Report correct error (208)
17454
17455         * expression.cs (Unary.DoResolve): Check whether the argument is
17456         managed or not.
17457
17458 2002-01-28  Miguel de Icaza  <miguel@ximian.com>
17459
17460         * support.cs: Api for Pair to set a value.  Despite the fact that
17461         the variables are public the MS C# compiler refuses to compile
17462         code that accesses the field if the variable is part of a foreach
17463         statement. 
17464
17465         * statement.cs (Fixed): Begin implementation of the fixed
17466         statement.
17467
17468         (Block.AddVariable): Return the VariableInfo on success and null
17469         on failure instead of true/false. 
17470
17471         * cs-parser.jay (foreach): Catch errors on variables already
17472         defined (we were ignoring this value before) and properly unwind
17473         the block hierarchy
17474
17475         (fixed_statement): grammar for the fixed statement.
17476
17477 2002-01-25  Miguel de Icaza  <miguel@ximian.com>
17478
17479         * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
17480         pointer types to be incretemented.
17481
17482         (SizeOf): Implement.
17483
17484         * cs-parser.jay (pointer_member_access): Implement
17485         expr->IDENTIFIER production.
17486
17487         * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
17488         MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
17489         on safe contexts.
17490
17491         (Unary): Implement indirection.
17492
17493         * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
17494         use in non-unsafe context).
17495
17496         (SimpleName.DoResolve): Check for pointers in field access on safe
17497         contexts. 
17498
17499         (Expression.LoadFromPtr): Factor the load-indirect code in this
17500         function.  This was duplicated in UnboxCast and ParameterReference
17501
17502 2002-01-24  Miguel de Icaza  <miguel@ximian.com>
17503
17504         * expression.cs (ComposedCast): report an error if a pointer cast
17505         is used in a safe region.
17506
17507         * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
17508         pointer type casts in unsafe context.
17509
17510         * codegen.cs (EmitContext): Set up IsUnsafe.
17511
17512         * cs-parser.jay (non_expression_type): Add productions for pointer
17513         casts. 
17514
17515         * expression.cs (Invocation.EmitCall): Remove chunk of buggy
17516         code.  We should not use force into static mode if the method is
17517         not virtual.  Fixes bug in MIS
17518
17519         * statement.cs (Do.Emit, While.Emit, For.Emit,
17520         Statement.EmitBoolExpression): Add support to Do and While to
17521         propagate infinite loop as `I do return' semantics.
17522
17523         Improve the For case to also test for boolean constants.
17524
17525         * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
17526         to the list of attributes we can add.
17527
17528         Remove `EmitContext' argument.
17529
17530         * class.cs (Method.Define): Apply parameter attributes.
17531         (Constructor.Define): Apply parameter attributes.
17532         (MethodCore.LabelParameters): Move here the core of labeling
17533         parameters. 
17534
17535         * support.cs (ReflectionParameters.ParameterModifier,
17536         InternalParameters.ParameterModifier): Use IsByRef on the type and
17537         only return the OUT bit for these parameters instead of in/out/ref
17538         flags.
17539
17540         This is because I miss-understood things.  The ParameterInfo.IsIn
17541         and IsOut represent whether the parameter has the [In] and [Out]
17542         attributes set.  
17543
17544 2002-01-22  Miguel de Icaza  <miguel@ximian.com>
17545
17546         * ecore.cs (FieldExpr.Emit): Release temporaries.
17547
17548         * assign.cs (LocalTemporary.Release): new function.
17549
17550         * codegen.cs (EmitContext.GetTemporaryStorage,
17551         EmitContext.FreeTemporaryStorage): Rework the way we deal with
17552         temporary storage.  Now we can "put back" localbuilders when we
17553         are done with them
17554
17555 2002-01-21  Miguel de Icaza  <miguel@ximian.com>
17556
17557         * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
17558         need to make a copy of the variable to generate verifiable code.
17559
17560 2002-01-19  Miguel de Icaza  <miguel@ximian.com>
17561
17562         * driver.cs: Compute dynamically the system directory.
17563
17564         * ecore.cs (CopyNewMethods): reworked, exposed, made public.
17565         Slower, but more generally useful.  Used by the abstract
17566         registering implementation. 
17567
17568         * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
17569         the rules for the special rule on Type/instances.  First check if
17570         we have the same name, and if so, try that special static path
17571         rather than the instance path.
17572
17573 2002-01-18  Miguel de Icaza  <miguel@ximian.com>
17574
17575         * cs-parser.jay: Emit 642 (warning: possible empty statement) for
17576         for, while and if.
17577
17578         * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
17579         Enum, ValueType, Delegate or Array for non-corlib compiles.
17580
17581         * cs-tokenizer.cs: Catch long identifiers (645)
17582
17583         * typemanager.cs (IndexerPropetyName): Ravi never tested this
17584         piece of code.
17585
17586         * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
17587         fix, we were returning too early, so we were not registering
17588         pending methods from abstract classes.
17589
17590         Do not register pending methods if the class is abstract.
17591
17592         * expression.cs (Conditional.DoResolve): Report circular implicit
17593         conversions when we neecd to compute it for conditional
17594         expressions. 
17595
17596         (Is.DoResolve): If the expression is always of the provided type,
17597         flag warning 183.  If the expression can not ever be of the
17598         provided type flag warning 184.
17599
17600         * class.cs: Catch 169 as well.
17601
17602         * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
17603         read. 
17604
17605 2002-01-18  Nick Drochak  <ndrochak@gol.com>
17606
17607         * makefile: remove path to beta2 csc.exe.  path to csc.exe must be in PATH instead.
17608
17609 2002-01-17  Miguel de Icaza  <miguel@ximian.com>
17610
17611         * interface.cs: (PopulateMethod): Check for pointers being defined
17612         only if the unsafe context is active.
17613         (PopulateProperty): ditto.
17614         (PopulateIndexer): ditto.
17615
17616         * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
17617         specified.  If pointers are present, make sure that they are
17618         present in an unsafe context.
17619         (Constructor, Constructor.Define): ditto.
17620         (Field, Field.Define): ditto.
17621         (Property, Property.Define): ditto.
17622         (Event, Event.Define): ditto.
17623
17624         * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
17625         hashtable if there are classes or structs defined.
17626
17627         * expression.cs (LocalVariableReference.DoResolve): Simplify this
17628         code, as the constant resolution moved.
17629
17630         * statement.cs (Block.EmitMeta): Resolve all constants as we emit
17631         the metadata, so we can flag error 133. 
17632
17633         * decl.cs (MemberCore.UnsafeOK): New function to test that a
17634         pointer is being declared in an unsafe context.
17635
17636 2002-01-16  Miguel de Icaza  <miguel@ximian.com>
17637
17638         * modifiers.cs (Modifiers.Check): Require a Location argument.
17639         Report error 227 for Unsafe use.
17640
17641         * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
17642
17643         * statement.cs (For.Emit): If the test is null, then report that
17644         we do `return', as we wont reach anything afterwards.
17645
17646         (Switch.SwitchGoverningType): Track the expression that matched
17647         the conversion.
17648
17649         * driver.cs: Allow negative numbers as an error code to flag.
17650
17651         * cs-parser.jay: Handle 1551.
17652
17653         * namespace.cs: Add 1537 checking (repeated using alias namespaces).
17654
17655 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
17656
17657         * cs-parser.jay: Report 1518 (type declaration can only contain
17658         class, struct, interface, enum or delegate)
17659
17660         (switch_label): Report 1523 (keywords `case' or `default' must
17661         preced code)
17662
17663         (opt_switch_sections): Report 1522 (empty switch)
17664
17665         * driver.cs: Report 1515 (response file specified multiple times)
17666         Report 1516 (Source file specified multiple times).
17667
17668         * expression.cs (Argument.Resolve): Signal 1510
17669
17670         (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
17671         access not allowed in static code)
17672
17673 2002-01-11  Ravi Pratap  <ravi@ximian.com>
17674
17675         * typemanager.cs (IsPointerType): Utility method which we are going
17676         to need a lot.
17677
17678         * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
17679         the object type, so we take care of that.
17680
17681         * expression.cs (FullMethodDesc): Also include the return type in descriptions.
17682
17683         * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
17684         added to non-params parameters :-)
17685
17686         * typemanager.cs (CSharpName): Include 'void' type too. 
17687
17688         (void_ptr_type): Include in the set of core types.
17689
17690         * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of 
17691         duplicating code.
17692
17693         (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have 
17694         an unsafe context.
17695
17696         * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had 
17697         completely forgotten about it.
17698
17699 2002-01-10  Ravi Pratap  <ravi@ximian.com>
17700
17701         * cs-parser.jay (pointer_type): Add. This begins our implementation
17702         of parsing rules for unsafe code.
17703
17704         (unsafe_statement): Implement.
17705
17706         (embedded_statement): Modify to include the above.
17707
17708         * statement.cs (Unsafe): Implement new class for unsafe blocks.
17709
17710         * codegen.cs (EmitContext.InUnsafe): Add. This determines
17711         if the current context is an unsafe one.
17712
17713         * cs-parser.jay (local_variable_pointer_type): Since local variable types
17714         are handled differently, we need separate rules for them.
17715
17716         (local_variable_declaration): Update to use local_variable_pointer_type
17717         to allow variable declarations of unmanaged pointer types.
17718
17719         * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
17720         in unsafe contexts.
17721
17722         * ../errors/cs0214.cs : Add.
17723
17724 2002-01-16  Nick Drochak  <ndrochak@gol.com>
17725
17726         * makefile: remove 'response' file when cleaning.
17727
17728 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
17729
17730         * cs-parser.jay: Report 1524.
17731
17732 2002-01-14  Miguel de Icaza  <miguel@ximian.com>
17733
17734         * typemanager.cs (RegisterMethod): drop checking if we have
17735         registered this from here
17736
17737 2002-01-12  Miguel de Icaza  <miguel@ximian.com>
17738
17739         * class.cs (Method.EmitDestructor): Implement calling our base
17740         destructor. 
17741
17742         * statement.cs (Try.Emit): Fix to reset the InFinally to the old
17743         value of InFinally.
17744
17745         * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
17746         this routine and will wrap the call in a try/catch block.  Deal
17747         with the case.
17748
17749 2002-01-11  Miguel de Icaza  <miguel@ximian.com>
17750
17751         * ecore.cs (Expression.MemberLookup): instead of taking a
17752         parameter `same_type' that was used to tell whether we could
17753         access private members we compute our containing type from the
17754         EmitContext.
17755
17756         (FieldExpr): Added partial support for volatile fields.  This does
17757         not work for volatile fields exposed from assemblies, as I can not
17758         figure out how to extract the modreq from it.
17759
17760         Updated all the source files to use this.
17761
17762         * codegen.cs (EmitContext): Compute ContainerType ahead of time,
17763         because it is referenced by MemberLookup very often. 
17764
17765 2002-01-09  Ravi Pratap  <ravi@ximian.com>
17766
17767         * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
17768         TypeBuilder.GetCustomAttributes to retrieve what we need.
17769
17770         Get rid of redundant default_member_attr_type as this is the same as
17771         default_member_type which already exists.
17772
17773         * interface.cs, attribute.cs : Update accordingly.
17774
17775 2002-01-08  Miguel de Icaza  <miguel@ximian.com>
17776
17777         * typemanager.cs: Enable IndexerPropertyName again.  It does not
17778         work for TYpeBuilders though.  Ravi, can you please fix this?
17779
17780         * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
17781
17782         * expression.cs (Argument.Emit): Handle the case of ref objects
17783         being passed to ref functions;  
17784
17785         (ParameterReference.EmitLoad): Loads the content of the pointer
17786         without dereferencing.
17787
17788 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
17789
17790         * cs-tokenizer.cs: Implemented the pre-processing expressions.
17791
17792 2002-01-08  Ravi Pratap  <ravi@ximian.com>
17793
17794         * class.cs (Indexer.DefineMethod): Incorporate the interface
17795         type in the name of the method if we are doing explicit interface
17796         implementation.
17797
17798         * expression.cs (ConversionExists): Remove as it is completely obsolete.
17799
17800         (BetterConversion): Fix extremely trivial bug where we were referring to
17801         ConversionExists instead of StandardConversionExists ! Hooray, things are fine
17802         again !
17803
17804         * ../errors/bug16.cs : Add although we have fixed it.
17805
17806 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
17807
17808         * expression.cs (BaseIndexer): Begin implementation.
17809
17810         * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
17811
17812         * cs-parser.jay (indexer_declarator): Use qualified_identifier
17813         production directly to remove a shift/reduce, and implement
17814         explicit interface implementation.
17815
17816         * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
17817         after a floating point suffix.
17818
17819         * expression.cs (DoNumericPromotions): Improved the conversion for
17820         uint/uint.  If we have a constant, we avoid doing a typecast to a
17821         larger type.
17822
17823         * class.cs (Indexer): Implement explicit interface implementation
17824         for indexers.
17825
17826 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
17827
17828         * class.cs: make the default instance constructor public and hidebysig.
17829
17830 2001-01-03  Ravi Pratap  <ravi@ximian.com>
17831
17832         * interface.cs (EmitDefaultMemberAttr): Make this helper method static
17833         so we can call it from elsewhere.
17834
17835         * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
17836         we emit it internally if the class has a defined indexer; otherwise the user
17837         emits it by decorating the class definition with the DefaultMemberAttribute.
17838
17839         * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
17840         attribute is not used on a type which defines an indexer.
17841
17842         * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
17843         character when we skip whitespace.
17844
17845         * ../errors/cs0646.cs : Add.
17846
17847 2002-01-03  Miguel de Icaza  <miguel@ximian.com>
17848
17849         * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
17850         again. 
17851
17852         * makefile: Add practical target `mcs3.exe' which builds the third
17853         generation compiler. 
17854
17855         * expression.cs (New): Fix structures constructor calling.
17856
17857         * class.cs (Property, Method, Indexer): Emit Final flag on the
17858         method if we are an interface implementation and we are not
17859         abstract. 
17860
17861         * ecore.cs (PropertyExpr): New public field `IsBase', tells
17862         whether this property is referencing a `base' method.
17863
17864         * expression.cs (Invocation.EmitCall): take an extra argument:
17865         is_base, this is used to determine whether the `call' or
17866         `callvirt' opcode should be used.
17867
17868
17869         * delegate.cs: update EmitCall.
17870
17871         * class.cs (Method.Define): Set NewSlot for the cases where we are
17872         not implementing an interface method.
17873
17874         (Property.Define): ditto.
17875
17876 2002-01-02  Miguel de Icaza  <miguel@ximian.com>
17877
17878         * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
17879         'r'.  Allows mcs to parse itself fully.
17880
17881 2002-01-02  Ravi Pratap  <ravi@ximian.com>
17882
17883         * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
17884         of the number of initializers that require the InitializeArray method.
17885
17886         (CheckIndices): Store the Expression in all cases - not the plain value. Also
17887         update the above field where necessary.
17888
17889         (MakeByteBlob): Update accordingly.
17890
17891         (DoEmit): Call EmitStaticInitializers only if the number of initializers is 
17892         greater than 2.
17893
17894         (EmitDynamicInitializers): Update in accordance with the new optimization.
17895
17896         (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
17897         same OpCode applies.
17898
17899         * cs-parser.jay : Fix some glaring errors I introduced.
17900
17901 2002-01-01  Ravi Pratap  <ravi@ximian.com> 
17902
17903         * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
17904         so that we can check for name clashes there too.
17905
17906         * typemanager.cs (default_member_attr_type): The attribute that we need to emit
17907         for interface indexers.
17908
17909         * interfaces.cs (Define): Emit the default member attribute.
17910
17911         * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
17912         variable was being referred to while setting the value ;-)
17913
17914 2002-01-01  Miguel de Icaza  <miguel@ximian.com>
17915
17916         * expression.cs (MakeByteBlob): Optimize: we do not need to fill
17917         byte-by-byte information when we know the data is zero.
17918
17919         Make the block always a multiple of 4, because
17920         DefineInitializedData has a bug.
17921
17922         * assign.cs: Fix, we should assign from the temporary, not from
17923         the source. 
17924
17925         * expression.cs (MakeByteBlob): Fix my incorrect code.
17926
17927 2001-12-31  Miguel de Icaza  <miguel@ximian.com>
17928
17929         * typemanager.cs (EnumToUnderlying): This function is used to get
17930         the underlying type from an enumeration, because it does not
17931         always work. 
17932
17933         * constant.cs: Use the I4_S form for values between -128 and 127.
17934
17935         * statement.cs (Block.LookupLabel): Looks up a label.
17936         (Block): Drop support for labeled blocks.
17937
17938         (LabeledStatement): New kind of statement that represents a label
17939         only.
17940
17941         (Goto): Finally implement this bad boy.
17942
17943         * cs-parser.jay: Update to reflect new mechanism to implement
17944         labels.
17945
17946 2001-12-30  Miguel de Icaza  <miguel@ximian.com>
17947
17948         * codegen.cs (EmitContext.This): a codegen property that keeps the
17949         a single instance of this instead of creating many different this
17950         instances. 
17951
17952         * delegate.cs (Delegate.DoResolve): Update to use the property;
17953
17954         * ecore.cs (SimpleName.SimpleNameResolve): Ditto
17955
17956         * expression.cs (BaseAccess.DoResolve): Ditto.
17957
17958 2001-12-29  Ravi Pratap  <ravi@ximian.com>
17959
17960         * typemanager.cs (methodimpl_attr_type): Add to hold the type
17961         corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
17962
17963         (InitCoreTypes): Update accordingly.
17964
17965         * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
17966         so we can quickly store the state.
17967
17968         (ApplyAttributes): Set the correct implementation flags
17969         for InternalCall methods.
17970
17971 2001-12-29  Miguel de Icaza  <miguel@ximian.com>
17972
17973         * expression.cs (EmitCall): if a method is not virtual, then do
17974         not use callvirt on it.
17975
17976         (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
17977         user defined stuff) requires the use of stobj, which takes an
17978         address on the stack instead of an array and an index.  So emit
17979         the Ldelema operation for it.
17980
17981         (EmitStoreOpcode): Use stobj for valuetypes.
17982
17983         (UnaryMutator.EmitCode): Use the right 1 value depending on
17984         whether we are dealing with int64/uint64, float or doubles.
17985
17986         * class.cs (TypeContainer.AddConstructor): Fix the logic to define
17987         constructors that I implemented last night.
17988
17989         (Constructor.IsDefault): Fix to work properly for static
17990         constructors.
17991
17992         * cs-parser.jay (CheckDef): report method signature errors.
17993         Update error number 103 to be 132.
17994
17995         * decl.cs: New AdditionResult enumeration value: MethodExists.
17996         Although we do this check for methods later on in the semantic
17997         analysis, catching repeated default constructors is so easy that
17998         we catch these here. 
17999
18000         * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
18001         promotions code.
18002
18003         (ParameterReference.EmitAssign, Emit): handle
18004         bools as bytes.
18005
18006         (ArrayAccess.EmitLoadOpcode): Handle bool type here.
18007         (ArrayAccess.EmitStoreOpcode): ditto.
18008
18009         * cs-tokenizer.cs (is_punct): Eliminated empty computation.
18010
18011         * expression.cs (MakeByteBlob): Complete all the missing types
18012         (uint, short, ushort, byte, sbyte)
18013
18014         * class.cs: Only init instance field initializers on instance
18015         constructors. 
18016
18017         Rename `constructors' to instance_constructors. 
18018
18019         (TypeContainer.AddConstructor): Only add constructors to the list
18020         if it is not static.
18021
18022         Make sure that we handle default_static_constructor independently
18023         everywhere where we handle instance_constructors
18024
18025 2001-12-28  Miguel de Icaza  <miguel@ximian.com>
18026
18027         * class.cs: Do not lookup or create a base initializer for a
18028         static constructor.
18029
18030         (ConstructorInitializer.Resolve): use the proper type to lookup
18031         for constructors.
18032
18033         * cs-parser.jay: Report error 1585 (modifiers between type and name).
18034
18035         * enum.cs, interface.cs: Remove CloseType, this is taken care by
18036         in DeclSpace. 
18037
18038         * decl.cs: CloseType is now an virtual method, the default
18039         implementation just closes this type.
18040
18041 2001-12-28  Ravi Pratap  <ravi@ximian.com>
18042
18043         * attribute.cs (DefinePInvokeMethod): Set the implementation flags
18044         to PreserveSig by default. Also emit HideBySig on such methods.
18045
18046         Basically, set the defaults to standard values.
18047
18048         * expression.cs (Invocation.BetterFunction): We need to make sure that for each
18049         argument, if candidate is better, it can't be worse than the best !
18050
18051         (Invocation): Re-write bits to differentiate between methods being
18052         applicable in their expanded form and their normal form - for params
18053         methods of course.
18054
18055         Get rid of use_standard everywhere as only standard conversions are allowed
18056         in overload resolution. 
18057
18058         More spec conformance.
18059
18060 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
18061
18062         * driver.cs: Add --timestamp, to see where the compiler spends
18063         most of its time.
18064
18065         * ecore.cs (SimpleName.DoResolve): Do not create an implicit
18066         `this' in static code.
18067
18068         (SimpleName.DoResolve): Implement in terms of a helper function
18069         that allows static-references to be passed upstream to
18070         MemberAccess.
18071
18072         (Expression.ResolveWithSimpleName): Resolve specially simple
18073         names when called by MemberAccess to implement the special
18074         semantics. 
18075
18076         (Expression.ImplicitReferenceConversion): Handle conversions from
18077         Null to reference types before others, as Null's type is
18078         System.Object. 
18079
18080         * expression.cs (Invocation.EmitCall): Handle the special case of
18081         calling methods declared on a reference type from a ValueType
18082         (Base classes System.Object and System.Enum)
18083
18084         (MemberAccess.Resolve): Only perform lookups on Enumerations if
18085         the left hand side is a TypeExpr, not on every enumeration. 
18086
18087         (Binary.Resolve): If types are reference types, then do a cast to
18088         object on operators != and == of both arguments.
18089
18090         * typemanager.cs (FindMembers): Extract instance and static
18091         members if requested.
18092
18093         * interface.cs (PopulateProperty): Use void_type instead of null
18094         as the return type for the setter method.
18095
18096         (PopulateIndexer): ditto.
18097
18098 2001-12-27  Ravi Pratap  <ravi@ximian.com>
18099
18100         * support.cs (ReflectionParameters): Fix minor bug where we
18101         were examining the wrong parameter for the ParamArray attribute.
18102
18103         Cope with requests for the type of the parameter at position
18104         greater than the params parameter's. We now return the element
18105         type of the params array as that makes more sense.
18106
18107         * expression.cs (Invocation.IsParamsMethodApplicable): Update 
18108         accordingly as we no longer have to extract the element type
18109         ourselves.
18110
18111         (Invocation.OverloadResolve): Update.
18112
18113 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
18114
18115         * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
18116         against IEnumerator, test whether the return value is a descendant
18117         of the IEnumerator interface.
18118
18119         * class.cs (Indexer.Define): Use an auxiliary method to implement
18120         the other bits of the method definition.  Begin support for
18121         explicit interface implementation.
18122
18123         (Property.DefineMethod): Use TypeManager.void_type instead of null
18124         for an empty return value.
18125
18126 2001-12-26  Miguel de Icaza  <miguel@ximian.com>
18127
18128         * expression.cs (MemberAccess.ResolveMemberAccess): if we are
18129         dealing with a FieldExpr which is composed of a FieldBuilder, in
18130         the code path we did extract the constant, but we should have
18131         obtained the underlying value to be able to cast it (otherwise we
18132         end up in an infinite loop, this is what Ravi was running into).
18133
18134         (ArrayCreation.UpdateIndices): Arrays might be empty.
18135
18136         (MemberAccess.ResolveMemberAccess): Add support for section
18137         14.5.4.1 that deals with the special case of E.I when E is a type
18138         and something else, that I can be a reference to a static member.
18139
18140         (ArrayCreation.MakeByteBlob): It is not an error to not be able to
18141         handle a particular array type to create byte blobs, it is just
18142         something we dont generate byteblobs for.
18143
18144         * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
18145         arguments. 
18146
18147         * location.cs (Push): remove the key from the hashtable that we
18148         are about to add.   This happens for empty files.
18149
18150         * driver.cs: Dispose files after we have parsed them.
18151
18152         (tokenize): new function that only runs the tokenizer on its
18153         input, for speed testing.
18154
18155 2001-12-26  Ravi Pratap  <ravi@ximian.com>
18156
18157         * class.cs (Event.Define): Define the private field only if there
18158         are no accessors defined.
18159
18160         * expression.cs (ResolveMemberAccess): If there is no associated
18161         field with the event, that means we have an event defined with its
18162         own accessors and we should flag error cs0070 since transforming
18163         ourselves into a field is not valid in that case.
18164
18165         * ecore.cs (SimpleName.DoResolve): Same as above.
18166
18167         * attribute.cs (DefinePInvokeMethod): Set the default calling convention
18168         and charset to sane values.
18169
18170 2001-12-25  Ravi Pratap  <ravi@ximian.com>
18171
18172         * assign.cs (DoResolve): Perform check on events only if they 
18173         are being accessed outside the declaring type.
18174
18175         * cs-parser.jay (event_declarations): Update rules to correctly
18176         set the type of the implicit parameter etc.
18177
18178         (add_accessor, remove_accessor): Set current local parameters.
18179
18180         * expression.cs (Binary): For delegate addition and subtraction,
18181         cast the return value from the method into the appropriate delegate
18182         type.
18183
18184 2001-12-24  Ravi Pratap  <ravi@ximian.com>
18185
18186         * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
18187         of these as the workaround is unnecessary.
18188
18189         * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
18190         delegate data - none of that is needed at all.
18191
18192         Re-write bits to extract the instance expression and the delegate method
18193         correctly.
18194
18195         * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator 
18196         on delegates too.
18197
18198         * attribute.cs (ApplyAttributes): New method to take care of common tasks
18199         of attaching attributes instead of duplicating code everywhere.
18200
18201         * everywhere : Update code to do attribute emission using the above method.
18202
18203 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
18204
18205         * expression.cs (IsParamsMethodApplicable): if there are not
18206         parameters, return immediately.
18207
18208         * ecore.cs: The 0 literal can be implicity converted to an enum
18209         type. 
18210
18211         (SimpleName.DoResolve): First lookup the type, then lookup the
18212         members. 
18213
18214         (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
18215         want to get its address.  If the InstanceExpression is not
18216         addressable, store the result in a temporary variable, then get
18217         the address of it.
18218
18219         * codegen.cs: Only display 219 errors on warning level or above. 
18220
18221         * expression.cs (ArrayAccess): Make it implement the
18222         IMemoryLocation interface.
18223
18224         (Binary.DoResolve): handle the operator == (object a, object b)
18225         and operator != (object a, object b) without incurring into a
18226         BoxedCast (because 5 != o should never be performed).
18227
18228         Handle binary enumerator operators.
18229
18230         (EmitLoadOpcode): Use Ldelema if the object we are loading is a
18231         value type, otherwise use Ldelem_ref.
18232
18233         Use precomputed names;
18234
18235         (AddressOf): Implement address of
18236
18237         * cs-parser.jay (labeled_statement): Fix recursive block
18238         addition by reworking the production.
18239
18240         * expression.cs (New.DoEmit): New has a special case:
18241                 
18242                  If we are dealing with a ValueType, we have a few
18243                  situations to deal with:
18244                 
18245                     * The target of New is a ValueType variable, that is
18246                       easy, we just pass this as the variable reference
18247                 
18248                     * The target of New is being passed as an argument,
18249                       to a boxing operation or a function that takes a
18250                       ValueType.
18251                 
18252                       In this case, we need to create a temporary variable
18253                       that is the argument of New.
18254
18255
18256 2001-12-23  Ravi Pratap  <ravi@ximian.com>
18257
18258         * rootcontext.cs (LookupType): Check that current_type is not null before
18259         going about looking at nested types.
18260
18261         * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
18262         not implement the IAssignMethod interface any more.
18263
18264         * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
18265         where we tranform them into FieldExprs if they are being resolved from within
18266         the declaring type.
18267
18268         * ecore.cs (SimpleName.DoResolve): Do the same here.
18269
18270         * assign.cs (DoResolve, Emit): Clean up code considerably. 
18271
18272         * ../errors/bug10.cs : Add.
18273
18274         * ../errors/cs0070.cs : Add.
18275
18276         * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
18277
18278         * assign.cs : Get rid of EventIsLocal everywhere.
18279
18280 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
18281
18282         * ecore.cs (ConvertIntLiteral): finished the implementation.
18283
18284         * statement.cs (SwitchLabel): Convert the value we are using as a
18285         key before looking up the table.
18286
18287 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
18288
18289         * codegen.cs (EmitTopBlock): Require a Location argument now.
18290
18291         * cs-parser.jay (constructor_declarator): We need to setup
18292         current_local_parameters before we parse the
18293         opt_constructor_initializer, to allow the variables to be bound
18294         to the constructor arguments.
18295
18296         * rootcontext.cs (LookupType): First lookup nested classes in our
18297         class and our parents before we go looking outside our class.
18298
18299         * expression.cs (ConstantFold): Extract/debox the values at the
18300         beginnning. 
18301
18302         * rootcontext.cs (EmitCode): Resolve the constants first before we
18303         resolve the types.  This is not really needed, but it helps debugging.
18304
18305         * statement.cs: report location.
18306
18307         * cs-parser.jay: pass location to throw statement.
18308
18309         * driver.cs: Small bug fix.
18310
18311         * report.cs: Updated format to be 4-zero filled digits.
18312
18313 2001-12-22  Ravi Pratap  <ravi@ximian.com>
18314
18315         * expression.cs (CheckIndices): Fix minor bug where the wrong
18316         variable was being referred to ;-)
18317
18318         (DoEmit): Do not call EmitStaticInitializers when the 
18319         underlying type is System.Object.
18320
18321 2001-12-21  Ravi Pratap  <ravi@ximian.com>
18322
18323         * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
18324         and do the usual workaround for SRE.
18325
18326         * class.cs (MyEventBuilder.EventType): New member to get at the type
18327         of the event, quickly.
18328
18329         * expression.cs (Binary.ResolveOperator): Handle delegate addition.
18330
18331         * assign.cs (Assign.DoResolve): Handle the case when the target
18332         is an EventExpr and perform the necessary checks.
18333
18334         * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
18335         interface.
18336
18337         (SimpleName.MemberStaticCheck): Include check for EventExpr.
18338
18339         (EventExpr): Set the type in the constructor itself since we 
18340         are meant to be born fully resolved.
18341
18342         (EventExpr.Define): Revert code I wrote earlier.
18343                 
18344         * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
18345         instance expression is null. The instance expression is a This in that case
18346         or a null, depending on whether it is a static method or not.
18347
18348         Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
18349         refers to more than one method.
18350
18351         * assign.cs (DoResolve): Check whether the event belongs to the same Type container
18352         and accordingly flag errors.
18353
18354 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
18355
18356         * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
18357
18358 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
18359
18360         * location.cs (ToString): Provide useful rutine.
18361
18362 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
18363
18364         * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
18365         objects, return the actual integral boxed.
18366
18367         * statement.cs (SwitchLabel): define an ILLabel for each
18368         SwitchLabel. 
18369
18370         (Switch.CheckSwitch): If the value is a Literal, extract
18371         the underlying literal.
18372
18373         Also in the unused hashtable we had, add the SwitchLabel so we can
18374         quickly look this value up.
18375
18376         * constant.cs: Implement a bunch of new constants.  Rewrite
18377         Literal based on this.  Made changes everywhere to adapt to this.
18378
18379         * expression.cs (Expression.MakeByteBlob): Optimize routine by
18380         dereferencing array only once, and also copes with enumrations.
18381
18382         bytes are two bytes wide, not one.
18383
18384         (Cast): Perform constant conversions.
18385
18386         * ecore.cs (TryImplicitIntConversion): Return literals instead of
18387         wrappers to the literals here.
18388
18389         * expression.cs (DoNumericPromotions): long literals can converted
18390         to ulong implicity (this is taken care of elsewhere, but I was
18391         missing this spot).
18392
18393         * ecore.cs (Expression.Literalize): Make the return type Literal,
18394         to improve type checking.
18395
18396         * rootcontext.cs: Lookup for nested classes in our class hierarchy.
18397
18398 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
18399
18400         * literal.cs: Revert code from ravi that checked the bounds.  The
18401         bounds are sane by the definition of the type itself. 
18402
18403         * typemanager.cs: Fix implementation of ImplementsInterface.  We
18404         need to actually look up in our parent hierarchy for interfaces
18405         implemented. 
18406
18407         * const.cs: Use the underlying type for enumerations
18408
18409         * delegate.cs: Compute the basename for the delegate creation,
18410         that should fix the delegate test case, and restore the correct
18411         Type Lookup semantics in rootcontext
18412
18413         * rootcontext.cs: Revert Ravi's last patch.  The correct way of
18414         referencing a nested type with the Reflection API is using the "+"
18415         sign. 
18416
18417         * cs-parser.jay: Do not require EOF token at the end.
18418
18419 2001-12-20  Ravi Pratap  <ravi@ximian.com>
18420
18421         * rootcontext.cs (LookupType): Concatenate type names with
18422         a '.' instead of a '+' The test suite passes again.
18423
18424         * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
18425         field of the enumeration.
18426
18427         * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
18428         the case when the member is an EventExpr.
18429
18430         * ecore.cs (EventExpr.InstanceExpression): Every event which is not
18431         static has an associated instance expression.
18432
18433         * typemanager.cs (RegisterEvent): The usual workaround, now for events.
18434
18435         (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
18436
18437         * class.cs (Event.Define): Register event and perform appropriate checks
18438         for error #111.
18439
18440         We define the Add and Remove methods even if the use provides none because
18441         in that case, we provide default implementations ourselves.
18442
18443         Define a private field of the type of the event. This is done by the CSC compiler
18444         and we should be doing it too ;-)
18445
18446         * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
18447         More methods we use in code we generate.
18448
18449         (multicast_delegate_type, delegate_type): Two separate types since the distinction
18450         is important.
18451
18452         (InitCoreTypes): Update accordingly for the above.
18453
18454         * class.cs (Event.Emit): Generate code for default accessors that we provide
18455
18456         (EmitDefaultMethod): Do the job in the above.
18457
18458         * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the 
18459         appropriate place.
18460
18461 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
18462
18463         * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
18464         builders even if we were missing one.
18465
18466         * interface.cs, class.cs, enum.cs: When calling DefineNestedType
18467         pass the Basename as our class name instead of the Name.  The
18468         basename will be correctly composed for us.
18469
18470         * parameter.cs (Paramters): Now takes a Location argument.
18471
18472         * decl.cs (DeclSpace.LookupType): Removed convenience function and
18473         make all the code call directly LookupType in RootContext and take
18474         this chance to pass the Location information everywhere.
18475
18476         * Everywhere: pass Location information.
18477
18478 2001-12-19  Miguel de Icaza  <miguel@ximian.com>
18479
18480         * class.cs (Constructor.Define): Updated way of detecting the
18481         length of the parameters.
18482
18483         (TypeContainer.DefineType): Use basename as the type name for
18484         nested types.
18485
18486         (TypeContainer.Define): Do not recursively define types here, as
18487         definition is taken care in order by the RootContext.
18488
18489         * tree.cs: Keep track of namespaces in a per-file basis.
18490
18491         * parameter.cs (Parameter.ComputeSignature): Update to use
18492         DeclSpace. 
18493
18494         (Parameters.GetSignature): ditto.
18495
18496         * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
18497         instead of a TypeContainer.
18498
18499         (Interface.SemanticAnalysis): Use `this' instead of our parent to
18500         resolve names.  Because we need to be resolve in our context, not
18501         our parents.
18502
18503         * driver.cs: Implement response files.
18504
18505         * class.cs (TypeContainer.DefineType): If we are defined, do not
18506         redefine ourselves.
18507
18508         (Event.Emit): Emit the code for add/remove handlers.
18509         (Event.Define): Save the MethodBuilders for add/remove.
18510
18511         * typemanager.cs: Use pair here too.
18512
18513         * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
18514         DictionaryEntry requires the first argument to be non-null.  
18515
18516         (enum_declaration): Compute full name for registering the
18517         enumeration.
18518
18519         (delegate_declaration): Instead of using
18520         formal_parameter_list, use opt_formal_parameter_list as the list
18521         can be empty.
18522
18523         * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
18524         (EventParsing): New property that controls whether `add' and
18525         `remove' are returned as tokens or identifiers (for events);
18526
18527 2001-12-19  Ravi Pratap  <ravi@ximian.com>
18528
18529         * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
18530         use MyEventBuilder only and let it wrap the real builder for us.
18531
18532         (MyEventBuilder): Revamp constructor etc.
18533
18534         Implement all operations that we perform on EventBuilder in precisely the same
18535         way here too.
18536
18537         (FindMembers): Update to use the EventBuilder member.
18538
18539         (Event.Emit): Update accordingly.
18540
18541 2001-12-18  Ravi Pratap  <ravi@ximian.com>
18542
18543         * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
18544         by calling the appropriate methods.
18545
18546         (GetCustomAttributes): Make stubs as they cannot possibly do anything
18547         useful.
18548
18549         (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
18550
18551 2001-12-17  Ravi Pratap  <ravi@ximian.com>
18552
18553         * delegate.cs (Delegate.Populate): Check that the return type
18554         and various parameters types are indeed accessible.
18555
18556         * class.cs (Constructor.Define): Same here.
18557
18558         (Field.Define): Ditto.
18559
18560         (Event.Define): Ditto.
18561
18562         (Operator.Define): Check that the underlying Method defined itself
18563         correctly - so it's MethodBuilder should not be null.
18564
18565         * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
18566         expression happens to be null.
18567
18568         * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
18569         members but as of now we don't seem to be able to do anything really useful with it.
18570
18571         (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
18572         not the EventBuilder.
18573
18574 2001-12-18  Miguel de Icaza  <miguel@ximian.com>
18575
18576         * cs-tokenizer.cs: Add support for defines.
18577         Add support for #if, #elif, #else, #endif
18578
18579         (eval_var): evaluates a variable.
18580         (eval): stubbed for evaluating functions.
18581
18582         * cs-parser.jay: Pass the defines information
18583
18584         * driver.cs: Add --define command line option.
18585
18586         * decl.cs: Move MemberCore here.
18587
18588         Make it the base class for DeclSpace.  This allows us to catch and
18589         report 108 and 109 for everything now.
18590
18591         * class.cs (TypeContainer.Define): Extract all the members
18592         before populating and emit the warning 108 (new keyword required
18593         to override) instead of having each member implement this.
18594
18595         (MemberCore.Define): New abstract method, we will be using this in
18596         the warning reporting engine in Populate.
18597
18598         (Operator.Define): Adjust to new MemberCore protocol. 
18599
18600         * const.cs (Const): This does not derive from Expression, it is a
18601         temporary object we use to create fields, it is a MemberCore. 
18602
18603         * class.cs (Method.Define): Allow the entry point to be in a
18604         specific class.
18605
18606         * driver.cs: Rewrite the argument handler to clean it up a bit.
18607
18608         * rootcontext.cs: Made it just an auxiliary namespace feature by
18609         making everything static.
18610
18611         * driver.cs: Adapt code to use RootContext type name instead of
18612         instance variable.
18613
18614         * delegate.cs: Remove RootContext argument.
18615
18616         * class.cs: (Struct, TypeContainer, Class): Remove RootContext
18617         argument. 
18618
18619         * class.cs (Event.Define): The lookup can fail.
18620
18621         * cs-tokenizer.cs: Begin implementation of pre-procesor. 
18622
18623         * expression.cs: Resolve the this instance before invoking the code.
18624
18625 2001-12-17  Miguel de Icaza  <miguel@ximian.com>
18626
18627         * cs-parser.jay: Add a production in element_access that allows
18628         the thing to become a "type" reference.  This way we can parse
18629         things like "(string [])" as a type.
18630
18631         Note that this still does not handle the more complex rules of
18632         casts. 
18633
18634
18635         * delegate.cs (Delegate.Populate): Register the delegage constructor builder here. 
18636
18637         * ecore.cs: (CopyNewMethods): new utility function used to
18638         assemble the list of methods from running FindMembers.
18639
18640         (MemberLookup): Rework FindMembers so that 
18641
18642 2001-12-16  Miguel de Icaza  <miguel@ximian.com>
18643
18644         * class.cs (TypeContainer): Remove Delegates who fail to be
18645         defined.
18646
18647         * delegate.cs (Populate): Verify that we dont get null return
18648         values.   TODO: Check for AsAccessible.
18649
18650         * cs-parser.jay: Use basename to emit error 574 (destructor should
18651         have the same name as container class), not the full name.
18652
18653         * cs-tokenizer.cs (adjust_int): Fit the integer in the best
18654         possible representation.  
18655
18656         Also implements integer type suffixes U and L.
18657
18658 2001-12-15  Miguel de Icaza  <miguel@ximian.com>
18659
18660         * expression.cs (ArrayCreation.DoResolve): We need to do the
18661         argument resolution *always*.
18662
18663         * decl.cs: Make this hold the namespace.  Hold the root context as
18664         well.
18665         (LookupType): Move here.
18666
18667         * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
18668
18669         * location.cs (Row, Name): Fixed the code, it was always returning
18670         references to the first file.
18671
18672         * interface.cs: Register properties defined through interfaces.
18673
18674         * driver.cs: Add support for globbing on the command line
18675
18676         * class.cs (Field): Make it derive from MemberCore as well.
18677         (Event): ditto.
18678
18679 2001-12-15  Ravi Pratap  <ravi@ximian.com>
18680
18681         * class.cs (Event::Define): Check that the type of the event is a delegate
18682         type else flag error #66.
18683
18684         Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
18685         same.
18686
18687         * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
18688         values of EntryPoint, CharSet etc etc.
18689
18690         Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
18691
18692         * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
18693         be null and we should ignore this. I am not sure if this is really clean. Apparently,
18694         there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
18695         which needs this to do its work.
18696
18697         * ../errors/cs0066.cs : Add.
18698
18699 2001-12-14  Miguel de Icaza  <miguel@ximian.com>
18700
18701         * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
18702         helper functions.
18703
18704         * class.cs: (MethodSignature.MethodSignature): Removed hack that
18705         clears out the parameters field.
18706         (MemberSignatureCompare): Cleanup
18707
18708         (MemberCore): New base class used to share code between MethodCore
18709         and Property.
18710
18711         (RegisterRequiredImplementations) BindingFlags.Public requires
18712         either BindingFlags.Instace or Static.  Use instance here.
18713
18714         (Property): Refactored code to cope better with the full spec.
18715
18716         * parameter.cs (GetParameterInfo): Return an empty array instead
18717         of null on error.
18718
18719         * class.cs (Property): Abstract or extern properties have no bodies.
18720
18721         * parameter.cs (GetParameterInfo): return a zero-sized array.
18722
18723         * class.cs (TypeContainer.MethodModifiersValid): Move all the
18724         method modifier validation to the typecontainer so we can reuse
18725         this on properties.
18726
18727         (MethodCore.ParameterTypes): return an empty sized array of types.
18728
18729         (Property.Define): Test property modifier validity.
18730
18731         Add tests for sealed/override too.
18732
18733         (Method.Emit): abstract or extern methods have no bodies.
18734
18735 2001-12-14  Ravi Pratap  <ravi@ximian.com>
18736
18737         * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
18738         thing.
18739
18740         (Method::Define, ::Emit): Modify accordingly.
18741
18742         * expression.cs (Invocation::OverloadResolve): Handle error # 121.
18743
18744         (ArrayCreation::MakeByteBlob): Handle floats and doubles.
18745
18746         * makefile: Pass in /unsafe.
18747
18748 2001-12-13  Miguel de Icaza  <miguel@ximian.com>
18749
18750         * class.cs (MakeKey): Kill routine.
18751
18752         * class.cs (TypeContainer.Define): Correctly define explicit
18753         method implementations (they require the full interface name plus
18754         the method name).
18755
18756         * typemanager.cs: Deply the PtrHashtable here and stop using the
18757         lame keys.  Things work so much better.
18758
18759         This of course broke everyone who depended on `RegisterMethod' to
18760         do the `test for existance' test.  This has to be done elsewhere.
18761
18762         * support.cs (PtrHashtable): A hashtable that avoid comparing with
18763         the object stupid Equals method (because, that like fails all over
18764         the place).  We still do not use it.
18765
18766         * class.cs (TypeContainer.SetRequiredInterface,
18767         TypeContainer.RequireMethods): Killed these two routines and moved
18768         all the functionality to RegisterRequiredImplementations.
18769
18770         (TypeContainer.RegisterRequiredImplementations): This routine now
18771         registers all the implementations required in an array for the
18772         interfaces and abstract methods.  We use an array of structures
18773         which can be computed ahead of time to reduce memory usage and we
18774         also assume that lookups are cheap as most classes will not
18775         implement too many interfaces.
18776
18777         We also avoid creating too many MethodSignatures.
18778
18779         (TypeContainer.IsInterfaceMethod): Update and optionally does not
18780         clear the "pending" bit if we find that there are problems with
18781         the declaration.
18782
18783         (TypeContainer.VerifyPendingMethods): Update to report errors of
18784         methods that look like implementations but are not.
18785
18786         (TypeContainer.Define): Add support for explicit interface method
18787         implementation. 
18788
18789 2001-12-12  Miguel de Icaza  <miguel@ximian.com>
18790
18791         * typemanager.cs: Keep track of the parameters here instead of
18792         being a feature of the TypeContainer.
18793
18794         * class.cs: Drop the registration of parameters here, as
18795         InterfaceMethods are also interface declarations.
18796
18797         * delegate.cs: Register methods with the TypeManager not only with
18798         the TypeContainer.  This code was buggy.
18799
18800         * interface.cs: Full registation here.
18801
18802 2001-12-11  Miguel de Icaza  <miguel@ximian.com>
18803
18804         * expression.cs: Remove reducer for binary expressions, it can not
18805         be done this way.
18806
18807         * const.cs: Put here the code that used to go into constant.cs
18808
18809         * constant.cs: Put here the code for constants, this is a new base
18810         class for Literals.
18811
18812         * literal.cs: Make Literal derive from Constant.
18813
18814 2001-12-09  Miguel de Icaza  <miguel@ximian.com>
18815
18816         * statement.cs (Return.Emit): Report error 157 if the user
18817         attempts to return from a finally block.
18818
18819         (Return.Emit): Instead of emitting a return, jump to the end of
18820         the function.
18821
18822         * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
18823         LocalBuilder to store the result of the function.  ReturnLabel is
18824         the target where we jump.
18825
18826
18827 2001-12-09  Radek Doulik  <rodo@ximian.com>
18828
18829         * cs-parser.jay: remember alias in current namespace
18830
18831         * ecore.cs (SimpleName::DoResolve): use aliases for types or
18832         namespaces
18833
18834         * class.cs (LookupAlias): lookup alias in my_namespace
18835
18836         * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
18837         aliases hashtable
18838         (LookupAlias): lookup alias in this and if needed in parent
18839         namespaces
18840
18841 2001-12-08  Miguel de Icaza  <miguel@ximian.com>
18842
18843         * support.cs: 
18844
18845         * rootcontext.cs: (ModuleBuilder) Made static, first step into
18846         making things static.  I need this to avoid passing the
18847         TypeContainer when calling ParameterType.
18848
18849         * support.cs (InternalParameters.ParameterType): Remove ugly hack
18850         that did string manipulation to compute the type and then call
18851         GetType.  Use Parameter.ParameterType instead.
18852
18853         * cs-tokenizer.cs: Consume the suffix for floating values.
18854
18855         * expression.cs (ParameterReference): figure out whether this is a
18856         reference parameter or not.  Kill an extra variable by computing
18857         the arg_idx during emission.
18858
18859         * parameter.cs (Parameters.GetParameterInfo): New overloaded
18860         function that returns whether a parameter is an out/ref value or not.
18861
18862         (Parameter.ParameterType): The type of the parameter (base,
18863         without ref/out applied).
18864
18865         (Parameter.Resolve): Perform resolution here.
18866         (Parameter.ExternalType): The full type (with ref/out applied).
18867
18868         * statement.cs (Using.Emit, Using.EmitExpression): Implement
18869         support for expressions on the using statement.
18870
18871 2001-12-07  Miguel de Icaza  <miguel@ximian.com>
18872
18873         * statement.cs (Using.EmitLocalVariableDecls): Split the
18874         localvariable handling of the using statement.
18875
18876         (Block.EmitMeta): Keep track of variable count across blocks.  We
18877         were reusing slots on separate branches of blocks.
18878
18879         (Try.Emit): Emit the general code block, we were not emitting it. 
18880
18881         Check the type of the declaration to be an IDisposable or
18882         something that can be implicity converted to it. 
18883
18884         Emit conversions if required.
18885
18886         * ecore.cs (EmptyExpression): New utility class.
18887         (Expression.ImplicitConversionExists): New utility function.
18888
18889 2001-12-06  Miguel de Icaza  <miguel@ximian.com>
18890
18891         * statement.cs (Using): Implement.
18892
18893         * expression.cs (LocalVariableReference): Support read only variables.
18894
18895         * statement.cs: Remove the explicit emit for the Leave opcode.
18896         (VariableInfo): Add a readonly field.
18897
18898 2001-12-05  Miguel de Icaza  <miguel@ximian.com>
18899
18900         * ecore.cs (ConvCast): new class used to encapsulate the various
18901         explicit integer conversions that works in both checked and
18902         unchecked contexts.
18903
18904         (Expression.ConvertNumericExplicit): Use new ConvCast class to
18905         properly generate the overflow opcodes.
18906
18907 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
18908
18909         * statement.cs: The correct type for the EmptyExpression is the
18910         element_type, not the variable type.  Ravi pointed this out.
18911
18912 2001-12-04  Ravi Pratap  <ravi@ximian.com>
18913
18914         * class.cs (Method::Define): Handle PInvoke methods specially
18915         by using DefinePInvokeMethod instead of the usual one.
18916
18917         * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
18918         above to do the task of extracting information and defining the method.
18919
18920 2001-12-04  Ravi Pratap  <ravi@ximian.com>
18921
18922         * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
18923         of the condition for string type.
18924
18925         (Emit): Move that here. 
18926
18927         (ArrayCreation::CheckIndices): Keep string literals in their expression
18928         form.
18929
18930         (EmitDynamicInitializers): Handle strings appropriately.
18931
18932 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
18933
18934         * codegen.cs (EmitContext): Replace multiple variables with a
18935         single pointer to the current Switch statement.
18936
18937         * statement.cs (GotoDefault, Switch): Adjust to cleaned up
18938         EmitContext.
18939
18940 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
18941
18942         * statement.cs 
18943
18944         * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
18945         default'.
18946
18947         (Foreach.Emit): Foreach on arrays was not setting
18948         up the loop variables (for break/continue).
18949
18950         (GotoCase): Semi-implented.
18951
18952 2001-12-03  Ravi Pratap  <ravi@ximian.com>
18953
18954         * attribute.cs (CheckAttribute): Handle system attributes by using
18955         Attribute.GetAttributes to examine information we need.
18956
18957         (GetValidPlaces): Same here.
18958
18959         * class.cs (Method::Define): Catch invalid use of extern and abstract together.
18960
18961         * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
18962
18963         * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
18964
18965         (Method::Define): Set appropriate flags if we have a DllImport attribute.
18966
18967         (Method::Emit): Handle the case when we are a PInvoke method.
18968
18969 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
18970
18971         * expression.cs: Use ResolveWithSimpleName on compound names.
18972
18973 2001-12-02  Ravi Pratap  <ravi@ximian.com>
18974
18975         * constant.cs (EmitConstant): Make sure we resolve the associated expression
18976         before trying to reduce it.
18977
18978         * typemanager.cs (RegisterConstant, LookupConstant): Implement.
18979
18980         * constant.cs (LookupConstantValue): Implement.
18981
18982         (EmitConstant): Use the above in emitting the constant.
18983
18984         * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
18985         that are user-defined by doing a LookupConstantValue on them.
18986
18987         (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
18988         too, like above.
18989
18990 2001-11-29  Miguel de Icaza  <miguel@ximian.com>
18991
18992         * expression.cs (BaseAccess, BaseIndexer): Also split this out.
18993
18994         (BaseAccess.DoResolve): Implement.
18995
18996         (MemberAccess.DoResolve): Split this routine into a
18997         ResolveMemberAccess routine that can be used independently
18998
18999 2001-11-28  Miguel de Icaza  <miguel@ximian.com>
19000
19001         * expression.cs (Probe, Is, As): Split Probe in two classes Is and
19002         As that share bits of the implementation.  Is returns a boolean,
19003         while As returns the Type that is being probed.
19004
19005 2001-12-01  Ravi Pratap  <ravi@ximian.com>
19006
19007         * enum.cs (LookupEnumValue): Re-write various bits, return an object value
19008         instead of a Literal - much easier.
19009
19010         (EnumInTransit): Remove - utterly useless :-)
19011
19012         (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
19013
19014         * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
19015
19016         * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
19017         chain when we have no associated expression.
19018
19019 2001-11-30  Ravi Pratap  <ravi@ximian.com>
19020
19021         * constant.cs (Define): Use Location while reporting the errror.
19022
19023         Also emit a warning when 'new' is used and there is no inherited
19024         member to hide.
19025
19026         * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being 
19027         populated.
19028
19029         (LookupEnumValue): Implement to lookup an enum member's value and define it
19030         if necessary.
19031
19032         (Populate): Re-write accordingly to use the above routine.
19033
19034 2001-11-27  Miguel de Icaza  <miguel@ximian.com>
19035
19036         * expression.cs (This): Fix prototype for DoResolveLValue to
19037         override the base class DoResolveLValue.
19038
19039         * cs-parser.cs: Report errors cs574 and cs575 (destructor
19040         declarations) 
19041
19042         * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
19043         (we need to load the address of the field here).  This fixes
19044         test-22. 
19045
19046         (FieldExpr.DoResolveLValue): Call the DoResolve
19047         function to initialize the Instance expression.
19048
19049         * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
19050         correctly the GetEnumerator operation on a value type.
19051
19052         * cs-parser.jay: Add more simple parsing error catches.
19053
19054         * statement.cs (Switch): Add support for string switches.
19055         Handle null specially.
19056
19057         * literal.cs (NullLiteral): Make NullLiteral objects singletons. 
19058
19059 2001-11-28  Ravi Pratap  <ravi@ximian.com>
19060
19061         * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
19062
19063         (declare_local_constant): New helper function.
19064
19065         * statement.cs (AddConstant): Keep a separate record of constants
19066
19067         (IsConstant): Implement to determine if a variable is a constant.
19068
19069         (GetConstantExpression): Implement.
19070
19071         * expression.cs (LocalVariableReference): Handle the case when it is a constant.
19072
19073         * statement.cs (IsVariableDefined): Re-write.
19074
19075 2001-11-27  Ravi Pratap  <ravi@ximian.com>
19076
19077         * class.cs (TypeContainer::FindMembers): Look for constants
19078         in the case when we are looking for MemberTypes.Field
19079
19080         * expression.cs (MemberAccess::DoResolve): Check that in the
19081         case we are a FieldExpr and a Literal, we are not being accessed
19082         by an instance reference.
19083
19084         * cs-parser.jay (local_constant_declaration): Implement.
19085
19086         (declaration_statement): Implement for constant declarations.
19087
19088 2001-11-26  Miguel de Icaza  <miguel@ximian.com>
19089
19090         * statement.cs (Switch): Catch double defaults.
19091
19092         (Switch): More work on the switch() statement
19093         implementation.  It works for integral values now, need to finish
19094         string support.
19095
19096
19097 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
19098
19099         * ecore.cs (Expression.ConvertIntLiteral): New function to convert
19100         integer literals into other integer literals.  To be used by
19101         switch. 
19102
19103 2001-11-24  Ravi Pratap  <ravi@ximian.com>
19104
19105         * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
19106         some memory.
19107
19108         (EmitDynamicInitializers): Cope with the above since we extract data
19109         directly from ArrayData now.
19110
19111         (ExpectInitializers): Keep track of whether initializers are mandatory
19112         or not.
19113
19114         (Bounds): Make it a hashtable to prevent the same dimension being 
19115         recorded for every element in that dimension.
19116
19117         (EmitDynamicInitializers): Fix bug which prevented the Set array method
19118         from being found.
19119
19120         Also fix bug which was causing the indices to be emitted in the reverse
19121         order.
19122
19123 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
19124
19125         * expression.cs (ArrayCreation): Implement the bits that Ravi left
19126         unfinished.  They do not work, because the underlying code is
19127         sloppy.
19128
19129 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
19130
19131         * cs-parser.jay: Remove bogus fixme.
19132
19133         * statement.cs (Switch, SwitchSection, SwithLabel): Started work
19134         on Switch statement.
19135
19136 2001-11-23  Ravi Pratap  <ravi@ximian.com>
19137
19138         * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
19139         the same. 
19140
19141         * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
19142         parameter. Apparently, any expression is allowed. 
19143
19144         (ValidateInitializers): Update accordingly.
19145
19146         (CheckIndices): Fix some tricky bugs thanks to recursion.
19147
19148         * delegate.cs (NewDelegate::DoResolve): Re-write large portions as 
19149         I was being completely brain-dead.
19150
19151         (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
19152         and re-write acordingly.
19153
19154         (DelegateInvocation): Re-write accordingly.
19155
19156         * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
19157
19158         (MakeByteBlob): Handle types more correctly.
19159
19160         * expression.cs (ArrayCreation:Emit): Write preliminary code to do
19161         initialization from expressions but it is incomplete because I am a complete
19162         Dodo :-|
19163
19164 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
19165
19166         * statement.cs (If.Emit): Fix a bug that generated incorrect code
19167         on If.  Basically, we have to return `true' (ie, we do return to
19168         our caller) only if both branches of the if return.
19169
19170         * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
19171         short-circuit operators, handle them as short circuit operators. 
19172
19173         (Cast.DoResolve): Resolve type.
19174         (Cast.Cast): Take an expression as the target type.
19175
19176         * cs-parser.jay (cast_expression): Remove old hack that only
19177         allowed a limited set of types to be handled.  Now we take a
19178         unary_expression and we resolve to a type during semantic
19179         analysis.
19180
19181         Use the grammar productions from Rhys to handle casts (this is
19182         not complete like Rhys syntax yet, we fail to handle that corner
19183         case that C# has regarding (-x), but we will get there.
19184
19185 2001-11-22  Ravi Pratap  <ravi@ximian.com>
19186
19187         * class.cs (EmitFieldInitializer): Take care of the case when we have a
19188         field which is an array type.
19189
19190         * cs-parser.jay (declare_local_variables): Support array initialization too.
19191
19192         * typemanager.cs (MakeKey): Implement.
19193
19194         (everywhere): Use the above appropriately.
19195
19196         * cs-parser.jay (for_statement): Update for array initialization while
19197         declaring variables.
19198
19199         * ecore.cs : The error message was correct, it's the variable's names that
19200         were misleading ;-) Make the code more readable.
19201
19202         (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
19203         the correct type etc.
19204
19205         (ConvertExplicit): Handle Enum types by examining the underlying type.
19206
19207 2001-11-21  Ravi Pratap  <ravi@ximian.com>
19208
19209         * parameter.cs (GetCallingConvention): Always return
19210         CallingConventions.Standard for now.
19211
19212 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
19213
19214         * expression.cs (Binary.ResolveOperator): Update the values of `l'
19215         and `r' after calling DoNumericPromotions.
19216
19217         * ecore.cs: Fix error message (the types were in the wrong order).
19218
19219         * statement.cs (Foreach.ProbeCollectionType): Need to pass
19220         BindingFlags.Instance as well 
19221
19222         * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
19223         implicit int literal conversion in an empty cast so that we
19224         propagate the right type upstream.
19225
19226         (UnboxCast): new class used to unbox value types.
19227         (Expression.ConvertExplicit): Add explicit type conversions done
19228         by unboxing.
19229
19230         (Expression.ImplicitNumericConversion): Oops, forgot to test for
19231         the target type before applying the implicit LongLiterals to ULong
19232         literal cast.
19233
19234 2001-11-21  Miguel de Icaza  <miguel@ximian.com>
19235
19236         * cs-parser.jay (for_statement): Reworked the way For works: now
19237         we declare manually any variables that are introduced in
19238         for_initializer to solve the problem of having out-of-band code
19239         emition (that is what got for broken).
19240
19241         (declaration_statement): Perform the actual variable declaration
19242         that used to be done in local_variable_declaration here.
19243
19244         (local_variable_declaration): Do not declare anything, just pass
19245         the information on a DictionaryEntry
19246
19247 2001-11-20  Ravi Pratap  <ravi@ximian.com>
19248
19249         * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
19250         re-write of the logic to now make it recursive.
19251
19252         (UpdateIndices): Re-write accordingly.
19253
19254         Store element data in a separate ArrayData list in the above methods.
19255
19256         (MakeByteBlob): Implement to dump the array data into a byte array.
19257
19258 2001-11-19  Ravi Pratap  <ravi@ximian.com>
19259
19260         * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
19261         into CheckIndices.
19262
19263         * constant.cs (Define): Implement.
19264
19265         (EmitConstant): Re-write fully.
19266
19267         Pass in location info.
19268
19269         * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
19270         respectively.
19271
19272         * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
19273         DictionaryEntry since we need location info too.
19274
19275         (constant_declaration): Update accordingly.
19276
19277         * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
19278         code into another method : UpdateIndices.
19279
19280 2001-11-18  Ravi Pratap  <ravi@ximian.com>
19281
19282         * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
19283         some type checking etc.
19284
19285 2001-11-17  Ravi Pratap  <ravi@ximian.com>
19286
19287         * expression.cs (ArrayCreation::ValidateInitializers): Implement
19288         bits to provide dimension info if the user skips doing that.
19289
19290         Update second constructor to store the rank correctly.
19291
19292 2001-11-16  Ravi Pratap  <ravi@ximian.com>
19293
19294         * expression.cs (ArrayCreation::ValidateInitializers): Poke around
19295         and try to implement.
19296
19297         * ../errors/cs0150.cs : Add.
19298
19299         * ../errors/cs0178.cs : Add.
19300
19301 2001-11-16  Miguel de Icaza  <miguel@ximian.com>
19302
19303         * statement.cs: Implement foreach on multi-dimensional arrays. 
19304
19305         * parameter.cs (Parameters.GetParameterByName): Also lookup the
19306         name of the params argument.
19307
19308         * expression.cs: Use EmitStoreOpcode to get the right opcode while
19309         initializing the array.
19310
19311         (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
19312         we can use this elsewhere.
19313
19314         * statement.cs: Finish implementation of foreach for single
19315         dimension arrays.
19316
19317         * cs-parser.jay: Use an out-of-band stack to pass information
19318         around, I wonder why I need this.
19319
19320         foreach_block: Make the new foreach_block the current_block.
19321
19322         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
19323         function used to return a static Parameters structure.  Used for
19324         empty parameters, as those are created very frequently.
19325
19326         * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
19327
19328 2001-11-15  Ravi Pratap  <ravi@ximian.com>
19329
19330         * interface.cs : Default modifier is private, not public. The
19331         make verify test passes again.
19332
19333 2001-11-15  Ravi Pratap  <ravi@ximian.com>
19334
19335         * support.cs (ReflectionParameters): Fix logic to determine
19336         whether the last parameter is a params one. Test 9 passes again.
19337
19338         * delegate.cs (Populate): Register the builders we define with
19339         RegisterParameterForBuilder. Test 19 passes again.
19340
19341         * cs-parser.jay (property_declaration): Reference $6 instead
19342         of $$ to get at the location.
19343
19344         (indexer_declaration): Similar stuff.
19345
19346         (attribute): Ditto.
19347
19348         * class.cs (Property): Register parameters for the Get and Set methods
19349         if they exist. Test 23 passes again.
19350
19351         * expression.cs (ArrayCreation::Emit): Pass null for the method in the
19352         call to EmitArguments as we are sure there aren't any params arguments. 
19353         Test 32 passes again.
19354
19355         * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
19356         IndexOutOfRangeException. 
19357
19358         * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
19359         Test 33 now passes again.
19360
19361 2001-11-15  Miguel de Icaza  <miguel@ximian.com>
19362
19363         * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
19364         broke a bunch of things.  Will have to come up with a better way
19365         of tracking locations.
19366
19367         * statement.cs: Implemented foreach for single dimension arrays.
19368
19369 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
19370
19371         * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
19372         an error.  This removes the lookup from the critical path.
19373
19374         * cs-parser.jay: Removed use of temporary_loc, which is completely
19375         broken. 
19376
19377 2001-11-14  Miguel de Icaza  <miguel@ximian.com>
19378
19379         * support.cs (ReflectionParameters.ParameterModifier): Report
19380         whether the argument is a PARAMS argument or not.
19381
19382         * class.cs: Set the attribute `ParamArrayAttribute' on the
19383         parameter argument.
19384
19385         * typemanager.cs: Define param_array_type (ParamArrayAttribute)
19386         and cons_param_array_attribute (ConstructorInfo for
19387         ParamArrayAttribute)., 
19388
19389         * codegen.cs: Emit the return using the `Return' statement, that
19390         way we can report the error correctly for missing return values. 
19391
19392         * class.cs (Method.Emit): Clean up.
19393
19394         * expression.cs (Argument.Resolve): Take another argument: the
19395         location where this argument is used.  Notice that this is not
19396         part of the "Argument" class as to reduce the size of the
19397         structure (we know the approximate location anyways).
19398
19399         Test if the argument is a variable-reference, if not, then
19400         complain with a 206.
19401
19402         (Argument.Emit): Emit addresses of variables.
19403
19404         (Argument.FullDesc): Simplify.
19405
19406         (Invocation.DoResolve): Update for Argument.Resolve.
19407
19408         (ElementAccess.DoResolve): ditto.
19409
19410         * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
19411         method should be virtual, as this method is always virtual.
19412
19413         (NewDelegate.DoResolve): Update for Argument.Resolve.
19414
19415         * class.cs (ConstructorInitializer.DoResolve): ditto.
19416
19417         * attribute.cs (Attribute.Resolve): ditto.
19418
19419 2001-11-13  Miguel de Icaza  <miguel@ximian.com>
19420
19421         * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
19422
19423         * expression.cs (ParameterReference): Drop IStackStorage and implement
19424         IAssignMethod instead. 
19425
19426         (LocalVariableReference): ditto.
19427
19428         * ecore.cs (FieldExpr): Drop IStackStorage and implement
19429         IAssignMethod instead. 
19430
19431 2001-11-13  Miguel de Icaza <miguel@ximian.com>
19432
19433         * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
19434         enumerations that are used in heavily used structures derive from
19435         byte in a laughable and pathetic attempt to reduce memory usage.
19436         This is the kind of pre-optimzations that you should not do at
19437         home without adult supervision.
19438
19439         * expression.cs (UnaryMutator): New class, used to handle ++ and
19440         -- separatedly from the other unary operators.  Cleans up the
19441         code, and kills the ExpressionStatement dependency in Unary.
19442
19443         (Unary): Removed `method' and `Arguments' from this class, making
19444         it smaller, and moving it all to SimpleCall, so I can reuse this
19445         code in other locations and avoid creating a lot of transient data
19446         strucutres when not required.
19447
19448         * cs-parser.jay: Adjust for new changes.
19449
19450 2001-11-11  Miguel de Icaza  <miguel@ximian.com>
19451
19452         * enum.cs (Enum.Populate): If there is a failure during
19453         definition, return
19454
19455         * cs-parser.jay (opt_enum_base): we used to catch type errors
19456         here, but this is really incorrect.  The type error should be
19457         catched during semantic analysis.
19458
19459 2001-12-11  Ravi Pratap  <ravi@ximian.com>
19460
19461         * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
19462         current_local_parameters as expected since I, in my stupidity, had forgotten
19463         to do this :-)
19464
19465         * attribute.cs (GetValidPlaces): Fix stupid bug.
19466
19467         * class.cs (Method::Emit): Perform check on applicability of attributes.
19468
19469         (Constructor::Emit): Ditto.
19470
19471         (Field::Emit): Ditto.
19472
19473         (Field.Location): Store location information.
19474
19475         (Property, Event, Indexer, Operator): Ditto.
19476
19477         * cs-parser.jay (field_declaration): Pass in location for each field.
19478
19479         * ../errors/cs0592.cs : Add.
19480
19481 2001-11-12  Ravi Pratap  <ravi@ximian.com>
19482
19483         * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
19484
19485         (InitCoreTypes): Update accordingly.
19486
19487         (RegisterAttrType, LookupAttr): Implement.
19488
19489         * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
19490         info about the same.
19491
19492         (Resolve): Update to populate the above as necessary.
19493
19494         (Error592): Helper.
19495
19496         (GetValidPlaces): Helper to the above.
19497
19498         (CheckAttribute): Implement to perform validity of attributes on declarative elements.
19499
19500         * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
19501
19502 2001-11-12  Ravi Pratap  <ravi@ximian.com>
19503
19504         * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
19505
19506         * ../errors/cs0617.cs : Add.
19507
19508 2001-11-11  Ravi Pratap  <ravi@ximian.com>
19509
19510         * enum.cs (Emit): Rename to Populate to be more consistent with what
19511         we expect it to do and when exactly it is called.
19512
19513         * class.cs, rootcontext.cs : Update accordingly.
19514
19515         * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
19516         FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
19517
19518         * enum.cs (Populate): Register fields with TypeManager.RegisterField.
19519
19520         * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
19521         of a fieldinfo using the above, when dealing with a FieldBuilder.
19522
19523 2001-11-10  Ravi Pratap  <ravi@ximian.com>
19524
19525         * ../errors/cs0031.cs : Add.
19526
19527         * ../errors/cs1008.cs : Add.
19528
19529         * ../errrors/cs0543.cs : Add.
19530
19531         * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
19532         enum type.
19533
19534         (FindMembers): Implement.
19535
19536         * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
19537         enums and delegates too.
19538
19539         (enum_types): Rename to builder_to_enum.
19540
19541         (delegate_types): Rename to builder_to_delegate.
19542
19543         * delegate.cs (FindMembers): Implement.
19544
19545 2001-11-09  Ravi Pratap  <ravi@ximian.com>
19546
19547         * typemanager.cs (IsEnumType): Implement.
19548
19549         * enum.cs (Emit): Re-write parts to account for the underlying type
19550         better and perform checking etc.
19551
19552         (GetNextDefaultValue): Helper to ensure we don't overshoot max value
19553         of the underlying type.
19554
19555         * literal.cs (GetValue methods everywhere): Perform bounds checking and return
19556         value
19557
19558         * enum.cs (error31): Helper to report error #31.
19559
19560         * cs-parser.jay (enum_declaration): Store location of each member too.
19561
19562         * enum.cs (member_to_location): New hashtable. 
19563
19564         (AddEnumMember): Update location hashtable.
19565
19566         (Emit): Use the location of each member while reporting errors.
19567
19568 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
19569
19570         * cs-parser.jay: A for_initializer if is a
19571         local_variable_declaration really ammount to have an implicit
19572         block with the variable declaration and no initializer for for.
19573
19574         * statement.cs (For.Emit): Cope with null initializers.
19575
19576         This fixes the infinite loop on for initializers.
19577
19578 2001-11-08  Miguel de Icaza  <miguel@ximian.com>
19579
19580         * enum.cs: More cleanup.
19581
19582         * ecore.cs: Remove dead code.
19583
19584         * class.cs (Property.Emit): More simplification.
19585         (Event.Emit): ditto.
19586
19587         Reworked to have less levels of indentation.
19588
19589 2001-11-08  Ravi Pratap  <ravi@ximian.com>
19590
19591         * class.cs (Property): Emit attributes.
19592
19593         (Field): Ditto.
19594
19595         (Event): Ditto.
19596
19597         (Indexer): Ditto.
19598
19599         (Operator): Ditto.
19600
19601         * enum.cs (Emit): Ditto.
19602
19603         * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
19604         Enums too.
19605
19606         * class.cs (Field, Event, etc.): Move attribute generation into the
19607         Emit method everywhere.
19608
19609         * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
19610         we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
19611         as we had no way of defining nested enums !
19612
19613         * rootcontext.cs : Adjust code accordingly.
19614
19615         * typemanager.cs (AddEnumType): To keep track of enum types separately.
19616
19617 2001-11-07  Ravi Pratap  <ravi@ximian.com>
19618
19619         * expression.cs (EvalConstantExpression): Move into ecore.cs
19620
19621         * enum.cs (Enum): Rename some members and make them public and readonly
19622         according to our convention.
19623
19624         * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
19625         nothing else.
19626
19627         * enum.cs (Enum::Define): Use the above instead of TypeAttr.
19628
19629         (Enum::Emit): Write a simple version for now which doesn't try to compute
19630         expressions. I shall modify this to be more robust in just a while.
19631
19632         * class.cs (TypeContainer::Emit): Make sure we include Enums too.
19633
19634         (TypeContainer::CloseType): Create the Enum types too.
19635
19636         * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
19637
19638         * expression.cs (EvalConstantExpression): Get rid of completely.
19639
19640         * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
19641         user-defined values and other cases.
19642
19643         (IsValidEnumLiteral): Helper function.
19644
19645         * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing 
19646         out there in the case we had a literal FieldExpr.
19647
19648         (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
19649
19650         (Literalize): Revamp a bit to take two arguments.
19651
19652         (EnumLiteral): New class which derives from Literal to wrap enum literals.
19653
19654 2001-11-06  Ravi Pratap  <ravi@ximian.com>
19655
19656         * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
19657
19658         * expression.cs (ArrayCreation::ValidateInitializers): Implement.
19659
19660         (Resolve): Use the above to ensure we have proper initializers.
19661
19662 2001-11-05  Ravi Pratap  <ravi@ximian.com>
19663
19664         * expression.cs (Expression::EvalConstantExpression): New method to 
19665         evaluate constant expressions.
19666
19667         * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
19668
19669 2001-11-07  Miguel de Icaza  <miguel@ximian.com>
19670
19671         * expression.cs (ArrayCreation.Emit): Some bits to initialize data
19672         in an array.
19673
19674         (Binary.ResolveOperator): Handle operator != (object a, object b)
19675         and operator == (object a, object b);
19676
19677         (Binary.DoNumericPromotions): Indicate whether the numeric
19678         promotion was possible.
19679
19680         (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
19681         Implement.  
19682
19683         Made the ArrayAccess implement interface IAssignMethod instead of
19684         IStackStore as the order in which arguments are passed reflects
19685         this.
19686
19687         * assign.cs: Instead of using expr.ExprClass to select the way of
19688         assinging, probe for the IStackStore/IAssignMethod interfaces.
19689
19690         * typemanager.cs: Load InitializeArray definition.
19691
19692         * rootcontext.cs (RootContext.MakeStaticData): Used to define
19693         static data that can be used to initialize arrays. 
19694
19695 2001-11-05  Miguel de Icaza  <miguel@ximian.com>
19696
19697         * expression.cs: Handle operator== and operator!= for booleans.
19698
19699         (Conditioal.Reduce): Implement reducer for the ?: operator.
19700
19701         (Conditional.Resolve): Implement dead code elimination.
19702
19703         (Binary.Resolve): Catch string literals and return a new
19704         concatenated string.
19705
19706         (Unary.Reduce): Implement reduction of unary expressions.
19707
19708         * ecore.cs: Split out the expression core handling here.
19709
19710         (Expression.Reduce): New method used to perform constant folding
19711         and CSE.  This is needed to support constant-expressions. 
19712
19713         * statement.cs (Statement.EmitBoolExpression): Pass true and false
19714         targets, and optimize for !x.
19715
19716 2001-11-04  Ravi Pratap  <ravi@ximian.com>
19717
19718         * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
19719         of an attribute gives us a CustomAttributeBuilder which we use accordingly to
19720         set custom atttributes.
19721
19722         * literal.cs (Literal::GetValue): New abstract method to return the actual
19723         value of the literal, cast as an object.
19724
19725         (*Literal): Implement GetValue method.
19726
19727         * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
19728         expressions to the arraylist but objects of type Argument.
19729
19730         * class.cs (TypeContainer::Emit): Emit our attributes too.
19731
19732         (Method::Emit, Constructor::Emit): Ditto.
19733
19734         * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
19735         to be ignoring earlier.
19736
19737 2001-11-03  Ravi Pratap  <ravi@ximian.com>
19738
19739         * attribute.cs (AttributeSection::Define): Implement to do the business
19740         of constructing a CustomAttributeBuilder.
19741
19742         (Attribute): New trivial class. Increases readability of code.  
19743
19744         * cs-parser.jay : Update accordingly.
19745
19746         (positional_argument_list, named_argument_list, named_argument): New rules
19747
19748         (attribute_arguments): Use the above so that we are more correct.
19749
19750 2001-11-02  Ravi Pratap  <ravi@ximian.com>
19751
19752         * expression.cs (Invocation::IsParamsMethodApplicable): Implement
19753         to perform all checks for a method with a params parameter.
19754
19755         (Invocation::OverloadResolve): Update to use the above method and therefore
19756         cope correctly with params method invocations.
19757
19758         * support.cs (InternalParameters::ParameterDesc): Provide a desc for 
19759         params too.
19760
19761         * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
19762         constructors in our parent too because we can't afford to miss out on 
19763         protected ones ;-)
19764
19765         * attribute.cs (AttributeSection): New name for the class Attribute
19766
19767         Other trivial changes to improve readability.
19768
19769         * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
19770         use the new class names.
19771
19772 2001-11-01  Ravi Pratap  <ravi@ximian.com>
19773
19774         * class.cs (Method::Define): Complete definition for params types too
19775
19776         (Indexer::Define): Ditto.
19777
19778         * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
19779         Cope everywhere with a request for info about the array parameter.
19780
19781 2001-11-01  Ravi Pratap  <ravi@ximian.com>
19782
19783         * tree.cs (RecordNamespace): Fix up to check for the correct key.
19784
19785         * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in 
19786         local_variable_type to extract the string corresponding to the type.
19787
19788         (local_variable_type): Fixup the action to use the new helper method.
19789
19790         * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to 
19791         go.
19792
19793         * expression.cs : Clean out code which uses the above.
19794
19795 2001-10-31  Ravi Pratap  <ravi@ximian.com>
19796
19797         * typemanager.cs (RegisterMethod): Check if we already have an existing key
19798         and bale out if necessary by returning a false.
19799
19800         (RegisterProperty): Ditto.
19801
19802         * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
19803         and print out appropriate error messages.
19804
19805         * interface.cs (everywhere): Ditto.
19806
19807         * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
19808         location to constructor.
19809
19810         * class.cs (Property, Event, Indexer): Update accordingly.
19811
19812         * ../errors/cs111.cs : Added.
19813
19814         * expression.cs (Invocation::IsApplicable): New static method to determine applicability
19815         of a method, as laid down by the spec.
19816
19817         (Invocation::OverloadResolve): Use the above method.
19818
19819 2001-10-31  Ravi Pratap  <ravi@ximian.com>
19820
19821         * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
19822         now take a TypeContainer and a Parameters object.
19823
19824         (ParameterData): Modify return type of ParameterModifier method to be 
19825         Parameter.Modifier and not a string.
19826
19827         (ReflectionParameters, InternalParameters): Update accordingly.
19828
19829         * expression.cs (Argument::GetParameterModifier): Same here.
19830
19831         * support.cs (InternalParameters::ParameterType): Find a better way of determining
19832         if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
19833         symbol in it at all so maybe this is only for now.
19834
19835 2001-10-30  Ravi Pratap  <ravi@ximian.com>
19836
19837         * support.cs (InternalParameters): Constructor now takes an extra argument 
19838         which is the actual Parameters class.
19839
19840         (ParameterDesc): Update to provide info on ref/out modifiers.
19841
19842         * class.cs (everywhere): Update call to InternalParameters to pass in
19843         the second argument too.
19844
19845         * support.cs (ParameterData): Add ParameterModifier, which is a method 
19846         to return the modifier info [ref/out etc]
19847
19848         (InternalParameters, ReflectionParameters): Implement the above.
19849
19850         * expression.cs (Argument::ParameterModifier): Similar function to return
19851         info about the argument's modifiers.
19852
19853         (Invocation::OverloadResolve): Update to take into account matching modifiers 
19854         too.
19855
19856         * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
19857         a new SetFormalParameters object which we pass to InternalParameters.
19858
19859 2001-10-30  Ravi Pratap  <ravi@ximian.com>
19860
19861         * expression.cs (NewArray): Merge into the ArrayCreation class.
19862
19863 2001-10-29  Ravi Pratap  <ravi@ximian.com>
19864
19865         * expression.cs (NewArray): Merge classes NewBuiltinArray and 
19866         NewUserdefinedArray into one as there wasn't much of a use in having
19867         two separate ones.
19868
19869         * expression.cs (Argument): Change field's name to ArgType from Type.
19870
19871         (Type): New readonly property which returns the proper type, taking into 
19872         account ref/out modifiers.
19873
19874         (everywhere): Adjust code accordingly for the above.
19875
19876         * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
19877         whether we are emitting for a ref or out parameter.
19878
19879         * expression.cs (Argument::Emit): Use the above field to set the state.
19880
19881         (LocalVariableReference::Emit): Update to honour the flag and emit the
19882         right stuff.
19883
19884         * parameter.cs (Attributes): Set the correct flags for ref parameters.
19885
19886         * expression.cs (Argument::FullDesc): New function to provide a full desc.
19887
19888         * support.cs (ParameterData): Add method ParameterDesc to the interface.
19889
19890         (ReflectionParameters, InternalParameters): Implement the above method.
19891
19892         * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
19893         reporting errors.
19894
19895         (Invocation::FullMethodDesc): Ditto. 
19896
19897 2001-10-29  Miguel de Icaza  <miguel@ximian.com>
19898
19899         * cs-parser.jay: Add extra production for the second form of array
19900         creation. 
19901
19902         * expression.cs (ArrayCreation): Update to reflect the above
19903         change. 
19904
19905         * Small changes to prepare for Array initialization.
19906
19907 2001-10-28  Miguel de Icaza  <miguel@ximian.com>
19908
19909         * typemanager.cs (ImplementsInterface): interface might be null;
19910         Deal with this problem;
19911
19912         Also, we do store negative hits on the cache (null values), so use
19913         this instead of calling t.GetInterfaces on the type everytime.
19914
19915 2001-10-28  Ravi Pratap  <ravi@ximian.com>
19916
19917         * typemanager.cs (IsBuiltinType): New method to help determine the same.
19918
19919         * expression.cs (New::DoResolve): Get rid of array creation code and instead
19920         split functionality out into different classes.
19921
19922         (New::FormArrayType): Move into NewBuiltinArray.
19923
19924         (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
19925         quite useless.
19926
19927         (NewBuiltinArray): New class to handle creation of built-in arrays.
19928
19929         (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
19930         account creation of one-dimensional arrays.
19931
19932         (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
19933
19934         (NewUserdefinedArray::DoResolve): Implement.
19935
19936         * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
19937
19938         * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
19939         we maintain inside the TypeManager. This is necessary to perform lookups on the
19940         module builder.
19941
19942         (LookupType): Update to perform GetType on the module builders too.     
19943
19944         * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
19945
19946         * exprssion.cs (NewUserdefinedArray::Emit): Implement.
19947
19948 2001-10-23  Ravi Pratap  <ravi@ximian.com>
19949
19950         * expression.cs (New::DoResolve): Implement guts of array creation.
19951
19952         (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
19953
19954 2001-10-27  Miguel de Icaza  <miguel@ximian.com>
19955
19956         * expression.cs: Fix bug I introduced lsat night that broke
19957         Delegates. 
19958
19959         (Expression.Resolve): Report a 246 error (can not resolve name)
19960         if we find a SimpleName in the stream.
19961
19962         (Expression.ResolveLValue): Ditto.
19963
19964         (Expression.ResolveWithSimpleName): This function is a variant of
19965         ResolveName, this one allows SimpleNames to be returned without a
19966         warning.  The only consumer of SimpleNames is MemberAccess
19967
19968 2001-10-26  Miguel de Icaza  <miguel@ximian.com>
19969
19970         * expression.cs (Invocation::DoResolve): Catch SimpleNames that
19971         might arrive here.  I have my doubts that this is correct.
19972
19973         * statement.cs (Lock): Implement lock statement.
19974
19975         * cs-parser.jay: Small fixes to support `lock' and `using'
19976
19977         * cs-tokenizer.cs: Remove extra space
19978
19979         * driver.cs: New flag --checked, allows to turn on integer math
19980         checking. 
19981
19982         * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
19983         Threading.Monitor.Exit 
19984
19985 2001-10-23  Miguel de Icaza  <miguel@ximian.com>
19986
19987         * expression.cs (IndexerAccess::DoResolveLValue): Set the
19988         Expression Class to be IndexerAccess.
19989
19990         Notice that Indexer::DoResolve sets the eclass to Value.
19991
19992 2001-10-22  Miguel de Icaza  <miguel@ximian.com>
19993
19994         * class.cs (TypeContainer::Emit): Emit code for indexers.
19995
19996         * assign.cs (IAssignMethod): New interface implemented by Indexers
19997         and Properties for handling assignment.
19998
19999         (Assign::Emit): Simplify and reuse code. 
20000
20001         * expression.cs (IndexerAccess, PropertyExpr): Implement
20002         IAssignMethod, clean up old code. 
20003
20004 2001-10-22  Ravi Pratap  <ravi@ximian.com>
20005
20006         * typemanager.cs (ImplementsInterface): New method to determine if a type
20007         implements a given interface. Provides a nice cache too.
20008
20009         * expression.cs (ImplicitReferenceConversion): Update checks to use the above
20010         method.
20011
20012         (ConvertReferenceExplicit): Ditto.
20013
20014         * delegate.cs (Delegate::Populate): Update to define the parameters on the 
20015         various methods, with correct names etc.
20016
20017         * class.cs (Operator::OpType): New members Operator.UnaryPlus and 
20018         Operator.UnaryNegation.
20019
20020         * cs-parser.jay (operator_declarator): Be a little clever in the case where
20021         we have a unary plus or minus operator.
20022
20023         * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and 
20024         UnaryMinus.
20025
20026         * everywhere : update accordingly.
20027
20028         * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
20029         respectively.
20030
20031         * class.cs (Method::Define): For the case where we are implementing a method
20032         inherited from an interface, we need to set the MethodAttributes.Final flag too. 
20033         Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
20034
20035 2001-10-21  Ravi Pratap  <ravi@ximian.com>
20036
20037         * interface.cs (FindMembers): Implement to work around S.R.E
20038         lameness.
20039
20040         * typemanager.cs (IsInterfaceType): Implement.
20041
20042         (FindMembers): Update to handle interface types too.
20043
20044         * expression.cs (ImplicitReferenceConversion): Re-write bits which
20045         use IsAssignableFrom as that is not correct - it doesn't work.
20046
20047         * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
20048         and accordingly override EmitStatement.
20049
20050         * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
20051         using the correct logic :-)
20052
20053 2001-10-19  Ravi Pratap  <ravi@ximian.com>
20054
20055         * ../errors/cs-11.cs : Add to demonstrate error -11 
20056
20057 2001-10-17  Miguel de Icaza  <miguel@ximian.com>
20058
20059         * assign.cs (Assign::Resolve): Resolve right hand side first, and
20060         then pass this as a hint to ResolveLValue.
20061
20062         * expression.cs (FieldExpr): Add Location information
20063
20064         (FieldExpr::LValueResolve): Report assignment to readonly
20065         variable. 
20066
20067         (Expression::ExprClassFromMemberInfo): Pass location information.
20068
20069         (Expression::ResolveLValue): Add new method that resolves an
20070         LValue. 
20071
20072         (Expression::DoResolveLValue): Default invocation calls
20073         DoResolve. 
20074
20075         (Indexers): New class used to keep track of indexers in a given
20076         Type. 
20077
20078         (IStackStore): Renamed from LValue, as it did not really describe
20079         what this did.  Also ResolveLValue is gone from this interface and
20080         now is part of Expression.
20081
20082         (ElementAccess): Depending on the element access type
20083
20084         * typemanager.cs: Add `indexer_name_type' as a Core type
20085         (System.Runtime.CompilerServices.IndexerNameAttribute)
20086
20087         * statement.cs (Goto): Take a location.
20088
20089 2001-10-18  Ravi Pratap  <ravi@ximian.com>
20090
20091         * delegate.cs (Delegate::VerifyDelegate): New method to verify
20092         if two delegates are compatible.
20093
20094         (NewDelegate::DoResolve): Update to take care of the case when
20095         we instantiate a delegate from another delegate.
20096
20097         * typemanager.cs (FindMembers): Don't even try to look up members
20098         of Delegate types for now.
20099
20100 2001-10-18  Ravi Pratap  <ravi@ximian.com>
20101
20102         * delegate.cs (NewDelegate): New class to take care of delegate
20103         instantiation.
20104
20105         * expression.cs (New): Split the delegate related code out into 
20106         the NewDelegate class.
20107
20108         * delegate.cs (DelegateInvocation): New class to handle delegate 
20109         invocation.
20110
20111         * expression.cs (Invocation): Split out delegate related code into
20112         the DelegateInvocation class.
20113
20114 2001-10-17  Ravi Pratap  <ravi@ximian.com>
20115
20116         * expression.cs (New::DoResolve): Implement delegate creation fully
20117         and according to the spec.
20118
20119         (New::DoEmit): Update to handle delegates differently.
20120
20121         (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
20122         because of which we were printing out arguments in reverse order !
20123
20124         * delegate.cs (VerifyMethod): Implement to check if the given method
20125         matches the delegate.
20126
20127         (FullDelegateDesc): Implement.
20128
20129         (VerifyApplicability): Implement.
20130
20131         * expression.cs (Invocation::DoResolve): Update to accordingly handle
20132         delegate invocations too.
20133
20134         (Invocation::Emit): Ditto.
20135
20136         * ../errors/cs1593.cs : Added.
20137
20138         * ../errors/cs1594.cs : Added.
20139
20140         * delegate.cs (InstanceExpression, TargetMethod): New properties.
20141
20142 2001-10-16  Ravi Pratap  <ravi@ximian.com>
20143
20144         * typemanager.cs (intptr_type): Core type for System.IntPtr
20145
20146         (InitCoreTypes): Update for the same.
20147
20148         (iasyncresult_type, asynccallback_type): Ditto.
20149
20150         * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
20151         correct.
20152
20153         * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
20154         too.
20155
20156         * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
20157         the builders for the 4 members of a delegate type :-)
20158
20159         (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
20160         type.
20161
20162         * expression.cs (New::DoResolve): Implement guts for delegate creation.
20163
20164         * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
20165
20166 2001-10-15  Miguel de Icaza  <miguel@ximian.com>
20167
20168         * statement.cs (Break::Emit): Implement.   
20169         (Continue::Emit): Implement.
20170
20171         (For::Emit): Track old being/end loops;  Set Begin loop, ack end loop
20172         (While::Emit): Track old being/end loops;  Set Begin loop, ack end loop
20173         (Do::Emit): Track old being/end loops;  Set Begin loop, ack end loop
20174         (Foreach::Emit): Track old being/end loops;  Set Begin loop, ack
20175         end loop
20176
20177         * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
20178         properties that track the label for the current loop (begin of the
20179         loop and end of the loop).
20180
20181 2001-10-15  Ravi Pratap  <ravi@ximian.com>
20182
20183         * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
20184         use of emitting anything at all.
20185
20186         * class.cs, rootcontext.cs : Get rid of calls to the same.
20187
20188         * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
20189
20190         (Populate): Define the constructor correctly and set the implementation
20191         attributes.
20192
20193         * typemanager.cs (delegate_types): New hashtable to hold delegates that
20194         have been defined.
20195
20196         (AddDelegateType): Implement.
20197
20198         (IsDelegateType): Implement helper method.
20199
20200         * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
20201
20202         * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
20203         and accordingly handle it.
20204
20205         * delegate.cs (Populate): Take TypeContainer argument.
20206         Implement bits to define the Invoke method. However, I still haven't figured out
20207         how to take care of the native int bit :-(
20208
20209         * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-) 
20210         Qualify the name of the delegate, not its return type !
20211
20212         * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
20213         conversion.
20214
20215         (StandardConversionExists): Checking for array types turns out to be recursive.
20216
20217         (ConvertReferenceExplicit): Implement array conversion.
20218
20219         (ExplicitReferenceConversionExists): New method to determine precisely that :-)
20220
20221 2001-10-12  Ravi Pratap  <ravi@ximian.com>
20222
20223         * cs-parser.jay (delegate_declaration): Store the fully qualified
20224         name as it is a type declaration.
20225
20226         * delegate.cs (ReturnType, Name): Rename members to these. Make them 
20227         readonly.
20228
20229         (DefineDelegate): Renamed from Define. Does the same thing essentially,
20230         as TypeContainer::DefineType.
20231
20232         (Populate): Method in which all the definition of the various methods (Invoke)
20233         etc is done.
20234
20235         (Emit): Emit any code, if necessary. I am not sure about this really, but let's
20236         see.
20237
20238         (CloseDelegate): Finally creates the delegate.
20239
20240         * class.cs (TypeContainer::DefineType): Update to define delegates.
20241         (Populate, Emit and CloseType): Do the same thing here too.
20242
20243         * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
20244         delegates in all these operations.
20245
20246 2001-10-14  Miguel de Icaza  <miguel@ximian.com>
20247
20248         * expression.cs: LocalTemporary: a new expression used to
20249         reference a temporary that has been created.
20250
20251         * assign.cs: Handle PropertyAccess back here, so that we can
20252         provide the proper semantic access to properties.
20253
20254         * expression.cs (Expression::ConvertReferenceExplicit): Implement
20255         a few more explicit conversions. 
20256
20257         * modifiers.cs: `NEW' modifier maps to HideBySig.
20258
20259         * expression.cs (PropertyExpr): Make this into an
20260         ExpressionStatement, and support the EmitStatement code path. 
20261
20262         Perform get/set error checking, clean up the interface.
20263
20264         * assign.cs: recognize PropertyExprs as targets, and if so, turn
20265         them into toplevel access objects.
20266
20267 2001-10-12  Miguel de Icaza  <miguel@ximian.com>
20268
20269         * expression.cs: PropertyExpr::PropertyExpr: use work around the
20270         SRE.
20271
20272         * typemanager.cs: Keep track here of our PropertyBuilders again to
20273         work around lameness in SRE.
20274
20275 2001-10-11  Miguel de Icaza  <miguel@ximian.com>
20276
20277         * expression.cs (LValue::LValueResolve): New method in the
20278         interface, used to perform a second resolution pass for LValues. 
20279
20280         (This::DoResolve): Catch the use of this in static methods.
20281
20282         (This::LValueResolve): Implement.
20283
20284         (This::Store): Remove warning, assigning to `this' in structures
20285         is 
20286
20287         (Invocation::Emit): Deal with invocation of
20288         methods on value types.  We need to pass the address to structure
20289         methods rather than the object itself.  (The equivalent code to
20290         emit "this" for structures leaves the entire structure on the
20291         stack instead of a pointer to it). 
20292
20293         (ParameterReference::DoResolve): Compute the real index for the
20294         argument based on whether the method takes or not a `this' pointer
20295         (ie, the method is static).
20296
20297         * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
20298         value types returned from functions when we need to invoke a
20299         method on the sturcture.
20300
20301
20302 2001-10-11  Ravi Pratap  <ravi@ximian.com>
20303
20304         * class.cs (TypeContainer::DefineType): Method to actually do the business of
20305         defining the type in the Modulebuilder or Typebuilder. This is to take
20306         care of nested types which need to be defined on the TypeBuilder using
20307         DefineNestedMethod.
20308
20309         (TypeContainer::GetClassBases): Implement. Essentially the code from the 
20310         methods in RootContext, only ported to be part of TypeContainer.
20311
20312         (TypeContainer::GetInterfaceOrClass): Ditto.
20313
20314         (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
20315
20316         * interface.cs (Interface::DefineInterface): New method. Does exactly
20317         what RootContext.CreateInterface did earlier, only it takes care of nested types 
20318         too.
20319
20320         (Interface::GetInterfaces): Move from RootContext here and port.
20321
20322         (Interface::GetInterfaceByName): Same here.
20323
20324         * rootcontext.cs (ResolveTree): Re-write.
20325
20326         (PopulateTypes): Re-write.
20327
20328         * class.cs (TypeContainer::Populate): Populate nested types too.
20329         (TypeContainer::Emit): Emit nested members too.
20330
20331         * typemanager.cs (AddUserType): Do not make use of the FullName property,
20332         instead just use the name argument passed in as it is already fully
20333         qualified.
20334
20335         (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
20336         to TypeContainer mapping to see if a type is user-defined.
20337
20338         * class.cs (TypeContainer::CloseType): Implement. 
20339
20340         (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
20341         the default constructor.
20342
20343         (TypeContainer::Populate): Fix minor bug which led to creating default constructors
20344         twice.
20345
20346         (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
20347
20348         * interface.cs (CloseType): Create the type here.
20349
20350         * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
20351         the hierarchy.
20352
20353         Remove all the methods which are now in TypeContainer.
20354
20355 2001-10-10  Ravi Pratap  <ravi@ximian.com>
20356
20357         * delegate.cs (Define): Re-write bits to define the delegate
20358         correctly.
20359
20360 2001-10-10  Miguel de Icaza  <miguel@ximian.com>
20361
20362         * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
20363
20364         * expression.cs (ImplicitReferenceConversion): handle null as well
20365         as a source to convert to any reference type.
20366
20367         * statement.cs (Return): Perform any implicit conversions to
20368         expected return type.  
20369
20370         Validate use of return statement.  
20371
20372         * codegen.cs (EmitContext): Pass the expected return type here.
20373
20374         * class.cs (Method, Constructor, Property): Pass expected return
20375         type to EmitContext.
20376
20377 2001-10-09  Miguel de Icaza  <miguel@ximian.com>
20378
20379         * expression.cs: Make DoResolve take an EmitContext instead of a
20380         TypeContainer.
20381
20382         Replaced `l' and `location' for `loc', for consistency.
20383
20384         (Error, Warning): Remove unneeded Tc argument.
20385
20386         * assign.cs, literal.cs, constant.cs: Update to new calling
20387         convention. 
20388
20389         * codegen.cs: EmitContext now contains a flag indicating whether
20390         code is being generated in a static method or not.
20391
20392         * cs-parser.jay: DecomposeQI, new function that replaces the old
20393         QualifiedIdentifier.  Now we always decompose the assembled
20394         strings from qualified_identifier productions into a group of
20395         memberaccesses.
20396
20397 2001-10-08  Miguel de Icaza  <miguel@ximian.com>
20398
20399         * rootcontext.cs: Deal with field-less struct types correctly now
20400         by passing the size option to Define Type.
20401
20402         * class.cs: Removed hack that created one static field. 
20403
20404 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
20405
20406         * statement.cs: Moved most of the code generation here. 
20407
20408 2001-10-09  Ravi Pratap  <ravi@ximian.com>
20409
20410         * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
20411         seem very right.
20412
20413         (ElementAccess): Remove useless bits for now - keep checks as the spec
20414         says.
20415
20416 2001-10-08  Ravi Pratap  <ravi@ximian.com>
20417
20418         * expression.cs (ElementAccess::DoResolve): Remove my crap code
20419         and start performing checks according to the spec.
20420
20421 2001-10-07  Ravi Pratap  <ravi@ximian.com>
20422
20423         * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
20424         rank_specifiers instead.
20425
20426         (rank_specifiers): Change the order in which the rank specifiers are stored
20427
20428         (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
20429
20430         * expression.cs (ElementAccess): Implement the LValue interface too.
20431
20432 2001-10-06  Ravi Pratap  <ravi@ximian.com>
20433
20434         * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
20435         except that user defined conversions are not included.
20436
20437         (UserDefinedConversion): Update to use the ConvertExplicitStandard to 
20438         perform the conversion of the return type, if necessary.
20439
20440         (New::DoResolve): Check whether we are creating an array or an object
20441         and accordingly do the needful.
20442
20443         (New::Emit): Same here.
20444
20445         (New::DoResolve): Implement guts of array creation.
20446
20447         (New::FormLookupType): Helper function.
20448
20449 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
20450
20451         * codegen.cs: Removed most of the code generation here, and move the
20452         corresponding code generation bits to the statement classes. 
20453
20454         Added support for try/catch/finalize and throw.
20455
20456         * cs-parser.jay: Added support for try/catch/finalize.
20457
20458         * class.cs: Catch static methods having the flags override,
20459         virtual or abstract.
20460
20461         * expression.cs (UserCast): This user cast was not really doing
20462         what it was supposed to do.  Which is to be born in fully resolved
20463         state.  Parts of the resolution were being performed at Emit time! 
20464
20465         Fixed this code.
20466
20467 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
20468
20469         * expression.cs: Implicity convert the result from UserCast.
20470
20471 2001-10-05  Ravi Pratap  <ravi@ximian.com>
20472
20473         * expression.cs (Expression::FindMostEncompassingType): Fix bug which
20474         prevented it from working correctly. 
20475
20476         (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
20477         merely ConvertImplicit.
20478
20479 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
20480
20481         * typemanager.cs: Make the LookupTypeContainer function static,
20482         and not per-instance.  
20483
20484         * class.cs: Make static FindMembers (the one that takes a Type
20485         argument). 
20486
20487         * codegen.cs: Add EmitForeach here.
20488
20489         * cs-parser.jay: Make foreach a toplevel object instead of the
20490         inline expansion, as we need to perform semantic analysis on it. 
20491
20492 2001-10-05  Ravi Pratap  <ravi@ximian.com>
20493
20494         * expression.cs (Expression::ImplicitUserConversion): Rename to
20495         UserDefinedConversion.
20496
20497         (Expression::UserDefinedConversion): Take an extra argument specifying 
20498         whether we look for explicit user conversions too.
20499
20500         (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
20501
20502         (UserDefinedConversion): Incorporate support for user defined explicit conversions.
20503
20504         (ExplicitUserConversion): Make it a call to UserDefinedConversion
20505         with the appropriate arguments.
20506
20507         * cs-parser.jay (cast_expression): Record location too.
20508
20509         * expression.cs (Cast): Record location info.
20510
20511         (Expression::ConvertExplicit): Take location argument.
20512
20513         (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
20514         to determine if we are doing explicit conversions.
20515
20516         (UserCast::Emit): Update accordingly.
20517
20518         (Expression::ConvertExplicit): Report an error if everything fails.
20519
20520         * ../errors/cs0030.cs : Add.
20521
20522 2001-10-04  Miguel de Icaza  <miguel@ximian.com>
20523
20524         * modifiers.cs: If the ABSTRACT keyword is present, also set the
20525         virtual and newslot bits. 
20526
20527         * class.cs (TypeContainer::RegisterRequiredImplementations):
20528         Record methods we need.
20529
20530         (TypeContainer::MakeKey): Helper function to make keys for
20531         MethodBases, since the Methodbase key is useless.
20532
20533         (TypeContainer::Populate): Call RegisterRequiredImplementations
20534         before defining the methods.   
20535
20536         Create a mapping for method_builders_to_methods ahead of time
20537         instead of inside a tight loop.
20538
20539         (::RequireMethods):  Accept an object as the data to set into the
20540         hashtable so we can report interface vs abstract method mismatch.
20541
20542 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
20543
20544         * report.cs: Make all of it static.
20545
20546         * rootcontext.cs: Drop object_type and value_type computations, as
20547         we have those in the TypeManager anyways.
20548
20549         Drop report instance variable too, now it is a global.
20550
20551         * driver.cs: Use try/catch on command line handling.
20552
20553         Add --probe option to debug the error reporting system with a test
20554         suite. 
20555
20556         * report.cs: Add support for exiting program when a probe
20557         condition is reached.
20558
20559 2001-10-03  Ravi Pratap  <ravi@ximian.com>
20560
20561         * expression.cs (Binary::DoNumericPromotions): Fix the case when
20562         we do a forcible conversion regardless of type, to check if 
20563         ForceConversion returns a null.
20564
20565         (Binary::error19): Use location to report error.
20566
20567         (Unary::error23): Use location here too.
20568
20569         * ../errors/cs0019.cs : Check in.
20570
20571         * ../errors/cs0023.cs : Check in.
20572
20573         * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
20574         case of a non-null MethodInfo object with a length of 0 !
20575
20576         (Binary::ResolveOperator): Flag error if overload resolution fails to find
20577         an applicable member - according to the spec :-)
20578         Also fix logic to find members in base types.
20579
20580         (Unary::ResolveOperator): Same here.
20581
20582         (Unary::report23): Change name to error23 and make first argument a TypeContainer
20583         as I was getting thoroughly confused between this and error19 :-)
20584
20585         * expression.cs (Expression::ImplicitUserConversion): Re-write fully
20586         (::FindMostEncompassedType): Implement.
20587         (::FindMostEncompassingType): Implement.
20588         (::StandardConversionExists): Implement.
20589
20590         (UserImplicitCast): Re-vamp. We now need info about most specific
20591         source and target types so that we can do the necessary conversions.
20592
20593         (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
20594         mathematical union with no duplicates.
20595
20596 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
20597
20598         * rootcontext.cs (RootContext::PopulateTypes): Populate containers
20599         in order from base classes to child classes, so that we can in
20600         child classes look up in our parent for method names and
20601         attributes (required for handling abstract, virtual, new, override
20602         constructs: we need to instrospect our base class, and if we dont
20603         populate the classes in order, the introspection might be
20604         incorrect.  For example, a method could query its parent before
20605         the parent has any methods and would determine that the parent has
20606         no abstract methods (while it could have had them)).
20607
20608         (RootContext::CreateType): Record the order in which we define the
20609         classes.
20610
20611 2001-10-02  Miguel de Icaza  <miguel@ximian.com>
20612
20613         * class.cs (TypeContainer::Populate): Also method definitions can
20614         fail now, keep track of this.
20615
20616         (TypeContainer::FindMembers): Implement support for
20617         DeclaredOnly/noDeclaredOnly flag.
20618
20619         (Constructor::Emit) Return the ConstructorBuilder.
20620
20621         (Method::Emit) Return the MethodBuilder. 
20622         Check for abstract or virtual methods to be public.
20623
20624         * rootcontext.cs (RootContext::CreateType): Register all the
20625         abstract methods required for the class to be complete and the
20626         interface methods that must be implemented. 
20627
20628         * cs-parser.jay: Report error 501 (method requires body if it is
20629         not marked abstract or extern).
20630
20631         * expression.cs (TypeOf::Emit): Implement.
20632
20633         * typemanager.cs: runtime_handle_type, new global type.
20634
20635         * class.cs (Property::Emit): Generate code for properties.
20636
20637 2001-10-02  Ravi Pratap  <ravi@ximian.com>
20638
20639         * expression.cs (Unary::ResolveOperator): Find operators on base type
20640         too - we now conform exactly to the spec.
20641
20642         (Binary::ResolveOperator): Same here.
20643
20644         * class.cs (Operator::Define): Fix minor quirk in the tests.
20645
20646         * ../errors/cs0215.cs : Added.
20647
20648         * ../errors/cs0556.cs : Added.
20649
20650         * ../errors/cs0555.cs : Added.
20651
20652 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
20653
20654         * cs-tokenizer.cs: Reimplemented Location to be a struct with a
20655         single integer which is really efficient
20656
20657 2001-10-01  Ravi Pratap  <ravi@ximian.com>
20658
20659         *  expression.cs (Expression::ImplicitUserConversion): Use location
20660         even in the case when we are examining True operators.
20661  
20662         * class.cs (Operator::Define): Perform extensive checks to conform
20663         with the rules for operator overloading in the spec.
20664
20665         * expression.cs (Expression::ImplicitReferenceConversion): Implement
20666         some of the other conversions mentioned in the spec.
20667
20668         * typemanager.cs (array_type): New static member for the System.Array built-in
20669         type.
20670
20671         (cloneable_interface): For System.ICloneable interface.
20672
20673         * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
20674         we start resolving the tree and populating types.
20675
20676         * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
20677  
20678 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
20679
20680         * expression.cs (Expression::ExprClassFromMemberInfo,
20681         Expression::Literalize): Create literal expressions from
20682         FieldInfos which are literals.
20683
20684         (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
20685         type casts, because they were wrong.  The test suite in tests
20686         caught these ones.
20687
20688         (ImplicitNumericConversion): ushort to ulong requires a widening
20689         cast. 
20690
20691         Int32 constant to long requires widening cast as well.
20692
20693         * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
20694         for integers because the type on the stack is not i4.
20695
20696 2001-09-30  Miguel de Icaza  <miguel@ximian.com>
20697
20698         * expression.cs (report118): require location argument. 
20699
20700         * parameter.cs: Do not dereference potential null value.
20701
20702         * class.cs: Catch methods that lack the `new' keyword when
20703         overriding a name.  Report warnings when `new' is used without
20704         anything being there to override.
20705
20706         * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
20707
20708         * class.cs: Only add constructor to hashtable if it is non-null
20709         (as now constructors can fail on define).
20710
20711         (TypeManager, Class, Struct): Take location arguments.
20712
20713         Catch field instance initialization in structs as errors.
20714
20715         accepting_filter: a new filter for FindMembers that is static so
20716         that we dont create an instance per invocation.
20717
20718         (Constructor::Define): Catch errors where a struct constructor is
20719         parameterless 
20720
20721         * cs-parser.jay: Pass location information for various new
20722         constructs. 
20723
20724         * delegate.cs (Delegate): take a location argument.
20725
20726         * driver.cs: Do not call EmitCode if there were problesm in the
20727         Definition of the types, as many Builders wont be there. 
20728
20729         * decl.cs (Decl::Decl): Require a location argument.
20730
20731         * cs-tokenizer.cs: Handle properly hex constants that can not fit
20732         into integers, and find the most appropiate integer for it.
20733
20734         * literal.cs: Implement ULongLiteral.
20735
20736         * rootcontext.cs: Provide better information about the location of
20737         failure when CreateType fails.
20738
20739 2001-09-29  Miguel de Icaza  <miguel@ximian.com>
20740
20741         * rootcontext.cs (RootContext::PopulateTypes): Populates structs
20742         as well.
20743
20744         * expression.cs (Binary::CheckShiftArguments): Add missing type
20745         computation.
20746         (Binary::ResolveOperator): Add type to the logical and and logical
20747         or, Bitwise And/Or and Exclusive Or code paths, it was missing
20748         before.
20749
20750         (Binary::DoNumericPromotions): In the case where either argument
20751         is ulong (and most signed types combined with ulong cause an
20752         error) perform implicit integer constant conversions as well.
20753
20754 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
20755
20756         * expression.cs (UserImplicitCast): Method should always be
20757         non-null. 
20758         (Invocation::BetterConversion): Simplified test for IntLiteral.
20759
20760         (Expression::ImplicitNumericConversion): Split this routine out.
20761         Put the code that performs implicit constant integer conversions
20762         here. 
20763
20764         (Expression::Resolve): Become a wrapper around DoResolve so we can
20765         check eclass and type being set after resolve.
20766
20767         (Invocation::Badness): Remove this dead function
20768
20769         (Binary::ResolveOperator): Do not compute the expensive argumnets
20770         unless we have a union for it.
20771
20772         (Probe::Emit): Is needs to do an isinst and then
20773         compare against null.
20774
20775         (::CanConvert): Added Location argument.  If the Location argument
20776         is null (Location.Null), then we do not report errors.  This is
20777         used by the `probe' mechanism of the Explicit conversion.  We do
20778         not want to generate an error for something that the user
20779         explicitly requested to be casted.  But the pipeline for an
20780         explicit cast first tests for potential implicit casts.
20781
20782         So for now, if the Location is null, it means `Probe only' to
20783         avoid adding another argument.   Might have to revise this
20784         strategy later.
20785
20786         (ClassCast): New class used to type cast objects into arbitrary
20787         classes (used in Explicit Reference Conversions).
20788
20789         Implement `as' as well.
20790
20791         Reverted all the patches from Ravi below: they were broken:
20792
20793                 * The use of `level' as a mechanism to stop recursive
20794                   invocations is wrong.  That was there just to catch the
20795                   bug with a strack trace but not as a way of addressing
20796                   the problem.
20797
20798                   To fix the problem we have to *understand* what is going
20799                   on and the interactions and come up with a plan, not
20800                   just get things going.
20801
20802                 * The use of the type conversion cache that I proposed
20803                   last night had an open topic: How does this work across
20804                   protection domains.  A user defined conversion might not
20805                   be public in the location where we are applying the
20806                   conversion, a different conversion might be selected
20807                   (ie, private A->B (better) but public B->A (worse),
20808                   inside A, A->B applies, but outside it, B->A will
20809                   apply).
20810
20811                 * On top of that (ie, even if the above is solved),
20812                   conversions in a cache need to be abstract.  Ie, `To
20813                   convert from an Int to a Short use an OpcodeCast', not
20814                   `To convert from an Int to a Short use the OpcodeCast on
20815                   the variable 5' (which is what this patch was doing).
20816
20817 2001-09-28  Ravi Pratap  <ravi@ximian.com>
20818
20819         * expression.cs (Invocation::ConversionExists): Re-write to use
20820         the conversion cache
20821
20822         (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
20823         cache all conversions done, not just user-defined ones.
20824
20825         (Invocation::BetterConversion): The real culprit. Use ConversionExists
20826         to determine if a conversion exists instead of acutually trying to 
20827         perform the conversion. It's faster too.
20828
20829         (Expression::ConvertExplicit): Modify to use ConversionExists to check
20830         and only then attempt the implicit conversion.
20831
20832 2001-09-28  Ravi Pratap  <ravi@ximian.com>
20833
20834         * expression.cs (ConvertImplicit): Use a cache for conversions
20835         already found. Check level of recursion and bail out if necessary.
20836
20837 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
20838
20839         * typemanager.cs (string_concat_string_string, string_concat_object_object):
20840         Export standard methods that we expect for string operations.
20841
20842         * statement.cs (Block::UsageWarning): Track usage of variables and
20843         report the errors for not used variables.
20844
20845         * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
20846         operator. 
20847
20848 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
20849
20850         * codegen.cs: remove unnneded code 
20851
20852         * expression.cs: Removed BuiltinTypeAccess class
20853
20854         Fix the order in which implicit conversions are
20855         done.  
20856
20857         The previous fixed dropped support for boxed conversions (adding a
20858         test to the test suite now)
20859
20860         (UserImplicitCast::CanConvert): Remove test for source being null,
20861         that code is broken.  We should not feed a null to begin with, if
20862         we do, then we should track the bug where the problem originates
20863         and not try to cover it up here.
20864
20865         Return a resolved expression of type UserImplicitCast on success
20866         rather than true/false.  Ravi: this is what I was talking about,
20867         the pattern is to use a static method as a "constructor" for
20868         objects. 
20869
20870         Also, do not create arguments until the very last minute,
20871         otherwise we always create the arguments even for lookups that
20872         will never be performed. 
20873
20874         (UserImplicitCast::Resolve): Eliminate, objects of type
20875         UserImplicitCast are born in a fully resolved state. 
20876
20877         * typemanager.cs (InitCoreTypes): Init also value_type
20878         (System.ValueType). 
20879
20880         * expression.cs (Cast::Resolve): First resolve the child expression.
20881
20882         (LValue): Add new method AddressOf to be used by
20883         the `&' operator.  
20884
20885         Change the argument of Store to take an EmitContext instead of an
20886         ILGenerator, because things like FieldExpr need to be able to call
20887         their children expression to generate the instance code. 
20888
20889         (Expression::Error, Expression::Warning): Sugar functions for
20890         reporting errors.
20891
20892         (Expression::MemberLookup): Accept a TypeContainer instead of a
20893         Report as the first argument.
20894
20895         (Expression::ResolvePrimary): Killed.  I still want to improve
20896         this as currently the code is just not right.
20897
20898         (Expression::ResolveMemberAccess): Simplify, but it is still
20899         wrong. 
20900
20901         (Unary::Resolve): Catch errors in AddressOf operators.
20902
20903         (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
20904         index to a byte for the short-version, or the compiler will choose
20905         the wrong Emit call, which generates the wrong data.
20906
20907         (ParameterReference::Emit, ::Store): same.
20908
20909         (FieldExpr::AddressOf): Implement.
20910
20911         * typemanager.cs: TypeManager: made public variable instead of
20912         property.
20913
20914         * driver.cs: document --fatal.
20915
20916         * report.cs (ErrorMessage, WarningMessage): new names for the old
20917         Error and Warning classes.
20918
20919         * cs-parser.jay (member_access): Turn built-in access to types
20920         into a normal simplename
20921
20922 2001-09-27  Ravi Pratap  <ravi@ximian.com>
20923
20924         * expression.cs (Invocation::BetterConversion): Fix to cope
20925         with q being null, since this was introducing a bug.
20926
20927         * expression.cs (ConvertImplicit): Do built-in conversions first.
20928
20929 2001-09-27  Ravi Pratap  <ravi@ximian.com>
20930
20931         * expression.cs (UserImplicitCast::Resolve): Fix bug.
20932
20933 2001-09-27  Ravi Pratap  <ravi@ximian.com>
20934
20935         * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
20936         I had introduced long ago (what's new ?).
20937
20938         * expression.cs (UserImplicitCast::CanConvert): Static method to do 
20939         the work of all the checking. 
20940         (ConvertImplicit): Call CanConvert and only then create object if necessary.
20941         (UserImplicitCast::CanConvert, ::Resolve): Re-write.
20942
20943         (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
20944         that is the right way. 
20945
20946         (Invocation::MakeUnionSet): Convenience function to make unions of sets for 
20947         overloading resolution. Use everywhere instead of cutting and pasting code.
20948
20949         (Binary::ResolveOperator): Use MakeUnionSet.
20950
20951         (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when 
20952         we have to convert to bool types. Not complete yet.
20953
20954 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
20955
20956         * typemanager.cs (TypeManager::CSharpName): support ushort.
20957
20958         * expression.cs (Expression::TryImplicitIntConversion): Attempts
20959         to provide an expression that performsn an implicit constant int
20960         conversion (section 6.1.6).
20961         (Expression::ConvertImplicitRequired): Reworked to include
20962         implicit constant expression conversions.
20963
20964         (Expression::ConvertNumericExplicit): Finished.
20965
20966         (Invocation::Emit): If InstanceExpression is null, then it means
20967         that we perform a call on this.
20968
20969 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
20970
20971         * expression.cs (Unary::Emit): Remove some dead code.
20972         (Probe): Implement Resolve and Emit for `is'.
20973         (Expression::ConvertImplicitRequired): Attempt to do constant
20974         expression conversions here.  Maybe should be moved to
20975         ConvertImplicit, but I am not sure.
20976         (Expression::ImplicitLongConstantConversionPossible,
20977         Expression::ImplicitIntConstantConversionPossible): New functions
20978         that tell whether is it possible to apply an implicit constant
20979         expression conversion.
20980
20981         (ConvertNumericExplicit): Started work on explicit numeric
20982         conversions.
20983
20984         * cs-parser.jay: Update operator constants.
20985
20986         * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
20987         (Parameters::GetSignature): Hook up VerifyArgs here.
20988         (Parameters::VerifyArgs): Verifies that no two arguments have the
20989         same name. 
20990
20991         * class.cs (Operator): Update the operator names to reflect the
20992         ones that the spec expects (as we are just stringizing the
20993         operator names).
20994
20995         * expression.cs (Unary::ResolveOperator): Fix bug: Use
20996         MethodInfo's ReturnType instead of LookupMethodByBuilder as the
20997         previous usage did only work for our methods.
20998         (Expression::ConvertImplicit): Handle decimal implicit numeric
20999         conversions as well.
21000         (Expression::InternalTypeConstructor): Used to invoke constructors
21001         on internal types for default promotions.
21002
21003         (Unary::Emit): Implement special handling for the pre/post
21004         increment/decrement for overloaded operators, as they need to have
21005         the same semantics as the other operators.
21006
21007         (Binary::ResolveOperator): ditto.
21008         (Invocation::ConversionExists): ditto.
21009         (UserImplicitCast::Resolve): ditto.
21010
21011 2001-09-26  Ravi Pratap  <ravi@ximian.com>
21012
21013         * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
21014         operator, return after emitting body. Regression tests pass again !
21015
21016         * expression.cs (ConvertImplicit): Take TypeContainer as first argument
21017         (Unary::ForceConversion, Binary::ForceConversion): Ditto.
21018         (Invocation::OverloadResolve): Ditto.
21019         (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
21020
21021         * everywhere : update calls to the above methods accordingly.
21022
21023 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
21024
21025         * assign.cs (Assign): Make it inherit from ExpressionStatement.
21026
21027         * expression.cs (ExpressionStatement): New base class used for
21028         expressions that can appear in statements, so that we can provide
21029         an alternate path to generate expression that do not leave a value
21030         on the stack.
21031
21032         (Expression::Emit, and all the derivatives): We no longer return
21033         whether a value is left on the stack or not.  Every expression
21034         after being emitted leaves a single value on the stack.
21035
21036         * codegen.cs (EmitContext::EmitStatementExpression): Use the
21037         facilties of ExpressionStatement if possible.
21038
21039         * cs-parser.jay: Update statement_expression.
21040
21041 2001-09-25  Miguel de Icaza  <miguel@ximian.com>
21042
21043         * driver.cs: Change the wording of message
21044
21045 2001-09-25  Ravi Pratap  <ravi@ximian.com>
21046
21047         * expression.cs (Binary::ResolveOperator): Had forgottten to set 
21048         the type of the expression to the return type of the method if
21049         we have an overloaded operator match ! The regression tests pass again !
21050         (Unary::ResolveOperator): Ditto.
21051
21052         * expression.cs (Invocation::ConversionExists): Correct the member lookup
21053         to find "op_Implicit", not "implicit" ;-)
21054         (UserImplicitCast): New class to take care of user-defined implicit conversions.
21055         (ConvertImplicit, ForceConversion): Take TypeContainer argument
21056
21057         * everywhere : Correct calls to the above accordingly.
21058
21059         * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
21060         (ConvertImplicit): Do user-defined conversion if it exists.
21061
21062 2001-09-24  Miguel de Icaza  <miguel@ximian.com>
21063
21064         * assign.cs: track location.
21065         (Resolve): Use implicit conversions on assignment.
21066
21067         * literal.cs: Oops.  Not good, Emit of short access values should
21068         pass (Bytes) or the wrong argument will be selected.
21069
21070         * expression.cs (Unary::Emit): Emit code for -expr.
21071
21072         (Unary::ResolveOperator): Handle `Substract' for non-constants
21073         (substract from zero from the non-constants).
21074         Deal with Doubles as well. 
21075
21076         (Expression::ConvertImplicitRequired): New routine that reports an
21077         error if no implicit conversion exists. 
21078
21079         (Invocation::OverloadResolve): Store the converted implicit
21080         expressions if we make them
21081
21082 2001-09-24  Ravi Pratap  <ravi@ximian.com>
21083
21084         * class.cs (ConstructorInitializer): Take a Location argument.
21085         (ConstructorBaseInitializer): Same here.
21086         (ConstructorThisInitializer): Same here.
21087
21088         * cs-parser.jay : Update all calls accordingly.
21089
21090         * expression.cs (Unary, Binary, New): Take location argument.
21091         Update accordingly everywhere.
21092
21093         * cs-parser.jay : Update all calls to the above to take a location
21094         argument.
21095
21096         * class.cs : Ditto.
21097
21098 2001-09-24  Ravi Pratap  <ravi@ximian.com>
21099
21100         * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
21101         (Invocation::BetterConversion): Same here
21102         (Invocation::ConversionExists): Ditto.
21103
21104         (Invocation::ConversionExists): Implement.
21105
21106 2001-09-22  Ravi Pratap  <ravi@ximian.com>
21107
21108         * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
21109         Also take an additional TypeContainer argument.
21110
21111         * All over : Pass in TypeContainer as argument to OverloadResolve.
21112
21113         * typemanager.cs (CSharpName): Update to check for the string type and return
21114         that too.
21115
21116         * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
21117         a given method.
21118
21119 2001-09-21  Ravi Pratap  <ravi@ximian.com>
21120
21121         * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
21122         (Invocation::BetterFunction): Implement.
21123         (Invocation::BetterConversion): Implement.
21124         (Invocation::ConversionExists): Skeleton, no implementation yet.
21125
21126         Okay, things work fine !
21127
21128 2001-09-21  Miguel de Icaza  <miguel@ximian.com>
21129
21130         * typemanager.cs: declare and load enum_type, delegate_type and
21131         void_type. 
21132
21133         * expression.cs (Expression::Emit): Now emit returns a value that
21134         tells whether a value is left on the stack or not.  This strategy
21135         might be reveted tomorrow with a mechanism that would address
21136         multiple assignments.
21137         (Expression::report118): Utility routine to report mismatches on
21138         the ExprClass.
21139
21140         (Unary::Report23): Report impossible type/operator combination
21141         utility function.
21142
21143         (Unary::IsIncrementableNumber): Whether the type can be
21144         incremented or decremented with add.
21145         (Unary::ResolveOperator): Also allow enumerations to be bitwise
21146         complemented. 
21147         (Unary::ResolveOperator): Implement ++, !, ~,
21148
21149         (Invocation::Emit): Deal with new Emit convetion.
21150
21151         * All Expression derivatives: Updated their Emit method to return
21152         whether they leave values on the stack or not.
21153
21154         * codegen.cs (CodeGen::EmitStatement): Pop values left on the
21155         stack for expressions that are statements. 
21156
21157 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
21158
21159         * expression.cs (LValue): New interface.  Must be implemented by
21160         LValue objects.
21161         (LocalVariableReference, ParameterReference, FieldExpr): Implement
21162         LValue interface.
21163
21164         * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
21165         interface for generating code, simplifies the code.
21166
21167 2001-09-20  Ravi Pratap  <ravi@ximian.com>
21168
21169         * expression.cs (everywhere): Comment out return statements in ::Resolve
21170         methods to avoid the warnings.
21171
21172 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
21173
21174         * driver.cs (parse): Report error 2001 if we can not open the
21175         source file.
21176
21177         * expression.cs (SimpleName::ResolveSimpleName): Error if we can
21178         not resolve it.
21179
21180         * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
21181         object. 
21182
21183         * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
21184         otherwise nested blocks end up with the same index.
21185
21186         * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
21187
21188         * expression.cs:  Instead of having FIXMEs in the Resolve
21189         functions, throw exceptions so it is obvious that we are facing a
21190         bug. 
21191
21192         * cs-parser.jay (invocation_expression): Pass Location information.
21193
21194         * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
21195         Use a basename for those routines because .NET does not like paths
21196         on them. 
21197
21198         * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
21199         already defined.
21200
21201 2001-09-19  Miguel de Icaza  <miguel@ximian.com>
21202
21203         * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
21204         are loading the correct data types (throws an exception if not).
21205         (TypeManager::InitCoreTypes): Use CoreLookupType
21206
21207         * expression.cs (Unary::ResolveOperator): return the child
21208         expression for expressions which are just +expr.
21209         (Unary::ResolveOperator): Return negative literals for -LITERAL
21210         expressions (otherwise they are Unary {Literal}).
21211         (Invocation::Badness): Take into account `Implicit constant
21212         expression conversions'.
21213
21214         * literal.cs (LongLiteral): Implement long literal class.
21215         (IntLiteral): export the `Value' of the intliteral. 
21216
21217 2001-09-19  Ravi Pratap  <ravi@ximian.com>
21218
21219         * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
21220
21221         * class.cs (Operator::Define): Change the methodname prefix to 'op_' 
21222         instead of 'Operator'
21223
21224         * expression.cs (Binary::ResolveOperator): Update accordingly.
21225         (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
21226         and 'Minus'
21227
21228         * cs-parser.jay (unary_expression): Update to use the new names.
21229
21230         * gen-treedump.cs (GetUnary): Same here.
21231
21232         * expression.cs (Unary::Resolve): Implement.
21233         (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded 
21234         operators are found instead of making noise ;-)
21235         (Unary::ResolveOperator): New method to do precisely the same thing which
21236         Binary::ResolveOperator does for Binary expressions.
21237         (Unary.method, .Arguments): Add.
21238         (Unary::OperName): Implement.   
21239         (Unary::ForceConversion): Copy and Paste !
21240
21241         * class.cs (Operator::Define): Fix a small bug for the case when we have 
21242         a unary operator.
21243
21244         * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
21245         for the inbuilt operators. Only overloading works for now ;-)
21246
21247 2001-09-18  Miguel de Icaza  <miguel@ximian.com>
21248
21249         * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
21250         UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
21251
21252         * expression.cs (This::Emit): Implement. 
21253         (This::Resolve): Implement.
21254         (TypeOf:Resolve): Implement.
21255         (Expression::ResolveSimpleName): Add an implicit this to instance
21256         field references. 
21257         (MemberAccess::Resolve): Deal with Parameters and Fields. 
21258         Bind instance variable to Field expressions.
21259         (FieldExpr::Instance): New field used to track the expression that
21260         represents the object instance.
21261         (FieldExpr::Resolve): Track potential errors from MemberLookup not
21262         binding 
21263         (FieldExpr::Emit): Implement.
21264
21265         * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
21266         the last instruction contains a return opcode to avoid generating
21267         the last `ret' instruction (this generates correct code, and it is
21268         nice to pass the peverify output).
21269
21270         * class.cs (TypeContainer::EmitFieldInitializers): Implement field
21271         initializer for static and instance variables.
21272         (Constructor::Emit): Allow initializer to be null in the case of
21273         static constructors.  Only emit initializer for instance
21274         constructors. 
21275
21276         (TypeContainer::FindMembers): Return a null array if there are no
21277         matches.
21278
21279         Also fix the code for the MemberTypes.Method branch, as it was not
21280         scanning that for operators (or tried to access null variables before).
21281
21282         * assign.cs (Assign::Emit): Handle instance and static fields. 
21283
21284         * TODO: Updated.
21285
21286         * driver.cs: Stop compilation if there are parse errors.
21287
21288         * cs-parser.jay (constructor_declaration): Provide default base
21289         initializer for non-static constructors.
21290         (constructor_declarator): Do not provide a default base
21291         initializers if none was specified.
21292         Catch the fact that constructors should not have parameters.
21293
21294         * class.cs: Do not emit parent class initializers for static
21295         constructors, that should be flagged as an error.
21296
21297 2001-09-18  Ravi Pratap  <ravi@ximian.com>
21298
21299         * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
21300         Move back code into TypeContainer::Populate.
21301
21302 2001-09-18  Ravi Pratap  <ravi@ximian.com>
21303
21304         * class.cs (TypeContainer::AddConstructor): Fix the check to
21305         compare against Name, not Basename. 
21306         (Operator::OpType): Change Plus and Minus to Add and Subtract.
21307
21308         * cs-parser.jay : Update accordingly.
21309
21310         * class.cs (TypeContainer::FindMembers): For the case where we are searching
21311         for methods, don't forget to look into the operators too.
21312         (RegisterMethodBuilder): Helper method to take care of this for
21313         methods, constructors and operators.
21314         (Operator::Define): Completely revamp.
21315         (Operator.OperatorMethod, MethodName): New fields.
21316         (TypeContainer::Populate): Move the registering of builders into
21317         RegisterMethodBuilder.
21318         (Operator::Emit): Re-write.
21319
21320         * expression.cs (Binary::Emit): Comment out code path to emit method
21321         invocation stuff for the case when we have a user defined operator. I am
21322         just not able to get it right !
21323
21324 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
21325
21326         * expression.cs (Expression::OverloadResolve): Drop TypeContainer
21327         argument. 
21328
21329         (Expression::MemberLookup): Provide a version that allows to
21330         specify the MemberTypes and BindingFlags. 
21331
21332         * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
21333         so it was not fetching variable information from outer blocks.
21334
21335         * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
21336         Beforefieldinit as it was buggy.
21337
21338         * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
21339         that Ravi put here.  
21340
21341         * class.cs (Constructor::Emit): Only emit if block is not null.
21342         (TypeContainer::EmitDefaultConstructor): Removed routine, now we
21343         deal with this by semantically definining it as if the user had
21344         done it.
21345
21346         (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
21347         constructors as we now "emit" them at a higher level.
21348
21349         (TypeContainer::DefineDefaultConstructor): Used to define the
21350         default constructors if none was provided.
21351
21352         (ConstructorInitializer): Add methods Resolve and Emit. 
21353
21354         * expression.cs: Cast to ConstructorInfo instead of MethodInfo
21355
21356 2001-09-17  Ravi Pratap  <ravi@ximian.com>
21357
21358         * class.cs (TypeContainer::EmitDefaultConstructor): Register
21359         the default constructor builder with our hashtable for methodbuilders
21360         to methodcores.
21361
21362         * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
21363         and argument_count is 0 in which case we have a match.
21364         (Binary::ResolveOperator): More null checking and miscellaneous coding
21365         style cleanup.
21366
21367 2001-09-17  Ravi Pratap  <ravi@ximian.com>
21368
21369         * rootcontext.cs (IsNameSpace): Compare against null.
21370
21371         * everywhere : Correct spelling to 'Greater' and to 'Subtract'
21372
21373         * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
21374         and Unary::Operator.
21375
21376         * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
21377         accordingly.
21378
21379         * expression.cs (Binary::method): New member to hold the MethodBase for the case when
21380         we have overloaded operators.
21381         (Binary::ResolveOperator): Implement the part which does the operator overload
21382         resolution.
21383
21384         * class.cs (Operator::Emit): Implement.
21385         (TypeContainer::Emit): Emit the operators we have too.
21386
21387         * expression.cs (Binary::Emit): Update to emit the appropriate code for
21388         the case when we have a user-defined operator.
21389
21390 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
21391
21392         * rootcontext.cs: Fix bug: tree.Namespaces might be null.
21393
21394 2001-09-16  Ravi Pratap  <ravi@ximian.com>
21395
21396         * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
21397         (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
21398         (Constructor::Emit): Implement.
21399         (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
21400         if we have no work to do. 
21401         (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's 
21402         Emit method.
21403
21404         * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
21405         (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
21406
21407         * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
21408         of parent.parent.
21409
21410 2001-09-15  Ravi Pratap  <ravi@ximian.com>
21411
21412         * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
21413         in the source.
21414         (Tree::RecordNamespace): Method to do what the name says ;-)
21415         (Tree::Namespaces): Property to get at the namespaces hashtable.
21416
21417         * cs-parser.jay (namespace_declaration): Call RecordNamespace to 
21418         keep track.
21419
21420         * rootcontext.cs (IsNamespace): Fixed it :-)
21421
21422 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
21423
21424         * class.cs (TypeContainer::FindMembers): Add support for
21425         constructors. 
21426         (MethodCore): New class that encapsulates both the shared aspects
21427         of a Constructor and a Method.  
21428         (Method, Constructor): Factored pieces into MethodCore.
21429
21430         * driver.cs: Added --fatal which makes errors throw exceptions.
21431         Load System assembly as well as part of the standard library.
21432
21433         * report.cs: Allow throwing exceptions on errors for debugging.
21434
21435         * modifiers.cs: Do not use `parent', instead use the real type
21436         container to evaluate permission settings.
21437
21438         * class.cs: Put Ravi's patch back in.  He is right, and we will
21439         have to cope with the
21440
21441 2001-09-14  Ravi Pratap  <ravi@ximian.com>
21442
21443         * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
21444         FamORAssem, not FamANDAssem.
21445
21446 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
21447
21448         * driver.cs: Added --parse option that only parses its input files
21449         and terminates.
21450
21451         * class.cs: Reverted last change from Ravi to IsTopLevel.  That is
21452         incorrect.  IsTopLevel is not used to tell whether an object is
21453         root_types or not (that can be achieved by testing this ==
21454         root_types).  But to see if this is a top-level *class* (not
21455         necessarly our "toplevel" container). 
21456
21457 2001-09-14  Ravi Pratap  <ravi@ximian.com>
21458
21459         * enum.cs (Enum::Define): Modify to call the Lookup method on the
21460         parent instead of a direct call to GetType.
21461
21462 2001-09-14  Ravi Pratap  <ravi@ximian.com>
21463
21464         * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
21465         Modifiers.TypeAttr. This should just be a call to that method.
21466
21467         * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
21468         object so that we can determine if we are top-level or not.
21469
21470         * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the 
21471         TypeContainer too.
21472
21473         * enum.cs (Enum::Define): Ditto.
21474
21475         * modifiers.cs (FieldAttr): Re-write.
21476
21477         * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
21478         (TypeContainer::HaveStaticConstructor): New property to provide access
21479         to precisely that info.
21480
21481         * modifiers.cs (MethodAttr): Re-write.
21482         (EventAttr): Remove altogether as there seems to be no ostensible use for it.
21483
21484         * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
21485         of top-level types as claimed.
21486
21487 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
21488
21489         * expression.cs (MemberLookup): Fruitless attempt to lookup
21490         constructors.  Maybe I need to emit default constructors?  That
21491         might be it (currently .NET emits this for me automatically).
21492         (Invocation::OverloadResolve): Cope with Arguments == null.
21493         (Invocation::EmitArguments): new function, shared by the new
21494         constructor and us.
21495         (Invocation::Emit): Handle static and instance methods.  Emit
21496         proper call instruction for virtual or non-virtual invocations.
21497         (New::Emit): Implement.
21498         (New::Resolve): Implement.
21499         (MemberAccess:Resolve): Implement.
21500         (MethodGroupExpr::InstanceExpression): used conforming to the spec
21501         to track instances.
21502         (FieldExpr::Resolve): Set type.
21503
21504         * support.cs: Handle empty arguments.
21505                 
21506         * cs-parser.jay (CompositeLookup, QualifierIdentifier,
21507         SimpleLookup): Auxiliary routines to help parse a qualifier
21508         identifier.  
21509
21510         Update qualifier_identifier rule.
21511
21512         * codegen.cs: Removed debugging messages.
21513
21514         * class.cs: Make this a global thing, this acts just as a "key" to
21515         objects that we might have around.
21516
21517         (Populate): Only initialize method_builders_to_methods once.
21518
21519         * expression.cs (PropertyExpr): Initialize type from the
21520         PropertyType. 
21521
21522         * codegen.cs (EmitContext::EmitBoolExpression): Use propper
21523         Resolve pattern.  Attempt to implicitly convert value to boolean.
21524         Emit code.
21525
21526         * expression.cs: Set the type for the int32/int32 argument case.
21527         (Binary::ResolveOperator): Set the return type to boolean for
21528         comparission operators
21529
21530         * typemanager.cs: Remove debugging print code.
21531
21532         (Invocation::Resolve): resolve type.
21533
21534         * class.cs: Allocate a MemberInfo of the correct size, as the code
21535         elsewhere depends on the test to reflect the correct contents.
21536
21537         (Method::) Keep track of parameters, due to System.Reflection holes
21538
21539         (TypeContainer::Populate): Keep track of MethodBuilders to Method
21540         mapping here.
21541
21542         (TypeContainer::FindMembers): Use ArrayList and then copy an array
21543         of the exact size and return that.
21544
21545         (Class::LookupMethodByBuilder): New function that maps
21546         MethodBuilders to its methods.  Required to locate the information
21547         on methods because System.Reflection bit us again.
21548
21549         * support.cs: New file, contains an interface ParameterData and
21550         two implementations: ReflectionParameters and InternalParameters
21551         used to access Parameter information.  We will need to grow this
21552         as required.
21553
21554         * expression.cs (Invocation::GetParameterData): implement a cache
21555         and a wrapper around the ParameterData creation for methods. 
21556         (Invocation::OverloadResolve): Use new code.
21557
21558 2001-09-13  Ravi Pratap  <ravi@ximian.com>
21559
21560         * class.cs (TypeContainer::EmitField): Remove and move into 
21561         (Field::Define): here and modify accordingly.
21562         (Field.FieldBuilder): New member.
21563         (TypeContainer::Populate): Update accordingly.
21564         (TypeContainer::FindMembers): Implement.
21565
21566 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
21567
21568         * statement.cs: (VariableInfo::VariableType): New field to be
21569         initialized with the full type once it is resolved. 
21570
21571 2001-09-12  Miguel de Icaza  <miguel@ximian.com>
21572
21573         * parameter.cs (GetParameterInfo): Use a type cache to compute
21574         things only once, and to reuse this information
21575
21576         * expression.cs (LocalVariableReference::Emit): Implement.
21577         (OpcodeCast::Emit): fix.
21578
21579         (ParameterReference::Resolve): Implement.
21580         (ParameterReference::Emit): Implement.
21581
21582         * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
21583         that are expressions need to stay as Expressions.
21584
21585         * typemanager.cs (CSharpName): Returns the C# name of a type if
21586         possible. 
21587
21588         * expression.cs (Expression::ConvertImplicit): New function that
21589         implements implicit type conversions.
21590
21591         (Expression::ImplicitReferenceConversion): Implements implicit
21592         reference conversions.
21593
21594         (EmptyCast): New type for transparent casts.
21595
21596         (OpcodeCast): New type for casts of types that are performed with
21597         a sequence of bytecodes.
21598
21599         (BoxedCast): New type used for casting value types into reference
21600         types.  Emits a box opcode.
21601
21602         (Binary::DoNumericPromotions): Implements numeric promotions of
21603         and computation of the Binary::Type.
21604
21605         (Binary::EmitBranchable): Optimization.
21606
21607         (Binary::Emit): Implement code emission for expressions.
21608
21609         * typemanager.cs (TypeManager): Added two new core types: sbyte
21610         and byte.
21611
21612 2001-09-12  Ravi Pratap  <ravi@ximian.com>
21613
21614         * class.cs (TypeContainer::FindMembers): Method which does exactly
21615         what Type.FindMembers does, only we don't have to use reflection. No
21616         implementation yet.
21617
21618         * typemanager.cs (typecontainers): New hashtable to hold the corresponding
21619         typecontainer objects as we need to get at them.
21620         (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
21621
21622         * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
21623         typecontainer object.
21624
21625         * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
21626         of just a Report object.
21627
21628 2001-09-11  Ravi Pratap  <ravi@ximian.com>
21629
21630         * class.cs (Event::Define): Go back to using the prefixes "add_" and
21631         "remove_"
21632         (TypeContainer::Populate): Now define the delegates of the type too.
21633         (TypeContainer.Delegates): Property to access the list of delegates defined
21634         in the type.
21635
21636         * delegates.cs (Delegate::Define): Implement partially.
21637
21638         * modifiers.cs (TypeAttr): Handle more flags.
21639
21640 2001-09-11  Ravi Pratap  <ravi@ximian.com>
21641
21642         * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
21643         and not <=
21644         (Operator::Define): Re-write logic to get types by using the LookupType method
21645         instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
21646         (Indexer::Define): Ditto.
21647         (Event::Define): Ditto.
21648         (Property::Define): Ditto.
21649
21650 2001-09-10  Ravi Pratap  <ravi@ximian.com>
21651
21652         * class.cs (TypeContainer::Populate): Now define operators too. 
21653         (TypeContainer.Operators): New property to access the list of operators
21654         in a type.
21655         (Operator.OperatorMethodBuilder): New member to hold the method builder
21656         for the operator we are defining.
21657         (Operator::Define): Implement.
21658
21659 2001-09-10  Ravi Pratap  <ravi@ximian.com>
21660
21661         * class.cs (Event::Define): Make the prefixes of the accessor methods
21662         addOn_ and removeOn_ 
21663
21664         * genericparser.cs (GenericParser::error): Overloaded method to handle the case
21665         of the location being passed in too. Ideally, this should go later since all
21666         error reporting should be done through the Report object.
21667
21668         * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
21669         (Populate): Iterate thru the indexers we have and define them too.
21670         (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
21671         for the get and set accessors.
21672         (Indexer::Define): Implement.
21673
21674 2001-09-09  Miguel de Icaza  <miguel@ximian.com>
21675
21676         * expression.cs (Binary::Resolve): Beginning of it.  I scratched
21677         my previous implementation, did not work.
21678
21679         * typemanager.cs: Add a couple of missing types (the longs).
21680
21681         * literal.cs: Use TypeManager.bool_type instead of getting it.
21682
21683         * expression.cs (EventExpr): New kind of expressions.
21684         (Expressio::ExprClassFromMemberInfo): finish
21685
21686 2001-09-08  Miguel de Icaza  <miguel@ximian.com>
21687
21688         * assign.cs: Emit stores to static fields differently.
21689
21690 2001-09-08  Ravi Pratap  <ravi@ximian.com>
21691
21692         * Merge in changes and adjust code to tackle conflicts. Backed out my
21693         code in Assign::Resolve ;-) 
21694
21695 2001-09-08  Ravi Pratap  <ravi@ximian.com>
21696
21697         * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
21698         instead Report.Error and also pass in the location.
21699         (CSharpParser::Lexer): New readonly property to return the reference
21700         to the Tokenizer object.
21701         (declare_local_variables): Use Report.Error with location instead of plain 
21702         old error.
21703         (CheckDef): Ditto.
21704
21705         * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
21706         (Operator.CheckBinaryOperator): Ditto.
21707
21708         * cs-parser.jay (operator_declarator): Update accordingly.
21709
21710         * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
21711         (CheckBinaryOperator): Same here.
21712
21713         * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
21714         on the name without any prefixes of namespace names etc. This is because we
21715         already might have something already fully qualified like 
21716         'System.Console.WriteLine'
21717
21718         * assign.cs (Resolve): Begin implementation. Stuck ;-)
21719
21720 2001-09-07  Ravi Pratap  <ravi@ximian.com>
21721
21722         * cs-tokenizer.cs (location): Return a string which also contains
21723         the file name.
21724
21725         * expression.cs (ElementAccess): New class for expressions of the
21726         type 'element access.'
21727         (BaseAccess): New class for expressions of the type 'base access.'
21728         (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
21729         respectively.
21730
21731         * cs-parser.jay (element_access): Implement action.
21732         (base_access): Implement actions.
21733         (checked_expression, unchecked_expression): Implement.
21734
21735         * cs-parser.jay (local_variable_type): Correct and implement.
21736         (type_suffixes, type_suffix_list, type_suffix): Implement actions.
21737
21738         * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
21739
21740         * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
21741         name and the specifiers.
21742
21743         * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
21744
21745         * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of 
21746         making them all public ;-)
21747
21748         * cs-parser.jay (error): Remove entirely as we have an implementation in the base
21749         class anyways.
21750
21751 2001-09-07  Miguel de Icaza  <miguel@ximian.com>
21752
21753         * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
21754         PropertyExprs.
21755         (FieldExpr, PropertyExprs): New resolved expressions.
21756         (SimpleName::MemberStaticCheck): Perform static checks for access
21757         to non-static fields on static methods. Maybe this should be
21758         generalized for MemberAccesses. 
21759         (SimpleName::ResolveSimpleName): More work on simple name
21760         resolution. 
21761
21762         * cs-parser.jay (primary_expression/qualified_identifier): track
21763         the parameter index.
21764
21765         * codegen.cs (CodeGen::Save): Catch save exception, report error.
21766         (EmitContext::EmitBoolExpression): Chain to expression generation
21767         instead of temporary hack.
21768         (::EmitStatementExpression): Put generic expression code generation.
21769
21770         * assign.cs (Assign::Emit): Implement variable assignments to
21771         local variables, parameters and fields.
21772
21773 2001-09-06  Miguel de Icaza  <miguel@ximian.com>
21774
21775         * statement.cs (Block::GetVariableInfo): New method, returns the
21776         VariableInfo for a variable name in a block.
21777         (Block::GetVariableType): Implement in terms of GetVariableInfo
21778
21779         * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
21780         DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
21781
21782 2001-09-06  Ravi Pratap  <ravi@ximian.com>
21783
21784         * cs-parser.jay (operator_declaration): Continue on my quest : update
21785         to take attributes argument.
21786         (event_declaration): Ditto.
21787         (enum_declaration): Ditto.
21788         (indexer_declaration): Ditto.
21789
21790         * class.cs (Operator::Operator): Update constructor accordingly.
21791         (Event::Event): Ditto.
21792
21793         * delegate.cs (Delegate::Delegate): Same here.
21794
21795         * enum.cs (Enum::Enum): Same here.
21796
21797 2001-09-05  Ravi Pratap  <ravi@ximian.com>
21798
21799         * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
21800
21801         * ../tests/cs0658.cs : New file to demonstrate error 0658.
21802
21803         * attribute.cs (Attributes): New class to encapsulate all attributes which were
21804         being passed around as an arraylist.
21805         (Attributes::AddAttribute): Method to add attribute sections.
21806
21807         * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
21808         (struct_declaration): Update accordingly.
21809         (constant_declaration): Update.
21810         (field_declaration): Update.
21811         (method_header): Update.
21812         (fixed_parameter): Update.
21813         (parameter_array): Ditto.
21814         (property_declaration): Ditto.
21815         (destructor_declaration): Ditto.
21816
21817         * class.cs (Struct::Struct): Update constructors accordingly.
21818         (Class::Class): Ditto.
21819         (Field::Field): Ditto.
21820         (Method::Method): Ditto.
21821         (Property::Property): Ditto.
21822         (TypeContainer::OptAttribute): update property's return type.
21823
21824         * interface.cs (Interface.opt_attributes): New member.
21825         (Interface::Interface): Update to take the extra Attributes argument.
21826
21827         * parameter.cs (Parameter::Parameter): Ditto.
21828
21829         * constant.cs (Constant::Constant): Ditto.
21830
21831         * interface.cs (InterfaceMemberBase): New OptAttributes field.
21832         (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take 
21833         the attributes as a parameter.
21834         (InterfaceProperty): Update constructor call.
21835         (InterfaceEvent): Ditto.
21836         (InterfaceMethod): Ditto.
21837         (InterfaceIndexer): Ditto.
21838
21839         * cs-parser.jay (interface_indexer_declaration): Update call to constructor to 
21840         pass the attributes too.
21841         (interface_event_declaration): Ditto.
21842         (interface_property_declaration): Ditto.
21843         (interface_method_declaration): Ditto.
21844         (interface_declaration): Ditto.
21845
21846 2001-09-05  Miguel de Icaza  <miguel@ximian.com>
21847
21848         * class.cs (Method::Define): Track the "static Main" definition to
21849         create an entry point. 
21850
21851         * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
21852         EntryPoint if we find it. 
21853
21854         * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
21855         (EmitContext::ig): Make this variable public.
21856
21857         * driver.cs: Make the default output file be the first file name
21858         with the .exe extension.  
21859
21860         Detect empty compilations
21861
21862         Handle various kinds of output targets.  Handle --target and
21863         rename -t to --dumper.
21864
21865         * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
21866         methods inherited from Expression return now an Expression.  This
21867         will is used during the tree rewriting as we resolve them during
21868         semantic analysis.
21869
21870         (Expression::MemberLookup): Implements the MemberLookup (7.3) from
21871         the spec.  Missing entirely is the information about
21872         accessability of elements of it.
21873
21874         (Expression::ExprClassFromMemberInfo): New constructor for
21875         Expressions that creates a fully initialized Expression based on
21876         a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
21877         a Type.
21878
21879         (Invocation::Resolve): Begin implementing resolution of invocations.
21880
21881         * literal.cs (StringLiteral):  Implement Emit.
21882
21883 2001-09-05  Ravi Pratap  <ravi@ximian.com>
21884
21885         * cs-parser.jay (error): Add new modifier because we are hiding an inherited
21886         member.
21887
21888 2001-09-04  Ravi Pratap  <ravi@ximian.com>
21889
21890         * cs-parser.jay (attribute_arguments): Implement actions.
21891         (attribute): Fix bug in production. Implement action.
21892         (attribute_list): Implement.
21893         (attribute_target): Implement.
21894         (attribute_target_specifier, opt_target_specifier): Implement
21895         (CheckAttributeTarget): New method to check if the attribute target
21896         is valid.
21897         (attribute_section): Implement.
21898         (opt_attributes): Implement.
21899
21900         * attribute.cs : New file to handle attributes.
21901         (Attribute): Class to hold attribute info.
21902
21903         * cs-parser.jay (opt_attribute_target_specifier): Remove production
21904         (attribute_section): Modify production to use 2 different rules to 
21905         achieve the same thing. 1 s/r conflict down !
21906         Clean out commented, useless, non-reducing dimension_separator rules.
21907
21908         * class.cs (TypeContainer.attributes): New member to hold list
21909         of attributes for a type.
21910         (Struct::Struct): Modify to take one more argument, the attribute list.
21911         (Class::Class): Ditto.
21912         (Field::Field): Ditto.
21913         (Method::Method): Ditto.
21914         (Property::Property): Ditto.
21915
21916         * cs-parser.jay (struct_declaration): Update constructor call to
21917         pass in the attributes too.
21918         (class_declaration): Ditto.
21919         (constant_declaration): Ditto.
21920         (field_declaration): Ditto.
21921         (method_header): Ditto.
21922         (fixed_parameter): Ditto.
21923         (parameter_array): Ditto.
21924         (property_declaration): Ditto.
21925
21926         * constant.cs (Constant::Constant): Update constructor similarly.
21927         Use System.Collections.
21928
21929         * parameter.cs (Parameter::Parameter): Update as above.
21930
21931 2001-09-02  Ravi Pratap  <ravi@ximian.com>
21932
21933         * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
21934         (TypeContainer.delegates): New member to hold list of delegates.
21935
21936         * cs-parser.jay (delegate_declaration): Implement the action correctly 
21937         this time as I seem to be on crack ;-)
21938
21939 2001-09-02  Miguel de Icaza  <miguel@ximian.com>
21940
21941         * rootcontext.cs (RootContext::IsNamespace): new function, used to
21942         tell whether an identifier represents a namespace.
21943
21944         * expression.cs (NamespaceExpr): A namespace expression, used only
21945         temporarly during expression resolution.
21946         (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
21947         utility functions to resolve names on expressions.
21948
21949 2001-09-01  Miguel de Icaza  <miguel@ximian.com>
21950
21951         * codegen.cs: Add hook for StatementExpressions. 
21952
21953         * class.cs: Fix inverted test for static flag in methods.
21954
21955 2001-09-02  Ravi Pratap  <ravi@ximian.com>
21956
21957         * class.cs (Operator::CheckUnaryOperator): Correct error number used
21958         to make it coincide with MS' number.
21959         (Operator::CheckBinaryOperator): Ditto.
21960
21961         * ../errors/errors.txt : Remove error numbers added earlier.
21962
21963         * ../errors/cs1019.cs : Test case for error # 1019
21964
21965         * ../errros/cs1020.cs : Test case for error # 1020
21966
21967         * cs-parser.jay : Clean out commented cruft.
21968         (dimension_separators, dimension_separator): Comment out. Ostensibly not
21969         used anywhere - non-reducing rule.
21970         (namespace_declarations): Non-reducing rule - comment out.
21971
21972         * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
21973         with TypeContainer::AddEnum.
21974
21975         * delegate.cs : New file for delegate handling classes.
21976         (Delegate): Class for declaring delegates.
21977
21978         * makefile : Update.
21979
21980         * cs-parser.jay (delegate_declaration): Implement.
21981
21982 2001-09-01  Ravi Pratap  <ravi@che.iitm.ac.in>
21983
21984         * class.cs (Event::Define): Implement.
21985         (Event.EventBuilder): New member.
21986
21987         * class.cs (TypeContainer::Populate): Update to define all enums and events
21988         we have.
21989         (Events): New property for the events arraylist we hold. Shouldn't we move to using
21990         readonly fields for all these cases ?
21991
21992 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
21993
21994         * class.cs (Property): Revamp to use the convention of making fields readonly.
21995         Accordingly modify code elsewhere.
21996
21997         * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
21998         the Define method of the Property class.
21999
22000         * class.cs : Clean up applied patch and update references to variables etc. Fix 
22001         trivial bug.
22002         (TypeContainer::Populate): Update to define all the properties we have. Also
22003         define all enumerations.
22004
22005         * enum.cs (Define): Implement.
22006
22007 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
22008
22009         * cs-parser.jay (overloadable_operator): The semantic value is an
22010         enum of the Operator class.
22011         (operator_declarator): Implement actions.
22012         (operator_declaration): Implement.
22013
22014         * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
22015         validity of definitions.
22016         (Operator::CheckBinaryOperator): Static method to check for binary operators
22017         (TypeContainer::AddOperator): New method to add an operator to a type.
22018
22019         * cs-parser.jay (indexer_declaration): Added line to actually call the
22020         AddIndexer method so it gets added ;-)
22021
22022         * ../errors/errors.txt : Update to include new error numbers. Are these numbers 
22023         already taken care of by the MS compiler ?  
22024
22025 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
22026
22027         * class.cs (Operator): New class for operator declarations.
22028         (Operator::OpType): Enum for the various operators.
22029
22030 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
22031
22032         * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
22033         ostensibly handle this in semantic analysis.
22034
22035         * cs-parser.jay (general_catch_clause): Comment out
22036         (specific_catch_clauses, specific_catch_clause): Ditto.
22037         (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
22038         (catch_args, opt_catch_args): New productions.
22039         (catch_clause): Rewrite to use the new productions above
22040         (catch_clauses): Modify accordingly.
22041         (opt_catch_clauses): New production to use in try_statement
22042         (try_statement): Revamp. Basically, we get rid of one unnecessary rule
22043         and re-write the code in the actions to extract the specific and
22044         general catch clauses by being a little smart ;-)
22045
22046         * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
22047         Hooray, try and catch statements parse fine !
22048
22049 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
22050
22051         * statement.cs (Block::GetVariableType): Fix logic to extract the type
22052         string from the hashtable of variables.
22053
22054         * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
22055         I end up making that mistake ;-)
22056         (catch_clauses): Fixed gross error which made Key and Value of the 
22057         DictionaryEntry the same : $1 !!
22058
22059 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
22060
22061         * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
22062
22063         * cs-parser.jay (event_declaration): Correct to remove the semicolon
22064         when the add and remove accessors are specified. 
22065
22066 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
22067
22068         * cs-parser.jay (IndexerDeclaration): New helper class to hold
22069         information about indexer_declarator.
22070         (indexer_declarator): Implement actions.
22071         (parsing_indexer): New local boolean used to keep track of whether
22072         we are parsing indexers or properties. This is necessary because 
22073         implicit_parameters come into picture even for the get accessor in the 
22074         case of an indexer.
22075         (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
22076
22077         * class.cs (Indexer): New class for indexer declarations.
22078         (TypeContainer::AddIndexer): New method to add an indexer to a type.
22079         (TypeContainer::indexers): New member to hold list of indexers for the
22080         type.
22081
22082 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
22083
22084         * cs-parser.jay (add_accessor_declaration): Implement action.
22085         (remove_accessor_declaration): Implement action.
22086         (event_accessors_declaration): Implement
22087         (variable_declarators): swap statements for first rule - trivial.
22088
22089         * class.cs (Event): New class to hold information about event
22090         declarations.
22091         (TypeContainer::AddEvent): New method to add an event to a type
22092         (TypeContainer::events): New member to hold list of events.
22093
22094         * cs-parser.jay (event_declaration): Implement actions.
22095
22096 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
22097
22098         * cs-parser.jay (dim_separators): Implement. Make it a string
22099         concatenating all the commas together, just as they appear.
22100         (opt_dim_separators): Modify accordingly
22101         (rank_specifiers): Update accordingly. Basically do the same
22102         thing - instead, collect the brackets here.
22103         (opt_rank_sepcifiers): Modify accordingly.
22104         (array_type): Modify to actually return the complete type string
22105         instead of ignoring the rank_specifiers.
22106         (expression_list): Implement to collect the expressions
22107         (variable_initializer): Implement. We make it a list of expressions
22108         essentially so that we can handle the array_initializer case neatly too.
22109         (variable_initializer_list): Implement.
22110         (array_initializer): Make it a list of variable_initializers
22111         (opt_array_initializer): Modify accordingly.
22112
22113         * expression.cs (New::NType): Add enumeration to help us
22114         keep track of whether we have an object/delegate creation
22115         or an array creation.
22116         (New:NewType, New::Rank, New::Indices, New::Initializers): New
22117         members to hold data about array creation.
22118         (New:New): Modify to update NewType
22119         (New:New): New Overloaded contructor for the array creation
22120         case.
22121
22122         * cs-parser.jay (array_creation_expression): Implement to call
22123         the overloaded New constructor.
22124
22125 2001-08-26  Ravi Pratap  <ravi@che.iitm.ac.in>
22126
22127         * class.cs (TypeContainer::Constructors): Return member
22128         constructors instead of returning null.
22129
22130 2001-08-26  Miguel de Icaza  <miguel@ximian.com>
22131
22132         * typemanager.cs (InitCoreTypes): Initialize the various core
22133         types after we have populated the type manager with the user
22134         defined types (this distinction will be important later while
22135         compiling corlib.dll)
22136
22137         * expression.cs, literal.cs, assign.cs, constant.cs: Started work
22138         on Expression Classification.  Now all expressions have a method
22139         `Resolve' and a method `Emit'.
22140
22141         * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
22142         generation from working.     Also add some temporary debugging
22143         code. 
22144
22145 2001-08-24  Miguel de Icaza  <miguel@ximian.com>
22146
22147         * codegen.cs: Lots of code generation pieces.  This is only the
22148         beginning, will continue tomorrow with more touches of polish.  We
22149         handle the fundamentals of if, while, do, for, return.  Others are
22150         trickier and I need to start working on invocations soon.
22151
22152         * gen-treedump.cs: Bug fix, use s.Increment here instead of
22153         s.InitStatement. 
22154
22155         * codegen.cs (EmitContext): New struct, used during code
22156         emission to keep a context.   Most of the code generation will be
22157         here. 
22158
22159         * cs-parser.jay: Add embedded blocks to the list of statements of
22160         this block.  So code generation proceeds in a top down fashion.
22161
22162 2001-08-23  Miguel de Icaza  <miguel@ximian.com>
22163
22164         * statement.cs: Add support for multiple child blocks.
22165
22166 2001-08-22  Miguel de Icaza  <miguel@ximian.com>
22167
22168         * codegen.cs (EmitCode): New function, will emit the code for a
22169         Block of code given a TypeContainer and its ILGenerator. 
22170
22171         * statement.cs (Block): Standard public readonly optimization.
22172         (Block::Block constructors): Link children. 
22173         (Block::Child): Child Linker.
22174         (Block::EmitVariables): Emits IL variable declarations.
22175
22176         * class.cs: Drop support for MethodGroups here, delay until
22177         Semantic Analysis.
22178         (Method::): Applied the same simplification that I did before, and
22179         move from Properties to public readonly fields.
22180         (Method::ParameterTypes): Returns the parameter types for the
22181         function, and implements a cache that will be useful later when I
22182         do error checking and the semantic analysis on the methods is
22183         performed.
22184         (Constructor::GetCallingConvention): Renamed from CallingConvetion
22185         and made a method, optional argument tells whether this is a class
22186         or a structure to apply the `has-this' bit.
22187         (Method::GetCallingConvention): Implement, returns the calling
22188         convention. 
22189         (Method::Define): Defines the type, a second pass is performed
22190         later to populate the methods.
22191
22192         (Constructor::ParameterTypes): implement a cache similar to the
22193         one on Method::ParameterTypes, useful later when we do semantic
22194         analysis. 
22195
22196         (TypeContainer::EmitMethod):  New method.  Emits methods.
22197
22198         * expression.cs: Removed MethodGroup class from here.
22199
22200         * parameter.cs (Parameters::GetCallingConvention): new method.
22201
22202 2001-08-21  Miguel de Icaza  <miguel@ximian.com>
22203
22204         * class.cs (TypeContainer::Populate): Drop RootContext from the
22205         argument. 
22206
22207         (Constructor::CallingConvention): Returns the calling convention.
22208         (Constructor::ParameterTypes): Returns the constructor parameter
22209         types. 
22210
22211         (TypeContainer::AddConstructor): Keep track of default constructor
22212         and the default static constructor.
22213
22214         (Constructor::) Another class that starts using `public readonly'
22215         instead of properties. 
22216
22217         (Constructor::IsDefault): Whether this is a default constructor. 
22218
22219         (Field::) use readonly public fields instead of properties also.
22220
22221         (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
22222         track of static constructors;  If none is used, turn on
22223         BeforeFieldInit in the TypeAttributes. 
22224
22225         * cs-parser.jay (opt_argument_list): now the return can be null
22226         for the cases where there are no arguments. 
22227
22228         (constructor_declarator): If there is no implicit `base' or
22229         `this', then invoke the default parent constructor. 
22230
22231         * modifiers.cs (MethodAttr): New static function maps a set of
22232         modifiers flags into a MethodAttributes enum
22233         (FieldAttr): renamed from `Map'.  So now we have FieldAttr,
22234         MethodAttr, TypeAttr to represent the various mappings where the
22235         modifiers are used.
22236         (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'  
22237
22238 2001-08-19  Miguel de Icaza  <miguel@ximian.com>
22239
22240         * parameter.cs (GetParameterInfo): Fix bug where there would be no
22241         method arguments.
22242
22243         * interface.cs (PopulateIndexer): Implemented the code generator
22244         for interface indexers.
22245
22246 2001-08-17  Miguel de Icaza  <miguel@ximian.com>
22247
22248         * interface.cs (InterfaceMemberBase): Now we track the new status
22249         here.  
22250
22251         (PopulateProperty): Implement property population.  Woohoo!  Got
22252         Methods and Properties going today. 
22253
22254         Removed all the properties for interfaces, and replaced them with
22255         `public readonly' fields. 
22256
22257 2001-08-16  Miguel de Icaza  <miguel@ximian.com>
22258
22259         * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
22260         initialize their hashtables/arraylists only when they are needed
22261         instead of doing this always.
22262
22263         * parameter.cs: Handle refs and out parameters.
22264
22265         * cs-parser.jay: Use an ArrayList to construct the arguments
22266         instead of the ParameterCollection, and then cast that to a
22267         Parameter[] array.
22268
22269         * parameter.cs: Drop the use of ParameterCollection and use
22270         instead arrays of Parameters.
22271
22272         (GetParameterInfo): Use the Type, not the Name when resolving
22273         types. 
22274
22275 2001-08-13  Miguel de Icaza  <miguel@ximian.com>
22276
22277         * parameter.cs: Eliminate the properties Name, Type and ModFlags,
22278         and instead use public readonly fields.
22279
22280         * class.cs: Put back walking code for type containers.
22281
22282 2001-08-11  Miguel de Icaza  <miguel@ximian.com>
22283
22284         * class.cs (MakeConstant): Code to define constants.
22285
22286         * rootcontext.cs (LookupType): New function.  Used to locate types 
22287
22288
22289 2001-08-08  Miguel de Icaza  <miguel@ximian.com>
22290
22291         * rootcontext.cs: OH MY!  My trick works!   It is amazing how nice
22292         this System.Reflection code is.  Kudos to Microsoft
22293
22294         * typemanager.cs: Implement a type cache and avoid loading all
22295         types at boot time.  Wrap in LookupType the internals.  This made
22296         the compiler so much faster.  Wow.  I rule!
22297
22298         * driver.cs: Make sure we always load mscorlib first (for
22299         debugging purposes, nothing really important).
22300
22301         * Renamespaced things that were on `CSC' to `CIR'.  Maybe I should
22302         have moved to `CSC' rather than `CIR'.  Oh man!  The confussion!  
22303
22304         * rootcontext.cs: Lookup types on their namespace;  Lookup types
22305         on namespaces that have been imported using the `using' keyword.
22306
22307         * class.cs (TypeContainer::TypeAttr): Virtualize.
22308         (Class::TypeAttr): Return attributes suitable for this bad boy.
22309         (Struct::TypeAttr): ditto.
22310         Handle nested classes.
22311         (TypeContainer::) Remove all the type visiting code, it is now
22312         replaced with the rootcontext.cs code
22313
22314         * rootcontext.cs (GetClassBases): Added support for structs. 
22315
22316 2001-08-06  Miguel de Icaza  <miguel@ximian.com>
22317
22318         * interface.cs, statement.cs, class.cs, parameter.cs,
22319         rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
22320         Drop use of TypeRefs, and use strings instead.
22321
22322 2001-08-04  Miguel de Icaza  <miguel@ximian.com>
22323
22324         * rootcontext.cs: 
22325
22326         * class.cs (Struct::Struct): set the SEALED flags after
22327         checking the modifiers.
22328         (TypeContainer::TypeAttr): new property, returns the
22329         TypeAttributes for a class.  
22330
22331         * cs-parser.jay (type_list): Oops, list production was creating a
22332         new list of base types.
22333
22334         * rootcontext.cs (StdLib): New property.
22335         (GetInterfaceTypeByName): returns an interface by type name, and
22336         encapsulates error handling here.
22337         (GetInterfaces): simplified.
22338         (ResolveTree): Encapsulated all the tree resolution here.
22339         (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
22340         types. 
22341
22342         * driver.cs: Add support for --nostdlib, to avoid loading the
22343         default assemblies.
22344         (Main): Do not put tree resolution here. 
22345
22346         * rootcontext.cs: Beginning of the class resolution.
22347
22348 2001-08-03  Miguel de Icaza  <miguel@ximian.com>
22349
22350         * rootcontext.cs: Provide better error reporting. 
22351
22352         * cs-parser.jay (interface_base): set our $$ to be interfaces.
22353
22354         * rootcontext.cs (CreateInterface): Handle the case where there
22355         are no parent interfaces.
22356
22357         (CloseTypes): Routine to flush types at the end.
22358         (CreateInterface): Track types.
22359         (GetInterfaces): Returns an array of Types from the list of
22360         defined interfaces.
22361
22362         * typemanager.c (AddUserType): Mechanism to track user types (puts
22363         the type on the global type hash, and allows us to close it at the
22364         end). 
22365
22366 2001-08-02  Miguel de Icaza  <miguel@ximian.com>
22367
22368         * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
22369         RecordInterface instead.
22370
22371         * cs-parser.jay: Updated to reflect changes above.
22372
22373         * decl.cs (Definition): Keep track of the TypeBuilder type that
22374         represents this type here.  Not sure we will use it in the long
22375         run, but wont hurt for now.
22376
22377         * driver.cs: Smaller changes to accomodate the new code.
22378
22379         Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
22380         when done. 
22381
22382         * rootcontext.cs (CreateInterface):  New method, used to create
22383         the System.TypeBuilder type for interfaces.
22384         (ResolveInterfaces): new entry point to resolve the interface
22385         hierarchy. 
22386         (CodeGen): Property, used to keep track of the code generator.
22387
22388 2001-07-26  Miguel de Icaza  <miguel@ximian.com>
22389
22390         * cs-parser.jay: Add a second production for delegate_declaration
22391         with `VOID'.
22392
22393         (enum_body): Put an opt_comma here instead of putting it on
22394         enum_body or enum_member_declarations so we can handle trailing
22395         commas on enumeration members.  Gets rid of a shift/reduce.
22396
22397         (type_list): Need a COMMA in the middle.
22398
22399         (indexer_declaration): Tell tokenizer to recognize get/set
22400
22401         * Remove old targets.
22402
22403         * Re-add the parser target.
22404
22405 2001-07-13  Simon Cozens <simon@simon-cozens.org>
22406
22407         * cs-parser.jay: Add precendence rules for a number of operators
22408         ot reduce the number of shift/reduce conflicts in the grammar.
22409
22410 2001-07-17  Miguel de Icaza  <miguel@ximian.com>
22411
22412         * tree.cs: moved IGenerator interface and renamed it to ITreeDump
22413         and put it here.
22414
22415         Get rid of old crufty code.
22416
22417         * rootcontext.cs: Use this to keep track of the parsed
22418         representation and the defined types available to the program. 
22419
22420         * gen-treedump.cs: adjust for new convention.
22421
22422         * type.cs: Split out the type manager, and the assembly builder
22423         from here. 
22424
22425         * typemanager.cs: the type manager will live here now.
22426
22427         * cil-codegen.cs: And the code generator here. 
22428
22429 2001-07-14  Sean MacIsaac  <macisaac@ximian.com>
22430
22431         * makefile: Fixed up for easy making.
22432
22433 2001-07-13  Simon Cozens <simon@simon-cozens.org>
22434
22435         * cs-parser.jay (rank_specifier): Remove a conflict by reordering
22436         the 
22437
22438         (unary_expression): Expand pre_increment_expression and
22439         post_decrement_expression to reduce a shift/reduce.
22440
22441 2001-07-11  Simon Cozens
22442
22443         * cs-tokenizer.cs: Hex numbers should begin with a 0.
22444
22445         Improve allow_keyword_as_indent name.
22446
22447 2001-06-19  Miguel de Icaza  <miguel@ximian.com>
22448
22449         * Adjustments for Beta2. 
22450
22451 2001-06-13  Miguel de Icaza  <miguel@ximian.com>
22452
22453         * decl.cs: Added `Define' abstract method.
22454         (InTransit): new property, used to catch recursive definitions. 
22455
22456         * interface.cs: Implement `Define'. 
22457
22458         * modifiers.cs: Map Modifiers.constants to
22459         System.Reflection.TypeAttribute flags.
22460
22461         * class.cs: Keep track of types and user-defined types.
22462         (BuilderInit): New method for creating an assembly
22463         (ResolveType): New function to launch the resolution process, only
22464         used by interfaces for now.
22465
22466         * cs-parser.jay: Keep track of Classes, Structs and Interfaces
22467         that are inserted into the name space. 
22468
22469 2001-06-08  Miguel de Icaza  <miguel@ximian.com>
22470
22471         * ARGH.  I have screwed up my tree so many times due to the use of
22472         rsync rather than using CVS.  Going to fix this at once. 
22473
22474         * driver.cs: Objetify driver.  Load assemblies, use assemblies to
22475         load types.
22476
22477 2001-06-07  Miguel de Icaza  <miguel@ximian.com>
22478
22479         * Experiment successful: Use System.Type rather that our own
22480         version of Type.  
22481
22482 2001-05-25  Miguel de Icaza  <miguel@ximian.com>
22483
22484         * cs-parser.jay: Removed nsAliases from here.
22485
22486         Use new namespaces, handle `using XXX;' 
22487
22488         * namespace.cs: Reimplemented namespace handling, use a recursive
22489         definition of the class.  Now we can keep track of using clauses
22490         and catch invalid using clauses.
22491
22492 2001-05-24  Miguel de Icaza  <miguel@ximian.com>
22493
22494         * gen-treedump.cs: Adapted for all the renaming.
22495
22496         * expression.cs (Expression): this class now has a Type property
22497         which returns an expression Type.
22498
22499         (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
22500         `Type', as this has a different meaning now in the base
22501
22502 2001-05-22  Miguel de Icaza  <miguel@ximian.com>
22503
22504         * interface.cs, class.cs: Removed from all the sources the
22505         references to signature computation, as we can not do method
22506         signature computation during the parsing time, as we are not
22507         trying to solve at that point distinguishing:
22508
22509         class X {
22510                 void a (Blah x) {}
22511                 void a (NS.Blah x) {}
22512         }
22513
22514         Which depending on the context might be valid or not, as we do not
22515         know if Blah is the same thing as NS.Blah at that point.
22516
22517         * Redid everything so the code uses TypeRefs now instead of
22518         Types.  TypeRefs are just temporary type placeholders, that need
22519         to be resolved.  They initially have a pointer to a string and the
22520         current scope in which they are used.  This is used later by the
22521         compiler to resolve the reference to an actual Type. 
22522
22523         * DeclSpace is no longer a CIR.Type, and neither are
22524         TypeContainers (Class and Struct) nor Interfaces nor Enums.  They
22525         are all DeclSpaces, but no Types. 
22526
22527         * type.cs (TypeRefManager): This implements the TypeRef manager,
22528         which keeps track of all the types that need to be resolved after
22529         the parsing has finished. 
22530
22531 2001-05-13  Miguel de Icaza  <miguel@ximian.com>
22532
22533         * ARGH.  We are going to have to store `foreach' as a class rather
22534         than resolving it, as we need to verify error 1579 after name
22535         resolution.   *OR* we could keep a flag that says `This request to
22536         IEnumerator comes from a foreach statement' which we can then use
22537         to generate the error.
22538
22539 2001-05-10  Miguel de Icaza  <miguel@ximian.com>
22540
22541         * class.cs (TypeContainer.AddMethod): we now add methods to the
22542         MethodGroup instead of the method hashtable.  
22543
22544         * expression.cs: Add MethodGroup abstraction, which gets us one
22545         step closer to the specification in the way we handle method
22546         declarations.  
22547
22548         * cs-parser.jay (primary_expression): qualified_identifier now
22549         tried to match up an identifier to a local variable reference or
22550         to a parameter reference.
22551
22552         current_local_parameters is now a parser global variable that
22553         points to the current parameters for the block, used during name
22554         lookup.
22555
22556         (property_declaration): Now creates an implicit `value' argument to
22557         the set accessor.
22558
22559 2001-05-09  Miguel de Icaza  <miguel@ximian.com>
22560
22561         * parameter.cs: Do not use `param' arguments as part of the
22562         signature, per the spec.
22563
22564 2001-05-08  Miguel de Icaza  <miguel@ximian.com>
22565
22566         * decl.cs: Base class for classes, structs and interfaces.  This
22567         is the "Declaration Space" 
22568
22569         * cs-parser.jay: Use CheckDef for checking declaration errors
22570         instead of having one on each function.
22571
22572         * class.cs: Factor out some code for handling error handling in
22573         accordance to the "Declarations" section in the "Basic Concepts"
22574         chapter in the ECMA C# spec.
22575
22576         * interface.cs: Make all interface member classes derive from
22577         InterfaceMemberBase.
22578
22579 2001-05-07  Miguel de Icaza  <miguel@ximian.com>
22580
22581         * Many things: all interfaces are parsed and generated in
22582         gen-treedump.  Support for member variables, constructors,
22583         destructors, properties, constants is there.
22584
22585         Beginning of the IL backend, but very little done, just there for
22586         testing purposes. 
22587
22588 2001-04-29  Miguel de Icaza  <miguel@ximian.com>
22589
22590         * cs-parser.jay: Fix labeled statement.
22591
22592         * cs-tokenizer.cs (escape): Escape " and ' always.
22593         ref_line, ref_name: keep track of the line/filename as instructed
22594         by #line by the compiler.
22595         Parse #line.
22596
22597 2001-04-27  Miguel de Icaza  <miguel@ximian.com>
22598
22599         * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
22600         to match the values in System.CodeDOM.
22601
22602         Divid renamed to Divide.
22603
22604         * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
22605         statements. 
22606         (Statements.set): remove.
22607
22608         * System.CodeDOM/CodeCatchClause.cs: always have a valid
22609         statements. 
22610
22611         * System.CodeDOM/CodeIfStatement.cs: trueStatements and
22612         falseStatements always have valid values. 
22613
22614         * cs-parser.jay: Use System.CodeDOM now.
22615