2005-07-27 Carlos Alberto Cortez <calberto.cortez@gmail.com>
[mono.git] / mcs / gmcs / ChangeLog
1 2005-07-27  Carlos Alberto Cortez <calberto.cortez@gmail.com>
2
3         Fix #75417
4         * ecore.cs (Expression.IsAccessorAccessible): Change the check for
5         Private accessor case, using TypeManager.IsPrivateAccessible instead of
6         invocation_type == mi.DeclaringType, since the first one also checks
7         other condition used by generic instances.
8         
9 2005-07-27  Martin Baulig  <martin@ximian.com>
10
11         * anonymous.cs (CaptureContext.AddField): Added
12         `AnonymousContainer am' argument; compute its toplevel scope if
13         it's not already computed.  Fixes #75649.
14
15 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
16
17         Fix #75321
18         * ecore.cs, class.cs: Use SetAssigned instead of direct access.
19
20         * class.cs (TypeContainer.VerifyMembers): Distinguish between
21         not used and not used & assigned.
22         (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
23
24 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
25
26         Fix #75053
27         * expression.cs (Is.DoResolve): null is never provided type.
28
29 2005-07-08  Marek Safar  <marek.safar@seznam.cz>
30
31         Fix #52496
32         * cs-parser.jay: Less strict event error rule to catch more errors.
33
34 2005-07-11  Martin Baulig  <martin@ximian.com>
35
36         * generic.cs (ConstructedType.CheckConstraints): Improve the check
37         for the constructor constraint: we do not only have to check
38         whether the class has a public constructor, but also ensure that
39         it's parameterless.  Fixes #75492.
40
41 2005-07-11  Martin Baulig  <martin@ximian.com>
42
43         * expression.cs (Binary.ResolveOperator): Only allow `==' and `!='
44         between type parameters if they either have the reference type
45         constraint or the class constraint.
46
47 2005-07-10  Kamil Skalski <nazgul@nemerle.org>
48
49         * generic.cs: Use MakeGenericType instead of BindGenericParameters.
50
51 2005-07-07  Marek Safar  <marek.safar@seznam.cz>
52
53         Fix #74975
54         * attribute.cs (orig_sec_assembly): Holds original version of assembly.
55         (ExtractSecurityPermissionSet): Cope with self referencing security
56         attributes properly.
57
58         * driver.cs (SetOutputFile): Made public property OutputFile.
59
60 2005-07-07  Raja R Harinath  <rharinath@novell.com>
61
62         Fix #75486.
63         * class.cs (TypeContainer.first_nonstatic_field): Rename from
64         has_nonstatic_fields.  Make into a FieldBase pointer.
65         (TypeContainer.AddField): Add CS0282 check.
66         (TypeContainer.EmitType): Update.
67
68 2005-07-06  Miguel de Icaza  <miguel@novell.com>
69
70         * cs-tokenizer.cs (consume_identifier): Do not create strings to
71         compare if they start with __.
72
73 2005-07-06  Raja R Harinath  <rharinath@novell.com>
74
75         * statement.cs (Switch.SwitchGoverningType): Only look at
76         UserCasts that don't need implicit standard conversions to one of
77         the allowed switch types (Fixes test-322.cs).
78         (LocalInfo.Resolve): Re-enable sanity-test.
79
80 2005-07-06  Marek Safar  <marek.safar@seznam.cz>
81
82         * cs-tokenizer.cs (consume_identifier): Detect double undescores
83         
84         * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
85         
86         * expression.cs (Invocation.DoResolve): Report error CS0245 here.
87
88 2005-07-06  Raja R Harinath  <rharinath@novell.com>
89
90         Fix #75472.
91         * ecore.cs (SimpleName.GetSignatureForError): Add.
92         * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
93         (MemberAccess.GetSignatureForError): Add.
94
95 2005-07-05  Marek Safar  <marek.safar@seznam.cz>
96  
97         The big error and warning messages review.
98         
99         * anonymous.cs,
100         * assign.cs,
101         * attribute.cs,
102         * class.cs,
103         * codegen.cs,
104         * convert.cs,
105         * cs-parser.jay,
106         * cs-tokenizer.cs,
107         * decl.cs,
108         * delegate.cs,
109         * doc.cs,
110         * driver.cs,
111         * ecore.cs,
112         * enum.cs,
113         * expression.cs,
114         * flowanalysis.cs,
115         * iterators.cs,
116         * literal.cs,
117         * location.cs,
118         * modifiers.cs,
119         * namespace.cs,
120         * parameter.cs,
121         * pending.cs,
122         * report.cs,
123         * rootcontext.cs,
124         * statement.cs,
125         * support.cs,
126         * tree.cs,
127         * typemanager.cs: Updated.
128         
129         * class.cs: (MethodCore.SetYields): Moved here to share.
130         (PropertyMethod.Define): Moved iterator setup here.
131         
132         * iterators.cs: Add orig_method to have full access to parent
133         container.
134
135 2005-07-05  Raja R Harinath  <rharinath@novell.com>
136
137         Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
138         * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
139         (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
140         variable of struct type.
141         * expression.cs (Unary.ResolveOperator): Update to change.
142         (Indirection.VerifyFixed): Likewise.
143         (LocalVariableReference.VerifyFixed): A local variable is always fixed.
144         (ParameterReference.VerifyFixed): Value parameters are fixed.
145         (This.VerifyFixed): Treat 'this' as a value parameter.
146         * statement.cs (LocalInfo.IsFixed): Remove.
147
148 2005-07-01  Martin Baulig  <martin@ximian.com>
149
150         * iterators.cs (Iterator.CapturedThisReference.Emit): Use
151         `ec.EmitThis ()' to get the correct scope.
152
153 2005-07-01  Martin Baulig  <martin@ximian.com>
154
155         * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
156         instance is a ParameterReference; fixes #75299.
157
158 2005-06-30  Raja R Harinath  <rharinath@novell.com>
159
160         Fix #75412.
161         * expression.cs (Indexers.map): Remove.
162         (Indexers.Append): Filter out inaccessible setters and getters.
163         (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
164
165         Fix #75283.
166         * ecore.cs (MemberExpr.EmitInstance): New.  Add CS0120 check.
167         Refactored from ...
168         (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
169         (FieldExpr.Emit, PropertyExpr.Emit): Update.
170         (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
171         * expression.cs (Invocation.EmitCall): Add CS0120 check.
172
173 2005-06-30  Marek Safar  <marek.safar@seznam.cz>
174
175         Fix #75322
176         * class.cs (FieldBase.GetInitializerExpression): One more field
177         for backup.
178
179 2005-06-28  Miguel de Icaza  <miguel@novell.com>
180
181         * pending.cs: Do not define a proxy if the base method is virtual,
182         it will be picked up by the runtime (bug 75270).
183
184 2005-07-08  Martin Baulig  <martin@ximian.com>
185
186         * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
187         handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
188
189 2005-07-07  Martin Baulig  <martin@ximian.com>
190
191         * generic.cs (ConstructedType.CheckConstraint): Use
192         ResolveAsTypeStep(), not ResolveAsTypeTerminal() so we're not
193         called recursively; fixes #75329.
194
195 2005-07-06  Martin Baulig  <martin@ximian.com>
196
197         * generic.cs (TypeManager.InferTypeArguments): Added support for
198         anonymous methods; fixes #75461.
199
200 2005-07-01  Martin Baulig  <martin@ximian.com>
201
202         * iterators.cs (Iterator.CapturedThisReference.Emit): Use
203         `ec.EmitThis ()' to get the correct scope.
204
205 2005-07-01  Martin Baulig  <martin@ximian.com>
206
207         * ecore.cs (FieldExpr.DoResolve): Only capture the field if it's
208         instance is `This'; fixes #75299.
209
210 2005-06-30  Martin Baulig  <martin@ximian.com>
211
212         * class.cs (Indexer): Implement IIteratorContainer; added support
213         for iterators in indexers.
214
215         * codegen.cs
216         (EmitContext.CurrentIterator): Make this a property, not a field.
217
218         * anonymous.cs (AnonymousContainer.Iterator): New public property.
219
220 2005-06-28  Miguel de Icaza  <miguel@novell.com>
221
222         * pending.cs: Do not define a proxy if the base method is virtual,
223         it will be picked up by the runtime (bug 75270).
224
225 2005-06-28  Martin Baulig  <martin@ximian.com>
226
227         * cs-parser.jay (interface_method_declaration): Avoid a
228         reduce/reduce conflict by moving some of the code into a separate
229         `interface_method_declaration_body' rule; fixes #75368.
230
231 2005-06-28  Martin Baulig  <martin@ximian.com>
232
233         * typemanager.cs (TypeManager.MemberLookup_FindMembers): Move the
234         array check after the check for TypeBuilder's.
235
236 2005-06-21  Raja R Harinath  <rharinath@novell.com>
237
238         * convert.cs (FindMostEncompassedType): Add two trivial special
239         cases (number_of_types == 0 || number_of_types == 1).
240         (FindMostEncompasingType): Likewise.
241
242 2005-06-17  Raja R Harinath  <rharinath@novell.com>
243
244         Some cleanups preparing for the fix of #75283.
245         * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
246         error testing.
247         (EventExpr.InstanceResolve): Likewise.
248         (EventExpr.DoResolve): Remove redundant checks.
249
250 2005-06-08  Miguel de Icaza  <miguel@novell.com>
251
252         * class.cs: Small fix.
253
254 2005-06-08  Raja R Harinath  <rharinath@novell.com>
255
256         Fix #75160.
257         * class.cs (GetPartialBases): Fix return value check of
258         part.GetClassBases.
259
260 2005-06-07  Raja R Harinath  <rharinath@novell.com>
261
262         Ensure that partial classes are registered in their enclosing
263         namespace.  Initial part of fix of #75160.
264         * tree.cs (Tree.RecordDecl): Add new namespace argument.
265         Register declspace with namespace here, not in
266         DeclSpace.RecordDecl.
267         * cs-parser.jay: Pass namespace to RecordDecl.
268         * class.cs (PartialContainer.Create): Likewise.
269         (ClassPart.DefineType): New sanity-check.  Throws an exception if
270         called.
271         * decl.cs (Declspace.RecordDecl): Remove.
272         * namespace.cs (NamespaceEntry.DefineName): Remove.
273
274 2005-06-06  Marek Safar  <marek.safar@seznam.cz>
275
276         * rootcontext.cs: Reset TargetExt as well.
277
278 2005-06-03  Raja R Harinath  <rharinath@novell.com>
279
280         * ecore.cs (Expression.Resolve): Emit CS0654 error when
281         -langversion:ISO-1.
282
283 2005-06-02  Raja R Harinath  <rharinath@novell.com>
284
285         Fix #75080, cs0119.cs.
286         * ecore.cs (Expression.ExprClassToResolveFlags): New.  Broken out
287         of ...
288         (Expression.Resolve): ... this.  Use it.  Remove bogus code
289         allowing ExprClass.Type and ExprClass.Namespace for
290         ResolveFlags.VariableOrValue.
291         (Expression.Resolve) [1-argument variant]: Change default resolve
292         flags based on language version.
293         (Expression.Error_UnexpectedKind): Use a simple string array
294         rather than an ArrayList.
295         * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
296         not ExprClass.Type.
297         (TypeOfVoid.DoResolve): Likewise.
298         (MemberAccess.DoResolve) [3-argument variant]: Make private.  Drop
299         flags argument -- it always has the same value.
300
301 2005-05-31  Raja R Harinath  <rharinath@novell.com>
302
303         Fix #75081.
304         * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
305         Use it in the error message.
306         * assign.cs, expression.cs, statement.cs: Update.
307
308 2005-05-30  Raja R Harinath  <rharinath@novell.com>
309
310         Fix #75088.
311         * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
312         the "almostMatchedMember" case too.
313         * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
314         that failed the accessibility checks to 'almost_match'.
315
316 2005-05-27  Vladimir Vukicevic  <vladimir@pobox.com>
317
318         * attribute.cs: Use internal MethodBuilder methods to set
319         ExactSpelling and SetLastError on PInvoke methods, instead
320         of passing them via charset.  Fixes #75060.
321
322 2005-05-27  Raja R Harinath  <rharinath@novell.com>
323
324         * parameter.cs (Parameter): Remove TODO comment.
325         (Parameter.DefineParameter): Remove Location parameter.
326         (Parameters.LabelParameters): Likewise.
327         * class.cs (Constructor.Emit): Update to change.
328         (MethodData.Emit): Likewise.
329         * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.  
330         * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
331
332 2005-05-27  Atsushi Enomoto  <atsushi@ximian.com>
333
334         * parameter.cs,
335           Removed Parameters.Location and added Parameter.Location instead.
336           Removed Location parameter from Emit() and GetSignature().
337         * anonymous.cs,
338           class.cs,
339           cs-parser.jay,
340           delegate.cs,
341           iterators.cs,
342           statement.cs :
343           Modified all related calls.
344
345 2005-06-21  Martin Baulig  <martin@ximian.com>
346
347         * generic.cs (NullCoalescingOperator.Emit): Make this work if the
348         left-hand side is not a nullable type; fixes #75328.
349
350 2005-06-21  Martin Baulig  <martin@ximian.com>
351
352         * typemanager.cs
353         (TypeManager.CSharpName): Use GetFullName() instead of `t.FullName'.
354         (TypeManager.GetFullNameSignature): Likewise.
355
356         * convert.cs (Convert.Error_CannotImplicitConversion): Compare
357         `source.FullName' and `target.FullName' to check whether there are
358         two conflicting definitions.
359
360 2005-06-21  Martin Baulig  <martin@ximian.com>
361
362         * convert.cs (Convert.ImplicitTypeParameterConversion): Always use
363         a BoxedCast - also for reference types - to be compatible with csc.
364
365 2005-06-21  Martin Baulig  <martin@ximian.com>
366
367         * expression.cs (MemberAccess.DoResolve): Add support for nested
368         types in a generic instance; fixes #75320.
369
370 2005-06-20  Martin Baulig  <martin@ximian.com>
371
372         * generic.cs (TypeManager.InferType): Also walk the class
373         hierarchy for generic instances; fixes #75261.
374
375 2005-06-17  Martin Baulig  <martin@ximian.com>
376
377         * typemanager.cs (TypeManager.IsBuiltinType): Use TypeToCoreType()
378         to make things work for corlib.
379
380 2005-06-15  Martin Baulig  <martin@ximian.com>
381
382         * attribute.cs (Attribute.CheckSecurityActionValidity): Remove the
383         obsolete `SecurityAction' values.
384
385 2005-06-06  Marek Safar  <marek.safar@seznam.cz>
386
387         * rootcontext.cs: Reset TargetExt as well.
388         
389 2005-06-09  Martin Baulig  <martin@ximian.com>
390
391         * delegate.cs (Delegate.VerifyMethod): Added
392         `MethodGroupExpr old_mg' argument; inherit its
393         `HasTypeParameters'; fix #75085.
394
395 2005-06-09  Martin Baulig  <martin@ximian.com>
396
397         * expression.cs (Invocation.OverloadResolve): Correctly handle
398         generic methods for the SetMemberIsUsed(); fix #75064.
399
400 2005-06-09  Martin Baulig  <martin@ximian.com>
401
402         * statement.cs (Throw.Resolve): Use TypeManager.IsSubclassOf();
403         fixes #75062.
404
405 2005-06-08  Martin Baulig  <martin@ximian.com>
406
407         * cs-parser.jay (nullable_type_or_conditional): If we put the
408         nullable back and our `type' is a `ComposedCast', remove the
409         nullable from it.  Fixes #75156.
410
411         * expression.cs (ComposedCast.RemoveNullable): New public method.
412
413 2005-06-08  Martin Baulig  <martin@ximian.com>
414
415         The big Iterators rewrite :-)
416
417         * iterators.cs: Rewrite this to use the anonymous methods framework.
418
419         * rootcontext.cs (RootContext.DefineTypes): Define Delegates
420         before the TypeContainers; see 2test-21.cs.
421
422         * class.cs
423         (TypeContainer.DefineType): Don't create a new EmitContext if we
424         already have one (this only happens if we're an Iterator).
425         (TypeContainer.Define): Also call Define() on all our iterators.
426         (Method.CreateEmitContext): Added support for iterators.
427
428         * anonymous.cs
429         (AnonymousContainer): New abstract base class for `AnonymousMethod'.
430         (AnonymousContainer.CreateMethodHost): Moved here from
431         AnonymousMethod and made abstract.
432         (AnonymousContainer.CreateScopeType): New abstract method.
433         (AnonymousContainer.IsIterator): New public property.
434         (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
435         get the ScopeTypeBuilder rather than manually defining it here. 
436         (ScopeInfo.EmitScopeInstance): New public method; correctly handle
437         iterators here.
438
439         * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
440         before RootContext.DefineTypes().
441
442         * codegen.cs (EmitContext.RemapToProxy): Removed.
443         (EmitContext.CurrentAnonymousMethod): Changed type from
444         AnonymousMethod -> AnonymousContainer.
445         (EmitContext.ResolveTopBlock): Protect from being called twice.
446         (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
447         (EmitContext.EmitThis): Removed the iterators hacks; use the
448         anonymous methods framework for that.
449
450         * statement.cs
451         (ToplevelBlock.Container): Make this a property, not a field.
452         (ToplevelBlock.ReParent): New public method; move the
453         ToplevelBlock into a new container.
454         (Foreach.TemporaryVariable): Simplify.
455
456 2005-06-05  Martin Baulig  <martin@ximian.com>
457
458         * statement.cs (LocalInfo.CompilerGenerated): New flag.
459         (Block.AddTemporaryVariable): New public method; creates a new
460         `LocalInfo' for a temporary variable.
461         (Block.EmitMeta): Create the LocalBuilders for all the temporary
462         variables here.
463         (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
464         non-iterator variables.
465
466 2005-06-05  Martin Baulig  <martin@ximian.com>
467
468         * statement.cs (Foreach.TemporaryVariable): Create the
469         LocalBuilder in the Emit phase and not in Resolve since in some
470         situations, we don't have an ILGenerator during Resolve; see
471         2test-19.cs for an example.
472
473 2005-06-04  Martin Baulig  <martin@ximian.com>
474
475         The big Foreach rewrite - Part II.
476
477         * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
478         with `PropertyInfo ienumerator_getcurrent'.
479
480         * codegen.cs (VariableStorage): Removed.
481
482         * statement.cs
483         (Foreach): Derive from Statement, not ExceptionStatement.
484         (Foreach.CollectionForeach): New nested class.  Moved all the code
485         dealing with collection foreach here.
486         (Foreach.ForeachHelperMethods): Removed.
487         (Foreach.TemporaryVariable): Implement IMemoryLocation.
488
489 2005-05-23  Martin Baulig  <martin@ximian.com>
490
491         * statement.cs (Try.DoResolve): Don't create a `finally' if we
492         don't need to.  Fix #75014.
493
494 2005-05-26  Raja R Harinath  <rharinath@novell.com>
495
496         Improve user-defined conversion handling.
497         * convert.cs (GetConversionOperators): Rewrite.  Return only the
498         applicable operators.
499         (AddConversionOperators): New.  Helper for GetConversionOperators.
500         (FindMostEncompassedType, FindMostEncompassingType): Verify that
501         there is only one most encompassed/encompassing type.
502         (FindMostSpecificSource, FindMostSpecificTarget): Remove
503         "applicable operator" handling.
504         (UserConversion): Move cache here from GetConversionOperators.
505         Directly cache the chosen operator, rather than the whole
506         MethodGroup.
507         (ExplicitNumericConversion): Fix buggy implementation of Decimal
508         case.  Allow conversion of decimal to sbyte and byte too.
509         * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
510         New static methods.  Used to avoid allocating EmptyExpressions in
511         convert.cs.
512
513 2005-05-24  Duncan Mak  <duncan@novell.com>
514
515         * ecore.cs (CastFromDecimal): New class for casting a decimal to
516         another class, used in Convert.ExplicitNumericConversion.
517         (CastToDecimal): New class, similar to above, but casts to
518         System.Decimal, used in Convert.ImplicitNumericConversion and also
519         in explicit convesion from double/float to decimal.
520
521         * convert.cs (ImplicitNumericConversion): Handle implicit
522         conversions to System.Decimal.
523         (ExplicitNumericConversion): handle explicit conversions to
524         System.Decimal.
525
526         This fixes #68711.
527         
528 2005-05-20  Miguel de Icaza  <miguel@novell.com>
529
530         * typemanager.cs: Do not throw an exception in the TypeBuilder
531         case, we take care of it on the TypeCode.
532
533 2005-05-17  Marek Safar  <marek.safar@seznam.cz>
534         
535         * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
536         is back.
537         
538         * cs-parser.jay: Catch more lexical errors.
539         
540         * report.cs: Add one more Error method.
541         
542         * rootcontext.cs,
543         * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
544
545 2005-05-20  Martin Baulig  <martin@ximian.com>
546
547         * class.cs (TypeContainer.CircularDepException): Removed.
548         (TypeContainer.DefineType): Removed the `InTransit' stuff.
549         (TypeContainer.CheckRecursiveDefinition): Check for circular class
550         (CS0146) and interface (CS0529) dependencies here.
551
552 2005-05-20  Martin Baulig  <martin@ximian.com>
553
554         * expression.cs (New.DoResolve): Move the CS0712 check above the
555         CS0144 check; otherwise it can never be reached.
556
557 2005-05-20  Martin Baulig  <martin@ximian.com>
558
559         * cs-parser.jay: Fix CS0080 check; add CS0231 and CS0257 from MCS.
560
561 2005-05-20  Martin Baulig  <martin@ximian.com>
562
563         * class.cs (TypeContainer.DefineType): Fix CS0698 check.
564
565         * typemanager.cs (TypeManager.IsAttributeType): New public method.
566
567 2005-05-19  Martin Baulig  <martin@ximian.com>
568
569         * delegate.cs
570         (ImplicitDelegateCreation.Check): Added `bool check_only' argument
571         to disable error reporting.
572
573         * convert.cs (Convert.ImplicitStandardConversionExists): Use it
574         here since we don't want to report an error; see the new test-336.cs.
575
576 2005-05-19  Raja R Harinath  <rharinath@novell.com>
577
578         * statement.cs (ToplevelBlock.GetParameterReference)
579         (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
580         Move here from class Block.
581         * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
582         * expression.cs (ParameterReference.DoResolveBase): Likewise.
583
584 2005-05-18  Martin Baulig  <martin@ximian.com>
585
586         Fix #74978.
587
588         * flowanalysis.cs
589         (FlowBranching.Reachability): Add non-static public And() and Or()
590         methods.
591         (FlowBranchingSwitch): New class; do the `break_origins' thing
592         like in FlowBranchingLoop.
593         (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
594         reachability, not just locals and parameters.
595         (FlowBranching.MergeChild): Remove some of the hacks for loop and
596         switch; MergeBreakOrigins() now takes care of that.
597
598 2005-05-18  Martin Baulig  <martin@ximian.com>
599
600         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
601         a loop and may leave it, reset the barrier; fixes #74974.
602
603 2005-05-16  Raja R Harinath  <rharinath@novell.com>
604
605         Fix test-382.cs.  Emit values of decimal constants.
606         * class.cs (TypeContainer.RegisterFieldForInitialization): New.
607         Carved out of ...
608         (TypeContainer.AddField): ... this.
609         (TypeContainer.EmitFieldInitializers): Allow the list of fields
610         with initializers to include 'Const's.
611         (ClassPart.RegisterFieldForInitialization): Forward to
612         PartialContainer.
613         * const.cs (Const.Const): Pass initializer to base class.
614         (Const.Define): In case of decimal constants, register them for
615         initialization in a static constructor.
616
617 2005-05-14  Martin Baulig  <martin@ximian.com>
618
619         * statement.cs (Block.Resolve): Correctly handle unreachable code;
620         do not call ResolveUnreachable() on unreachable statements in
621         here, see the comment in the source code.
622
623 2005-05-13  Raja R Harinath  <rharinath@novell.com>
624
625         Fix #74934.
626         * expression.cs (BinaryResolveOperator): If one of the operands of
627         an equality comparison is 'null' and the other is a pointer type,
628         convert the null to a NullPointer.
629         * convert.cs (ImplicitReferenceConversion): If the expression is a
630         NullLiteral and the target type is a pointer type, return a
631         NullPointer instead.
632         (ImplicitConversionStandard): Likewise.
633
634 2005-05-13  Marek Safar  <marek.safar@seznam.cz>
635         
636         * cs-parser.jay: Set readonly context based on special constructs.
637         
638         * expression.cs (LocalVariableReference.DoResolveBase): Improved
639         readonly variable error handling.
640         
641         * rootcontext.cs (EmitCode): Don't verify members when error
642         occurred.
643         
644         * statement.cs (LocalInfo): Add reaodnly context information.
645         (SetReadOnlyContext, GetReadOnlyContext): New methods.
646
647 2005-05-17  Martin Baulig  <martin@ximian.com>
648
649         * expression.cs (Argument.Resolve): Turn on flow analysis; fix
650         #70970. 
651
652 2005-05-13  Martin Baulig  <martin@ximian.com>
653
654         * statement.cs (Block.Resolve, ResolveUnreachable): Correctly
655         handle unreachable blocks.
656
657 2005-05-13  Martin Baulig  <martin@ximian.com>
658
659         * class.cs
660         (ConstructorInitializer.GetOverloadedConstructor): Don't crash.
661         (MethodCore.CheckCore): Use TypeManager.IsEqual(); fix #74904 and
662         #74905. 
663
664 2005-05-13  Martin Baulig  <martin@ximian.com>
665
666         * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
667         instance variable, not a local.  Fix #74873.
668         (Block.ResolveUnreachable): Set it to true here.
669
670 2005-05-12  Martin Baulig  <martin@ximian.com>
671
672         * cs-parser.jay (property_declaration): Pass the `current_class',
673         not the `current_container' to Property's .ctor.  Fixes #74912.
674
675 2005-05-11  Martin Baulig  <martin@ximian.com>
676
677         * typemanager.cs (Closure): Copy this from MCS and merge all the
678         GMCS-specific changes into it.
679
680 2005-05-12  Raja R Harinath  <harinath@gmail.com>
681
682         Fix #74920.
683         * typemanager.cs (unmanaged_enclosing_types): New.
684         (IsUnmanagedType): Avoid infloops by using
685         'unmanaged_enclosing_types' to talk with recursive invocations.
686
687 2005-05-11  Duncan Mak  <duncan@novell.com>
688
689         * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
690         continuing to process for 'arg'.
691         (handle_preprocessing_directive): Check the argument of the #endif
692         directive and report error CS1025 if there are any trailing
693         characters.
694
695         According to the C# spec, having even whitespace after the #endif
696         directive is illegal; however, because we call arg.TrimEnd ()
697         beforehand, we have the same behavior as csc, allowing whitespace
698         after the directive.
699
700         Fixes #74892.
701
702 2005-05-11  Marek Safar  <marek.safar@seznam.cz>
703
704         Fix #74863.
705         
706         * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
707         (Constructor.GetObsoleteAttribute): Implemented correctly.
708
709 2005-05-10  Martin Baulig  <martin@ximian.com>
710
711         * generic.cs (Constraints.Resolve): Report CS0246 if we cannot
712         resolve the type; fixes #74864.
713         (DefaultValueExpression): Create the LocalTemporary in Emit(), not
714         in DoResolve(); fixes #74862.
715
716 2005-05-10  Martin Baulig  <martin@ximian.com>
717
718         * support.cs (ReflectionParameters.ParameterModifier): Use
719         `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
720         and `ParameterAttributes.In'.  Fixes #74884.
721
722 2005-05-10  Martin Baulig  <martin@ximian.com>
723
724         * typemanager.cs (TypeManager.MemberLookup_FindMembers): Don't use
725         the cache if we're just looking for `MemberTypes.NestedType' in a
726         generic instance.
727
728         * ecore.cs (Expression.ResolveAsTypeTerminal): Don't check the
729         constraints if we're still resolving the type tree.
730         (Expression.MemberLookup): If we're resolving the type tree, only
731         look for `MemberTypes.NestedType' since we're only interested in
732         getting types.
733
734         * class.cs (TypeContainer.DefineType): Don't resolve the type
735         parameters here; do this later in ResolveType() after the type
736         tree has been resolved.
737         (TypeContainer.ResolveType): New public method; this is called
738         after the type tree is resolved and before the types are being
739         populated.  We resolve the generic constraints here.
740         (TypeContainer.DoDefineMember): Check the constraints on our base
741         class and interfaces.
742
743         * decl.cs (DeclSpace.ResolveBaseTypeExpr): Make this protected;
744         set the `ResolvingTypeTree' flag on the EmitContext.
745
746         * codegen.cs (EmitContext.ResolvingTypeTree): New public field.
747
748 2005-05-10  Marek Safar  <marek.safar@seznam.cz>
749
750         * class.cs (Method.Define): Catch attempt for Finalizer declaration.
751         
752         * expression.cs (Argument.GetParameterModifier): Turned to property.
753         (Invocation.Error_InvalidArguments): Add more descriptive errors.
754         
755         * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
756         its C# equivalent.
757         
758 2005-05-09  Raja R Harinath  <rharinath@novell.com>
759
760         Fix #74852.
761         * decl.cs (MemberCache.AddMethods): Register override methods,
762         rather than non-override methods.
763         * typemanager.cs (RegisterOverride): New.
764         (IsOverride): Update.
765
766 2005-05-09  Marek Safar  <marek.safar@seznam.cz>
767
768         * typemanager.cs (TypeManager): Moved InitGenerics to Reset method.
769
770 2005-05-06  Martin Baulig  <martin@ximian.com>
771
772         * attribute.cs
773         (Attributable.IsClsComplianceRequired): Fix typo in the method name.
774         (AttributeTester.AnalyzeTypeCompliance): Add generics support.
775
776 2005-05-09  Marek Safar  <marek.safar@seznam.cz>
777
778         Fix #73105.
779         
780         * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
781         recursive declaration.
782         
783         * statement.cs (Block.ResolveMeta): Report any error in resolving.
784         
785 2005-05-06  Marek Safar  <marek.safar@seznam.cz>
786
787         * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
788         
789         * expression.cs (Binary.DoResolve): (x && 0) is always 0.
790
791 2005-05-05  Raja R Harinath  <rharinath@novell.com>
792
793         Fix #74797.
794         * decl.cs (DeclSpace.FamilyAccessible): 
795         Use TypeManager.IsNestedFamilyAccessible.
796
797         Fix reopened #64812.
798         * typemanager.cs (Closure.Filter): Introduce checks for 'protected
799         internal'.
800
801 2005-05-04  Raja R Harinath  <rharinath@novell.com>
802             Abin Thomas  <projectmonokochi@rediffmail.com>
803             Anoob V E  <projectmonokochi@rediffmail.com>
804             Harilal P R  <projectmonokochi@rediffmail.com>
805
806         Fix #64812.
807         * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
808         allow access to all static members.
809
810 2005-05-04  Martin Baulig  <martin@ximian.com>
811
812         * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
813
814 2005-05-04  Martin Baulig  <martin@ximian.com>
815
816         Fix #74655.
817
818         * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
819         section at the end; make things work if `default' is not the last
820         section.        
821
822 2005-05-04  Martin Baulig  <martin@ximian.com>
823
824         Fix #70400.
825
826         * statement.cs (Switch): Replaced the `got_default' field with a
827         `default_section' one.
828         (Switch.CheckSwitch): Set `default_section' here.
829         (Switch.Resolve): If we're a constant switch and the constant is
830         not found, use the default section.
831
832 2005-05-03  Martin Baulig  <martin@ximian.com>
833
834         * expression.cs (ArrayAccess.EmitGetLength): New public method.
835
836         * statement.cs (Foreach.ArrayForeach): New nested class.
837         (Foreach.TemporaryVariable): New nested class.
838         (Foreach.EmitArrayForeach): Removed; this is now in the new
839         ArrayForeach class.
840
841 2005-05-03  Raja R Harinath  <rharinath@novell.com>
842
843         * pending.cs (BaseImplements): Move the #74773 fix here.  This is
844         more conservative.
845         (VerifyPendingMethods): Revert change below.
846
847         * typemanager.cs (IsOverride, RegisterNonOverride): New.
848         * decl.cs (MemberCache.AddMethod): Register "non-override" methods
849         that used to trigger warning -28.  Remove warning -28.
850         * expression.cs (Invocation.OverloadResolve): Use
851         TypeManager.IsOverride to distinguish override methods.
852
853         Fix #74773.
854         * pending.cs (VerifyPendingMethods): If a base type implements the
855         requested interface, don't bother checking individual methods of
856         the base type.  As a side-effect, this prevents the creation of
857         unnecessary proxies.
858
859 2005-05-02  Martin Baulig  <martin@ximian.com>
860
861         Fix #70182.
862
863         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
864         Also `And' the locals if the old vector is null.
865         (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
866         null; in this case we basically reset all the variables.        
867
868 2005-05-02  Martin Baulig  <martin@ximian.com>
869
870         Fix #74529.
871
872         * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
873         Added `FlowBranching branching' argument; always `and' the
874         variables instead of `or'ing them unless we're an infinite loop.
875
876         * statement.cs (While.Resolve): Create a new sibling unless we're
877         infinite.       
878
879 2005-05-02  Martin Baulig  <martin@ximian.com>
880
881         Fix #70140.
882
883         * class.cs (ConstructorInitializer.Resolve): Added `Block block'
884         arguments; use it instead of creating a new TopLevelBlock.
885         (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
886         our ConstructorInitializer.
887
888         * statement.cs
889         (TopLevelBlock.TopLevelBranching): New public property.
890         (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
891         and create our `TopLevelBranching'.
892
893         * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
894         anonymous method host, use `block.TopLevelBranching' rather than
895         creating a new branching.
896
897 2005-04-20  Miguel de Icaza  <miguel@novell.com>
898
899         * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
900         a ScopeInfo, if any of the current children is a child of the new
901         entry, move those children there.
902
903 2005-04-30  Martin Baulig  <martin@ximian.com>
904
905         * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
906         at the beginning of a SwitchSection.  Fix #73335.
907
908 2005-04-27  Marek Safar  <marek.safar@seznam.cz>
909
910         Fix #74378
911         * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
912         
913         * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
914         (FieldExpr.DoResolve): Obsolete members are ignored for field
915         initializers.
916         
917 2005-04-26  Marek Safar  <marek.safar@seznam.cz>
918
919         * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
920         of arrays detection.
921
922         * class.cs (Interface.VerifyClsCompliance): Add base interfaces
923         verification.
924         (Field.VerifyClsCompliance): Volatile fields are not compliant.
925
926         * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
927         arrays report.
928
929 2005-04-25  Ben Maurer  <bmaurer@ximian.com>
930
931         * cs-parser.jay: Use the prefered version of -unsafe in error
932         message.
933
934 2005-04-22  Marek Safar  <marek.safar@seznam.cz>
935
936         * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
937         circumstances.
938
939 2005-04-20  John Luke  <john.luke@gmail.com>
940
941         * driver.cs: fix typo in error message, --outout to --output
942
943 2005-04-30  Martin Baulig  <martin@ximian.com>
944
945         * attribute.cs (Attribute.CheckSecurityActionValidity): Correctly
946         handle the .NET 2.x security attributes.
947
948 2005-04-30  Martin Baulig  <martin@ximian.com>
949
950         * typemanager.cs
951         (TypeManager.ExpandInterfaces): Don't add things twice.
952
953         * class.cs
954         (TypeContainer.VerifyClsCompliance): Allow generic instances.
955
956 2005-04-29  Martin Baulig  <martin@ximian.com>
957
958         * generic.cs (Constraints.ResolveTypes): Expand interfaces.
959
960         * anonymous.cs: Added support for anonymous generic methods.
961
962 2005-04-29  Martin Baulig  <martin@ximian.com>
963
964         * typemanager.cs (TypeManager.GetInterfaces): Correctly handle
965         generic instances.
966
967 2005-04-29  Martin Baulig  <martin@ximian.com>
968
969         * generic.cs (TypeManager.HasConstructorConstraint): Removed.
970
971         * expression.cs (New.DoResolve): Fix the CS0304 check.
972
973 2005-04-29  Martin Baulig  <martin@ximian.com>
974
975         * typemanager.cs (TypeManager.GetFullName): Updated to the new
976         naming schema.
977
978         * class.cs (MethodCore.IsDuplicateImplementation): If we're an
979         explicit interface implementation, compare the interface types.
980         (MethodData.Define): Use the new naming scheme from the latest
981         .NET 2.x beta2.
982         (MemberBase.DoDefineBase): Resolve `InterfaceType' here.
983
984         * decl.cs (MemberName.GetMemberName): Removed.
985         (MemberName.MethodName, FullName): New properties.
986
987 2005-04-25  Raja R Harinath  <rharinath@novell.com>
988
989         * gmcs.exe.config: Update v2.0.40607 -> v2.0.50215.
990
991 2005-04-22  Martin Baulig  <martin@ximian.com>
992
993         * generic.cs (GenericMethod): Create the EmitContext in the
994         `Define()'; in `Define(MethodBuilder)', create the type parameters
995         before calling `Define()'.  Fixes #73933.
996
997 2005-04-22  Martin Baulig  <martin@ximian.com>
998
999         * generic.cs
1000         (Constraints.Resolve): Make things work wrt. the new type lookup system.
1001         (ConstructedType.ResolveAsTypeTerminal): Don't override this.
1002
1003         * ecore.cs (Expression.ResolveAsTypeTerminal): If `te' is a
1004         ConstructedType, check its constraints.
1005
1006 2005-04-20  Marek Safar  <marek.safar@seznam.cz>
1007
1008         * codegen.cs (InRefOutArgumentResolving): New field.
1009         
1010         * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
1011         fields outside contructor.
1012         
1013         * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
1014         
1015 2005-04-19  Miguel de Icaza  <miguel@novell.com>
1016
1017         * anonymous.cs (CaptureContext.EmitParameterInstance): The
1018         parameter code was not completed ever, so it was not as up-to-date
1019         as local variables.  Must finish it.
1020
1021         The bug fix was to compare the Toplevel of the block, not the
1022         current block.  Thanks for Ben for pointing this out. 
1023
1024 2005-04-19  Raja R Harinath  <rharinath@novell.com>
1025
1026         * decl.cs (AddMethods): Use the declaring type of the problem
1027         method to determine if we want to squash a warning.
1028
1029 2005-04-19  Marek Safar  <marek.safar@seznam.cz>
1030
1031         * attribute.cs: Removed debug output.
1032
1033         * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
1034         
1035         * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
1036         Report.Stderr.
1037         
1038 2005-04-18  Raja R Harinath  <rharinath@novell.com>
1039
1040         Fix #74481.
1041         * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
1042         (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
1043         all null comparisons against reference types.
1044
1045 2005-04-18  Marek Safar  <marek.safar@seznam.cz>
1046
1047         Fix# 74565
1048         * class.cs (TypeContainer.CircularDepException) New nested
1049         exception class.
1050         (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
1051         (TypeContainer.DefineType): Removed error, reset InTransit before
1052         exit.
1053         (Class.DefineType): Throw exception when is in Transit.
1054         Catch exception and report error.
1055         (Struct.DefineType): Throw exception when is in Transit.
1056         Catch exception and report error.
1057         (Interface.DefineType): Throw exception when is in Transit.
1058         Catch exception and report error.
1059
1060         * codegen.cs: Add InCatch,InFinally to EmitContext to easily
1061         handle nested exception handlers.
1062
1063         * flowanalysis.cs (InTryWithCatch): New method, search for try with
1064         a catch.
1065
1066         * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
1067         InFinally and InCatch storage.
1068
1069         * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
1070         (Catch.Resolve): Set and Restore ec.InCatch.
1071         (Try.Resolve): Set and Restore ec.InFinally.
1072         (Try.HasCatch): True when try has catch.
1073
1074 2005-04-17  Atsushi Enomoto  <atsushi@ximian.com>
1075
1076         * doc.cs : In some cases FilterName returns MonoEvent and MonoField
1077           for the same event member, so exclude such cases from warning 419.
1078           Fixed bug #74633.
1079
1080 2005-04-16  Miguel de Icaza  <miguel@novell.com>
1081
1082         * expression.cs (Binary.ResolveOperator): Apply patch from John
1083         Luke to fix bug 59864: operators &, | and ^ on enumerations
1084         require that the same enum type on both sides.
1085
1086         * driver.cs: Add warnings to old flag usage, this is to assist
1087         people who produce Makefiles and hope that the Makefiles will be
1088         used on Windows.
1089
1090         * class.cs (TypeContainer.EmitType): Moved the definition of the
1091         special $PRIVATE$ field from the resolve phase to the Emit phase.
1092         During resolve we do not know if we are a struct with
1093         HasExplicitLayout, we know this only after the attributes for the
1094         type are emitted.
1095
1096         Set the FieldOffset to zero on the dummy field that we create for
1097         the class.   Fixes 74590.
1098
1099 2005-04-16  Raja R Harinath  <rharinath@novell.com>
1100
1101         Fix #73834.
1102         * ecore.cs (PropertyExpr.resolved): New.
1103         (DoResolve): Use it to handle a case of double resolution here.
1104         Handle a case of identical-name-and-type-name.
1105         * expression.cs (ArrayCreation.CheckIndices): Avoid double
1106         resolution by storing the results of expression resolution back
1107         into the "probes" array.
1108
1109 2005-04-15  Raja R Harinath  <rharinath@novell.com>
1110
1111         Fix cs0208-7.cs and cs0208-8.cs.
1112         * typemanager.cs (IsUnmanagedType): Arrays are not allowed
1113         (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0).  Improve
1114         error reporting to point out the reason a struct is not unmanaged.
1115
1116 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
1117
1118         * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and 
1119           just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
1120
1121 2005-04-13  Raja R Harinath  <rharinath@novell.com>
1122
1123         Fix #74528.
1124         * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
1125         IdenticalNameAndTypeName here.
1126         (EventExpr.InstanceResolve): Likewise.
1127
1128 2005-04-13  Marek Safar  <marek.safar@seznam.cz>
1129
1130         C# 2.0 DefaultCharSetAttribute implementation
1131         
1132         * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
1133         which allows us to set GlobalNamespace for every resolve.
1134         (Attribute.ResolveArguments): Cut from Resolve.
1135         (Attribute.GetCharSetValue): Returns CharSet named argument.
1136         (Attribute.DefinePInvokeMethod): Gets default charset from
1137         module settings.
1138         (GlobalAttribute.ResolveAsTypeStep): Override.
1139         (GlobalAttribute.ResolveArguments): Override.
1140         
1141         * class.cs (TypeAttr): Is protected.
1142         
1143         * codegen.cs (ModuleClass.DefaultCharSet): New member.
1144         (ModuleClass.DefaultCharSetType): New memeber.
1145         (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
1146         
1147         * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
1148         charset from module.
1149         
1150         * delegate.cs (TypeAttr): Override.
1151         (Delegate.DefineType): Use this TypeAttr.
1152         
1153         * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
1154         at very early stage (before types are defined) to resolve model
1155         module attributes. It will probably not work with corlib but it
1156         should be ok.
1157         
1158         * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
1159         charset from module.
1160         
1161         * typemanager.cs (default_charset_type): New type.
1162
1163 2005-04-13  Raja R Harinath  <rharinath@novell.com>
1164
1165         * decl.cs (MemberCache.AddMethods): Don't warn if
1166         System.Object.Finalize has buggy MethodAttributes.
1167
1168         * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
1169         removed below.
1170
1171 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
1172
1173         * doc.cs : detect ambiguous reference to overloaded members.
1174           Fixed bug #71603. MS 1.1 csc does not detect it.
1175
1176 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
1177
1178         * doc.cs : delegates must not be referenced with parameters.
1179           Fixed bug #71605.
1180
1181 2005-04-12  Miguel de Icaza  <miguel@novell.com>
1182
1183         * typemanager.cs (IsUnmanagedType): Arrays are allowed.
1184
1185 2005-04-10  Miguel de Icaza  <miguel@novell.com>
1186
1187         * driver.cs (MainDriver): Stop processing if the CLS stage found
1188         errors. 
1189
1190         (CompilerCallableEntryPoint.InvokeCompiler): Always
1191         reset after execution;   Take a TextWriter argument for the
1192         output.
1193
1194         * report.cs: Use the error stream instead of hardcoding stderr. 
1195
1196 2005-04-09  Miguel de Icaza  <miguel@novell.com>
1197
1198         * class.cs: Reduce code paths to test, too small of an
1199         optimization to make it worth the extra testing.  Always perform
1200         it. 
1201
1202 2005-04-08  Raja R Harinath  <rharinath@novell.com>
1203
1204         Fix #74510.
1205         * class.cs (OperatorArrayList.CheckPairedOperators): Skip
1206         operators that had errors reported on them.
1207
1208 2005-04-08  Marek Safar  <marek.safar@seznam.cz>
1209
1210         * attribute.cs (Attribute.IsValidArgumentType): Test valid named
1211         argument types.
1212         (Attribute.Resolve): Add named argument type checking.
1213         
1214         * class.cs (FixedField.Define): Use IsPrimitiveType
1215         
1216         * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
1217         
1218         * iterators.cs (Iterator.DefineIterator): Add check for arglist and
1219         unsafe parameter types.
1220         
1221         * statement.cs (Using.ResolveExpression): Add better error description.
1222         
1223         * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
1224         
1225 2005-04-08  Raja R Harinath  <rharinath@novell.com>
1226
1227         Fix #74484.
1228         * attribute.cs (Attribute.GetAttributeUsage): Resolve
1229         AttributeUsageAttribute in the emitcontext of the attribute class,
1230         not in the emitcontext of the attributable entity it was attached to.
1231         * cs-parser.jay: Use 'current_class', not 'current_container',
1232         when creating a GlobalAttribute.
1233
1234 2005-04-08  Alp Toker  <alp@atoker.com>
1235
1236         * pending.cs: The fix to #58413 failed to compile methods implementing
1237         interfaces with/without params modifiers and vice versa, even though
1238         params modifiers aren't part of the signature. Make the modifier check
1239         less strict as in csc.
1240
1241 2005-04-07  Abin Thomas  <projectmonokochi@rediffmail.com>
1242             Anoob V E  <projectmonokochi@rediffmail.com>
1243             Harilal P R  <projectmonokochi@rediffmail.com>
1244
1245         Fix #58413.
1246         * pending.cs (TypeAndMethods.mods): New.  Store the parameter
1247         modifiers of pending methods.
1248         (PendingImplementation.PendingImplementation): Initialize it.
1249         Add Parameter.Modifier [][] mods and initialize it with ParameterData.
1250         (PendingImplementation.InterFaceMethod): Repalce Type[] argument
1251         with ParameterData.  Add check for modifiers.
1252         * class.cs (MethodData.Define): Update to changes.
1253
1254 2005-04-07  Raja R Harinath  <rharinath@novell.com>
1255
1256         * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
1257
1258 2005-04-07  Marek Safar  <marek.safar@seznam.cz>
1259
1260         * class.cs (PropertyMethod.Define): Check private accessor in abstract
1261         property.
1262         
1263         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
1264         
1265         * rootcontext.cs,
1266         * typemanager.cs: Registered RequiredAttributeAttribute.
1267         
1268 2005-04-06  Marek Safar  <marek.safar@seznam.cz>
1269
1270         * class.cs (VerifyMembers): Doesn't need EmitContext argument.
1271         Warning CS0169 is back at level 3.
1272         (IMethodData.SetMemberIsUsed): New method.
1273         
1274         * decl.cs (IsUsed): New value; moved from FieldBase.Status
1275         (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
1276         
1277         * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
1278
1279         * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
1280         contants.
1281         (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
1282         is used.
1283         
1284         * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
1285         is used.
1286         
1287         * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
1288         to avoid the problems with nested types.
1289
1290 2005-04-05  Abin Thomas  <projectmonokochi@rediffmail.com>
1291             Anoob V.E  <projectmonokochi@rediffmail.com>
1292             Harilal P.R  <projectmonokochi@rediffmail.com>
1293             Raja R Harinath  <rharinath@novell.com>
1294
1295         Fix #73820.
1296         * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
1297         attribute.
1298         * typemanager (GetConstructor): Make public.
1299
1300 2005-04-05  John Luke  <john.luke@gmail.com>
1301             Raja R Harinath  <rharinath@novell.com>
1302
1303         Fix #62232.
1304         * typemanager.cs (IsUnmanagedType): Check non-public fields of a
1305         struct too.  Return false quicker in a few cases.
1306         (VerifyUnManaged): Use it.
1307
1308 2005-04-05  Raja R Harinath  <rharinath@novell.com>
1309
1310         Fix #74041.
1311         * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
1312         not 'unreachable_seen'.
1313
1314 2005-04-04  Marek Safar  <marek.safar@seznam.cz>
1315
1316         * attribute.cs (Attribute.GetValue): Removed unused.
1317         
1318         * codegen.cs (CodeGen.TrimExt): Removed unused.
1319         
1320         * cs-parser.jay (output): Removed unused.
1321         
1322         * cs-tokenizer.cs (hex_digits): Removed unused.
1323         
1324         * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
1325         
1326         * expression.cs (Indirection.LoadExprValue): Removed unused.
1327         (ArrayCreation.ExpressionToArrayArgument): Removed unused.
1328         
1329         * iterators.cs (Iterator.param_types): Removed unused.
1330         
1331         * statement.cs (Goto.block): Removed unused.
1332         (ToplevelBlock.did): Removed unused.
1333         (Switch.ResolveConstantSwitch): Removed unused.
1334
1335 2005-04-01  Ben Maurer  <bmaurer@ximian.com>
1336
1337         * rootcontext.cs: Allow mcs to bootstrap with the compilation
1338         resetting thingy.
1339
1340 2005-04-19  Martin Baulig  <martin@ximian.com>
1341
1342         Merged r42462 from MCS and made it work for GMCS.
1343
1344         * class.cs (MethodCore.ds): Moved this field to `MemberBase'.
1345
1346         * generic.cs (GenericMethod.Define): Removed `return_type' argument.
1347
1348 2005-04-01  Raja R Harinath  <rharinath@novell.com>
1349
1350         Fix #74232 and cs0208-3.cs.
1351         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
1352         * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
1353         unmanaged type.  Don't use FieldBuilders when 't' is a
1354         TypeBuilder.  Use ModFlags and MemberType fields.
1355         * class.cs (MemberBase.member_type): Rename from MemberType.
1356         (MemberBase.MemberType): New property.  Determines member_type on
1357         demand.
1358         (MemberBase.DoDefine): Don't initialize MemberType here.
1359         (FieldMember.Define): Likewise.
1360
1361 2005-04-01  Marek Safar  <marek.safar@seznam.cz>
1362
1363         Fix #74241
1364         * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
1365         Attributes are emitted there.
1366         
1367 2005-04-01  Raja R Harinath  <rharinath@novell.com>
1368
1369         * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
1370         keyword in 'partial enum' too.
1371         * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
1372         is not allowed).
1373         Report from Kamil Skalski <nazgul@omega.pl>.
1374
1375         Fix #74309.
1376         * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
1377         have partial containers too.
1378
1379         * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
1380         in block' checks to Block.CheckInvariantMeaningInBlock.
1381         * statement.cs (Block.GetKnownVariableInfo): Make private.
1382         (Block.IsVariableUsedInChildBlock): Remove.
1383         (Block.IsVariableUsedInBlock): Likewise.
1384         (Block.CheckInvariantMeaningInBlock): New.  Show location of
1385         conflicting declaration.
1386         (Block.AddVariable): Make error messages less long-winded and more
1387         specific.  Show location of conflicting declaration.
1388         * parameter.cs (Parameters.Location): New readonly property.
1389
1390 2005-03-31  Raja R Harinath  <rharinath@novell.com>
1391
1392         Clean up semantics of invoking ResolveMemberAccess.
1393         * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
1394         can have an instance, ensure that we pass in a non-TypeExpression
1395         to ResolveMemberAccess.  Tighten up IdenticalNameAndTypeName checks.
1396         (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
1397         argument.  Update to changes and simplify.
1398         (FieldExpr.Emitinstance): Remove CS0120 check.
1399         (PropertyExpr.EmitInstance): Likewise.
1400         * expression.cs (Argument.Resolve): Likewise.
1401         (Invocation.DoResolve): Update to changes in semantics of
1402         InstanceExpression.
1403
1404 2005-03-31  Marek Safar  <marek.safar@seznam.cz>
1405
1406         Fix #74241
1407         * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
1408         customization.
1409         
1410         * decl.cs (MemberCache.AddMethods): Fix infinite loop.
1411
1412 2005-03-31  Raja R Harinath  <rharinath@novell.com>
1413
1414         Fix difference in behaviour with commandline invocation.
1415         * driver.cs (Driver.Reset): New.
1416         (CompilerCallableEntryPoint): Call it.
1417
1418         * statement.cs (If.Resolve): Avoid spurious "uninitialized
1419         variable" warnings if the boolean expression failed to resolve.
1420
1421 2005-03-30  Sebastien Pouliot  <sebastien@ximian.com>
1422
1423         * attribute.cs: Fix the union of several permissions when some of them
1424         are unrestricted (so the result isn't an unrestricted permission set).
1425         Fix #74036.
1426
1427 2005-03-30  Raja R Harinath  <rharinath@novell.com>
1428
1429         * ecore.cs (MemberExpr): New class.  Convert from interface
1430         IMemberExpr.
1431         (MemberExpr.ResolveMemberAccess): Refactor and move here from
1432         MemberAccess.ResolveMemberAccess.  Tighten up pre-conditions and
1433         error checks.
1434         (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
1435         (MethodGroupExpr.IsExplicitImpl): Remove.
1436         (Expression.GetFieldFromEvent): Remove.
1437         (SimpleName.MemberStaticCheck): Remove.
1438         (SimpleName.DoSimpleNameResolve): Update to changes.
1439         * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
1440         (MemberAccess.IdenticalNameAndTypeName): Remove.
1441         (MemberAccess.error176): Move to MemberExpr.
1442         (MemberAccess.DoResolve): Update to changes.
1443         (BaseAccess.DoResolve): Likewise.
1444
1445 2005-03-30  Marek Safar  <marek.safar@seznam.cz>
1446
1447         C# 2.0 Conditional attribute class implementation
1448         
1449         * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
1450         Analyzes class whether it has attribute which has ConditionalAttribute
1451         and its condition is not defined.
1452         
1453         * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
1454         (Class.IsExcluded): New method. Search for at least one defined
1455         condition in ConditionalAttribute of attribute class.
1456
1457 2005-03-30  Raja R Harinath  <rharinath@novell.com>
1458
1459         * ecore.cs (PropertyExpr): Derive from Expression, not
1460         ExpressionStatement.
1461         (PropertyExpr.EmitStatement): Remove.
1462
1463 2005-03-29  Raja R Harinath  <rharinath@novell.com>
1464
1465         Fix #74060.
1466         * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
1467         internal field "value__" of an enum be private.  The examples for
1468         "value__" that I found on MSDN all used FieldAttributes.Private.
1469
1470         * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
1471         Don't mention IL method attribute names.
1472
1473         Fix #47991.  Remove a TODO.
1474         * statement.cs (Block.Toplevel): Make into a field.
1475         (Block.Parameters): Move into ToplevelBlock.
1476         (Block.known_variables): Rename from child_variable_names.
1477         (Block.Block): Remove variants that take Parameters.  Initialize
1478         'Toplevel' with the immediately surrounding toplevel block.
1479         (Block.AddKnownVariable): Rename from AddChildVariableName.  Add a
1480         LocalInfo parameter.
1481         (Block.GetKnownVariableInfo): New.
1482         (Block.IsVariableNameUsedInChildBlock): Update.
1483         (Block.IsVariableNameUsedInBlock): New.  Checks if a name is used in
1484         the block, even though it may not be in scope.
1485         (Block.AddVariable): Remove Parameters parameter.  Use
1486         Toplevel.Parameters instead.
1487         (Block.AddConstant): Remove Parameters parameter.
1488         (Block.GetParameterReference): Update to use Toplevel.Parameters.
1489         (Block.IsParamaterReference): Likewise.
1490         (Block.IsLocalParameter): Likewise.  Simplify a lot.
1491         (ToplevelBlock.Parameters): New.  Moved from Block.
1492         (ToplevelBlock.ToplevelBlock): Update to changes.  Always
1493         initialize Parameters to a non-null value.
1494         * cs-parser.jay: Update to changes.
1495         * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
1496         simple names that mean different things in the same block.  Use
1497         Block.IsVariableNameUsedInBlock.
1498
1499 2005-03-28  Raja R Harinath  <rharinath@novell.com>
1500
1501         * enum.cs (Enum.LookupEnumValue): Remove debugging code.
1502
1503 2005-03-26  Raja R Harinath  <harinath@acm.org>
1504
1505         Fix #73038.
1506         * assign.cs (Assign.DoResolve): When the RHS of an assignment
1507         fails to resolve, ensure that the LHS is still resolved as an
1508         lvalue.
1509
1510 2005-03-25  Raja R Harinath  <harinath@acm.org>
1511
1512         * enum.cs (Enum.DefineType): Set ec.InEnumContext and
1513         ec.ContainerType.
1514         (Enum.current_ec): Remove.
1515         (Enum.LookupEnumValue): Remove EmitContext argument.
1516         Just uses the one created during DefineType.
1517         (Enum.FindMembers): Update.
1518         * expression.cs (MemberAccess.DoResolve): Update.
1519
1520 2005-03-22  Marek Safar  <marek.safar@seznam.cz>
1521
1522         * assign.cs (Assign.DoResolve): Check for CS1717 when
1523         source and target are same (uses Equals).
1524
1525         * expression.cs (LocalVariableReference, ParameterReference,
1526         This): Implemented Equals, GetHashCode.
1527
1528         * statement.cs (Block.GetParameterReference): Removed useless
1529         local variable.
1530
1531 2005-03-22  Raja R Harinath  <rharinath@novell.com>
1532
1533         Fix cs0128.cs
1534         * statement.cs (Block.AddVariable): Ensure that we skip implicit
1535         blocks before deciding whether the error is cs0136 or cs0128.
1536
1537         * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
1538         (using_alias_directive, using_namespace_directive): Pass
1539         MemberName, not an expression to Namespace.UsingAlias and
1540         Namespace.Using.
1541         (MakeName): Use the MemberName of the namespace.
1542         * namespace.cs (Namespace.MemberName): New.
1543         (UsingEntry.UsingEntry): Take a MemberName, not an expression.
1544         (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
1545         Likewise.
1546         * decl.cs (MemberName.Name): Make readonly.
1547         (MemberName.FromDotted): New "constructor".
1548         (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
1549         (MemberCore.Name): Compute from MemberName on demand.
1550         (MemberCore.SetMemberName): Provide a way to change the
1551         MemberName.
1552         (MemberCore.AddToContainer): Don't take a fullname parameter.
1553         * class.cs (TypeContainer.AddToMemberContainer): Don't add the
1554         fully qualified name of the container to the member name.
1555         (TypeContainer.AddToTypeContainer): Use a fully qualified name
1556         only if the type is a member of the root container.
1557         (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
1558         MemberName.Left rather than searching for an embedded ".".
1559         (PartialContainer.CreatePart): Update to changes in RootContext.
1560         (MemberBase.ShortName): Turn into a property.  Use
1561         MemberCore.SetMemberName.
1562         (MemberBase.ExplicitInterfaceName): Remove.
1563         (MemberBase.UpdateMemberName): Remove.
1564         (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
1565         (PropertyBase.SetMemberName): New override.
1566         * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
1567         (Tree.GetDecl): New.
1568         (Tree.AllDecls): Rename from Decls.
1569         * attribute.cs, enum.cs, report.cs: Update to changes.
1570         * driver.cs (MainDriver): Use MemberName.FromDotted on
1571         RootContext.MainClass.
1572
1573 2005-03-21  Marek Safar  <marek.safar@seznam.cz>
1574
1575         * class.cs (FixedField.Define): Check for CS1664 and more sanity
1576         checks.
1577
1578         * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
1579
1580 2005-03-18  Marek Safar  <marek.safar@seznam.cz>
1581
1582         * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
1583         property accessor modifiers.
1584
1585         * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
1586         fixed buffer attribute (CS1716).
1587         (PropertyMethod.HasCustomAccessModifier): When property accessor
1588         has custom modifier.
1589
1590         * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
1591         modifiers.
1592         (PropertyExpr.DoResolveLValue): Add CS0272.
1593
1594 2005-03-17  Miguel de Icaza  <miguel@novell.com>
1595
1596         * convert.cs: When converting to a pointer, use the proper Conv.U
1597         or Conv.I depending on the source data type.
1598
1599         * cs-tokenizer.cs: Make the size for large decimal constants,
1600         fixes #72957.
1601
1602 2005-03-17  Martin Baulig  <martin@ximian.com>
1603
1604         * anonymous.cs (AnonymousMethod.method_modifiers): Change default
1605         from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'.  Fixes #73260.
1606
1607 2005-03-17  Martin Baulig  <martin@ximian.com>
1608
1609         * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
1610         to bool so we can return an error condition.
1611         (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
1612         returned an error.
1613
1614 2005-03-16  Zoltan Varga  <vargaz@freemail.hu>
1615
1616         * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
1617         attributes.
1618
1619 2005-03-16  Raja R Harinath  <rharinath@novell.com>
1620
1621         Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
1622         Refactor to avoid traversing the list of assemblies, and to avoid
1623         string concatenation.
1624         * typemanager.cs (guid_attr_type): Remove.
1625         (negative_hits, pointers, references): Remove hashes.
1626         (type_hash): New.
1627         (GetConstructedType): New.  Uses type_hash to handle constructed
1628         types (arrays, references, pointers).
1629         (GetReferenceType, GetPointerType): Use it.
1630         (GetNestedType): New.  Uses type_hash to handle nested types of
1631         reflected types.
1632         (LookupType, LookupTypeDirect): Remove.
1633         (CoreLookupType): Inline parts of old LookupTypeDirect code.  Use
1634         'types' hash and LookupTypeReflection directly.
1635         (params_string, params_object): Use GetConstructedType.
1636         * namespace.cs (Namespace.cached_types): New.  Cache of reflected
1637         top-level types.
1638         (Namespace.Lookup): Use cached_types.
1639         (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
1640         provided by old TypeManager.LookupType.
1641         * rootcontext.cs (MakeFQN): Remove.
1642         * decl.cs (DeclSpace.MakeFQN): Likewise.
1643         (DeclSpace.LookupType): Use TypeManager.GetNestedType.
1644         * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
1645         TypeManager.GetConstructedType.
1646         * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
1647
1648 2005-04-16  Zoltan Varga  <vargaz@freemail.hu>
1649
1650         * cs-parser.jay: Fix build.
1651
1652 2005-03-15  Marek Safar  <marek.safar@seznam.cz>
1653
1654         * class.cs (TypeContainer.CircularDepException) New nested
1655         (MethodCore.CheckBase): Report CS1715 for properties and indexers.
1656
1657         * cs-parser.jay: Reports CS1527 for any namespace element.
1658
1659         * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
1660         Added CS0407.
1661
1662         * expression.cs (ParameterReference.IsAssigned): Changed error to
1663         CS0269.
1664         (Error_WrongNumArguments): Moved CS0245 detection here.
1665
1666         * statement.cs (Return.Resolve): Add CS1622 report.
1667
1668 2005-03-11  Marek Safar  <marek.safar@seznam.cz>
1669
1670         * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
1671
1672 2005-03-11  Zoltan Varga  <vargaz@freemail.hu>
1673
1674         * attribute.cs expression.cs: Get rid of some allocations.
1675
1676 2004-03-11  Atsushi Enomoto  <atsushi@ximian.com>
1677
1678         * doc.cs : just eliminate the latest change.
1679
1680 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
1681
1682         * doc.cs : commented out the latest change. It breaks xml-030.cs
1683
1684 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
1685
1686         * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
1687           fail. So invoke CreateType() in FindDocumentedType().
1688
1689 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
1690
1691         * cs-tokenizer.cs : added IsKeyword().
1692         * doc.cs : Detect keyword incorrectly used as identifier.
1693           Allow identifiers prefixed by @.
1694
1695 2005-03-10  Marek Safar  <marek.safar@seznam.cz>
1696
1697         * attributes.cs (Attributes.Emit): Continue after CheckTargets.
1698         It caused exception in namespace resolving (again!).
1699         
1700         * class.cs (Class.ctor): Removed exit.
1701         (PropertyMethod.ctor): ditto.
1702         
1703         * codegen.cs (Codegen.Reset): Reset static data.
1704         (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
1705         
1706         * cs-tokenizer.cs (Cleanup): Removed.
1707         
1708         * driver.cs (GetSystemDir): Rewrote to one line command.
1709         It caused problem with unloaded dynamic modules.
1710         (UnixParseOption): Removed Exit.
1711         (CompilerCallableEntryPoint.InvokeCompiler): Make static.
1712         (CompilerCallableEntryPoint.Reset): Reset suitable static data.
1713         Now can be mcs used as library.
1714         
1715         * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
1716         empty location.
1717         
1718         * location.cs (Reset): Reset static data.
1719         
1720         * namespace.cs (Reset): Reset static data.
1721         
1722         * report.cs (Report.Reset): Reset static data.
1723         
1724         * rootcontext.cs (RootContext.Reset): Reset static data.
1725         
1726         * tree.cs (RootTypes.ctor): Use Location.Null
1727         
1728         * typemanager.cs (TypeManager.Reset): Reset static data.
1729         (CoreLookupType): Removed Exit.
1730         (TypeHandle.Reset): Reset static data.
1731         
1732 2005-03-10  Raja R Harinath  <rharinath@novell.com>
1733
1734         Fix #73516.
1735         * typemanager.cs (ComputeNamespaces): Import namespaces from
1736         referenced modules too.
1737
1738 2005-03-09  Raja R Harinath  <rharinath@novell.com>
1739
1740         * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
1741         than '.'.
1742
1743 2005-03-09  Raja R Harinath  <rharinath@novell.com>
1744
1745         * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
1746         enclosing DeclSpace.  This ensures that a name-lookup populates
1747         more caches and there are fewer 'TypeExpression's.  Carve out
1748         nested type lookup into ...
1749         (LookupNestedTypeInHierarchy): ... this.
1750
1751 2005-04-15  Martin Baulig  <martin@ximian.com>
1752
1753         Merged r41590 from MCS and make it work in the generics land.
1754
1755         * generic.cs (TypeParameter.UpdateConstraints): Removed the
1756         `check' argument.
1757
1758         * class.cs (PartialContainer.UpdateConstraints): Removed.
1759         (PartialContainer.CheckConstraints): Removed.
1760         (PartialContainer.SetParameterInfo): Store the constraints here.
1761         (PartialContainer.DefineTypeParameters): New public method;
1762         resolve the type parameter's constraints here.  Note that the
1763         PartialContainer doesn't have an EmitContext anymore, so we must
1764         do this in the ClassPart.
1765
1766 2005-03-09  Raja R Harinath  <rharinath@novell.com>
1767
1768         Clean up a few partial-class semantics.  
1769         Fixes test-357.cs and cs1618-2.cs.
1770         * cs-parser.jay (struct_declaration): Use 'current_class' as
1771         parent of newly-created struct.  Remove call to Register ().
1772         Use 'pop_current_class' to complete handing the current struct.
1773         (interface_declaration): Likewise.
1774         (class_declaration): Likewise.
1775         (enum_declaration): Use 'current_class' as parent of newly created
1776         enum.
1777         (delegate_declaration): Likewise.
1778         (pop_current_class): New function.  This is used to handle closing
1779         up the 'current_class' and 'current_container', and pointing them
1780         to the enclosing class/container.
1781         (CSharpParser): Initialize 'current_class' too.
1782         * decl.cs (MemberCore): Add check for invariant: a partial
1783         container is not a parsed entity, and thus does not enclose any
1784         parsed members.
1785         (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
1786         (DeclSpace.BaseTypeExpr): Use it.
1787         (DeclSpace.LookupType): Add check for invariant.
1788         * class.cs (TypeContainer): Add check for invariant: a nested
1789         class should have the same NamespaceEntry as its enclosing class.
1790         (TypeContainer.EmitFieldInitializers): Make virtual.
1791         (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
1792         MemberCore.
1793         (TypeContainer.Register): Remove.
1794         (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
1795         null.  Use TypeResolveEmitContext for resolving base types and
1796         interfaces.  Move initialization of Parts.TypeBuilder here from
1797         ...
1798         (TypeContainer.DefineNestedTypes): ... here.
1799         (PartialContainer): Take a Namespace not a NamespaceEntry.
1800         (PartialContainer.Create): Don't use Register.  Call the
1801         appropriate Add... function directly.
1802         (ClassPart): Take both the PartialContainer and the enclosing
1803         class as constructor arguments.
1804         (ClassPart.EmitFieldInitializers): Override.
1805         (ClassPart.PartFindNestedTypes): Remove.
1806         (FieldBase.GetInitializerExpression): Resolve the initializer
1807         expression in the emit context of the enclosing class.
1808         * tree.cs (RootTypes): Remove Register ().
1809         
1810 2005-03-08  Marek Safar  <marek.safar@seznam.cz>
1811
1812         * cs-parser.jay: Removed CS0134.
1813         
1814         * driver.cs: Removed CS1901.
1815         
1816         * expression.cs (SizeOf.DoResolve): Don't report CS0233
1817         for predefined types.
1818
1819 2005-03-07  Duncan Mak  <duncan@novell.com>
1820
1821         * codegen.cs (Save):  Catch UnauthorizedAccessException as
1822         well. Fixes bug #73454.
1823
1824 2005-03-07  Marek Safar  <marek.safar@seznam.cz>
1825
1826         * cs-tokenizer.cs (xtoken): Add CS1035.
1827         
1828         * class.cs (MethodData.Define): Add CS0683.
1829         (FieldMember.ctor): Add CS0681.
1830
1831 2005-03-07  Raja R Harinath  <rharinath@novell.com>
1832
1833         * ecore.cs (SimpleName.DoResolve): Rename from
1834         SimpleName.DoResolveAllowStatic.
1835         (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
1836         Pass 'intermediate' flag to MemberStaticCheck.
1837         (SimpleName.MemberStaticCheck): Skip "static check" only in case
1838         of "intermediate" lookups via MemberAccess.
1839         (SimpleName.IdenticalNameAndTypeName): New.  Carved out of ...
1840         * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
1841
1842 2005-03-07  Raja R Harinath  <rharinath@novell.com>
1843
1844         Fix #73394.
1845         * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
1846         slipped in because of variable names that are identical to a
1847         builtin type's BCL equivalent ('string String;', 'int Int32;').
1848         (PropertyExpr.EmitInstance): Likewise.
1849
1850 2005-03-04  Marek Safar  <marek.safar@seznam.cz>
1851
1852         * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
1853         
1854         * report.cs (warning_ignore_table): Made public.
1855
1856 2005-03-04  Raja R Harinath  <rharinath@novell.com>
1857
1858         Fix #73282.
1859         * class.cs (MethodData.Emit): Pass 'container' to
1860         container.GetObsoleteAttribute instead of 'container.Parent'.
1861
1862 2005-03-03  Marek Safar  <marek.safar@seznam.cz>
1863
1864         * cs-parser.jay: Add 1534 error test.
1865
1866         * iterators.cs (Yield.CheckContext): Add error 1629.
1867         (Iterator.ctor): Save unsafe modifier.
1868         (MoveNextMethod.DoEmit): Restore unsafe context.
1869
1870         * namespace.cs (UsingAlias): Better error message.
1871
1872 2005-03-03  Dan Winship  <danw@novell.com>
1873
1874         * convert.cs (Error_CannotImplicitConversion): fix two bugs in
1875         the warning message [#73219]
1876
1877 2005-03-03  Raja R Harinath  <rharinath@novell.com>
1878
1879         Fix compile with MCS 1.0.0.0.
1880         * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
1881         w_restore to not depend on string constant folding.
1882
1883 2005-03-03  Raja R Harinath  <rharinath@novell.com>
1884
1885         * decl.cs (DeclSpace.LookupType): Remove 'silent' argument.  Move
1886         CS0246 check to users who passed 'silent = false'.
1887         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
1888         check.
1889         (SimpleName.SimpleNameResolve): Update.
1890         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
1891         (MemberAccess.IdenticalNameAndTypeName): Update.
1892         * doc.cs (FindDocumentedTypeNonArray): Update.
1893
1894 2005-03-03  Raja R Harinath  <rharinath@novell.com>     
1895
1896         * codegen.cs (EmitContext): Remove ResolvingTypeTree.
1897         * parameters.cs (ComputeAndDefineParameters): Remove.
1898         * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
1899         * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
1900         Use GetParameterInfo.
1901
1902 2005-03-02  Marek Safar  <marek.safar@seznam.cz>
1903
1904         * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
1905
1906 2005-03-02  Raja R Harinath  <rharinath@novell.com>
1907
1908         Unify DeclSpace.LookupType and DeclSpace.FindType.
1909         * decl.cs (DeclSpace.FindNestedType): New virtual function.  This
1910         is in charge of defining nested types on demand.
1911         (DeclSpace.LookupType): Use it when the current_type is a
1912         TypeBuilder.  Use LookupTypeDirect for reflected types.
1913         (DeclSpace.FindType): Remove.
1914         (DeclSpace.LookupInterfaceOrClass): Likewise.
1915         (DeclSpace.DefineTypeAndParents): Likewise.
1916         * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
1917         DeclSpace.LookupType.
1918         * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
1919         * typemanager.cs (LookupType): Simplify.
1920         (AddUserType): Remove type from negative_hits.
1921         * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
1922         * class.cs (TypeContainer.FindMembers): Move handling of nested
1923         types ...
1924         (TypeContainer.FindMembers_NestedTypes): ... here.
1925         (TypeContainer.FindNestedType): Implement override.
1926         (ClassPart.FindNestedType): Delegate to PartialContainer.
1927         (ClassPart.PartFindNestedType): Looks up the nested types of the
1928         part alone.
1929
1930 2005-04-14  Martin Baulig  <martin@ximian.com>
1931
1932         * generic.cs (ConstructedType): Moved all the type lookup and
1933         nested class logic into SimpleName.
1934         (ConstructedType.ResolveConstructedType): Our underlying type is
1935         already fully resolved; all the type lookup stuff is in
1936         SimpleName.
1937
1938         * ecore.cs (SimpleName.ResolveAsTypeStep): Resolve nested
1939         constructed types here instead of in ConstructedType.
1940
1941         * decl.cs (MemberName.GetTypeExpression): Always create a
1942         SimpleName, not a ConstructedType.
1943         (DeclSpace.ResolveNestedType): Removed; this is now in SimpleName.
1944
1945 2005-03-02  Martin Baulig  <martin@ximian.com>
1946
1947         * class.cs (TypeContainer.DoDefineMembers): We also need a default
1948         static constructor in static classes.
1949
1950 2005-03-01  Zoltan Varga  <vargaz@freemail.hu>
1951
1952         * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
1953         sizeParamIndex is not specified.
1954
1955 2005-03-01  Marek Safar  <marek.safar@seznam.cz>
1956
1957         Fix #73117
1958         * report.cs (WarningMessage.IsEnabled): Missing null check.
1959
1960 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
1961
1962         * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
1963         in the fields and not in the properties.
1964
1965 2005-02-28  Zoltan Varga  <vargaz@freemail.hu>
1966
1967         * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex 
1968         fields as well.
1969
1970 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
1971
1972         * attribute.cs: Small refactoring (improved robustness).
1973         (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
1974         (ValidateGuid): Removed.
1975         (Resolve): Removed referenced to above mentioned.
1976         (GetAttributeUsage): Made private and changed to work without
1977         class assistance.
1978         (GetIndexerAttributeValue): Don't crash.
1979         (GetConditionalAttributeValue): Ditto.
1980         (GetClsCompliantAttributeValue): Ditto.
1981         (ExtractSecurityPermissionSet): All attributes exceptions are
1982         error 648.
1983         (GetPropertyValue): New helper.
1984         (GetMethodImplOptions): New method.
1985         (DefinePInvokeMethod): Reuse common code. Implemented handling of
1986         some missing properties.
1987         
1988         * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
1989         (Method.ApplyAttributeBuilder): Updated.
1990         
1991         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
1992         exception.
1993
1994 2005-02-28  Raja R Harinath  <rharinath@novell.com>
1995
1996         Fix #73052.
1997         * report.cs (Report.SymbolRelatedToPreviousError): Handle
1998         non-simple types (array, pointer, reference).
1999
2000 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
2001
2002         * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
2003
2004         * class.cs (MethodCore.IsDuplicateImplementation): Special error
2005         for operators.
2006         (Method.CheckBase): Catch wrong destructor here.
2007         (MethodData.Define): Add errors 550, 668.
2008
2009         * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
2010
2011         * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
2012
2013         * pending.cs (VerifyPendingMethods): Add error 551.
2014
2015         * typemanager.cs (CSharpName): Next error report helper.
2016
2017 2005-02-25  Marek Safar  <marek.safar@seznam.cz>
2018
2019         * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
2020         attributes. Removed useless attribute double check.
2021         It saves almost 2MBs for corlib.
2022
2023 2005-02-25  Raja R Harinath  <rharinath@novell.com>
2024
2025         Fix #72924.
2026         * statement.cs (ExpressionStatement.Resolve): Make robust to being
2027         called twice in case of error.
2028
2029 2005-02-23  Chris Toshok  <toshok@ximian.com>
2030
2031         Fix compiler portions of #72827.
2032         * statement.cs (Block.Emit): call Begin/EndScope on the
2033         EmitContext instead of the ILGenerator.
2034
2035         * codegen.cs (EmitContext.BeginScope): new method, call
2036         ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
2037         we have one.)
2038         (EmitContext.BeginScope): same, but EndScope and CloseScope
2039
2040         * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
2041         offset and call the superclass's OpenScope(int) with it.
2042         (SymbolWriter.CloseScope): get the current il
2043         offset and call superclass's CloseScope(int) with it.
2044
2045 2005-02-23  Marek Safar  <marek.safar@seznam.cz>
2046
2047         * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
2048         CS1677 for out and ref as well.
2049
2050         * class.cs (Method.Define): Add error CS1599 detection.
2051         
2052         * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
2053         
2054         * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
2055         
2056         * delegate.cs (Delegate.Define): Add error CS1599 detection.
2057         
2058         * support.cs.cs (ModifierDesc): New helper method.
2059
2060 2005-02-23  Raja R Harinath  <rharinath@novell.com>
2061             Abin Thomas  <projectmonokochi@rediffmail.com>
2062             Anoob V E  <projectmonokochi@rediffmail.com>
2063             Harilal P R  <projectmonokochi@rediffmail.com>
2064
2065         Fix #57851, #72718.
2066         * class.cs (ConstructorBuilder.Resolve): Make sure that the second
2067         MemberLookup (used for error reporting) actually returns a result.
2068         Fix error report number (122, not 112).
2069
2070 2005-02-22  Abin Thomas  <projectmonokochi@rediffmail.com>
2071             Anoob V E  <projectmonokochi@rediffmail.com>
2072             Harilal P R  <projectmonokochi@rediffmail.com>
2073
2074         Fix #71134.
2075         * pending.cs (PendingImplementation.GetAbstractMethods):
2076         Find NonPublic members too.
2077
2078 2005-02-22  Marek Safar  <marek.safar@seznam.cz>
2079
2080         * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
2081         Fixed error 217.
2082         
2083         * class.cs (MethodCore.CheckMethodAgainstBase):
2084         Add error 239 report.
2085
2086 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
2087
2088         * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
2089         
2090         * class.cs (Operator.Define): Add error 217 report.
2091         
2092 2005-02-21  Raja R Harinath  <rharinath@novell.com>
2093
2094         Fix #68955.
2095         * expression.cs (Invocation.IsApplicable): Make public.
2096         (Invocation.IsParamsMethodApplicable): Likewise.
2097         * delegate.cs (Delegate.VerifyApplicability): Don't use
2098         Invocation.VerifyArgumentCompat for parameter applicability
2099         testing.  Use Invocation.IsApplicable and
2100         Invocation.IsParamsMethodApplicable.
2101
2102 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
2103
2104         * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
2105         
2106         * class.cs (Operator.Define): Add error 217 report.
2107         
2108 2005-02-21  Raja R Harinath  <rharinath@novell.com>
2109
2110         * namespace.cs (UsingEntry.Resolve): Undo change below.
2111
2112 2005-02-21  Raja R Harinath  <rharinath@novell.com>
2113
2114         Fix #72756.
2115         * ecore.cs (Expression.MemberLookupFailed): Add argument to
2116         disable the error message when the extended MemberLookup also
2117         fails.
2118         (Expression.MemberLookupFinal): Update.
2119         (SimpleName.DoSimpleNameResolve): Update.
2120         * expression.cs (MemberAccess.ResolveNamespaceOrType):
2121         Don't use MemberLookupFinal.
2122         (New.DoResolve): Update.
2123         (BaseAccess.CommonResolve): Update.
2124
2125 2005-02-21  Raja R Harinath  <rharinath@novell.com>
2126
2127         Fix #72732.
2128         * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
2129         occured previously, don't resolve again.
2130
2131 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
2132
2133         Fix #69949
2134         * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
2135         argument. Call ResolveAttributeUsage for unresolved.
2136         when types doesn't match ctor arguments.
2137         
2138         * class.cs (DoDefineMembers.TypeContainer): Removed safety check
2139         for nested attribute classes.
2140         (Class.attribute_usage): Removed.
2141         (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
2142         for attribute class.
2143         
2144         * ecore.cs (IsAttribute): Removed.
2145         
2146         * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
2147         
2148         * rootcontext.cs (RegisterAttribute): Removed, attributes are
2149         now normal types.
2150         (attribute_types): Removed.
2151         (EmitCode): Global attributes are emited as the latest.
2152
2153 2005-02-18  Marek Safar  <marek.safar@seznam.cz>
2154
2155         * class.cs (EmitFieldInitializers): Don't emit field initializer
2156         for default values when optimilization is on.
2157         
2158         * constant.cs (Constant.IsDefaultValue): New property.
2159         
2160         * driver.cs: Add /optimize handling.
2161         
2162         * constant.cs,
2163         * ecore.cs,
2164         * literal.cs: Implement new IsDefaultValue property.
2165         
2166         * rootcontext.cs (Optimize): New field, holds /optimize option.
2167
2168 2005-02-18  Raja R Harinath  <rharinath@novell.com>
2169
2170         Fix crasher in re-opened #72347.
2171         * namespace.cs (Namespace.Lookup): Return null if
2172         DeclSpace.DefineType returns null.
2173
2174         Fix #72678.
2175         * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
2176
2177 2005-02-18  Raja R Harinath  <rharinath@novell.com>
2178
2179         Fix remainder of #63202.  Change semantics of DoResolveLValue: it
2180         now returns null if it cannot resolve to an lvalue.
2181         * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
2182         (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
2183         returned null.  Remove check for SimpleName.
2184         (EventExpr.DoResolveLValue): New.
2185         * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
2186         * expression.cs (Argument.Error_LValueRequired): New.  Move CS1510
2187         error from ...
2188         (Argument.Resolve): ... here.  Use it.  Use DoResolveLValue to
2189         avoid CS0131 error.
2190         (Unary.ResolveOperator): Move CS0211 check ...
2191         (Unary.DoResolve): ... here.  Use DoResolveLValue to avoid
2192         CS0131 error.
2193         (Unary.DoResolveLValue): Simplify.
2194         (AddressOf.DoResolveLValue): New.
2195         (ArrayAccess.DoResolveLValue): New.
2196
2197 2005-02-16  Marek Safar  <marek.safar@seznam.cz>
2198
2199         * attribute.cs (Attribute.Resolve): Add arguments casting for
2200         when types doesn't match ctor arguments.
2201
2202 2005-02-16  Raja R Harinath  <rharinath@novell.com>
2203
2204         Fix parts of #63202.
2205         * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
2206         lookup of operator in base type.  Ensure that all checks happen
2207         when the operator resolves to an "op_..." method.
2208
2209 2005-02-15  Raja R Harinath  <rharinath@novell.com>
2210
2211         Fix #71992.
2212         * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
2213         'ignore_cs0104' parameter.  Pass it to ...
2214         (NamespaceEntry.Lookup): ... this.
2215         * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
2216         * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
2217         (TypeLookupExpression.DoResolveAsTypeStep): Update.
2218         * expression.cs (MemberAccess.IdenticalNameAndTypeName):
2219         Update.  Request that cs0104 errors be ignored.
2220         (ComposedCast.ResolveAsTypeStep): Update.
2221
2222 2005-02-14  Raja R Harinath  <rharinath@novell.com>
2223
2224         Fix #59209.
2225         * expression.cs (Invocation.BetterFunction): Remove support for
2226         comparing virtual functions and their overrides.
2227         (Invocation.IsOverride): New.
2228         (Invocation.OverloadResolve): Don't consider 'override' functions
2229         during candidate selection.  Store them in a lookaside list.
2230         If the selected method is a 'virtual' function, use the list to
2231         find any overrides that are closer to the LHS type.
2232
2233 2005-02-14  Marek Safar  <marek.safar@seznam.cz>
2234
2235         * expression.cs (New.DoResolve): Add complex core type reduction.
2236         (New.Constantify): Converts complex core type syntax like 'new int ()'
2237         to simple constant.
2238         
2239 2005-02-14  Raja R Harinath  <rharinath@novell.com>
2240
2241         * decl.cs (EntryType.EntryType): New constructor to create an
2242         updated copy of a cache entry.
2243         (MemberCache.AddMethods): Use it.
2244         (MemberCache.ClearDeclaredOnly): Remove.
2245         (MemberCache.MemberCache): Update.
2246
2247 2005-02-11  Miguel de Icaza  <miguel@novell.com>
2248
2249         * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
2250         variable.  This one is represents the actual low-level declaration
2251         of the method, as opposed to the semantic level `IsStatic'.   
2252
2253         An anonymous method which is hosted into a static method might be
2254         actually an instance method.  IsStatic would reflect the
2255         container, while MethodIsStatic represents the actual code
2256         generated.
2257
2258         * expression.cs (ParameterReference): Use the new MethodIsStatic
2259         instead of IsStatic.
2260
2261         * anonymous.cs (AnonymousMethod.Compatible): Pass the
2262         Modifiers.STATIC to the Anonymous' Method EmitContext if static is
2263         set on the current EmitContext. 
2264
2265         * expression.cs (Cast): Overload DoResolveLValue so we can pass
2266         resolve our casted expression as an LValue.  This triggers the
2267         proper LValue processing that is later required by Assign.
2268
2269         This fixes 72347.
2270
2271         * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
2272
2273 2005-02-11  Marek Safar  <marek.safar@seznam.cz>
2274
2275         C# 2.0 Fixed buffer implementation
2276
2277         * anonymous.cs: Update after RegisterHelperClass renaming.
2278
2279         * attribute.cs (AttributeTester.fixed_buffer_cache):
2280         Cache of external fixed buffers.
2281         (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
2282         implementation if field is fixed buffer else null.
2283
2284         * class.cs
2285         (TypeContainer.AddField): Accept FieldMember instead of Field.
2286         (FieldBase.IsFieldClsCompliant): Extracted code from
2287         VerifyClsCompliance descendant customization.
2288         (FixedField): New class handles fixed buffer fields.
2289         (FixedFieldExternal): Keeps information about imported fixed
2290         buffer.
2291         (IFixedField): Make access to internal or external fixed buffer
2292         same.
2293
2294         * cs-parser.jay: Add fixed buffer parsing.
2295
2296         * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
2297         buffer.
2298
2299         * expression.cs (Indirection): Extended implementation to accept
2300         fixed buffer field.
2301         (PointerArithmetic.Emit): Get element from fixed buffer as well.
2302         (ElementAccess.MakePointerAccess): Get type as parameter.
2303         (DoResolve): Add fixed buffer field expression conversion.
2304         (DoResolveLValue): Ditto.
2305         (FixedBufferPtr): New class. Moved most of original ArrayPtr.
2306         (ArrayPtr): Derives from FixedBufferPtr.
2307         (ArrayPtr.Emit): Add extra emit for array elements.
2308
2309         * flowanalysis.cs.cs (StructInfo): Use FieldMember.
2310
2311         * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
2312         for compiler generated types.
2313         (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
2314
2315         * statement.cs (Fixed): Refactored to be easier add fixed buffer
2316         and consume less memory.
2317         (Fixed.Resolve): Add fixed buffer case.
2318
2319         * typemanager.cs (compiler_generated_attr_ctor,
2320         fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
2321         (HasElementType): Add our own implementation to work on every
2322         runtime.
2323
2324 2005-02-11  Miguel de Icaza  <miguel@novell.com>
2325
2326         * anonymous.cs (CaptureContext): Track whether `this' has been
2327         referenced.   
2328
2329         * expression.cs (This.ResolveBase): Call CaptureThis.  Before we
2330         only captured `this' if it was implicitly done (instance
2331         methods/variables were used). 
2332
2333         * codegen.cs (EmitContext.CaptureThis): New method to flag that
2334         `this' must be captured.
2335
2336 2005-01-30  Miguel de Icaza  <miguel@novell.com>
2337  
2338         * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
2339         is null it means that there has been no need to capture anything,
2340         so we just create a sibling.
2341
2342         Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
2343
2344         Just a partial fix.  The other half is fairly elusive.
2345         
2346 2005-02-10  Raja R Harinath  <rharinath@novell.com>
2347
2348         Fix #52586, cs0121-4.cs.
2349         * decl.cs (MemberCache.DeepCopy): Rename from SetupCache.  Take
2350         and return a hashtable.
2351         (MemberCache.ClearDeclaredOnly): New.
2352         (MemberCache.MemberCache): Update to change.  Make a deep copy of
2353         the method_hash of a base type too.
2354         (MemberCache.AddMethods): Adapt to having a deep copy of the base
2355         type methods.  Overwrite entries with the same MethodHandle so
2356         that the ReflectedType is correct.  The process leaves in base
2357         virtual functions and their overrides as distinct entries.
2358         (CacheEntry): Now a class instead of a struct.  It shouldn't alter
2359         matters since it was boxed in a ArrayList before.
2360         (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
2361         modifier.
2362         * expression.cs (Invocation.BetterFunction): Simplify.  Handle the
2363         case of a virtual function and its override (choose the overload
2364         as better).
2365         (Invocation.OverloadResolve): Avoid 'override' members during
2366         'applicable_type' calculation.
2367
2368 2005-03-28  Raja R Harinath  <rharinath@novell.com>
2369
2370         * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
2371         (TypeHandle.TypeHandle): Use LookupMemberCache rather than
2372         GetTypeHandle.  It is possible for a reflected type to derive from
2373         a TypeBuilder (e.g., int[] derives from the TypeBuilder
2374         System.Array during mscorlib compilation).
2375         * decl.cs (MemberCache.MemberCache): If the base cache doesn't
2376         contain a method_hash, don't create one either.  Don't create a
2377         deep copy of the base cache's method_hash.
2378         (MemberCache.SetupCache): Rename back from DeepCopy.
2379         (MemberCache.AddMethods): Rewrite, now that method_hash isn't
2380         already initialized.  If we see an override function, add its
2381         underlying base virtual function to the member_hash too.
2382
2383 2005-02-09  Raja R Harinath  <rharinath@novell.com>
2384
2385         Combine two near-redundant caches.
2386         * typemanager.cs (method_params): Rename from method_internal_params.
2387         (TypeManager.GetParameterData): New.  Replace
2388         Invocation.GetParameterData.
2389         (TypeManager.LookupParametersByBuilder): Remove.
2390         * expression.cs (Invocation.method_parameter_cache): Remove.
2391         (Invocation.GetParameterData): Remove.
2392         Update to changes.
2393         * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
2394         Update to changes.
2395
2396 2005-02-08  Raja R Harinath  <rharinath@novell.com>
2397
2398         Fix #72015.
2399         * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
2400         TypeManager.multicast_delegate_type is null, resolve it by looking
2401         up "System.MulticastDelegate".
2402         * rootcontext.cs (RootContext.ResolveCore): Simplify.
2403
2404 2005-02-07  Abin Thomas (NOSIP)  <projectmonokochi@rediffmail.com>
2405             Anoob V.E (NOSIP)  <projectmonokochi@rediffmail.com>
2406             Harilal P.R (NOSIP)  <projectmonokochi@rediffmail.com>
2407
2408         Fix cs0164.cs.
2409         * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
2410         (LabeledStatement.AddReference): New.  Set 'referenced'.
2411         (Goto.Resolve): Use it.
2412
2413 2005-02-05  John Luke  <john.luke@gmail.com>
2414
2415         * driver.cs: remove duplicate -doc line in Usage ()
2416
2417 2005-02-04  Raja R Harinath  <rharinath@novell.com>
2418
2419         * location.cs (Location.AddFile): Fix CS2002 error report.
2420
2421 2005-02-02  Martin Baulig  <martin@ximian.com>
2422
2423         * delegate.cs (Delegate.DefineType): Report an internal error if
2424         TypeManager.multicast_delegate_type is null.  See bug #72015 for
2425         details.        
2426
2427 2005-02-02  Raja R Harinath  <rharinath@novell.com>
2428
2429         Fix a crasher in a variant of #31984.
2430         * const.cs (Constant.CheckBase): New override that defers the
2431         new-or-override check in case the base type hasn't been populated
2432         yet.
2433         (Constant.Define): Ensure the new-or-override check is performed.
2434
2435 2005-02-01  Duncan Mak  <duncan@ximian.com>
2436
2437         * const.cs (LookupConstantValue): Check that `ce' is not null
2438         before calling GetValue ().
2439
2440 2005-02-01  Raja R Harinath  <rharinath@novell.com>
2441
2442         Fix test-334.cs (#69519).
2443         * cs-parser.jay (using_alias_directive): Pass in an expression to
2444         NamespaceEntry.UsingAlias.
2445         (using_namespace_directive): Pass in an expression to
2446         NamespaceEntry.Using.
2447         (namespace_name): Don't flatten to a string.
2448         * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
2449         (NamespaceEntry.AliasEntry.Resolve): Lookup using
2450         ResolveAsTypeStep.
2451         (NamespaceEntry.UsingEntry): Likewise.
2452         (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
2453         changes.
2454         (NamespaceEntry.LookupForUsing): Remove.
2455         (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
2456         names.
2457         (NamespaceEntry.Lookup): Remove support for dotted names.
2458
2459 2005-02-01  Raja R Harinath  <rharinath@novell.com>
2460
2461         * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
2462         split into two.
2463         (NamespaceEntry.ImplicitParent): Compute on demand.
2464         (NamespaceEntry.Doppelganger): New implicit namespace-entry that
2465         parallels the current.
2466         (NamespaceEntry.LookupForUsing): Use it.
2467         (NamespaceEntry.Lookup): If the current namespace-entry is
2468         implicit, don't search aliases and using tables.
2469
2470 2005-02-01  Raja R Harinath  <rharinath@novell.com>
2471
2472         Fix #31984.
2473         * class.cs (TypeContainer.DoDefineMembers): Don't initialize
2474         BaseCache here.
2475         (TypeContainer.BaseCache): Compute on demand.
2476         (TypeContainer.FindMembers): Define constants and types if they're
2477         not already created.
2478         (FieldMember.Define): Move resetting of ec.InUnsafe before error
2479         check.
2480         * const.cs (Constant.Define): Make idempotent.
2481
2482 2005-01-29  Miguel de Icaza  <miguel@novell.com>
2483
2484         * pending.cs: Produce better code (no nops produced by using Ldarg
2485         + value).
2486         
2487         * pending.cs (PendingImplementation.DefineProxy): It was not `arg
2488         i - 1' it should be arg + 1.
2489
2490         Fixes bug #71819.
2491
2492 2005-01-28  Raja R Harinath  <rharinath@novell.com>
2493
2494         * attribute.cs (Attribute.CheckAttributeType): Make private
2495         non-virtual.
2496         (Attribute.ResolveType): Make virtual.
2497         (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
2498         handling of RootContext.Tree.Types.
2499
2500 2005-01-27  Raja R Harinath  <rharinath@novell.com>
2501
2502         Update attribute-handling to use the SimpleName/MemberAccess
2503         mechanisms.
2504         * cs-parser.jay (attribute): Pass in an expression to the
2505         constructors of Attribute and GlobalAttribute.
2506         * attribute.cs (Attribute): Take an expression for the name.
2507         (Attribute.ResolvePossibleAttributeTypes): New.  Resolves the
2508         passed in attribute name expression.
2509         (Attribute.CheckAttributeType): Use it.
2510         * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
2511         * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
2512         (MemberAccess.ResolveNamespaceOrType): ... here.  Add 'silent'
2513         argument to prevent error messages if the lookup fails.
2514
2515 2005-01-27  Marek Safar  <marek.safar@seznam.cz>
2516
2517         * expression.cs (Indirection): Implemented IVariable interface
2518         to support indirection in AddressOf operator.
2519         (PointerArithmetic.Emit): Add optimalization for case where
2520         result can be precomputed.
2521
2522 2005-01-26  Martin Baulig  <martin@ximian.com>
2523
2524         * class.cs (TypeContainer.AttributeTargets): Return the correct
2525         AttributeTargets depending on our `Kind' instead of throwing an
2526         exception; fixes #71632.
2527
2528 2005-01-26  Marek Safar  <marek.safar@seznam.cz>
2529
2530         Fix #71257
2531         * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
2532         constant members.
2533
2534 2005-03-17  Martin Baulig  <martin@ximian.com>
2535
2536         * anonymous.cs (AnonymousMethod.method_modifiers): Change default
2537         from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'.  Fixes #73260.
2538
2539 2005-03-17  Martin Baulig  <martin@ximian.com>
2540
2541         * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
2542         to bool so we can return an error condition.
2543         (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
2544         returned an error.
2545
2546 2005-03-17  Martin Baulig  <martin@ximian.com>
2547
2548         * generic.cs (TypeMananager.IsIEnumerable): New public method.
2549
2550         * convert.cs (Convert.ImplicitReferenceConversion(Exists)): Allow
2551         converting from an array-type of T to `IEnumerable<T>'.
2552
2553 2005-03-16  Martin Baulig  <martin@ximian.com>
2554
2555         * generic.cs (Nullable.Unwrap): Implement IAssignMethod.
2556         (Nullable.LiftedUnaryMutator): New public class.
2557
2558         * expression.cs (UnaryMutator.DoResolve): Added support for
2559         Nullable Types.
2560
2561 2005-03-14  Martin Baulig  <martin@ximian.com>
2562
2563         * generic.cs (Nullable.NullCoalescingOperator): Implemented.
2564
2565 2005-03-14  Martin Baulig  <martin@ximian.com>
2566
2567         * generic.cs (Nullable.LiftedBinaryOperator): Added support for
2568         the comparision operators `<', `>', `<=' and `>='.
2569
2570 2005-03-13  Martin Baulig  <martin@ximian.com>
2571
2572         * generic.cs
2573         (Nullable.NullLiteral): Renamed to `Nullable.NullableLiteral' to
2574         avoid confusion with the `NullLiteral'.
2575         (Nullable.LiftedBinaryOperator): Correctly implement `==' and '!='.
2576
2577 2005-03-13  Martin Baulig  <martin@ximian.com>
2578
2579         * expression.cs (Binary.ResolveOperator): For `==' and `!=', allow
2580         comparing arbitrary types with the null literal.
2581
2582 2005-03-13  Martin Baulig  <martin@ximian.com>
2583
2584         * generic.cs (Nullable.LiftedBinaryOperator): Add support for the
2585         boolean operators '&&', '||', '&' and '|'.
2586         (Nullable.OperatorTrueOrFalse): New public class.
2587
2588         * ecore.cs (Expression.GetOperatorTrue/False): Return an `Expression'
2589         instead of a `StaticCallExpr'; added support for nullables.
2590
2591 2005-03-10  Martin Baulig  <martin@ximian.com>
2592
2593         * expression.cs
2594         (ArrayAccess.EmitDynamicInitializers): Use `etype.IsValueType'
2595         rather than `etype.IsSubclassOf (TypeManager.value_type)'.      
2596
2597 2005-03-07  Martin Baulig  <martin@ximian.com>
2598
2599         * generic.cs (Nullable.Unwrap): Implement IMemoryLocation and make
2600         it work if `expr' is not an IMemoryLocation.
2601         (Nullable.Lifted): Implement IMemoryLocation.
2602         (Nullable.LiftedConversion.ResolveUnderlying): Use the correct
2603         target type.
2604
2605 2005-03-05  Martin Baulig  <martin@ximian.com>
2606
2607         * generic.cs (Nullable.Unwrap, Wrap): New protected classes.
2608         (Nullable.Lifted): New abstract class; rewrote the lifted conversions.
2609         (Nullable): Added support for lifted unary and binary operators.
2610
2611         * expression.cs (Unary.DoResolve): Added support for nullable types.
2612         (Binary.DoResolve): Likewise.
2613         (Conditional.DoResolve): Likewise.
2614
2615 2005-03-02  Martin Baulig  <martin@ximian.com>
2616
2617         * decl.cs (DeclSpace.SetParameterInfo): Make this virtual.
2618
2619         * class.cs (ClassPart.SetParameterInfo): Override this.
2620         (PartialContainer.SetParameterInfo): Override this.
2621         (TypeContainer.CheckConstraints): New protected method.
2622         (PartialContainer.CheckConstraints): Override this and check
2623         whether the same contraints were specified in all parts of a
2624         partial generic type definition.
2625         (PartialContainer.UpdateConstraints): New public method.
2626
2627         * generic.cs (TypeParameter.UpdateConstraints): New public method.
2628
2629 2005-03-02  Martin Baulig  <martin@ximian.com>
2630
2631         Committing a patch from Carlos Alberto Cortez to fix #72887.
2632
2633         * convert.cs (Convert.ExplicitReferenceConversionExists): Allow
2634         casts from `T []' to `int []'.
2635
2636 2005-03-02  Martin Baulig  <martin@ximian.com>
2637
2638         * generic.cs (TypeManager.IsEqual): Make this symmetric.
2639
2640         * expression.cs (Binary.ResolveOperator): When resolving a
2641         BinaryDelegate, use `TypeManager.IsEqual (l, r)' rather than just
2642         `=='.  Fixes #71866.  See gen-127.cs.
2643
2644 2005-03-02  Martin Baulig  <martin@ximian.com>
2645
2646         * class.cs (TypeContainer.DoDefineMembers): We also need a default
2647         static constructor in static classes.
2648
2649 2005-03-02  Martin Baulig  <martin@ximian.com>
2650
2651         * generic.cs
2652         (NullableType.Name, NullableType.FullName): Add a "?" to the name.
2653         (Nullable.LiftedConversion): Added support for user-defined
2654         conversions.
2655
2656         * cs-tokenizer.cs (Tokenizer.PutbackCloseParens): New public method.
2657
2658         * cs-parser.jay: Use ComposedCast everywhere instead of
2659         NullableType, so we don't need to check for NullableType
2660         everywhere.
2661         (conditional_expression): Added `INTERR CLOSE_PARENS' rule for the
2662         case where we'll be resolved into a `parenthesized_expression_0'
2663         afterwards.
2664
2665         * convert.cs
2666         (Convert.UserDefinedConversion): Added nullable conversions.
2667
2668 2005-02-28  Martin Baulig  <martin@ximian.com>
2669
2670         * generic.cs (TypeManager.IsNullableType): New static method.
2671         (Nullable): New abstract class.
2672         (Nullable.NullLiteral): New public class.
2673         (Nullable.LiftedConversion): New public class.
2674
2675         * cs-parser.jay (non_expression_type): Changed `builtin_types' to
2676         `builtin_types opt_nullable'.
2677
2678         * convert.cs
2679         (Convert.ImplicitConversionStandard): Added nullable conversions.
2680         (Convert.ExplicitConversionStandard): Likewise.
2681         (Convert.ExplicitConversion): Likewise.
2682
2683 2005-02-26  Martin Baulig  <martin@ximian.com>
2684
2685         * expression.cs (ComposedCast.DoResolveAsTypeStep): Allow `dim' to
2686         begin with a "?", for instance "?[]".  Don't do a type lookup if
2687         `dim' is empty.
2688
2689 2005-02-25  Martin Baulig  <martin@ximian.com>
2690
2691         The first part of Nullable Types :-)
2692
2693         * generic.cs (NullableType): New public class.
2694         (NullCoalescingOperator): New public class.
2695         (TypeArguments.Resolve): Add a CS0306 check.
2696
2697         * cs-parser.jay (opt_error_modifier): Removed, this was unused.
2698         (opt_nullable): New rule.
2699         (type): Added `opt_nullable' to `namespace_or_type_name',
2700         `builtin_types' and `pointer_type'.
2701         (array_type): Added `opt_nullable'.
2702         (opt_rank_specifier_or_nullable): New rule; this is the
2703         combination of `opt_rank_specifier' and `opt_nullable'.
2704         (opt_error): New rule; catch errors here.
2705         (nullable_type_or_conditional): New rule; we use this to check for
2706         nullable and still detect the conditional operator.
2707         (local_variable_type): Use `opt_rank_specifier_or_nullable'
2708         instead `opt_rank_specifier'.
2709
2710         * expression.cs (ComposedCast.DoResolveAsTypeStep): Added support
2711         for nullables.
2712
2713 2005-02-24  Martin Baulig  <martin@ximian.com>
2714
2715         * README, README.Changes: Removed; they're old and obsolete.
2716
2717 2005-02-22  Martin Baulig  <martin@ximian.com>
2718
2719         * generic.cs (TypeParameter.Resolve): If resolving the constraints
2720         returned an error, set `constraints' to null to avoid a crash
2721         later on.
2722         (TypeParameter.ResolveType): Likewise.
2723
2724 2005-02-22  Martin Baulig  <martin@ximian.com>
2725
2726         * generic.cs
2727         (Constraints.ResolveTypes): Protect against being called twice.
2728         (Constraints.CheckInterfaceMethod): Don't call ResolveTypes().
2729         (TypeParameter.ResolveType): New public method; calls
2730         constraints.ResolveTypes().
2731         (TypeParameter.DefineType): Moved constraints.ResolveType() out
2732         into the new ResolveType().
2733         (GenericMethod.Define): Call ResolveType() on all our
2734         TypeParameter's.        
2735
2736 2005-02-21  Martin Baulig  <martin@ximian.com>
2737
2738         * generic.cs
2739         (TypeManager.generic_nullable_type): New static public field.
2740         (TypeManager.InitGenericCoreType): Lookup "System.Nullable`1".
2741
2742         * rootcontext.cs
2743         (RootContext.ResolveCore): Resolve "System.Nullable`1".
2744
2745 2005-02-15  Martin Baulig  <martin@ximian.com>
2746
2747         * generic.cs (ConstructedType.Constraints): Correctly check
2748         constraints if the argument type is a type parameter; fixes
2749         #72326. 
2750
2751 2005-02-02  Martin Baulig  <martin@ximian.com>
2752
2753         * delegate.cs (Delegate.DefineType): Report an internal error if
2754         TypeManager.multicast_delegate_type is null.  See bug #72015 for
2755         details.        
2756
2757 2005-01-29  Miguel de Icaza  <miguel@novell.com>
2758
2759         * pending.cs: Produce better code (no nops produced by using Ldarg
2760         + value).
2761         
2762         * pending.cs (PendingImplementation.DefineProxy): It was not `arg
2763         i - 1' it should be arg + 1.
2764
2765         Fixes bug #71819.
2766         
2767 2005-01-26  Martin Baulig  <martin@ximian.com>
2768
2769         * cs-parser.jay (indexer_declarator): Don't report an error if we
2770         have type parameters since we can be an explicit interface
2771         implementation; fixes #71449.
2772
2773 2005-01-26  Martin Baulig  <martin@ximian.com>
2774
2775         * class.cs (TypeContainer.AttributeTargets): Return the correct
2776         AttributeTargets depending on our `Kind' instead of throwing an
2777         exception; fixes #71632.
2778
2779 2005-01-26  Martin Baulig  <martin@ximian.com>
2780
2781         * delegate.cs (Delegate.DefineType): Correctly define our type
2782         parameters.  Fixes #71483.
2783
2784 2005-01-25  Raja R Harinath  <rharinath@novell.com>
2785
2786         Fix #71602.
2787         * expression.cs (MemberAccess.DoResolve): Don't complain with
2788         cs0572 when the LHS of a member access has identical name and type
2789         name.
2790
2791 2005-01-25  Marek Safar  <marek.safar@seznam.cz>
2792
2793         Fix #71651, #71675
2794         * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
2795         CreatePermission.
2796         Create custom PermissionSet only for PermissionSetAttribute.
2797
2798 2005-01-24  Marek Safar  <marek.safar@seznam.cz>
2799
2800         Fix #71649
2801         * class.cs (StaticClass.DefineContainerMembers): Enable enums and
2802         delegates in static class.
2803
2804 2005-01-24  Martin Baulig  <martin@ximian.com>
2805
2806         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
2807         merging an implicit block, just use its reachability.
2808
2809         * statement.cs (Block.Resolve): Make the unreachable code check
2810         work wrt. implicit blocks; see test-337 from #63842.
2811
2812 2005-01-21  Alp Toker  <alp@atoker.com>
2813  
2814         * cs-parser.jay: destructor_declaration's container is PartialContainer
2815         not Class when partial types are used, so use Kind prop instead of
2816         'is'.
2817         
2818 2005-01-22  Miguel de Icaza  <miguel@ximian.com>
2819
2820         * cs-parser.jay: Improve error reporting when an interface
2821         declares new types.
2822
2823 2005-01-20  Dick Porter  <dick@ximian.com>
2824
2825         * support.cs: SeekableStreamReader fix from Sandor Dobos
2826         (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
2827         chars are read.  Fixes bug 70369.
2828
2829 2005-01-20  Raja R Harinath  <rharinath@novell.com>
2830
2831         * cs-parser.jay (catch_clause): Simplify current_block handling
2832         somewhat.
2833
2834 2005-01-17  Miguel de Icaza  <miguel@ximian.com>
2835
2836         * convert.cs (ImplicitStandardConversionExists): Synchronize the
2837         code with ImplicitStandardConversion to handle the implicit
2838         conversion of method groups into valid delegate invocations. 
2839
2840         The problem is that in parameter handling we were using this code
2841         path.  Fixes bug #64698
2842
2843 2005-01-19  Raja R Harinath  <rharinath@novell.com>
2844
2845         * cs-parser.jay: Fix several infelicities.
2846         - Avoid assigning to the parser value stack.  Code like 
2847           '$3 = null' is unclean.  Synthesize a value for the code block
2848           instead. 
2849         - Avoid using oob_stack for storing location information.  Use ...
2850         (_mark_): ... this.  New (empty) rule.  Saves the current location
2851         in $$.
2852         (foreach_statement): Avoid using oob_stack for current_block
2853         handling.  Use technique used in for_statement and
2854         using_statement.  Synthesize a value for the code block to store
2855         additional intermediate information.
2856
2857 2005-01-13  Miguel de Icaza  <miguel@ximian.com>
2858
2859         * ecore.cs (IsAccessorAccessible): Accessibility to private fields
2860         of a different type is only allowed to private fields of a
2861         containing type, not on fields of a base class.
2862
2863         See test-174.cs and error cs0122-9.cs
2864
2865 2005-01-13  Raja R Harinath  <rharinath@novell.com>
2866
2867         Fix test-335.cs (bug #58126).
2868         * cs-parser.jay (argument): Split out non-expression parts of the
2869         rule into 'non_simple_argument'.
2870         (invocation_expression): Support parenthesized invocations with
2871         multiple arguments, and with single non-simple arguments.
2872
2873 2005-01-13  Raja R Harinath  <rharinath@novell.com>
2874
2875         * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
2876         places.
2877
2878 2005-01-12  Raja R Harinath  <rharinath@novell.com>
2879
2880         Fix cs0038-1.cs, cs1640-6.cs.
2881         * ecore.cs (Expression.Resolve): Remove special-case for
2882         SimpleName in error-handling.
2883         (Expression.almostMatchedMembers): Relax access permission to
2884         protected.
2885         (Expression.MemberLookupFailed): Handle duplicates in
2886         almostMatchedMembers list.
2887         (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
2888         * expression.cs (New.DoResolve): Report CS1540 for more cases.
2889         * typemanager.cs (GetFullNameSignature): Use the MethodBase
2890         overload if the passed in MemberInfo is a MethodBase.
2891
2892 2005-01-25  Martin Baulig  <martin@ximian.com>
2893
2894         * doc.cs
2895         (DocUtil.emptyParamList): Removed; use `Type.EmptyTypes' instead.
2896
2897 2005-01-12  Marek Safar  <marek.safar@seznam.cz>
2898
2899         Fix #70749
2900         * attribute.cs (ExtractSecurityPermissionSet): Don't report error
2901         for non-CAS & merge permission sets properly.
2902
2903 2005-01-11  Raja R Harinath  <rharinath@novell.com>
2904
2905         Improve standard-compliance of simple name and member access 
2906         resolution.  Fixes bugs #52697, #57200, #67520, #69519.
2907         * ecore.cs (FullNamedExpression): New abstract base class 
2908         for Namespaces and TypeExpressions.
2909         (ResolveFlags.SimpleName): Remove.
2910         (SimpleName): Remove support for dotted names.
2911         (SimpleName.ResolveAsTypeStep): Simplify.  Now just a wrapper to 
2912         DeclSpace.FindType and DeclSpace.LookupType.
2913         (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
2914         (Expression.ExprClassName): Make member function.
2915         * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
2916         a namespace.  Remove creation of dotted "SimpleName"s.
2917         (MemberAccess.DoResolve): Likewise.
2918         * decl.cs (DeclSpace.Cache): Make private.
2919         (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
2920         (DeclSpace.FindType): Update.
2921         (DeclSpace.LookupType): Move here from RootContext.  Return a 
2922         FullNamedExpression.
2923         * namespace.cs (Namespace): Derive from FullNamedExpression
2924         so that it can be part of expression resolution.
2925         (Namespace.Lookup): Return an FullNamedExpression.
2926         (NamespaceEntry.LookupAlias): Lookup aliases only in current
2927         namespace.
2928         * rootcontext.cs (NamespaceLookup): Remove.
2929         (LookupType): Move to DeclSpace.
2930         * attribute.cs (CheckAttributeType): Update.
2931         * doc.cs (FindDocumentedType): Remove allowAlias argument.
2932         (FindDocumentedTypeNonArray): Likewise.
2933
2934 2005-01-11  Raja R Harinath  <rharinath@novell.com>
2935
2936         Fix cs0509.cs, cs1632.cs.
2937         * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
2938         is the same as IsInterface.
2939         (TypeContainer.GetClassBases): Likewise.
2940         * statement.cs (LabeledStatement.ig): New field.
2941         (LabeledStatement.LabelTarget): Save ILGenerator which created the
2942         label.
2943         (LabeledStatement.DoEmit): Check that the label was created with
2944         the same ILGenerator.
2945
2946 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
2947
2948         Fix #71058
2949         * attribute.cs (GetMethodObsoleteAttribute): Need to transform
2950         accessors to its properties.
2951
2952         * ecore.cs (PropertyExpr): Add AccessorTable to help track back
2953         from accessors to property.
2954         
2955 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
2956
2957         Fix #70722
2958         * class.cs (MethodCore.CheckBase): Test base method obsoleteness
2959         only for overrides.
2960         
2961 2005-01-08  Miguel de Icaza  <miguel@ximian.com>
2962
2963         * attribute.cs: Check for null and empty strings.  
2964
2965         I have lost another battle to Paolo.
2966
2967 2005-01-07  Marek Safar  <marek.safar@seznam.cz>
2968
2969         Fix #70942
2970         * class.cs (PropertyMethod): Set Parent field in ctors.
2971         (SetMethod.InternalParameters): Add unsafe switch hack.
2972         Override MarkForDuplicationCheck where it is appropriate.
2973
2974         * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
2975         It says whether container allows members with the same name.
2976         Base default is no.
2977         (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
2978         Removed is_method parameter.
2979
2980 2005-01-06  Duncan Mak  <duncan@ximian.com>
2981
2982         * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
2983         because the previous change led to incorrect reporting of CS1032
2984         ("Cannot define/undefine preprocessor symbols after first token in
2985         file"). Instead of using `tokens_seen' as the only flag that
2986         triggers CS1040, introduce `comments_seen'. This new flag is used
2987         to signify having seen comments on the current line, so it is
2988         unset after a newline.
2989
2990 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
2991
2992         * doc.cs : When searching for a type, find nested type too.
2993           This fixes bug #71040.
2994
2995 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
2996
2997         * doc.cs :
2998           - Warn missing member comment on those classes which also does not
2999             have doc comments. Fixed bug #71041.
3000           - Don't warn missing doc comment on default constructor.
3001             Fixed bug #71042.
3002
3003 2005-01-06  Duncan Mak  <duncan@ximian.com>
3004
3005         * cs-tokenizer.cs (xtoken): After handling traditional C-style
3006         comments, set `tokens_seen' to true. This allows us to detect
3007         misplaced preprocessor directives (i.e. not at the beginning of
3008         the a line, nor after whitespaces). In that case, report error
3009         CS1040. This fixes bug #56460.
3010
3011         * cs-parser.jay (interface_member_declaration): Add checks for
3012         IsExplicitImpl, and report CS0541 error if an interface member is
3013         defined as an explicit interface declaration.
3014
3015 2005-01-06  Marek Safar  <marek.safar@seznam.cz>
3016
3017         Fix #70817
3018         * class.cs (PropertyMethod): Set Parent field in ctors.
3019         (SetMethod.InternalParameters): Add unsafe switch hack.
3020         
3021         * decl.cs (MemberCore.Parent): Cannot be readonly.
3022
3023 2005-01-06  Raja R Harinath  <rharinath@novell.com>
3024
3025         * decl.cs (DeclSpace.ResolveType): Remove.
3026         (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
3027         Merge in code from ...
3028         (DeclSpace.GetTypeResolvingEmitContext): ... here.  Remove.
3029         * class.cs, enum.cs: Update to changes.
3030
3031 2005-01-06  Miguel de Icaza  <miguel@ximian.com>
3032
3033         * anonymous.cs: Ensure that we init the scope of our parent if it
3034         has not been initialized yet.
3035
3036 2004-12-30  Duncan Mak  <duncan@ximian.com>
3037
3038         * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
3039         if field.FieldBuilder is null. Fixes #70758.
3040
3041         * convert.cs: Fixed some typos and updated some of the comments.
3042         (ImplicitStandardConversionExists):
3043         (TryImplicitIntConversion): If `target_type' is an interface and
3044         the type of `ic' implements this interface, return true or a new
3045         BoxedCast instead of null. This fixes #70468.
3046
3047 2004-12-29  Duncan Mak  <duncan@ximian.com>
3048
3049         * expression.cs (Argument.Emit): Check that Expr is
3050         IMemoryLocation before casting to it, and report CS1510 otherwise.
3051
3052         This fixes #70402.
3053
3054 2004-12-21  Ben Maurer  <bmaurer@ximian.com>
3055
3056         * statement.cs (Block.ThisVariable): remove the recursion here, to
3057         make the --profile more sane.
3058
3059 2004-12-17  Carlos Cortez <calberto.cortez@gmail.com>
3060
3061         * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
3062         assembly, by JB Evain.
3063
3064 2004-12-17  Raja R Harinath  <rharinath@novell.com>
3065
3066         * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs, 
3067           rootcontext.cs, typemanager.cs: Make nomenclature consistent.
3068         "parent" refers to enclosing type/class.  "base" refers to superclass.
3069
3070 2004-12-17  Raja R Harinath  <rharinath@novell.com>
3071
3072         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
3073         Ensure that we only have GlobalAttributes.
3074         * attribute.cs (Attribute.Emit): Make non-virtual.
3075         (GlobalAttribute.Emit): Remove.
3076         (Attribute.Resolve): Make virtual.
3077         (GlobalAttribute.Resolve): New.  Set Rootcontext.Tree.Types.NamespaceEntry.
3078         (Attribute.GetConditionalAttributeValue): Take an EmitContext as
3079         the argument. Don't create one.
3080         (Attribute.GetObsoleteAttribute): Likewise.
3081         (Attribute.GetClsCompliantAttributeValue): Likewise.
3082         * class.cs, decl.cs: Update to changes.
3083
3084 2004-12-17  Marek Safar  <marek.safar@seznam.cz>
3085
3086         * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
3087         
3088         * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
3089         
3090         * statement.cs (Foreach.Resolve): Add error 186 report.
3091
3092 2004-12-16  Marek Safar  <marek.safar@seznam.cz>
3093
3094         * expression.cs (Conditional.DoResolve): Add warning 429.
3095         
3096         * statement.cs (If.Resolve): Add warning 665.
3097
3098 2004-12-16  Raja R Harinath  <rharinath@novell.com>
3099
3100         New invariant: RootContext.Tree.Types.NamespaceEntry == null
3101         except when in the parser, and in GlobalAttribute.
3102         * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
3103         * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
3104         RootContext.Tree.Types.NamespaceEntry once work is done.
3105         (GlobalAttribute.Emit): New.  Wrapper for Attribute.Emit, but sets
3106         and resets RootContext.Tree.Types.NamespaceEntry.
3107
3108 2004-12-15  Marek Safar  <marek.safar@seznam.cz>
3109
3110         * cs-parser.jay: Don't create a block for every variable.
3111
3112 2004-12-14  Miguel de Icaza  <miguel@ximian.com>
3113
3114         * location.cs: Provide extra information.
3115
3116         * statement.cs: The instance is not `ldarg_0.THIS' when accessing
3117         variables from the captured environment, it is the ldarg_0.
3118
3119 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
3120
3121         * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
3122         find a conclusion.
3123         
3124         * class.cs: Changed warning level for 169 to avoid developer
3125         displeasure from warning flooding. It will be changed back when they
3126         fix most of current BCL warnings.
3127         
3128         * RootContext.cs: Pushed default WarningLevel to 3.
3129         
3130         * statement.cs: Removed unused variable.
3131
3132 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
3133
3134         * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
3135         (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
3136         Add error 502 report.
3137         (StaticClass.DefineType): Add error 441 report.
3138         (Class.AllowedModifiersProp): New virtual property as temporary
3139         extension to AllowedModifiers.
3140         (Class.DefineType): Add error 418 report. Moved ModFlags check here
3141         to share implementation with StaticClass and don't call virtual
3142         methods from ctor.
3143         
3144         * driver.cs (MainDriver): Add error 1558 test.
3145
3146         * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
3147         report. Moved error 36 test here.
3148
3149         * statement.cs (Throw.Resolve): Add error 724 report.
3150
3151         * typemanager.cs: Add out_attribute_type core type.
3152         
3153 2004-12-13  Marek Safar  <marek.safar@seznam.cz>
3154
3155         * class.cs (TypeContainer.VerifyClsCompliance): Add error
3156         3018 report.
3157         (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
3158
3159         * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
3160         3017 report.
3161         
3162         * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
3163
3164         * parameter.cs (ReturnParameter.ApplyAttributeBuilder): 
3165         Add error 3023 report.
3166         (Parameter.ApplyAttributeBuilder): Add error 3022 report.
3167
3168         * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
3169         implementation.
3170
3171 2004-12-12  John Luke  <john.luke@gmail.com>
3172
3173         * driver.cs (AddArgs): take -- into account when
3174         adding arguments, fixes bug 65710 
3175
3176 2004-12-12  Martin Baulig  <martin@ximian.com>
3177
3178         * expression.cs (Unary.TryReduceNegative): Added support for
3179         SByteConstant and ByteConstant.
3180         (Unary.Reduce): Check error values from TryReduceNegative().
3181
3182 2004-12-10  Marek Safar  <marek.safar@seznam.cz>
3183
3184         * attributes.cs (Attribute.Resolve): Avoid multiple error report
3185         and report exception as error 182.
3186
3187 2004-12-10  Raja R Harinath  <rharinath@novell.com>
3188
3189         * driver.cs (Main): Fix message when there are warnings.
3190
3191 2004-12-09  Miguel de Icaza  <miguel@ximian.com>
3192
3193         * delegate.cs: Fixed my fix from yesterday, sorry about that.
3194
3195 2004-12-09  Marek Safar  <marek.safar@seznam.cz>
3196
3197         * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs: 
3198         Reduced number of warnings.
3199         
3200         * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
3201
3202 2004-12-08  Miguel de Icaza  <miguel@ximian.com>
3203
3204         * driver.cs: Removed message.
3205
3206         * delegate.cs: Fix bug introduced in 1.1.x: 70219.
3207
3208 2004-12-08    <vargaz@freemail.hu>
3209
3210         * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
3211
3212 2004-12-08  Martin Baulig  <martin@ximian.com>
3213
3214         * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
3215         instead of a CS3002 for properties and indexer.
3216
3217 2004-12-08  Martin Baulig  <martin@ximian.com>
3218
3219         * decl.cs (MemberName.ToString): Make this work again.
3220
3221 2004-12-08  Marek Safar  <marek.safar@seznam.cz>
3222
3223         * attribute.cs (Resolve): Add error 591 detection.
3224
3225         * class.cs (FieldMember.Define): Add error 1547 detection.
3226         (Indexer.Define): Add error 620 detection.
3227         (Operator.Define): Add error 590 detection.
3228
3229         * ecore.cs: Missing argument for error 79.
3230
3231         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
3232         detection.
3233
3234 2004-12-07  Marek Safar  <marek.safar@seznam.cz>
3235
3236         Fix #70106
3237         * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
3238         only.
3239
3240 2004-12-07  Atsushi Enomoto  <atsushi@ximian.com>
3241
3242         * cs-parser.jay : handle doc comments on implicit/explicit operators.
3243           Some operator comments were suppressed.
3244         * doc.cs : Implicit/explicit operator name in doc comments are like
3245           "op_Explicit(type)~returnType", so added suffix handling.
3246
3247 2005-01-21  Alp Toker  <alp@atoker.com>
3248
3249         * cs-parser.jay: destructor_declaration's container is PartialContainer
3250         not Class when partial types are used, so use Kind prop instead of 'is'.
3251
3252 2004-12-12  Martin Baulig  <martin@ximian.com>
3253
3254         * expression.cs (Unary.TryReduceNegative): Added support for
3255         SByteConstant and ByteConstant.
3256         (Unary.Reduce): Check error values from TryReduceNegative().
3257
3258 2004-12-11  Martin Baulig  <martin@ximian.com>
3259
3260         * support.cs (ReflectionParameters.ParameterName): If we have a
3261         `gpd', call `ParameterName' on it.
3262
3263         * parameter.cs (Parameter.GetParameterAttributes): New static method.
3264
3265         * pending.cs (PendingImplementation.DefineProxy): Call
3266         DefineParameter() for all of the MethodBuilder's arguments.
3267
3268 2004-12-09  Martin Baulig  <martin@ximian.com>
3269
3270         * doc.cs (DocUtil): Make this a static class.
3271
3272 2004-12-09  Martin Baulig  <martin@ximian.com>
3273
3274         * expression.cs (Invocation.InferType): Moved the type inference
3275         implementation into TypeManager.
3276
3277         * generics.cs (TypeManager): Moved the type inference
3278         implementation here.
3279
3280 2004-12-09  Martin Baulig  <martin@ximian.com>
3281
3282         * typemanager.cs (TypeManager): Make this a partial class.
3283
3284         * generics.cs
3285         (TypeManager): Move the generics part of `TypeManager' here.
3286
3287 2004-12-08  Martin Baulig  <martin@ximian.com>
3288
3289         * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
3290         instead of a CS3002 for properties and indexer.  Added CS3024
3291         check for generic interfaces.
3292
3293         * attributes.cs (AttributeTester.AnalyzeTypeCompliance): Generic
3294         instances are not CLS-compliant.
3295
3296 2004-12-08  Martin Baulig  <martin@ximian.com>
3297
3298         * cs-parser.jay
3299         (void_pointer_expression): New rule for `void*', `void**' etc.
3300         (typeof_expression): Add `void_pointer_expression'; fixes #66846.       
3301
3302 2004-12-08  Martin Baulig  <martin@ximian.com>
3303
3304         * expression.cs (Invocation.InferType): Removed the hack for
3305         MethodCore.MayUnify().  
3306
3307         * typemanager.cs (TypeManager.MayBecomeEqualGenericTypes): Make
3308         this actually work.
3309
3310         * class.cs (MethodCore.MayUnify): Use
3311         TypeManager.MayBecomeEqualGenericTypes().       
3312
3313 2004-12-08  Martin Baulig  <martin@ximian.com>
3314
3315         * expression.cs (Is.DoResolve, As.DoResolve): If we're a type
3316         parameter, box it.  Fixes #69233.
3317
3318 2004-12-08  Martin Baulig  <martin@ximian.com>
3319
3320         * generic.cs (ConstructedType.CheckConstraints): Valuetypes always
3321         have the ctor constraint.  Fixes #68326.
3322
3323 2004-12-07  Atsushi Enomoto  <atsushi@ximian.com>
3324
3325         * cs-parser.jay : interface comment was not consumed because of
3326           extra opt_semicolon before doc handling.
3327
3328 2004-12-03  Raja R Harinath  <rharinath@novell.com>
3329
3330         Fix test-327.cs, test-328.cs, and put in early infrastructure
3331         for eventually fixing #52697.
3332         * namespace.cs (NamespaceEntry.LookupForUsing): New method.
3333         (NamespaceEntry.LookupNamespaceOrType): New method, refactored
3334         from other methods.
3335         (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
3336         (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
3337         (VerifyUsing, error246): Update.
3338         * rootcontext.cs (RootContext.NamespaceLookup): Just use
3339         'NamespaceEntry.LookupNamespaceOrType'.
3340
3341 2004-12-07  Martin Baulig  <martin@ximian.com>
3342
3343         * driver.cs: Call it "BETA SOFTWARE" :-)
3344
3345 2004-12-06  Raja R Harinath  <rharinath@novell.com>
3346
3347         Fix crash on cs0657-17.cs.
3348         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
3349         Use RootContext.Tree.Types, not 'new RootTypes ()'.
3350         * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
3351         the case where the NamespaceEntry gets overwritten.
3352
3353 2004-12-06  Marek Safar  <marek.safar@seznam.cz>
3354
3355         Fixed #69195, #56821
3356         * ecore.cs (ResolveBoolean): Tiny refactoring.
3357
3358         * expression.cs (Binary.DoResolve): Add warning 429 and skipping
3359         of right expression resolving when left is false constant and
3360         operator is LogicalAnd OR true constant and operator is LogicalOr.
3361
3362         * statement.cs (ResolveUnreachable): Always reports warning.
3363
3364 2004-12-05  Miguel de Icaza  <miguel@ximian.com>
3365
3366         * class.cs: Distinguish between 1721 and 1722 (just a little help
3367         for the programmer).
3368
3369 2004-12-03  Miguel de Icaza  <miguel@ximian.com>
3370
3371         * delegate.cs: Only allow this on new versions of the language. 
3372
3373 2004-12-02  Duncan Mak  <duncan@ximian.com>
3374
3375         * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
3376         Expression class.
3377         (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
3378         here as a static method. Take an additional bool out parameter
3379         `must_do_cs1540_check' for signaling to InstanceResolve.
3380         (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
3381         member field from PropertyExpr class and made it an argument of
3382         the method instead.
3383         (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
3384         check for MarshalByRefObject, and report CS0122 instead of CS1540.
3385         (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
3386         and `remove_accessor' as well as InstanceResolve: report CS0122
3387         where applicable.
3388
3389         Fixes #70129.
3390
3391 2004-12-07  Martin Baulig  <martin@ximian.com>
3392
3393         * decl.cs (DeclSpace.AddToContainer): Report correct errors CS0694
3394         and CS0692 where appropriate.
3395
3396 2004-12-06  Martin Baulig  <martin@ximian.com>
3397
3398         * class.cs (MethodCore.MayUnify): Moved the CS0408 check here from
3399         IsDuplicateImplementation() and improved it.
3400
3401         * expression.cs (Invocation.InferTypeArguments): Added
3402         `Type[] inferred_class_types' argument (for MethodCore.MayUnify)
3403         and removed the "ref" modifier from `infered_types'.
3404
3405         * decl.cs (MemberName.ToString): Removed the exception.
3406
3407 2004-12-03  Atsushi Enomoto  <atsushi@ximian.com>
3408
3409         * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
3410           comments are allowed.
3411
3412 2004-12-03  Carlos Alberto Cortez <calberto.cortez@gmail.com>
3413
3414         * delegate.cs: Add checks for subtypes in paramaters and return values
3415         in VerifyMethod () to add support for Covariance/Contravariance
3416         in delegates.
3417         
3418 2004-12-02  Miguel de Icaza  <miguel@ximian.com>
3419
3420         * report.cs: Remove extra closing parenthesis.
3421
3422         * convert.cs (Error_CannotImplicitConversion): If the name of the
3423         types are the same, provide some extra information.
3424
3425 2004-12-02  Marek Safar  <marek.safar@seznam.cz>
3426
3427         Fix bug #70102
3428         * attribute.cs (Resolve): Improved implementation of params
3429         attribute arguments.
3430
3431         * support.cs (ParameterData): Add HasParams to be faster.
3432
3433 2004-12-02  Atsushi Enomoto  <atsushi@ximian.com>
3434
3435         all things are for /doc support:
3436
3437         * doc.cs: new file that supports XML documentation generation.
3438         * mcs.exe.sources: added doc.cs.
3439         * driver.cs:
3440           Handle /doc command line option.
3441           Report error 2006 instead of 5 for missing file name for /doc.
3442           Generate XML documentation when required, after type resolution.
3443         * cs-tokenizer.cs:
3444           Added support for picking up documentation (/// and /** ... */),
3445           including a new XmlCommentState enumeration.
3446         * cs-parser.jay:
3447           Added lines to fill Documentation element for field, constant,
3448           property, indexer, method, constructor, destructor, operator, event
3449           and class, struct, interface, delegate, enum.
3450           Added lines to warn incorrect comment.
3451         * rootcontext.cs :
3452           Added Documentation field (passed only when /doc was specified).
3453         * decl.cs:
3454           Added DocComment, DocCommentHeader, GenerateDocComment() and
3455           OnGenerateDocComment() and some supporting private members for
3456           /doc feature to MemberCore.
3457         * class.cs:
3458           Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
3459         * delegate.cs:
3460           Added overriden DocCommentHeader.
3461         * enum.cs:
3462           Added overriden DocCommentHeader and GenerateDocComment().
3463
3464 2004-12-01  Miguel de Icaza  <miguel@ximian.com>
3465
3466         * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
3467         unwrapping the enumeration values, chain to
3468         DoConstantNumericPromotions again, so we can promote things to the
3469         fundamental types (takes care of enums that are bytes, sbytes).
3470
3471         Fixes bug #62054.
3472
3473 2004-12-01  Raja R Harinath  <rharinath@novell.com>
3474
3475         * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
3476         Fix long-standing bug in type-lookup.  Use FindType instead of
3477         LookupType when ec.ResolvingTypeTree.
3478         (Attribute.ResolveType, Attribute.Resolve)
3479         (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
3480         Update to changes.
3481         (Attributes.Search): Remove internal version.  Update.
3482         (Attributes.SearchMulti): Update.
3483         (Attributes.GetClsCompliantAttribute): Remove.
3484         (Attributes.GetIndexerNameAttribute): Remove.
3485         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
3486         (DeclSpace.GetClsCompliantAttributeValue): Likewise.
3487         * class.cs (Indexer.Define): Likewise.
3488
3489 2004-12-01  Marek Safar  <marek.safar@seznam.cz>
3490
3491         Fix bug #68790
3492         * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
3493         MarshallByReference members access.
3494
3495         * expression.cs: Use CheckMarshallByRefAccess;
3496         Better error CS0197 message.
3497
3498         * report.cs: Print whole related error message.
3499
3500 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
3501
3502         * class (GetClassBases): Better error 60 report.
3503         (EventProperty): Disabled warning 67 detection.
3504
3505 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
3506
3507         Fix bug #60324
3508         * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
3509
3510         * constant.cs (DecimalConstant.Emit): Don't use int ctor for
3511         precise values.
3512
3513 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
3514
3515         Fix bug #49488
3516         * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
3517
3518         * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
3519
3520 2004-11-26  Miguel de Icaza  <miguel@ximian.com>
3521
3522         * attribute.cs (Attribute.Resolve): Refine error reporting and
3523         report a cs0117 if the identifier does not exist, to distinguish
3524         from 0617 which is a miss-use of the actual identifier.
3525
3526         * ecore.cs (EventExpr.Emit): Refine error report and distinguish
3527         between cs0070 and cs0079.
3528
3529         * class.cs (MemberBase.DoDefine): When reporting a wrong
3530         accessibility level, we use MethodCore to compare instead of
3531         Method (this was a regression in some refactoring effort).
3532
3533         So now we correctly report cs0056 again.
3534
3535         * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
3536         testing the target_type (which was known to be object_type) and
3537         not the source type (which is anonymous_method).
3538
3539         Fixed reporting of error cs1660.
3540
3541         * expression.cs (UserCast.Source): Expose the underlying cast.
3542
3543         * statement.cs (Switch.SwitchGoverningType): Sort the list of
3544         allowed types to find a match to int32 first (most common).
3545
3546         In addition, it ignores any ImplicitUserConversions that did an
3547         internal implicit conversion (as the switch statement allows only
3548         one integral conversion to exist).
3549
3550         * class.cs (PartialContainer.Create): rename `name' to
3551         `member_name' for clarity.  Then replace the string calls with a
3552         call to MemberName.GetPartialName, as now using
3553         MemberName.ToString is an error (this is due to the side effects
3554         it had, that were fixed in the past).
3555
3556         This will restore the error reporting on a number of partial class
3557         errors that were missusing this (and getting an exception as a
3558         results, which is now just a plain textual warning, because
3559         yyparse debug output would crash otherwise).
3560
3561 2004-11-26  Raja R Harinath  <rharinath@novell.com>
3562
3563         * Makefile (PROGRAM_INSTALL_DIR): Remove.
3564
3565 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
3566
3567         * rootcontext.cs (LookupType): Make sure to cache lookups that
3568         don't give us a negative result. This saves about 5% of corlib
3569         compilation time.
3570
3571 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
3572
3573         * report.cs (AbstractMessage.Print): messages are sent to stderr
3574
3575         * class.cs (TypeContainer.GetClassBases): It is an error to have a
3576         non-interface in the list of interfaces (at this point, either
3577         parent was properly set, or a base class is being listed in the
3578         interfaces section).
3579
3580         This flags error 1722, and resolves the crash from bug 69259.
3581
3582 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
3583
3584         * statement.cs (Using.EmitExpressionFinally): make this work right
3585         for valuetypes. Fixes 69926.
3586
3587 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
3588
3589         * const.cs (Const.ChangeType): Cope with the "0 literal can be
3590         converted to an enum" here, before we try to change the underlying
3591         type.  This code exists, but it is a different code path than the
3592         one used while encoding constants.
3593
3594         (ImplicitReferenceConversionExists): In addition, resynchronized
3595         the code here, so it matches the same code in
3596         ImplicitReferenceConversionExists for the `from any class-type S
3597         to any interface-type T'.       
3598
3599 2004-11-25  Marek Safar  <marek.safar@seznam.cz>
3600
3601         * cfold.cs (BinaryFold): Add addition for DecimalConstant.
3602
3603 2004-11-24  Miguel de Icaza  <miguel@ximian.com>
3604
3605         * cs-parser.jay: Use verbosity accordingly. 
3606
3607 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
3608
3609         * expression.cs (Unary.ResolveOperator): Do not report warning;
3610         AddressOf reads from variable.
3611         
3612         (LocalVariableReferences.DoResolveBase): Improved my previous fix.
3613
3614 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
3615
3616         Fix bug #69462
3617
3618         * attribute.cs (Attributable): Removed CheckTargets.
3619         (Attributes.Emit): Explicit attribute targets are tested here.
3620
3621         * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
3622         not enabled for interfaces.
3623
3624         * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
3625         (GetAssemblyName): Ouch next bug there.
3626
3627 2004-11-23  Carlos Alberto Cortez <calberto.cortez@gmail.com>
3628
3629         * expression.cs: Error 275 added.
3630         
3631 2004-11-23  Marek Safar  <marek.safar@seznam.cz>
3632
3633         Fix bug #69177 (Implemented decimal constant support)
3634
3635         * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
3636         (BinaryFold): Add DecimalConstant.
3637
3638         * const.cs (Define): Decimal constant 
3639         (is not constant.
3640         (ChangeType): Add decimal type handling.
3641         (LookupConstantValue): Don't set value for decimal type but
3642         emit DecimalConstantAttribute. Needed for constant optimization.
3643
3644         * constant.cs (ToDecimal): New method.
3645         (ConvertToDecimal): New method.
3646         (IntConstant): Implemented ConvertToDecimal.
3647         (DecimalConstant.Emit): Emit optimized version for decimals in
3648         int range.
3649
3650         * expression.cs (ResolveOperator): Changed order of constant
3651         reduction to work correctly with native types which have
3652         overloaded operators.
3653         (ResolveMemberAccess): Extract constant value from attribute
3654         for decimal type.
3655
3656         * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
3657
3658         * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
3659         void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
3660         (ChangeType): Decimal is special.
3661         (TypeToCoreType): Add decimal type.
3662
3663 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
3664
3665         * convert.cs (ImplicitConversionRequired): Add error cs0642 for
3666         decimal types.
3667
3668 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
3669
3670         * class.cs (EventField.ApplyAttributeBuilder): Fix error
3671         test cs1667-5.cs.
3672
3673 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
3674
3675         * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
3676
3677         * pending.cs (PendingImplementation): Grab only interfaces.
3678
3679 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
3680
3681         * statement.cs (ForeachHelperMethods): Add location member and
3682         error 202 detection.
3683
3684 2004-11-18  Marek Safar  <marek.safar@seznam.cz>
3685
3686         * expression.cs (DoResolveBase): Fixed wrong warning for out
3687         variables.
3688
3689 2004-12-04  Martin Baulig  <martin@ximian.com>
3690
3691         * convert.cs (Convert.TypeParameter_to_Null): Use the constraints
3692         to check whether the conversion is ok.
3693
3694         * typemanager.cs (TypeManager.GetTypeArguments): Just return
3695         `Type.EmptyTypes' if we're not a generic TypeContainer.
3696
3697 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
3698
3699         * convert.cs (ImplicitReferenceConversionExists): A surprisingly
3700         old bug: when converting from the null literal to a pointer,
3701         return an EmptyCast, not the NullLiteral.
3702
3703         This fixes #69921, the recent null_type changes probably made this
3704         bug more prominent.
3705
3706 2004-12-03  Martin Baulig  <martin@ximian.com>
3707
3708         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
3709         method as our child, call AnonymousMethod.Compatible() on it.
3710
3711 2004-12-02  Miguel de Icaza  <miguel@ximian.com>
3712
3713         * class.cs (FieldBase): Use an unused bit field from the field to
3714         encode the `has_offset' property from the FieldMember.  This saves
3715         a couple of Ks on bootstrap compilation.
3716
3717         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
3718         method as our child, return the AnonymousMethod resolved
3719         expression.
3720
3721         * expression.cs (New.DoResolve): Allow return values from
3722         NewDelegate to also include AnonymousMethods.
3723
3724         Fixes #70150.
3725
3726 2004-11-29  Raja R Harinath  <rharinath@novell.com>
3727
3728         * decl.cs (MemberCore.MemberName): Remove readonly to fix an error
3729         cs1648 report.
3730         * rootcontext.cs (ResolveCore::interfaces_first_stage): Add
3731         System.Runtime.InteropServices._Exception, since it's a base
3732         interface of the core type System.Exception in the net_2_0 profile.
3733
3734 2004-11-27  Martin Baulig  <martin@ximian.com>
3735
3736         * ecore.cs (Expression.StoreFromPtr): Use `stobj' for generic parameters.
3737
3738 2004-11-26  Raja R Harinath  <rharinath@novell.com>
3739
3740         * Makefile: Convert to use executable.make.
3741         * gmcs.exe.sources: New.
3742
3743 2004-11-25  Martin Baulig  <martin@ximian.com>
3744
3745         * expression.cs (Invocation.InferType): Added support for byref types.
3746
3747 2004-11-25  Martin Baulig  <martin@ximian.com>
3748
3749         * statement.cs (Foreach.FetchMethodMoveNext): Wrap `mi.ReturnType'
3750         in TypeManager.TypeToCoreType().
3751
3752 2004-11-25  Martin Baulig  <martin@ximian.com>
3753
3754         * iterators.cs (Iterator.DoDefineMembers): Override and lookup the
3755         "Dispose" method from the `current_type'.
3756         (Iterator.EmitMoveNext): Use the `dispose_method' we looked up in
3757         DoDefineMembers() instead of using the MethodBuilder; this is
3758         required for generic iterators.
3759
3760         * class.cs (TypeContainer.DoDefineMembers): Make this virtual.
3761
3762 2004-11-24  Martin Baulig  <martin@ximian.com>
3763
3764         * ecore.cs (Expression.LoadFromPtr): Use `ldobj' for generic parameters.
3765
3766 2004-11-20  Martin Baulig  <martin@ximian.com>
3767
3768         * expression.cs (Invocation.InferType): Correctly infer generic
3769         instances; see gen-103.cs.
3770         (Invocation.InferTypeArguments): If a generic method doesn't have
3771         any unbound type parameters, we don't need to infer anything.
3772
3773 2004-11-19  Raja R Harinath  <rharinath@novell.com>
3774
3775         * Makefile (gmcs.exe): Update to new location of bootstrap mcs.exe.
3776
3777 2004-11-17  Raja R Harinath  <rharinath@novell.com>
3778
3779         * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
3780         (TypeHandle.GetMemberCache): New.
3781         (TypeHandle.TypeHandle): Update.
3782         (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
3783         (TypeManager.LookupParentInterfacesCache):
3784         Rename from LookupInterfaceCache.  Optimize slightly.
3785         (TypeManager.MemberLookup_FindMembers): Update.
3786         * decl.cs (MemberCache.MemberCache): Set Container to null in the
3787         multi-type variant.
3788         (AddCacheContents): Rename from AddHashtable.
3789         * class.cs (TypeContainer.parent_container): Remove.
3790         (TypeContainer.VerifyClsCompliance): Don't use parent_container.
3791         (TypeContainer.DoDefineMembers): Don't initialize it.
3792         Update to name changes.
3793         
3794 2004-11-17  Miguel de Icaza  <miguel@ximian.com>
3795
3796         * class.cs (MethodCore.CheckAccessModifiers): New helper routine
3797         that factors the code to check access modifiers on override.  
3798
3799         (PropertyBase): Use the code here.
3800
3801         Patch from Lluis S'anchez, fixes bug #69361.
3802
3803 2004-11-15  Miguel de Icaza  <miguel@ximian.com>
3804
3805         * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
3806         routine that is used to report the use of a captured variable
3807         whose address has been taken.
3808
3809         There are two checks: one when variables are being captured and
3810         the other check is when the address of a variable is taken. 
3811         
3812         (because an anonymous methods might be resolved before *or* after
3813         the address has been taken) and 
3814
3815         * expression.cs (Conditional.DoResolve): Remove the special
3816         casing that Martin added to trueExpr and falseExpr being both
3817         NullLiteral.  We get the right behavior now just by introducing
3818         the null_type into the compiler. 
3819
3820         * convert.cs (ExplicitConversion): Change the code to use
3821         null_type instead of testing `expr is NullLiteral'.
3822         (ImplicitConversionStandard): use null_type too.
3823         (ImplicitReferenceConversionExists): use null_type too.
3824         (ImplicitReferenceConversion): use null_type too.
3825
3826         * literal.cs: The type of `NullLiteral' is now null_type instead
3827         of object_type. 
3828         (Resolve): Set the type here.
3829
3830         * typemanager.cs: Introduce null_type.
3831
3832 2004-11-18  Martin Baulig  <martin@ximian.com>
3833
3834         * rootcontext.cs
3835         (RootContext.LookupType): Return a `Type', not a `TypeExpr'.
3836
3837 2004-11-18  Martin Baulig  <martin@ximian.com>
3838
3839         * ecore.cs (TypeExpr.DoResolveAsTypeStep): Make this protected.
3840
3841 2004-11-18  Martin Baulig  <martin@ximian.com>
3842
3843         * generic.cs (Constraints.Resolve): Take an `EmitContext' instead
3844         of a `DeclSpace'.  If one of our constraints is a `ConstructedType',
3845         call ResolveConstructedType() on it to resolve it without checking
3846         constraints.
3847         (Constraints.ResolveTypes): Check them here.
3848         (ConstructedType.DoResolveAsTypeStep): Fully resolve ourselves,
3849         but don't check constraints.
3850         (ConstructedType.ResolveAsTypeTerminal): Override this and also
3851         check constraints here.
3852         (ConstructedType.ResolveConstructedType): New public method.  This
3853         is called from DoResolveAsTypeStep() and Constraints.Resolve() to
3854         resolve ourselves without checking constraints.
3855
3856         * ecore.cs (Expression.ResolveAsTypeTerminal): Make this virtual.
3857
3858 2004-11-18  Martin Baulig  <martin@ximian.com>
3859
3860         * decl.cs
3861         (DeclSpace.CurrentType): Changed type from `TypeExpr' to `Type'.
3862
3863         * delegate.cs (Delegate.DefineType): Always create the EmitContext.
3864
3865 2004-11-18  Martin Baulig  <martin@ximian.com>
3866
3867         * ecore.cs (TypeExpr.ResolveType): Removed.
3868         (Expression.ResolveAsTypeTerminal): We always return a fully
3869         resolved `TypeExpr', so we can just access its `Type'.
3870
3871         * class.cs (TypeContainer.DefineType): Resolve `CurrentType' here.
3872
3873 2004-11-17  Martin Baulig  <martin@ximian.com>
3874
3875         * ecore.cs (IAlias.Type): Replaced with ResolveAsType() to make
3876         sure we don't return any unresolved TypeExpr's.
3877         (TypeAliasExpression): The .ctor now takes an `IAlias' instead of
3878         a `TypeExpr'.
3879         (Expression.ResolveAsTypeTerminal): Make sure `te.Type != null'.
3880
3881         * expression.cs (MemberAccess.ResolveAsTypeStep): Don't return any
3882         unresolved `ConstructedType's.
3883
3884 2004-11-17  Martin Baulig  <martin@ximian.com>
3885
3886         * ecore.cs (TypeExpr.ResolveType): Don't make this virtual.
3887
3888 2004-11-17  Martin Baulig  <martin@ximian.com>
3889
3890         * ecore.cs
3891         (Expression.ResolveAsTypeTerminal): Removed the `bool silent' argument.
3892
3893         * decl.cs (DeclSpace.ResolveType): Removed.
3894         (DeclSpace.ResolveTypeExpr): Removed the `bool silent' argument.
3895
3896 2004-11-17  Martin Baulig  <martin@ximian.com>
3897
3898         * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
3899         direction, like FindMembers() does.  Fixes #69546, testcase is in
3900         test-315.cs.    
3901
3902 2004-11-16  Martin Baulig  <martin@ximian.com>
3903
3904         This is based on a patch from Marek Safar, see bug #69082.
3905         Fixes bugs #63705 and #67130.
3906
3907         * typemanager.cs (TypeManager.LookupInterfaceCache): New public
3908         method; create a MemberCache for an interface type and cache the
3909         result.
3910
3911         * decl.cs (IMemberContainer.ParentContainer): Removed.
3912         (IMemberContainer.ParentCache): New property.
3913         (MemberCache.SetupCacheForInterface): Removed.
3914         (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
3915         to create a cache for an interface's "parent".
3916
3917         * class.cs (TypeContainer.DoDefineMembers): Setup cache for
3918         interfaces too.
3919
3920 2004-11-14  Ben Maurer  <bmaurer@ximian.com>
3921
3922         * statement.cs: Avoid adding bools to a hashtable.
3923
3924 2004-11-15  Martin Baulig  <martin@ximian.com>
3925
3926         * decl.cs (MemberName.GetPartialName): Removed, use GetTypeName() instead.
3927
3928 2004-11-11  Martin Baulig  <martin@ximian.com>
3929
3930         * typemanager.cs (TypeManager.GetMethodName): New method.
3931
3932         * class.cs (MethodData.Define): Include the generic arity in the
3933         name of an explicit interface; also add it to the method name.
3934
3935         * pending.cs (PendingImplementation.InterfaceMethod): The method
3936         name now includes the generic arity.
3937
3938 2004-11-07  Miguel de Icaza  <miguel@ximian.com>
3939
3940         * expression.cs (Invocation.OverloadResolve): Flag error if we are
3941         calling an unsafe method from a safe location.
3942
3943 2004-11-06  Marek Safar  <marek.safar@seznam.cz>
3944
3945         Fix #69167
3946         * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
3947
3948 2004-11-06  Miguel de Icaza  <miguel@ximian.com>
3949
3950         * namespace.cs (VerifyUsing): use GetPartialName instead of
3951         ToString. 
3952
3953 2004-11-05  Miguel de Icaza  <miguel@ximian.com>
3954
3955         * statement.cs (Return.Resolve): Fix regression in typo: if
3956         `in_exc', we have to request a NeedReturnLabel, this was a typo
3957         introduced in the anonymous method check-in.  Fixes #69131.
3958
3959         * Indexers were using the ShortName when defining themselves,
3960         causing a regression in the compiler bootstrap when applying the
3961         patch from 2004-11-02 (first part), now they use their full name
3962         and the bug is gone.
3963
3964 2004-11-04  Zoltan Varga  <vargaz@freemail.hu>
3965
3966         * driver.cs: Strip the path from the names of embedded resources. Fixes
3967         #68519.
3968
3969 2004-11-04  Raja R Harinath  <rharinath@novell.com>
3970
3971         Fix error message regression: cs0104-2.cs.
3972         * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
3973         (AliasEntry.Resolve): Update.
3974         * rootcontext.cs (RootContext.NamespaceLookup): Update.  Remove
3975         'silent' flag.
3976         (RootContext.LookupType): Update.
3977
3978 2004-11-03  Carlos Alberto Cortez <carlos@unixmexico.org>
3979
3980         * cs-parser.jay: Add support for handling accessor modifiers
3981         * class: Add support port accessor modifiers and error checking,
3982         define PropertyMethod.Define as virtual (not abstract anymore)
3983         * ecore.cs: Add checking for proeprties access with access modifiers
3984         * iterators.cs: Modify Accessor constructor call based in the modified
3985         constructor
3986 2004-11-02  Ben Maurer  <bmaurer@ximian.com>
3987
3988         * expression.cs (StringConcat): Handle being called twice,
3989         as when we have a concat in a field init with more than two
3990         ctors in the class
3991
3992 2004-11-02  Miguel de Icaza  <miguel@ximian.com>
3993
3994         * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
3995         special case explicit implementations, we should always produce
3996         the .property or .event declaration.
3997         
3998         * decl.cs (MemberName): Renamed GetFullName to GetPartialName
3999         since it will not return correct data if people use this
4000         unresolved in the presence of using statements (see test-313).
4001
4002         * class.cs (MethodData.Define): If we are an explicit interface
4003         implementation, set the method name to the full name of the
4004         interface plus the name of the method.  
4005
4006         Notice that using the method.MethodName.GetFullName() does not
4007         work, as it will only contain the name as declared on the source
4008         file (it can be a shorthand in the presence of using statements)
4009         and not the fully qualifed type name, for example:
4010
4011         using System;
4012
4013         class D : ICloneable {
4014                 object ICloneable.Clone ()  {
4015                 }
4016         }
4017
4018         Would produce a method called `ICloneable.Clone' instead of
4019         `System.ICloneable.Clone'.
4020
4021         * namespace.cs (Alias.Resolve): Use GetPartialName.
4022         
4023 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
4024
4025         * cs-parser.jay: Add error 1055 report.
4026
4027 2004-11-01  Miguel de Icaza  <miguel@ximian.com>
4028
4029         * assign.cs (Assign.DoResolve): Only do the transform of
4030         assignment into a New if the types are compatible, if not, fall
4031         through and let the implicit code deal with the errors and with
4032         the necessary conversions. 
4033
4034 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
4035
4036         * cs-parser.jay: Add error 1031 report.
4037
4038         * cs-tokenizer.cs: Add location for error 1038.
4039
4040 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
4041
4042         * cs-parser.jay: Add error 1016 report.
4043
4044 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
4045
4046         * cs-parser.jay: Add errors 1575,1611 report.
4047
4048 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
4049
4050         * cs-parser.jay: Add error 1001 report.
4051
4052 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
4053
4054         Fix #68850
4055         * attribute.cs (GetMarshal): Add method argument for
4056         caller identification.
4057
4058         * class.cs, codegen.cs, enum.cs, parameter.cs: Added
4059         agument for GetMarshal and RuntimeMissingSupport.
4060
4061 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
4062
4063         * attribute.cs (ExtractSecurityPermissionSet): Removed
4064         TypeManager.code_access_permission_type.
4065
4066         * typemanager.cs: Removed TypeManager.code_access_permission_type.
4067
4068 2004-10-27  Miguel de Icaza  <miguel@ximian.com>
4069
4070         * expression.cs (LocalVariableReference.DoResolveLValue): Check
4071         for obsolete use of a variable here.   Fixes regression on errors
4072         cs0619-25 and cs0619-26.
4073
4074 2004-10-27  Marek Safar  <marek.safar@seznam.cz>
4075
4076         Fix #62358, implemented security attribute encoding.
4077
4078         * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
4079         Tests permitted SecurityAction for assembly or other types.
4080         (Assembly.ExtractSecurityPermissionSet): New method. Transforms
4081         data from SecurityPermissionAttribute to PermisionSet class.
4082
4083         * class.cs (ApplyAttributeBuilder): Added special handling
4084         for System.Security.Permissions.SecurityAttribute based types.
4085
4086         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
4087         special handling for System.Security.Permissions.SecurityAttribute
4088         based types.
4089
4090         * enum.cs (ApplyAttributeBuilder): Added special handling
4091         for System.Security.Permissions.SecurityAttribute based types.
4092
4093         * parameter.cs (ApplyAttributeBuilder): Added special handling
4094         for System.Security.Permissions.SecurityAttribute based types.
4095
4096         * rootcontext.cs: Next 2 core types.
4097
4098         * typemanager.cs (TypeManager.security_permission_attr_type):
4099         Built in type for the SecurityPermission Attribute.
4100         (code_access_permission_type): Build in type.
4101
4102 2004-10-17  Miguel de Icaza  <miguel@ximian.com>
4103
4104         * expression.cs (LocalVariableReference.DoResolveBase, Emit):
4105         Remove the tests for `ec.RemapToProxy' from here, and encapsulate
4106         all of this information into
4107         EmitContext.EmitCapturedVariableInstance.
4108         
4109         * codegen.cs (EmitCapturedVariableInstance): move here the
4110         funcionality of emitting an ldarg.0 in the presence of a
4111         remapping.   This centralizes the instance emit code.
4112
4113         (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
4114         then emit a load of this: it means that we have reached the
4115         topmost ScopeInfo: the one that contains the pointer to the
4116         instance of the class hosting the anonymous method.
4117
4118         * anonymous.cs (AddField, HaveCapturedFields): Propagate field
4119         captures to the topmost CaptureContext.
4120
4121 2004-10-12  Miguel de Icaza  <miguel@ximian.com>
4122
4123         * expression.cs (LocalVariableReference): Move the knowledge about
4124         the iterators into codegen's EmitCapturedVariableInstance.
4125
4126 2004-10-11  Miguel de Icaza  <miguel@ximian.com>
4127
4128         * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
4129         all code paths return a value from an anonymous method (it is the
4130         same as the 161 error, but for anonymous methods).
4131
4132 2004-10-08  Miguel de Icaza  <miguel@ximian.com>
4133
4134         The introduction of anonymous methods in the compiler changed
4135         various ways of doing things in the compiler.  The most
4136         significant one is the hard split between the resolution phase
4137         and the emission phases of the compiler.
4138
4139         For instance, routines that referenced local variables no
4140         longer can safely create temporary variables during the
4141         resolution phase: they must do so from the emission phase,
4142         since the variable might have been "captured", hence access to
4143         it can not be done with the local-variable operations from the runtime.
4144         
4145         * statement.cs 
4146
4147         (Block.Flags): New flag `IsTopLevel' to indicate that this block
4148         is a toplevel block.
4149
4150         (ToplevelBlock): A new kind of Block, these are the blocks that
4151         are created by the parser for all toplevel method bodies.  These
4152         include methods, accessors and anonymous methods.
4153
4154         These contain some extra information not found in regular blocks:
4155         A pointer to an optional CaptureContext (for tracking captured
4156         local variables and parameters).  A pointer to the parent
4157         ToplevelBlock.
4158         
4159         (Return.Resolve): Catch missmatches when returning a value from an
4160         anonymous method (error 1662).
4161         Invoke NeedReturnLabel from the Resolve phase instead of the emit
4162         phase.
4163
4164         (Break.Resolve): ditto.
4165
4166         (SwitchLabel): instead of defining the labels during the
4167         resolution phase, we now turned the public ILLabel and ILLabelCode
4168         labels into methods called GetILLabelCode() and GetILLabel() that
4169         only define the label during the Emit phase.
4170
4171         (GotoCase): Track the SwitchLabel instead of the computed label
4172         (its contained therein).  Emit the code by using
4173         SwitchLabel.GetILLabelCode ().
4174
4175         (LocalInfo.Flags.Captured): A new flag has been introduce to track
4176         whether the Local has been captured or not.
4177
4178         (LocalInfo.IsCaptured): New property, used to tell whether the
4179         local has been captured.
4180         
4181         * anonymous.cs: Vastly updated to contain the anonymous method
4182         support.
4183
4184         The main classes here are: CaptureContext which tracks any
4185         captured information for a toplevel block and ScopeInfo used to
4186         track the activation frames for various local variables.   
4187
4188         Each toplevel block has an optional capture context associated
4189         with it.  When a method contains an anonymous method both the
4190         toplevel method and the anonymous method will create a capture
4191         context.   When variables or parameters are captured, they are
4192         recorded on the CaptureContext that owns them, for example:
4193
4194         void Demo () {
4195              int a;
4196              MyDelegate d = delegate {
4197                  a = 1;
4198              }
4199         }
4200
4201         Here `a' will be recorded as captured on the toplevel
4202         CapturedContext, the inner captured context will not have anything
4203         (it will only have data if local variables or parameters from it
4204         are captured in a nested anonymous method.
4205
4206         The ScopeInfo is used to track the activation frames for local
4207         variables, for example:
4208
4209         for (int i = 0; i < 10; i++)
4210                 for (int j = 0; j < 10; j++){
4211                    MyDelegate d = delegate {
4212                         call (i, j);
4213                    }
4214                 }
4215
4216         At runtime this captures a single captured variable `i', but it
4217         captures 10 different versions of the variable `j'.  The variable
4218         `i' will be recorded on the toplevel ScopeInfo, while `j' will be
4219         recorded on a child.  
4220
4221         The toplevel ScopeInfo will also track information like the `this'
4222         pointer if instance variables were referenced (this is necessary
4223         as the anonymous method lives inside a nested class in the host
4224         type of the method). 
4225
4226         (AnonymousMethod): Expanded to track the Toplevel, implement
4227         `AnonymousMethod.Compatible' to tell whether an anonymous method
4228         can be converted to a target delegate type. 
4229
4230         The routine now also produces the anonymous method content
4231
4232         (AnonymousDelegate): A helper class that derives from
4233         DelegateCreation, this is used to generate the code necessary to
4234         produce the delegate for the anonymous method that was created. 
4235
4236         * assign.cs: API adjustments for new changes in
4237         Convert.ImplicitStandardConversionExists.
4238
4239         * class.cs: Adjustments to cope with the fact that now toplevel
4240         blocks are of type `ToplevelBlock'. 
4241
4242         * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
4243         insteda of standard blocks.
4244
4245         Flag errors if params arguments are passed to anonymous methods.
4246
4247         * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
4248         `CurrentAnonymousMethod' which points to the current Anonymous
4249         Method.  The variable points to the AnonymousMethod class that
4250         holds the code being compiled.  It is set in the new EmitContext
4251         created for the anonymous method.
4252
4253         (EmitContext.Phase): Introduce a variable and an enumeration to
4254         assist in enforcing some rules about when and where we are allowed
4255         to invoke certain methods (EmitContext.NeedsReturnLabel is the
4256         only one that enfonces this right now).
4257
4258         (EmitContext.HaveCaptureInfo): new helper method that returns
4259         whether we have a CapturedContext initialized.
4260
4261         (EmitContext.CaptureVariable): New method used to register that a
4262         LocalInfo must be flagged for capturing. 
4263
4264         (EmitContext.CapturedParameter): New method used to register that a
4265         parameters must be flagged for capturing. 
4266         
4267         (EmitContext.CapturedField): New method used to register that a
4268         field must be flagged for capturing. 
4269
4270         (EmitContext.HaveCapturedVariables,
4271         EmitContext.HaveCapturedFields): Return whether there are captured
4272         variables or fields. 
4273
4274         (EmitContext.EmitMethodHostInstance): This is used to emit the
4275         instance for the anonymous method.  The instance might be null
4276         (static methods), this (for anonymous methods that capture nothing
4277         and happen to live side-by-side with the current method body) or a
4278         more complicated expression if the method has a CaptureContext.
4279
4280         (EmitContext.EmitTopBlock): Routine that drives the emission of
4281         code: it will first resolve the top block, then emit any metadata
4282         and then emit the code.  The split is done so that we can extract
4283         any anonymous methods and flag any captured variables/parameters.
4284         
4285         (EmitContext.ResolveTopBlock): Triggers the resolution phase,
4286         during this phase, the ILGenerator should not be used as labels
4287         and local variables declared here might not be accessible to any
4288         code that is part of an anonymous method.  
4289
4290         Exceptions to this include the temporary variables that are
4291         created by some statements internally for holding temporary
4292         variables. 
4293         
4294         (EmitContext.EmitMeta): New routine, in charge of emitting all the
4295         metadata for a cb
4296
4297         (EmitContext.TemporaryReturn): This method is typically called
4298         from the Emit phase, and its the only place where we allow the
4299         ReturnLabel to be defined other than the EmitMeta.  The reason is
4300         that otherwise we would have to duplicate a lot of logic in the
4301         Resolve phases of various methods that today is on the Emit
4302         phase. 
4303
4304         (EmitContext.NeedReturnLabel): This no longer creates the label,
4305         as the ILGenerator is not valid during the resolve phase.
4306
4307         (EmitContext.EmitThis): Extended the knowledge in this class to
4308         work in anonymous methods in addition to iterators. 
4309
4310         (EmitContext.EmitCapturedVariableInstance): This emits whatever
4311         code is necessary on the stack to access the instance to a local
4312         variable (the variable will be accessed as a field).
4313
4314         (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
4315         EmitContext.EmitAddressOfParameter): Routines to support
4316         parameters (not completed at this point). 
4317         
4318         Removals: Removed RemapLocal and RemapLocalLValue.  We probably
4319         will also remove the parameters.
4320
4321         * convert.cs (Convert): Define a `ConstantEC' which points to a
4322         null.  This is just to prefity some code that uses
4323         ImplicitStandardConversion code and do not have an EmitContext
4324         handy.
4325
4326         The idea is to flag explicitly that at that point in time, it is
4327         known that the conversion will not trigger the delegate checking
4328         code in implicit conversions (which requires a valid
4329         EmitContext). 
4330
4331         Everywhere: pass new EmitContext parameter since
4332         ImplicitStandardConversionExists now requires it to check for
4333         anonymous method conversions. 
4334
4335         (Convert.ImplicitStandardConversionExists): If the type of an
4336         expression is the anonymous_method_type, and the type is a
4337         delegate, we invoke the AnonymousMethod.Compatible method to check
4338         whether an implicit conversion is possible. 
4339
4340         (Convert.ImplicitConversionStandard): Only do implicit method
4341         group conversions if the language level is not ISO_1.
4342
4343         * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
4344         MethodInfo for the Invoke method.  used by Delegate and
4345         AnonymousDelegate.
4346
4347         * expression.cs (Binary.DoNumericPromotions): only allow anonymous
4348         method conversions if the target type is a delegate.
4349
4350         Removed extra debugging nops.
4351
4352         (LocalVariableReference): Turn the `local_info' into a public
4353         field. 
4354
4355         Add `prepared' field, the same hack used for FieldExprs to cope
4356         with composed assignments, as Local variables do not necessarily
4357         operate purely on the stack as they used to: they can be captured
4358         fields. 
4359
4360         Add `temp' for a temporary result, like fields.
4361
4362         Refactor DoResolve and DoResolveLValue into DoResolveBase.
4363
4364         It now copes with Local variables that are captured and emits the
4365         proper instance variable to load it from a field in the captured
4366         case. 
4367
4368         (ParameterReference.DoResolveBase): During the resolve phase,
4369         capture parameters if we are in an anonymous method.
4370
4371         (ParameterReference.Emit, ParameterReference.AddressOf): If in an
4372         anonymous method, use the EmitContext helper routines to emit the
4373         parameter reference.
4374
4375         * iterators.cs: Set RemapToProxy to true/false during the
4376         EmitDispose class.
4377
4378         * parameters.cs (GetParameterByName): New helper method. 
4379
4380         * typemanager.cs (anonymous_method_type) a new type that
4381         represents an anonyous method.  This is always an internal type,
4382         used as a fencepost to test against the anonymous-methodness of an
4383         expression. 
4384         
4385 2004-10-20  Marek Safar  <marek.safar@seznam.cz>
4386
4387         * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
4388         561 report.
4389         (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
4390
4391 2004-11-10  Martin Baulig  <martin@ximian.com>
4392
4393         * expression.cs (Invocation.BetterFunction): If two methods have
4394         equal parameter types, but only one of them is generic, the
4395         non-generic one wins.
4396         (New.DoResolve): Don't set `is_struct' to false if we're a generic
4397         instance; just use `Type.IsValueType' to determine whether
4398         something is a struct or not.
4399         (MemberAccess.DoResolveAsTypeStep): Don't modify the `args' field,
4400         so we can be called multiple times.
4401
4402 2004-11-10  Martin Baulig  <martin@ximian.com>
4403
4404         * generic.cs (TypeParameter.DefineConstraints): New public method.
4405         (TypeParameter.CheckAccessLevel): Override this and return true.
4406         (ConstructedType.ResolveType): Renamed to DoResolveType(), don't
4407         override ResolveType() anymore.
4408         (ConstructedType.DoResolveAsTypeStep): Call DoResolveType() here.
4409
4410 2004-11-10  Martin Baulig  <martin@ximian.com>
4411
4412         * rootcontext.cs (RootContext.LookupType): If we're a nested type,
4413         call DeclSpace.ResolveNestedType() on it.
4414
4415 2004-11-10  Martin Baulig  <martin@ximian.com>
4416
4417         * support.cs (ReflectionParameters.ParameterModifier): If `gpd' is
4418         non-null, call ParameterModifier() on it.
4419
4420 2004-11-10  Martin Baulig  <martin@ximian.com>
4421
4422         * iterators.cs
4423         (Iterators): Added `current_type' and `this_type' fields.
4424         (Iterators.DefineIterator): Create a new EmitContext and store it
4425         in `ec'; compute `this_type'.
4426
4427 2004-11-10  Martin Baulig  <martin@ximian.com>
4428
4429         * typemanager.cs
4430         (TypeManager.IsPrivateAccessible): New public method.
4431         (Closure.Filter): Use IsPrivateAccessible() instead of IsEqual().
4432
4433 2004-11-10  Martin Baulig  <martin@ximian.com>
4434
4435         * class.cs (TypeContainer.DefineType): Call
4436         TypeBuilder.DefineGenericParameters() before resolving the type
4437         parameters.
4438         (MethodData.parent_method): New protected field.
4439         (MethodData..ctor): Added `MethodInfo parent_method' argument.
4440         (MethodData.Define): Compute `parent_method'.
4441
4442         * decl.cs
4443         (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
4444         (MemberCore.GetClsCompliantAttributeValue): Likewise.
4445         (DeclSpace.ec): New protected field; store the EmitContext here.
4446         (DeclSpace.EmitContext): New public property.
4447         (DeclSpace.ResolveType): Un-comment from the [Obsolte] attribute.
4448         (DeclSpace.ResolveNestedType): New public method.
4449         (DeclSpace.ResolveTypeExpr): Just call ResolveAsTypeTerminal() here.
4450         (DeclSpace.NestedAccessible): Added `Type tb' argument.
4451         (DeclSpace.FamilyAccessible): Likewise.
4452         (DeclSpace.FindType): Call ResolveNestedType() for nested types.
4453         (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
4454         EmitContext.
4455
4456         * delegate.cs (Delegate.Define): Store the EmitContext in the `ec'
4457         field.
4458
4459         * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
4460         (Enum.Emit): Don't create a new EmitContext.
4461
4462 2004-10-18  Martin Baulig  <martin@ximian.com>
4463
4464         * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
4465         `Type' directly, but call ResolveType() on it.
4466         (Catch.Resolve): Likewise.
4467         (Foreach.Resolve): Likewise.
4468
4469 2004-10-18  Martin Baulig  <martin@ximian.com>
4470
4471         * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
4472         `Type' directly, but call ResolveType() on it.
4473         (Probe.DoResolve): Likewise.
4474         (ArrayCreation.LookupType): Likewise.
4475         (TypeOf.DoResolve): Likewise.
4476         (SizeOf.DoResolve): Likewise.
4477
4478 2004-10-18  Raja R Harinath  <rharinath@novell.com>
4479
4480         * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
4481         the ResolveType.
4482
4483 2004-10-17  John Luke  <john.luke@gmail.com>
4484
4485         * class.cs (Operator.GetSignatureForError): use CSharpName
4486
4487         * parameter.cs (Parameter.GetSignatureForError): Returns
4488         correct name even if was not defined.
4489
4490 2004-10-13  Raja R Harinath  <rharinath@novell.com>
4491
4492         Fix #65816.
4493         * class.cs (TypeContainer.EmitContext): New property.
4494         (DefineNestedTypes): Create an emitcontext for each part.
4495         (MethodCore.DoDefineParameters): Use container's emitcontext.
4496         Pass type array to InternalParameters.
4497         (MemberBase.DoDefine): Use container's emitcontext.
4498         (FieldMember.Define): Likewise.
4499         (Event.Define): Likewise.
4500         (SetMethod.GetParameterInfo): Change argument to EmitContext.
4501         Pass type array to InternalParameters.
4502         (SetIndexerMethod.GetParameterInfo): Likewise.
4503         (SetMethod.Define): Pass emitcontext to GetParameterInfo.
4504         * delegate.cs (Define): Pass emitcontext to
4505         ComputeAndDefineParameterTypes and GetParameterInfo.  Pass type
4506         array to InternalParameters.
4507         * expression.cs (ParameterReference.DoResolveBase): Pass
4508         emitcontext to GetParameterInfo.
4509         (ComposedCast.DoResolveAsTypeStep): Remove check on
4510         ec.ResolvingTypeTree.
4511         * parameter.cs (Parameter.Resolve): Change argument to
4512         EmitContext.  Use ResolveAsTypeTerminal.
4513         (Parameter.GetSignature): Change argument to EmitContext.
4514         (Parameters.ComputeSignature): Likewise.
4515         (Parameters.ComputeParameterTypes): Likewise.
4516         (Parameters.GetParameterInfo): Likewise.
4517         (Parameters.ComputeAndDefineParameterTypes): Likewise.
4518         Re-use ComputeParameterTypes.  Set ec.ResolvingTypeTree.
4519         * support.cs (InternalParameters..ctor): Remove variant that takes
4520         a DeclSpace.
4521         * typemanager.cs (system_intptr_expr): New.
4522         (InitExpressionTypes): Initialize it.
4523
4524 2004-10-12  Chris Toshok  <toshok@ximian.com>
4525
4526         * cs-parser.jay: fix location for try_statement and catch_clause.
4527
4528 2004-10-18  Martin Baulig  <martin@ximian.com>
4529
4530         * class.cs (FieldMember.Define): Don't access the TypeExpr's
4531         `Type' directly, but call ResolveType() on it.
4532         (MemberBase.DoDefine): Likewise.
4533
4534         * expression.cs (New.DoResolve): Don't access the TypeExpr's
4535         `Type' directly, but call ResolveType() on it.
4536         (ComposedCast.DoResolveAsTypeStep): Likewise.
4537
4538         * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
4539         `Type' directly, but call ResolveType() on it.
4540
4541 2004-10-17  John Luke  <john.luke@gmail.com>
4542
4543         * class.cs (Operator.GetSignatureForError): use CSharpName
4544
4545         * parameter.cs (Parameter.GetSignatureForError): Returns
4546         correct name even if was not defined.
4547
4548 2004-10-13  Raja R Harinath  <rharinath@novell.com>
4549
4550         Fix #65816.
4551         * class.cs (TypeContainer.EmitContext): New property.
4552         (DefineNestedTypes): Create an emitcontext for each part.
4553         (MethodCore.DoDefineParameters): Use container's emitcontext.
4554         Pass type array to InternalParameters.
4555         (MemberBase.DoDefine): Use container's emitcontext.
4556         (FieldMember.Define): Likewise.
4557         (Event.Define): Likewise.
4558         (SetMethod.GetParameterInfo): Change argument to EmitContext.
4559         Pass type array to InternalParameters.
4560         (SetIndexerMethod.GetParameterInfo): Likewise.
4561         (SetMethod.Define): Pass emitcontext to GetParameterInfo.
4562         * delegate.cs (Define): Pass emitcontext to
4563         ComputeAndDefineParameterTypes and GetParameterInfo.  Pass type
4564         array to InternalParameters.
4565         * expression.cs (ParameterReference.DoResolveBase): Pass
4566         emitcontext to GetParameterInfo.
4567         (ComposedCast.DoResolveAsTypeStep): Remove check on
4568         ec.ResolvingTypeTree.
4569         * parameter.cs (Parameter.Resolve): Change argument to
4570         EmitContext.  Use ResolveAsTypeTerminal.
4571         (Parameter.GetSignature): Change argument to EmitContext.
4572         (Parameters.ComputeSignature): Likewise.
4573         (Parameters.ComputeParameterTypes): Likewise.
4574         (Parameters.GetParameterInfo): Likewise.
4575         (Parameters.ComputeAndDefineParameterTypes): Likewise.
4576         Re-use ComputeParameterTypes.  Set ec.ResolvingTypeTree.
4577         * support.cs (InternalParameters..ctor): Remove variant that takes
4578         a DeclSpace.
4579         * typemanager.cs (system_intptr_expr): New.
4580         (InitExpressionTypes): Initialize it.
4581
4582 2004-10-12  Chris Toshok  <toshok@ximian.com>
4583
4584         * cs-parser.jay: fix location for try_statement and catch_clause.
4585
4586 2004-10-07  Raja R Harinath  <rharinath@novell.com>
4587
4588         More DeclSpace.ResolveType avoidance.
4589         * decl.cs (MemberCore.InUnsafe): New property.
4590         * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal 
4591         with newly created EmitContext.
4592         (FieldMember.Define): Likewise.
4593         * delegate.cs (Delegate.Define): Likewise.
4594         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
4595         only if normal name-lookup fails.
4596         (TypeExpr.DoResolve): Enable error-checking.
4597         * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
4598         (SizeOf.DoResolve): Likewise.
4599         (ComposedCast.DoResolveAsTypeStep): Likewise.
4600         (StackAlloc.DoResolve): Likewise.
4601         * statement.cs (Block.Flags): Add new flag 'Unsafe'.
4602         (Block.Unsafe): New property.
4603         (Block.EmitMeta): Set ec.InUnsafe as appropriate.
4604         (Unsafe): Set 'unsafe' flag of contained block.
4605         (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
4606         (Fixed.Resolve): Likewise.
4607         (Catch.Resolve): Likewise.
4608         (Using.ResolveLocalVariableDecls): Likewise.
4609         (Foreach.Resolve): Likewise.
4610
4611 2004-10-05  John Luke <john.luke@gmail.com>
4612
4613         * cs-parser.jay: add location to error CS0175
4614
4615 2004-10-04  Miguel de Icaza  <miguel@ximian.com>
4616
4617         * ecore.cs (Expression.Constantity): Add support for turning null
4618         into a constant.
4619
4620         * const.cs (Const.Define): Allow constants to be reference types
4621         as long as the value is Null.
4622
4623 2004-10-04  Juraj Skripsky  <js@hotfeet.ch>
4624
4625         * namespace.cs (NamespaceEntry.Using): No matter which warning
4626         level is set, check if this namespace name has already been added.
4627
4628 2004-10-03 Ben Maurer  <bmaurer@ximian.com>
4629
4630         * expression.cs: reftype [!=]= null should always use br[true,false].
4631         # 67410
4632
4633 2004-10-03  Marek Safar  <marek.safar@seznam.cz>
4634
4635         Fix #67108
4636         * attribute.cs: Enum conversion moved to 
4637         GetAttributeArgumentExpression to be applied to the all
4638         expressions.
4639
4640 2004-10-01  Raja R Harinath  <rharinath@novell.com>
4641
4642         Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
4643         * class.c (TypeContainer.DefineType): Flag error if
4644         base types aren't accessible due to access permissions.
4645         * decl.cs (DeclSpace.ResolveType): Move logic to
4646         Expression.ResolveAsTypeTerminal.
4647         (DeclSpace.ResolveTypeExpr): Thin layer over
4648         Expression.ResolveAsTypeTerminal.
4649         (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
4650         Refactor code into NestedAccess.  Use it.
4651         (DeclSpace.NestedAccess): New.
4652         * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
4653         argument to silence errors.  Check access permissions.
4654         (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
4655         * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
4656         (Cast.DoResolve): Likewise.
4657         (New.DoResolve): Likewise.
4658         (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
4659         (TypeOf.DoResolve): Likewise.
4660
4661         * expression.cs (Invocation.BetterConversion): Return the Type of
4662         the better conversion.  Implement section 14.4.2.3 more faithfully.
4663         (Invocation.BetterFunction): Make boolean.  Make correspondence to
4664         section 14.4.2.2 explicit.
4665         (Invocation.OverloadResolve): Update.
4666         (Invocation): Remove is_base field.
4667         (Invocation.DoResolve): Don't use is_base.  Use mg.IsBase.
4668         (Invocation.Emit): Likewise.
4669
4670 2004-09-24  Marek Safar  <marek.safar@seznam.cz>
4671
4672         * cs-parser.jay: Reverted 642 warning fix.
4673
4674 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
4675
4676         Fix bug #66615
4677         * decl.cs (FindMemberWithSameName): Indexer can have more than
4678         1 argument.
4679
4680 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
4681
4682         * expression.cs (LocalVariableReference.DoResolveLValue):
4683         Do not report warning 219 for out values.
4684         (EmptyExpression.Null): New member to avoid extra allocations.
4685
4686 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
4687
4688         * cs-parser.jay: Fix wrong warning 642 report.
4689
4690         * cs-tokenizer.cs (CheckNextToken): New helper;
4691         Inspect next character if is same as expected.
4692
4693 2004-09-23  Martin Baulig  <martin@ximian.com>
4694
4695         * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
4696         (Convert.ImplicitReferenceConversionExists): Likewise.
4697
4698 2004-11-09  Raja R Harinath  <rharinath@novell.com>
4699
4700         * Makefile (DISTFILES): Comment out a few missing files.
4701
4702 2004-10-29  Raja R Harinath  <rharinath@novell.com>
4703
4704         * Makefile (bootstrap_libs,bootstrap_libfiles): New.
4705         (bootstrap-libs): New target.  Invokes the net_2_0_bootstrap profile.
4706         (gmcs.exe): Invoke bootstrap-libs.
4707         (clean-local): Clean the net_2_0_bootstrap profile too.
4708         (PROGRAM_INSTALL_DIR): New.
4709         (install-local): Use it.
4710
4711 2004-10-13  Martin Baulig  <martin@ximian.com>
4712
4713         * generic.cs (TypeManager.InflatedConstraints): New nested class.
4714         (TypeParameter.DefineType): If we're a method type parameter and
4715         that method is overriding something, "inflate" its constraints.
4716
4717 2004-10-12  Martin Baulig  <martin@ximian.com>
4718
4719         * expression.cs (MemberAccess.DoResolve): If we're a SimpleName
4720         and have type arguments, create and resolve a ConstructedType.
4721
4722 2004-10-12  Martin Baulig  <martin@ximian.com>
4723
4724         * decl.cs (MemberCache.FindMemberToOverride): Use
4725         TypeManager.IsEqual() to compare the parameters and Type.Equals()
4726         to compare the invocationType.
4727
4728         * typemanager.cs (TypeManager.IsEqual): Added support for arrays.
4729         When comparing two type parameters, only do the signature-only
4730         comparision for method type parameters.
4731
4732 2004-10-11  Martin Baulig  <martin@ximian.com>
4733
4734         * report.cs: Don't make --fatal abort on warnings, we have
4735         -warnaserror for that.
4736
4737 2004-10-11  Martin Baulig  <martin@ximian.com>
4738
4739         * typemanager.cs
4740         (TypeManager.IsEqualGenericType): Removed, use IsEqual() instead.
4741         (TypeManager.IsEqual): Call ourself recursively instead of using
4742         Type.IsEqual(). 
4743
4744 2004-10-11  Martin Baulig  <martin@ximian.com>
4745
4746         * class.cs (TypeContainer.DefineType): Only call TypeParameter.Define()
4747         on our own type parameters, not on the ones we inherit from a containing
4748         class.
4749
4750         * expression.cs (Invocation.InferType): Use `==', not `Equals()' for
4751         the comparision.
4752
4753         * generic.cs (TypeParameter.Define): We may only be called once.
4754
4755         * pending.cs (Pending.InterfaceMethod): Call TypeManager.Real_IsEqual()
4756         instead of TypeManager.IsEqual().
4757
4758 2004-09-28  Martin Baulig  <martin@ximian.com>
4759
4760         * generic.cs
4761         (GenericConstraints.EffectiveBaseClass): New public property.
4762         (TypeParameter.GenericConstraints): New public property.
4763         (ConstructedType.CheckConstraints): Improved.
4764
4765         * convert.cs (Convert.TypeParam_EffectiveBaseType): New private method.
4766         (Convert.TypeParameterConversion): New private method; use this in
4767         ImplicitReferenceConversion() and ImplicitReferenceConversionExists()
4768         for all conversions related to type parameters.
4769
4770 2004-09-24  Martin Baulig  <martin@ximian.com>
4771
4772         * convert.cs (Convert.ImplicitReferenceConversion): Added implicit
4773         type parameter conversions for type parameters which are known to
4774         be reference types.
4775
4776 2004-09-24  Martin Baulig  <martin@ximian.com>
4777
4778         * generic.cs (GenericConstraints): Added `IsReferenceType' and
4779         `IsValueType' properties.
4780
4781         * support.cs (ReflectionConstraints): Use
4782         Type.GetGenericParameterConstraints() instead of the old hack.
4783
4784 2004-09-24  Martin Baulig  <martin@ximian.com>
4785
4786         * generic.cs (GenericConstraints): Moved here and made it an
4787         abstract class.
4788
4789         * support.cs (GenericConstraints): Moved to generic.cs.
4790
4791 2004-09-24  Martin Baulig  <martin@ximian.com>
4792
4793         * support.cs
4794         (ReflectionConstraints): Un-nested this class and made it public.
4795
4796         * typemanager.cs
4797         (TypeManager.GetTypeParameterConstraints): New public method.
4798         (TypeManager.HasConstructorConstraint): Use the attributes.
4799
4800 2004-09-24  Martin Baulig  <martin@ximian.com>
4801
4802         * support.cs (GenericConstraints): Replaced `HasConstructor',
4803         `IsReferenceType' and `IsValueType' with `Attributes'.
4804         (ReflectionParameters.ReflectionConstraints): Removed the Create()
4805         method and made the .ctor public.
4806
4807         * generic.cs (Constraints.Attributes): New public property.
4808         (Constraints): Renamed `HasConstructor' -> `HasConstructorConstraint',
4809         `IsReferenceType' -> `HasReferenceTypeConstraint' and
4810         `IsValueType' -> `HasValueTypeConstraint'.
4811
4812 2004-09-23  Martin Baulig  <martin@ximian.com>
4813
4814         * generic.cs (Constraints): Reflect latest runtime changes.
4815
4816 2004-09-23  Martin Baulig  <martin@ximian.com>
4817
4818         * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
4819         (Convert.ImplicitReferenceConversionExists): Likewise.
4820
4821 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
4822
4823         * class.cs (Operator.Define): Add error 448 and 559 report.
4824         
4825 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
4826
4827         * class.cs (MemberBase.IsTypePermitted): New protected
4828         method for checking error CS0610.
4829
4830 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
4831
4832         * class.cs (TypeContainer.HasExplicitLayout): New property
4833         Returns whether container has StructLayout attribute set Explicit.
4834         (FieldMember): New abstract class for consts and fields.
4835         (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
4836         (Field): Reuse FieldMember.
4837
4838         * const.cs (Const): Reuse FieldMember.
4839
4840         * rootcontext.cs: EmitConstants call moved to class.
4841
4842 2004-09-22  Martin Baulig  <martin@ximian.com>
4843
4844         Marek and me just fixed one of our oldest bugs: #28562 :-)
4845
4846         * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
4847
4848         * attribute.cs (Attribute.GetAttributeArgumentExpression): If
4849         we're an EnumConstant, just return that.
4850         (Attribute.Resolve): GetAttributeArgumentExpression() may give us
4851         an EnumConstant.  In this case, we need to use GetValueAsEnumType()
4852         to get the value which'll actually be written into the attribute.
4853         However, we have to use GetValue() to access the attribute's value
4854         in the compiler.        
4855
4856 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
4857
4858         * constant.cs (Constant.IsNegative): New abstract property
4859         IsNegative.
4860
4861         * expression.cs (ArrayAccess.DoResolve): Add warning 251.
4862         (StackAlloc.DoResolve): Reused IsNegative.
4863
4864 2004-09-22  Martin Baulig  <martin@ximian.com>
4865
4866         * typemanager.cs (TypeManager.LookupGenericTypeContainer): New
4867         public method; like LookupTypeContainer, but also works for
4868         generic instances.
4869
4870         * report.cs (Report.SymbolRelatedToPreviousError): Use
4871         TypeManager.LookupGenericTypeContainer().       
4872
4873 2004-09-22  Martin Baulig  <martin@ximian.com>
4874
4875         Thanks to Peter Sestoft for this bug report.
4876
4877         * expression.cs (Conditional): If both the `trueExpr' and the
4878         `falseExpr' is a NullLiteral, return a NullLiteral.
4879
4880 2004-09-22  Martin Baulig  <martin@ximian.com>
4881
4882         * statement.cs (Foreach.EmitCollectionForeach): If we're in an
4883         iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
4884         for the "get_Current" call.
4885
4886 2004-09-21  Martin Baulig  <martin@ximian.com>
4887
4888         * convert.cs (Convert.ImplicitReferenceConversion): When
4889         converting to an interface type, first check whether we're
4890         converting from a reference type.
4891
4892 2004-09-14  Martin Baulig  <martin@ximian.com>
4893
4894         * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
4895
4896 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
4897
4898         Fixed bug #61902
4899         * codegen.cs (TestObsoleteMethodUsage): Trace when method is
4900         called and is obsolete then this member suppress message
4901         when call is inside next [Obsolete] method or type.
4902
4903         * expression.cs: Use TestObsoleteMethodUsage member.
4904
4905 2004-09-14  Martin Baulig  <martin@ximian.com>
4906
4907         * genericparser.cs: Removed.
4908
4909 2004-09-13  Marek Safar  <marek.safar@seznam.cz>
4910
4911         * class.cs (MethodCore.CheckBase): Fix bug #65757.
4912
4913 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
4914
4915         * attribute.cs (Attribute.Resolve): Add error 653 report.
4916
4917         * class.cs (Class.ApplyAttributeBuilder): Add error 641
4918         report.
4919         (Method.ApplyAttributeBuilder): Add error 685 report.
4920         (Operator.Define): Add error 564 report.
4921
4922         * cs-tokenizer.cs (handle_hex): Add error 1013 report.
4923
4924         * expression.cs (Invocation.DoResolve): Add error
4925         245 and 250 report.
4926
4927         * parameter.cs (Parameter.ApplyAttributeBuilder): Add
4928         error 674 report.
4929
4930 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
4931
4932         * class.cs (ConstructorInitializer.Resolve):
4933         Wrong error number (515->516).
4934
4935 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
4936
4937         * class.cs (Indexer.Define): Add error 631 report.
4938
4939 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
4940
4941         * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
4942
4943 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
4944
4945         * expression.cs (Probe.DoResolve): Add error CS0241 report.
4946
4947 2004-09-10  Marek Safar  <marek.safar@seznam.cz>
4948
4949         * cs-parser.jay: Added error CS0241 report.
4950
4951 2004-09-10  Raja R Harinath  <rharinath@novell.com>
4952
4953         * cs-parser.jay (fixed_statement): Introduce a scope for the
4954         declaration in the 'fixed' statement.
4955
4956 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
4957
4958         * cs-parser.jay: Added CS0230 error report.
4959
4960 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
4961
4962         * cs-parser.jay: Added errors CS0231 and CS0257 report.
4963
4964 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
4965
4966         * expression.cs (Argument.Resolve): Added error CS0192 and
4967         CS0199 report.
4968
4969 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
4970
4971         C# 2.0 #pragma warning feature
4972
4973         * cs-tokenizer.cs (PreProcessPragma): New method; 
4974         Handles #pragma directive.
4975
4976         * report.cs (WarningRegions): New class; Support
4977         class for #pragma warning directive. It tests whether
4978         warning is enabled for a given line.
4979
4980 2004-09-08  Miguel de Icaza  <miguel@ximian.com>
4981
4982         * const.cs: Add more descriptive error report, tahnks to
4983         Sebastien. 
4984
4985 2004-09-08  Marek Safar  <marek.safar@seznam.cz>
4986
4987         * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
4988
4989 2004-09-07  Miguel de Icaza  <miguel@ximian.com>
4990
4991         * expression.cs: Apply patch from Ben: Remove dead code from
4992         ArrayCreation, and remove the TurnintoConstant call in const.cs,
4993         as that code just threw an exception anwyays.
4994
4995         * const.cs: Remove the call to the turnintoconstant, for details
4996         see bug: #63144
4997         
4998         * literal.cs: The type of the null-literal is the null type;  So
4999         we use a placeholder type (literal.cs:System.Null, defined here)
5000         for it.
5001
5002         * expression.cs (Conditional.DoResolve): Remove some old code that
5003         is no longer needed, conversions have been fixed.
5004
5005         (ArrayCreationExpression.DoResolve): Return false if we fail to
5006         resolve the inner expression.
5007
5008 2004-09-07  Raja R Harinath  <rharinath@novell.com>
5009
5010         Fix test-290.cs.
5011         * cs-parser.jay (delegate_declaration): Record a delegate
5012         declaration as a type declaration.
5013         Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
5014
5015 2004-09-06  Miguel de Icaza  <miguel@ximian.com>
5016
5017         * parameter.cs: Do not crash if the type can not be resolved. 
5018
5019         * expression.cs: Report errors with unsafe pointers, fixes #64896
5020
5021 2004-09-06 Ben Maurer  <bmaurer@users.sourceforge.net>
5022
5023         * expression.cs: Pointer arith always needs to do a conv.i
5024         if the operand is a long. fix 65320
5025
5026 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
5027
5028         Fixed cs0619-37.cs, cs0619-38.cs
5029
5030         * enum.cs (GetObsoleteAttribute): Removed.
5031
5032         * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
5033         on Enum member is double staged. The first is tested member
5034         and then enum.
5035
5036 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
5037
5038         Fixed #56986, #63631, #65231
5039
5040         * class.cs: (TypeContainer.AddToMemberContainer): New method,
5041         adds member to name container.
5042         (TypeContainer.AddToTypeContainer): New method, adds type to
5043         name container.
5044         (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
5045         AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
5046         AddOperator): Simplified by reusing AddToMemberContainer.
5047         (TypeContainer.UserDefinedStaticConstructor): Changed to property
5048         instead of field.
5049         (Method.CheckForDuplications): Fixed implementation to test all
5050         possibilities.
5051         (MemberBase): Detection whether member is explicit interface
5052         implementation is now in constructor.
5053         (MemberBase.UpdateMemberName): Handles IndexerName.
5054         (Accessor): Changed to keep also location information.
5055         (AbstractPropertyEventMethod): Is derived from MemberCore.
5056         (AbstractPropertyEventMethod.IsDummy): Says whether accessor
5057         will be emited or not.
5058         (PropertyBase.AreAccessorsDuplicateImplementation):
5059         Tests whether accessors are not in collision with some method.
5060         (Operator): Is derived from MethodCore to simplify common
5061         operations.
5062
5063         * decl.cs (Flags.TestMethodDuplication): Test for duplication
5064         must be performed.
5065         (DeclSpace.AddToContainer): Adds the member to defined_names
5066         table. It tests for duplications and enclosing name conflicts.
5067
5068         * enum.cs (EnumMember): Clean up to reuse the base structures
5069
5070 2004-09-03  Martin Baulig  <martin@ximian.com>
5071
5072         Merged latest changes into gmcs.  Please keep this comment in
5073         here, it makes it easier for me to see what changed in MCS since
5074         the last time I merged.
5075
5076 2004-09-03  Martin Baulig  <martin@ximian.com>
5077
5078         * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
5079         into TypeContainer, to make partial classes work again.
5080
5081 2004-09-03  Martin Baulig  <martin@ximian.com>
5082
5083         * rootcontext.cs (RootContext.V2): Removed.
5084
5085 2004-03-23  Martin Baulig  <martin@ximian.com>
5086
5087         * expression.cs (Invocation.OverloadResolve): Added `bool
5088         may_fail' argument and use it instead of the Location.IsNull() hack.
5089
5090 2004-09-09  Martin Baulig  <martin@ximian.com>
5091
5092         * cs-parser.jay (namespace_declaration): Fixed CS0134 reporting.
5093
5094 2004-09-09  Martin Baulig  <martin@ximian.com>
5095
5096         * generic.cs (TypeParameter.DefineType): Added support for
5097         explicit interface methods.
5098
5099 2004-09-09  Martin Baulig  <martin@ximian.com>
5100
5101         * README.Changes: New document.  Started to list important changes
5102         between MCS and GMCS here.
5103
5104 2004-09-08  Martin Baulig  <martin@ximian.com>
5105
5106         * class.cs
5107         (TypeContainer.CheckRecursiveDefinition): New protected method.
5108         (TypeContainer.DefineType): Move the CS0146 check into
5109         CheckRecursiveDefinition().     
5110
5111 2004-09-06  Martin Baulig  <martin@ximian.com>
5112
5113         * generic.cs (ConstructedType.CheckConstraints): Allow builtin
5114         types for the constructor constraint.
5115
5116 2004-09-03  Martin Baulig  <martin@ximian.com>
5117
5118         * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
5119         into TypeContainer, to make partial classes work again.
5120
5121 2004-09-03  Martin Baulig  <martin@ximian.com>
5122
5123         * rootcontext.cs (RootContext.V2): Removed.
5124
5125 2004-03-23  Martin Baulig  <martin@ximian.com>
5126
5127         * expression.cs (Invocation.OverloadResolve): Added `bool
5128         may_fail' argument and use it instead of the Location.IsNull() hack.
5129
5130 2004-09-03  Martin Baulig  <martin@ximian.com>
5131
5132         Merged latest changes into gmcs.  Please keep this comment in
5133         here, it makes it easier for me to see what changed in MCS since
5134         the last time I merged.
5135
5136 2004-09-03  Raja R Harinath  <rharinath@novell.com>
5137
5138         Fix #61128.
5139         * expression.cs (BetterConversion): Don't allow either conversion 
5140         to be null.  Remove redundant implicit conversion test when 'q ==
5141         null' -- when this function is invoked, we already know that the
5142         implicit conversion exists.
5143         (BetterFunction): Assume that 'best' is non-null.  Remove
5144         redundant reimplementation of IsApplicable when 'best' is null.
5145         (IsParamsMethodApplicable, IsApplicable): Add new parameter for
5146         number of arguments.
5147         (IsAncestralType): Extract from OverloadResolve.
5148         (OverloadResolve): Make robust to the MethodGroupExpr being
5149         unsorted.  Implement all the logic of Section 14.5.5.1, and
5150         support overloading of methods from multiple applicable types.
5151         Clean up logic somewhat.  Don't pass null methods to BetterFunction.
5152
5153         * report.cs (SymbolRelatedToPreviousError): Cleanup output.
5154         (RealError, Warning): Append type of report to related symbol.
5155
5156 2004-09-03  Marek Safar  <marek.safar@seznam.cz>
5157
5158         * enum.cs: Fixed CLS-Compliance checks for enum members.
5159         Error tests cs3008-8.cs, cs3014-8.cs
5160
5161 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
5162
5163         Fixed bug #62342, #63102
5164         * class.cs: ImplementIndexer uses member.IsExplicitImpl
5165         like ImplementMethod.
5166
5167 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
5168
5169         * attribute.cs (Attribute.GetAttributeArgumentExpression):
5170         Fixed bug #65170.
5171
5172 2004-09-02  Martin Baulig  <martin@ximian.com>
5173
5174         * statement.cs (Using.EmitLocalVariableDeclFinally): Use
5175         TypeManager.GetArgumentTypes() rather than calling GetParameters()
5176         on the MethodBase.
5177
5178 2004-09-01  Marek Safar  <marek.safar@seznam.cz>
5179
5180         C# 2.0 Static classes implemented
5181
5182         * class.cs (TypeContainer): instance_constructors,
5183         initialized_fields, initialized_static_fields,
5184         default_constructor, base_inteface_types are protected to be
5185         accessible from StaticClass.
5186         (TypeContainer.DefineDefaultConstructor): New virtual method
5187         for custom default constructor generating
5188         (StaticClass): New class to handle "Static classes" feature.
5189
5190         * cs-parser.jay: Handle static keyword on class like instance
5191         of StaticClass.
5192
5193         * driver.cs: Added "/langversion" command line switch with two
5194         options (iso-1, default).
5195
5196 2004-08-31  Marek Safar  <marek.safar@seznam.cz>
5197
5198         * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
5199
5200 2004-08-31  Miguel de Icaza  <miguel@ximian.com>
5201
5202         * delegate.cs: Style.
5203
5204 2004-08-31 Ben Maurer  <bmaurer@users.sourceforge.net>
5205
5206         * delegate.cs: Add seperate instance expr field for miguel.
5207
5208 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
5209
5210         * PointerArithmetic (Resolve): make sure we are not doing
5211         pointer arith on void*. Also, make sure we are resolved
5212         by not setting eclass until resolve.
5213
5214         All callers: Make sure that PointerArithmetic gets resolved.
5215
5216 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
5217
5218         * ArrayCreation (LookupType): If the type does not resolve 
5219         to an array, give an error.
5220
5221 2004-08-27  Marek Safar  <marek.safar@seznam.cz>
5222
5223         * statement.cs (Try.Resolve): Fixed bug #64222
5224
5225 2004-08-27  Martin Baulig  <martin@ximian.com>
5226
5227         * class.cs
5228         (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
5229         crash here.     
5230
5231 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
5232
5233         * ecore.cs (Constantify): Get underlying type via
5234         System.Enum.GetUnderlyingType to avoid StackOverflow on the
5235         Windows in special cases.
5236
5237 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
5238
5239         * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
5240         for obtaining also private methods.
5241         (GetRemoveMethod): Used GetRemoveMethod (true)
5242         for obtaining also private methods.
5243
5244 2004-09-02  Martin Baulig  <martin@ximian.com>
5245
5246         * statement.cs (Using.EmitLocalVariableDeclFinally): Use
5247         TypeManager.GetArgumentTypes() rather than calling GetParameters()
5248         on the MethodBase.
5249
5250 2004-08-27  Martin Baulig  <martin@ximian.com>
5251
5252         * class.cs
5253         (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
5254         crash here.     
5255
5256 2004-08-25  Martin Baulig  <martin@ximian.com>
5257
5258         * support.cs (ReflectionParameters..ctor): If this is a generic
5259         method, retrieve and store its type parameters.
5260         (InternalParameters..ctor): Added `TypeParameter[]' argument.
5261         (ReflectionParameters.GenericConstraints): The argument specifies
5262         the type parameter, not the method parameter.
5263         (InternalParameters.GenericConstraints): Likewise.
5264
5265         * generic.cs (TypeParameter.DefineType): Correctly handle
5266         constraints wrt. generic methods in interfaces and their
5267         implementations.        
5268
5269 2004-08-24  Martin Baulig  <martin@ximian.com>
5270
5271         * generic.cs (TypeParameter.IsSubclassOf): New public method.
5272         (Constraints.IsSubclassOf): New internal method.
5273
5274         * typemanager.cs (TypeManager.FindMembers): Added special support
5275         for GenericTypeParameterBuilder's.      
5276         (TypeManager.IsSubclassOf, IsFamilyAccessible): Added support for
5277         type parameters.
5278
5279 2004-08-24  Martin Baulig  <martin@ximian.com>
5280
5281         * typemanager.cs
5282         (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
5283         this for accessibility checks.
5284         (TypeManager.IsSubclassOrNestedChildOf): Renamed to
5285         IsNestedFamilyAccessible.
5286         (TypeManager.IsSubclassOf): New method, do what the name actually
5287         says.   
5288
5289 2004-08-24  Martin Baulig  <martin@ximian.com>
5290
5291         * expression.cs (MemberAccess.DoResolve): When resolving ourselves
5292         as a SimpleName, include the generic arity.
5293
5294 2004-08-24  Martin Baulig  <martin@ximian.com>
5295
5296         * class.cs (Method.Define): Set MethodAttributes.SpecialName and
5297         MethodAttributes.HideBySig for operators.
5298
5299 2004-08-23  Martin Baulig  <martin@ximian.com>
5300
5301         Back to the old error reporting system :-)
5302
5303         * report.cs (Message): Removed.
5304         (Report.MessageData, ErrorData, WarningData): Removed.
5305         (Report.Error, Warning): Back to the old system.
5306
5307 2004-08-23  Martin Baulig  <martin@ximian.com>
5308
5309         * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
5310
5311         * class.cs (TypeContainer.ParentContainer): New public virtual
5312         method; replaces the explicit interface implementation.
5313         (ClassPart.ParentContainer): Override.
5314
5315 2004-08-23  Martin Baulig  <martin@ximian.com>
5316
5317         * statement.cs (Switch): Added support for constant switches; see
5318         #59428 or test-285.cs.
5319
5320 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
5321
5322         Fixed bug #62740.
5323         * statement.cs (GetEnumeratorFilter): Removed useless
5324         logic because C# specs is strict. GetEnumerator must be
5325         public.
5326
5327 2004-08-22  Martin Baulig  <martin@ximian.com>
5328
5329         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
5330         a switch and may break, reset the barrier.  Fixes #59867.
5331
5332 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
5333
5334         CLS-Compliance speed up (~5% for corlib)
5335
5336         * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
5337         New method. Tests container for CLS-Compliant names
5338
5339         * class.cs (TypeContainer.VerifyClsName): New method.
5340         Checks whether container name is CLS Compliant.
5341         (Constructor): Implements IMethodData.
5342
5343         * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
5344         low-case table for CLS Compliance test.
5345         (MemberCache.VerifyClsParameterConflict): New method.
5346         Checks method parameters for CS3006 error.
5347
5348         * enum.cs (EnumMember): Is derived from MemberCore.
5349         (Enum.VerifyClsName): Optimized for better performance.
5350
5351 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
5352
5353         * report.cs: Renamed Error_T to Error and changed all
5354         references.
5355
5356 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
5357
5358         * class.cs (TypeContainer.IndexerArrayList): New inner class
5359         container for indexers.
5360         (TypeContainer.DefaultIndexerName): New constant for default
5361         indexer name. Replaced all "Item" with this constant.
5362         (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
5363
5364         * typemanager.cs (TypeManager.default_member_ctor): Cache here
5365         DefaultMemberAttribute constructor.
5366
5367 2004-08-05  Martin Baulig  <martin@ximian.com>
5368
5369         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
5370         Fix bug #59429.
5371
5372 2004-08-05  Marek Safar  <marek.safar@seznam.cz>
5373
5374         * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
5375         multi platforms problem.
5376
5377         * compiler.csproj: Included shared files.
5378
5379 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
5380
5381         Fix bug 60333, 55971 in the more general way
5382         * attribute.cs (Attribute.GetAttributeArgumentExpression):
5383         Added arg_type argument for constant conversion.
5384         (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
5385
5386 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
5387
5388         Fix bug #59760
5389         * class.cs (TypeContainer ): New inner classes MethodArrayList, 
5390         OperatorArrayList, MethodCoreArrayList for typecontainer
5391         containers. Changed class member types to these new types.
5392         (MethodArrayList.DefineMembers): Added test for CS0659.
5393
5394 2004-08-04  Miguel de Icaza  <miguel@ximian.com>
5395
5396         * cfold.cs: Synchronize the folding with the code in expression.cs
5397         Binary.DoNumericPromotions for uint operands.
5398
5399         * attribute.cs: Revert patch from Raja, it introduced a regression
5400         while building Blam-1.2.1 (hard to isolate a test case).
5401
5402 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
5403
5404         Fix for #55382
5405         * class.cs:
5406         (TypeContainer.Define): Renamed to DefineContainerMembers because of
5407         name collision.
5408         (MethodCore.parent_method): New member. The method we're overriding
5409         if this is an override method.
5410         (MethodCore.CheckBase): Moved from Method class and made common.
5411         (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
5412         private.
5413         (MethodCore.CheckForDuplications): New abstract method. For custom
5414         member duplication search in a container
5415         (MethodCore.FindOutParentMethod): New abstract method. Gets parent
5416         method and its return type.
5417         (Event.conflict_symbol): New member. Symbol with same name in the
5418         parent class.
5419
5420         * decl.cs:
5421         (MemberCache.FindMemberWithSameName): New method. The method
5422         is looking for conflict with inherited symbols.
5423
5424 2004-08-04  Martin Baulig  <martin@ximian.com>
5425
5426         * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
5427
5428         * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
5429
5430 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
5431
5432         * report.cs (Message): New enum for better error, warning reference in
5433         the code.
5434         (MessageData): New inner abstract class. It generally handles printing of
5435         error and warning messages.
5436         Removed unused Error, Warning, Message methods.
5437
5438 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
5439
5440         Fix for cs0592-8.cs test
5441         * attribute.cs
5442         (Attributable.ValidAttributeTargets): Made public.
5443         (Attribute.ExplicitTarget): New member for explicit target value.
5444         (Attribute.CheckTargets): Now we translate explicit attribute
5445         target to Target here.
5446
5447 2004-08-03  Ben Maurer  <bmaurer@ximian.com>
5448
5449         * ecore.cs (MethodGroupExpr): new IsBase property.
5450
5451         * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
5452
5453         * delegate.cs (DelegateCreation): store a MethodGroupExpr
5454         rather than an instance expr.
5455
5456         (DelegateCreation.Emit): Use the method group rather than
5457         the instance expression. Also, if you have base.Foo as the
5458         method for a delegate, make sure to emit ldftn, not ldftnvirt.
5459
5460         (ResolveMethodGroupExpr): Use the MethodGroupExpr. 
5461
5462         (NewDelegate.DoResolve): Only check for the existance of Invoke
5463         if the method is going to be needed. Use MethodGroupExpr.
5464
5465         (NewDelegate.Emit): Remove, DelegateCreation implements this.   
5466
5467         * expression.cs: For pointer arith., make sure to use
5468         the size of the type, not the size of the pointer to
5469         the type.
5470
5471 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
5472
5473         Fix for #60722
5474         * class.cs (Class): Added error CS0502 test.
5475
5476 2004-08-03  John Luke  <jluke@cfl.rr.com>
5477             Raja R Harinath  <rharinath@novell.com>
5478
5479         Fix for #60997.
5480         * attribute.cs (Attribute.complained_before): New flag.
5481         (Attribute.ResolveType, Attribute.Resolve),
5482         (Attribute.DefinePInvokeMethod): Set it.
5483         (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
5484         
5485 2004-08-03  Martin Baulig  <martin@ximian.com>
5486
5487         * expression.cs (Binary.ResolveOperator): Don't abort if we can't
5488         use a user-defined operator; we still need to do numeric
5489         promotions in case one argument is a builtin type and the other
5490         one has an implicit conversion to that type.  Fixes #62322.
5491
5492 2004-08-18  Martin Baulig  <martin@ximian.com>
5493
5494         * class.cs (Method.Define): Use the correct method name when
5495         creating the MethodBuilder for a generic method.
5496
5497 2004-08-17  Martin Baulig  <martin@ximian.com>
5498
5499         * generic.cs (Constraints): Support type parameter constraints.
5500
5501 2004-08-16  Martin Baulig  <martin@ximian.com>
5502
5503         * cs-tokenizer.cs (Tokenizer.TypeOfParsing): New public property.
5504         (Token.GENERIC_DIMENSION): New token; this is returned if we
5505         encounter an unbound generic type in a typeof() expression.
5506
5507         * cs-parser.jay (opt_type_argument_list): Added GENERIC_DIMENSION;
5508         this token is only generated while parsing a typeof() expression.
5509         (typeof_expression): Removed the old unbound_type hack.
5510
5511         * generic.cs (TypeArguments.IsUnbound): New public property.
5512
5513         * decl.cs (MemberName): Added support for unbound types.
5514
5515 2004-08-14  Martin Baulig  <martin@ximian.com>
5516
5517         * typemanager.cs
5518         (TypeManager.IsEqualGenericInstance): New static method.
5519         (TypeManager.IsSubclassOrNestedChildOf, IsSubclassOf): This is
5520         just used to check accessibility, so follow the rules of 26.1.6.        
5521
5522         * expression.cs (MemberAccess.ResolveAsTypeStep): Return a
5523         ConstructedType instead of a TypeExpression if we have type arguments.
5524
5525         * cs-parser.jay (typeof_expression): Support unbound generic types.
5526
5527         * ecore.cs (UnboundTypeExpression): New public class.
5528
5529 2004-08-12  Martin Baulig  <martin@ximian.com>
5530
5531         * typemanager.cs (TypeManager.IsNestedChildOf): Use
5532         TypeManager.IsEqual() rather than `=='.
5533
5534         * decl.cs (DeclSpace.CheckAccessLevel): Use `tb.FullName' for
5535         generic instances as well.
5536
5537 2004-08-12  Martin Baulig  <martin@ximian.com>
5538
5539         * expression.cs (Invocation.InferType): We can only infer method
5540         type parameters.  Fixes #62647.
5541
5542 2004-08-11  Martin Baulig  <martin@ximian.com>
5543
5544         * class.cs (TypeContainer.DefineType): Create the TypeBuilder
5545         before resolving the base classes.
5546
5547 2004-08-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
5548
5549         * Makefile: install .mdb file too.
5550
5551 2004-08-05  Martin Baulig  <martin@ximian.com>
5552
5553         * ecore.cs (FieldExpr.DoResolveLValue): If we're resolving a field
5554         initializer, the current type is just the TypeBuilder, not the
5555         instantiated generic type.
5556         (FieldExpr.IsFieldInitializer): New public property.
5557
5558 2004-08-04  Martin Baulig  <martin@ximian.com>
5559
5560         * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
5561
5562         * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
5563
5564 2004-08-03  Martin Baulig  <martin@ximian.com>
5565
5566         * class.cs (MethodData.Define): If we're an explicit
5567         implementation, remove the generic arity from the type name.
5568
5569 2004-08-03  Martin Baulig  <martin@ximian.com>
5570
5571         * expression.cs (Binary.ResolveOperator): Don't abort if we can't
5572         use a user-defined operator; we still need to do numeric
5573         promotions in case one argument is a builtin type and the other
5574         one has an implicit conversion to that type.  Fixes #62322.
5575
5576 2004-08-02  Martin Baulig  <martin@ximian.com>
5577
5578         * class.cs (TypeContainer.ifaces): Make this a `Type[]', not a
5579         `TypeExpr[]' array.
5580         (TypeContainer.GetClassBases): Return the unexpanded list of
5581         interfaces; we expand them later.
5582         (TypeContainer.DefineType): After creating the TypeBuilder, call
5583         TypeManager.ExpandInterfaces() to get an expanded and resolved
5584         list of interfaces.
5585
5586         * ecore.cs (TypeExpr.GetInterfaces): Removed
5587
5588         * generics.cs (Constraints.InterfaceConstraints): Remove.
5589         (TypeParameter.DefineType): Call TypeManager.RegisterBuilder() to
5590         register the interface constraints.
5591
5592         * typemanager.cs
5593         (TypeManager.AddUserType): Removed the `ifaces' argument.
5594         (TypeManager.AddTypeParameter): Likewise.
5595         (TypeManager.AddUserInterface): Removed, was unused.
5596         (TypeManager.RegisterBuilder): Take a `Type[]' instead of a
5597         `TypeExpr[]' array for the interfaces.
5598         (TypeManager.ExpandInterfaces): Call this after the TypeBuilder
5599         has been defined, returns a list of the resolved interfaces types.
5600         (TypeManager.GetInterfaces): Return a `Type[]', not a `TypeExpr[]'.
5601         (TypeManager.GetExplicitInterfaces): Likewise.  
5602
5603 2004-08-02  Martin Baulig  <martin@ximian.com>
5604
5605         * expression.cs (Invocation.EmitCall): If we're invoking a method
5606         on a type parameter, use the new `Constrained' prefix opcode.
5607
5608 2004-08-02  Martin Baulig  <martin@ximian.com>
5609
5610         * statement.cs (LocalInfo.Flags): Added `IsThis'.
5611         (LocalInfo.IsThis): New public property.
5612         (Block.EmitMeta): Don't create a LocalBuilder for `this'.
5613
5614 2004-08-01  Martin Baulig  <martin@ximian.com>
5615
5616         * class.cs (TypeContainer.GetClassBases): Don't set the default
5617         here since we may get called from GetPartialBases().
5618         (TypeContainer.DefineType): If GetClassBases() didn't return a
5619         parent, use the default one.
5620
5621 2004-07-30  Martin Baulig  <martin@ximian.com>
5622
5623         * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
5624
5625         * class.cs (SourceMethod): New public class, derive from the
5626         symbol writer's ISourceMethod.
5627         (Method): Use the new symbol writer API.
5628
5629         * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
5630         as argument and use the new symbol writer.
5631
5632         * location.cs
5633         (SourceFile): Implement the symbol writer's ISourceFile.
5634         (Location.SymbolDocument): Removed.
5635         (Location.SourceFile): New public property.
5636
5637         * symbolwriter.cs: Use the new symbol writer API.
5638
5639 2004-07-30  Raja R Harinath  <rharinath@novell.com>
5640
5641         * Makefile (install-local): Remove.  Functionality moved to
5642         executable.make.
5643
5644 2004-07-28  Lluis Sanchez Gual  <lluis@novell.com>
5645
5646         * Makefile: Install mcs.exe.config file together with mcs.exe.
5647         * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
5648         correct runtime version.
5649         
5650 2004-07-25  Martin Baulig  <martin@ximian.com>
5651
5652         * class.cs
5653         (TypeContainer.RegisterOrder): Removed, this was unused.
5654         (TypeContainer, interface_order): Removed.
5655         (TypeContainer.AddClass, AddStruct, AddInterface): Take a
5656         TypeContainer as argument since we can also be called with a
5657         `PartialContainer' for a partial class/struct/interface.
5658         (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
5659         of checking whether we're an `Interface' - we could be a
5660         `PartialContainer'.
5661         (PartialContainer.Register): Override; call
5662         AddClass()/AddStruct()/AddInterface() on our parent.
5663
5664         * cs-parser.jay (interface_member_declaration): Add things to the
5665         `current_container', not the `current_class'.
5666
5667         * rootcontext.cs (RegisterOrder): The overloaded version which
5668         takes an `Interface' was unused, removed.
5669
5670         * typemanager.cs (TypeManager.LookupInterface): Return a
5671         `TypeContainer', not an `Interface'.
5672         (TypeManager.IsInterfaceType): The `builder_to_declspace' may
5673         contain a `PartialContainer' for an interface, so check it's
5674         `Kind' to figure out what it is.
5675
5676 2004-07-25  Martin Baulig  <martin@ximian.com>
5677
5678         * class.cs (Class.DefaultTypeAttributes): New public constant.
5679         (Struct.DefaultTypeAttributes): Likewise.
5680         (Interface.DefaultTypeAttributes): Likewise.
5681         (PartialContainer.TypeAttr): Override this and add the
5682         DefaultTypeAttributes.
5683
5684 2004-07-25  Martin Baulig  <martin@ximian.com>
5685
5686         * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
5687         we can just use the `Parent' field instead.
5688
5689 2004-07-25  Martin Baulig  <martin@ximian.com>
5690
5691         * class.cs (TypeContainer.Emit): Renamed to EmitType().
5692
5693 2004-07-25  Martin Baulig  <martin@ximian.com>
5694
5695         * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
5696         our parts before defining any methods.
5697         (TypeContainer.VerifyImplements): Make this virtual.
5698         (ClassPart.VerifyImplements): Override and call VerifyImplements()
5699         on our PartialContainer.
5700
5701 2004-07-25  Martin Baulig  <martin@ximian.com>
5702
5703         * iterators.cs (Iterator.Define): Renamed to DefineIterator().
5704
5705         * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
5706         argument, we can just use the `Parent' field instead.
5707
5708         * class.cs
5709         (MemberBase.CheckBase): Removed the `TypeContainer' argument.   
5710         (MemberBase.DoDefine): Likewise.
5711
5712 2004-07-24  Martin Baulig  <martin@ximian.com>
5713
5714         * decl.cs (MemberCore.Parent): New public field.
5715         (DeclSpace.Parent): Moved to MemberCore.
5716
5717         * class.cs (MethodCore.ds): Removed; use `Parent' instead.
5718         (MemberBase.ctor): Added TypeContainer argument, pass it to our
5719         parent's .ctor.
5720         (FieldBase, Field, Operator): Likewise.
5721         (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
5722         (EventField, Event): Likewise.
5723
5724 2004-07-23  Martin Baulig  <martin@ximian.com>
5725
5726         * class.cs (PartialContainer): New public class.
5727         (ClassPart): New public class.
5728         (TypeContainer): Added support for partial classes.
5729         (TypeContainer.GetClassBases): Splitted some of the functionality
5730         out into GetNormalBases() and GetPartialBases().
5731
5732         * cs-tokenizer.cs (Token.PARTIAL): New token.
5733         (Tokenizer.consume_identifier): Added some hacks to recognize
5734         `partial', but only if it's immediately followed by `class',
5735         `struct' or `interface'.
5736
5737         * cs-parser.jay: Added support for partial clases.
5738
5739 2004-07-23  Martin Baulig  <martin@ximian.com>
5740
5741         * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
5742         a `DeclSpace' and also made it readonly.
5743         (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
5744         (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
5745         (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
5746
5747         * cs-parser.jay: Pass the `current_class', not the
5748         `current_container' (at the moment, this is still the same thing)
5749         to a new Method, Property, Event, Indexer or Constructor.
5750
5751 2004-07-23  Martin Baulig  <martin@ximian.com>
5752
5753         * cs-parser.jay (CSharpParser): Added a new `current_class' field
5754         and removed the `current_interface' one.
5755         (struct_declaration, class_declaration, interface_declaration):
5756         Set `current_class' to the newly created class/struct/interface;
5757         set their `Bases' and call Register() before parsing their body.
5758
5759 2004-07-23  Martin Baulig  <martin@ximian.com>
5760
5761         * class.cs (Kind): New public enum.
5762         (TypeContainer): Made this class abstract.
5763         (TypeContainer.Kind): New public readonly field.
5764         (TypeContainer.CheckDef): New public method; moved here from
5765         cs-parser.jay.
5766         (TypeContainer.Register): New public abstract method.
5767         (TypeContainer.GetPendingImplementations): New public abstract
5768         method.
5769         (TypeContainer.GetClassBases): Removed the `is_class' and
5770         `is_iface' parameters.
5771         (TypeContainer.DefineNestedTypes): Formerly known as
5772         DoDefineType().
5773         (ClassOrStruct): Made this class abstract.
5774
5775         * tree.cs (RootTypes): New public type. 
5776
5777 2004-07-20  Martin Baulig  <martin@ximian.com>
5778
5779         * tree.cs (Tree.RecordNamespace): Removed.
5780         (Tree.Namespaces): Removed.
5781
5782         * rootcontext.cs (RootContext.IsNamespace): Removed.
5783
5784         * cs-parser.jay (namespace_declaration): Just create a new
5785         NamespaceEntry here.
5786
5787 2004-07-21  Lluis Sanchez Gual  <lluis@novell.com>
5788
5789         * Makefile: Install gmcs.exe.config file together with gmcs.exe.
5790         * gmcs.exe.config: Renamed from mcs.exe.config. Added supportedRuntime
5791         entry to make sure it runs in the correct runtime version.
5792         
5793 2004-07-18  Martin Baulig  <martin@ximian.com>
5794
5795         * generic.cs (ConstructedType.CheckConstraints): Improved
5796         constraints checking.
5797
5798 2004-07-18  Martin Baulig  <martin@ximian.com>
5799
5800         * expression.cs (Invocation.BetterMethod): Call
5801         TypeManager.TypeToCoreType() on all types and removed my previous
5802         hack; we're already doig the right thing here.
5803
5804 2004-07-17  Martin Baulig  <martin@ximian.com>
5805
5806         * decl.cs (MemberName.MakeName): Create the "class`1" names here.
5807
5808 2004-07-16  Martin Baulig  <martin@ximian.com>
5809
5810         * iterators.cs: Added generics support.
5811
5812 2004-07-16  Martin Baulig  <martin@ximian.com>
5813
5814         * iterators.cs: Rewrote this.  We're now using one single Proxy
5815         class for both the IEnumerable and the IEnumerator interface and
5816         `Iterator' derives from Class so we can use the high-level API.
5817
5818         * class.cs (TypeContainer.AddIterator): New method.
5819         (TypeContainer.DoDefineType): New protected virtual method, which
5820         is called from DefineType().
5821         (TypeContainer.DoDefineMembers): Call DefineType() and
5822         DefineMembers() on all our iterators.
5823         (TypeContainer.Emit): Call Emit() on all our iterators.
5824         (TypeContainer.CloseType): Call CloseType() on all our iterators.
5825
5826         * codegen.cs (EmitContext.CurrentIterator): New public field.
5827
5828 2004-07-15  Martin Baulig  <martin@ximian.com>
5829
5830         * typemanager.cs
5831         (TypeManager.not_supported_exception_type): New type.   
5832
5833 2004-07-14  Martin Baulig  <martin@ximian.com>
5834
5835         * typemanager.cs
5836         (TypeManager.generic_ienumerable_type): New type.
5837         (TypeManager.generic_ienumerator_type): New type.
5838
5839         * rootcontext.cs
5840         (RootContext.interfaces_first_stage): Added
5841         "System.Collections.Generic.IEnumerator`1" and
5842         "System.Collections.Generic.IEnumerable`1".     
5843
5844 2004-07-14  Martin Baulig  <martin@ximian.com>
5845
5846         * iterators.cs: Use real error numbers.
5847
5848 2004-07-14  Martin Baulig  <martin@ximian.com>
5849
5850         * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
5851         requires this to be a System.Collection.IEnumerable and not a
5852         class implementing that interface.
5853         (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.      
5854
5855 2004-07-13  Marek Safar  <marek.safar@seznam.cz>
5856
5857         * class.cs: Fixed previous fix, it broke some error tests.
5858
5859 2004-07-12  Martin Baulig  <martin@ximian.com>
5860
5861         * enum.cs (Enum.Define): Call Emit() to emit the attributes.
5862         Fixes #61293.
5863
5864 2004-07-14  Martin Baulig  <martin@ximian.com>
5865
5866         * decl.cs, expression.cs, generic.cs: Use a backqoute (`) and not
5867         an exclamation mark (!) for the generic arity to reflect the
5868         latest spec changes; ie. use "System.Collections.Generic.IList`1".
5869
5870 2004-07-13  Martin Baulig  <martin@ximian.com>
5871
5872         * cs-tokenizer.cs (Tokenizer.parse_less_than): Allow array rank
5873         specifiers being part of a type argument.
5874
5875 2004-07-13  Martin Baulig  <martin@ximian.com>
5876
5877         * expression.cs (MemberAccess.ResolveAsTypeStep): Use the full `!'
5878         name for generic types.
5879
5880 2004-07-13  Martin Baulig  <martin@ximian.com>
5881
5882         * assign.cs (Assign.DoResolve): Moved the CS0131 check up a little
5883         bit to fix #60119.
5884
5885 2004-07-09  Miguel de Icaza  <miguel@ximian.com>
5886
5887         * assign.cs (LocalTemporary): Add new argument: is_address,If
5888         `is_address' is true, then the value that we store is the address
5889         to the real value, and not the value itself.
5890         
5891         * ecore.cs (PropertyExpr): use the new local temporary
5892         stuff to allow us to handle X.Y += z (where X is a struct)
5893
5894 2004-07-08  Martin Baulig  <martin@ximian.com>
5895
5896         * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
5897         not always return, just like we're doing in Using.Resolve().
5898
5899 2004-07-07  Miguel de Icaza  <miguel@ximian.com>
5900
5901         * cs-parser.jay (fixed_statement): flag this as Pinned.
5902
5903 2004-07-06  Miguel de Icaza  <miguel@ximian.com>
5904
5905         * typemanager.cs (TypeManager): Removed MakePinned method, this
5906         mechanism is replaced with the .NET 2.x compatible mechanism of
5907         calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
5908
5909         * statement.cs (LocalInfo): Remove MakePinned, add Pinned property 
5910         Rename `Fixed' to `Pinned' as a flag, to distinguish from the
5911         `IsFixed' property which has a different meaning.
5912
5913 2004-07-02  Raja R Harinath  <rharinath@novell.com>
5914
5915         * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
5916         visible from inside a nested class, not just the names of the
5917         immediately enclosing class.
5918         Fix for bug #60730.
5919
5920 2004-06-24  Raja R Harinath  <rharinath@novell.com>
5921
5922         * expression.cs (BetterConversion): Remove buggy special-case
5923         handling of "implicit constant expression conversions".  At this
5924         point, we already know that the conversion is possible -- we're
5925         only checking to see which is better.
5926
5927 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
5928
5929         * cs-parser.jay: Added error CS0210 test.
5930
5931 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
5932
5933         * cs-parser.jay: Added error CS0134 test.
5934
5935 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
5936
5937         Fix bug #52507
5938         * cs-parser.jay: Added error CS0145 test.
5939
5940 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
5941
5942         * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
5943
5944 2004-06-23  Ben Maurer  <bmaurer@ximian.com>
5945         
5946         * expression.cs (StackAlloc.Resolve): The argument may not
5947         be a constant; deal with this case.
5948         
5949 2004-06-23  Marek Safar  <marek.safar@seznam.cz>
5950
5951         * attribute.cs (IndexerName_GetIndexerName): Renamed to
5952         GetIndexerAttributeValue.
5953         (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
5954
5955         * class.cs (Indexer.Define): Added error tests for CS0415,
5956         CS0609.
5957
5958 2004-06-23  Miguel de Icaza  <miguel@ximian.com>
5959
5960         * attribute.cs (Attribute.Resolve): Keep field code in sync with
5961         property code.
5962
5963 2004-06-23  Martin Baulig  <martin@ximian.com>
5964
5965         * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
5966         neither return nor throw, reset the barrier as well.  Fixes #60457.
5967
5968 2004-06-22  Atsushi Enomoto  <atsushi@ximian.com>
5969
5970         * class.cs : EventAttributes is now set to None by default.
5971           This fixes bug #60459.
5972
5973 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
5974
5975         Fix bug #60219
5976         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
5977         Don't throw exception but return null (it's sufficient now).
5978
5979 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
5980
5981         * typemanager.cs (GetArgumentTypes): Faster implementation.
5982
5983 2004-06-18  Martin Baulig  <martin@ximian.com>
5984
5985         * attribute.cs (Attribute.Resolve): Check whether we're an
5986         EmptyCast which a Constant child.  Fixes #60333.
5987
5988 2004-06-17  Ben Maurer  <bmaurer@ximian.com>
5989
5990         * statement.cs (EmitCollectionForeach): Account for the fact that
5991         not all valuetypes are in areas which we can take the address of.
5992         For these variables, we store to a temporary variable. Also, make
5993         sure that we dont emit a `callvirt' on a valuetype method.
5994
5995 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
5996
5997         * expression.cs (StackAlloc.DoReSolve): Added test for
5998         negative parameter (CS0247).
5999
6000 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
6001
6002         Fix bug #59792
6003         * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
6004
6005 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
6006
6007         Fix bug #59781
6008         * expression.cs: (Binary.DoNumericPromotions): Added conversion for
6009         ulong.
6010
6011 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
6012
6013         Fix bug #58254 & cs1555.cs, cs1556.cs
6014         * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
6015
6016 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
6017
6018         * cs-parser.jay: Added error CS1669 test for indexers.
6019
6020 2004-06-18  Martin Baulig  <martin@ximian.com>
6021
6022         * generics.cs (GenericMethod.ctor): Don't take an Attributes
6023         argument.  Fixes #60441.
6024
6025 2004-06-16  Ben Maurer  <bmaurer@ximian.com>
6026         * ecore.cs (MethodGroupExpr.Name): Revert Martin's patch.
6027         The name needs to have the actual name of the method in order
6028         for other tests (such as the one in OverloadResolve for Invoke
6029         on a delegate) to work. As well, it does not really help
6030         error reporting because the method group had multiple methods.
6031         * Makefile: Remove MCS_DEBUG, you can enable with the DEBUG_FLAGS.
6032         Make profiling work.
6033         
6034 2004-06-13  Martin Baulig  <martin@ximian.com>
6035
6036         * cs-parser.jay: Don't allow generic attributes.
6037
6038 2004-06-13  Martin Baulig  <martin@ximian.com>
6039
6040         * class.cs (MemberBase.DoDefineBase): New protected method.
6041         (MemberBase.DoDefine): Compute the `flags' in the new
6042         DoDefineBase() which must be called first.
6043         (Method.Define): Call DoDefineBase() first so we have the flags
6044         when defining the generic method.
6045
6046         * cs-parser.jay (interface_method_declaration): Support generic methods.
6047
6048 2004-06-13  Martin Baulig  <martin@ximian.com>
6049
6050         * decl.cs (TypeName): Removed.
6051         (MemberName): Removed TypeName and MemberNow; now we just have
6052         MemberName.
6053
6054         * cs-parser.jay: Don't distinguish between type arguments and type
6055         parameters in the grammar and simplified the rules a bit.  The
6056         reduce/reduce conflicts are now gone (except the one we inherited
6057         from mcs).
6058
6059 2004-06-11  Martin Baulig  <martin@ximian.com>
6060
6061         * expression.cs (Invocation.IsParamsMethodApplicable): We need to
6062         call this twice: for params and varargs methods.
6063
6064 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
6065
6066         * class.cs:
6067         (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
6068
6069 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
6070
6071         * attribute.cs (Attribute.GetValidTargets): Made public.
6072
6073         * class.cs: 
6074         (AbstractPropertyEventMethod): New class for better code sharing.
6075         (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
6076         CS1667 report.
6077         (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
6078
6079 2004-06-09  Martin Baulig  <martin@ximian.com>
6080
6081         * cs-parser.jay: Removed a reduce/reduce conflict.
6082
6083 2004-06-03  Martin Baulig  <martin@ximian.com>
6084
6085         * generic.cs (ConstructedType.GetMemberAccess): Renamed to
6086         GetSimpleName() and return a SimpleName.
6087
6088         * ecore.cs (SimpleName.Arguments): New public field.
6089         (SimpleName): Added overloaded ctor which takes an additional
6090         TypeArguments argument.
6091         (SimpleName.SimpleNameResolve): Added support for generic methods.
6092         (MethodGroupExpr.ResolveGeneric): New public method.  The code was
6093         formerly in MemberAccess.DoResolve(), but we also need it in
6094         SimpleNameResolve().
6095
6096         * expression.cs (MemberAccess.DoResolve): Use the new
6097         MethodGroupExpr.ResolveGeneric().       
6098
6099 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
6100
6101         * decl.cs: If possible, use lookuptypedirect here. We can only do
6102         this if there is no `.' after the namespace. Avoids using
6103         LookupType, which does lots of slow processing.
6104         (FindNestedType) New method, does what it says :-).
6105         * namespace.cs: use LookupTypeDirect.
6106         * rootcontext.cs: use membercache, if possible.
6107         * typemanager.cs (LookupTypeDirect): Cache negative hits too.
6108
6109 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
6110
6111         * expression.cs:
6112         According to the spec, 
6113
6114         In a member access of the form E.I, if E is a single identifier,
6115         and if the meaning of E as a simple-name (§7.5.2) is a constant,
6116         field, property, localvariable, or parameter with the same type as
6117         the meaning of E as a type-name (§3.8), then both possible
6118         meanings of E are permitted.
6119
6120         We did not check that E as a simple-name had the same type as E as
6121         a type name.
6122
6123         This trivial check gives us 5-7% on bootstrap time.
6124
6125 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
6126
6127         * expression.cs (Invocation.OverloadResolve): Avoid the
6128         use of hashtables and boxing here by allocating on demand.
6129
6130 2004-05-30  Martin Baulig  <martin@ximian.com>
6131
6132         * rootcontext.cs (RootContext.LookupType): Don't cache things if
6133         we're doing a silent lookup.  Don't try to lookup nested types in
6134         TypeManager.object_type (thanks to Ben Maurer).
6135
6136 2004-05-30  Martin Baulig  <martin@ximian.com>
6137
6138         Committing a patch from Ben Maurer.
6139
6140         * rootcontext.cs (RootContext.LookupType): Cache negative results.
6141
6142 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
6143
6144         * convert.cs: add a trivial cache for overload operator resolution.
6145
6146 2004-05-31  Marek Safar  <marek.safar@seznam.cz>
6147
6148         * attribute.cs
6149         (AttributeTester.GetObsoleteAttribute): Returns instance of
6150         ObsoleteAttribute when type is obsolete.
6151
6152         * class.cs
6153         (TypeContainer.VerifyObsoleteAttribute): Override.
6154         (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
6155         (MethodCode.VerifyObsoleteAttribute): Override.
6156         (MemberBase.VerifyObsoleteAttribute): Override.
6157
6158         * decl.cs
6159         (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
6160         and report proper error.
6161
6162         *delegate.cs
6163         (Delegate.VerifyObsoleteAttribute): Override.
6164
6165         * ecore.cs
6166         (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
6167         and report proper error.
6168         (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
6169
6170         * enum.cs
6171         (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
6172         and enum member.
6173
6174         * expression.cs
6175         (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
6176         New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
6177         Added test for ObsoleteAttribute.
6178
6179         * statement.cs
6180         (Catch): Derived from Statement.
6181
6182 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
6183
6184         * decl.cs: If possible, use lookuptypedirect here. We can only do
6185         this if there is no `.' after the namespace. Avoids using
6186         LookupType, which does lots of slow processing.
6187         (FindNestedType) New method, does what it says :-).
6188         * namespace.cs: use LookupTypeDirect.
6189         * rootcontext.cs: use membercache, if possible.
6190         * typemanager.cs (LookupTypeDirect): Cache negative hits too.
6191
6192 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
6193
6194         * expression.cs:
6195         According to the spec, 
6196
6197         In a member access of the form E.I, if E is a single identifier,
6198         and if the meaning of E as a simple-name (§7.5.2) is a constant,
6199         field, property, localvariable, or parameter with the same type as
6200         the meaning of E as a type-name (§3.8), then both possible
6201         meanings of E are permitted.
6202
6203         We did not check that E as a simple-name had the same type as E as
6204         a type name.
6205
6206         This trivial check gives us 5-7% on bootstrap time.
6207
6208 2004-05-30  Marek Safar  <marek.safar@seznam.cz>
6209
6210         Fixed bug #59071 & cs0160.cs
6211         * statement.cs (Try.Resolve): Check here whether order of catch
6212         clauses matches their dependencies.
6213
6214 2004-05-30  Marek Safar  <marek.safar@seznam.cz>
6215
6216         Fixed bug #58624
6217         * ecore.cs (SimpleName.SimpleNameResolve): Added test for
6218         unsafe type.
6219
6220 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
6221
6222         * expression.cs (Invocation.OverloadResolve): Avoid the
6223         use of hashtables and boxing here by allocating on demand.
6224
6225 2004-05-30  Martin Baulig  <martin@ximian.com>
6226
6227         * rootcontext.cs (RootContext.LookupType): Don't cache things if
6228         we're doing a silent lookup.  Don't try to lookup nested types in
6229         TypeManager.object_type (thanks to Ben Maurer).
6230
6231 2004-05-30  Martin Baulig  <martin@ximian.com>
6232
6233         Committing a patch from Ben Maurer.
6234
6235         * rootcontext.cs (RootContext.LookupType): Cache negative results.      
6236
6237 2004-05-29  Martin Baulig  <martin@ximian.com>
6238
6239         * class.cs (IMethodData.ShouldIgnore): New method.
6240
6241         * typemanager.cs (TypeManager.MethodFlags): Don't take a
6242         `Location' argument, we don't need it anywhere.  Use
6243         `IMethodData.ShouldIgnore ()' instead of
6244         `MethodData.GetMethodFlags ()'.
6245         (TypeManager.AddMethod): Removed.
6246         (TypeManager.AddMethod2): Renamed to AddMethod.
6247
6248 2004-05-29  Martin Baulig  <martin@ximian.com>
6249
6250         Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
6251
6252         * convert.cs (Convert.ImplicitReferenceConversion): If we're
6253         converting from a class type S to an interface type and we already
6254         have an object on the stack, don't box it again.  Fixes #52578.
6255
6256 2004-05-29  Martin Baulig  <martin@ximian.com>
6257
6258         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
6259         Added support for `params' parameters.  Fixes #59267.
6260
6261 2004-05-29  Martin Baulig  <martin@ximian.com>
6262
6263         * literal.cs (NullPointer): Provide a private .ctor which sets
6264         `type' to TypeManager.object_type.  Fixes #59048.
6265
6266 2004-05-29  Martin Baulig  <martin@ximian.com>
6267
6268         * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
6269         EventExpr, set `ee.InstanceExpression = left'.  Fixes #59188.
6270
6271         * ecore.cs (EventExpr.instance_expr): Make the field private.
6272
6273 2004-05-26  Marek Safar  <marek.safar@seznam.cz>
6274
6275         Fixed bug #50080 & cs0214-2.cs
6276         * expression.cs (Cast.DoResolve): Check unsafe context here.
6277         
6278         * statement.cs (Resolve.DoResolve): Likewise.
6279
6280 2004-05-26  Martin Baulig  <martin@ximian.com>
6281
6282         * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
6283
6284         * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
6285         (RootContext.LookupType): Pass down the `silent' flag.
6286
6287 2004-05-25  Martin Baulig  <martin@ximian.com>
6288
6289         * expression.cs
6290         (MethodGroupExpr.IdenticalTypeName): New public property.
6291         (Invocation.DoResolve): Don't report a CS0176 if the "instance"
6292         expression actually refers to a type.
6293
6294 2004-05-25  Martin Baulig  <martin@ximian.com>
6295
6296         * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
6297         for #56176 and made it actually work.
6298
6299 2004-05-25  Martin Baulig  <martin@ximian.com>
6300
6301         * ecore.cs (Expression.CacheTemporaries): Make this virtual.
6302         (FieldExpr, PropertyExpr): Override and implement
6303         CacheTemporaries.  Fixes #52279.
6304
6305 2004-05-25  Miguel de Icaza  <miguel@ximian.com>
6306
6307         * location.cs: In the new compiler listing a file twice is a
6308         warning, not an error.
6309
6310 2004-05-24  Martin Baulig  <martin@ximian.com>
6311
6312         * enum.cs (Enum.DefineType): For the `BaseType' to be a
6313         TypeLookupExpression; otherwise, report a CS1008.  Fixes #58571.
6314
6315 2004-05-24  Martin Baulig  <martin@ximian.com>
6316
6317         * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
6318         walking the `using' list.  Fixes #53921.
6319
6320 2004-05-24  Martin Baulig  <martin@ximian.com>
6321
6322         * const.cs (Const.LookupConstantValue): Added support for
6323         EmptyCast's; fixes #55251.
6324
6325 2004-05-24  Martin Baulig  <martin@ximian.com>
6326
6327         * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
6328         DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
6329         which does the CS0135 check.  The reason is that we first need to
6330         check whether the variable actually exists.
6331
6332 2004-05-24  Martin Baulig  <martin@ximian.com>
6333
6334         * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
6335         than RootContext.LookupType() to find the explicit interface
6336         type.  Fixes #58584.
6337
6338 2004-05-24  Raja R Harinath  <rharinath@novell.com>
6339
6340         * Makefile: Simplify.  Use executable.make.
6341         * mcs.exe.sources: New file.  List of sources of mcs.exe.
6342
6343 2004-05-24  Anders Carlsson  <andersca@gnome.org>
6344
6345         * decl.cs:
6346         * enum.cs:
6347         Use the invariant culture when doing String.Compare for CLS case
6348         sensitivity.
6349         
6350 2004-05-23  Martin Baulig  <martin@ximian.com>
6351
6352         * decl.cs (DeclSpace.FindType): Only check the `using' list if we
6353         don't have any dots.  Fixes #52622, added cs0246-8.cs.
6354
6355         * namespace.cs (NamespaceEntry.Lookup): Likewise.
6356
6357 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
6358
6359         * class.cs (MemberBase.Define): Reuse MemberType member for 
6360         resolved type. Other methods can use it too.
6361
6362 2004-05-23  Martin Baulig  <martin@ximian.com>
6363
6364         * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
6365         the variable also exists in the current block (otherwise, we need
6366         to report a CS0103).  Fixes #58670.
6367
6368 2004-05-23  Martin Baulig  <martin@ximian.com>
6369
6370         * flowanalysis.cs (Reachability.Reachable): Compute this
6371         on-the-fly rather than storing it as a field.
6372
6373 2004-05-23  Martin Baulig  <martin@ximian.com>
6374
6375         * flowanalysis.cs (Reachability.And): Manually compute the
6376         resulting `barrier' from the reachability.      
6377        
6378 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
6379
6380         Fix bug #57835
6381         * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
6382         instance of ObsoleteAttribute when symbol is obsolete.
6383
6384         * class.cs
6385         (IMethodData): Extended interface for ObsoleteAttribute support.
6386
6387 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
6388
6389         * attribute.cs: Fix bug #55970
6390
6391 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
6392
6393         Fix bug #52705
6394         * attribute.cs
6395         (GetObsoleteAttribute): New method. Creates the instance of
6396         ObsoleteAttribute.
6397         (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
6398         ObsoleteAttribute when member is obsolete.
6399         (AttributeTester.Report_ObsoleteMessage): Common method for
6400         Obsolete error/warning reporting.
6401
6402         * class.cs
6403         (TypeContainer.base_classs_type): New member for storing parent type.
6404
6405         * decl.cs
6406         (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
6407         for this MemberCore.
6408
6409 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
6410
6411         * attribute.cs, const.cs: Fix bug #58590
6412
6413 2004-05-21  Martin Baulig  <martin@ximian.com>
6414
6415         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
6416         out parameters if the end of the method is unreachable.  Fixes
6417         #58098. 
6418
6419 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
6420
6421         * codegen.cs, cs-parser.jay: Removed SetAttributes method.
6422         Hari was right, why extra method.
6423
6424 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
6425
6426         * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
6427
6428 2004-05-20  Martin Baulig  <martin@ximian.com>
6429
6430         * delegate.cs: Convert this file to Unix mode - like the original
6431         version in mcs is.
6432
6433 2004-05-20  Martin Baulig  <martin@ximian.com>
6434
6435         * attribute.cs: Convert this file to Unix mode - like the original
6436         version in mcs is.
6437
6438 2004-05-19  Marek Safar  <marek.safar@seznam.cz>
6439
6440        Fix bug #58688 (MCS does not report error when the same attribute
6441        is assigned twice)
6442
6443        * attribute.cs (Attribute.Emit): Distinction between null and default.
6444
6445 2004-05-19  Raja R Harinath  <rharinath@novell.com>
6446
6447        * cs-parser.jay (attribute): Create a GlobalAttribute for the case
6448        of a top-level attribute without an attribute target.
6449        * attribute.cs (Attribute.Error_AttributeConstructorMismatch): 
6450        Make non-static.
6451        (Attribute.Conditional_GetConditionName), 
6452        (Attribute.Obsolete_GetObsoleteMessage): Update.
6453        (Attribute.IndexerName_GetIndexerName): New.  Attribute-specific
6454        part of ScanForIndexerName.
6455        (Attribute.CanIgnoreInvalidAttribute): New function.
6456        (Attribute.ScanForIndexerName): Move to ...
6457        (Attributes.ScanForIndexerName): ... here.
6458        (Attributes.Attrs): Rename from now-misnamed AttributeSections.
6459        (Attributes.Search): New internal variant that can choose not to
6460        complain if types aren't resolved.  The original signature now
6461        complains.
6462        (Attributes.GetClsCompliantAttribute): Use internal variant, with
6463        complaints suppressed.
6464        (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
6465        only if it not useful.
6466        (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
6467        top-level for attributes that are shared between the assembly
6468        and a top-level class.
6469        * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
6470        * class.cs: Update to reflect changes.
6471        (DefineIndexers): Fuse loops.
6472        * codegen.cs (GetAssemblyName): Update to reflect changes.  Accept
6473        a couple more variants of attribute names.
6474
6475 2004-05-18  Marek Safar  <marek.safar@seznam.cz>
6476
6477         Fix bug #52585 (Implemented explicit attribute declaration)
6478
6479         * attribute.cs:
6480         (Attributable.ValidAttributeTargets): New abstract method. It gets
6481         list of valid attribute targets for explicit target declaration.
6482         (Attribute.Target): It holds target itself.
6483         (AttributeSection): Removed.
6484         (Attribute.CheckTargets): New method. It checks whether attribute
6485         target is valid for the current element.
6486
6487         * class.cs:
6488         (EventProperty): New class. For events that are declared like
6489         property (with add and remove accessors).
6490         (EventField): New class. For events that are declared like field.
6491         class.cs
6492
6493         * cs-parser.jay: Implemented explicit attribute target declaration.
6494
6495         * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:        
6496         Override ValidAttributeTargets.
6497
6498         * parameter.cs:
6499         (ReturnParameter): Class for applying custom attributes on 
6500         the return type.
6501         (ParameterAtribute): New class. Class for applying custom
6502         attributes on the parameter type.
6503
6504 2004-05-17  Miguel de Icaza  <miguel@ximian.com>
6505
6506         * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
6507         definitions. 
6508
6509         (Method): Allow UNSAFE here.
6510
6511         * modifiers.cs: Support unsafe reporting.
6512
6513 2004-05-17  Marek Safar  <marek.safar@seznam.cz>
6514
6515         * decl.cs: Fix bug #58478.
6516
6517 2004-05-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
6518
6519         * statement.cs: When checking for unreachable code on an EmptyStatement,
6520         set the location. Fixes bug #58488.
6521
6522 2004-05-13  Miguel de Icaza  <miguel@ximian.com>
6523
6524         * driver.cs: Add -pkg handling.
6525
6526         From Gonzalo: UseShelLExecute=false
6527
6528 2004-05-12  Marek Safar  <marek.safar@seznam.cz>
6529
6530         * attribute.cs:
6531         (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
6532         for attribute.
6533         (Attribute.IsClsCompliaceRequired): Moved to base for better
6534         accesibility.
6535         (Attribute.UsageAttribute): New property for AttributeUsageAttribute
6536         when attribute is AttributeUsageAttribute.
6537         (Attribute.GetValidTargets): Simplified.
6538         (Attribute.GetAttributeUsage): New method returns AttributeUsage
6539         attribute for this type.
6540         (Attribute.ApplyAttributes): Method renamed to Emit and make
6541         non-static.
6542         (GlobalAttributeSection): New class for special handling of global
6543         attributes (assembly, module).
6544         (AttributeSection.Emit): New method.
6545
6546         * class.cs: Implemented Attributable abstract methods.
6547         (MethodCore.LabelParameters): Moved to Parameter class.
6548         (Accessor): Is back simple class.
6549         (PropertyMethod): Implemented Attributable abstract class.
6550         (DelegateMethod): Implemented Attributable abstract class.
6551         (Event): New constructor for disctintion between normal Event
6552         and Event with accessors.
6553
6554         * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
6555
6556         * codegen.cs, const.cs, decl.cs, delegate.cs:
6557         (CommonAssemblyModulClass): Implemented Attributable abstract class
6558         and simplified.
6559
6560         * enum.cs: Implement IAttributeSupport interface.
6561         (EnumMember): New class for emum members. Implemented Attributable
6562         abstract class
6563
6564         * parameter.cs:
6565         (ParameterBase): Is abstract.
6566         (ReturnParameter): New class for easier [return:] attribute handling.
6567
6568         * typemanager.cs: Removed builder_to_attr.
6569
6570 2004-05-11  Raja R Harinath  <rharinath@novell.com>
6571
6572         Fix bug #57151.
6573         * attribute.cs (Attribute.GetPositionalValue): New function.
6574         * class.cs (TypeContainer.VerifyMembers): New function.
6575         (TypeContainer.Emit): Use it.
6576         (ClassOrStruct): New base class for Class and Struct.
6577         (ClassOrStruct.ApplyAttributeBuilder): New function.  Note if 
6578         StructLayout(LayoutKind.Explicit) was ascribed to the struct or
6579         class.
6580         (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
6581         then each non-static field should have a FieldOffset attribute.
6582         Otherwise, none of the fields should have a FieldOffset attribute.
6583         * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout 
6584         and FieldOffset attributes.
6585         * typemanager.cs (TypeManager.struct_layout_attribute_type)
6586         (TypeManager.field_offset_attribute_type): New core types.
6587         (TypeManager.InitCoreTypes): Initialize them.
6588
6589 2004-05-11  Michal Moskal  <malekith@pld-linux.org>
6590
6591         * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
6592         Return correct type.
6593         From bug #58270.
6594
6595 2004-05-09  Miguel de Icaza  <miguel@ximian.com>
6596
6597         * expression.cs (Binary.DoNumericPromotions): 0 long constant can
6598         be implicitly converted to ulong.
6599         
6600         * expression.cs: The logic for allowing operator &, | and ^ worked
6601         was wrong, it worked before because we did not report an error in
6602         an else branch.  Fixes 57895.
6603
6604         * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
6605         allow volatile fields to be reference types.
6606
6607 2004-05-07  Miguel de Icaza  <miguel@ximian.com>
6608
6609         * driver.cs: Add support for /debug-
6610
6611 2004-05-07  Raja R Harinath  <rharinath@novell.com>
6612
6613         * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType): 
6614         Add a 'complain' parameter to silence errors.
6615         (Attribute.Resolve): Update to changes.  Put in sanity check to catch
6616         silently overlooked type-resolutions.
6617         (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
6618         to reflect changes.
6619         (Attributes.Search): New function.
6620         (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
6621         (Attributes.GetAttributeFullName): Remove hack.
6622         * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes): 
6623         Update to reflect changes.
6624         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
6625         Use Attributes.Search instead of nested loops.
6626
6627 2004-05-07  Marek Safar  <marek.safar@seznam.cz>
6628
6629         * decl.cs:
6630         (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
6631         (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
6632         (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
6633
6634         * report.cs: (Report.Warning): Renamed to Warning_T because of
6635         parameter collision.
6636
6637 2004-05-05  Raja R Harinath  <rharinath@novell.com>
6638
6639         * expression.cs (MemberAccess.ResolveMemberAccess):
6640         Exit with non-zero status after Report.Error.
6641         * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
6642         Likewise.
6643         * typemanager.cs (TypeManager.CoreLookupType): Likewise.
6644
6645 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
6646
6647         * support.cs: Don't hang when the file is empty.
6648
6649 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
6650
6651         * support.cs: In SeekableStreamReader, compute the preamble size of the
6652           underlying stream. Position changes should take into account that initial
6653           count of bytes.
6654
6655 2004-05-03  Todd Berman  <tberman@sevenl.net>
6656
6657         * driver.cs: remove unused GetSysVersion function.
6658
6659 2004-05-03  Todd Berman  <tberman@sevenl.net>
6660
6661         * driver.cs: Remove the hack from saturday, as well as the hack
6662         from jackson (LoadAssemblyFromGac), also adds the CWD to the
6663         link_paths to get that bit proper.
6664
6665 2004-05-01  Todd Berman  <tberman@sevenl.net>
6666
6667         * driver.cs: Try a LoadFrom before a Load, this checks the current
6668         path. This is currently a bug in mono that is be fixed, however, this
6669         provides a workaround for now. This will be removed when the bug
6670         is fixed.
6671
6672 2004-05-01  Sebastien Pouliot  <sebastien@ximian.com>
6673
6674         * CryptoConvert.cs: Updated to latest version. Fix issue with 
6675         incomplete key pairs (#57941).
6676
6677 2004-05-01  Todd Berman  <tberman@sevenl.net>
6678
6679         * driver.cs: Remove '.' from path_chars, now System.* loads properly
6680         from the GAC
6681
6682 2004-04-30  Jackson Harper  <jackson@ximian.com>
6683
6684         * codegen.cs: Open keys readonly.
6685         
6686 2004-04-30  Gonzalo Paniagua Javier <gonzalo@ximian.com>
6687
6688         * typemanager.cs: don't report cyclic struct layout when a struct
6689         contains 2 or more fields of the same type. Failed for Pango.AttrShape
6690         which has 2 Pango.Rectangle fields.
6691
6692 2004-04-29 Ben Maurer  <bmaurer@users.sourceforge.net>
6693
6694         * expression.cs: Handle IntPtr comparisons with IL code
6695         rather than a method call.
6696
6697 2004-04-29  Martin Baulig  <martin@ximian.com>
6698
6699         * ecore.cs (PropertyExpr.FindAccessor): New private method.  Walk
6700         the list of PropertyInfo's in class hierarchy and find the
6701         accessor.  Fixes #56013.
6702
6703 2004-04-29  Martin Baulig  <martin@ximian.com>
6704
6705         * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
6706
6707 2004-04-29  Martin Baulig  <martin@ximian.com>
6708
6709         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
6710
6711         * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
6712
6713 2004-04-29  Martin Baulig  <martin@ximian.com>
6714
6715         * class.cs (ConstructorInitializer.Resolve): Check whether the
6716         parent .ctor is accessible.  Fixes #52146.
6717
6718 2004-04-29  Martin Baulig  <martin@ximian.com>
6719
6720         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
6721
6722         * statement.cs (Using.EmitLocalVariableDecls): Use
6723         TypeManager.idisposable_type, not typeof (IDisposable).
6724         (Foreach.EmitCollectionForeach): Added support for valuetypes.
6725
6726 2004-04-29  Martin Baulig  <martin@ximian.com>
6727
6728         * class.cs (Event.Define): Don't emit the field and don't set
6729         RTSpecialName and SpecialName for events on interfaces.  Fixes
6730         #57703. 
6731
6732 2004-04-29  Raja R Harinath  <rharinath@novell.com>
6733
6734         Refactor Attribute.ApplyAttributes.
6735         * attribute.cs (Attributable): New base class for objects that can
6736         have Attributes applied on them.
6737         (Attribute): Make AttributeUsage fields public.
6738         (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
6739         (Attribute.IsInternalCall): New property.
6740         (Attribute.UsageAttr): Convert to a public read-only property.
6741         (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
6742         (Attribute.ResolveType, Attribute.Resolve)
6743         (Attribute.ScanForIndexerName): Update to reflect changes.
6744         (Attribute.CheckAttributeTarget): Re-format.
6745         (Attribute.ApplyAttributes): Refactor, to various
6746         Attributable.ApplyAttributeBuilder methods.
6747         * decl.cs (MemberCore): Make Attributable.
6748         * class.cs (Accessor): Make Attributable.
6749         (MethodData.ApplyAttributes): Use proper attribute types, not
6750         attribute names.
6751         (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
6752         (TypeContainer.ApplyAttributeBuilder)
6753         (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
6754         (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)   
6755         (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
6756         (Operator.ApplyAttributeBuilder): New factored-out methods.
6757         * const.cs (Const.ApplyAttributeBuilder): Likewise.
6758         * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
6759         * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
6760         * parameter.cs (ParameterBase): New Attributable base class
6761         that can also represent Return types.
6762         (Parameter): Update to the changes.
6763
6764 2004-04-29  Jackson Harper  <jackson@ximian.com>
6765
6766         * driver.cs: Prefer the corlib system version when looking for
6767         assemblies in the GAC. This is still a hack, but its a better hack
6768         now.
6769         
6770 2004-04-29  Marek Safar  <marek.safar@seznam.cz>
6771
6772         * decl.cs, enum.cs: Improved error 3005 reporting.
6773   
6774         * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
6775         (related_symbols): New private member for list of symbols
6776         related to reported error/warning.
6777         
6778         * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
6779
6780 2004-04-29  Martin Baulig  <martin@ximian.com>
6781
6782         * ecore.cs (Expression.Constantify): If we're an enum and
6783         TypeManager.TypeToCoreType() doesn't give us another type, use
6784         t.UnderlyingSystemType.  Fixes #56178.  
6785
6786 2004-04-29  Martin Baulig  <martin@ximian.com>
6787
6788         * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
6789         interfaces and for each interface, only add members directly
6790         declared in that interface.  Fixes #53255.
6791
6792 2004-04-28  Martin Baulig  <martin@ximian.com>
6793
6794         * expression.cs (ConditionalLogicalOperator): Use a temporary
6795         variable for `left' to avoid that we evaluate it more than once;
6796         bug #52588.
6797
6798 2004-04-28  Martin Baulig  <martin@ximian.com>
6799
6800         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
6801         `void[]' (CS1547).
6802
6803 2004-04-28  Martin Baulig  <martin@ximian.com>
6804
6805         * statement.cs (LocalInfo.Resolve): Check whether the type is not
6806         void (CS1547).
6807
6808         * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
6809         whether the type is not void (CS1547).
6810
6811 2004-04-28  Martin Baulig  <martin@ximian.com>
6812
6813         * expression.cs (Unary.DoResolveLValue): Override this and report
6814         CS0131 for anything but Operator.Indirection.
6815
6816 2004-04-28  Martin Baulig  <martin@ximian.com>
6817
6818         Committing a patch from Ben Maurer; see bug #50820.
6819
6820         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
6821         check for classes.
6822
6823         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
6824         classes.        
6825
6826 2004-04-28  Martin Baulig  <martin@ximian.com>
6827
6828         Committing a patch from Ben Maurer; see bug #50820.
6829
6830         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
6831         check for classes.
6832
6833         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
6834         classes.        
6835
6836 2004-04-28  Martin Baulig  <martin@ximian.com>
6837
6838         * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
6839         (Block.AddLabel): Call DoLookupLabel() to only search in the
6840         current block.
6841
6842 2004-04-28  Martin Baulig  <martin@ximian.com>
6843
6844         * cfold.cs (ConstantFold.BinaryFold): Added special support for
6845         comparing StringConstants and NullLiterals in Equality and Inequality.
6846
6847 2004-04-28  Jackson Harper  <jackson@ximian.com>
6848
6849         * driver.cs: Attempt to load referenced assemblies from the
6850         GAC. This is the quick and dirty version of this method that
6851         doesnt take into account versions and just takes the first
6852         canidate found. Will be good enough for now as we will not have more
6853         then one version installed into the GAC until I update this method.
6854
6855 2004-04-28  Martin Baulig  <martin@ximian.com>
6856
6857         * typemanager.cs (TypeManager.CheckStructCycles): New public
6858         static method to check for cycles in the struct layout.
6859
6860         * rootcontext.cs (RootContext.PopulateTypes): Call
6861         TypeManager.CheckStructCycles() for each TypeContainer.
6862         [Note: We only need to visit each type once.]
6863
6864 2004-04-28  Martin Baulig  <martin@ximian.com>
6865
6866         * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
6867
6868         * const.cs (Const.LookupConstantValue): Return a `bool' signalling
6869         success and added `out object value'.  Use a `bool resolved' field
6870         to check whether we've already been called rather than
6871         `ConstantValue != null' since this breaks for NullLiterals.
6872
6873 2004-04-28  Raja R Harinath  <rharinath@novell.com>
6874
6875         * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
6876         setting of this flag, since the 'set' method may be non-public.
6877
6878 2004-04-28  Raja R Harinath  <rharinath@novell.com>
6879
6880         * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
6881         check on current_vector.Block.
6882
6883 2004-04-27  Martin Baulig  <martin@ximian.com>
6884
6885         * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
6886         a field initializer.  Fixes #56459.
6887
6888 2004-04-27  Martin Baulig  <martin@ximian.com>
6889
6890         * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
6891         we're not attempting to use an indexer.  Fixes #52154.
6892
6893 2004-04-27  Martin Baulig  <martin@ximian.com>
6894
6895         * statement.cs (Return): Don't create a return label if we don't
6896         need it; reverts my change from January 20th.  Thanks to Ben
6897         Maurer for this.
6898
6899 2004-04-27  Martin Baulig  <martin@ximian.com>
6900
6901         According to the spec, `goto' can only leave a nested scope, but
6902         never enter it.
6903
6904         * statement.cs (Block.LookupLabel): Only lookup in the current
6905         block, don't recurse into parent or child blocks.
6906         (Block.AddLabel): Check in parent and child blocks, report
6907         CS0140/CS0158 if we find a duplicate.
6908         (Block): Removed this indexer for label lookups.
6909         (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
6910         this already does the error reporting for us.
6911
6912         * flowanalysis.cs
6913         (FlowBranching.UsageVector.Block): New public variable; may be null.
6914         (FlowBranching.CreateSibling): Added `Block' argument.
6915         (FlowBranching.LookupLabel): New public virtual method.  Lookup a
6916         label for the target of a `goto' and check whether we're not
6917         leaving a `finally'.
6918
6919 2004-04-27  Martin Baulig  <martin@ximian.com>
6920
6921         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
6922         a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
6923         just for returns).
6924
6925 2004-04-27  Martin Baulig  <martin@ximian.com>
6926
6927         * statement.cs (Block.AddLabel): Also check for implicit blocks
6928         and added a CS0158 check.
6929
6930 2004-04-27  Martin Baulig  <martin@ximian.com>
6931
6932         * flowanalysis.cs (FlowBranchingLoop): New class.
6933         (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
6934         UsageVector's instead of an ArrayList.
6935         (FlowBranching.Label): Likewise.
6936         (FlowBranching.UsageVector.MergeBreakOrigins): New method.
6937         (FlowBranching.AddBreakVector): New method.
6938
6939 2004-04-27  Miguel de Icaza  <miguel@ximian.com>
6940
6941         * attribute.cs: Small regression fix: only convert the type if we
6942         the type is different, fixes System.Drawing build.
6943
6944 2004-04-27  Martin Baulig  <martin@ximian.com>
6945
6946         * attribute.cs (Attribute.Resolve): If we have a constant value
6947         for a named field or property, implicity convert it to the correct
6948         type.
6949
6950 2004-04-27  Raja R Harinath  <rharinath@novell.com>
6951
6952         * statement.cs (Block.Block): Implicit blocks share
6953         'child_variable_names' fields with parent blocks.
6954         (Block.AddChildVariableNames): Remove.
6955         (Block.AddVariable): Mark variable as "used by a child block" in
6956         every surrounding block.
6957         * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
6958         been used in a child block, complain about violation of "Invariant
6959         meaning in blocks" rule.
6960         * cs-parser.jay (declare_local_variables): Don't use
6961         AddChildVariableNames.
6962         (foreach_statement): Don't create an implicit block: 'foreach'
6963         introduces a scope.
6964
6965 2004-04-23  Miguel de Icaza  <miguel@ximian.com>
6966
6967         * convert.cs (ImplicitNumericConversion): 0 is also positive when
6968         converting from 0L to ulong.  Fixes 57522.
6969
6970 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
6971
6972         * decl.cs (FindMemberToOverride): Fix wrong warning for case when
6973         derived class hides via 'new' keyword field from base class (test-242.cs).
6974         TODO: Handle this in the more general way.
6975         
6976         * class.cs (CheckBase): Ditto.
6977
6978 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
6979
6980         * decl.cs (caching_flags): New member for storing cached values
6981         as bit flags.
6982         (MemberCore.Flags): New enum where bit flags for caching_flags
6983         are defined.
6984         (MemberCore.cls_compliance): Moved to caching_flags.
6985         (DeclSpace.Created): Moved to caching_flags.
6986
6987         * class.cs: Use caching_flags instead of DeclSpace.Created
6988         
6989 2004-04-21  Miguel de Icaza  <miguel@ximian.com>
6990
6991         * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
6992         if we are only a derived class, not a nested class.
6993
6994         * typemanager.cs: Same as above, but do this at the MemberLookup
6995         level (used by field and methods, properties are handled in
6996         PropertyExpr).   Allow for the qualified access if we are a nested
6997         method. 
6998
6999 2004-04-21  Marek Safar  <marek.safar@seznam.cz>
7000
7001         * class.cs: Refactoring.
7002         (IMethodData): New inteface; Holds links to parent members
7003         to avoid member duplication (reduced memory allocation).
7004         (Method): Implemented IMethodData interface.
7005         (PropertyBase): New inner classes for get/set methods.
7006         (PropertyBase.PropertyMethod): Implemented IMethodData interface
7007         (Event): New inner classes for add/remove methods.
7008         (Event.DelegateMethod): Implemented IMethodData interface.
7009
7010         * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
7011         EmitContext (related to class.cs refactoring).
7012
7013 2004-04-21  Raja R Harinath  <rharinath@novell.com>
7014
7015         * delegate.cs (Delegate.VerifyApplicability): If the number of
7016         arguments are the same as the number of parameters, first try to
7017         verify applicability ignoring  any 'params' modifier on the last
7018         parameter.
7019         Fixes #56442.
7020
7021 2004-04-08  Martin Baulig  <martin@ximian.com>
7022
7023         Merged latest changes into gmcs.  Please keep this comment in
7024         here, it makes it easier for me to see what changed in MCS since
7025         the last time I merged.
7026
7027 2004-04-16  Raja R Harinath  <rharinath@novell.com>
7028
7029         * class.cs (TypeContainer.AddIndexer): Use
7030         'ExplicitInterfaceName' to determine if interface name was
7031         explicitly specified.  'InterfaceType' is not initialized at this time.
7032         (TypeContainer.DefineIndexers): Remove use of temporary list.  The
7033         Indexers array is already in the required order.  Initialize
7034         'IndexerName' only if there are normal indexers.
7035         (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
7036         (TypeContainer.Emit): Emit DefaultMember attribute only if
7037         IndexerName is initialized.
7038         Fixes #56300.
7039
7040 2004-04-15  Benjamin Jemlich  <pcgod@gmx.net>
7041
7042         * enum.cs (Enum.DefineType): Don't allow char as type for enum.
7043         Fixes #57007
7044
7045 2004-04-15  Raja R Harinath  <rharinath@novell.com>
7046
7047         * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
7048         attributes.
7049         Fix for #56456.
7050
7051         * attribute.cs (Attribute.Resolve): Check for duplicate named
7052         attributes.
7053         Fix for #56463.
7054
7055 2004-04-15  Miguel de Icaza  <miguel@ximian.com>
7056
7057         * iterators.cs (MarkYield): track whether we are in an exception,
7058         and generate code accordingly.  Use a temporary value to store the
7059         result for our state.
7060
7061         I had ignored a bit the interaction of try/catch with iterators
7062         since their behavior was not entirely obvious, but now it is
7063         possible to verify that our behavior is the same as MS .NET 2.0
7064
7065         Fixes 54814
7066
7067 2004-04-14  Miguel de Icaza  <miguel@ximian.com>
7068
7069         * iterators.cs: Avoid creating temporaries if there is no work to
7070         do. 
7071
7072         * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
7073         Enumerations, use TypeManager.EnumToUnderlying and call
7074         recursively. 
7075
7076         Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
7077         bug #57013
7078
7079         (This.Emit): Use EmitContext.EmitThis to emit our
7080         instance variable.
7081
7082         (This.EmitAssign): Ditto.
7083
7084         * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
7085         codepaths, we will move all the functionality into
7086         Mono.CSharp.This 
7087
7088         (FieldExpr.EmitAssign): Ditto.
7089
7090         This fixes several hidden bugs that I uncovered while doing a code
7091         review of this today.
7092
7093         * codegen.cs (EmitThis): reworked so the semantics are more clear
7094         and also support value types "this" instances.
7095
7096         * iterators.cs: Changed so that for iterators in value types, we
7097         do not pass the value type as a parameter.  
7098
7099         Initialization of the enumerator helpers is now done in the caller
7100         instead of passing the parameters to the constructors and having
7101         the constructor set the fields.
7102
7103         The fields have now `assembly' visibility instead of private.
7104
7105 2004-04-11  Miguel de Icaza  <miguel@ximian.com>
7106
7107         * expression.cs (Argument.Resolve): Check if fields passed as ref
7108         or out are contained in a MarshalByRefObject.
7109
7110         * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
7111         another compiler type.
7112
7113 2004-04-06 Ben Maurer  <bmaurer@users.sourceforge.net>
7114
7115         * class.cs (Indexer.Define): use the new name checking method.
7116         Also, return false on an error.
7117         * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
7118         (is_identifier_[start/part]_character): make static.
7119
7120 2004-04-10  Miguel de Icaza  <miguel@ximian.com>
7121
7122         * expression.cs (Binary.ResolveOperator): Do no append strings
7123         twice: since we can be invoked more than once (array evaluation)
7124         on the same concatenation, take care of this here.  Based on a fix
7125         from Ben (bug #56454)
7126
7127 2004-04-08  Sebastien Pouliot  <sebastien@ximian.com>
7128
7129         * codegen.cs: Fix another case where CS1548 must be reported (when 
7130         delay-sign isn't specified and no private is available #56564). Fix
7131         loading the ECMA "key" to delay-sign an assembly. Report a CS1548 
7132         error when MCS is used on the MS runtime and we need to delay-sign 
7133         (which seems unsupported by AssemblyBuilder - see #56621).
7134
7135 2004-04-08  Marek Safar  <marek.safar@seznam.cz>
7136
7137         * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
7138         (TypeManager.ComputeNamespaces): Faster implementation for
7139         Microsoft runtime.
7140
7141         * compiler.csproj: Updated AssemblyName to mcs.
7142
7143 2004-05-11  Jackson Harper  <jackson@ximian.com>
7144
7145         * Makefile: Preserve MONO_PATH
7146         
7147 2004-05-11  Jackson Harper  <jackson@ximian.com>
7148
7149         * Makefile: Use mono and mcs to build gmcs
7150         
7151 2004-05-03  Miguel de Icaza  <miguel@ximian.com>
7152
7153         * codegen.cs: Add patch from Robert Shade
7154         <rshade@dvsconsulting.com>, use FileAccess.Read on the keyfile, to
7155         sync with mcs.
7156
7157 2004-05-02  Sebastien Pouliot  <sebastien@ximian.com>
7158
7159         * CryptoConvert.cs: Updated to latest version. Fix issue with 
7160         incomplete key pairs (#57941).
7161
7162 2004-04-08  Sebastien Pouliot  <sebastien@ximian.com>
7163
7164         * codegen.cs: Fix another case where CS1548 must be reported (when 
7165         delay-sign isn't specified and no private is available #56564). Fix
7166         loading the ECMA "key" to delay-sign an assembly. Report a CS1548 
7167         error when MCS is used on the MS runtime and we need to delay-sign 
7168         (which seems unsupported by AssemblyBuilder - see #56621).
7169
7170 2004-04-29  Jackson Harper  <jackson@ximian.com>
7171
7172         * Makefile: Set MONO_PATH to use the bootstrap corlib
7173         * driver.cs: Check the GAC for referenced assemblies.
7174                 
7175 2004-04-29  Martin Baulig  <martin@ximian.com>
7176
7177         * Makefile (gmcs.exe): Set MONO_PATH to use `../class/lib/net_2_0'.
7178
7179 2004-04-07  Martin Baulig  <martin@ximian.com>
7180
7181         * expression.cs (Binary.ResolveOperator): Added special case for
7182         Equality/Inequality between a type parameter and a null literal.
7183
7184 2004-04-07  Martin Baulig  <martin@ximian.com>
7185
7186         * convert.cs: Check null literal -> type parameter conversions.
7187
7188 2004-04-07  Martin Baulig  <martin@ximian.com>
7189
7190         * generic.cs (ConstructedType.CheckConstraints): Enforce the
7191         `class' and `struct' constraints.
7192
7193 2004-04-07  Martin Baulig  <martin@ximian.com>
7194
7195         * generic.cs (SpecialConstraint): New public enum.
7196         (Constraints.Resolve): Added support for the `class' and `struct'
7197         constraints.
7198
7199         * cs-parser.jay (type_parameter_constraint): Added support for the
7200         `class' and `struct' constraints.
7201
7202 2004-04-07  Martin Baulig  <martin@ximian.com>
7203
7204         * support.cs (GenericConstraints): Replaced `Types' by
7205         `ClassConstraint' and `InterfaceConstraints'; added
7206         `HasClassConstraint'.   
7207
7208 2004-04-07  Martin Baulig  <martin@ximian.com>
7209
7210         * generic.cs
7211         (Constraints.InterfaceConstraints): New public property.
7212         (Constraints.Types): Make this property public
7213         (TypeParameter): Implement IMemberContainer.
7214         (TypeParameter.Define): Take a `GenericTypeParameterBuilder'
7215         instead of a TypeBuilder/MethodBuilder; pass the interface
7216         constraints to TypeManager.AddTypeParameter().
7217         (TypeParameter.DefineType): Just take an EmitContext and no
7218         TypeBuilder/MethodBuilder.  Use the new public API.
7219
7220         * typemanager.cs (TypeManager.AddTypeParameter): Added
7221         `TypeExpr[]' argument; add the interfaces to the
7222         `builder_to_ifaces' hash.
7223         (TypeManager.LookupMemberContainer): For
7224         GenericTypeParameterBuilders, get the TypeParameter from the
7225         `builder_to_type_param'.
7226         (TypeManager.FindMembers): For GenericTypeParameterBuilders, get
7227         the TypeParameter and call FindMembers on it.
7228
7229 2004-04-07  Martin Baulig  <martin@ximian.com>
7230
7231         * class.cs
7232         (MethodCore.GenericMethod): Moved this field here from Method.
7233         (MethodCore.IsDuplicateImplementation): Take the number of type
7234         parameters into account if we're a generic method.
7235
7236         * expression.cs (Invocation.InferTypeArguments): Don't return true
7237         if `arguments' is null; we still need to check whether we actually
7238         don't need to infer anything in this case.
7239         (MemberAccess): Merged the functionality from GenericMemberAccess
7240         into this class.
7241
7242         * generic.cs (GenericMemberAccess): Removed.
7243
7244 2004-04-05  Martin Baulig  <martin@ximian.com>
7245
7246         * decl.cs (MemberCore): For generic classes, interfaces and
7247         structs, `Name' now includes the number of type parameters
7248         ("Stack!1.Node!1").
7249         (DeclSpace.FindType): Removed the `num_type_args' argument; we now
7250         encode the number of type arguments in the type name.
7251
7252         * expression.cs (Expression.MemberLookup): Removed the
7253         `num_type_args' argument; we now encode the number of type
7254         arguments in the type name.
7255
7256         * ecore.cs (SimpleName): Encode the number of type arguments in
7257         the type name itself.
7258
7259         * generic.cs (ConstructedType): Likewise.
7260
7261         * tree.cs (Tree.RecordDecl): Take a `string' instead of a
7262         `MemberName'; we now include the number of type parameters in the
7263         type name.
7264
7265         * typemanager.cs (TypeManager.CheckGeneric): Removed.
7266         (TypeManager.MemberLookup): Removed the
7267         `num_type_args' argument; we now encode the number of type
7268         arguments in the type name.     
7269
7270 2004-04-03  Martin Baulig  <martin@ximian.com>
7271
7272         * decl.cs (MemberCore.ctor): Take a MemberName instead of a sting.
7273         (MemberCore.MemberName): Moved here from MemberBase.
7274         (DeclSpace.SetParameterInfo): Just take the constraints as an
7275         ArrayList; we already have the type parameters in our
7276         `MemberName'; also do the CS0080 reporting here.
7277
7278         * cs-parser.jay (struct_declaration): Use `member_name' instead of
7279         `IDENTIFIER opt_type_parameter_list'; when constructing our
7280         `MemberName', it'll already include our type parameters.
7281         (class_declaration, interface_declaration): Likewise.
7282         (delegate_declaration): Likewise.
7283         (MakeName): Take a MemberName and return a MemberName.
7284         The following two changes are required to avoid shift/reduce conflicts:
7285         (member_name): Don't include a TypeName anymore; ie. this is now
7286         just 'IDENTIFIER opt_type_parameter_list'.
7287         (property_declaration, event_declaration): Use a
7288         `namespace_or_type_name' instead of a `member_name'.            
7289
7290 2004-04-03  Martin Baulig  <martin@ximian.com>
7291
7292         * decl.cs (MemberName): Renamed to `TypeName' and created a new
7293         `MemberName' class.
7294         (TypeName): Formerly known as MemberName.
7295
7296         * namespace.cs (NamespaceEntry.UsingAlias): Take a `TypeName'
7297         instead of a `MemberName'.
7298
7299         * cs-parser.jay (namespace_or_type_name): Create a TypeName.
7300         (member_name): New rule; create a MemberName.
7301
7302 2004-04-02  Martin Baulig  <martin@ximian.com>
7303
7304         * namespace.cs (NamespaceEntry.VerifyUsing): Added error checking
7305         (CS0305 and CS0308).
7306
7307 2004-04-02  Martin Baulig  <martin@ximian.com>
7308
7309         * generic.cs (GenericMemberAccess.ResolveAsTypeStep): Added
7310         support for nested types.
7311
7312 2004-04-02  Martin Baulig  <martin@ximian.com>
7313
7314         * ecore.cs (IAlias): New public interface.
7315         (TypeExpr, TypeExpression): Implement IAlias.
7316         (TypeAliasExpression): New public class.
7317
7318         * namespace.cs (Namespace): Implement IAlias.
7319         (Namespace.Lookup): Return an IAlias instead on an object.
7320         (Namespace.DefineName): Take an IAlias instead of an object.
7321         (NamespaceEntry.AliasEntry.Resolve): Return an IAlias instead of
7322         an object.
7323         (NamespaceEntry.UsingAlias): Take a Membername instead of an
7324         Expression.
7325         (NamespaceEntry.LookupAlias): Return an IAlias instead on an
7326         object.
7327         (NamespaceEntry.Lookup): Likewise.
7328
7329         * rootcontext.cs (RootContext.LookupType): Return a TypeExpr
7330         instead of a Type.      
7331
7332         * decl.cs (DeclSpace): Implement IAlias.
7333         (DeclSpace.LookupAlias): Return an IAlias instead of a string.
7334
7335         * generic.cs (ConstructedType): Improved error checking.
7336
7337 2004-04-02  Martin Baulig  <martin@ximian.com>
7338
7339         * convert.cs: Added type parameter conversions.
7340
7341         * ecore.cs
7342         (UnboxCast.Emit): Emit an `unbox.any' for type params.
7343         (ClassCast.Emit): If the source type is a type parameter, box it.
7344         If the target type is a type parameter, emit an `unbox.any'
7345         instead of a `classcast'.1      
7346
7347 2004-04-01  Martin Baulig  <martin@ximian.com>
7348
7349         * cs-tokenizer.cs (parse_less_than): Allow Token.DOT.
7350
7351 2004-04-01  Martin Baulig  <martin@ximian.com>
7352
7353         * generic.cs (ConstructedType.CheckConstraints): Use
7354         Convert.ImplicitStandardConversionExists(); user-defined implicit
7355         conversions are not allowed according to the spec.
7356
7357 2004-03-30  Martin Baulig  <martin@ximian.com>
7358
7359         * expression.cs (New): Added support for type parameters.
7360
7361         * typemanager.cs
7362         (TypeManager.activator_type): New public static field.
7363         (TypeManager.activator_create_instance): Likewise.
7364
7365 2004-03-30  Martin Baulig  <martin@ximian.com>
7366
7367         * typemanager.cs (TypeManager.HasConstructorConstraint): New
7368         public method.
7369
7370 2004-03-30  Martin Baulig  <martin@ximian.com>
7371
7372         * generic.cs (ConstructedType.CheckConstraints): Actually follow
7373         the spec here: the argument type must be convertible to the
7374         constraints.
7375
7376 2004-03-30  Martin Baulig  <martin@ximian.com>
7377
7378         * generic.cs
7379         (TypeParameter.Define, TypeParameter.DefineMethod): Call
7380         TypeManager.AddTypeParameter().
7381         (ConstructedType.CheckConstraints): Re-enable this and actually
7382         check whether we have a constructor constraint.
7383
7384         * typemanager.cs
7385         (TypeManager.builder_to_type_param): New static field.
7386         (TypeManager.AddTypeParameter): New static method.
7387         (TypeManager.LookupTypeParameter): New public method.
7388
7389 2004-03-30  Martin Baulig  <martin@ximian.com>
7390
7391         * generic.cs (TypeParameter.DefineType): Return a boolean and use
7392         the new API to actually define the constructor constraint.
7393
7394         * typemanager.cs
7395         (TypeManager.new_constraint_attr_type): New static field.
7396         (TypeManager.InitCoreTypes): Initialize it.
7397
7398 2004-03-30  Martin Baulig  <martin@ximian.com>
7399
7400         * generic.cs (Constraints): Completed error checking, use correct
7401         error numbers.
7402
7403 2004-03-29  Martin Baulig  <martin@ximian.com>
7404
7405         * delegate.cs (Delegate.VerifyMethod): Infer type arguments.
7406
7407         * expression.cs (Invocation.InferTypeArguments): Added overloaded
7408         public version which takes a `ParameterData pd' instead of an
7409         `ArrayList args'.
7410
7411 2004-03-29  Martin Baulig  <martin@ximian.com>
7412
7413         * typemanager.cs (TypeManager.IsGenericMethod): Take a MethodBase,
7414         not a MethodInfo.       
7415
7416 2004-03-29  Martin Baulig  <martin@ximian.com>
7417
7418         * expression.cs (Argument.ResolveMethodGroup): If we're a
7419         ConstructedType, call GetMemberAccess() on it.  
7420
7421 2004-03-29  Martin Baulig  <martin@ximian.com>
7422
7423         * class.cs (MethodBase.CheckGenericOverride): New abstract method.
7424         (MethodCore.CheckGenericOverride): When overriding a generic
7425         method, check whether the constraints match.
7426
7427         * support.cs (GenericConstraints): New public interface.
7428         (ParameterData.GenericConstraints): New public method.
7429
7430         * parameter.cs (Parameter.Resolve): Check whether we're a generic
7431         method parameter and compute our constraints if appropriate.
7432         (Parameter.GenericConstraints): New public property.
7433
7434         * generic.cs (Constraints): Implement GenericConstraints.
7435
7436 2004-03-29  Martin Baulig  <martin@ximian.com>
7437
7438         * decl.cs (MemberCache.FindMemberToOverride): Use
7439         `paramTypes [j].Equals (cmpAttrs [j])' instead of `=='.
7440
7441 2004-03-29  Martin Baulig  <martin@ximian.com>
7442
7443         * generic.cs (GenericMethod.Define): Resolve our type parameters.
7444
7445 2004-03-29  Martin Baulig  <martin@ximian.com>
7446
7447         * cs-parser.jay: Report CS0080 instead of -200 ("Constraints are
7448         not allowed on non-generic declarations").
7449
7450 2004-03-29  Martin Baulig  <martin@ximian.com>
7451
7452         * expression.cs (Invocation.InferTypeArguments): Added overloaded
7453         public version of this method.
7454
7455         * class.cs (MethodCore.IsDuplicateImplementation): Use
7456         Invocation.InferTypeArguments() to check this.
7457
7458 2004-03-29  Martin Baulig  <martin@ximian.com>
7459
7460         * convert.cs: Use TypeManager.IsDelegateType() instead of
7461         comparing types correctly.
7462
7463 2004-03-29  Martin Baulig  <martin@ximian.com>
7464
7465         * convert.cs: Use TypeManager.IsSubclassOf() instead of comparing
7466         types directly to make it work for generic instances.
7467
7468         * typemanager.cs (TypeManager.IsSubclassOf): New static method.
7469
7470 2004-03-29  Martin Baulig  <martin@ximian.com>
7471
7472         * typemanager.cs (TypeManager.MayBecomeEqualGenericTypes): Added
7473         support for arrays.     
7474
7475 2004-03-24  Martin Baulig  <martin@ximian.com>
7476
7477         * decl.cs (DeclSpace.FindType): Also use
7478         TypeManager.CheckGeneric() for types from the using clauses.
7479
7480 2004-03-23  Martin Baulig  <martin@ximian.com>
7481
7482         * expression.cs (Invocation.OverloadResolve): Added `bool
7483         may_fail' argument and use it instead of the Location.IsNull() hack.
7484
7485 2004-03-23  Martin Baulig  <martin@ximian.com>
7486
7487         * expression.cs (Invocation.InferType): Use correct type inference
7488         rules here.     
7489
7490 2004-03-23  Martin Baulig  <martin@ximian.com>
7491
7492         * ecore.cs (MethodGroupExpr.Name): Use
7493         TypeManager.CSharpSignature() instead of just the name.
7494
7495         * expression.cs (Invocation.OverloadResolve): Provide better error
7496         reporting.
7497         (Invocation.DoResolve): OverloadResolve() never returns null
7498         without reporting an error, so removed the error -6 reporting here.
7499
7500 2004-03-23  Martin Baulig  <martin@ximian.com>
7501
7502         * typemanager.cs (TypeManager.GetMethodFlags): Fixed the FIXME for
7503         generic methods.
7504
7505         * cs-parser.jay (delegate_declaration): Support generic delegates.
7506
7507         * delegate.cs: Support generic delegates.
7508
7509 2004-03-22  Martin Baulig  <martin@ximian.com>
7510
7511         * expression.cs (Invocation.InferParamsTypeArguments): New static
7512         method; does type inference for params arguments.
7513
7514 2004-03-21  Martin Baulig  <martin@ximian.com>
7515
7516         * typemanager.cs (TypeManager.IsGenericMethod): New public static
7517         method; checks whether a method is a generic method.    
7518
7519         * expression.cs (Invocation.InferTypeArguments): New static method;
7520         infer type arguments for generic method invocation.
7521
7522         * ecore.cs (MethodGroupExpr.HasTypeArguments): New public
7523         property; we set this to true if we're resolving a generic method
7524         invocation and the user specified type arguments, ie. we're not
7525         doing type inference.
7526
7527 2004-03-20  Martin Baulig  <martin@ximian.com>
7528
7529         * class.cs (MethodData.DeclaringType): New public property.
7530         (MethodData.Define): Set DeclaringType here.
7531         (Operator.Define): Use OperatorMethod.MethodData.DeclaringType
7532         instead of OperatorMethodBuilder.DeclaringType.
7533
7534 2004-03-20  Martin Baulig  <martin@ximian.com>
7535
7536         * cs-tokenizer.cs (xtoken): Return a special
7537         Token.DEFAULT_OPEN_PARENS for "`default' followed by open parens".
7538
7539         * cs-parser.jay (default_value_expression): Switch to the new
7540         syntax (14.5.13).
7541
7542 2004-03-19  Martin Baulig  <martin@ximian.com>
7543
7544         * decl.cs (MemberName): New class.  We use this to "construct"
7545         namespace_or_type_name's.
7546
7547         * generics.cs (TypeArguments.GetDeclarations): New public method;
7548         returns the type arguments as a string[] and reports a CS0081 if
7549         one of them is not an identifier.
7550
7551         * class.cs (MemberBase): The .ctor now takes the name as a
7552         MemberName instead of a string.
7553         (MemberBase.ExplicitInterfaceName): Changed type from string to
7554         Expression.
7555         (MemberBase.DoDefine): If we're an explicit implementation, the
7556         InterfaceType may be a generic instance.
7557
7558         * cs-parser.jay (namespace_or_type_name): Return a MemberName.
7559         (namespace_name): Call MemberName.GetName () to transform the
7560         MemberName into a string and ensure we don't have any type
7561         arguments.
7562         (type_name): Call MemberName.GetTypeExpression() to transfrom the
7563         MemberName into an expression.
7564         (method_header): Use namespace_or_type_name instead of member_name.     
7565
7566 2004-04-07  Miguel de Icaza  <miguel@ximian.com>
7567
7568         * rootcontext.cs: Add new types to the boot resolution.
7569
7570         * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
7571         MulticastDelegate is not allowed.
7572
7573         * typemanager.cs: Add new types to lookup: System.TypedReference
7574         and ArgIterator.
7575
7576         * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
7577         check for TypedReference or ArgIterator, they are not allowed. 
7578
7579         * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
7580         makes us properly catch 1510 in some conditions (see bug 56016 for
7581         details). 
7582
7583 2004-04-06  Bernie Solomon  <bernard@ugsolutions.com>
7584
7585         * CryptoConvert.cs: update from corlib version
7586         with endian fixes.
7587
7588 2004-04-05  Miguel de Icaza  <miguel@ximian.com>
7589
7590         * class.cs (Indexer.Define): Check indexername declaration
7591
7592 2004-04-05  Marek Safar  <marek.safar@seznam.cz>
7593
7594         * attribute.cs (IsClsCompliant): Fixed problem with handling
7595         all three states (compliant, not-compliant, undetected).
7596
7597 2004-03-30  Marek Safar  <marek.safar@seznam.cz>
7598
7599         * attribute.cs (Attribute): Location is now public.
7600         (Resolve): Store resolved arguments (pos_values) in attribute class.
7601         Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
7602         (GetClsCompliantAttributeValue): New method that gets
7603         CLSCompliantAttribute value.
7604         (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
7605         if exists else null.
7606         (AttributeTester): New class for CLS-Compliant verification routines.
7607
7608         * class.cs (Emit): Add CLS-Compliant verification.
7609         (Method.GetSignatureForError): Implemented.
7610         (Constructor.GetSignatureForError): Implemented
7611         (Constructor.HasCompliantArgs): Returns if constructor has
7612         CLS-Compliant arguments.
7613         (Constructor.Emit): Override.
7614         (Construcor.IsIdentifierClsCompliant): New method; For constructors
7615         is needed to test only parameters.
7616         (FieldBase.GetSignatureForError): Implemented.
7617         (TypeContainer): New member for storing base interfaces.
7618         (TypeContainer.FindMembers): Search in base interfaces too.
7619
7620         * codegen.cs (GetClsComplianceAttribute): New method that gets
7621         assembly or module CLSCompliantAttribute value.
7622         (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
7623         for assembly.
7624         (ModuleClass.Emit): Add error 3012 test.
7625
7626         * const.cs (Emit): Override and call base for CLS-Compliant tests.
7627
7628         * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
7629         state for all decl types.
7630         (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
7631         if CLS-Compliant tests are required.
7632         (IsClsCompliaceRequired): New method. Analyze whether code
7633         must be CLS-Compliant.
7634         (IsExposedFromAssembly): New method. Returns true when MemberCore
7635         is exposed from assembly.
7636         (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
7637         value or gets cached value.
7638         (HasClsCompliantAttribute): New method. Returns true if MemberCore
7639         is explicitly marked with CLSCompliantAttribute.
7640         (IsIdentifierClsCompliant): New abstract method. This method is
7641         used to testing error 3005.
7642         (IsIdentifierAndParamClsCompliant): New method. Common helper method
7643         for identifier and parameters CLS-Compliant testing.
7644         (VerifyClsCompliance): New method. The main virtual method for
7645         CLS-Compliant verifications.
7646         (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
7647         null. I don't know why is null (too many public members !).
7648         (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
7649         and get value of first CLSCompliantAttribute that found.
7650
7651         * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
7652         (VerifyClsCompliance): Override and add extra tests.
7653
7654         * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
7655         clscheck- disable CLS-Compliant verification event if assembly is has
7656         CLSCompliantAttribute(true).
7657
7658         * enum.cs (Emit): Override and call base for CLS-Compliant tests.
7659         ApllyAttribute is now called in emit section as in the other cases.
7660         Possible future Emit integration.
7661         (IsIdentifierClsCompliant): New override.
7662         (VerifyClsCompliance): New override.
7663         (GetEnumeratorName): Returns full enum name.
7664
7665         * parameter.cs (GetSignatureForError): Implemented.
7666
7667         * report.cs (WarningData): New struct for Warning message information.
7668         (LocationOfPreviousError): New method.
7669         (Warning): New method. Reports warning based on the warning table.
7670         (Error_T): New method. Reports error based on the error table.
7671
7672         * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
7673         verifications are done here.
7674
7675         * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
7676
7677         * typemanager.cs (cls_compliant_attribute_type): New member thath holds
7678         CLSCompliantAttribute.
7679         (all_imported_types): New member holds all imported types from other
7680         assemblies.
7681         (LoadAllImportedTypes): New method fills static table with exported types
7682         from all referenced assemblies.
7683         (Modules): New property returns all assembly modules.
7684
7685 2004-03-30  Miguel de Icaza  <miguel@ximian.com>
7686
7687         * cs-parser.jay: Add a rule to catch wrong event syntax instead of
7688         throwing a parser error.
7689
7690         * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
7691         which removes the hardcoded get_/set_ prefixes for properties, as
7692         IL allows for the properties to be named something else.  
7693
7694         Bug #56013
7695
7696         * expression.cs: Do not override operand before we know if it is
7697         non-null.  Fix 56207
7698
7699 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
7700
7701         * typemanager.cs: support for pinned variables.
7702
7703 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
7704
7705         * decl.cs, typemanager.cs: Avoid using an arraylist
7706         as a buffer if there is only one result set.
7707
7708 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
7709
7710         * expression.cs: Make sure you cant call a static method
7711         with an instance expression, bug #56174.
7712
7713 2004-03-29  Miguel de Icaza  <miguel@ximian.com>
7714
7715         * class.cs (IsDuplicateImplementation): Improve error reporting to
7716         flag 663 (method only differs in parameter modifier).
7717
7718         * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
7719         in preprocessor directives.
7720
7721         * location.cs (LookupFile): Allow for the empty path.
7722
7723         * attribute.cs (DefinePInvokeMethod): Fix 56148;  I would like a
7724         better approach for some of that patch, but its failing with the
7725         CharSet enumeration.  For now try/catch will do.
7726
7727         * typemanager.cs: Do not crash if a struct does not have fields.
7728         Fixes 56150.
7729
7730 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
7731
7732         * expression.cs: cs0213, cant fix a fixed expression.
7733         fixes 50231.
7734
7735 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
7736
7737         * cs-parser.jay: detect invalid embeded statements gracefully.
7738         bug #51113.
7739
7740 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
7741
7742         * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
7743         As a regex:
7744         s/
7745         the invocation type may not be a subclass of the tye of the item/
7746         The type of the item must be a subclass of the invocation item.
7747         /g
7748
7749         Fixes bug #50820.
7750
7751 2004-03-25  Sebastien Pouliot  <sebastien@ximian.com>
7752
7753         * attribute.cs: Added methods to get a string and a bool from an
7754         attribute. Required to information from AssemblyKeyFileAttribute,
7755         AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
7756         * codegen.cs: Modified AssemblyName creation to include support for
7757         strongnames. Catch additional exceptions to report them as CS1548.
7758         * compiler.csproj: Updated include CryptoConvert.cs.
7759         * compiler.csproj.user: Removed file - user specific configuration.
7760         * CryptoConvert.cs: New. A COPY of the class CryptoConvert from 
7761         Mono.Security assembly. The original class is maintained and tested in
7762         /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
7763         * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
7764         like CSC 8.0 (C# v2) supports.
7765         * Makefile: Added CryptoConvert.cs to mcs sources.
7766         * rootcontext.cs: Added new options for strongnames.
7767
7768 2004-03-24 Ben Maurer  <bmaurer@users.sourceforge.net>
7769
7770         * driver.cs: For --expect-error, report error code `2'
7771         if the program compiled with no errors, error code `1' if
7772         it compiled with an error other than the one expected.
7773
7774 2004-03-24  Sebastien Pouliot  <sebastien@ximian.com>
7775
7776         * compiler.csproj: Updated for Visual Studio .NET 2003.
7777         * compiler.csproj.user: Updated for Visual Studio .NET 2003.
7778         * compiler.sln: Updated for Visual Studio .NET 2003.
7779
7780 2004-03-24  Ravi Pratap M  <ravi@ximian.com>
7781
7782         * expression.cs: Fix bug #47234. We basically need to apply the
7783         rule that we prefer the conversion of null to a reference type
7784         when faced with a conversion to 'object' (csc behaviour).
7785
7786 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
7787
7788         * statement.cs: Shorter form for foreach, eliminates
7789         a local variable. r=Martin.
7790
7791 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
7792
7793         * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
7794         checks if we can use brtrue/brfalse to test for 0.
7795         * expression.cs: use the above in the test for using brtrue/brfalse.
7796         cleanup code a bit.
7797
7798 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
7799
7800         * expression.cs: Rewrite string concat stuff. Benefits:
7801
7802         - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
7803         - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
7804         rather than a concat chain.
7805
7806         * typemanager.cs: Add lookups for more concat overloads.
7807
7808 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
7809
7810         * expression.cs: Emit shorter il code for array init.
7811
7812         newarr
7813         dup
7814         // set 1
7815
7816         // set 2
7817
7818         newarr
7819         stloc.x
7820
7821         ldloc.x
7822         // set 1
7823
7824         ldloc.x
7825         // set 2
7826
7827 2004-03-22 Ben Maurer  <bmaurer@users.sourceforge.net>
7828
7829         * statement.cs: Before, two switch blocks would be merged if the
7830         total size of the blocks (end_item - begin_item + 1) was less than
7831         two times the combined sizes of the blocks.
7832
7833         Now, it will only merge if after the merge at least half of the
7834         slots are filled.
7835
7836         fixes 55885.
7837
7838 2004-03-20  Atsushi Enomoto  <atsushi@ximian.com>
7839
7840         * class.cs : csc build fix for GetMethods(). See bug #52503.
7841
7842 2004-03-20 Ben Maurer  <bmaurer@users.sourceforge.net>
7843
7844         * expression.cs: Make sure fp comparisons work with NaN.
7845         This fixes bug #54303. Mig approved this patch a long
7846         time ago, but we were not able to test b/c the runtime
7847         had a related bug.
7848
7849 2004-03-19  Miguel de Icaza  <miguel@ximian.com>
7850
7851         * ecore.cs (TypExpr.GetHashCode): implement this overload. 
7852
7853 2004-03-19  Martin Baulig  <martin@ximian.com>
7854
7855         * class.cs (MemberCore.IsDuplicateImplementation): Check whether
7856         two overloads may unify for some type parameter substitutions and
7857         report a CS0408 if appropriate.
7858
7859 2004-03-19  Martin Baulig  <martin@ximian.com>
7860
7861         * class.cs (MemberCore.IsDuplicateImplementation): Report the
7862         error here and not in our caller.
7863
7864 2004-03-19  Martin Baulig  <martin@ximian.com>
7865
7866         * interface.cs: Completely killed this file.
7867         (Interface): We're now a TypeContainer and live in class.cs.
7868
7869         * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
7870         argument; we're now also called for interfaces.
7871         (TypeContainer.DefineMembers): Allow this method being called
7872         multiple times.
7873         (TypeContainer.GetMethods): New public method; formerly known as
7874         Interface.GetMethod().  This is used by PendingImplementation.
7875         (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
7876         it's now private and non-static.
7877         (Interface): Moved this here; it's now implemented similar to
7878         Class and Struct.
7879         (Method, Property, Event, Indexer): Added `bool is_interface'
7880         argument to their .ctor's.
7881         (MemberBase.IsInterface): New public field.
7882
7883         * cs-parser.jay: Create normal Method, Property, Event, Indexer
7884         instances instead of InterfaceMethod, InterfaceProperty, etc.
7885         (opt_interface_base): Removed; we now use `opt_class_base' instead.
7886         (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
7887
7888 2004-03-19  Martin Baulig  <martin@ximian.com>
7889
7890         * class.cs (MethodCore.IsDuplicateImplementation): New private
7891         method which does the CS0111 checking.
7892         (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
7893         Use IsDuplicateImplementation().
7894
7895 2004-03-17 Ben Maurer  <bmaurer@users.sourceforge.net>
7896
7897         * decl.cs (FindMemberToOverride): New method to find the correct
7898         method or property to override in the base class.
7899         * class.cs
7900             - Make Method/Property use the above method to find the
7901               version in the base class.
7902             - Remove the InheritableMemberSignatureCompare as it is now
7903               dead code.
7904
7905         This patch makes large code bases much faster to compile, as it is
7906         O(n) rather than O(n^2) to do this validation.
7907
7908         Also, it fixes bug 52458 which is that nested classes are not
7909         taken into account when finding the base class member.
7910
7911         Reviewed/Approved by Martin.
7912
7913 2004-03-17  Martin Baulig  <martin@ximian.com>
7914
7915         * expression.cs (MemberAccess.DoResolve): Take the parent's number
7916         of type arguments into account; use the `real_num_type_args'
7917         approach like in DoResolveAsTypeStep().
7918
7919         * generic.cs (GenericMemberAccess.DoResolve): Make this work for
7920         nested types.
7921
7922 2004-03-17  Marek Safar  <marek.safar@seznam.cz>
7923
7924         * interface.cs: In all interface classes removed redundant
7925         member initialization.
7926
7927 2004-03-16  Martin Baulig  <martin@ximian.com>
7928
7929         * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
7930
7931 2004-03-15  Miguel de Icaza  <miguel@ximian.com>
7932
7933         * decl.cs (DefineTypeAndParents): New helper method to define a
7934         type's containers before the type itself is defined;  This is a
7935         bug exposed by the recent changes to Windows.Forms when an
7936         implemented interface was defined inside a class that had not been
7937         built yet.   
7938
7939         * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
7940
7941         (Check): Loop correctly to report errors modifiers
7942         (UNSAFE was not in the loop, since it was the same as TOP).
7943
7944         * interface.cs: Every interface member now takes a ModFlags,
7945         instead of a "is_new" bool, which we set on the base MemberCore. 
7946
7947         Every place where we called "UnsafeOk" in the interface, now we
7948         call the proper member (InterfaceMethod.UnsafeOK) instead to get
7949         the unsafe settings from the member declaration instead of the
7950         container interface. 
7951
7952         * cs-parser.jay (opt_new): Allow unsafe here per the spec. 
7953
7954         * pending.cs (TypeAndMethods): Add `get_indexer_name' and
7955         `set_indexer_name' to the pending bits (one per type).
7956
7957         We fixed a bug today that was picking the wrong method to
7958         override, since for properties the existing InterfaceMethod code
7959         basically ignored the method name.  Now we make sure that the
7960         method name is one of the valid indexer names.
7961
7962 2004-03-14  Gustavo Giráldez  <gustavo.giraldez@gmx.net>
7963  
7964         * support.cs (SeekableStreamReader): Keep track of stream byte
7965         positions and don't mix them with character offsets to the buffer.
7966
7967         Patch from Gustavo Giráldez
7968
7969 2004-03-15  Marek Safar  <marek.safar@seznam.cz>
7970
7971         * interface.cs (InterfaceSetGetBase): Removed double member
7972         initialization, base class does it as well.
7973
7974 2004-03-13  Martin Baulig  <martin@ximian.com>
7975
7976         * class.cs: Reverted Miguel's latest commit; it makes mcs crash
7977         when compiling corlib.
7978
7979 2004-03-13  Miguel de Icaza  <miguel@ximian.com>
7980
7981         * convert.cs (ExplicitConversion): We were reporting an error on
7982         certain conversions (object_type source to a value type, when the
7983         expression was `null') before we had a chance to pass it through
7984         the user defined conversions.
7985
7986         * driver.cs: Replace / and \ in resource specifications to dots.
7987         Fixes 50752
7988
7989         * class.cs: Add check for duplicate operators.  Fixes 52477
7990
7991 2004-03-11  Miguel de Icaza  <miguel@ximian.com>
7992
7993         * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
7994         that are in the middle of the statements, not only at the end.
7995         Fixes #54987
7996
7997         * class.cs (TypeContainer.AddField): No longer set the
7998         `HaveStaticConstructor' flag, now we call it
7999         `UserDefineStaticConstructor' to diferentiate the slightly
8000         semantic difference.
8001
8002         The situation is that we were not adding BeforeFieldInit (from
8003         Modifiers.TypeAttr) to classes that could have it.
8004         BeforeFieldInit should be set to classes that have no static
8005         constructor. 
8006
8007         See:
8008
8009         http://www.yoda.arachsys.com/csharp/beforefieldinit.html
8010
8011         And most importantly Zoltan's comment:
8012
8013         http://bugzilla.ximian.com/show_bug.cgi?id=44229
8014
8015         "I think beforefieldinit means 'it's ok to initialize the type sometime 
8016          before its static fields are used', i.e. initialization does not need
8017          to be triggered by the first access to the type. Setting this flag
8018          helps the JIT to compile better code, since it can run the static
8019          constructor at JIT time, and does not need to generate code to call it
8020          (possibly lots of times) at runtime. Unfortunately, mcs does not set
8021          this flag for lots of classes like String. 
8022          
8023          csc sets this flag if the type does not have an explicit static 
8024          constructor. The reasoning seems to be that if there are only static
8025          initalizers for a type, and no static constructor, then the programmer
8026          does not care when this initialization happens, so beforefieldinit
8027          can be used.
8028          
8029          This bug prevents the AOT compiler from being usable, since it 
8030          generates so many calls to mono_runtime_class_init that the AOT code
8031          is much slower than the JITted code. The JITted code is faster, 
8032          because it does not generate these calls if the vtable is type is
8033          already initialized, which is true in the majority of cases. But the
8034          AOT compiler can't do this."
8035
8036 2004-03-10  Miguel de Icaza  <miguel@ximian.com>
8037
8038         * class.cs (MethodData.Emit): Refactor the code so symbolic
8039         information is generated for destructors;  For some reasons we
8040         were taking a code path that did not generate symbolic information
8041         before. 
8042
8043 2004-03-11 Ben Maurer  <bmaurer@users.sourceforge.net>
8044
8045         * class.cs: Create a Constructor.CheckBase method that
8046         takes care of all validation type code. The method
8047         contains some code that was moved from Define.
8048
8049         It also includes new code that checks for duplicate ctors.
8050         This fixes bug #55148.
8051
8052 2004-03-09  Joshua Tauberer <tauberer@for.net>
8053
8054         * expression.cs (ArrayCreation): Fix: More than 6 nulls in
8055         a { ... }-style array creation invokes EmitStaticInitializers
8056         which is not good for reference-type arrays.  String, decimal
8057         and now null constants (NullCast) are not counted toward
8058         static initializers.
8059
8060 2004-03-05  Martin Baulig  <martin@ximian.com>
8061
8062         * location.cs (SourceFile.HasLineDirective): New public field;
8063         specifies whether the file contains or is referenced by a "#line"
8064         directive.
8065         (Location.DefineSymbolDocuments): Ignore source files which
8066         either contain or are referenced by a "#line" directive.        
8067
8068 2004-02-29  Ben Maurer <bmaurer@users.sourceforge.net>
8069
8070         * class.cs (Method.CheckBase): Avoid using FindMembers, we have
8071         direct access to our parent, so check the method inline there.
8072
8073 2004-02-27 Ben Maurer  <bmaurer@users.sourceforge.net>
8074
8075         * expression.cs (Invocation.EmitCall): Miguel's last commit
8076         caused a regression. If you had:
8077
8078             T t = null;
8079             t.Foo ();
8080
8081         In Foo the implict this would be null.
8082
8083 2004-02-27  Miguel de Icaza  <miguel@ximian.com>
8084
8085         * expression.cs (Invocation.EmitCall): If the method is not
8086         virtual, do not emit a CallVirt to it, use Call.
8087
8088         * typemanager.cs (GetFullNameSignature): Improve the method to
8089         cope with ".ctor" and replace it with the type name.
8090
8091         * class.cs (ConstructorInitializer.Resolve): Now the method takes
8092         as an argument the ConstructorBuilder where it is being defined,
8093         to catch the recursive constructor invocations.
8094
8095 2004-03-16  Martin Baulig  <martin@ximian.com>
8096
8097         * expression.cs (MemberAccess.DoResolve): If `expr' resolved to a
8098         ConstructedType, call ResolveType() on it to get the type rather
8099         than just using `expr.Type'.
8100
8101 2004-03-16  Martin Baulig  <martin@ximian.com>
8102
8103         * generics.cs (ConstructedType.GetMemberAccess): Take the
8104         EmitContext instead on the TypeExpr and use
8105         ec.TypeContainer.CurrentType/ec.ContainerType.
8106
8107 2004-03-16  Martin Baulig  <martin@ximian.com>
8108
8109         * ecore.cs (SimpleName.DoResolveAsTypeStep): Lookup type
8110         parameters before aliases.
8111
8112 2004-03-16  Martin Baulig  <martin@ximian.com>
8113
8114         * typemanager.cs (TypeManager.MayBecomeEqualGenericInstances):
8115         New oublic function; checks whether two generic instances may become
8116         equal under some instantiations (26.3.1).
8117
8118         * class.cs (TypeContainer.Define): Call
8119         TypeManager.MayBecomeEqualGenericInstances() and report CS0695 on
8120         error.
8121
8122 2004-03-16  Martin Baulig  <martin@ximian.com>
8123
8124         * class.cs (TypeContainer.GetClassBases): Moved
8125         Error_TypeParameterAsBase() here and also check whether the base
8126         class is not an attribute.
8127
8128 2004-03-16  Martin Baulig  <martin@ximian.com>
8129
8130         * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
8131
8132 2004-03-16  Martin Baulig  <martin@ximian.com>
8133
8134         * class.cs (Error_TypeParameterAsBase): Use correct error number
8135         here (CS0689).  
8136
8137 2004-03-16  Martin Baulig  <martin@ximian.com>
8138
8139         * decl.cs (DeclSpace.ResolveTypeExpr): Added more error checking
8140         for generics.
8141
8142         * generics.cs (ConstructedType.DoResolveAsTypeStep): Added better
8143         error reporting.
8144
8145 2004-03-15  Martin Baulig  <martin@ximian.com>
8146
8147         * typemanager.cs (TypeManager.GetFullName): New public method.
8148         (TypeManager.MemberLookup): Added `int_num_type_arguments'
8149         argument; only return members with the correct number of type
8150         arguments.
8151         (TypeManager.CheckGeneric): Allow -1 to bypass the check.
8152         (TypeManager.FilterWithClosure): Call CheckGeneric() to check
8153         whether the number of type arguments matches.
8154
8155         * generic.cs (GenericMemberAccess.ResolveAsTypeStep): Allow `expr'
8156         not being a ConstructedType; we can now do "typeof (Foo.Bar<U>)".
8157
8158         * expression.cs (MemberAccess): Added public `NumTypeArguments'
8159         field; it's set by the protected .ctor when we're actually a
8160         GenericMemberAccess.
8161         (MemberAccess.ResolveAsTypeStep): Compute the total number of type
8162         arguments and pass it to MemberLookupFinal ().
8163
8164         * ecore.cs (Expression.MemberLookup): Added `int
8165         num_type_arguments' argument; only return members with the correct
8166         number of type arguments.
8167         (Expression.MemberLookupFailed): Check whether the MemberLookup
8168         failed because we did not have the correct number of type
8169         arguments; report CS0305 in this case.
8170
8171         * decl.cs (DeclSpace.ResolveTypeExpr): Don't report an error if
8172         `e.ResolveAsTypeTerminal()' already did so.
8173
8174 2004-03-15  Martin Baulig  <martin@ximian.com>
8175
8176         * ecore.cs (Expression.ResolveLValue): Allow e.type being null if
8177         we're a ConstructedType; in this case, the caller must report an
8178         error (for instance CS0131).
8179
8180         * generic.cs (TypeArguments): Added Location argument to the .ctor.
8181         (TypeArguments.Resolve): Actually report errors here.
8182
8183 2004-03-15  Miguel de Icaza  <miguel@ximian.com>
8184
8185         * pending.cs (TypeAndMethods): Add `get_indexer_name' and
8186         `set_indexer_name' to the pending bits (one per type).
8187
8188         We fixed a bug today that was picking the wrong method to
8189         override, since for properties the existing InterfaceMethod code
8190         basically ignored the method name.  Now we make sure that the
8191         method name is one of the valid indexer names.
8192
8193 2004-03-15  Martin Baulig  <martin@ximian.com>
8194
8195         * typemanager.cs (TypeManager.IndexerPropertyName): Added support
8196         for generic instances.
8197
8198 2004-03-13  Martin Baulig  <martin@ximian.com>
8199
8200         * class.cs (TypeContainer.DefineType): Call
8201         TypeManager.AddUserType() immediately after creating the
8202         TypeBuilder; pass all type parameters when creating the
8203         CurrentType.
8204
8205         * decl.cs (DeclSpace.FindNestedType): New public method.
8206         (DeclSpace.FindType): Added `int num_type_args' argument; only
8207         return types with the correct number of type parameters.
8208         (DeclSpace.CountTypeParams): New public property.
8209
8210         * ecore.cs (SimpleName.ctor): Added overloaded version which takes
8211         the number of type parameters; defaults to zero.
8212
8213         * generic.cs (TypeArguments.Count): New public property.
8214         (ConstructedType.DoResolveAsTypeStep): First call
8215         ds.FindNestedType() to find out whether we're nested in the
8216         current generic type; in this case, we inherit all type parameters
8217         from the current class.
8218
8219         * rootcontext.cs (RootContext.NamespaceLookup): Added `int
8220         num_type_args' argument.
8221         (RootContext.LookupType): Added overloaded version which takes the
8222         number of type arguments; only return types with the correct
8223         number of type arguments.
8224
8225         * typemanager.cs (TypeManager.CheckGeneric): New public function;
8226         checks whether `Type t' has `int num_type_args'.
8227
8228 2004-03-13  Martin Baulig  <martin@ximian.com>
8229
8230         * generic.cs (GenericMethod.DefineType): New method; calls
8231         DefineType() on all the type parameters.
8232
8233         * class.cs (MethodData.ctor): Added `GenericMethod generic' argument.
8234         (MethodData.Define): If we're a generic method, call
8235         GenericMethod.DefineType() to define the type parameters.       
8236
8237 2004-03-10  Martin Baulig  <martin@ximian.com>
8238
8239         * pending.cs (Pending.InterfaceMethod): Use TypeManager.IsEqual()
8240         instead of IsAssignableFrom.    
8241
8242 2004-03-10  Martin Baulig  <martin@ximian.com>
8243
8244         * ecore.cs (FieldExpr.ctor): Use TypeManager.TypeToCoreType().
8245
8246         * support.cs (ParameterData.HasArrayParameter): New property.
8247         (ReflectionParameters.ctor): Take a MethodBase instead of a
8248         ParameterInfo[].  If we have any type parameters, get the generic
8249         method definition and ask it whether we have variable arguments.
8250
8251 2004-02-26  Miguel de Icaza  <miguel@ximian.com>
8252
8253         * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
8254         routines to check if a type is an enumerable/enumerator allow
8255         classes that implement the IEnumerable or IEnumerator interfaces.
8256
8257         * class.cs (Property, Operator): Implement IIteratorContainer, and
8258         implement SetYields.
8259
8260         (Property.Define): Do the block swapping for get_methods in the
8261         context of iterators.   We need to check if Properties also
8262         include indexers or not.
8263
8264         (Operator): Assign the Block before invoking the
8265         OperatorMethod.Define, so we can trigger the Iterator code
8266         replacement. 
8267
8268         * cs-parser.jay (SimpleIteratorContainer): new helper class.  Both
8269         Property and Operator classes are not created when we parse the
8270         declarator but until we have the block completed, so we use a
8271         singleton SimpleIteratorContainer.Simple to flag whether the
8272         SetYields has been invoked.
8273
8274         We propagate this setting then to the Property or the Operator to
8275         allow the `yield' to function.
8276
8277 2004-02-25  Marek Safar  <marek.safar@seznam.cz>
8278
8279         * codegen.cs: Implemented attribute support for modules.
8280         New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
8281         Assembly/Module functionality.
8282
8283         * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
8284         interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
8285         Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
8286
8287 2004-02-16  Marek Safar  <marek.safar@seznam.cz>
8288
8289         * interface.cs (FindMembers): The operation is performed on all base
8290         interfaces and not only on the first. It is required for future CLS Compliance patch.
8291
8292 2004-02-12 Ben Maurer  <bmaurer@users.sourceforge.net>
8293
8294         * statement.cs, codegen.cs:
8295         This patch deals with patterns such as:
8296
8297         public class List : IEnumerable {
8298
8299                 public MyEnumerator GetEnumerator () {
8300                         return new MyEnumerator(this);
8301                 }
8302
8303                 IEnumerator IEnumerable.GetEnumerator () {
8304                         ...
8305                 }
8306                 
8307                 public struct MyEnumerator : IEnumerator {
8308                         ...
8309                 }
8310         }
8311
8312         Before, there were a few things we did wrong:
8313         1) we would emit callvirt on a struct, which is illegal
8314         2) we emited ldarg when we needed to emit ldarga
8315         3) we would mistakenly call the interface methods on an enumerator
8316         type that derived from IEnumerator and was in another assembly. For example:
8317
8318         public class MyEnumerator : IEnumerator
8319
8320         Would have the interface methods called, even if there were public impls of the
8321         method. In a struct, this lead to invalid IL code.
8322
8323 2004-02-11  Marek Safar  <marek.safar@seznam.cz>
8324
8325         * const.cs: Const is now derived from FieldBase. Method EmitConstant name
8326           renamed to Emit.
8327
8328         * delegate.cs (Define): Fixed crash when delegate type is undefined.
8329
8330 2004-02-11  Miguel de Icaza  <miguel@ximian.com>
8331
8332         * cs-parser.jay: Fix small regression: we were not testing V2
8333         compiler features correctly.
8334
8335         * interface.cs: If the emit context is null, then create one
8336
8337 2004-02-09  Marek Safar  <marek.safar@seznam.cz>
8338
8339         * decl.cs (GetSignatureForError): New virtual method to get full name
8340           for error messages.
8341
8342         * attribute.cs (IAttributeSupport): New interface for attribute setting.
8343           Now it is possible to rewrite ApplyAttributes method to be less if/else.
8344
8345         * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
8346           Duplicated members and code in these classes has been removed.
8347           Better encapsulation in these classes.
8348
8349 2004-02-07  Miguel de Icaza  <miguel@ximian.com>
8350
8351         * assign.cs (Assign.DoResolve): When dealing with compound
8352         assignments, there is a new rule in ECMA C# 2.4 (might have been
8353         there before, but it is documented here) that states that in:
8354
8355         a op= b;
8356
8357         If b is of type int, and the `op' is a shift-operator, then the
8358         above is evaluated as:
8359
8360         a = (int) a op b 
8361
8362         * expression.cs (Binary.ResolveOperator): Instead of testing for
8363         int/uint/long/ulong, try to implicitly convert to any of those
8364         types and use that in pointer arithmetic.
8365
8366         * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
8367         method to print information for from the type, not from the
8368         null-method we were given.
8369
8370 2004-02-01  Duncan Mak  <duncan@ximian.com>
8371
8372         * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
8373         parsing for cmd, fixes bug #53694.
8374
8375 2004-02-04  Marek Safar  <marek.safar@seznam.cz>
8376
8377         * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
8378         in the member name duplication tests. Property and operator name duplication
8379         was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
8380
8381 2004-02-03  Marek Safar  <marek.safar@seznam.cz>
8382
8383         * interface.cs (PopulateMethod): Fixed crash when interface method
8384         returns not existing type (error test cs0246-3.cs).
8385
8386 2004-02-02  Ravi Pratap M <ravi@ximian.com>
8387
8388         * cs-parser.jay (interface_accessors): Re-write actions to also
8389         store attributes attached to get and set methods. Fix spelling
8390         while at it.
8391
8392         (inteface_property_declaration): Modify accordingly.
8393
8394         (InterfaceAccessorInfo): New helper class to store information to pass
8395         around between rules that use interface_accessors.
8396
8397         * interface.cs (Emit): Apply attributes on the get and set
8398         accessors of properties and indexers too.
8399
8400         * attribute.cs (ApplyAttributes): Modify accordingly to use the
8401         right MethodBuilder when applying attributes to the get and set accessors.
8402
8403 2004-01-31  Miguel de Icaza  <miguel@ximian.com>
8404
8405         * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
8406
8407 2004-01-26  Miguel de Icaza  <miguel@ximian.com>
8408
8409         * cs-tokenizer.cs: Handle #line hidden from PDC bits.
8410
8411 2004-01-25  Miguel de Icaza  <miguel@ximian.com>
8412
8413         * cs-parser.jay: Remove YIELD token, instead use the new grammar
8414         changes that treat `yield' specially when present before `break'
8415         or `return' tokens.
8416
8417         * cs-tokenizer.cs: yield is no longer a keyword.
8418
8419 2004-01-23  Marek Safar  <marek.safar@seznam.cz>
8420
8421         * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
8422         setting for default constructors.
8423         For default constructors are almost every time set wrong Modifier. The
8424         generated IL code has been alright. But inside mcs this values was
8425         wrong and this was reason why several of my CLS Compliance tests
8426         failed.
8427
8428 2004-02-27  Martin Baulig  <martin@ximian.com>
8429
8430         * generics.cs (ConstructedType.ResolveType): Make the nested type
8431         stuff actually work.
8432
8433 2004-02-25  Martin Baulig  <martin@ximian.com>
8434
8435         * decl.cs (DeclSpace.CurrentTypeParameters): New protected
8436         property; returns the type parameters just from the current type,
8437         ie. with the ones from outer classes.
8438         (DeclSpace.LookupGeneric): First search in the current class, then
8439         in outer classes.
8440         (DeclSpace.initialize_type_params): When hiding a type parameter
8441         from an outer class, put it into the `type_param_list' anyways.
8442
8443         * expression.cs (MemberAccess.expr): Made this field protected.
8444
8445         * class.cs (TypeContainer.Define): The `CurrentType' just contains
8446         the type parameters from the current class.
8447
8448         * generic.cs (ConstructedType.ResolveType): Support nested generic
8449         types by taking the type parameters which we inherit from outer
8450         classes into account.
8451         (GenericMemberAccess.ResolveAsTypeStep): Override this and added
8452         support for nested generic types.
8453
8454 2004-02-23  Martin Baulig  <martin@ximian.com>
8455
8456         * decl.cs (DeclSpace.IsGeneric): Make this a property instead of a
8457         field and check whether we're nested inside a generic type.
8458         (DeclSpace.ResolveType): If we're resolving to a generic type
8459         definition, create a ConstructedType and return its resolved type.
8460         (DeclSpace.initialize_type_params): New private method;
8461         initializes the `type_param_list' field from the type parameters
8462         from this and all enclosing classes.
8463         (DeclSpace.TypeParameters): Call initialize_type_params() unless
8464         we're already initialized.
8465
8466 2004-02-23  Martin Baulig  <martin@ximian.com>
8467
8468         * class.cs (Method.Define): Create the generic method before
8469         calling DoDefine().
8470         (Memberbase.DoDefine): Added DeclSpace argument (in addition to
8471         the TypeContainer one); we use this for generic methods.
8472
8473         * decl.cs (CheckAccessLevel): If we're a GenericMethod, use our
8474         parent's TypeBuilder.
8475
8476 2004-02-18  Martin Baulig  <martin@ximian.com>
8477
8478         * ecore.cs (FieldExpr.DoResolveLValue): Use TypeManager.IsEqual()
8479         to check for equality.
8480
8481 2004-02-05  Martin Baulig  <martin@ximian.com>
8482
8483         * ecore.cs (FieldExpr.DoResolveLValue): If we have an
8484         `ec.TypeContainer.CurrentType', use it instead of
8485         `ec.ContainerType' to check whether we're in the type's ctor.
8486
8487 2004-01-29  Martin Baulig  <martin@ximian.com>
8488
8489         * expression.cs (Invocation.DoResolve): If we're a
8490         `ConstructedType', then we're actually a generic method, so
8491         rewrite the expr as a GenericMemberAccess.
8492
8493         * cs-parser.jay (member_name): Don't use `namespace_or_type_name'
8494         here; manually parse it into a string.
8495
8496 2004-01-28  Martin Baulig  <martin@ximian.com>
8497
8498         * typemanager.cs (TypeManager.IsEqual): New static method.
8499         (TypeManager.FilterWithClosure): Call TypeManager.IsEqual() to
8500         check for equality instead of using `=='.
8501
8502 2004-01-26  Martin Baulig  <martin@ximian.com>
8503
8504         * decl.cs (DeclSpace.CurrentType): New public field.
8505
8506         * expression.cs (This.ResolveBase): If we have an
8507         `ec.TypeContainer.CurrentType', use it instead of
8508         `ec.ContainerType'.
8509
8510         * class.cs (TypeContainer.DefineType): If we're a generic type,
8511         create the `CurrentType' (unresolved).
8512         (TypeContainer.GenericType): New private field.
8513         (TypeContainer.DefineMembers): If we have a `CurrentType', resolve
8514         it and store it in `GenericType' before creating the MemberCache.
8515         (TypeContainer.GetMembers): If we have a `GenericType', call
8516         TypeManager.FindMembers() on it.
8517
8518         * interface.cs (Interface.GenericType): New private field.
8519         (Interface.DefineType): If we're a generic type, create the
8520         `CurrentType' (unresolved).
8521         (Interface.DefineMembers): If we have a `CurrentType', resolve it
8522         and store it in `GenericType' before creating the MemberCache.
8523         (Interface.GetMembers): If we have a `GenericType', call
8524         TypeManager.FindMembers() on it.
8525
8526 2004-01-22  Martin Baulig  <martin@ximian.com>
8527
8528         * cs-parser.jay (namespace_or_type_name): Return an Expression,
8529         not a QualifiedIdentifier.  This is what `type_name_expression'
8530         was previously doing.
8531         (type_name_expression): Removed; the code is now in
8532         `namespace_or_type_name'.
8533         (qualified_identifier): Removed, use `namespace_or_type_name'
8534         instead.
8535         (QualifiedIdentifier): Removed this class.      
8536
8537 2004-01-22  Martin Baulig  <martin@ximian.com>
8538
8539         * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
8540         not a string as alias name.
8541
8542 2004-01-21  Miguel de Icaza  <miguel@ximian.com>
8543
8544         * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
8545         #52730 bug, and instead compute correctly the need to use a
8546         temporary variable when requesting an address based on the
8547         static/instace modified of the field and the constructor.
8548  
8549 2004-01-21  Martin Baulig  <martin@ximian.com>
8550
8551         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
8552         class and namespace before looking up aliases.  Fixes #52517.
8553
8554 2004-01-21  Martin Baulig  <martin@ximian.com>
8555
8556         * flowanalysis.cs (UsageVector.Merge): Allow variables being
8557         assinged in a 'try'; fixes exception4.cs.
8558
8559 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
8560         * class.cs : Implemented parameter-less constructor for TypeContainer
8561
8562         * decl.cs: Attributes are now stored here. New property OptAttributes
8563
8564         * delegate.cs, enum.cs, interface.cs: Removed attribute member.
8565
8566         * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
8567
8568 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
8569
8570         * typemanager.cs (CSharpSignature): Now reports also inner class name.
8571           (CSharpSignature): New method for indexer and property signature.
8572
8573 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
8574
8575         * pending.cs (IsVirtualFilter): Faster implementation.
8576
8577 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
8578
8579         * typemanager.cs: Avoid inclusion of same assembly more than once.
8580
8581 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
8582
8583         * cs-parser.jay: Fixed problem where the last assembly attribute
8584           has been applied also to following declaration (class, struct, etc.)
8585           
8586 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
8587
8588         * class.cs: Added error CS0538, CS0539 reporting.
8589         Fixed crash on Microsoft runtime when field type is void.
8590
8591         * cs-parser.jay: Added error CS0537 reporting.
8592
8593         * pending.cs: Added error CS0535 reporting.
8594         Improved error report for errors CS0536, CS0534.
8595
8596 2004-01-20  Miguel de Icaza  <miguel@ximian.com>
8597
8598         Merge a few bits from the Anonymous Method MCS tree.
8599
8600         * statement.cs (ToplevelBlock): New class for toplevel methods,
8601         will hold anonymous methods, lifted variables.
8602
8603         * cs-parser.jay: Create toplevel blocks for delegates and for
8604         regular blocks of code. 
8605
8606 2004-01-20  Martin Baulig  <martin@ximian.com>
8607
8608         * codegen.cs (EmitContext): Removed `InTry', `InCatch',
8609         `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
8610         and `NeedExplicitReturn'; added `IsLastStatement'.
8611         (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
8612         have a `ReturnLabel' or we're not unreachable.
8613
8614         * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
8615         child's reachability; don't just override ours with it.  Fixes
8616         #58058 (lluis's example).
8617         (FlowBranching): Added public InTryOrCatch(), InCatch(),
8618         InFinally(), InLoop(), InSwitch() and
8619         BreakCrossesTryCatchBoundary() methods.
8620
8621         * statement.cs (Return): Do all error checking in Resolve().
8622         Unless we are the last statement in a top-level block, always
8623         create a return label and jump to it.
8624         (Break, Continue): Do all error checking in Resolve(); also make
8625         sure we aren't leaving a `finally'.
8626         (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
8627         statement in a top-level block.
8628         (Block.Flags): Added `IsDestructor'.
8629         (Block.IsDestructor): New public property.
8630
8631 2004-01-20  Martin Baulig  <martin@ximian.com>
8632
8633         * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
8634
8635 2004-01-20  Martin Baulig  <martin@ximian.com>
8636
8637         * statement.cs (Statement.ResolveUnreachable): New public method.
8638         (If, While): Do the dead-code elimination in Resolve(), not in Emit().
8639         (Block.Resolve): Resolve unreachable statements.
8640
8641 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
8642
8643         * expression.cs: We need to fix the case where we do
8644         not have a temp variable here.
8645
8646         * assign.cs: Only expression compound assignments need
8647         temporary variables.
8648
8649 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
8650
8651         * flowanalysis.cs: Reduce memory allocation in a few ways:
8652           - A block with no variables should not allocate a bit
8653             vector for itself.
8654           - A method with no out parameters does not need any tracking
8655             for assignment of the parameters, so we need not allocate
8656             any data for it.
8657           - The arrays:
8658                 public readonly Type[] VariableTypes;
8659                 public readonly string[] VariableNames;
8660             Are redundant. The data is already stored in the variable
8661             map, so we need not allocate another array for it.
8662           - We need to add alot of checks for if (params | locals) == null
8663             due to the first two changes.
8664
8665 2004-01-18  Miguel de Icaza  <miguel@ximian.com>
8666
8667         * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
8668         implement IMemoryLocation, we store a copy on a local variable and
8669         take the address of it.  Patch from Benjamin Jemlich
8670
8671         * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
8672         to use a special "type_name_expression" rule which reduces the
8673         number of "QualifiedIdentifier" classes created, and instead
8674         directly creates MemberAccess expressions.
8675
8676 2004-01-17  Miguel de Icaza  <miguel@ximian.com>
8677
8678         * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
8679         that fixes #52853.  Null literal assignment to ValueType
8680
8681         * class.cs (MethodData.Emit): Instead of checking the name of the
8682         method to determine if its a destructor, create a new derived
8683         class from Method called Destructor, and test for that.  
8684
8685         * cs-parser.jay: Create a Destructor object instead of a Method.  
8686
8687         Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
8688
8689         Fixes: 52933
8690
8691 2004-01-16  Miguel de Icaza  <miguel@ximian.com>
8692
8693         * expression.cs (Binary.ResolveOperator): Perform an implicit
8694         conversion from MethodGroups to their delegate types on the
8695         Addition operation.
8696
8697         * delegate.cs: Introduce a new class DelegateCreation that is the
8698         base class for `NewDelegate' and `ImplicitDelegateCreation',
8699         factor some code in here.
8700
8701         * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
8702         conversion from MethodGroups to compatible delegate types. 
8703
8704         * ecore.cs (Expression.Resolve): Do not flag error 654
8705         (Methodgroupd needs parenthesis) if running on the V2 compiler, as
8706         we allow conversions from MethodGroups to delegate types now.
8707
8708         * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
8709         assignments in v2 either.
8710
8711 2004-01-10  Miguel de Icaza  <miguel@ximian.com>
8712
8713         * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
8714         static read-only fields in ctors.
8715
8716         Applied patch from Benjamin Jemlich 
8717
8718         * expression.cs (UnaryMutator): Avoid leaking local variables. 
8719
8720 2004-01-09  Miguel de Icaza  <miguel@ximian.com>
8721
8722         * cs-tokenizer.cs (IsCastToken): Allow the various native types
8723         here to return true, as they can be used like this:
8724
8725                 (XXX) int.MEMBER ()
8726
8727         Fixed 49836 and all the other dups
8728
8729 2004-01-09  Zoltan Varga  <vargaz@freemail.hu>
8730
8731         * driver.cs: Implement /win32res and /win32icon.
8732
8733 2004-01-08  Miguel de Icaza  <miguel@ximian.com>
8734
8735         * cs-parser.jay: Add a rule to improve error handling for the
8736         common mistake of placing modifiers after the type.
8737
8738 2004-01-07  Miguel de Icaza  <miguel@ximian.com>
8739
8740         * cs-parser.jay (interface_event_declaration): Catch
8741         initialization of events on interfaces, and report cs0068
8742
8743         * cs-parser.jay (interface_event_declaration): Catch
8744         initialization of events. 
8745
8746         * ecore.cs: Better report missing constructors.
8747
8748         * expression.cs (Binary.ResolveOperator): My previous bug fix had
8749         the error reporting done in the wrong place.  Fix.
8750
8751         * expression.cs (Binary.ResolveOperator): Catch the 
8752         operator + (E x, E y) error earlier, and later allow for implicit
8753         conversions in operator +/- (E e, U x) from U to the underlying
8754         type of E.
8755
8756         * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
8757         52596, if the container class is abstract, the default constructor
8758         is protected otherwise its public (before, we were always public).
8759
8760         * statement.cs (Fixed.Resolve): Catch a couple more errors in the
8761         fixed statement.
8762
8763         (Using.EmitLocalVariableDecls): Applied patch from Benjamin
8764         Jemlich that fixes bug #52597, MCS was generating invalid code for
8765         idisposable structs.   Thanks to Ben for following up with this
8766         bug as well.
8767
8768 2004-01-06  Miguel de Icaza  <miguel@ximian.com>
8769
8770         * driver.cs: Allow assemblies without code to be generated, fixes
8771         52230.
8772
8773 2004-01-07  Nick Drochak <ndrochak@gol.com>
8774
8775         * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
8776
8777 2004-01-05  Miguel de Icaza  <miguel@ximian.com>
8778
8779         * cs-parser.jay: Add rules to improve error reporting if fields or
8780         methods are declared at the namespace level (error 116)
8781
8782         * Add rules to catch event add/remove
8783
8784 2004-01-04  David Sheldon <dave-mono@earth.li>
8785
8786   * expression.cs: Added matching ")" to error message for 
8787   CS0077
8788
8789 2004-01-03 Todd Berman <tberman@gentoo.org>
8790
8791         * ecore.cs, attribute.cs:
8792         Applying fix from #52429.
8793
8794 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
8795
8796         * ecore.cs, expression.cs, statement.cs:
8797         Total rewrite of how we handle branching. We
8798         now handle complex boolean expressions with fewer
8799         jumps. As well if (x == 0) no longer emits a ceq.
8800
8801         if (x is Foo) is much faster now, because we generate
8802         better code.
8803
8804         Overall, we get a pretty big improvement on our benchmark
8805         tests. The code we generate is smaller and more readable.
8806
8807         I did a full two-stage bootstrap. The patch was reviewed
8808         by Martin and Miguel.
8809
8810 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
8811
8812         * cs-parser.jay: Make primary_expression not take a QI.
8813         we dont need this because the member_access rule covers
8814         us here. So we replace the rule with just IDENTIFIER.
8815
8816         This has two good effects. First, we remove a s/r conflict.
8817         Second, we allocate many fewer QualifiedIdentifier objects.
8818
8819 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
8820
8821         * attribute.cs: Handle MarshalAs attributes as pseudo, and
8822         set the correct information via SRE. This prevents
8823         hanging on the MS runtime. Fixes #29374.
8824
8825 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
8826
8827         * convert.cs: correctly handle conversions to value types
8828         from Enum and ValueType as unboxing conversions.
8829
8830         Fixes bug #52569. Patch by Benjamin Jemlich.
8831
8832 2004-01-02  Ravi Pratap  <ravi@ximian.com>
8833
8834         * expression.cs (BetterConversion): Prefer int -> uint
8835         over int -> ulong (csc's behaviour). This fixed bug #52046.
8836
8837 2004-01-02 Ben Maurer  <bmaurer@users.sourceforge.net>
8838
8839         * decl.cs (MemberCache.FindMembers): now returns a
8840         MemberInfo [].
8841
8842         * typemanager.cs: In general, go with with ^^.
8843         (CopyNewMethods): take an IList.
8844         (RealMemberLookup): Only allocate an arraylist
8845         if we copy from two sets of methods.
8846
8847         This change basically does two things:
8848         1) Fewer array lists allocated due to CopyNewMethods.
8849         2) the explicit cast in MemberList costed ALOT.
8850
8851 2004-01-02  Zoltan Varga  <vargaz@freemail.hu>
8852
8853         * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
8854         a hashtable to avoid needless string allocations when an identifier is
8855         used more than once (the common case).
8856
8857 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
8858
8859         * pending.cs: MS's TypeBuilder.GetInterfaces ()
8860         is broken, it will not return anything. So, we
8861         have to use the information we have in mcs to
8862         do the task.
8863
8864         * typemanager.cs: Add a cache for GetInterfaces,
8865         since this will now be used more often (due to ^^)
8866
8867         (GetExplicitInterfaces) New method that gets the
8868         declared, not effective, interfaces on a type
8869         builder (eg, if you have interface IFoo, interface
8870         IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
8871         { IBar }.
8872
8873         This patch makes MCS able to bootstrap itself on
8874         Windows again.
8875
8876 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
8877
8878         * expression.cs: Remove the Nop's that Miguel put
8879         in by mistake.
8880
8881 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
8882
8883         * report.cs, codegen.cs: Give the real stack trace to
8884         the error when an exception is thrown.
8885
8886 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
8887
8888         * decl.cs: only allocate hashtables for ifaces if 
8889         it is an iface!
8890
8891 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
8892
8893         * expression.cs: fix the error from cs0121-2.cs
8894         (a parent interface has two child interfaces that
8895         have a function with the same name and 0 params
8896         and the function is called through the parent).
8897
8898 2003-12-30 Ben Maurer  <bmaurer@users.sourceforge.net>
8899
8900         * class.cs, rootcontext.cs, typmanager.cs: do not
8901         leak pointers.
8902
8903 2003-12-28 Ben Maurer  <bmaurer@users.sourceforge.net>
8904
8905         * codegen.cs: remove stack for the ec flow branching.
8906         It is already a linked list, so no need.
8907
8908 2003-12-27 Ben Maurer  <bmaurer@users.sourceforge.net>
8909
8910         * Makefile: Allow custom profiler here.
8911
8912 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
8913
8914         * typemanager.cs (LookupType):
8915           - Use a static char [], because split takes
8916             a param array for args, so it was allocating
8917             every time.
8918           - Do not store true in a hashtable, it boxes.
8919
8920 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
8921
8922         * flowanalysis.cs: bytify common enums.
8923
8924 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
8925
8926         * modifiers.cs: Add a new set of flags for the
8927         flags allowed on explicit interface impls.
8928         * cs-parser.jay: catch the use of modifiers in
8929         interfaces correctly.
8930         * class.cs: catch private void IFoo.Blah ().
8931
8932         All related to bug #50572.
8933
8934 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
8935
8936         * decl.cs: Rewrite the consistant accessability checking.
8937         Accessability is not linear, it must be implemented in
8938         a tableish way. Fixes #49704.
8939
8940 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
8941
8942         * expression.cs: Handle negation in a checked context.
8943         We must use subtraction from zero. Fixes #38674.
8944
8945 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
8946
8947         * class.cs: Ignore static void main in DLLs.
8948         * rootcontext.cs: Handle the target type here,
8949         since we are have to access it from class.cs
8950         * driver.cs: account for the above.
8951
8952 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
8953
8954         * report.cs: Give line numbers and files if available.
8955
8956 2003-12-20  Zoltan Varga  <vargaz@freemail.hu>
8957
8958         * driver.cs: Implement /addmodule.
8959
8960         * typemanager.cs:  Change 'modules' field so it now contains Modules not
8961         ModuleBuilders.
8962
8963 2003-12-20  Martin Baulig  <martin@ximian.com>
8964
8965         * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
8966         (FieldBase.IsAssigned): Removed this field.
8967         (FieldBase.SetAssigned): New public method.
8968         (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
8969
8970 2003-12-20  Martin Baulig  <martin@ximian.com>
8971
8972         * expression.cs (LocalVariableReference.DoResolve): Don't set
8973         `vi.Used' if we're called from DoResolveLValue().
8974
8975         * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
8976         returns the usage vector it just merged into the current one -
8977         pass this one to UsageWarning().
8978         (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
8979         of the `EmitContext', don't call this recursively on our children.
8980
8981 2003-12-19  Zoltan Varga  <vargaz@freemail.hu>
8982
8983         * driver.cs: Implement /target:module.
8984
8985 2003-12-18  Zoltan Varga  <vargaz@freemail.hu>
8986
8987         * support.cs (CharArrayHashtable): New helper class.
8988
8989         * cs-tokenizer.cs: Store keywords in a hashtable indexed by 
8990         char arrays, not strings, so we can avoid creating a string in
8991         consume_identifier if the identifier is a keyword.
8992
8993 2003-12-16  Martin Baulig  <martin@ximian.com>
8994
8995         * statement.cs (LocalInfo.Assigned): Removed this property.
8996         (LocalInfo.Flags): Removed `Assigned'.
8997         (LocalInfo.IsAssigned): New public method; takes the EmitContext
8998         and uses flow analysis.
8999         (Block.UsageWarning): Made this method private.
9000         (Block.Resolve): Call UsageWarning() if appropriate.
9001
9002         * expression.cs (LocalVariableReference.DoResolve): Always set
9003         LocalInfo.Used here.
9004
9005 2003-12-13  Martin Baulig  <martin@ximian.com>
9006
9007         * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
9008         any value here; we're now using flow analysis to figure out
9009         whether a statement/block returns a value.
9010
9011 2003-12-13  Martin Baulig  <martin@ximian.com>
9012
9013         * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
9014         working again.
9015         (FlowBranching.MergeFinally): Don't call
9016         `branching.CheckOutParameters()' here, this is called in
9017         MergeTopBlock().
9018         (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
9019         when adding the `finally' vector.       
9020
9021 2003-12-13  Martin Baulig  <martin@ximian.com>
9022
9023         * flowanalysis.cs
9024         (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
9025         actually work and also fix #48962.
9026
9027 2003-12-12 Ben Maurer  <bmaurer@users.sourceforge.net>
9028
9029         * decl.cs: Do not check System.Object for nested types,
9030         since we know it does not have any. Big bang for buck:
9031
9032         BEFORE:
9033            Run 1:   8.35 seconds
9034            Run 2:   8.32 seconds
9035            corlib:  17.99 seconds
9036         AFTER:
9037            Run 1:   8.17 seconds
9038            Run 2:   8.17 seconds
9039            corlib:  17.39 seconds
9040
9041 2003-12-11 Ben Maurer  <bmaurer@users.sourceforge.net>
9042
9043         * class.cs (FindMembers): Allocate arraylists on demand. Most of the
9044         time we are returning 0 members, so we save alot here.
9045
9046 2003-12-11  Martin Baulig  <martin@ximian.com>
9047
9048         * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
9049         `MergeChild()', also just take the `FlowBranching' as argument;
9050         call Merge() on it and return the result.
9051         (FlowBranching.Merge): We don't need to do anything if we just
9052         have one sibling.
9053
9054 2003-12-11  Martin Baulig  <martin@ximian.com>
9055
9056         * flowanalysis.cs: Use a list of `UsageVector's instead of storing
9057         them in an `ArrayList' to reduce memory usage.  Thanks to Ben
9058         Maurer for this idea.
9059
9060 2003-12-11  Martin Baulig  <martin@ximian.com>
9061
9062         * flowanalysis.cs (MergeResult): This class is now gone; we now
9063         use the `UsageVector' for this.  The reason for this is that if a
9064         branching just has one sibling, we don't need to "merge" them at
9065         all - that's the next step to do.
9066         (FlowBranching.Merge): We now return a `UsageVector' instead of a
9067         `MergeResult'.
9068
9069 2003-12-11  Martin Baulig  <martin@ximian.com>
9070
9071         Reworked flow analyis and made it more precise and bug-free.  The
9072         most important change is that we're now using a special `Reachability'
9073         class instead of having "magic" meanings of `FlowReturns'.  I'll
9074         do some more cleanups and optimizations and also add some more
9075         documentation this week.
9076
9077         * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
9078         largely reworked this class.
9079         (FlowReturns): Removed `Unreachable' and `Exception'; we now use
9080         the new `Reachability' class instead of having "magic" values here.
9081         (FlowBranching): We're now using an instance of `Reachability'
9082         instead of having separate `Returns', `Breaks' etc. fields.
9083
9084         * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
9085         based on flow analysis; ignore the return value of block.Emit ().
9086
9087 2003-12-10  Zoltan Varga  <vargaz@freemail.hu>
9088
9089         * driver.cs typemanager.cs: Find the mono extensions to corlib even
9090         if they are private.
9091
9092 2003-12-09  Martin Baulig  <martin@ximian.com>
9093
9094         * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
9095         call them directly on the UsageVector.
9096
9097 2003-12-09  Martin Baulig  <martin@ximian.com>
9098
9099         * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
9100         Changed return type from `FlowReturns' to `Reachability'.
9101
9102 2003-12-09  Martin Baulig  <martin@ximian.com>
9103
9104         * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
9105         (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
9106         `Reachable' fields with a single `Reachability' one.
9107
9108 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
9109
9110         * class.cs (FindMembers): Remove foreach's.
9111
9112         Bootstrap times:
9113
9114         BEFORE
9115                 Run 1:   8.74 seconds
9116                 Run 2:   8.71 seconds
9117
9118         AFTER
9119                 Run 1:   8.64 seconds
9120                 Run 2:   8.58 seconds
9121
9122
9123 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
9124
9125         * cs-parser.jay:
9126         * gen-treedump.cs:
9127         * statement.cs:
9128         This patch does a few things:
9129                 1. EmptyStatement is now a singleton, so it is never reallocated.
9130                 2. All blah is EmptyStatement constructs have been changed to
9131                    blah == EmptyStatement.Value, which is much faster and valid
9132                    now that EmptyStatement is a singleton.
9133                 3. When resolving a block, rather than allocating a new array for
9134                    the non-empty statements, empty statements are replaced with
9135                    EmptyStatement.Value
9136                 4. Some recursive functions have been made non-recursive.
9137         Mainly the performance impact is from (3), however (1) and (2) are needed for
9138         this to work. (4) does not make a big difference in normal situations, however
9139         it makes the profile look saner.
9140
9141         Bootstrap times:
9142
9143         BEFORE
9144         9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
9145         9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
9146         Total memory allocated: 56397 KB
9147
9148         AFTER
9149         9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
9150         8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
9151         Total memory allocated: 55666 KB
9152
9153 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
9154
9155         * support.cs: Rewrite DoubleHash to use its own impl. Is faster
9156         than the hashtable in a hashtable version
9157
9158         * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
9159         we always end up concating a string. This results in a huge perf
9160         loss, because many strings have to be tracked by the GC. In this
9161         patch, we first use a hashtable that works with two keys, so that
9162         the strings do not need to be concat'ed.
9163
9164         Bootstrap times:
9165         BEFORE
9166                 Run 1:   8.74 seconds
9167                 Run 2:   8.71 seconds
9168
9169         AFTER
9170                 Run 1:   8.65 seconds
9171                 Run 2:   8.56 seconds
9172
9173 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
9174
9175         * Makefile: Add a new target `do-time' that does a quick and simple
9176         profile, leaving easy to parse output.
9177
9178 2003-12-08  Zoltan Varga  <vargaz@freemail.hu>
9179
9180         * codegen.cs (Init): Create the dynamic assembly with 
9181         AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
9182
9183 2003-12-02 Ben Maurer  <bmaurer@users.sourceforge.net>
9184
9185         * support.cs: Make the PtrHashtable use only one
9186         instance of its comparer.
9187
9188 2003-11-30  Zoltan Varga  <vargaz@freemail.hu>
9189
9190         * typemanager.cs: Fix lookup of GetNamespaces.
9191
9192 2003-11-29  Miguel de Icaza  <miguel@ximian.com>
9193
9194         * expression.cs: Removed redundant line.
9195
9196         * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
9197         ArrayLists, use for loops with bounds.  
9198
9199         * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
9200         arraylist.
9201
9202         * expression.cs (Invocation.OverloadResolve): Avoid foreach on
9203         arraylists, use for loop with bounds.
9204
9205         The above three changes give us a 0.071 second performance
9206         improvement out of 3.294 seconds down to 3.223.  On my machine
9207         the above changes reduced the memory usage by 1,387 KB during
9208         compiler bootstrap.
9209
9210         * cs-parser.jay (QualifiedIdentifier): New class used to represent
9211         QualifiedIdentifiers.  Before we created a new string through
9212         concatenation, and mostly later on, the result would be
9213         manipulated by DecomposeQI through string manipulation.
9214
9215         This reduced the compiler memory usage for bootstrapping from
9216         59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
9217         compile times in 0.05 seconds.
9218
9219 2003-11-28  Dick Porter  <dick@ximian.com>
9220
9221         * support.cs: Do string compares with the Invariant culture.
9222
9223         * rootcontext.cs: 
9224         * gen-treedump.cs: 
9225         * expression.cs: 
9226         * driver.cs: 
9227         * decl.cs: 
9228         * codegen.cs: 
9229         * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
9230         the comparison is done with the Invariant culture.
9231
9232 2003-11-27  Miguel de Icaza  <miguel@ximian.com>
9233
9234         * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
9235         GetEnumerator method.
9236
9237         (ProbeCollectionType): Iterate starting at the most specific type
9238         upwards looking for a GetEnumerator
9239
9240         * expression.cs: Shift count can be up to 31 for int/uint and 63
9241         for long/ulong.
9242
9243 2003-11-26  Miguel de Icaza  <miguel@ximian.com>
9244
9245         * statement.cs (Block.LookupLabel): Also look for the label on the
9246         children blocks.  Use a hash table to keep track of visited
9247         nodes. 
9248
9249         * cfold.cs (IntConstant to UIntConstant mapping): Only return if
9250         we actually did transform the other operand, otherwise fall back
9251         to the common codepath that casts to long.
9252
9253         * cs-tokenizer.cs: Use the same code pattern as the int case.
9254         Maybe I should do the parsing myself, and avoid depending on the
9255         Parse routines to get this done.
9256
9257 2003-11-25  Miguel de Icaza  <miguel@ximian.com>
9258
9259         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
9260         which fixes bug 51347.  This time test it.
9261
9262         * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
9263         attributes for example can not tell the difference between these.
9264         The difference was only a syntax feature of the language. 
9265
9266         * attribute.cs: Apply attributes to delegates.
9267
9268         * delegate.cs: Call the apply attributes method.
9269
9270 2003-11-24  Miguel de Icaza  <miguel@ximian.com>
9271
9272         * convert.cs (TryImplicitIntConversion): One line bug fix: we were
9273         comparing 0 vs Byte.MinValue, not the value
9274
9275         (ImplicitConversionRequired): When reporting a conversion error,
9276         use error 31 to print out the constant error instead of the
9277         simpler 29.
9278
9279         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
9280         which fixes bug 51347.
9281
9282 2003-11-22  Miguel de Icaza  <miguel@ximian.com>
9283
9284         * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen) 
9285         which fixes the -warnaserror command line option.
9286
9287 2003-11-21  Miguel de Icaza  <miguel@ximian.com>
9288
9289         * cfold.cs (DoNumericPromotions): During constant folding of
9290         additions on UIntConstant, special case intconstants with
9291         IntConstants like we do on the expression binary operator. 
9292
9293 2003-11-12  Miguel de Icaza  <miguel@ximian.com>
9294
9295         * convert.cs (ImplicitReferenceConversion): We were missing a case
9296         (System.Enum are not value types or class types, so we need to
9297         classify them separatedly).
9298
9299         * driver.cs: We do not support error 2007.
9300
9301 2003-11-12 Jackson Harper <jackson@ximian.com>
9302
9303         * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
9304         system directory. Also use the full file name so users can
9305         libraries names mscorlib-o-tron.dll in a non system dir.
9306         
9307 2004-01-04  David Sheldon <dave-mono@earth.li>
9308
9309         * expression.cs: Added matching ")" to error message for CS0077.
9310
9311 2003-12-19  Martin Baulig  <martin@ximian.com>
9312
9313         * typemanager.cs (TypeManager.IsEqualGenericType): New public
9314         static method; see documentation in the method.
9315         (TypeManager.IsSubclassOrNestedChild): Allow IsEqualGenericType().
9316
9317         * convert.cs (Convert.ImplicitReferenceConversion,
9318         Convert.ImplicitReferenceConversionExists): Add support for
9319         generic type declarations; see gen-36.cs.
9320
9321 2003-12-19  Martin Baulig  <martin@ximian.com>
9322
9323         * pending.cs (Pending.InterfaceMethod): Use
9324         `Type.IsAssignableFrom()' instead of `=='.
9325
9326 2003-12-18  Martin Baulig  <martin@ximian.com>
9327
9328         * decl.cs (DeclSpace.AsAccessible): Check for array, pointer and
9329         byref types first.
9330
9331         * convert.cs (Convert.ImplicitStandardConversionExists): Use
9332         `expr_type.Equals (target_type)' instead of `=='.
9333
9334 2003-12-08  Martin Baulig  <martin@ximian.com>
9335
9336         * generics.cs (Constraints.Types): Removed.
9337         (Constraints.Resolve): Just resolve everything to TypeExpr's, not
9338         to Type's.
9339         (Constraints.ResolveTypes): New public method; resolves the
9340         TypeExpr's to Type's.
9341         (TypeParameter.Define): TypeBuilder.DefineGenericParameter() no
9342         longer takes the constraints.
9343         (TypeParameter.DefineMethod): Likewise.
9344         (TypeParameter.DefineType): New public method.  Calls
9345         `TypeBuilder/MethodBuilder.SetGenericParameterConstraints()' to set
9346         the constraints.
9347
9348 2003-12-08  Martin Baulig  <martin@ximian.com>
9349
9350         * convert.cs (Convert.ImplicitConversionStandard): Use
9351         `expr_type.Equals (target_type)' instead of `=='.
9352
9353 2003-12-08  Martin Baulig  <martin@ximian.com>
9354
9355         * typemanager.cs (TypeManager.GetReferenceType): Call
9356         `Type.MakeByRefType ()'.
9357
9358 2003-12-08  Martin Baulig  <martin@ximian.com>
9359
9360         * cs-parser.jay, cs-tokenizer.cs: `where' is not a keyword, it
9361         just has some special meaning in some situations.  For instance,
9362         it is allowed to use `where' as the name of a variable etc.
9363
9364 2003-12-04  Martin Baulig  <martin@ximian.com>
9365
9366         * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
9367         `Type.MakeArrayType()' for array types.
9368
9369 2003-11-18  Miguel de Icaza  <miguel@ximian.com>
9370
9371         * expression.cs (Invocation.VerifyArgumentsCompat): Remove
9372         debugging message.
9373
9374         (SizeOf.DoResolve): assign the `type_queried' field.  This gets
9375         corlib to compile.
9376
9377 2003-11-16  Martin Baulig  <martin@ximian.com>
9378
9379         * codegen.cs (EmitContext.IsGeneric): Removed.
9380
9381         * ecore.cs (SimpleName.ResolveAsTypeStep): Always call
9382         ResolveGeneric() on the DeclSpace.
9383
9384 2003-11-16  Martin Baulig  <martin@ximian.com>
9385
9386         * generic.cs (TypeArguments.Resolve):
9387         `Expression.ResolveAsTypeTerminal()' returns a TypeExpr; call
9388         `ResolveType()' on it to get the Type.
9389
9390 2003-11-15  Martin Baulig  <martin@ximian.com>
9391
9392         * generic.cs (ConstructedType.GetInterfaces): Override this.
9393
9394 2003-11-14  Martin Baulig  <martin@ximian.com>
9395
9396         * interface.cs (Interface.DefineType): Define all type parameters
9397         before adding the interfaces we inherit.
9398
9399 2003-11-11  Martin Baulig  <martin@ximian.com>
9400
9401         * generic.cs (ConstructedType.ResolveType): Always call
9402         `gt.BindGenericParameters (atypes)'; also if `args.HasTypeArguments'.
9403
9404 2003-11-10  Martin Baulig  <martin@ximian.com>
9405
9406         * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
9407         (TypeManager.InitCoreTypes): Initialize them here, but instead of
9408         calling `ResolveType()' on them, directly assign their `Type'.
9409
9410 2003-11-08  Martin Baulig  <martin@ximian.com>
9411
9412         * generic.cs (ConstructedType): Override `IsClass' etc.
9413
9414 2003-11-08  Martin Baulig  <martin@ximian.com>
9415
9416         * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
9417         return value and the `out parent' parameter.
9418         (TypeContainer.DefineType): Moved the CS0644 check into
9419         GetClassBases().  Don't pass the interface types to the
9420         `builder.DefineType()'/`builder.DefineNestedType()', but resolve
9421         them later and then call `TypeBuilder.AddInterfaceImplementation()'.
9422
9423         * ecore.cs (TypeExpr.IsAttribute): New property.
9424         (TypeExpr.GetInterfaces): New method.
9425
9426         * interface.cs (Interface.GetInterfaceTypeByName): Return a
9427         TypeExpr instead of a Type.
9428         (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
9429         (Interface.DefineType): Don't pass the interface types to the
9430         `builder.Definetype()'/`builder.DefineNestedType()', but resolve
9431         them later and then call `TypeBulider.AddInterfaceImplementation()'.
9432
9433         * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
9434         instead of a `Type[]'.
9435         (TypeManager.RegisterBuilder): Likewise.
9436         (TypeManager.AddUserInterface): Likewise.
9437         (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
9438         `Type[]' and also return a `TypeExpr[]'.
9439         (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
9440
9441 2003-11-08  Martin Baulig  <martin@ximian.com>
9442
9443         * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
9444         Expression.     
9445
9446 2003-11-08  Martin Baulig  <martin@ximian.com>
9447
9448         * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
9449         TypeManager.ResolveExpressionTypes().
9450
9451         * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
9452         instead of an Expression.
9453         (TypeExpr): This is now an abstract base class for `TypeExpression'.
9454         (TypeExpression): New public class; formerly known as `TypeExpr'.
9455
9456         * expression.cs (ComposedCast): Derive from TypeExpr.
9457
9458         * typemanager.cs (TypeManager.system_*_expr): These are now
9459         TypExpr's instead of Expression's.
9460         (TypeManager.ResolveExpressionTypes): New public static function;
9461         called from DeclSpace.GetTypeResolveEmitContext() to resolve all
9462         of them.        
9463
9464 2003-11-06  Miguel de Icaza  <miguel@ximian.com>
9465
9466         * expression.cs (New.DoResolve): Do not dereference value that
9467         might be a null return.
9468
9469         * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
9470         sure that the constant value has the right type.  Fixes an
9471         unreported bug, similar to 50425.
9472
9473         * const.cs (Const.LookupConstantValue): Call
9474         ImplicitStandardConversionExists before doing a conversion to
9475         avoid havng the TypeManager.ChangeType do conversions.
9476
9477         Reduced the number of casts used
9478
9479         (Const.ChangeType): New routine to enable reuse of the constant
9480         type changing code from statement.
9481
9482         * typemanager.cs (ChangeType): Move common initialization to
9483         static global variables.
9484
9485         Fixes #50425.
9486
9487         * convert.cs (ImplicitReferenceConversion): Somehow we allowed
9488         every value type to go through, even if it was void.  Fix that. 
9489
9490         * cs-tokenizer.cs: Use is_identifier_start_character on the start
9491         character of the define, and the is_identifier_part_character for
9492         the rest of the string.
9493
9494 2003-11-05  Miguel de Icaza  <miguel@ximian.com>
9495
9496         * expression.cs (UnaryMutator.EmitCode): When I updated
9497         LocalVariableReference.DoResolve, I overdid it, and dropped an
9498         optimization done on local variable references.
9499
9500 2003-11-04  Miguel de Icaza  <miguel@ximian.com>
9501
9502         * ecore.cs: Convert the return from Ldlen into an int.
9503
9504 2003-10-20  Miguel de Icaza  <miguel@ximian.com>
9505
9506         * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
9507         the accessibility, this is a special case for toplevel non-public
9508         classes (internal for instance).
9509
9510 2003-10-20  Nick Drochak <ndrochak@gol.com>
9511
9512         * ecore.cs: Fix typo and build.  Needed another right paren.
9513
9514 2003-10-19  Miguel de Icaza  <miguel@ximian.com>
9515
9516         * ecore.cs: Applied fix from Ben Maurer.   We were handling in the
9517         `internal' case regular and protected, but not allowing protected
9518         to be evaluated later.  Bug 49840
9519
9520 2003-10-15  Miguel de Icaza  <miguel@ximian.com>
9521
9522         * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
9523         to kb.Nlast, and not the kb.nFirst to isolate the switch
9524         statement.
9525
9526         Extract the underlying type, so enumerations of long/ulong are
9527         treated like long/ulong.
9528
9529 2003-10-14  Miguel de Icaza  <miguel@ximian.com>
9530
9531         * expression.cs (New): Overload the meaning of RequestedType to
9532         track the possible creation of the NewDelegate type, since
9533         DoResolve is invoked more than once for new constructors on field
9534         initialization.
9535
9536         See bugs: #48800 and #37014
9537
9538         * cs-parser.jay (declare_local_constants): Take an arraylist
9539         instead of a single constant.
9540
9541         (local_constant_declaration): It should take a
9542         constant_declarators, not a constant_declarator.  Fixes 49487
9543
9544         * convert.cs: Fix error report.
9545
9546 2003-10-13 Jackson Harper <jackson@ximian.com>
9547
9548         * typemanager.cs (TypeToCoreType): Add float and double this fixes
9549         bug #49611
9550         
9551 2003-11-03  Martin Baulig  <martin@ximian.com>
9552
9553         * expression.cs (ArrayAccess.GetStoreOpcode): Added
9554         `out bool has_type_arg'; if set, we need to pass the type to
9555         ig.Emit().
9556         (ArrayAccess.GetStoreOpcode, ArrayAccess.EmitLoadOpcode): Use
9557         Stelem_Any/Ldelem_Any for generic parameters.   
9558
9559 2003-11-02  Martin Baulig  <martin@ximian.com>
9560
9561         * expression.cs (Invocation.EmitCall): Use
9562         `TypeManager.IsValueType()' to check whether it's a value type.
9563         Don't set `struct_call' when calling a method on a type parameter.
9564
9565 2003-11-02  Martin Baulig  <martin@ximian.com>
9566
9567         * generics.cs (ConstructedType.Resolve): Renamed to ResolveType()
9568         and removed the TypeBuilder argument.
9569
9570         * typemanager.cs (TypeManager.IsValueType): Return
9571         `t.IsGenericParameter || t.IsValueType'.
9572
9573 2003-10-25  Martin Baulig  <martin@ximian.com>
9574
9575         * decl.cs (DeclSpace.ResolveType): If we're a ConstructedType,
9576         call ConstructedType.Resolve() on it.
9577
9578         * generic.cs (ConstructedType.Resolve): Set `type' on success.
9579
9580 2003-10-25  Martin Baulig  <martin@ximian.com>
9581
9582         * class.cs (TypeContainer.GetClassBases): Changed
9583         `out Type parent' into `out TypeExpr parent'.  Moved CS0644 and
9584         CS8214 reporting here.
9585         (TypeContainer.DefineType): GetClassBases() gives us a `TypeExpr'
9586         instead of a `Type' for our parent.  In case of a recursive
9587         declaration (see tests/gen-23.cs for an example), our parent is a
9588         ConstructedType and it doesn't have its type set.  So, first
9589         create our own TypeBuilder, then call constructed.Resolve() to get
9590         the parent's type and finally TypeBuilder.SetParent() it.
9591
9592         * ecore.cs (TypeExpr.Name): New public virtual property.
9593
9594         * generic.cs
9595         (ConstructedType): We're now a TypeExpr and not just an Expression.
9596         (ConstructedType.ResolveAsTypeStep): Don't resolve our type
9597         arguments here; this is done later.
9598         (ConstructedType.Resolve): New public method to resolve the type
9599         arguments and bind them.
9600
9601 2003-10-21  Martin Baulig  <martin@ximian.com>
9602
9603         * convert.cs: Use `TypeManager.IsValueType' instead of
9604         'type.IsValueType' everywhere.
9605
9606         * typemanager.cs (TypeManager.IsValueType): Return true for type
9607         parameters.  The reason for this is that we need to box a type
9608         parameter when converting it to a reference type.
9609
9610         * cs-parser.jay: Added support for default value expressions.
9611
9612         * generics.cs (DefaultValueExpression): New public class.       
9613
9614 2003-10-17  Martin Baulig  <martin@ximian.com>
9615
9616         * generic.cs (Constraints.Resolve): Take a DecpSpace instead of a
9617         TypeContainer so we can also use this for Interfaces.
9618         (TypeParameter.Resolve): Likewise.
9619
9620         * interface.cs (Interface.DefineType): Added support for generic
9621         interfaces.
9622
9623         * cs-parser.jay: Added support for generic structs and interfaces.
9624
9625 2003-10-17  Martin Baulig  <martin@ximian.com>
9626
9627         * generic.cs (GenericMemberAccess.DoResolve): We can now actually
9628         call generic methods :-)
9629
9630 2003-10-16  Martin Baulig  <martin@ximian.com>
9631
9632         * cs-parser.jay (namespace_or_type_name): Only create a
9633         GenericMemberAccess if we actually have type arguments.
9634
9635 2003-10-13  Martin Baulig  <martin@ximian.com>
9636
9637         * class.cs (Method.Define): If we're a generic method, call
9638         TypeBuilder.DefineGenericMethod () before resolving
9639         the parameters.
9640         (MethodData): Added .ctor which takes an additional MethodBuilder
9641         argument; this is used for generic methods.
9642         (MethodData.Define): Call `builder.SetGenericMethodSignature()' if
9643         we already have a MethodBuilder.
9644
9645 2003-10-10  Martin Baulig  <martin@ximian.com>
9646
9647         * class.cs (Method): Added .ctor which takes a `GenericMethod'
9648         instead of a `DeclSpace'.  This is used for generic methods.
9649
9650         * cs-parser.jay (method_header): Added support for generic
9651         methods; create a `GenericMethod' instance and pass it to the
9652         `Method's .ctor; it'll be used as the `DeclSpace' to lookup
9653         parameters and locals.
9654
9655         * decl.cs (DeclSpace.SetParameterInfo): Removed Location argument
9656         since we already have the location.  Check whether we're a generic
9657         type declaration or a generic method and create the correct type
9658         parameter.
9659
9660         * generic.cs (TypeParameter.DefineMethod): New public method.
9661         (GenericMethod): New public class; derives from DeclSpace and is
9662         used for generic methods.       
9663
9664 2003-10-09  Martin Baulig  <martin@ximian.com>
9665
9666         * class.cs (MethodCore): Added additional `DeclSpace ds' argument
9667         to the .ctor.
9668         (MethodCore.DoDefineParameters): Removed the TypeContainer
9669         argument; use the DeclSpace which was passed to the .ctor instead.
9670         (MethodCore.CheckParameter): Take a DeclSpace instead of a
9671         TypeContainer; we only need a DeclSpace here.
9672
9673 2003-10-09  Martin Baulig  <martin@ximian.com>
9674
9675         * class.cs (MethodData): Added additional `DeclSpace ds' argument
9676         to the .ctor.
9677         (MethodData.Define, MethodData.Emit): Pass the `ds' to the
9678         EmitContext's .ctor.    
9679
9680 2003-10-09  Martin Baulig  <martin@ximian.com>
9681
9682         * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
9683         (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
9684         AsAccessible(), moved them as well.
9685
9686         * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
9687
9688 2003-10-07  Miguel de Icaza  <miguel@ximian.com>
9689
9690         * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
9691         generation for >=, as spotted by Paolo, bug 48679.  
9692         Patch from David Waite.
9693
9694         * cs-tokenizer.cs: Add handling for #pragma.
9695
9696         * cs-parser.jay: Allow for both yield and yield return in the
9697         syntax.  The anti-cobolization of C# fight will go on!
9698
9699         * class.cs (TypeBuilder.DefineType): Catch error condition here
9700         (Parent.DefineType erroring out and returning null).
9701
9702         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
9703         coping with enumerations variables, we were mistakenly processing
9704         them as a regular value type instead of built-in types.  Fixes the
9705         bug #48063
9706
9707         * typemanager.cs (IsBuiltinOrEnum): New method.
9708
9709 2003-09-30  Miguel de Icaza  <miguel@ximian.com>
9710
9711         * cs-parser.jay: Upgrade: yield now needs the return clause.
9712
9713 2003-10-08  Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
9714
9715         * cs-parser.jay : Renamed yyName to yyNames related to jay.
9716
9717 2003-09-29  Martin Baulig  <martin@ximian.com>
9718
9719         * typemanager.cs (TypeManager.GetMethodFlags): Added support for
9720         inflated generic methods.
9721
9722         * generics.cs (ConstructedType): Distinguish between open and
9723         closed constructed types; correctly resolve the arguments.
9724
9725 2003-09-22  Martin Baulig  <martin@ximian.com>
9726
9727         * generic.cs (ConstructedType.ResolveAsTypeCheck): Check whether
9728         all type arguments meet their constraints.
9729
9730 2003-09-19  Martin Baulig  <martin@ximian.com>
9731
9732         * decl.cs (MemberCache.SetupCacheForInterface): Take a
9733         `MemberCache parent' argument.  Normally, an interface doesn't
9734         have a parent type except System.Object, but we use this in gmcs
9735         for generic type parameters.
9736
9737 2003-09-18  Martin Baulig  <martin@ximian.com>
9738
9739         * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
9740         on `type.IsInterface'; don't check whether the type has a parent
9741         to determine whether it's an interface.
9742
9743 2003-09-17  Martin Baulig  <martin@ximian.com>
9744
9745         * generic.cs (ConstructedType.ToString): Always use `name' as the
9746         type name.
9747
9748 2003-09-15  Martin Baulig  <martin@ximian.com>
9749
9750         * cs-parser.jay: Fix grammar wrt. type_parameter_constraints.
9751
9752         * generic.cs (Constraints.Resolve): New public method; this is
9753         called to resolve the constraint types and to check whether all
9754         the constraints are correct.
9755         (Constraints.Types): New public property.
9756         (TypeParameter.Resolve): New public method; resolves all the
9757         type's constraints.
9758
9759         * class.cs (TypeContainer.DefineType): Call
9760         TypeParameter.Resolve() before actually defining the type.
9761
9762 2003-09-15  Martin Baulig  <martin@ximian.com>
9763
9764         * class.cs (TypeContainer.DefineType): Added an error flag to
9765         avoid reporting duplicate CS0146's ("class definition is
9766         circular.").
9767
9768         * driver.cs (Driver.MainDriver): Abort if
9769         RootContext.ResolveTree() reported any errors.
9770
9771 2003-09-07  Martin Baulig  <martin@ximian.com>
9772
9773         * report.cs (Error, Warning): Added overloaded versions which take
9774         a `params object[] args' and call String.Format().
9775
9776 2003-09-07  Martin Baulig  <martin@ximian.com>
9777
9778         * decl.cs (DeclSpace..ctor): Don't call
9779         NamespaceEntry.DefineName() here; do it in RecordDecl() which is
9780         called from Tree.RecordDecl().  Fixes the CS0101 reporting.
9781         (DeclSpace.RecordDecl): New method.
9782
9783         * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
9784
9785 2003-09-02  Ravi Pratap  <ravi@ximian.com>
9786
9787         * attribute.cs (CheckAttributeTarget): Ensure that we allow return
9788         value attributes to be applied to ParameterBuilders.
9789
9790         * class.cs (MethodCore.LabelParameters): Make static and more
9791         generic so that it can be used from other places - like interface
9792         methods, for instance.
9793
9794         * interface.cs (Interface.Emit): Call LabelParameters before
9795         emitting attributes on the InterfaceMethod.
9796
9797 2003-09-07  Martin Baulig  <martin@ximian.com>
9798
9799         * generic.cs (ConstructedType.ResolveAsTypeStep): Report a CS8217
9800         if the number of type parameters doesn't match.
9801
9802 2003-09-04  Martin Baulig  <martin@ximian.com>
9803
9804         * expression.cs (ComposedCast.ResolveAsTypeStep): Added support
9805         for arrays of generic type params (ie. `!0[]').
9806
9807 2003-09-04  Martin Baulig  <martin@ximian.com>
9808
9809         * class.cs (TypeContainer.AsAccessible): Ignore generic parameters
9810         for the moment.
9811
9812 2003-09-04  Martin Baulig  <martin@ximian.com>
9813
9814         * decl.cs (DeclSpace.LookupGeneric): New method.
9815         (DeclSpace.CheckAccessLevel): Ignore generic parameters for the
9816         moment.
9817
9818         * generic.cs (TypeParameterExpr): Take a TypeParameter as
9819         argument, not just a string.
9820         (TypeParameter.Define): New public method; this is called to
9821         actually define the generic parameter; after this, you can use the
9822         new `Type' property to get the type.
9823
9824 2003-09-04  Martin Baulig  <martin@ximian.com>
9825
9826         * decl.cs (DeclSpace.SetParameterInfo): The `constraints' argument
9827         is now an ArrayList; initialize the result of the `TypeParameters'
9828         property here.
9829         (DeclSpace.GetGenericData): Removed.
9830         (DeclSpace.LookupGeneric): Temporarily removed; we need to
9831         implement this in a different way.
9832         (DeclSpace.GetTypeParameters): Removed; there's now a
9833         `TypeParameters' property.
9834         (DeclSpace.TypeParameters): New public property.
9835
9836         * generic.cs (Constraints): Make this class public.
9837         (TypeParameter): New public class.
9838
9839 2003-09-04  Martin Baulig  <martin@ximian.com>
9840
9841         * decl.cs (DeclSpace.GetTypeParameters): New method to return the
9842         generic parameters.
9843
9844         * class.cs (TypeContainer.DefineType): Call
9845         TypeBuilder.DefineGenericParameter () on all generic parameters if
9846         this is a generic type.
9847
9848 2003-08-28  Martin Baulig  <martin@ximian.com>
9849
9850         * sample-stack.il: Compile this with ilasm: "ilasm /dll
9851         sample-stack.il".
9852
9853         * sample-hello.cs: Compile this with gmcs: "gmcs
9854         /r:sample-stack.dll sample-hello.cs".
9855
9856 2003-08-28  Martin Baulig  <martin@ximian.com>
9857
9858         * generic.cs (ConstructedType.ResolveAsTypeStep): Actually bind
9859         the parameters to the generic type.
9860
9861 2003-08-28  Martin Baulig  <martin@ximian.com>
9862
9863         * cs-tokenizer.cs (parse_less_than): Also allow all builtin types.
9864
9865 2003-08-28  Martin Baulig  <martin@ximian.com>
9866
9867         * cs-parser.jay (opt_type_argument_list): Use
9868         `OP_GENERICS_LT type_arguments OP_GENERICS_GT'.
9869         (primary_expression): Replace `qualified_identifier' with `type_name'.
9870         (type_parameter_list): Use `OP_GENERICS_LT type_parameters OP_GENERICS_GT'.
9871
9872         * cs-tokenizer.cs (is_punct): When reading a `<', invoke a custom
9873         parser to check whether it is syntactically a type parameter list;
9874         return OP_GENERICS_LT/OP_GENERICS_GT instead of OP_LT/OP_GT in
9875         this case.
9876
9877 2003-08-26  Martin Baulig  <martin@ximian.com>
9878
9879         * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
9880         resolving aliases; fixes #47927.
9881
9882 2003-08-26  Martin Baulig  <martin@ximian.com>
9883
9884         * statement.cs (Using.DoResolve): This is internally emitting a
9885         try/finally clause, so we need to set ec.NeedExplicitReturn if we
9886         do not always return.  Fixes #47681.
9887
9888 2003-08-26  Martin Baulig  <martin@ximian.com>
9889
9890         * decl.cs (MemberCore): Moved WarningNotHiding(),
9891         Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
9892         into MemberBase.
9893         (AdditionResult): Make this nested in DeclSpace.
9894         (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
9895         argument; call NamespaceEntry.Define() unless we're nested in a
9896         class or struct.
9897
9898         * namespace.cs (Namespace.DefineName): New public function.  This
9899         is called from DeclSpace's .ctor to add 
9900         (Namespace.Lookup): Include DeclSpaces in the lookup.
9901
9902         * class.cs (Operator): Derive from MemberBase, not MemberCore.
9903
9904         * const.cs (Const): Derive from MemberBase, not MemberCore.     
9905
9906 2003-08-25  Martin Baulig  <martin@ximian.com>
9907
9908         * convert.cs (Convert.ExplicitReferenceConversion): When
9909         converting from an interface type to a class, unbox if the target
9910         type is a struct type.  Fixes #47822.
9911
9912 2003-08-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9913
9914         * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
9915         #47854.
9916
9917 2003-08-22  Martin Baulig  <martin@ximian.com>
9918
9919         * class.cs (TypeManager.DefineType): When defining a nested type,
9920         call DefineType() on our parent; fixes #47801.
9921
9922 2003-08-22  Martin Baulig  <martin@ximian.com>
9923
9924         * class.cs (MethodData.Define): While checking if a method is an
9925         interface implementation, improve the test a bit more to fix #47654.
9926
9927 2003-08-22  Martin Baulig  <martin@ximian.com>
9928
9929         * expression.cs (Probe.DoResolve): Check whether `expr' resolved
9930         correctly; fixes #47722.
9931
9932 2003-08-22  Martin Baulig  <martin@ximian.com>
9933
9934         * expression.cs (UnaryMutator.ResolveVariable): If the target is a
9935         LocalVariableReference, ensure it's not read-only.  Fixes #47536.
9936
9937         * statement.cs (Fixed.DoResolve): Make all variables read-only. 
9938
9939 2003-08-22  Martin Baulig  <martin@ximian.com>
9940
9941         * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
9942         can only be assigned in static constructors.  Fixes #47161.
9943
9944 2003-08-22  Martin Baulig  <martin@ximian.com>
9945
9946         Rewrote and improved the flow analysis code.
9947
9948         * flowbranching.cs (FlowBranching): Make this class abstract.
9949         (FlowBranching.CreateBranching): New static function to create a
9950         new flow branching.
9951         (FlowBranchingBlock, FlowBranchingException): New classes.
9952         (FlowBranching.UsageVector.Type): New public readonly field.
9953         (FlowBranching.UsageVector.Breaks): Removed the setter.
9954         (FlowBranching.UsageVector.Returns): Removed the setter.
9955         (FlowBranching.UsageVector): Added Break(), Return(),
9956         NeverReachable() and Throw() methods to modify the reachability.
9957         (FlowBranching.UsageVector.MergeChildren): Removed, this is now
9958         done by FlowBranching.Merge().
9959         (FlowBranching.UsageVector.MergeChild): New method; merges the
9960         merge result into the current vector.
9961         (FlowBranching.Merge): New abstract method to merge a branching.
9962
9963 2003-08-12  Martin Baulig  <martin@ximian.com>
9964
9965         * expression.cs (Indirection.CacheTemporaries): Create the
9966         LocalTemporary with the pointer type, not its element type.
9967
9968 2003-08-10  Miguel de Icaza  <miguel@ximian.com>
9969
9970         * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
9971         token was a keyword or not.
9972
9973         Add `error' options where an IDENTIFIER was expected;  Provide
9974         CheckToken and CheckIdentifierToken convenience error reporting
9975         functions. 
9976
9977         Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
9978
9979         * decl.cs: Rename `NamespaceEntry Namespace' public field into
9980         NameSpaceEntry NameSpaceEntry.
9981
9982         (LookupInterfaceOrClass): Avoid creating a full qualified name
9983         from namespace and name: avoid doing lookups when we know the
9984         namespace is non-existant.   Use new Tree.LookupByNamespace which
9985         looks up DeclSpaces based on their namespace, name pair.
9986
9987         * driver.cs: Provide a new `parser verbose' to display the
9988         exception thrown during parsing.  This is turned off by default
9989         now, so the output of a failure from mcs is more graceful.
9990
9991         * namespace.cs: Track all the namespaces defined in a hashtable
9992         for quick lookup.
9993
9994         (IsNamespace): New method
9995
9996 2003-08-09  Miguel de Icaza  <miguel@ximian.com>
9997
9998         * namespace.cs: Remove redundant call;  Avoid using MakeFQN when
9999         we know that we need to concatenate (full typename can never be
10000         null). 
10001
10002         * class.cs: ditto.
10003
10004         * statement.cs: Use a bitfield;  Do not initialize to null things
10005         which are done by the constructor by default.
10006
10007         * cs-parser.jay: bug fix, parameter was 4, not 3.
10008
10009         * expression.cs: Just use the property;
10010
10011         * statement.cs: No need for GetVariableInfo method.
10012
10013 2003-08-08  Martin Baulig  <martin@ximian.com>
10014
10015         * flowanalysis.cs (FlowReturns): This is now nested in the
10016         `FlowBranching' class.
10017         (MyBitVector): Moved this here from statement.cs.
10018         (FlowBranching.SiblingType): New enum type.
10019         (FlowBranching.CreateSibling): Added `SiblingType' argument.
10020
10021 2003-08-07  Martin Baulig  <martin@ximian.com>
10022
10023         * flowanalysis.cs (FlowBranchingType): This is now nested in the
10024         `FlowBranching' class and called `BranchingType'.
10025
10026 2003-08-07  Martin Baulig  <martin@ximian.com>
10027
10028         * flowanalysis.cs: Moved all the control flow analysis code into
10029         its own file.
10030
10031 2003-08-07  Martin Baulig  <martin@ximian.com>
10032
10033         * assign.cs (Assign.DoResolve): `target' must either be an
10034         IAssignMethod or an EventAccess; report a CS0131 otherwise.  Fixes
10035         #37319.
10036
10037 2003-08-07  Miguel de Icaza  <miguel@ximian.com>
10038
10039         * expression.cs (BinaryMethod): This kind of expression is created by the
10040         Binary class if it determines that the operator has to be handled
10041         by a method.
10042
10043         (BinaryDelegate): This kind of expression is created if we are
10044         dealing with a + or - operator on delegates.
10045
10046         (Binary): remove method, argumetns, and DelegateOperator: when
10047         dealing with methods, 
10048
10049         * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
10050
10051         * statement.cs (Block): use bitfields for the three extra booleans
10052         we had in use.   Remove unused topblock parameter.
10053
10054         * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
10055
10056         * assign.cs: Drop extra unneeded tests.
10057
10058 2003-08-06  Miguel de Icaza  <miguel@ximian.com>
10059
10060         * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
10061
10062         * statement.cs (Foreach): Use VariableStorage instead of
10063         LocalBuilders.   
10064
10065         * codegen.cs (VariableStorage): New class used by clients that
10066         require a variable stored: locals or fields for variables that
10067         need to live across yield.
10068
10069         Maybe provide a convenience api for EmitThis+EmitLoad?
10070
10071         (GetTemporaryLocal, FreeTemporaryLocal): Recycle
10072         these bad boys.
10073
10074 2003-08-05  Miguel de Icaza  <miguel@ximian.com>
10075
10076         * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
10077         RemapParameterLValue): New methods that are used to turn a
10078         precomputed FieldInfo into an expression like this:
10079
10080                 instance.FieldInfo
10081
10082         The idea is to use this instead of making LocalVariableReference
10083         have more than one meaning.
10084
10085         * cs-parser.jay: Add error production to BASE.
10086
10087         * ecore.cs: Deal with TypeManager.GetField returning null, which
10088         is now a valid return value.
10089
10090         (FieldExprNoAddress): New expression for Fields whose address can
10091         not be taken.
10092
10093         * expression.cs (LocalVariableReference): During the resolve
10094         phases, create new expressions if we are in a remapping context.
10095         Remove code that dealt with remapping here.
10096
10097         (ParameterReference): same.
10098
10099         (ProxyInstance): New expression, like the `This' expression, but
10100         it is born fully resolved.  We know what we are doing, so remove
10101         the errors that are targeted to user-provided uses of `this'.
10102
10103         * statement.cs (Foreach): our variable is now stored as an
10104         Expression;  During resolution, follow the protocol, dont just
10105         assume it will return this.
10106
10107 2003-08-06  Martin Baulig  <martin@ximian.com>
10108
10109         * support.cs (SeekableStreamReader.cs): New public class.
10110
10111         * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
10112         SeekableStreamReader instead of the normal StreamReader.
10113
10114 2003-08-04  Martin Baulig  <martin@ximian.com>
10115
10116         * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
10117         CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
10118         deambiguate casts and delegate invocations.
10119         (parenthesized_expression): Use the new tokens to ensure this is
10120         not a cast of method invocation.
10121
10122         * cs-tokenizer.cs (is_punct): Return one of the new special tokens
10123         when reading a `)' and Deambiguate_CloseParens () was previously
10124         called.
10125
10126         * expression.cs (ParenthesizedExpression): New class.  This is
10127         just used for the CS0075 test.
10128         (Binary.DoResolve): Check for CS0075.   
10129
10130 2003-07-29  Ravi Pratap  <ravi@ximian.com>
10131
10132         * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
10133         Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
10134         reference comparison.
10135
10136         (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
10137         examine the ReturnType for equality - this is necessary in the
10138         cases of implicit and explicit operators whose signature also
10139         includes the return type.
10140
10141 2003-07-26  Miguel de Icaza  <miguel@ximian.com>
10142
10143         * namespace.cs: Cache the result of the namespace computation,
10144         instead of computing it every time.
10145
10146 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
10147
10148         * decl.cs: Use a global arraylist that we reuse over invocations
10149         to avoid excesive memory consumption.  Reduces memory usage on an
10150         mcs compile by one meg (45 average).
10151
10152         * typemanager.cs (LookupTypeReflection): In .NET pointers are
10153         private, work around that.
10154
10155 2003-07-23  Miguel de Icaza  <miguel@ximian.com>
10156
10157         * literal.cs (IntLiteral): Define Zero and One static literals. 
10158
10159         * cs-parser.jay (integer_literal): use static literals to reduce
10160         memory usage for the most used literals (0, 1 and -1).  211kb
10161         reduced in memory usage.
10162
10163         Replace all calls to `new ArrayList' with `new
10164         ArrayList(4)' which is a good average number for most allocations,
10165         and also requires only 16 bytes of memory for its buffer by
10166         default. 
10167
10168         This reduced MCS memory usage in seven megabytes for the RSS after
10169         bootstrapping.
10170
10171 2003-07-28  Ravi Pratap  <ravi@ximian.com>
10172
10173         * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
10174         handle params methods the correct way by forming only one
10175         applicable set with params and normal methods in them. Earlier we
10176         were looking at params methods only if we found no normal methods
10177         which was not the correct thing to do.
10178
10179         (Invocation.BetterFunction): Take separate arguments indicating
10180         when candidate and the best method are params methods in their
10181         expanded form.
10182
10183         This fixes bugs #43367 and #46199.
10184
10185         * attribute.cs: Documentation updates.
10186
10187         (CheckAttribute): Rename to CheckAttributeTarget.
10188         (GetValidPlaces): Rename to GetValidTargets.
10189
10190         * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
10191         bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
10192
10193         Fixes bug #44468.
10194
10195 2003-07-28  Miguel de Icaza  <miguel@ximian.com>
10196
10197         * codegen.cs: Compute IsGeneric correctly.
10198
10199         * cs-parser.jay: Introduce OP_GENERIC_LT for the grammar ambiguity
10200         resolution. 
10201
10202         Bring back (temporarily) OP_LEFT_SHIFT, OP_RIGHT_SHIFT,
10203         OP_SHIFT_RIGHT_ASSIGN, OP_SHIFT_LEFT_ASSIGN.  There were too many
10204         regressions, and I was chasing more bugs than I required.
10205
10206         * interface.cs: Use expressions for base type names (like classes
10207         and structs have been doing for a while now), and resolve that.
10208         This patch should probably go into head as well.
10209
10210         This makes it one less user of FindType.
10211
10212 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
10213
10214         This compiler can not self host currently.  Need to fix that.
10215         
10216         * Makefile: compile to `gmcs.exe'
10217
10218         * driver.cs: Turn on v2 by default on gmcs.
10219
10220         * generic.cs (ConstructedType): Does no longer take a container
10221         type argument;  That will be taken care of later.
10222
10223         (ConstructedType.DoResolve, ConstructedType.ResolveAsTypeStep):
10224         Use SimpleName to resolve for now, so we can continue the work on
10225         the parser, until we get Type.GetType that understands generics.
10226
10227         (ConstructedType.ToString): Implement
10228
10229         (TypeArguments.Resolve): Resolve the child expressions as types. 
10230         
10231         * cs-parser.jay: Rename interface_constraints to
10232         type_parameter_constraints
10233
10234         (namespace_or_type_name): Only use constructed types for the basic
10235         construction, we will deal with identifier<...> later.
10236
10237         (type/type_name): No longer call DecomposeQI, as
10238         namespace_or_type_name is always decoded now.
10239         
10240 2003-07-22  Ravi Pratap  <ravi@ximian.com>
10241
10242         * expression.cs (Invocation.OverloadResolve): Follow the spec more
10243         closely: we eliminate methods in base types when we have an
10244         applicable method in a top-level type.
10245
10246         Please see section 14.5.5.1 for an exact description of what goes
10247         on. 
10248
10249         This fixes bug #45127 and a host of other related to corlib compilation.
10250
10251         * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
10252         array is the method corresponding to the top-level type (this is
10253         because of the changes made to icall.c) so we change this
10254         accordingly.
10255
10256         (MethodGroupExpr.Name): This too.
10257
10258         * typemanager.cs (GetElementType): New method which does the right
10259         thing when compiling corlib. 
10260
10261         * everywhere: Make use of the above in the relevant places.
10262
10263 2003-07-22  Martin Baulig  <martin@ximian.com>
10264
10265         * cs-parser.jay (invocation_expression): Moved
10266         `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
10267         `cast_expression', but create a InvocationOrCast which later
10268         resolves to either an Invocation or a Cast.
10269
10270         * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
10271         method; call this before EmitStatement() to make sure that this
10272         expression can be used as a statement.
10273
10274         * expression.cs (InvocationOrCast): New class; resolves to either
10275         an Invocation or a Cast.
10276
10277         * statement.cs (StatementExpression): Call ResolveStatement() on
10278         the ExpressionStatement before emitting it.
10279
10280 2003-07-21  Martin Baulig  <martin@ximian.com>
10281
10282         * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
10283         `ref' and `out' attributes match; fixes #46220.
10284         (MemberAccess.ResolveMemberAccess): You can't reference a type
10285         through an expression; fixes #33180.
10286         (Indexers.GetIndexersForType): Don't return the indexers from
10287         interfaces the class implements; fixes #46502.
10288
10289 2003-07-21  Martin Baulig  <martin@ximian.com>
10290
10291         * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
10292         CS0661 checks; fixes bug #30442.
10293
10294 2003-07-21  Martin Baulig  <martin@ximian.com>
10295
10296         * decl.cs (AdditionResult): Added `Error'.
10297
10298         * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
10299
10300         * typemanager.cs (TypeManager.ChangeType): Catch exceptions; makes
10301         cs0031.cs actually work.
10302
10303  2003-07-20  Miguel de Icaza  <miguel@ximian.com>
10304  
10305         * cs-parser.jay (namespace_name): do not use
10306         namespace_or_type_name, use qualified_identifier, because
10307         namespace_or_type_name will soon return a composed expression
10308         instead of a string.
10309  
10310         (namespace_or_type_name): Instead of returning a string, now this
10311         production returns an expression.
10312  
10313         * codegen.cs (EmitContext): Setup IsGeneric property based on
10314         whether our DeclSpace is generic, our the method is generic.
10315  
10316         * modifier.cs (Modifiers.METHOD_GENERIC): New definition, use if
10317         the method is generic.
10318  
10319         * cs-parser.jay (type_arguments, opt_type_argument_list,
10320         type_parameters, type_parameter_list, opt_type_parameter_list,
10321         type_parameter,, opt_type_parameter_constraints_clauses,
10322         type_parameter_constraints_clauses,
10323         type_parameter_constraint_clause, type_parameter_constraint,
10324         interface_constraints): Add new production
10325  
10326         * decl.cs (DeclSpace): IsGeneric, flag to track whether this
10327         DeclSpace is generic or not.
10328  
10329         (DeclSpace.SetParameterInfo): New routine, used to set the
10330         parameter info for a type.
10331  
10332         (DeclSpace.LookupGeneric): Lookups a name, and if it is a generic,
10333         returns a GenericTypeExpr
10334  
10335         * ecore.cs (SimpleName.ResolveAsTypeStep): If our container is
10336         generic, lookup the generic argument.
10337  
10338         * attribute.cs: Do not allow TypeParameterExpressions in
10339         Attributes.
10340  
10341         * class.cs: Do not allow the Main method to be defined in a
10342         Generic container.
10343  
10344         * expression.cs (SizeOf): Do not allow generic types to be used as
10345         arguments to sizeof.
10346  
10347         * typemanager.cs (IsGeneric): Wrapper for Reflection when we have
10348         it: whether a type is generic or not.  Only works for types we are
10349         currently building for now.
10350         
10351 2003-07-20  Martin Baulig  <martin@ximian.com>
10352
10353         * namespace.cs: Fixed that bug which caused a crash when compiling
10354         the debugger's GUI.
10355
10356 2003-07-20  Miguel de Icaza  <miguel@ximian.com>
10357
10358         * typemanager.cs (LookupTypeReflection): Never expose types which
10359         are NotPublic, NestedPrivate, NestedAssembly, or
10360         NestedFamANDAssem.  We used to return these, and later do a check
10361         that would report a meaningful error, but the problem is that we
10362         would not get the real match, if there was a name override.
10363
10364 2003-07-18  Miguel de Icaza  <miguel@ximian.com>
10365
10366         * namespace.cs (Namespace, Name): Do not compute the namespace
10367         name dynamically, compute it in the constructor.  This reduced
10368         memory usage by 1697 KB.
10369
10370         * driver.cs: Use --pause to pause at the end.
10371
10372 2003-07-17  Peter Williams  <peter@newton.cx>
10373
10374         * Makefile: Change the name of the test target so that it doesn't
10375         conflict with the recursive test target.
10376
10377 2003-07-17  Miguel de Icaza  <miguel@ximian.com>
10378
10379         * expression.cs (LocalVariableReference.Emit, EmitAssign,
10380         AddressOf): Do not use EmitThis, that was wrong, use the actual
10381         this pointer.
10382
10383 2003-07-15  Miguel de Icaza  <miguel@ximian.com>
10384
10385         * class.cs (MethodData.Define): While checking if a method is an
10386         interface implementation, improve the test: If we are not public
10387         (use new test here: use the computed MethodAttributes directly,
10388         instead of the parsed modifier flags) check if the `implementing'
10389         method comes from an interface or not.
10390
10391         * pending.cs (VerifyPendingMethods): Slightly better error
10392         message.
10393
10394         * makefile: add test target that does the mcs bootstrap.
10395
10396 2003-07-16  Ravi Pratap  <ravi@ximian.com>
10397
10398         * interface.cs (Define): Do nothing here since there are no
10399         members to populate etc. Move the attribute emission out of here
10400         since this was just totally the wrong place to put it. Attribute
10401         application happens during the 'Emit' phase, not in the 'Define'
10402         phase.
10403
10404         (Emit): Add this method and move the attribute emission here
10405
10406         * rootcontext.cs (EmitCode): Call the Emit method on interface
10407         types too.
10408
10409 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
10410
10411         * expression.cs (OverloadResolve): Report error only if Location
10412         is not 'Null' which means that there was a probe going on.
10413
10414 2003-07-14  Martin Baulig  <martin@ximian.com>
10415
10416         * expression.cs (ConditionalLogicalOperator): New public class to
10417         implement user defined conditional logical operators.
10418         This is section 14.11.2 in the spec and bug #40505.
10419
10420 2003-07-14  Martin Baulig  <martin@ximian.com>
10421
10422         * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
10423
10424 2003-07-14  Martin Baulig  <martin@ximian.com>
10425
10426         * codegen.cs (EmitContext.InFixedInitializer): New public field.
10427
10428         * ecore.cs (IVariable.VerifyFixed): New interface method.
10429
10430         * expression.cs (Unary.ResolveOperator): When resolving the `&'
10431         operator, check whether the variable is actually fixed.  Fixes bug
10432         #36055.  Set a variable definitely assigned when taking its
10433         address as required by the spec.
10434
10435         * statement.cs (LocalInfo.IsFixed): New field.
10436         (LocalInfo.MakePinned): Set `IsFixed' to true.
10437
10438 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
10439
10440         * attribute.cs (Attribute.Resolve): While doing a Member lookup
10441         for .ctors, ensure that we only ask for members declared in the
10442         attribute type (BindingFlags.DeclaredOnly).
10443
10444         Fixes bug #43632.
10445
10446         * expression.cs (Error_WrongNumArguments): Report error 1501
10447         correctly the way CSC does.
10448
10449 2003-07-13  Martin Baulig  <martin@ximian.com>
10450
10451         * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
10452         lookup on the fully qualified name, to make things like "X.X" work
10453         where "X.X" is a fully qualified type name, but we also have a
10454         namespace "X" in the using list.  Fixes #41975.
10455
10456 2003-07-13  Martin Baulig  <martin@ximian.com>
10457
10458         * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
10459         function. If we're a CompoundAssign, we need to create an embedded
10460         CompoundAssign, not an embedded Assign.
10461         (Assign.DoResolve): Make this work for embedded CompoundAssign's.
10462         Fixes #45854.
10463
10464 2003-07-13  Martin Baulig  <martin@ximian.com>
10465
10466         * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
10467         work to fix bug #46088.
10468
10469 2003-07-13  Ravi Pratap <ravi@ximian.com>
10470
10471         * class.cs (Operator.Emit): Do not emit attributes here - it is
10472         taken care of by the Method class that we delegate too. This takes
10473         care of bug #45876.
10474
10475 2003-07-10  Martin Baulig  <martin@ximian.com>
10476
10477         * expression.cs (TypeOfVoid): New class.
10478         (TypeOf): Report a CS0673 if it's System.Void.  Fixes #42264.
10479
10480 2003-07-10  Martin Baulig  <martin@ximian.com>
10481
10482         * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
10483         bug #35957.
10484
10485 2003-07-10  Martin Baulig  <martin@ximian.com>
10486
10487         * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
10488         not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
10489
10490         * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
10491
10492         * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
10493
10494 2003-07-10  Martin Baulig  <martin@ximian.com>
10495
10496         * expression.cs (ArrayCreation): Don't use a byte blob for arrays
10497         of decimal.  Fixes #42850.
10498
10499         NOTE: I also fixed the created byte blob, but this doesn't work on
10500         the MS runtime and csc never produces any byte blobs for decimal
10501         arrays.
10502
10503 2003-07-10  Martin Baulig  <martin@ximian.com>
10504
10505         * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
10506         structs; fixes #32068.
10507         (Block.AddChildVariableNames): Fixed #44302.
10508
10509 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10510
10511         * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
10512
10513 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
10514
10515         * attribute.cs: And this test is onger needed.
10516
10517 2003-07-08  Martin Baulig  <martin@ximian.com>
10518
10519         * rootcontext.cs (RootContext.NamespaceLookup): Ignore
10520         inaccessible types.  Fixes #36313.
10521
10522         * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
10523
10524         * namespace.cs (NamespaceEntry): Create implicit entries for all
10525         namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
10526         implicit entries for N1.N2 and N1.
10527
10528 2003-07-08  Martin Baulig  <martin@ximian.com>
10529
10530         Rewrote the handling of namespaces to fix a lot of the issues
10531         wrt. `using' aliases etc.
10532
10533         * namespace.cs (Namespace): Splitted this class into a
10534         per-assembly `Namespace' and a per-file `NamespaceEntry'.
10535
10536         * typemanager.cs (TypeManager.IsNamespace): Removed.
10537         (TypeManager.ComputeNamespaces): Only compute namespaces from
10538         loaded assemblies here, not the namespaces from the assembly we're
10539         currently compiling.
10540
10541 2003-07-08  Martin Baulig  <martin@ximian.com>
10542
10543         * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
10544
10545 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
10546
10547         * typemanager.cs: Reverted patch from Gonzalo, my previous patch
10548         already fixed it.  
10549
10550         I thought about the memory savings here, but LookupTypeReflection
10551         is used under already very constrained scenarios.  Compiling
10552         corlib or mcs only exposes one hit, so it would not really reduce
10553         any memory consumption.
10554
10555 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10556
10557         * typemanager.cs: fixes bug #45889 by only adding public types from
10558         other assemblies to the list of known types.
10559
10560 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
10561
10562         * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
10563         on the type we resolved.
10564
10565 2003-07-05  Martin Baulig  <martin@ximian.com>
10566
10567         * pending.cs (PendingImplementation.ParentImplements): Don't
10568         create the proxy if the parent is abstract.
10569
10570         * class.cs (TypeContainer.DefineIndexers): Process explicit
10571         interface implementations first.  Fixes #37714.
10572
10573 2003-07-04  Miguel de Icaza  <miguel@ximian.com>
10574
10575         * expression.cs (MemberAccess.ResolveMemberAccess): Events are
10576         defined recursively;  but since we modify the input parameters
10577         (left is set to `this' temporarily), we reset this value if the
10578         left_is_explicit is false, which gives the original semantics to
10579         the code.  
10580
10581         * literal.cs (NullPointer): new class used to represent a null
10582         literal in a pointer context.
10583
10584         * convert.cs (Convert.ImplicitReferenceConversion): Is the target
10585         type is a pointer, use a NullPointer object instead of a
10586         NullLiteral.   Closes 43687
10587
10588         (ExplicitConversion): Convert pointer values using
10589         the conv opcode to the proper type.
10590
10591         * ecore.cs (New): change ValueTypeVariable property into a method,
10592         that returns whether the valuetype is suitable for being used.
10593
10594         * expression.cs (Binary.DoNumericPromotions): Only return if we
10595         the int constant was a valid uint, and we can return both left and
10596         right as uints.  If not, we continue processing, to trigger the
10597         type conversion.  This fixes 39018.
10598
10599         * statement.cs (Block.EmitMeta): During constant resolution, set
10600         the CurrentBlock property on the emitcontext, so that we resolve
10601         constants propertly.
10602
10603 2003-07-02  Martin Baulig  <martin@ximian.com>
10604
10605         * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
10606         (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
10607
10608         * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
10609         than emitting it here.
10610
10611         * statement.cs: Fixed some more flow analysis bugs.
10612
10613 2003-07-02  Martin Baulig  <martin@ximian.com>
10614
10615         * class.cs (MethodData.Define): When implementing interface
10616         methods, set Final unless we're Virtual.
10617
10618         * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
10619         check work for interface methods.
10620
10621 2003-07-01  Martin Baulig  <martin@ximian.com>
10622
10623         * ecore.cs (EmitContext.This): Replaced this property with a
10624         GetThis() method which takes a Location argument.  This ensures
10625         that we get the correct error location for a CS0188.
10626
10627 2003-07-01  Miguel de Icaza  <miguel@ximian.com>
10628
10629         * ecore.cs: (Convert.ConvertIntLiteral): Add test for
10630         ImplicitStandardConversion.
10631
10632         * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
10633
10634 2003-07-01  Zoltan Varga  <vargaz@freemail.hu>
10635
10636         * expression.cs (ResolveOperator): Fix Concat (string, string, string)
10637         optimization.
10638
10639 2003-06-30  Miguel de Icaza  <miguel@ximian.com>
10640
10641         * class.cs (Constructor.Define): Turn off initlocals for unsafe
10642         constructors.
10643
10644         (MethodData.Define): Turn off initlocals for unsafe methods.
10645
10646 2003-06-29  Miguel de Icaza  <miguel@ximian.com>
10647
10648         * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
10649         complete;  Fixes #37521.
10650
10651         * delegate.cs: Use Modifiers.TypeAttr to compute the
10652         TypeAttributes, instead of rolling our own.  This makes the flags
10653         correct for the delegates.
10654
10655 2003-06-28  Miguel de Icaza  <miguel@ximian.com>
10656
10657         * class.cs (Constructor.Define): Set the private flag for static
10658         constructors as well.
10659
10660         * cs-parser.jay (statement_expression): Set the return value to
10661         null, to avoid a crash when we catch an error.
10662
10663 2003-06-24  Miguel de Icaza  <miguel@ximian.com>
10664
10665         * cs-parser.jay: Applied patch from Jackson that adds support for
10666         extern and unsafe modifiers to destructor declarations.
10667
10668         * expression.cs: Report error 21 if the user is trying to index a
10669         System.Array.
10670
10671         * driver.cs: Add an error message, suggested by the bug report.
10672
10673         * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
10674         if we do not have a ": this ()" constructor initializer.  Fixes 45149
10675
10676 2003-06-14  Miguel de Icaza  <miguel@ximian.com>
10677
10678         * namespace.cs: Add some information to reduce FAQs.
10679
10680 2003-06-13  Miguel de Icaza  <miguel@ximian.com>
10681
10682         * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
10683         underlying enumeration types.  Fixes #43915.
10684
10685         * expression.cs: Treat ushort/short as legal values to be used in
10686         bitwise operations.
10687
10688 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
10689
10690         * delegate.cs: transfer custom attributes for paramenters from
10691         the delegate declaration to Invoke and BeginInvoke.
10692
10693 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
10694
10695         * attribute.cs: handle custom marshalers and emit marshal info
10696         for fields, too.
10697
10698 2003-05-28  Hector E. Gomez Morales  <hgomez_36@flashmail.com>
10699
10700         * makefile.gnu: Added anonymous.cs to the compiler sources.
10701
10702 2003-05-28  Miguel de Icaza  <miguel@ximian.com>
10703
10704         * iterators.cs: Change the name of the proxy class to include two
10705         underscores.
10706
10707         * cs-parser.jay: Update grammar to include anonymous methods.
10708
10709         * anonymous.cs: new file.
10710
10711 2003-05-27  Miguel de Icaza  <miguel@ximian.com>
10712
10713         * class.cs (Field.Define): Add missing test for pointers and
10714         safety. 
10715
10716 2003-05-27  Ravi Pratap  <ravi@ximian.com>
10717
10718         * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
10719         we use the stobj opcode.
10720
10721         (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
10722         since it wasn't the correct fix. 
10723
10724         It still is puzzling that we are required to use stobj for IntPtr
10725         which seems to be a ValueType.
10726
10727 2003-05-26  Miguel de Icaza  <miguel@ximian.com>
10728
10729         * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
10730         during regular simple name resolution.   Now, the trick is that
10731         instead of returning for processing the simplename, we do a
10732         TypeManager.LookupType (ie, a rooted lookup as opposed to a
10733         contextual lookup type).   If a match is found, return that, if
10734         not, return for further composition.
10735
10736         This fixes long-standing 30485.
10737
10738         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
10739         using the address to initialize an object, do an Stobj instead of
10740         using the regular Stelem.
10741
10742         (IndexerAccess.Emit, IndexerAccess.EmitAssign):
10743         Pass `is_base_indexer' to Invocation.EmitCall instead of false.
10744         Because if we are a BaseIndexerAccess that value will be true.
10745         Fixes 43643.
10746
10747         * statement.cs (GotoCase.Resolve): Return after reporting an
10748         error, do not attempt to continue. 
10749
10750         * expression.cs (PointerArithmetic.Emit): If our operand is a
10751         long, convert our constants to match the operand before
10752         multiplying.  Convert to I type before adding.   Fixes 43670.
10753
10754 2003-05-14  Ravi Pratap  <ravi@ximian.com>
10755
10756         * enum.cs (ImplicitConversionExists) : Rename to
10757         ImplicitEnumConversionExists to remove ambiguity. 
10758
10759         * ecore.cs (NullCast): New type of cast expression class which
10760         basically is very similar to EmptyCast with the difference being
10761         it still is a constant since it is used only to cast a null to
10762         something else
10763         (eg. (string) null)
10764
10765         * convert.cs (ImplicitReferenceConversion): When casting a null
10766         literal, we return a NullCast.
10767
10768         * literal.cs (NullLiteralTyped): Remove - I don't see why this
10769         should be around anymore.
10770
10771         The renaming (reported was slightly wrong). Corrections:
10772
10773         ConvertImplicitStandard -> ImplicitConversionStandard
10774         ConvertExplicitStandard -> ExplicitConversionStandard
10775
10776         * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
10777         before passing them in !
10778
10779         * convert.cs (ImplicitConversionStandard): When comparing for
10780         equal expr and target types, ensure that expr is not a
10781         NullLiteral.
10782
10783         In general, we must not be checking (expr_type ==
10784         target_type) in the top level conversion methods
10785         (ImplicitConversion, ExplicitConversion etc). This checking is
10786         done in the methods that they delegate to.
10787
10788 2003-05-20  Miguel de Icaza  <miguel@ximian.com>
10789
10790         * convert.cs: Move Error_CannotConvertType,
10791         ImplicitReferenceConversion, ImplicitReferenceConversionExists,
10792         ImplicitNumericConversion, ImplicitConversionExists,
10793         ImplicitUserConversionExists, StandardConversionExists,
10794         FindMostEncompassedType, FindMostSpecificSource,
10795         FindMostSpecificTarget, ImplicitUserConversion,
10796         ExplicitUserConversion, GetConversionOperators,
10797         UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
10798         TryImplicitIntConversion, Error_CannotConvertImplicit,
10799         ConvertImplicitRequired, ConvertNumericExplicit,
10800         ExplicitReferenceConversionExists, ConvertReferenceExplicit,
10801         ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
10802         its own file.
10803
10804         Perform the following renames:
10805
10806         StandardConversionExists -> ImplicitStandardConversionExists
10807         ConvertImplicit -> ImplicitConversion
10808         ConvertImplicitStandard -> ImplicitStandardConversion
10809         TryImplicitIntConversion -> ImplicitIntConversion
10810         ConvertImplicitRequired -> ImplicitConversionRequired
10811         ConvertNumericExplicit -> ExplicitNumericConversion
10812         ConvertReferenceExplicit -> ExplicitReferenceConversion
10813         ConvertExplicit -> ExplicitConversion
10814         ConvertExplicitStandard -> ExplicitStandardConversion
10815
10816 2003-05-19  Martin Baulig  <martin@ximian.com>
10817
10818         * statement.cs (TypeInfo.StructInfo): Made this type protected.
10819         (TypeInfo): Added support for structs having structs as fields.
10820
10821         * ecore.cs (FieldExpr): Implement IVariable.
10822         (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
10823         VariableInfo for the field.
10824
10825 2003-05-18  Martin Baulig  <martin@ximian.com>
10826
10827         * expression.cs (This.DoResolve): Report a CS0027 if we're
10828         emitting a field initializer.
10829
10830 2003-05-18  Martin Baulig  <martin@ximian.com>
10831
10832         * expression.cs (This.ResolveBase): New public function.
10833         (This.DoResolve): Check for CS0188.
10834
10835         * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
10836         This.Resolve().
10837
10838         * ecore.cs (MethodGroupExpr.DoResolve): Set the
10839         `instance_expression' to null if we don't have any non-static
10840         methods.
10841
10842 2003-05-18  Martin Baulig  <martin@ximian.com>
10843
10844         Reworked the way how local variables and parameters are handled by
10845         the flow analysis code.
10846
10847         * statement.cs (TypeInfo, VariableMap): New public classes.
10848         (VariableInfo): New public class.  This is now responsible for
10849         checking whether a variable has been assigned.  It is used for
10850         parameters and local variables.
10851         (Block.EmitMeta): Take the InternalParameters as argument; compute
10852         the layout of the flow vectors here.
10853         (Block.LocalMap, Block.ParameterMap): New public properties.
10854         (FlowBranching): The .ctor doesn't get the InternalParameters
10855         anymore since Block.EmitMeta() now computes the layout of the flow
10856         vector.
10857         (MyStructInfo): This class is now known as `StructInfo' and nested
10858         in `TypeInfo'; we don't access this directly anymore.
10859
10860         * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
10861         property and removed IsAssigned(), IsFieldAssigned(),
10862         SetAssigned() and SetFieldAssigned(); we now call them on the
10863         VariableInfo so we don't need to duplicate this code everywhere.
10864
10865         * expression.cs (ParameterReference): Added `Block block' argument
10866         to the .ctor.
10867         (LocalVariableReference, ParameterReference, This): The new
10868         VariableInfo class is now responsible for all the definite
10869         assignment stuff.
10870
10871         * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
10872         IsParameterAssigned, SetParameterAssigned): Removed.
10873
10874 2003-05-18  Martin Baulig  <martin@ximian.com>
10875
10876         * typemanager.cs (InitCoreTypes): Try calling
10877         SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
10878         the 3-args-version.  Corlib now also needs our `void_type'.
10879         (GetMethod): Added overloaded version which takes an optional
10880         `bool report_errors' to allow lookups of optional methods.
10881
10882 2003-05-12  Martin Baulig  <martin@ximian.com>
10883
10884         * statement.cs (VariableInfo): Renamed to LocalInfo since it's
10885         only used for locals and not for parameters.
10886
10887 2003-05-12  Miguel de Icaza  <miguel@ximian.com>
10888
10889         * support.cs (InternalParameters.ParameterType): Return the
10890         ExternalType of the parameter.
10891
10892         * parameter.cs (Parameter.ExternalType): drop the two arguments,
10893         they were unused.
10894
10895 2003-05-11  Miguel de Icaza  <miguel@ximian.com>
10896
10897         * class.cs (MethodData.Define): Do not set the `newslot' on
10898         interface members, if they are also flagged as "override".
10899
10900         * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
10901         better code for ++i and i++.  This only works for static fields
10902         and local variables.
10903
10904         * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
10905         want to pull the DeclSpace out of the builder_to_declspace instead
10906         of the TypeBuilder (like in TypeContainer.FindMembers).
10907
10908         * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
10909         instead of LookupTypeContainer.  Fixes the crash on .NET for
10910         looking up interface members.
10911
10912         * const.cs: Create our own emit context during the Definition
10913         stage, so that constants are evaluated in the proper context, when
10914         a recursive definition happens.
10915
10916 2003-05-11  Martin Baulig  <martin@ximian.com>
10917
10918         * statement.cs (Block.CreateSwitchBlock): New method.  Creates a
10919         new block for a switch section.
10920         (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
10921         the adding/lookup in the switch block.  Fixes #39828.
10922
10923 2003-05-09  Miguel de Icaza  <miguel@ximian.com>
10924
10925         * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
10926         functionality: I needed to convert the data after I had performed
10927         the add/sub operation into the operands type size.
10928
10929         * ecore.cs (ImplicitReferenceConversion): When boxing an interface
10930         pass the type for the box operation, otherwise the resulting
10931         object would have been of type object.
10932
10933         (BoxedCast): Add constructor to specify the type to box as.
10934
10935 2003-05-07  Miguel de Icaza  <miguel@ximian.com>
10936
10937         * iterators.cs: I was reusing the `count' variable inadvertently,
10938         take steps to not allow this to happen.
10939
10940 2003-05-06  Miguel de Icaza  <miguel@ximian.com>
10941
10942         * attribute.cs (Attribute.Resolve): Params attributes are encoded
10943         by creating an array at the point where the params starts and
10944         putting all those arguments there, then adjusting the size of the
10945         array.
10946
10947 2003-05-05  Miguel de Icaza  <miguel@ximian.com>
10948
10949         * expression.cs (New.AddressOf): Implement interface
10950         IMemoryLocation.  This is used when the `new' operator is used in
10951         the context of an invocation to a method on a value type.
10952
10953         See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
10954         example. 
10955
10956         * namespace.cs: Also check the using aliases here.
10957
10958         * driver.cs: Move the test for using validity after the types have
10959         been entered, so we do a single pass that also includes the using
10960         aliases. 
10961
10962         * statement.cs (Try.Resolve): Avoid crashing if there is a failure
10963         in the regular case.   CreateSiblingForFinally is doing extra
10964         error checking.
10965
10966         * attribute.cs (GetAttributeArgumentExpression): Store the result
10967         on an out value, and use the return value to indicate failure
10968         instead of using null (which is a valid return for Constant.GetValue).
10969
10970         * statement.cs: Perform the analysis flow for the increment
10971         portion after the statement, because this will be the real flow of
10972         execution.  Fixes #42385
10973
10974         * codegen.cs (EmitContext.EmitArgument,
10975         EmitContext.EmitStoreArgument): New helper functions when the
10976         RemapToProxy flag is set.
10977
10978         * expression.cs (ParameterReference.EmitLdarg): Expose this useful
10979         function.
10980
10981         Add support for remapping parameters. 
10982
10983         * iterators.cs: Propagate parameter values;  Store parameter
10984         values in the proxy classes.
10985
10986 2003-05-04  Miguel de Icaza  <miguel@ximian.com>
10987
10988         * ecore.cs (FieldExpr): Fix an obvious bug.  static fields do not
10989         need a proxy reference;  I do not know what I was thinking
10990
10991         * cs-parser.jay (constructor_initializer): catch another error,
10992         and display nice message.
10993
10994         (field_declaration): catch void field declaration
10995         to flag a better error. 
10996
10997         * class.cs (MemberBase.CheckBase): Report an error instead of a
10998         warning if a new protected member is declared in a struct. 
10999         (Field.Define): catch the error of readonly/volatile.
11000
11001         * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
11002
11003         (FieldExpr.AddressOf): ditto.  Catch error where the address of a
11004         volatile variable is taken
11005
11006 2003-05-02  Miguel de Icaza  <miguel@ximian.com>
11007
11008         * statement.cs (Fixed.Resolve): Report an error if we are not in
11009         an unsafe context.
11010
11011 2003-05-01  Miguel de Icaza  <miguel@ximian.com>
11012
11013         * typemanager.cs: reuse the code that handles type clashes for
11014         delegates and enumerations.
11015
11016         * class.cs (Report28): Always report.
11017
11018         * expression.cs (EncodeAsAttribute): Allow nulls here.
11019
11020 2003-04-28  Miguel de Icaza  <miguel@ximian.com>
11021
11022         * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
11023         the functionality for testing whether an expression is valid for
11024         an attribute here.  Also handle the case of arrays of elements
11025         being stored. 
11026
11027         * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
11028         encoding a linear array into an array of objects that are suitable
11029         to be passed to an CustomAttributeBuilder.
11030
11031         * delegate.cs: Check unsafe types being used outside of an Unsafe context.
11032
11033         * ecore.cs: (FieldExpr): Handle field remapping here.
11034
11035         * iteratators.cs: Pass the instance variable (if the method is an
11036         instance method) to the constructors, so we can access the field
11037         variables on the class.
11038
11039         TODO: Test this with structs.  I think the THIS variable on
11040         structs might have to be a pointer, and not a refenrece
11041
11042 2003-04-27  Miguel de Icaza  <miguel@ximian.com>
11043
11044         * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
11045         local variables to fields in a proxy class.
11046
11047         * iterators.cs (PopulateProxy): Rename our internal fields to
11048         <XXX>.  
11049         Create a <THIS> field if we are an instance method, so we can
11050         reference our parent container variables.
11051         (MapVariable): Called back from the EmitContext code to enter a
11052         new variable to field mapping into the proxy class (we just create
11053         a FieldBuilder).
11054
11055         * expression.cs
11056         (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
11057         for using the remapped locals to fields.
11058
11059         I placed the code here, because that gives the same semantics to
11060         local variables, and only changes the Emit code.
11061
11062         * statement.cs (Fixed.Resolve): it is not allowed to have fixed
11063         statements inside iterators.
11064         (VariableInfo): Add a FieldBuilder for the cases when we are
11065         remapping local variables to fields in a proxy class
11066
11067         * ecore.cs (SimpleNameResolve): Avoid testing two times for
11068         current_block != null.
11069
11070         * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
11071         not cope with strings, as it has been moved to the
11072         TableSwitchEmit.  Fixed bug in switch generation.
11073
11074         * expression.cs (New.DoResolve): Provide more context for the user
11075         when reporting an error.
11076
11077         * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
11078         pointers. 
11079
11080         * expression.cs (MemberAccess.DoResolve): When we get a type back,
11081         check the permissions for it.  Note than in a type-resolution
11082         context the check was already present in DeclSpace.ResolveType,
11083         but was missing from the MemberAccess.
11084
11085         (ArrayCreation.CheckIndices): warn if the user has
11086         more nested levels of expressions, but there are no more
11087         dimensions specified.  Avoids crash on bug 41906.
11088
11089 2003-04-26  Miguel de Icaza  <miguel@ximian.com>
11090
11091         * statement.cs (Block): replace Implicit bool, for a generic
11092         flags.   
11093         New flag: `Unchecked'.  This is used during the EmitMeta phase
11094         (which is out-of-line with the regular Resolve/Emit process for a
11095         statement, as this is done ahead of time, but still gets a chance
11096         to call constant resolve).
11097
11098         (Block.Flags): new enum for adding a new flag.
11099
11100         (Block.EmitMeta): track the state of unchecked.
11101
11102         (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
11103         to enable constant resolution to work there as well.
11104
11105 2003-04-22  Miguel de Icaza  <miguel@ximian.com>
11106
11107         * typemanager.cs (ienumerable_type): Also look up
11108         System.Collections.IEnumerable. 
11109
11110 2003-04-21  Miguel de Icaza  <miguel@ximian.com>
11111
11112         TODO: Test more than one conditional per method.
11113
11114         * class.cs (Indexer.Define): Report the location where the user is
11115         referencing the unsupported feature.
11116
11117         (MethodData): Overload the use of `conditionals' to
11118         minimize the creation of needless ArrayLists.   This saves roughly
11119         212kb on my machine.
11120
11121         (Method): Implement the new IIteratorContainer interface.
11122         (Method.SetYields): Implement the method by setting the ModFlags
11123         to contain METHOD_YIELDS.
11124
11125         * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
11126         which just got set to null.
11127
11128         * iterators.cs: New file.
11129
11130         (Yield, YieldBreak): New statements.
11131
11132         * statement.cs (Return.Resolve): Flag an error if we are used in
11133         an iterator method.
11134
11135         * codegen.cs (InIterator): New flag set if the code is being
11136         compiled in an iterator method.
11137
11138         * modifiers.cs: New flag METHOD_YIELDS.  This modifier is an
11139         internal modifier, and we just use it to avoid adding extra
11140         fields, as this is seldom used.  
11141
11142         * cs-parser.jay: Add yield_statement (yield and yield break).
11143
11144         * driver.cs: New flag -v2 to turn on version 2 features. 
11145
11146         * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
11147         hashtable when v2 is enabled.
11148
11149 2003-04-20  Miguel de Icaza  <miguel@ximian.com>
11150
11151         * typemanager.cs (TypeManager.NamespaceClash): Use to check if
11152         there is already a namespace defined with this name.
11153
11154         (TypeManager.InitCoreTypes): Remove the temporary workaround, as
11155         people upgraded their corlibs.
11156
11157         (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
11158         always use fully qualified types, no need to use the compiler
11159         front end.
11160
11161         (TypeManager.IsNamespace): Use binarysearch.
11162
11163         * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
11164         AddDelegate): I did not quite use the new IsValid API properly: I
11165         have to pass the short-name and the fullname.  I was passing only
11166         the basename instead of the fullname sometimes. 
11167
11168         (TypeContainer.DefineType): call NamespaceClash.
11169
11170         * interface.cs (Interface.DefineType): use NamespaceClash before
11171         defining the type.
11172
11173         * delegate.cs (Delegate.DefineType): use NamespaceClash before
11174         defining the type.
11175
11176         * enum.cs: (Enum.DefineType): use NamespaceClash before
11177         defining the type.
11178
11179         * typemanager.cs (: 3-line patch that gives us some tasty 11%
11180         speed increase.  First, use the negative_hits cache when we get a
11181         negative.  Second, add the type with its full original name
11182         instead of the new . and + encoded name (reflection uses + to
11183         separate type from a nested type).  Use LookupTypeReflection
11184         directly which bypasses the type->name hashtable (that we already
11185         know does not contain the type.
11186
11187         * decl.cs (DeclSpace.ResolveTypeExpr): track the
11188         location/container type. 
11189
11190         * driver.cs: When passing utf8, use directly the UTF8Encoding.
11191
11192 2003-04-19  Miguel de Icaza  <miguel@ximian.com>
11193
11194         * decl.cs (ResolveTypeExpr): Mirror check acess here too.
11195
11196         * delegate.cs (NewDelegate.Resolve): Test whether an instance
11197         method is being referenced in the method group from a static
11198         context, and report error 120 if so.
11199
11200         * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
11201         Error118. 
11202
11203         * typemanager.cs: Add intermediate namespaces (if a namespace A.B
11204         is created, we create the A namespace).
11205
11206         * cs-parser.jay: A namespace also introduces a DeclarationFound.
11207         Fixes #41591
11208
11209 2003-04-18  Miguel de Icaza  <miguel@ximian.com>
11210
11211         * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
11212         invocation to ModuleBuilder.GetType with the same values will
11213         return a new type instance, so we need to cache its return
11214         values. 
11215
11216         * expression.cs (Binary.ResolveOperator): Only allow the compare
11217         operators on enums if they are of the same type.
11218
11219         * ecore.cs (Expression.ImplicitReferenceConversion): handle target
11220         types of ValueType on their own case.  Before we were giving them
11221         the same treatment as objects.
11222
11223         * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
11224         fullname.  Short name is used to compare against container name.
11225         Fullname is used to check against defined namespace names.
11226
11227         * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
11228         AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
11229
11230         (Method.CheckBase): Call parent.
11231         (MemberBase.CheckBase): Check for protected members on sealed
11232         classes.
11233         (PropertyBase.CheckBase): Call parent.
11234         (Field.Define): Call parent.
11235
11236         * report.cs: Negative error codes are now mapped to 8000 - code,
11237         so that the display is render more nicely.
11238
11239         * typemanager.cs: Do not use try/catch, instead report a regular
11240         error. 
11241
11242         (GetPointerType, GetReferenceType): These methods provide
11243         mechanisms to obtain the T* and T& from a T.  We had the code
11244         previously scattered around the code base, and it also used
11245         TypeManager.LookupType that would go through plenty of caches.
11246         This one goes directly to the type source.
11247
11248         In some places we did the Type.GetType followed by
11249         ModuleBuilder.GetType, but not in others, so this unifies the
11250         processing as well.
11251
11252         * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
11253         statements now that we have namespace information.
11254
11255         * typemanager.cs (IsNamespace): New method, returns whether the
11256         string presented is a namespace or not.
11257
11258         (ComputeNamespaces): New public entry point, computes the list of
11259         available namespaces, using the GetNamespaces API call in Mono, or
11260         the slower version in MS.NET.   
11261
11262         Now before we start the semantic analysis phase, we have a
11263         complete list of namespaces including everything that the user has
11264         provided.
11265
11266         Deleted old code to cache namespaces in .nsc files.
11267
11268 2003-04-17  Miguel de Icaza  <miguel@ximian.com>
11269
11270         * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
11271         class/struct location definition Location for the implicit
11272         constructor location.
11273
11274         (Operator.Define): Use the location of the operator for the
11275         implicit Method definition.
11276
11277         (Constructor.Emit): use the constructor location for the implicit
11278         base initializer constructor.
11279
11280         * ecore.cs: Remove ITypeExpression.  This interface is now gone,
11281         and the Expression class now contains two new methods:
11282
11283         ResolveAsTypeStep and ResolveAsTypeTerminal.  This is used to
11284         isolate type lookup from the rest of the resolution process.
11285
11286         Since we use Expressions to hold type definitions due to the way
11287         we parse the input we have historically overloaded Resolve to
11288         perform the Type lookups if a special flag is passed.  Now this is
11289         eliminated and two methods take their place. 
11290
11291         The differences in the two methods between xStep and xTerminal is
11292         that xStep is involved in our current lookup system that uses
11293         SimpleNames to compose a name, while xTerminal is used just to
11294         catch the case where the simplename lookup failed.
11295
11296 2003-04-16  Miguel de Icaza  <miguel@ximian.com>
11297
11298         * expression.cs (ResolveMemberAccess): Remove redundant code.
11299         TypeExpr expressions are always born fully resolved.
11300
11301         * interface.cs (PopulateMethod): Do not lookup the types twice.
11302         We were doing it once during SemanticAnalysis and once during
11303         PopulateMethod.
11304
11305         * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
11306         in local variable type definitions, were being returned as a
11307         SimpleName (we decomposed everything into a string), that is
11308         because primary_expression was being used instead of a type in the
11309         grammar (reduce/reduce conflicts).
11310
11311         The part that was wrong is that we converted the expression into a
11312         string (an oversimplification in one hand, compounded with primary
11313         expressions doing string concatenation).
11314
11315         So things like:
11316
11317         A.B.C [] x;
11318
11319         Would return "A.B.C[]" as a SimpleName.  This stopped things like
11320         using clauses from working on this particular context.  And a type
11321         was being matched directly against "A.B.C[]".
11322
11323         We now use the correct approach, and allow for ComposedCast to be
11324         part of the unary expression.  So the "A.B.C []" become a composed
11325         cast of "A.B.C" (as a nested group of MemberAccess with a
11326         SimpleName at the end) plus the rank composition "[]". 
11327
11328         Also fixes 35567
11329
11330 2003-04-10  Miguel de Icaza  <miguel@ximian.com>
11331
11332         * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
11333         for the access level checking.
11334
11335         * class.cs: Cosmetic changes.  Renamed `TypeContainer parent' to
11336         `TypeContainer container', because I kept getting confused when I
11337         was debugging this code.
11338
11339         * expression.cs (Indexers): Instead of tracking getters/setters,
11340         we now track them in parallel.  We create one arraylist less, but
11341         most importantly it is possible now for the LValue code to find a
11342         matching get for a set.
11343
11344         (IndexerAccess.DoResolveLValue): Update the code.
11345         GetIndexersForType has been modified already to extract all the
11346         indexers from a type.  The code assumed it did not.
11347
11348         Also make the code set the correct return type for the indexer.
11349         This was fixed a long time ago for properties, but was missing for
11350         indexers.  It used to be void_type.
11351
11352         (Binary.Emit): Test first for doubles instead of
11353         floats, as they are more common.
11354
11355         (Binary.EmitBranchable): Use the .un version of the branch opcodes
11356         when dealing with floats and the <=, >= operators.  This fixes bug
11357         #39314 
11358
11359         * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
11360         to load the array value by emitting a load on the foreach variable
11361         type.  This was incorrect.  
11362
11363         We now emit the code to load an element using the the array
11364         variable type, and then we emit the conversion operator.
11365
11366         Fixed #40176
11367
11368 2003-04-10  Zoltan Varga  <vargaz@freemail.hu>
11369
11370         * attribute.cs: Avoid allocation of ArrayLists in the common case.
11371
11372 2003-04-09  Miguel de Icaza  <miguel@ximian.com>
11373
11374         * class.cs (MethodSignature.InheritableMemberSignatureCompare):
11375         test for protection before we test for signatures. 
11376
11377         (MethodSignature.ToString): implement.
11378
11379         * expression.cs (Unary.TryReduceNegative): Add missing minus sign
11380         to the case where we reduced into a LongConstant.
11381
11382         * decl.cs (CheckAccessLevel): If the type is an array, we can not
11383         depend on whether the information is acurrate, because the
11384         Microsoft runtime will always claim that the array type is public,
11385         regardless of the real state.
11386
11387         If the type is a pointer, another problem happens: the type is
11388         reported as non-public in Microsoft.  
11389
11390         In both cases we have to call CheckAccessLevel recursively with
11391         the underlying type as the argument to be tested.
11392
11393 2003-04-08  Miguel de Icaza  <miguel@ximian.com>
11394
11395         * assign.cs (Assign.Emit): If we are dealing with a compound
11396         assignment expression, we should use the code path that stores the
11397         intermediate result in a temporary value.  This fixes #40903.
11398
11399         *expression.cs (Indirection.ToString): Provide ToString method for
11400         debugging. 
11401
11402 2003-04-08  Zoltan Varga  <vargaz@freemail.hu>
11403
11404         * class.cs: Null out fields holding references to Block objects so
11405         they can be garbage collected.
11406
11407         * expression.cs (OverloadResolve): Remove unused local.
11408
11409 2003-04-07  Martin Baulig  <martin@ximian.com>
11410
11411         * codegen.cs (EmitContext.CurrentFile): New public field.
11412         (EmitContext.Mark): Use the CurrentFile to check whether the
11413         location is in the correct file.
11414         (EmitContext.EmitTopBlock): Initialize CurrentFile here.
11415
11416 2003-04-07  Martin Baulig  <martin@ximian.com>
11417
11418         * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
11419
11420         * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
11421         location.  [FIXME: The location argument which gets passed to this
11422         method is sometimes wrong!]
11423
11424 2003-04-07  Nick Drochak <ndrochak@gol.com>
11425
11426         * codegen.cs: Be more verbose when we can't find the symbol writer dll.
11427
11428 2003-04-07  Miguel de Icaza  <miguel@ximian.com>
11429
11430         * expression.cs (Indirection.EmitAssign): We were using the
11431         temporary, but returning immediately instead of continuing the
11432         EmitAssing flow.
11433
11434 2003-04-06  Martin Baulig  <martin@ximian.com>
11435
11436         * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
11437         if it's a nested child, but also deriving from the outer class.
11438         See test 190.cs.
11439
11440         * typemanager.cs (IsNestedChildOf): Make this work if it's a
11441         nested child, but also deriving from the outer class.  See
11442         test-190.cs.
11443         (FilterWithClosure): We may access private members of the outer
11444         class if we're a nested child and deriving from the outer class.
11445         (RealMemberLookup): Only set `closure_private_ok' if the
11446         `original_bf' contained BindingFlags.NonPublic.
11447
11448 2003-04-05  Martin Baulig  <martin@ximian.com>
11449
11450         * expression.cs (SizeOf.DoResolve): Use ResolveTypeExpr, so we can
11451         probe if its a type parameter, and if so, flag an error.
11452
11453         * decl.cs: Move here the SetParameterInfo code from class.cs.
11454         Handle IsGeneric here.
11455
11456         Handle a variety of errors in the parameter info definition.
11457
11458         * ecore.cs (SimpleName.DoResolveType): Handle look ups for generic
11459         type parameters here.
11460
11461         * cs-parser.jay (class_declaration): report errors for parameters
11462         here as well.
11463
11464 2003-01-21  Miguel de Icaza  <miguel@ximian.com>
11465
11466         * generic.cs: New file, contains support code for generics.
11467
11468         * cs-parser.jay: Remove OP_SHIFT_LEFT, OP_SHIFT_RIGHT,
11469         OP_SHIFT_LEFT_ASSIGN, OP_SHIFT_RIGHT_ASSIGN.
11470
11471         Update parser for the above removals.
11472
11473         * cs-tokenizer.cs: Do not handle <<= or >>= specially.  This is
11474         now taken care of in the parser.
11475
11476 2003-04-02  Miguel de Icaza  <miguel@ximian.com>
11477
11478         * class.cs (Event.Define): Do not allow abstract events to have
11479         initializers. 
11480
11481 2003-04-01  Miguel de Icaza  <miguel@ximian.com>
11482
11483         * cs-parser.jay: Add error productions for ADD/REMOVE missing a
11484         block in event declarations.
11485
11486         * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
11487         value type, get its address.
11488
11489         * expression.cs (Is.Emit): For action `LeaveOnStack' we were
11490         leaving a class on the stack instead of a boolean value (int
11491         0/1).  Change the code so we compare against null, and then the
11492         result against zero.
11493
11494         * class.cs (TypeContainer.GetClassBases): We were checking for the
11495         parent class being sealed too late.
11496
11497         * expression.cs (Binary.Emit): For <= and >= when dealing with
11498         floating point values, use cgt.un and clt.un instead of cgt and
11499         clt alone.
11500
11501 2003-04-01  Zoltan Varga  <vargaz@freemail.hu>
11502
11503         * statement.cs: Apply the same optimization as MS: skip the 
11504         GetEnumerator returning an IEnumerator, and use the one returning a 
11505         CharEnumerator instead. This allows us to avoid the try-finally block 
11506         and the boxing.
11507
11508 2003-03-31  Gaurav Vaish <gvaish_mono@lycos.com>
11509
11510         * cs-parser.jay: Attributes cannot be applied to
11511                          namespaces. Fixes #40473
11512
11513 2003-03-31  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11514
11515         * class.cs:
11516         (Add*): check if the name is valid using the full name for constants,
11517         fields, properties and events.
11518
11519 2003-03-28  Miguel de Icaza  <miguel@ximian.com>
11520
11521         * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
11522         char constants to be part of the enumeration.
11523
11524         * expression.cs (Conditional.DoResolve): Add support for operator
11525         true. Implements the missing functionality from 14.12
11526
11527         * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
11528         operator true/false as required by the spec.
11529
11530         * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
11531         implicit conversion to boolean.
11532
11533         * statement.cs (Statement.ResolveBoolean): A boolean expression is
11534         also one where the type implements `operator true'. 
11535
11536         * ecore.cs (Expression.GetOperatorTrue): New helper routine to
11537         get an expression that will invoke operator true based on an
11538         expression.  
11539
11540         (GetConversionOperators): Removed the hack that called op_True
11541         here.  
11542
11543         (Expression.ResolveBoolean): Move this from Statement.
11544
11545 2003-03-17  Miguel de Icaza  <miguel@ximian.com>
11546
11547         * ecore.cs (FieldExpr): do not allow initialization of initonly
11548         fields on derived classes
11549
11550 2003-03-13  Martin Baulig  <martin@ximian.com>
11551
11552         * statement.cs (Block.Emit): Call ig.BeginScope() and
11553         ig.EndScope() when compiling with debugging info; call
11554         LocalBuilder.SetLocalSymInfo _after_ opening the scope.
11555
11556 2003-03-08  Miguel de Icaza  <miguel@ximian.com>
11557
11558         * expression.cs (Indexers): Do not construct immediately, allow
11559         for new members to be appended as we go.  Fixes 38143
11560
11561 2003-03-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11562
11563         * expression.cs: save/restore context when resolving an unchecked
11564         expression.
11565
11566 2003-03-05  Miguel de Icaza  <miguel@ximian.com>
11567
11568         * cfold.cs: Catch division by zero in modulus operator during
11569         constant folding.
11570
11571 2003-03-03  Miguel de Icaza  <miguel@ximian.com>
11572
11573         * interface.cs (Interface.DefineMembers): Avoid defining members
11574         twice. 
11575
11576 2003-02-27  Miguel de Icaza  <miguel@ximian.com>
11577
11578         * driver.cs: handle the +/- options for -noconfig
11579
11580         * statement.cs (Unckeched.Resolve): Also track the state of
11581         unchecked in the Resolve phase.
11582
11583 2003-02-27  Martin Baulig  <martin@ximian.com>
11584
11585         * ecore.cs (Expression.MemberLookup): Don't create a
11586         MethodGroupExpr for something which is not a method.  Fixes #38291.
11587
11588 2003-02-25  Miguel de Icaza  <miguel@ximian.com>
11589
11590         * class.cs (MemberBase.CheckParameters): Also check that the type
11591         is unmanaged if it is a pointer.
11592
11593         * expression.cs (SizeOf.Resolve): Add location information.
11594
11595         * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
11596         a managed type is declared.
11597
11598         * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
11599         parameter modifiers as well.  Fixes bug 38606
11600
11601         * class.cs: Very sad.  Am backing out the speed up changes
11602         introduced by the ArrayList -> Array in the TypeContainer, as they
11603         were not actually that much faster, and introduced a bug (no error
11604         reports on duplicated methods).
11605
11606         * assign.cs (CompoundAssign.DoLResolve): Resolve the original
11607         source first, this will guarantee that we have a valid expression
11608         before calling in lower levels functions that will require a
11609         resolved object.  Then use this original_source in the
11610         target.ResolveLValue instead of the original source that was
11611         passed to us.
11612
11613         Another change.  Use target.Resolve instead of LValueResolve.
11614         Although we are resolving for LValues, we will let the Assign code
11615         take care of that (it will be called again from Resolve).  This
11616         basically allows code like this:
11617
11618         class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
11619         class Y { void A (X x) { x [0] += o; }
11620
11621         The problem was that the indexer was trying to resolve for
11622         set_Item (idx, object o) and never finding one.  The real set_Item
11623         was set_Item (idx, X).  By delaying the process we get the right
11624         semantics. 
11625
11626         Fixes bug 36505
11627
11628 2003-02-23  Martin Baulig  <martin@ximian.com>
11629
11630         * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
11631         while calling DoEmit ().
11632
11633         * codegen.cs (EmitContext.Mark): Don't mark locations in other
11634         source files; if you use the #line directive inside a method, the
11635         compiler stops emitting line numbers for the debugger until it
11636         reaches the end of the method or another #line directive which
11637         restores the original file.
11638
11639 2003-02-23  Martin Baulig  <martin@ximian.com>
11640
11641         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
11642
11643 2003-02-23  Martin Baulig  <martin@ximian.com>
11644
11645         * statement.cs (Block.AddChildVariableNames): We need to call this
11646         recursively, not just for our immediate children.
11647
11648 2003-02-23  Martin Baulig  <martin@ximian.com>
11649
11650         * class.cs (Event.Define): Always make the field private, like csc does.
11651
11652         * typemanager.cs (TypeManager.RealMemberLookup): Make events
11653         actually work, fixes bug #37521.
11654
11655 2003-02-23  Miguel de Icaza  <miguel@ximian.com>
11656
11657         * delegate.cs: When creating the various temporary "Parameters"
11658         classes, make sure that we call the ComputeAndDefineParameterTypes
11659         on those new parameters (just like we do with the formal ones), to
11660         allow them to be resolved in the context of the DeclSpace.
11661
11662         This fixes the bug that Dick observed in Bugzilla #38530.
11663
11664 2003-02-22  Miguel de Icaza  <miguel@ximian.com>
11665
11666         * expression.cs (ResolveMemberAccess): When resolving a constant,
11667         do not attempt to pull a constant if the value was not able to
11668         generate a valid constant.
11669
11670         * const.cs (LookupConstantValue): Do not report more errors than required.
11671
11672 2003-02-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11673
11674         * expression.cs: fixes bug #38328.
11675
11676 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
11677
11678         * class.cs: Changed all the various members that can be part of a
11679         class from being an ArrayList to be an Array of the right type.
11680         During the DefineType type_list, interface_list, delegate_list and
11681         enum_list are turned into types, interfaces, delegates and enums
11682         arrays.  
11683
11684         And during the member population, indexer_list, event_list,
11685         constant_list, field_list, instance_constructor_list, method_list,
11686         operator_list and property_list are turned into their real arrays.
11687
11688         Although we could probably perform this operation earlier, for
11689         good error reporting we need to keep the lists and remove the
11690         lists for longer than required.
11691
11692         This optimization was triggered by Paolo profiling the compiler
11693         speed on the output of `gen-sample-program.pl' perl script. 
11694
11695         * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
11696         not crash in methods like MemberLookupFailed that use this field.  
11697
11698         This problem arises when the compiler fails to resolve a type
11699         during interface type definition for example.
11700
11701 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
11702
11703         * expression.cs (Indexers.GetIndexersForType): Interfaces do not
11704         inherit from System.Object, so we have to stop at null, not only
11705         when reaching System.Object.
11706
11707 2003-02-17  Miguel de Icaza  <miguel@ximian.com>
11708
11709         * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
11710         DeclaredOnly because the parent indexer might have had a different
11711         name, but did not loop until the top of the hierarchy was reached.
11712
11713         The problem this one fixes is 35492: when a class implemented an
11714         indexer from an interface, we were getting the interface method
11715         (which was abstract) and we were flagging an error (can not invoke
11716         abstract method).
11717
11718         This also keeps bug 33089 functioning, and test-148 functioning.
11719
11720         * typemanager.cs (IsSpecialMethod): The correct way of figuring
11721         out if a method is special is to see if it is declared in a
11722         property or event, or whether it is one of the predefined operator
11723         names.   This should fix correctly #36804.
11724
11725 2003-02-15  Miguel de Icaza  <miguel@ximian.com>
11726
11727         The goal here is to remove the dependency on EmptyCast.Peel ().
11728         Killing it completely.
11729
11730         The problem is that currently in a number of places where
11731         constants are expected, we have to "probe" for an EmptyCast, and
11732         Peel, which is not the correct thing to do, as this will be
11733         repetitive and will likely lead to errors. 
11734
11735         The idea is to remove any EmptyCasts that are used in casts that
11736         can be reduced to constants, so we only have to cope with
11737         constants. 
11738
11739         This bug hunt was triggered by Bug 37363 and the desire to remove
11740         the duplicate pattern where we were "peeling" emptycasts to check
11741         whether they were constants.  Now constants will always be
11742         constants.
11743
11744         * ecore.cs: Use an enumconstant here instead of wrapping with
11745         EmptyCast.  
11746
11747         * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
11748         throwing me off.  By handling this we can get rid of a few hacks.
11749
11750         * statement.cs (Switch): Removed Peel() code.
11751
11752 2003-02-14  Miguel de Icaza  <miguel@ximian.com>
11753
11754         * class.cs: Location information for error 508
11755
11756         * expression.cs (New.DoResolve): Add a guard against double
11757         resolution of an expression.  
11758
11759         The New DoResolve might be called twice when initializing field
11760         expressions (see EmitFieldInitializers, the call to
11761         GetInitializerExpression will perform a resolve on the expression,
11762         and later the assign will trigger another resolution
11763
11764         This leads to bugs (#37014)
11765
11766         * delegate.cs: The signature for EndInvoke should contain any ref
11767         or out parameters as well.  We were not doing this in the past. 
11768
11769         * class.cs (Field.Define): Do not overwrite the type definition
11770         inside the `volatile' group.  Turns out that volatile enumerations
11771         were changing the type here to perform a validity test, which
11772         broke conversions. 
11773
11774 2003-02-12  Miguel de Icaza  <miguel@ximian.com>
11775
11776         * ecore.cs (FieldExpr.AddressOf): In the particular case of This
11777         and structs, we do not want to load the instance variable
11778
11779         (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
11780         enum_type has to be handled like an object reference (implicit
11781         conversions exists from this to object), but the regular IsClass
11782         and IsValueType tests will never return true for this one.
11783
11784         Also we use TypeManager.IsValueType instead of type.IsValueType,
11785         just for consistency with the rest of the code (this is only
11786         needed if we ever use the construct exposed by test-180.cs inside
11787         corlib, which we dont today).
11788
11789 2003-02-12  Zoltan Varga  <vargaz@freemail.hu>
11790
11791         * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
11792         just InternalCall.
11793
11794 2003-02-09  Martin Baulig  <martin@ximian.com>
11795
11796         * namespace.cs (Namespace..ctor): Added SourceFile argument.
11797         (Namespace.DefineNamespaces): New static public method; this is
11798         called when we're compiling with debugging to add all namespaces
11799         to the symbol file.
11800
11801         * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
11802         pass it to the Namespace's .ctor.
11803
11804         * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
11805         and MethodBase arguments; pass the namespace ID to the symwriter;
11806         pass the MethodBase instead of the token to the symwriter.
11807         (SymbolWriter.DefineNamespace): New method to add a namespace to
11808         the symbol file.
11809
11810 2003-02-09  Martin Baulig  <martin@ximian.com>
11811
11812         * symbolwriter.cs: New file.  This is a wrapper around
11813         ISymbolWriter with a cleaner API.  We'll dynamically Invoke()
11814         methods here in near future.
11815
11816 2003-02-09  Martin Baulig  <martin@ximian.com>
11817
11818         * codegen.cs (EmitContext.Mark): Just pass the arguments to
11819         ILGenerator.MarkSequencePoint() which are actually used by the
11820         symbol writer.
11821
11822 2003-02-09  Martin Baulig  <martin@ximian.com>
11823
11824         * location.cs (SourceFile): New public sealed class.  This
11825         contains the name and an index which is used in the location's token.
11826         (Location): Reserve an appropriate number of bits in the token for
11827         the source file instead of walking over that list, this gives us a
11828         really huge performance improvement when compiling with debugging.
11829
11830         * driver.cs (Driver.parse, Driver.tokenize_file): Take a
11831         `SourceFile' argument instead of a string.
11832         (Driver.ProcessFile): Add all the files via Location.AddFile(),
11833         but don't parse/tokenize here, we need to generate the list of all
11834         source files before we do that.
11835         (Driver.ProcessFiles): New static function.  Parses/tokenizes all
11836         the files.
11837
11838         * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
11839         instead of a string.
11840
11841         * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
11842         of a string.
11843
11844 2003-02-09  Martin Baulig  <martin@ximian.com>
11845
11846         * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
11847         filename on `#line default'.
11848
11849 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
11850
11851         * statement.cs: don't clear the pinned var when the fixed statement
11852         returns from the method (fixes bug#37752).
11853
11854 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
11855
11856         * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban) 
11857         to IsValueType.
11858
11859 2003-02-07  Martin Baulig  <martin@ximian.com>
11860
11861         * driver.cs: Removed the `--debug-args' command line argument.
11862
11863         * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
11864         automatically by the AsssemblyBuilder.
11865         (CodeGen.InitializeSymbolWriter): We don't need to call any
11866         initialization function on the symbol writer anymore.  This method
11867         doesn't take any arguments.
11868
11869 2003-02-03  Miguel de Icaza  <miguel@ximian.com>
11870
11871         * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
11872         from referenced assemblies as well.
11873
11874 2003-02-02  Martin Baulig  <martin@ximian.com>
11875
11876         * class.cs (MethodData.Emit): Generate debugging info for external methods.
11877
11878 2003-02-02  Martin Baulig  <martin@ximian.com>
11879
11880         * class.cs (Constructor.Emit): Open the symbol writer before
11881         emitting the constructor initializer.
11882         (ConstructorInitializer.Emit): Call ec.Mark() to allow
11883         single-stepping through constructor initializers.
11884
11885 2003-01-30  Miguel de Icaza  <miguel@ximian.com>
11886
11887         * class.cs: Handle error 549: do not allow virtual methods in
11888         sealed classes. 
11889
11890 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
11891
11892         * decl.cs: Check access levels when resolving types
11893
11894 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
11895
11896         * statement.cs: Add parameters and locals set in catch blocks that might 
11897         return to set vector
11898
11899 2003-01-29  Miguel de Icaza  <miguel@ximian.com>
11900
11901         * class.cs (Operator): Set the SpecialName flags for operators.
11902
11903         * expression.cs (Invocation.DoResolve): Only block calls to
11904         accessors and operators on SpecialName methods.
11905
11906         (Cast.TryReduce): Handle conversions from char constants.
11907
11908
11909 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
11910
11911         * statement.cs: small memory and time optimization in FlowBranching.
11912
11913 2003-01-28  Pedro Mart  <yoros@wanadoo.es>
11914
11915         * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
11916         problem that the last fix but in the other sid (Set).
11917
11918         * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
11919         access when there is no indexer in the hierarchy.
11920
11921 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
11922
11923         * class.cs: Combine some if statements.
11924
11925 2003-01-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11926
11927         * driver.cs: fixed bug #37187.
11928
11929 2003-01-27  Pedro Martinez Juliá  <yoros@wanadoo.es>
11930
11931         * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
11932         any indexer, it's needed to build a list with all the indexers in the
11933         hierarchy (AllGetters), else we have problems. Fixes #35653.
11934
11935 2003-01-23  Miguel de Icaza  <miguel@ximian.com>
11936
11937         * class.cs (MethodData.Define): It is wrong for an interface
11938         implementation to be static in both cases: explicit and implicit.
11939         We were only handling this in one case.
11940
11941         Improve the if situation there to not have negations.
11942
11943         * class.cs (Field.Define): Turns out that we do not need to check
11944         the unsafe bit on field definition, only on usage.  Remove the test.
11945
11946 2003-01-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11947
11948         * driver.cs: use assembly.Location instead of Codebase (the latest
11949         patch made mcs fail when using MS assemblies).
11950
11951 2003-01-21  Tim Haynes <thaynes@openlinksw.com>
11952
11953         * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
11954         get the path to *corlib.dll.
11955
11956 2003-01-21  Nick Drochak <ndrochak@gol.com>
11957
11958         * cs-tokenizer.cs:
11959         * pending.cs:
11960         * typemanager.cs: Remove compiler warnings
11961
11962 2003-01-20  Duncan Mak  <duncan@ximian.com>
11963
11964         * AssemblyInfo.cs: Bump the version number to 0.19.
11965
11966 2003-01-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11967
11968         * cs-tokenizer.cs: little fixes to line numbering when #line is used.
11969
11970 2003-01-18  Zoltan Varga  <vargaz@freemail.hu>
11971
11972         * class.cs (Constructor::Emit): Emit debugging info for constructors.
11973
11974 2003-01-17  Miguel de Icaza  <miguel@ximian.com>
11975
11976         * cs-parser.jay: Small fix: we were not comparing the constructor
11977         name correctly.   Thanks to Zoltan for the initial pointer.
11978
11979 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
11980
11981         * cs-tokenizer.cs: Set file name when specified with #line
11982
11983 2003-01-15  Miguel de Icaza  <miguel@ximian.com>
11984
11985         * cs-parser.jay: Only perform the constructor checks here if we
11986         are named like the class;  This will help provider a better
11987         error.  The constructor path is taken when a type definition is
11988         not found, but most likely the user forgot to add the type, so
11989         report that rather than the constructor error.
11990
11991 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
11992
11993         * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
11994         allocations.
11995
11996 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
11997
11998         * cs-parser.jay: Add cleanup call.
11999
12000 2003-01-13  Duncan Mak  <duncan@ximian.com>
12001
12002         * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
12003         consistent with other methods.
12004
12005 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
12006
12007         * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
12008
12009 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
12010
12011         * attribute.cs: only set GuidAttr to true when we have a
12012         GuidAttribute.
12013
12014 2003-01-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12015
12016         * ecore.cs:
12017         * expression.cs:
12018         * typemanager.cs: fixes to allow mcs compile corlib with the new
12019         Type.IsSubclassOf fix.
12020
12021 2003-01-08  Miguel de Icaza  <miguel@ximian.com>
12022
12023         * expression.cs (LocalVariableReference.DoResolve): Classify a
12024         constant as a value, not as a variable.   Also, set the type for
12025         the variable.
12026
12027         * cs-parser.jay (fixed_statement): take a type instead of a
12028         pointer_type, so we can produce a better error message later.
12029
12030         * statement.cs (Fixed.Resolve): Flag types that are not pointers
12031         as an error.  
12032
12033         (For.DoEmit): Make inifinite loops have a
12034         non-conditional branch back.
12035
12036         (Fixed.DoEmit): First populate the pinned variables, then emit the
12037         statement, then clear the variables.  Before I was emitting the
12038         code once for each fixed piece.
12039
12040
12041 2003-01-08  Martin Baulig  <martin@ximian.com>
12042
12043         * statement.cs (FlowBranching.MergeChild): A break in a
12044         SWITCH_SECTION does not leave a loop.  Fixes #36155.
12045
12046 2003-01-08  Martin Baulig  <martin@ximian.com>
12047
12048         * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
12049         lives in the same number space than `param_map'.  Fixes #36154.
12050
12051 2003-01-07  Miguel de Icaza  <miguel@ximian.com>
12052
12053         * cs-parser.jay (constructor_declaration): Set the
12054         Constructor.ModFlags before probing for it.  This makes the
12055         compiler report 514, 515 and 132 (the code was there, but got
12056         broken). 
12057
12058         * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
12059         (GotoDefault.Resolve): Set `Returns' to ALWAYS.
12060         (GotoCase.Resolve): Set `Returns' to ALWAYS.
12061
12062 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
12063
12064         * enum.cs: create the enum static fields using the enum type.
12065
12066 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
12067
12068         * class.cs: don't try to create the ParamBuilder for the return
12069         type if it's not needed (and handle it breaking for the ms runtime
12070         anyway).
12071
12072 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
12073
12074         * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
12075
12076 2002-12-29  Miguel de Icaza  <miguel@ximian.com>
12077
12078         * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
12079         the command.   This showed up while compiling the JANET source
12080         code, which used \r as its only newline separator.
12081
12082 2002-12-28  Miguel de Icaza  <miguel@ximian.com>
12083
12084         * class.cs (Method.Define): If we are an operator (because it
12085         reuses our code), then set the SpecialName and HideBySig.  #36128
12086
12087 2002-12-22  Miguel de Icaza  <miguel@ximian.com>
12088
12089         * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
12090         exception, report error 120 `object reference required'.
12091
12092         * driver.cs: Add --pause option, used during to measure the size
12093         of the process as it goes with --timestamp.
12094
12095         * expression.cs (Invocation.DoResolve): Do not allow methods with
12096         SpecialName to be invoked.
12097
12098 2002-12-21  Miguel de Icaza  <miguel@ximian.com>
12099
12100         * cs-tokenizer.cs: Small fix to the parser: compute the ascii
12101         number before adding it.
12102
12103 2002-12-21  Ravi Pratap  <ravi@ximian.com>
12104
12105         * ecore.cs (StandardImplicitConversion): When in an unsafe
12106         context, we allow conversion between void * to any other pointer
12107         type. This fixes bug #35973.
12108
12109 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
12110
12111         * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
12112         is not thrown when extensionless outputs are used 
12113
12114 2002-12-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12115
12116         * rootcontext.cs: fixed compilation of corlib.
12117
12118 2002-12-19  Miguel de Icaza  <miguel@ximian.com>
12119
12120         * attribute.cs (Attributes.Contains): Add new method.
12121
12122         * class.cs (MethodCore.LabelParameters): if the parameter is an
12123         `out' parameter, check that no attribute `[In]' has been passed.
12124
12125         * enum.cs: Handle the `value__' name in an enumeration.
12126
12127 2002-12-14  Jaroslaw Kowalski <jarek@atm.com.pl>
12128
12129         * decl.cs: Added special case to allow overrides on "protected
12130         internal" methods
12131
12132 2002-12-18  Ravi Pratap  <ravi@ximian.com>
12133
12134         * attribute.cs (Attributes.AddAttributeSection): Rename to this
12135         since it makes much more sense.
12136
12137         (Attributes.ctor): Don't require a Location parameter.
12138
12139         * rootcontext.cs (AddGlobalAttributeSection): Rename again.
12140
12141         * attribute.cs (ApplyAttributes): Remove extra Location parameters
12142         since we already have that information per attribute.
12143
12144         * everywhere : make appropriate changes.
12145
12146         * class.cs (LabelParameters): Write the code which actually
12147         applies attributes to the return type. We can't do this on the MS
12148         .NET runtime so we flag a warning in the case an exception is
12149         thrown.
12150
12151 2002-12-18  Miguel de Icaza  <miguel@ximian.com>
12152
12153         * const.cs: Handle implicit null conversions here too.
12154
12155 2002-12-17  Ravi Pratap  <ravi@ximian.com>
12156
12157         * class.cs (MethodCore.LabelParameters): Remove the extra
12158         Type [] parameter since it is completely unnecessary. Instead
12159         pass in the method's attributes so that we can extract
12160         the "return" attribute.
12161
12162 2002-12-17  Miguel de Icaza  <miguel@ximian.com>
12163
12164         * cs-parser.jay (parse): Use Report.Error to flag errors instead
12165         of ignoring it and letting the compile continue.
12166
12167         * typemanager.cs (ChangeType): use an extra argument to return an
12168         error condition instead of throwing an exception.
12169
12170 2002-12-15  Miguel de Icaza  <miguel@ximian.com>
12171
12172         * expression.cs (Unary.TryReduce): mimic the code for the regular
12173         code path.  Perform an implicit cast in the cases where we can
12174         implicitly convert to one of the integral types, and then reduce
12175         based on that constant.   This fixes bug #35483.
12176
12177 2002-12-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12178
12179         * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
12180
12181 2002-12-13  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12182
12183         * namespace.cs: fixed bug #35489.
12184
12185 2002-12-12  Miguel de Icaza  <miguel@ximian.com>
12186
12187         * class.cs: Remove some dead code.
12188
12189         * cs-parser.jay: Estimate the number of methods needed
12190         (RootContext.MethodCount);
12191
12192         * cs-tokenizer.cs: Use char arrays for parsing identifiers and
12193         numbers instead of StringBuilders.
12194
12195         * support.cs (PtrHashtable): Add constructor with initial size;
12196         We can now reduce reallocations of the method table.
12197
12198 2002-12-10  Ravi Pratap  <ravi@ximian.com>
12199
12200         * attribute.cs (ApplyAttributes): Keep track of the emitted
12201         attributes on a per-target basis. This fixes bug #35413.
12202
12203 2002-12-10  Miguel de Icaza  <miguel@ximian.com>
12204
12205         * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
12206         default to the Windows 1252 encoding.
12207
12208         (UnixParseOption): Support version, thanks to Alp for the missing
12209         pointer. 
12210
12211         * AssemblyInfo.cs: Add nice assembly information.
12212
12213         * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
12214         (bug 35169).
12215
12216         * cs-parser.jay: Allow a trailing comma before the close bracked
12217         in the attribute_section production.
12218
12219         * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
12220         address of the instance was being taken, I will take this out,
12221         because we take the address of the object immediately here.
12222
12223 2002-12-09  Ravi Pratap  <ravi@ximian.com>
12224
12225         * typemanager.cs (AreMultipleAllowed): Take care of the most
12226         obvious case where attribute type is not in the current assembly -
12227         stupid me ;-)
12228
12229 2002-12-08  Miguel de Icaza  <miguel@ximian.com>
12230
12231         * ecore.cs (SimpleName.DoResolve): First perform lookups on using
12232         definitions, instead of doing that afterwards.  
12233
12234         Also we use a nice little hack, depending on the constructor, we
12235         know if we are a "composed" name or a simple name.  Hence, we
12236         avoid the IndexOf test, and we avoid 
12237
12238         * codegen.cs: Add code to assist in a bug reporter to track down
12239         the source of a compiler crash. 
12240
12241 2002-12-07  Ravi Pratap  <ravi@ximian.com>
12242
12243         * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
12244         types have been emitted for a given element and flag an error
12245         if something which does not have AllowMultiple set is used more
12246         than once.
12247
12248         * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
12249         attribute types and their corresponding AllowMultiple properties
12250
12251         (AreMultipleAllowed): Check the property for a given type.
12252
12253         * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
12254         property in the case we have a TypeContainer.
12255
12256         (Attributes.AddAttribute): Detect duplicates and just skip on
12257         adding them. This trivial fix catches a pretty gross error in our
12258         attribute emission - global attributes were being emitted twice!
12259
12260         Bugzilla bug #33187 is now fixed.
12261
12262 2002-12-06  Miguel de Icaza  <miguel@ximian.com>
12263
12264         * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
12265         instead of pp_and).
12266
12267         * expression.cs (Binary.ResolveOperator): I can only use the
12268         Concat (string, string, string) and Concat (string, string,
12269         string, string) if the child is actually a concatenation of
12270         strings. 
12271
12272 2002-12-04  Miguel de Icaza  <miguel@ximian.com>
12273
12274         * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
12275         context where we need a 2-character lookahead.
12276
12277         * pending.cs (PendingImplementation): Rework so we can keep track
12278         of interface types all the time, and flag those which were
12279         implemented by parents as optional.
12280
12281 2002-12-03  Miguel de Icaza  <miguel@ximian.com>
12282
12283         * expression.cs (Binary.ResolveOperator): Use
12284         String.Concat(string,string,string) or
12285         String.Concat(string,string,string,string) when possible. 
12286
12287         * typemanager: More helper methods.
12288
12289
12290 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
12291
12292         * pending.cs: remove the bogus return from GetMissingInterfaces()
12293         (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
12294
12295 2002-12-02  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12296
12297         * namespace.cs: avoid duplicated 'using xxx' being added to
12298         using_clauses. This prevents mcs from issuing and 'ambiguous type' error
12299         when we get more than one 'using' statement for the same namespace.
12300         Report a CS0105 warning for it.
12301
12302 2002-11-30  Miguel de Icaza  <miguel@ximian.com>
12303
12304         * cs-tokenizer.cs (consume_identifier): use read directly, instead
12305         of calling getChar/putback, uses internal knowledge of it.    
12306
12307         (xtoken): Reorder tokenizer so most common patterns are checked
12308         first.  This reduces the compilation time in another 5% (from 8.11s
12309         average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
12310
12311         The parsing time is 22% of the compilation in mcs, and from that
12312         64% is spent on the tokenization process.  
12313
12314         I tried using a binary search for keywords, but this is slower
12315         than the hashtable.  Another option would be to do a couple of
12316         things:
12317
12318                 * Not use a StringBuilder, instead use an array of chars,
12319                   with a set value.  Notice that this way we could catch
12320                   the 645 error without having to do it *afterwards*.
12321
12322                 * We could write a hand-parser to avoid the hashtable
12323                   compares altogether.
12324
12325         The identifier consumption process takes 37% of the tokenization
12326         time.  Another 15% is spent on is_number.  56% of the time spent
12327         on is_number is spent on Int64.Parse:
12328
12329                 * We could probably choose based on the string length to
12330                   use Int32.Parse or Int64.Parse and avoid all the 64-bit
12331                   computations. 
12332
12333         Another 3% is spend on wrapping `xtoken' in the `token' function.
12334
12335         Handle 0xa0 as whitespace (#34752)
12336
12337 2002-11-26  Miguel de Icaza  <miguel@ximian.com>
12338
12339         * typemanager.cs (IsCLRType): New routine to tell whether a type
12340         is one of the builtin types.  
12341
12342         Maybe it needs to use TypeCodes to be faster.  Maybe we could use
12343         typecode in more places instead of doing pointer comparissions.
12344         We could leverage some knowledge about the way the typecodes are
12345         laid out.
12346
12347         New code to cache namespaces in assemblies, it is currently not
12348         invoked, to be used soon.
12349
12350         * decl.cs (DeclSpace.MakeFQN): Simple optimization.
12351
12352         * expression.cs (Binary.ResolveOperator): specially handle
12353         strings, and do not perform user-defined operator overloading for
12354         built-in types.
12355
12356 2002-11-24  Miguel de Icaza  <miguel@ximian.com>
12357
12358         * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
12359         internalcall as it is a pretty simple operation;  Avoid whenever
12360         possible to call Char.IsLetter.
12361
12362         (consume_identifier): Cut by half the number of
12363         hashtable calls by merging the is_keyword and GetKeyword behavior.
12364
12365         Do not short-circuit, because if we do, we
12366         report errors (ie, #if false && true would produce an invalid
12367         directive error);
12368
12369
12370 2002-11-24  Martin Baulig  <martin@ximian.com>
12371
12372         * expression.cs (Cast.TryReduce): If we're in checked syntax,
12373         check constant ranges and report a CS0221.  Fixes #33186.
12374
12375 2002-11-24  Martin Baulig  <martin@ximian.com>
12376
12377         * cs-parser.jay: Make this work for uninitialized variable
12378         declarations in the `for' initializer.  Fixes #32416.
12379
12380 2002-11-24  Martin Baulig  <martin@ximian.com>
12381
12382         * ecore.cs (Expression.ConvertExplicit): Make casting from/to
12383         System.Enum actually work.  Fixes bug #32269, added verify-6.cs.
12384
12385 2002-11-24  Martin Baulig  <martin@ximian.com>
12386
12387         * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
12388         argument; if true, we also check for user-defined conversions.
12389         This is only needed if both arguments are of a user-defined type.
12390         Fixes #30443, added test-175.cs.
12391         (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
12392
12393         * ecore.cs (Expression.ImplicitUserConversionExists): New method.
12394
12395 2002-11-24  Martin Baulig  <martin@ximian.com>
12396
12397         * expression.cs (ArrayAccess.GetStoreOpcode): New public static
12398         function to get the store opcode.
12399         (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
12400         only emit the Ldelema if the store opcode is Stobj.  You must run
12401         both test-34 and test-167 to test this.  Fixes #34529.
12402
12403 2002-11-23  Martin Baulig  <martin@ximian.com>
12404
12405         * ecore.cs (Expression.MemberLookup): Added additional
12406         `qualifier_type' argument which is used when we're being called
12407         from MemberAccess.DoResolve() and null if we're called from a
12408         SimpleName lookup.
12409         (Expression.MemberLookupFailed): New method to report errors; this
12410         does the CS1540 check and reports the correct error message.
12411
12412         * typemanager.cs (MemberLookup): Added additional `qualifier_type'
12413         argument for the CS1540 check and redone the way how we're dealing
12414         with private members.  See the comment in the source code for details.
12415         (FilterWithClosure): Reverted this back to revision 1.197; renamed
12416         `closure_start_type' to `closure_qualifier_type' and check whether
12417         it's not null.  It was not this filter being broken, it was just
12418         being called with the wrong arguments.
12419
12420         * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
12421         and pass it the correct `qualifier_type'; this also does the error
12422         handling for us.
12423
12424 2002-11-22  Miguel de Icaza  <miguel@ximian.com>
12425
12426         * expression.cs (Invocation.EmitParams): If the we are dealing
12427         with a non-built-in value type, load its address as well.
12428
12429         (ArrayCreation): Use a a pretty constant instead
12430         of the hardcoded value 2.   Use 6 instead of 2 for the number of
12431         static initializers.  
12432
12433         (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
12434         because they are not really value types, just glorified integers. 
12435
12436         * driver.cs: Do not append .exe, the CSC compiler does not do it.
12437
12438         * ecore.cs: Remove redundant code for enumerations, make them use
12439         the same code path as everything else, fixes the casting issue
12440         with enumerations in Windows.Forms.
12441
12442         * attribute.cs: Do only cast to string if it is a string, the
12443         validation happens later.
12444
12445         * typemanager.cs: Temproary hack to avoid a bootstrap issue until
12446         people upgrade their corlibs.
12447
12448         * ecore.cs: Oops, enumerations were not following the entire code path
12449
12450 2002-11-21  Miguel de Icaza  <miguel@ximian.com>
12451
12452         * typemanager.cs (FilterWithClosure): Commented out the test for
12453         1540 in typemanager.cs, as it has problems when accessing
12454         protected methods from a parent class (see test-174.cs). 
12455
12456         * attribute.cs (Attribute.ValidateGuid): new method.
12457         (Attribute.Resolve): Use above.
12458
12459 2002-11-19  Miguel de Icaza  <miguel@ximian.com>
12460
12461         * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
12462
12463         * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
12464         handling for enumerations, as we only needed the TypeContainer
12465         functionality to begin with (this is required for the fix below to
12466         work for enums that reference constants in a container class for
12467         example). 
12468
12469         * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
12470
12471         * enum.cs (Enum.Define): Use `this' instead of parent, so we have
12472         a valid TypeBuilder to perform lookups on.o
12473
12474         * class.cs (InheritableMemberSignatureCompare): Use true in the
12475         call to GetGetMethod and GetSetMethod, because we are comparing
12476         the signature, and we need to get the methods *even* if they are
12477         private. 
12478
12479         (PropertyBase.CheckBase): ditto.
12480
12481         * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
12482         GotoCase.Resolve): Use Peel on EmpytCasts.
12483
12484         * ecore.cs (EmptyCast): drop child, add Peel method.
12485
12486 2002-11-17  Martin Baulig  <martin@ximian.com>
12487
12488         * ecore.cs (EmptyCast.Child): New public property.
12489
12490         * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
12491         label resolved to an EmptyCast.  Fixes #34162.
12492         (GotoCase.Resolve): Likewise.
12493         (Block.EmitMeta): Likewise.
12494
12495 2002-11-17  Martin Baulig  <martin@ximian.com>
12496
12497         * expression.cs (Invocation.BetterConversion): Prefer int over
12498         uint; short over ushort; long over ulong for integer literals.
12499         Use ImplicitConversionExists instead of StandardConversionExists
12500         since we also need to check for user-defined implicit conversions.
12501         Fixes #34165.  Added test-173.cs.
12502
12503 2002-11-16  Martin Baulig  <martin@ximian.com>
12504
12505         * expression.cs (Binary.EmitBranchable): Eliminate comparisions
12506         with the `true' and `false' literals.  Fixes #33151.
12507
12508 2002-11-16  Martin Baulig  <martin@ximian.com>
12509
12510         * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
12511         October 22nd; don't do the cs1540 check for static members.
12512
12513         * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
12514         now using our own filter here and doing the cs1540 check again.
12515
12516 2002-11-16  Martin Baulig  <martin@ximian.com>
12517
12518         * support.cs (InternalParameters): Don't crash if we don't have
12519         any fixed parameters.  Fixes #33532.
12520
12521 2002-11-16  Martin Baulig  <martin@ximian.com>
12522
12523         * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
12524         when looking up static methods to make this work on Windows.
12525         Fixes #33773.
12526
12527 2002-11-16  Martin Baulig  <martin@ximian.com>
12528
12529         * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
12530         a setter rather than using PropertyInfo.CanWrite.
12531
12532 2002-11-15  Nick Drochak  <ndrochak@gol.com>
12533
12534         * class.cs: Allow acces to block member by subclasses. Fixes build
12535         breaker.
12536
12537 2002-11-14  Martin Baulig  <martin@ximian.com>
12538
12539         * class.cs (Constructor.Emit): Added the extern/block check.
12540         Fixes bug #33678.
12541
12542 2002-11-14  Martin Baulig  <martin@ximian.com>
12543
12544         * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
12545         iteration while looking for indexers, this is needed because the
12546         indexer may have a different name in our base classes.  Fixed the
12547         error reporting (no indexers at all, not get accessor, no
12548         overloaded match).  Fixes bug #33089.
12549         (IndexerAccess.DoResolveLValue): Likewise.
12550
12551 2002-11-14  Martin Baulig  <martin@ximian.com>
12552
12553         * class.cs (PropertyBase.CheckBase): Make this work for multiple
12554         indexers.  Fixes the first part of bug #33089.
12555         (MethodSignature.InheritableMemberSignatureCompare): Added support
12556         for properties.
12557
12558 2002-11-13  Ravi Pratap  <ravi@ximian.com>
12559
12560         * attribute.cs (Attribute.Resolve): Catch the
12561         NullReferenceException and report it since it isn't supposed to
12562         happen. 
12563
12564 2002-11-12  Miguel de Icaza  <miguel@ximian.com>
12565
12566         * expression.cs (Binary.EmitBranchable): Also handle the cases for
12567         LogicalOr and LogicalAnd that can benefit from recursively
12568         handling EmitBranchable.  The code now should be nice for Paolo.
12569
12570 2002-11-08  Miguel de Icaza  <miguel@ximian.com>
12571
12572         * typemanager.cs (LookupType): Added a negative-hit hashtable for
12573         the Type lookups, as we perform quite a number of lookups on
12574         non-Types.  This can be removed once we can deterministically tell
12575         whether we have a type or a namespace in advance.
12576
12577         But this might require special hacks from our corlib.
12578
12579         * TODO: updated.
12580
12581         * ecore.cs (TryImplicitIntConversion): Handle conversions to float
12582         and double which avoids a conversion from an integer to a double.
12583
12584         * expression.cs: tiny optimization, avoid calling IsConstant,
12585         because it effectively performs the lookup twice.
12586
12587 2002-11-06  Miguel de Icaza  <miguel@ximian.com>
12588
12589         But a bogus return here to keep the semantics of the old code
12590         until the Mono runtime is fixed.
12591
12592         * pending.cs (GetMissingInterfaces): New method used to remove all
12593         the interfaces that are already implemented by our parent
12594         classes from the list of pending methods. 
12595
12596         * interface.cs: Add checks for calls after ResolveTypeExpr.
12597
12598 2002-11-05  Miguel de Icaza  <miguel@ximian.com>
12599
12600         * class.cs (Class.Emit): Report warning 67: event not used if the
12601         warning level is beyond 3.
12602
12603         * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
12604         being a NullLiteral.
12605
12606         * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
12607         specifiers. 
12608
12609         * class.cs (TypeContainer.GetClassBases): Cover a missing code
12610         path that might fail if a type can not be resolved.
12611
12612         * expression.cs (Binary.Emit): Emit unsigned versions of the
12613         operators. 
12614
12615         * driver.cs: use error 5.
12616
12617 2002-11-02  Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
12618
12619         * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
12620
12621 2002-11-01  Miguel de Icaza  <miguel@ximian.com>
12622
12623         * cs-parser.jay (switch_section): A beautiful patch from Martin
12624         Baulig that fixed 33094.
12625
12626 2002-10-31  Miguel de Icaza  <miguel@ximian.com>
12627
12628         * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
12629         Check whether the base is abstract and report an error if so.
12630
12631         * expression.cs (IndexerAccess.DoResolveLValue,
12632         IndexerAccess.DoResolve): ditto. 
12633
12634         (Invocation.DoResolve): ditto.
12635
12636         (Invocation.FullMethodDesc): Improve the report string.
12637
12638         * statement.cs (Block): Eliminate IsVariableDefined as it is
12639         basically just a wrapper for GetVariableInfo.
12640
12641         * ecore.cs (SimpleName): Use new 
12642
12643         * support.cs (ReflectionParamter.ParameterType): We unwrap the
12644         type, as we return the actual parameter ref/unref state on a
12645         different call.
12646
12647 2002-10-30  Miguel de Icaza  <miguel@ximian.com>
12648
12649         * support.cs: Return proper flags REF/OUT fixing the previous
12650         commit.  
12651
12652         * expression.cs: Reverted last patch, that was wrong.  Is_ref is
12653         not used to mean `ref' but `ref or out' in ParameterReference
12654
12655         * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
12656         full type signature instead of calling TypeManger.CSharpName
12657         ourselves. 
12658
12659         * support.cs (InternalParameters.ParameterDesc): Do not compare
12660         directly to the modflags, because REF/OUT will actually be bitsets
12661         if set. 
12662
12663         * delegate.cs (VerifyMethod): Check also the modifiers.
12664
12665         * cs-tokenizer.cs: Fix bug where floating point values with an
12666         exponent where a sign was missing was ignored.
12667
12668         * driver.cs: Allow multiple assemblies to be specified in a single
12669         /r: argument
12670
12671 2002-10-28  Miguel de Icaza  <miguel@ximian.com>
12672
12673         * cs-parser.jay: Ugly.  We had to add a multiplicative_expression,
12674         because identifiers after a parenthesis would end up in this kind
12675         of production, and we needed to desamiguate it for having casts
12676         like:
12677
12678                 (UserDefinedType *) xxx
12679
12680 2002-10-24  Miguel de Icaza  <miguel@ximian.com>
12681
12682         * typemanager.cs (RealMemberLookup): when we deal with a subclass,
12683         we should set on the Bindingflags.NonPublic, but not turn on
12684         private_ok.  private_ok controls whether a Private member is
12685         returned (this is chekced on the filter routine), while the
12686         BindingFlags.NonPublic just controls whether private/protected
12687         will be allowed.   This fixes the problem part of the problem of
12688         private properties being allowed to be used in derived classes.
12689
12690         * expression.cs (BaseAccess): Provide an DoResolveLValue method,
12691         so we can call the children DoResolveLValue method (this will
12692         properly signal errors on lvalue assignments to base properties)
12693
12694         * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
12695         getter are null, and we have a property info, we know that this
12696         happened because the lookup failed, so we report an error 122 for
12697         protection level violation.
12698
12699         We also silently return if setter and getter are null in the
12700         resolve functions, this condition only happens if we have flagged
12701         the error before.  This is the other half of the problem. 
12702
12703         (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
12704         not have accessibility information, that is why we were returning
12705         true in the filter function in typemanager.cs.
12706
12707         To properly report 122 (property is inaccessible because of its
12708         protection level) correctly, we report this error in ResolveAccess
12709         by failing if both the setter and the getter are lacking (ie, the
12710         lookup failed). 
12711
12712         DoResolve and DoLResolve have been modified to check for both
12713         setter/getter being null and returning silently, the reason being
12714         that I did not want to put the knowledge about this error in upper
12715         layers, like:
12716
12717         int old = Report.Errors;
12718         x = new PropertyExpr (...);
12719         if (old != Report.Errors)
12720                 return null;
12721         else
12722                 return x;
12723
12724         So the property expr is returned, but it is invalid, so the error
12725         will be flagged during the resolve process. 
12726
12727         * class.cs: Remove InheritablePropertySignatureCompare from the
12728         class, as we no longer depend on the property signature to compute
12729         whether it is possible to implement a method or not.
12730
12731         The reason is that calling PropertyInfo.GetGetMethod will return
12732         null (in .NET, in Mono it works, and we should change this), in
12733         cases where the Get Method does not exist in that particular
12734         class.
12735
12736         So this code:
12737
12738         class X { public virtual int A { get { return 1; } } }
12739         class Y : X { }
12740         class Z : Y { public override int A { get { return 2; } } }
12741
12742         Would fail in Z because the parent (Y) would not have the property
12743         defined.  So we avoid this completely now (because the alternative
12744         fix was ugly and slow), and we now depend exclusively on the
12745         method names.
12746
12747         (PropertyBase.CheckBase): Use a method-base mechanism to find our
12748         reference method, instead of using the property.
12749
12750         * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
12751         routines are gone now.
12752
12753         * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
12754         names, they were incorrectly named.
12755
12756         * cs-tokenizer.cs: Return are more gentle token on failure. 
12757
12758         * pending.cs (PendingImplementation.InterfaceMethod): This routine
12759         had an out-of-sync index variable, which caused it to remove from
12760         the list of pending methods the wrong method sometimes.
12761
12762 2002-10-22  Miguel de Icaza  <miguel@ximian.com>
12763
12764         * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
12765         CanWrite, because those refer to this particular instance of the
12766         property, and do not take into account the fact that we can
12767         override single members of a property.
12768
12769         Constructor requires an EmitContext.  The resolution process does
12770         not happen here, but we need to compute the accessors before,
12771         because the resolution does not always happen for properties.
12772
12773         * typemanager.cs (RealMemberLookup): Set private_ok if we are a
12774         subclass, before we did not update this flag, but we did update
12775         bindingflags. 
12776
12777         (GetAccessors): Drop this routine, as it did not work in the
12778         presence of partially overwritten set/get methods. 
12779
12780         Notice that this broke the cs1540 detection, but that will require
12781         more thinking. 
12782
12783 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12784
12785         * class.cs:
12786         * codegen.cs:
12787         * driver.cs: issue a warning instead of an error if we don't support
12788         debugging for the platform. Also ignore a couple of errors that may
12789         arise when trying to write the symbols. Undo my previous patch.
12790
12791 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12792
12793         * driver.cs: ignore /debug switch except for Unix platforms.
12794
12795 2002-10-23  Nick Drochak  <ndrochak@gol.com>
12796
12797         * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
12798
12799 2002-10-21  Miguel de Icaza  <miguel@ximian.com>
12800
12801         * driver.cs: Do not make mcs-debug conditional, so we do not break
12802         builds that use it.
12803
12804         * statement.cs (UsageVector.MergeChildren): I would like Martin to
12805         review this patch.  But basically after all the children variables
12806         have been merged, the value of "Breaks" was not being set to
12807         new_breaks for Switch blocks.  I think that it should be set after
12808         it has executed.  Currently I set this to the value of new_breaks,
12809         but only if new_breaks is FlowReturn.ALWAYS, which is a bit
12810         conservative, but I do not understand this code very well.
12811
12812         I did not break anything in the build, so that is good ;-)
12813
12814         * cs-tokenizer.cs: Also allow \r in comments as a line separator.
12815
12816 2002-10-20  Mark Crichton  <crichton@gimp.org>
12817
12818         * cfold.cs: Fixed compile blocker.  Really fixed it this time.
12819
12820 2002-10-20  Nick Drochak  <ndrochak@gol.com>
12821
12822         * cfold.cs: Fixed compile blocker.
12823
12824 2002-10-20  Miguel de Icaza  <miguel@ximian.com>
12825
12826         * driver.cs: I was chekcing the key, not the file.
12827
12828 2002-10-19  Ravi Pratap  <ravi@ximian.com>
12829
12830         * ecore.cs (UserDefinedConversion): Get rid of the bogus error
12831         message that we were generating - we just need to silently return
12832         a null.
12833
12834 2002-10-19  Miguel de Icaza  <miguel@ximian.com>
12835
12836         * class.cs (Event.Define): Change my previous commit, as this
12837         breaks the debugger.  This is a temporary hack, as it seems like
12838         the compiler is generating events incorrectly to begin with.
12839
12840         * expression.cs (Binary.ResolveOperator): Added support for 
12841         "U operator - (E x, E y)"
12842
12843         * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
12844         y)".
12845
12846         * ecore.cs (FieldExpr.AddressOf): We had a special code path for
12847         init-only variables, but this path did not take into account that
12848         there might be also instance readonly variables.  Correct this
12849         problem. 
12850
12851         This fixes bug 32253
12852
12853         * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
12854         delegates as well.
12855
12856         * driver.cs: Change the extension for modules to `netmodule'
12857
12858         * cs-parser.jay: Improved slightly the location tracking for
12859         the debugger symbols.
12860
12861         * class.cs (Event.Define): Use Modifiers.FieldAttr on the
12862         modifiers that were specified instead of the hardcoded value
12863         (FamAndAssem).  This was basically ignoring the static modifier,
12864         and others.  Fixes 32429.
12865
12866         * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
12867         fixed a bug in the process (32476)
12868
12869         * expression.cs (ArrayAccess.EmitAssign): Patch from
12870         hwang_rob@yahoo.ca that fixes bug 31834.3
12871
12872 2002-10-18  Miguel de Icaza  <miguel@ximian.com>
12873
12874         * driver.cs: Make the module extension .netmodule.
12875
12876 2002-10-16  Miguel de Icaza  <miguel@ximian.com>
12877
12878         * driver.cs: Report an error if the resource file is not found
12879         instead of crashing.
12880
12881         * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
12882         false, like Emit does.
12883
12884 2002-10-16  Nick Drochak  <ndrochak@gol.com>
12885
12886         * typemanager.cs: Remove unused private member.  Also reported mcs
12887         bug to report this as a warning like csc.
12888
12889 2002-10-15  Martin Baulig  <martin@gnome.org>
12890
12891         * statement.cs (Statement.Emit): Made this a virtual method; emits
12892         the line number info and calls DoEmit().
12893         (Statement.DoEmit): New protected abstract method, formerly knows
12894         as Statement.Emit().
12895
12896         * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
12897
12898 2002-10-11  Miguel de Icaza  <miguel@ximian.com>
12899
12900         * class.cs: Following the comment from 2002-09-26 to AddMethod, I
12901         have fixed a remaining problem: not every AddXXXX was adding a
12902         fully qualified name.  
12903
12904         Now everyone registers a fully qualified name in the DeclSpace as
12905         being defined instead of the partial name.  
12906
12907         Downsides: we are slower than we need to be due to the excess
12908         copies and the names being registered this way.  
12909
12910         The reason for this is that we currently depend (on the corlib
12911         bootstrap for instance) that types are fully qualified, because
12912         we dump all the types in the namespace, and we should really have
12913         types inserted into the proper namespace, so we can only store the
12914         basenames in the defined_names array.
12915
12916 2002-10-10  Martin Baulig  <martin@gnome.org>
12917
12918         * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
12919         from bug #31834, see the bug report for a testcase which is
12920         miscompiled.
12921
12922 2002-10-10  Martin Baulig  <martin@gnome.org>
12923
12924         * codegen.cs (EmitContext.Breaks): Removed, we're now using the
12925         flow analysis code for this.
12926
12927         * statement.cs (Do, While, For): Tell the flow analysis code about
12928         infinite loops.
12929         (FlowBranching.UsageVector): Added support for infinite loops.
12930         (Block.Resolve): Moved the dead code elimination here and use flow
12931         analysis to do it.
12932
12933 2002-10-09  Miguel de Icaza  <miguel@ximian.com>
12934
12935         * class.cs (Field.Define): Catch cycles on struct type
12936         definitions. 
12937
12938         * typemanager.cs (IsUnmanagedtype): Do not recursively check
12939         fields if the fields are static.  We only need to check instance
12940         fields. 
12941
12942         * expression.cs (As.DoResolve): Test for reference type.
12943
12944         * statement.cs (Using.ResolveExpression): Use
12945         ConvertImplicitRequired, not ConvertImplicit which reports an
12946         error on failture
12947         (Using.ResolveLocalVariableDecls): ditto.
12948
12949         * expression.cs (Binary.ResolveOperator): Report errors in a few
12950         places where we had to.
12951
12952         * typemanager.cs (IsUnmanagedtype): Finish implementation.
12953
12954 2002-10-08  Miguel de Icaza  <miguel@ximian.com>
12955
12956         * expression.cs: Use StoreFromPtr instead of extracting the type
12957         and then trying to use Stelem.  Patch is from hwang_rob@yahoo.ca
12958
12959         * ecore.cs (ImplicitReferenceConversion): It is possible to assign
12960         an enumeration value to a System.Enum, but System.Enum is not a
12961         value type, but an class type, so we need to box.
12962
12963         (Expression.ConvertExplicit): One codepath could return
12964         errors but not flag them.  Fix this.  Fixes #31853
12965
12966         * parameter.cs (Resolve): Do not allow void as a parameter type.
12967
12968 2002-10-06  Martin Baulig  <martin@gnome.org>
12969
12970         * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
12971         if it's a class type and not a struct.  Fixes #31815.
12972
12973 2002-10-06  Martin Baulig  <martin@gnome.org>
12974
12975         * statement.cs: Reworked the flow analysis code a bit to make it
12976         usable for dead code elimination.
12977
12978 2002-10-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12979
12980         * cs-parser.jay: allow empty source files. Fixes bug #31781.
12981
12982 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
12983
12984         * expression.cs (ComposedCast.DoResolveType): A quick workaround
12985         to fix the test 165, will investigate deeper.
12986
12987 2002-10-04  Martin Baulig  <martin@gnome.org>
12988
12989         * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
12990         finally blocks actually work.
12991         (Try.Resolve): We don't need to create a sibling for `finally' if
12992         there is no finally block.
12993
12994 2002-10-04  Martin Baulig  <martin@gnome.org>
12995
12996         * class.cs (Constructor.Define): The default accessibility for a
12997         non-default constructor is private, not public.
12998
12999 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
13000
13001         * class.cs (Constructor): Make AllowedModifiers public, add
13002         EXTERN.
13003
13004         * cs-parser.jay: Perform the modifiers test here, as the
13005         constructor for the Constructor class usually receives a zero
13006         because of the way we create it (first we create, later we
13007         customize, and we were never checking the modifiers).
13008
13009         * typemanager.cs (Typemanager.LookupTypeDirect): This new function
13010         is a version of LookupTypeReflection that includes the type-name
13011         cache.  This can be used as a fast path for functions that know
13012         the fully qualified name and are only calling into *.GetType() to
13013         obtain a composed type.
13014
13015         This is also used by TypeManager.LookupType during its type
13016         composition.
13017
13018         (LookupType): We now also track the real type name, as sometimes
13019         we can get a quey for the real type name from things like
13020         ComposedCast.  This fixes bug 31422.
13021
13022         * expression.cs (ComposedCast.Resolve): Since we are obtaining a
13023         complete type fullname, it does not have to go through the type
13024         resolution system to obtain the composed version of the type (for
13025         obtaining arrays or pointers).
13026
13027         (Conditional.Emit): Use the EmitBoolExpression to
13028         generate nicer code, as requested by Paolo.
13029
13030         (ArrayCreation.CheckIndices): Use the patch from
13031         hwang_rob@yahoo.ca to validate the array initializers. 
13032
13033 2002-10-03  Miguel de Icaza  <miguel@ximian.com>
13034
13035         * class.cs (ConstructorInitializer.Emit): simplify code by using
13036         Invocation.EmitCall, and at the same time, fix the bugs in calling
13037         parent constructors that took variable arguments. 
13038
13039         * ecore.cs (Expression.ConvertNumericExplicit,
13040         Expression.ImplicitNumericConversion): Remove the code that
13041         manually wrapped decimal (InternalTypeConstructor call is now gone
13042         as well).
13043
13044         * expression.cs (Cast.TryReduce): Also handle decimal types when
13045         trying to perform a constant fold on the type.
13046
13047         * typemanager.cs (IsUnmanagedtype): Partially implemented.
13048
13049         * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
13050         that only turned off an error report, and did nothing else. 
13051
13052 2002-10-02  Miguel de Icaza  <miguel@ximian.com>
13053
13054         * driver.cs: Handle and ignore /fullpaths
13055
13056 2002-10-01  Miguel de Icaza  <miguel@ximian.com>
13057
13058         * expression.cs (Binary.ResolveOperator): Catch the case where
13059         DoNumericPromotions returns true, 
13060
13061         (Binary.DoNumericPromotions): Simplify the code, and the tests.
13062
13063 2002-09-27  Miguel de Icaza  <miguel@ximian.com>
13064
13065         * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
13066         report error 70.
13067
13068 2002-09-26  Miguel de Icaza  <miguel@ximian.com>
13069
13070         * ecore.cs (ConvertNumericExplicit): It is not enough that the
13071         conversion exists, but it is also required that the conversion be
13072         performed.  This manifested in "(Type64Enum) 2".  
13073
13074         * class.cs (TypeManager.AddMethod): The fix is not to change
13075         AddEnum, because that one was using a fully qualified name (every
13076         DeclSpace derivative does), but to change the AddMethod routine
13077         that was using an un-namespaced name.  This now correctly reports
13078         the duplicated name.
13079
13080         Revert patch until I can properly fix it.  The issue
13081         is that we have a shared Type space across all namespaces
13082         currently, which is wrong.
13083
13084         Options include making the Namespace a DeclSpace, and merge
13085         current_namespace/current_container in the parser.
13086
13087 2002-09-25  Miguel de Icaza  <miguel@ximian.com>
13088
13089         * cs-parser.jay: Improve error reporting when we get a different
13090         kind of expression in local_variable_type and
13091         local_variable_pointer_type. 
13092
13093         Propagate this to avoid missleading errors being reported.
13094
13095         * ecore.cs (ImplicitReferenceConversion): treat
13096         TypeManager.value_type as a target just like object_type.   As
13097         code like this:
13098
13099         ValueType v = 1;
13100
13101         Is valid, and needs to result in the int 1 being boxed before it
13102         is assigned to the value type v.
13103
13104         * class.cs (TypeContainer.AddEnum): Use the basename, not the name
13105         to validate the enumeration name.
13106
13107         * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
13108         EmitDynamicInitializers for the criteria to use Ldelema.  Thanks
13109         to hwang_rob@yahoo.ca for finding the bug and providing a patch.
13110
13111         * ecore.cs (TryImplicitIntConversion): When doing an
13112         implicit-enumeration-conversion, check if the type is 64-bits and
13113         perform a conversion before passing to EnumConstant.
13114
13115 2002-09-23  Miguel de Icaza  <miguel@ximian.com>
13116
13117         * decl.cs (Error_AmbiguousTypeReference); New routine used to
13118         report ambiguous type references.  Unlike the MS version, we
13119         report what the ambiguity is.   Innovation at work ;-)
13120
13121         (DeclSpace.FindType): Require a location argument to
13122         display when we display an ambiguous error.
13123
13124         * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
13125
13126         * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
13127
13128         * expression.cs (EmitDynamicInitializers): Apply patch from
13129         hwang_rob@yahoo.ca that fixes the order in which we emit our
13130         initializers. 
13131
13132 2002-09-21  Martin Baulig  <martin@gnome.org>
13133
13134         * delegate.cs (Delegate.VerifyApplicability): Make this work if the
13135         delegate takes no arguments.
13136
13137 2002-09-20  Miguel de Icaza  <miguel@ximian.com>
13138
13139         * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
13140         from integers.
13141
13142         * expression.cs: Extract the underlying type.
13143
13144         * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
13145
13146         * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
13147
13148 2002-09-19  Miguel de Icaza  <miguel@ximian.com>
13149
13150         * class.cs (TypeContainer.DefineType): We can not use the nice
13151         PackingSize with the size set to 1 DefineType method, because it
13152         will not allow us to define the interfaces that the struct
13153         implements.
13154
13155         This completes the fixing of bug 27287
13156
13157         * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
13158         means also structs.  This fixes part of the problem. 
13159         (Expresion.ImplicitReferenceConversionExists): ditto.
13160
13161         * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
13162         error if there were no errors reported during the type lookup
13163         process, to avoid duplicates or redundant errors.  Without this
13164         you would get an ambiguous errors plus a type not found.  We have
13165         beaten the user enough with the first error.  
13166
13167         (DeclSparce.FindType): Emit a warning if we have an ambiguous
13168         reference. 
13169
13170         * ecore.cs (SimpleName.DoResolveType): If an error is emitted
13171         during the resolution process, stop the lookup, this avoids
13172         repeated error reports (same error twice).
13173
13174         * rootcontext.cs: Emit a warning if we have an ambiguous reference.
13175
13176         * typemanager.cs (LookupType): Redo the type lookup code to match
13177         the needs of System.Reflection.  
13178
13179         The issue is that System.Reflection requires references to nested
13180         types to begin with a "+" sign instead of a dot.  So toplevel
13181         types look like: "NameSpace.TopLevelClass", and nested ones look
13182         like "Namespace.TopLevelClass+Nested", with arbitrary nesting
13183         levels. 
13184
13185 2002-09-19  Martin Baulig  <martin@gnome.org>
13186
13187         * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
13188         says that a method always returns or always throws an exception,
13189         don't report the CS0161.
13190
13191         * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
13192         set `Returns = new_returns'.
13193
13194 2002-09-19  Martin Baulig  <martin@gnome.org>
13195
13196         * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
13197         to an enum constant, check for a CS0176.
13198
13199 2002-09-18  Miguel de Icaza  <miguel@ximian.com>
13200
13201         * class.cs (TypeContainer.CheckPairedOperators): Now we check
13202         for operators that must be in pairs and report errors.
13203
13204         * ecore.cs (SimpleName.DoResolveType): During the initial type
13205         resolution process, when we define types recursively, we must
13206         check first for types in our current scope before we perform
13207         lookups in the enclosing scopes.
13208
13209         * expression.cs (MakeByteBlob): Handle Decimal blobs.
13210
13211         (Invocation.VerifyArgumentsCompat): Call
13212         TypeManager.TypeToCoreType on the parameter_type.GetElementType.
13213         I thought we were supposed to always call this, but there are a
13214         few places in the code where we dont do it.
13215
13216 2002-09-17  Miguel de Icaza  <miguel@ximian.com>
13217
13218         * driver.cs: Add support in -linkres and -resource to specify the
13219         name of the identifier.
13220
13221 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
13222
13223         * ecore.cs (StandardConversionExists): Sync with the conversion
13224         code: allow anything-* to void* conversions.
13225
13226         (FindMostSpecificSource): Use an Expression argument
13227         instead of a Type, because we might be handed over a Literal which
13228         gets a few more implicit conversions that plain types do not.  So
13229         this information was being lost.
13230
13231         Also, we drop the temporary type-holder expression when not
13232         required.
13233
13234 2002-09-17  Martin Baulig  <martin@gnome.org>
13235
13236         * class.cs (PropertyBase.CheckBase): Don't check the base class if
13237         this is an explicit interface implementation.
13238
13239 2002-09-17  Martin Baulig  <martin@gnome.org>
13240
13241         * class.cs (PropertyBase.CheckBase): Make this work for indexers with
13242         different `IndexerName' attributes.
13243
13244         * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
13245         (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
13246         virtual CommonResolve().
13247
13248 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
13249
13250         * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
13251         and convert that to the UnderlyingType.
13252
13253         * statement.cs (Foreach.Resolve): Indexers are just like variables
13254         or PropertyAccesses.
13255
13256         * cs-tokenizer.cs (consume_string): Track line numbers and columns
13257         inside quoted strings, we were not doing this before.
13258
13259 2002-09-16  Martin Baulig  <martin@gnome.org>
13260
13261         * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
13262         resolve it.  This is needed for the definite assignment check of the
13263         instance expression, fixes bug #29846.
13264         (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
13265
13266 2002-09-16  Nick Drochak  <ndrochak@gol.com>
13267
13268         * parameter.cs: Fix compile error.  Cannot reference static member
13269         from an instance object.  Is this an mcs bug?
13270
13271 2002-09-14  Martin Baulig  <martin@gnome.org>
13272
13273         * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
13274         multiple times.  Fixes bug #30295, added test-166.cs.
13275
13276 2002-09-14  Martin Baulig  <martin@gnome.org>
13277
13278         * statement.cs (Block.Emit): Don't emit unreachable code.
13279         (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
13280         `break' statements.
13281         (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
13282
13283 2002-09-14  Martin Baulig  <martin@gnome.org>
13284
13285         * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
13286         is set.
13287
13288 2002-09-14  Martin Baulig  <martin@gnome.org>
13289
13290         * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
13291         if `type == parent' since in this case `type.IsSubclassOf (parent)' will
13292         be false on the ms runtime.
13293
13294 2002-09-13  Martin Baulig  <martin@gnome.org>
13295
13296         * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
13297         the CS0038 error message.
13298
13299 2002-09-12  Miguel de Icaza  <miguel@ximian.com>
13300
13301         * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
13302         constant inside, return it.
13303
13304 2002-09-12  Martin Baulig  <martin@gnome.org>
13305
13306         * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
13307         implicit conversion can be done between enum types.
13308
13309         * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
13310         check whether an implicit conversion to the current enum's UnderlyingType
13311         exists and report an error if not.
13312
13313         * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
13314         without debugging support.
13315
13316         * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
13317         Fixes bug #30235.  Thanks to Ricardo Fernández Pascual.
13318
13319 2002-09-12  Martin Baulig  <martin@gnome.org>
13320
13321         * typemanager.cs (TypeManager.IsNestedChildOf): New method.
13322
13323         * ecore.cs (IMemberExpr.DeclaringType): New property.
13324         (SimpleName.SimpleNameResolve): Check whether we're accessing a
13325         nonstatic member of an outer type (CS0038).
13326
13327 2002-09-11  Miguel de Icaza  <miguel@ximian.com>
13328
13329         * driver.cs: Activate the using-error detector at warning level
13330         4 (at least for MS-compatible APIs).
13331
13332         * namespace.cs (VerifyUsing): Small buglett fix.
13333
13334         * pending.cs (PendingImplementation): pass the container pointer. 
13335
13336         * interface.cs (GetMethods): Allow for recursive definition.  Long
13337         term, I would like to move every type to support recursive
13338         definitions, not the current ordering mechanism that we have right
13339         now.
13340
13341         The situation is this: Attributes are handled before interfaces,
13342         so we can apply attributes to interfaces.  But some attributes
13343         implement interfaces, we will now handle the simple cases
13344         (recursive definitions will just get an error).  
13345
13346         * parameter.cs: Only invalidate types at the end if we fail to
13347         lookup all types.  
13348
13349 2002-09-09  Martin Baulig  <martin@gnome.org>
13350
13351         * ecore.cs (PropertyExpr.Emit): Also check for
13352         TypeManager.system_int_array_get_length so this'll also work when
13353         compiling corlib.  Fixes #30003.
13354
13355 2002-09-09  Martin Baulig  <martin@gnome.org>
13356
13357         * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
13358         and throw an exception if we can't get the type's size.  Fixed #30040,
13359         added test-165.cs.
13360
13361 2002-09-09  Martin Baulig  <martin@gnome.org>
13362
13363         * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
13364
13365         * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
13366         context.  Fixes bug #30027.
13367
13368         * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
13369         virtual functions.  Fixes bug #30043, added test-164.cs.
13370
13371 2002-09-08  Ravi Pratap  <ravi@ximian.com>
13372
13373         * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
13374
13375 2002-09-08  Nick Drochak  <ndrochak@gol.com>
13376
13377         * driver.cs: Use an object to get the windows codepage since it's not a
13378         static property.
13379
13380 2002-09-08  Miguel de Icaza  <miguel@ximian.com>
13381
13382         * statement.cs (For.Emit): for infinite loops (test == null)
13383         return whether there is a break inside, not always "true".
13384
13385         * namespace.cs (UsingEntry): New struct to hold the name of the
13386         using definition, the location where it is defined, and whether it
13387         has been used in a successful type lookup.
13388
13389         * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
13390         strings.
13391
13392         * decl.cs: ditto.
13393
13394 2002-09-06  Ravi Pratap  <ravi@ximian.com>
13395
13396         * attribute.cs : Fix incorrect code which relied on catching
13397         a NullReferenceException to detect a null being passed in
13398         where an object was expected.
13399
13400 2002-09-06  Miguel de Icaza  <miguel@ximian.com>
13401
13402         * statement.cs (Try): flag the catch variable as assigned
13403
13404         * expression.cs (Cast): Simplified by using ResolveType instead of
13405         manually resolving.
13406
13407         * statement.cs (Catch): Fix bug by using ResolveType.
13408
13409 2002-09-06  Ravi Pratap  <ravi@ximian.com>
13410
13411         * expression.cs (BetterConversion): Special case for when we have
13412         a NullLiteral as the argument and we have to choose between string
13413         and object types - we choose string the way csc does.
13414
13415         * attribute.cs (Attribute.Resolve): Catch the
13416         NullReferenceException and report error #182 since the Mono
13417         runtime no more has the bug and having this exception raised means
13418         we tried to select a constructor which takes an object and is
13419         passed a null.
13420
13421 2002-09-05  Ravi Pratap  <ravi@ximian.com>
13422
13423         * expression.cs (Invocation.OverloadResolve): Flag a nicer error
13424         message (1502, 1503) when we can't locate a method after overload
13425         resolution. This is much more informative and closes the bug
13426         Miguel reported.
13427
13428         * interface.cs (PopulateMethod): Return if there are no argument
13429         types. Fixes a NullReferenceException bug.
13430
13431         * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
13432         expressions too. Previously we were checking only in one place for
13433         positional arguments leaving out named arguments.
13434
13435         * ecore.cs (ImplicitNumericConversion): Conversion from underlying
13436         type to the enum type is not allowed. Remove code corresponding to
13437         that.
13438
13439         (ConvertNumericExplicit): Allow explicit conversions from
13440         the underlying type to enum type. This precisely follows the spec
13441         and closes a bug filed by Gonzalo.
13442
13443 2002-09-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13444
13445         * compiler.csproj:
13446         * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
13447
13448 2002-09-03  Miguel de Icaza  <miguel@ximian.com>
13449
13450         * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
13451         it was important that we stored the right value after the
13452         reduction in `converted'.
13453
13454 2002-09-04  Martin Baulig  <martin@gnome.org>
13455
13456         * location.cs (Location.SymbolDocument): Use full pathnames for the
13457         source files.
13458
13459 2002-08-30  Miguel de Icaza  <miguel@ximian.com>
13460
13461         * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
13462         of the expression resolve mechanism, because that will catch the
13463         SimpleName error failures.
13464
13465         (Conditional): If we can not resolve the
13466         expression, return, do not crash.
13467
13468 2002-08-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13469
13470         * cs-tokenizer.cs:
13471         (location): display token name instead of its number.
13472
13473 2002-08-28  Martin Baulig  <martin@gnome.org>
13474
13475         * expression.cs (Binary.ResolveOperator): Don't silently return
13476         but return an error if an operator cannot be applied between two
13477         enum types.
13478
13479 2002-08-28  Martin Baulig  <martin@gnome.org>
13480
13481         * class.cs (Constructor.Define): Set the permission attributes
13482         correctly instead of making all constructors public.
13483
13484 2002-08-28  Martin Baulig  <martin@gnome.org>
13485
13486         * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
13487         for private members before reporting a CS0103; if we find anything,
13488         it's a CS0122.
13489
13490 2002-08-28  Martin Baulig  <martin@gnome.org>
13491
13492         * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
13493         to check whether `closure_start_type == closure_invocation_type',
13494         we also need to check whether `m.DeclaringType == closure_invocation_type'
13495         before bypassing the permission checks.  We might be accessing
13496         protected/private members from the base class.
13497         (TypeManager.RealMemberLookup): Only set private_ok if private
13498         members were requested via BindingFlags.NonPublic.
13499
13500         * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
13501
13502         * expression.cs (MemberAccess.ResolveMemberAccess): Set
13503         MethodGroupExpr.IsExplicitImpl if appropriate.
13504         (Invocation.DoResolve): Don't report the CS0120 for explicit
13505         interface implementations.
13506
13507 2002-08-27  Martin Baulig  <martin@gnome.org>
13508
13509         * expression.cs (Invocation.DoResolve): If this is a static
13510         method and we don't have an InstanceExpression, we must report
13511         a CS0120.
13512
13513 2002-08-25  Martin Baulig  <martin@gnome.org>
13514
13515         * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
13516         `==' between a valuetype and an object.
13517
13518 2002-08-25  Miguel de Icaza  <miguel@ximian.com>
13519
13520         * ecore.cs (TypeExpr): Provide a ToString method.
13521
13522 2002-08-24  Martin Baulig  <martin@gnome.org>
13523
13524         * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
13525         now called proggie.dbg and it's a binary file.
13526
13527 2002-08-23  Martin Baulig  <martin@gnome.org>
13528
13529         * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
13530
13531 2002-08-23  Martin Baulig  <martin@gnome.org>
13532
13533         * struct.cs (MyStructInfo.ctor): Make this work with empty
13534         structs; it's not allowed to use foreach() on null.
13535
13536 2002-08-23  Martin Baulig  <martin@gnome.org>
13537
13538         * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
13539         writer the full pathname of the generated assembly.
13540
13541 2002-08-23  Martin Baulig  <martin@gnome.org>
13542
13543         * statements.cs (FlowBranching.UsageVector.MergeChildren):
13544         A `finally' block never returns or breaks; improved handling of
13545         unreachable code.
13546
13547 2002-08-23  Martin Baulig  <martin@gnome.org>
13548
13549         * statement.cs (Throw.Resolve): Allow `throw null'.
13550
13551 2002-08-23  Martin Baulig  <martin@gnome.org>
13552
13553         * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
13554         EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
13555         `ee.EventInfo.DeclaringType == ec.ContainerType'.  The
13556         MemberLookup would return a wrong event if this is an explicit
13557         interface implementation and the class has an event with the same
13558         name.
13559
13560 2002-08-23  Martin Baulig  <martin@gnome.org>
13561
13562         * statement.cs (Block.AddChildVariableNames): New public method.
13563         (Block.AddChildVariableName): Likewise.
13564         (Block.IsVariableNameUsedInChildBlock): Likewise.
13565         (Block.AddVariable): Check whether a variable name has already
13566         been used in a child block.
13567
13568         * cs-parser.jay (declare_local_variables): Mark all variable names
13569         from the current block as being used in a child block in the
13570         implicit block.
13571
13572 2002-08-23  Martin Baulig  <martin@gnome.org>
13573
13574         * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
13575         find the symbol writer.
13576
13577         * driver.cs: csc also allows the arguments to /define being
13578         separated by commas, not only by semicolons.
13579
13580 2002-08-23  Martin Baulig  <martin@gnome.org>
13581
13582         * interface.cs (Interface.GetMembers): Added static check for events.
13583
13584 2002-08-15  Martin Baulig  <martin@gnome.org>
13585
13586         * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
13587         call, use ec.ContainerType.BaseType as queried_type and invocation_type.
13588
13589         * ecore.cs (Expression.MemberLookup): Added documentation and explained
13590         why the MethodData.EmitDestructor() change was necessary.
13591
13592 2002-08-20  Martin Baulig  <martin@gnome.org>
13593
13594         * class.cs (TypeContainer.FindMembers): Added static check for events.
13595
13596         * decl.cs (MemberCache.AddMembers): Handle events like normal members.
13597
13598         * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
13599         use Type.GetEvents(), not Type.FindMembers().
13600
13601 2002-08-20  Martin Baulig  <martin@gnome.org>
13602
13603         * decl.cs (MemberCache): Added a special method cache which will
13604         be used for method-only searched.  This ensures that a method
13605         search will return a MethodInfo with the correct ReflectedType for
13606         inherited methods.      
13607
13608 2002-08-20  Martin Baulig  <martin@gnome.org>
13609
13610         * decl.cs (DeclSpace.FindMembers): Made this public.
13611
13612 2002-08-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13613
13614         * delegate.cs: fixed build on windows.
13615         [FIXME:  Filed as bug #29150: MCS must report these errors.]
13616
13617 2002-08-19  Ravi Pratap  <ravi@ximian.com>
13618
13619         * ecore.cs (StandardConversionExists): Return a false
13620         if we are trying to convert the void type to anything else
13621         since that is not allowed.
13622
13623         * delegate.cs (DelegateInvocation.DoResolve): Ensure that
13624         we flag error 70 in the event an event is trying to be accessed
13625         directly from outside the declaring type.
13626
13627 2002-08-20  Martin Baulig  <martin@gnome.org>
13628
13629         * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
13630         MemberCache from typemanager.cs to decl.cs.
13631
13632 2002-08-19  Martin Baulig  <martin@gnome.org>
13633
13634         * class.cs (TypeContainer): Implement IMemberContainer.
13635         (TypeContainer.DefineMembers): Create the MemberCache.
13636         (TypeContainer.FindMembers): Do better BindingFlags checking; only
13637         return public members if BindingFlags.Public was given, check
13638         whether members are static.
13639
13640 2002-08-16  Martin Baulig  <martin@gnome.org>
13641
13642         * decl.cs (DeclSpace.Define): Splitted this in Define and
13643         DefineMembers.  DefineMembers is called first and initializes the
13644         MemberCache.
13645
13646         * rootcontext.cs (RootContext.DefineMembers): New function.  Calls
13647         DefineMembers() on all our DeclSpaces.
13648
13649         * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
13650         but call DefineMembers() on all nested interfaces.  We call their
13651         Define() in our new Define() function.
13652
13653         * interface.cs (Interface): Implement IMemberContainer.
13654         (Interface.Define): Moved all code except the attribute stuf to
13655         DefineMembers().
13656         (Interface.DefineMembers): Initialize the member cache.
13657
13658         * typemanager.cs (IMemberFinder): Removed this interface, we don't
13659         need this anymore since we can use MemberCache.FindMembers directly.
13660
13661 2002-08-19  Martin Baulig  <martin@gnome.org>
13662
13663         * typemanager.cs (MemberCache): When creating the cache for an
13664         interface type, add all inherited members.
13665         (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
13666         to `out bool used_cache' and documented it.
13667         (TypeManager.MemberLookup): If we already used the cache in the first
13668         iteration, we don't need to do the interfaces check.
13669
13670 2002-08-19  Martin Baulig  <martin@gnome.org>
13671
13672         * decl.cs (DeclSpace.FindMembers): New abstract method.  Moved this
13673         here from IMemberFinder and don't implement this interface anymore.
13674         (DeclSpace.MemberCache): Moved here from IMemberFinder.
13675
13676         * typemanager.cs (IMemberFinder): This interface is now only used by
13677         classes which actually support the member cache.
13678         (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
13679         since we only put DeclSpaces into this Hashtable.
13680         (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
13681         a dynamic type and TypeHandle.GetTypeHandle() otherwise.
13682
13683 2002-08-16  Martin Baulig  <martin@gnome.org>
13684
13685         * typemanager.cs (ICachingMemberFinder): Removed.
13686         (IMemberFinder.MemberCache): New property.
13687         (TypeManager.FindMembers): Merged this with RealFindMembers().
13688         This function will never be called from TypeManager.MemberLookup()
13689         so we can't use the cache here, just the IMemberFinder.
13690         (TypeManager.MemberLookup_FindMembers): Check whether the
13691         IMemberFinder has a MemberCache and call the cache's FindMembers
13692         function.
13693         (MemberCache): Rewrote larger parts of this yet another time and
13694         cleaned it up a bit.
13695
13696 2002-08-15  Miguel de Icaza  <miguel@ximian.com>
13697
13698         * driver.cs (LoadArgs): Support quoting.
13699
13700         (Usage): Show the CSC-like command line arguments.
13701
13702         Improved a few error messages.
13703
13704 2002-08-15  Martin Baulig  <martin@gnome.org>
13705
13706         * typemanager.cs (IMemberContainer.Type): New property.
13707         (IMemberContainer.IsInterface): New property.
13708
13709         The following changes are conditional to BROKEN_RUNTIME, which is
13710         defined at the top of the file.
13711
13712         * typemanager.cs (MemberCache.MemberCache): Don't add the base
13713         class'es members, but add all members from TypeHandle.ObjectType
13714         if we're an interface.
13715         (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
13716         is the current type.
13717         (MemberCache.CacheEntry.Container): Removed this field.
13718         (TypeHandle.GetMembers): Include inherited members.
13719
13720 2002-08-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13721
13722         * typemanager.cs: fixed compilation and added a comment on a field that
13723         is never used.
13724
13725 2002-08-15  Martin Baulig  <martin@gnome.org>
13726
13727         * class.cs (ConstructorInitializer.Resolve): In the
13728         Expression.MemberLookup call, use the queried_type as
13729         invocation_type.
13730
13731         * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
13732         declared' attribute, it's always true.
13733         (IMemberContainer.Parent, IMemberContainer.Name): New properties.
13734         (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
13735         temporary wrapper for FindMembers which tells MemberLookup whether
13736         members from the base classes are included in the return value.
13737         This will go away soon.
13738         (TypeManager.MemberLookup): Use this temporary hack here; once the
13739         new MemberCache is completed, we don't need to do the DeclaredOnly
13740         looping here anymore since the MemberCache will take care of this.
13741         (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
13742         (MemberCache): When creating the MemberCache for a class, get
13743         members from the current class and all its base classes.
13744         (MemberCache.CacheEntry.Container): New field.  This is a
13745         temporary hack until the Mono runtime is fixed to distinguish
13746         between ReflectedType and DeclaringType.  It allows us to use MCS
13747         with both the MS runtime and the unfixed Mono runtime without
13748         problems and without accecting performance.
13749         (MemberCache.SearchMembers): The DeclaredOnly looping from
13750         TypeManager.MemberLookup is now done here.      
13751
13752 2002-08-14  Martin Baulig  <martin@gnome.org>
13753
13754         * statement.cs (MyStructInfo.MyStructInfo): Don't call
13755         Type.GetFields on dynamic types but get the fields from the
13756         corresponding TypeContainer.
13757         (MyStructInfo.GetStructInfo): Added check for enum types.
13758
13759         * typemanager.cs (MemberList.IsSynchronized): Implemented.
13760         (MemberList.SyncRoot): Implemented.
13761         (TypeManager.FilterWithClosure): No need to check permissions if
13762         closure_start_type == closure_invocation_type, don't crash if
13763         closure_invocation_type is null.
13764
13765 2002-08-13  Martin Baulig  <martin@gnome.org>
13766
13767         Rewrote TypeContainer.FindMembers to use a member cache.  This
13768         gives us a speed increase of about 35% for the self-hosting MCS
13769         build and of about 15-20% for the class libs (both on GNU/Linux).
13770
13771         * report.cs (Timer): New class to get enhanced profiling.  This
13772         whole class is "TIMER" conditional since it remarkably slows down
13773         compilation speed.
13774
13775         * class.cs (MemberList): New class.  This is an IList wrapper
13776         which we're now using instead of passing MemberInfo[]'s around to
13777         avoid copying this array unnecessarily.
13778         (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
13779         (ICachingMemberFinder, IMemberContainer): New interface.
13780         (TypeManager.FilterWithClosure): If `criteria' is null, the name
13781         has already been checked, otherwise use it for the name comparision.
13782         (TypeManager.FindMembers): Renamed to RealMemberFinder and
13783         provided wrapper which tries to use ICachingMemberFinder.FindMembers
13784         if possible.  Returns a MemberList, not a MemberInfo [].
13785         (TypeHandle): New class, implements IMemberContainer.  We create
13786         one instance of this class per type, it contains a MemberCache
13787         which is used to do the member lookups.
13788         (MemberCache): New class.  Each instance of this class contains
13789         all members of a type and a name-based hash table.
13790         (MemberCache.FindMembers): This is our new member lookup
13791         function.  First, it looks up all members of the requested name in
13792         the hash table.  Then, it walks this list and sorts out all
13793         applicable members and returns them.
13794
13795 2002-08-13  Martin Baulig  <martin@gnome.org>
13796
13797         In addition to a nice code cleanup, this gives us a performance
13798         increase of about 1.4% on GNU/Linux - not much, but it's already
13799         half a second for the self-hosting MCS compilation.
13800
13801         * typemanager.cs (IMemberFinder): New interface.  It is used by
13802         TypeManager.FindMembers to call FindMembers on a TypeContainer,
13803         Enum, Delegate or Interface.
13804         (TypeManager.finder_to_member_finder): New PtrHashtable.
13805         (TypeManager.finder_to_container): Removed.
13806         (TypeManager.finder_to_delegate): Removed.
13807         (TypeManager.finder_to_interface): Removed.
13808         (TypeManager.finder_to_enum): Removed.
13809
13810         * interface.cs (Interface): Implement IMemberFinder.
13811
13812         * delegate.cs (Delegate): Implement IMemberFinder.
13813
13814         * enum.cs (Enum): Implement IMemberFinder.
13815
13816         * class.cs (TypeContainer): Implement IMemberFinder.
13817
13818 2002-08-12  Martin Baulig  <martin@gnome.org>
13819
13820         * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
13821
13822 2002-08-12  Martin Baulig  <martin@gnome.org>
13823
13824         * ecore.cs (ITypeExpression): New interface for expressions which
13825         resolve to a type.
13826         (TypeExpression): Renamed to TypeLookupExpression.
13827         (Expression.DoResolve): If we're doing a types-only lookup, the
13828         expression must implement the ITypeExpression interface and we
13829         call DoResolveType() on it.
13830         (SimpleName): Implement the new ITypeExpression interface.
13831         (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
13832         hack, the situation that we're only looking up types can't happen
13833         anymore when this method is called.  Moved the type lookup code to
13834         DoResolveType() and call it.
13835         (SimpleName.DoResolveType): This ITypeExpression interface method
13836         is now doing the types-only lookup.
13837         (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
13838         (ResolveFlags): Added MaskExprClass.
13839
13840         * expression.cs (MemberAccess): Implement the ITypeExpression
13841         interface.
13842         (MemberAccess.DoResolve): Added support for a types-only lookup
13843         when we're called via ITypeExpression.DoResolveType().
13844         (ComposedCast): Implement the ITypeExpression interface.
13845
13846         * codegen.cs (EmitContext.OnlyLookupTypes): Removed.  Call
13847         Expression.Resolve() with ResolveFlags.Type instead.
13848
13849 2002-08-12  Martin Baulig  <martin@gnome.org>
13850
13851         * interface.cs (Interface.Define): Apply attributes.
13852
13853         * attribute.cs (Attribute.ApplyAttributes): Added support for
13854         interface attributes.
13855
13856 2002-08-11  Martin Baulig  <martin@gnome.org>
13857
13858         * statement.cs (Block.Emit): Only check the "this" variable if we
13859         do not always throw an exception.
13860
13861         * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
13862         whether the property has a set accessor.
13863
13864 2002-08-11  Martin Baulig  <martin@gnome.org>
13865
13866         Added control flow analysis support for structs.
13867
13868         * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
13869         with control flow analysis turned off.
13870         (IVariable): New interface.
13871         (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
13872         returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
13873         (FieldExpr.DoResolve): Resolve the instance expression with flow
13874         analysis turned off and do the definite assignment check after the
13875         resolving when we know what the expression will resolve to.
13876
13877         * expression.cs (LocalVariableReference, ParameterReference):
13878         Implement the new IVariable interface, only call the flow analysis
13879         code if ec.DoFlowAnalysis is true.
13880         (This): Added constructor which takes a Block argument.  Implement
13881         the new IVariable interface.
13882         (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
13883         DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
13884         This does the definite assignment checks for struct members.
13885
13886         * class.cs (Constructor.Emit): If this is a non-static `struct'
13887         constructor which doesn't have any initializer, call
13888         Block.AddThisVariable() to tell the flow analysis code that all
13889         struct elements must be initialized before control returns from
13890         the constructor.
13891
13892         * statement.cs (MyStructInfo): New public class.
13893         (UsageVector.this [VariableInfo vi]): Added `int field_idx'
13894         argument to this indexer.  If non-zero, check an individual struct
13895         member, not the whole struct.
13896         (FlowBranching.CheckOutParameters): Check struct members.
13897         (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
13898         overloaded versions of these methods which take an additional
13899         `int field_idx' argument to check struct members.
13900         (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
13901         overloaded versions of these methods which take an additional
13902         `string field_name' argument to check struct member.s
13903         (VariableInfo): Implement the IVariable interface.
13904         (VariableInfo.StructInfo): New public property.  Returns the
13905         MyStructInfo instance of the variable if it's a struct or null.
13906         (Block.AddThisVariable): New public method.  This is called from
13907         Constructor.Emit() for non-static `struct' constructor which do
13908         not have any initializer.  It creates a special variable for the
13909         "this" instance variable which will be checked by the flow
13910         analysis code to ensure that all of the struct's fields are
13911         initialized before control returns from the constructor.
13912         (UsageVector): Added support for struct members.  If a
13913         variable/parameter is a struct with N members, we reserve a slot
13914         in the usage vector for each member.  A struct is considered fully
13915         initialized if either the struct itself (slot 0) or all its
13916         members are initialized.
13917
13918 2002-08-08  Martin Baulig  <martin@gnome.org>
13919
13920         * driver.cs (Driver.MainDriver): Only report an error CS5001
13921         if there were no compilation errors.
13922
13923         * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
13924         `UnsafeContext' property to determine whether the parent is in
13925         unsafe context rather than checking the parent's ModFlags:
13926         classes nested in an unsafe class are unsafe as well.
13927
13928 2002-08-08  Martin Baulig  <martin@gnome.org>
13929
13930         * statement.cs (UsageVector.MergeChildren): Distinguish between
13931         `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
13932         we return.  Added test17() and test18() to test-154.cs.
13933
13934 2002-08-08  Martin Baulig  <martin@gnome.org>
13935
13936         * typemanager.cs (TypeManager.FilterWithClosure): If we have
13937         Family access, make sure the invoking type isn't a subclass of the
13938         queried type (that'd be a CS1540).
13939
13940         * ecore.cs (Expression.MemberLookup): Added overloaded version of
13941         this method which takes an additional `Type invocation_type'.
13942
13943         * expression.cs (BaseAccess.DoResolve): Use the base type as
13944         invocation and query type.
13945         (MemberAccess.DoResolve): If the lookup failed and we're about to
13946         report a CS0122, try a lookup with the ec.ContainerType - if this
13947         succeeds, we must report a CS1540.
13948
13949 2002-08-08  Martin Baulig  <martin@gnome.org>
13950
13951         * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
13952         (MethodGroupExpr): Implement the IMemberExpr interface.
13953
13954         * expression (MemberAccess.ResolveMemberAccess): No need to have
13955         any special code for MethodGroupExprs anymore, they're now
13956         IMemberExprs.   
13957
13958 2002-08-08  Martin Baulig  <martin@gnome.org>
13959
13960         * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
13961         Family, FamANDAssem and FamORAssem permissions.
13962         (TypeManager.IsSubclassOrNestedChildOf): New public method.
13963
13964 2002-08-08  Martin Baulig  <martin@gnome.org>
13965
13966         * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
13967         (UsageVector.MergeChildren): `break' breaks unless we're in a switch
13968         or loop block.
13969
13970 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
13971
13972         * driver.cs: implemented /resource option to embed managed resources.
13973
13974 2002-08-07  Martin Baulig  <martin@gnome.org>
13975
13976         * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
13977         (FieldBase.HasFieldInitializer): New public property.
13978         (FieldBase.GetInitializerExpression): New public method.  Resolves and
13979         returns the field initializer and makes sure it is only resolved once.
13980         (TypeContainer.EmitFieldInitializers): Call
13981         FieldBase.GetInitializerExpression to get the initializer, this ensures
13982         that it isn't resolved multiple times.
13983
13984         * codegen.cs (EmitContext): Added `bool IsFieldInitialier'.  This tells
13985         the resolving process (SimpleName/MemberLookup) that we're currently
13986         emitting a field initializer (which must not access any instance members,
13987         this is an error CS0236).
13988
13989         * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
13990         argument, if the `IsFieldInitializer' flag is set, we must report and
13991         error CS0236 and not an error CS0120.   
13992
13993 2002-08-07  Martin Baulig  <martin@gnome.org>
13994
13995         * ecore.cs (IMemberExpr): New public interface.
13996         (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
13997         (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
13998         if the expression is an IMemberExpr.
13999
14000         * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
14001         to be null, implicitly default to `this' if we're non-static in
14002         this case.  Simplified the code a lot by using the new IMemberExpr
14003         interface.  Also fixed bug #28176 here.
14004
14005 2002-08-06  Martin Baulig  <martin@gnome.org>
14006
14007         * cs-parser.jay (SimpleLookup): Removed.  We need to create
14008         ParameterReferences during semantic analysis so that we can do a
14009         type-only search when resolving Cast, TypeOf and SizeOf.
14010         (block): Pass the `current_local_parameters' to the Block's
14011         constructor.
14012
14013         * class.cs (ConstructorInitializer): Added `Parameters parameters'
14014         argument to the constructor.
14015         (ConstructorInitializer.Resolve): Create a temporary implicit
14016         block with the parameters.
14017
14018         * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
14019         references here if we aren't doing a type-only search.
14020
14021         * statement.cs (Block): Added constructor which takes a
14022         `Parameters parameters' argument.
14023         (Block.Parameters): New public property.
14024
14025         * support.cs (InternalParameters.Parameters): Renamed `parameters'
14026         to `Parameters' and made it public readonly.
14027
14028 2002-08-06  Martin Baulig  <martin@gnome.org>
14029
14030         * ecore.cs (Expression.Warning): Made this public as well.
14031
14032         * report.cs (Report.Debug): Print the contents of collections.
14033
14034 2002-08-06  Martin Baulig  <martin@gnome.org>
14035
14036         * ecore.cs (Expression.ResolveFlags): New [Flags] enum.  This is
14037         used to tell Resolve() which kinds of expressions it may return.
14038         (Expression.Resolve): Added overloaded version of this method which
14039         takes a `ResolveFlags flags' argument.  This can be used to tell
14040         Resolve() which kinds of expressions it may return.  Reports a
14041         CS0118 on error.
14042         (Expression.ResolveWithSimpleName): Removed, use Resolve() with
14043         ResolveFlags.SimpleName.
14044         (Expression.Error118): Added overloaded version of this method which
14045         takes a `ResolveFlags flags' argument.  It uses the flags to determine
14046         which kinds of expressions are allowed.
14047
14048         * expression.cs (Argument.ResolveMethodGroup): New public method.
14049         Resolves an argument, but allows a MethodGroup to be returned.
14050         This is used when invoking a delegate.
14051
14052         * TODO: Updated a bit.
14053
14054 2002-08-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14055
14056         Fixed compilation with csc.
14057
14058         * ecore.cs: Expression.Error made public. Is this correct? Should
14059         Warning be made public too?
14060
14061         * expression.cs: use ea.Location instead of ea.loc.
14062         [FIXME:  Filed as bug #28607: MCS must report these errors.]
14063
14064 2002-08-06  Martin Baulig  <martin@gnome.org>
14065
14066         * ecore.cs (Expression.loc): Moved the location here instead of
14067         duplicating it in all derived classes.
14068         (Expression.Location): New public property.
14069         (Expression.Error, Expression.Warning): Made them non-static and
14070         removed the location argument.
14071         (Expression.Warning): Added overloaded version which takes an
14072         `int level' argument.
14073         (Expression.Error118): Make this non-static and removed the
14074         expression and location arguments.
14075         (TypeExpr): Added location argument to the constructor.
14076
14077         * expression.cs (StaticCallExpr): Added location argument to
14078         the constructor.
14079         (Indirection, PointerArithmetic): Likewise.
14080         (CheckedExpr, UnCheckedExpr): Likewise.
14081         (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
14082         (StringPtr): Likewise.
14083
14084
14085 2002-08-05  Martin Baulig  <martin@gnome.org>
14086
14087         * expression.cs (BaseAccess.DoResolve): Actually report errors.
14088
14089         * assign.cs (Assign.DoResolve): Check whether the source
14090         expression is a value or variable.
14091
14092         * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
14093         while resolving the corresponding blocks.
14094
14095         * interface.cs (Interface.GetInterfaceTypeByName): Actually report
14096         an error, don't silently return null.
14097
14098         * statement.cs (Block.AddVariable): Do the error reporting here
14099         and distinguish between CS0128 and CS0136.
14100         (Block.DoResolve): Report all unused labels (warning CS0164).
14101         (LabeledStatement): Pass the location to the constructor.
14102         (LabeledStatement.HasBeenReferenced): New property.
14103         (LabeledStatement.Resolve): Set it to true here.
14104
14105         * statement.cs (Return.Emit): Return success even after reporting
14106         a type mismatch error (CS0126 or CS0127), this is what csc does and
14107         it avoids confusing the users with any consecutive errors.
14108
14109 2002-08-05  Martin Baulig  <martin@gnome.org>
14110
14111         * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
14112
14113         * const.cs (Const.LookupConstantValue): Catch circular definitions.
14114
14115         * expression.cs (MemberAccess.DoResolve): Silently return if an
14116         error has already been reported.
14117
14118         * ecore.cs (Expression.MemberLookupFinal): Silently return if an
14119         error has already been reported.
14120
14121 2002-08-05  Martin Baulig  <martin@gnome.org>
14122
14123         * statement.cs (UsageVector): Only initialize the `parameters'
14124         vector if we actually have any "out" parameters.
14125
14126 2002-08-05  Martin Baulig  <martin@gnome.org>
14127
14128         * expression.cs (Binary.ResolveOperator): When combining delegates,
14129         they must have the same type.
14130
14131 2002-08-05  Martin Baulig  <martin@gnome.org>
14132
14133         * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
14134         PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
14135         work with the ms runtime and we also don't need it: if we're a
14136         PropertyBuilder and not in the `indexer_arguments' hash, then we
14137         are a property and not an indexer.
14138
14139         * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
14140         Type.IsPointer and Type.IsByRef instead of Type.HasElementType
14141         since the latter one doesn't work with the ms runtime.
14142
14143 2002-08-03  Martin Baulig  <martin@gnome.org>
14144
14145         Fixed bugs #27998 and #22735.
14146
14147         * class.cs (Method.IsOperator): New public field.
14148         (Method.CheckBase): Report CS0111 if there's already a method
14149         with the same parameters in the current class.  Report CS0508 when
14150         attempting to change the return type of an inherited method.
14151         (MethodData.Emit): Report CS0179 if a method doesn't have a body
14152         and it's not marked abstract or extern.
14153         (PropertyBase): New abstract base class for Property and Indexer.
14154         (PropertyBase.CheckBase): Moved here from Property and made it work
14155         for indexers.
14156         (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
14157         the same so we can reuse it there.
14158         (Property, Indexer): Derive from PropertyBase.
14159         (MethodSignature.inheritable_property_signature_filter): New delegate
14160         to find properties and indexers.
14161
14162         * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
14163         argument and improved error reporting.
14164
14165         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
14166         EmptyReadOnlyParameters and made it a property.
14167
14168         * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
14169         version of this method which takes a `PropertyInfo indexer'.
14170         (TypeManager.RegisterIndexer): New method.
14171
14172         * class.cs: Added myself as author of this file :-)
14173
14174 2002-08-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14175
14176         * class.cs: fixed compilation on windoze.
14177
14178 2002-08-03  Martin Baulig  <martin@gnome.org>
14179
14180         * interface.cs (Interface.GetInterfaceBases): Check whether all
14181         base interfaces are at least as accessible than the current one.
14182
14183         * class.cs (TypeContainer.GetClassBases): Check whether base types
14184         are at least as accessible than the current type.
14185         (TypeContainer.AsAccessible): Implemented and made non-static.
14186         (MemberBase.CheckParameters): Report errors if the accessibility
14187         checks fail.
14188
14189         * delegate.cs (Delegate.Delegate): The default visibility is
14190         internal for top-level types and private for nested types.
14191         (Delegate.Define): Report errors if the accessibility checks fail.
14192
14193         * enum.cs (Enum.Enum): The default visibility is internal for
14194         top-level types and private for nested types.
14195         (Enum.DefineType): Compute the correct visibility.
14196
14197         * modifiers.cs (Modifiers.TypeAttr): Added a version of this
14198         function which takes a `bool is_toplevel' instead of a TypeContainer.
14199
14200         * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
14201         builtin type.
14202
14203 2002-08-02  Martin Baulig  <martin@gnome.org>
14204
14205         * expression.cs (LocalVariableReferenc): Added constructor which
14206         takes additional `VariableInfo vi' and `bool is_readonly' arguments.
14207         (LocalVariableReference.IsReadOnly): New property.
14208         (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
14209         variable is readonly, use our own readonly flag to do this; you can
14210         use the new constructor to get a writable reference to a read-only
14211         variable.
14212
14213         * cs-parser.jay (foreach_statement, using_statement): Get a writable
14214         reference to the local variable.
14215
14216 2002-08-01  Miguel de Icaza  <miguel@ximian.com>
14217
14218         * rootcontext.cs (ResolveCore): Also include System.Exception
14219
14220         * statement.cs (Block.Emit): Do not emit the dead-code warnings if
14221         we reach an EmptyStatement.
14222
14223         (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
14224         is also fine.
14225
14226         * expression.cs (Binary.ResolveOperator): Check error result in
14227         two places.
14228
14229         use brtrue/brfalse directly and avoid compares to null.
14230
14231 2002-08-02  Martin Baulig  <martin@gnome.org>
14232
14233         * class.cs (TypeContainer.Define): Define all nested interfaces here.
14234         Fixes bug #28407, added test-155.cs.
14235
14236 2002-08-01  Martin Baulig  <martin@gnome.org>
14237
14238         * class.cs (Event.EmitDefaultMethod): Make this work with static
14239         events.  Fixes #28311, added verify-3.cs.
14240
14241 2002-08-01  Martin Baulig  <martin@gnome.org>
14242
14243         * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
14244         `is_disposable' fields.
14245         (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
14246         `hm.is_disposable' if we're using the collection pattern.
14247         (Foreach.EmitCollectionForeach): Use the correct type for the
14248         enumerator's local variable, only emit the try/finally block if
14249         necessary (fixes #27713).
14250
14251 2002-08-01  Martin Baulig  <martin@gnome.org>
14252
14253         * ecore.cs (Expression.report118): Renamed to Error118 and made
14254         it public static.
14255
14256         * statement.cs (Throw.Resolve): Check whether the expression is of
14257         the correct type (CS0118) and whether the type derives from
14258         System.Exception (CS0155).
14259         (Catch.Resolve): New method.  Do the type lookup here and check
14260         whether it derives from System.Exception (CS0155).
14261         (Catch.CatchType, Catch.IsGeneral): New public properties.
14262
14263         * typemanager.cs (TypeManager.exception_type): Added.
14264
14265 2002-07-31  Miguel de Icaza  <miguel@ximian.com>
14266
14267         * driver.cs: Updated About function.
14268
14269 2002-07-31  Martin Baulig  <martin@gnome.org>
14270
14271         Implemented Control Flow Analysis.
14272
14273         * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
14274         (EmitContext.CurrentBranching): Added.
14275         (EmitContext.StartFlowBranching): Added.
14276         (EmitContext.EndFlowBranching): Added.
14277         (EmitContext.KillFlowBranching): Added.
14278         (EmitContext.IsVariableAssigned): Added.
14279         (EmitContext.SetVariableAssigned): Added.
14280         (EmitContext.IsParameterAssigned): Added.
14281         (EmitContext.SetParameterAssigned): Added.
14282         (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
14283         Added control flow analysis stuff here.
14284
14285         * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
14286         resolve the expression as lvalue.
14287         (LocalVariableReference.DoResolve): Check whether the variable has
14288         already been assigned.
14289         (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
14290         the parameter as assigned here.
14291         (ParameterReference.DoResolve): Check whether the parameter has already
14292         been assigned.
14293         (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
14294         expression as lvalue.
14295
14296         * statement.cs (FlowBranching): New class for the flow analysis code.
14297         (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
14298         (LabeledStatement.IsDefined): New public property.
14299         (LabeledStatement.AddUsageVector): New public method to tell flow
14300         analyis that the label may be reached via a forward jump.
14301         (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
14302         flow analysis.
14303         (VariableInfo.Number): New public field.  This is used by flow analysis
14304         to number all locals of a block.
14305         (Block.CountVariables): New public property.  This is the number of
14306         local variables in this block (including the locals from all parent
14307         blocks).
14308         (Block.EmitMeta): Number all the variables.
14309
14310         * statement.cs: Added flow analysis support to all classes.
14311
14312 2002-07-31  Martin Baulig  <martin@gnome.org>
14313
14314         * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
14315         To get debugging messages, compile mcs with /define:MCS_DEBUG and
14316         then use this argument.
14317
14318         * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
14319
14320         * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
14321         use this to specify /define options.
14322
14323 2002-07-29  Martin Baulig  <martin@gnome.org>
14324
14325         * statement.cs (Fixed): Moved all code that does variable lookups
14326         and resolvings from Emit to Resolve.
14327
14328         * statement.cs (For): Moved all code that does variable lookups
14329         and resolvings from Emit to Resolve.
14330
14331         * statement.cs (Using): Moved all code that does variable lookups
14332         and resolvings from Emit to Resolve.
14333
14334 2002-07-29  Martin Baulig  <martin@gnome.org>
14335
14336         * attribute.cs (Attribute.Resolve): Explicitly catch a
14337         System.NullReferenceException when creating the
14338         CustromAttributeBuilder and report a different warning message.
14339
14340 2002-07-29  Martin Baulig  <martin@gnome.org>
14341
14342         * support.cs (ParameterData.ParameterName): Added method to
14343         get the name of a parameter.
14344
14345         * typemanager.cs (TypeManager.IsValueType): New public method.
14346
14347 2002-07-29  Martin Baulig  <martin@gnome.org>
14348
14349         * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'.  This
14350         is a flag which specifies that it's either ref or out.
14351         (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
14352         the out parameter to `out Parameter.Modifier mod', also set the
14353         Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
14354
14355         * support.cs (InternalParameters.ParameterModifier): Distinguish
14356         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
14357         Parameter.Modifier.ISBYREF flag if it's either ref or out.
14358
14359         * expression.cs (Argument.GetParameterModifier): Distinguish
14360         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
14361         Parameter.Modifier.ISBYREF flag if it's either ref or out.
14362
14363 2002-07-29  Martin Baulig  <martin@gnome.org>
14364
14365         * expression.cs (ParameterReference.ParameterReference): Added
14366         `Location loc' argument to the constructor.
14367
14368         * cs-parser.jay: Pass location to ParameterReference.
14369
14370 2002-07-28  Miguel de Icaza  <miguel@ximian.com>
14371
14372         * statement.cs (Try): Initialize the location.
14373
14374         * cs-parser.jay: pass location to Try.
14375
14376         * expression.cs (Unary.Reduce): Change the prototype to return
14377         whether a constant fold could be performed or not.  The result is
14378         returned in an out parameters.  In the case of Indirection and
14379         AddressOf, we want to perform the full tests.
14380
14381 2002-07-26  Miguel de Icaza  <miguel@ximian.com>
14382
14383         * statement.cs (Statement.Emit): Flag dead code.
14384
14385 2002-07-27  Andrew Birkett  <andy@nobugs.org>
14386
14387         * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
14388
14389 2002-07-27  Martin Baulig  <martin@gnome.org>
14390
14391         * class.cs (MethodData.Define): Put back call to
14392         TypeManager.AddMethod(), accidentally commented this out.
14393
14394         * report.cs (Debug): New public method to print debugging information,
14395         this is `[Conditional ("DEBUG")]'.
14396
14397 2002-07-26  Martin Baulig  <martin@gnome.org>
14398
14399         * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
14400         (switch_statement): Push the current_block to the switch_stack and
14401         pop it again when we're done with the switch.
14402         (switch_section): The new block is a child of the current_block.
14403         Fixes bug #24007, added test-152.cs.
14404
14405 2002-07-27  Martin Baulig  <martin@gnome.org>
14406
14407         * expression.cs (Invocation.EmitArguments): When calling a varargs
14408         function with only its fixed arguments, we need to pass an empty
14409         array.
14410
14411 2002-07-27  Martin Baulig  <martin@gnome.org>
14412
14413         Mono 0.13 has been released.
14414
14415 2002-07-25  Miguel de Icaza  <miguel@ximian.com>
14416
14417         * driver.cs: Rename --resource to --linkres, because that is what
14418         we do currently, we dont support --resource yet.
14419
14420         * cs-tokenizer.cs: Fix test for reporting endif mismatches.
14421
14422 2002-07-25  Martin Baulig  <martin@gnome.org>
14423
14424         * class.cs (MethodData): New public class.  This is a `method builder'
14425         class for a method or one accessor of a Property/Indexer/Event.
14426         (MethodData.GetMethodFlags): Moved here from MemberBase.
14427         (MethodData.ApplyAttributes): Likewise.
14428         (MethodData.ApplyObsoleteAttribute): Likewise.
14429         (MethodData.ApplyConditionalAttribute): Likewise.
14430         (MethodData.ApplyDllImportAttribute): Likewise.
14431         (MethodData.CheckAbstractAndExternal): Likewise.
14432         (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
14433         (MethodData.Emit): Formerly known as Method.Emit().
14434         (MemberBase): Moved everything which was specific to a single
14435         accessor/method to MethodData.
14436         (Method): Create a new MethodData and call Define() and Emit() on it.
14437         (Property, Indexer, Event): Create a new MethodData objects for each
14438         accessor and call Define() and Emit() on them.
14439
14440 2002-07-25  Martin Baulig  <martin@gnome.org>
14441
14442         Made MethodCore derive from MemberBase to reuse the code from there.
14443         MemberBase now also checks for attributes.
14444
14445         * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
14446         (MemberBase.GetMethodFlags): Moved here from class Method and marked
14447         as virtual.
14448         (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
14449         `CallingConventions cc' and `Attributes opt_attrs' arguments.
14450         (MemberBase.ApplyAttributes): New virtual method; applies the
14451         attributes to a method or accessor.
14452         (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
14453         (MemberBase.ApplyConditionalAttribute): Likewise.
14454         (MemberBase.ApplyDllImportAttribute): Likewise.
14455         (MemberBase.CheckAbstractAndExternal): Likewise.
14456         (MethodCore.ParameterTypes): This is now a property instead of a
14457         method, it's initialized from DoDefineParameters().
14458         (MethodCore.ParameterInfo): Removed the set accessor.
14459         (MethodCore.DoDefineParameters): New protected virtual method to
14460         initialize ParameterTypes and ParameterInfo.
14461         (Method.GetReturnType): We can now simply return the MemberType.
14462         (Method.GetMethodFlags): Override the MemberBase version and add
14463         the conditional flags.
14464         (Method.CheckBase): Moved some code from Define() here, call
14465         DoDefineParameters() here.
14466         (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
14467         here to avoid some larger code duplication.
14468         (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
14469         ensure that abstract and external accessors don't declare a body.
14470
14471         * attribute.cs (Attribute.GetValidPieces): Make this actually work:
14472         `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
14473         lookup in the attribute's parent classes, so we need to abort as soon
14474         as we found the first match.
14475         (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
14476         the attribute has no arguments.
14477
14478         * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
14479         of a Method.
14480
14481 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14482
14483         * cs-parser.jay: reverted previous patch.
14484
14485 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14486
14487         * cs-parser.jay: fixed bug #22119.
14488
14489 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14490
14491         * attribute.cs: fixed compilation. The error was:
14492         "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must 
14493         be assigned to before control leaves the current method."
14494         [FIXME:  Filed as bug #28186: MCS must report this error.]
14495
14496 2002-07-25  Martin Baulig  <martin@gnome.org>
14497
14498         * attribute.cs (Attribute.Conditional_GetConditionName): New static
14499         method to pull the condition name ouf of a Conditional attribute.
14500         (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
14501         the obsolete message and error flag out of an Obsolete attribute.
14502
14503         * class.cs (Method.GetMethodFlags): New public method to get the
14504         TypeManager.MethodFlags for this method.
14505         (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
14506         private methods.
14507         (Method.Define): Get and apply the Obsolete and Conditional attributes;
14508         if we're overriding a virtual function, set the new private variable
14509         `parent_method'; call the new TypeManager.AddMethod().
14510
14511         * typemanager.cs (TypeManager.AddMethod): New static method.  Stores
14512         the MethodBuilder and the Method in a PtrHashtable.
14513         (TypeManager.builder_to_method): Added for this purpose.
14514         (TypeManager.MethodFlags): Added IsObsoleteError.
14515         (TypeManager.GetMethodFlags): Added `Location loc' argument.  Lookup
14516         Obsolete and Conditional arguments in MethodBuilders.  If we discover
14517         an Obsolete attribute, emit an appropriate warning 618 / error 619 with
14518         the message from the attribute.
14519
14520 2002-07-24  Martin Baulig  <martin@gnome.org>
14521
14522         * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
14523         preprocessor directives, ensure that the argument to #define/#undef is
14524         exactly one identifier and that it's actually an identifier.
14525
14526         Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
14527         did not work ....
14528
14529 2002-07-24  Martin Baulig  <martin@gnome.org>
14530
14531         * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
14532         initialize it to TypeManager.object_type in the constructor.
14533         (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
14534         of the `hm.get_current' method if we're using the collection pattern.
14535         (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
14536         for the explicit conversion to make it work when we're using the collection
14537         pattern and the `Current' property has a different return type than `object'.
14538         Fixes #27713.
14539
14540 2002-07-24  Martin Baulig  <martin@gnome.org>
14541
14542         * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
14543         does not match, but don't report any errors.  This method is called in
14544         order for all methods in a MethodGroupExpr until a matching method is
14545         found, so we don't want to bail out if the first method doesn't match.
14546         (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
14547         matches, report the 123.  Fixes #28070.
14548
14549 2002-07-24  Martin Baulig  <martin@gnome.org>
14550
14551         * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
14552         TypeManager.TypeToCoreType() to the top of the method so the
14553         following equality checks will work.  Fixes #28107.
14554
14555 2002-07-24  Martin Baulig  <martin@gnome.org>
14556
14557         * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
14558         operand is of type uint, and the other operand is of type sbyte,
14559         short or int, the operands are converted to type long." -
14560         Actually do what this comment already told us.  Fixes bug #28106,
14561         added test-150.cs.
14562
14563 2002-07-24  Martin Baulig  <martin@gnome.org>
14564
14565         * class.cs (MethodBase): New abstract class.  This is now a base
14566         class for Property, Indexer and Event to avoid some code duplication
14567         in their Define() and DefineMethods() methods.
14568         (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
14569         generic methods for Define() and DefineMethods().
14570         (FieldBase): Derive from MemberBase, not MemberCore.
14571         (Property): Derive from MemberBase, not MemberCore.
14572         (Property.DefineMethod): Moved all the code from this method to the
14573         new MethodBase.DefineAccessor(), just call it with appropriate
14574         argumetnts.
14575         (Property.Define): Call the new Property.DoDefine(), this does some
14576         sanity checks and we don't need to duplicate the code everywhere.
14577         (Event): Derive from MemberBase, not MemberCore.
14578         (Event.Define): Use the new MethodBase.DefineAccessor() to define the
14579         accessors, this will also make them work with interface events.
14580         (Indexer): Derive from MemberBase, not MemberCore.
14581         (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
14582         (Indexer.Define): Use the new MethodBase functions.
14583
14584         * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
14585         argument to the constructor.
14586         (Interface.FindMembers): Added support for interface events.
14587         (Interface.PopluateEvent): Implemented.
14588
14589         Added test-149.cs for this.  This also fixes bugs #26067 and #24256.
14590
14591 2002-07-22  Miguel de Icaza  <miguel@ximian.com>
14592
14593         * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
14594         but this is required to check for a method name being the same as
14595         the containing class.  
14596
14597         Handle this now.
14598
14599 2002-07-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14600
14601         * interface.cs: initialize variable.
14602
14603 2002-07-23  Martin Baulig  <martin@gnome.org>
14604
14605         Implemented the IndexerName attribute in interfaces.
14606
14607         * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
14608         name if this is an explicit interface implementation.
14609         (Indexer.InterfaceIndexerName): New public variable.  If we're
14610         implementing an interface indexer, this is the IndexerName in that
14611         interface.  Otherwise, it's the IndexerName.
14612         (Indexer.DefineMethod): If we're implementing interface indexer,
14613         set InterfaceIndexerName.  Use the new Pending.IsInterfaceIndexer
14614         and Pending.ImplementIndexer methods.
14615         (Indexer.Define): Also define the PropertyBuilder if we're
14616         implementing an interface indexer and this is neither an explicit
14617         interface implementation nor do the IndexerName match the one in
14618         the interface.
14619
14620         * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
14621         If a method is defined here, then we always need to create a proxy
14622         for it.  This is used when implementing interface indexers.
14623         (Pending.IsInterfaceIndexer): New public method.
14624         (Pending.ImplementIndexer): New public method.
14625         (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
14626         This is used when implementing interface indexers to define a proxy
14627         if necessary.
14628         (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
14629         define a proxy if necessary.
14630
14631         * interface.cs (Interface.IndexerName): New public variable.
14632         (Interface.PopulateIndexer): Set the IndexerName.
14633         (Interface.DefineIndexers): New private method.  Populate all the
14634         indexers and make sure their IndexerNames match.
14635
14636         * typemanager.cs (IndexerPropertyName): Added support for interface
14637         indexers.
14638
14639 2002-07-22  Martin Baulig  <martin@gnome.org>
14640
14641         * codegen.cs (EmitContext.HasReturnLabel): New public variable.
14642         (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
14643         ret if HasReturnLabel.
14644         (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
14645         variables.
14646
14647         * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
14648         and set the ec.LoopBeginTryCatchLevel.
14649         (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
14650         (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
14651         the current ec.TryCatchLevel, the branch goes out of an exception
14652         block.  In this case, we need to use Leave and not Br.
14653
14654 2002-07-22  Martin Baulig  <martin@gnome.org>
14655
14656         * statement.cs (Try.Emit): Emit an explicit ret after the end of the
14657         block unless the block does not always return or it is contained in
14658         another try { ... } catch { ... } block.  Fixes bug #26506.
14659         Added verify-1.cs to the test suite.
14660
14661 2002-07-22  Martin Baulig  <martin@gnome.org>
14662
14663         * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
14664         then we do not always return.  Fixes bug #24985.
14665
14666 2002-07-22  Martin Baulig  <martin@gnome.org>
14667
14668         * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
14669         lookup on a per-class level; ie. walk up the class hierarchy until we
14670         found at least one applicable method, then choose the best among them.
14671         Fixes bug #24463 and test-29.cs.
14672
14673 2002-07-22  Martin Baulig  <martin@gnome.org>
14674
14675         * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
14676         return types of the methods.  The return type is not part of the
14677         signature and we must not check it to make the `new' modifier work.
14678         Fixes bug #27999, also added test-147.cs.
14679         (TypeManager.TypeToCoreType): Added TypeManager.type_type.
14680
14681         * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
14682         on the method's return type.
14683
14684 2002-07-21  Martin Baulig  <martin@gnome.org>
14685
14686         * assign.cs: Make this work if the rightmost source is a constant and
14687         we need to do an implicit type conversion.  Also adding a few more tests
14688         to test-38.cs which should have caught this.
14689
14690         * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
14691         target in the makefile for this.  The makefile.gnu is primarily intended
14692         for end-users who don't want to debug the compiler.
14693
14694 2002-07-21  Martin Baulig  <martin@gnome.org>
14695
14696         * assign.cs: Improved the Assign class so it can now handle embedded
14697         assignments (X = Y = Z = something).  As a side-effect this'll now also
14698         consume less local variables.  test-38.cs now passes with MCS, added
14699         a few new test cases to that test.
14700
14701 2002-07-20  Martin Baulig  <martin@gnome.org>
14702
14703         * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
14704         instructions.  Fixes bug #27977, also added test-146.cs.
14705
14706 2002-07-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14707
14708         * cs-tokenizer.cs: fixed getHex ().
14709
14710 2002-07-19  Martin Baulig  <martin@gnome.org>
14711
14712         * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
14713         not Type.GetType() to lookup the array type.  This is needed when
14714         we're constructing an array of a user-defined type.
14715         (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
14716         single-dimensional arrays, but also for single-dimensial arrays of
14717         type decimal.
14718
14719 2002-07-19  Martin Baulig  <martin@gnome.org>
14720
14721         * expression.cs (New.DoEmit): Create a new LocalTemporary each time
14722         this function is called, it's not allowed to share LocalBuilders
14723         among ILGenerators.
14724
14725 2002-07-19  Martin Baulig  <martin@gnome.org>
14726
14727         * expression.cs (Argument.Resolve): Report an error 118 when trying
14728         to pass a type as argument.
14729
14730 2002-07-18  Martin Baulig  <martin@gnome.org>
14731
14732         * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
14733         Conv_R_Un for the signed `long' type.
14734
14735 2002-07-15  Miguel de Icaza  <miguel@ximian.com>
14736
14737         * expression.cs (MemberAccess.DoResolve): Do not reuse the field
14738         `expr' for the temporary result, as that will fail if we do
14739         multiple resolves on the same expression.
14740
14741 2002-07-05  Miguel de Icaza  <miguel@ximian.com>
14742
14743         * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
14744         ec.TypeContainer for looking up aliases. 
14745
14746         * class.cs (TypeContainer): Remove LookupAlias from here.
14747
14748         * decl.cs (DeclSpace); Move here.
14749
14750 2002-07-01  Miguel de Icaza  <miguel@ximian.com>
14751
14752         * class.cs (FindMembers): Only call filter if the constructor
14753         bulider is not null.
14754
14755         Also handle delegates in `NestedTypes' now.  Now we will perform
14756         type lookups using the standard resolution process.  This also
14757         fixes a bug.
14758
14759         * decl.cs (DeclSpace.ResolveType): New type resolution routine.
14760         This uses Expressions (the limited kind that can be parsed by the
14761         tree) instead of strings.
14762
14763         * expression.cs (ComposedCast.ToString): Implement, used to flag
14764         errors since now we have to render expressions.
14765
14766         (ArrayCreation): Kill FormElementType.  Use ComposedCasts in
14767         FormArrayType. 
14768
14769         * ecore.cs (SimpleName.ToString): ditto.
14770
14771         * cs-parser.jay: Instead of using strings to assemble types, use
14772         Expressions to assemble the type (using SimpleName, ComposedCast,
14773         MemberAccess).  This should fix the type lookups in declarations,
14774         because we were using a different code path for this.
14775
14776         * statement.cs (Block.Resolve): Continue processing statements
14777         even when there is an error.
14778
14779 2002-07-17  Miguel de Icaza  <miguel@ximian.com>
14780
14781         * class.cs (Event.Define): Also remove the `remove' method from
14782         the list of pending items.
14783
14784         * expression.cs (ParameterReference): Use ldarg.N (0..3) to
14785         generate more compact code. 
14786
14787 2002-07-17  Martin Baulig  <martin@gnome.org>
14788
14789         * const.cs (Const.LookupConstantValue): Add support for constant
14790         `unchecked' and `checked' expressions.
14791         Also adding test case test-140.cs for this.
14792
14793 2002-07-17  Martin Baulig  <martin@gnome.org>
14794
14795         * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
14796         check whether mi.ReturnType implements the IEnumerator interface; the
14797         `==' and the IsAssignableFrom() will fail in this situation.
14798
14799 2002-07-16  Ravi Pratap  <ravi@ximian.com>
14800
14801         * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix 
14802         here too.
14803
14804 2002-07-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14805
14806         * expression.cs: fixed bug #27811.
14807
14808 2002-07-14  Miguel de Icaza  <miguel@ximian.com>
14809
14810         * expression.cs (ParameterReference.AddressOf): Patch from Paolo
14811         Molaro: when we are a ref, the value already contains a pointer
14812         value, do not take the address of it.
14813
14814 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
14815         * removed mb-parser.jay and mb-tokenizer.cs
14816
14817 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
14818
14819         * expression.cs: check against the building corlib void type.
14820
14821 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
14822
14823         * ecore.cs: fix for valuetype static readonly fields: when 
14824         initializing them, we need their address, not the address of a copy.
14825
14826 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
14827
14828         * typemanager.cs: register also enum_type in corlib.
14829
14830 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
14831
14832         * class.cs: allow calling this (but not base) initializers in structs.
14833
14834 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
14835
14836         * ecore.cs: make sure we compare against the building base types
14837         in GetTypeSize ().
14838
14839 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
14840
14841         * typemanager.cs: fix TypeToCoreType() to handle void and object
14842         (corlib gets no more typerefs after this change).
14843
14844 2002-07-12  Miguel de Icaza  <miguel@ximian.com>
14845
14846         * expression.cs (ArrayCreation.EmitArrayArguments): use
14847         Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
14848
14849         (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
14850         Conv_Ovf_I_Un for the array arguments.  Even if C# allows longs as
14851         array indexes, the runtime actually forbids them.
14852
14853         * ecore.cs (ExpressionToArrayArgument): Move the conversion code
14854         for array arguments here.
14855
14856         * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
14857         instead of the default for ValueTypes.
14858
14859         (New.DoEmit): Use IsValueType instead of
14860         IsSubclassOf (value_type)
14861         (New.DoResolve): ditto.
14862         (Invocation.EmitCall): ditto.
14863
14864         * assign.cs (Assign): ditto.
14865
14866         * statement.cs (Unsafe): Ok, so I got the semantics wrong.
14867         Statements *are* currently doing part of their resolution during
14868         Emit.  
14869
14870         Expressions do always resolve during resolve, but statements are
14871         only required to propagate resolution to their children.
14872
14873 2002-07-11  Miguel de Icaza  <miguel@ximian.com>
14874
14875         * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
14876
14877         (LoadAssembly): Do not add the dll if it is already specified
14878
14879         (MainDriver): Add the System directory to the link path at the end,
14880         after all the other -L arguments. 
14881
14882         * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
14883         wrong opcode for loading bytes and bools (ldelem.i1 instead of
14884         ldelem.u1) and using the opposite for sbytes.
14885
14886         This fixes Digger, and we can finally run it.
14887
14888         * driver.cs (UnixParseOption): Move the option parsing here.  
14889         (CSCParseOption): Implement CSC-like parsing of options.
14890
14891         We now support both modes of operation, the old Unix way, and the
14892         new CSC-like way.  This should help those who wanted to make cross
14893         platform makefiles.
14894
14895         The only thing broken is that /r:, /reference: and /lib: are not
14896         implemented, because I want to make those have the same semantics
14897         as the CSC compiler has, and kill once and for all the confussion
14898         around this.   Will be doing this tomorrow.
14899
14900         * statement.cs (Unsafe.Resolve): The state is checked during
14901         resolve, not emit, so we have to set the flags for IsUnsfe here.
14902
14903 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
14904
14905         * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
14906         not catch the Error_ObjectRefRequired in SimpleName (as it is
14907         possible to have a class/instance variable name that later gets
14908         deambiguated), we have to check this here.      
14909
14910 2002-07-10  Ravi Pratap  <ravi@ximian.com>
14911
14912         * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
14913         make static and put into Expression.
14914
14915         (Event.Define): Register the private field of the event with the 
14916         TypeManager so that GetFieldFromEvent can get at it.
14917
14918         (TypeManager.RegisterPrivateFieldOfEvent): Implement to
14919         keep track of the private field associated with an event which
14920         has no accessors.
14921
14922         (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
14923         private field.
14924
14925         * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
14926
14927 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
14928
14929         * expression.cs (Binary.EmitBranchable): this routine emits the
14930         Binary expression in a branchable context.  This basically means:
14931         we need to branch somewhere, not just get the value on the stack.
14932
14933         This works together with Statement.EmitBoolExpression.
14934
14935         * statement.cs (Statement.EmitBoolExpression): Use
14936         EmitBranchable. 
14937
14938 2002-07-09  Miguel de Icaza  <miguel@ximian.com>
14939
14940         * statement.cs (For): Reduce the number of jumps in loops.
14941
14942         (For): Implement loop inversion for the For statement.
14943
14944         (Break): We can be breaking out of a Try/Catch controlled section
14945         (foreach might have an implicit try/catch clause), so we need to
14946         use Leave instead of Br.
14947
14948         * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
14949         now).  If the instace expression supports IMemoryLocation, we use
14950         the AddressOf method from the IMemoryLocation to extract the
14951         address instead of emitting the instance.
14952
14953         This showed up with `This', as we were emitting the instance
14954         always (Emit) instead of the Address of This.  Particularly
14955         interesting when This is a value type, as we dont want the Emit
14956         effect (which was to load the object).
14957
14958 2002-07-08  Miguel de Icaza  <miguel@ximian.com>
14959
14960         * attribute.cs: Pass the entry point to the DefinePInvokeMethod
14961
14962         * statement.cs (Checked): Set the CheckedState during the resolve
14963         process too, as the ConvCast operations track the checked state on
14964         the resolve process, and not emit.
14965
14966         * cs-parser.jay (namespace_member_declaration): Flag that we have
14967         found a declaration when we do.  This is used to flag error 1529
14968
14969         * driver.cs: Report ok when we display the help only.
14970
14971 2002-07-06  Andrew Birkett  <adb@tardis.ed.ac.uk>
14972
14973         * cs-tokenizer.cs (xtoken): Improve handling of string literals.
14974
14975 2002-07-04  Miguel de Icaza  <miguel@ximian.com>
14976
14977         * cs-tokenizer.cs (define): We also have to track locally the
14978         defines.  AllDefines is just used for the Conditional Attribute,
14979         but we also need the local defines for the current source code. 
14980
14981 2002-07-03  Miguel de Icaza  <miguel@ximian.com>
14982
14983         * statement.cs (While, For, Do): These loops can exit through a
14984         Break statement, use this information to tell whether the
14985         statement is the last piece of code.
14986
14987         (Break): Flag that we break.
14988
14989         * codegen.cs (EmitContexts): New `Breaks' state variable.
14990
14991 2002-07-03  Martin Baulig  <martin@gnome.org>
14992
14993         * class.cs (TypeContainer.MethodModifiersValid): Allow override
14994         modifiers in method declarations in structs.  Otherwise, you won't
14995         be able to override things like Object.Equals().
14996
14997 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
14998
14999         * class.cs (Method, Property, Indexer): Do not allow the public
15000         modifier to be used in explicit interface implementations.
15001
15002         (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
15003         override modifiers in method declarations in structs
15004
15005 2002-07-02   Andrew Birkett <adb@tardis.ed.ac.uk>
15006
15007         * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
15008         integer or real overflow, report an error
15009
15010 2002-07-02  Martin Baulig  <martin@gnome.org>
15011
15012         * typemanager.cs (TypeManager.InitCoreTypes): When compiling
15013         corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
15014         to tell the runtime about our newly created System.Object and
15015         System.ValueType types.
15016
15017 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
15018
15019         * expression.cs (This): Use Stobj/Ldobj when we are a member of a
15020         struct instead of Ldarg/Starg.
15021
15022 2002-07-02  Martin Baulig  <martin@gnome.org>
15023
15024         * expression.cs (Indirection.Indirection): Call
15025         TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
15026
15027 2002-07-02  Martin Baulig  <martin@gnome.org>
15028
15029         * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
15030         ValueType, call TypeManager.TypeToCoreType() on it.
15031         (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
15032         the OpCodes.Newarr argument.
15033
15034 2002-07-02  Martin Baulig  <martin@gnome.org>
15035
15036         * expression.cs (Invocation.EmitCall): When compiling corlib,
15037         replace all calls to the system's System.Array type to calls to
15038         the newly created one.
15039
15040         * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
15041         System.Array methods.
15042         (TypeManager.InitCoreTypes): When compiling corlib, get the methods
15043         from the system's System.Array type which must be replaced.
15044
15045 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
15046
15047         * typemanager.cs: load unverifiable_code_ctor so we can build
15048         corlib using the correct type. Avoid using GetTypeCode() with
15049         TypeBuilders.
15050         * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
15051         TypeManager.object_type to allow building corlib.
15052
15053 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
15054
15055         * ecore.cs: handle System.Enum separately in LoadFromPtr().
15056
15057 2002-07-01  Martin Baulig  <martin@gnome.org>
15058
15059         * class.cs: Make the last change actually work, we need to check
15060         whether `ifaces != null' to avoid a crash.
15061
15062 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
15063
15064         * class.cs: when we build structs without fields that implement
15065         interfaces, we need to add the interfaces separately, since there is
15066         no API to both set the size and add the interfaces at type creation
15067         time.
15068
15069 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
15070
15071         * expression.cs: the dimension arguments to the array constructors
15072         need to be converted if they are a long.
15073
15074 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
15075
15076         * class.cs: don't emit ldarg.0 if there is no parent constructor
15077         (fixes showstopper for corlib).
15078
15079 2002-06-29  Martin Baulig  <martin@gnome.org>
15080
15081         MCS now compiles corlib on GNU/Linux :-)
15082
15083         * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
15084         ie. check for MethodImplOptions.InternalCall.
15085
15086         * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
15087         and TypeManager.attribute_type are null, so we must explicitly check
15088         whether parent is not null to find out whether it's an attribute type.
15089         (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
15090         and SetBuilder, not only if the property is neither abstract nor external.
15091         This is necessary to set the MethodImplOptions on the accessor methods.
15092         (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
15093         SetBuilder, see Property.Emit().
15094
15095         * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
15096         populate "System.Object", "System.ValueType" and "System.Attribute" since
15097         they've already been populated from BootCorlib_PopulateCoreTypes().
15098
15099 2002-06-29  Martin Baulig  <martin@gnome.org>
15100
15101         * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
15102         is the NullLiteral, we also need to make sure that target_type is not
15103         an enum type.   
15104
15105 2002-06-29  Martin Baulig  <martin@gnome.org>
15106
15107         * rootcontext.cs (RootContext.ResolveCore): We must initialize
15108         `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
15109         before calling BootstrapCorlib_ResolveDelegate ().
15110
15111 2002-06-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15112
15113         * statement.cs: fixed build-breaker. All tests passed ok.
15114
15115 2002-06-27  Martin Baulig  <martin@gnome.org>
15116
15117         * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
15118         for System.Decimal when compiling corlib.
15119
15120 2002-06-27  Martin Baulig  <martin@gnome.org>
15121
15122         * statement.cs (Switch.TableSwitchEmit): Make this work with empty
15123         switch blocks which contain nothing but a default clause.
15124
15125 2002-06-26  Andrew  <adb@tardis.ed.ac.uk>
15126
15127        * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
15128
15129 2002-06-27  Martin Baulig  <martin@gnome.org>
15130
15131         * ecore.cs (PropertyExpr.PropertyExpr): Call
15132         TypeManager.TypeToCoreType() on the `pi.PropertyType'.
15133
15134         * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
15135         is already a TypeBuilder.
15136
15137 2002-06-27  Martin Baulig  <martin@gnome.org>
15138
15139         * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
15140         `target_type == TypeManager.array_type', not IsAssignableFrom() in
15141         the "from an array-type to System.Array" case.  This makes it work
15142         when compiling corlib.
15143
15144 2002-06-27  Martin Baulig  <martin@gnome.org>
15145
15146         * ecore.cs (Expression.SimpleNameResolve): If the expression is a
15147         non-static PropertyExpr, set its InstanceExpression.  This makes
15148         the `ICollection.Count' property work in System/Array.cs.
15149
15150 2002-06-25  Andrew Birkett  <adb@tardis.ed.ac.uk>
15151
15152         * driver.cs: Made error handling more consistent.  Errors now
15153         tracked by Report class, so many methods which used to return int
15154         now return void.  Main() now prints success/failure and 
15155         errors/warnings message.
15156
15157         Renamed '--probe' compiler argument to '--expect-error'.  Removed
15158         the magic number return values (123 and 124).  Now, if the
15159         expected error occurs, the compiler exits with success (exit value
15160         0).  If the compilation completes without seeing that particular
15161         error, the compiler exits with failure (exit value 1).  The
15162         makefile in mcs/errors has been changed to handle the new behaviour.
15163
15164         * report.cs: Made 'expected error' number a property and renamed
15165         it from 'Probe' to 'ExpectedError'.
15166
15167         * genericparser.cs: Removed error handling support, since it is
15168         now all done by Report class.
15169
15170         * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
15171         class, so parse() no longer returns an int.
15172
15173         * namespace.cs: Use Report.Error instead of GenericParser.error
15174
15175 2002-06-22  Miguel de Icaza  <miguel@ximian.com>
15176
15177         * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
15178         TypeContainer.AddOperator): At the front of the list put the
15179         explicit implementations, so they get resolved/defined first. 
15180
15181 2002-06-21  Miguel de Icaza  <miguel@ximian.com>
15182
15183         * class.cs (TypeContainer.VerifyImplements): Verifies that a given
15184         interface type is implemented by this TypeContainer.  Used during
15185         explicit interface implementation.
15186
15187         (Property.Define, Indexer.Define, Method.Define): Validate that
15188         the given interface in the explicit implementation is one of the
15189         base classes for the containing type.
15190
15191         Also if we are explicitly implementing an interface, but there is
15192         no match in the pending implementation table, report an error.
15193
15194         (Property.Define): Only define the property if we are
15195         not explicitly implementing a property from an interface.  Use the
15196         correct name also for those properties (the same CSC uses,
15197         although that is really not needed).
15198
15199         (Property.Emit): Do not emit attributes for explicitly implemented
15200         properties, as there is no TypeBuilder.
15201
15202         (Indexer.Emit): ditto.
15203
15204         Hiding then means that we do not really *implement* a pending
15205         implementation, which makes code fail.
15206
15207 2002-06-22  Martin Baulig  <martin@gnome.org>
15208
15209         * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
15210         the return value of Object.GetType().  [FIXME: we need to do this whenever
15211         we get a type back from the reflection library].
15212
15213 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
15214
15215         * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
15216
15217 2002-06-20  Miguel de Icaza  <miguel@ximian.com>
15218
15219         * attribute.cs: Return null if we can not look up the type.
15220
15221         * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
15222         the interface types found.
15223
15224         * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
15225         interface types found.
15226
15227         * typemanager.cs (GetInterfaces): Make this routine returns alll
15228         the interfaces and work around the lame differences between
15229         System.Type and System.Reflection.Emit.TypeBuilder in the results
15230         result for GetInterfaces.
15231
15232         (ExpandInterfaces): Given an array of interface types, expand and
15233         eliminate repeated ocurrences of an interface.  This expands in
15234         context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
15235         be IA, IB, IC.
15236
15237 2002-06-21  Martin Baulig  <martin@gnome.org>
15238
15239         * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
15240         on System.Enum.
15241
15242 2002-06-21  Martin Baulig  <martin@gnome.org>
15243
15244         * typemanager.cs (TypeManager.TypeToCoreType): New function.  When compiling corlib
15245         and called with one of the core types, return the corresponding typebuilder for
15246         that type.
15247
15248         * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
15249         element type.
15250
15251 2002-06-21  Martin Baulig  <martin@gnome.org>
15252
15253         * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
15254         `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
15255         (Expression.ConvertReferenceExplicit): Likewise.
15256
15257         * expression.cs (ElementAccess.DoResolve): Likewise.
15258         (ElementAccess.DoResolveLValue): Likewise.
15259
15260 2002-06-10  Martin Baulig  <martin@gnome.org>
15261
15262         * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
15263         add the "value" parameter to the parameter list.
15264
15265         * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
15266         to our caller.
15267
15268 2002-06-19  Miguel de Icaza  <miguel@ximian.com>
15269
15270         * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
15271         the argument to an int, uint, long or ulong, per the spec.  Also
15272         catch negative constants in array creation.
15273
15274 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
15275
15276         * class.cs: do not allow the same interface to appear twice in
15277         the definition list.
15278
15279 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
15280
15281         * ecore.cs: don't use ldlen with System.Array.
15282
15283 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
15284
15285         * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
15286
15287 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
15288
15289         * modifiers.cs: produce correct field attributes for protected
15290         internal. Easy fix so miguel can work on ther harder stuff:-)
15291
15292 2002-06-18  Miguel de Icaza  <miguel@ximian.com>
15293
15294         * pending.cs: New file.  Move the code from class.cs here.
15295         Support clearning the pending flag for all methods (when not doing
15296         explicit interface implementation).
15297
15298 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
15299
15300         * rootcontext.cs: added a couple more types needed to bootstrap.
15301
15302 2002-06-17  Miguel de Icaza  <miguel@ximian.com>
15303
15304         * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
15305         constructor in the type, instead of any constructor in the type
15306         hierarchy.  Thanks to Paolo for finding this bug (it showed up as
15307         a bug in the Mono runtime when applying the params attribute). 
15308
15309 2002-06-16  Rafael Teixeira  <rafaelteixeirabr@hotmail.com>
15310         * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
15311
15312 2002-06-14  Rachel Hestilow  <hestilow@ximian.com>
15313
15314         * expression.cs (Unary.ResolveOperator): Use TypeManager
15315         to resolve the type.
15316
15317 2002-06-13  Ravi Pratap  <ravi@ximian.com>
15318
15319         * cs-parser.jay (enum_member_declaration): Pass in the attributes
15320         attached.
15321
15322         * enum.cs (AddEnumMember): Add support to store the attributes associated 
15323         with each member too.
15324
15325         * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
15326         field builders too - this takes care of the enum member case.
15327
15328 2002-06-10  Rachel Hestilow  <hestilow@ximian.com>
15329
15330         * typemanager.cs (TypeManager.VerifyUnManaged): Allow
15331         address-of operator on both value types and pointers.
15332
15333 2002-06-10  Martin Baulig  <martin@gnome.org>
15334
15335         * interface.cs (Interface.PopulateIndexer): Add the indexer's
15336         PropertyBuilder to the `property_builders' list.
15337
15338         * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
15339         (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
15340         `lookup_type' and all its interfaces.  Unfortunately, Type.FindMembers() won't
15341         find any indexers which are inherited from an interface.
15342
15343 2002-06-09  Martin Baulig  <martin@gnome.org>
15344
15345         * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
15346         the same type as the constant if necessary.  There's also a test-130.cs
15347         for this.
15348
15349         * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
15350
15351         * typemanager.cs (TypeManager.ChangeType): Previously known as
15352         Enum.ChangeEnumType().
15353
15354 2002-06-09  Martin Baulig  <martin@gnome.org>
15355
15356         * expression.cs (Cast.TryReduce): Added support for consts.
15357
15358 2002-06-08  Ravi Pratap  <ravi@ximian.com>
15359
15360         * class.cs (Accessor): Hold attributes information so we can pass
15361         it along.
15362
15363         * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
15364         Modify to pass in attributes attached to the methods.
15365
15366         (add_accessor_declaration, remove_accessor_declaration): Ditto.
15367
15368         * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
15369         to handle the Accessor kind :-)
15370
15371         * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
15372
15373 2002-06-08  Martin Baulig  <martin@gnome.org>
15374
15375         * expression.cs (Unary.TryReduceNegative): Added support for
15376         ULongConstants.
15377
15378 2002-06-08  Martin Baulig  <martin@gnome.org>
15379
15380         * enum.cs (Enum.LookupEnumValue): Don't report an error if the
15381         name can't be found in the `defined_names' - the caller will do a
15382         MemberLookup in this case and thus find methods in System.Enum
15383         such as Enum.IsDefined().
15384
15385 2002-06-08  Martin Baulig  <martin@gnome.org>
15386
15387         * enum.cs (Enum.ChangeEnumType): This is a custom version of
15388         Convert.ChangeType() which works with TypeBuilder created types.
15389         (Enum.LookupEnumValue, Enum.Define): Use it here.
15390
15391         * class.cs (TypeContainer.RegisterRequiredImplementations): Added
15392         `TypeBuilder.BaseType != null' check.
15393         (TypeContainer.FindMembers): Only lookup parent members if we
15394         actually have a parent.
15395         (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
15396         (ConstructorInitializer.Resolve): Likewise.
15397
15398         * interface.cs (Interface.FindMembers): Added
15399         `TypeBuilder.BaseType != null' check.
15400
15401         * rootcontext.cs (RootContext.ResolveCore): Added
15402         "System.Runtime.CompilerServices.IndexerNameAttribute" to
15403         classes_second_stage.
15404
15405         * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
15406         debug_type and trace_type when compiling with --nostdlib.       
15407
15408 2002-06-07  Martin Baulig  <martin@gnome.org>
15409
15410         * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
15411         (AddField): Set it to true when adding a non-static field.
15412         (DefineType): Use `have_nonstatic_fields' to find out whether we
15413         have non-static fields, not `Fields != null'.
15414
15415 2002-06-02  Miguel de Icaza  <miguel@ximian.com>
15416
15417         * ecore.cs (SimpleNameResolve): Removed simple bug (we were
15418         dereferencing a null on the static-field code path)
15419
15420 2002-05-30  Martin Baulig  <martin@gnome.org>
15421
15422         * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
15423         to take command line arguments.  Use reflection to call the new
15424         custom `Initialize' function on the symbol writer and pass it the
15425         command line arguments.
15426
15427         * driver.cs (--debug-args): New command line argument to pass command
15428         line arguments to the symbol writer.
15429
15430 2002-05-28  Miguel de Icaza  <miguel@ximian.com>
15431
15432         * assign.cs (DoResolve): Forgot to do the implicit conversion to
15433         the target type for indexers and properties.  Thanks to Joe for
15434         catching this.
15435
15436 2002-05-27  Miguel de Icaza  <miguel@ximian.com>
15437
15438         * typemanager.cs (MethodFlags): returns the method flags
15439         (Obsolete/ShouldIgnore) that control warning emission and whether
15440         the invocation should be made, or ignored. 
15441
15442         * expression.cs (Invocation.Emit): Remove previous hack, we should
15443         not do this on matching a base type, we should do this based on an attribute
15444
15445         Only emit calls to System.Diagnostics.Debug and
15446         System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
15447         on the command line.
15448
15449         * rootcontext.cs: Global settings for tracing and debugging.
15450
15451         * cs-tokenizer.cs (define): New utility function to track
15452         defines.   Set the global settings for TRACE and DEBUG if found.
15453
15454 2002-05-25  Ravi Pratap  <ravi@ximian.com>
15455
15456         * interface.cs (Populate*): Pass in the TypeContainer as well as
15457         the DeclSpace as parameters so that we can create EmitContexts and
15458         then use that to apply attributes etc.
15459
15460         (PopulateMethod, PopulateEvent, PopulateProperty)
15461         (PopulateIndexer): Apply attributes everywhere.
15462
15463         * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
15464         etc.
15465
15466         (ApplyAttributes): Update accordingly.
15467
15468         We now apply interface attributes for all members too.
15469
15470 2002-05-26  Miguel de Icaza  <miguel@ximian.com>
15471
15472         * class.cs (Indexer.Define); Correctly check if we are explicit
15473         implementation (instead of checking the Name for a ".", we
15474         directly look up if the InterfaceType was specified).
15475
15476         Delay the creation of the PropertyBuilder.
15477
15478         Only create the PropertyBuilder if we are not an explicit
15479         interface implementation.   This means that explicit interface
15480         implementation members do not participate in regular function
15481         lookups, and hence fixes another major ambiguity problem in
15482         overload resolution (that was the visible effect).
15483
15484         (DefineMethod): Return whether we are doing an interface
15485         implementation. 
15486
15487         * typemanager.cs: Temporary hack until we get attributes in
15488         interfaces (Ravi is working on that) and we get IndexerName
15489         support in interfaces.
15490
15491         * interface.cs: Register the indexers as properties.
15492
15493         * attribute.cs (Attribute.Resolve): Catch the error, and emit a
15494         warning, I have verified that this is a bug in the .NET runtime
15495         (JavaScript suffers of the same problem).
15496
15497         * typemanager.cs (MemberLookup): When looking up members for
15498         interfaces, the parent of an interface is the implicit
15499         System.Object (so we succeed in searches of Object methods in an
15500         interface method invocation.  Example:  IEnumerable x;  x.ToString
15501         ()) 
15502
15503 2002-05-25  Miguel de Icaza  <miguel@ximian.com>
15504
15505         * class.cs (Event): Events should also register if they do
15506         implement the methods that an interface requires.
15507
15508         * typemanager.cs (MemberLookup); use the new GetInterfaces
15509         method. 
15510
15511         (GetInterfaces): The code used to lookup interfaces for a type is
15512         used in more than one place, factor it here. 
15513
15514         * driver.cs: Track the errors at the bottom of the file, we kept
15515         on going.
15516
15517         * delegate.cs (NewDelegate.Emit): We have to emit a null as the
15518         instance if the method we are calling is static!
15519
15520 2002-05-24  Miguel de Icaza  <miguel@ximian.com>
15521
15522         * attribute.cs (ApplyAttributes): Make this function filter out
15523         the IndexerName attribute (as that attribute in reality is never
15524         applied) and return the string constant for the IndexerName
15525         attribute. 
15526
15527         * class.cs (TypeContainer.Emit): Validate that all the indexers
15528         have the same IndexerName attribute, and if so, set the
15529         DefaultName attribute on the class. 
15530
15531         * typemanager.cs: The return value might contain other stuff (not
15532         only methods).  For instance, consider a method with an "Item"
15533         property and an Item method.
15534
15535         * class.cs: If there is a problem with the parameter types,
15536         return. 
15537
15538 2002-05-24  Ravi Pratap  <ravi@ximian.com>
15539
15540         * ecore.cs (ImplicitConversionExists): Wrapper function which also
15541         looks at user defined conversion after making a call to 
15542         StandardConversionExists - we need this for overload resolution.
15543
15544         * expression.cs : Update accordingly the various method calls.
15545
15546         This fixes 2 bugs filed against implicit user defined conversions 
15547
15548 2002-05-22  Miguel de Icaza  <miguel@ximian.com>
15549
15550         * statement.cs: Track the result of the assignment.
15551
15552 2002-05-21  Miguel de Icaza  <miguel@ximian.com>
15553
15554         * expression.cs (MemberAccess): Improved error reporting for
15555         inaccessible members.
15556
15557 2002-05-22  Martin Baulig  <martin@gnome.org>
15558
15559         * makefile (mcs-mono2.exe): New target.  This is mcs compiled with
15560         itself with debugging support.
15561
15562 2002-05-22  Martin Baulig  <martin@gnome.org>
15563
15564         * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
15565         Removed, this isn't needed anymore.
15566
15567 2002-05-20  Martin Baulig  <martin@gnome.org>
15568
15569         * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
15570         be underlying type for an enum.
15571
15572 2002-05-20  Miguel de Icaza  <miguel@ximian.com>
15573
15574         * typemanager.cs (InitEnumUnderlyingTypes): New helper function
15575         that splits out the loading of just the core types.
15576
15577         * rootcontext.cs (ResolveCore): Split the struct resolution in
15578         two, so we can load the enumeration underlying types before any
15579         enums are used.
15580
15581         * expression.cs (Is): Bandaid until we fix properly Switch (see
15582         bug #24985 for details).
15583
15584         * typemanager.cs (ImplementsInterface): The hashtable will contain
15585         a null if there are no interfaces implemented.
15586
15587 2002-05-18  Miguel de Icaza  <miguel@ximian.com>
15588
15589         * cs-parser.jay (indexer_declarator): It is fine to have array
15590         parameters
15591
15592 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
15593
15594         * typemanager.cs: (RegisterBuilder): New function used to register
15595         TypeBuilders that implement interfaces.  Since
15596         TypeBuilder.GetInterfaces (as usual) does not work with lame
15597         Reflection.Emit. 
15598         (AddUserType): register interfaces.
15599
15600         (ImplementsInterface): Use the builder_to_ifaces hash if we are
15601         dealing with TypeBuilder.  Also, arrays are showing up as
15602         SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
15603         methods can not be invoked on them!
15604
15605         * ecore.cs (ExplicitReferenceConversionExists): Made public.
15606         (ImplicitReferenceConversionExists): Split out from
15607         StandardConversionExists. 
15608
15609         * expression.cs (As): We were only implementing one of the three
15610         cases for the as operator.  We now implement them all.
15611         (Is): Implement the various other cases for Is as well.
15612
15613         * typemanager.cs (CACHE): New define used to control if we want or
15614         not the FindMembers cache.  Seems to have a negative impact on
15615         performance currently
15616
15617         (MemberLookup): Nested types have full acess to
15618         enclosing type members
15619
15620         Remove code that coped with instance/static returns for events, we
15621         now catch this in RealFindMembers.
15622
15623         (RealFindMembers): only perform static lookup if the instance
15624         lookup did not return a type or an event.  
15625
15626 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
15627
15628         * assign.cs (CompoundAssign): We pass more semantic information
15629         now to Compound Assignments than we did before: now we have all
15630         the information at hand, and now we resolve the target *before* we
15631         do the expression expansion, which allows the "CacheValue" method
15632         to have the effect we intended (before, a [x] += 1 would generate
15633         two differen ArrayAccess expressions from the ElementAccess,
15634         during the resolution process).
15635
15636         (CompoundAssign.DoResolve): Resolve target and original_source here.
15637
15638 2002-05-16  Miguel de Icaza  <miguel@ximian.com>
15639
15640         * expression.cs (ArrayAccess): dropped debugging information. 
15641
15642         * typemanager.cs: Small bug fix: I was always returning i_members,
15643         instead of one of i_members or s_members (depending on which had
15644         the content).
15645
15646         * assign.cs (IAssignMethod.CacheTemporaries): New method.  This
15647         method is invoked before any code generation takes place, and it
15648         is a mechanism to inform that the expression will be invoked more
15649         than once, and that the method should use temporary values to
15650         avoid having side effects
15651
15652         (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
15653
15654         * ecore.cs (Expression.CacheTemporaries): Provide empty default
15655         implementation.
15656
15657         * expression.cs (Indirection, ArrayAccess): Add support for
15658         CacheTemporaries in these two bad boys. 
15659
15660         * ecore.cs (LoadFromPtr): figure out on our own if we need to use
15661         ldobj or ldind_ref.  
15662         (StoreFromPtr): Handle stobj as well.
15663
15664         * expression.cs (UnaryMutator): Share more code.
15665
15666         * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
15667         down: I was not tracking the Filter function as well, which
15668         was affecting the results of the cache.
15669
15670 2002-05-15  Miguel de Icaza  <miguel@ximian.com>
15671
15672         * attribute.cs: Remove the hack to handle the CharSet property on
15673         StructLayouts. 
15674
15675 2002-05-14  Miguel de Icaza  <miguel@ximian.com>
15676
15677         * attribute.cs (DoResolve): More uglyness, we now only try to
15678         resolve the attribute partially, to extract the CharSet
15679         information (only if we are a StructLayout attribute).  Otherwise 
15680
15681         (GetExtraTypeInfo): Add some code to conditionally kill in the
15682         future this.   I am more and more convinced that the .NET
15683         framework has special code to handle the attribute setting on
15684         certain elements.
15685
15686         * expression.cs (IsParamsMethodApplicable): Revert my previous
15687         foreach change here, it was wrong.
15688
15689 2002-05-13  Miguel de Icaza  <miguel@ximian.com>
15690
15691         * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
15692         (pp_expr): do not abort on unknown input, just return.
15693         (eval): abort if there are pending chars.
15694
15695         * attribute.cs (Attribute.Resolve): Positional parameters are
15696         optional.  Deal with that case.
15697
15698         * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
15699         the Ansi/Unicode/Auto information for the type.
15700
15701         (TypeContainer.DefineType): instantiate the EmitContext here, as
15702         we will be using it during the type definition (to resolve
15703         attributes) and during the emit phase.
15704
15705         * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
15706         to pull type information out of the attributes
15707
15708         (Attribute.Resolve): track the constructor builder, and allow for
15709         multiple invocations (structs and classes will use this).
15710
15711         * ecore.cs (MemberLookupFinal): new version with all the
15712         parameters customizable.
15713
15714         * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
15715         constructors.  Return if the result value is null (as the error
15716         would have been flagged already by MemberLookupFinal)
15717
15718         Do not allow instances of abstract classes or interfaces to be
15719         created.
15720
15721         * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
15722         We have to compare the assembly property here when dealing with
15723         FamANDAssem and Assembly access modifiers, because we might be
15724         creating an assembly from *modules* (that means that we are not
15725         getting TypeBuilders for types defined in other modules that are
15726         part of this assembly).
15727
15728         (Method.Emit): If the method is marked abstract and has a body,
15729         emit an error. 
15730
15731         (TypeContainer.DefineMembers): If both the defined member and the
15732         parent name match are methods, then do not emit any warnings: let
15733         the Method.Define routine take care of flagging warnings.  But if
15734         there is a mismatch (method overrides something else, or method is
15735         overriwritten by something, then emit warning).
15736
15737         (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
15738         set to null, this means `do not check for the return type on the
15739         signature'. 
15740
15741         (Method.Define): set the return type for the method signature to
15742         null, so that we get methods with the same name and parameters and
15743         different return types.  This is used to flag warning 114 (you are
15744         hiding a method, and you probably want to use the new/override
15745         keywords instead).
15746
15747         * typemanager.cs (MemberLookup): Implemented proper access
15748         control, closing a long standing set of bug reports.  The problem
15749         was that the Framework only has two bits: Public and NonPublic,
15750         and NonPublic includes private and protected methods, but we need
15751         to enforce the FamANDAssem, FamOrAssem and Family. 
15752
15753 2002-05-11  Miguel de Icaza  <miguel@ximian.com>
15754
15755         * statement.cs (GotoCase): Return true: Ammounts to giving up
15756         knowledge on whether we return or not, and letting the other case
15757         be responsible for it.
15758
15759 2002-05-10  Miguel de Icaza  <miguel@ximian.com>
15760
15761         * driver.cs: Do not load directories for each file processed, only
15762         do it if there is a pattern.
15763
15764         * ecore.cs: Report readonly assigns here as well, as we might have
15765         been resolved only by MemberAccess.
15766
15767         (SimpleName.SimpleNameResolve): Also be useful for LValue
15768         resolution.   We need this to propagate assign to local readonly variables
15769
15770         * typemanager.cs: Use a ptrhashtable for the criteria, because we
15771         do not want to reuse potential criteria memory.
15772
15773         * class.cs (MyEventBuilder): Set reflected_type;
15774
15775         * ecore.cs (Constantify): Added support for constifying bools.
15776
15777         (RootContext.LookupType): Added a cache for values looked up in
15778         the declaration space.
15779
15780         * typemanager.cs (FindMembers): Now is a front-end to
15781         RealFindMembers, and provides a two-level hashtable-based cache to
15782         the request.  
15783
15784         15% performance improvement: from 22.5 to 19.2 seconds.
15785
15786         * expression.cs (IsParamsMethodApplicable): use foreach.
15787         (Invocation.DoResolve): ditto.
15788         (New.DoResolve): ditto.
15789         (ArrayCreation.DoResolve): ditto.
15790
15791         * ecore.cs (FindMostEncompassingType): use foreach.
15792
15793         * delegate.cs (NewDelegate.DoResolve): Use foreach
15794
15795         * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
15796         (RemoveMethods): use foreach.
15797
15798         * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
15799         nested foreach statements instead of for, and also break out of
15800         the inner loop once a match is found.
15801
15802         (Invocation.OverloadResolve): Use foreach, simplify the code. 
15803
15804 2002-05-08  Miguel de Icaza  <miguel@ximian.com>
15805
15806         * cfold.cs (BinaryFold): During an enumeration evaluation context,
15807         we actually unwrap the expression to allow for extra information
15808         to be extracted. 
15809
15810         * expression.cs: Use Shr_Un on unsigned operations. 
15811
15812 2002-05-08  Ravi Pratap  <ravi@ximian.com>
15813
15814         * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of 
15815         applicable operators was not being considered correctly. This closes
15816         the bug Miguel reported.
15817
15818 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
15819
15820         * attribute.cs: check that the type derives from System.Attribute
15821         and report the correct error in that case (moved the duplicate code to
15822         its own method, too).
15823
15824 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
15825
15826         * attribute.cs: lookup attribute type name as the spec says: first the
15827         bare attribute name and then name + "Attribute" (nant compiles with
15828         mcs after this fix).
15829
15830 2002-05-07  Miguel de Icaza  <miguel@ximian.com>
15831
15832         * expression.cs (Unary.TryReduceNegative): Ah!  Tricky!  Tricky!
15833         Because of the way we parse things, we should try to see if a
15834         UIntConstant can fit in an integer.
15835
15836 2002-05-07  Ravi Pratap  <ravi@ximian.com>
15837
15838         * ecore.cs (GetConversionOperators): Do not pick up op_True operators
15839         when we are in an explicit context.
15840
15841         (ConvertReferenceExplicit): When converting from Iface type S to Class
15842         T make sure the rules are implemented as an OR.
15843
15844         * parameter.cs (ParameterType): Make it a property for now although the
15845         purpose really isn't anything immediate.
15846
15847         * expression.cs (Is*Applicable): Do better checking on the parameter type
15848         of a ref/out parameter. The ones from the system assemblies are already 
15849         marked with the correct type so we don't need to do any correction.
15850
15851         * ecore.cs (StandardConversionExists): Conversion from Interface types to 
15852         the object type is standard too so include that.
15853
15854 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
15855
15856         * ecore.cs (StandardConversionExists): Augment with missing code:
15857         deal with IntConstant, LongConstants and Enumerations.
15858
15859         * assign.cs: Report the error, instead of failing silently
15860
15861         * rootcontext.cs (AddGlobalAttributes): Track attributes on the
15862         typecontainer that they are declared, because the
15863         typecontainer/namespace will have the list of using clauses that
15864         need to be applied.
15865
15866         Assembly Attributes were escaping the normal registration
15867         mechanism. 
15868
15869         (EmitCode): Apply attributes within an EmitContext that represents
15870         the container they were declared on.
15871
15872         * cs-parser.jay: Track bases for structs.  How did I get this wrong?
15873
15874 2002-05-06  Ravi Pratap  <ravi@ximian.com>
15875
15876         * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
15877         Revamp completely - make much cleaner as we now operate only
15878         on a set of Types.
15879
15880         (FindMostSpecificSource, FindMostSpecificTarget): New methods
15881         to implement the logic detailed in the spec more correctly.
15882
15883         (UserDefinedConversion): Update accordingly.
15884
15885 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
15886
15887         * statement.cs: Return flow analysis information up.
15888
15889         * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
15890         and the default.
15891
15892         (token): Do not consume an extra character before calling
15893         decimal_digits.
15894
15895 2002-05-06  Piers Haken <piersh@friskit.com>
15896
15897         * cs-parser.jay: add 'override' attribute to System.Object.Finalize
15898
15899 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
15900
15901         * class.cs (Constructor.Emit): Set the IsStatic flag in the
15902         EmitContext during the instance constructor initializer
15903         resolution, to stop access to instance variables.
15904
15905         This is mandated by the spec, last paragraph of the `constructor
15906         initializers' section. 
15907
15908 2002-05-05  Miguel de Icaza  <miguel@ximian.com>
15909
15910         * cs-parser.jay, class.cs (Accessor): new class used to represent
15911         an accessor (get or set).  In the past we used `null' to represent
15912         a missing accessor.  But this is ambiguous because there was no
15913         way to tell in abstract indexers/properties if one of them was
15914         specified.
15915
15916         Now there is a way of addressing that.
15917
15918         * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
15919         instead of FindMembers.
15920
15921         * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
15922         the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
15923
15924         * attribute.cs: Treat indexers and properties as the same in terms
15925         of applying attributes
15926
15927         * ecore.cs (FindMostEncompassedType): Use statically initialized
15928         EmptyExpressions()s like we do elsewhere to avoid creating useless
15929         objects (and we take this out of the tight loop).
15930
15931         (GetConversionOperators): Move the code to extract the actual
15932         operators to a separate routine to clean things up.
15933
15934 2002-05-04  Miguel de Icaza  <miguel@ximian.com>
15935
15936         * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
15937         events are always registered FieldBuilders.
15938
15939         * class.cs (FieldBase): New class shared by Fields 
15940
15941         * delegate.cs: If we are a toplevel delegate, use our full name.
15942         If we are a nested delegate, then only use our tail name.
15943
15944 2002-05-02  Ravi Pratap  <ravi@ximian.com>
15945
15946         * expression.cs (IsApplicable): Ensure that we add the "&" to
15947         ref/out types before comparing it with the type of the argument.
15948
15949         (IsParamsMethodApplicable): Ditto.
15950
15951         (Argument.Type): Use TypeManager.LookupType instead of Type.GetType - 
15952         silly me ;-)
15953
15954         * delegate.cs : Handle the case when we have more than one applicable
15955         method. Flag an error only when we finish checking all.
15956
15957 2002-05-02  Miguel de Icaza  <miguel@ximian.com>
15958
15959         * expression.cs: Add support for boolean static initializers.
15960
15961 2002-05-01  Miguel de Icaza  <miguel@ximian.com>
15962
15963         * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
15964
15965         * parameter.cs (ComputeParameterTypes,
15966         ComputeAndDefineParameterTypes): Better error handling: now we
15967         clear the `types' cache if we fail during any of the type lookups.
15968         We also return the status code correctly to our caller
15969
15970         * delegate.cs: If we fail to define a delegate, abort the extra
15971         steps. 
15972
15973         * expression.cs (Binary.ResolveOperator): for
15974         operator==(object,object) and operator !=(object, object) we also
15975         have to verify that there is an implicit conversion from one to
15976         the other.
15977
15978         (ArrayAccess.DoResolve): Array Access can operate on
15979         non-variables. 
15980
15981 2002-04-30  Miguel de Icaza  <miguel@ximian.com>
15982
15983         * assign.cs (CompoundAssign): A new class used as a "flag" that
15984         the assignment actually is happening as part of a compound
15985         assignment operator.
15986
15987         During compound assignment, a few new rules exist to enable things
15988         like:
15989
15990         byte b |= 1 + 2
15991
15992         From the spec:
15993
15994         x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
15995         to the type of x) if y is implicitly convertible to the type of x,
15996         and the operator is a builtin operator and the return type of the
15997         operator is explicitly convertible to the type of x. 
15998
15999         * rootcontext.cs: Reset warning level to 2.  4 catches various
16000         "interesting" features in mcs, we must clean this up at some
16001         point, but currently am trying to kill other bugs ;-)
16002
16003         * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
16004         in container classes as well.  
16005
16006         * expression.cs (Binary.ResolveOperator): Handle string case
16007         before anything else (as operator overloading does emit an error
16008         before doing anything else).
16009
16010         This code could go away when we move to a table driven model, but
16011         i could not come up with a good plan last night.
16012
16013 2002-04-30  Lawrence Pit <loz@cable.a2000.nl>
16014
16015         * typemanager.cs (CSharpName): reimplementation using regex.
16016         * class.cs: added null check for fields in Emit
16017         * rootcontext.cs: set warninglevel to 4
16018
16019 2002-04-29  Miguel de Icaza  <miguel@ximian.com>
16020
16021         * typemanager.cs (CSharpName): reimplemented with Lupus
16022         suggestion.
16023
16024 2002-04-28  Miguel de Icaza  <miguel@ximian.com>
16025
16026         * statement.cs (If): correclty implement Resolve, because we were
16027         not catching sem errors in there.  The same process is needed
16028         everywhere else. 
16029         (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
16030
16031
16032         (Statement.Warning_DeadCodeFound): Factorize code.
16033         (While): Report dead code here too.
16034
16035         (Statement): Added Resolve virtual method to allow
16036         for resolution split from the emit code.
16037
16038 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
16039
16040         * statement.cs (EmitBoolExpression): No longer try to resolve the
16041         expression here.    
16042         (MakeBoolean): New utility function that resolve, implicitly
16043         converts to boolean and tags the expression. 
16044
16045
16046         (If, Do): Implement dead code elimination.
16047         (While): Implement loop inversion
16048
16049         (Do, While, For, If): Resolve the expression prior to calling our
16050         code generation.
16051
16052 2002-04-22  Lawrence Pit <loz@cable.a2000.nl>
16053
16054         * class.cs:
16055           - added method Report28 (warning: program has more than one entry point)
16056           - added method IsEntryPoint, implements paragraph 10.1 of the spec
16057           - modified method Method.Define, the part at the end of the method
16058
16059         * rootcontext.cs: added static public Location EntryPointLocation;
16060           
16061         * ../errors/cs0028.cs : Add test case for the above warning.              
16062
16063         * typemanager.cs:
16064           - modified method CSharpName to allow arrays of primitive type to
16065             be printed nicely (e.g. instead of System.Int32[][] it now prints
16066             int[][])
16067           - added method CSharpSignature: returns the signature of a method
16068             in string format to be used in reporting errors, warnings, etc.
16069
16070         * support.cs: InternalParameters.ParameterDesc variable tmp initialized
16071         with String.Empty.
16072
16073 2002-04-26  Ravi Pratap  <ravi@ximian.com>
16074
16075         * delegate.cs (Define): Fix extremely silly bug where I was
16076         setting the type of the 'object' parameter of the BeginInvoke
16077         method to System.IAsyncResult instead of System.Object ;-)
16078
16079 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
16080
16081         * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
16082         here. 
16083
16084         (Constructor.Emit): return if we fail to initialize the
16085         constructor.  Another door closed!  
16086
16087         * expression.cs (New.DoResolve): Improve error message (from -6 to
16088         1501).  Use DeclaredOnly lookup to find the exact constructor.
16089
16090         * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
16091         loop.  This is useful.
16092
16093         * cs-parser.jay: Adjust the default parameters so that destructors
16094         have the proper signature.
16095
16096 2002-04-26  Martin Baulig  <martin@gnome.org>
16097
16098         * driver.cs (LoadAssembly): If `assembly' contains any characters
16099         which are only valid in path names and not in assembly names
16100         (currently slash, backslash and point), use Assembly.LoadFrom ()
16101         instead of Assembly.Load () on the `assembly' (before iteration
16102         over the link_paths).
16103
16104 2002-04-26  Martin Baulig  <martin@gnome.org>
16105
16106         * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
16107
16108 2002-04-25  Miguel de Icaza  <miguel@ximian.com>
16109
16110         * class.cs (Property): use the new typemanager.MemberLookup
16111
16112         (TypeContainer.MemberLookup): Implement using the
16113         TypeManager.MemberLookup now. 
16114
16115         * typemanager.cs: Make MemberLookup a function of the TypeManager,
16116         and return MemberInfos, so that these can be used without an
16117         EmitContext (what we had before).
16118
16119 2002-04-24  Miguel de Icaza  <miguel@ximian.com>
16120
16121         * expression.cs: Fix the case where the argument to params if the
16122         type of the params.  I omitted handling this before.   Fixed
16123
16124 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
16125
16126         * driver.cs: Call BootCorlib_PopulateCoreType
16127
16128         * class.cs (Property.CheckBase): Check for properties only, not
16129         for all members. 
16130
16131         * interface.cs: Temporary hack: try/catch around the
16132         CustomAttributeBuilder, because I am getting an exception that I
16133         do not understand.
16134
16135         * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
16136         types whose definitions are required to be there (attributes are
16137         defined before standard types).
16138
16139         Compute definitions as we boot the various types, as they are used
16140         immediately (value_type class will need object_type, but if we do
16141         not initialize object_type, we will pass a null, which will let
16142         the runtime pick the System.Object from the existing corlib, which
16143         is not what we want).
16144
16145 2002-04-22  Patrik Torstensson <totte@labs2.com>
16146
16147         * cs-tokenizer.cs: fixed a number of trim() issues.
16148
16149 2002-04-22  Ravi Pratap  <ravi@ximian.com>
16150
16151         * expression.cs (Argument.Type): Ensure that we return the correct
16152         type when we have out or ref parameters [in which case we 
16153         append a "&"].
16154
16155 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
16156
16157         * class.cs (Property, Indexer): Allow extern modifier in there. 
16158
16159         * typemanager.cs (InitBaseTypes): Initializes object_type and
16160         value_type, since those will be used early on during the bootstrap
16161         process to compile corlib.
16162
16163         (InitCoreTypes): Move code from here to InitBaseTypes.
16164
16165 2002-04-21  Miguel de Icaza  <miguel@ximian.com>
16166
16167         * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
16168         single-dimension arrays as using the ldlen opcode.  
16169
16170         Daniel Lewis discovered this optimization.  
16171
16172         * typemanager.cs: Add signature for System.Array::get_Length
16173
16174 2002-04-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16175
16176         * statement.cs: report the error when the foreach does not apply to an
16177         array nor a collection.
16178
16179 2002-04-19  Miguel de Icaza  <miguel@ximian.com>
16180
16181         * expression.cs: Add implicit conversions to the operator ~.
16182
16183         * constant.cs (DecimalConstant.Emit): Emit decimal value.
16184
16185         * typemanager.cs: Locate the decimal constructor.
16186
16187 2002-04-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16188
16189         * attribute.cs: use the new property of TypeOf.
16190         * expression.cs: added 'get' property around typearg.
16191
16192         These changes fix a build breaker reported by NickD. Is this the
16193         correct way to fix?  If not, please, revert my changes and make it
16194         work :-).
16195
16196 2002-04-17  Miguel de Icaza  <miguel@ximian.com>
16197
16198         * attribute.cs: Add support for typeof in attribute invocations.
16199         I am not sure that this is right though.
16200
16201 2002-04-14  Duncan Mak  <duncan@ximian.com>
16202
16203         * cfold.cs (BinaryFold): Catch DivideByZeroException in the
16204         Binary.Operator.Division case.
16205
16206 2002-04-13  Ravi Pratap  <ravi@ximian.com>
16207
16208         * class.cs (DefineType): Ensure that we do a proper check on
16209         attribute types and also register it with the TypeManager.
16210
16211         (TypeContainer.Targets): The default for attribute types is
16212         AttributeTargets.All.
16213
16214         * attribute.cs (ApplyAttributes): Registering the attribute type
16215         is done elsewhere, not when we discover we have a Usage attribute.
16216
16217 2002-04-12  Ravi Pratap  <ravi@ximian.com>
16218
16219         * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
16220         and get rid of is_delegate parameter.
16221
16222         * everywhere : update.
16223
16224 2002-04-12  Ravi Pratap  <ravi@ximian.com>
16225
16226         * cs-parser.jay (compilation_unit): Revamp completely to use
16227         some new ideas that I got from Rhys' grammar to solve the problems
16228         with assembly level attributes.
16229
16230         (outer_declaration): New grammar production.
16231
16232         (attribute_sections): Add.
16233
16234         (opt_attributes): Base on attribute_sections
16235
16236         (namespace_declaration): Allow opt_attributes to tackle the case
16237         when we have assembly level attributes - we are clever in this
16238         regard now ;-)
16239
16240         * attribute.cs (ApplyAttributes): Do not worry about assembly 
16241         attributes in the non-global context.
16242
16243         * rootcontext.cs (AddGlobalAttributes): Go back to using this
16244         instead of SetGlobalAttributes.
16245
16246         * class.cs, rootcontext.cs : Ensure we define and generate 
16247         attribute types before anything else.
16248
16249         * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
16250         and flag the new error -20 for the case when the attribute type
16251         does not have valid targets specified. csc does not catch this.
16252
16253         * ../errors/errors.txt : update for error # -20
16254
16255 2002-04-11  Ravi Pratap  <ravi@ximian.com>
16256
16257         * support.cs (InternalParameters.ParameterModifier): Do some null
16258         checking and return sane values.
16259
16260         * class.cs (Method.Define): If we are a PInvoke method, ensure
16261         that we are static and extern. Report error # 601
16262
16263         * ../errors/cs0601.cs : Add test case for the above error.
16264
16265 2002-04-07  Ravi Pratap  <ravi@ximian.com>
16266
16267         * rootcontext.cs (attribute_types): We need to keep type of
16268         all attribute types separately and emit code for them first.
16269
16270         (RegisterAttribute) : Implement.
16271
16272         * class.cs (DefineType): Check if the current Type is a custom
16273         attribute type and register it accordingly.
16274
16275         * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
16276         adding the first attribute twice and rename to
16277
16278         (SetGlobalAttributes): this.
16279
16280         * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
16281         lookups.
16282
16283         * attribute.cs (ApplyAttributes): Take an additional argument telling us
16284         if we are processing global arguments. Hmm, I am unsure of this.
16285
16286 2002-04-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16287
16288         * expression.cs: added static array of strings to avoid calling
16289         Enum.ToString () for Operator in Binary. Significant recover of
16290         performance.
16291
16292 2002-04-10  Miguel de Icaza  <miguel@ximian.com>
16293
16294         * class.cs (FindMembers): Allow the Builders of the various
16295         members to be null.  If they are skip them.  This only happens
16296         during the PInvoke declaration.
16297
16298 2002-04-09  Miguel de Icaza  <miguel@ximian.com>
16299
16300         * parameter.cs (Parameters.ComputeParameterTypes): Flag the
16301         failure, so we do not keep going afterwards.
16302
16303         * expression.cs: (Invocation.OverloadResolve): I believe Ravi
16304         wanted to pass `false' as the `is_delegate' argument.  If this is
16305         the case, why not use delegate_type == null to mean `is_delegate =
16306         false' and anything else as is_delegate = true.
16307
16308 Tue Apr  9 05:40:12  2002 Piers Haken <piersh@friskit.com>
16309
16310         * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
16311         code for the section, not the beginning of the tests.
16312
16313 2002-04-08  Miguel de Icaza  <miguel@ximian.com>
16314
16315         * cfold.cs: Handle operator + (Enum x, Underlying x) 
16316
16317         * expression.cs (Binary): same.  Warn about errors where we have
16318         Enum/Enum in operator + as well.
16319
16320 Mon Apr  8 06:29:03  2002 Piers Haken <piersh@friskit.com>
16321
16322         * statement.cs:
16323                 - added support for switch(bool)
16324                 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
16325                 - add TableSwitchEmit() to handle table-based switch statements
16326
16327 2002-04-05  Ravi Pratap  <ravi@ximian.com>
16328
16329         * expression.cs (Invocation.OverloadResolve): Factor out code which
16330         does parameter compatibility checking with arguments so that we can 
16331         re-use the code even from Delegate.VerifyApplicability
16332
16333         (VerifyArgumentsCompat): Move above code here.
16334
16335         * delegate.cs (VerifyApplicability): Get rid of duplicate code
16336         and instead make a call to the above method.
16337
16338 2002-03-31  Ravi Pratap  <ravi@ximian.com>
16339
16340         * typemanager.cs (attribute_type): Corresponds to System.Attribute.
16341         We use it to keep track of classes which are attribute types.
16342
16343 2002-04-02  Miguel de Icaza  <miguel@ximian.com>
16344
16345         * delegate.cs (Delegate.Define): Correctly define the types in the
16346         presence of fixed and array parameters.
16347
16348         * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
16349         doing FindMembers.
16350
16351         * ecore.cs (Expression.MemberLookup): Reset binding flags to not
16352         include NonPublic after the first iteration.
16353
16354         * class.cs (Indexer.CheckBase): Only check if both parents are
16355         non-null. 
16356
16357         * cs-parser.jay (accessor_body): If empty, set to null.
16358
16359         * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
16360         same code path here to resolve constants names that we did have in
16361         MemberAccess.DoResolve.  There is too much code duplicated here.
16362
16363 2002-04-01  Miguel de Icaza  <miguel@ximian.com>
16364
16365         * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
16366
16367         * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
16368         to MakeUnionSet.
16369
16370         * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
16371         tokens, numbers and strings.
16372
16373         * ecore.cs (MethodGroupExpr): Make Emit warn about missing
16374         parenthesis.
16375
16376         * delegate.cs: Use ComputeAndDefineParameterTypes for both the
16377         asyncronous parameters and the regular parameters.  
16378
16379         * codegen.cs (CodeGen.Init): Use the constructor that allows us to
16380         specify the target directory.
16381
16382         * expression.cs: (This.DoResolve): Simplify
16383         (As.Emit): Optimize, do not generate IsInst if the expression is
16384         always of the given type.
16385
16386         (Is.DoResolve): Bug fix, we were reporting both always/never for
16387         the is expression.
16388
16389         * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
16390         creating too many unnecessary arrays.
16391
16392 2002-03-31  Miguel de Icaza  <miguel@ximian.com>
16393
16394         * class.cs (EmitFieldInitializer): Use Assign expression to assign
16395         fields instead of rolling our own initializer.   Takes care of all
16396         implicit conversions, and drops unnecessary static checks/argument.
16397
16398 2002-03-31  Dick Porter  <dick@ximian.com>
16399
16400         * driver.cs: use the GetDirectories() return values properly, and
16401         use "/" as path separator.
16402
16403 2002-03-30  Miguel de Icaza  <miguel@ximian.com>
16404
16405         * expression.cs (Unary): Optimize - - expr into expr.
16406         (Binary): Optimize a + (-b) into a -b.
16407
16408         * codegen.cs (CodeGen): Made all methods static.
16409
16410 2002-03-29  Miguel de Icaza  <miguel@ximian.com>
16411
16412         * rootcontext.cs: 
16413
16414         * decl.cs: Rename `definition' into `TypeBuilder' and drop the
16415         TypeBuilder property.
16416
16417         * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
16418         instead. 
16419
16420         * tree.cs: Removed the various RecordXXXX, and replaced with a
16421         single RecordDecl.  Removed all the accessor methods, and just
16422         left a single access point Type 
16423
16424         * enum.cs: Rename DefineEnum to DefineType.
16425
16426         * decl.cs: New abstract method `DefineType' used to unify the
16427         Defines for Enumerations, Interfaces, TypeContainers and
16428         Delegates.
16429
16430         (FindType): Moved LookupInterfaceOrClass here.  Moved the
16431         LookupBaseClasses method that used to live in class.cs and
16432         interface.cs here, and renamed to FindType.
16433
16434         * delegate.cs: Implement DefineType.  Take advantage of the
16435         refactored pattern for locating the parent builder without taking
16436         the parent_builder argument (which we know does not work if we are
16437         nested, and triggering a toplevel definition).
16438
16439 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
16440
16441         * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
16442         accessibility of a member has changed during override and report
16443         an error if so.
16444
16445         * class.cs (Method.Define, Property.Define): Only complain on
16446         overrides if the method is private, any other accessibility is
16447         fine (and since we just checked the permission is the same, we are
16448         good to go).
16449
16450         * cs-tokenizer.cs: only line, region, endregion, if, endif, else
16451         and elif are processed always.  The other pre-processing
16452         directives are only processed if we are "taking" the path
16453
16454 2002-03-29  Martin Baulig  <martin@gnome.org>
16455
16456         * class.cs (Method.Emit): Only emit symbolic debugging info if the
16457         current location is not Null.
16458
16459         * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
16460         a separate method so we can profile it.
16461
16462         * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
16463         `span.Seconds' are just seconds, but no minutes or hours.
16464         (MainDriver): Profile the CodeGen.SaveSymbols calls.
16465
16466 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
16467
16468         * class.cs (Method.Define), (Property.Define), (Indexer.Define):
16469         Remove the gratuitous set of Final:
16470
16471                                 // If an interface implementation, then we can set Final.
16472                                 if (((flags & MethodAttributes.Abstract) == 0) &&
16473                                     implementing.DeclaringType.IsInterface)
16474                                         flags |= MethodAttributes.Final;
16475
16476         I do not know what I was smoking when I used that.
16477
16478
16479         * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
16480         step into fixing the name resolution issues for delegates and
16481         unifying the toplevel name resolution.
16482
16483 2002-03-28  Martin Baulig  <martin@gnome.org>
16484
16485         * class.cs (Method.Emit): If we have a symbol writer, call its
16486         OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
16487         tell it about the current method.
16488
16489         * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
16490         writer that we're going to emit the first byte of IL code for a new
16491         statement (a new source line).
16492         (EmitContext.EmitTopBlock): If we have a symbol writer, call
16493         EmitContext.Mark() before emitting any code.
16494
16495         * location.cs (SymbolDocument): Return null when we're Null.
16496
16497         * statement.cs (Statement): Moved the `Location loc' variable here.
16498         (Statement.EmitBoolExpression): If we have a symbol writer, call
16499         ec.Mark() before emitting any code to tell it that we're at the
16500         beginning of a new statement.
16501         (StatementExpression): Added `Location' argument to the constructor.
16502         (Block): Added public readonly variable `StartLocation' and public
16503         variable `EndLocation'.  The latter is to be set using SetEndLocation().
16504         (Block): Added constructor which takes a start and end location.
16505         (Block.SetEndLocation): New method. This sets the end location.
16506         (Block.EmitMeta): If we have a symbol writer, tell it the names of the
16507         local variables we create.
16508         (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
16509         each statement and do also mark the begin and end of the block.
16510
16511         * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
16512         tell it the current lexer.Location, use Location.Null for the end of the
16513         block.
16514         (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
16515         current block, set its end location using SetEndLocation().
16516         (statement_expression): StatementExpression constructor now takes the
16517         lexer.Location as additional argument.
16518         (for_statement, declare_local_variables): Likewise.
16519         (declare_local_variables): When creating a new implicit block, use the
16520         new Block constructor and pass it the lexer.Location.
16521
16522 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
16523
16524         * ecore.cs (Expression.MemberLookup): On interfaces, lookup
16525         members also on the parent interfaces recursively.
16526
16527 2002-03-27  Miguel de Icaza  <miguel@ximian.com>
16528
16529         * report.cs: Use new formats, since Gonzalo finished the missing
16530         bits. 
16531
16532         * expression.cs (Binary.ResolveOperator): added missing operator|
16533         operator& and operator^ for bool/bool.
16534
16535         * cs-parser.jay: CheckDef now takes a Location argument that is
16536         used to report errors more precisly (instead of reporting the end
16537         of a definition, we try to track something which is a lot closer
16538         to the source of the problem).
16539
16540         * cs-tokenizer.cs: Track global token use, so we can properly flag
16541         the use of #define/#undef after the first token has been seen.
16542
16543         Also, rename the reportXXXX to Error_DescriptiveName
16544
16545         * decl.cs (DeclSpace.IsTopLevel): Move property here from
16546         TypeContainer, so that Enum and Interface can use this too.
16547
16548         * class.cs (TypeContainer.LookupInterfaceOrClass,
16549         GetInterfaceOrClass, GetClassBases, DefineType): Drop the
16550         `builder' argument.  Typically this was used to pass the parent
16551         builder (a ModuleBuilder or a TypeBuilder from whoever triggered
16552         the definition).  
16553
16554         The problem is that a nested class could trigger the definition of
16555         a toplevel class, and the builder would be obviously wrong in that
16556         case. 
16557
16558         So we drop this argument, and we compute dynamically the
16559         TypeBuilder/ModuleBuilder (the correct information was available
16560         to us anyways from DeclSpace.Parent)
16561
16562         * interface.cs (Interface.DefineInterface): Drop builder
16563         parameter cleanup like class.cs
16564
16565         * enum.cs (Enum.DefineEnum): Drop builder parameter.  Clean up
16566         like class.cs
16567
16568         * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
16569         values. 
16570
16571         (Try.Emit): Propagate the returns value from the statement.
16572
16573         (Return.Emit): Even if we are leavning 
16574
16575         * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
16576
16577         * modifiers.cs: Fix the computation of MethodAttributes flags.
16578
16579 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
16580
16581         * driver.cs: allow compilation of files that start with '/'.
16582         Add a default case when checking the argument of --target.
16583
16584 2002-03-25  Miguel de Icaza  <miguel@ximian.com>
16585
16586         * interface.cs: Implement the same search algorithm for types in
16587         the interface code.
16588
16589         * delegate.cs: Do not allow multiple definition.
16590
16591         * Recovered ChangeLog that got accidentally amputated
16592
16593         * interface.cs (Interface.DefineInterface): Prevent from double definitions.
16594
16595         * rootcontext.cs: Load manually enum to allow core classes to
16596         contain enumerations.
16597
16598         * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
16599         Update to new static methods in TypeManager.
16600
16601         * typemanager.cs (GetMethod, GetConstructor): Use our
16602         implementation of FindMembers to find the members, since during
16603         corlib compilation, the types are TypeBuilders and GetMethod and
16604         GetConstructor do not work.
16605
16606         Make all methods in TypeManager static.
16607
16608         (InitCodeHelpers): Split the functionality from
16609         the InitCodeTypes function.
16610
16611         * driver.cs: Call InitCodeHelpers after we have populated the
16612         types. 
16613
16614         * cs-parser.jay (delegate_declaration): we did not used to compute
16615         the delegate name correctly for void delegates.
16616
16617 2002-03-24  Miguel de Icaza  <miguel@ximian.com>
16618
16619         * rootcontext.cs (RootContext): Init the interface_resolve_order
16620         and type_container_resolve_order always.
16621
16622         (ResolveCore, BootstrapCorlib_ResolveClass,
16623         BootstrapCorlib_ResolveStruct): New functions to bootstrap the
16624         compiler when compiling with --nostdlib
16625
16626         * class.cs (TypeContainer.DefineType): Check that our parent is
16627         not null.  This test is most important when we are bootstraping
16628         the core types.
16629
16630         * codegen.cs: Split out the symbol writing code.
16631
16632 2002-03-25  Martin Baulig  <martin@gnome.org>
16633
16634         * driver.cs (-g): Made -g an alias for --debug.
16635
16636 2002-03-24  Martin Baulig  <martin@gnome.org>
16637
16638         * codegen.cs (SymbolWriter): New public variable. Returns the
16639         current symbol writer.
16640         (CodeGen): Added `bool want_debugging_support' argument to the
16641          constructor. If true, tell the ModuleBuild that we want debugging
16642         support and ask it for the ISymbolWriter.
16643         (Save): If we have a symbol writer, call it's Close() method after
16644         saving the assembly.
16645
16646         * driver.c (--debug): New command line argument to create a
16647         debugger information file.
16648
16649         * location.cs (SymbolDocument): New public property. Returns an
16650         ISymbolDocumentWriter object for the current source file or null
16651         if we don't have a symbol writer.
16652
16653 2002-03-21  Miguel de Icaza  <miguel@ximian.com>
16654
16655         * driver.cs (LoadAssembly): Correctly return when all the paths
16656         have been tried and not before.
16657
16658         * statement.cs (Switch.Emit): return the actual coverage for this
16659         statement (returns/not-returns)
16660
16661         (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
16662         switch of the statement if we are the last switch section.  That
16663         kills two problems: try/catch problems (we used to emit an empty
16664         nop at the end) and switch statements where all branches would
16665         return. 
16666
16667 2002-03-19  Miguel de Icaza  <miguel@ximian.com>
16668
16669         * driver.cs: Add default assemblies (the equivalent to the
16670         Microsoft CSC.RSP file)
16671
16672         * cs-tokenizer.cs: When updating `cols and setting it to zero,
16673         also update tokens_seen and set it to false.
16674
16675         * driver.cs: Implement --recurse for Mike.
16676
16677         * driver.cs (SplitPathAndPattern): Small bug fix, I was not
16678         correctly splitting out the paths.
16679
16680 2002-03-18  Miguel de Icaza  <miguel@ximian.com>
16681
16682         * interface.cs (Interface.PopulateProperty): Instead of using
16683         `parent' as the declaration space for the set parameters, use
16684         `this' 
16685
16686         * support.cs (InternalParameters): InternalParameters constructor
16687         takes a DeclSpace instead of a TypeContainer.
16688
16689         * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
16690         types are being initialized, load the address of it before calling
16691         the function.  
16692
16693         (New): Provide a mechanism to disable the generation of local
16694         value type temporaries when the caller will be providing us with
16695         an address to store it.
16696
16697         (ArrayCreation.EmitDynamicInitializers): Use it.
16698
16699 2002-03-17  Miguel de Icaza  <miguel@ximian.com>
16700
16701         * expression.cs (Invocation.EmitArguments): Only probe for array
16702         property if there is more than one argument.  Sorry about that.
16703
16704         * class.cs (Invocation.EmitArguments): Fix to emit arguments for
16705         empty param arrays.
16706
16707         * class.cs (Method.LabelParameters): Fix incorrect code path that
16708         prevented the `ParamArrayAttribute' from being applied to the
16709         params attribute.
16710
16711 2002-03-16  Miguel de Icaza  <miguel@ximian.com>
16712
16713         * support.cs (ReflectionParameters): Correctly compute whether the
16714         last argument is a params array.  Fixes the problem with
16715         string.Split ('a')
16716
16717         * typemanager.cs: Make the assemblies array always be non-null
16718         (empty, but non-null)
16719
16720         * tree.cs (RecordDecl): New function that abstracts the recording
16721         of names.  This reports error 101, and provides a pointer to the
16722         previous declaration.  Fixes a crash in the compiler.
16723
16724         * cs-parser.jay (constructor_declaration): Update to new grammar,
16725         and provide a constructor_body that can be empty.
16726
16727 2002-03-15  Miguel de Icaza  <miguel@ximian.com>
16728
16729         * driver.cs: Add support for --resources.
16730
16731         * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
16732         Make all types for the various array helper methods be integer.
16733
16734         * ecore.cs (Expression.ConvertNumericExplicit): Pass the
16735         CheckState to ConvCast.
16736
16737         (ConvCast): Now it takes a `checked' state argument, to avoid
16738         depending on the emit context for the conversion, and just using
16739         the resolve time setting.
16740
16741         * expression.cs (ArrayCreation.EmitArrayArguments): New function,
16742         instead of Invocation.EmitArguments.  We do not emit the original
16743         arguments, instead we emit those which have been converted to
16744         unsigned int expressions.
16745
16746         * statement.cs (Block.EmitMeta): Drop tracking of indexes.
16747
16748         * codegen.cs: ditto.
16749
16750         * expression.cs (LocalVariableReference): Drop the use of the
16751         Store function that depended on the variable index.
16752
16753         * statement.cs (VariableInfo): Drop the `Idx' property from this
16754         class, as this is not taking into account the indexes for
16755         temporaries tat we generate during the execution, getting the
16756         indexes wrong.
16757
16758         * class.cs: First emit class initializers, then call the parent
16759         constructor. 
16760
16761         * expression.cs (Binary): Fix opcode emision.
16762         (UnaryMutator.EmitCode): Support checked code generation
16763
16764         * ecore.cs (MemberLookup): TypeManager.FindMembers will return
16765         matches for events for both the Static and Instance scans,
16766         pointing to the same element.   Fix that.
16767
16768 2002-03-14  Miguel de Icaza  <miguel@ximian.com>
16769
16770         * rootcontext.cs (ResolveTree): Always set the
16771         interface_resolve_order, because nested interfaces will be calling
16772         into us.
16773
16774         * class.cs (GetInterfaceOrClass): Track the same resolution
16775         process used by TypeManager.LookupType.  This fixes the nested
16776         type lookups in class declarations (separate path from
16777         LookupType). 
16778
16779         (TypeContainer.DefineType): Also define nested interfaces.
16780         (TypeContainer.RegisterOrder): New public function used to
16781         register the order in which child interfaces need to be closed.
16782
16783         Nested interfaces need to be closed after their parents have been
16784         created. 
16785
16786         * interface.cs (InterfaceAttr): Put all the logic for computing
16787         the interface attribute here. 
16788
16789         (DefineInterface): Register our interface order with the
16790         RootContext or with the TypeContainer depending on the case.
16791
16792 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
16793
16794         * cs-parser.jay: rework foreach statement to work with the new
16795         changes to the policy on SimpleNames.
16796
16797         * report.cs: support Stacktrace on warnings as well.
16798
16799         * makefile: drop --unsafe and /unsafe from the compile.
16800
16801 2002-03-13  Ravi Pratap  <ravi@ximian.com>
16802
16803         * ecore.cs (StandardConversionExists): Modify to take an Expression
16804         as the first parameter. Ensure we do null -> reference type conversion
16805         checking.
16806
16807         * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
16808         temporary Expression objects.
16809
16810 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
16811
16812         * interface.cs: workaround bug in method overloading resolution
16813         (there is already a bugzilla bug for it).
16814
16815 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
16816
16817         We could also solve this problem by having a separate path for
16818         performing type lookups, instead of DoResolve, we could have a
16819         ResolveType entry point, and only participating pieces of the
16820         production (simplename, deref, array) would implement this. 
16821
16822         * codegen.cs (EmitContext): New field OnlyLookupTypes used to
16823         signal SimpleName to only resolve type names and not attempt to
16824         resolve anything else.
16825
16826         * expression.cs (Cast): Set the flag.
16827
16828         * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
16829
16830         * class.cs: Only report 108 if there is no `new' modifier.
16831
16832         * cs-parser.jay: rework foreach statement to work with the new
16833         changes to the policy on SimpleNames.
16834         
16835         * report.cs: support Stacktrace on warnings as well.
16836
16837         * makefile: drop --unsafe and /unsafe from the compile.
16838
16839 2002-03-11  Miguel de Icaza  <miguel@ximian.com>
16840
16841         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
16842         lookups here, instead of doing that at parse time.  This means
16843         that our grammar will not introduce `LocalVariableReferences' as
16844         expressions at this point.  That solves the problem of code like
16845         this:
16846
16847         class X {
16848            static void Main ()
16849            { int X = 1;
16850             { X x = null }}}
16851
16852         This is only half the fix.  The full fix requires parameters to
16853         also be handled in this way.
16854
16855         * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
16856         makes the use more obvious of the DeclSpace.  The
16857         ec.TypeContainer.TypeBuilder is now only used to pull the
16858         TypeBuilder for it.
16859
16860         My theory is that I can get rid of the TypeBuilder completely from
16861         the EmitContext, and have typecasts where it is used (from
16862         DeclSpace to where it matters).  
16863
16864         The only pending problem is that the code that implements Aliases
16865         is on TypeContainer, and probably should go in DeclSpace.
16866
16867         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
16868         lookups here, instead of doing that at parse time.  This means
16869         that our grammar will not introduce `LocalVariableReferences' as
16870         expressions at this point.  That solves the problem of code like
16871         this:
16872
16873         class X {
16874            static void Main ()
16875            { int X = 1;
16876             { X x = null }}}
16877
16878         This is only half the fix.  The full fix requires parameters to
16879         also be handled in this way.
16880
16881         * class.cs (Property.DefineMethod): When implementing an interface
16882         method, set newslot, when implementing an abstract method, do not
16883         set the flag (before we tried never setting it, or always setting
16884         it, which is the difference).
16885         (Indexer.DefineMethod): same.
16886         (Method.DefineMethod): same.
16887
16888         * ecore.cs: Only set the status used flag if we get back a Field.
16889
16890         * attribute.cs: Temporary hack, so Paolo can keep working.
16891
16892 2002-03-08  Ravi Pratap  <ravi@ximian.com>
16893
16894         * attribute.cs (Attribute.UnmanagedType): This is to keep track of
16895         the unmanaged type in the case we have a MarshalAs attribute.
16896
16897         (Resolve): Handle the case when we are parsing the special MarshalAs
16898         attribute [we need to store the unmanaged type to use later]
16899
16900         * typemanager.cs (marshal_as_attr_type): Built in type for the 
16901         MarshalAs Attribute.
16902
16903         * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute 
16904         on parameters and accordingly set the marshalling info.
16905
16906 2002-03-09  Miguel de Icaza  <miguel@ximian.com>
16907
16908         * class.cs: Optimizing slightly by removing redundant code after
16909         we switched to the `NoTypes' return value.
16910         (Property.DefineMethod): use NoTypes here too.
16911
16912         This fixes the bug I introduced in my last batch of changes.
16913
16914 2002-03-05  Ravi Pratap  <ravi@ximian.com>
16915
16916         * tree.cs (RecordEnum): Add. We now keep track of enums too.
16917
16918         * class.cs (LookupInterfaceOrClass): Check against the list of recorded
16919         Enums since those are types too. 
16920
16921         * cs-parser.jay (enum_declaration): Record enums as we parse them.
16922
16923         * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined 
16924         thanks to a call during the lookup process.
16925
16926 2002-03-07  Miguel de Icaza  <miguel@ximian.com>
16927
16928         * statement.cs (Foreach): Lots of work to accomodate a particular
16929         kind of foreach statement that I had not kept in mind.  It is
16930         possible to have foreachs on classes that provide a GetEnumerator
16931         method that return objects that implement the "pattern" for using
16932         a foreach, there is no need to support GetEnumerator
16933         specifically. 
16934
16935         This is needed to compile nant.
16936
16937         * decl.cs: Only report 114 if the member is not `Finalize' and if
16938         the warning level is at least 2.
16939
16940         * class.cs: Moved the compare function from Method to
16941         MethodSignature. 
16942
16943         (MethodSignature.InheritableMemberSignatureCompare): Add new
16944         filter function that is used to extract inheritable methods from a
16945         class. 
16946
16947         (Method.Define): Use the new `inheritable_method_signature_filter'
16948         delegate
16949
16950         * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
16951         command. 
16952
16953 2002-03-06  Miguel de Icaza  <miguel@ximian.com>
16954
16955         * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
16956
16957         * cs-parser.jay: Add opt_semicolon to the interface declaration.
16958
16959         * expression.cs: Pass location information to
16960         ConvertImplicitStandard. 
16961
16962         * class.cs: Added debugging code to track return values from
16963         interfaces. 
16964
16965 2002-03-05  Miguel de Icaza  <miguel@ximian.com>
16966
16967         * expression.cs (Is.DoResolve): If either side of the `is' is an
16968         interface, do not flag the warning.
16969
16970         * ecore.cs (ImplicitReferenceConversion): We need a separate test
16971         for interfaces
16972
16973         * report.cs: Allow for --fatal to be used with --probe.
16974
16975         * typemanager.cs (NoTypes): Move the definition for the empty Type
16976         array here. 
16977
16978         * class.cs (TypeContainer.FindMembers): Also look for methods defined by
16979         properties. 
16980         (TypeContainer.DefineProxy): New function used to proxy to parent
16981         implementations when implementing interfaces.
16982         (TypeContainer.ParentImplements): used to lookup if our parent
16983         implements a public function that is required by an interface.
16984         (TypeContainer.VerifyPendingMethods): Hook this up.
16985
16986         * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
16987         `modules' and `assemblies' arraylists into arrays.  We only grow
16988         these are the very early start up of the program, so this improves
16989         the speedof LookupType (nicely measured).
16990
16991         * expression.cs (MakeByteBlob): Replaced unsafe code with
16992         BitConverter, as suggested by Paolo.
16993
16994         * cfold.cs (ConstantFold.Binary): Special case: perform constant
16995         folding of string concatenation, but if either side is a string,
16996         and the other is not, then return null, and let the runtime use
16997         the concatenation on the string plus the object (using
16998         `Object.ToString'). 
16999
17000 2002-03-04  Miguel de Icaza  <miguel@ximian.com>
17001
17002         Constant Folding has been implemented now.
17003
17004         * expression.cs (Unary.Reduce): Do not throw an exception, catch
17005         the error instead on types that are not supported in one's
17006         complement. 
17007
17008         * constant.cs (Constant and all children): New set of functions to
17009         perform implict and explicit conversions.
17010
17011         * ecore.cs (EnumConstant): Implement the new functions to perform
17012         conversion by proxying to the child expression.
17013
17014         * codegen.cs: (ConstantCheckState): Constant evaluation has its
17015         own separate setting that can not be turned off from the command
17016         line using --unchecked or --checked and is only controlled using
17017         the checked/unchecked statements and expressions.  This setting is
17018         used by the constant folder to flag errors.
17019
17020         * expression.cs (CheckedExpr, UncheckedExpr): Set the
17021         ConstantCheckState as well.   
17022
17023         During Resolve, they also have to flag the state, because the
17024         constant folder runs completely in the Resolve phase.
17025
17026         * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
17027         well.
17028
17029 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
17030
17031         * cfold.cs: New file, this file contains the constant folder.
17032
17033         * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
17034         argument to track whether we are using the resulting address to
17035         load or store a value and provide better error messages. 
17036
17037         (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
17038         new AddressOf arguments.
17039
17040         * statement.cs (Foreach.EmitCollectionForeach): Update
17041
17042         * expression.cs (Argument.Emit): Call AddressOf with proper
17043         arguments to track usage.
17044
17045         (New.DoEmit): Call AddressOf with new arguments.
17046
17047         (Unary.Emit): Adjust AddressOf call.
17048
17049 2002-03-01  Ravi Pratap  <ravi@ximian.com>
17050
17051         * cs-parser.jay (member_access): Change the case for pre-defined types
17052         to use a MemberAccess instead of a SimpleName. Thanks to Felix again for 
17053         this suggestion.
17054
17055         * class.cs (Operator::Emit): If we are abstract or extern, we don't have
17056         a method body.
17057
17058         * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
17059         essentially like methods and apply attributes like MethodImplOptions to them too.
17060
17061         * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
17062         not being null.
17063
17064         * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
17065         DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
17066         is the DeclSpace.
17067
17068         * Update code everywhere accordingly.
17069
17070         * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
17071
17072         * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
17073
17074 2002-02-28  Ravi Pratap  <ravi@ximian.com>
17075
17076         * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
17077         try performing lookups against those instead of jumping straight into using
17078         the 'using' clauses.
17079
17080         (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
17081
17082         (LookupType): Perform lookups in implicit parents too.
17083
17084         * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
17085         sequence as RootContext.LookupType. 
17086
17087         * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries 
17088         the various cases of namespace lookups into this method.
17089
17090 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
17091
17092         * cs-parser.jay: Add support for [Attribute ()] (empty arguments
17093         in positional arguments)
17094
17095         * class.cs (Operator): Update the AllowedModifiers to contain
17096         extern. 
17097
17098         * cs-parser.jay: Update operator declaration to allow for the
17099         operator body to be empty.
17100
17101         * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
17102         values. 
17103
17104 2002-02-27  Miguel de Icaza  <miguel@ximian.com>
17105
17106         * class.cs (Method.Emit): Label parameters.
17107
17108         * driver.cs: Return 1 or 0 as the program exit code.
17109
17110 2002-02-26  Miguel de Icaza  <miguel@ximian.com>
17111
17112         * expression.cs: Special case the `null' object when trying to
17113         auto-compute the type, as anything can be explicitly converted to
17114         that. 
17115
17116         * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
17117         spotting this Paolo.
17118
17119         (Expression.ImplicitNumericConversion): Perform comparissions of
17120         the type using the underlying type in the case of an enumeration
17121         rather than using the enumeration type for the compare.
17122
17123         Cope with the underlying == type case, which is not possible to
17124         catch before. 
17125
17126         (Expression.ConvertNumericExplicit): Perform comparissions of
17127         the type using the underlying type in the case of an enumeration
17128         rather than using the enumeration type for the compare.
17129
17130         * driver.cs: If the user does not supply an extension, assume .exe
17131
17132         * cs-parser.jay (if_statement): Rewrote so that we can track the
17133         location for the if statement.
17134
17135         * expression.cs (Binary.ConstantFold): Only concat strings when
17136         the operation is "+", not everything ;-)
17137
17138         * statement.cs (Statement.EmitBoolExpression): Take a location
17139         argument. 
17140         (If, While, Do): Track location.
17141
17142         * expression.cs (Binary.ResolveOperator): In the object + string
17143         case, I was missing a call to ConvertImplicit
17144
17145 2002-02-25  Ravi Pratap  <ravi@ximian.com>
17146
17147         * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
17148         Location arguments. Ensure we use RootContext.LookupType to do our work
17149         and not try to do a direct Type.GetType and ModuleBuilder.GetType
17150
17151         * interface.cs (PopulateMethod): Handle the type of the parameter being
17152         null gracefully.
17153
17154         * expression.cs (Invocation.BetterFunction): Handle the case when we 
17155         have a params method with no fixed arguments and a call is made with no
17156         arguments.
17157
17158 2002-02-25  Miguel de Icaza  <miguel@ximian.com>
17159
17160         * cs-tokenizer.cs: Add support for the quote-escape-sequence in
17161         the verbatim-string-literal
17162
17163         * support.cs (InternalParameters.ParameterModifier): handle null
17164         fixed parameters.
17165         (InternalParameters.ParameterType): ditto.
17166
17167         * parameter.cs (VerifyArgs): Also check if the fixed parameter is
17168         duplicating the name of the variable parameter.
17169         (GetParameterByName): Fix bug where we were not looking up array
17170         paramters if they were the only present (thanks Paolo!).
17171         (GetParameterInfo): We only have an empty set of types if both
17172         fixed and array are set to null.
17173         (GetParameterInfo-idx): Handle FixedParameter == null
17174
17175         * cs-parser.jay: Handle the case where there is no catch
17176         statements (missing null test).
17177
17178 2002-02-22  Miguel de Icaza  <miguel@ximian.com>
17179
17180         * driver.cs (MainDriver): Be conservative on our command line
17181         handling.
17182
17183         Catch DirectoryNotFoundException when calling GetFiles.
17184
17185         (SplitPathAndPattern): Used to split the input specification into
17186         a path and a pattern that we can feed to Directory.GetFiles.
17187
17188 2002-02-21  Miguel de Icaza  <miguel@ximian.com>
17189
17190         * statement.cs (Fixed): Implement the last case of the Fixed
17191         statement (string handling).
17192
17193         * expression.cs (StringPtr): New class used to return a char * to
17194         a string;  Used by the Fixed statement.
17195
17196         * typemanager.cs: Add char_ptr_type.  Add get_OffsetToStringData method.
17197
17198         * expression.cs (Binary.ResolveOperator): Remove redundant
17199         MemberLookup pn parent type.
17200         Optimize union call, we do not need a union if the types are the same.
17201         (Unary.ResolveOperator): REmove redundant MemberLookup on parent
17202         type.
17203
17204         Specialize the use of MemberLookup everywhere, instead of using
17205         the default settings. 
17206
17207         (StackAlloc): Implement stackalloc keyword.
17208
17209         * cs-parser.jay: Add rule to parse stackalloc.
17210
17211         * driver.cs: Handle /h, /help, /?
17212
17213         * expression.cs (MakeByteBlob): Removed the hacks we had in place
17214         before we supported unsafe code.
17215
17216         * makefile: add --unsafe to the self compilation of mcs.
17217
17218 2002-02-20  Miguel de Icaza  <miguel@ximian.com>
17219
17220         * expression.cs (PointerArithmetic): New class that is used to
17221         perform pointer arithmetic.
17222         (Binary.Resolve): Handle pointer arithmetic
17223         Handle pointer comparission.
17224         (ArrayPtr): Utility expression class that is used to take the
17225         address of an array.
17226
17227         (ElementAccess): Implement array access for pointers
17228
17229         * statement.cs (Fixed): Implement fixed statement for arrays, we
17230         are missing one more case before we are done.
17231
17232         * expression.cs (Indirection): Implement EmitAssign and set the
17233         ExprClass to Variable.  This allows pointer dereferences to be
17234         treated as variables, and to have values assigned to them.
17235
17236         * ecore.cs (Expression.StoreFromPtr): New utility function to
17237         store values dereferencing.
17238
17239 2002-02-20  Ravi Pratap  <ravi@ximian.com>
17240
17241         * expression.cs (Binary.ResolveOperator): Ensure that we are
17242         not trying to operate on a void type - this fixes the reported
17243         bug.
17244
17245         * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
17246         the parent implementation is sealed.
17247
17248         * ../errors/cs0239.cs : Add.
17249
17250         * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
17251
17252         * typemanager.cs (unverifiable_code_type): Corresponds to 
17253         System.Security.UnverifiableCodeAttribute. We need to emit this for modules
17254         which have unsafe code in them.
17255
17256         * rootcontext.cs (EmitCode): Emit the above attribute when we are in an 
17257         unsafe context.
17258
17259 2002-02-19  Miguel de Icaza  <miguel@ximian.com>
17260
17261         * cs-tokenizer.cs: Add support for @"litreal strings"
17262
17263         Make tokenizer accept pre-processor directives
17264         on any column (remove the old C-like limitation). 
17265
17266         * rootcontext.cs (EmitCode): Emit any global attributes.
17267         (AddGlobalAttributes): Used to keep track of assembly attributes. 
17268
17269         * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
17270
17271         * cs-parser.jay: Add support for global attributes.  
17272
17273 2002-02-17  Miguel de Icaza  <miguel@ximian.com>
17274
17275         * expression.cs (Indirection): New helper class.  Unary will
17276         create Indirection classes to be able to implement the
17277         IMemoryLocation interface on it.
17278
17279 2002-02-16  Miguel de Icaza  <miguel@ximian.com>
17280
17281         * cs-parser.jay (fixed_statement): reference the right statement.
17282
17283         * statement.cs (Fixed.Emit): Finish implementing the fixed
17284         statement for the &x case.
17285
17286 2002-02-14  Miguel de Icaza  <miguel@ximian.com>
17287
17288         * class.cs (Property.Define, Method.Define): Remove newslot when
17289         `implementing'.  
17290
17291         * modifiers.cs: My use of NewSlot when `Abstract' was set was
17292         wrong.  NewSlot should only be used if the `new' keyword is present.
17293
17294         * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
17295         locating our system dir.  Sorry about this.
17296
17297 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
17298
17299         * driver.cs (GetSystemDir): Compute correctly the location of our
17300         system assemblies.  I was using the compiler directory instead of
17301         the library directory.
17302
17303 2002-02-13  Ravi Pratap  <ravi@ximian.com>
17304
17305         * expression.cs (BetterFunction): Put back in what Miguel commented out
17306         since it is the correct fix. The problem is elsewhere ;-)
17307
17308         (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
17309         parameters of the parms method are themselves compatible or not !
17310
17311         (StandardConversionExists): Fix very dangerous bug where we were forgetting
17312         to check that a class implements an interface before saying that an implicit
17313         conversion was allowed. Use ImplementsInterface to do the checking.
17314
17315 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
17316
17317         * class.cs (Method.Define): Track whether we are an explicit
17318         implementation or not.  And only call DefineMethodOverride if we
17319         are an explicit implementation.
17320
17321         (Property.DefineMethod): Ditto.
17322
17323 2002-02-11  Ravi Pratap  <ravi@ximian.com>
17324
17325         * expression.cs (BetterFunction): Catch hideous bug which was
17326          preventing us from detecting ambiguous calls due to implicit casts i.e
17327         cs0121.
17328
17329 2002-01-29  Miguel de Icaza  <miguel@ximian.com>
17330
17331         * support.cs (Pair): Remove un-needed method.  I figured why I was
17332         getting the error in cs-parser.jay, the variable in a foreach loop
17333         is readonly, and the compiler does not really treat this as a variable.
17334
17335         * cs-parser.jay (fixed_statement): Fix grammar.  Use ASSIGN
17336         instead of EQUALS in grammar.  
17337
17338         * typemanager.cs (VerifyUnmanaged): Report correct error (208)
17339
17340         * expression.cs (Unary.DoResolve): Check whether the argument is
17341         managed or not.
17342
17343 2002-01-28  Miguel de Icaza  <miguel@ximian.com>
17344
17345         * support.cs: Api for Pair to set a value.  Despite the fact that
17346         the variables are public the MS C# compiler refuses to compile
17347         code that accesses the field if the variable is part of a foreach
17348         statement. 
17349
17350         * statement.cs (Fixed): Begin implementation of the fixed
17351         statement.
17352
17353         (Block.AddVariable): Return the VariableInfo on success and null
17354         on failure instead of true/false. 
17355
17356         * cs-parser.jay (foreach): Catch errors on variables already
17357         defined (we were ignoring this value before) and properly unwind
17358         the block hierarchy
17359
17360         (fixed_statement): grammar for the fixed statement.
17361
17362 2002-01-25  Miguel de Icaza  <miguel@ximian.com>
17363
17364         * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
17365         pointer types to be incretemented.
17366
17367         (SizeOf): Implement.
17368
17369         * cs-parser.jay (pointer_member_access): Implement
17370         expr->IDENTIFIER production.
17371
17372         * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
17373         MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
17374         on safe contexts.
17375
17376         (Unary): Implement indirection.
17377
17378         * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
17379         use in non-unsafe context).
17380
17381         (SimpleName.DoResolve): Check for pointers in field access on safe
17382         contexts. 
17383
17384         (Expression.LoadFromPtr): Factor the load-indirect code in this
17385         function.  This was duplicated in UnboxCast and ParameterReference
17386
17387 2002-01-24  Miguel de Icaza  <miguel@ximian.com>
17388
17389         * expression.cs (ComposedCast): report an error if a pointer cast
17390         is used in a safe region.
17391
17392         * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
17393         pointer type casts in unsafe context.
17394
17395         * codegen.cs (EmitContext): Set up IsUnsafe.
17396
17397         * cs-parser.jay (non_expression_type): Add productions for pointer
17398         casts. 
17399
17400         * expression.cs (Invocation.EmitCall): Remove chunk of buggy
17401         code.  We should not use force into static mode if the method is
17402         not virtual.  Fixes bug in MIS
17403
17404         * statement.cs (Do.Emit, While.Emit, For.Emit,
17405         Statement.EmitBoolExpression): Add support to Do and While to
17406         propagate infinite loop as `I do return' semantics.
17407
17408         Improve the For case to also test for boolean constants.
17409
17410         * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
17411         to the list of attributes we can add.
17412
17413         Remove `EmitContext' argument.
17414
17415         * class.cs (Method.Define): Apply parameter attributes.
17416         (Constructor.Define): Apply parameter attributes.
17417         (MethodCore.LabelParameters): Move here the core of labeling
17418         parameters. 
17419
17420         * support.cs (ReflectionParameters.ParameterModifier,
17421         InternalParameters.ParameterModifier): Use IsByRef on the type and
17422         only return the OUT bit for these parameters instead of in/out/ref
17423         flags.
17424
17425         This is because I miss-understood things.  The ParameterInfo.IsIn
17426         and IsOut represent whether the parameter has the [In] and [Out]
17427         attributes set.  
17428
17429 2002-01-22  Miguel de Icaza  <miguel@ximian.com>
17430
17431         * ecore.cs (FieldExpr.Emit): Release temporaries.
17432
17433         * assign.cs (LocalTemporary.Release): new function.
17434
17435         * codegen.cs (EmitContext.GetTemporaryStorage,
17436         EmitContext.FreeTemporaryStorage): Rework the way we deal with
17437         temporary storage.  Now we can "put back" localbuilders when we
17438         are done with them
17439
17440 2002-01-21  Miguel de Icaza  <miguel@ximian.com>
17441
17442         * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
17443         need to make a copy of the variable to generate verifiable code.
17444
17445 2002-01-19  Miguel de Icaza  <miguel@ximian.com>
17446
17447         * driver.cs: Compute dynamically the system directory.
17448
17449         * ecore.cs (CopyNewMethods): reworked, exposed, made public.
17450         Slower, but more generally useful.  Used by the abstract
17451         registering implementation. 
17452
17453         * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
17454         the rules for the special rule on Type/instances.  First check if
17455         we have the same name, and if so, try that special static path
17456         rather than the instance path.
17457
17458 2002-01-18  Miguel de Icaza  <miguel@ximian.com>
17459
17460         * cs-parser.jay: Emit 642 (warning: possible empty statement) for
17461         for, while and if.
17462
17463         * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
17464         Enum, ValueType, Delegate or Array for non-corlib compiles.
17465
17466         * cs-tokenizer.cs: Catch long identifiers (645)
17467
17468         * typemanager.cs (IndexerPropetyName): Ravi never tested this
17469         piece of code.
17470
17471         * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
17472         fix, we were returning too early, so we were not registering
17473         pending methods from abstract classes.
17474
17475         Do not register pending methods if the class is abstract.
17476
17477         * expression.cs (Conditional.DoResolve): Report circular implicit
17478         conversions when we neecd to compute it for conditional
17479         expressions. 
17480
17481         (Is.DoResolve): If the expression is always of the provided type,
17482         flag warning 183.  If the expression can not ever be of the
17483         provided type flag warning 184.
17484
17485         * class.cs: Catch 169 as well.
17486
17487         * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
17488         read. 
17489
17490 2002-01-18  Nick Drochak  <ndrochak@gol.com>
17491
17492         * makefile: remove path to beta2 csc.exe.  path to csc.exe must be in PATH instead.
17493
17494 2002-01-17  Miguel de Icaza  <miguel@ximian.com>
17495
17496         * interface.cs: (PopulateMethod): Check for pointers being defined
17497         only if the unsafe context is active.
17498         (PopulateProperty): ditto.
17499         (PopulateIndexer): ditto.
17500
17501         * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
17502         specified.  If pointers are present, make sure that they are
17503         present in an unsafe context.
17504         (Constructor, Constructor.Define): ditto.
17505         (Field, Field.Define): ditto.
17506         (Property, Property.Define): ditto.
17507         (Event, Event.Define): ditto.
17508
17509         * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
17510         hashtable if there are classes or structs defined.
17511
17512         * expression.cs (LocalVariableReference.DoResolve): Simplify this
17513         code, as the constant resolution moved.
17514
17515         * statement.cs (Block.EmitMeta): Resolve all constants as we emit
17516         the metadata, so we can flag error 133. 
17517
17518         * decl.cs (MemberCore.UnsafeOK): New function to test that a
17519         pointer is being declared in an unsafe context.
17520
17521 2002-01-16  Miguel de Icaza  <miguel@ximian.com>
17522
17523         * modifiers.cs (Modifiers.Check): Require a Location argument.
17524         Report error 227 for Unsafe use.
17525
17526         * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
17527
17528         * statement.cs (For.Emit): If the test is null, then report that
17529         we do `return', as we wont reach anything afterwards.
17530
17531         (Switch.SwitchGoverningType): Track the expression that matched
17532         the conversion.
17533
17534         * driver.cs: Allow negative numbers as an error code to flag.
17535
17536         * cs-parser.jay: Handle 1551.
17537
17538         * namespace.cs: Add 1537 checking (repeated using alias namespaces).
17539
17540 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
17541
17542         * cs-parser.jay: Report 1518 (type declaration can only contain
17543         class, struct, interface, enum or delegate)
17544
17545         (switch_label): Report 1523 (keywords `case' or `default' must
17546         preced code)
17547
17548         (opt_switch_sections): Report 1522 (empty switch)
17549
17550         * driver.cs: Report 1515 (response file specified multiple times)
17551         Report 1516 (Source file specified multiple times).
17552
17553         * expression.cs (Argument.Resolve): Signal 1510
17554
17555         (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
17556         access not allowed in static code)
17557
17558 2002-01-11  Ravi Pratap  <ravi@ximian.com>
17559
17560         * typemanager.cs (IsPointerType): Utility method which we are going
17561         to need a lot.
17562
17563         * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
17564         the object type, so we take care of that.
17565
17566         * expression.cs (FullMethodDesc): Also include the return type in descriptions.
17567
17568         * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
17569         added to non-params parameters :-)
17570
17571         * typemanager.cs (CSharpName): Include 'void' type too. 
17572
17573         (void_ptr_type): Include in the set of core types.
17574
17575         * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of 
17576         duplicating code.
17577
17578         (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have 
17579         an unsafe context.
17580
17581         * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had 
17582         completely forgotten about it.
17583
17584 2002-01-10  Ravi Pratap  <ravi@ximian.com>
17585
17586         * cs-parser.jay (pointer_type): Add. This begins our implementation
17587         of parsing rules for unsafe code.
17588
17589         (unsafe_statement): Implement.
17590
17591         (embedded_statement): Modify to include the above.
17592
17593         * statement.cs (Unsafe): Implement new class for unsafe blocks.
17594
17595         * codegen.cs (EmitContext.InUnsafe): Add. This determines
17596         if the current context is an unsafe one.
17597
17598         * cs-parser.jay (local_variable_pointer_type): Since local variable types
17599         are handled differently, we need separate rules for them.
17600
17601         (local_variable_declaration): Update to use local_variable_pointer_type
17602         to allow variable declarations of unmanaged pointer types.
17603
17604         * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
17605         in unsafe contexts.
17606
17607         * ../errors/cs0214.cs : Add.
17608
17609 2002-01-16  Nick Drochak  <ndrochak@gol.com>
17610
17611         * makefile: remove 'response' file when cleaning.
17612
17613 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
17614
17615         * cs-parser.jay: Report 1524.
17616
17617 2002-01-14  Miguel de Icaza  <miguel@ximian.com>
17618
17619         * typemanager.cs (RegisterMethod): drop checking if we have
17620         registered this from here
17621
17622 2002-01-12  Miguel de Icaza  <miguel@ximian.com>
17623
17624         * class.cs (Method.EmitDestructor): Implement calling our base
17625         destructor. 
17626
17627         * statement.cs (Try.Emit): Fix to reset the InFinally to the old
17628         value of InFinally.
17629
17630         * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
17631         this routine and will wrap the call in a try/catch block.  Deal
17632         with the case.
17633
17634 2002-01-11  Miguel de Icaza  <miguel@ximian.com>
17635
17636         * ecore.cs (Expression.MemberLookup): instead of taking a
17637         parameter `same_type' that was used to tell whether we could
17638         access private members we compute our containing type from the
17639         EmitContext.
17640
17641         (FieldExpr): Added partial support for volatile fields.  This does
17642         not work for volatile fields exposed from assemblies, as I can not
17643         figure out how to extract the modreq from it.
17644
17645         Updated all the source files to use this.
17646
17647         * codegen.cs (EmitContext): Compute ContainerType ahead of time,
17648         because it is referenced by MemberLookup very often. 
17649
17650 2002-01-09  Ravi Pratap  <ravi@ximian.com>
17651
17652         * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
17653         TypeBuilder.GetCustomAttributes to retrieve what we need.
17654
17655         Get rid of redundant default_member_attr_type as this is the same as
17656         default_member_type which already exists.
17657
17658         * interface.cs, attribute.cs : Update accordingly.
17659
17660 2002-01-08  Miguel de Icaza  <miguel@ximian.com>
17661
17662         * typemanager.cs: Enable IndexerPropertyName again.  It does not
17663         work for TYpeBuilders though.  Ravi, can you please fix this?
17664
17665         * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
17666
17667         * expression.cs (Argument.Emit): Handle the case of ref objects
17668         being passed to ref functions;  
17669
17670         (ParameterReference.EmitLoad): Loads the content of the pointer
17671         without dereferencing.
17672
17673 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
17674
17675         * cs-tokenizer.cs: Implemented the pre-processing expressions.
17676
17677 2002-01-08  Ravi Pratap  <ravi@ximian.com>
17678
17679         * class.cs (Indexer.DefineMethod): Incorporate the interface
17680         type in the name of the method if we are doing explicit interface
17681         implementation.
17682
17683         * expression.cs (ConversionExists): Remove as it is completely obsolete.
17684
17685         (BetterConversion): Fix extremely trivial bug where we were referring to
17686         ConversionExists instead of StandardConversionExists ! Hooray, things are fine
17687         again !
17688
17689         * ../errors/bug16.cs : Add although we have fixed it.
17690
17691 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
17692
17693         * expression.cs (BaseIndexer): Begin implementation.
17694
17695         * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
17696
17697         * cs-parser.jay (indexer_declarator): Use qualified_identifier
17698         production directly to remove a shift/reduce, and implement
17699         explicit interface implementation.
17700
17701         * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
17702         after a floating point suffix.
17703
17704         * expression.cs (DoNumericPromotions): Improved the conversion for
17705         uint/uint.  If we have a constant, we avoid doing a typecast to a
17706         larger type.
17707
17708         * class.cs (Indexer): Implement explicit interface implementation
17709         for indexers.
17710
17711 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
17712
17713         * class.cs: make the default instance constructor public and hidebysig.
17714
17715 2001-01-03  Ravi Pratap  <ravi@ximian.com>
17716
17717         * interface.cs (EmitDefaultMemberAttr): Make this helper method static
17718         so we can call it from elsewhere.
17719
17720         * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
17721         we emit it internally if the class has a defined indexer; otherwise the user
17722         emits it by decorating the class definition with the DefaultMemberAttribute.
17723
17724         * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
17725         attribute is not used on a type which defines an indexer.
17726
17727         * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
17728         character when we skip whitespace.
17729
17730         * ../errors/cs0646.cs : Add.
17731
17732 2002-01-03  Miguel de Icaza  <miguel@ximian.com>
17733
17734         * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
17735         again. 
17736
17737         * makefile: Add practical target `mcs3.exe' which builds the third
17738         generation compiler. 
17739
17740         * expression.cs (New): Fix structures constructor calling.
17741
17742         * class.cs (Property, Method, Indexer): Emit Final flag on the
17743         method if we are an interface implementation and we are not
17744         abstract. 
17745
17746         * ecore.cs (PropertyExpr): New public field `IsBase', tells
17747         whether this property is referencing a `base' method.
17748
17749         * expression.cs (Invocation.EmitCall): take an extra argument:
17750         is_base, this is used to determine whether the `call' or
17751         `callvirt' opcode should be used.
17752
17753
17754         * delegate.cs: update EmitCall.
17755
17756         * class.cs (Method.Define): Set NewSlot for the cases where we are
17757         not implementing an interface method.
17758
17759         (Property.Define): ditto.
17760
17761 2002-01-02  Miguel de Icaza  <miguel@ximian.com>
17762
17763         * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
17764         'r'.  Allows mcs to parse itself fully.
17765
17766 2002-01-02  Ravi Pratap  <ravi@ximian.com>
17767
17768         * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
17769         of the number of initializers that require the InitializeArray method.
17770
17771         (CheckIndices): Store the Expression in all cases - not the plain value. Also
17772         update the above field where necessary.
17773
17774         (MakeByteBlob): Update accordingly.
17775
17776         (DoEmit): Call EmitStaticInitializers only if the number of initializers is 
17777         greater than 2.
17778
17779         (EmitDynamicInitializers): Update in accordance with the new optimization.
17780
17781         (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
17782         same OpCode applies.
17783
17784         * cs-parser.jay : Fix some glaring errors I introduced.
17785
17786 2002-01-01  Ravi Pratap  <ravi@ximian.com> 
17787
17788         * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
17789         so that we can check for name clashes there too.
17790
17791         * typemanager.cs (default_member_attr_type): The attribute that we need to emit
17792         for interface indexers.
17793
17794         * interfaces.cs (Define): Emit the default member attribute.
17795
17796         * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
17797         variable was being referred to while setting the value ;-)
17798
17799 2002-01-01  Miguel de Icaza  <miguel@ximian.com>
17800
17801         * expression.cs (MakeByteBlob): Optimize: we do not need to fill
17802         byte-by-byte information when we know the data is zero.
17803
17804         Make the block always a multiple of 4, because
17805         DefineInitializedData has a bug.
17806
17807         * assign.cs: Fix, we should assign from the temporary, not from
17808         the source. 
17809
17810         * expression.cs (MakeByteBlob): Fix my incorrect code.
17811
17812 2001-12-31  Miguel de Icaza  <miguel@ximian.com>
17813
17814         * typemanager.cs (EnumToUnderlying): This function is used to get
17815         the underlying type from an enumeration, because it does not
17816         always work. 
17817
17818         * constant.cs: Use the I4_S form for values between -128 and 127.
17819
17820         * statement.cs (Block.LookupLabel): Looks up a label.
17821         (Block): Drop support for labeled blocks.
17822
17823         (LabeledStatement): New kind of statement that represents a label
17824         only.
17825
17826         (Goto): Finally implement this bad boy.
17827
17828         * cs-parser.jay: Update to reflect new mechanism to implement
17829         labels.
17830
17831 2001-12-30  Miguel de Icaza  <miguel@ximian.com>
17832
17833         * codegen.cs (EmitContext.This): a codegen property that keeps the
17834         a single instance of this instead of creating many different this
17835         instances. 
17836
17837         * delegate.cs (Delegate.DoResolve): Update to use the property;
17838
17839         * ecore.cs (SimpleName.SimpleNameResolve): Ditto
17840
17841         * expression.cs (BaseAccess.DoResolve): Ditto.
17842
17843 2001-12-29  Ravi Pratap  <ravi@ximian.com>
17844
17845         * typemanager.cs (methodimpl_attr_type): Add to hold the type
17846         corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
17847
17848         (InitCoreTypes): Update accordingly.
17849
17850         * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
17851         so we can quickly store the state.
17852
17853         (ApplyAttributes): Set the correct implementation flags
17854         for InternalCall methods.
17855
17856 2001-12-29  Miguel de Icaza  <miguel@ximian.com>
17857
17858         * expression.cs (EmitCall): if a method is not virtual, then do
17859         not use callvirt on it.
17860
17861         (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
17862         user defined stuff) requires the use of stobj, which takes an
17863         address on the stack instead of an array and an index.  So emit
17864         the Ldelema operation for it.
17865
17866         (EmitStoreOpcode): Use stobj for valuetypes.
17867
17868         (UnaryMutator.EmitCode): Use the right 1 value depending on
17869         whether we are dealing with int64/uint64, float or doubles.
17870
17871         * class.cs (TypeContainer.AddConstructor): Fix the logic to define
17872         constructors that I implemented last night.
17873
17874         (Constructor.IsDefault): Fix to work properly for static
17875         constructors.
17876
17877         * cs-parser.jay (CheckDef): report method signature errors.
17878         Update error number 103 to be 132.
17879
17880         * decl.cs: New AdditionResult enumeration value: MethodExists.
17881         Although we do this check for methods later on in the semantic
17882         analysis, catching repeated default constructors is so easy that
17883         we catch these here. 
17884
17885         * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
17886         promotions code.
17887
17888         (ParameterReference.EmitAssign, Emit): handle
17889         bools as bytes.
17890
17891         (ArrayAccess.EmitLoadOpcode): Handle bool type here.
17892         (ArrayAccess.EmitStoreOpcode): ditto.
17893
17894         * cs-tokenizer.cs (is_punct): Eliminated empty computation.
17895
17896         * expression.cs (MakeByteBlob): Complete all the missing types
17897         (uint, short, ushort, byte, sbyte)
17898
17899         * class.cs: Only init instance field initializers on instance
17900         constructors. 
17901
17902         Rename `constructors' to instance_constructors. 
17903
17904         (TypeContainer.AddConstructor): Only add constructors to the list
17905         if it is not static.
17906
17907         Make sure that we handle default_static_constructor independently
17908         everywhere where we handle instance_constructors
17909
17910 2001-12-28  Miguel de Icaza  <miguel@ximian.com>
17911
17912         * class.cs: Do not lookup or create a base initializer for a
17913         static constructor.
17914
17915         (ConstructorInitializer.Resolve): use the proper type to lookup
17916         for constructors.
17917
17918         * cs-parser.jay: Report error 1585 (modifiers between type and name).
17919
17920         * enum.cs, interface.cs: Remove CloseType, this is taken care by
17921         in DeclSpace. 
17922
17923         * decl.cs: CloseType is now an virtual method, the default
17924         implementation just closes this type.
17925
17926 2001-12-28  Ravi Pratap  <ravi@ximian.com>
17927
17928         * attribute.cs (DefinePInvokeMethod): Set the implementation flags
17929         to PreserveSig by default. Also emit HideBySig on such methods.
17930
17931         Basically, set the defaults to standard values.
17932
17933         * expression.cs (Invocation.BetterFunction): We need to make sure that for each
17934         argument, if candidate is better, it can't be worse than the best !
17935
17936         (Invocation): Re-write bits to differentiate between methods being
17937         applicable in their expanded form and their normal form - for params
17938         methods of course.
17939
17940         Get rid of use_standard everywhere as only standard conversions are allowed
17941         in overload resolution. 
17942
17943         More spec conformance.
17944
17945 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
17946
17947         * driver.cs: Add --timestamp, to see where the compiler spends
17948         most of its time.
17949
17950         * ecore.cs (SimpleName.DoResolve): Do not create an implicit
17951         `this' in static code.
17952
17953         (SimpleName.DoResolve): Implement in terms of a helper function
17954         that allows static-references to be passed upstream to
17955         MemberAccess.
17956
17957         (Expression.ResolveWithSimpleName): Resolve specially simple
17958         names when called by MemberAccess to implement the special
17959         semantics. 
17960
17961         (Expression.ImplicitReferenceConversion): Handle conversions from
17962         Null to reference types before others, as Null's type is
17963         System.Object. 
17964
17965         * expression.cs (Invocation.EmitCall): Handle the special case of
17966         calling methods declared on a reference type from a ValueType
17967         (Base classes System.Object and System.Enum)
17968
17969         (MemberAccess.Resolve): Only perform lookups on Enumerations if
17970         the left hand side is a TypeExpr, not on every enumeration. 
17971
17972         (Binary.Resolve): If types are reference types, then do a cast to
17973         object on operators != and == of both arguments.
17974
17975         * typemanager.cs (FindMembers): Extract instance and static
17976         members if requested.
17977
17978         * interface.cs (PopulateProperty): Use void_type instead of null
17979         as the return type for the setter method.
17980
17981         (PopulateIndexer): ditto.
17982
17983 2001-12-27  Ravi Pratap  <ravi@ximian.com>
17984
17985         * support.cs (ReflectionParameters): Fix minor bug where we
17986         were examining the wrong parameter for the ParamArray attribute.
17987
17988         Cope with requests for the type of the parameter at position
17989         greater than the params parameter's. We now return the element
17990         type of the params array as that makes more sense.
17991
17992         * expression.cs (Invocation.IsParamsMethodApplicable): Update 
17993         accordingly as we no longer have to extract the element type
17994         ourselves.
17995
17996         (Invocation.OverloadResolve): Update.
17997
17998 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
17999
18000         * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
18001         against IEnumerator, test whether the return value is a descendant
18002         of the IEnumerator interface.
18003
18004         * class.cs (Indexer.Define): Use an auxiliary method to implement
18005         the other bits of the method definition.  Begin support for
18006         explicit interface implementation.
18007
18008         (Property.DefineMethod): Use TypeManager.void_type instead of null
18009         for an empty return value.
18010
18011 2001-12-26  Miguel de Icaza  <miguel@ximian.com>
18012
18013         * expression.cs (MemberAccess.ResolveMemberAccess): if we are
18014         dealing with a FieldExpr which is composed of a FieldBuilder, in
18015         the code path we did extract the constant, but we should have
18016         obtained the underlying value to be able to cast it (otherwise we
18017         end up in an infinite loop, this is what Ravi was running into).
18018
18019         (ArrayCreation.UpdateIndices): Arrays might be empty.
18020
18021         (MemberAccess.ResolveMemberAccess): Add support for section
18022         14.5.4.1 that deals with the special case of E.I when E is a type
18023         and something else, that I can be a reference to a static member.
18024
18025         (ArrayCreation.MakeByteBlob): It is not an error to not be able to
18026         handle a particular array type to create byte blobs, it is just
18027         something we dont generate byteblobs for.
18028
18029         * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
18030         arguments. 
18031
18032         * location.cs (Push): remove the key from the hashtable that we
18033         are about to add.   This happens for empty files.
18034
18035         * driver.cs: Dispose files after we have parsed them.
18036
18037         (tokenize): new function that only runs the tokenizer on its
18038         input, for speed testing.
18039
18040 2001-12-26  Ravi Pratap  <ravi@ximian.com>
18041
18042         * class.cs (Event.Define): Define the private field only if there
18043         are no accessors defined.
18044
18045         * expression.cs (ResolveMemberAccess): If there is no associated
18046         field with the event, that means we have an event defined with its
18047         own accessors and we should flag error cs0070 since transforming
18048         ourselves into a field is not valid in that case.
18049
18050         * ecore.cs (SimpleName.DoResolve): Same as above.
18051
18052         * attribute.cs (DefinePInvokeMethod): Set the default calling convention
18053         and charset to sane values.
18054
18055 2001-12-25  Ravi Pratap  <ravi@ximian.com>
18056
18057         * assign.cs (DoResolve): Perform check on events only if they 
18058         are being accessed outside the declaring type.
18059
18060         * cs-parser.jay (event_declarations): Update rules to correctly
18061         set the type of the implicit parameter etc.
18062
18063         (add_accessor, remove_accessor): Set current local parameters.
18064
18065         * expression.cs (Binary): For delegate addition and subtraction,
18066         cast the return value from the method into the appropriate delegate
18067         type.
18068
18069 2001-12-24  Ravi Pratap  <ravi@ximian.com>
18070
18071         * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
18072         of these as the workaround is unnecessary.
18073
18074         * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
18075         delegate data - none of that is needed at all.
18076
18077         Re-write bits to extract the instance expression and the delegate method
18078         correctly.
18079
18080         * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator 
18081         on delegates too.
18082
18083         * attribute.cs (ApplyAttributes): New method to take care of common tasks
18084         of attaching attributes instead of duplicating code everywhere.
18085
18086         * everywhere : Update code to do attribute emission using the above method.
18087
18088 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
18089
18090         * expression.cs (IsParamsMethodApplicable): if there are not
18091         parameters, return immediately.
18092
18093         * ecore.cs: The 0 literal can be implicity converted to an enum
18094         type. 
18095
18096         (SimpleName.DoResolve): First lookup the type, then lookup the
18097         members. 
18098
18099         (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
18100         want to get its address.  If the InstanceExpression is not
18101         addressable, store the result in a temporary variable, then get
18102         the address of it.
18103
18104         * codegen.cs: Only display 219 errors on warning level or above. 
18105
18106         * expression.cs (ArrayAccess): Make it implement the
18107         IMemoryLocation interface.
18108
18109         (Binary.DoResolve): handle the operator == (object a, object b)
18110         and operator != (object a, object b) without incurring into a
18111         BoxedCast (because 5 != o should never be performed).
18112
18113         Handle binary enumerator operators.
18114
18115         (EmitLoadOpcode): Use Ldelema if the object we are loading is a
18116         value type, otherwise use Ldelem_ref.
18117
18118         Use precomputed names;
18119
18120         (AddressOf): Implement address of
18121
18122         * cs-parser.jay (labeled_statement): Fix recursive block
18123         addition by reworking the production.
18124
18125         * expression.cs (New.DoEmit): New has a special case:
18126                 
18127                  If we are dealing with a ValueType, we have a few
18128                  situations to deal with:
18129                 
18130                     * The target of New is a ValueType variable, that is
18131                       easy, we just pass this as the variable reference
18132                 
18133                     * The target of New is being passed as an argument,
18134                       to a boxing operation or a function that takes a
18135                       ValueType.
18136                 
18137                       In this case, we need to create a temporary variable
18138                       that is the argument of New.
18139
18140
18141 2001-12-23  Ravi Pratap  <ravi@ximian.com>
18142
18143         * rootcontext.cs (LookupType): Check that current_type is not null before
18144         going about looking at nested types.
18145
18146         * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
18147         not implement the IAssignMethod interface any more.
18148
18149         * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
18150         where we tranform them into FieldExprs if they are being resolved from within
18151         the declaring type.
18152
18153         * ecore.cs (SimpleName.DoResolve): Do the same here.
18154
18155         * assign.cs (DoResolve, Emit): Clean up code considerably. 
18156
18157         * ../errors/bug10.cs : Add.
18158
18159         * ../errors/cs0070.cs : Add.
18160
18161         * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
18162
18163         * assign.cs : Get rid of EventIsLocal everywhere.
18164
18165 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
18166
18167         * ecore.cs (ConvertIntLiteral): finished the implementation.
18168
18169         * statement.cs (SwitchLabel): Convert the value we are using as a
18170         key before looking up the table.
18171
18172 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
18173
18174         * codegen.cs (EmitTopBlock): Require a Location argument now.
18175
18176         * cs-parser.jay (constructor_declarator): We need to setup
18177         current_local_parameters before we parse the
18178         opt_constructor_initializer, to allow the variables to be bound
18179         to the constructor arguments.
18180
18181         * rootcontext.cs (LookupType): First lookup nested classes in our
18182         class and our parents before we go looking outside our class.
18183
18184         * expression.cs (ConstantFold): Extract/debox the values at the
18185         beginnning. 
18186
18187         * rootcontext.cs (EmitCode): Resolve the constants first before we
18188         resolve the types.  This is not really needed, but it helps debugging.
18189
18190         * statement.cs: report location.
18191
18192         * cs-parser.jay: pass location to throw statement.
18193
18194         * driver.cs: Small bug fix.
18195
18196         * report.cs: Updated format to be 4-zero filled digits.
18197
18198 2001-12-22  Ravi Pratap  <ravi@ximian.com>
18199
18200         * expression.cs (CheckIndices): Fix minor bug where the wrong
18201         variable was being referred to ;-)
18202
18203         (DoEmit): Do not call EmitStaticInitializers when the 
18204         underlying type is System.Object.
18205
18206 2001-12-21  Ravi Pratap  <ravi@ximian.com>
18207
18208         * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
18209         and do the usual workaround for SRE.
18210
18211         * class.cs (MyEventBuilder.EventType): New member to get at the type
18212         of the event, quickly.
18213
18214         * expression.cs (Binary.ResolveOperator): Handle delegate addition.
18215
18216         * assign.cs (Assign.DoResolve): Handle the case when the target
18217         is an EventExpr and perform the necessary checks.
18218
18219         * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
18220         interface.
18221
18222         (SimpleName.MemberStaticCheck): Include check for EventExpr.
18223
18224         (EventExpr): Set the type in the constructor itself since we 
18225         are meant to be born fully resolved.
18226
18227         (EventExpr.Define): Revert code I wrote earlier.
18228                 
18229         * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
18230         instance expression is null. The instance expression is a This in that case
18231         or a null, depending on whether it is a static method or not.
18232
18233         Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
18234         refers to more than one method.
18235
18236         * assign.cs (DoResolve): Check whether the event belongs to the same Type container
18237         and accordingly flag errors.
18238
18239 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
18240
18241         * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
18242
18243 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
18244
18245         * location.cs (ToString): Provide useful rutine.
18246
18247 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
18248
18249         * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
18250         objects, return the actual integral boxed.
18251
18252         * statement.cs (SwitchLabel): define an ILLabel for each
18253         SwitchLabel. 
18254
18255         (Switch.CheckSwitch): If the value is a Literal, extract
18256         the underlying literal.
18257
18258         Also in the unused hashtable we had, add the SwitchLabel so we can
18259         quickly look this value up.
18260
18261         * constant.cs: Implement a bunch of new constants.  Rewrite
18262         Literal based on this.  Made changes everywhere to adapt to this.
18263
18264         * expression.cs (Expression.MakeByteBlob): Optimize routine by
18265         dereferencing array only once, and also copes with enumrations.
18266
18267         bytes are two bytes wide, not one.
18268
18269         (Cast): Perform constant conversions.
18270
18271         * ecore.cs (TryImplicitIntConversion): Return literals instead of
18272         wrappers to the literals here.
18273
18274         * expression.cs (DoNumericPromotions): long literals can converted
18275         to ulong implicity (this is taken care of elsewhere, but I was
18276         missing this spot).
18277
18278         * ecore.cs (Expression.Literalize): Make the return type Literal,
18279         to improve type checking.
18280
18281         * rootcontext.cs: Lookup for nested classes in our class hierarchy.
18282
18283 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
18284
18285         * literal.cs: Revert code from ravi that checked the bounds.  The
18286         bounds are sane by the definition of the type itself. 
18287
18288         * typemanager.cs: Fix implementation of ImplementsInterface.  We
18289         need to actually look up in our parent hierarchy for interfaces
18290         implemented. 
18291
18292         * const.cs: Use the underlying type for enumerations
18293
18294         * delegate.cs: Compute the basename for the delegate creation,
18295         that should fix the delegate test case, and restore the correct
18296         Type Lookup semantics in rootcontext
18297
18298         * rootcontext.cs: Revert Ravi's last patch.  The correct way of
18299         referencing a nested type with the Reflection API is using the "+"
18300         sign. 
18301
18302         * cs-parser.jay: Do not require EOF token at the end.
18303
18304 2001-12-20  Ravi Pratap  <ravi@ximian.com>
18305
18306         * rootcontext.cs (LookupType): Concatenate type names with
18307         a '.' instead of a '+' The test suite passes again.
18308
18309         * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
18310         field of the enumeration.
18311
18312         * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
18313         the case when the member is an EventExpr.
18314
18315         * ecore.cs (EventExpr.InstanceExpression): Every event which is not
18316         static has an associated instance expression.
18317
18318         * typemanager.cs (RegisterEvent): The usual workaround, now for events.
18319
18320         (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
18321
18322         * class.cs (Event.Define): Register event and perform appropriate checks
18323         for error #111.
18324
18325         We define the Add and Remove methods even if the use provides none because
18326         in that case, we provide default implementations ourselves.
18327
18328         Define a private field of the type of the event. This is done by the CSC compiler
18329         and we should be doing it too ;-)
18330
18331         * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
18332         More methods we use in code we generate.
18333
18334         (multicast_delegate_type, delegate_type): Two separate types since the distinction
18335         is important.
18336
18337         (InitCoreTypes): Update accordingly for the above.
18338
18339         * class.cs (Event.Emit): Generate code for default accessors that we provide
18340
18341         (EmitDefaultMethod): Do the job in the above.
18342
18343         * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the 
18344         appropriate place.
18345
18346 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
18347
18348         * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
18349         builders even if we were missing one.
18350
18351         * interface.cs, class.cs, enum.cs: When calling DefineNestedType
18352         pass the Basename as our class name instead of the Name.  The
18353         basename will be correctly composed for us.
18354
18355         * parameter.cs (Paramters): Now takes a Location argument.
18356
18357         * decl.cs (DeclSpace.LookupType): Removed convenience function and
18358         make all the code call directly LookupType in RootContext and take
18359         this chance to pass the Location information everywhere.
18360
18361         * Everywhere: pass Location information.
18362
18363 2001-12-19  Miguel de Icaza  <miguel@ximian.com>
18364
18365         * class.cs (Constructor.Define): Updated way of detecting the
18366         length of the parameters.
18367
18368         (TypeContainer.DefineType): Use basename as the type name for
18369         nested types.
18370
18371         (TypeContainer.Define): Do not recursively define types here, as
18372         definition is taken care in order by the RootContext.
18373
18374         * tree.cs: Keep track of namespaces in a per-file basis.
18375
18376         * parameter.cs (Parameter.ComputeSignature): Update to use
18377         DeclSpace. 
18378
18379         (Parameters.GetSignature): ditto.
18380
18381         * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
18382         instead of a TypeContainer.
18383
18384         (Interface.SemanticAnalysis): Use `this' instead of our parent to
18385         resolve names.  Because we need to be resolve in our context, not
18386         our parents.
18387
18388         * driver.cs: Implement response files.
18389
18390         * class.cs (TypeContainer.DefineType): If we are defined, do not
18391         redefine ourselves.
18392
18393         (Event.Emit): Emit the code for add/remove handlers.
18394         (Event.Define): Save the MethodBuilders for add/remove.
18395
18396         * typemanager.cs: Use pair here too.
18397
18398         * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
18399         DictionaryEntry requires the first argument to be non-null.  
18400
18401         (enum_declaration): Compute full name for registering the
18402         enumeration.
18403
18404         (delegate_declaration): Instead of using
18405         formal_parameter_list, use opt_formal_parameter_list as the list
18406         can be empty.
18407
18408         * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
18409         (EventParsing): New property that controls whether `add' and
18410         `remove' are returned as tokens or identifiers (for events);
18411
18412 2001-12-19  Ravi Pratap  <ravi@ximian.com>
18413
18414         * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
18415         use MyEventBuilder only and let it wrap the real builder for us.
18416
18417         (MyEventBuilder): Revamp constructor etc.
18418
18419         Implement all operations that we perform on EventBuilder in precisely the same
18420         way here too.
18421
18422         (FindMembers): Update to use the EventBuilder member.
18423
18424         (Event.Emit): Update accordingly.
18425
18426 2001-12-18  Ravi Pratap  <ravi@ximian.com>
18427
18428         * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
18429         by calling the appropriate methods.
18430
18431         (GetCustomAttributes): Make stubs as they cannot possibly do anything
18432         useful.
18433
18434         (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
18435
18436 2001-12-17  Ravi Pratap  <ravi@ximian.com>
18437
18438         * delegate.cs (Delegate.Populate): Check that the return type
18439         and various parameters types are indeed accessible.
18440
18441         * class.cs (Constructor.Define): Same here.
18442
18443         (Field.Define): Ditto.
18444
18445         (Event.Define): Ditto.
18446
18447         (Operator.Define): Check that the underlying Method defined itself
18448         correctly - so it's MethodBuilder should not be null.
18449
18450         * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
18451         expression happens to be null.
18452
18453         * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
18454         members but as of now we don't seem to be able to do anything really useful with it.
18455
18456         (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
18457         not the EventBuilder.
18458
18459 2001-12-18  Miguel de Icaza  <miguel@ximian.com>
18460
18461         * cs-tokenizer.cs: Add support for defines.
18462         Add support for #if, #elif, #else, #endif
18463
18464         (eval_var): evaluates a variable.
18465         (eval): stubbed for evaluating functions.
18466
18467         * cs-parser.jay: Pass the defines information
18468
18469         * driver.cs: Add --define command line option.
18470
18471         * decl.cs: Move MemberCore here.
18472
18473         Make it the base class for DeclSpace.  This allows us to catch and
18474         report 108 and 109 for everything now.
18475
18476         * class.cs (TypeContainer.Define): Extract all the members
18477         before populating and emit the warning 108 (new keyword required
18478         to override) instead of having each member implement this.
18479
18480         (MemberCore.Define): New abstract method, we will be using this in
18481         the warning reporting engine in Populate.
18482
18483         (Operator.Define): Adjust to new MemberCore protocol. 
18484
18485         * const.cs (Const): This does not derive from Expression, it is a
18486         temporary object we use to create fields, it is a MemberCore. 
18487
18488         * class.cs (Method.Define): Allow the entry point to be in a
18489         specific class.
18490
18491         * driver.cs: Rewrite the argument handler to clean it up a bit.
18492
18493         * rootcontext.cs: Made it just an auxiliary namespace feature by
18494         making everything static.
18495
18496         * driver.cs: Adapt code to use RootContext type name instead of
18497         instance variable.
18498
18499         * delegate.cs: Remove RootContext argument.
18500
18501         * class.cs: (Struct, TypeContainer, Class): Remove RootContext
18502         argument. 
18503
18504         * class.cs (Event.Define): The lookup can fail.
18505
18506         * cs-tokenizer.cs: Begin implementation of pre-procesor. 
18507
18508         * expression.cs: Resolve the this instance before invoking the code.
18509
18510 2001-12-17  Miguel de Icaza  <miguel@ximian.com>
18511
18512         * cs-parser.jay: Add a production in element_access that allows
18513         the thing to become a "type" reference.  This way we can parse
18514         things like "(string [])" as a type.
18515
18516         Note that this still does not handle the more complex rules of
18517         casts. 
18518
18519
18520         * delegate.cs (Delegate.Populate): Register the delegage constructor builder here. 
18521
18522         * ecore.cs: (CopyNewMethods): new utility function used to
18523         assemble the list of methods from running FindMembers.
18524
18525         (MemberLookup): Rework FindMembers so that 
18526
18527 2001-12-16  Miguel de Icaza  <miguel@ximian.com>
18528
18529         * class.cs (TypeContainer): Remove Delegates who fail to be
18530         defined.
18531
18532         * delegate.cs (Populate): Verify that we dont get null return
18533         values.   TODO: Check for AsAccessible.
18534
18535         * cs-parser.jay: Use basename to emit error 574 (destructor should
18536         have the same name as container class), not the full name.
18537
18538         * cs-tokenizer.cs (adjust_int): Fit the integer in the best
18539         possible representation.  
18540
18541         Also implements integer type suffixes U and L.
18542
18543 2001-12-15  Miguel de Icaza  <miguel@ximian.com>
18544
18545         * expression.cs (ArrayCreation.DoResolve): We need to do the
18546         argument resolution *always*.
18547
18548         * decl.cs: Make this hold the namespace.  Hold the root context as
18549         well.
18550         (LookupType): Move here.
18551
18552         * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
18553
18554         * location.cs (Row, Name): Fixed the code, it was always returning
18555         references to the first file.
18556
18557         * interface.cs: Register properties defined through interfaces.
18558
18559         * driver.cs: Add support for globbing on the command line
18560
18561         * class.cs (Field): Make it derive from MemberCore as well.
18562         (Event): ditto.
18563
18564 2001-12-15  Ravi Pratap  <ravi@ximian.com>
18565
18566         * class.cs (Event::Define): Check that the type of the event is a delegate
18567         type else flag error #66.
18568
18569         Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
18570         same.
18571
18572         * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
18573         values of EntryPoint, CharSet etc etc.
18574
18575         Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
18576
18577         * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
18578         be null and we should ignore this. I am not sure if this is really clean. Apparently,
18579         there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
18580         which needs this to do its work.
18581
18582         * ../errors/cs0066.cs : Add.
18583
18584 2001-12-14  Miguel de Icaza  <miguel@ximian.com>
18585
18586         * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
18587         helper functions.
18588
18589         * class.cs: (MethodSignature.MethodSignature): Removed hack that
18590         clears out the parameters field.
18591         (MemberSignatureCompare): Cleanup
18592
18593         (MemberCore): New base class used to share code between MethodCore
18594         and Property.
18595
18596         (RegisterRequiredImplementations) BindingFlags.Public requires
18597         either BindingFlags.Instace or Static.  Use instance here.
18598
18599         (Property): Refactored code to cope better with the full spec.
18600
18601         * parameter.cs (GetParameterInfo): Return an empty array instead
18602         of null on error.
18603
18604         * class.cs (Property): Abstract or extern properties have no bodies.
18605
18606         * parameter.cs (GetParameterInfo): return a zero-sized array.
18607
18608         * class.cs (TypeContainer.MethodModifiersValid): Move all the
18609         method modifier validation to the typecontainer so we can reuse
18610         this on properties.
18611
18612         (MethodCore.ParameterTypes): return an empty sized array of types.
18613
18614         (Property.Define): Test property modifier validity.
18615
18616         Add tests for sealed/override too.
18617
18618         (Method.Emit): abstract or extern methods have no bodies.
18619
18620 2001-12-14  Ravi Pratap  <ravi@ximian.com>
18621
18622         * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
18623         thing.
18624
18625         (Method::Define, ::Emit): Modify accordingly.
18626
18627         * expression.cs (Invocation::OverloadResolve): Handle error # 121.
18628
18629         (ArrayCreation::MakeByteBlob): Handle floats and doubles.
18630
18631         * makefile: Pass in /unsafe.
18632
18633 2001-12-13  Miguel de Icaza  <miguel@ximian.com>
18634
18635         * class.cs (MakeKey): Kill routine.
18636
18637         * class.cs (TypeContainer.Define): Correctly define explicit
18638         method implementations (they require the full interface name plus
18639         the method name).
18640
18641         * typemanager.cs: Deply the PtrHashtable here and stop using the
18642         lame keys.  Things work so much better.
18643
18644         This of course broke everyone who depended on `RegisterMethod' to
18645         do the `test for existance' test.  This has to be done elsewhere.
18646
18647         * support.cs (PtrHashtable): A hashtable that avoid comparing with
18648         the object stupid Equals method (because, that like fails all over
18649         the place).  We still do not use it.
18650
18651         * class.cs (TypeContainer.SetRequiredInterface,
18652         TypeContainer.RequireMethods): Killed these two routines and moved
18653         all the functionality to RegisterRequiredImplementations.
18654
18655         (TypeContainer.RegisterRequiredImplementations): This routine now
18656         registers all the implementations required in an array for the
18657         interfaces and abstract methods.  We use an array of structures
18658         which can be computed ahead of time to reduce memory usage and we
18659         also assume that lookups are cheap as most classes will not
18660         implement too many interfaces.
18661
18662         We also avoid creating too many MethodSignatures.
18663
18664         (TypeContainer.IsInterfaceMethod): Update and optionally does not
18665         clear the "pending" bit if we find that there are problems with
18666         the declaration.
18667
18668         (TypeContainer.VerifyPendingMethods): Update to report errors of
18669         methods that look like implementations but are not.
18670
18671         (TypeContainer.Define): Add support for explicit interface method
18672         implementation. 
18673
18674 2001-12-12  Miguel de Icaza  <miguel@ximian.com>
18675
18676         * typemanager.cs: Keep track of the parameters here instead of
18677         being a feature of the TypeContainer.
18678
18679         * class.cs: Drop the registration of parameters here, as
18680         InterfaceMethods are also interface declarations.
18681
18682         * delegate.cs: Register methods with the TypeManager not only with
18683         the TypeContainer.  This code was buggy.
18684
18685         * interface.cs: Full registation here.
18686
18687 2001-12-11  Miguel de Icaza  <miguel@ximian.com>
18688
18689         * expression.cs: Remove reducer for binary expressions, it can not
18690         be done this way.
18691
18692         * const.cs: Put here the code that used to go into constant.cs
18693
18694         * constant.cs: Put here the code for constants, this is a new base
18695         class for Literals.
18696
18697         * literal.cs: Make Literal derive from Constant.
18698
18699 2001-12-09  Miguel de Icaza  <miguel@ximian.com>
18700
18701         * statement.cs (Return.Emit): Report error 157 if the user
18702         attempts to return from a finally block.
18703
18704         (Return.Emit): Instead of emitting a return, jump to the end of
18705         the function.
18706
18707         * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
18708         LocalBuilder to store the result of the function.  ReturnLabel is
18709         the target where we jump.
18710
18711
18712 2001-12-09  Radek Doulik  <rodo@ximian.com>
18713
18714         * cs-parser.jay: remember alias in current namespace
18715
18716         * ecore.cs (SimpleName::DoResolve): use aliases for types or
18717         namespaces
18718
18719         * class.cs (LookupAlias): lookup alias in my_namespace
18720
18721         * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
18722         aliases hashtable
18723         (LookupAlias): lookup alias in this and if needed in parent
18724         namespaces
18725
18726 2001-12-08  Miguel de Icaza  <miguel@ximian.com>
18727
18728         * support.cs: 
18729
18730         * rootcontext.cs: (ModuleBuilder) Made static, first step into
18731         making things static.  I need this to avoid passing the
18732         TypeContainer when calling ParameterType.
18733
18734         * support.cs (InternalParameters.ParameterType): Remove ugly hack
18735         that did string manipulation to compute the type and then call
18736         GetType.  Use Parameter.ParameterType instead.
18737
18738         * cs-tokenizer.cs: Consume the suffix for floating values.
18739
18740         * expression.cs (ParameterReference): figure out whether this is a
18741         reference parameter or not.  Kill an extra variable by computing
18742         the arg_idx during emission.
18743
18744         * parameter.cs (Parameters.GetParameterInfo): New overloaded
18745         function that returns whether a parameter is an out/ref value or not.
18746
18747         (Parameter.ParameterType): The type of the parameter (base,
18748         without ref/out applied).
18749
18750         (Parameter.Resolve): Perform resolution here.
18751         (Parameter.ExternalType): The full type (with ref/out applied).
18752
18753         * statement.cs (Using.Emit, Using.EmitExpression): Implement
18754         support for expressions on the using statement.
18755
18756 2001-12-07  Miguel de Icaza  <miguel@ximian.com>
18757
18758         * statement.cs (Using.EmitLocalVariableDecls): Split the
18759         localvariable handling of the using statement.
18760
18761         (Block.EmitMeta): Keep track of variable count across blocks.  We
18762         were reusing slots on separate branches of blocks.
18763
18764         (Try.Emit): Emit the general code block, we were not emitting it. 
18765
18766         Check the type of the declaration to be an IDisposable or
18767         something that can be implicity converted to it. 
18768
18769         Emit conversions if required.
18770
18771         * ecore.cs (EmptyExpression): New utility class.
18772         (Expression.ImplicitConversionExists): New utility function.
18773
18774 2001-12-06  Miguel de Icaza  <miguel@ximian.com>
18775
18776         * statement.cs (Using): Implement.
18777
18778         * expression.cs (LocalVariableReference): Support read only variables.
18779
18780         * statement.cs: Remove the explicit emit for the Leave opcode.
18781         (VariableInfo): Add a readonly field.
18782
18783 2001-12-05  Miguel de Icaza  <miguel@ximian.com>
18784
18785         * ecore.cs (ConvCast): new class used to encapsulate the various
18786         explicit integer conversions that works in both checked and
18787         unchecked contexts.
18788
18789         (Expression.ConvertNumericExplicit): Use new ConvCast class to
18790         properly generate the overflow opcodes.
18791
18792 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
18793
18794         * statement.cs: The correct type for the EmptyExpression is the
18795         element_type, not the variable type.  Ravi pointed this out.
18796
18797 2001-12-04  Ravi Pratap  <ravi@ximian.com>
18798
18799         * class.cs (Method::Define): Handle PInvoke methods specially
18800         by using DefinePInvokeMethod instead of the usual one.
18801
18802         * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
18803         above to do the task of extracting information and defining the method.
18804
18805 2001-12-04  Ravi Pratap  <ravi@ximian.com>
18806
18807         * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
18808         of the condition for string type.
18809
18810         (Emit): Move that here. 
18811
18812         (ArrayCreation::CheckIndices): Keep string literals in their expression
18813         form.
18814
18815         (EmitDynamicInitializers): Handle strings appropriately.
18816
18817 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
18818
18819         * codegen.cs (EmitContext): Replace multiple variables with a
18820         single pointer to the current Switch statement.
18821
18822         * statement.cs (GotoDefault, Switch): Adjust to cleaned up
18823         EmitContext.
18824
18825 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
18826
18827         * statement.cs 
18828
18829         * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
18830         default'.
18831
18832         (Foreach.Emit): Foreach on arrays was not setting
18833         up the loop variables (for break/continue).
18834
18835         (GotoCase): Semi-implented.
18836
18837 2001-12-03  Ravi Pratap  <ravi@ximian.com>
18838
18839         * attribute.cs (CheckAttribute): Handle system attributes by using
18840         Attribute.GetAttributes to examine information we need.
18841
18842         (GetValidPlaces): Same here.
18843
18844         * class.cs (Method::Define): Catch invalid use of extern and abstract together.
18845
18846         * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
18847
18848         * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
18849
18850         (Method::Define): Set appropriate flags if we have a DllImport attribute.
18851
18852         (Method::Emit): Handle the case when we are a PInvoke method.
18853
18854 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
18855
18856         * expression.cs: Use ResolveWithSimpleName on compound names.
18857
18858 2001-12-02  Ravi Pratap  <ravi@ximian.com>
18859
18860         * constant.cs (EmitConstant): Make sure we resolve the associated expression
18861         before trying to reduce it.
18862
18863         * typemanager.cs (RegisterConstant, LookupConstant): Implement.
18864
18865         * constant.cs (LookupConstantValue): Implement.
18866
18867         (EmitConstant): Use the above in emitting the constant.
18868
18869         * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
18870         that are user-defined by doing a LookupConstantValue on them.
18871
18872         (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
18873         too, like above.
18874
18875 2001-11-29  Miguel de Icaza  <miguel@ximian.com>
18876
18877         * expression.cs (BaseAccess, BaseIndexer): Also split this out.
18878
18879         (BaseAccess.DoResolve): Implement.
18880
18881         (MemberAccess.DoResolve): Split this routine into a
18882         ResolveMemberAccess routine that can be used independently
18883
18884 2001-11-28  Miguel de Icaza  <miguel@ximian.com>
18885
18886         * expression.cs (Probe, Is, As): Split Probe in two classes Is and
18887         As that share bits of the implementation.  Is returns a boolean,
18888         while As returns the Type that is being probed.
18889
18890 2001-12-01  Ravi Pratap  <ravi@ximian.com>
18891
18892         * enum.cs (LookupEnumValue): Re-write various bits, return an object value
18893         instead of a Literal - much easier.
18894
18895         (EnumInTransit): Remove - utterly useless :-)
18896
18897         (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
18898
18899         * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
18900
18901         * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
18902         chain when we have no associated expression.
18903
18904 2001-11-30  Ravi Pratap  <ravi@ximian.com>
18905
18906         * constant.cs (Define): Use Location while reporting the errror.
18907
18908         Also emit a warning when 'new' is used and there is no inherited
18909         member to hide.
18910
18911         * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being 
18912         populated.
18913
18914         (LookupEnumValue): Implement to lookup an enum member's value and define it
18915         if necessary.
18916
18917         (Populate): Re-write accordingly to use the above routine.
18918
18919 2001-11-27  Miguel de Icaza  <miguel@ximian.com>
18920
18921         * expression.cs (This): Fix prototype for DoResolveLValue to
18922         override the base class DoResolveLValue.
18923
18924         * cs-parser.cs: Report errors cs574 and cs575 (destructor
18925         declarations) 
18926
18927         * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
18928         (we need to load the address of the field here).  This fixes
18929         test-22. 
18930
18931         (FieldExpr.DoResolveLValue): Call the DoResolve
18932         function to initialize the Instance expression.
18933
18934         * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
18935         correctly the GetEnumerator operation on a value type.
18936
18937         * cs-parser.jay: Add more simple parsing error catches.
18938
18939         * statement.cs (Switch): Add support for string switches.
18940         Handle null specially.
18941
18942         * literal.cs (NullLiteral): Make NullLiteral objects singletons. 
18943
18944 2001-11-28  Ravi Pratap  <ravi@ximian.com>
18945
18946         * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
18947
18948         (declare_local_constant): New helper function.
18949
18950         * statement.cs (AddConstant): Keep a separate record of constants
18951
18952         (IsConstant): Implement to determine if a variable is a constant.
18953
18954         (GetConstantExpression): Implement.
18955
18956         * expression.cs (LocalVariableReference): Handle the case when it is a constant.
18957
18958         * statement.cs (IsVariableDefined): Re-write.
18959
18960 2001-11-27  Ravi Pratap  <ravi@ximian.com>
18961
18962         * class.cs (TypeContainer::FindMembers): Look for constants
18963         in the case when we are looking for MemberTypes.Field
18964
18965         * expression.cs (MemberAccess::DoResolve): Check that in the
18966         case we are a FieldExpr and a Literal, we are not being accessed
18967         by an instance reference.
18968
18969         * cs-parser.jay (local_constant_declaration): Implement.
18970
18971         (declaration_statement): Implement for constant declarations.
18972
18973 2001-11-26  Miguel de Icaza  <miguel@ximian.com>
18974
18975         * statement.cs (Switch): Catch double defaults.
18976
18977         (Switch): More work on the switch() statement
18978         implementation.  It works for integral values now, need to finish
18979         string support.
18980
18981
18982 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
18983
18984         * ecore.cs (Expression.ConvertIntLiteral): New function to convert
18985         integer literals into other integer literals.  To be used by
18986         switch. 
18987
18988 2001-11-24  Ravi Pratap  <ravi@ximian.com>
18989
18990         * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
18991         some memory.
18992
18993         (EmitDynamicInitializers): Cope with the above since we extract data
18994         directly from ArrayData now.
18995
18996         (ExpectInitializers): Keep track of whether initializers are mandatory
18997         or not.
18998
18999         (Bounds): Make it a hashtable to prevent the same dimension being 
19000         recorded for every element in that dimension.
19001
19002         (EmitDynamicInitializers): Fix bug which prevented the Set array method
19003         from being found.
19004
19005         Also fix bug which was causing the indices to be emitted in the reverse
19006         order.
19007
19008 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
19009
19010         * expression.cs (ArrayCreation): Implement the bits that Ravi left
19011         unfinished.  They do not work, because the underlying code is
19012         sloppy.
19013
19014 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
19015
19016         * cs-parser.jay: Remove bogus fixme.
19017
19018         * statement.cs (Switch, SwitchSection, SwithLabel): Started work
19019         on Switch statement.
19020
19021 2001-11-23  Ravi Pratap  <ravi@ximian.com>
19022
19023         * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
19024         the same. 
19025
19026         * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
19027         parameter. Apparently, any expression is allowed. 
19028
19029         (ValidateInitializers): Update accordingly.
19030
19031         (CheckIndices): Fix some tricky bugs thanks to recursion.
19032
19033         * delegate.cs (NewDelegate::DoResolve): Re-write large portions as 
19034         I was being completely brain-dead.
19035
19036         (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
19037         and re-write acordingly.
19038
19039         (DelegateInvocation): Re-write accordingly.
19040
19041         * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
19042
19043         (MakeByteBlob): Handle types more correctly.
19044
19045         * expression.cs (ArrayCreation:Emit): Write preliminary code to do
19046         initialization from expressions but it is incomplete because I am a complete
19047         Dodo :-|
19048
19049 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
19050
19051         * statement.cs (If.Emit): Fix a bug that generated incorrect code
19052         on If.  Basically, we have to return `true' (ie, we do return to
19053         our caller) only if both branches of the if return.
19054
19055         * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
19056         short-circuit operators, handle them as short circuit operators. 
19057
19058         (Cast.DoResolve): Resolve type.
19059         (Cast.Cast): Take an expression as the target type.
19060
19061         * cs-parser.jay (cast_expression): Remove old hack that only
19062         allowed a limited set of types to be handled.  Now we take a
19063         unary_expression and we resolve to a type during semantic
19064         analysis.
19065
19066         Use the grammar productions from Rhys to handle casts (this is
19067         not complete like Rhys syntax yet, we fail to handle that corner
19068         case that C# has regarding (-x), but we will get there.
19069
19070 2001-11-22  Ravi Pratap  <ravi@ximian.com>
19071
19072         * class.cs (EmitFieldInitializer): Take care of the case when we have a
19073         field which is an array type.
19074
19075         * cs-parser.jay (declare_local_variables): Support array initialization too.
19076
19077         * typemanager.cs (MakeKey): Implement.
19078
19079         (everywhere): Use the above appropriately.
19080
19081         * cs-parser.jay (for_statement): Update for array initialization while
19082         declaring variables.
19083
19084         * ecore.cs : The error message was correct, it's the variable's names that
19085         were misleading ;-) Make the code more readable.
19086
19087         (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
19088         the correct type etc.
19089
19090         (ConvertExplicit): Handle Enum types by examining the underlying type.
19091
19092 2001-11-21  Ravi Pratap  <ravi@ximian.com>
19093
19094         * parameter.cs (GetCallingConvention): Always return
19095         CallingConventions.Standard for now.
19096
19097 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
19098
19099         * expression.cs (Binary.ResolveOperator): Update the values of `l'
19100         and `r' after calling DoNumericPromotions.
19101
19102         * ecore.cs: Fix error message (the types were in the wrong order).
19103
19104         * statement.cs (Foreach.ProbeCollectionType): Need to pass
19105         BindingFlags.Instance as well 
19106
19107         * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
19108         implicit int literal conversion in an empty cast so that we
19109         propagate the right type upstream.
19110
19111         (UnboxCast): new class used to unbox value types.
19112         (Expression.ConvertExplicit): Add explicit type conversions done
19113         by unboxing.
19114
19115         (Expression.ImplicitNumericConversion): Oops, forgot to test for
19116         the target type before applying the implicit LongLiterals to ULong
19117         literal cast.
19118
19119 2001-11-21  Miguel de Icaza  <miguel@ximian.com>
19120
19121         * cs-parser.jay (for_statement): Reworked the way For works: now
19122         we declare manually any variables that are introduced in
19123         for_initializer to solve the problem of having out-of-band code
19124         emition (that is what got for broken).
19125
19126         (declaration_statement): Perform the actual variable declaration
19127         that used to be done in local_variable_declaration here.
19128
19129         (local_variable_declaration): Do not declare anything, just pass
19130         the information on a DictionaryEntry
19131
19132 2001-11-20  Ravi Pratap  <ravi@ximian.com>
19133
19134         * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
19135         re-write of the logic to now make it recursive.
19136
19137         (UpdateIndices): Re-write accordingly.
19138
19139         Store element data in a separate ArrayData list in the above methods.
19140
19141         (MakeByteBlob): Implement to dump the array data into a byte array.
19142
19143 2001-11-19  Ravi Pratap  <ravi@ximian.com>
19144
19145         * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
19146         into CheckIndices.
19147
19148         * constant.cs (Define): Implement.
19149
19150         (EmitConstant): Re-write fully.
19151
19152         Pass in location info.
19153
19154         * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
19155         respectively.
19156
19157         * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
19158         DictionaryEntry since we need location info too.
19159
19160         (constant_declaration): Update accordingly.
19161
19162         * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
19163         code into another method : UpdateIndices.
19164
19165 2001-11-18  Ravi Pratap  <ravi@ximian.com>
19166
19167         * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
19168         some type checking etc.
19169
19170 2001-11-17  Ravi Pratap  <ravi@ximian.com>
19171
19172         * expression.cs (ArrayCreation::ValidateInitializers): Implement
19173         bits to provide dimension info if the user skips doing that.
19174
19175         Update second constructor to store the rank correctly.
19176
19177 2001-11-16  Ravi Pratap  <ravi@ximian.com>
19178
19179         * expression.cs (ArrayCreation::ValidateInitializers): Poke around
19180         and try to implement.
19181
19182         * ../errors/cs0150.cs : Add.
19183
19184         * ../errors/cs0178.cs : Add.
19185
19186 2001-11-16  Miguel de Icaza  <miguel@ximian.com>
19187
19188         * statement.cs: Implement foreach on multi-dimensional arrays. 
19189
19190         * parameter.cs (Parameters.GetParameterByName): Also lookup the
19191         name of the params argument.
19192
19193         * expression.cs: Use EmitStoreOpcode to get the right opcode while
19194         initializing the array.
19195
19196         (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
19197         we can use this elsewhere.
19198
19199         * statement.cs: Finish implementation of foreach for single
19200         dimension arrays.
19201
19202         * cs-parser.jay: Use an out-of-band stack to pass information
19203         around, I wonder why I need this.
19204
19205         foreach_block: Make the new foreach_block the current_block.
19206
19207         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
19208         function used to return a static Parameters structure.  Used for
19209         empty parameters, as those are created very frequently.
19210
19211         * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
19212
19213 2001-11-15  Ravi Pratap  <ravi@ximian.com>
19214
19215         * interface.cs : Default modifier is private, not public. The
19216         make verify test passes again.
19217
19218 2001-11-15  Ravi Pratap  <ravi@ximian.com>
19219
19220         * support.cs (ReflectionParameters): Fix logic to determine
19221         whether the last parameter is a params one. Test 9 passes again.
19222
19223         * delegate.cs (Populate): Register the builders we define with
19224         RegisterParameterForBuilder. Test 19 passes again.
19225
19226         * cs-parser.jay (property_declaration): Reference $6 instead
19227         of $$ to get at the location.
19228
19229         (indexer_declaration): Similar stuff.
19230
19231         (attribute): Ditto.
19232
19233         * class.cs (Property): Register parameters for the Get and Set methods
19234         if they exist. Test 23 passes again.
19235
19236         * expression.cs (ArrayCreation::Emit): Pass null for the method in the
19237         call to EmitArguments as we are sure there aren't any params arguments. 
19238         Test 32 passes again.
19239
19240         * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
19241         IndexOutOfRangeException. 
19242
19243         * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
19244         Test 33 now passes again.
19245
19246 2001-11-15  Miguel de Icaza  <miguel@ximian.com>
19247
19248         * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
19249         broke a bunch of things.  Will have to come up with a better way
19250         of tracking locations.
19251
19252         * statement.cs: Implemented foreach for single dimension arrays.
19253
19254 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
19255
19256         * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
19257         an error.  This removes the lookup from the critical path.
19258
19259         * cs-parser.jay: Removed use of temporary_loc, which is completely
19260         broken. 
19261
19262 2001-11-14  Miguel de Icaza  <miguel@ximian.com>
19263
19264         * support.cs (ReflectionParameters.ParameterModifier): Report
19265         whether the argument is a PARAMS argument or not.
19266
19267         * class.cs: Set the attribute `ParamArrayAttribute' on the
19268         parameter argument.
19269
19270         * typemanager.cs: Define param_array_type (ParamArrayAttribute)
19271         and cons_param_array_attribute (ConstructorInfo for
19272         ParamArrayAttribute)., 
19273
19274         * codegen.cs: Emit the return using the `Return' statement, that
19275         way we can report the error correctly for missing return values. 
19276
19277         * class.cs (Method.Emit): Clean up.
19278
19279         * expression.cs (Argument.Resolve): Take another argument: the
19280         location where this argument is used.  Notice that this is not
19281         part of the "Argument" class as to reduce the size of the
19282         structure (we know the approximate location anyways).
19283
19284         Test if the argument is a variable-reference, if not, then
19285         complain with a 206.
19286
19287         (Argument.Emit): Emit addresses of variables.
19288
19289         (Argument.FullDesc): Simplify.
19290
19291         (Invocation.DoResolve): Update for Argument.Resolve.
19292
19293         (ElementAccess.DoResolve): ditto.
19294
19295         * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
19296         method should be virtual, as this method is always virtual.
19297
19298         (NewDelegate.DoResolve): Update for Argument.Resolve.
19299
19300         * class.cs (ConstructorInitializer.DoResolve): ditto.
19301
19302         * attribute.cs (Attribute.Resolve): ditto.
19303
19304 2001-11-13  Miguel de Icaza  <miguel@ximian.com>
19305
19306         * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
19307
19308         * expression.cs (ParameterReference): Drop IStackStorage and implement
19309         IAssignMethod instead. 
19310
19311         (LocalVariableReference): ditto.
19312
19313         * ecore.cs (FieldExpr): Drop IStackStorage and implement
19314         IAssignMethod instead. 
19315
19316 2001-11-13  Miguel de Icaza <miguel@ximian.com>
19317
19318         * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
19319         enumerations that are used in heavily used structures derive from
19320         byte in a laughable and pathetic attempt to reduce memory usage.
19321         This is the kind of pre-optimzations that you should not do at
19322         home without adult supervision.
19323
19324         * expression.cs (UnaryMutator): New class, used to handle ++ and
19325         -- separatedly from the other unary operators.  Cleans up the
19326         code, and kills the ExpressionStatement dependency in Unary.
19327
19328         (Unary): Removed `method' and `Arguments' from this class, making
19329         it smaller, and moving it all to SimpleCall, so I can reuse this
19330         code in other locations and avoid creating a lot of transient data
19331         strucutres when not required.
19332
19333         * cs-parser.jay: Adjust for new changes.
19334
19335 2001-11-11  Miguel de Icaza  <miguel@ximian.com>
19336
19337         * enum.cs (Enum.Populate): If there is a failure during
19338         definition, return
19339
19340         * cs-parser.jay (opt_enum_base): we used to catch type errors
19341         here, but this is really incorrect.  The type error should be
19342         catched during semantic analysis.
19343
19344 2001-12-11  Ravi Pratap  <ravi@ximian.com>
19345
19346         * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
19347         current_local_parameters as expected since I, in my stupidity, had forgotten
19348         to do this :-)
19349
19350         * attribute.cs (GetValidPlaces): Fix stupid bug.
19351
19352         * class.cs (Method::Emit): Perform check on applicability of attributes.
19353
19354         (Constructor::Emit): Ditto.
19355
19356         (Field::Emit): Ditto.
19357
19358         (Field.Location): Store location information.
19359
19360         (Property, Event, Indexer, Operator): Ditto.
19361
19362         * cs-parser.jay (field_declaration): Pass in location for each field.
19363
19364         * ../errors/cs0592.cs : Add.
19365
19366 2001-11-12  Ravi Pratap  <ravi@ximian.com>
19367
19368         * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
19369
19370         (InitCoreTypes): Update accordingly.
19371
19372         (RegisterAttrType, LookupAttr): Implement.
19373
19374         * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
19375         info about the same.
19376
19377         (Resolve): Update to populate the above as necessary.
19378
19379         (Error592): Helper.
19380
19381         (GetValidPlaces): Helper to the above.
19382
19383         (CheckAttribute): Implement to perform validity of attributes on declarative elements.
19384
19385         * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
19386
19387 2001-11-12  Ravi Pratap  <ravi@ximian.com>
19388
19389         * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
19390
19391         * ../errors/cs0617.cs : Add.
19392
19393 2001-11-11  Ravi Pratap  <ravi@ximian.com>
19394
19395         * enum.cs (Emit): Rename to Populate to be more consistent with what
19396         we expect it to do and when exactly it is called.
19397
19398         * class.cs, rootcontext.cs : Update accordingly.
19399
19400         * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
19401         FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
19402
19403         * enum.cs (Populate): Register fields with TypeManager.RegisterField.
19404
19405         * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
19406         of a fieldinfo using the above, when dealing with a FieldBuilder.
19407
19408 2001-11-10  Ravi Pratap  <ravi@ximian.com>
19409
19410         * ../errors/cs0031.cs : Add.
19411
19412         * ../errors/cs1008.cs : Add.
19413
19414         * ../errrors/cs0543.cs : Add.
19415
19416         * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
19417         enum type.
19418
19419         (FindMembers): Implement.
19420
19421         * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
19422         enums and delegates too.
19423
19424         (enum_types): Rename to builder_to_enum.
19425
19426         (delegate_types): Rename to builder_to_delegate.
19427
19428         * delegate.cs (FindMembers): Implement.
19429
19430 2001-11-09  Ravi Pratap  <ravi@ximian.com>
19431
19432         * typemanager.cs (IsEnumType): Implement.
19433
19434         * enum.cs (Emit): Re-write parts to account for the underlying type
19435         better and perform checking etc.
19436
19437         (GetNextDefaultValue): Helper to ensure we don't overshoot max value
19438         of the underlying type.
19439
19440         * literal.cs (GetValue methods everywhere): Perform bounds checking and return
19441         value
19442
19443         * enum.cs (error31): Helper to report error #31.
19444
19445         * cs-parser.jay (enum_declaration): Store location of each member too.
19446
19447         * enum.cs (member_to_location): New hashtable. 
19448
19449         (AddEnumMember): Update location hashtable.
19450
19451         (Emit): Use the location of each member while reporting errors.
19452
19453 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
19454
19455         * cs-parser.jay: A for_initializer if is a
19456         local_variable_declaration really ammount to have an implicit
19457         block with the variable declaration and no initializer for for.
19458
19459         * statement.cs (For.Emit): Cope with null initializers.
19460
19461         This fixes the infinite loop on for initializers.
19462
19463 2001-11-08  Miguel de Icaza  <miguel@ximian.com>
19464
19465         * enum.cs: More cleanup.
19466
19467         * ecore.cs: Remove dead code.
19468
19469         * class.cs (Property.Emit): More simplification.
19470         (Event.Emit): ditto.
19471
19472         Reworked to have less levels of indentation.
19473
19474 2001-11-08  Ravi Pratap  <ravi@ximian.com>
19475
19476         * class.cs (Property): Emit attributes.
19477
19478         (Field): Ditto.
19479
19480         (Event): Ditto.
19481
19482         (Indexer): Ditto.
19483
19484         (Operator): Ditto.
19485
19486         * enum.cs (Emit): Ditto.
19487
19488         * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
19489         Enums too.
19490
19491         * class.cs (Field, Event, etc.): Move attribute generation into the
19492         Emit method everywhere.
19493
19494         * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
19495         we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
19496         as we had no way of defining nested enums !
19497
19498         * rootcontext.cs : Adjust code accordingly.
19499
19500         * typemanager.cs (AddEnumType): To keep track of enum types separately.
19501
19502 2001-11-07  Ravi Pratap  <ravi@ximian.com>
19503
19504         * expression.cs (EvalConstantExpression): Move into ecore.cs
19505
19506         * enum.cs (Enum): Rename some members and make them public and readonly
19507         according to our convention.
19508
19509         * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
19510         nothing else.
19511
19512         * enum.cs (Enum::Define): Use the above instead of TypeAttr.
19513
19514         (Enum::Emit): Write a simple version for now which doesn't try to compute
19515         expressions. I shall modify this to be more robust in just a while.
19516
19517         * class.cs (TypeContainer::Emit): Make sure we include Enums too.
19518
19519         (TypeContainer::CloseType): Create the Enum types too.
19520
19521         * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
19522
19523         * expression.cs (EvalConstantExpression): Get rid of completely.
19524
19525         * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
19526         user-defined values and other cases.
19527
19528         (IsValidEnumLiteral): Helper function.
19529
19530         * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing 
19531         out there in the case we had a literal FieldExpr.
19532
19533         (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
19534
19535         (Literalize): Revamp a bit to take two arguments.
19536
19537         (EnumLiteral): New class which derives from Literal to wrap enum literals.
19538
19539 2001-11-06  Ravi Pratap  <ravi@ximian.com>
19540
19541         * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
19542
19543         * expression.cs (ArrayCreation::ValidateInitializers): Implement.
19544
19545         (Resolve): Use the above to ensure we have proper initializers.
19546
19547 2001-11-05  Ravi Pratap  <ravi@ximian.com>
19548
19549         * expression.cs (Expression::EvalConstantExpression): New method to 
19550         evaluate constant expressions.
19551
19552         * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
19553
19554 2001-11-07  Miguel de Icaza  <miguel@ximian.com>
19555
19556         * expression.cs (ArrayCreation.Emit): Some bits to initialize data
19557         in an array.
19558
19559         (Binary.ResolveOperator): Handle operator != (object a, object b)
19560         and operator == (object a, object b);
19561
19562         (Binary.DoNumericPromotions): Indicate whether the numeric
19563         promotion was possible.
19564
19565         (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
19566         Implement.  
19567
19568         Made the ArrayAccess implement interface IAssignMethod instead of
19569         IStackStore as the order in which arguments are passed reflects
19570         this.
19571
19572         * assign.cs: Instead of using expr.ExprClass to select the way of
19573         assinging, probe for the IStackStore/IAssignMethod interfaces.
19574
19575         * typemanager.cs: Load InitializeArray definition.
19576
19577         * rootcontext.cs (RootContext.MakeStaticData): Used to define
19578         static data that can be used to initialize arrays. 
19579
19580 2001-11-05  Miguel de Icaza  <miguel@ximian.com>
19581
19582         * expression.cs: Handle operator== and operator!= for booleans.
19583
19584         (Conditioal.Reduce): Implement reducer for the ?: operator.
19585
19586         (Conditional.Resolve): Implement dead code elimination.
19587
19588         (Binary.Resolve): Catch string literals and return a new
19589         concatenated string.
19590
19591         (Unary.Reduce): Implement reduction of unary expressions.
19592
19593         * ecore.cs: Split out the expression core handling here.
19594
19595         (Expression.Reduce): New method used to perform constant folding
19596         and CSE.  This is needed to support constant-expressions. 
19597
19598         * statement.cs (Statement.EmitBoolExpression): Pass true and false
19599         targets, and optimize for !x.
19600
19601 2001-11-04  Ravi Pratap  <ravi@ximian.com>
19602
19603         * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
19604         of an attribute gives us a CustomAttributeBuilder which we use accordingly to
19605         set custom atttributes.
19606
19607         * literal.cs (Literal::GetValue): New abstract method to return the actual
19608         value of the literal, cast as an object.
19609
19610         (*Literal): Implement GetValue method.
19611
19612         * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
19613         expressions to the arraylist but objects of type Argument.
19614
19615         * class.cs (TypeContainer::Emit): Emit our attributes too.
19616
19617         (Method::Emit, Constructor::Emit): Ditto.
19618
19619         * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
19620         to be ignoring earlier.
19621
19622 2001-11-03  Ravi Pratap  <ravi@ximian.com>
19623
19624         * attribute.cs (AttributeSection::Define): Implement to do the business
19625         of constructing a CustomAttributeBuilder.
19626
19627         (Attribute): New trivial class. Increases readability of code.  
19628
19629         * cs-parser.jay : Update accordingly.
19630
19631         (positional_argument_list, named_argument_list, named_argument): New rules
19632
19633         (attribute_arguments): Use the above so that we are more correct.
19634
19635 2001-11-02  Ravi Pratap  <ravi@ximian.com>
19636
19637         * expression.cs (Invocation::IsParamsMethodApplicable): Implement
19638         to perform all checks for a method with a params parameter.
19639
19640         (Invocation::OverloadResolve): Update to use the above method and therefore
19641         cope correctly with params method invocations.
19642
19643         * support.cs (InternalParameters::ParameterDesc): Provide a desc for 
19644         params too.
19645
19646         * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
19647         constructors in our parent too because we can't afford to miss out on 
19648         protected ones ;-)
19649
19650         * attribute.cs (AttributeSection): New name for the class Attribute
19651
19652         Other trivial changes to improve readability.
19653
19654         * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
19655         use the new class names.
19656
19657 2001-11-01  Ravi Pratap  <ravi@ximian.com>
19658
19659         * class.cs (Method::Define): Complete definition for params types too
19660
19661         (Indexer::Define): Ditto.
19662
19663         * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
19664         Cope everywhere with a request for info about the array parameter.
19665
19666 2001-11-01  Ravi Pratap  <ravi@ximian.com>
19667
19668         * tree.cs (RecordNamespace): Fix up to check for the correct key.
19669
19670         * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in 
19671         local_variable_type to extract the string corresponding to the type.
19672
19673         (local_variable_type): Fixup the action to use the new helper method.
19674
19675         * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to 
19676         go.
19677
19678         * expression.cs : Clean out code which uses the above.
19679
19680 2001-10-31  Ravi Pratap  <ravi@ximian.com>
19681
19682         * typemanager.cs (RegisterMethod): Check if we already have an existing key
19683         and bale out if necessary by returning a false.
19684
19685         (RegisterProperty): Ditto.
19686
19687         * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
19688         and print out appropriate error messages.
19689
19690         * interface.cs (everywhere): Ditto.
19691
19692         * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
19693         location to constructor.
19694
19695         * class.cs (Property, Event, Indexer): Update accordingly.
19696
19697         * ../errors/cs111.cs : Added.
19698
19699         * expression.cs (Invocation::IsApplicable): New static method to determine applicability
19700         of a method, as laid down by the spec.
19701
19702         (Invocation::OverloadResolve): Use the above method.
19703
19704 2001-10-31  Ravi Pratap  <ravi@ximian.com>
19705
19706         * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
19707         now take a TypeContainer and a Parameters object.
19708
19709         (ParameterData): Modify return type of ParameterModifier method to be 
19710         Parameter.Modifier and not a string.
19711
19712         (ReflectionParameters, InternalParameters): Update accordingly.
19713
19714         * expression.cs (Argument::GetParameterModifier): Same here.
19715
19716         * support.cs (InternalParameters::ParameterType): Find a better way of determining
19717         if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
19718         symbol in it at all so maybe this is only for now.
19719
19720 2001-10-30  Ravi Pratap  <ravi@ximian.com>
19721
19722         * support.cs (InternalParameters): Constructor now takes an extra argument 
19723         which is the actual Parameters class.
19724
19725         (ParameterDesc): Update to provide info on ref/out modifiers.
19726
19727         * class.cs (everywhere): Update call to InternalParameters to pass in
19728         the second argument too.
19729
19730         * support.cs (ParameterData): Add ParameterModifier, which is a method 
19731         to return the modifier info [ref/out etc]
19732
19733         (InternalParameters, ReflectionParameters): Implement the above.
19734
19735         * expression.cs (Argument::ParameterModifier): Similar function to return
19736         info about the argument's modifiers.
19737
19738         (Invocation::OverloadResolve): Update to take into account matching modifiers 
19739         too.
19740
19741         * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
19742         a new SetFormalParameters object which we pass to InternalParameters.
19743
19744 2001-10-30  Ravi Pratap  <ravi@ximian.com>
19745
19746         * expression.cs (NewArray): Merge into the ArrayCreation class.
19747
19748 2001-10-29  Ravi Pratap  <ravi@ximian.com>
19749
19750         * expression.cs (NewArray): Merge classes NewBuiltinArray and 
19751         NewUserdefinedArray into one as there wasn't much of a use in having
19752         two separate ones.
19753
19754         * expression.cs (Argument): Change field's name to ArgType from Type.
19755
19756         (Type): New readonly property which returns the proper type, taking into 
19757         account ref/out modifiers.
19758
19759         (everywhere): Adjust code accordingly for the above.
19760
19761         * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
19762         whether we are emitting for a ref or out parameter.
19763
19764         * expression.cs (Argument::Emit): Use the above field to set the state.
19765
19766         (LocalVariableReference::Emit): Update to honour the flag and emit the
19767         right stuff.
19768
19769         * parameter.cs (Attributes): Set the correct flags for ref parameters.
19770
19771         * expression.cs (Argument::FullDesc): New function to provide a full desc.
19772
19773         * support.cs (ParameterData): Add method ParameterDesc to the interface.
19774
19775         (ReflectionParameters, InternalParameters): Implement the above method.
19776
19777         * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
19778         reporting errors.
19779
19780         (Invocation::FullMethodDesc): Ditto. 
19781
19782 2001-10-29  Miguel de Icaza  <miguel@ximian.com>
19783
19784         * cs-parser.jay: Add extra production for the second form of array
19785         creation. 
19786
19787         * expression.cs (ArrayCreation): Update to reflect the above
19788         change. 
19789
19790         * Small changes to prepare for Array initialization.
19791
19792 2001-10-28  Miguel de Icaza  <miguel@ximian.com>
19793
19794         * typemanager.cs (ImplementsInterface): interface might be null;
19795         Deal with this problem;
19796
19797         Also, we do store negative hits on the cache (null values), so use
19798         this instead of calling t.GetInterfaces on the type everytime.
19799
19800 2001-10-28  Ravi Pratap  <ravi@ximian.com>
19801
19802         * typemanager.cs (IsBuiltinType): New method to help determine the same.
19803
19804         * expression.cs (New::DoResolve): Get rid of array creation code and instead
19805         split functionality out into different classes.
19806
19807         (New::FormArrayType): Move into NewBuiltinArray.
19808
19809         (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
19810         quite useless.
19811
19812         (NewBuiltinArray): New class to handle creation of built-in arrays.
19813
19814         (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
19815         account creation of one-dimensional arrays.
19816
19817         (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
19818
19819         (NewUserdefinedArray::DoResolve): Implement.
19820
19821         * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
19822
19823         * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
19824         we maintain inside the TypeManager. This is necessary to perform lookups on the
19825         module builder.
19826
19827         (LookupType): Update to perform GetType on the module builders too.     
19828
19829         * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
19830
19831         * exprssion.cs (NewUserdefinedArray::Emit): Implement.
19832
19833 2001-10-23  Ravi Pratap  <ravi@ximian.com>
19834
19835         * expression.cs (New::DoResolve): Implement guts of array creation.
19836
19837         (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
19838
19839 2001-10-27  Miguel de Icaza  <miguel@ximian.com>
19840
19841         * expression.cs: Fix bug I introduced lsat night that broke
19842         Delegates. 
19843
19844         (Expression.Resolve): Report a 246 error (can not resolve name)
19845         if we find a SimpleName in the stream.
19846
19847         (Expression.ResolveLValue): Ditto.
19848
19849         (Expression.ResolveWithSimpleName): This function is a variant of
19850         ResolveName, this one allows SimpleNames to be returned without a
19851         warning.  The only consumer of SimpleNames is MemberAccess
19852
19853 2001-10-26  Miguel de Icaza  <miguel@ximian.com>
19854
19855         * expression.cs (Invocation::DoResolve): Catch SimpleNames that
19856         might arrive here.  I have my doubts that this is correct.
19857
19858         * statement.cs (Lock): Implement lock statement.
19859
19860         * cs-parser.jay: Small fixes to support `lock' and `using'
19861
19862         * cs-tokenizer.cs: Remove extra space
19863
19864         * driver.cs: New flag --checked, allows to turn on integer math
19865         checking. 
19866
19867         * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
19868         Threading.Monitor.Exit 
19869
19870 2001-10-23  Miguel de Icaza  <miguel@ximian.com>
19871
19872         * expression.cs (IndexerAccess::DoResolveLValue): Set the
19873         Expression Class to be IndexerAccess.
19874
19875         Notice that Indexer::DoResolve sets the eclass to Value.
19876
19877 2001-10-22  Miguel de Icaza  <miguel@ximian.com>
19878
19879         * class.cs (TypeContainer::Emit): Emit code for indexers.
19880
19881         * assign.cs (IAssignMethod): New interface implemented by Indexers
19882         and Properties for handling assignment.
19883
19884         (Assign::Emit): Simplify and reuse code. 
19885
19886         * expression.cs (IndexerAccess, PropertyExpr): Implement
19887         IAssignMethod, clean up old code. 
19888
19889 2001-10-22  Ravi Pratap  <ravi@ximian.com>
19890
19891         * typemanager.cs (ImplementsInterface): New method to determine if a type
19892         implements a given interface. Provides a nice cache too.
19893
19894         * expression.cs (ImplicitReferenceConversion): Update checks to use the above
19895         method.
19896
19897         (ConvertReferenceExplicit): Ditto.
19898
19899         * delegate.cs (Delegate::Populate): Update to define the parameters on the 
19900         various methods, with correct names etc.
19901
19902         * class.cs (Operator::OpType): New members Operator.UnaryPlus and 
19903         Operator.UnaryNegation.
19904
19905         * cs-parser.jay (operator_declarator): Be a little clever in the case where
19906         we have a unary plus or minus operator.
19907
19908         * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and 
19909         UnaryMinus.
19910
19911         * everywhere : update accordingly.
19912
19913         * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
19914         respectively.
19915
19916         * class.cs (Method::Define): For the case where we are implementing a method
19917         inherited from an interface, we need to set the MethodAttributes.Final flag too. 
19918         Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
19919
19920 2001-10-21  Ravi Pratap  <ravi@ximian.com>
19921
19922         * interface.cs (FindMembers): Implement to work around S.R.E
19923         lameness.
19924
19925         * typemanager.cs (IsInterfaceType): Implement.
19926
19927         (FindMembers): Update to handle interface types too.
19928
19929         * expression.cs (ImplicitReferenceConversion): Re-write bits which
19930         use IsAssignableFrom as that is not correct - it doesn't work.
19931
19932         * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
19933         and accordingly override EmitStatement.
19934
19935         * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
19936         using the correct logic :-)
19937
19938 2001-10-19  Ravi Pratap  <ravi@ximian.com>
19939
19940         * ../errors/cs-11.cs : Add to demonstrate error -11 
19941
19942 2001-10-17  Miguel de Icaza  <miguel@ximian.com>
19943
19944         * assign.cs (Assign::Resolve): Resolve right hand side first, and
19945         then pass this as a hint to ResolveLValue.
19946
19947         * expression.cs (FieldExpr): Add Location information
19948
19949         (FieldExpr::LValueResolve): Report assignment to readonly
19950         variable. 
19951
19952         (Expression::ExprClassFromMemberInfo): Pass location information.
19953
19954         (Expression::ResolveLValue): Add new method that resolves an
19955         LValue. 
19956
19957         (Expression::DoResolveLValue): Default invocation calls
19958         DoResolve. 
19959
19960         (Indexers): New class used to keep track of indexers in a given
19961         Type. 
19962
19963         (IStackStore): Renamed from LValue, as it did not really describe
19964         what this did.  Also ResolveLValue is gone from this interface and
19965         now is part of Expression.
19966
19967         (ElementAccess): Depending on the element access type
19968
19969         * typemanager.cs: Add `indexer_name_type' as a Core type
19970         (System.Runtime.CompilerServices.IndexerNameAttribute)
19971
19972         * statement.cs (Goto): Take a location.
19973
19974 2001-10-18  Ravi Pratap  <ravi@ximian.com>
19975
19976         * delegate.cs (Delegate::VerifyDelegate): New method to verify
19977         if two delegates are compatible.
19978
19979         (NewDelegate::DoResolve): Update to take care of the case when
19980         we instantiate a delegate from another delegate.
19981
19982         * typemanager.cs (FindMembers): Don't even try to look up members
19983         of Delegate types for now.
19984
19985 2001-10-18  Ravi Pratap  <ravi@ximian.com>
19986
19987         * delegate.cs (NewDelegate): New class to take care of delegate
19988         instantiation.
19989
19990         * expression.cs (New): Split the delegate related code out into 
19991         the NewDelegate class.
19992
19993         * delegate.cs (DelegateInvocation): New class to handle delegate 
19994         invocation.
19995
19996         * expression.cs (Invocation): Split out delegate related code into
19997         the DelegateInvocation class.
19998
19999 2001-10-17  Ravi Pratap  <ravi@ximian.com>
20000
20001         * expression.cs (New::DoResolve): Implement delegate creation fully
20002         and according to the spec.
20003
20004         (New::DoEmit): Update to handle delegates differently.
20005
20006         (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
20007         because of which we were printing out arguments in reverse order !
20008
20009         * delegate.cs (VerifyMethod): Implement to check if the given method
20010         matches the delegate.
20011
20012         (FullDelegateDesc): Implement.
20013
20014         (VerifyApplicability): Implement.
20015
20016         * expression.cs (Invocation::DoResolve): Update to accordingly handle
20017         delegate invocations too.
20018
20019         (Invocation::Emit): Ditto.
20020
20021         * ../errors/cs1593.cs : Added.
20022
20023         * ../errors/cs1594.cs : Added.
20024
20025         * delegate.cs (InstanceExpression, TargetMethod): New properties.
20026
20027 2001-10-16  Ravi Pratap  <ravi@ximian.com>
20028
20029         * typemanager.cs (intptr_type): Core type for System.IntPtr
20030
20031         (InitCoreTypes): Update for the same.
20032
20033         (iasyncresult_type, asynccallback_type): Ditto.
20034
20035         * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
20036         correct.
20037
20038         * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
20039         too.
20040
20041         * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
20042         the builders for the 4 members of a delegate type :-)
20043
20044         (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
20045         type.
20046
20047         * expression.cs (New::DoResolve): Implement guts for delegate creation.
20048
20049         * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
20050
20051 2001-10-15  Miguel de Icaza  <miguel@ximian.com>
20052
20053         * statement.cs (Break::Emit): Implement.   
20054         (Continue::Emit): Implement.
20055
20056         (For::Emit): Track old being/end loops;  Set Begin loop, ack end loop
20057         (While::Emit): Track old being/end loops;  Set Begin loop, ack end loop
20058         (Do::Emit): Track old being/end loops;  Set Begin loop, ack end loop
20059         (Foreach::Emit): Track old being/end loops;  Set Begin loop, ack
20060         end loop
20061
20062         * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
20063         properties that track the label for the current loop (begin of the
20064         loop and end of the loop).
20065
20066 2001-10-15  Ravi Pratap  <ravi@ximian.com>
20067
20068         * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
20069         use of emitting anything at all.
20070
20071         * class.cs, rootcontext.cs : Get rid of calls to the same.
20072
20073         * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
20074
20075         (Populate): Define the constructor correctly and set the implementation
20076         attributes.
20077
20078         * typemanager.cs (delegate_types): New hashtable to hold delegates that
20079         have been defined.
20080
20081         (AddDelegateType): Implement.
20082
20083         (IsDelegateType): Implement helper method.
20084
20085         * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
20086
20087         * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
20088         and accordingly handle it.
20089
20090         * delegate.cs (Populate): Take TypeContainer argument.
20091         Implement bits to define the Invoke method. However, I still haven't figured out
20092         how to take care of the native int bit :-(
20093
20094         * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-) 
20095         Qualify the name of the delegate, not its return type !
20096
20097         * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
20098         conversion.
20099
20100         (StandardConversionExists): Checking for array types turns out to be recursive.
20101
20102         (ConvertReferenceExplicit): Implement array conversion.
20103
20104         (ExplicitReferenceConversionExists): New method to determine precisely that :-)
20105
20106 2001-10-12  Ravi Pratap  <ravi@ximian.com>
20107
20108         * cs-parser.jay (delegate_declaration): Store the fully qualified
20109         name as it is a type declaration.
20110
20111         * delegate.cs (ReturnType, Name): Rename members to these. Make them 
20112         readonly.
20113
20114         (DefineDelegate): Renamed from Define. Does the same thing essentially,
20115         as TypeContainer::DefineType.
20116
20117         (Populate): Method in which all the definition of the various methods (Invoke)
20118         etc is done.
20119
20120         (Emit): Emit any code, if necessary. I am not sure about this really, but let's
20121         see.
20122
20123         (CloseDelegate): Finally creates the delegate.
20124
20125         * class.cs (TypeContainer::DefineType): Update to define delegates.
20126         (Populate, Emit and CloseType): Do the same thing here too.
20127
20128         * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
20129         delegates in all these operations.
20130
20131 2001-10-14  Miguel de Icaza  <miguel@ximian.com>
20132
20133         * expression.cs: LocalTemporary: a new expression used to
20134         reference a temporary that has been created.
20135
20136         * assign.cs: Handle PropertyAccess back here, so that we can
20137         provide the proper semantic access to properties.
20138
20139         * expression.cs (Expression::ConvertReferenceExplicit): Implement
20140         a few more explicit conversions. 
20141
20142         * modifiers.cs: `NEW' modifier maps to HideBySig.
20143
20144         * expression.cs (PropertyExpr): Make this into an
20145         ExpressionStatement, and support the EmitStatement code path. 
20146
20147         Perform get/set error checking, clean up the interface.
20148
20149         * assign.cs: recognize PropertyExprs as targets, and if so, turn
20150         them into toplevel access objects.
20151
20152 2001-10-12  Miguel de Icaza  <miguel@ximian.com>
20153
20154         * expression.cs: PropertyExpr::PropertyExpr: use work around the
20155         SRE.
20156
20157         * typemanager.cs: Keep track here of our PropertyBuilders again to
20158         work around lameness in SRE.
20159
20160 2001-10-11  Miguel de Icaza  <miguel@ximian.com>
20161
20162         * expression.cs (LValue::LValueResolve): New method in the
20163         interface, used to perform a second resolution pass for LValues. 
20164
20165         (This::DoResolve): Catch the use of this in static methods.
20166
20167         (This::LValueResolve): Implement.
20168
20169         (This::Store): Remove warning, assigning to `this' in structures
20170         is 
20171
20172         (Invocation::Emit): Deal with invocation of
20173         methods on value types.  We need to pass the address to structure
20174         methods rather than the object itself.  (The equivalent code to
20175         emit "this" for structures leaves the entire structure on the
20176         stack instead of a pointer to it). 
20177
20178         (ParameterReference::DoResolve): Compute the real index for the
20179         argument based on whether the method takes or not a `this' pointer
20180         (ie, the method is static).
20181
20182         * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
20183         value types returned from functions when we need to invoke a
20184         method on the sturcture.
20185
20186
20187 2001-10-11  Ravi Pratap  <ravi@ximian.com>
20188
20189         * class.cs (TypeContainer::DefineType): Method to actually do the business of
20190         defining the type in the Modulebuilder or Typebuilder. This is to take
20191         care of nested types which need to be defined on the TypeBuilder using
20192         DefineNestedMethod.
20193
20194         (TypeContainer::GetClassBases): Implement. Essentially the code from the 
20195         methods in RootContext, only ported to be part of TypeContainer.
20196
20197         (TypeContainer::GetInterfaceOrClass): Ditto.
20198
20199         (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
20200
20201         * interface.cs (Interface::DefineInterface): New method. Does exactly
20202         what RootContext.CreateInterface did earlier, only it takes care of nested types 
20203         too.
20204
20205         (Interface::GetInterfaces): Move from RootContext here and port.
20206
20207         (Interface::GetInterfaceByName): Same here.
20208
20209         * rootcontext.cs (ResolveTree): Re-write.
20210
20211         (PopulateTypes): Re-write.
20212
20213         * class.cs (TypeContainer::Populate): Populate nested types too.
20214         (TypeContainer::Emit): Emit nested members too.
20215
20216         * typemanager.cs (AddUserType): Do not make use of the FullName property,
20217         instead just use the name argument passed in as it is already fully
20218         qualified.
20219
20220         (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
20221         to TypeContainer mapping to see if a type is user-defined.
20222
20223         * class.cs (TypeContainer::CloseType): Implement. 
20224
20225         (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
20226         the default constructor.
20227
20228         (TypeContainer::Populate): Fix minor bug which led to creating default constructors
20229         twice.
20230
20231         (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
20232
20233         * interface.cs (CloseType): Create the type here.
20234
20235         * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
20236         the hierarchy.
20237
20238         Remove all the methods which are now in TypeContainer.
20239
20240 2001-10-10  Ravi Pratap  <ravi@ximian.com>
20241
20242         * delegate.cs (Define): Re-write bits to define the delegate
20243         correctly.
20244
20245 2001-10-10  Miguel de Icaza  <miguel@ximian.com>
20246
20247         * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
20248
20249         * expression.cs (ImplicitReferenceConversion): handle null as well
20250         as a source to convert to any reference type.
20251
20252         * statement.cs (Return): Perform any implicit conversions to
20253         expected return type.  
20254
20255         Validate use of return statement.  
20256
20257         * codegen.cs (EmitContext): Pass the expected return type here.
20258
20259         * class.cs (Method, Constructor, Property): Pass expected return
20260         type to EmitContext.
20261
20262 2001-10-09  Miguel de Icaza  <miguel@ximian.com>
20263
20264         * expression.cs: Make DoResolve take an EmitContext instead of a
20265         TypeContainer.
20266
20267         Replaced `l' and `location' for `loc', for consistency.
20268
20269         (Error, Warning): Remove unneeded Tc argument.
20270
20271         * assign.cs, literal.cs, constant.cs: Update to new calling
20272         convention. 
20273
20274         * codegen.cs: EmitContext now contains a flag indicating whether
20275         code is being generated in a static method or not.
20276
20277         * cs-parser.jay: DecomposeQI, new function that replaces the old
20278         QualifiedIdentifier.  Now we always decompose the assembled
20279         strings from qualified_identifier productions into a group of
20280         memberaccesses.
20281
20282 2001-10-08  Miguel de Icaza  <miguel@ximian.com>
20283
20284         * rootcontext.cs: Deal with field-less struct types correctly now
20285         by passing the size option to Define Type.
20286
20287         * class.cs: Removed hack that created one static field. 
20288
20289 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
20290
20291         * statement.cs: Moved most of the code generation here. 
20292
20293 2001-10-09  Ravi Pratap  <ravi@ximian.com>
20294
20295         * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
20296         seem very right.
20297
20298         (ElementAccess): Remove useless bits for now - keep checks as the spec
20299         says.
20300
20301 2001-10-08  Ravi Pratap  <ravi@ximian.com>
20302
20303         * expression.cs (ElementAccess::DoResolve): Remove my crap code
20304         and start performing checks according to the spec.
20305
20306 2001-10-07  Ravi Pratap  <ravi@ximian.com>
20307
20308         * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
20309         rank_specifiers instead.
20310
20311         (rank_specifiers): Change the order in which the rank specifiers are stored
20312
20313         (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
20314
20315         * expression.cs (ElementAccess): Implement the LValue interface too.
20316
20317 2001-10-06  Ravi Pratap  <ravi@ximian.com>
20318
20319         * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
20320         except that user defined conversions are not included.
20321
20322         (UserDefinedConversion): Update to use the ConvertExplicitStandard to 
20323         perform the conversion of the return type, if necessary.
20324
20325         (New::DoResolve): Check whether we are creating an array or an object
20326         and accordingly do the needful.
20327
20328         (New::Emit): Same here.
20329
20330         (New::DoResolve): Implement guts of array creation.
20331
20332         (New::FormLookupType): Helper function.
20333
20334 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
20335
20336         * codegen.cs: Removed most of the code generation here, and move the
20337         corresponding code generation bits to the statement classes. 
20338
20339         Added support for try/catch/finalize and throw.
20340
20341         * cs-parser.jay: Added support for try/catch/finalize.
20342
20343         * class.cs: Catch static methods having the flags override,
20344         virtual or abstract.
20345
20346         * expression.cs (UserCast): This user cast was not really doing
20347         what it was supposed to do.  Which is to be born in fully resolved
20348         state.  Parts of the resolution were being performed at Emit time! 
20349
20350         Fixed this code.
20351
20352 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
20353
20354         * expression.cs: Implicity convert the result from UserCast.
20355
20356 2001-10-05  Ravi Pratap  <ravi@ximian.com>
20357
20358         * expression.cs (Expression::FindMostEncompassingType): Fix bug which
20359         prevented it from working correctly. 
20360
20361         (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
20362         merely ConvertImplicit.
20363
20364 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
20365
20366         * typemanager.cs: Make the LookupTypeContainer function static,
20367         and not per-instance.  
20368
20369         * class.cs: Make static FindMembers (the one that takes a Type
20370         argument). 
20371
20372         * codegen.cs: Add EmitForeach here.
20373
20374         * cs-parser.jay: Make foreach a toplevel object instead of the
20375         inline expansion, as we need to perform semantic analysis on it. 
20376
20377 2001-10-05  Ravi Pratap  <ravi@ximian.com>
20378
20379         * expression.cs (Expression::ImplicitUserConversion): Rename to
20380         UserDefinedConversion.
20381
20382         (Expression::UserDefinedConversion): Take an extra argument specifying 
20383         whether we look for explicit user conversions too.
20384
20385         (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
20386
20387         (UserDefinedConversion): Incorporate support for user defined explicit conversions.
20388
20389         (ExplicitUserConversion): Make it a call to UserDefinedConversion
20390         with the appropriate arguments.
20391
20392         * cs-parser.jay (cast_expression): Record location too.
20393
20394         * expression.cs (Cast): Record location info.
20395
20396         (Expression::ConvertExplicit): Take location argument.
20397
20398         (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
20399         to determine if we are doing explicit conversions.
20400
20401         (UserCast::Emit): Update accordingly.
20402
20403         (Expression::ConvertExplicit): Report an error if everything fails.
20404
20405         * ../errors/cs0030.cs : Add.
20406
20407 2001-10-04  Miguel de Icaza  <miguel@ximian.com>
20408
20409         * modifiers.cs: If the ABSTRACT keyword is present, also set the
20410         virtual and newslot bits. 
20411
20412         * class.cs (TypeContainer::RegisterRequiredImplementations):
20413         Record methods we need.
20414
20415         (TypeContainer::MakeKey): Helper function to make keys for
20416         MethodBases, since the Methodbase key is useless.
20417
20418         (TypeContainer::Populate): Call RegisterRequiredImplementations
20419         before defining the methods.   
20420
20421         Create a mapping for method_builders_to_methods ahead of time
20422         instead of inside a tight loop.
20423
20424         (::RequireMethods):  Accept an object as the data to set into the
20425         hashtable so we can report interface vs abstract method mismatch.
20426
20427 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
20428
20429         * report.cs: Make all of it static.
20430
20431         * rootcontext.cs: Drop object_type and value_type computations, as
20432         we have those in the TypeManager anyways.
20433
20434         Drop report instance variable too, now it is a global.
20435
20436         * driver.cs: Use try/catch on command line handling.
20437
20438         Add --probe option to debug the error reporting system with a test
20439         suite. 
20440
20441         * report.cs: Add support for exiting program when a probe
20442         condition is reached.
20443
20444 2001-10-03  Ravi Pratap  <ravi@ximian.com>
20445
20446         * expression.cs (Binary::DoNumericPromotions): Fix the case when
20447         we do a forcible conversion regardless of type, to check if 
20448         ForceConversion returns a null.
20449
20450         (Binary::error19): Use location to report error.
20451
20452         (Unary::error23): Use location here too.
20453
20454         * ../errors/cs0019.cs : Check in.
20455
20456         * ../errors/cs0023.cs : Check in.
20457
20458         * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
20459         case of a non-null MethodInfo object with a length of 0 !
20460
20461         (Binary::ResolveOperator): Flag error if overload resolution fails to find
20462         an applicable member - according to the spec :-)
20463         Also fix logic to find members in base types.
20464
20465         (Unary::ResolveOperator): Same here.
20466
20467         (Unary::report23): Change name to error23 and make first argument a TypeContainer
20468         as I was getting thoroughly confused between this and error19 :-)
20469
20470         * expression.cs (Expression::ImplicitUserConversion): Re-write fully
20471         (::FindMostEncompassedType): Implement.
20472         (::FindMostEncompassingType): Implement.
20473         (::StandardConversionExists): Implement.
20474
20475         (UserImplicitCast): Re-vamp. We now need info about most specific
20476         source and target types so that we can do the necessary conversions.
20477
20478         (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
20479         mathematical union with no duplicates.
20480
20481 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
20482
20483         * rootcontext.cs (RootContext::PopulateTypes): Populate containers
20484         in order from base classes to child classes, so that we can in
20485         child classes look up in our parent for method names and
20486         attributes (required for handling abstract, virtual, new, override
20487         constructs: we need to instrospect our base class, and if we dont
20488         populate the classes in order, the introspection might be
20489         incorrect.  For example, a method could query its parent before
20490         the parent has any methods and would determine that the parent has
20491         no abstract methods (while it could have had them)).
20492
20493         (RootContext::CreateType): Record the order in which we define the
20494         classes.
20495
20496 2001-10-02  Miguel de Icaza  <miguel@ximian.com>
20497
20498         * class.cs (TypeContainer::Populate): Also method definitions can
20499         fail now, keep track of this.
20500
20501         (TypeContainer::FindMembers): Implement support for
20502         DeclaredOnly/noDeclaredOnly flag.
20503
20504         (Constructor::Emit) Return the ConstructorBuilder.
20505
20506         (Method::Emit) Return the MethodBuilder. 
20507         Check for abstract or virtual methods to be public.
20508
20509         * rootcontext.cs (RootContext::CreateType): Register all the
20510         abstract methods required for the class to be complete and the
20511         interface methods that must be implemented. 
20512
20513         * cs-parser.jay: Report error 501 (method requires body if it is
20514         not marked abstract or extern).
20515
20516         * expression.cs (TypeOf::Emit): Implement.
20517
20518         * typemanager.cs: runtime_handle_type, new global type.
20519
20520         * class.cs (Property::Emit): Generate code for properties.
20521
20522 2001-10-02  Ravi Pratap  <ravi@ximian.com>
20523
20524         * expression.cs (Unary::ResolveOperator): Find operators on base type
20525         too - we now conform exactly to the spec.
20526
20527         (Binary::ResolveOperator): Same here.
20528
20529         * class.cs (Operator::Define): Fix minor quirk in the tests.
20530
20531         * ../errors/cs0215.cs : Added.
20532
20533         * ../errors/cs0556.cs : Added.
20534
20535         * ../errors/cs0555.cs : Added.
20536
20537 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
20538
20539         * cs-tokenizer.cs: Reimplemented Location to be a struct with a
20540         single integer which is really efficient
20541
20542 2001-10-01  Ravi Pratap  <ravi@ximian.com>
20543
20544         *  expression.cs (Expression::ImplicitUserConversion): Use location
20545         even in the case when we are examining True operators.
20546  
20547         * class.cs (Operator::Define): Perform extensive checks to conform
20548         with the rules for operator overloading in the spec.
20549
20550         * expression.cs (Expression::ImplicitReferenceConversion): Implement
20551         some of the other conversions mentioned in the spec.
20552
20553         * typemanager.cs (array_type): New static member for the System.Array built-in
20554         type.
20555
20556         (cloneable_interface): For System.ICloneable interface.
20557
20558         * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
20559         we start resolving the tree and populating types.
20560
20561         * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
20562  
20563 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
20564
20565         * expression.cs (Expression::ExprClassFromMemberInfo,
20566         Expression::Literalize): Create literal expressions from
20567         FieldInfos which are literals.
20568
20569         (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
20570         type casts, because they were wrong.  The test suite in tests
20571         caught these ones.
20572
20573         (ImplicitNumericConversion): ushort to ulong requires a widening
20574         cast. 
20575
20576         Int32 constant to long requires widening cast as well.
20577
20578         * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
20579         for integers because the type on the stack is not i4.
20580
20581 2001-09-30  Miguel de Icaza  <miguel@ximian.com>
20582
20583         * expression.cs (report118): require location argument. 
20584
20585         * parameter.cs: Do not dereference potential null value.
20586
20587         * class.cs: Catch methods that lack the `new' keyword when
20588         overriding a name.  Report warnings when `new' is used without
20589         anything being there to override.
20590
20591         * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
20592
20593         * class.cs: Only add constructor to hashtable if it is non-null
20594         (as now constructors can fail on define).
20595
20596         (TypeManager, Class, Struct): Take location arguments.
20597
20598         Catch field instance initialization in structs as errors.
20599
20600         accepting_filter: a new filter for FindMembers that is static so
20601         that we dont create an instance per invocation.
20602
20603         (Constructor::Define): Catch errors where a struct constructor is
20604         parameterless 
20605
20606         * cs-parser.jay: Pass location information for various new
20607         constructs. 
20608
20609         * delegate.cs (Delegate): take a location argument.
20610
20611         * driver.cs: Do not call EmitCode if there were problesm in the
20612         Definition of the types, as many Builders wont be there. 
20613
20614         * decl.cs (Decl::Decl): Require a location argument.
20615
20616         * cs-tokenizer.cs: Handle properly hex constants that can not fit
20617         into integers, and find the most appropiate integer for it.
20618
20619         * literal.cs: Implement ULongLiteral.
20620
20621         * rootcontext.cs: Provide better information about the location of
20622         failure when CreateType fails.
20623
20624 2001-09-29  Miguel de Icaza  <miguel@ximian.com>
20625
20626         * rootcontext.cs (RootContext::PopulateTypes): Populates structs
20627         as well.
20628
20629         * expression.cs (Binary::CheckShiftArguments): Add missing type
20630         computation.
20631         (Binary::ResolveOperator): Add type to the logical and and logical
20632         or, Bitwise And/Or and Exclusive Or code paths, it was missing
20633         before.
20634
20635         (Binary::DoNumericPromotions): In the case where either argument
20636         is ulong (and most signed types combined with ulong cause an
20637         error) perform implicit integer constant conversions as well.
20638
20639 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
20640
20641         * expression.cs (UserImplicitCast): Method should always be
20642         non-null. 
20643         (Invocation::BetterConversion): Simplified test for IntLiteral.
20644
20645         (Expression::ImplicitNumericConversion): Split this routine out.
20646         Put the code that performs implicit constant integer conversions
20647         here. 
20648
20649         (Expression::Resolve): Become a wrapper around DoResolve so we can
20650         check eclass and type being set after resolve.
20651
20652         (Invocation::Badness): Remove this dead function
20653
20654         (Binary::ResolveOperator): Do not compute the expensive argumnets
20655         unless we have a union for it.
20656
20657         (Probe::Emit): Is needs to do an isinst and then
20658         compare against null.
20659
20660         (::CanConvert): Added Location argument.  If the Location argument
20661         is null (Location.Null), then we do not report errors.  This is
20662         used by the `probe' mechanism of the Explicit conversion.  We do
20663         not want to generate an error for something that the user
20664         explicitly requested to be casted.  But the pipeline for an
20665         explicit cast first tests for potential implicit casts.
20666
20667         So for now, if the Location is null, it means `Probe only' to
20668         avoid adding another argument.   Might have to revise this
20669         strategy later.
20670
20671         (ClassCast): New class used to type cast objects into arbitrary
20672         classes (used in Explicit Reference Conversions).
20673
20674         Implement `as' as well.
20675
20676         Reverted all the patches from Ravi below: they were broken:
20677
20678                 * The use of `level' as a mechanism to stop recursive
20679                   invocations is wrong.  That was there just to catch the
20680                   bug with a strack trace but not as a way of addressing
20681                   the problem.
20682
20683                   To fix the problem we have to *understand* what is going
20684                   on and the interactions and come up with a plan, not
20685                   just get things going.
20686
20687                 * The use of the type conversion cache that I proposed
20688                   last night had an open topic: How does this work across
20689                   protection domains.  A user defined conversion might not
20690                   be public in the location where we are applying the
20691                   conversion, a different conversion might be selected
20692                   (ie, private A->B (better) but public B->A (worse),
20693                   inside A, A->B applies, but outside it, B->A will
20694                   apply).
20695
20696                 * On top of that (ie, even if the above is solved),
20697                   conversions in a cache need to be abstract.  Ie, `To
20698                   convert from an Int to a Short use an OpcodeCast', not
20699                   `To convert from an Int to a Short use the OpcodeCast on
20700                   the variable 5' (which is what this patch was doing).
20701
20702 2001-09-28  Ravi Pratap  <ravi@ximian.com>
20703
20704         * expression.cs (Invocation::ConversionExists): Re-write to use
20705         the conversion cache
20706
20707         (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
20708         cache all conversions done, not just user-defined ones.
20709
20710         (Invocation::BetterConversion): The real culprit. Use ConversionExists
20711         to determine if a conversion exists instead of acutually trying to 
20712         perform the conversion. It's faster too.
20713
20714         (Expression::ConvertExplicit): Modify to use ConversionExists to check
20715         and only then attempt the implicit conversion.
20716
20717 2001-09-28  Ravi Pratap  <ravi@ximian.com>
20718
20719         * expression.cs (ConvertImplicit): Use a cache for conversions
20720         already found. Check level of recursion and bail out if necessary.
20721
20722 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
20723
20724         * typemanager.cs (string_concat_string_string, string_concat_object_object):
20725         Export standard methods that we expect for string operations.
20726
20727         * statement.cs (Block::UsageWarning): Track usage of variables and
20728         report the errors for not used variables.
20729
20730         * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
20731         operator. 
20732
20733 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
20734
20735         * codegen.cs: remove unnneded code 
20736
20737         * expression.cs: Removed BuiltinTypeAccess class
20738
20739         Fix the order in which implicit conversions are
20740         done.  
20741
20742         The previous fixed dropped support for boxed conversions (adding a
20743         test to the test suite now)
20744
20745         (UserImplicitCast::CanConvert): Remove test for source being null,
20746         that code is broken.  We should not feed a null to begin with, if
20747         we do, then we should track the bug where the problem originates
20748         and not try to cover it up here.
20749
20750         Return a resolved expression of type UserImplicitCast on success
20751         rather than true/false.  Ravi: this is what I was talking about,
20752         the pattern is to use a static method as a "constructor" for
20753         objects. 
20754
20755         Also, do not create arguments until the very last minute,
20756         otherwise we always create the arguments even for lookups that
20757         will never be performed. 
20758
20759         (UserImplicitCast::Resolve): Eliminate, objects of type
20760         UserImplicitCast are born in a fully resolved state. 
20761
20762         * typemanager.cs (InitCoreTypes): Init also value_type
20763         (System.ValueType). 
20764
20765         * expression.cs (Cast::Resolve): First resolve the child expression.
20766
20767         (LValue): Add new method AddressOf to be used by
20768         the `&' operator.  
20769
20770         Change the argument of Store to take an EmitContext instead of an
20771         ILGenerator, because things like FieldExpr need to be able to call
20772         their children expression to generate the instance code. 
20773
20774         (Expression::Error, Expression::Warning): Sugar functions for
20775         reporting errors.
20776
20777         (Expression::MemberLookup): Accept a TypeContainer instead of a
20778         Report as the first argument.
20779
20780         (Expression::ResolvePrimary): Killed.  I still want to improve
20781         this as currently the code is just not right.
20782
20783         (Expression::ResolveMemberAccess): Simplify, but it is still
20784         wrong. 
20785
20786         (Unary::Resolve): Catch errors in AddressOf operators.
20787
20788         (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
20789         index to a byte for the short-version, or the compiler will choose
20790         the wrong Emit call, which generates the wrong data.
20791
20792         (ParameterReference::Emit, ::Store): same.
20793
20794         (FieldExpr::AddressOf): Implement.
20795
20796         * typemanager.cs: TypeManager: made public variable instead of
20797         property.
20798
20799         * driver.cs: document --fatal.
20800
20801         * report.cs (ErrorMessage, WarningMessage): new names for the old
20802         Error and Warning classes.
20803
20804         * cs-parser.jay (member_access): Turn built-in access to types
20805         into a normal simplename
20806
20807 2001-09-27  Ravi Pratap  <ravi@ximian.com>
20808
20809         * expression.cs (Invocation::BetterConversion): Fix to cope
20810         with q being null, since this was introducing a bug.
20811
20812         * expression.cs (ConvertImplicit): Do built-in conversions first.
20813
20814 2001-09-27  Ravi Pratap  <ravi@ximian.com>
20815
20816         * expression.cs (UserImplicitCast::Resolve): Fix bug.
20817
20818 2001-09-27  Ravi Pratap  <ravi@ximian.com>
20819
20820         * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
20821         I had introduced long ago (what's new ?).
20822
20823         * expression.cs (UserImplicitCast::CanConvert): Static method to do 
20824         the work of all the checking. 
20825         (ConvertImplicit): Call CanConvert and only then create object if necessary.
20826         (UserImplicitCast::CanConvert, ::Resolve): Re-write.
20827
20828         (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
20829         that is the right way. 
20830
20831         (Invocation::MakeUnionSet): Convenience function to make unions of sets for 
20832         overloading resolution. Use everywhere instead of cutting and pasting code.
20833
20834         (Binary::ResolveOperator): Use MakeUnionSet.
20835
20836         (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when 
20837         we have to convert to bool types. Not complete yet.
20838
20839 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
20840
20841         * typemanager.cs (TypeManager::CSharpName): support ushort.
20842
20843         * expression.cs (Expression::TryImplicitIntConversion): Attempts
20844         to provide an expression that performsn an implicit constant int
20845         conversion (section 6.1.6).
20846         (Expression::ConvertImplicitRequired): Reworked to include
20847         implicit constant expression conversions.
20848
20849         (Expression::ConvertNumericExplicit): Finished.
20850
20851         (Invocation::Emit): If InstanceExpression is null, then it means
20852         that we perform a call on this.
20853
20854 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
20855
20856         * expression.cs (Unary::Emit): Remove some dead code.
20857         (Probe): Implement Resolve and Emit for `is'.
20858         (Expression::ConvertImplicitRequired): Attempt to do constant
20859         expression conversions here.  Maybe should be moved to
20860         ConvertImplicit, but I am not sure.
20861         (Expression::ImplicitLongConstantConversionPossible,
20862         Expression::ImplicitIntConstantConversionPossible): New functions
20863         that tell whether is it possible to apply an implicit constant
20864         expression conversion.
20865
20866         (ConvertNumericExplicit): Started work on explicit numeric
20867         conversions.
20868
20869         * cs-parser.jay: Update operator constants.
20870
20871         * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
20872         (Parameters::GetSignature): Hook up VerifyArgs here.
20873         (Parameters::VerifyArgs): Verifies that no two arguments have the
20874         same name. 
20875
20876         * class.cs (Operator): Update the operator names to reflect the
20877         ones that the spec expects (as we are just stringizing the
20878         operator names).
20879
20880         * expression.cs (Unary::ResolveOperator): Fix bug: Use
20881         MethodInfo's ReturnType instead of LookupMethodByBuilder as the
20882         previous usage did only work for our methods.
20883         (Expression::ConvertImplicit): Handle decimal implicit numeric
20884         conversions as well.
20885         (Expression::InternalTypeConstructor): Used to invoke constructors
20886         on internal types for default promotions.
20887
20888         (Unary::Emit): Implement special handling for the pre/post
20889         increment/decrement for overloaded operators, as they need to have
20890         the same semantics as the other operators.
20891
20892         (Binary::ResolveOperator): ditto.
20893         (Invocation::ConversionExists): ditto.
20894         (UserImplicitCast::Resolve): ditto.
20895
20896 2001-09-26  Ravi Pratap  <ravi@ximian.com>
20897
20898         * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
20899         operator, return after emitting body. Regression tests pass again !
20900
20901         * expression.cs (ConvertImplicit): Take TypeContainer as first argument
20902         (Unary::ForceConversion, Binary::ForceConversion): Ditto.
20903         (Invocation::OverloadResolve): Ditto.
20904         (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
20905
20906         * everywhere : update calls to the above methods accordingly.
20907
20908 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
20909
20910         * assign.cs (Assign): Make it inherit from ExpressionStatement.
20911
20912         * expression.cs (ExpressionStatement): New base class used for
20913         expressions that can appear in statements, so that we can provide
20914         an alternate path to generate expression that do not leave a value
20915         on the stack.
20916
20917         (Expression::Emit, and all the derivatives): We no longer return
20918         whether a value is left on the stack or not.  Every expression
20919         after being emitted leaves a single value on the stack.
20920
20921         * codegen.cs (EmitContext::EmitStatementExpression): Use the
20922         facilties of ExpressionStatement if possible.
20923
20924         * cs-parser.jay: Update statement_expression.
20925
20926 2001-09-25  Miguel de Icaza  <miguel@ximian.com>
20927
20928         * driver.cs: Change the wording of message
20929
20930 2001-09-25  Ravi Pratap  <ravi@ximian.com>
20931
20932         * expression.cs (Binary::ResolveOperator): Had forgottten to set 
20933         the type of the expression to the return type of the method if
20934         we have an overloaded operator match ! The regression tests pass again !
20935         (Unary::ResolveOperator): Ditto.
20936
20937         * expression.cs (Invocation::ConversionExists): Correct the member lookup
20938         to find "op_Implicit", not "implicit" ;-)
20939         (UserImplicitCast): New class to take care of user-defined implicit conversions.
20940         (ConvertImplicit, ForceConversion): Take TypeContainer argument
20941
20942         * everywhere : Correct calls to the above accordingly.
20943
20944         * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
20945         (ConvertImplicit): Do user-defined conversion if it exists.
20946
20947 2001-09-24  Miguel de Icaza  <miguel@ximian.com>
20948
20949         * assign.cs: track location.
20950         (Resolve): Use implicit conversions on assignment.
20951
20952         * literal.cs: Oops.  Not good, Emit of short access values should
20953         pass (Bytes) or the wrong argument will be selected.
20954
20955         * expression.cs (Unary::Emit): Emit code for -expr.
20956
20957         (Unary::ResolveOperator): Handle `Substract' for non-constants
20958         (substract from zero from the non-constants).
20959         Deal with Doubles as well. 
20960
20961         (Expression::ConvertImplicitRequired): New routine that reports an
20962         error if no implicit conversion exists. 
20963
20964         (Invocation::OverloadResolve): Store the converted implicit
20965         expressions if we make them
20966
20967 2001-09-24  Ravi Pratap  <ravi@ximian.com>
20968
20969         * class.cs (ConstructorInitializer): Take a Location argument.
20970         (ConstructorBaseInitializer): Same here.
20971         (ConstructorThisInitializer): Same here.
20972
20973         * cs-parser.jay : Update all calls accordingly.
20974
20975         * expression.cs (Unary, Binary, New): Take location argument.
20976         Update accordingly everywhere.
20977
20978         * cs-parser.jay : Update all calls to the above to take a location
20979         argument.
20980
20981         * class.cs : Ditto.
20982
20983 2001-09-24  Ravi Pratap  <ravi@ximian.com>
20984
20985         * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
20986         (Invocation::BetterConversion): Same here
20987         (Invocation::ConversionExists): Ditto.
20988
20989         (Invocation::ConversionExists): Implement.
20990
20991 2001-09-22  Ravi Pratap  <ravi@ximian.com>
20992
20993         * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
20994         Also take an additional TypeContainer argument.
20995
20996         * All over : Pass in TypeContainer as argument to OverloadResolve.
20997
20998         * typemanager.cs (CSharpName): Update to check for the string type and return
20999         that too.
21000
21001         * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
21002         a given method.
21003
21004 2001-09-21  Ravi Pratap  <ravi@ximian.com>
21005
21006         * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
21007         (Invocation::BetterFunction): Implement.
21008         (Invocation::BetterConversion): Implement.
21009         (Invocation::ConversionExists): Skeleton, no implementation yet.
21010
21011         Okay, things work fine !
21012
21013 2001-09-21  Miguel de Icaza  <miguel@ximian.com>
21014
21015         * typemanager.cs: declare and load enum_type, delegate_type and
21016         void_type. 
21017
21018         * expression.cs (Expression::Emit): Now emit returns a value that
21019         tells whether a value is left on the stack or not.  This strategy
21020         might be reveted tomorrow with a mechanism that would address
21021         multiple assignments.
21022         (Expression::report118): Utility routine to report mismatches on
21023         the ExprClass.
21024
21025         (Unary::Report23): Report impossible type/operator combination
21026         utility function.
21027
21028         (Unary::IsIncrementableNumber): Whether the type can be
21029         incremented or decremented with add.
21030         (Unary::ResolveOperator): Also allow enumerations to be bitwise
21031         complemented. 
21032         (Unary::ResolveOperator): Implement ++, !, ~,
21033
21034         (Invocation::Emit): Deal with new Emit convetion.
21035
21036         * All Expression derivatives: Updated their Emit method to return
21037         whether they leave values on the stack or not.
21038
21039         * codegen.cs (CodeGen::EmitStatement): Pop values left on the
21040         stack for expressions that are statements. 
21041
21042 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
21043
21044         * expression.cs (LValue): New interface.  Must be implemented by
21045         LValue objects.
21046         (LocalVariableReference, ParameterReference, FieldExpr): Implement
21047         LValue interface.
21048
21049         * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
21050         interface for generating code, simplifies the code.
21051
21052 2001-09-20  Ravi Pratap  <ravi@ximian.com>
21053
21054         * expression.cs (everywhere): Comment out return statements in ::Resolve
21055         methods to avoid the warnings.
21056
21057 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
21058
21059         * driver.cs (parse): Report error 2001 if we can not open the
21060         source file.
21061
21062         * expression.cs (SimpleName::ResolveSimpleName): Error if we can
21063         not resolve it.
21064
21065         * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
21066         object. 
21067
21068         * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
21069         otherwise nested blocks end up with the same index.
21070
21071         * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
21072
21073         * expression.cs:  Instead of having FIXMEs in the Resolve
21074         functions, throw exceptions so it is obvious that we are facing a
21075         bug. 
21076
21077         * cs-parser.jay (invocation_expression): Pass Location information.
21078
21079         * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
21080         Use a basename for those routines because .NET does not like paths
21081         on them. 
21082
21083         * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
21084         already defined.
21085
21086 2001-09-19  Miguel de Icaza  <miguel@ximian.com>
21087
21088         * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
21089         are loading the correct data types (throws an exception if not).
21090         (TypeManager::InitCoreTypes): Use CoreLookupType
21091
21092         * expression.cs (Unary::ResolveOperator): return the child
21093         expression for expressions which are just +expr.
21094         (Unary::ResolveOperator): Return negative literals for -LITERAL
21095         expressions (otherwise they are Unary {Literal}).
21096         (Invocation::Badness): Take into account `Implicit constant
21097         expression conversions'.
21098
21099         * literal.cs (LongLiteral): Implement long literal class.
21100         (IntLiteral): export the `Value' of the intliteral. 
21101
21102 2001-09-19  Ravi Pratap  <ravi@ximian.com>
21103
21104         * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
21105
21106         * class.cs (Operator::Define): Change the methodname prefix to 'op_' 
21107         instead of 'Operator'
21108
21109         * expression.cs (Binary::ResolveOperator): Update accordingly.
21110         (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
21111         and 'Minus'
21112
21113         * cs-parser.jay (unary_expression): Update to use the new names.
21114
21115         * gen-treedump.cs (GetUnary): Same here.
21116
21117         * expression.cs (Unary::Resolve): Implement.
21118         (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded 
21119         operators are found instead of making noise ;-)
21120         (Unary::ResolveOperator): New method to do precisely the same thing which
21121         Binary::ResolveOperator does for Binary expressions.
21122         (Unary.method, .Arguments): Add.
21123         (Unary::OperName): Implement.   
21124         (Unary::ForceConversion): Copy and Paste !
21125
21126         * class.cs (Operator::Define): Fix a small bug for the case when we have 
21127         a unary operator.
21128
21129         * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
21130         for the inbuilt operators. Only overloading works for now ;-)
21131
21132 2001-09-18  Miguel de Icaza  <miguel@ximian.com>
21133
21134         * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
21135         UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
21136
21137         * expression.cs (This::Emit): Implement. 
21138         (This::Resolve): Implement.
21139         (TypeOf:Resolve): Implement.
21140         (Expression::ResolveSimpleName): Add an implicit this to instance
21141         field references. 
21142         (MemberAccess::Resolve): Deal with Parameters and Fields. 
21143         Bind instance variable to Field expressions.
21144         (FieldExpr::Instance): New field used to track the expression that
21145         represents the object instance.
21146         (FieldExpr::Resolve): Track potential errors from MemberLookup not
21147         binding 
21148         (FieldExpr::Emit): Implement.
21149
21150         * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
21151         the last instruction contains a return opcode to avoid generating
21152         the last `ret' instruction (this generates correct code, and it is
21153         nice to pass the peverify output).
21154
21155         * class.cs (TypeContainer::EmitFieldInitializers): Implement field
21156         initializer for static and instance variables.
21157         (Constructor::Emit): Allow initializer to be null in the case of
21158         static constructors.  Only emit initializer for instance
21159         constructors. 
21160
21161         (TypeContainer::FindMembers): Return a null array if there are no
21162         matches.
21163
21164         Also fix the code for the MemberTypes.Method branch, as it was not
21165         scanning that for operators (or tried to access null variables before).
21166
21167         * assign.cs (Assign::Emit): Handle instance and static fields. 
21168
21169         * TODO: Updated.
21170
21171         * driver.cs: Stop compilation if there are parse errors.
21172
21173         * cs-parser.jay (constructor_declaration): Provide default base
21174         initializer for non-static constructors.
21175         (constructor_declarator): Do not provide a default base
21176         initializers if none was specified.
21177         Catch the fact that constructors should not have parameters.
21178
21179         * class.cs: Do not emit parent class initializers for static
21180         constructors, that should be flagged as an error.
21181
21182 2001-09-18  Ravi Pratap  <ravi@ximian.com>
21183
21184         * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
21185         Move back code into TypeContainer::Populate.
21186
21187 2001-09-18  Ravi Pratap  <ravi@ximian.com>
21188
21189         * class.cs (TypeContainer::AddConstructor): Fix the check to
21190         compare against Name, not Basename. 
21191         (Operator::OpType): Change Plus and Minus to Add and Subtract.
21192
21193         * cs-parser.jay : Update accordingly.
21194
21195         * class.cs (TypeContainer::FindMembers): For the case where we are searching
21196         for methods, don't forget to look into the operators too.
21197         (RegisterMethodBuilder): Helper method to take care of this for
21198         methods, constructors and operators.
21199         (Operator::Define): Completely revamp.
21200         (Operator.OperatorMethod, MethodName): New fields.
21201         (TypeContainer::Populate): Move the registering of builders into
21202         RegisterMethodBuilder.
21203         (Operator::Emit): Re-write.
21204
21205         * expression.cs (Binary::Emit): Comment out code path to emit method
21206         invocation stuff for the case when we have a user defined operator. I am
21207         just not able to get it right !
21208
21209 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
21210
21211         * expression.cs (Expression::OverloadResolve): Drop TypeContainer
21212         argument. 
21213
21214         (Expression::MemberLookup): Provide a version that allows to
21215         specify the MemberTypes and BindingFlags. 
21216
21217         * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
21218         so it was not fetching variable information from outer blocks.
21219
21220         * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
21221         Beforefieldinit as it was buggy.
21222
21223         * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
21224         that Ravi put here.  
21225
21226         * class.cs (Constructor::Emit): Only emit if block is not null.
21227         (TypeContainer::EmitDefaultConstructor): Removed routine, now we
21228         deal with this by semantically definining it as if the user had
21229         done it.
21230
21231         (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
21232         constructors as we now "emit" them at a higher level.
21233
21234         (TypeContainer::DefineDefaultConstructor): Used to define the
21235         default constructors if none was provided.
21236
21237         (ConstructorInitializer): Add methods Resolve and Emit. 
21238
21239         * expression.cs: Cast to ConstructorInfo instead of MethodInfo
21240
21241 2001-09-17  Ravi Pratap  <ravi@ximian.com>
21242
21243         * class.cs (TypeContainer::EmitDefaultConstructor): Register
21244         the default constructor builder with our hashtable for methodbuilders
21245         to methodcores.
21246
21247         * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
21248         and argument_count is 0 in which case we have a match.
21249         (Binary::ResolveOperator): More null checking and miscellaneous coding
21250         style cleanup.
21251
21252 2001-09-17  Ravi Pratap  <ravi@ximian.com>
21253
21254         * rootcontext.cs (IsNameSpace): Compare against null.
21255
21256         * everywhere : Correct spelling to 'Greater' and to 'Subtract'
21257
21258         * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
21259         and Unary::Operator.
21260
21261         * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
21262         accordingly.
21263
21264         * expression.cs (Binary::method): New member to hold the MethodBase for the case when
21265         we have overloaded operators.
21266         (Binary::ResolveOperator): Implement the part which does the operator overload
21267         resolution.
21268
21269         * class.cs (Operator::Emit): Implement.
21270         (TypeContainer::Emit): Emit the operators we have too.
21271
21272         * expression.cs (Binary::Emit): Update to emit the appropriate code for
21273         the case when we have a user-defined operator.
21274
21275 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
21276
21277         * rootcontext.cs: Fix bug: tree.Namespaces might be null.
21278
21279 2001-09-16  Ravi Pratap  <ravi@ximian.com>
21280
21281         * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
21282         (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
21283         (Constructor::Emit): Implement.
21284         (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
21285         if we have no work to do. 
21286         (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's 
21287         Emit method.
21288
21289         * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
21290         (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
21291
21292         * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
21293         of parent.parent.
21294
21295 2001-09-15  Ravi Pratap  <ravi@ximian.com>
21296
21297         * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
21298         in the source.
21299         (Tree::RecordNamespace): Method to do what the name says ;-)
21300         (Tree::Namespaces): Property to get at the namespaces hashtable.
21301
21302         * cs-parser.jay (namespace_declaration): Call RecordNamespace to 
21303         keep track.
21304
21305         * rootcontext.cs (IsNamespace): Fixed it :-)
21306
21307 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
21308
21309         * class.cs (TypeContainer::FindMembers): Add support for
21310         constructors. 
21311         (MethodCore): New class that encapsulates both the shared aspects
21312         of a Constructor and a Method.  
21313         (Method, Constructor): Factored pieces into MethodCore.
21314
21315         * driver.cs: Added --fatal which makes errors throw exceptions.
21316         Load System assembly as well as part of the standard library.
21317
21318         * report.cs: Allow throwing exceptions on errors for debugging.
21319
21320         * modifiers.cs: Do not use `parent', instead use the real type
21321         container to evaluate permission settings.
21322
21323         * class.cs: Put Ravi's patch back in.  He is right, and we will
21324         have to cope with the
21325
21326 2001-09-14  Ravi Pratap  <ravi@ximian.com>
21327
21328         * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
21329         FamORAssem, not FamANDAssem.
21330
21331 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
21332
21333         * driver.cs: Added --parse option that only parses its input files
21334         and terminates.
21335
21336         * class.cs: Reverted last change from Ravi to IsTopLevel.  That is
21337         incorrect.  IsTopLevel is not used to tell whether an object is
21338         root_types or not (that can be achieved by testing this ==
21339         root_types).  But to see if this is a top-level *class* (not
21340         necessarly our "toplevel" container). 
21341
21342 2001-09-14  Ravi Pratap  <ravi@ximian.com>
21343
21344         * enum.cs (Enum::Define): Modify to call the Lookup method on the
21345         parent instead of a direct call to GetType.
21346
21347 2001-09-14  Ravi Pratap  <ravi@ximian.com>
21348
21349         * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
21350         Modifiers.TypeAttr. This should just be a call to that method.
21351
21352         * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
21353         object so that we can determine if we are top-level or not.
21354
21355         * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the 
21356         TypeContainer too.
21357
21358         * enum.cs (Enum::Define): Ditto.
21359
21360         * modifiers.cs (FieldAttr): Re-write.
21361
21362         * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
21363         (TypeContainer::HaveStaticConstructor): New property to provide access
21364         to precisely that info.
21365
21366         * modifiers.cs (MethodAttr): Re-write.
21367         (EventAttr): Remove altogether as there seems to be no ostensible use for it.
21368
21369         * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
21370         of top-level types as claimed.
21371
21372 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
21373
21374         * expression.cs (MemberLookup): Fruitless attempt to lookup
21375         constructors.  Maybe I need to emit default constructors?  That
21376         might be it (currently .NET emits this for me automatically).
21377         (Invocation::OverloadResolve): Cope with Arguments == null.
21378         (Invocation::EmitArguments): new function, shared by the new
21379         constructor and us.
21380         (Invocation::Emit): Handle static and instance methods.  Emit
21381         proper call instruction for virtual or non-virtual invocations.
21382         (New::Emit): Implement.
21383         (New::Resolve): Implement.
21384         (MemberAccess:Resolve): Implement.
21385         (MethodGroupExpr::InstanceExpression): used conforming to the spec
21386         to track instances.
21387         (FieldExpr::Resolve): Set type.
21388
21389         * support.cs: Handle empty arguments.
21390                 
21391         * cs-parser.jay (CompositeLookup, QualifierIdentifier,
21392         SimpleLookup): Auxiliary routines to help parse a qualifier
21393         identifier.  
21394
21395         Update qualifier_identifier rule.
21396
21397         * codegen.cs: Removed debugging messages.
21398
21399         * class.cs: Make this a global thing, this acts just as a "key" to
21400         objects that we might have around.
21401
21402         (Populate): Only initialize method_builders_to_methods once.
21403
21404         * expression.cs (PropertyExpr): Initialize type from the
21405         PropertyType. 
21406
21407         * codegen.cs (EmitContext::EmitBoolExpression): Use propper
21408         Resolve pattern.  Attempt to implicitly convert value to boolean.
21409         Emit code.
21410
21411         * expression.cs: Set the type for the int32/int32 argument case.
21412         (Binary::ResolveOperator): Set the return type to boolean for
21413         comparission operators
21414
21415         * typemanager.cs: Remove debugging print code.
21416
21417         (Invocation::Resolve): resolve type.
21418
21419         * class.cs: Allocate a MemberInfo of the correct size, as the code
21420         elsewhere depends on the test to reflect the correct contents.
21421
21422         (Method::) Keep track of parameters, due to System.Reflection holes
21423
21424         (TypeContainer::Populate): Keep track of MethodBuilders to Method
21425         mapping here.
21426
21427         (TypeContainer::FindMembers): Use ArrayList and then copy an array
21428         of the exact size and return that.
21429
21430         (Class::LookupMethodByBuilder): New function that maps
21431         MethodBuilders to its methods.  Required to locate the information
21432         on methods because System.Reflection bit us again.
21433
21434         * support.cs: New file, contains an interface ParameterData and
21435         two implementations: ReflectionParameters and InternalParameters
21436         used to access Parameter information.  We will need to grow this
21437         as required.
21438
21439         * expression.cs (Invocation::GetParameterData): implement a cache
21440         and a wrapper around the ParameterData creation for methods. 
21441         (Invocation::OverloadResolve): Use new code.
21442
21443 2001-09-13  Ravi Pratap  <ravi@ximian.com>
21444
21445         * class.cs (TypeContainer::EmitField): Remove and move into 
21446         (Field::Define): here and modify accordingly.
21447         (Field.FieldBuilder): New member.
21448         (TypeContainer::Populate): Update accordingly.
21449         (TypeContainer::FindMembers): Implement.
21450
21451 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
21452
21453         * statement.cs: (VariableInfo::VariableType): New field to be
21454         initialized with the full type once it is resolved. 
21455
21456 2001-09-12  Miguel de Icaza  <miguel@ximian.com>
21457
21458         * parameter.cs (GetParameterInfo): Use a type cache to compute
21459         things only once, and to reuse this information
21460
21461         * expression.cs (LocalVariableReference::Emit): Implement.
21462         (OpcodeCast::Emit): fix.
21463
21464         (ParameterReference::Resolve): Implement.
21465         (ParameterReference::Emit): Implement.
21466
21467         * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
21468         that are expressions need to stay as Expressions.
21469
21470         * typemanager.cs (CSharpName): Returns the C# name of a type if
21471         possible. 
21472
21473         * expression.cs (Expression::ConvertImplicit): New function that
21474         implements implicit type conversions.
21475
21476         (Expression::ImplicitReferenceConversion): Implements implicit
21477         reference conversions.
21478
21479         (EmptyCast): New type for transparent casts.
21480
21481         (OpcodeCast): New type for casts of types that are performed with
21482         a sequence of bytecodes.
21483
21484         (BoxedCast): New type used for casting value types into reference
21485         types.  Emits a box opcode.
21486
21487         (Binary::DoNumericPromotions): Implements numeric promotions of
21488         and computation of the Binary::Type.
21489
21490         (Binary::EmitBranchable): Optimization.
21491
21492         (Binary::Emit): Implement code emission for expressions.
21493
21494         * typemanager.cs (TypeManager): Added two new core types: sbyte
21495         and byte.
21496
21497 2001-09-12  Ravi Pratap  <ravi@ximian.com>
21498
21499         * class.cs (TypeContainer::FindMembers): Method which does exactly
21500         what Type.FindMembers does, only we don't have to use reflection. No
21501         implementation yet.
21502
21503         * typemanager.cs (typecontainers): New hashtable to hold the corresponding
21504         typecontainer objects as we need to get at them.
21505         (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
21506
21507         * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
21508         typecontainer object.
21509
21510         * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
21511         of just a Report object.
21512
21513 2001-09-11  Ravi Pratap  <ravi@ximian.com>
21514
21515         * class.cs (Event::Define): Go back to using the prefixes "add_" and
21516         "remove_"
21517         (TypeContainer::Populate): Now define the delegates of the type too.
21518         (TypeContainer.Delegates): Property to access the list of delegates defined
21519         in the type.
21520
21521         * delegates.cs (Delegate::Define): Implement partially.
21522
21523         * modifiers.cs (TypeAttr): Handle more flags.
21524
21525 2001-09-11  Ravi Pratap  <ravi@ximian.com>
21526
21527         * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
21528         and not <=
21529         (Operator::Define): Re-write logic to get types by using the LookupType method
21530         instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
21531         (Indexer::Define): Ditto.
21532         (Event::Define): Ditto.
21533         (Property::Define): Ditto.
21534
21535 2001-09-10  Ravi Pratap  <ravi@ximian.com>
21536
21537         * class.cs (TypeContainer::Populate): Now define operators too. 
21538         (TypeContainer.Operators): New property to access the list of operators
21539         in a type.
21540         (Operator.OperatorMethodBuilder): New member to hold the method builder
21541         for the operator we are defining.
21542         (Operator::Define): Implement.
21543
21544 2001-09-10  Ravi Pratap  <ravi@ximian.com>
21545
21546         * class.cs (Event::Define): Make the prefixes of the accessor methods
21547         addOn_ and removeOn_ 
21548
21549         * genericparser.cs (GenericParser::error): Overloaded method to handle the case
21550         of the location being passed in too. Ideally, this should go later since all
21551         error reporting should be done through the Report object.
21552
21553         * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
21554         (Populate): Iterate thru the indexers we have and define them too.
21555         (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
21556         for the get and set accessors.
21557         (Indexer::Define): Implement.
21558
21559 2001-09-09  Miguel de Icaza  <miguel@ximian.com>
21560
21561         * expression.cs (Binary::Resolve): Beginning of it.  I scratched
21562         my previous implementation, did not work.
21563
21564         * typemanager.cs: Add a couple of missing types (the longs).
21565
21566         * literal.cs: Use TypeManager.bool_type instead of getting it.
21567
21568         * expression.cs (EventExpr): New kind of expressions.
21569         (Expressio::ExprClassFromMemberInfo): finish
21570
21571 2001-09-08  Miguel de Icaza  <miguel@ximian.com>
21572
21573         * assign.cs: Emit stores to static fields differently.
21574
21575 2001-09-08  Ravi Pratap  <ravi@ximian.com>
21576
21577         * Merge in changes and adjust code to tackle conflicts. Backed out my
21578         code in Assign::Resolve ;-) 
21579
21580 2001-09-08  Ravi Pratap  <ravi@ximian.com>
21581
21582         * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
21583         instead Report.Error and also pass in the location.
21584         (CSharpParser::Lexer): New readonly property to return the reference
21585         to the Tokenizer object.
21586         (declare_local_variables): Use Report.Error with location instead of plain 
21587         old error.
21588         (CheckDef): Ditto.
21589
21590         * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
21591         (Operator.CheckBinaryOperator): Ditto.
21592
21593         * cs-parser.jay (operator_declarator): Update accordingly.
21594
21595         * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
21596         (CheckBinaryOperator): Same here.
21597
21598         * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
21599         on the name without any prefixes of namespace names etc. This is because we
21600         already might have something already fully qualified like 
21601         'System.Console.WriteLine'
21602
21603         * assign.cs (Resolve): Begin implementation. Stuck ;-)
21604
21605 2001-09-07  Ravi Pratap  <ravi@ximian.com>
21606
21607         * cs-tokenizer.cs (location): Return a string which also contains
21608         the file name.
21609
21610         * expression.cs (ElementAccess): New class for expressions of the
21611         type 'element access.'
21612         (BaseAccess): New class for expressions of the type 'base access.'
21613         (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
21614         respectively.
21615
21616         * cs-parser.jay (element_access): Implement action.
21617         (base_access): Implement actions.
21618         (checked_expression, unchecked_expression): Implement.
21619
21620         * cs-parser.jay (local_variable_type): Correct and implement.
21621         (type_suffixes, type_suffix_list, type_suffix): Implement actions.
21622
21623         * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
21624
21625         * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
21626         name and the specifiers.
21627
21628         * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
21629
21630         * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of 
21631         making them all public ;-)
21632
21633         * cs-parser.jay (error): Remove entirely as we have an implementation in the base
21634         class anyways.
21635
21636 2001-09-07  Miguel de Icaza  <miguel@ximian.com>
21637
21638         * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
21639         PropertyExprs.
21640         (FieldExpr, PropertyExprs): New resolved expressions.
21641         (SimpleName::MemberStaticCheck): Perform static checks for access
21642         to non-static fields on static methods. Maybe this should be
21643         generalized for MemberAccesses. 
21644         (SimpleName::ResolveSimpleName): More work on simple name
21645         resolution. 
21646
21647         * cs-parser.jay (primary_expression/qualified_identifier): track
21648         the parameter index.
21649
21650         * codegen.cs (CodeGen::Save): Catch save exception, report error.
21651         (EmitContext::EmitBoolExpression): Chain to expression generation
21652         instead of temporary hack.
21653         (::EmitStatementExpression): Put generic expression code generation.
21654
21655         * assign.cs (Assign::Emit): Implement variable assignments to
21656         local variables, parameters and fields.
21657
21658 2001-09-06  Miguel de Icaza  <miguel@ximian.com>
21659
21660         * statement.cs (Block::GetVariableInfo): New method, returns the
21661         VariableInfo for a variable name in a block.
21662         (Block::GetVariableType): Implement in terms of GetVariableInfo
21663
21664         * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
21665         DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
21666
21667 2001-09-06  Ravi Pratap  <ravi@ximian.com>
21668
21669         * cs-parser.jay (operator_declaration): Continue on my quest : update
21670         to take attributes argument.
21671         (event_declaration): Ditto.
21672         (enum_declaration): Ditto.
21673         (indexer_declaration): Ditto.
21674
21675         * class.cs (Operator::Operator): Update constructor accordingly.
21676         (Event::Event): Ditto.
21677
21678         * delegate.cs (Delegate::Delegate): Same here.
21679
21680         * enum.cs (Enum::Enum): Same here.
21681
21682 2001-09-05  Ravi Pratap  <ravi@ximian.com>
21683
21684         * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
21685
21686         * ../tests/cs0658.cs : New file to demonstrate error 0658.
21687
21688         * attribute.cs (Attributes): New class to encapsulate all attributes which were
21689         being passed around as an arraylist.
21690         (Attributes::AddAttribute): Method to add attribute sections.
21691
21692         * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
21693         (struct_declaration): Update accordingly.
21694         (constant_declaration): Update.
21695         (field_declaration): Update.
21696         (method_header): Update.
21697         (fixed_parameter): Update.
21698         (parameter_array): Ditto.
21699         (property_declaration): Ditto.
21700         (destructor_declaration): Ditto.
21701
21702         * class.cs (Struct::Struct): Update constructors accordingly.
21703         (Class::Class): Ditto.
21704         (Field::Field): Ditto.
21705         (Method::Method): Ditto.
21706         (Property::Property): Ditto.
21707         (TypeContainer::OptAttribute): update property's return type.
21708
21709         * interface.cs (Interface.opt_attributes): New member.
21710         (Interface::Interface): Update to take the extra Attributes argument.
21711
21712         * parameter.cs (Parameter::Parameter): Ditto.
21713
21714         * constant.cs (Constant::Constant): Ditto.
21715
21716         * interface.cs (InterfaceMemberBase): New OptAttributes field.
21717         (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take 
21718         the attributes as a parameter.
21719         (InterfaceProperty): Update constructor call.
21720         (InterfaceEvent): Ditto.
21721         (InterfaceMethod): Ditto.
21722         (InterfaceIndexer): Ditto.
21723
21724         * cs-parser.jay (interface_indexer_declaration): Update call to constructor to 
21725         pass the attributes too.
21726         (interface_event_declaration): Ditto.
21727         (interface_property_declaration): Ditto.
21728         (interface_method_declaration): Ditto.
21729         (interface_declaration): Ditto.
21730
21731 2001-09-05  Miguel de Icaza  <miguel@ximian.com>
21732
21733         * class.cs (Method::Define): Track the "static Main" definition to
21734         create an entry point. 
21735
21736         * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
21737         EntryPoint if we find it. 
21738
21739         * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
21740         (EmitContext::ig): Make this variable public.
21741
21742         * driver.cs: Make the default output file be the first file name
21743         with the .exe extension.  
21744
21745         Detect empty compilations
21746
21747         Handle various kinds of output targets.  Handle --target and
21748         rename -t to --dumper.
21749
21750         * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
21751         methods inherited from Expression return now an Expression.  This
21752         will is used during the tree rewriting as we resolve them during
21753         semantic analysis.
21754
21755         (Expression::MemberLookup): Implements the MemberLookup (7.3) from
21756         the spec.  Missing entirely is the information about
21757         accessability of elements of it.
21758
21759         (Expression::ExprClassFromMemberInfo): New constructor for
21760         Expressions that creates a fully initialized Expression based on
21761         a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
21762         a Type.
21763
21764         (Invocation::Resolve): Begin implementing resolution of invocations.
21765
21766         * literal.cs (StringLiteral):  Implement Emit.
21767
21768 2001-09-05  Ravi Pratap  <ravi@ximian.com>
21769
21770         * cs-parser.jay (error): Add new modifier because we are hiding an inherited
21771         member.
21772
21773 2001-09-04  Ravi Pratap  <ravi@ximian.com>
21774
21775         * cs-parser.jay (attribute_arguments): Implement actions.
21776         (attribute): Fix bug in production. Implement action.
21777         (attribute_list): Implement.
21778         (attribute_target): Implement.
21779         (attribute_target_specifier, opt_target_specifier): Implement
21780         (CheckAttributeTarget): New method to check if the attribute target
21781         is valid.
21782         (attribute_section): Implement.
21783         (opt_attributes): Implement.
21784
21785         * attribute.cs : New file to handle attributes.
21786         (Attribute): Class to hold attribute info.
21787
21788         * cs-parser.jay (opt_attribute_target_specifier): Remove production
21789         (attribute_section): Modify production to use 2 different rules to 
21790         achieve the same thing. 1 s/r conflict down !
21791         Clean out commented, useless, non-reducing dimension_separator rules.
21792
21793         * class.cs (TypeContainer.attributes): New member to hold list
21794         of attributes for a type.
21795         (Struct::Struct): Modify to take one more argument, the attribute list.
21796         (Class::Class): Ditto.
21797         (Field::Field): Ditto.
21798         (Method::Method): Ditto.
21799         (Property::Property): Ditto.
21800
21801         * cs-parser.jay (struct_declaration): Update constructor call to
21802         pass in the attributes too.
21803         (class_declaration): Ditto.
21804         (constant_declaration): Ditto.
21805         (field_declaration): Ditto.
21806         (method_header): Ditto.
21807         (fixed_parameter): Ditto.
21808         (parameter_array): Ditto.
21809         (property_declaration): Ditto.
21810
21811         * constant.cs (Constant::Constant): Update constructor similarly.
21812         Use System.Collections.
21813
21814         * parameter.cs (Parameter::Parameter): Update as above.
21815
21816 2001-09-02  Ravi Pratap  <ravi@ximian.com>
21817
21818         * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
21819         (TypeContainer.delegates): New member to hold list of delegates.
21820
21821         * cs-parser.jay (delegate_declaration): Implement the action correctly 
21822         this time as I seem to be on crack ;-)
21823
21824 2001-09-02  Miguel de Icaza  <miguel@ximian.com>
21825
21826         * rootcontext.cs (RootContext::IsNamespace): new function, used to
21827         tell whether an identifier represents a namespace.
21828
21829         * expression.cs (NamespaceExpr): A namespace expression, used only
21830         temporarly during expression resolution.
21831         (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
21832         utility functions to resolve names on expressions.
21833
21834 2001-09-01  Miguel de Icaza  <miguel@ximian.com>
21835
21836         * codegen.cs: Add hook for StatementExpressions. 
21837
21838         * class.cs: Fix inverted test for static flag in methods.
21839
21840 2001-09-02  Ravi Pratap  <ravi@ximian.com>
21841
21842         * class.cs (Operator::CheckUnaryOperator): Correct error number used
21843         to make it coincide with MS' number.
21844         (Operator::CheckBinaryOperator): Ditto.
21845
21846         * ../errors/errors.txt : Remove error numbers added earlier.
21847
21848         * ../errors/cs1019.cs : Test case for error # 1019
21849
21850         * ../errros/cs1020.cs : Test case for error # 1020
21851
21852         * cs-parser.jay : Clean out commented cruft.
21853         (dimension_separators, dimension_separator): Comment out. Ostensibly not
21854         used anywhere - non-reducing rule.
21855         (namespace_declarations): Non-reducing rule - comment out.
21856
21857         * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
21858         with TypeContainer::AddEnum.
21859
21860         * delegate.cs : New file for delegate handling classes.
21861         (Delegate): Class for declaring delegates.
21862
21863         * makefile : Update.
21864
21865         * cs-parser.jay (delegate_declaration): Implement.
21866
21867 2001-09-01  Ravi Pratap  <ravi@che.iitm.ac.in>
21868
21869         * class.cs (Event::Define): Implement.
21870         (Event.EventBuilder): New member.
21871
21872         * class.cs (TypeContainer::Populate): Update to define all enums and events
21873         we have.
21874         (Events): New property for the events arraylist we hold. Shouldn't we move to using
21875         readonly fields for all these cases ?
21876
21877 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
21878
21879         * class.cs (Property): Revamp to use the convention of making fields readonly.
21880         Accordingly modify code elsewhere.
21881
21882         * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
21883         the Define method of the Property class.
21884
21885         * class.cs : Clean up applied patch and update references to variables etc. Fix 
21886         trivial bug.
21887         (TypeContainer::Populate): Update to define all the properties we have. Also
21888         define all enumerations.
21889
21890         * enum.cs (Define): Implement.
21891
21892 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
21893
21894         * cs-parser.jay (overloadable_operator): The semantic value is an
21895         enum of the Operator class.
21896         (operator_declarator): Implement actions.
21897         (operator_declaration): Implement.
21898
21899         * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
21900         validity of definitions.
21901         (Operator::CheckBinaryOperator): Static method to check for binary operators
21902         (TypeContainer::AddOperator): New method to add an operator to a type.
21903
21904         * cs-parser.jay (indexer_declaration): Added line to actually call the
21905         AddIndexer method so it gets added ;-)
21906
21907         * ../errors/errors.txt : Update to include new error numbers. Are these numbers 
21908         already taken care of by the MS compiler ?  
21909
21910 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
21911
21912         * class.cs (Operator): New class for operator declarations.
21913         (Operator::OpType): Enum for the various operators.
21914
21915 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
21916
21917         * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
21918         ostensibly handle this in semantic analysis.
21919
21920         * cs-parser.jay (general_catch_clause): Comment out
21921         (specific_catch_clauses, specific_catch_clause): Ditto.
21922         (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
21923         (catch_args, opt_catch_args): New productions.
21924         (catch_clause): Rewrite to use the new productions above
21925         (catch_clauses): Modify accordingly.
21926         (opt_catch_clauses): New production to use in try_statement
21927         (try_statement): Revamp. Basically, we get rid of one unnecessary rule
21928         and re-write the code in the actions to extract the specific and
21929         general catch clauses by being a little smart ;-)
21930
21931         * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
21932         Hooray, try and catch statements parse fine !
21933
21934 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
21935
21936         * statement.cs (Block::GetVariableType): Fix logic to extract the type
21937         string from the hashtable of variables.
21938
21939         * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
21940         I end up making that mistake ;-)
21941         (catch_clauses): Fixed gross error which made Key and Value of the 
21942         DictionaryEntry the same : $1 !!
21943
21944 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
21945
21946         * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
21947
21948         * cs-parser.jay (event_declaration): Correct to remove the semicolon
21949         when the add and remove accessors are specified. 
21950
21951 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
21952
21953         * cs-parser.jay (IndexerDeclaration): New helper class to hold
21954         information about indexer_declarator.
21955         (indexer_declarator): Implement actions.
21956         (parsing_indexer): New local boolean used to keep track of whether
21957         we are parsing indexers or properties. This is necessary because 
21958         implicit_parameters come into picture even for the get accessor in the 
21959         case of an indexer.
21960         (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
21961
21962         * class.cs (Indexer): New class for indexer declarations.
21963         (TypeContainer::AddIndexer): New method to add an indexer to a type.
21964         (TypeContainer::indexers): New member to hold list of indexers for the
21965         type.
21966
21967 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
21968
21969         * cs-parser.jay (add_accessor_declaration): Implement action.
21970         (remove_accessor_declaration): Implement action.
21971         (event_accessors_declaration): Implement
21972         (variable_declarators): swap statements for first rule - trivial.
21973
21974         * class.cs (Event): New class to hold information about event
21975         declarations.
21976         (TypeContainer::AddEvent): New method to add an event to a type
21977         (TypeContainer::events): New member to hold list of events.
21978
21979         * cs-parser.jay (event_declaration): Implement actions.
21980
21981 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
21982
21983         * cs-parser.jay (dim_separators): Implement. Make it a string
21984         concatenating all the commas together, just as they appear.
21985         (opt_dim_separators): Modify accordingly
21986         (rank_specifiers): Update accordingly. Basically do the same
21987         thing - instead, collect the brackets here.
21988         (opt_rank_sepcifiers): Modify accordingly.
21989         (array_type): Modify to actually return the complete type string
21990         instead of ignoring the rank_specifiers.
21991         (expression_list): Implement to collect the expressions
21992         (variable_initializer): Implement. We make it a list of expressions
21993         essentially so that we can handle the array_initializer case neatly too.
21994         (variable_initializer_list): Implement.
21995         (array_initializer): Make it a list of variable_initializers
21996         (opt_array_initializer): Modify accordingly.
21997
21998         * expression.cs (New::NType): Add enumeration to help us
21999         keep track of whether we have an object/delegate creation
22000         or an array creation.
22001         (New:NewType, New::Rank, New::Indices, New::Initializers): New
22002         members to hold data about array creation.
22003         (New:New): Modify to update NewType
22004         (New:New): New Overloaded contructor for the array creation
22005         case.
22006
22007         * cs-parser.jay (array_creation_expression): Implement to call
22008         the overloaded New constructor.
22009
22010 2001-08-26  Ravi Pratap  <ravi@che.iitm.ac.in>
22011
22012         * class.cs (TypeContainer::Constructors): Return member
22013         constructors instead of returning null.
22014
22015 2001-08-26  Miguel de Icaza  <miguel@ximian.com>
22016
22017         * typemanager.cs (InitCoreTypes): Initialize the various core
22018         types after we have populated the type manager with the user
22019         defined types (this distinction will be important later while
22020         compiling corlib.dll)
22021
22022         * expression.cs, literal.cs, assign.cs, constant.cs: Started work
22023         on Expression Classification.  Now all expressions have a method
22024         `Resolve' and a method `Emit'.
22025
22026         * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
22027         generation from working.     Also add some temporary debugging
22028         code. 
22029
22030 2001-08-24  Miguel de Icaza  <miguel@ximian.com>
22031
22032         * codegen.cs: Lots of code generation pieces.  This is only the
22033         beginning, will continue tomorrow with more touches of polish.  We
22034         handle the fundamentals of if, while, do, for, return.  Others are
22035         trickier and I need to start working on invocations soon.
22036
22037         * gen-treedump.cs: Bug fix, use s.Increment here instead of
22038         s.InitStatement. 
22039
22040         * codegen.cs (EmitContext): New struct, used during code
22041         emission to keep a context.   Most of the code generation will be
22042         here. 
22043
22044         * cs-parser.jay: Add embedded blocks to the list of statements of
22045         this block.  So code generation proceeds in a top down fashion.
22046
22047 2001-08-23  Miguel de Icaza  <miguel@ximian.com>
22048
22049         * statement.cs: Add support for multiple child blocks.
22050
22051 2001-08-22  Miguel de Icaza  <miguel@ximian.com>
22052
22053         * codegen.cs (EmitCode): New function, will emit the code for a
22054         Block of code given a TypeContainer and its ILGenerator. 
22055
22056         * statement.cs (Block): Standard public readonly optimization.
22057         (Block::Block constructors): Link children. 
22058         (Block::Child): Child Linker.
22059         (Block::EmitVariables): Emits IL variable declarations.
22060
22061         * class.cs: Drop support for MethodGroups here, delay until
22062         Semantic Analysis.
22063         (Method::): Applied the same simplification that I did before, and
22064         move from Properties to public readonly fields.
22065         (Method::ParameterTypes): Returns the parameter types for the
22066         function, and implements a cache that will be useful later when I
22067         do error checking and the semantic analysis on the methods is
22068         performed.
22069         (Constructor::GetCallingConvention): Renamed from CallingConvetion
22070         and made a method, optional argument tells whether this is a class
22071         or a structure to apply the `has-this' bit.
22072         (Method::GetCallingConvention): Implement, returns the calling
22073         convention. 
22074         (Method::Define): Defines the type, a second pass is performed
22075         later to populate the methods.
22076
22077         (Constructor::ParameterTypes): implement a cache similar to the
22078         one on Method::ParameterTypes, useful later when we do semantic
22079         analysis. 
22080
22081         (TypeContainer::EmitMethod):  New method.  Emits methods.
22082
22083         * expression.cs: Removed MethodGroup class from here.
22084
22085         * parameter.cs (Parameters::GetCallingConvention): new method.
22086
22087 2001-08-21  Miguel de Icaza  <miguel@ximian.com>
22088
22089         * class.cs (TypeContainer::Populate): Drop RootContext from the
22090         argument. 
22091
22092         (Constructor::CallingConvention): Returns the calling convention.
22093         (Constructor::ParameterTypes): Returns the constructor parameter
22094         types. 
22095
22096         (TypeContainer::AddConstructor): Keep track of default constructor
22097         and the default static constructor.
22098
22099         (Constructor::) Another class that starts using `public readonly'
22100         instead of properties. 
22101
22102         (Constructor::IsDefault): Whether this is a default constructor. 
22103
22104         (Field::) use readonly public fields instead of properties also.
22105
22106         (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
22107         track of static constructors;  If none is used, turn on
22108         BeforeFieldInit in the TypeAttributes. 
22109
22110         * cs-parser.jay (opt_argument_list): now the return can be null
22111         for the cases where there are no arguments. 
22112
22113         (constructor_declarator): If there is no implicit `base' or
22114         `this', then invoke the default parent constructor. 
22115
22116         * modifiers.cs (MethodAttr): New static function maps a set of
22117         modifiers flags into a MethodAttributes enum
22118         (FieldAttr): renamed from `Map'.  So now we have FieldAttr,
22119         MethodAttr, TypeAttr to represent the various mappings where the
22120         modifiers are used.
22121         (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'  
22122
22123 2001-08-19  Miguel de Icaza  <miguel@ximian.com>
22124
22125         * parameter.cs (GetParameterInfo): Fix bug where there would be no
22126         method arguments.
22127
22128         * interface.cs (PopulateIndexer): Implemented the code generator
22129         for interface indexers.
22130
22131 2001-08-17  Miguel de Icaza  <miguel@ximian.com>
22132
22133         * interface.cs (InterfaceMemberBase): Now we track the new status
22134         here.  
22135
22136         (PopulateProperty): Implement property population.  Woohoo!  Got
22137         Methods and Properties going today. 
22138
22139         Removed all the properties for interfaces, and replaced them with
22140         `public readonly' fields. 
22141
22142 2001-08-16  Miguel de Icaza  <miguel@ximian.com>
22143
22144         * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
22145         initialize their hashtables/arraylists only when they are needed
22146         instead of doing this always.
22147
22148         * parameter.cs: Handle refs and out parameters.
22149
22150         * cs-parser.jay: Use an ArrayList to construct the arguments
22151         instead of the ParameterCollection, and then cast that to a
22152         Parameter[] array.
22153
22154         * parameter.cs: Drop the use of ParameterCollection and use
22155         instead arrays of Parameters.
22156
22157         (GetParameterInfo): Use the Type, not the Name when resolving
22158         types. 
22159
22160 2001-08-13  Miguel de Icaza  <miguel@ximian.com>
22161
22162         * parameter.cs: Eliminate the properties Name, Type and ModFlags,
22163         and instead use public readonly fields.
22164
22165         * class.cs: Put back walking code for type containers.
22166
22167 2001-08-11  Miguel de Icaza  <miguel@ximian.com>
22168
22169         * class.cs (MakeConstant): Code to define constants.
22170
22171         * rootcontext.cs (LookupType): New function.  Used to locate types 
22172
22173
22174 2001-08-08  Miguel de Icaza  <miguel@ximian.com>
22175
22176         * rootcontext.cs: OH MY!  My trick works!   It is amazing how nice
22177         this System.Reflection code is.  Kudos to Microsoft
22178
22179         * typemanager.cs: Implement a type cache and avoid loading all
22180         types at boot time.  Wrap in LookupType the internals.  This made
22181         the compiler so much faster.  Wow.  I rule!
22182
22183         * driver.cs: Make sure we always load mscorlib first (for
22184         debugging purposes, nothing really important).
22185
22186         * Renamespaced things that were on `CSC' to `CIR'.  Maybe I should
22187         have moved to `CSC' rather than `CIR'.  Oh man!  The confussion!  
22188
22189         * rootcontext.cs: Lookup types on their namespace;  Lookup types
22190         on namespaces that have been imported using the `using' keyword.
22191
22192         * class.cs (TypeContainer::TypeAttr): Virtualize.
22193         (Class::TypeAttr): Return attributes suitable for this bad boy.
22194         (Struct::TypeAttr): ditto.
22195         Handle nested classes.
22196         (TypeContainer::) Remove all the type visiting code, it is now
22197         replaced with the rootcontext.cs code
22198
22199         * rootcontext.cs (GetClassBases): Added support for structs. 
22200
22201 2001-08-06  Miguel de Icaza  <miguel@ximian.com>
22202
22203         * interface.cs, statement.cs, class.cs, parameter.cs,
22204         rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
22205         Drop use of TypeRefs, and use strings instead.
22206
22207 2001-08-04  Miguel de Icaza  <miguel@ximian.com>
22208
22209         * rootcontext.cs: 
22210
22211         * class.cs (Struct::Struct): set the SEALED flags after
22212         checking the modifiers.
22213         (TypeContainer::TypeAttr): new property, returns the
22214         TypeAttributes for a class.  
22215
22216         * cs-parser.jay (type_list): Oops, list production was creating a
22217         new list of base types.
22218
22219         * rootcontext.cs (StdLib): New property.
22220         (GetInterfaceTypeByName): returns an interface by type name, and
22221         encapsulates error handling here.
22222         (GetInterfaces): simplified.
22223         (ResolveTree): Encapsulated all the tree resolution here.
22224         (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
22225         types. 
22226
22227         * driver.cs: Add support for --nostdlib, to avoid loading the
22228         default assemblies.
22229         (Main): Do not put tree resolution here. 
22230
22231         * rootcontext.cs: Beginning of the class resolution.
22232
22233 2001-08-03  Miguel de Icaza  <miguel@ximian.com>
22234
22235         * rootcontext.cs: Provide better error reporting. 
22236
22237         * cs-parser.jay (interface_base): set our $$ to be interfaces.
22238
22239         * rootcontext.cs (CreateInterface): Handle the case where there
22240         are no parent interfaces.
22241
22242         (CloseTypes): Routine to flush types at the end.
22243         (CreateInterface): Track types.
22244         (GetInterfaces): Returns an array of Types from the list of
22245         defined interfaces.
22246
22247         * typemanager.c (AddUserType): Mechanism to track user types (puts
22248         the type on the global type hash, and allows us to close it at the
22249         end). 
22250
22251 2001-08-02  Miguel de Icaza  <miguel@ximian.com>
22252
22253         * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
22254         RecordInterface instead.
22255
22256         * cs-parser.jay: Updated to reflect changes above.
22257
22258         * decl.cs (Definition): Keep track of the TypeBuilder type that
22259         represents this type here.  Not sure we will use it in the long
22260         run, but wont hurt for now.
22261
22262         * driver.cs: Smaller changes to accomodate the new code.
22263
22264         Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
22265         when done. 
22266
22267         * rootcontext.cs (CreateInterface):  New method, used to create
22268         the System.TypeBuilder type for interfaces.
22269         (ResolveInterfaces): new entry point to resolve the interface
22270         hierarchy. 
22271         (CodeGen): Property, used to keep track of the code generator.
22272
22273 2001-07-26  Miguel de Icaza  <miguel@ximian.com>
22274
22275         * cs-parser.jay: Add a second production for delegate_declaration
22276         with `VOID'.
22277
22278         (enum_body): Put an opt_comma here instead of putting it on
22279         enum_body or enum_member_declarations so we can handle trailing
22280         commas on enumeration members.  Gets rid of a shift/reduce.
22281
22282         (type_list): Need a COMMA in the middle.
22283
22284         (indexer_declaration): Tell tokenizer to recognize get/set
22285
22286         * Remove old targets.
22287
22288         * Re-add the parser target.
22289
22290 2001-07-13  Simon Cozens <simon@simon-cozens.org>
22291
22292         * cs-parser.jay: Add precendence rules for a number of operators
22293         ot reduce the number of shift/reduce conflicts in the grammar.
22294
22295 2001-07-17  Miguel de Icaza  <miguel@ximian.com>
22296
22297         * tree.cs: moved IGenerator interface and renamed it to ITreeDump
22298         and put it here.
22299
22300         Get rid of old crufty code.
22301
22302         * rootcontext.cs: Use this to keep track of the parsed
22303         representation and the defined types available to the program. 
22304
22305         * gen-treedump.cs: adjust for new convention.
22306
22307         * type.cs: Split out the type manager, and the assembly builder
22308         from here. 
22309
22310         * typemanager.cs: the type manager will live here now.
22311
22312         * cil-codegen.cs: And the code generator here. 
22313
22314 2001-07-14  Sean MacIsaac  <macisaac@ximian.com>
22315
22316         * makefile: Fixed up for easy making.
22317
22318 2001-07-13  Simon Cozens <simon@simon-cozens.org>
22319
22320         * cs-parser.jay (rank_specifier): Remove a conflict by reordering
22321         the 
22322
22323         (unary_expression): Expand pre_increment_expression and
22324         post_decrement_expression to reduce a shift/reduce.
22325
22326 2001-07-11  Simon Cozens
22327
22328         * cs-tokenizer.cs: Hex numbers should begin with a 0.
22329
22330         Improve allow_keyword_as_indent name.
22331
22332 2001-06-19  Miguel de Icaza  <miguel@ximian.com>
22333
22334         * Adjustments for Beta2. 
22335
22336 2001-06-13  Miguel de Icaza  <miguel@ximian.com>
22337
22338         * decl.cs: Added `Define' abstract method.
22339         (InTransit): new property, used to catch recursive definitions. 
22340
22341         * interface.cs: Implement `Define'. 
22342
22343         * modifiers.cs: Map Modifiers.constants to
22344         System.Reflection.TypeAttribute flags.
22345
22346         * class.cs: Keep track of types and user-defined types.
22347         (BuilderInit): New method for creating an assembly
22348         (ResolveType): New function to launch the resolution process, only
22349         used by interfaces for now.
22350
22351         * cs-parser.jay: Keep track of Classes, Structs and Interfaces
22352         that are inserted into the name space. 
22353
22354 2001-06-08  Miguel de Icaza  <miguel@ximian.com>
22355
22356         * ARGH.  I have screwed up my tree so many times due to the use of
22357         rsync rather than using CVS.  Going to fix this at once. 
22358
22359         * driver.cs: Objetify driver.  Load assemblies, use assemblies to
22360         load types.
22361
22362 2001-06-07  Miguel de Icaza  <miguel@ximian.com>
22363
22364         * Experiment successful: Use System.Type rather that our own
22365         version of Type.  
22366
22367 2001-05-25  Miguel de Icaza  <miguel@ximian.com>
22368
22369         * cs-parser.jay: Removed nsAliases from here.
22370
22371         Use new namespaces, handle `using XXX;' 
22372
22373         * namespace.cs: Reimplemented namespace handling, use a recursive
22374         definition of the class.  Now we can keep track of using clauses
22375         and catch invalid using clauses.
22376
22377 2001-05-24  Miguel de Icaza  <miguel@ximian.com>
22378
22379         * gen-treedump.cs: Adapted for all the renaming.
22380
22381         * expression.cs (Expression): this class now has a Type property
22382         which returns an expression Type.
22383
22384         (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
22385         `Type', as this has a different meaning now in the base
22386
22387 2001-05-22  Miguel de Icaza  <miguel@ximian.com>
22388
22389         * interface.cs, class.cs: Removed from all the sources the
22390         references to signature computation, as we can not do method
22391         signature computation during the parsing time, as we are not
22392         trying to solve at that point distinguishing:
22393
22394         class X {
22395                 void a (Blah x) {}
22396                 void a (NS.Blah x) {}
22397         }
22398
22399         Which depending on the context might be valid or not, as we do not
22400         know if Blah is the same thing as NS.Blah at that point.
22401
22402         * Redid everything so the code uses TypeRefs now instead of
22403         Types.  TypeRefs are just temporary type placeholders, that need
22404         to be resolved.  They initially have a pointer to a string and the
22405         current scope in which they are used.  This is used later by the
22406         compiler to resolve the reference to an actual Type. 
22407
22408         * DeclSpace is no longer a CIR.Type, and neither are
22409         TypeContainers (Class and Struct) nor Interfaces nor Enums.  They
22410         are all DeclSpaces, but no Types. 
22411
22412         * type.cs (TypeRefManager): This implements the TypeRef manager,
22413         which keeps track of all the types that need to be resolved after
22414         the parsing has finished. 
22415
22416 2001-05-13  Miguel de Icaza  <miguel@ximian.com>
22417
22418         * ARGH.  We are going to have to store `foreach' as a class rather
22419         than resolving it, as we need to verify error 1579 after name
22420         resolution.   *OR* we could keep a flag that says `This request to
22421         IEnumerator comes from a foreach statement' which we can then use
22422         to generate the error.
22423
22424 2001-05-10  Miguel de Icaza  <miguel@ximian.com>
22425
22426         * class.cs (TypeContainer.AddMethod): we now add methods to the
22427         MethodGroup instead of the method hashtable.  
22428
22429         * expression.cs: Add MethodGroup abstraction, which gets us one
22430         step closer to the specification in the way we handle method
22431         declarations.  
22432
22433         * cs-parser.jay (primary_expression): qualified_identifier now
22434         tried to match up an identifier to a local variable reference or
22435         to a parameter reference.
22436
22437         current_local_parameters is now a parser global variable that
22438         points to the current parameters for the block, used during name
22439         lookup.
22440
22441         (property_declaration): Now creates an implicit `value' argument to
22442         the set accessor.
22443
22444 2001-05-09  Miguel de Icaza  <miguel@ximian.com>
22445
22446         * parameter.cs: Do not use `param' arguments as part of the
22447         signature, per the spec.
22448
22449 2001-05-08  Miguel de Icaza  <miguel@ximian.com>
22450
22451         * decl.cs: Base class for classes, structs and interfaces.  This
22452         is the "Declaration Space" 
22453
22454         * cs-parser.jay: Use CheckDef for checking declaration errors
22455         instead of having one on each function.
22456
22457         * class.cs: Factor out some code for handling error handling in
22458         accordance to the "Declarations" section in the "Basic Concepts"
22459         chapter in the ECMA C# spec.
22460
22461         * interface.cs: Make all interface member classes derive from
22462         InterfaceMemberBase.
22463
22464 2001-05-07  Miguel de Icaza  <miguel@ximian.com>
22465
22466         * Many things: all interfaces are parsed and generated in
22467         gen-treedump.  Support for member variables, constructors,
22468         destructors, properties, constants is there.
22469
22470         Beginning of the IL backend, but very little done, just there for
22471         testing purposes. 
22472
22473 2001-04-29  Miguel de Icaza  <miguel@ximian.com>
22474
22475         * cs-parser.jay: Fix labeled statement.
22476
22477         * cs-tokenizer.cs (escape): Escape " and ' always.
22478         ref_line, ref_name: keep track of the line/filename as instructed
22479         by #line by the compiler.
22480         Parse #line.
22481
22482 2001-04-27  Miguel de Icaza  <miguel@ximian.com>
22483
22484         * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
22485         to match the values in System.CodeDOM.
22486
22487         Divid renamed to Divide.
22488
22489         * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
22490         statements. 
22491         (Statements.set): remove.
22492
22493         * System.CodeDOM/CodeCatchClause.cs: always have a valid
22494         statements. 
22495
22496         * System.CodeDOM/CodeIfStatement.cs: trueStatements and
22497         falseStatements always have valid values. 
22498
22499         * cs-parser.jay: Use System.CodeDOM now.
22500