**** Merged r45574 from MCS ****
[mono.git] / mcs / gmcs / ChangeLog
1 2005-06-07  Raja R Harinath  <rharinath@novell.com>
2
3         Ensure that partial classes are registered in their enclosing
4         namespace.  Initial part of fix of #75160.
5         * tree.cs (Tree.RecordDecl): Add new namespace argument.
6         Register declspace with namespace here, not in
7         DeclSpace.RecordDecl.
8         * cs-parser.jay: Pass namespace to RecordDecl.
9         * class.cs (PartialContainer.Create): Likewise.
10         (ClassPart.DefineType): New sanity-check.  Throws an exception if
11         called.
12         * decl.cs (Declspace.RecordDecl): Remove.
13         * namespace.cs (NamespaceEntry.DefineName): Remove.
14
15 2005-06-06  Marek Safar  <marek.safar@seznam.cz>
16
17         * rootcontext.cs: Reset TargetExt as well.
18
19 2005-06-03  Raja R Harinath  <rharinath@novell.com>
20
21         * ecore.cs (Expression.Resolve): Emit CS0654 error when
22         -langversion:ISO-1.
23
24 2005-06-02  Raja R Harinath  <rharinath@novell.com>
25
26         Fix #75080, cs0119.cs.
27         * ecore.cs (Expression.ExprClassToResolveFlags): New.  Broken out
28         of ...
29         (Expression.Resolve): ... this.  Use it.  Remove bogus code
30         allowing ExprClass.Type and ExprClass.Namespace for
31         ResolveFlags.VariableOrValue.
32         (Expression.Resolve) [1-argument variant]: Change default resolve
33         flags based on language version.
34         (Expression.Error_UnexpectedKind): Use a simple string array
35         rather than an ArrayList.
36         * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
37         not ExprClass.Type.
38         (TypeOfVoid.DoResolve): Likewise.
39         (MemberAccess.DoResolve) [3-argument variant]: Make private.  Drop
40         flags argument -- it always has the same value.
41
42 2005-05-31  Raja R Harinath  <rharinath@novell.com>
43
44         Fix #75081.
45         * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
46         Use it in the error message.
47         * assign.cs, expression.cs, statement.cs: Update.
48
49 2005-05-30  Raja R Harinath  <rharinath@novell.com>
50
51         Fix #75088.
52         * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
53         the "almostMatchedMember" case too.
54         * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
55         that failed the accessibility checks to 'almost_match'.
56
57 2005-05-27  Vladimir Vukicevic  <vladimir@pobox.com>
58
59         * attribute.cs: Use internal MethodBuilder methods to set
60         ExactSpelling and SetLastError on PInvoke methods, instead
61         of passing them via charset.  Fixes #75060.
62
63 2005-05-27  Raja R Harinath  <rharinath@novell.com>
64
65         * parameter.cs (Parameter): Remove TODO comment.
66         (Parameter.DefineParameter): Remove Location parameter.
67         (Parameters.LabelParameters): Likewise.
68         * class.cs (Constructor.Emit): Update to change.
69         (MethodData.Emit): Likewise.
70         * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.  
71         * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
72
73 2005-05-27  Atsushi Enomoto  <atsushi@ximian.com>
74
75         * parameter.cs,
76           Removed Parameters.Location and added Parameter.Location instead.
77           Removed Location parameter from Emit() and GetSignature().
78         * anonymous.cs,
79           class.cs,
80           cs-parser.jay,
81           delegate.cs,
82           iterators.cs,
83           statement.cs :
84           Modified all related calls.
85
86 2005-06-21  Martin Baulig  <martin@ximian.com>
87
88         * generic.cs (NullCoalescingOperator.Emit): Make this work if the
89         left-hand side is not a nullable type; fixes #75328.
90
91 2005-06-21  Martin Baulig  <martin@ximian.com>
92
93         * typemanager.cs
94         (TypeManager.CSharpName): Use GetFullName() instead of `t.FullName'.
95         (TypeManager.GetFullNameSignature): Likewise.
96
97         * convert.cs (Convert.Error_CannotImplicitConversion): Compare
98         `source.FullName' and `target.FullName' to check whether there are
99         two conflicting definitions.
100
101 2005-06-21  Martin Baulig  <martin@ximian.com>
102
103         * convert.cs (Convert.ImplicitTypeParameterConversion): Always use
104         a BoxedCast - also for reference types - to be compatible with csc.
105
106 2005-06-21  Martin Baulig  <martin@ximian.com>
107
108         * expression.cs (MemberAccess.DoResolve): Add support for nested
109         types in a generic instance; fixes #75320.
110
111 2005-06-20  Martin Baulig  <martin@ximian.com>
112
113         * generic.cs (TypeManager.InferType): Also walk the class
114         hierarchy for generic instances; fixes #75261.
115
116 2005-06-17  Martin Baulig  <martin@ximian.com>
117
118         * typemanager.cs (TypeManager.IsBuiltinType): Use TypeToCoreType()
119         to make things work for corlib.
120
121 2005-06-15  Martin Baulig  <martin@ximian.com>
122
123         * attribute.cs (Attribute.CheckSecurityActionValidity): Remove the
124         obsolete `SecurityAction' values.
125
126 2005-06-06  Marek Safar  <marek.safar@seznam.cz>
127
128         * rootcontext.cs: Reset TargetExt as well.
129         
130 2005-06-09  Martin Baulig  <martin@ximian.com>
131
132         * delegate.cs (Delegate.VerifyMethod): Added
133         `MethodGroupExpr old_mg' argument; inherit its
134         `HasTypeParameters'; fix #75085.
135
136 2005-06-09  Martin Baulig  <martin@ximian.com>
137
138         * expression.cs (Invocation.OverloadResolve): Correctly handle
139         generic methods for the SetMemberIsUsed(); fix #75064.
140
141 2005-06-09  Martin Baulig  <martin@ximian.com>
142
143         * statement.cs (Throw.Resolve): Use TypeManager.IsSubclassOf();
144         fixes #75062.
145
146 2005-06-08  Martin Baulig  <martin@ximian.com>
147
148         * cs-parser.jay (nullable_type_or_conditional): If we put the
149         nullable back and our `type' is a `ComposedCast', remove the
150         nullable from it.  Fixes #75156.
151
152         * expression.cs (ComposedCast.RemoveNullable): New public method.
153
154 2005-06-08  Martin Baulig  <martin@ximian.com>
155
156         The big Iterators rewrite :-)
157
158         * iterators.cs: Rewrite this to use the anonymous methods framework.
159
160         * rootcontext.cs (RootContext.DefineTypes): Define Delegates
161         before the TypeContainers; see 2test-21.cs.
162
163         * class.cs
164         (TypeContainer.DefineType): Don't create a new EmitContext if we
165         already have one (this only happens if we're an Iterator).
166         (TypeContainer.Define): Also call Define() on all our iterators.
167         (Method.CreateEmitContext): Added support for iterators.
168
169         * anonymous.cs
170         (AnonymousContainer): New abstract base class for `AnonymousMethod'.
171         (AnonymousContainer.CreateMethodHost): Moved here from
172         AnonymousMethod and made abstract.
173         (AnonymousContainer.CreateScopeType): New abstract method.
174         (AnonymousContainer.IsIterator): New public property.
175         (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
176         get the ScopeTypeBuilder rather than manually defining it here. 
177         (ScopeInfo.EmitScopeInstance): New public method; correctly handle
178         iterators here.
179
180         * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
181         before RootContext.DefineTypes().
182
183         * codegen.cs (EmitContext.RemapToProxy): Removed.
184         (EmitContext.CurrentAnonymousMethod): Changed type from
185         AnonymousMethod -> AnonymousContainer.
186         (EmitContext.ResolveTopBlock): Protect from being called twice.
187         (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
188         (EmitContext.EmitThis): Removed the iterators hacks; use the
189         anonymous methods framework for that.
190
191         * statement.cs
192         (ToplevelBlock.Container): Make this a property, not a field.
193         (ToplevelBlock.ReParent): New public method; move the
194         ToplevelBlock into a new container.
195         (Foreach.TemporaryVariable): Simplify.
196
197 2005-06-05  Martin Baulig  <martin@ximian.com>
198
199         * statement.cs (LocalInfo.CompilerGenerated): New flag.
200         (Block.AddTemporaryVariable): New public method; creates a new
201         `LocalInfo' for a temporary variable.
202         (Block.EmitMeta): Create the LocalBuilders for all the temporary
203         variables here.
204         (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
205         non-iterator variables.
206
207 2005-06-05  Martin Baulig  <martin@ximian.com>
208
209         * statement.cs (Foreach.TemporaryVariable): Create the
210         LocalBuilder in the Emit phase and not in Resolve since in some
211         situations, we don't have an ILGenerator during Resolve; see
212         2test-19.cs for an example.
213
214 2005-06-04  Martin Baulig  <martin@ximian.com>
215
216         The big Foreach rewrite - Part II.
217
218         * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
219         with `PropertyInfo ienumerator_getcurrent'.
220
221         * codegen.cs (VariableStorage): Removed.
222
223         * statement.cs
224         (Foreach): Derive from Statement, not ExceptionStatement.
225         (Foreach.CollectionForeach): New nested class.  Moved all the code
226         dealing with collection foreach here.
227         (Foreach.ForeachHelperMethods): Removed.
228         (Foreach.TemporaryVariable): Implement IMemoryLocation.
229
230 2005-05-23  Martin Baulig  <martin@ximian.com>
231
232         * statement.cs (Try.DoResolve): Don't create a `finally' if we
233         don't need to.  Fix #75014.
234
235 2005-05-24  Duncan Mak  <duncan@novell.com>
236
237         * ecore.cs (CastFromDecimal): New class for casting a decimal to
238         another class, used in Convert.ExplicitNumericConversion.
239         (CastToDecimal): New class, similar to above, but casts to
240         System.Decimal, used in Convert.ImplicitNumericConversion and also
241         in explicit convesion from double/float to decimal.
242
243         * convert.cs (ImplicitNumericConversion): Handle implicit
244         conversions to System.Decimal.
245         (ExplicitNumericConversion): handle explicit conversions to
246         System.Decimal.
247
248         This fixes #68711.
249         
250 2005-05-20  Miguel de Icaza  <miguel@novell.com>
251
252         * typemanager.cs: Do not throw an exception in the TypeBuilder
253         case, we take care of it on the TypeCode.
254
255 2005-05-17  Marek Safar  <marek.safar@seznam.cz>
256         
257         * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
258         is back.
259         
260         * cs-parser.jay: Catch more lexical errors.
261         
262         * report.cs: Add one more Error method.
263         
264         * rootcontext.cs,
265         * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
266
267 2005-05-20  Martin Baulig  <martin@ximian.com>
268
269         * class.cs (TypeContainer.CircularDepException): Removed.
270         (TypeContainer.DefineType): Removed the `InTransit' stuff.
271         (TypeContainer.CheckRecursiveDefinition): Check for circular class
272         (CS0146) and interface (CS0529) dependencies here.
273
274 2005-05-20  Martin Baulig  <martin@ximian.com>
275
276         * expression.cs (New.DoResolve): Move the CS0712 check above the
277         CS0144 check; otherwise it can never be reached.
278
279 2005-05-20  Martin Baulig  <martin@ximian.com>
280
281         * cs-parser.jay: Fix CS0080 check; add CS0231 and CS0257 from MCS.
282
283 2005-05-20  Martin Baulig  <martin@ximian.com>
284
285         * class.cs (TypeContainer.DefineType): Fix CS0698 check.
286
287         * typemanager.cs (TypeManager.IsAttributeType): New public method.
288
289 2005-05-19  Martin Baulig  <martin@ximian.com>
290
291         * delegate.cs
292         (ImplicitDelegateCreation.Check): Added `bool check_only' argument
293         to disable error reporting.
294
295         * convert.cs (Convert.ImplicitStandardConversionExists): Use it
296         here since we don't want to report an error; see the new test-336.cs.
297
298 2005-05-19  Raja R Harinath  <rharinath@novell.com>
299
300         * statement.cs (ToplevelBlock.GetParameterReference)
301         (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
302         Move here from class Block.
303         * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
304         * expression.cs (ParameterReference.DoResolveBase): Likewise.
305
306 2005-05-18  Martin Baulig  <martin@ximian.com>
307
308         Fix #74978.
309
310         * flowanalysis.cs
311         (FlowBranching.Reachability): Add non-static public And() and Or()
312         methods.
313         (FlowBranchingSwitch): New class; do the `break_origins' thing
314         like in FlowBranchingLoop.
315         (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
316         reachability, not just locals and parameters.
317         (FlowBranching.MergeChild): Remove some of the hacks for loop and
318         switch; MergeBreakOrigins() now takes care of that.
319
320 2005-05-18  Martin Baulig  <martin@ximian.com>
321
322         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
323         a loop and may leave it, reset the barrier; fixes #74974.
324
325 2005-05-16  Raja R Harinath  <rharinath@novell.com>
326
327         Fix test-382.cs.  Emit values of decimal constants.
328         * class.cs (TypeContainer.RegisterFieldForInitialization): New.
329         Carved out of ...
330         (TypeContainer.AddField): ... this.
331         (TypeContainer.EmitFieldInitializers): Allow the list of fields
332         with initializers to include 'Const's.
333         (ClassPart.RegisterFieldForInitialization): Forward to
334         PartialContainer.
335         * const.cs (Const.Const): Pass initializer to base class.
336         (Const.Define): In case of decimal constants, register them for
337         initialization in a static constructor.
338
339 2005-05-14  Martin Baulig  <martin@ximian.com>
340
341         * statement.cs (Block.Resolve): Correctly handle unreachable code;
342         do not call ResolveUnreachable() on unreachable statements in
343         here, see the comment in the source code.
344
345 2005-05-13  Raja R Harinath  <rharinath@novell.com>
346
347         Fix #74934.
348         * expression.cs (BinaryResolveOperator): If one of the operands of
349         an equality comparison is 'null' and the other is a pointer type,
350         convert the null to a NullPointer.
351         * convert.cs (ImplicitReferenceConversion): If the expression is a
352         NullLiteral and the target type is a pointer type, return a
353         NullPointer instead.
354         (ImplicitConversionStandard): Likewise.
355
356 2005-05-13  Marek Safar  <marek.safar@seznam.cz>
357         
358         * cs-parser.jay: Set readonly context based on special constructs.
359         
360         * expression.cs (LocalVariableReference.DoResolveBase): Improved
361         readonly variable error handling.
362         
363         * rootcontext.cs (EmitCode): Don't verify members when error
364         occurred.
365         
366         * statement.cs (LocalInfo): Add reaodnly context information.
367         (SetReadOnlyContext, GetReadOnlyContext): New methods.
368
369 2005-05-17  Martin Baulig  <martin@ximian.com>
370
371         * expression.cs (Argument.Resolve): Turn on flow analysis; fix
372         #70970. 
373
374 2005-05-13  Martin Baulig  <martin@ximian.com>
375
376         * statement.cs (Block.Resolve, ResolveUnreachable): Correctly
377         handle unreachable blocks.
378
379 2005-05-13  Martin Baulig  <martin@ximian.com>
380
381         * class.cs
382         (ConstructorInitializer.GetOverloadedConstructor): Don't crash.
383         (MethodCore.CheckCore): Use TypeManager.IsEqual(); fix #74904 and
384         #74905. 
385
386 2005-05-13  Martin Baulig  <martin@ximian.com>
387
388         * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
389         instance variable, not a local.  Fix #74873.
390         (Block.ResolveUnreachable): Set it to true here.
391
392 2005-05-12  Martin Baulig  <martin@ximian.com>
393
394         * cs-parser.jay (property_declaration): Pass the `current_class',
395         not the `current_container' to Property's .ctor.  Fixes #74912.
396
397 2005-05-11  Martin Baulig  <martin@ximian.com>
398
399         * typemanager.cs (Closure): Copy this from MCS and merge all the
400         GMCS-specific changes into it.
401
402 2005-05-12  Raja R Harinath  <harinath@gmail.com>
403
404         Fix #74920.
405         * typemanager.cs (unmanaged_enclosing_types): New.
406         (IsUnmanagedType): Avoid infloops by using
407         'unmanaged_enclosing_types' to talk with recursive invocations.
408
409 2005-05-11  Duncan Mak  <duncan@novell.com>
410
411         * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
412         continuing to process for 'arg'.
413         (handle_preprocessing_directive): Check the argument of the #endif
414         directive and report error CS1025 if there are any trailing
415         characters.
416
417         According to the C# spec, having even whitespace after the #endif
418         directive is illegal; however, because we call arg.TrimEnd ()
419         beforehand, we have the same behavior as csc, allowing whitespace
420         after the directive.
421
422         Fixes #74892.
423
424 2005-05-11  Marek Safar  <marek.safar@seznam.cz>
425
426         Fix #74863.
427         
428         * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
429         (Constructor.GetObsoleteAttribute): Implemented correctly.
430
431 2005-05-10  Martin Baulig  <martin@ximian.com>
432
433         * generic.cs (Constraints.Resolve): Report CS0246 if we cannot
434         resolve the type; fixes #74864.
435         (DefaultValueExpression): Create the LocalTemporary in Emit(), not
436         in DoResolve(); fixes #74862.
437
438 2005-05-10  Martin Baulig  <martin@ximian.com>
439
440         * support.cs (ReflectionParameters.ParameterModifier): Use
441         `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
442         and `ParameterAttributes.In'.  Fixes #74884.
443
444 2005-05-10  Martin Baulig  <martin@ximian.com>
445
446         * typemanager.cs (TypeManager.MemberLookup_FindMembers): Don't use
447         the cache if we're just looking for `MemberTypes.NestedType' in a
448         generic instance.
449
450         * ecore.cs (Expression.ResolveAsTypeTerminal): Don't check the
451         constraints if we're still resolving the type tree.
452         (Expression.MemberLookup): If we're resolving the type tree, only
453         look for `MemberTypes.NestedType' since we're only interested in
454         getting types.
455
456         * class.cs (TypeContainer.DefineType): Don't resolve the type
457         parameters here; do this later in ResolveType() after the type
458         tree has been resolved.
459         (TypeContainer.ResolveType): New public method; this is called
460         after the type tree is resolved and before the types are being
461         populated.  We resolve the generic constraints here.
462         (TypeContainer.DoDefineMember): Check the constraints on our base
463         class and interfaces.
464
465         * decl.cs (DeclSpace.ResolveBaseTypeExpr): Make this protected;
466         set the `ResolvingTypeTree' flag on the EmitContext.
467
468         * codegen.cs (EmitContext.ResolvingTypeTree): New public field.
469
470 2005-05-10  Marek Safar  <marek.safar@seznam.cz>
471
472         * class.cs (Method.Define): Catch attempt for Finalizer declaration.
473         
474         * expression.cs (Argument.GetParameterModifier): Turned to property.
475         (Invocation.Error_InvalidArguments): Add more descriptive errors.
476         
477         * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
478         its C# equivalent.
479         
480 2005-05-09  Raja R Harinath  <rharinath@novell.com>
481
482         Fix #74852.
483         * decl.cs (MemberCache.AddMethods): Register override methods,
484         rather than non-override methods.
485         * typemanager.cs (RegisterOverride): New.
486         (IsOverride): Update.
487
488 2005-05-09  Marek Safar  <marek.safar@seznam.cz>
489
490         * typemanager.cs (TypeManager): Moved InitGenerics to Reset method.
491
492 2005-05-06  Martin Baulig  <martin@ximian.com>
493
494         * attribute.cs
495         (Attributable.IsClsComplianceRequired): Fix typo in the method name.
496         (AttributeTester.AnalyzeTypeCompliance): Add generics support.
497
498 2005-05-09  Marek Safar  <marek.safar@seznam.cz>
499
500         Fix #73105.
501         
502         * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
503         recursive declaration.
504         
505         * statement.cs (Block.ResolveMeta): Report any error in resolving.
506         
507 2005-05-06  Marek Safar  <marek.safar@seznam.cz>
508
509         * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
510         
511         * expression.cs (Binary.DoResolve): (x && 0) is always 0.
512
513 2005-05-05  Raja R Harinath  <rharinath@novell.com>
514
515         Fix #74797.
516         * decl.cs (DeclSpace.FamilyAccessible): 
517         Use TypeManager.IsNestedFamilyAccessible.
518
519         Fix reopened #64812.
520         * typemanager.cs (Closure.Filter): Introduce checks for 'protected
521         internal'.
522
523 2005-05-04  Raja R Harinath  <rharinath@novell.com>
524             Abin Thomas  <projectmonokochi@rediffmail.com>
525             Anoob V E  <projectmonokochi@rediffmail.com>
526             Harilal P R  <projectmonokochi@rediffmail.com>
527
528         Fix #64812.
529         * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
530         allow access to all static members.
531
532 2005-05-04  Martin Baulig  <martin@ximian.com>
533
534         * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
535
536 2005-05-04  Martin Baulig  <martin@ximian.com>
537
538         Fix #74655.
539
540         * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
541         section at the end; make things work if `default' is not the last
542         section.        
543
544 2005-05-04  Martin Baulig  <martin@ximian.com>
545
546         Fix #70400.
547
548         * statement.cs (Switch): Replaced the `got_default' field with a
549         `default_section' one.
550         (Switch.CheckSwitch): Set `default_section' here.
551         (Switch.Resolve): If we're a constant switch and the constant is
552         not found, use the default section.
553
554 2005-05-03  Martin Baulig  <martin@ximian.com>
555
556         * expression.cs (ArrayAccess.EmitGetLength): New public method.
557
558         * statement.cs (Foreach.ArrayForeach): New nested class.
559         (Foreach.TemporaryVariable): New nested class.
560         (Foreach.EmitArrayForeach): Removed; this is now in the new
561         ArrayForeach class.
562
563 2005-05-03  Raja R Harinath  <rharinath@novell.com>
564
565         * pending.cs (BaseImplements): Move the #74773 fix here.  This is
566         more conservative.
567         (VerifyPendingMethods): Revert change below.
568
569         * typemanager.cs (IsOverride, RegisterNonOverride): New.
570         * decl.cs (MemberCache.AddMethod): Register "non-override" methods
571         that used to trigger warning -28.  Remove warning -28.
572         * expression.cs (Invocation.OverloadResolve): Use
573         TypeManager.IsOverride to distinguish override methods.
574
575         Fix #74773.
576         * pending.cs (VerifyPendingMethods): If a base type implements the
577         requested interface, don't bother checking individual methods of
578         the base type.  As a side-effect, this prevents the creation of
579         unnecessary proxies.
580
581 2005-05-02  Martin Baulig  <martin@ximian.com>
582
583         Fix #70182.
584
585         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
586         Also `And' the locals if the old vector is null.
587         (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
588         null; in this case we basically reset all the variables.        
589
590 2005-05-02  Martin Baulig  <martin@ximian.com>
591
592         Fix #74529.
593
594         * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
595         Added `FlowBranching branching' argument; always `and' the
596         variables instead of `or'ing them unless we're an infinite loop.
597
598         * statement.cs (While.Resolve): Create a new sibling unless we're
599         infinite.       
600
601 2005-05-02  Martin Baulig  <martin@ximian.com>
602
603         Fix #70140.
604
605         * class.cs (ConstructorInitializer.Resolve): Added `Block block'
606         arguments; use it instead of creating a new TopLevelBlock.
607         (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
608         our ConstructorInitializer.
609
610         * statement.cs
611         (TopLevelBlock.TopLevelBranching): New public property.
612         (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
613         and create our `TopLevelBranching'.
614
615         * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
616         anonymous method host, use `block.TopLevelBranching' rather than
617         creating a new branching.
618
619 2005-04-20  Miguel de Icaza  <miguel@novell.com>
620
621         * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
622         a ScopeInfo, if any of the current children is a child of the new
623         entry, move those children there.
624
625 2005-04-30  Martin Baulig  <martin@ximian.com>
626
627         * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
628         at the beginning of a SwitchSection.  Fix #73335.
629
630 2005-04-27  Marek Safar  <marek.safar@seznam.cz>
631
632         Fix #74378
633         * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
634         
635         * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
636         (FieldExpr.DoResolve): Obsolete members are ignored for field
637         initializers.
638         
639 2005-04-26  Marek Safar  <marek.safar@seznam.cz>
640
641         * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
642         of arrays detection.
643
644         * class.cs (Interface.VerifyClsCompliance): Add base interfaces
645         verification.
646         (Field.VerifyClsCompliance): Volatile fields are not compliant.
647
648         * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
649         arrays report.
650
651 2005-04-25  Ben Maurer  <bmaurer@ximian.com>
652
653         * cs-parser.jay: Use the prefered version of -unsafe in error
654         message.
655
656 2005-04-22  Marek Safar  <marek.safar@seznam.cz>
657
658         * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
659         circumstances.
660
661 2005-04-20  John Luke  <john.luke@gmail.com>
662
663         * driver.cs: fix typo in error message, --outout to --output
664
665 2005-04-30  Martin Baulig  <martin@ximian.com>
666
667         * attribute.cs (Attribute.CheckSecurityActionValidity): Correctly
668         handle the .NET 2.x security attributes.
669
670 2005-04-30  Martin Baulig  <martin@ximian.com>
671
672         * typemanager.cs
673         (TypeManager.ExpandInterfaces): Don't add things twice.
674
675         * class.cs
676         (TypeContainer.VerifyClsCompliance): Allow generic instances.
677
678 2005-04-29  Martin Baulig  <martin@ximian.com>
679
680         * generic.cs (Constraints.ResolveTypes): Expand interfaces.
681
682         * anonymous.cs: Added support for anonymous generic methods.
683
684 2005-04-29  Martin Baulig  <martin@ximian.com>
685
686         * typemanager.cs (TypeManager.GetInterfaces): Correctly handle
687         generic instances.
688
689 2005-04-29  Martin Baulig  <martin@ximian.com>
690
691         * generic.cs (TypeManager.HasConstructorConstraint): Removed.
692
693         * expression.cs (New.DoResolve): Fix the CS0304 check.
694
695 2005-04-29  Martin Baulig  <martin@ximian.com>
696
697         * typemanager.cs (TypeManager.GetFullName): Updated to the new
698         naming schema.
699
700         * class.cs (MethodCore.IsDuplicateImplementation): If we're an
701         explicit interface implementation, compare the interface types.
702         (MethodData.Define): Use the new naming scheme from the latest
703         .NET 2.x beta2.
704         (MemberBase.DoDefineBase): Resolve `InterfaceType' here.
705
706         * decl.cs (MemberName.GetMemberName): Removed.
707         (MemberName.MethodName, FullName): New properties.
708
709 2005-04-25  Raja R Harinath  <rharinath@novell.com>
710
711         * gmcs.exe.config: Update v2.0.40607 -> v2.0.50215.
712
713 2005-04-22  Martin Baulig  <martin@ximian.com>
714
715         * generic.cs (GenericMethod): Create the EmitContext in the
716         `Define()'; in `Define(MethodBuilder)', create the type parameters
717         before calling `Define()'.  Fixes #73933.
718
719 2005-04-22  Martin Baulig  <martin@ximian.com>
720
721         * generic.cs
722         (Constraints.Resolve): Make things work wrt. the new type lookup system.
723         (ConstructedType.ResolveAsTypeTerminal): Don't override this.
724
725         * ecore.cs (Expression.ResolveAsTypeTerminal): If `te' is a
726         ConstructedType, check its constraints.
727
728 2005-04-20  Marek Safar  <marek.safar@seznam.cz>
729
730         * codegen.cs (InRefOutArgumentResolving): New field.
731         
732         * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
733         fields outside contructor.
734         
735         * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
736         
737 2005-04-19  Miguel de Icaza  <miguel@novell.com>
738
739         * anonymous.cs (CaptureContext.EmitParameterInstance): The
740         parameter code was not completed ever, so it was not as up-to-date
741         as local variables.  Must finish it.
742
743         The bug fix was to compare the Toplevel of the block, not the
744         current block.  Thanks for Ben for pointing this out. 
745
746 2005-04-19  Raja R Harinath  <rharinath@novell.com>
747
748         * decl.cs (AddMethods): Use the declaring type of the problem
749         method to determine if we want to squash a warning.
750
751 2005-04-19  Marek Safar  <marek.safar@seznam.cz>
752
753         * attribute.cs: Removed debug output.
754
755         * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
756         
757         * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
758         Report.Stderr.
759         
760 2005-04-18  Raja R Harinath  <rharinath@novell.com>
761
762         Fix #74481.
763         * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
764         (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
765         all null comparisons against reference types.
766
767 2005-04-18  Marek Safar  <marek.safar@seznam.cz>
768
769         Fix# 74565
770         * class.cs (TypeContainer.CircularDepException) New nested
771         exception class.
772         (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
773         (TypeContainer.DefineType): Removed error, reset InTransit before
774         exit.
775         (Class.DefineType): Throw exception when is in Transit.
776         Catch exception and report error.
777         (Struct.DefineType): Throw exception when is in Transit.
778         Catch exception and report error.
779         (Interface.DefineType): Throw exception when is in Transit.
780         Catch exception and report error.
781
782         * codegen.cs: Add InCatch,InFinally to EmitContext to easily
783         handle nested exception handlers.
784
785         * flowanalysis.cs (InTryWithCatch): New method, search for try with
786         a catch.
787
788         * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
789         InFinally and InCatch storage.
790
791         * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
792         (Catch.Resolve): Set and Restore ec.InCatch.
793         (Try.Resolve): Set and Restore ec.InFinally.
794         (Try.HasCatch): True when try has catch.
795
796 2005-04-17  Atsushi Enomoto  <atsushi@ximian.com>
797
798         * doc.cs : In some cases FilterName returns MonoEvent and MonoField
799           for the same event member, so exclude such cases from warning 419.
800           Fixed bug #74633.
801
802 2005-04-16  Miguel de Icaza  <miguel@novell.com>
803
804         * expression.cs (Binary.ResolveOperator): Apply patch from John
805         Luke to fix bug 59864: operators &, | and ^ on enumerations
806         require that the same enum type on both sides.
807
808         * driver.cs: Add warnings to old flag usage, this is to assist
809         people who produce Makefiles and hope that the Makefiles will be
810         used on Windows.
811
812         * class.cs (TypeContainer.EmitType): Moved the definition of the
813         special $PRIVATE$ field from the resolve phase to the Emit phase.
814         During resolve we do not know if we are a struct with
815         HasExplicitLayout, we know this only after the attributes for the
816         type are emitted.
817
818         Set the FieldOffset to zero on the dummy field that we create for
819         the class.   Fixes 74590.
820
821 2005-04-16  Raja R Harinath  <rharinath@novell.com>
822
823         Fix #73834.
824         * ecore.cs (PropertyExpr.resolved): New.
825         (DoResolve): Use it to handle a case of double resolution here.
826         Handle a case of identical-name-and-type-name.
827         * expression.cs (ArrayCreation.CheckIndices): Avoid double
828         resolution by storing the results of expression resolution back
829         into the "probes" array.
830
831 2005-04-15  Raja R Harinath  <rharinath@novell.com>
832
833         Fix cs0208-7.cs and cs0208-8.cs.
834         * typemanager.cs (IsUnmanagedType): Arrays are not allowed
835         (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0).  Improve
836         error reporting to point out the reason a struct is not unmanaged.
837
838 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
839
840         * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and 
841           just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
842
843 2005-04-13  Raja R Harinath  <rharinath@novell.com>
844
845         Fix #74528.
846         * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
847         IdenticalNameAndTypeName here.
848         (EventExpr.InstanceResolve): Likewise.
849
850 2005-04-13  Marek Safar  <marek.safar@seznam.cz>
851
852         C# 2.0 DefaultCharSetAttribute implementation
853         
854         * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
855         which allows us to set GlobalNamespace for every resolve.
856         (Attribute.ResolveArguments): Cut from Resolve.
857         (Attribute.GetCharSetValue): Returns CharSet named argument.
858         (Attribute.DefinePInvokeMethod): Gets default charset from
859         module settings.
860         (GlobalAttribute.ResolveAsTypeStep): Override.
861         (GlobalAttribute.ResolveArguments): Override.
862         
863         * class.cs (TypeAttr): Is protected.
864         
865         * codegen.cs (ModuleClass.DefaultCharSet): New member.
866         (ModuleClass.DefaultCharSetType): New memeber.
867         (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
868         
869         * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
870         charset from module.
871         
872         * delegate.cs (TypeAttr): Override.
873         (Delegate.DefineType): Use this TypeAttr.
874         
875         * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
876         at very early stage (before types are defined) to resolve model
877         module attributes. It will probably not work with corlib but it
878         should be ok.
879         
880         * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
881         charset from module.
882         
883         * typemanager.cs (default_charset_type): New type.
884
885 2005-04-13  Raja R Harinath  <rharinath@novell.com>
886
887         * decl.cs (MemberCache.AddMethods): Don't warn if
888         System.Object.Finalize has buggy MethodAttributes.
889
890         * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
891         removed below.
892
893 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
894
895         * doc.cs : detect ambiguous reference to overloaded members.
896           Fixed bug #71603. MS 1.1 csc does not detect it.
897
898 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
899
900         * doc.cs : delegates must not be referenced with parameters.
901           Fixed bug #71605.
902
903 2005-04-12  Miguel de Icaza  <miguel@novell.com>
904
905         * typemanager.cs (IsUnmanagedType): Arrays are allowed.
906
907 2005-04-10  Miguel de Icaza  <miguel@novell.com>
908
909         * driver.cs (MainDriver): Stop processing if the CLS stage found
910         errors. 
911
912         (CompilerCallableEntryPoint.InvokeCompiler): Always
913         reset after execution;   Take a TextWriter argument for the
914         output.
915
916         * report.cs: Use the error stream instead of hardcoding stderr. 
917
918 2005-04-09  Miguel de Icaza  <miguel@novell.com>
919
920         * class.cs: Reduce code paths to test, too small of an
921         optimization to make it worth the extra testing.  Always perform
922         it. 
923
924 2005-04-08  Raja R Harinath  <rharinath@novell.com>
925
926         Fix #74510.
927         * class.cs (OperatorArrayList.CheckPairedOperators): Skip
928         operators that had errors reported on them.
929
930 2005-04-08  Marek Safar  <marek.safar@seznam.cz>
931
932         * attribute.cs (Attribute.IsValidArgumentType): Test valid named
933         argument types.
934         (Attribute.Resolve): Add named argument type checking.
935         
936         * class.cs (FixedField.Define): Use IsPrimitiveType
937         
938         * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
939         
940         * iterators.cs (Iterator.DefineIterator): Add check for arglist and
941         unsafe parameter types.
942         
943         * statement.cs (Using.ResolveExpression): Add better error description.
944         
945         * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
946         
947 2005-04-08  Raja R Harinath  <rharinath@novell.com>
948
949         Fix #74484.
950         * attribute.cs (Attribute.GetAttributeUsage): Resolve
951         AttributeUsageAttribute in the emitcontext of the attribute class,
952         not in the emitcontext of the attributable entity it was attached to.
953         * cs-parser.jay: Use 'current_class', not 'current_container',
954         when creating a GlobalAttribute.
955
956 2005-04-08  Alp Toker  <alp@atoker.com>
957
958         * pending.cs: The fix to #58413 failed to compile methods implementing
959         interfaces with/without params modifiers and vice versa, even though
960         params modifiers aren't part of the signature. Make the modifier check
961         less strict as in csc.
962
963 2005-04-07  Abin Thomas  <projectmonokochi@rediffmail.com>
964             Anoob V E  <projectmonokochi@rediffmail.com>
965             Harilal P R  <projectmonokochi@rediffmail.com>
966
967         Fix #58413.
968         * pending.cs (TypeAndMethods.mods): New.  Store the parameter
969         modifiers of pending methods.
970         (PendingImplementation.PendingImplementation): Initialize it.
971         Add Parameter.Modifier [][] mods and initialize it with ParameterData.
972         (PendingImplementation.InterFaceMethod): Repalce Type[] argument
973         with ParameterData.  Add check for modifiers.
974         * class.cs (MethodData.Define): Update to changes.
975
976 2005-04-07  Raja R Harinath  <rharinath@novell.com>
977
978         * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
979
980 2005-04-07  Marek Safar  <marek.safar@seznam.cz>
981
982         * class.cs (PropertyMethod.Define): Check private accessor in abstract
983         property.
984         
985         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
986         
987         * rootcontext.cs,
988         * typemanager.cs: Registered RequiredAttributeAttribute.
989         
990 2005-04-06  Marek Safar  <marek.safar@seznam.cz>
991
992         * class.cs (VerifyMembers): Doesn't need EmitContext argument.
993         Warning CS0169 is back at level 3.
994         (IMethodData.SetMemberIsUsed): New method.
995         
996         * decl.cs (IsUsed): New value; moved from FieldBase.Status
997         (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
998         
999         * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
1000
1001         * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
1002         contants.
1003         (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
1004         is used.
1005         
1006         * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
1007         is used.
1008         
1009         * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
1010         to avoid the problems with nested types.
1011
1012 2005-04-05  Abin Thomas  <projectmonokochi@rediffmail.com>
1013             Anoob V.E  <projectmonokochi@rediffmail.com>
1014             Harilal P.R  <projectmonokochi@rediffmail.com>
1015             Raja R Harinath  <rharinath@novell.com>
1016
1017         Fix #73820.
1018         * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
1019         attribute.
1020         * typemanager (GetConstructor): Make public.
1021
1022 2005-04-05  John Luke  <john.luke@gmail.com>
1023             Raja R Harinath  <rharinath@novell.com>
1024
1025         Fix #62232.
1026         * typemanager.cs (IsUnmanagedType): Check non-public fields of a
1027         struct too.  Return false quicker in a few cases.
1028         (VerifyUnManaged): Use it.
1029
1030 2005-04-05  Raja R Harinath  <rharinath@novell.com>
1031
1032         Fix #74041.
1033         * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
1034         not 'unreachable_seen'.
1035
1036 2005-04-04  Marek Safar  <marek.safar@seznam.cz>
1037
1038         * attribute.cs (Attribute.GetValue): Removed unused.
1039         
1040         * codegen.cs (CodeGen.TrimExt): Removed unused.
1041         
1042         * cs-parser.jay (output): Removed unused.
1043         
1044         * cs-tokenizer.cs (hex_digits): Removed unused.
1045         
1046         * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
1047         
1048         * expression.cs (Indirection.LoadExprValue): Removed unused.
1049         (ArrayCreation.ExpressionToArrayArgument): Removed unused.
1050         
1051         * iterators.cs (Iterator.param_types): Removed unused.
1052         
1053         * statement.cs (Goto.block): Removed unused.
1054         (ToplevelBlock.did): Removed unused.
1055         (Switch.ResolveConstantSwitch): Removed unused.
1056
1057 2005-04-01  Ben Maurer  <bmaurer@ximian.com>
1058
1059         * rootcontext.cs: Allow mcs to bootstrap with the compilation
1060         resetting thingy.
1061
1062 2005-04-19  Martin Baulig  <martin@ximian.com>
1063
1064         Merged r42462 from MCS and made it work for GMCS.
1065
1066         * class.cs (MethodCore.ds): Moved this field to `MemberBase'.
1067
1068         * generic.cs (GenericMethod.Define): Removed `return_type' argument.
1069
1070 2005-04-01  Raja R Harinath  <rharinath@novell.com>
1071
1072         Fix #74232 and cs0208-3.cs.
1073         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
1074         * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
1075         unmanaged type.  Don't use FieldBuilders when 't' is a
1076         TypeBuilder.  Use ModFlags and MemberType fields.
1077         * class.cs (MemberBase.member_type): Rename from MemberType.
1078         (MemberBase.MemberType): New property.  Determines member_type on
1079         demand.
1080         (MemberBase.DoDefine): Don't initialize MemberType here.
1081         (FieldMember.Define): Likewise.
1082
1083 2005-04-01  Marek Safar  <marek.safar@seznam.cz>
1084
1085         Fix #74241
1086         * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
1087         Attributes are emitted there.
1088         
1089 2005-04-01  Raja R Harinath  <rharinath@novell.com>
1090
1091         * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
1092         keyword in 'partial enum' too.
1093         * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
1094         is not allowed).
1095         Report from Kamil Skalski <nazgul@omega.pl>.
1096
1097         Fix #74309.
1098         * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
1099         have partial containers too.
1100
1101         * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
1102         in block' checks to Block.CheckInvariantMeaningInBlock.
1103         * statement.cs (Block.GetKnownVariableInfo): Make private.
1104         (Block.IsVariableUsedInChildBlock): Remove.
1105         (Block.IsVariableUsedInBlock): Likewise.
1106         (Block.CheckInvariantMeaningInBlock): New.  Show location of
1107         conflicting declaration.
1108         (Block.AddVariable): Make error messages less long-winded and more
1109         specific.  Show location of conflicting declaration.
1110         * parameter.cs (Parameters.Location): New readonly property.
1111
1112 2005-03-31  Raja R Harinath  <rharinath@novell.com>
1113
1114         Clean up semantics of invoking ResolveMemberAccess.
1115         * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
1116         can have an instance, ensure that we pass in a non-TypeExpression
1117         to ResolveMemberAccess.  Tighten up IdenticalNameAndTypeName checks.
1118         (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
1119         argument.  Update to changes and simplify.
1120         (FieldExpr.Emitinstance): Remove CS0120 check.
1121         (PropertyExpr.EmitInstance): Likewise.
1122         * expression.cs (Argument.Resolve): Likewise.
1123         (Invocation.DoResolve): Update to changes in semantics of
1124         InstanceExpression.
1125
1126 2005-03-31  Marek Safar  <marek.safar@seznam.cz>
1127
1128         Fix #74241
1129         * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
1130         customization.
1131         
1132         * decl.cs (MemberCache.AddMethods): Fix infinite loop.
1133
1134 2005-03-31  Raja R Harinath  <rharinath@novell.com>
1135
1136         Fix difference in behaviour with commandline invocation.
1137         * driver.cs (Driver.Reset): New.
1138         (CompilerCallableEntryPoint): Call it.
1139
1140         * statement.cs (If.Resolve): Avoid spurious "uninitialized
1141         variable" warnings if the boolean expression failed to resolve.
1142
1143 2005-03-30  Sebastien Pouliot  <sebastien@ximian.com>
1144
1145         * attribute.cs: Fix the union of several permissions when some of them
1146         are unrestricted (so the result isn't an unrestricted permission set).
1147         Fix #74036.
1148
1149 2005-03-30  Raja R Harinath  <rharinath@novell.com>
1150
1151         * ecore.cs (MemberExpr): New class.  Convert from interface
1152         IMemberExpr.
1153         (MemberExpr.ResolveMemberAccess): Refactor and move here from
1154         MemberAccess.ResolveMemberAccess.  Tighten up pre-conditions and
1155         error checks.
1156         (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
1157         (MethodGroupExpr.IsExplicitImpl): Remove.
1158         (Expression.GetFieldFromEvent): Remove.
1159         (SimpleName.MemberStaticCheck): Remove.
1160         (SimpleName.DoSimpleNameResolve): Update to changes.
1161         * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
1162         (MemberAccess.IdenticalNameAndTypeName): Remove.
1163         (MemberAccess.error176): Move to MemberExpr.
1164         (MemberAccess.DoResolve): Update to changes.
1165         (BaseAccess.DoResolve): Likewise.
1166
1167 2005-03-30  Marek Safar  <marek.safar@seznam.cz>
1168
1169         C# 2.0 Conditional attribute class implementation
1170         
1171         * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
1172         Analyzes class whether it has attribute which has ConditionalAttribute
1173         and its condition is not defined.
1174         
1175         * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
1176         (Class.IsExcluded): New method. Search for at least one defined
1177         condition in ConditionalAttribute of attribute class.
1178
1179 2005-03-30  Raja R Harinath  <rharinath@novell.com>
1180
1181         * ecore.cs (PropertyExpr): Derive from Expression, not
1182         ExpressionStatement.
1183         (PropertyExpr.EmitStatement): Remove.
1184
1185 2005-03-29  Raja R Harinath  <rharinath@novell.com>
1186
1187         Fix #74060.
1188         * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
1189         internal field "value__" of an enum be private.  The examples for
1190         "value__" that I found on MSDN all used FieldAttributes.Private.
1191
1192         * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
1193         Don't mention IL method attribute names.
1194
1195         Fix #47991.  Remove a TODO.
1196         * statement.cs (Block.Toplevel): Make into a field.
1197         (Block.Parameters): Move into ToplevelBlock.
1198         (Block.known_variables): Rename from child_variable_names.
1199         (Block.Block): Remove variants that take Parameters.  Initialize
1200         'Toplevel' with the immediately surrounding toplevel block.
1201         (Block.AddKnownVariable): Rename from AddChildVariableName.  Add a
1202         LocalInfo parameter.
1203         (Block.GetKnownVariableInfo): New.
1204         (Block.IsVariableNameUsedInChildBlock): Update.
1205         (Block.IsVariableNameUsedInBlock): New.  Checks if a name is used in
1206         the block, even though it may not be in scope.
1207         (Block.AddVariable): Remove Parameters parameter.  Use
1208         Toplevel.Parameters instead.
1209         (Block.AddConstant): Remove Parameters parameter.
1210         (Block.GetParameterReference): Update to use Toplevel.Parameters.
1211         (Block.IsParamaterReference): Likewise.
1212         (Block.IsLocalParameter): Likewise.  Simplify a lot.
1213         (ToplevelBlock.Parameters): New.  Moved from Block.
1214         (ToplevelBlock.ToplevelBlock): Update to changes.  Always
1215         initialize Parameters to a non-null value.
1216         * cs-parser.jay: Update to changes.
1217         * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
1218         simple names that mean different things in the same block.  Use
1219         Block.IsVariableNameUsedInBlock.
1220
1221 2005-03-28  Raja R Harinath  <rharinath@novell.com>
1222
1223         * enum.cs (Enum.LookupEnumValue): Remove debugging code.
1224
1225 2005-03-26  Raja R Harinath  <harinath@acm.org>
1226
1227         Fix #73038.
1228         * assign.cs (Assign.DoResolve): When the RHS of an assignment
1229         fails to resolve, ensure that the LHS is still resolved as an
1230         lvalue.
1231
1232 2005-03-25  Raja R Harinath  <harinath@acm.org>
1233
1234         * enum.cs (Enum.DefineType): Set ec.InEnumContext and
1235         ec.ContainerType.
1236         (Enum.current_ec): Remove.
1237         (Enum.LookupEnumValue): Remove EmitContext argument.
1238         Just uses the one created during DefineType.
1239         (Enum.FindMembers): Update.
1240         * expression.cs (MemberAccess.DoResolve): Update.
1241
1242 2005-03-22  Marek Safar  <marek.safar@seznam.cz>
1243
1244         * assign.cs (Assign.DoResolve): Check for CS1717 when
1245         source and target are same (uses Equals).
1246
1247         * expression.cs (LocalVariableReference, ParameterReference,
1248         This): Implemented Equals, GetHashCode.
1249
1250         * statement.cs (Block.GetParameterReference): Removed useless
1251         local variable.
1252
1253 2005-03-22  Raja R Harinath  <rharinath@novell.com>
1254
1255         Fix cs0128.cs
1256         * statement.cs (Block.AddVariable): Ensure that we skip implicit
1257         blocks before deciding whether the error is cs0136 or cs0128.
1258
1259         * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
1260         (using_alias_directive, using_namespace_directive): Pass
1261         MemberName, not an expression to Namespace.UsingAlias and
1262         Namespace.Using.
1263         (MakeName): Use the MemberName of the namespace.
1264         * namespace.cs (Namespace.MemberName): New.
1265         (UsingEntry.UsingEntry): Take a MemberName, not an expression.
1266         (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
1267         Likewise.
1268         * decl.cs (MemberName.Name): Make readonly.
1269         (MemberName.FromDotted): New "constructor".
1270         (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
1271         (MemberCore.Name): Compute from MemberName on demand.
1272         (MemberCore.SetMemberName): Provide a way to change the
1273         MemberName.
1274         (MemberCore.AddToContainer): Don't take a fullname parameter.
1275         * class.cs (TypeContainer.AddToMemberContainer): Don't add the
1276         fully qualified name of the container to the member name.
1277         (TypeContainer.AddToTypeContainer): Use a fully qualified name
1278         only if the type is a member of the root container.
1279         (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
1280         MemberName.Left rather than searching for an embedded ".".
1281         (PartialContainer.CreatePart): Update to changes in RootContext.
1282         (MemberBase.ShortName): Turn into a property.  Use
1283         MemberCore.SetMemberName.
1284         (MemberBase.ExplicitInterfaceName): Remove.
1285         (MemberBase.UpdateMemberName): Remove.
1286         (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
1287         (PropertyBase.SetMemberName): New override.
1288         * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
1289         (Tree.GetDecl): New.
1290         (Tree.AllDecls): Rename from Decls.
1291         * attribute.cs, enum.cs, report.cs: Update to changes.
1292         * driver.cs (MainDriver): Use MemberName.FromDotted on
1293         RootContext.MainClass.
1294
1295 2005-03-21  Marek Safar  <marek.safar@seznam.cz>
1296
1297         * class.cs (FixedField.Define): Check for CS1664 and more sanity
1298         checks.
1299
1300         * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
1301
1302 2005-03-18  Marek Safar  <marek.safar@seznam.cz>
1303
1304         * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
1305         property accessor modifiers.
1306
1307         * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
1308         fixed buffer attribute (CS1716).
1309         (PropertyMethod.HasCustomAccessModifier): When property accessor
1310         has custom modifier.
1311
1312         * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
1313         modifiers.
1314         (PropertyExpr.DoResolveLValue): Add CS0272.
1315
1316 2005-03-17  Miguel de Icaza  <miguel@novell.com>
1317
1318         * convert.cs: When converting to a pointer, use the proper Conv.U
1319         or Conv.I depending on the source data type.
1320
1321         * cs-tokenizer.cs: Make the size for large decimal constants,
1322         fixes #72957.
1323
1324 2005-03-17  Martin Baulig  <martin@ximian.com>
1325
1326         * anonymous.cs (AnonymousMethod.method_modifiers): Change default
1327         from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'.  Fixes #73260.
1328
1329 2005-03-17  Martin Baulig  <martin@ximian.com>
1330
1331         * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
1332         to bool so we can return an error condition.
1333         (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
1334         returned an error.
1335
1336 2005-03-16  Zoltan Varga  <vargaz@freemail.hu>
1337
1338         * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
1339         attributes.
1340
1341 2005-03-16  Raja R Harinath  <rharinath@novell.com>
1342
1343         Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
1344         Refactor to avoid traversing the list of assemblies, and to avoid
1345         string concatenation.
1346         * typemanager.cs (guid_attr_type): Remove.
1347         (negative_hits, pointers, references): Remove hashes.
1348         (type_hash): New.
1349         (GetConstructedType): New.  Uses type_hash to handle constructed
1350         types (arrays, references, pointers).
1351         (GetReferenceType, GetPointerType): Use it.
1352         (GetNestedType): New.  Uses type_hash to handle nested types of
1353         reflected types.
1354         (LookupType, LookupTypeDirect): Remove.
1355         (CoreLookupType): Inline parts of old LookupTypeDirect code.  Use
1356         'types' hash and LookupTypeReflection directly.
1357         (params_string, params_object): Use GetConstructedType.
1358         * namespace.cs (Namespace.cached_types): New.  Cache of reflected
1359         top-level types.
1360         (Namespace.Lookup): Use cached_types.
1361         (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
1362         provided by old TypeManager.LookupType.
1363         * rootcontext.cs (MakeFQN): Remove.
1364         * decl.cs (DeclSpace.MakeFQN): Likewise.
1365         (DeclSpace.LookupType): Use TypeManager.GetNestedType.
1366         * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
1367         TypeManager.GetConstructedType.
1368         * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
1369
1370 2005-04-16  Zoltan Varga  <vargaz@freemail.hu>
1371
1372         * cs-parser.jay: Fix build.
1373
1374 2005-03-15  Marek Safar  <marek.safar@seznam.cz>
1375
1376         * class.cs (TypeContainer.CircularDepException) New nested
1377         (MethodCore.CheckBase): Report CS1715 for properties and indexers.
1378
1379         * cs-parser.jay: Reports CS1527 for any namespace element.
1380
1381         * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
1382         Added CS0407.
1383
1384         * expression.cs (ParameterReference.IsAssigned): Changed error to
1385         CS0269.
1386         (Error_WrongNumArguments): Moved CS0245 detection here.
1387
1388         * statement.cs (Return.Resolve): Add CS1622 report.
1389
1390 2005-03-11  Marek Safar  <marek.safar@seznam.cz>
1391
1392         * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
1393
1394 2005-03-11  Zoltan Varga  <vargaz@freemail.hu>
1395
1396         * attribute.cs expression.cs: Get rid of some allocations.
1397
1398 2004-03-11  Atsushi Enomoto  <atsushi@ximian.com>
1399
1400         * doc.cs : just eliminate the latest change.
1401
1402 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
1403
1404         * doc.cs : commented out the latest change. It breaks xml-030.cs
1405
1406 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
1407
1408         * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
1409           fail. So invoke CreateType() in FindDocumentedType().
1410
1411 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
1412
1413         * cs-tokenizer.cs : added IsKeyword().
1414         * doc.cs : Detect keyword incorrectly used as identifier.
1415           Allow identifiers prefixed by @.
1416
1417 2005-03-10  Marek Safar  <marek.safar@seznam.cz>
1418
1419         * attributes.cs (Attributes.Emit): Continue after CheckTargets.
1420         It caused exception in namespace resolving (again!).
1421         
1422         * class.cs (Class.ctor): Removed exit.
1423         (PropertyMethod.ctor): ditto.
1424         
1425         * codegen.cs (Codegen.Reset): Reset static data.
1426         (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
1427         
1428         * cs-tokenizer.cs (Cleanup): Removed.
1429         
1430         * driver.cs (GetSystemDir): Rewrote to one line command.
1431         It caused problem with unloaded dynamic modules.
1432         (UnixParseOption): Removed Exit.
1433         (CompilerCallableEntryPoint.InvokeCompiler): Make static.
1434         (CompilerCallableEntryPoint.Reset): Reset suitable static data.
1435         Now can be mcs used as library.
1436         
1437         * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
1438         empty location.
1439         
1440         * location.cs (Reset): Reset static data.
1441         
1442         * namespace.cs (Reset): Reset static data.
1443         
1444         * report.cs (Report.Reset): Reset static data.
1445         
1446         * rootcontext.cs (RootContext.Reset): Reset static data.
1447         
1448         * tree.cs (RootTypes.ctor): Use Location.Null
1449         
1450         * typemanager.cs (TypeManager.Reset): Reset static data.
1451         (CoreLookupType): Removed Exit.
1452         (TypeHandle.Reset): Reset static data.
1453         
1454 2005-03-10  Raja R Harinath  <rharinath@novell.com>
1455
1456         Fix #73516.
1457         * typemanager.cs (ComputeNamespaces): Import namespaces from
1458         referenced modules too.
1459
1460 2005-03-09  Raja R Harinath  <rharinath@novell.com>
1461
1462         * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
1463         than '.'.
1464
1465 2005-03-09  Raja R Harinath  <rharinath@novell.com>
1466
1467         * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
1468         enclosing DeclSpace.  This ensures that a name-lookup populates
1469         more caches and there are fewer 'TypeExpression's.  Carve out
1470         nested type lookup into ...
1471         (LookupNestedTypeInHierarchy): ... this.
1472
1473 2005-04-15  Martin Baulig  <martin@ximian.com>
1474
1475         Merged r41590 from MCS and make it work in the generics land.
1476
1477         * generic.cs (TypeParameter.UpdateConstraints): Removed the
1478         `check' argument.
1479
1480         * class.cs (PartialContainer.UpdateConstraints): Removed.
1481         (PartialContainer.CheckConstraints): Removed.
1482         (PartialContainer.SetParameterInfo): Store the constraints here.
1483         (PartialContainer.DefineTypeParameters): New public method;
1484         resolve the type parameter's constraints here.  Note that the
1485         PartialContainer doesn't have an EmitContext anymore, so we must
1486         do this in the ClassPart.
1487
1488 2005-03-09  Raja R Harinath  <rharinath@novell.com>
1489
1490         Clean up a few partial-class semantics.  
1491         Fixes test-357.cs and cs1618-2.cs.
1492         * cs-parser.jay (struct_declaration): Use 'current_class' as
1493         parent of newly-created struct.  Remove call to Register ().
1494         Use 'pop_current_class' to complete handing the current struct.
1495         (interface_declaration): Likewise.
1496         (class_declaration): Likewise.
1497         (enum_declaration): Use 'current_class' as parent of newly created
1498         enum.
1499         (delegate_declaration): Likewise.
1500         (pop_current_class): New function.  This is used to handle closing
1501         up the 'current_class' and 'current_container', and pointing them
1502         to the enclosing class/container.
1503         (CSharpParser): Initialize 'current_class' too.
1504         * decl.cs (MemberCore): Add check for invariant: a partial
1505         container is not a parsed entity, and thus does not enclose any
1506         parsed members.
1507         (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
1508         (DeclSpace.BaseTypeExpr): Use it.
1509         (DeclSpace.LookupType): Add check for invariant.
1510         * class.cs (TypeContainer): Add check for invariant: a nested
1511         class should have the same NamespaceEntry as its enclosing class.
1512         (TypeContainer.EmitFieldInitializers): Make virtual.
1513         (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
1514         MemberCore.
1515         (TypeContainer.Register): Remove.
1516         (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
1517         null.  Use TypeResolveEmitContext for resolving base types and
1518         interfaces.  Move initialization of Parts.TypeBuilder here from
1519         ...
1520         (TypeContainer.DefineNestedTypes): ... here.
1521         (PartialContainer): Take a Namespace not a NamespaceEntry.
1522         (PartialContainer.Create): Don't use Register.  Call the
1523         appropriate Add... function directly.
1524         (ClassPart): Take both the PartialContainer and the enclosing
1525         class as constructor arguments.
1526         (ClassPart.EmitFieldInitializers): Override.
1527         (ClassPart.PartFindNestedTypes): Remove.
1528         (FieldBase.GetInitializerExpression): Resolve the initializer
1529         expression in the emit context of the enclosing class.
1530         * tree.cs (RootTypes): Remove Register ().
1531         
1532 2005-03-08  Marek Safar  <marek.safar@seznam.cz>
1533
1534         * cs-parser.jay: Removed CS0134.
1535         
1536         * driver.cs: Removed CS1901.
1537         
1538         * expression.cs (SizeOf.DoResolve): Don't report CS0233
1539         for predefined types.
1540
1541 2005-03-07  Duncan Mak  <duncan@novell.com>
1542
1543         * codegen.cs (Save):  Catch UnauthorizedAccessException as
1544         well. Fixes bug #73454.
1545
1546 2005-03-07  Marek Safar  <marek.safar@seznam.cz>
1547
1548         * cs-tokenizer.cs (xtoken): Add CS1035.
1549         
1550         * class.cs (MethodData.Define): Add CS0683.
1551         (FieldMember.ctor): Add CS0681.
1552
1553 2005-03-07  Raja R Harinath  <rharinath@novell.com>
1554
1555         * ecore.cs (SimpleName.DoResolve): Rename from
1556         SimpleName.DoResolveAllowStatic.
1557         (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
1558         Pass 'intermediate' flag to MemberStaticCheck.
1559         (SimpleName.MemberStaticCheck): Skip "static check" only in case
1560         of "intermediate" lookups via MemberAccess.
1561         (SimpleName.IdenticalNameAndTypeName): New.  Carved out of ...
1562         * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
1563
1564 2005-03-07  Raja R Harinath  <rharinath@novell.com>
1565
1566         Fix #73394.
1567         * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
1568         slipped in because of variable names that are identical to a
1569         builtin type's BCL equivalent ('string String;', 'int Int32;').
1570         (PropertyExpr.EmitInstance): Likewise.
1571
1572 2005-03-04  Marek Safar  <marek.safar@seznam.cz>
1573
1574         * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
1575         
1576         * report.cs (warning_ignore_table): Made public.
1577
1578 2005-03-04  Raja R Harinath  <rharinath@novell.com>
1579
1580         Fix #73282.
1581         * class.cs (MethodData.Emit): Pass 'container' to
1582         container.GetObsoleteAttribute instead of 'container.Parent'.
1583
1584 2005-03-03  Marek Safar  <marek.safar@seznam.cz>
1585
1586         * cs-parser.jay: Add 1534 error test.
1587
1588         * iterators.cs (Yield.CheckContext): Add error 1629.
1589         (Iterator.ctor): Save unsafe modifier.
1590         (MoveNextMethod.DoEmit): Restore unsafe context.
1591
1592         * namespace.cs (UsingAlias): Better error message.
1593
1594 2005-03-03  Dan Winship  <danw@novell.com>
1595
1596         * convert.cs (Error_CannotImplicitConversion): fix two bugs in
1597         the warning message [#73219]
1598
1599 2005-03-03  Raja R Harinath  <rharinath@novell.com>
1600
1601         Fix compile with MCS 1.0.0.0.
1602         * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
1603         w_restore to not depend on string constant folding.
1604
1605 2005-03-03  Raja R Harinath  <rharinath@novell.com>
1606
1607         * decl.cs (DeclSpace.LookupType): Remove 'silent' argument.  Move
1608         CS0246 check to users who passed 'silent = false'.
1609         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
1610         check.
1611         (SimpleName.SimpleNameResolve): Update.
1612         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
1613         (MemberAccess.IdenticalNameAndTypeName): Update.
1614         * doc.cs (FindDocumentedTypeNonArray): Update.
1615
1616 2005-03-03  Raja R Harinath  <rharinath@novell.com>     
1617
1618         * codegen.cs (EmitContext): Remove ResolvingTypeTree.
1619         * parameters.cs (ComputeAndDefineParameters): Remove.
1620         * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
1621         * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
1622         Use GetParameterInfo.
1623
1624 2005-03-02  Marek Safar  <marek.safar@seznam.cz>
1625
1626         * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
1627
1628 2005-03-02  Raja R Harinath  <rharinath@novell.com>
1629
1630         Unify DeclSpace.LookupType and DeclSpace.FindType.
1631         * decl.cs (DeclSpace.FindNestedType): New virtual function.  This
1632         is in charge of defining nested types on demand.
1633         (DeclSpace.LookupType): Use it when the current_type is a
1634         TypeBuilder.  Use LookupTypeDirect for reflected types.
1635         (DeclSpace.FindType): Remove.
1636         (DeclSpace.LookupInterfaceOrClass): Likewise.
1637         (DeclSpace.DefineTypeAndParents): Likewise.
1638         * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
1639         DeclSpace.LookupType.
1640         * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
1641         * typemanager.cs (LookupType): Simplify.
1642         (AddUserType): Remove type from negative_hits.
1643         * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
1644         * class.cs (TypeContainer.FindMembers): Move handling of nested
1645         types ...
1646         (TypeContainer.FindMembers_NestedTypes): ... here.
1647         (TypeContainer.FindNestedType): Implement override.
1648         (ClassPart.FindNestedType): Delegate to PartialContainer.
1649         (ClassPart.PartFindNestedType): Looks up the nested types of the
1650         part alone.
1651
1652 2005-04-14  Martin Baulig  <martin@ximian.com>
1653
1654         * generic.cs (ConstructedType): Moved all the type lookup and
1655         nested class logic into SimpleName.
1656         (ConstructedType.ResolveConstructedType): Our underlying type is
1657         already fully resolved; all the type lookup stuff is in
1658         SimpleName.
1659
1660         * ecore.cs (SimpleName.ResolveAsTypeStep): Resolve nested
1661         constructed types here instead of in ConstructedType.
1662
1663         * decl.cs (MemberName.GetTypeExpression): Always create a
1664         SimpleName, not a ConstructedType.
1665         (DeclSpace.ResolveNestedType): Removed; this is now in SimpleName.
1666
1667 2005-03-02  Martin Baulig  <martin@ximian.com>
1668
1669         * class.cs (TypeContainer.DoDefineMembers): We also need a default
1670         static constructor in static classes.
1671
1672 2005-03-01  Zoltan Varga  <vargaz@freemail.hu>
1673
1674         * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
1675         sizeParamIndex is not specified.
1676
1677 2005-03-01  Marek Safar  <marek.safar@seznam.cz>
1678
1679         Fix #73117
1680         * report.cs (WarningMessage.IsEnabled): Missing null check.
1681
1682 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
1683
1684         * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
1685         in the fields and not in the properties.
1686
1687 2005-02-28  Zoltan Varga  <vargaz@freemail.hu>
1688
1689         * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex 
1690         fields as well.
1691
1692 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
1693
1694         * attribute.cs: Small refactoring (improved robustness).
1695         (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
1696         (ValidateGuid): Removed.
1697         (Resolve): Removed referenced to above mentioned.
1698         (GetAttributeUsage): Made private and changed to work without
1699         class assistance.
1700         (GetIndexerAttributeValue): Don't crash.
1701         (GetConditionalAttributeValue): Ditto.
1702         (GetClsCompliantAttributeValue): Ditto.
1703         (ExtractSecurityPermissionSet): All attributes exceptions are
1704         error 648.
1705         (GetPropertyValue): New helper.
1706         (GetMethodImplOptions): New method.
1707         (DefinePInvokeMethod): Reuse common code. Implemented handling of
1708         some missing properties.
1709         
1710         * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
1711         (Method.ApplyAttributeBuilder): Updated.
1712         
1713         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
1714         exception.
1715
1716 2005-02-28  Raja R Harinath  <rharinath@novell.com>
1717
1718         Fix #73052.
1719         * report.cs (Report.SymbolRelatedToPreviousError): Handle
1720         non-simple types (array, pointer, reference).
1721
1722 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
1723
1724         * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
1725
1726         * class.cs (MethodCore.IsDuplicateImplementation): Special error
1727         for operators.
1728         (Method.CheckBase): Catch wrong destructor here.
1729         (MethodData.Define): Add errors 550, 668.
1730
1731         * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
1732
1733         * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
1734
1735         * pending.cs (VerifyPendingMethods): Add error 551.
1736
1737         * typemanager.cs (CSharpName): Next error report helper.
1738
1739 2005-02-25  Marek Safar  <marek.safar@seznam.cz>
1740
1741         * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
1742         attributes. Removed useless attribute double check.
1743         It saves almost 2MBs for corlib.
1744
1745 2005-02-25  Raja R Harinath  <rharinath@novell.com>
1746
1747         Fix #72924.
1748         * statement.cs (ExpressionStatement.Resolve): Make robust to being
1749         called twice in case of error.
1750
1751 2005-02-23  Chris Toshok  <toshok@ximian.com>
1752
1753         Fix compiler portions of #72827.
1754         * statement.cs (Block.Emit): call Begin/EndScope on the
1755         EmitContext instead of the ILGenerator.
1756
1757         * codegen.cs (EmitContext.BeginScope): new method, call
1758         ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
1759         we have one.)
1760         (EmitContext.BeginScope): same, but EndScope and CloseScope
1761
1762         * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
1763         offset and call the superclass's OpenScope(int) with it.
1764         (SymbolWriter.CloseScope): get the current il
1765         offset and call superclass's CloseScope(int) with it.
1766
1767 2005-02-23  Marek Safar  <marek.safar@seznam.cz>
1768
1769         * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
1770         CS1677 for out and ref as well.
1771
1772         * class.cs (Method.Define): Add error CS1599 detection.
1773         
1774         * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
1775         
1776         * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
1777         
1778         * delegate.cs (Delegate.Define): Add error CS1599 detection.
1779         
1780         * support.cs.cs (ModifierDesc): New helper method.
1781
1782 2005-02-23  Raja R Harinath  <rharinath@novell.com>
1783             Abin Thomas  <projectmonokochi@rediffmail.com>
1784             Anoob V E  <projectmonokochi@rediffmail.com>
1785             Harilal P R  <projectmonokochi@rediffmail.com>
1786
1787         Fix #57851, #72718.
1788         * class.cs (ConstructorBuilder.Resolve): Make sure that the second
1789         MemberLookup (used for error reporting) actually returns a result.
1790         Fix error report number (122, not 112).
1791
1792 2005-02-22  Abin Thomas  <projectmonokochi@rediffmail.com>
1793             Anoob V E  <projectmonokochi@rediffmail.com>
1794             Harilal P R  <projectmonokochi@rediffmail.com>
1795
1796         Fix #71134.
1797         * pending.cs (PendingImplementation.GetAbstractMethods):
1798         Find NonPublic members too.
1799
1800 2005-02-22  Marek Safar  <marek.safar@seznam.cz>
1801
1802         * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
1803         Fixed error 217.
1804         
1805         * class.cs (MethodCore.CheckMethodAgainstBase):
1806         Add error 239 report.
1807
1808 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
1809
1810         * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
1811         
1812         * class.cs (Operator.Define): Add error 217 report.
1813         
1814 2005-02-21  Raja R Harinath  <rharinath@novell.com>
1815
1816         Fix #68955.
1817         * expression.cs (Invocation.IsApplicable): Make public.
1818         (Invocation.IsParamsMethodApplicable): Likewise.
1819         * delegate.cs (Delegate.VerifyApplicability): Don't use
1820         Invocation.VerifyArgumentCompat for parameter applicability
1821         testing.  Use Invocation.IsApplicable and
1822         Invocation.IsParamsMethodApplicable.
1823
1824 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
1825
1826         * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
1827         
1828         * class.cs (Operator.Define): Add error 217 report.
1829         
1830 2005-02-21  Raja R Harinath  <rharinath@novell.com>
1831
1832         * namespace.cs (UsingEntry.Resolve): Undo change below.
1833
1834 2005-02-21  Raja R Harinath  <rharinath@novell.com>
1835
1836         Fix #72756.
1837         * ecore.cs (Expression.MemberLookupFailed): Add argument to
1838         disable the error message when the extended MemberLookup also
1839         fails.
1840         (Expression.MemberLookupFinal): Update.
1841         (SimpleName.DoSimpleNameResolve): Update.
1842         * expression.cs (MemberAccess.ResolveNamespaceOrType):
1843         Don't use MemberLookupFinal.
1844         (New.DoResolve): Update.
1845         (BaseAccess.CommonResolve): Update.
1846
1847 2005-02-21  Raja R Harinath  <rharinath@novell.com>
1848
1849         Fix #72732.
1850         * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
1851         occured previously, don't resolve again.
1852
1853 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
1854
1855         Fix #69949
1856         * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
1857         argument. Call ResolveAttributeUsage for unresolved.
1858         when types doesn't match ctor arguments.
1859         
1860         * class.cs (DoDefineMembers.TypeContainer): Removed safety check
1861         for nested attribute classes.
1862         (Class.attribute_usage): Removed.
1863         (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
1864         for attribute class.
1865         
1866         * ecore.cs (IsAttribute): Removed.
1867         
1868         * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
1869         
1870         * rootcontext.cs (RegisterAttribute): Removed, attributes are
1871         now normal types.
1872         (attribute_types): Removed.
1873         (EmitCode): Global attributes are emited as the latest.
1874
1875 2005-02-18  Marek Safar  <marek.safar@seznam.cz>
1876
1877         * class.cs (EmitFieldInitializers): Don't emit field initializer
1878         for default values when optimilization is on.
1879         
1880         * constant.cs (Constant.IsDefaultValue): New property.
1881         
1882         * driver.cs: Add /optimize handling.
1883         
1884         * constant.cs,
1885         * ecore.cs,
1886         * literal.cs: Implement new IsDefaultValue property.
1887         
1888         * rootcontext.cs (Optimize): New field, holds /optimize option.
1889
1890 2005-02-18  Raja R Harinath  <rharinath@novell.com>
1891
1892         Fix crasher in re-opened #72347.
1893         * namespace.cs (Namespace.Lookup): Return null if
1894         DeclSpace.DefineType returns null.
1895
1896         Fix #72678.
1897         * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
1898
1899 2005-02-18  Raja R Harinath  <rharinath@novell.com>
1900
1901         Fix remainder of #63202.  Change semantics of DoResolveLValue: it
1902         now returns null if it cannot resolve to an lvalue.
1903         * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
1904         (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
1905         returned null.  Remove check for SimpleName.
1906         (EventExpr.DoResolveLValue): New.
1907         * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
1908         * expression.cs (Argument.Error_LValueRequired): New.  Move CS1510
1909         error from ...
1910         (Argument.Resolve): ... here.  Use it.  Use DoResolveLValue to
1911         avoid CS0131 error.
1912         (Unary.ResolveOperator): Move CS0211 check ...
1913         (Unary.DoResolve): ... here.  Use DoResolveLValue to avoid
1914         CS0131 error.
1915         (Unary.DoResolveLValue): Simplify.
1916         (AddressOf.DoResolveLValue): New.
1917         (ArrayAccess.DoResolveLValue): New.
1918
1919 2005-02-16  Marek Safar  <marek.safar@seznam.cz>
1920
1921         * attribute.cs (Attribute.Resolve): Add arguments casting for
1922         when types doesn't match ctor arguments.
1923
1924 2005-02-16  Raja R Harinath  <rharinath@novell.com>
1925
1926         Fix parts of #63202.
1927         * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
1928         lookup of operator in base type.  Ensure that all checks happen
1929         when the operator resolves to an "op_..." method.
1930
1931 2005-02-15  Raja R Harinath  <rharinath@novell.com>
1932
1933         Fix #71992.
1934         * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
1935         'ignore_cs0104' parameter.  Pass it to ...
1936         (NamespaceEntry.Lookup): ... this.
1937         * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
1938         * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
1939         (TypeLookupExpression.DoResolveAsTypeStep): Update.
1940         * expression.cs (MemberAccess.IdenticalNameAndTypeName):
1941         Update.  Request that cs0104 errors be ignored.
1942         (ComposedCast.ResolveAsTypeStep): Update.
1943
1944 2005-02-14  Raja R Harinath  <rharinath@novell.com>
1945
1946         Fix #59209.
1947         * expression.cs (Invocation.BetterFunction): Remove support for
1948         comparing virtual functions and their overrides.
1949         (Invocation.IsOverride): New.
1950         (Invocation.OverloadResolve): Don't consider 'override' functions
1951         during candidate selection.  Store them in a lookaside list.
1952         If the selected method is a 'virtual' function, use the list to
1953         find any overrides that are closer to the LHS type.
1954
1955 2005-02-14  Marek Safar  <marek.safar@seznam.cz>
1956
1957         * expression.cs (New.DoResolve): Add complex core type reduction.
1958         (New.Constantify): Converts complex core type syntax like 'new int ()'
1959         to simple constant.
1960         
1961 2005-02-14  Raja R Harinath  <rharinath@novell.com>
1962
1963         * decl.cs (EntryType.EntryType): New constructor to create an
1964         updated copy of a cache entry.
1965         (MemberCache.AddMethods): Use it.
1966         (MemberCache.ClearDeclaredOnly): Remove.
1967         (MemberCache.MemberCache): Update.
1968
1969 2005-02-11  Miguel de Icaza  <miguel@novell.com>
1970
1971         * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
1972         variable.  This one is represents the actual low-level declaration
1973         of the method, as opposed to the semantic level `IsStatic'.   
1974
1975         An anonymous method which is hosted into a static method might be
1976         actually an instance method.  IsStatic would reflect the
1977         container, while MethodIsStatic represents the actual code
1978         generated.
1979
1980         * expression.cs (ParameterReference): Use the new MethodIsStatic
1981         instead of IsStatic.
1982
1983         * anonymous.cs (AnonymousMethod.Compatible): Pass the
1984         Modifiers.STATIC to the Anonymous' Method EmitContext if static is
1985         set on the current EmitContext. 
1986
1987         * expression.cs (Cast): Overload DoResolveLValue so we can pass
1988         resolve our casted expression as an LValue.  This triggers the
1989         proper LValue processing that is later required by Assign.
1990
1991         This fixes 72347.
1992
1993         * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
1994
1995 2005-02-11  Marek Safar  <marek.safar@seznam.cz>
1996
1997         C# 2.0 Fixed buffer implementation
1998
1999         * anonymous.cs: Update after RegisterHelperClass renaming.
2000
2001         * attribute.cs (AttributeTester.fixed_buffer_cache):
2002         Cache of external fixed buffers.
2003         (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
2004         implementation if field is fixed buffer else null.
2005
2006         * class.cs
2007         (TypeContainer.AddField): Accept FieldMember instead of Field.
2008         (FieldBase.IsFieldClsCompliant): Extracted code from
2009         VerifyClsCompliance descendant customization.
2010         (FixedField): New class handles fixed buffer fields.
2011         (FixedFieldExternal): Keeps information about imported fixed
2012         buffer.
2013         (IFixedField): Make access to internal or external fixed buffer
2014         same.
2015
2016         * cs-parser.jay: Add fixed buffer parsing.
2017
2018         * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
2019         buffer.
2020
2021         * expression.cs (Indirection): Extended implementation to accept
2022         fixed buffer field.
2023         (PointerArithmetic.Emit): Get element from fixed buffer as well.
2024         (ElementAccess.MakePointerAccess): Get type as parameter.
2025         (DoResolve): Add fixed buffer field expression conversion.
2026         (DoResolveLValue): Ditto.
2027         (FixedBufferPtr): New class. Moved most of original ArrayPtr.
2028         (ArrayPtr): Derives from FixedBufferPtr.
2029         (ArrayPtr.Emit): Add extra emit for array elements.
2030
2031         * flowanalysis.cs.cs (StructInfo): Use FieldMember.
2032
2033         * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
2034         for compiler generated types.
2035         (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
2036
2037         * statement.cs (Fixed): Refactored to be easier add fixed buffer
2038         and consume less memory.
2039         (Fixed.Resolve): Add fixed buffer case.
2040
2041         * typemanager.cs (compiler_generated_attr_ctor,
2042         fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
2043         (HasElementType): Add our own implementation to work on every
2044         runtime.
2045
2046 2005-02-11  Miguel de Icaza  <miguel@novell.com>
2047
2048         * anonymous.cs (CaptureContext): Track whether `this' has been
2049         referenced.   
2050
2051         * expression.cs (This.ResolveBase): Call CaptureThis.  Before we
2052         only captured `this' if it was implicitly done (instance
2053         methods/variables were used). 
2054
2055         * codegen.cs (EmitContext.CaptureThis): New method to flag that
2056         `this' must be captured.
2057
2058 2005-01-30  Miguel de Icaza  <miguel@novell.com>
2059  
2060         * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
2061         is null it means that there has been no need to capture anything,
2062         so we just create a sibling.
2063
2064         Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
2065
2066         Just a partial fix.  The other half is fairly elusive.
2067         
2068 2005-02-10  Raja R Harinath  <rharinath@novell.com>
2069
2070         Fix #52586, cs0121-4.cs.
2071         * decl.cs (MemberCache.DeepCopy): Rename from SetupCache.  Take
2072         and return a hashtable.
2073         (MemberCache.ClearDeclaredOnly): New.
2074         (MemberCache.MemberCache): Update to change.  Make a deep copy of
2075         the method_hash of a base type too.
2076         (MemberCache.AddMethods): Adapt to having a deep copy of the base
2077         type methods.  Overwrite entries with the same MethodHandle so
2078         that the ReflectedType is correct.  The process leaves in base
2079         virtual functions and their overrides as distinct entries.
2080         (CacheEntry): Now a class instead of a struct.  It shouldn't alter
2081         matters since it was boxed in a ArrayList before.
2082         (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
2083         modifier.
2084         * expression.cs (Invocation.BetterFunction): Simplify.  Handle the
2085         case of a virtual function and its override (choose the overload
2086         as better).
2087         (Invocation.OverloadResolve): Avoid 'override' members during
2088         'applicable_type' calculation.
2089
2090 2005-03-28  Raja R Harinath  <rharinath@novell.com>
2091
2092         * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
2093         (TypeHandle.TypeHandle): Use LookupMemberCache rather than
2094         GetTypeHandle.  It is possible for a reflected type to derive from
2095         a TypeBuilder (e.g., int[] derives from the TypeBuilder
2096         System.Array during mscorlib compilation).
2097         * decl.cs (MemberCache.MemberCache): If the base cache doesn't
2098         contain a method_hash, don't create one either.  Don't create a
2099         deep copy of the base cache's method_hash.
2100         (MemberCache.SetupCache): Rename back from DeepCopy.
2101         (MemberCache.AddMethods): Rewrite, now that method_hash isn't
2102         already initialized.  If we see an override function, add its
2103         underlying base virtual function to the member_hash too.
2104
2105 2005-02-09  Raja R Harinath  <rharinath@novell.com>
2106
2107         Combine two near-redundant caches.
2108         * typemanager.cs (method_params): Rename from method_internal_params.
2109         (TypeManager.GetParameterData): New.  Replace
2110         Invocation.GetParameterData.
2111         (TypeManager.LookupParametersByBuilder): Remove.
2112         * expression.cs (Invocation.method_parameter_cache): Remove.
2113         (Invocation.GetParameterData): Remove.
2114         Update to changes.
2115         * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
2116         Update to changes.
2117
2118 2005-02-08  Raja R Harinath  <rharinath@novell.com>
2119
2120         Fix #72015.
2121         * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
2122         TypeManager.multicast_delegate_type is null, resolve it by looking
2123         up "System.MulticastDelegate".
2124         * rootcontext.cs (RootContext.ResolveCore): Simplify.
2125
2126 2005-02-07  Abin Thomas (NOSIP)  <projectmonokochi@rediffmail.com>
2127             Anoob V.E (NOSIP)  <projectmonokochi@rediffmail.com>
2128             Harilal P.R (NOSIP)  <projectmonokochi@rediffmail.com>
2129
2130         Fix cs0164.cs.
2131         * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
2132         (LabeledStatement.AddReference): New.  Set 'referenced'.
2133         (Goto.Resolve): Use it.
2134
2135 2005-02-05  John Luke  <john.luke@gmail.com>
2136
2137         * driver.cs: remove duplicate -doc line in Usage ()
2138
2139 2005-02-04  Raja R Harinath  <rharinath@novell.com>
2140
2141         * location.cs (Location.AddFile): Fix CS2002 error report.
2142
2143 2005-02-02  Martin Baulig  <martin@ximian.com>
2144
2145         * delegate.cs (Delegate.DefineType): Report an internal error if
2146         TypeManager.multicast_delegate_type is null.  See bug #72015 for
2147         details.        
2148
2149 2005-02-02  Raja R Harinath  <rharinath@novell.com>
2150
2151         Fix a crasher in a variant of #31984.
2152         * const.cs (Constant.CheckBase): New override that defers the
2153         new-or-override check in case the base type hasn't been populated
2154         yet.
2155         (Constant.Define): Ensure the new-or-override check is performed.
2156
2157 2005-02-01  Duncan Mak  <duncan@ximian.com>
2158
2159         * const.cs (LookupConstantValue): Check that `ce' is not null
2160         before calling GetValue ().
2161
2162 2005-02-01  Raja R Harinath  <rharinath@novell.com>
2163
2164         Fix test-334.cs (#69519).
2165         * cs-parser.jay (using_alias_directive): Pass in an expression to
2166         NamespaceEntry.UsingAlias.
2167         (using_namespace_directive): Pass in an expression to
2168         NamespaceEntry.Using.
2169         (namespace_name): Don't flatten to a string.
2170         * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
2171         (NamespaceEntry.AliasEntry.Resolve): Lookup using
2172         ResolveAsTypeStep.
2173         (NamespaceEntry.UsingEntry): Likewise.
2174         (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
2175         changes.
2176         (NamespaceEntry.LookupForUsing): Remove.
2177         (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
2178         names.
2179         (NamespaceEntry.Lookup): Remove support for dotted names.
2180
2181 2005-02-01  Raja R Harinath  <rharinath@novell.com>
2182
2183         * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
2184         split into two.
2185         (NamespaceEntry.ImplicitParent): Compute on demand.
2186         (NamespaceEntry.Doppelganger): New implicit namespace-entry that
2187         parallels the current.
2188         (NamespaceEntry.LookupForUsing): Use it.
2189         (NamespaceEntry.Lookup): If the current namespace-entry is
2190         implicit, don't search aliases and using tables.
2191
2192 2005-02-01  Raja R Harinath  <rharinath@novell.com>
2193
2194         Fix #31984.
2195         * class.cs (TypeContainer.DoDefineMembers): Don't initialize
2196         BaseCache here.
2197         (TypeContainer.BaseCache): Compute on demand.
2198         (TypeContainer.FindMembers): Define constants and types if they're
2199         not already created.
2200         (FieldMember.Define): Move resetting of ec.InUnsafe before error
2201         check.
2202         * const.cs (Constant.Define): Make idempotent.
2203
2204 2005-01-29  Miguel de Icaza  <miguel@novell.com>
2205
2206         * pending.cs: Produce better code (no nops produced by using Ldarg
2207         + value).
2208         
2209         * pending.cs (PendingImplementation.DefineProxy): It was not `arg
2210         i - 1' it should be arg + 1.
2211
2212         Fixes bug #71819.
2213
2214 2005-01-28  Raja R Harinath  <rharinath@novell.com>
2215
2216         * attribute.cs (Attribute.CheckAttributeType): Make private
2217         non-virtual.
2218         (Attribute.ResolveType): Make virtual.
2219         (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
2220         handling of RootContext.Tree.Types.
2221
2222 2005-01-27  Raja R Harinath  <rharinath@novell.com>
2223
2224         Update attribute-handling to use the SimpleName/MemberAccess
2225         mechanisms.
2226         * cs-parser.jay (attribute): Pass in an expression to the
2227         constructors of Attribute and GlobalAttribute.
2228         * attribute.cs (Attribute): Take an expression for the name.
2229         (Attribute.ResolvePossibleAttributeTypes): New.  Resolves the
2230         passed in attribute name expression.
2231         (Attribute.CheckAttributeType): Use it.
2232         * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
2233         * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
2234         (MemberAccess.ResolveNamespaceOrType): ... here.  Add 'silent'
2235         argument to prevent error messages if the lookup fails.
2236
2237 2005-01-27  Marek Safar  <marek.safar@seznam.cz>
2238
2239         * expression.cs (Indirection): Implemented IVariable interface
2240         to support indirection in AddressOf operator.
2241         (PointerArithmetic.Emit): Add optimalization for case where
2242         result can be precomputed.
2243
2244 2005-01-26  Martin Baulig  <martin@ximian.com>
2245
2246         * class.cs (TypeContainer.AttributeTargets): Return the correct
2247         AttributeTargets depending on our `Kind' instead of throwing an
2248         exception; fixes #71632.
2249
2250 2005-01-26  Marek Safar  <marek.safar@seznam.cz>
2251
2252         Fix #71257
2253         * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
2254         constant members.
2255
2256 2005-03-17  Martin Baulig  <martin@ximian.com>
2257
2258         * anonymous.cs (AnonymousMethod.method_modifiers): Change default
2259         from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'.  Fixes #73260.
2260
2261 2005-03-17  Martin Baulig  <martin@ximian.com>
2262
2263         * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
2264         to bool so we can return an error condition.
2265         (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
2266         returned an error.
2267
2268 2005-03-17  Martin Baulig  <martin@ximian.com>
2269
2270         * generic.cs (TypeMananager.IsIEnumerable): New public method.
2271
2272         * convert.cs (Convert.ImplicitReferenceConversion(Exists)): Allow
2273         converting from an array-type of T to `IEnumerable<T>'.
2274
2275 2005-03-16  Martin Baulig  <martin@ximian.com>
2276
2277         * generic.cs (Nullable.Unwrap): Implement IAssignMethod.
2278         (Nullable.LiftedUnaryMutator): New public class.
2279
2280         * expression.cs (UnaryMutator.DoResolve): Added support for
2281         Nullable Types.
2282
2283 2005-03-14  Martin Baulig  <martin@ximian.com>
2284
2285         * generic.cs (Nullable.NullCoalescingOperator): Implemented.
2286
2287 2005-03-14  Martin Baulig  <martin@ximian.com>
2288
2289         * generic.cs (Nullable.LiftedBinaryOperator): Added support for
2290         the comparision operators `<', `>', `<=' and `>='.
2291
2292 2005-03-13  Martin Baulig  <martin@ximian.com>
2293
2294         * generic.cs
2295         (Nullable.NullLiteral): Renamed to `Nullable.NullableLiteral' to
2296         avoid confusion with the `NullLiteral'.
2297         (Nullable.LiftedBinaryOperator): Correctly implement `==' and '!='.
2298
2299 2005-03-13  Martin Baulig  <martin@ximian.com>
2300
2301         * expression.cs (Binary.ResolveOperator): For `==' and `!=', allow
2302         comparing arbitrary types with the null literal.
2303
2304 2005-03-13  Martin Baulig  <martin@ximian.com>
2305
2306         * generic.cs (Nullable.LiftedBinaryOperator): Add support for the
2307         boolean operators '&&', '||', '&' and '|'.
2308         (Nullable.OperatorTrueOrFalse): New public class.
2309
2310         * ecore.cs (Expression.GetOperatorTrue/False): Return an `Expression'
2311         instead of a `StaticCallExpr'; added support for nullables.
2312
2313 2005-03-10  Martin Baulig  <martin@ximian.com>
2314
2315         * expression.cs
2316         (ArrayAccess.EmitDynamicInitializers): Use `etype.IsValueType'
2317         rather than `etype.IsSubclassOf (TypeManager.value_type)'.      
2318
2319 2005-03-07  Martin Baulig  <martin@ximian.com>
2320
2321         * generic.cs (Nullable.Unwrap): Implement IMemoryLocation and make
2322         it work if `expr' is not an IMemoryLocation.
2323         (Nullable.Lifted): Implement IMemoryLocation.
2324         (Nullable.LiftedConversion.ResolveUnderlying): Use the correct
2325         target type.
2326
2327 2005-03-05  Martin Baulig  <martin@ximian.com>
2328
2329         * generic.cs (Nullable.Unwrap, Wrap): New protected classes.
2330         (Nullable.Lifted): New abstract class; rewrote the lifted conversions.
2331         (Nullable): Added support for lifted unary and binary operators.
2332
2333         * expression.cs (Unary.DoResolve): Added support for nullable types.
2334         (Binary.DoResolve): Likewise.
2335         (Conditional.DoResolve): Likewise.
2336
2337 2005-03-02  Martin Baulig  <martin@ximian.com>
2338
2339         * decl.cs (DeclSpace.SetParameterInfo): Make this virtual.
2340
2341         * class.cs (ClassPart.SetParameterInfo): Override this.
2342         (PartialContainer.SetParameterInfo): Override this.
2343         (TypeContainer.CheckConstraints): New protected method.
2344         (PartialContainer.CheckConstraints): Override this and check
2345         whether the same contraints were specified in all parts of a
2346         partial generic type definition.
2347         (PartialContainer.UpdateConstraints): New public method.
2348
2349         * generic.cs (TypeParameter.UpdateConstraints): New public method.
2350
2351 2005-03-02  Martin Baulig  <martin@ximian.com>
2352
2353         Committing a patch from Carlos Alberto Cortez to fix #72887.
2354
2355         * convert.cs (Convert.ExplicitReferenceConversionExists): Allow
2356         casts from `T []' to `int []'.
2357
2358 2005-03-02  Martin Baulig  <martin@ximian.com>
2359
2360         * generic.cs (TypeManager.IsEqual): Make this symmetric.
2361
2362         * expression.cs (Binary.ResolveOperator): When resolving a
2363         BinaryDelegate, use `TypeManager.IsEqual (l, r)' rather than just
2364         `=='.  Fixes #71866.  See gen-127.cs.
2365
2366 2005-03-02  Martin Baulig  <martin@ximian.com>
2367
2368         * class.cs (TypeContainer.DoDefineMembers): We also need a default
2369         static constructor in static classes.
2370
2371 2005-03-02  Martin Baulig  <martin@ximian.com>
2372
2373         * generic.cs
2374         (NullableType.Name, NullableType.FullName): Add a "?" to the name.
2375         (Nullable.LiftedConversion): Added support for user-defined
2376         conversions.
2377
2378         * cs-tokenizer.cs (Tokenizer.PutbackCloseParens): New public method.
2379
2380         * cs-parser.jay: Use ComposedCast everywhere instead of
2381         NullableType, so we don't need to check for NullableType
2382         everywhere.
2383         (conditional_expression): Added `INTERR CLOSE_PARENS' rule for the
2384         case where we'll be resolved into a `parenthesized_expression_0'
2385         afterwards.
2386
2387         * convert.cs
2388         (Convert.UserDefinedConversion): Added nullable conversions.
2389
2390 2005-02-28  Martin Baulig  <martin@ximian.com>
2391
2392         * generic.cs (TypeManager.IsNullableType): New static method.
2393         (Nullable): New abstract class.
2394         (Nullable.NullLiteral): New public class.
2395         (Nullable.LiftedConversion): New public class.
2396
2397         * cs-parser.jay (non_expression_type): Changed `builtin_types' to
2398         `builtin_types opt_nullable'.
2399
2400         * convert.cs
2401         (Convert.ImplicitConversionStandard): Added nullable conversions.
2402         (Convert.ExplicitConversionStandard): Likewise.
2403         (Convert.ExplicitConversion): Likewise.
2404
2405 2005-02-26  Martin Baulig  <martin@ximian.com>
2406
2407         * expression.cs (ComposedCast.DoResolveAsTypeStep): Allow `dim' to
2408         begin with a "?", for instance "?[]".  Don't do a type lookup if
2409         `dim' is empty.
2410
2411 2005-02-25  Martin Baulig  <martin@ximian.com>
2412
2413         The first part of Nullable Types :-)
2414
2415         * generic.cs (NullableType): New public class.
2416         (NullCoalescingOperator): New public class.
2417         (TypeArguments.Resolve): Add a CS0306 check.
2418
2419         * cs-parser.jay (opt_error_modifier): Removed, this was unused.
2420         (opt_nullable): New rule.
2421         (type): Added `opt_nullable' to `namespace_or_type_name',
2422         `builtin_types' and `pointer_type'.
2423         (array_type): Added `opt_nullable'.
2424         (opt_rank_specifier_or_nullable): New rule; this is the
2425         combination of `opt_rank_specifier' and `opt_nullable'.
2426         (opt_error): New rule; catch errors here.
2427         (nullable_type_or_conditional): New rule; we use this to check for
2428         nullable and still detect the conditional operator.
2429         (local_variable_type): Use `opt_rank_specifier_or_nullable'
2430         instead `opt_rank_specifier'.
2431
2432         * expression.cs (ComposedCast.DoResolveAsTypeStep): Added support
2433         for nullables.
2434
2435 2005-02-24  Martin Baulig  <martin@ximian.com>
2436
2437         * README, README.Changes: Removed; they're old and obsolete.
2438
2439 2005-02-22  Martin Baulig  <martin@ximian.com>
2440
2441         * generic.cs (TypeParameter.Resolve): If resolving the constraints
2442         returned an error, set `constraints' to null to avoid a crash
2443         later on.
2444         (TypeParameter.ResolveType): Likewise.
2445
2446 2005-02-22  Martin Baulig  <martin@ximian.com>
2447
2448         * generic.cs
2449         (Constraints.ResolveTypes): Protect against being called twice.
2450         (Constraints.CheckInterfaceMethod): Don't call ResolveTypes().
2451         (TypeParameter.ResolveType): New public method; calls
2452         constraints.ResolveTypes().
2453         (TypeParameter.DefineType): Moved constraints.ResolveType() out
2454         into the new ResolveType().
2455         (GenericMethod.Define): Call ResolveType() on all our
2456         TypeParameter's.        
2457
2458 2005-02-21  Martin Baulig  <martin@ximian.com>
2459
2460         * generic.cs
2461         (TypeManager.generic_nullable_type): New static public field.
2462         (TypeManager.InitGenericCoreType): Lookup "System.Nullable`1".
2463
2464         * rootcontext.cs
2465         (RootContext.ResolveCore): Resolve "System.Nullable`1".
2466
2467 2005-02-15  Martin Baulig  <martin@ximian.com>
2468
2469         * generic.cs (ConstructedType.Constraints): Correctly check
2470         constraints if the argument type is a type parameter; fixes
2471         #72326. 
2472
2473 2005-02-02  Martin Baulig  <martin@ximian.com>
2474
2475         * delegate.cs (Delegate.DefineType): Report an internal error if
2476         TypeManager.multicast_delegate_type is null.  See bug #72015 for
2477         details.        
2478
2479 2005-01-29  Miguel de Icaza  <miguel@novell.com>
2480
2481         * pending.cs: Produce better code (no nops produced by using Ldarg
2482         + value).
2483         
2484         * pending.cs (PendingImplementation.DefineProxy): It was not `arg
2485         i - 1' it should be arg + 1.
2486
2487         Fixes bug #71819.
2488         
2489 2005-01-26  Martin Baulig  <martin@ximian.com>
2490
2491         * cs-parser.jay (indexer_declarator): Don't report an error if we
2492         have type parameters since we can be an explicit interface
2493         implementation; fixes #71449.
2494
2495 2005-01-26  Martin Baulig  <martin@ximian.com>
2496
2497         * class.cs (TypeContainer.AttributeTargets): Return the correct
2498         AttributeTargets depending on our `Kind' instead of throwing an
2499         exception; fixes #71632.
2500
2501 2005-01-26  Martin Baulig  <martin@ximian.com>
2502
2503         * delegate.cs (Delegate.DefineType): Correctly define our type
2504         parameters.  Fixes #71483.
2505
2506 2005-01-25  Raja R Harinath  <rharinath@novell.com>
2507
2508         Fix #71602.
2509         * expression.cs (MemberAccess.DoResolve): Don't complain with
2510         cs0572 when the LHS of a member access has identical name and type
2511         name.
2512
2513 2005-01-25  Marek Safar  <marek.safar@seznam.cz>
2514
2515         Fix #71651, #71675
2516         * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
2517         CreatePermission.
2518         Create custom PermissionSet only for PermissionSetAttribute.
2519
2520 2005-01-24  Marek Safar  <marek.safar@seznam.cz>
2521
2522         Fix #71649
2523         * class.cs (StaticClass.DefineContainerMembers): Enable enums and
2524         delegates in static class.
2525
2526 2005-01-24  Martin Baulig  <martin@ximian.com>
2527
2528         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
2529         merging an implicit block, just use its reachability.
2530
2531         * statement.cs (Block.Resolve): Make the unreachable code check
2532         work wrt. implicit blocks; see test-337 from #63842.
2533
2534 2005-01-21  Alp Toker  <alp@atoker.com>
2535  
2536         * cs-parser.jay: destructor_declaration's container is PartialContainer
2537         not Class when partial types are used, so use Kind prop instead of
2538         'is'.
2539         
2540 2005-01-22  Miguel de Icaza  <miguel@ximian.com>
2541
2542         * cs-parser.jay: Improve error reporting when an interface
2543         declares new types.
2544
2545 2005-01-20  Dick Porter  <dick@ximian.com>
2546
2547         * support.cs: SeekableStreamReader fix from Sandor Dobos
2548         (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
2549         chars are read.  Fixes bug 70369.
2550
2551 2005-01-20  Raja R Harinath  <rharinath@novell.com>
2552
2553         * cs-parser.jay (catch_clause): Simplify current_block handling
2554         somewhat.
2555
2556 2005-01-17  Miguel de Icaza  <miguel@ximian.com>
2557
2558         * convert.cs (ImplicitStandardConversionExists): Synchronize the
2559         code with ImplicitStandardConversion to handle the implicit
2560         conversion of method groups into valid delegate invocations. 
2561
2562         The problem is that in parameter handling we were using this code
2563         path.  Fixes bug #64698
2564
2565 2005-01-19  Raja R Harinath  <rharinath@novell.com>
2566
2567         * cs-parser.jay: Fix several infelicities.
2568         - Avoid assigning to the parser value stack.  Code like 
2569           '$3 = null' is unclean.  Synthesize a value for the code block
2570           instead. 
2571         - Avoid using oob_stack for storing location information.  Use ...
2572         (_mark_): ... this.  New (empty) rule.  Saves the current location
2573         in $$.
2574         (foreach_statement): Avoid using oob_stack for current_block
2575         handling.  Use technique used in for_statement and
2576         using_statement.  Synthesize a value for the code block to store
2577         additional intermediate information.
2578
2579 2005-01-13  Miguel de Icaza  <miguel@ximian.com>
2580
2581         * ecore.cs (IsAccessorAccessible): Accessibility to private fields
2582         of a different type is only allowed to private fields of a
2583         containing type, not on fields of a base class.
2584
2585         See test-174.cs and error cs0122-9.cs
2586
2587 2005-01-13  Raja R Harinath  <rharinath@novell.com>
2588
2589         Fix test-335.cs (bug #58126).
2590         * cs-parser.jay (argument): Split out non-expression parts of the
2591         rule into 'non_simple_argument'.
2592         (invocation_expression): Support parenthesized invocations with
2593         multiple arguments, and with single non-simple arguments.
2594
2595 2005-01-13  Raja R Harinath  <rharinath@novell.com>
2596
2597         * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
2598         places.
2599
2600 2005-01-12  Raja R Harinath  <rharinath@novell.com>
2601
2602         Fix cs0038-1.cs, cs1640-6.cs.
2603         * ecore.cs (Expression.Resolve): Remove special-case for
2604         SimpleName in error-handling.
2605         (Expression.almostMatchedMembers): Relax access permission to
2606         protected.
2607         (Expression.MemberLookupFailed): Handle duplicates in
2608         almostMatchedMembers list.
2609         (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
2610         * expression.cs (New.DoResolve): Report CS1540 for more cases.
2611         * typemanager.cs (GetFullNameSignature): Use the MethodBase
2612         overload if the passed in MemberInfo is a MethodBase.
2613
2614 2005-01-25  Martin Baulig  <martin@ximian.com>
2615
2616         * doc.cs
2617         (DocUtil.emptyParamList): Removed; use `Type.EmptyTypes' instead.
2618
2619 2005-01-12  Marek Safar  <marek.safar@seznam.cz>
2620
2621         Fix #70749
2622         * attribute.cs (ExtractSecurityPermissionSet): Don't report error
2623         for non-CAS & merge permission sets properly.
2624
2625 2005-01-11  Raja R Harinath  <rharinath@novell.com>
2626
2627         Improve standard-compliance of simple name and member access 
2628         resolution.  Fixes bugs #52697, #57200, #67520, #69519.
2629         * ecore.cs (FullNamedExpression): New abstract base class 
2630         for Namespaces and TypeExpressions.
2631         (ResolveFlags.SimpleName): Remove.
2632         (SimpleName): Remove support for dotted names.
2633         (SimpleName.ResolveAsTypeStep): Simplify.  Now just a wrapper to 
2634         DeclSpace.FindType and DeclSpace.LookupType.
2635         (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
2636         (Expression.ExprClassName): Make member function.
2637         * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
2638         a namespace.  Remove creation of dotted "SimpleName"s.
2639         (MemberAccess.DoResolve): Likewise.
2640         * decl.cs (DeclSpace.Cache): Make private.
2641         (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
2642         (DeclSpace.FindType): Update.
2643         (DeclSpace.LookupType): Move here from RootContext.  Return a 
2644         FullNamedExpression.
2645         * namespace.cs (Namespace): Derive from FullNamedExpression
2646         so that it can be part of expression resolution.
2647         (Namespace.Lookup): Return an FullNamedExpression.
2648         (NamespaceEntry.LookupAlias): Lookup aliases only in current
2649         namespace.
2650         * rootcontext.cs (NamespaceLookup): Remove.
2651         (LookupType): Move to DeclSpace.
2652         * attribute.cs (CheckAttributeType): Update.
2653         * doc.cs (FindDocumentedType): Remove allowAlias argument.
2654         (FindDocumentedTypeNonArray): Likewise.
2655
2656 2005-01-11  Raja R Harinath  <rharinath@novell.com>
2657
2658         Fix cs0509.cs, cs1632.cs.
2659         * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
2660         is the same as IsInterface.
2661         (TypeContainer.GetClassBases): Likewise.
2662         * statement.cs (LabeledStatement.ig): New field.
2663         (LabeledStatement.LabelTarget): Save ILGenerator which created the
2664         label.
2665         (LabeledStatement.DoEmit): Check that the label was created with
2666         the same ILGenerator.
2667
2668 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
2669
2670         Fix #71058
2671         * attribute.cs (GetMethodObsoleteAttribute): Need to transform
2672         accessors to its properties.
2673
2674         * ecore.cs (PropertyExpr): Add AccessorTable to help track back
2675         from accessors to property.
2676         
2677 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
2678
2679         Fix #70722
2680         * class.cs (MethodCore.CheckBase): Test base method obsoleteness
2681         only for overrides.
2682         
2683 2005-01-08  Miguel de Icaza  <miguel@ximian.com>
2684
2685         * attribute.cs: Check for null and empty strings.  
2686
2687         I have lost another battle to Paolo.
2688
2689 2005-01-07  Marek Safar  <marek.safar@seznam.cz>
2690
2691         Fix #70942
2692         * class.cs (PropertyMethod): Set Parent field in ctors.
2693         (SetMethod.InternalParameters): Add unsafe switch hack.
2694         Override MarkForDuplicationCheck where it is appropriate.
2695
2696         * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
2697         It says whether container allows members with the same name.
2698         Base default is no.
2699         (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
2700         Removed is_method parameter.
2701
2702 2005-01-06  Duncan Mak  <duncan@ximian.com>
2703
2704         * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
2705         because the previous change led to incorrect reporting of CS1032
2706         ("Cannot define/undefine preprocessor symbols after first token in
2707         file"). Instead of using `tokens_seen' as the only flag that
2708         triggers CS1040, introduce `comments_seen'. This new flag is used
2709         to signify having seen comments on the current line, so it is
2710         unset after a newline.
2711
2712 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
2713
2714         * doc.cs : When searching for a type, find nested type too.
2715           This fixes bug #71040.
2716
2717 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
2718
2719         * doc.cs :
2720           - Warn missing member comment on those classes which also does not
2721             have doc comments. Fixed bug #71041.
2722           - Don't warn missing doc comment on default constructor.
2723             Fixed bug #71042.
2724
2725 2005-01-06  Duncan Mak  <duncan@ximian.com>
2726
2727         * cs-tokenizer.cs (xtoken): After handling traditional C-style
2728         comments, set `tokens_seen' to true. This allows us to detect
2729         misplaced preprocessor directives (i.e. not at the beginning of
2730         the a line, nor after whitespaces). In that case, report error
2731         CS1040. This fixes bug #56460.
2732
2733         * cs-parser.jay (interface_member_declaration): Add checks for
2734         IsExplicitImpl, and report CS0541 error if an interface member is
2735         defined as an explicit interface declaration.
2736
2737 2005-01-06  Marek Safar  <marek.safar@seznam.cz>
2738
2739         Fix #70817
2740         * class.cs (PropertyMethod): Set Parent field in ctors.
2741         (SetMethod.InternalParameters): Add unsafe switch hack.
2742         
2743         * decl.cs (MemberCore.Parent): Cannot be readonly.
2744
2745 2005-01-06  Raja R Harinath  <rharinath@novell.com>
2746
2747         * decl.cs (DeclSpace.ResolveType): Remove.
2748         (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
2749         Merge in code from ...
2750         (DeclSpace.GetTypeResolvingEmitContext): ... here.  Remove.
2751         * class.cs, enum.cs: Update to changes.
2752
2753 2005-01-06  Miguel de Icaza  <miguel@ximian.com>
2754
2755         * anonymous.cs: Ensure that we init the scope of our parent if it
2756         has not been initialized yet.
2757
2758 2004-12-30  Duncan Mak  <duncan@ximian.com>
2759
2760         * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
2761         if field.FieldBuilder is null. Fixes #70758.
2762
2763         * convert.cs: Fixed some typos and updated some of the comments.
2764         (ImplicitStandardConversionExists):
2765         (TryImplicitIntConversion): If `target_type' is an interface and
2766         the type of `ic' implements this interface, return true or a new
2767         BoxedCast instead of null. This fixes #70468.
2768
2769 2004-12-29  Duncan Mak  <duncan@ximian.com>
2770
2771         * expression.cs (Argument.Emit): Check that Expr is
2772         IMemoryLocation before casting to it, and report CS1510 otherwise.
2773
2774         This fixes #70402.
2775
2776 2004-12-21  Ben Maurer  <bmaurer@ximian.com>
2777
2778         * statement.cs (Block.ThisVariable): remove the recursion here, to
2779         make the --profile more sane.
2780
2781 2004-12-17  Carlos Cortez <calberto.cortez@gmail.com>
2782
2783         * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
2784         assembly, by JB Evain.
2785
2786 2004-12-17  Raja R Harinath  <rharinath@novell.com>
2787
2788         * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs, 
2789           rootcontext.cs, typemanager.cs: Make nomenclature consistent.
2790         "parent" refers to enclosing type/class.  "base" refers to superclass.
2791
2792 2004-12-17  Raja R Harinath  <rharinath@novell.com>
2793
2794         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
2795         Ensure that we only have GlobalAttributes.
2796         * attribute.cs (Attribute.Emit): Make non-virtual.
2797         (GlobalAttribute.Emit): Remove.
2798         (Attribute.Resolve): Make virtual.
2799         (GlobalAttribute.Resolve): New.  Set Rootcontext.Tree.Types.NamespaceEntry.
2800         (Attribute.GetConditionalAttributeValue): Take an EmitContext as
2801         the argument. Don't create one.
2802         (Attribute.GetObsoleteAttribute): Likewise.
2803         (Attribute.GetClsCompliantAttributeValue): Likewise.
2804         * class.cs, decl.cs: Update to changes.
2805
2806 2004-12-17  Marek Safar  <marek.safar@seznam.cz>
2807
2808         * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
2809         
2810         * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
2811         
2812         * statement.cs (Foreach.Resolve): Add error 186 report.
2813
2814 2004-12-16  Marek Safar  <marek.safar@seznam.cz>
2815
2816         * expression.cs (Conditional.DoResolve): Add warning 429.
2817         
2818         * statement.cs (If.Resolve): Add warning 665.
2819
2820 2004-12-16  Raja R Harinath  <rharinath@novell.com>
2821
2822         New invariant: RootContext.Tree.Types.NamespaceEntry == null
2823         except when in the parser, and in GlobalAttribute.
2824         * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
2825         * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
2826         RootContext.Tree.Types.NamespaceEntry once work is done.
2827         (GlobalAttribute.Emit): New.  Wrapper for Attribute.Emit, but sets
2828         and resets RootContext.Tree.Types.NamespaceEntry.
2829
2830 2004-12-15  Marek Safar  <marek.safar@seznam.cz>
2831
2832         * cs-parser.jay: Don't create a block for every variable.
2833
2834 2004-12-14  Miguel de Icaza  <miguel@ximian.com>
2835
2836         * location.cs: Provide extra information.
2837
2838         * statement.cs: The instance is not `ldarg_0.THIS' when accessing
2839         variables from the captured environment, it is the ldarg_0.
2840
2841 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
2842
2843         * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
2844         find a conclusion.
2845         
2846         * class.cs: Changed warning level for 169 to avoid developer
2847         displeasure from warning flooding. It will be changed back when they
2848         fix most of current BCL warnings.
2849         
2850         * RootContext.cs: Pushed default WarningLevel to 3.
2851         
2852         * statement.cs: Removed unused variable.
2853
2854 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
2855
2856         * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
2857         (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
2858         Add error 502 report.
2859         (StaticClass.DefineType): Add error 441 report.
2860         (Class.AllowedModifiersProp): New virtual property as temporary
2861         extension to AllowedModifiers.
2862         (Class.DefineType): Add error 418 report. Moved ModFlags check here
2863         to share implementation with StaticClass and don't call virtual
2864         methods from ctor.
2865         
2866         * driver.cs (MainDriver): Add error 1558 test.
2867
2868         * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
2869         report. Moved error 36 test here.
2870
2871         * statement.cs (Throw.Resolve): Add error 724 report.
2872
2873         * typemanager.cs: Add out_attribute_type core type.
2874         
2875 2004-12-13  Marek Safar  <marek.safar@seznam.cz>
2876
2877         * class.cs (TypeContainer.VerifyClsCompliance): Add error
2878         3018 report.
2879         (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
2880
2881         * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
2882         3017 report.
2883         
2884         * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
2885
2886         * parameter.cs (ReturnParameter.ApplyAttributeBuilder): 
2887         Add error 3023 report.
2888         (Parameter.ApplyAttributeBuilder): Add error 3022 report.
2889
2890         * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
2891         implementation.
2892
2893 2004-12-12  John Luke  <john.luke@gmail.com>
2894
2895         * driver.cs (AddArgs): take -- into account when
2896         adding arguments, fixes bug 65710 
2897
2898 2004-12-12  Martin Baulig  <martin@ximian.com>
2899
2900         * expression.cs (Unary.TryReduceNegative): Added support for
2901         SByteConstant and ByteConstant.
2902         (Unary.Reduce): Check error values from TryReduceNegative().
2903
2904 2004-12-10  Marek Safar  <marek.safar@seznam.cz>
2905
2906         * attributes.cs (Attribute.Resolve): Avoid multiple error report
2907         and report exception as error 182.
2908
2909 2004-12-10  Raja R Harinath  <rharinath@novell.com>
2910
2911         * driver.cs (Main): Fix message when there are warnings.
2912
2913 2004-12-09  Miguel de Icaza  <miguel@ximian.com>
2914
2915         * delegate.cs: Fixed my fix from yesterday, sorry about that.
2916
2917 2004-12-09  Marek Safar  <marek.safar@seznam.cz>
2918
2919         * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs: 
2920         Reduced number of warnings.
2921         
2922         * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
2923
2924 2004-12-08  Miguel de Icaza  <miguel@ximian.com>
2925
2926         * driver.cs: Removed message.
2927
2928         * delegate.cs: Fix bug introduced in 1.1.x: 70219.
2929
2930 2004-12-08    <vargaz@freemail.hu>
2931
2932         * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
2933
2934 2004-12-08  Martin Baulig  <martin@ximian.com>
2935
2936         * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
2937         instead of a CS3002 for properties and indexer.
2938
2939 2004-12-08  Martin Baulig  <martin@ximian.com>
2940
2941         * decl.cs (MemberName.ToString): Make this work again.
2942
2943 2004-12-08  Marek Safar  <marek.safar@seznam.cz>
2944
2945         * attribute.cs (Resolve): Add error 591 detection.
2946
2947         * class.cs (FieldMember.Define): Add error 1547 detection.
2948         (Indexer.Define): Add error 620 detection.
2949         (Operator.Define): Add error 590 detection.
2950
2951         * ecore.cs: Missing argument for error 79.
2952
2953         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
2954         detection.
2955
2956 2004-12-07  Marek Safar  <marek.safar@seznam.cz>
2957
2958         Fix #70106
2959         * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
2960         only.
2961
2962 2004-12-07  Atsushi Enomoto  <atsushi@ximian.com>
2963
2964         * cs-parser.jay : handle doc comments on implicit/explicit operators.
2965           Some operator comments were suppressed.
2966         * doc.cs : Implicit/explicit operator name in doc comments are like
2967           "op_Explicit(type)~returnType", so added suffix handling.
2968
2969 2005-01-21  Alp Toker  <alp@atoker.com>
2970
2971         * cs-parser.jay: destructor_declaration's container is PartialContainer
2972         not Class when partial types are used, so use Kind prop instead of 'is'.
2973
2974 2004-12-12  Martin Baulig  <martin@ximian.com>
2975
2976         * expression.cs (Unary.TryReduceNegative): Added support for
2977         SByteConstant and ByteConstant.
2978         (Unary.Reduce): Check error values from TryReduceNegative().
2979
2980 2004-12-11  Martin Baulig  <martin@ximian.com>
2981
2982         * support.cs (ReflectionParameters.ParameterName): If we have a
2983         `gpd', call `ParameterName' on it.
2984
2985         * parameter.cs (Parameter.GetParameterAttributes): New static method.
2986
2987         * pending.cs (PendingImplementation.DefineProxy): Call
2988         DefineParameter() for all of the MethodBuilder's arguments.
2989
2990 2004-12-09  Martin Baulig  <martin@ximian.com>
2991
2992         * doc.cs (DocUtil): Make this a static class.
2993
2994 2004-12-09  Martin Baulig  <martin@ximian.com>
2995
2996         * expression.cs (Invocation.InferType): Moved the type inference
2997         implementation into TypeManager.
2998
2999         * generics.cs (TypeManager): Moved the type inference
3000         implementation here.
3001
3002 2004-12-09  Martin Baulig  <martin@ximian.com>
3003
3004         * typemanager.cs (TypeManager): Make this a partial class.
3005
3006         * generics.cs
3007         (TypeManager): Move the generics part of `TypeManager' here.
3008
3009 2004-12-08  Martin Baulig  <martin@ximian.com>
3010
3011         * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
3012         instead of a CS3002 for properties and indexer.  Added CS3024
3013         check for generic interfaces.
3014
3015         * attributes.cs (AttributeTester.AnalyzeTypeCompliance): Generic
3016         instances are not CLS-compliant.
3017
3018 2004-12-08  Martin Baulig  <martin@ximian.com>
3019
3020         * cs-parser.jay
3021         (void_pointer_expression): New rule for `void*', `void**' etc.
3022         (typeof_expression): Add `void_pointer_expression'; fixes #66846.       
3023
3024 2004-12-08  Martin Baulig  <martin@ximian.com>
3025
3026         * expression.cs (Invocation.InferType): Removed the hack for
3027         MethodCore.MayUnify().  
3028
3029         * typemanager.cs (TypeManager.MayBecomeEqualGenericTypes): Make
3030         this actually work.
3031
3032         * class.cs (MethodCore.MayUnify): Use
3033         TypeManager.MayBecomeEqualGenericTypes().       
3034
3035 2004-12-08  Martin Baulig  <martin@ximian.com>
3036
3037         * expression.cs (Is.DoResolve, As.DoResolve): If we're a type
3038         parameter, box it.  Fixes #69233.
3039
3040 2004-12-08  Martin Baulig  <martin@ximian.com>
3041
3042         * generic.cs (ConstructedType.CheckConstraints): Valuetypes always
3043         have the ctor constraint.  Fixes #68326.
3044
3045 2004-12-07  Atsushi Enomoto  <atsushi@ximian.com>
3046
3047         * cs-parser.jay : interface comment was not consumed because of
3048           extra opt_semicolon before doc handling.
3049
3050 2004-12-03  Raja R Harinath  <rharinath@novell.com>
3051
3052         Fix test-327.cs, test-328.cs, and put in early infrastructure
3053         for eventually fixing #52697.
3054         * namespace.cs (NamespaceEntry.LookupForUsing): New method.
3055         (NamespaceEntry.LookupNamespaceOrType): New method, refactored
3056         from other methods.
3057         (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
3058         (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
3059         (VerifyUsing, error246): Update.
3060         * rootcontext.cs (RootContext.NamespaceLookup): Just use
3061         'NamespaceEntry.LookupNamespaceOrType'.
3062
3063 2004-12-07  Martin Baulig  <martin@ximian.com>
3064
3065         * driver.cs: Call it "BETA SOFTWARE" :-)
3066
3067 2004-12-06  Raja R Harinath  <rharinath@novell.com>
3068
3069         Fix crash on cs0657-17.cs.
3070         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
3071         Use RootContext.Tree.Types, not 'new RootTypes ()'.
3072         * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
3073         the case where the NamespaceEntry gets overwritten.
3074
3075 2004-12-06  Marek Safar  <marek.safar@seznam.cz>
3076
3077         Fixed #69195, #56821
3078         * ecore.cs (ResolveBoolean): Tiny refactoring.
3079
3080         * expression.cs (Binary.DoResolve): Add warning 429 and skipping
3081         of right expression resolving when left is false constant and
3082         operator is LogicalAnd OR true constant and operator is LogicalOr.
3083
3084         * statement.cs (ResolveUnreachable): Always reports warning.
3085
3086 2004-12-05  Miguel de Icaza  <miguel@ximian.com>
3087
3088         * class.cs: Distinguish between 1721 and 1722 (just a little help
3089         for the programmer).
3090
3091 2004-12-03  Miguel de Icaza  <miguel@ximian.com>
3092
3093         * delegate.cs: Only allow this on new versions of the language. 
3094
3095 2004-12-02  Duncan Mak  <duncan@ximian.com>
3096
3097         * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
3098         Expression class.
3099         (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
3100         here as a static method. Take an additional bool out parameter
3101         `must_do_cs1540_check' for signaling to InstanceResolve.
3102         (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
3103         member field from PropertyExpr class and made it an argument of
3104         the method instead.
3105         (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
3106         check for MarshalByRefObject, and report CS0122 instead of CS1540.
3107         (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
3108         and `remove_accessor' as well as InstanceResolve: report CS0122
3109         where applicable.
3110
3111         Fixes #70129.
3112
3113 2004-12-07  Martin Baulig  <martin@ximian.com>
3114
3115         * decl.cs (DeclSpace.AddToContainer): Report correct errors CS0694
3116         and CS0692 where appropriate.
3117
3118 2004-12-06  Martin Baulig  <martin@ximian.com>
3119
3120         * class.cs (MethodCore.MayUnify): Moved the CS0408 check here from
3121         IsDuplicateImplementation() and improved it.
3122
3123         * expression.cs (Invocation.InferTypeArguments): Added
3124         `Type[] inferred_class_types' argument (for MethodCore.MayUnify)
3125         and removed the "ref" modifier from `infered_types'.
3126
3127         * decl.cs (MemberName.ToString): Removed the exception.
3128
3129 2004-12-03  Atsushi Enomoto  <atsushi@ximian.com>
3130
3131         * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
3132           comments are allowed.
3133
3134 2004-12-03  Carlos Alberto Cortez <calberto.cortez@gmail.com>
3135
3136         * delegate.cs: Add checks for subtypes in paramaters and return values
3137         in VerifyMethod () to add support for Covariance/Contravariance
3138         in delegates.
3139         
3140 2004-12-02  Miguel de Icaza  <miguel@ximian.com>
3141
3142         * report.cs: Remove extra closing parenthesis.
3143
3144         * convert.cs (Error_CannotImplicitConversion): If the name of the
3145         types are the same, provide some extra information.
3146
3147 2004-12-02  Marek Safar  <marek.safar@seznam.cz>
3148
3149         Fix bug #70102
3150         * attribute.cs (Resolve): Improved implementation of params
3151         attribute arguments.
3152
3153         * support.cs (ParameterData): Add HasParams to be faster.
3154
3155 2004-12-02  Atsushi Enomoto  <atsushi@ximian.com>
3156
3157         all things are for /doc support:
3158
3159         * doc.cs: new file that supports XML documentation generation.
3160         * mcs.exe.sources: added doc.cs.
3161         * driver.cs:
3162           Handle /doc command line option.
3163           Report error 2006 instead of 5 for missing file name for /doc.
3164           Generate XML documentation when required, after type resolution.
3165         * cs-tokenizer.cs:
3166           Added support for picking up documentation (/// and /** ... */),
3167           including a new XmlCommentState enumeration.
3168         * cs-parser.jay:
3169           Added lines to fill Documentation element for field, constant,
3170           property, indexer, method, constructor, destructor, operator, event
3171           and class, struct, interface, delegate, enum.
3172           Added lines to warn incorrect comment.
3173         * rootcontext.cs :
3174           Added Documentation field (passed only when /doc was specified).
3175         * decl.cs:
3176           Added DocComment, DocCommentHeader, GenerateDocComment() and
3177           OnGenerateDocComment() and some supporting private members for
3178           /doc feature to MemberCore.
3179         * class.cs:
3180           Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
3181         * delegate.cs:
3182           Added overriden DocCommentHeader.
3183         * enum.cs:
3184           Added overriden DocCommentHeader and GenerateDocComment().
3185
3186 2004-12-01  Miguel de Icaza  <miguel@ximian.com>
3187
3188         * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
3189         unwrapping the enumeration values, chain to
3190         DoConstantNumericPromotions again, so we can promote things to the
3191         fundamental types (takes care of enums that are bytes, sbytes).
3192
3193         Fixes bug #62054.
3194
3195 2004-12-01  Raja R Harinath  <rharinath@novell.com>
3196
3197         * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
3198         Fix long-standing bug in type-lookup.  Use FindType instead of
3199         LookupType when ec.ResolvingTypeTree.
3200         (Attribute.ResolveType, Attribute.Resolve)
3201         (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
3202         Update to changes.
3203         (Attributes.Search): Remove internal version.  Update.
3204         (Attributes.SearchMulti): Update.
3205         (Attributes.GetClsCompliantAttribute): Remove.
3206         (Attributes.GetIndexerNameAttribute): Remove.
3207         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
3208         (DeclSpace.GetClsCompliantAttributeValue): Likewise.
3209         * class.cs (Indexer.Define): Likewise.
3210
3211 2004-12-01  Marek Safar  <marek.safar@seznam.cz>
3212
3213         Fix bug #68790
3214         * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
3215         MarshallByReference members access.
3216
3217         * expression.cs: Use CheckMarshallByRefAccess;
3218         Better error CS0197 message.
3219
3220         * report.cs: Print whole related error message.
3221
3222 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
3223
3224         * class (GetClassBases): Better error 60 report.
3225         (EventProperty): Disabled warning 67 detection.
3226
3227 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
3228
3229         Fix bug #60324
3230         * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
3231
3232         * constant.cs (DecimalConstant.Emit): Don't use int ctor for
3233         precise values.
3234
3235 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
3236
3237         Fix bug #49488
3238         * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
3239
3240         * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
3241
3242 2004-11-26  Miguel de Icaza  <miguel@ximian.com>
3243
3244         * attribute.cs (Attribute.Resolve): Refine error reporting and
3245         report a cs0117 if the identifier does not exist, to distinguish
3246         from 0617 which is a miss-use of the actual identifier.
3247
3248         * ecore.cs (EventExpr.Emit): Refine error report and distinguish
3249         between cs0070 and cs0079.
3250
3251         * class.cs (MemberBase.DoDefine): When reporting a wrong
3252         accessibility level, we use MethodCore to compare instead of
3253         Method (this was a regression in some refactoring effort).
3254
3255         So now we correctly report cs0056 again.
3256
3257         * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
3258         testing the target_type (which was known to be object_type) and
3259         not the source type (which is anonymous_method).
3260
3261         Fixed reporting of error cs1660.
3262
3263         * expression.cs (UserCast.Source): Expose the underlying cast.
3264
3265         * statement.cs (Switch.SwitchGoverningType): Sort the list of
3266         allowed types to find a match to int32 first (most common).
3267
3268         In addition, it ignores any ImplicitUserConversions that did an
3269         internal implicit conversion (as the switch statement allows only
3270         one integral conversion to exist).
3271
3272         * class.cs (PartialContainer.Create): rename `name' to
3273         `member_name' for clarity.  Then replace the string calls with a
3274         call to MemberName.GetPartialName, as now using
3275         MemberName.ToString is an error (this is due to the side effects
3276         it had, that were fixed in the past).
3277
3278         This will restore the error reporting on a number of partial class
3279         errors that were missusing this (and getting an exception as a
3280         results, which is now just a plain textual warning, because
3281         yyparse debug output would crash otherwise).
3282
3283 2004-11-26  Raja R Harinath  <rharinath@novell.com>
3284
3285         * Makefile (PROGRAM_INSTALL_DIR): Remove.
3286
3287 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
3288
3289         * rootcontext.cs (LookupType): Make sure to cache lookups that
3290         don't give us a negative result. This saves about 5% of corlib
3291         compilation time.
3292
3293 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
3294
3295         * report.cs (AbstractMessage.Print): messages are sent to stderr
3296
3297         * class.cs (TypeContainer.GetClassBases): It is an error to have a
3298         non-interface in the list of interfaces (at this point, either
3299         parent was properly set, or a base class is being listed in the
3300         interfaces section).
3301
3302         This flags error 1722, and resolves the crash from bug 69259.
3303
3304 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
3305
3306         * statement.cs (Using.EmitExpressionFinally): make this work right
3307         for valuetypes. Fixes 69926.
3308
3309 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
3310
3311         * const.cs (Const.ChangeType): Cope with the "0 literal can be
3312         converted to an enum" here, before we try to change the underlying
3313         type.  This code exists, but it is a different code path than the
3314         one used while encoding constants.
3315
3316         (ImplicitReferenceConversionExists): In addition, resynchronized
3317         the code here, so it matches the same code in
3318         ImplicitReferenceConversionExists for the `from any class-type S
3319         to any interface-type T'.       
3320
3321 2004-11-25  Marek Safar  <marek.safar@seznam.cz>
3322
3323         * cfold.cs (BinaryFold): Add addition for DecimalConstant.
3324
3325 2004-11-24  Miguel de Icaza  <miguel@ximian.com>
3326
3327         * cs-parser.jay: Use verbosity accordingly. 
3328
3329 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
3330
3331         * expression.cs (Unary.ResolveOperator): Do not report warning;
3332         AddressOf reads from variable.
3333         
3334         (LocalVariableReferences.DoResolveBase): Improved my previous fix.
3335
3336 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
3337
3338         Fix bug #69462
3339
3340         * attribute.cs (Attributable): Removed CheckTargets.
3341         (Attributes.Emit): Explicit attribute targets are tested here.
3342
3343         * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
3344         not enabled for interfaces.
3345
3346         * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
3347         (GetAssemblyName): Ouch next bug there.
3348
3349 2004-11-23  Carlos Alberto Cortez <calberto.cortez@gmail.com>
3350
3351         * expression.cs: Error 275 added.
3352         
3353 2004-11-23  Marek Safar  <marek.safar@seznam.cz>
3354
3355         Fix bug #69177 (Implemented decimal constant support)
3356
3357         * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
3358         (BinaryFold): Add DecimalConstant.
3359
3360         * const.cs (Define): Decimal constant 
3361         (is not constant.
3362         (ChangeType): Add decimal type handling.
3363         (LookupConstantValue): Don't set value for decimal type but
3364         emit DecimalConstantAttribute. Needed for constant optimization.
3365
3366         * constant.cs (ToDecimal): New method.
3367         (ConvertToDecimal): New method.
3368         (IntConstant): Implemented ConvertToDecimal.
3369         (DecimalConstant.Emit): Emit optimized version for decimals in
3370         int range.
3371
3372         * expression.cs (ResolveOperator): Changed order of constant
3373         reduction to work correctly with native types which have
3374         overloaded operators.
3375         (ResolveMemberAccess): Extract constant value from attribute
3376         for decimal type.
3377
3378         * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
3379
3380         * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
3381         void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
3382         (ChangeType): Decimal is special.
3383         (TypeToCoreType): Add decimal type.
3384
3385 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
3386
3387         * convert.cs (ImplicitConversionRequired): Add error cs0642 for
3388         decimal types.
3389
3390 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
3391
3392         * class.cs (EventField.ApplyAttributeBuilder): Fix error
3393         test cs1667-5.cs.
3394
3395 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
3396
3397         * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
3398
3399         * pending.cs (PendingImplementation): Grab only interfaces.
3400
3401 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
3402
3403         * statement.cs (ForeachHelperMethods): Add location member and
3404         error 202 detection.
3405
3406 2004-11-18  Marek Safar  <marek.safar@seznam.cz>
3407
3408         * expression.cs (DoResolveBase): Fixed wrong warning for out
3409         variables.
3410
3411 2004-12-04  Martin Baulig  <martin@ximian.com>
3412
3413         * convert.cs (Convert.TypeParameter_to_Null): Use the constraints
3414         to check whether the conversion is ok.
3415
3416         * typemanager.cs (TypeManager.GetTypeArguments): Just return
3417         `Type.EmptyTypes' if we're not a generic TypeContainer.
3418
3419 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
3420
3421         * convert.cs (ImplicitReferenceConversionExists): A surprisingly
3422         old bug: when converting from the null literal to a pointer,
3423         return an EmptyCast, not the NullLiteral.
3424
3425         This fixes #69921, the recent null_type changes probably made this
3426         bug more prominent.
3427
3428 2004-12-03  Martin Baulig  <martin@ximian.com>
3429
3430         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
3431         method as our child, call AnonymousMethod.Compatible() on it.
3432
3433 2004-12-02  Miguel de Icaza  <miguel@ximian.com>
3434
3435         * class.cs (FieldBase): Use an unused bit field from the field to
3436         encode the `has_offset' property from the FieldMember.  This saves
3437         a couple of Ks on bootstrap compilation.
3438
3439         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
3440         method as our child, return the AnonymousMethod resolved
3441         expression.
3442
3443         * expression.cs (New.DoResolve): Allow return values from
3444         NewDelegate to also include AnonymousMethods.
3445
3446         Fixes #70150.
3447
3448 2004-11-29  Raja R Harinath  <rharinath@novell.com>
3449
3450         * decl.cs (MemberCore.MemberName): Remove readonly to fix an error
3451         cs1648 report.
3452         * rootcontext.cs (ResolveCore::interfaces_first_stage): Add
3453         System.Runtime.InteropServices._Exception, since it's a base
3454         interface of the core type System.Exception in the net_2_0 profile.
3455
3456 2004-11-27  Martin Baulig  <martin@ximian.com>
3457
3458         * ecore.cs (Expression.StoreFromPtr): Use `stobj' for generic parameters.
3459
3460 2004-11-26  Raja R Harinath  <rharinath@novell.com>
3461
3462         * Makefile: Convert to use executable.make.
3463         * gmcs.exe.sources: New.
3464
3465 2004-11-25  Martin Baulig  <martin@ximian.com>
3466
3467         * expression.cs (Invocation.InferType): Added support for byref types.
3468
3469 2004-11-25  Martin Baulig  <martin@ximian.com>
3470
3471         * statement.cs (Foreach.FetchMethodMoveNext): Wrap `mi.ReturnType'
3472         in TypeManager.TypeToCoreType().
3473
3474 2004-11-25  Martin Baulig  <martin@ximian.com>
3475
3476         * iterators.cs (Iterator.DoDefineMembers): Override and lookup the
3477         "Dispose" method from the `current_type'.
3478         (Iterator.EmitMoveNext): Use the `dispose_method' we looked up in
3479         DoDefineMembers() instead of using the MethodBuilder; this is
3480         required for generic iterators.
3481
3482         * class.cs (TypeContainer.DoDefineMembers): Make this virtual.
3483
3484 2004-11-24  Martin Baulig  <martin@ximian.com>
3485
3486         * ecore.cs (Expression.LoadFromPtr): Use `ldobj' for generic parameters.
3487
3488 2004-11-20  Martin Baulig  <martin@ximian.com>
3489
3490         * expression.cs (Invocation.InferType): Correctly infer generic
3491         instances; see gen-103.cs.
3492         (Invocation.InferTypeArguments): If a generic method doesn't have
3493         any unbound type parameters, we don't need to infer anything.
3494
3495 2004-11-19  Raja R Harinath  <rharinath@novell.com>
3496
3497         * Makefile (gmcs.exe): Update to new location of bootstrap mcs.exe.
3498
3499 2004-11-17  Raja R Harinath  <rharinath@novell.com>
3500
3501         * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
3502         (TypeHandle.GetMemberCache): New.
3503         (TypeHandle.TypeHandle): Update.
3504         (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
3505         (TypeManager.LookupParentInterfacesCache):
3506         Rename from LookupInterfaceCache.  Optimize slightly.
3507         (TypeManager.MemberLookup_FindMembers): Update.
3508         * decl.cs (MemberCache.MemberCache): Set Container to null in the
3509         multi-type variant.
3510         (AddCacheContents): Rename from AddHashtable.
3511         * class.cs (TypeContainer.parent_container): Remove.
3512         (TypeContainer.VerifyClsCompliance): Don't use parent_container.
3513         (TypeContainer.DoDefineMembers): Don't initialize it.
3514         Update to name changes.
3515         
3516 2004-11-17  Miguel de Icaza  <miguel@ximian.com>
3517
3518         * class.cs (MethodCore.CheckAccessModifiers): New helper routine
3519         that factors the code to check access modifiers on override.  
3520
3521         (PropertyBase): Use the code here.
3522
3523         Patch from Lluis S'anchez, fixes bug #69361.
3524
3525 2004-11-15  Miguel de Icaza  <miguel@ximian.com>
3526
3527         * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
3528         routine that is used to report the use of a captured variable
3529         whose address has been taken.
3530
3531         There are two checks: one when variables are being captured and
3532         the other check is when the address of a variable is taken. 
3533         
3534         (because an anonymous methods might be resolved before *or* after
3535         the address has been taken) and 
3536
3537         * expression.cs (Conditional.DoResolve): Remove the special
3538         casing that Martin added to trueExpr and falseExpr being both
3539         NullLiteral.  We get the right behavior now just by introducing
3540         the null_type into the compiler. 
3541
3542         * convert.cs (ExplicitConversion): Change the code to use
3543         null_type instead of testing `expr is NullLiteral'.
3544         (ImplicitConversionStandard): use null_type too.
3545         (ImplicitReferenceConversionExists): use null_type too.
3546         (ImplicitReferenceConversion): use null_type too.
3547
3548         * literal.cs: The type of `NullLiteral' is now null_type instead
3549         of object_type. 
3550         (Resolve): Set the type here.
3551
3552         * typemanager.cs: Introduce null_type.
3553
3554 2004-11-18  Martin Baulig  <martin@ximian.com>
3555
3556         * rootcontext.cs
3557         (RootContext.LookupType): Return a `Type', not a `TypeExpr'.
3558
3559 2004-11-18  Martin Baulig  <martin@ximian.com>
3560
3561         * ecore.cs (TypeExpr.DoResolveAsTypeStep): Make this protected.
3562
3563 2004-11-18  Martin Baulig  <martin@ximian.com>
3564
3565         * generic.cs (Constraints.Resolve): Take an `EmitContext' instead
3566         of a `DeclSpace'.  If one of our constraints is a `ConstructedType',
3567         call ResolveConstructedType() on it to resolve it without checking
3568         constraints.
3569         (Constraints.ResolveTypes): Check them here.
3570         (ConstructedType.DoResolveAsTypeStep): Fully resolve ourselves,
3571         but don't check constraints.
3572         (ConstructedType.ResolveAsTypeTerminal): Override this and also
3573         check constraints here.
3574         (ConstructedType.ResolveConstructedType): New public method.  This
3575         is called from DoResolveAsTypeStep() and Constraints.Resolve() to
3576         resolve ourselves without checking constraints.
3577
3578         * ecore.cs (Expression.ResolveAsTypeTerminal): Make this virtual.
3579
3580 2004-11-18  Martin Baulig  <martin@ximian.com>
3581
3582         * decl.cs
3583         (DeclSpace.CurrentType): Changed type from `TypeExpr' to `Type'.
3584
3585         * delegate.cs (Delegate.DefineType): Always create the EmitContext.
3586
3587 2004-11-18  Martin Baulig  <martin@ximian.com>
3588
3589         * ecore.cs (TypeExpr.ResolveType): Removed.
3590         (Expression.ResolveAsTypeTerminal): We always return a fully
3591         resolved `TypeExpr', so we can just access its `Type'.
3592
3593         * class.cs (TypeContainer.DefineType): Resolve `CurrentType' here.
3594
3595 2004-11-17  Martin Baulig  <martin@ximian.com>
3596
3597         * ecore.cs (IAlias.Type): Replaced with ResolveAsType() to make
3598         sure we don't return any unresolved TypeExpr's.
3599         (TypeAliasExpression): The .ctor now takes an `IAlias' instead of
3600         a `TypeExpr'.
3601         (Expression.ResolveAsTypeTerminal): Make sure `te.Type != null'.
3602
3603         * expression.cs (MemberAccess.ResolveAsTypeStep): Don't return any
3604         unresolved `ConstructedType's.
3605
3606 2004-11-17  Martin Baulig  <martin@ximian.com>
3607
3608         * ecore.cs (TypeExpr.ResolveType): Don't make this virtual.
3609
3610 2004-11-17  Martin Baulig  <martin@ximian.com>
3611
3612         * ecore.cs
3613         (Expression.ResolveAsTypeTerminal): Removed the `bool silent' argument.
3614
3615         * decl.cs (DeclSpace.ResolveType): Removed.
3616         (DeclSpace.ResolveTypeExpr): Removed the `bool silent' argument.
3617
3618 2004-11-17  Martin Baulig  <martin@ximian.com>
3619
3620         * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
3621         direction, like FindMembers() does.  Fixes #69546, testcase is in
3622         test-315.cs.    
3623
3624 2004-11-16  Martin Baulig  <martin@ximian.com>
3625
3626         This is based on a patch from Marek Safar, see bug #69082.
3627         Fixes bugs #63705 and #67130.
3628
3629         * typemanager.cs (TypeManager.LookupInterfaceCache): New public
3630         method; create a MemberCache for an interface type and cache the
3631         result.
3632
3633         * decl.cs (IMemberContainer.ParentContainer): Removed.
3634         (IMemberContainer.ParentCache): New property.
3635         (MemberCache.SetupCacheForInterface): Removed.
3636         (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
3637         to create a cache for an interface's "parent".
3638
3639         * class.cs (TypeContainer.DoDefineMembers): Setup cache for
3640         interfaces too.
3641
3642 2004-11-14  Ben Maurer  <bmaurer@ximian.com>
3643
3644         * statement.cs: Avoid adding bools to a hashtable.
3645
3646 2004-11-15  Martin Baulig  <martin@ximian.com>
3647
3648         * decl.cs (MemberName.GetPartialName): Removed, use GetTypeName() instead.
3649
3650 2004-11-11  Martin Baulig  <martin@ximian.com>
3651
3652         * typemanager.cs (TypeManager.GetMethodName): New method.
3653
3654         * class.cs (MethodData.Define): Include the generic arity in the
3655         name of an explicit interface; also add it to the method name.
3656
3657         * pending.cs (PendingImplementation.InterfaceMethod): The method
3658         name now includes the generic arity.
3659
3660 2004-11-07  Miguel de Icaza  <miguel@ximian.com>
3661
3662         * expression.cs (Invocation.OverloadResolve): Flag error if we are
3663         calling an unsafe method from a safe location.
3664
3665 2004-11-06  Marek Safar  <marek.safar@seznam.cz>
3666
3667         Fix #69167
3668         * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
3669
3670 2004-11-06  Miguel de Icaza  <miguel@ximian.com>
3671
3672         * namespace.cs (VerifyUsing): use GetPartialName instead of
3673         ToString. 
3674
3675 2004-11-05  Miguel de Icaza  <miguel@ximian.com>
3676
3677         * statement.cs (Return.Resolve): Fix regression in typo: if
3678         `in_exc', we have to request a NeedReturnLabel, this was a typo
3679         introduced in the anonymous method check-in.  Fixes #69131.
3680
3681         * Indexers were using the ShortName when defining themselves,
3682         causing a regression in the compiler bootstrap when applying the
3683         patch from 2004-11-02 (first part), now they use their full name
3684         and the bug is gone.
3685
3686 2004-11-04  Zoltan Varga  <vargaz@freemail.hu>
3687
3688         * driver.cs: Strip the path from the names of embedded resources. Fixes
3689         #68519.
3690
3691 2004-11-04  Raja R Harinath  <rharinath@novell.com>
3692
3693         Fix error message regression: cs0104-2.cs.
3694         * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
3695         (AliasEntry.Resolve): Update.
3696         * rootcontext.cs (RootContext.NamespaceLookup): Update.  Remove
3697         'silent' flag.
3698         (RootContext.LookupType): Update.
3699
3700 2004-11-03  Carlos Alberto Cortez <carlos@unixmexico.org>
3701
3702         * cs-parser.jay: Add support for handling accessor modifiers
3703         * class: Add support port accessor modifiers and error checking,
3704         define PropertyMethod.Define as virtual (not abstract anymore)
3705         * ecore.cs: Add checking for proeprties access with access modifiers
3706         * iterators.cs: Modify Accessor constructor call based in the modified
3707         constructor
3708 2004-11-02  Ben Maurer  <bmaurer@ximian.com>
3709
3710         * expression.cs (StringConcat): Handle being called twice,
3711         as when we have a concat in a field init with more than two
3712         ctors in the class
3713
3714 2004-11-02  Miguel de Icaza  <miguel@ximian.com>
3715
3716         * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
3717         special case explicit implementations, we should always produce
3718         the .property or .event declaration.
3719         
3720         * decl.cs (MemberName): Renamed GetFullName to GetPartialName
3721         since it will not return correct data if people use this
3722         unresolved in the presence of using statements (see test-313).
3723
3724         * class.cs (MethodData.Define): If we are an explicit interface
3725         implementation, set the method name to the full name of the
3726         interface plus the name of the method.  
3727
3728         Notice that using the method.MethodName.GetFullName() does not
3729         work, as it will only contain the name as declared on the source
3730         file (it can be a shorthand in the presence of using statements)
3731         and not the fully qualifed type name, for example:
3732
3733         using System;
3734
3735         class D : ICloneable {
3736                 object ICloneable.Clone ()  {
3737                 }
3738         }
3739
3740         Would produce a method called `ICloneable.Clone' instead of
3741         `System.ICloneable.Clone'.
3742
3743         * namespace.cs (Alias.Resolve): Use GetPartialName.
3744         
3745 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
3746
3747         * cs-parser.jay: Add error 1055 report.
3748
3749 2004-11-01  Miguel de Icaza  <miguel@ximian.com>
3750
3751         * assign.cs (Assign.DoResolve): Only do the transform of
3752         assignment into a New if the types are compatible, if not, fall
3753         through and let the implicit code deal with the errors and with
3754         the necessary conversions. 
3755
3756 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
3757
3758         * cs-parser.jay: Add error 1031 report.
3759
3760         * cs-tokenizer.cs: Add location for error 1038.
3761
3762 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
3763
3764         * cs-parser.jay: Add error 1016 report.
3765
3766 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
3767
3768         * cs-parser.jay: Add errors 1575,1611 report.
3769
3770 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
3771
3772         * cs-parser.jay: Add error 1001 report.
3773
3774 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
3775
3776         Fix #68850
3777         * attribute.cs (GetMarshal): Add method argument for
3778         caller identification.
3779
3780         * class.cs, codegen.cs, enum.cs, parameter.cs: Added
3781         agument for GetMarshal and RuntimeMissingSupport.
3782
3783 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
3784
3785         * attribute.cs (ExtractSecurityPermissionSet): Removed
3786         TypeManager.code_access_permission_type.
3787
3788         * typemanager.cs: Removed TypeManager.code_access_permission_type.
3789
3790 2004-10-27  Miguel de Icaza  <miguel@ximian.com>
3791
3792         * expression.cs (LocalVariableReference.DoResolveLValue): Check
3793         for obsolete use of a variable here.   Fixes regression on errors
3794         cs0619-25 and cs0619-26.
3795
3796 2004-10-27  Marek Safar  <marek.safar@seznam.cz>
3797
3798         Fix #62358, implemented security attribute encoding.
3799
3800         * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
3801         Tests permitted SecurityAction for assembly or other types.
3802         (Assembly.ExtractSecurityPermissionSet): New method. Transforms
3803         data from SecurityPermissionAttribute to PermisionSet class.
3804
3805         * class.cs (ApplyAttributeBuilder): Added special handling
3806         for System.Security.Permissions.SecurityAttribute based types.
3807
3808         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
3809         special handling for System.Security.Permissions.SecurityAttribute
3810         based types.
3811
3812         * enum.cs (ApplyAttributeBuilder): Added special handling
3813         for System.Security.Permissions.SecurityAttribute based types.
3814
3815         * parameter.cs (ApplyAttributeBuilder): Added special handling
3816         for System.Security.Permissions.SecurityAttribute based types.
3817
3818         * rootcontext.cs: Next 2 core types.
3819
3820         * typemanager.cs (TypeManager.security_permission_attr_type):
3821         Built in type for the SecurityPermission Attribute.
3822         (code_access_permission_type): Build in type.
3823
3824 2004-10-17  Miguel de Icaza  <miguel@ximian.com>
3825
3826         * expression.cs (LocalVariableReference.DoResolveBase, Emit):
3827         Remove the tests for `ec.RemapToProxy' from here, and encapsulate
3828         all of this information into
3829         EmitContext.EmitCapturedVariableInstance.
3830         
3831         * codegen.cs (EmitCapturedVariableInstance): move here the
3832         funcionality of emitting an ldarg.0 in the presence of a
3833         remapping.   This centralizes the instance emit code.
3834
3835         (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
3836         then emit a load of this: it means that we have reached the
3837         topmost ScopeInfo: the one that contains the pointer to the
3838         instance of the class hosting the anonymous method.
3839
3840         * anonymous.cs (AddField, HaveCapturedFields): Propagate field
3841         captures to the topmost CaptureContext.
3842
3843 2004-10-12  Miguel de Icaza  <miguel@ximian.com>
3844
3845         * expression.cs (LocalVariableReference): Move the knowledge about
3846         the iterators into codegen's EmitCapturedVariableInstance.
3847
3848 2004-10-11  Miguel de Icaza  <miguel@ximian.com>
3849
3850         * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
3851         all code paths return a value from an anonymous method (it is the
3852         same as the 161 error, but for anonymous methods).
3853
3854 2004-10-08  Miguel de Icaza  <miguel@ximian.com>
3855
3856         The introduction of anonymous methods in the compiler changed
3857         various ways of doing things in the compiler.  The most
3858         significant one is the hard split between the resolution phase
3859         and the emission phases of the compiler.
3860
3861         For instance, routines that referenced local variables no
3862         longer can safely create temporary variables during the
3863         resolution phase: they must do so from the emission phase,
3864         since the variable might have been "captured", hence access to
3865         it can not be done with the local-variable operations from the runtime.
3866         
3867         * statement.cs 
3868
3869         (Block.Flags): New flag `IsTopLevel' to indicate that this block
3870         is a toplevel block.
3871
3872         (ToplevelBlock): A new kind of Block, these are the blocks that
3873         are created by the parser for all toplevel method bodies.  These
3874         include methods, accessors and anonymous methods.
3875
3876         These contain some extra information not found in regular blocks:
3877         A pointer to an optional CaptureContext (for tracking captured
3878         local variables and parameters).  A pointer to the parent
3879         ToplevelBlock.
3880         
3881         (Return.Resolve): Catch missmatches when returning a value from an
3882         anonymous method (error 1662).
3883         Invoke NeedReturnLabel from the Resolve phase instead of the emit
3884         phase.
3885
3886         (Break.Resolve): ditto.
3887
3888         (SwitchLabel): instead of defining the labels during the
3889         resolution phase, we now turned the public ILLabel and ILLabelCode
3890         labels into methods called GetILLabelCode() and GetILLabel() that
3891         only define the label during the Emit phase.
3892
3893         (GotoCase): Track the SwitchLabel instead of the computed label
3894         (its contained therein).  Emit the code by using
3895         SwitchLabel.GetILLabelCode ().
3896
3897         (LocalInfo.Flags.Captured): A new flag has been introduce to track
3898         whether the Local has been captured or not.
3899
3900         (LocalInfo.IsCaptured): New property, used to tell whether the
3901         local has been captured.
3902         
3903         * anonymous.cs: Vastly updated to contain the anonymous method
3904         support.
3905
3906         The main classes here are: CaptureContext which tracks any
3907         captured information for a toplevel block and ScopeInfo used to
3908         track the activation frames for various local variables.   
3909
3910         Each toplevel block has an optional capture context associated
3911         with it.  When a method contains an anonymous method both the
3912         toplevel method and the anonymous method will create a capture
3913         context.   When variables or parameters are captured, they are
3914         recorded on the CaptureContext that owns them, for example:
3915
3916         void Demo () {
3917              int a;
3918              MyDelegate d = delegate {
3919                  a = 1;
3920              }
3921         }
3922
3923         Here `a' will be recorded as captured on the toplevel
3924         CapturedContext, the inner captured context will not have anything
3925         (it will only have data if local variables or parameters from it
3926         are captured in a nested anonymous method.
3927
3928         The ScopeInfo is used to track the activation frames for local
3929         variables, for example:
3930
3931         for (int i = 0; i < 10; i++)
3932                 for (int j = 0; j < 10; j++){
3933                    MyDelegate d = delegate {
3934                         call (i, j);
3935                    }
3936                 }
3937
3938         At runtime this captures a single captured variable `i', but it
3939         captures 10 different versions of the variable `j'.  The variable
3940         `i' will be recorded on the toplevel ScopeInfo, while `j' will be
3941         recorded on a child.  
3942
3943         The toplevel ScopeInfo will also track information like the `this'
3944         pointer if instance variables were referenced (this is necessary
3945         as the anonymous method lives inside a nested class in the host
3946         type of the method). 
3947
3948         (AnonymousMethod): Expanded to track the Toplevel, implement
3949         `AnonymousMethod.Compatible' to tell whether an anonymous method
3950         can be converted to a target delegate type. 
3951
3952         The routine now also produces the anonymous method content
3953
3954         (AnonymousDelegate): A helper class that derives from
3955         DelegateCreation, this is used to generate the code necessary to
3956         produce the delegate for the anonymous method that was created. 
3957
3958         * assign.cs: API adjustments for new changes in
3959         Convert.ImplicitStandardConversionExists.
3960
3961         * class.cs: Adjustments to cope with the fact that now toplevel
3962         blocks are of type `ToplevelBlock'. 
3963
3964         * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
3965         insteda of standard blocks.
3966
3967         Flag errors if params arguments are passed to anonymous methods.
3968
3969         * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
3970         `CurrentAnonymousMethod' which points to the current Anonymous
3971         Method.  The variable points to the AnonymousMethod class that
3972         holds the code being compiled.  It is set in the new EmitContext
3973         created for the anonymous method.
3974
3975         (EmitContext.Phase): Introduce a variable and an enumeration to
3976         assist in enforcing some rules about when and where we are allowed
3977         to invoke certain methods (EmitContext.NeedsReturnLabel is the
3978         only one that enfonces this right now).
3979
3980         (EmitContext.HaveCaptureInfo): new helper method that returns
3981         whether we have a CapturedContext initialized.
3982
3983         (EmitContext.CaptureVariable): New method used to register that a
3984         LocalInfo must be flagged for capturing. 
3985
3986         (EmitContext.CapturedParameter): New method used to register that a
3987         parameters must be flagged for capturing. 
3988         
3989         (EmitContext.CapturedField): New method used to register that a
3990         field must be flagged for capturing. 
3991
3992         (EmitContext.HaveCapturedVariables,
3993         EmitContext.HaveCapturedFields): Return whether there are captured
3994         variables or fields. 
3995
3996         (EmitContext.EmitMethodHostInstance): This is used to emit the
3997         instance for the anonymous method.  The instance might be null
3998         (static methods), this (for anonymous methods that capture nothing
3999         and happen to live side-by-side with the current method body) or a
4000         more complicated expression if the method has a CaptureContext.
4001
4002         (EmitContext.EmitTopBlock): Routine that drives the emission of
4003         code: it will first resolve the top block, then emit any metadata
4004         and then emit the code.  The split is done so that we can extract
4005         any anonymous methods and flag any captured variables/parameters.
4006         
4007         (EmitContext.ResolveTopBlock): Triggers the resolution phase,
4008         during this phase, the ILGenerator should not be used as labels
4009         and local variables declared here might not be accessible to any
4010         code that is part of an anonymous method.  
4011
4012         Exceptions to this include the temporary variables that are
4013         created by some statements internally for holding temporary
4014         variables. 
4015         
4016         (EmitContext.EmitMeta): New routine, in charge of emitting all the
4017         metadata for a cb
4018
4019         (EmitContext.TemporaryReturn): This method is typically called
4020         from the Emit phase, and its the only place where we allow the
4021         ReturnLabel to be defined other than the EmitMeta.  The reason is
4022         that otherwise we would have to duplicate a lot of logic in the
4023         Resolve phases of various methods that today is on the Emit
4024         phase. 
4025
4026         (EmitContext.NeedReturnLabel): This no longer creates the label,
4027         as the ILGenerator is not valid during the resolve phase.
4028
4029         (EmitContext.EmitThis): Extended the knowledge in this class to
4030         work in anonymous methods in addition to iterators. 
4031
4032         (EmitContext.EmitCapturedVariableInstance): This emits whatever
4033         code is necessary on the stack to access the instance to a local
4034         variable (the variable will be accessed as a field).
4035
4036         (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
4037         EmitContext.EmitAddressOfParameter): Routines to support
4038         parameters (not completed at this point). 
4039         
4040         Removals: Removed RemapLocal and RemapLocalLValue.  We probably
4041         will also remove the parameters.
4042
4043         * convert.cs (Convert): Define a `ConstantEC' which points to a
4044         null.  This is just to prefity some code that uses
4045         ImplicitStandardConversion code and do not have an EmitContext
4046         handy.
4047
4048         The idea is to flag explicitly that at that point in time, it is
4049         known that the conversion will not trigger the delegate checking
4050         code in implicit conversions (which requires a valid
4051         EmitContext). 
4052
4053         Everywhere: pass new EmitContext parameter since
4054         ImplicitStandardConversionExists now requires it to check for
4055         anonymous method conversions. 
4056
4057         (Convert.ImplicitStandardConversionExists): If the type of an
4058         expression is the anonymous_method_type, and the type is a
4059         delegate, we invoke the AnonymousMethod.Compatible method to check
4060         whether an implicit conversion is possible. 
4061
4062         (Convert.ImplicitConversionStandard): Only do implicit method
4063         group conversions if the language level is not ISO_1.
4064
4065         * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
4066         MethodInfo for the Invoke method.  used by Delegate and
4067         AnonymousDelegate.
4068
4069         * expression.cs (Binary.DoNumericPromotions): only allow anonymous
4070         method conversions if the target type is a delegate.
4071
4072         Removed extra debugging nops.
4073
4074         (LocalVariableReference): Turn the `local_info' into a public
4075         field. 
4076
4077         Add `prepared' field, the same hack used for FieldExprs to cope
4078         with composed assignments, as Local variables do not necessarily
4079         operate purely on the stack as they used to: they can be captured
4080         fields. 
4081
4082         Add `temp' for a temporary result, like fields.
4083
4084         Refactor DoResolve and DoResolveLValue into DoResolveBase.
4085
4086         It now copes with Local variables that are captured and emits the
4087         proper instance variable to load it from a field in the captured
4088         case. 
4089
4090         (ParameterReference.DoResolveBase): During the resolve phase,
4091         capture parameters if we are in an anonymous method.
4092
4093         (ParameterReference.Emit, ParameterReference.AddressOf): If in an
4094         anonymous method, use the EmitContext helper routines to emit the
4095         parameter reference.
4096
4097         * iterators.cs: Set RemapToProxy to true/false during the
4098         EmitDispose class.
4099
4100         * parameters.cs (GetParameterByName): New helper method. 
4101
4102         * typemanager.cs (anonymous_method_type) a new type that
4103         represents an anonyous method.  This is always an internal type,
4104         used as a fencepost to test against the anonymous-methodness of an
4105         expression. 
4106         
4107 2004-10-20  Marek Safar  <marek.safar@seznam.cz>
4108
4109         * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
4110         561 report.
4111         (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
4112
4113 2004-11-10  Martin Baulig  <martin@ximian.com>
4114
4115         * expression.cs (Invocation.BetterFunction): If two methods have
4116         equal parameter types, but only one of them is generic, the
4117         non-generic one wins.
4118         (New.DoResolve): Don't set `is_struct' to false if we're a generic
4119         instance; just use `Type.IsValueType' to determine whether
4120         something is a struct or not.
4121         (MemberAccess.DoResolveAsTypeStep): Don't modify the `args' field,
4122         so we can be called multiple times.
4123
4124 2004-11-10  Martin Baulig  <martin@ximian.com>
4125
4126         * generic.cs (TypeParameter.DefineConstraints): New public method.
4127         (TypeParameter.CheckAccessLevel): Override this and return true.
4128         (ConstructedType.ResolveType): Renamed to DoResolveType(), don't
4129         override ResolveType() anymore.
4130         (ConstructedType.DoResolveAsTypeStep): Call DoResolveType() here.
4131
4132 2004-11-10  Martin Baulig  <martin@ximian.com>
4133
4134         * rootcontext.cs (RootContext.LookupType): If we're a nested type,
4135         call DeclSpace.ResolveNestedType() on it.
4136
4137 2004-11-10  Martin Baulig  <martin@ximian.com>
4138
4139         * support.cs (ReflectionParameters.ParameterModifier): If `gpd' is
4140         non-null, call ParameterModifier() on it.
4141
4142 2004-11-10  Martin Baulig  <martin@ximian.com>
4143
4144         * iterators.cs
4145         (Iterators): Added `current_type' and `this_type' fields.
4146         (Iterators.DefineIterator): Create a new EmitContext and store it
4147         in `ec'; compute `this_type'.
4148
4149 2004-11-10  Martin Baulig  <martin@ximian.com>
4150
4151         * typemanager.cs
4152         (TypeManager.IsPrivateAccessible): New public method.
4153         (Closure.Filter): Use IsPrivateAccessible() instead of IsEqual().
4154
4155 2004-11-10  Martin Baulig  <martin@ximian.com>
4156
4157         * class.cs (TypeContainer.DefineType): Call
4158         TypeBuilder.DefineGenericParameters() before resolving the type
4159         parameters.
4160         (MethodData.parent_method): New protected field.
4161         (MethodData..ctor): Added `MethodInfo parent_method' argument.
4162         (MethodData.Define): Compute `parent_method'.
4163
4164         * decl.cs
4165         (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
4166         (MemberCore.GetClsCompliantAttributeValue): Likewise.
4167         (DeclSpace.ec): New protected field; store the EmitContext here.
4168         (DeclSpace.EmitContext): New public property.
4169         (DeclSpace.ResolveType): Un-comment from the [Obsolte] attribute.
4170         (DeclSpace.ResolveNestedType): New public method.
4171         (DeclSpace.ResolveTypeExpr): Just call ResolveAsTypeTerminal() here.
4172         (DeclSpace.NestedAccessible): Added `Type tb' argument.
4173         (DeclSpace.FamilyAccessible): Likewise.
4174         (DeclSpace.FindType): Call ResolveNestedType() for nested types.
4175         (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
4176         EmitContext.
4177
4178         * delegate.cs (Delegate.Define): Store the EmitContext in the `ec'
4179         field.
4180
4181         * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
4182         (Enum.Emit): Don't create a new EmitContext.
4183
4184 2004-10-18  Martin Baulig  <martin@ximian.com>
4185
4186         * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
4187         `Type' directly, but call ResolveType() on it.
4188         (Catch.Resolve): Likewise.
4189         (Foreach.Resolve): Likewise.
4190
4191 2004-10-18  Martin Baulig  <martin@ximian.com>
4192
4193         * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
4194         `Type' directly, but call ResolveType() on it.
4195         (Probe.DoResolve): Likewise.
4196         (ArrayCreation.LookupType): Likewise.
4197         (TypeOf.DoResolve): Likewise.
4198         (SizeOf.DoResolve): Likewise.
4199
4200 2004-10-18  Raja R Harinath  <rharinath@novell.com>
4201
4202         * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
4203         the ResolveType.
4204
4205 2004-10-17  John Luke  <john.luke@gmail.com>
4206
4207         * class.cs (Operator.GetSignatureForError): use CSharpName
4208
4209         * parameter.cs (Parameter.GetSignatureForError): Returns
4210         correct name even if was not defined.
4211
4212 2004-10-13  Raja R Harinath  <rharinath@novell.com>
4213
4214         Fix #65816.
4215         * class.cs (TypeContainer.EmitContext): New property.
4216         (DefineNestedTypes): Create an emitcontext for each part.
4217         (MethodCore.DoDefineParameters): Use container's emitcontext.
4218         Pass type array to InternalParameters.
4219         (MemberBase.DoDefine): Use container's emitcontext.
4220         (FieldMember.Define): Likewise.
4221         (Event.Define): Likewise.
4222         (SetMethod.GetParameterInfo): Change argument to EmitContext.
4223         Pass type array to InternalParameters.
4224         (SetIndexerMethod.GetParameterInfo): Likewise.
4225         (SetMethod.Define): Pass emitcontext to GetParameterInfo.
4226         * delegate.cs (Define): Pass emitcontext to
4227         ComputeAndDefineParameterTypes and GetParameterInfo.  Pass type
4228         array to InternalParameters.
4229         * expression.cs (ParameterReference.DoResolveBase): Pass
4230         emitcontext to GetParameterInfo.
4231         (ComposedCast.DoResolveAsTypeStep): Remove check on
4232         ec.ResolvingTypeTree.
4233         * parameter.cs (Parameter.Resolve): Change argument to
4234         EmitContext.  Use ResolveAsTypeTerminal.
4235         (Parameter.GetSignature): Change argument to EmitContext.
4236         (Parameters.ComputeSignature): Likewise.
4237         (Parameters.ComputeParameterTypes): Likewise.
4238         (Parameters.GetParameterInfo): Likewise.
4239         (Parameters.ComputeAndDefineParameterTypes): Likewise.
4240         Re-use ComputeParameterTypes.  Set ec.ResolvingTypeTree.
4241         * support.cs (InternalParameters..ctor): Remove variant that takes
4242         a DeclSpace.
4243         * typemanager.cs (system_intptr_expr): New.
4244         (InitExpressionTypes): Initialize it.
4245
4246 2004-10-12  Chris Toshok  <toshok@ximian.com>
4247
4248         * cs-parser.jay: fix location for try_statement and catch_clause.
4249
4250 2004-10-18  Martin Baulig  <martin@ximian.com>
4251
4252         * class.cs (FieldMember.Define): Don't access the TypeExpr's
4253         `Type' directly, but call ResolveType() on it.
4254         (MemberBase.DoDefine): Likewise.
4255
4256         * expression.cs (New.DoResolve): Don't access the TypeExpr's
4257         `Type' directly, but call ResolveType() on it.
4258         (ComposedCast.DoResolveAsTypeStep): Likewise.
4259
4260         * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
4261         `Type' directly, but call ResolveType() on it.
4262
4263 2004-10-17  John Luke  <john.luke@gmail.com>
4264
4265         * class.cs (Operator.GetSignatureForError): use CSharpName
4266
4267         * parameter.cs (Parameter.GetSignatureForError): Returns
4268         correct name even if was not defined.
4269
4270 2004-10-13  Raja R Harinath  <rharinath@novell.com>
4271
4272         Fix #65816.
4273         * class.cs (TypeContainer.EmitContext): New property.
4274         (DefineNestedTypes): Create an emitcontext for each part.
4275         (MethodCore.DoDefineParameters): Use container's emitcontext.
4276         Pass type array to InternalParameters.
4277         (MemberBase.DoDefine): Use container's emitcontext.
4278         (FieldMember.Define): Likewise.
4279         (Event.Define): Likewise.
4280         (SetMethod.GetParameterInfo): Change argument to EmitContext.
4281         Pass type array to InternalParameters.
4282         (SetIndexerMethod.GetParameterInfo): Likewise.
4283         (SetMethod.Define): Pass emitcontext to GetParameterInfo.
4284         * delegate.cs (Define): Pass emitcontext to
4285         ComputeAndDefineParameterTypes and GetParameterInfo.  Pass type
4286         array to InternalParameters.
4287         * expression.cs (ParameterReference.DoResolveBase): Pass
4288         emitcontext to GetParameterInfo.
4289         (ComposedCast.DoResolveAsTypeStep): Remove check on
4290         ec.ResolvingTypeTree.
4291         * parameter.cs (Parameter.Resolve): Change argument to
4292         EmitContext.  Use ResolveAsTypeTerminal.
4293         (Parameter.GetSignature): Change argument to EmitContext.
4294         (Parameters.ComputeSignature): Likewise.
4295         (Parameters.ComputeParameterTypes): Likewise.
4296         (Parameters.GetParameterInfo): Likewise.
4297         (Parameters.ComputeAndDefineParameterTypes): Likewise.
4298         Re-use ComputeParameterTypes.  Set ec.ResolvingTypeTree.
4299         * support.cs (InternalParameters..ctor): Remove variant that takes
4300         a DeclSpace.
4301         * typemanager.cs (system_intptr_expr): New.
4302         (InitExpressionTypes): Initialize it.
4303
4304 2004-10-12  Chris Toshok  <toshok@ximian.com>
4305
4306         * cs-parser.jay: fix location for try_statement and catch_clause.
4307
4308 2004-10-07  Raja R Harinath  <rharinath@novell.com>
4309
4310         More DeclSpace.ResolveType avoidance.
4311         * decl.cs (MemberCore.InUnsafe): New property.
4312         * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal 
4313         with newly created EmitContext.
4314         (FieldMember.Define): Likewise.
4315         * delegate.cs (Delegate.Define): Likewise.
4316         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
4317         only if normal name-lookup fails.
4318         (TypeExpr.DoResolve): Enable error-checking.
4319         * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
4320         (SizeOf.DoResolve): Likewise.
4321         (ComposedCast.DoResolveAsTypeStep): Likewise.
4322         (StackAlloc.DoResolve): Likewise.
4323         * statement.cs (Block.Flags): Add new flag 'Unsafe'.
4324         (Block.Unsafe): New property.
4325         (Block.EmitMeta): Set ec.InUnsafe as appropriate.
4326         (Unsafe): Set 'unsafe' flag of contained block.
4327         (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
4328         (Fixed.Resolve): Likewise.
4329         (Catch.Resolve): Likewise.
4330         (Using.ResolveLocalVariableDecls): Likewise.
4331         (Foreach.Resolve): Likewise.
4332
4333 2004-10-05  John Luke <john.luke@gmail.com>
4334
4335         * cs-parser.jay: add location to error CS0175
4336
4337 2004-10-04  Miguel de Icaza  <miguel@ximian.com>
4338
4339         * ecore.cs (Expression.Constantity): Add support for turning null
4340         into a constant.
4341
4342         * const.cs (Const.Define): Allow constants to be reference types
4343         as long as the value is Null.
4344
4345 2004-10-04  Juraj Skripsky  <js@hotfeet.ch>
4346
4347         * namespace.cs (NamespaceEntry.Using): No matter which warning
4348         level is set, check if this namespace name has already been added.
4349
4350 2004-10-03 Ben Maurer  <bmaurer@ximian.com>
4351
4352         * expression.cs: reftype [!=]= null should always use br[true,false].
4353         # 67410
4354
4355 2004-10-03  Marek Safar  <marek.safar@seznam.cz>
4356
4357         Fix #67108
4358         * attribute.cs: Enum conversion moved to 
4359         GetAttributeArgumentExpression to be applied to the all
4360         expressions.
4361
4362 2004-10-01  Raja R Harinath  <rharinath@novell.com>
4363
4364         Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
4365         * class.c (TypeContainer.DefineType): Flag error if
4366         base types aren't accessible due to access permissions.
4367         * decl.cs (DeclSpace.ResolveType): Move logic to
4368         Expression.ResolveAsTypeTerminal.
4369         (DeclSpace.ResolveTypeExpr): Thin layer over
4370         Expression.ResolveAsTypeTerminal.
4371         (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
4372         Refactor code into NestedAccess.  Use it.
4373         (DeclSpace.NestedAccess): New.
4374         * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
4375         argument to silence errors.  Check access permissions.
4376         (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
4377         * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
4378         (Cast.DoResolve): Likewise.
4379         (New.DoResolve): Likewise.
4380         (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
4381         (TypeOf.DoResolve): Likewise.
4382
4383         * expression.cs (Invocation.BetterConversion): Return the Type of
4384         the better conversion.  Implement section 14.4.2.3 more faithfully.
4385         (Invocation.BetterFunction): Make boolean.  Make correspondence to
4386         section 14.4.2.2 explicit.
4387         (Invocation.OverloadResolve): Update.
4388         (Invocation): Remove is_base field.
4389         (Invocation.DoResolve): Don't use is_base.  Use mg.IsBase.
4390         (Invocation.Emit): Likewise.
4391
4392 2004-09-24  Marek Safar  <marek.safar@seznam.cz>
4393
4394         * cs-parser.jay: Reverted 642 warning fix.
4395
4396 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
4397
4398         Fix bug #66615
4399         * decl.cs (FindMemberWithSameName): Indexer can have more than
4400         1 argument.
4401
4402 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
4403
4404         * expression.cs (LocalVariableReference.DoResolveLValue):
4405         Do not report warning 219 for out values.
4406         (EmptyExpression.Null): New member to avoid extra allocations.
4407
4408 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
4409
4410         * cs-parser.jay: Fix wrong warning 642 report.
4411
4412         * cs-tokenizer.cs (CheckNextToken): New helper;
4413         Inspect next character if is same as expected.
4414
4415 2004-09-23  Martin Baulig  <martin@ximian.com>
4416
4417         * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
4418         (Convert.ImplicitReferenceConversionExists): Likewise.
4419
4420 2004-11-09  Raja R Harinath  <rharinath@novell.com>
4421
4422         * Makefile (DISTFILES): Comment out a few missing files.
4423
4424 2004-10-29  Raja R Harinath  <rharinath@novell.com>
4425
4426         * Makefile (bootstrap_libs,bootstrap_libfiles): New.
4427         (bootstrap-libs): New target.  Invokes the net_2_0_bootstrap profile.
4428         (gmcs.exe): Invoke bootstrap-libs.
4429         (clean-local): Clean the net_2_0_bootstrap profile too.
4430         (PROGRAM_INSTALL_DIR): New.
4431         (install-local): Use it.
4432
4433 2004-10-13  Martin Baulig  <martin@ximian.com>
4434
4435         * generic.cs (TypeManager.InflatedConstraints): New nested class.
4436         (TypeParameter.DefineType): If we're a method type parameter and
4437         that method is overriding something, "inflate" its constraints.
4438
4439 2004-10-12  Martin Baulig  <martin@ximian.com>
4440
4441         * expression.cs (MemberAccess.DoResolve): If we're a SimpleName
4442         and have type arguments, create and resolve a ConstructedType.
4443
4444 2004-10-12  Martin Baulig  <martin@ximian.com>
4445
4446         * decl.cs (MemberCache.FindMemberToOverride): Use
4447         TypeManager.IsEqual() to compare the parameters and Type.Equals()
4448         to compare the invocationType.
4449
4450         * typemanager.cs (TypeManager.IsEqual): Added support for arrays.
4451         When comparing two type parameters, only do the signature-only
4452         comparision for method type parameters.
4453
4454 2004-10-11  Martin Baulig  <martin@ximian.com>
4455
4456         * report.cs: Don't make --fatal abort on warnings, we have
4457         -warnaserror for that.
4458
4459 2004-10-11  Martin Baulig  <martin@ximian.com>
4460
4461         * typemanager.cs
4462         (TypeManager.IsEqualGenericType): Removed, use IsEqual() instead.
4463         (TypeManager.IsEqual): Call ourself recursively instead of using
4464         Type.IsEqual(). 
4465
4466 2004-10-11  Martin Baulig  <martin@ximian.com>
4467
4468         * class.cs (TypeContainer.DefineType): Only call TypeParameter.Define()
4469         on our own type parameters, not on the ones we inherit from a containing
4470         class.
4471
4472         * expression.cs (Invocation.InferType): Use `==', not `Equals()' for
4473         the comparision.
4474
4475         * generic.cs (TypeParameter.Define): We may only be called once.
4476
4477         * pending.cs (Pending.InterfaceMethod): Call TypeManager.Real_IsEqual()
4478         instead of TypeManager.IsEqual().
4479
4480 2004-09-28  Martin Baulig  <martin@ximian.com>
4481
4482         * generic.cs
4483         (GenericConstraints.EffectiveBaseClass): New public property.
4484         (TypeParameter.GenericConstraints): New public property.
4485         (ConstructedType.CheckConstraints): Improved.
4486
4487         * convert.cs (Convert.TypeParam_EffectiveBaseType): New private method.
4488         (Convert.TypeParameterConversion): New private method; use this in
4489         ImplicitReferenceConversion() and ImplicitReferenceConversionExists()
4490         for all conversions related to type parameters.
4491
4492 2004-09-24  Martin Baulig  <martin@ximian.com>
4493
4494         * convert.cs (Convert.ImplicitReferenceConversion): Added implicit
4495         type parameter conversions for type parameters which are known to
4496         be reference types.
4497
4498 2004-09-24  Martin Baulig  <martin@ximian.com>
4499
4500         * generic.cs (GenericConstraints): Added `IsReferenceType' and
4501         `IsValueType' properties.
4502
4503         * support.cs (ReflectionConstraints): Use
4504         Type.GetGenericParameterConstraints() instead of the old hack.
4505
4506 2004-09-24  Martin Baulig  <martin@ximian.com>
4507
4508         * generic.cs (GenericConstraints): Moved here and made it an
4509         abstract class.
4510
4511         * support.cs (GenericConstraints): Moved to generic.cs.
4512
4513 2004-09-24  Martin Baulig  <martin@ximian.com>
4514
4515         * support.cs
4516         (ReflectionConstraints): Un-nested this class and made it public.
4517
4518         * typemanager.cs
4519         (TypeManager.GetTypeParameterConstraints): New public method.
4520         (TypeManager.HasConstructorConstraint): Use the attributes.
4521
4522 2004-09-24  Martin Baulig  <martin@ximian.com>
4523
4524         * support.cs (GenericConstraints): Replaced `HasConstructor',
4525         `IsReferenceType' and `IsValueType' with `Attributes'.
4526         (ReflectionParameters.ReflectionConstraints): Removed the Create()
4527         method and made the .ctor public.
4528
4529         * generic.cs (Constraints.Attributes): New public property.
4530         (Constraints): Renamed `HasConstructor' -> `HasConstructorConstraint',
4531         `IsReferenceType' -> `HasReferenceTypeConstraint' and
4532         `IsValueType' -> `HasValueTypeConstraint'.
4533
4534 2004-09-23  Martin Baulig  <martin@ximian.com>
4535
4536         * generic.cs (Constraints): Reflect latest runtime changes.
4537
4538 2004-09-23  Martin Baulig  <martin@ximian.com>
4539
4540         * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
4541         (Convert.ImplicitReferenceConversionExists): Likewise.
4542
4543 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
4544
4545         * class.cs (Operator.Define): Add error 448 and 559 report.
4546         
4547 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
4548
4549         * class.cs (MemberBase.IsTypePermitted): New protected
4550         method for checking error CS0610.
4551
4552 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
4553
4554         * class.cs (TypeContainer.HasExplicitLayout): New property
4555         Returns whether container has StructLayout attribute set Explicit.
4556         (FieldMember): New abstract class for consts and fields.
4557         (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
4558         (Field): Reuse FieldMember.
4559
4560         * const.cs (Const): Reuse FieldMember.
4561
4562         * rootcontext.cs: EmitConstants call moved to class.
4563
4564 2004-09-22  Martin Baulig  <martin@ximian.com>
4565
4566         Marek and me just fixed one of our oldest bugs: #28562 :-)
4567
4568         * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
4569
4570         * attribute.cs (Attribute.GetAttributeArgumentExpression): If
4571         we're an EnumConstant, just return that.
4572         (Attribute.Resolve): GetAttributeArgumentExpression() may give us
4573         an EnumConstant.  In this case, we need to use GetValueAsEnumType()
4574         to get the value which'll actually be written into the attribute.
4575         However, we have to use GetValue() to access the attribute's value
4576         in the compiler.        
4577
4578 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
4579
4580         * constant.cs (Constant.IsNegative): New abstract property
4581         IsNegative.
4582
4583         * expression.cs (ArrayAccess.DoResolve): Add warning 251.
4584         (StackAlloc.DoResolve): Reused IsNegative.
4585
4586 2004-09-22  Martin Baulig  <martin@ximian.com>
4587
4588         * typemanager.cs (TypeManager.LookupGenericTypeContainer): New
4589         public method; like LookupTypeContainer, but also works for
4590         generic instances.
4591
4592         * report.cs (Report.SymbolRelatedToPreviousError): Use
4593         TypeManager.LookupGenericTypeContainer().       
4594
4595 2004-09-22  Martin Baulig  <martin@ximian.com>
4596
4597         Thanks to Peter Sestoft for this bug report.
4598
4599         * expression.cs (Conditional): If both the `trueExpr' and the
4600         `falseExpr' is a NullLiteral, return a NullLiteral.
4601
4602 2004-09-22  Martin Baulig  <martin@ximian.com>
4603
4604         * statement.cs (Foreach.EmitCollectionForeach): If we're in an
4605         iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
4606         for the "get_Current" call.
4607
4608 2004-09-21  Martin Baulig  <martin@ximian.com>
4609
4610         * convert.cs (Convert.ImplicitReferenceConversion): When
4611         converting to an interface type, first check whether we're
4612         converting from a reference type.
4613
4614 2004-09-14  Martin Baulig  <martin@ximian.com>
4615
4616         * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
4617
4618 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
4619
4620         Fixed bug #61902
4621         * codegen.cs (TestObsoleteMethodUsage): Trace when method is
4622         called and is obsolete then this member suppress message
4623         when call is inside next [Obsolete] method or type.
4624
4625         * expression.cs: Use TestObsoleteMethodUsage member.
4626
4627 2004-09-14  Martin Baulig  <martin@ximian.com>
4628
4629         * genericparser.cs: Removed.
4630
4631 2004-09-13  Marek Safar  <marek.safar@seznam.cz>
4632
4633         * class.cs (MethodCore.CheckBase): Fix bug #65757.
4634
4635 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
4636
4637         * attribute.cs (Attribute.Resolve): Add error 653 report.
4638
4639         * class.cs (Class.ApplyAttributeBuilder): Add error 641
4640         report.
4641         (Method.ApplyAttributeBuilder): Add error 685 report.
4642         (Operator.Define): Add error 564 report.
4643
4644         * cs-tokenizer.cs (handle_hex): Add error 1013 report.
4645
4646         * expression.cs (Invocation.DoResolve): Add error
4647         245 and 250 report.
4648
4649         * parameter.cs (Parameter.ApplyAttributeBuilder): Add
4650         error 674 report.
4651
4652 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
4653
4654         * class.cs (ConstructorInitializer.Resolve):
4655         Wrong error number (515->516).
4656
4657 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
4658
4659         * class.cs (Indexer.Define): Add error 631 report.
4660
4661 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
4662
4663         * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
4664
4665 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
4666
4667         * expression.cs (Probe.DoResolve): Add error CS0241 report.
4668
4669 2004-09-10  Marek Safar  <marek.safar@seznam.cz>
4670
4671         * cs-parser.jay: Added error CS0241 report.
4672
4673 2004-09-10  Raja R Harinath  <rharinath@novell.com>
4674
4675         * cs-parser.jay (fixed_statement): Introduce a scope for the
4676         declaration in the 'fixed' statement.
4677
4678 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
4679
4680         * cs-parser.jay: Added CS0230 error report.
4681
4682 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
4683
4684         * cs-parser.jay: Added errors CS0231 and CS0257 report.
4685
4686 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
4687
4688         * expression.cs (Argument.Resolve): Added error CS0192 and
4689         CS0199 report.
4690
4691 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
4692
4693         C# 2.0 #pragma warning feature
4694
4695         * cs-tokenizer.cs (PreProcessPragma): New method; 
4696         Handles #pragma directive.
4697
4698         * report.cs (WarningRegions): New class; Support
4699         class for #pragma warning directive. It tests whether
4700         warning is enabled for a given line.
4701
4702 2004-09-08  Miguel de Icaza  <miguel@ximian.com>
4703
4704         * const.cs: Add more descriptive error report, tahnks to
4705         Sebastien. 
4706
4707 2004-09-08  Marek Safar  <marek.safar@seznam.cz>
4708
4709         * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
4710
4711 2004-09-07  Miguel de Icaza  <miguel@ximian.com>
4712
4713         * expression.cs: Apply patch from Ben: Remove dead code from
4714         ArrayCreation, and remove the TurnintoConstant call in const.cs,
4715         as that code just threw an exception anwyays.
4716
4717         * const.cs: Remove the call to the turnintoconstant, for details
4718         see bug: #63144
4719         
4720         * literal.cs: The type of the null-literal is the null type;  So
4721         we use a placeholder type (literal.cs:System.Null, defined here)
4722         for it.
4723
4724         * expression.cs (Conditional.DoResolve): Remove some old code that
4725         is no longer needed, conversions have been fixed.
4726
4727         (ArrayCreationExpression.DoResolve): Return false if we fail to
4728         resolve the inner expression.
4729
4730 2004-09-07  Raja R Harinath  <rharinath@novell.com>
4731
4732         Fix test-290.cs.
4733         * cs-parser.jay (delegate_declaration): Record a delegate
4734         declaration as a type declaration.
4735         Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
4736
4737 2004-09-06  Miguel de Icaza  <miguel@ximian.com>
4738
4739         * parameter.cs: Do not crash if the type can not be resolved. 
4740
4741         * expression.cs: Report errors with unsafe pointers, fixes #64896
4742
4743 2004-09-06 Ben Maurer  <bmaurer@users.sourceforge.net>
4744
4745         * expression.cs: Pointer arith always needs to do a conv.i
4746         if the operand is a long. fix 65320
4747
4748 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
4749
4750         Fixed cs0619-37.cs, cs0619-38.cs
4751
4752         * enum.cs (GetObsoleteAttribute): Removed.
4753
4754         * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
4755         on Enum member is double staged. The first is tested member
4756         and then enum.
4757
4758 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
4759
4760         Fixed #56986, #63631, #65231
4761
4762         * class.cs: (TypeContainer.AddToMemberContainer): New method,
4763         adds member to name container.
4764         (TypeContainer.AddToTypeContainer): New method, adds type to
4765         name container.
4766         (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
4767         AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
4768         AddOperator): Simplified by reusing AddToMemberContainer.
4769         (TypeContainer.UserDefinedStaticConstructor): Changed to property
4770         instead of field.
4771         (Method.CheckForDuplications): Fixed implementation to test all
4772         possibilities.
4773         (MemberBase): Detection whether member is explicit interface
4774         implementation is now in constructor.
4775         (MemberBase.UpdateMemberName): Handles IndexerName.
4776         (Accessor): Changed to keep also location information.
4777         (AbstractPropertyEventMethod): Is derived from MemberCore.
4778         (AbstractPropertyEventMethod.IsDummy): Says whether accessor
4779         will be emited or not.
4780         (PropertyBase.AreAccessorsDuplicateImplementation):
4781         Tests whether accessors are not in collision with some method.
4782         (Operator): Is derived from MethodCore to simplify common
4783         operations.
4784
4785         * decl.cs (Flags.TestMethodDuplication): Test for duplication
4786         must be performed.
4787         (DeclSpace.AddToContainer): Adds the member to defined_names
4788         table. It tests for duplications and enclosing name conflicts.
4789
4790         * enum.cs (EnumMember): Clean up to reuse the base structures
4791
4792 2004-09-03  Martin Baulig  <martin@ximian.com>
4793
4794         Merged latest changes into gmcs.  Please keep this comment in
4795         here, it makes it easier for me to see what changed in MCS since
4796         the last time I merged.
4797
4798 2004-09-03  Martin Baulig  <martin@ximian.com>
4799
4800         * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
4801         into TypeContainer, to make partial classes work again.
4802
4803 2004-09-03  Martin Baulig  <martin@ximian.com>
4804
4805         * rootcontext.cs (RootContext.V2): Removed.
4806
4807 2004-03-23  Martin Baulig  <martin@ximian.com>
4808
4809         * expression.cs (Invocation.OverloadResolve): Added `bool
4810         may_fail' argument and use it instead of the Location.IsNull() hack.
4811
4812 2004-09-09  Martin Baulig  <martin@ximian.com>
4813
4814         * cs-parser.jay (namespace_declaration): Fixed CS0134 reporting.
4815
4816 2004-09-09  Martin Baulig  <martin@ximian.com>
4817
4818         * generic.cs (TypeParameter.DefineType): Added support for
4819         explicit interface methods.
4820
4821 2004-09-09  Martin Baulig  <martin@ximian.com>
4822
4823         * README.Changes: New document.  Started to list important changes
4824         between MCS and GMCS here.
4825
4826 2004-09-08  Martin Baulig  <martin@ximian.com>
4827
4828         * class.cs
4829         (TypeContainer.CheckRecursiveDefinition): New protected method.
4830         (TypeContainer.DefineType): Move the CS0146 check into
4831         CheckRecursiveDefinition().     
4832
4833 2004-09-06  Martin Baulig  <martin@ximian.com>
4834
4835         * generic.cs (ConstructedType.CheckConstraints): Allow builtin
4836         types for the constructor constraint.
4837
4838 2004-09-03  Martin Baulig  <martin@ximian.com>
4839
4840         * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
4841         into TypeContainer, to make partial classes work again.
4842
4843 2004-09-03  Martin Baulig  <martin@ximian.com>
4844
4845         * rootcontext.cs (RootContext.V2): Removed.
4846
4847 2004-03-23  Martin Baulig  <martin@ximian.com>
4848
4849         * expression.cs (Invocation.OverloadResolve): Added `bool
4850         may_fail' argument and use it instead of the Location.IsNull() hack.
4851
4852 2004-09-03  Martin Baulig  <martin@ximian.com>
4853
4854         Merged latest changes into gmcs.  Please keep this comment in
4855         here, it makes it easier for me to see what changed in MCS since
4856         the last time I merged.
4857
4858 2004-09-03  Raja R Harinath  <rharinath@novell.com>
4859
4860         Fix #61128.
4861         * expression.cs (BetterConversion): Don't allow either conversion 
4862         to be null.  Remove redundant implicit conversion test when 'q ==
4863         null' -- when this function is invoked, we already know that the
4864         implicit conversion exists.
4865         (BetterFunction): Assume that 'best' is non-null.  Remove
4866         redundant reimplementation of IsApplicable when 'best' is null.
4867         (IsParamsMethodApplicable, IsApplicable): Add new parameter for
4868         number of arguments.
4869         (IsAncestralType): Extract from OverloadResolve.
4870         (OverloadResolve): Make robust to the MethodGroupExpr being
4871         unsorted.  Implement all the logic of Section 14.5.5.1, and
4872         support overloading of methods from multiple applicable types.
4873         Clean up logic somewhat.  Don't pass null methods to BetterFunction.
4874
4875         * report.cs (SymbolRelatedToPreviousError): Cleanup output.
4876         (RealError, Warning): Append type of report to related symbol.
4877
4878 2004-09-03  Marek Safar  <marek.safar@seznam.cz>
4879
4880         * enum.cs: Fixed CLS-Compliance checks for enum members.
4881         Error tests cs3008-8.cs, cs3014-8.cs
4882
4883 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
4884
4885         Fixed bug #62342, #63102
4886         * class.cs: ImplementIndexer uses member.IsExplicitImpl
4887         like ImplementMethod.
4888
4889 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
4890
4891         * attribute.cs (Attribute.GetAttributeArgumentExpression):
4892         Fixed bug #65170.
4893
4894 2004-09-02  Martin Baulig  <martin@ximian.com>
4895
4896         * statement.cs (Using.EmitLocalVariableDeclFinally): Use
4897         TypeManager.GetArgumentTypes() rather than calling GetParameters()
4898         on the MethodBase.
4899
4900 2004-09-01  Marek Safar  <marek.safar@seznam.cz>
4901
4902         C# 2.0 Static classes implemented
4903
4904         * class.cs (TypeContainer): instance_constructors,
4905         initialized_fields, initialized_static_fields,
4906         default_constructor, base_inteface_types are protected to be
4907         accessible from StaticClass.
4908         (TypeContainer.DefineDefaultConstructor): New virtual method
4909         for custom default constructor generating
4910         (StaticClass): New class to handle "Static classes" feature.
4911
4912         * cs-parser.jay: Handle static keyword on class like instance
4913         of StaticClass.
4914
4915         * driver.cs: Added "/langversion" command line switch with two
4916         options (iso-1, default).
4917
4918 2004-08-31  Marek Safar  <marek.safar@seznam.cz>
4919
4920         * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
4921
4922 2004-08-31  Miguel de Icaza  <miguel@ximian.com>
4923
4924         * delegate.cs: Style.
4925
4926 2004-08-31 Ben Maurer  <bmaurer@users.sourceforge.net>
4927
4928         * delegate.cs: Add seperate instance expr field for miguel.
4929
4930 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
4931
4932         * PointerArithmetic (Resolve): make sure we are not doing
4933         pointer arith on void*. Also, make sure we are resolved
4934         by not setting eclass until resolve.
4935
4936         All callers: Make sure that PointerArithmetic gets resolved.
4937
4938 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
4939
4940         * ArrayCreation (LookupType): If the type does not resolve 
4941         to an array, give an error.
4942
4943 2004-08-27  Marek Safar  <marek.safar@seznam.cz>
4944
4945         * statement.cs (Try.Resolve): Fixed bug #64222
4946
4947 2004-08-27  Martin Baulig  <martin@ximian.com>
4948
4949         * class.cs
4950         (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
4951         crash here.     
4952
4953 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
4954
4955         * ecore.cs (Constantify): Get underlying type via
4956         System.Enum.GetUnderlyingType to avoid StackOverflow on the
4957         Windows in special cases.
4958
4959 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
4960
4961         * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
4962         for obtaining also private methods.
4963         (GetRemoveMethod): Used GetRemoveMethod (true)
4964         for obtaining also private methods.
4965
4966 2004-09-02  Martin Baulig  <martin@ximian.com>
4967
4968         * statement.cs (Using.EmitLocalVariableDeclFinally): Use
4969         TypeManager.GetArgumentTypes() rather than calling GetParameters()
4970         on the MethodBase.
4971
4972 2004-08-27  Martin Baulig  <martin@ximian.com>
4973
4974         * class.cs
4975         (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
4976         crash here.     
4977
4978 2004-08-25  Martin Baulig  <martin@ximian.com>
4979
4980         * support.cs (ReflectionParameters..ctor): If this is a generic
4981         method, retrieve and store its type parameters.
4982         (InternalParameters..ctor): Added `TypeParameter[]' argument.
4983         (ReflectionParameters.GenericConstraints): The argument specifies
4984         the type parameter, not the method parameter.
4985         (InternalParameters.GenericConstraints): Likewise.
4986
4987         * generic.cs (TypeParameter.DefineType): Correctly handle
4988         constraints wrt. generic methods in interfaces and their
4989         implementations.        
4990
4991 2004-08-24  Martin Baulig  <martin@ximian.com>
4992
4993         * generic.cs (TypeParameter.IsSubclassOf): New public method.
4994         (Constraints.IsSubclassOf): New internal method.
4995
4996         * typemanager.cs (TypeManager.FindMembers): Added special support
4997         for GenericTypeParameterBuilder's.      
4998         (TypeManager.IsSubclassOf, IsFamilyAccessible): Added support for
4999         type parameters.
5000
5001 2004-08-24  Martin Baulig  <martin@ximian.com>
5002
5003         * typemanager.cs
5004         (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
5005         this for accessibility checks.
5006         (TypeManager.IsSubclassOrNestedChildOf): Renamed to
5007         IsNestedFamilyAccessible.
5008         (TypeManager.IsSubclassOf): New method, do what the name actually
5009         says.   
5010
5011 2004-08-24  Martin Baulig  <martin@ximian.com>
5012
5013         * expression.cs (MemberAccess.DoResolve): When resolving ourselves
5014         as a SimpleName, include the generic arity.
5015
5016 2004-08-24  Martin Baulig  <martin@ximian.com>
5017
5018         * class.cs (Method.Define): Set MethodAttributes.SpecialName and
5019         MethodAttributes.HideBySig for operators.
5020
5021 2004-08-23  Martin Baulig  <martin@ximian.com>
5022
5023         Back to the old error reporting system :-)
5024
5025         * report.cs (Message): Removed.
5026         (Report.MessageData, ErrorData, WarningData): Removed.
5027         (Report.Error, Warning): Back to the old system.
5028
5029 2004-08-23  Martin Baulig  <martin@ximian.com>
5030
5031         * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
5032
5033         * class.cs (TypeContainer.ParentContainer): New public virtual
5034         method; replaces the explicit interface implementation.
5035         (ClassPart.ParentContainer): Override.
5036
5037 2004-08-23  Martin Baulig  <martin@ximian.com>
5038
5039         * statement.cs (Switch): Added support for constant switches; see
5040         #59428 or test-285.cs.
5041
5042 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
5043
5044         Fixed bug #62740.
5045         * statement.cs (GetEnumeratorFilter): Removed useless
5046         logic because C# specs is strict. GetEnumerator must be
5047         public.
5048
5049 2004-08-22  Martin Baulig  <martin@ximian.com>
5050
5051         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
5052         a switch and may break, reset the barrier.  Fixes #59867.
5053
5054 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
5055
5056         CLS-Compliance speed up (~5% for corlib)
5057
5058         * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
5059         New method. Tests container for CLS-Compliant names
5060
5061         * class.cs (TypeContainer.VerifyClsName): New method.
5062         Checks whether container name is CLS Compliant.
5063         (Constructor): Implements IMethodData.
5064
5065         * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
5066         low-case table for CLS Compliance test.
5067         (MemberCache.VerifyClsParameterConflict): New method.
5068         Checks method parameters for CS3006 error.
5069
5070         * enum.cs (EnumMember): Is derived from MemberCore.
5071         (Enum.VerifyClsName): Optimized for better performance.
5072
5073 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
5074
5075         * report.cs: Renamed Error_T to Error and changed all
5076         references.
5077
5078 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
5079
5080         * class.cs (TypeContainer.IndexerArrayList): New inner class
5081         container for indexers.
5082         (TypeContainer.DefaultIndexerName): New constant for default
5083         indexer name. Replaced all "Item" with this constant.
5084         (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
5085
5086         * typemanager.cs (TypeManager.default_member_ctor): Cache here
5087         DefaultMemberAttribute constructor.
5088
5089 2004-08-05  Martin Baulig  <martin@ximian.com>
5090
5091         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
5092         Fix bug #59429.
5093
5094 2004-08-05  Marek Safar  <marek.safar@seznam.cz>
5095
5096         * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
5097         multi platforms problem.
5098
5099         * compiler.csproj: Included shared files.
5100
5101 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
5102
5103         Fix bug 60333, 55971 in the more general way
5104         * attribute.cs (Attribute.GetAttributeArgumentExpression):
5105         Added arg_type argument for constant conversion.
5106         (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
5107
5108 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
5109
5110         Fix bug #59760
5111         * class.cs (TypeContainer ): New inner classes MethodArrayList, 
5112         OperatorArrayList, MethodCoreArrayList for typecontainer
5113         containers. Changed class member types to these new types.
5114         (MethodArrayList.DefineMembers): Added test for CS0659.
5115
5116 2004-08-04  Miguel de Icaza  <miguel@ximian.com>
5117
5118         * cfold.cs: Synchronize the folding with the code in expression.cs
5119         Binary.DoNumericPromotions for uint operands.
5120
5121         * attribute.cs: Revert patch from Raja, it introduced a regression
5122         while building Blam-1.2.1 (hard to isolate a test case).
5123
5124 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
5125
5126         Fix for #55382
5127         * class.cs:
5128         (TypeContainer.Define): Renamed to DefineContainerMembers because of
5129         name collision.
5130         (MethodCore.parent_method): New member. The method we're overriding
5131         if this is an override method.
5132         (MethodCore.CheckBase): Moved from Method class and made common.
5133         (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
5134         private.
5135         (MethodCore.CheckForDuplications): New abstract method. For custom
5136         member duplication search in a container
5137         (MethodCore.FindOutParentMethod): New abstract method. Gets parent
5138         method and its return type.
5139         (Event.conflict_symbol): New member. Symbol with same name in the
5140         parent class.
5141
5142         * decl.cs:
5143         (MemberCache.FindMemberWithSameName): New method. The method
5144         is looking for conflict with inherited symbols.
5145
5146 2004-08-04  Martin Baulig  <martin@ximian.com>
5147
5148         * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
5149
5150         * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
5151
5152 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
5153
5154         * report.cs (Message): New enum for better error, warning reference in
5155         the code.
5156         (MessageData): New inner abstract class. It generally handles printing of
5157         error and warning messages.
5158         Removed unused Error, Warning, Message methods.
5159
5160 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
5161
5162         Fix for cs0592-8.cs test
5163         * attribute.cs
5164         (Attributable.ValidAttributeTargets): Made public.
5165         (Attribute.ExplicitTarget): New member for explicit target value.
5166         (Attribute.CheckTargets): Now we translate explicit attribute
5167         target to Target here.
5168
5169 2004-08-03  Ben Maurer  <bmaurer@ximian.com>
5170
5171         * ecore.cs (MethodGroupExpr): new IsBase property.
5172
5173         * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
5174
5175         * delegate.cs (DelegateCreation): store a MethodGroupExpr
5176         rather than an instance expr.
5177
5178         (DelegateCreation.Emit): Use the method group rather than
5179         the instance expression. Also, if you have base.Foo as the
5180         method for a delegate, make sure to emit ldftn, not ldftnvirt.
5181
5182         (ResolveMethodGroupExpr): Use the MethodGroupExpr. 
5183
5184         (NewDelegate.DoResolve): Only check for the existance of Invoke
5185         if the method is going to be needed. Use MethodGroupExpr.
5186
5187         (NewDelegate.Emit): Remove, DelegateCreation implements this.   
5188
5189         * expression.cs: For pointer arith., make sure to use
5190         the size of the type, not the size of the pointer to
5191         the type.
5192
5193 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
5194
5195         Fix for #60722
5196         * class.cs (Class): Added error CS0502 test.
5197
5198 2004-08-03  John Luke  <jluke@cfl.rr.com>
5199             Raja R Harinath  <rharinath@novell.com>
5200
5201         Fix for #60997.
5202         * attribute.cs (Attribute.complained_before): New flag.
5203         (Attribute.ResolveType, Attribute.Resolve),
5204         (Attribute.DefinePInvokeMethod): Set it.
5205         (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
5206         
5207 2004-08-03  Martin Baulig  <martin@ximian.com>
5208
5209         * expression.cs (Binary.ResolveOperator): Don't abort if we can't
5210         use a user-defined operator; we still need to do numeric
5211         promotions in case one argument is a builtin type and the other
5212         one has an implicit conversion to that type.  Fixes #62322.
5213
5214 2004-08-18  Martin Baulig  <martin@ximian.com>
5215
5216         * class.cs (Method.Define): Use the correct method name when
5217         creating the MethodBuilder for a generic method.
5218
5219 2004-08-17  Martin Baulig  <martin@ximian.com>
5220
5221         * generic.cs (Constraints): Support type parameter constraints.
5222
5223 2004-08-16  Martin Baulig  <martin@ximian.com>
5224
5225         * cs-tokenizer.cs (Tokenizer.TypeOfParsing): New public property.
5226         (Token.GENERIC_DIMENSION): New token; this is returned if we
5227         encounter an unbound generic type in a typeof() expression.
5228
5229         * cs-parser.jay (opt_type_argument_list): Added GENERIC_DIMENSION;
5230         this token is only generated while parsing a typeof() expression.
5231         (typeof_expression): Removed the old unbound_type hack.
5232
5233         * generic.cs (TypeArguments.IsUnbound): New public property.
5234
5235         * decl.cs (MemberName): Added support for unbound types.
5236
5237 2004-08-14  Martin Baulig  <martin@ximian.com>
5238
5239         * typemanager.cs
5240         (TypeManager.IsEqualGenericInstance): New static method.
5241         (TypeManager.IsSubclassOrNestedChildOf, IsSubclassOf): This is
5242         just used to check accessibility, so follow the rules of 26.1.6.        
5243
5244         * expression.cs (MemberAccess.ResolveAsTypeStep): Return a
5245         ConstructedType instead of a TypeExpression if we have type arguments.
5246
5247         * cs-parser.jay (typeof_expression): Support unbound generic types.
5248
5249         * ecore.cs (UnboundTypeExpression): New public class.
5250
5251 2004-08-12  Martin Baulig  <martin@ximian.com>
5252
5253         * typemanager.cs (TypeManager.IsNestedChildOf): Use
5254         TypeManager.IsEqual() rather than `=='.
5255
5256         * decl.cs (DeclSpace.CheckAccessLevel): Use `tb.FullName' for
5257         generic instances as well.
5258
5259 2004-08-12  Martin Baulig  <martin@ximian.com>
5260
5261         * expression.cs (Invocation.InferType): We can only infer method
5262         type parameters.  Fixes #62647.
5263
5264 2004-08-11  Martin Baulig  <martin@ximian.com>
5265
5266         * class.cs (TypeContainer.DefineType): Create the TypeBuilder
5267         before resolving the base classes.
5268
5269 2004-08-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
5270
5271         * Makefile: install .mdb file too.
5272
5273 2004-08-05  Martin Baulig  <martin@ximian.com>
5274
5275         * ecore.cs (FieldExpr.DoResolveLValue): If we're resolving a field
5276         initializer, the current type is just the TypeBuilder, not the
5277         instantiated generic type.
5278         (FieldExpr.IsFieldInitializer): New public property.
5279
5280 2004-08-04  Martin Baulig  <martin@ximian.com>
5281
5282         * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
5283
5284         * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
5285
5286 2004-08-03  Martin Baulig  <martin@ximian.com>
5287
5288         * class.cs (MethodData.Define): If we're an explicit
5289         implementation, remove the generic arity from the type name.
5290
5291 2004-08-03  Martin Baulig  <martin@ximian.com>
5292
5293         * expression.cs (Binary.ResolveOperator): Don't abort if we can't
5294         use a user-defined operator; we still need to do numeric
5295         promotions in case one argument is a builtin type and the other
5296         one has an implicit conversion to that type.  Fixes #62322.
5297
5298 2004-08-02  Martin Baulig  <martin@ximian.com>
5299
5300         * class.cs (TypeContainer.ifaces): Make this a `Type[]', not a
5301         `TypeExpr[]' array.
5302         (TypeContainer.GetClassBases): Return the unexpanded list of
5303         interfaces; we expand them later.
5304         (TypeContainer.DefineType): After creating the TypeBuilder, call
5305         TypeManager.ExpandInterfaces() to get an expanded and resolved
5306         list of interfaces.
5307
5308         * ecore.cs (TypeExpr.GetInterfaces): Removed
5309
5310         * generics.cs (Constraints.InterfaceConstraints): Remove.
5311         (TypeParameter.DefineType): Call TypeManager.RegisterBuilder() to
5312         register the interface constraints.
5313
5314         * typemanager.cs
5315         (TypeManager.AddUserType): Removed the `ifaces' argument.
5316         (TypeManager.AddTypeParameter): Likewise.
5317         (TypeManager.AddUserInterface): Removed, was unused.
5318         (TypeManager.RegisterBuilder): Take a `Type[]' instead of a
5319         `TypeExpr[]' array for the interfaces.
5320         (TypeManager.ExpandInterfaces): Call this after the TypeBuilder
5321         has been defined, returns a list of the resolved interfaces types.
5322         (TypeManager.GetInterfaces): Return a `Type[]', not a `TypeExpr[]'.
5323         (TypeManager.GetExplicitInterfaces): Likewise.  
5324
5325 2004-08-02  Martin Baulig  <martin@ximian.com>
5326
5327         * expression.cs (Invocation.EmitCall): If we're invoking a method
5328         on a type parameter, use the new `Constrained' prefix opcode.
5329
5330 2004-08-02  Martin Baulig  <martin@ximian.com>
5331
5332         * statement.cs (LocalInfo.Flags): Added `IsThis'.
5333         (LocalInfo.IsThis): New public property.
5334         (Block.EmitMeta): Don't create a LocalBuilder for `this'.
5335
5336 2004-08-01  Martin Baulig  <martin@ximian.com>
5337
5338         * class.cs (TypeContainer.GetClassBases): Don't set the default
5339         here since we may get called from GetPartialBases().
5340         (TypeContainer.DefineType): If GetClassBases() didn't return a
5341         parent, use the default one.
5342
5343 2004-07-30  Martin Baulig  <martin@ximian.com>
5344
5345         * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
5346
5347         * class.cs (SourceMethod): New public class, derive from the
5348         symbol writer's ISourceMethod.
5349         (Method): Use the new symbol writer API.
5350
5351         * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
5352         as argument and use the new symbol writer.
5353
5354         * location.cs
5355         (SourceFile): Implement the symbol writer's ISourceFile.
5356         (Location.SymbolDocument): Removed.
5357         (Location.SourceFile): New public property.
5358
5359         * symbolwriter.cs: Use the new symbol writer API.
5360
5361 2004-07-30  Raja R Harinath  <rharinath@novell.com>
5362
5363         * Makefile (install-local): Remove.  Functionality moved to
5364         executable.make.
5365
5366 2004-07-28  Lluis Sanchez Gual  <lluis@novell.com>
5367
5368         * Makefile: Install mcs.exe.config file together with mcs.exe.
5369         * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
5370         correct runtime version.
5371         
5372 2004-07-25  Martin Baulig  <martin@ximian.com>
5373
5374         * class.cs
5375         (TypeContainer.RegisterOrder): Removed, this was unused.
5376         (TypeContainer, interface_order): Removed.
5377         (TypeContainer.AddClass, AddStruct, AddInterface): Take a
5378         TypeContainer as argument since we can also be called with a
5379         `PartialContainer' for a partial class/struct/interface.
5380         (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
5381         of checking whether we're an `Interface' - we could be a
5382         `PartialContainer'.
5383         (PartialContainer.Register): Override; call
5384         AddClass()/AddStruct()/AddInterface() on our parent.
5385
5386         * cs-parser.jay (interface_member_declaration): Add things to the
5387         `current_container', not the `current_class'.
5388
5389         * rootcontext.cs (RegisterOrder): The overloaded version which
5390         takes an `Interface' was unused, removed.
5391
5392         * typemanager.cs (TypeManager.LookupInterface): Return a
5393         `TypeContainer', not an `Interface'.
5394         (TypeManager.IsInterfaceType): The `builder_to_declspace' may
5395         contain a `PartialContainer' for an interface, so check it's
5396         `Kind' to figure out what it is.
5397
5398 2004-07-25  Martin Baulig  <martin@ximian.com>
5399
5400         * class.cs (Class.DefaultTypeAttributes): New public constant.
5401         (Struct.DefaultTypeAttributes): Likewise.
5402         (Interface.DefaultTypeAttributes): Likewise.
5403         (PartialContainer.TypeAttr): Override this and add the
5404         DefaultTypeAttributes.
5405
5406 2004-07-25  Martin Baulig  <martin@ximian.com>
5407
5408         * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
5409         we can just use the `Parent' field instead.
5410
5411 2004-07-25  Martin Baulig  <martin@ximian.com>
5412
5413         * class.cs (TypeContainer.Emit): Renamed to EmitType().
5414
5415 2004-07-25  Martin Baulig  <martin@ximian.com>
5416
5417         * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
5418         our parts before defining any methods.
5419         (TypeContainer.VerifyImplements): Make this virtual.
5420         (ClassPart.VerifyImplements): Override and call VerifyImplements()
5421         on our PartialContainer.
5422
5423 2004-07-25  Martin Baulig  <martin@ximian.com>
5424
5425         * iterators.cs (Iterator.Define): Renamed to DefineIterator().
5426
5427         * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
5428         argument, we can just use the `Parent' field instead.
5429
5430         * class.cs
5431         (MemberBase.CheckBase): Removed the `TypeContainer' argument.   
5432         (MemberBase.DoDefine): Likewise.
5433
5434 2004-07-24  Martin Baulig  <martin@ximian.com>
5435
5436         * decl.cs (MemberCore.Parent): New public field.
5437         (DeclSpace.Parent): Moved to MemberCore.
5438
5439         * class.cs (MethodCore.ds): Removed; use `Parent' instead.
5440         (MemberBase.ctor): Added TypeContainer argument, pass it to our
5441         parent's .ctor.
5442         (FieldBase, Field, Operator): Likewise.
5443         (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
5444         (EventField, Event): Likewise.
5445
5446 2004-07-23  Martin Baulig  <martin@ximian.com>
5447
5448         * class.cs (PartialContainer): New public class.
5449         (ClassPart): New public class.
5450         (TypeContainer): Added support for partial classes.
5451         (TypeContainer.GetClassBases): Splitted some of the functionality
5452         out into GetNormalBases() and GetPartialBases().
5453
5454         * cs-tokenizer.cs (Token.PARTIAL): New token.
5455         (Tokenizer.consume_identifier): Added some hacks to recognize
5456         `partial', but only if it's immediately followed by `class',
5457         `struct' or `interface'.
5458
5459         * cs-parser.jay: Added support for partial clases.
5460
5461 2004-07-23  Martin Baulig  <martin@ximian.com>
5462
5463         * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
5464         a `DeclSpace' and also made it readonly.
5465         (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
5466         (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
5467         (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
5468
5469         * cs-parser.jay: Pass the `current_class', not the
5470         `current_container' (at the moment, this is still the same thing)
5471         to a new Method, Property, Event, Indexer or Constructor.
5472
5473 2004-07-23  Martin Baulig  <martin@ximian.com>
5474
5475         * cs-parser.jay (CSharpParser): Added a new `current_class' field
5476         and removed the `current_interface' one.
5477         (struct_declaration, class_declaration, interface_declaration):
5478         Set `current_class' to the newly created class/struct/interface;
5479         set their `Bases' and call Register() before parsing their body.
5480
5481 2004-07-23  Martin Baulig  <martin@ximian.com>
5482
5483         * class.cs (Kind): New public enum.
5484         (TypeContainer): Made this class abstract.
5485         (TypeContainer.Kind): New public readonly field.
5486         (TypeContainer.CheckDef): New public method; moved here from
5487         cs-parser.jay.
5488         (TypeContainer.Register): New public abstract method.
5489         (TypeContainer.GetPendingImplementations): New public abstract
5490         method.
5491         (TypeContainer.GetClassBases): Removed the `is_class' and
5492         `is_iface' parameters.
5493         (TypeContainer.DefineNestedTypes): Formerly known as
5494         DoDefineType().
5495         (ClassOrStruct): Made this class abstract.
5496
5497         * tree.cs (RootTypes): New public type. 
5498
5499 2004-07-20  Martin Baulig  <martin@ximian.com>
5500
5501         * tree.cs (Tree.RecordNamespace): Removed.
5502         (Tree.Namespaces): Removed.
5503
5504         * rootcontext.cs (RootContext.IsNamespace): Removed.
5505
5506         * cs-parser.jay (namespace_declaration): Just create a new
5507         NamespaceEntry here.
5508
5509 2004-07-21  Lluis Sanchez Gual  <lluis@novell.com>
5510
5511         * Makefile: Install gmcs.exe.config file together with gmcs.exe.
5512         * gmcs.exe.config: Renamed from mcs.exe.config. Added supportedRuntime
5513         entry to make sure it runs in the correct runtime version.
5514         
5515 2004-07-18  Martin Baulig  <martin@ximian.com>
5516
5517         * generic.cs (ConstructedType.CheckConstraints): Improved
5518         constraints checking.
5519
5520 2004-07-18  Martin Baulig  <martin@ximian.com>
5521
5522         * expression.cs (Invocation.BetterMethod): Call
5523         TypeManager.TypeToCoreType() on all types and removed my previous
5524         hack; we're already doig the right thing here.
5525
5526 2004-07-17  Martin Baulig  <martin@ximian.com>
5527
5528         * decl.cs (MemberName.MakeName): Create the "class`1" names here.
5529
5530 2004-07-16  Martin Baulig  <martin@ximian.com>
5531
5532         * iterators.cs: Added generics support.
5533
5534 2004-07-16  Martin Baulig  <martin@ximian.com>
5535
5536         * iterators.cs: Rewrote this.  We're now using one single Proxy
5537         class for both the IEnumerable and the IEnumerator interface and
5538         `Iterator' derives from Class so we can use the high-level API.
5539
5540         * class.cs (TypeContainer.AddIterator): New method.
5541         (TypeContainer.DoDefineType): New protected virtual method, which
5542         is called from DefineType().
5543         (TypeContainer.DoDefineMembers): Call DefineType() and
5544         DefineMembers() on all our iterators.
5545         (TypeContainer.Emit): Call Emit() on all our iterators.
5546         (TypeContainer.CloseType): Call CloseType() on all our iterators.
5547
5548         * codegen.cs (EmitContext.CurrentIterator): New public field.
5549
5550 2004-07-15  Martin Baulig  <martin@ximian.com>
5551
5552         * typemanager.cs
5553         (TypeManager.not_supported_exception_type): New type.   
5554
5555 2004-07-14  Martin Baulig  <martin@ximian.com>
5556
5557         * typemanager.cs
5558         (TypeManager.generic_ienumerable_type): New type.
5559         (TypeManager.generic_ienumerator_type): New type.
5560
5561         * rootcontext.cs
5562         (RootContext.interfaces_first_stage): Added
5563         "System.Collections.Generic.IEnumerator`1" and
5564         "System.Collections.Generic.IEnumerable`1".     
5565
5566 2004-07-14  Martin Baulig  <martin@ximian.com>
5567
5568         * iterators.cs: Use real error numbers.
5569
5570 2004-07-14  Martin Baulig  <martin@ximian.com>
5571
5572         * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
5573         requires this to be a System.Collection.IEnumerable and not a
5574         class implementing that interface.
5575         (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.      
5576
5577 2004-07-13  Marek Safar  <marek.safar@seznam.cz>
5578
5579         * class.cs: Fixed previous fix, it broke some error tests.
5580
5581 2004-07-12  Martin Baulig  <martin@ximian.com>
5582
5583         * enum.cs (Enum.Define): Call Emit() to emit the attributes.
5584         Fixes #61293.
5585
5586 2004-07-14  Martin Baulig  <martin@ximian.com>
5587
5588         * decl.cs, expression.cs, generic.cs: Use a backqoute (`) and not
5589         an exclamation mark (!) for the generic arity to reflect the
5590         latest spec changes; ie. use "System.Collections.Generic.IList`1".
5591
5592 2004-07-13  Martin Baulig  <martin@ximian.com>
5593
5594         * cs-tokenizer.cs (Tokenizer.parse_less_than): Allow array rank
5595         specifiers being part of a type argument.
5596
5597 2004-07-13  Martin Baulig  <martin@ximian.com>
5598
5599         * expression.cs (MemberAccess.ResolveAsTypeStep): Use the full `!'
5600         name for generic types.
5601
5602 2004-07-13  Martin Baulig  <martin@ximian.com>
5603
5604         * assign.cs (Assign.DoResolve): Moved the CS0131 check up a little
5605         bit to fix #60119.
5606
5607 2004-07-09  Miguel de Icaza  <miguel@ximian.com>
5608
5609         * assign.cs (LocalTemporary): Add new argument: is_address,If
5610         `is_address' is true, then the value that we store is the address
5611         to the real value, and not the value itself.
5612         
5613         * ecore.cs (PropertyExpr): use the new local temporary
5614         stuff to allow us to handle X.Y += z (where X is a struct)
5615
5616 2004-07-08  Martin Baulig  <martin@ximian.com>
5617
5618         * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
5619         not always return, just like we're doing in Using.Resolve().
5620
5621 2004-07-07  Miguel de Icaza  <miguel@ximian.com>
5622
5623         * cs-parser.jay (fixed_statement): flag this as Pinned.
5624
5625 2004-07-06  Miguel de Icaza  <miguel@ximian.com>
5626
5627         * typemanager.cs (TypeManager): Removed MakePinned method, this
5628         mechanism is replaced with the .NET 2.x compatible mechanism of
5629         calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
5630
5631         * statement.cs (LocalInfo): Remove MakePinned, add Pinned property 
5632         Rename `Fixed' to `Pinned' as a flag, to distinguish from the
5633         `IsFixed' property which has a different meaning.
5634
5635 2004-07-02  Raja R Harinath  <rharinath@novell.com>
5636
5637         * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
5638         visible from inside a nested class, not just the names of the
5639         immediately enclosing class.
5640         Fix for bug #60730.
5641
5642 2004-06-24  Raja R Harinath  <rharinath@novell.com>
5643
5644         * expression.cs (BetterConversion): Remove buggy special-case
5645         handling of "implicit constant expression conversions".  At this
5646         point, we already know that the conversion is possible -- we're
5647         only checking to see which is better.
5648
5649 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
5650
5651         * cs-parser.jay: Added error CS0210 test.
5652
5653 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
5654
5655         * cs-parser.jay: Added error CS0134 test.
5656
5657 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
5658
5659         Fix bug #52507
5660         * cs-parser.jay: Added error CS0145 test.
5661
5662 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
5663
5664         * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
5665
5666 2004-06-23  Ben Maurer  <bmaurer@ximian.com>
5667         
5668         * expression.cs (StackAlloc.Resolve): The argument may not
5669         be a constant; deal with this case.
5670         
5671 2004-06-23  Marek Safar  <marek.safar@seznam.cz>
5672
5673         * attribute.cs (IndexerName_GetIndexerName): Renamed to
5674         GetIndexerAttributeValue.
5675         (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
5676
5677         * class.cs (Indexer.Define): Added error tests for CS0415,
5678         CS0609.
5679
5680 2004-06-23  Miguel de Icaza  <miguel@ximian.com>
5681
5682         * attribute.cs (Attribute.Resolve): Keep field code in sync with
5683         property code.
5684
5685 2004-06-23  Martin Baulig  <martin@ximian.com>
5686
5687         * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
5688         neither return nor throw, reset the barrier as well.  Fixes #60457.
5689
5690 2004-06-22  Atsushi Enomoto  <atsushi@ximian.com>
5691
5692         * class.cs : EventAttributes is now set to None by default.
5693           This fixes bug #60459.
5694
5695 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
5696
5697         Fix bug #60219
5698         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
5699         Don't throw exception but return null (it's sufficient now).
5700
5701 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
5702
5703         * typemanager.cs (GetArgumentTypes): Faster implementation.
5704
5705 2004-06-18  Martin Baulig  <martin@ximian.com>
5706
5707         * attribute.cs (Attribute.Resolve): Check whether we're an
5708         EmptyCast which a Constant child.  Fixes #60333.
5709
5710 2004-06-17  Ben Maurer  <bmaurer@ximian.com>
5711
5712         * statement.cs (EmitCollectionForeach): Account for the fact that
5713         not all valuetypes are in areas which we can take the address of.
5714         For these variables, we store to a temporary variable. Also, make
5715         sure that we dont emit a `callvirt' on a valuetype method.
5716
5717 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
5718
5719         * expression.cs (StackAlloc.DoReSolve): Added test for
5720         negative parameter (CS0247).
5721
5722 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
5723
5724         Fix bug #59792
5725         * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
5726
5727 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
5728
5729         Fix bug #59781
5730         * expression.cs: (Binary.DoNumericPromotions): Added conversion for
5731         ulong.
5732
5733 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
5734
5735         Fix bug #58254 & cs1555.cs, cs1556.cs
5736         * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
5737
5738 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
5739
5740         * cs-parser.jay: Added error CS1669 test for indexers.
5741
5742 2004-06-18  Martin Baulig  <martin@ximian.com>
5743
5744         * generics.cs (GenericMethod.ctor): Don't take an Attributes
5745         argument.  Fixes #60441.
5746
5747 2004-06-16  Ben Maurer  <bmaurer@ximian.com>
5748         * ecore.cs (MethodGroupExpr.Name): Revert Martin's patch.
5749         The name needs to have the actual name of the method in order
5750         for other tests (such as the one in OverloadResolve for Invoke
5751         on a delegate) to work. As well, it does not really help
5752         error reporting because the method group had multiple methods.
5753         * Makefile: Remove MCS_DEBUG, you can enable with the DEBUG_FLAGS.
5754         Make profiling work.
5755         
5756 2004-06-13  Martin Baulig  <martin@ximian.com>
5757
5758         * cs-parser.jay: Don't allow generic attributes.
5759
5760 2004-06-13  Martin Baulig  <martin@ximian.com>
5761
5762         * class.cs (MemberBase.DoDefineBase): New protected method.
5763         (MemberBase.DoDefine): Compute the `flags' in the new
5764         DoDefineBase() which must be called first.
5765         (Method.Define): Call DoDefineBase() first so we have the flags
5766         when defining the generic method.
5767
5768         * cs-parser.jay (interface_method_declaration): Support generic methods.
5769
5770 2004-06-13  Martin Baulig  <martin@ximian.com>
5771
5772         * decl.cs (TypeName): Removed.
5773         (MemberName): Removed TypeName and MemberNow; now we just have
5774         MemberName.
5775
5776         * cs-parser.jay: Don't distinguish between type arguments and type
5777         parameters in the grammar and simplified the rules a bit.  The
5778         reduce/reduce conflicts are now gone (except the one we inherited
5779         from mcs).
5780
5781 2004-06-11  Martin Baulig  <martin@ximian.com>
5782
5783         * expression.cs (Invocation.IsParamsMethodApplicable): We need to
5784         call this twice: for params and varargs methods.
5785
5786 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
5787
5788         * class.cs:
5789         (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
5790
5791 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
5792
5793         * attribute.cs (Attribute.GetValidTargets): Made public.
5794
5795         * class.cs: 
5796         (AbstractPropertyEventMethod): New class for better code sharing.
5797         (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
5798         CS1667 report.
5799         (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
5800
5801 2004-06-09  Martin Baulig  <martin@ximian.com>
5802
5803         * cs-parser.jay: Removed a reduce/reduce conflict.
5804
5805 2004-06-03  Martin Baulig  <martin@ximian.com>
5806
5807         * generic.cs (ConstructedType.GetMemberAccess): Renamed to
5808         GetSimpleName() and return a SimpleName.
5809
5810         * ecore.cs (SimpleName.Arguments): New public field.
5811         (SimpleName): Added overloaded ctor which takes an additional
5812         TypeArguments argument.
5813         (SimpleName.SimpleNameResolve): Added support for generic methods.
5814         (MethodGroupExpr.ResolveGeneric): New public method.  The code was
5815         formerly in MemberAccess.DoResolve(), but we also need it in
5816         SimpleNameResolve().
5817
5818         * expression.cs (MemberAccess.DoResolve): Use the new
5819         MethodGroupExpr.ResolveGeneric().       
5820
5821 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
5822
5823         * decl.cs: If possible, use lookuptypedirect here. We can only do
5824         this if there is no `.' after the namespace. Avoids using
5825         LookupType, which does lots of slow processing.
5826         (FindNestedType) New method, does what it says :-).
5827         * namespace.cs: use LookupTypeDirect.
5828         * rootcontext.cs: use membercache, if possible.
5829         * typemanager.cs (LookupTypeDirect): Cache negative hits too.
5830
5831 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
5832
5833         * expression.cs:
5834         According to the spec, 
5835
5836         In a member access of the form E.I, if E is a single identifier,
5837         and if the meaning of E as a simple-name (§7.5.2) is a constant,
5838         field, property, localvariable, or parameter with the same type as
5839         the meaning of E as a type-name (§3.8), then both possible
5840         meanings of E are permitted.
5841
5842         We did not check that E as a simple-name had the same type as E as
5843         a type name.
5844
5845         This trivial check gives us 5-7% on bootstrap time.
5846
5847 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
5848
5849         * expression.cs (Invocation.OverloadResolve): Avoid the
5850         use of hashtables and boxing here by allocating on demand.
5851
5852 2004-05-30  Martin Baulig  <martin@ximian.com>
5853
5854         * rootcontext.cs (RootContext.LookupType): Don't cache things if
5855         we're doing a silent lookup.  Don't try to lookup nested types in
5856         TypeManager.object_type (thanks to Ben Maurer).
5857
5858 2004-05-30  Martin Baulig  <martin@ximian.com>
5859
5860         Committing a patch from Ben Maurer.
5861
5862         * rootcontext.cs (RootContext.LookupType): Cache negative results.
5863
5864 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
5865
5866         * convert.cs: add a trivial cache for overload operator resolution.
5867
5868 2004-05-31  Marek Safar  <marek.safar@seznam.cz>
5869
5870         * attribute.cs
5871         (AttributeTester.GetObsoleteAttribute): Returns instance of
5872         ObsoleteAttribute when type is obsolete.
5873
5874         * class.cs
5875         (TypeContainer.VerifyObsoleteAttribute): Override.
5876         (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
5877         (MethodCode.VerifyObsoleteAttribute): Override.
5878         (MemberBase.VerifyObsoleteAttribute): Override.
5879
5880         * decl.cs
5881         (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
5882         and report proper error.
5883
5884         *delegate.cs
5885         (Delegate.VerifyObsoleteAttribute): Override.
5886
5887         * ecore.cs
5888         (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
5889         and report proper error.
5890         (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
5891
5892         * enum.cs
5893         (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
5894         and enum member.
5895
5896         * expression.cs
5897         (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
5898         New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
5899         Added test for ObsoleteAttribute.
5900
5901         * statement.cs
5902         (Catch): Derived from Statement.
5903
5904 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
5905
5906         * decl.cs: If possible, use lookuptypedirect here. We can only do
5907         this if there is no `.' after the namespace. Avoids using
5908         LookupType, which does lots of slow processing.
5909         (FindNestedType) New method, does what it says :-).
5910         * namespace.cs: use LookupTypeDirect.
5911         * rootcontext.cs: use membercache, if possible.
5912         * typemanager.cs (LookupTypeDirect): Cache negative hits too.
5913
5914 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
5915
5916         * expression.cs:
5917         According to the spec, 
5918
5919         In a member access of the form E.I, if E is a single identifier,
5920         and if the meaning of E as a simple-name (§7.5.2) is a constant,
5921         field, property, localvariable, or parameter with the same type as
5922         the meaning of E as a type-name (§3.8), then both possible
5923         meanings of E are permitted.
5924
5925         We did not check that E as a simple-name had the same type as E as
5926         a type name.
5927
5928         This trivial check gives us 5-7% on bootstrap time.
5929
5930 2004-05-30  Marek Safar  <marek.safar@seznam.cz>
5931
5932         Fixed bug #59071 & cs0160.cs
5933         * statement.cs (Try.Resolve): Check here whether order of catch
5934         clauses matches their dependencies.
5935
5936 2004-05-30  Marek Safar  <marek.safar@seznam.cz>
5937
5938         Fixed bug #58624
5939         * ecore.cs (SimpleName.SimpleNameResolve): Added test for
5940         unsafe type.
5941
5942 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
5943
5944         * expression.cs (Invocation.OverloadResolve): Avoid the
5945         use of hashtables and boxing here by allocating on demand.
5946
5947 2004-05-30  Martin Baulig  <martin@ximian.com>
5948
5949         * rootcontext.cs (RootContext.LookupType): Don't cache things if
5950         we're doing a silent lookup.  Don't try to lookup nested types in
5951         TypeManager.object_type (thanks to Ben Maurer).
5952
5953 2004-05-30  Martin Baulig  <martin@ximian.com>
5954
5955         Committing a patch from Ben Maurer.
5956
5957         * rootcontext.cs (RootContext.LookupType): Cache negative results.      
5958
5959 2004-05-29  Martin Baulig  <martin@ximian.com>
5960
5961         * class.cs (IMethodData.ShouldIgnore): New method.
5962
5963         * typemanager.cs (TypeManager.MethodFlags): Don't take a
5964         `Location' argument, we don't need it anywhere.  Use
5965         `IMethodData.ShouldIgnore ()' instead of
5966         `MethodData.GetMethodFlags ()'.
5967         (TypeManager.AddMethod): Removed.
5968         (TypeManager.AddMethod2): Renamed to AddMethod.
5969
5970 2004-05-29  Martin Baulig  <martin@ximian.com>
5971
5972         Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
5973
5974         * convert.cs (Convert.ImplicitReferenceConversion): If we're
5975         converting from a class type S to an interface type and we already
5976         have an object on the stack, don't box it again.  Fixes #52578.
5977
5978 2004-05-29  Martin Baulig  <martin@ximian.com>
5979
5980         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
5981         Added support for `params' parameters.  Fixes #59267.
5982
5983 2004-05-29  Martin Baulig  <martin@ximian.com>
5984
5985         * literal.cs (NullPointer): Provide a private .ctor which sets
5986         `type' to TypeManager.object_type.  Fixes #59048.
5987
5988 2004-05-29  Martin Baulig  <martin@ximian.com>
5989
5990         * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
5991         EventExpr, set `ee.InstanceExpression = left'.  Fixes #59188.
5992
5993         * ecore.cs (EventExpr.instance_expr): Make the field private.
5994
5995 2004-05-26  Marek Safar  <marek.safar@seznam.cz>
5996
5997         Fixed bug #50080 & cs0214-2.cs
5998         * expression.cs (Cast.DoResolve): Check unsafe context here.
5999         
6000         * statement.cs (Resolve.DoResolve): Likewise.
6001
6002 2004-05-26  Martin Baulig  <martin@ximian.com>
6003
6004         * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
6005
6006         * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
6007         (RootContext.LookupType): Pass down the `silent' flag.
6008
6009 2004-05-25  Martin Baulig  <martin@ximian.com>
6010
6011         * expression.cs
6012         (MethodGroupExpr.IdenticalTypeName): New public property.
6013         (Invocation.DoResolve): Don't report a CS0176 if the "instance"
6014         expression actually refers to a type.
6015
6016 2004-05-25  Martin Baulig  <martin@ximian.com>
6017
6018         * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
6019         for #56176 and made it actually work.
6020
6021 2004-05-25  Martin Baulig  <martin@ximian.com>
6022
6023         * ecore.cs (Expression.CacheTemporaries): Make this virtual.
6024         (FieldExpr, PropertyExpr): Override and implement
6025         CacheTemporaries.  Fixes #52279.
6026
6027 2004-05-25  Miguel de Icaza  <miguel@ximian.com>
6028
6029         * location.cs: In the new compiler listing a file twice is a
6030         warning, not an error.
6031
6032 2004-05-24  Martin Baulig  <martin@ximian.com>
6033
6034         * enum.cs (Enum.DefineType): For the `BaseType' to be a
6035         TypeLookupExpression; otherwise, report a CS1008.  Fixes #58571.
6036
6037 2004-05-24  Martin Baulig  <martin@ximian.com>
6038
6039         * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
6040         walking the `using' list.  Fixes #53921.
6041
6042 2004-05-24  Martin Baulig  <martin@ximian.com>
6043
6044         * const.cs (Const.LookupConstantValue): Added support for
6045         EmptyCast's; fixes #55251.
6046
6047 2004-05-24  Martin Baulig  <martin@ximian.com>
6048
6049         * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
6050         DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
6051         which does the CS0135 check.  The reason is that we first need to
6052         check whether the variable actually exists.
6053
6054 2004-05-24  Martin Baulig  <martin@ximian.com>
6055
6056         * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
6057         than RootContext.LookupType() to find the explicit interface
6058         type.  Fixes #58584.
6059
6060 2004-05-24  Raja R Harinath  <rharinath@novell.com>
6061
6062         * Makefile: Simplify.  Use executable.make.
6063         * mcs.exe.sources: New file.  List of sources of mcs.exe.
6064
6065 2004-05-24  Anders Carlsson  <andersca@gnome.org>
6066
6067         * decl.cs:
6068         * enum.cs:
6069         Use the invariant culture when doing String.Compare for CLS case
6070         sensitivity.
6071         
6072 2004-05-23  Martin Baulig  <martin@ximian.com>
6073
6074         * decl.cs (DeclSpace.FindType): Only check the `using' list if we
6075         don't have any dots.  Fixes #52622, added cs0246-8.cs.
6076
6077         * namespace.cs (NamespaceEntry.Lookup): Likewise.
6078
6079 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
6080
6081         * class.cs (MemberBase.Define): Reuse MemberType member for 
6082         resolved type. Other methods can use it too.
6083
6084 2004-05-23  Martin Baulig  <martin@ximian.com>
6085
6086         * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
6087         the variable also exists in the current block (otherwise, we need
6088         to report a CS0103).  Fixes #58670.
6089
6090 2004-05-23  Martin Baulig  <martin@ximian.com>
6091
6092         * flowanalysis.cs (Reachability.Reachable): Compute this
6093         on-the-fly rather than storing it as a field.
6094
6095 2004-05-23  Martin Baulig  <martin@ximian.com>
6096
6097         * flowanalysis.cs (Reachability.And): Manually compute the
6098         resulting `barrier' from the reachability.      
6099        
6100 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
6101
6102         Fix bug #57835
6103         * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
6104         instance of ObsoleteAttribute when symbol is obsolete.
6105
6106         * class.cs
6107         (IMethodData): Extended interface for ObsoleteAttribute support.
6108
6109 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
6110
6111         * attribute.cs: Fix bug #55970
6112
6113 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
6114
6115         Fix bug #52705
6116         * attribute.cs
6117         (GetObsoleteAttribute): New method. Creates the instance of
6118         ObsoleteAttribute.
6119         (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
6120         ObsoleteAttribute when member is obsolete.
6121         (AttributeTester.Report_ObsoleteMessage): Common method for
6122         Obsolete error/warning reporting.
6123
6124         * class.cs
6125         (TypeContainer.base_classs_type): New member for storing parent type.
6126
6127         * decl.cs
6128         (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
6129         for this MemberCore.
6130
6131 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
6132
6133         * attribute.cs, const.cs: Fix bug #58590
6134
6135 2004-05-21  Martin Baulig  <martin@ximian.com>
6136
6137         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
6138         out parameters if the end of the method is unreachable.  Fixes
6139         #58098. 
6140
6141 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
6142
6143         * codegen.cs, cs-parser.jay: Removed SetAttributes method.
6144         Hari was right, why extra method.
6145
6146 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
6147
6148         * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
6149
6150 2004-05-20  Martin Baulig  <martin@ximian.com>
6151
6152         * delegate.cs: Convert this file to Unix mode - like the original
6153         version in mcs is.
6154
6155 2004-05-20  Martin Baulig  <martin@ximian.com>
6156
6157         * attribute.cs: Convert this file to Unix mode - like the original
6158         version in mcs is.
6159
6160 2004-05-19  Marek Safar  <marek.safar@seznam.cz>
6161
6162        Fix bug #58688 (MCS does not report error when the same attribute
6163        is assigned twice)
6164
6165        * attribute.cs (Attribute.Emit): Distinction between null and default.
6166
6167 2004-05-19  Raja R Harinath  <rharinath@novell.com>
6168
6169        * cs-parser.jay (attribute): Create a GlobalAttribute for the case
6170        of a top-level attribute without an attribute target.
6171        * attribute.cs (Attribute.Error_AttributeConstructorMismatch): 
6172        Make non-static.
6173        (Attribute.Conditional_GetConditionName), 
6174        (Attribute.Obsolete_GetObsoleteMessage): Update.
6175        (Attribute.IndexerName_GetIndexerName): New.  Attribute-specific
6176        part of ScanForIndexerName.
6177        (Attribute.CanIgnoreInvalidAttribute): New function.
6178        (Attribute.ScanForIndexerName): Move to ...
6179        (Attributes.ScanForIndexerName): ... here.
6180        (Attributes.Attrs): Rename from now-misnamed AttributeSections.
6181        (Attributes.Search): New internal variant that can choose not to
6182        complain if types aren't resolved.  The original signature now
6183        complains.
6184        (Attributes.GetClsCompliantAttribute): Use internal variant, with
6185        complaints suppressed.
6186        (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
6187        only if it not useful.
6188        (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
6189        top-level for attributes that are shared between the assembly
6190        and a top-level class.
6191        * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
6192        * class.cs: Update to reflect changes.
6193        (DefineIndexers): Fuse loops.
6194        * codegen.cs (GetAssemblyName): Update to reflect changes.  Accept
6195        a couple more variants of attribute names.
6196
6197 2004-05-18  Marek Safar  <marek.safar@seznam.cz>
6198
6199         Fix bug #52585 (Implemented explicit attribute declaration)
6200
6201         * attribute.cs:
6202         (Attributable.ValidAttributeTargets): New abstract method. It gets
6203         list of valid attribute targets for explicit target declaration.
6204         (Attribute.Target): It holds target itself.
6205         (AttributeSection): Removed.
6206         (Attribute.CheckTargets): New method. It checks whether attribute
6207         target is valid for the current element.
6208
6209         * class.cs:
6210         (EventProperty): New class. For events that are declared like
6211         property (with add and remove accessors).
6212         (EventField): New class. For events that are declared like field.
6213         class.cs
6214
6215         * cs-parser.jay: Implemented explicit attribute target declaration.
6216
6217         * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:        
6218         Override ValidAttributeTargets.
6219
6220         * parameter.cs:
6221         (ReturnParameter): Class for applying custom attributes on 
6222         the return type.
6223         (ParameterAtribute): New class. Class for applying custom
6224         attributes on the parameter type.
6225
6226 2004-05-17  Miguel de Icaza  <miguel@ximian.com>
6227
6228         * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
6229         definitions. 
6230
6231         (Method): Allow UNSAFE here.
6232
6233         * modifiers.cs: Support unsafe reporting.
6234
6235 2004-05-17  Marek Safar  <marek.safar@seznam.cz>
6236
6237         * decl.cs: Fix bug #58478.
6238
6239 2004-05-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
6240
6241         * statement.cs: When checking for unreachable code on an EmptyStatement,
6242         set the location. Fixes bug #58488.
6243
6244 2004-05-13  Miguel de Icaza  <miguel@ximian.com>
6245
6246         * driver.cs: Add -pkg handling.
6247
6248         From Gonzalo: UseShelLExecute=false
6249
6250 2004-05-12  Marek Safar  <marek.safar@seznam.cz>
6251
6252         * attribute.cs:
6253         (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
6254         for attribute.
6255         (Attribute.IsClsCompliaceRequired): Moved to base for better
6256         accesibility.
6257         (Attribute.UsageAttribute): New property for AttributeUsageAttribute
6258         when attribute is AttributeUsageAttribute.
6259         (Attribute.GetValidTargets): Simplified.
6260         (Attribute.GetAttributeUsage): New method returns AttributeUsage
6261         attribute for this type.
6262         (Attribute.ApplyAttributes): Method renamed to Emit and make
6263         non-static.
6264         (GlobalAttributeSection): New class for special handling of global
6265         attributes (assembly, module).
6266         (AttributeSection.Emit): New method.
6267
6268         * class.cs: Implemented Attributable abstract methods.
6269         (MethodCore.LabelParameters): Moved to Parameter class.
6270         (Accessor): Is back simple class.
6271         (PropertyMethod): Implemented Attributable abstract class.
6272         (DelegateMethod): Implemented Attributable abstract class.
6273         (Event): New constructor for disctintion between normal Event
6274         and Event with accessors.
6275
6276         * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
6277
6278         * codegen.cs, const.cs, decl.cs, delegate.cs:
6279         (CommonAssemblyModulClass): Implemented Attributable abstract class
6280         and simplified.
6281
6282         * enum.cs: Implement IAttributeSupport interface.
6283         (EnumMember): New class for emum members. Implemented Attributable
6284         abstract class
6285
6286         * parameter.cs:
6287         (ParameterBase): Is abstract.
6288         (ReturnParameter): New class for easier [return:] attribute handling.
6289
6290         * typemanager.cs: Removed builder_to_attr.
6291
6292 2004-05-11  Raja R Harinath  <rharinath@novell.com>
6293
6294         Fix bug #57151.
6295         * attribute.cs (Attribute.GetPositionalValue): New function.
6296         * class.cs (TypeContainer.VerifyMembers): New function.
6297         (TypeContainer.Emit): Use it.
6298         (ClassOrStruct): New base class for Class and Struct.
6299         (ClassOrStruct.ApplyAttributeBuilder): New function.  Note if 
6300         StructLayout(LayoutKind.Explicit) was ascribed to the struct or
6301         class.
6302         (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
6303         then each non-static field should have a FieldOffset attribute.
6304         Otherwise, none of the fields should have a FieldOffset attribute.
6305         * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout 
6306         and FieldOffset attributes.
6307         * typemanager.cs (TypeManager.struct_layout_attribute_type)
6308         (TypeManager.field_offset_attribute_type): New core types.
6309         (TypeManager.InitCoreTypes): Initialize them.
6310
6311 2004-05-11  Michal Moskal  <malekith@pld-linux.org>
6312
6313         * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
6314         Return correct type.
6315         From bug #58270.
6316
6317 2004-05-09  Miguel de Icaza  <miguel@ximian.com>
6318
6319         * expression.cs (Binary.DoNumericPromotions): 0 long constant can
6320         be implicitly converted to ulong.
6321         
6322         * expression.cs: The logic for allowing operator &, | and ^ worked
6323         was wrong, it worked before because we did not report an error in
6324         an else branch.  Fixes 57895.
6325
6326         * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
6327         allow volatile fields to be reference types.
6328
6329 2004-05-07  Miguel de Icaza  <miguel@ximian.com>
6330
6331         * driver.cs: Add support for /debug-
6332
6333 2004-05-07  Raja R Harinath  <rharinath@novell.com>
6334
6335         * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType): 
6336         Add a 'complain' parameter to silence errors.
6337         (Attribute.Resolve): Update to changes.  Put in sanity check to catch
6338         silently overlooked type-resolutions.
6339         (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
6340         to reflect changes.
6341         (Attributes.Search): New function.
6342         (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
6343         (Attributes.GetAttributeFullName): Remove hack.
6344         * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes): 
6345         Update to reflect changes.
6346         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
6347         Use Attributes.Search instead of nested loops.
6348
6349 2004-05-07  Marek Safar  <marek.safar@seznam.cz>
6350
6351         * decl.cs:
6352         (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
6353         (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
6354         (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
6355
6356         * report.cs: (Report.Warning): Renamed to Warning_T because of
6357         parameter collision.
6358
6359 2004-05-05  Raja R Harinath  <rharinath@novell.com>
6360
6361         * expression.cs (MemberAccess.ResolveMemberAccess):
6362         Exit with non-zero status after Report.Error.
6363         * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
6364         Likewise.
6365         * typemanager.cs (TypeManager.CoreLookupType): Likewise.
6366
6367 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
6368
6369         * support.cs: Don't hang when the file is empty.
6370
6371 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
6372
6373         * support.cs: In SeekableStreamReader, compute the preamble size of the
6374           underlying stream. Position changes should take into account that initial
6375           count of bytes.
6376
6377 2004-05-03  Todd Berman  <tberman@sevenl.net>
6378
6379         * driver.cs: remove unused GetSysVersion function.
6380
6381 2004-05-03  Todd Berman  <tberman@sevenl.net>
6382
6383         * driver.cs: Remove the hack from saturday, as well as the hack
6384         from jackson (LoadAssemblyFromGac), also adds the CWD to the
6385         link_paths to get that bit proper.
6386
6387 2004-05-01  Todd Berman  <tberman@sevenl.net>
6388
6389         * driver.cs: Try a LoadFrom before a Load, this checks the current
6390         path. This is currently a bug in mono that is be fixed, however, this
6391         provides a workaround for now. This will be removed when the bug
6392         is fixed.
6393
6394 2004-05-01  Sebastien Pouliot  <sebastien@ximian.com>
6395
6396         * CryptoConvert.cs: Updated to latest version. Fix issue with 
6397         incomplete key pairs (#57941).
6398
6399 2004-05-01  Todd Berman  <tberman@sevenl.net>
6400
6401         * driver.cs: Remove '.' from path_chars, now System.* loads properly
6402         from the GAC
6403
6404 2004-04-30  Jackson Harper  <jackson@ximian.com>
6405
6406         * codegen.cs: Open keys readonly.
6407         
6408 2004-04-30  Gonzalo Paniagua Javier <gonzalo@ximian.com>
6409
6410         * typemanager.cs: don't report cyclic struct layout when a struct
6411         contains 2 or more fields of the same type. Failed for Pango.AttrShape
6412         which has 2 Pango.Rectangle fields.
6413
6414 2004-04-29 Ben Maurer  <bmaurer@users.sourceforge.net>
6415
6416         * expression.cs: Handle IntPtr comparisons with IL code
6417         rather than a method call.
6418
6419 2004-04-29  Martin Baulig  <martin@ximian.com>
6420
6421         * ecore.cs (PropertyExpr.FindAccessor): New private method.  Walk
6422         the list of PropertyInfo's in class hierarchy and find the
6423         accessor.  Fixes #56013.
6424
6425 2004-04-29  Martin Baulig  <martin@ximian.com>
6426
6427         * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
6428
6429 2004-04-29  Martin Baulig  <martin@ximian.com>
6430
6431         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
6432
6433         * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
6434
6435 2004-04-29  Martin Baulig  <martin@ximian.com>
6436
6437         * class.cs (ConstructorInitializer.Resolve): Check whether the
6438         parent .ctor is accessible.  Fixes #52146.
6439
6440 2004-04-29  Martin Baulig  <martin@ximian.com>
6441
6442         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
6443
6444         * statement.cs (Using.EmitLocalVariableDecls): Use
6445         TypeManager.idisposable_type, not typeof (IDisposable).
6446         (Foreach.EmitCollectionForeach): Added support for valuetypes.
6447
6448 2004-04-29  Martin Baulig  <martin@ximian.com>
6449
6450         * class.cs (Event.Define): Don't emit the field and don't set
6451         RTSpecialName and SpecialName for events on interfaces.  Fixes
6452         #57703. 
6453
6454 2004-04-29  Raja R Harinath  <rharinath@novell.com>
6455
6456         Refactor Attribute.ApplyAttributes.
6457         * attribute.cs (Attributable): New base class for objects that can
6458         have Attributes applied on them.
6459         (Attribute): Make AttributeUsage fields public.
6460         (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
6461         (Attribute.IsInternalCall): New property.
6462         (Attribute.UsageAttr): Convert to a public read-only property.
6463         (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
6464         (Attribute.ResolveType, Attribute.Resolve)
6465         (Attribute.ScanForIndexerName): Update to reflect changes.
6466         (Attribute.CheckAttributeTarget): Re-format.
6467         (Attribute.ApplyAttributes): Refactor, to various
6468         Attributable.ApplyAttributeBuilder methods.
6469         * decl.cs (MemberCore): Make Attributable.
6470         * class.cs (Accessor): Make Attributable.
6471         (MethodData.ApplyAttributes): Use proper attribute types, not
6472         attribute names.
6473         (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
6474         (TypeContainer.ApplyAttributeBuilder)
6475         (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
6476         (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)   
6477         (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
6478         (Operator.ApplyAttributeBuilder): New factored-out methods.
6479         * const.cs (Const.ApplyAttributeBuilder): Likewise.
6480         * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
6481         * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
6482         * parameter.cs (ParameterBase): New Attributable base class
6483         that can also represent Return types.
6484         (Parameter): Update to the changes.
6485
6486 2004-04-29  Jackson Harper  <jackson@ximian.com>
6487
6488         * driver.cs: Prefer the corlib system version when looking for
6489         assemblies in the GAC. This is still a hack, but its a better hack
6490         now.
6491         
6492 2004-04-29  Marek Safar  <marek.safar@seznam.cz>
6493
6494         * decl.cs, enum.cs: Improved error 3005 reporting.
6495   
6496         * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
6497         (related_symbols): New private member for list of symbols
6498         related to reported error/warning.
6499         
6500         * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
6501
6502 2004-04-29  Martin Baulig  <martin@ximian.com>
6503
6504         * ecore.cs (Expression.Constantify): If we're an enum and
6505         TypeManager.TypeToCoreType() doesn't give us another type, use
6506         t.UnderlyingSystemType.  Fixes #56178.  
6507
6508 2004-04-29  Martin Baulig  <martin@ximian.com>
6509
6510         * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
6511         interfaces and for each interface, only add members directly
6512         declared in that interface.  Fixes #53255.
6513
6514 2004-04-28  Martin Baulig  <martin@ximian.com>
6515
6516         * expression.cs (ConditionalLogicalOperator): Use a temporary
6517         variable for `left' to avoid that we evaluate it more than once;
6518         bug #52588.
6519
6520 2004-04-28  Martin Baulig  <martin@ximian.com>
6521
6522         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
6523         `void[]' (CS1547).
6524
6525 2004-04-28  Martin Baulig  <martin@ximian.com>
6526
6527         * statement.cs (LocalInfo.Resolve): Check whether the type is not
6528         void (CS1547).
6529
6530         * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
6531         whether the type is not void (CS1547).
6532
6533 2004-04-28  Martin Baulig  <martin@ximian.com>
6534
6535         * expression.cs (Unary.DoResolveLValue): Override this and report
6536         CS0131 for anything but Operator.Indirection.
6537
6538 2004-04-28  Martin Baulig  <martin@ximian.com>
6539
6540         Committing a patch from Ben Maurer; see bug #50820.
6541
6542         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
6543         check for classes.
6544
6545         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
6546         classes.        
6547
6548 2004-04-28  Martin Baulig  <martin@ximian.com>
6549
6550         Committing a patch from Ben Maurer; see bug #50820.
6551
6552         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
6553         check for classes.
6554
6555         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
6556         classes.        
6557
6558 2004-04-28  Martin Baulig  <martin@ximian.com>
6559
6560         * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
6561         (Block.AddLabel): Call DoLookupLabel() to only search in the
6562         current block.
6563
6564 2004-04-28  Martin Baulig  <martin@ximian.com>
6565
6566         * cfold.cs (ConstantFold.BinaryFold): Added special support for
6567         comparing StringConstants and NullLiterals in Equality and Inequality.
6568
6569 2004-04-28  Jackson Harper  <jackson@ximian.com>
6570
6571         * driver.cs: Attempt to load referenced assemblies from the
6572         GAC. This is the quick and dirty version of this method that
6573         doesnt take into account versions and just takes the first
6574         canidate found. Will be good enough for now as we will not have more
6575         then one version installed into the GAC until I update this method.
6576
6577 2004-04-28  Martin Baulig  <martin@ximian.com>
6578
6579         * typemanager.cs (TypeManager.CheckStructCycles): New public
6580         static method to check for cycles in the struct layout.
6581
6582         * rootcontext.cs (RootContext.PopulateTypes): Call
6583         TypeManager.CheckStructCycles() for each TypeContainer.
6584         [Note: We only need to visit each type once.]
6585
6586 2004-04-28  Martin Baulig  <martin@ximian.com>
6587
6588         * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
6589
6590         * const.cs (Const.LookupConstantValue): Return a `bool' signalling
6591         success and added `out object value'.  Use a `bool resolved' field
6592         to check whether we've already been called rather than
6593         `ConstantValue != null' since this breaks for NullLiterals.
6594
6595 2004-04-28  Raja R Harinath  <rharinath@novell.com>
6596
6597         * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
6598         setting of this flag, since the 'set' method may be non-public.
6599
6600 2004-04-28  Raja R Harinath  <rharinath@novell.com>
6601
6602         * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
6603         check on current_vector.Block.
6604
6605 2004-04-27  Martin Baulig  <martin@ximian.com>
6606
6607         * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
6608         a field initializer.  Fixes #56459.
6609
6610 2004-04-27  Martin Baulig  <martin@ximian.com>
6611
6612         * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
6613         we're not attempting to use an indexer.  Fixes #52154.
6614
6615 2004-04-27  Martin Baulig  <martin@ximian.com>
6616
6617         * statement.cs (Return): Don't create a return label if we don't
6618         need it; reverts my change from January 20th.  Thanks to Ben
6619         Maurer for this.
6620
6621 2004-04-27  Martin Baulig  <martin@ximian.com>
6622
6623         According to the spec, `goto' can only leave a nested scope, but
6624         never enter it.
6625
6626         * statement.cs (Block.LookupLabel): Only lookup in the current
6627         block, don't recurse into parent or child blocks.
6628         (Block.AddLabel): Check in parent and child blocks, report
6629         CS0140/CS0158 if we find a duplicate.
6630         (Block): Removed this indexer for label lookups.
6631         (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
6632         this already does the error reporting for us.
6633
6634         * flowanalysis.cs
6635         (FlowBranching.UsageVector.Block): New public variable; may be null.
6636         (FlowBranching.CreateSibling): Added `Block' argument.
6637         (FlowBranching.LookupLabel): New public virtual method.  Lookup a
6638         label for the target of a `goto' and check whether we're not
6639         leaving a `finally'.
6640
6641 2004-04-27  Martin Baulig  <martin@ximian.com>
6642
6643         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
6644         a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
6645         just for returns).
6646
6647 2004-04-27  Martin Baulig  <martin@ximian.com>
6648
6649         * statement.cs (Block.AddLabel): Also check for implicit blocks
6650         and added a CS0158 check.
6651
6652 2004-04-27  Martin Baulig  <martin@ximian.com>
6653
6654         * flowanalysis.cs (FlowBranchingLoop): New class.
6655         (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
6656         UsageVector's instead of an ArrayList.
6657         (FlowBranching.Label): Likewise.
6658         (FlowBranching.UsageVector.MergeBreakOrigins): New method.
6659         (FlowBranching.AddBreakVector): New method.
6660
6661 2004-04-27  Miguel de Icaza  <miguel@ximian.com>
6662
6663         * attribute.cs: Small regression fix: only convert the type if we
6664         the type is different, fixes System.Drawing build.
6665
6666 2004-04-27  Martin Baulig  <martin@ximian.com>
6667
6668         * attribute.cs (Attribute.Resolve): If we have a constant value
6669         for a named field or property, implicity convert it to the correct
6670         type.
6671
6672 2004-04-27  Raja R Harinath  <rharinath@novell.com>
6673
6674         * statement.cs (Block.Block): Implicit blocks share
6675         'child_variable_names' fields with parent blocks.
6676         (Block.AddChildVariableNames): Remove.
6677         (Block.AddVariable): Mark variable as "used by a child block" in
6678         every surrounding block.
6679         * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
6680         been used in a child block, complain about violation of "Invariant
6681         meaning in blocks" rule.
6682         * cs-parser.jay (declare_local_variables): Don't use
6683         AddChildVariableNames.
6684         (foreach_statement): Don't create an implicit block: 'foreach'
6685         introduces a scope.
6686
6687 2004-04-23  Miguel de Icaza  <miguel@ximian.com>
6688
6689         * convert.cs (ImplicitNumericConversion): 0 is also positive when
6690         converting from 0L to ulong.  Fixes 57522.
6691
6692 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
6693
6694         * decl.cs (FindMemberToOverride): Fix wrong warning for case when
6695         derived class hides via 'new' keyword field from base class (test-242.cs).
6696         TODO: Handle this in the more general way.
6697         
6698         * class.cs (CheckBase): Ditto.
6699
6700 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
6701
6702         * decl.cs (caching_flags): New member for storing cached values
6703         as bit flags.
6704         (MemberCore.Flags): New enum where bit flags for caching_flags
6705         are defined.
6706         (MemberCore.cls_compliance): Moved to caching_flags.
6707         (DeclSpace.Created): Moved to caching_flags.
6708
6709         * class.cs: Use caching_flags instead of DeclSpace.Created
6710         
6711 2004-04-21  Miguel de Icaza  <miguel@ximian.com>
6712
6713         * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
6714         if we are only a derived class, not a nested class.
6715
6716         * typemanager.cs: Same as above, but do this at the MemberLookup
6717         level (used by field and methods, properties are handled in
6718         PropertyExpr).   Allow for the qualified access if we are a nested
6719         method. 
6720
6721 2004-04-21  Marek Safar  <marek.safar@seznam.cz>
6722
6723         * class.cs: Refactoring.
6724         (IMethodData): New inteface; Holds links to parent members
6725         to avoid member duplication (reduced memory allocation).
6726         (Method): Implemented IMethodData interface.
6727         (PropertyBase): New inner classes for get/set methods.
6728         (PropertyBase.PropertyMethod): Implemented IMethodData interface
6729         (Event): New inner classes for add/remove methods.
6730         (Event.DelegateMethod): Implemented IMethodData interface.
6731
6732         * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
6733         EmitContext (related to class.cs refactoring).
6734
6735 2004-04-21  Raja R Harinath  <rharinath@novell.com>
6736
6737         * delegate.cs (Delegate.VerifyApplicability): If the number of
6738         arguments are the same as the number of parameters, first try to
6739         verify applicability ignoring  any 'params' modifier on the last
6740         parameter.
6741         Fixes #56442.
6742
6743 2004-04-08  Martin Baulig  <martin@ximian.com>
6744
6745         Merged latest changes into gmcs.  Please keep this comment in
6746         here, it makes it easier for me to see what changed in MCS since
6747         the last time I merged.
6748
6749 2004-04-16  Raja R Harinath  <rharinath@novell.com>
6750
6751         * class.cs (TypeContainer.AddIndexer): Use
6752         'ExplicitInterfaceName' to determine if interface name was
6753         explicitly specified.  'InterfaceType' is not initialized at this time.
6754         (TypeContainer.DefineIndexers): Remove use of temporary list.  The
6755         Indexers array is already in the required order.  Initialize
6756         'IndexerName' only if there are normal indexers.
6757         (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
6758         (TypeContainer.Emit): Emit DefaultMember attribute only if
6759         IndexerName is initialized.
6760         Fixes #56300.
6761
6762 2004-04-15  Benjamin Jemlich  <pcgod@gmx.net>
6763
6764         * enum.cs (Enum.DefineType): Don't allow char as type for enum.
6765         Fixes #57007
6766
6767 2004-04-15  Raja R Harinath  <rharinath@novell.com>
6768
6769         * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
6770         attributes.
6771         Fix for #56456.
6772
6773         * attribute.cs (Attribute.Resolve): Check for duplicate named
6774         attributes.
6775         Fix for #56463.
6776
6777 2004-04-15  Miguel de Icaza  <miguel@ximian.com>
6778
6779         * iterators.cs (MarkYield): track whether we are in an exception,
6780         and generate code accordingly.  Use a temporary value to store the
6781         result for our state.
6782
6783         I had ignored a bit the interaction of try/catch with iterators
6784         since their behavior was not entirely obvious, but now it is
6785         possible to verify that our behavior is the same as MS .NET 2.0
6786
6787         Fixes 54814
6788
6789 2004-04-14  Miguel de Icaza  <miguel@ximian.com>
6790
6791         * iterators.cs: Avoid creating temporaries if there is no work to
6792         do. 
6793
6794         * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
6795         Enumerations, use TypeManager.EnumToUnderlying and call
6796         recursively. 
6797
6798         Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
6799         bug #57013
6800
6801         (This.Emit): Use EmitContext.EmitThis to emit our
6802         instance variable.
6803
6804         (This.EmitAssign): Ditto.
6805
6806         * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
6807         codepaths, we will move all the functionality into
6808         Mono.CSharp.This 
6809
6810         (FieldExpr.EmitAssign): Ditto.
6811
6812         This fixes several hidden bugs that I uncovered while doing a code
6813         review of this today.
6814
6815         * codegen.cs (EmitThis): reworked so the semantics are more clear
6816         and also support value types "this" instances.
6817
6818         * iterators.cs: Changed so that for iterators in value types, we
6819         do not pass the value type as a parameter.  
6820
6821         Initialization of the enumerator helpers is now done in the caller
6822         instead of passing the parameters to the constructors and having
6823         the constructor set the fields.
6824
6825         The fields have now `assembly' visibility instead of private.
6826
6827 2004-04-11  Miguel de Icaza  <miguel@ximian.com>
6828
6829         * expression.cs (Argument.Resolve): Check if fields passed as ref
6830         or out are contained in a MarshalByRefObject.
6831
6832         * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
6833         another compiler type.
6834
6835 2004-04-06 Ben Maurer  <bmaurer@users.sourceforge.net>
6836
6837         * class.cs (Indexer.Define): use the new name checking method.
6838         Also, return false on an error.
6839         * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
6840         (is_identifier_[start/part]_character): make static.
6841
6842 2004-04-10  Miguel de Icaza  <miguel@ximian.com>
6843
6844         * expression.cs (Binary.ResolveOperator): Do no append strings
6845         twice: since we can be invoked more than once (array evaluation)
6846         on the same concatenation, take care of this here.  Based on a fix
6847         from Ben (bug #56454)
6848
6849 2004-04-08  Sebastien Pouliot  <sebastien@ximian.com>
6850
6851         * codegen.cs: Fix another case where CS1548 must be reported (when 
6852         delay-sign isn't specified and no private is available #56564). Fix
6853         loading the ECMA "key" to delay-sign an assembly. Report a CS1548 
6854         error when MCS is used on the MS runtime and we need to delay-sign 
6855         (which seems unsupported by AssemblyBuilder - see #56621).
6856
6857 2004-04-08  Marek Safar  <marek.safar@seznam.cz>
6858
6859         * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
6860         (TypeManager.ComputeNamespaces): Faster implementation for
6861         Microsoft runtime.
6862
6863         * compiler.csproj: Updated AssemblyName to mcs.
6864
6865 2004-05-11  Jackson Harper  <jackson@ximian.com>
6866
6867         * Makefile: Preserve MONO_PATH
6868         
6869 2004-05-11  Jackson Harper  <jackson@ximian.com>
6870
6871         * Makefile: Use mono and mcs to build gmcs
6872         
6873 2004-05-03  Miguel de Icaza  <miguel@ximian.com>
6874
6875         * codegen.cs: Add patch from Robert Shade
6876         <rshade@dvsconsulting.com>, use FileAccess.Read on the keyfile, to
6877         sync with mcs.
6878
6879 2004-05-02  Sebastien Pouliot  <sebastien@ximian.com>
6880
6881         * CryptoConvert.cs: Updated to latest version. Fix issue with 
6882         incomplete key pairs (#57941).
6883
6884 2004-04-08  Sebastien Pouliot  <sebastien@ximian.com>
6885
6886         * codegen.cs: Fix another case where CS1548 must be reported (when 
6887         delay-sign isn't specified and no private is available #56564). Fix
6888         loading the ECMA "key" to delay-sign an assembly. Report a CS1548 
6889         error when MCS is used on the MS runtime and we need to delay-sign 
6890         (which seems unsupported by AssemblyBuilder - see #56621).
6891
6892 2004-04-29  Jackson Harper  <jackson@ximian.com>
6893
6894         * Makefile: Set MONO_PATH to use the bootstrap corlib
6895         * driver.cs: Check the GAC for referenced assemblies.
6896                 
6897 2004-04-29  Martin Baulig  <martin@ximian.com>
6898
6899         * Makefile (gmcs.exe): Set MONO_PATH to use `../class/lib/net_2_0'.
6900
6901 2004-04-07  Martin Baulig  <martin@ximian.com>
6902
6903         * expression.cs (Binary.ResolveOperator): Added special case for
6904         Equality/Inequality between a type parameter and a null literal.
6905
6906 2004-04-07  Martin Baulig  <martin@ximian.com>
6907
6908         * convert.cs: Check null literal -> type parameter conversions.
6909
6910 2004-04-07  Martin Baulig  <martin@ximian.com>
6911
6912         * generic.cs (ConstructedType.CheckConstraints): Enforce the
6913         `class' and `struct' constraints.
6914
6915 2004-04-07  Martin Baulig  <martin@ximian.com>
6916
6917         * generic.cs (SpecialConstraint): New public enum.
6918         (Constraints.Resolve): Added support for the `class' and `struct'
6919         constraints.
6920
6921         * cs-parser.jay (type_parameter_constraint): Added support for the
6922         `class' and `struct' constraints.
6923
6924 2004-04-07  Martin Baulig  <martin@ximian.com>
6925
6926         * support.cs (GenericConstraints): Replaced `Types' by
6927         `ClassConstraint' and `InterfaceConstraints'; added
6928         `HasClassConstraint'.   
6929
6930 2004-04-07  Martin Baulig  <martin@ximian.com>
6931
6932         * generic.cs
6933         (Constraints.InterfaceConstraints): New public property.
6934         (Constraints.Types): Make this property public
6935         (TypeParameter): Implement IMemberContainer.
6936         (TypeParameter.Define): Take a `GenericTypeParameterBuilder'
6937         instead of a TypeBuilder/MethodBuilder; pass the interface
6938         constraints to TypeManager.AddTypeParameter().
6939         (TypeParameter.DefineType): Just take an EmitContext and no
6940         TypeBuilder/MethodBuilder.  Use the new public API.
6941
6942         * typemanager.cs (TypeManager.AddTypeParameter): Added
6943         `TypeExpr[]' argument; add the interfaces to the
6944         `builder_to_ifaces' hash.
6945         (TypeManager.LookupMemberContainer): For
6946         GenericTypeParameterBuilders, get the TypeParameter from the
6947         `builder_to_type_param'.
6948         (TypeManager.FindMembers): For GenericTypeParameterBuilders, get
6949         the TypeParameter and call FindMembers on it.
6950
6951 2004-04-07  Martin Baulig  <martin@ximian.com>
6952
6953         * class.cs
6954         (MethodCore.GenericMethod): Moved this field here from Method.
6955         (MethodCore.IsDuplicateImplementation): Take the number of type
6956         parameters into account if we're a generic method.
6957
6958         * expression.cs (Invocation.InferTypeArguments): Don't return true
6959         if `arguments' is null; we still need to check whether we actually
6960         don't need to infer anything in this case.
6961         (MemberAccess): Merged the functionality from GenericMemberAccess
6962         into this class.
6963
6964         * generic.cs (GenericMemberAccess): Removed.
6965
6966 2004-04-05  Martin Baulig  <martin@ximian.com>
6967
6968         * decl.cs (MemberCore): For generic classes, interfaces and
6969         structs, `Name' now includes the number of type parameters
6970         ("Stack!1.Node!1").
6971         (DeclSpace.FindType): Removed the `num_type_args' argument; we now
6972         encode the number of type arguments in the type name.
6973
6974         * expression.cs (Expression.MemberLookup): Removed the
6975         `num_type_args' argument; we now encode the number of type
6976         arguments in the type name.
6977
6978         * ecore.cs (SimpleName): Encode the number of type arguments in
6979         the type name itself.
6980
6981         * generic.cs (ConstructedType): Likewise.
6982
6983         * tree.cs (Tree.RecordDecl): Take a `string' instead of a
6984         `MemberName'; we now include the number of type parameters in the
6985         type name.
6986
6987         * typemanager.cs (TypeManager.CheckGeneric): Removed.
6988         (TypeManager.MemberLookup): Removed the
6989         `num_type_args' argument; we now encode the number of type
6990         arguments in the type name.     
6991
6992 2004-04-03  Martin Baulig  <martin@ximian.com>
6993
6994         * decl.cs (MemberCore.ctor): Take a MemberName instead of a sting.
6995         (MemberCore.MemberName): Moved here from MemberBase.
6996         (DeclSpace.SetParameterInfo): Just take the constraints as an
6997         ArrayList; we already have the type parameters in our
6998         `MemberName'; also do the CS0080 reporting here.
6999
7000         * cs-parser.jay (struct_declaration): Use `member_name' instead of
7001         `IDENTIFIER opt_type_parameter_list'; when constructing our
7002         `MemberName', it'll already include our type parameters.
7003         (class_declaration, interface_declaration): Likewise.
7004         (delegate_declaration): Likewise.
7005         (MakeName): Take a MemberName and return a MemberName.
7006         The following two changes are required to avoid shift/reduce conflicts:
7007         (member_name): Don't include a TypeName anymore; ie. this is now
7008         just 'IDENTIFIER opt_type_parameter_list'.
7009         (property_declaration, event_declaration): Use a
7010         `namespace_or_type_name' instead of a `member_name'.            
7011
7012 2004-04-03  Martin Baulig  <martin@ximian.com>
7013
7014         * decl.cs (MemberName): Renamed to `TypeName' and created a new
7015         `MemberName' class.
7016         (TypeName): Formerly known as MemberName.
7017
7018         * namespace.cs (NamespaceEntry.UsingAlias): Take a `TypeName'
7019         instead of a `MemberName'.
7020
7021         * cs-parser.jay (namespace_or_type_name): Create a TypeName.
7022         (member_name): New rule; create a MemberName.
7023
7024 2004-04-02  Martin Baulig  <martin@ximian.com>
7025
7026         * namespace.cs (NamespaceEntry.VerifyUsing): Added error checking
7027         (CS0305 and CS0308).
7028
7029 2004-04-02  Martin Baulig  <martin@ximian.com>
7030
7031         * generic.cs (GenericMemberAccess.ResolveAsTypeStep): Added
7032         support for nested types.
7033
7034 2004-04-02  Martin Baulig  <martin@ximian.com>
7035
7036         * ecore.cs (IAlias): New public interface.
7037         (TypeExpr, TypeExpression): Implement IAlias.
7038         (TypeAliasExpression): New public class.
7039
7040         * namespace.cs (Namespace): Implement IAlias.
7041         (Namespace.Lookup): Return an IAlias instead on an object.
7042         (Namespace.DefineName): Take an IAlias instead of an object.
7043         (NamespaceEntry.AliasEntry.Resolve): Return an IAlias instead of
7044         an object.
7045         (NamespaceEntry.UsingAlias): Take a Membername instead of an
7046         Expression.
7047         (NamespaceEntry.LookupAlias): Return an IAlias instead on an
7048         object.
7049         (NamespaceEntry.Lookup): Likewise.
7050
7051         * rootcontext.cs (RootContext.LookupType): Return a TypeExpr
7052         instead of a Type.      
7053
7054         * decl.cs (DeclSpace): Implement IAlias.
7055         (DeclSpace.LookupAlias): Return an IAlias instead of a string.
7056
7057         * generic.cs (ConstructedType): Improved error checking.
7058
7059 2004-04-02  Martin Baulig  <martin@ximian.com>
7060
7061         * convert.cs: Added type parameter conversions.
7062
7063         * ecore.cs
7064         (UnboxCast.Emit): Emit an `unbox.any' for type params.
7065         (ClassCast.Emit): If the source type is a type parameter, box it.
7066         If the target type is a type parameter, emit an `unbox.any'
7067         instead of a `classcast'.1      
7068
7069 2004-04-01  Martin Baulig  <martin@ximian.com>
7070
7071         * cs-tokenizer.cs (parse_less_than): Allow Token.DOT.
7072
7073 2004-04-01  Martin Baulig  <martin@ximian.com>
7074
7075         * generic.cs (ConstructedType.CheckConstraints): Use
7076         Convert.ImplicitStandardConversionExists(); user-defined implicit
7077         conversions are not allowed according to the spec.
7078
7079 2004-03-30  Martin Baulig  <martin@ximian.com>
7080
7081         * expression.cs (New): Added support for type parameters.
7082
7083         * typemanager.cs
7084         (TypeManager.activator_type): New public static field.
7085         (TypeManager.activator_create_instance): Likewise.
7086
7087 2004-03-30  Martin Baulig  <martin@ximian.com>
7088
7089         * typemanager.cs (TypeManager.HasConstructorConstraint): New
7090         public method.
7091
7092 2004-03-30  Martin Baulig  <martin@ximian.com>
7093
7094         * generic.cs (ConstructedType.CheckConstraints): Actually follow
7095         the spec here: the argument type must be convertible to the
7096         constraints.
7097
7098 2004-03-30  Martin Baulig  <martin@ximian.com>
7099
7100         * generic.cs
7101         (TypeParameter.Define, TypeParameter.DefineMethod): Call
7102         TypeManager.AddTypeParameter().
7103         (ConstructedType.CheckConstraints): Re-enable this and actually
7104         check whether we have a constructor constraint.
7105
7106         * typemanager.cs
7107         (TypeManager.builder_to_type_param): New static field.
7108         (TypeManager.AddTypeParameter): New static method.
7109         (TypeManager.LookupTypeParameter): New public method.
7110
7111 2004-03-30  Martin Baulig  <martin@ximian.com>
7112
7113         * generic.cs (TypeParameter.DefineType): Return a boolean and use
7114         the new API to actually define the constructor constraint.
7115
7116         * typemanager.cs
7117         (TypeManager.new_constraint_attr_type): New static field.
7118         (TypeManager.InitCoreTypes): Initialize it.
7119
7120 2004-03-30  Martin Baulig  <martin@ximian.com>
7121
7122         * generic.cs (Constraints): Completed error checking, use correct
7123         error numbers.
7124
7125 2004-03-29  Martin Baulig  <martin@ximian.com>
7126
7127         * delegate.cs (Delegate.VerifyMethod): Infer type arguments.
7128
7129         * expression.cs (Invocation.InferTypeArguments): Added overloaded
7130         public version which takes a `ParameterData pd' instead of an
7131         `ArrayList args'.
7132
7133 2004-03-29  Martin Baulig  <martin@ximian.com>
7134
7135         * typemanager.cs (TypeManager.IsGenericMethod): Take a MethodBase,
7136         not a MethodInfo.       
7137
7138 2004-03-29  Martin Baulig  <martin@ximian.com>
7139
7140         * expression.cs (Argument.ResolveMethodGroup): If we're a
7141         ConstructedType, call GetMemberAccess() on it.  
7142
7143 2004-03-29  Martin Baulig  <martin@ximian.com>
7144
7145         * class.cs (MethodBase.CheckGenericOverride): New abstract method.
7146         (MethodCore.CheckGenericOverride): When overriding a generic
7147         method, check whether the constraints match.
7148
7149         * support.cs (GenericConstraints): New public interface.
7150         (ParameterData.GenericConstraints): New public method.
7151
7152         * parameter.cs (Parameter.Resolve): Check whether we're a generic
7153         method parameter and compute our constraints if appropriate.
7154         (Parameter.GenericConstraints): New public property.
7155
7156         * generic.cs (Constraints): Implement GenericConstraints.
7157
7158 2004-03-29  Martin Baulig  <martin@ximian.com>
7159
7160         * decl.cs (MemberCache.FindMemberToOverride): Use
7161         `paramTypes [j].Equals (cmpAttrs [j])' instead of `=='.
7162
7163 2004-03-29  Martin Baulig  <martin@ximian.com>
7164
7165         * generic.cs (GenericMethod.Define): Resolve our type parameters.
7166
7167 2004-03-29  Martin Baulig  <martin@ximian.com>
7168
7169         * cs-parser.jay: Report CS0080 instead of -200 ("Constraints are
7170         not allowed on non-generic declarations").
7171
7172 2004-03-29  Martin Baulig  <martin@ximian.com>
7173
7174         * expression.cs (Invocation.InferTypeArguments): Added overloaded
7175         public version of this method.
7176
7177         * class.cs (MethodCore.IsDuplicateImplementation): Use
7178         Invocation.InferTypeArguments() to check this.
7179
7180 2004-03-29  Martin Baulig  <martin@ximian.com>
7181
7182         * convert.cs: Use TypeManager.IsDelegateType() instead of
7183         comparing types correctly.
7184
7185 2004-03-29  Martin Baulig  <martin@ximian.com>
7186
7187         * convert.cs: Use TypeManager.IsSubclassOf() instead of comparing
7188         types directly to make it work for generic instances.
7189
7190         * typemanager.cs (TypeManager.IsSubclassOf): New static method.
7191
7192 2004-03-29  Martin Baulig  <martin@ximian.com>
7193
7194         * typemanager.cs (TypeManager.MayBecomeEqualGenericTypes): Added
7195         support for arrays.     
7196
7197 2004-03-24  Martin Baulig  <martin@ximian.com>
7198
7199         * decl.cs (DeclSpace.FindType): Also use
7200         TypeManager.CheckGeneric() for types from the using clauses.
7201
7202 2004-03-23  Martin Baulig  <martin@ximian.com>
7203
7204         * expression.cs (Invocation.OverloadResolve): Added `bool
7205         may_fail' argument and use it instead of the Location.IsNull() hack.
7206
7207 2004-03-23  Martin Baulig  <martin@ximian.com>
7208
7209         * expression.cs (Invocation.InferType): Use correct type inference
7210         rules here.     
7211
7212 2004-03-23  Martin Baulig  <martin@ximian.com>
7213
7214         * ecore.cs (MethodGroupExpr.Name): Use
7215         TypeManager.CSharpSignature() instead of just the name.
7216
7217         * expression.cs (Invocation.OverloadResolve): Provide better error
7218         reporting.
7219         (Invocation.DoResolve): OverloadResolve() never returns null
7220         without reporting an error, so removed the error -6 reporting here.
7221
7222 2004-03-23  Martin Baulig  <martin@ximian.com>
7223
7224         * typemanager.cs (TypeManager.GetMethodFlags): Fixed the FIXME for
7225         generic methods.
7226
7227         * cs-parser.jay (delegate_declaration): Support generic delegates.
7228
7229         * delegate.cs: Support generic delegates.
7230
7231 2004-03-22  Martin Baulig  <martin@ximian.com>
7232
7233         * expression.cs (Invocation.InferParamsTypeArguments): New static
7234         method; does type inference for params arguments.
7235
7236 2004-03-21  Martin Baulig  <martin@ximian.com>
7237
7238         * typemanager.cs (TypeManager.IsGenericMethod): New public static
7239         method; checks whether a method is a generic method.    
7240
7241         * expression.cs (Invocation.InferTypeArguments): New static method;
7242         infer type arguments for generic method invocation.
7243
7244         * ecore.cs (MethodGroupExpr.HasTypeArguments): New public
7245         property; we set this to true if we're resolving a generic method
7246         invocation and the user specified type arguments, ie. we're not
7247         doing type inference.
7248
7249 2004-03-20  Martin Baulig  <martin@ximian.com>
7250
7251         * class.cs (MethodData.DeclaringType): New public property.
7252         (MethodData.Define): Set DeclaringType here.
7253         (Operator.Define): Use OperatorMethod.MethodData.DeclaringType
7254         instead of OperatorMethodBuilder.DeclaringType.
7255
7256 2004-03-20  Martin Baulig  <martin@ximian.com>
7257
7258         * cs-tokenizer.cs (xtoken): Return a special
7259         Token.DEFAULT_OPEN_PARENS for "`default' followed by open parens".
7260
7261         * cs-parser.jay (default_value_expression): Switch to the new
7262         syntax (14.5.13).
7263
7264 2004-03-19  Martin Baulig  <martin@ximian.com>
7265
7266         * decl.cs (MemberName): New class.  We use this to "construct"
7267         namespace_or_type_name's.
7268
7269         * generics.cs (TypeArguments.GetDeclarations): New public method;
7270         returns the type arguments as a string[] and reports a CS0081 if
7271         one of them is not an identifier.
7272
7273         * class.cs (MemberBase): The .ctor now takes the name as a
7274         MemberName instead of a string.
7275         (MemberBase.ExplicitInterfaceName): Changed type from string to
7276         Expression.
7277         (MemberBase.DoDefine): If we're an explicit implementation, the
7278         InterfaceType may be a generic instance.
7279
7280         * cs-parser.jay (namespace_or_type_name): Return a MemberName.
7281         (namespace_name): Call MemberName.GetName () to transform the
7282         MemberName into a string and ensure we don't have any type
7283         arguments.
7284         (type_name): Call MemberName.GetTypeExpression() to transfrom the
7285         MemberName into an expression.
7286         (method_header): Use namespace_or_type_name instead of member_name.     
7287
7288 2004-04-07  Miguel de Icaza  <miguel@ximian.com>
7289
7290         * rootcontext.cs: Add new types to the boot resolution.
7291
7292         * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
7293         MulticastDelegate is not allowed.
7294
7295         * typemanager.cs: Add new types to lookup: System.TypedReference
7296         and ArgIterator.
7297
7298         * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
7299         check for TypedReference or ArgIterator, they are not allowed. 
7300
7301         * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
7302         makes us properly catch 1510 in some conditions (see bug 56016 for
7303         details). 
7304
7305 2004-04-06  Bernie Solomon  <bernard@ugsolutions.com>
7306
7307         * CryptoConvert.cs: update from corlib version
7308         with endian fixes.
7309
7310 2004-04-05  Miguel de Icaza  <miguel@ximian.com>
7311
7312         * class.cs (Indexer.Define): Check indexername declaration
7313
7314 2004-04-05  Marek Safar  <marek.safar@seznam.cz>
7315
7316         * attribute.cs (IsClsCompliant): Fixed problem with handling
7317         all three states (compliant, not-compliant, undetected).
7318
7319 2004-03-30  Marek Safar  <marek.safar@seznam.cz>
7320
7321         * attribute.cs (Attribute): Location is now public.
7322         (Resolve): Store resolved arguments (pos_values) in attribute class.
7323         Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
7324         (GetClsCompliantAttributeValue): New method that gets
7325         CLSCompliantAttribute value.
7326         (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
7327         if exists else null.
7328         (AttributeTester): New class for CLS-Compliant verification routines.
7329
7330         * class.cs (Emit): Add CLS-Compliant verification.
7331         (Method.GetSignatureForError): Implemented.
7332         (Constructor.GetSignatureForError): Implemented
7333         (Constructor.HasCompliantArgs): Returns if constructor has
7334         CLS-Compliant arguments.
7335         (Constructor.Emit): Override.
7336         (Construcor.IsIdentifierClsCompliant): New method; For constructors
7337         is needed to test only parameters.
7338         (FieldBase.GetSignatureForError): Implemented.
7339         (TypeContainer): New member for storing base interfaces.
7340         (TypeContainer.FindMembers): Search in base interfaces too.
7341
7342         * codegen.cs (GetClsComplianceAttribute): New method that gets
7343         assembly or module CLSCompliantAttribute value.
7344         (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
7345         for assembly.
7346         (ModuleClass.Emit): Add error 3012 test.
7347
7348         * const.cs (Emit): Override and call base for CLS-Compliant tests.
7349
7350         * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
7351         state for all decl types.
7352         (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
7353         if CLS-Compliant tests are required.
7354         (IsClsCompliaceRequired): New method. Analyze whether code
7355         must be CLS-Compliant.
7356         (IsExposedFromAssembly): New method. Returns true when MemberCore
7357         is exposed from assembly.
7358         (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
7359         value or gets cached value.
7360         (HasClsCompliantAttribute): New method. Returns true if MemberCore
7361         is explicitly marked with CLSCompliantAttribute.
7362         (IsIdentifierClsCompliant): New abstract method. This method is
7363         used to testing error 3005.
7364         (IsIdentifierAndParamClsCompliant): New method. Common helper method
7365         for identifier and parameters CLS-Compliant testing.
7366         (VerifyClsCompliance): New method. The main virtual method for
7367         CLS-Compliant verifications.
7368         (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
7369         null. I don't know why is null (too many public members !).
7370         (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
7371         and get value of first CLSCompliantAttribute that found.
7372
7373         * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
7374         (VerifyClsCompliance): Override and add extra tests.
7375
7376         * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
7377         clscheck- disable CLS-Compliant verification event if assembly is has
7378         CLSCompliantAttribute(true).
7379
7380         * enum.cs (Emit): Override and call base for CLS-Compliant tests.
7381         ApllyAttribute is now called in emit section as in the other cases.
7382         Possible future Emit integration.
7383         (IsIdentifierClsCompliant): New override.
7384         (VerifyClsCompliance): New override.
7385         (GetEnumeratorName): Returns full enum name.
7386
7387         * parameter.cs (GetSignatureForError): Implemented.
7388
7389         * report.cs (WarningData): New struct for Warning message information.
7390         (LocationOfPreviousError): New method.
7391         (Warning): New method. Reports warning based on the warning table.
7392         (Error_T): New method. Reports error based on the error table.
7393
7394         * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
7395         verifications are done here.
7396
7397         * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
7398
7399         * typemanager.cs (cls_compliant_attribute_type): New member thath holds
7400         CLSCompliantAttribute.
7401         (all_imported_types): New member holds all imported types from other
7402         assemblies.
7403         (LoadAllImportedTypes): New method fills static table with exported types
7404         from all referenced assemblies.
7405         (Modules): New property returns all assembly modules.
7406
7407 2004-03-30  Miguel de Icaza  <miguel@ximian.com>
7408
7409         * cs-parser.jay: Add a rule to catch wrong event syntax instead of
7410         throwing a parser error.
7411
7412         * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
7413         which removes the hardcoded get_/set_ prefixes for properties, as
7414         IL allows for the properties to be named something else.  
7415
7416         Bug #56013
7417
7418         * expression.cs: Do not override operand before we know if it is
7419         non-null.  Fix 56207
7420
7421 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
7422
7423         * typemanager.cs: support for pinned variables.
7424
7425 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
7426
7427         * decl.cs, typemanager.cs: Avoid using an arraylist
7428         as a buffer if there is only one result set.
7429
7430 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
7431
7432         * expression.cs: Make sure you cant call a static method
7433         with an instance expression, bug #56174.
7434
7435 2004-03-29  Miguel de Icaza  <miguel@ximian.com>
7436
7437         * class.cs (IsDuplicateImplementation): Improve error reporting to
7438         flag 663 (method only differs in parameter modifier).
7439
7440         * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
7441         in preprocessor directives.
7442
7443         * location.cs (LookupFile): Allow for the empty path.
7444
7445         * attribute.cs (DefinePInvokeMethod): Fix 56148;  I would like a
7446         better approach for some of that patch, but its failing with the
7447         CharSet enumeration.  For now try/catch will do.
7448
7449         * typemanager.cs: Do not crash if a struct does not have fields.
7450         Fixes 56150.
7451
7452 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
7453
7454         * expression.cs: cs0213, cant fix a fixed expression.
7455         fixes 50231.
7456
7457 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
7458
7459         * cs-parser.jay: detect invalid embeded statements gracefully.
7460         bug #51113.
7461
7462 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
7463
7464         * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
7465         As a regex:
7466         s/
7467         the invocation type may not be a subclass of the tye of the item/
7468         The type of the item must be a subclass of the invocation item.
7469         /g
7470
7471         Fixes bug #50820.
7472
7473 2004-03-25  Sebastien Pouliot  <sebastien@ximian.com>
7474
7475         * attribute.cs: Added methods to get a string and a bool from an
7476         attribute. Required to information from AssemblyKeyFileAttribute,
7477         AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
7478         * codegen.cs: Modified AssemblyName creation to include support for
7479         strongnames. Catch additional exceptions to report them as CS1548.
7480         * compiler.csproj: Updated include CryptoConvert.cs.
7481         * compiler.csproj.user: Removed file - user specific configuration.
7482         * CryptoConvert.cs: New. A COPY of the class CryptoConvert from 
7483         Mono.Security assembly. The original class is maintained and tested in
7484         /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
7485         * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
7486         like CSC 8.0 (C# v2) supports.
7487         * Makefile: Added CryptoConvert.cs to mcs sources.
7488         * rootcontext.cs: Added new options for strongnames.
7489
7490 2004-03-24 Ben Maurer  <bmaurer@users.sourceforge.net>
7491
7492         * driver.cs: For --expect-error, report error code `2'
7493         if the program compiled with no errors, error code `1' if
7494         it compiled with an error other than the one expected.
7495
7496 2004-03-24  Sebastien Pouliot  <sebastien@ximian.com>
7497
7498         * compiler.csproj: Updated for Visual Studio .NET 2003.
7499         * compiler.csproj.user: Updated for Visual Studio .NET 2003.
7500         * compiler.sln: Updated for Visual Studio .NET 2003.
7501
7502 2004-03-24  Ravi Pratap M  <ravi@ximian.com>
7503
7504         * expression.cs: Fix bug #47234. We basically need to apply the
7505         rule that we prefer the conversion of null to a reference type
7506         when faced with a conversion to 'object' (csc behaviour).
7507
7508 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
7509
7510         * statement.cs: Shorter form for foreach, eliminates
7511         a local variable. r=Martin.
7512
7513 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
7514
7515         * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
7516         checks if we can use brtrue/brfalse to test for 0.
7517         * expression.cs: use the above in the test for using brtrue/brfalse.
7518         cleanup code a bit.
7519
7520 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
7521
7522         * expression.cs: Rewrite string concat stuff. Benefits:
7523
7524         - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
7525         - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
7526         rather than a concat chain.
7527
7528         * typemanager.cs: Add lookups for more concat overloads.
7529
7530 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
7531
7532         * expression.cs: Emit shorter il code for array init.
7533
7534         newarr
7535         dup
7536         // set 1
7537
7538         // set 2
7539
7540         newarr
7541         stloc.x
7542
7543         ldloc.x
7544         // set 1
7545
7546         ldloc.x
7547         // set 2
7548
7549 2004-03-22 Ben Maurer  <bmaurer@users.sourceforge.net>
7550
7551         * statement.cs: Before, two switch blocks would be merged if the
7552         total size of the blocks (end_item - begin_item + 1) was less than
7553         two times the combined sizes of the blocks.
7554
7555         Now, it will only merge if after the merge at least half of the
7556         slots are filled.
7557
7558         fixes 55885.
7559
7560 2004-03-20  Atsushi Enomoto  <atsushi@ximian.com>
7561
7562         * class.cs : csc build fix for GetMethods(). See bug #52503.
7563
7564 2004-03-20 Ben Maurer  <bmaurer@users.sourceforge.net>
7565
7566         * expression.cs: Make sure fp comparisons work with NaN.
7567         This fixes bug #54303. Mig approved this patch a long
7568         time ago, but we were not able to test b/c the runtime
7569         had a related bug.
7570
7571 2004-03-19  Miguel de Icaza  <miguel@ximian.com>
7572
7573         * ecore.cs (TypExpr.GetHashCode): implement this overload. 
7574
7575 2004-03-19  Martin Baulig  <martin@ximian.com>
7576
7577         * class.cs (MemberCore.IsDuplicateImplementation): Check whether
7578         two overloads may unify for some type parameter substitutions and
7579         report a CS0408 if appropriate.
7580
7581 2004-03-19  Martin Baulig  <martin@ximian.com>
7582
7583         * class.cs (MemberCore.IsDuplicateImplementation): Report the
7584         error here and not in our caller.
7585
7586 2004-03-19  Martin Baulig  <martin@ximian.com>
7587
7588         * interface.cs: Completely killed this file.
7589         (Interface): We're now a TypeContainer and live in class.cs.
7590
7591         * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
7592         argument; we're now also called for interfaces.
7593         (TypeContainer.DefineMembers): Allow this method being called
7594         multiple times.
7595         (TypeContainer.GetMethods): New public method; formerly known as
7596         Interface.GetMethod().  This is used by PendingImplementation.
7597         (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
7598         it's now private and non-static.
7599         (Interface): Moved this here; it's now implemented similar to
7600         Class and Struct.
7601         (Method, Property, Event, Indexer): Added `bool is_interface'
7602         argument to their .ctor's.
7603         (MemberBase.IsInterface): New public field.
7604
7605         * cs-parser.jay: Create normal Method, Property, Event, Indexer
7606         instances instead of InterfaceMethod, InterfaceProperty, etc.
7607         (opt_interface_base): Removed; we now use `opt_class_base' instead.
7608         (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
7609
7610 2004-03-19  Martin Baulig  <martin@ximian.com>
7611
7612         * class.cs (MethodCore.IsDuplicateImplementation): New private
7613         method which does the CS0111 checking.
7614         (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
7615         Use IsDuplicateImplementation().
7616
7617 2004-03-17 Ben Maurer  <bmaurer@users.sourceforge.net>
7618
7619         * decl.cs (FindMemberToOverride): New method to find the correct
7620         method or property to override in the base class.
7621         * class.cs
7622             - Make Method/Property use the above method to find the
7623               version in the base class.
7624             - Remove the InheritableMemberSignatureCompare as it is now
7625               dead code.
7626
7627         This patch makes large code bases much faster to compile, as it is
7628         O(n) rather than O(n^2) to do this validation.
7629
7630         Also, it fixes bug 52458 which is that nested classes are not
7631         taken into account when finding the base class member.
7632
7633         Reviewed/Approved by Martin.
7634
7635 2004-03-17  Martin Baulig  <martin@ximian.com>
7636
7637         * expression.cs (MemberAccess.DoResolve): Take the parent's number
7638         of type arguments into account; use the `real_num_type_args'
7639         approach like in DoResolveAsTypeStep().
7640
7641         * generic.cs (GenericMemberAccess.DoResolve): Make this work for
7642         nested types.
7643
7644 2004-03-17  Marek Safar  <marek.safar@seznam.cz>
7645
7646         * interface.cs: In all interface classes removed redundant
7647         member initialization.
7648
7649 2004-03-16  Martin Baulig  <martin@ximian.com>
7650
7651         * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
7652
7653 2004-03-15  Miguel de Icaza  <miguel@ximian.com>
7654
7655         * decl.cs (DefineTypeAndParents): New helper method to define a
7656         type's containers before the type itself is defined;  This is a
7657         bug exposed by the recent changes to Windows.Forms when an
7658         implemented interface was defined inside a class that had not been
7659         built yet.   
7660
7661         * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
7662
7663         (Check): Loop correctly to report errors modifiers
7664         (UNSAFE was not in the loop, since it was the same as TOP).
7665
7666         * interface.cs: Every interface member now takes a ModFlags,
7667         instead of a "is_new" bool, which we set on the base MemberCore. 
7668
7669         Every place where we called "UnsafeOk" in the interface, now we
7670         call the proper member (InterfaceMethod.UnsafeOK) instead to get
7671         the unsafe settings from the member declaration instead of the
7672         container interface. 
7673
7674         * cs-parser.jay (opt_new): Allow unsafe here per the spec. 
7675
7676         * pending.cs (TypeAndMethods): Add `get_indexer_name' and
7677         `set_indexer_name' to the pending bits (one per type).
7678
7679         We fixed a bug today that was picking the wrong method to
7680         override, since for properties the existing InterfaceMethod code
7681         basically ignored the method name.  Now we make sure that the
7682         method name is one of the valid indexer names.
7683
7684 2004-03-14  Gustavo Giráldez  <gustavo.giraldez@gmx.net>
7685  
7686         * support.cs (SeekableStreamReader): Keep track of stream byte
7687         positions and don't mix them with character offsets to the buffer.
7688
7689         Patch from Gustavo Giráldez
7690
7691 2004-03-15  Marek Safar  <marek.safar@seznam.cz>
7692
7693         * interface.cs (InterfaceSetGetBase): Removed double member
7694         initialization, base class does it as well.
7695
7696 2004-03-13  Martin Baulig  <martin@ximian.com>
7697
7698         * class.cs: Reverted Miguel's latest commit; it makes mcs crash
7699         when compiling corlib.
7700
7701 2004-03-13  Miguel de Icaza  <miguel@ximian.com>
7702
7703         * convert.cs (ExplicitConversion): We were reporting an error on
7704         certain conversions (object_type source to a value type, when the
7705         expression was `null') before we had a chance to pass it through
7706         the user defined conversions.
7707
7708         * driver.cs: Replace / and \ in resource specifications to dots.
7709         Fixes 50752
7710
7711         * class.cs: Add check for duplicate operators.  Fixes 52477
7712
7713 2004-03-11  Miguel de Icaza  <miguel@ximian.com>
7714
7715         * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
7716         that are in the middle of the statements, not only at the end.
7717         Fixes #54987
7718
7719         * class.cs (TypeContainer.AddField): No longer set the
7720         `HaveStaticConstructor' flag, now we call it
7721         `UserDefineStaticConstructor' to diferentiate the slightly
7722         semantic difference.
7723
7724         The situation is that we were not adding BeforeFieldInit (from
7725         Modifiers.TypeAttr) to classes that could have it.
7726         BeforeFieldInit should be set to classes that have no static
7727         constructor. 
7728
7729         See:
7730
7731         http://www.yoda.arachsys.com/csharp/beforefieldinit.html
7732
7733         And most importantly Zoltan's comment:
7734
7735         http://bugzilla.ximian.com/show_bug.cgi?id=44229
7736
7737         "I think beforefieldinit means 'it's ok to initialize the type sometime 
7738          before its static fields are used', i.e. initialization does not need
7739          to be triggered by the first access to the type. Setting this flag
7740          helps the JIT to compile better code, since it can run the static
7741          constructor at JIT time, and does not need to generate code to call it
7742          (possibly lots of times) at runtime. Unfortunately, mcs does not set
7743          this flag for lots of classes like String. 
7744          
7745          csc sets this flag if the type does not have an explicit static 
7746          constructor. The reasoning seems to be that if there are only static
7747          initalizers for a type, and no static constructor, then the programmer
7748          does not care when this initialization happens, so beforefieldinit
7749          can be used.
7750          
7751          This bug prevents the AOT compiler from being usable, since it 
7752          generates so many calls to mono_runtime_class_init that the AOT code
7753          is much slower than the JITted code. The JITted code is faster, 
7754          because it does not generate these calls if the vtable is type is
7755          already initialized, which is true in the majority of cases. But the
7756          AOT compiler can't do this."
7757
7758 2004-03-10  Miguel de Icaza  <miguel@ximian.com>
7759
7760         * class.cs (MethodData.Emit): Refactor the code so symbolic
7761         information is generated for destructors;  For some reasons we
7762         were taking a code path that did not generate symbolic information
7763         before. 
7764
7765 2004-03-11 Ben Maurer  <bmaurer@users.sourceforge.net>
7766
7767         * class.cs: Create a Constructor.CheckBase method that
7768         takes care of all validation type code. The method
7769         contains some code that was moved from Define.
7770
7771         It also includes new code that checks for duplicate ctors.
7772         This fixes bug #55148.
7773
7774 2004-03-09  Joshua Tauberer <tauberer@for.net>
7775
7776         * expression.cs (ArrayCreation): Fix: More than 6 nulls in
7777         a { ... }-style array creation invokes EmitStaticInitializers
7778         which is not good for reference-type arrays.  String, decimal
7779         and now null constants (NullCast) are not counted toward
7780         static initializers.
7781
7782 2004-03-05  Martin Baulig  <martin@ximian.com>
7783
7784         * location.cs (SourceFile.HasLineDirective): New public field;
7785         specifies whether the file contains or is referenced by a "#line"
7786         directive.
7787         (Location.DefineSymbolDocuments): Ignore source files which
7788         either contain or are referenced by a "#line" directive.        
7789
7790 2004-02-29  Ben Maurer <bmaurer@users.sourceforge.net>
7791
7792         * class.cs (Method.CheckBase): Avoid using FindMembers, we have
7793         direct access to our parent, so check the method inline there.
7794
7795 2004-02-27 Ben Maurer  <bmaurer@users.sourceforge.net>
7796
7797         * expression.cs (Invocation.EmitCall): Miguel's last commit
7798         caused a regression. If you had:
7799
7800             T t = null;
7801             t.Foo ();
7802
7803         In Foo the implict this would be null.
7804
7805 2004-02-27  Miguel de Icaza  <miguel@ximian.com>
7806
7807         * expression.cs (Invocation.EmitCall): If the method is not
7808         virtual, do not emit a CallVirt to it, use Call.
7809
7810         * typemanager.cs (GetFullNameSignature): Improve the method to
7811         cope with ".ctor" and replace it with the type name.
7812
7813         * class.cs (ConstructorInitializer.Resolve): Now the method takes
7814         as an argument the ConstructorBuilder where it is being defined,
7815         to catch the recursive constructor invocations.
7816
7817 2004-03-16  Martin Baulig  <martin@ximian.com>
7818
7819         * expression.cs (MemberAccess.DoResolve): If `expr' resolved to a
7820         ConstructedType, call ResolveType() on it to get the type rather
7821         than just using `expr.Type'.
7822
7823 2004-03-16  Martin Baulig  <martin@ximian.com>
7824
7825         * generics.cs (ConstructedType.GetMemberAccess): Take the
7826         EmitContext instead on the TypeExpr and use
7827         ec.TypeContainer.CurrentType/ec.ContainerType.
7828
7829 2004-03-16  Martin Baulig  <martin@ximian.com>
7830
7831         * ecore.cs (SimpleName.DoResolveAsTypeStep): Lookup type
7832         parameters before aliases.
7833
7834 2004-03-16  Martin Baulig  <martin@ximian.com>
7835
7836         * typemanager.cs (TypeManager.MayBecomeEqualGenericInstances):
7837         New oublic function; checks whether two generic instances may become
7838         equal under some instantiations (26.3.1).
7839
7840         * class.cs (TypeContainer.Define): Call
7841         TypeManager.MayBecomeEqualGenericInstances() and report CS0695 on
7842         error.
7843
7844 2004-03-16  Martin Baulig  <martin@ximian.com>
7845
7846         * class.cs (TypeContainer.GetClassBases): Moved
7847         Error_TypeParameterAsBase() here and also check whether the base
7848         class is not an attribute.
7849
7850 2004-03-16  Martin Baulig  <martin@ximian.com>
7851
7852         * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
7853
7854 2004-03-16  Martin Baulig  <martin@ximian.com>
7855
7856         * class.cs (Error_TypeParameterAsBase): Use correct error number
7857         here (CS0689).  
7858
7859 2004-03-16  Martin Baulig  <martin@ximian.com>
7860
7861         * decl.cs (DeclSpace.ResolveTypeExpr): Added more error checking
7862         for generics.
7863
7864         * generics.cs (ConstructedType.DoResolveAsTypeStep): Added better
7865         error reporting.
7866
7867 2004-03-15  Martin Baulig  <martin@ximian.com>
7868
7869         * typemanager.cs (TypeManager.GetFullName): New public method.
7870         (TypeManager.MemberLookup): Added `int_num_type_arguments'
7871         argument; only return members with the correct number of type
7872         arguments.
7873         (TypeManager.CheckGeneric): Allow -1 to bypass the check.
7874         (TypeManager.FilterWithClosure): Call CheckGeneric() to check
7875         whether the number of type arguments matches.
7876
7877         * generic.cs (GenericMemberAccess.ResolveAsTypeStep): Allow `expr'
7878         not being a ConstructedType; we can now do "typeof (Foo.Bar<U>)".
7879
7880         * expression.cs (MemberAccess): Added public `NumTypeArguments'
7881         field; it's set by the protected .ctor when we're actually a
7882         GenericMemberAccess.
7883         (MemberAccess.ResolveAsTypeStep): Compute the total number of type
7884         arguments and pass it to MemberLookupFinal ().
7885
7886         * ecore.cs (Expression.MemberLookup): Added `int
7887         num_type_arguments' argument; only return members with the correct
7888         number of type arguments.
7889         (Expression.MemberLookupFailed): Check whether the MemberLookup
7890         failed because we did not have the correct number of type
7891         arguments; report CS0305 in this case.
7892
7893         * decl.cs (DeclSpace.ResolveTypeExpr): Don't report an error if
7894         `e.ResolveAsTypeTerminal()' already did so.
7895
7896 2004-03-15  Martin Baulig  <martin@ximian.com>
7897
7898         * ecore.cs (Expression.ResolveLValue): Allow e.type being null if
7899         we're a ConstructedType; in this case, the caller must report an
7900         error (for instance CS0131).
7901
7902         * generic.cs (TypeArguments): Added Location argument to the .ctor.
7903         (TypeArguments.Resolve): Actually report errors here.
7904
7905 2004-03-15  Miguel de Icaza  <miguel@ximian.com>
7906
7907         * pending.cs (TypeAndMethods): Add `get_indexer_name' and
7908         `set_indexer_name' to the pending bits (one per type).
7909
7910         We fixed a bug today that was picking the wrong method to
7911         override, since for properties the existing InterfaceMethod code
7912         basically ignored the method name.  Now we make sure that the
7913         method name is one of the valid indexer names.
7914
7915 2004-03-15  Martin Baulig  <martin@ximian.com>
7916
7917         * typemanager.cs (TypeManager.IndexerPropertyName): Added support
7918         for generic instances.
7919
7920 2004-03-13  Martin Baulig  <martin@ximian.com>
7921
7922         * class.cs (TypeContainer.DefineType): Call
7923         TypeManager.AddUserType() immediately after creating the
7924         TypeBuilder; pass all type parameters when creating the
7925         CurrentType.
7926
7927         * decl.cs (DeclSpace.FindNestedType): New public method.
7928         (DeclSpace.FindType): Added `int num_type_args' argument; only
7929         return types with the correct number of type parameters.
7930         (DeclSpace.CountTypeParams): New public property.
7931
7932         * ecore.cs (SimpleName.ctor): Added overloaded version which takes
7933         the number of type parameters; defaults to zero.
7934
7935         * generic.cs (TypeArguments.Count): New public property.
7936         (ConstructedType.DoResolveAsTypeStep): First call
7937         ds.FindNestedType() to find out whether we're nested in the
7938         current generic type; in this case, we inherit all type parameters
7939         from the current class.
7940
7941         * rootcontext.cs (RootContext.NamespaceLookup): Added `int
7942         num_type_args' argument.
7943         (RootContext.LookupType): Added overloaded version which takes the
7944         number of type arguments; only return types with the correct
7945         number of type arguments.
7946
7947         * typemanager.cs (TypeManager.CheckGeneric): New public function;
7948         checks whether `Type t' has `int num_type_args'.
7949
7950 2004-03-13  Martin Baulig  <martin@ximian.com>
7951
7952         * generic.cs (GenericMethod.DefineType): New method; calls
7953         DefineType() on all the type parameters.
7954
7955         * class.cs (MethodData.ctor): Added `GenericMethod generic' argument.
7956         (MethodData.Define): If we're a generic method, call
7957         GenericMethod.DefineType() to define the type parameters.       
7958
7959 2004-03-10  Martin Baulig  <martin@ximian.com>
7960
7961         * pending.cs (Pending.InterfaceMethod): Use TypeManager.IsEqual()
7962         instead of IsAssignableFrom.    
7963
7964 2004-03-10  Martin Baulig  <martin@ximian.com>
7965
7966         * ecore.cs (FieldExpr.ctor): Use TypeManager.TypeToCoreType().
7967
7968         * support.cs (ParameterData.HasArrayParameter): New property.
7969         (ReflectionParameters.ctor): Take a MethodBase instead of a
7970         ParameterInfo[].  If we have any type parameters, get the generic
7971         method definition and ask it whether we have variable arguments.
7972
7973 2004-02-26  Miguel de Icaza  <miguel@ximian.com>
7974
7975         * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
7976         routines to check if a type is an enumerable/enumerator allow
7977         classes that implement the IEnumerable or IEnumerator interfaces.
7978
7979         * class.cs (Property, Operator): Implement IIteratorContainer, and
7980         implement SetYields.
7981
7982         (Property.Define): Do the block swapping for get_methods in the
7983         context of iterators.   We need to check if Properties also
7984         include indexers or not.
7985
7986         (Operator): Assign the Block before invoking the
7987         OperatorMethod.Define, so we can trigger the Iterator code
7988         replacement. 
7989
7990         * cs-parser.jay (SimpleIteratorContainer): new helper class.  Both
7991         Property and Operator classes are not created when we parse the
7992         declarator but until we have the block completed, so we use a
7993         singleton SimpleIteratorContainer.Simple to flag whether the
7994         SetYields has been invoked.
7995
7996         We propagate this setting then to the Property or the Operator to
7997         allow the `yield' to function.
7998
7999 2004-02-25  Marek Safar  <marek.safar@seznam.cz>
8000
8001         * codegen.cs: Implemented attribute support for modules.
8002         New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
8003         Assembly/Module functionality.
8004
8005         * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
8006         interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
8007         Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
8008
8009 2004-02-16  Marek Safar  <marek.safar@seznam.cz>
8010
8011         * interface.cs (FindMembers): The operation is performed on all base
8012         interfaces and not only on the first. It is required for future CLS Compliance patch.
8013
8014 2004-02-12 Ben Maurer  <bmaurer@users.sourceforge.net>
8015
8016         * statement.cs, codegen.cs:
8017         This patch deals with patterns such as:
8018
8019         public class List : IEnumerable {
8020
8021                 public MyEnumerator GetEnumerator () {
8022                         return new MyEnumerator(this);
8023                 }
8024
8025                 IEnumerator IEnumerable.GetEnumerator () {
8026                         ...
8027                 }
8028                 
8029                 public struct MyEnumerator : IEnumerator {
8030                         ...
8031                 }
8032         }
8033
8034         Before, there were a few things we did wrong:
8035         1) we would emit callvirt on a struct, which is illegal
8036         2) we emited ldarg when we needed to emit ldarga
8037         3) we would mistakenly call the interface methods on an enumerator
8038         type that derived from IEnumerator and was in another assembly. For example:
8039
8040         public class MyEnumerator : IEnumerator
8041
8042         Would have the interface methods called, even if there were public impls of the
8043         method. In a struct, this lead to invalid IL code.
8044
8045 2004-02-11  Marek Safar  <marek.safar@seznam.cz>
8046
8047         * const.cs: Const is now derived from FieldBase. Method EmitConstant name
8048           renamed to Emit.
8049
8050         * delegate.cs (Define): Fixed crash when delegate type is undefined.
8051
8052 2004-02-11  Miguel de Icaza  <miguel@ximian.com>
8053
8054         * cs-parser.jay: Fix small regression: we were not testing V2
8055         compiler features correctly.
8056
8057         * interface.cs: If the emit context is null, then create one
8058
8059 2004-02-09  Marek Safar  <marek.safar@seznam.cz>
8060
8061         * decl.cs (GetSignatureForError): New virtual method to get full name
8062           for error messages.
8063
8064         * attribute.cs (IAttributeSupport): New interface for attribute setting.
8065           Now it is possible to rewrite ApplyAttributes method to be less if/else.
8066
8067         * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
8068           Duplicated members and code in these classes has been removed.
8069           Better encapsulation in these classes.
8070
8071 2004-02-07  Miguel de Icaza  <miguel@ximian.com>
8072
8073         * assign.cs (Assign.DoResolve): When dealing with compound
8074         assignments, there is a new rule in ECMA C# 2.4 (might have been
8075         there before, but it is documented here) that states that in:
8076
8077         a op= b;
8078
8079         If b is of type int, and the `op' is a shift-operator, then the
8080         above is evaluated as:
8081
8082         a = (int) a op b 
8083
8084         * expression.cs (Binary.ResolveOperator): Instead of testing for
8085         int/uint/long/ulong, try to implicitly convert to any of those
8086         types and use that in pointer arithmetic.
8087
8088         * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
8089         method to print information for from the type, not from the
8090         null-method we were given.
8091
8092 2004-02-01  Duncan Mak  <duncan@ximian.com>
8093
8094         * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
8095         parsing for cmd, fixes bug #53694.
8096
8097 2004-02-04  Marek Safar  <marek.safar@seznam.cz>
8098
8099         * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
8100         in the member name duplication tests. Property and operator name duplication
8101         was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
8102
8103 2004-02-03  Marek Safar  <marek.safar@seznam.cz>
8104
8105         * interface.cs (PopulateMethod): Fixed crash when interface method
8106         returns not existing type (error test cs0246-3.cs).
8107
8108 2004-02-02  Ravi Pratap M <ravi@ximian.com>
8109
8110         * cs-parser.jay (interface_accessors): Re-write actions to also
8111         store attributes attached to get and set methods. Fix spelling
8112         while at it.
8113
8114         (inteface_property_declaration): Modify accordingly.
8115
8116         (InterfaceAccessorInfo): New helper class to store information to pass
8117         around between rules that use interface_accessors.
8118
8119         * interface.cs (Emit): Apply attributes on the get and set
8120         accessors of properties and indexers too.
8121
8122         * attribute.cs (ApplyAttributes): Modify accordingly to use the
8123         right MethodBuilder when applying attributes to the get and set accessors.
8124
8125 2004-01-31  Miguel de Icaza  <miguel@ximian.com>
8126
8127         * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
8128
8129 2004-01-26  Miguel de Icaza  <miguel@ximian.com>
8130
8131         * cs-tokenizer.cs: Handle #line hidden from PDC bits.
8132
8133 2004-01-25  Miguel de Icaza  <miguel@ximian.com>
8134
8135         * cs-parser.jay: Remove YIELD token, instead use the new grammar
8136         changes that treat `yield' specially when present before `break'
8137         or `return' tokens.
8138
8139         * cs-tokenizer.cs: yield is no longer a keyword.
8140
8141 2004-01-23  Marek Safar  <marek.safar@seznam.cz>
8142
8143         * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
8144         setting for default constructors.
8145         For default constructors are almost every time set wrong Modifier. The
8146         generated IL code has been alright. But inside mcs this values was
8147         wrong and this was reason why several of my CLS Compliance tests
8148         failed.
8149
8150 2004-02-27  Martin Baulig  <martin@ximian.com>
8151
8152         * generics.cs (ConstructedType.ResolveType): Make the nested type
8153         stuff actually work.
8154
8155 2004-02-25  Martin Baulig  <martin@ximian.com>
8156
8157         * decl.cs (DeclSpace.CurrentTypeParameters): New protected
8158         property; returns the type parameters just from the current type,
8159         ie. with the ones from outer classes.
8160         (DeclSpace.LookupGeneric): First search in the current class, then
8161         in outer classes.
8162         (DeclSpace.initialize_type_params): When hiding a type parameter
8163         from an outer class, put it into the `type_param_list' anyways.
8164
8165         * expression.cs (MemberAccess.expr): Made this field protected.
8166
8167         * class.cs (TypeContainer.Define): The `CurrentType' just contains
8168         the type parameters from the current class.
8169
8170         * generic.cs (ConstructedType.ResolveType): Support nested generic
8171         types by taking the type parameters which we inherit from outer
8172         classes into account.
8173         (GenericMemberAccess.ResolveAsTypeStep): Override this and added
8174         support for nested generic types.
8175
8176 2004-02-23  Martin Baulig  <martin@ximian.com>
8177
8178         * decl.cs (DeclSpace.IsGeneric): Make this a property instead of a
8179         field and check whether we're nested inside a generic type.
8180         (DeclSpace.ResolveType): If we're resolving to a generic type
8181         definition, create a ConstructedType and return its resolved type.
8182         (DeclSpace.initialize_type_params): New private method;
8183         initializes the `type_param_list' field from the type parameters
8184         from this and all enclosing classes.
8185         (DeclSpace.TypeParameters): Call initialize_type_params() unless
8186         we're already initialized.
8187
8188 2004-02-23  Martin Baulig  <martin@ximian.com>
8189
8190         * class.cs (Method.Define): Create the generic method before
8191         calling DoDefine().
8192         (Memberbase.DoDefine): Added DeclSpace argument (in addition to
8193         the TypeContainer one); we use this for generic methods.
8194
8195         * decl.cs (CheckAccessLevel): If we're a GenericMethod, use our
8196         parent's TypeBuilder.
8197
8198 2004-02-18  Martin Baulig  <martin@ximian.com>
8199
8200         * ecore.cs (FieldExpr.DoResolveLValue): Use TypeManager.IsEqual()
8201         to check for equality.
8202
8203 2004-02-05  Martin Baulig  <martin@ximian.com>
8204
8205         * ecore.cs (FieldExpr.DoResolveLValue): If we have an
8206         `ec.TypeContainer.CurrentType', use it instead of
8207         `ec.ContainerType' to check whether we're in the type's ctor.
8208
8209 2004-01-29  Martin Baulig  <martin@ximian.com>
8210
8211         * expression.cs (Invocation.DoResolve): If we're a
8212         `ConstructedType', then we're actually a generic method, so
8213         rewrite the expr as a GenericMemberAccess.
8214
8215         * cs-parser.jay (member_name): Don't use `namespace_or_type_name'
8216         here; manually parse it into a string.
8217
8218 2004-01-28  Martin Baulig  <martin@ximian.com>
8219
8220         * typemanager.cs (TypeManager.IsEqual): New static method.
8221         (TypeManager.FilterWithClosure): Call TypeManager.IsEqual() to
8222         check for equality instead of using `=='.
8223
8224 2004-01-26  Martin Baulig  <martin@ximian.com>
8225
8226         * decl.cs (DeclSpace.CurrentType): New public field.
8227
8228         * expression.cs (This.ResolveBase): If we have an
8229         `ec.TypeContainer.CurrentType', use it instead of
8230         `ec.ContainerType'.
8231
8232         * class.cs (TypeContainer.DefineType): If we're a generic type,
8233         create the `CurrentType' (unresolved).
8234         (TypeContainer.GenericType): New private field.
8235         (TypeContainer.DefineMembers): If we have a `CurrentType', resolve
8236         it and store it in `GenericType' before creating the MemberCache.
8237         (TypeContainer.GetMembers): If we have a `GenericType', call
8238         TypeManager.FindMembers() on it.
8239
8240         * interface.cs (Interface.GenericType): New private field.
8241         (Interface.DefineType): If we're a generic type, create the
8242         `CurrentType' (unresolved).
8243         (Interface.DefineMembers): If we have a `CurrentType', resolve it
8244         and store it in `GenericType' before creating the MemberCache.
8245         (Interface.GetMembers): If we have a `GenericType', call
8246         TypeManager.FindMembers() on it.
8247
8248 2004-01-22  Martin Baulig  <martin@ximian.com>
8249
8250         * cs-parser.jay (namespace_or_type_name): Return an Expression,
8251         not a QualifiedIdentifier.  This is what `type_name_expression'
8252         was previously doing.
8253         (type_name_expression): Removed; the code is now in
8254         `namespace_or_type_name'.
8255         (qualified_identifier): Removed, use `namespace_or_type_name'
8256         instead.
8257         (QualifiedIdentifier): Removed this class.      
8258
8259 2004-01-22  Martin Baulig  <martin@ximian.com>
8260
8261         * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
8262         not a string as alias name.
8263
8264 2004-01-21  Miguel de Icaza  <miguel@ximian.com>
8265
8266         * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
8267         #52730 bug, and instead compute correctly the need to use a
8268         temporary variable when requesting an address based on the
8269         static/instace modified of the field and the constructor.
8270  
8271 2004-01-21  Martin Baulig  <martin@ximian.com>
8272
8273         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
8274         class and namespace before looking up aliases.  Fixes #52517.
8275
8276 2004-01-21  Martin Baulig  <martin@ximian.com>
8277
8278         * flowanalysis.cs (UsageVector.Merge): Allow variables being
8279         assinged in a 'try'; fixes exception4.cs.
8280
8281 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
8282         * class.cs : Implemented parameter-less constructor for TypeContainer
8283
8284         * decl.cs: Attributes are now stored here. New property OptAttributes
8285
8286         * delegate.cs, enum.cs, interface.cs: Removed attribute member.
8287
8288         * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
8289
8290 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
8291
8292         * typemanager.cs (CSharpSignature): Now reports also inner class name.
8293           (CSharpSignature): New method for indexer and property signature.
8294
8295 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
8296
8297         * pending.cs (IsVirtualFilter): Faster implementation.
8298
8299 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
8300
8301         * typemanager.cs: Avoid inclusion of same assembly more than once.
8302
8303 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
8304
8305         * cs-parser.jay: Fixed problem where the last assembly attribute
8306           has been applied also to following declaration (class, struct, etc.)
8307           
8308 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
8309
8310         * class.cs: Added error CS0538, CS0539 reporting.
8311         Fixed crash on Microsoft runtime when field type is void.
8312
8313         * cs-parser.jay: Added error CS0537 reporting.
8314
8315         * pending.cs: Added error CS0535 reporting.
8316         Improved error report for errors CS0536, CS0534.
8317
8318 2004-01-20  Miguel de Icaza  <miguel@ximian.com>
8319
8320         Merge a few bits from the Anonymous Method MCS tree.
8321
8322         * statement.cs (ToplevelBlock): New class for toplevel methods,
8323         will hold anonymous methods, lifted variables.
8324
8325         * cs-parser.jay: Create toplevel blocks for delegates and for
8326         regular blocks of code. 
8327
8328 2004-01-20  Martin Baulig  <martin@ximian.com>
8329
8330         * codegen.cs (EmitContext): Removed `InTry', `InCatch',
8331         `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
8332         and `NeedExplicitReturn'; added `IsLastStatement'.
8333         (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
8334         have a `ReturnLabel' or we're not unreachable.
8335
8336         * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
8337         child's reachability; don't just override ours with it.  Fixes
8338         #58058 (lluis's example).
8339         (FlowBranching): Added public InTryOrCatch(), InCatch(),
8340         InFinally(), InLoop(), InSwitch() and
8341         BreakCrossesTryCatchBoundary() methods.
8342
8343         * statement.cs (Return): Do all error checking in Resolve().
8344         Unless we are the last statement in a top-level block, always
8345         create a return label and jump to it.
8346         (Break, Continue): Do all error checking in Resolve(); also make
8347         sure we aren't leaving a `finally'.
8348         (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
8349         statement in a top-level block.
8350         (Block.Flags): Added `IsDestructor'.
8351         (Block.IsDestructor): New public property.
8352
8353 2004-01-20  Martin Baulig  <martin@ximian.com>
8354
8355         * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
8356
8357 2004-01-20  Martin Baulig  <martin@ximian.com>
8358
8359         * statement.cs (Statement.ResolveUnreachable): New public method.
8360         (If, While): Do the dead-code elimination in Resolve(), not in Emit().
8361         (Block.Resolve): Resolve unreachable statements.
8362
8363 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
8364
8365         * expression.cs: We need to fix the case where we do
8366         not have a temp variable here.
8367
8368         * assign.cs: Only expression compound assignments need
8369         temporary variables.
8370
8371 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
8372
8373         * flowanalysis.cs: Reduce memory allocation in a few ways:
8374           - A block with no variables should not allocate a bit
8375             vector for itself.
8376           - A method with no out parameters does not need any tracking
8377             for assignment of the parameters, so we need not allocate
8378             any data for it.
8379           - The arrays:
8380                 public readonly Type[] VariableTypes;
8381                 public readonly string[] VariableNames;
8382             Are redundant. The data is already stored in the variable
8383             map, so we need not allocate another array for it.
8384           - We need to add alot of checks for if (params | locals) == null
8385             due to the first two changes.
8386
8387 2004-01-18  Miguel de Icaza  <miguel@ximian.com>
8388
8389         * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
8390         implement IMemoryLocation, we store a copy on a local variable and
8391         take the address of it.  Patch from Benjamin Jemlich
8392
8393         * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
8394         to use a special "type_name_expression" rule which reduces the
8395         number of "QualifiedIdentifier" classes created, and instead
8396         directly creates MemberAccess expressions.
8397
8398 2004-01-17  Miguel de Icaza  <miguel@ximian.com>
8399
8400         * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
8401         that fixes #52853.  Null literal assignment to ValueType
8402
8403         * class.cs (MethodData.Emit): Instead of checking the name of the
8404         method to determine if its a destructor, create a new derived
8405         class from Method called Destructor, and test for that.  
8406
8407         * cs-parser.jay: Create a Destructor object instead of a Method.  
8408
8409         Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
8410
8411         Fixes: 52933
8412
8413 2004-01-16  Miguel de Icaza  <miguel@ximian.com>
8414
8415         * expression.cs (Binary.ResolveOperator): Perform an implicit
8416         conversion from MethodGroups to their delegate types on the
8417         Addition operation.
8418
8419         * delegate.cs: Introduce a new class DelegateCreation that is the
8420         base class for `NewDelegate' and `ImplicitDelegateCreation',
8421         factor some code in here.
8422
8423         * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
8424         conversion from MethodGroups to compatible delegate types. 
8425
8426         * ecore.cs (Expression.Resolve): Do not flag error 654
8427         (Methodgroupd needs parenthesis) if running on the V2 compiler, as
8428         we allow conversions from MethodGroups to delegate types now.
8429
8430         * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
8431         assignments in v2 either.
8432
8433 2004-01-10  Miguel de Icaza  <miguel@ximian.com>
8434
8435         * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
8436         static read-only fields in ctors.
8437
8438         Applied patch from Benjamin Jemlich 
8439
8440         * expression.cs (UnaryMutator): Avoid leaking local variables. 
8441
8442 2004-01-09  Miguel de Icaza  <miguel@ximian.com>
8443
8444         * cs-tokenizer.cs (IsCastToken): Allow the various native types
8445         here to return true, as they can be used like this:
8446
8447                 (XXX) int.MEMBER ()
8448
8449         Fixed 49836 and all the other dups
8450
8451 2004-01-09  Zoltan Varga  <vargaz@freemail.hu>
8452
8453         * driver.cs: Implement /win32res and /win32icon.
8454
8455 2004-01-08  Miguel de Icaza  <miguel@ximian.com>
8456
8457         * cs-parser.jay: Add a rule to improve error handling for the
8458         common mistake of placing modifiers after the type.
8459
8460 2004-01-07  Miguel de Icaza  <miguel@ximian.com>
8461
8462         * cs-parser.jay (interface_event_declaration): Catch
8463         initialization of events on interfaces, and report cs0068
8464
8465         * cs-parser.jay (interface_event_declaration): Catch
8466         initialization of events. 
8467
8468         * ecore.cs: Better report missing constructors.
8469
8470         * expression.cs (Binary.ResolveOperator): My previous bug fix had
8471         the error reporting done in the wrong place.  Fix.
8472
8473         * expression.cs (Binary.ResolveOperator): Catch the 
8474         operator + (E x, E y) error earlier, and later allow for implicit
8475         conversions in operator +/- (E e, U x) from U to the underlying
8476         type of E.
8477
8478         * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
8479         52596, if the container class is abstract, the default constructor
8480         is protected otherwise its public (before, we were always public).
8481
8482         * statement.cs (Fixed.Resolve): Catch a couple more errors in the
8483         fixed statement.
8484
8485         (Using.EmitLocalVariableDecls): Applied patch from Benjamin
8486         Jemlich that fixes bug #52597, MCS was generating invalid code for
8487         idisposable structs.   Thanks to Ben for following up with this
8488         bug as well.
8489
8490 2004-01-06  Miguel de Icaza  <miguel@ximian.com>
8491
8492         * driver.cs: Allow assemblies without code to be generated, fixes
8493         52230.
8494
8495 2004-01-07  Nick Drochak <ndrochak@gol.com>
8496
8497         * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
8498
8499 2004-01-05  Miguel de Icaza  <miguel@ximian.com>
8500
8501         * cs-parser.jay: Add rules to improve error reporting if fields or
8502         methods are declared at the namespace level (error 116)
8503
8504         * Add rules to catch event add/remove
8505
8506 2004-01-04  David Sheldon <dave-mono@earth.li>
8507
8508   * expression.cs: Added matching ")" to error message for 
8509   CS0077
8510
8511 2004-01-03 Todd Berman <tberman@gentoo.org>
8512
8513         * ecore.cs, attribute.cs:
8514         Applying fix from #52429.
8515
8516 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
8517
8518         * ecore.cs, expression.cs, statement.cs:
8519         Total rewrite of how we handle branching. We
8520         now handle complex boolean expressions with fewer
8521         jumps. As well if (x == 0) no longer emits a ceq.
8522
8523         if (x is Foo) is much faster now, because we generate
8524         better code.
8525
8526         Overall, we get a pretty big improvement on our benchmark
8527         tests. The code we generate is smaller and more readable.
8528
8529         I did a full two-stage bootstrap. The patch was reviewed
8530         by Martin and Miguel.
8531
8532 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
8533
8534         * cs-parser.jay: Make primary_expression not take a QI.
8535         we dont need this because the member_access rule covers
8536         us here. So we replace the rule with just IDENTIFIER.
8537
8538         This has two good effects. First, we remove a s/r conflict.
8539         Second, we allocate many fewer QualifiedIdentifier objects.
8540
8541 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
8542
8543         * attribute.cs: Handle MarshalAs attributes as pseudo, and
8544         set the correct information via SRE. This prevents
8545         hanging on the MS runtime. Fixes #29374.
8546
8547 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
8548
8549         * convert.cs: correctly handle conversions to value types
8550         from Enum and ValueType as unboxing conversions.
8551
8552         Fixes bug #52569. Patch by Benjamin Jemlich.
8553
8554 2004-01-02  Ravi Pratap  <ravi@ximian.com>
8555
8556         * expression.cs (BetterConversion): Prefer int -> uint
8557         over int -> ulong (csc's behaviour). This fixed bug #52046.
8558
8559 2004-01-02 Ben Maurer  <bmaurer@users.sourceforge.net>
8560
8561         * decl.cs (MemberCache.FindMembers): now returns a
8562         MemberInfo [].
8563
8564         * typemanager.cs: In general, go with with ^^.
8565         (CopyNewMethods): take an IList.
8566         (RealMemberLookup): Only allocate an arraylist
8567         if we copy from two sets of methods.
8568
8569         This change basically does two things:
8570         1) Fewer array lists allocated due to CopyNewMethods.
8571         2) the explicit cast in MemberList costed ALOT.
8572
8573 2004-01-02  Zoltan Varga  <vargaz@freemail.hu>
8574
8575         * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
8576         a hashtable to avoid needless string allocations when an identifier is
8577         used more than once (the common case).
8578
8579 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
8580
8581         * pending.cs: MS's TypeBuilder.GetInterfaces ()
8582         is broken, it will not return anything. So, we
8583         have to use the information we have in mcs to
8584         do the task.
8585
8586         * typemanager.cs: Add a cache for GetInterfaces,
8587         since this will now be used more often (due to ^^)
8588
8589         (GetExplicitInterfaces) New method that gets the
8590         declared, not effective, interfaces on a type
8591         builder (eg, if you have interface IFoo, interface
8592         IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
8593         { IBar }.
8594
8595         This patch makes MCS able to bootstrap itself on
8596         Windows again.
8597
8598 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
8599
8600         * expression.cs: Remove the Nop's that Miguel put
8601         in by mistake.
8602
8603 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
8604
8605         * report.cs, codegen.cs: Give the real stack trace to
8606         the error when an exception is thrown.
8607
8608 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
8609
8610         * decl.cs: only allocate hashtables for ifaces if 
8611         it is an iface!
8612
8613 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
8614
8615         * expression.cs: fix the error from cs0121-2.cs
8616         (a parent interface has two child interfaces that
8617         have a function with the same name and 0 params
8618         and the function is called through the parent).
8619
8620 2003-12-30 Ben Maurer  <bmaurer@users.sourceforge.net>
8621
8622         * class.cs, rootcontext.cs, typmanager.cs: do not
8623         leak pointers.
8624
8625 2003-12-28 Ben Maurer  <bmaurer@users.sourceforge.net>
8626
8627         * codegen.cs: remove stack for the ec flow branching.
8628         It is already a linked list, so no need.
8629
8630 2003-12-27 Ben Maurer  <bmaurer@users.sourceforge.net>
8631
8632         * Makefile: Allow custom profiler here.
8633
8634 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
8635
8636         * typemanager.cs (LookupType):
8637           - Use a static char [], because split takes
8638             a param array for args, so it was allocating
8639             every time.
8640           - Do not store true in a hashtable, it boxes.
8641
8642 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
8643
8644         * flowanalysis.cs: bytify common enums.
8645
8646 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
8647
8648         * modifiers.cs: Add a new set of flags for the
8649         flags allowed on explicit interface impls.
8650         * cs-parser.jay: catch the use of modifiers in
8651         interfaces correctly.
8652         * class.cs: catch private void IFoo.Blah ().
8653
8654         All related to bug #50572.
8655
8656 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
8657
8658         * decl.cs: Rewrite the consistant accessability checking.
8659         Accessability is not linear, it must be implemented in
8660         a tableish way. Fixes #49704.
8661
8662 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
8663
8664         * expression.cs: Handle negation in a checked context.
8665         We must use subtraction from zero. Fixes #38674.
8666
8667 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
8668
8669         * class.cs: Ignore static void main in DLLs.
8670         * rootcontext.cs: Handle the target type here,
8671         since we are have to access it from class.cs
8672         * driver.cs: account for the above.
8673
8674 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
8675
8676         * report.cs: Give line numbers and files if available.
8677
8678 2003-12-20  Zoltan Varga  <vargaz@freemail.hu>
8679
8680         * driver.cs: Implement /addmodule.
8681
8682         * typemanager.cs:  Change 'modules' field so it now contains Modules not
8683         ModuleBuilders.
8684
8685 2003-12-20  Martin Baulig  <martin@ximian.com>
8686
8687         * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
8688         (FieldBase.IsAssigned): Removed this field.
8689         (FieldBase.SetAssigned): New public method.
8690         (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
8691
8692 2003-12-20  Martin Baulig  <martin@ximian.com>
8693
8694         * expression.cs (LocalVariableReference.DoResolve): Don't set
8695         `vi.Used' if we're called from DoResolveLValue().
8696
8697         * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
8698         returns the usage vector it just merged into the current one -
8699         pass this one to UsageWarning().
8700         (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
8701         of the `EmitContext', don't call this recursively on our children.
8702
8703 2003-12-19  Zoltan Varga  <vargaz@freemail.hu>
8704
8705         * driver.cs: Implement /target:module.
8706
8707 2003-12-18  Zoltan Varga  <vargaz@freemail.hu>
8708
8709         * support.cs (CharArrayHashtable): New helper class.
8710
8711         * cs-tokenizer.cs: Store keywords in a hashtable indexed by 
8712         char arrays, not strings, so we can avoid creating a string in
8713         consume_identifier if the identifier is a keyword.
8714
8715 2003-12-16  Martin Baulig  <martin@ximian.com>
8716
8717         * statement.cs (LocalInfo.Assigned): Removed this property.
8718         (LocalInfo.Flags): Removed `Assigned'.
8719         (LocalInfo.IsAssigned): New public method; takes the EmitContext
8720         and uses flow analysis.
8721         (Block.UsageWarning): Made this method private.
8722         (Block.Resolve): Call UsageWarning() if appropriate.
8723
8724         * expression.cs (LocalVariableReference.DoResolve): Always set
8725         LocalInfo.Used here.
8726
8727 2003-12-13  Martin Baulig  <martin@ximian.com>
8728
8729         * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
8730         any value here; we're now using flow analysis to figure out
8731         whether a statement/block returns a value.
8732
8733 2003-12-13  Martin Baulig  <martin@ximian.com>
8734
8735         * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
8736         working again.
8737         (FlowBranching.MergeFinally): Don't call
8738         `branching.CheckOutParameters()' here, this is called in
8739         MergeTopBlock().
8740         (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
8741         when adding the `finally' vector.       
8742
8743 2003-12-13  Martin Baulig  <martin@ximian.com>
8744
8745         * flowanalysis.cs
8746         (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
8747         actually work and also fix #48962.
8748
8749 2003-12-12 Ben Maurer  <bmaurer@users.sourceforge.net>
8750
8751         * decl.cs: Do not check System.Object for nested types,
8752         since we know it does not have any. Big bang for buck:
8753
8754         BEFORE:
8755            Run 1:   8.35 seconds
8756            Run 2:   8.32 seconds
8757            corlib:  17.99 seconds
8758         AFTER:
8759            Run 1:   8.17 seconds
8760            Run 2:   8.17 seconds
8761            corlib:  17.39 seconds
8762
8763 2003-12-11 Ben Maurer  <bmaurer@users.sourceforge.net>
8764
8765         * class.cs (FindMembers): Allocate arraylists on demand. Most of the
8766         time we are returning 0 members, so we save alot here.
8767
8768 2003-12-11  Martin Baulig  <martin@ximian.com>
8769
8770         * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
8771         `MergeChild()', also just take the `FlowBranching' as argument;
8772         call Merge() on it and return the result.
8773         (FlowBranching.Merge): We don't need to do anything if we just
8774         have one sibling.
8775
8776 2003-12-11  Martin Baulig  <martin@ximian.com>
8777
8778         * flowanalysis.cs: Use a list of `UsageVector's instead of storing
8779         them in an `ArrayList' to reduce memory usage.  Thanks to Ben
8780         Maurer for this idea.
8781
8782 2003-12-11  Martin Baulig  <martin@ximian.com>
8783
8784         * flowanalysis.cs (MergeResult): This class is now gone; we now
8785         use the `UsageVector' for this.  The reason for this is that if a
8786         branching just has one sibling, we don't need to "merge" them at
8787         all - that's the next step to do.
8788         (FlowBranching.Merge): We now return a `UsageVector' instead of a
8789         `MergeResult'.
8790
8791 2003-12-11  Martin Baulig  <martin@ximian.com>
8792
8793         Reworked flow analyis and made it more precise and bug-free.  The
8794         most important change is that we're now using a special `Reachability'
8795         class instead of having "magic" meanings of `FlowReturns'.  I'll
8796         do some more cleanups and optimizations and also add some more
8797         documentation this week.
8798
8799         * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
8800         largely reworked this class.
8801         (FlowReturns): Removed `Unreachable' and `Exception'; we now use
8802         the new `Reachability' class instead of having "magic" values here.
8803         (FlowBranching): We're now using an instance of `Reachability'
8804         instead of having separate `Returns', `Breaks' etc. fields.
8805
8806         * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
8807         based on flow analysis; ignore the return value of block.Emit ().
8808
8809 2003-12-10  Zoltan Varga  <vargaz@freemail.hu>
8810
8811         * driver.cs typemanager.cs: Find the mono extensions to corlib even
8812         if they are private.
8813
8814 2003-12-09  Martin Baulig  <martin@ximian.com>
8815
8816         * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
8817         call them directly on the UsageVector.
8818
8819 2003-12-09  Martin Baulig  <martin@ximian.com>
8820
8821         * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
8822         Changed return type from `FlowReturns' to `Reachability'.
8823
8824 2003-12-09  Martin Baulig  <martin@ximian.com>
8825
8826         * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
8827         (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
8828         `Reachable' fields with a single `Reachability' one.
8829
8830 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
8831
8832         * class.cs (FindMembers): Remove foreach's.
8833
8834         Bootstrap times:
8835
8836         BEFORE
8837                 Run 1:   8.74 seconds
8838                 Run 2:   8.71 seconds
8839
8840         AFTER
8841                 Run 1:   8.64 seconds
8842                 Run 2:   8.58 seconds
8843
8844
8845 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
8846
8847         * cs-parser.jay:
8848         * gen-treedump.cs:
8849         * statement.cs:
8850         This patch does a few things:
8851                 1. EmptyStatement is now a singleton, so it is never reallocated.
8852                 2. All blah is EmptyStatement constructs have been changed to
8853                    blah == EmptyStatement.Value, which is much faster and valid
8854                    now that EmptyStatement is a singleton.
8855                 3. When resolving a block, rather than allocating a new array for
8856                    the non-empty statements, empty statements are replaced with
8857                    EmptyStatement.Value
8858                 4. Some recursive functions have been made non-recursive.
8859         Mainly the performance impact is from (3), however (1) and (2) are needed for
8860         this to work. (4) does not make a big difference in normal situations, however
8861         it makes the profile look saner.
8862
8863         Bootstrap times:
8864
8865         BEFORE
8866         9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
8867         9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
8868         Total memory allocated: 56397 KB
8869
8870         AFTER
8871         9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
8872         8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
8873         Total memory allocated: 55666 KB
8874
8875 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
8876
8877         * support.cs: Rewrite DoubleHash to use its own impl. Is faster
8878         than the hashtable in a hashtable version
8879
8880         * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
8881         we always end up concating a string. This results in a huge perf
8882         loss, because many strings have to be tracked by the GC. In this
8883         patch, we first use a hashtable that works with two keys, so that
8884         the strings do not need to be concat'ed.
8885
8886         Bootstrap times:
8887         BEFORE
8888                 Run 1:   8.74 seconds
8889                 Run 2:   8.71 seconds
8890
8891         AFTER
8892                 Run 1:   8.65 seconds
8893                 Run 2:   8.56 seconds
8894
8895 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
8896
8897         * Makefile: Add a new target `do-time' that does a quick and simple
8898         profile, leaving easy to parse output.
8899
8900 2003-12-08  Zoltan Varga  <vargaz@freemail.hu>
8901
8902         * codegen.cs (Init): Create the dynamic assembly with 
8903         AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
8904
8905 2003-12-02 Ben Maurer  <bmaurer@users.sourceforge.net>
8906
8907         * support.cs: Make the PtrHashtable use only one
8908         instance of its comparer.
8909
8910 2003-11-30  Zoltan Varga  <vargaz@freemail.hu>
8911
8912         * typemanager.cs: Fix lookup of GetNamespaces.
8913
8914 2003-11-29  Miguel de Icaza  <miguel@ximian.com>
8915
8916         * expression.cs: Removed redundant line.
8917
8918         * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
8919         ArrayLists, use for loops with bounds.  
8920
8921         * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
8922         arraylist.
8923
8924         * expression.cs (Invocation.OverloadResolve): Avoid foreach on
8925         arraylists, use for loop with bounds.
8926
8927         The above three changes give us a 0.071 second performance
8928         improvement out of 3.294 seconds down to 3.223.  On my machine
8929         the above changes reduced the memory usage by 1,387 KB during
8930         compiler bootstrap.
8931
8932         * cs-parser.jay (QualifiedIdentifier): New class used to represent
8933         QualifiedIdentifiers.  Before we created a new string through
8934         concatenation, and mostly later on, the result would be
8935         manipulated by DecomposeQI through string manipulation.
8936
8937         This reduced the compiler memory usage for bootstrapping from
8938         59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
8939         compile times in 0.05 seconds.
8940
8941 2003-11-28  Dick Porter  <dick@ximian.com>
8942
8943         * support.cs: Do string compares with the Invariant culture.
8944
8945         * rootcontext.cs: 
8946         * gen-treedump.cs: 
8947         * expression.cs: 
8948         * driver.cs: 
8949         * decl.cs: 
8950         * codegen.cs: 
8951         * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
8952         the comparison is done with the Invariant culture.
8953
8954 2003-11-27  Miguel de Icaza  <miguel@ximian.com>
8955
8956         * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
8957         GetEnumerator method.
8958
8959         (ProbeCollectionType): Iterate starting at the most specific type
8960         upwards looking for a GetEnumerator
8961
8962         * expression.cs: Shift count can be up to 31 for int/uint and 63
8963         for long/ulong.
8964
8965 2003-11-26  Miguel de Icaza  <miguel@ximian.com>
8966
8967         * statement.cs (Block.LookupLabel): Also look for the label on the
8968         children blocks.  Use a hash table to keep track of visited
8969         nodes. 
8970
8971         * cfold.cs (IntConstant to UIntConstant mapping): Only return if
8972         we actually did transform the other operand, otherwise fall back
8973         to the common codepath that casts to long.
8974
8975         * cs-tokenizer.cs: Use the same code pattern as the int case.
8976         Maybe I should do the parsing myself, and avoid depending on the
8977         Parse routines to get this done.
8978
8979 2003-11-25  Miguel de Icaza  <miguel@ximian.com>
8980
8981         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
8982         which fixes bug 51347.  This time test it.
8983
8984         * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
8985         attributes for example can not tell the difference between these.
8986         The difference was only a syntax feature of the language. 
8987
8988         * attribute.cs: Apply attributes to delegates.
8989
8990         * delegate.cs: Call the apply attributes method.
8991
8992 2003-11-24  Miguel de Icaza  <miguel@ximian.com>
8993
8994         * convert.cs (TryImplicitIntConversion): One line bug fix: we were
8995         comparing 0 vs Byte.MinValue, not the value
8996
8997         (ImplicitConversionRequired): When reporting a conversion error,
8998         use error 31 to print out the constant error instead of the
8999         simpler 29.
9000
9001         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
9002         which fixes bug 51347.
9003
9004 2003-11-22  Miguel de Icaza  <miguel@ximian.com>
9005
9006         * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen) 
9007         which fixes the -warnaserror command line option.
9008
9009 2003-11-21  Miguel de Icaza  <miguel@ximian.com>
9010
9011         * cfold.cs (DoNumericPromotions): During constant folding of
9012         additions on UIntConstant, special case intconstants with
9013         IntConstants like we do on the expression binary operator. 
9014
9015 2003-11-12  Miguel de Icaza  <miguel@ximian.com>
9016
9017         * convert.cs (ImplicitReferenceConversion): We were missing a case
9018         (System.Enum are not value types or class types, so we need to
9019         classify them separatedly).
9020
9021         * driver.cs: We do not support error 2007.
9022
9023 2003-11-12 Jackson Harper <jackson@ximian.com>
9024
9025         * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
9026         system directory. Also use the full file name so users can
9027         libraries names mscorlib-o-tron.dll in a non system dir.
9028         
9029 2004-01-04  David Sheldon <dave-mono@earth.li>
9030
9031         * expression.cs: Added matching ")" to error message for CS0077.
9032
9033 2003-12-19  Martin Baulig  <martin@ximian.com>
9034
9035         * typemanager.cs (TypeManager.IsEqualGenericType): New public
9036         static method; see documentation in the method.
9037         (TypeManager.IsSubclassOrNestedChild): Allow IsEqualGenericType().
9038
9039         * convert.cs (Convert.ImplicitReferenceConversion,
9040         Convert.ImplicitReferenceConversionExists): Add support for
9041         generic type declarations; see gen-36.cs.
9042
9043 2003-12-19  Martin Baulig  <martin@ximian.com>
9044
9045         * pending.cs (Pending.InterfaceMethod): Use
9046         `Type.IsAssignableFrom()' instead of `=='.
9047
9048 2003-12-18  Martin Baulig  <martin@ximian.com>
9049
9050         * decl.cs (DeclSpace.AsAccessible): Check for array, pointer and
9051         byref types first.
9052
9053         * convert.cs (Convert.ImplicitStandardConversionExists): Use
9054         `expr_type.Equals (target_type)' instead of `=='.
9055
9056 2003-12-08  Martin Baulig  <martin@ximian.com>
9057
9058         * generics.cs (Constraints.Types): Removed.
9059         (Constraints.Resolve): Just resolve everything to TypeExpr's, not
9060         to Type's.
9061         (Constraints.ResolveTypes): New public method; resolves the
9062         TypeExpr's to Type's.
9063         (TypeParameter.Define): TypeBuilder.DefineGenericParameter() no
9064         longer takes the constraints.
9065         (TypeParameter.DefineMethod): Likewise.
9066         (TypeParameter.DefineType): New public method.  Calls
9067         `TypeBuilder/MethodBuilder.SetGenericParameterConstraints()' to set
9068         the constraints.
9069
9070 2003-12-08  Martin Baulig  <martin@ximian.com>
9071
9072         * convert.cs (Convert.ImplicitConversionStandard): Use
9073         `expr_type.Equals (target_type)' instead of `=='.
9074
9075 2003-12-08  Martin Baulig  <martin@ximian.com>
9076
9077         * typemanager.cs (TypeManager.GetReferenceType): Call
9078         `Type.MakeByRefType ()'.
9079
9080 2003-12-08  Martin Baulig  <martin@ximian.com>
9081
9082         * cs-parser.jay, cs-tokenizer.cs: `where' is not a keyword, it
9083         just has some special meaning in some situations.  For instance,
9084         it is allowed to use `where' as the name of a variable etc.
9085
9086 2003-12-04  Martin Baulig  <martin@ximian.com>
9087
9088         * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
9089         `Type.MakeArrayType()' for array types.
9090
9091 2003-11-18  Miguel de Icaza  <miguel@ximian.com>
9092
9093         * expression.cs (Invocation.VerifyArgumentsCompat): Remove
9094         debugging message.
9095
9096         (SizeOf.DoResolve): assign the `type_queried' field.  This gets
9097         corlib to compile.
9098
9099 2003-11-16  Martin Baulig  <martin@ximian.com>
9100
9101         * codegen.cs (EmitContext.IsGeneric): Removed.
9102
9103         * ecore.cs (SimpleName.ResolveAsTypeStep): Always call
9104         ResolveGeneric() on the DeclSpace.
9105
9106 2003-11-16  Martin Baulig  <martin@ximian.com>
9107
9108         * generic.cs (TypeArguments.Resolve):
9109         `Expression.ResolveAsTypeTerminal()' returns a TypeExpr; call
9110         `ResolveType()' on it to get the Type.
9111
9112 2003-11-15  Martin Baulig  <martin@ximian.com>
9113
9114         * generic.cs (ConstructedType.GetInterfaces): Override this.
9115
9116 2003-11-14  Martin Baulig  <martin@ximian.com>
9117
9118         * interface.cs (Interface.DefineType): Define all type parameters
9119         before adding the interfaces we inherit.
9120
9121 2003-11-11  Martin Baulig  <martin@ximian.com>
9122
9123         * generic.cs (ConstructedType.ResolveType): Always call
9124         `gt.BindGenericParameters (atypes)'; also if `args.HasTypeArguments'.
9125
9126 2003-11-10  Martin Baulig  <martin@ximian.com>
9127
9128         * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
9129         (TypeManager.InitCoreTypes): Initialize them here, but instead of
9130         calling `ResolveType()' on them, directly assign their `Type'.
9131
9132 2003-11-08  Martin Baulig  <martin@ximian.com>
9133
9134         * generic.cs (ConstructedType): Override `IsClass' etc.
9135
9136 2003-11-08  Martin Baulig  <martin@ximian.com>
9137
9138         * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
9139         return value and the `out parent' parameter.
9140         (TypeContainer.DefineType): Moved the CS0644 check into
9141         GetClassBases().  Don't pass the interface types to the
9142         `builder.DefineType()'/`builder.DefineNestedType()', but resolve
9143         them later and then call `TypeBuilder.AddInterfaceImplementation()'.
9144
9145         * ecore.cs (TypeExpr.IsAttribute): New property.
9146         (TypeExpr.GetInterfaces): New method.
9147
9148         * interface.cs (Interface.GetInterfaceTypeByName): Return a
9149         TypeExpr instead of a Type.
9150         (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
9151         (Interface.DefineType): Don't pass the interface types to the
9152         `builder.Definetype()'/`builder.DefineNestedType()', but resolve
9153         them later and then call `TypeBulider.AddInterfaceImplementation()'.
9154
9155         * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
9156         instead of a `Type[]'.
9157         (TypeManager.RegisterBuilder): Likewise.
9158         (TypeManager.AddUserInterface): Likewise.
9159         (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
9160         `Type[]' and also return a `TypeExpr[]'.
9161         (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
9162
9163 2003-11-08  Martin Baulig  <martin@ximian.com>
9164
9165         * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
9166         Expression.     
9167
9168 2003-11-08  Martin Baulig  <martin@ximian.com>
9169
9170         * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
9171         TypeManager.ResolveExpressionTypes().
9172
9173         * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
9174         instead of an Expression.
9175         (TypeExpr): This is now an abstract base class for `TypeExpression'.
9176         (TypeExpression): New public class; formerly known as `TypeExpr'.
9177
9178         * expression.cs (ComposedCast): Derive from TypeExpr.
9179
9180         * typemanager.cs (TypeManager.system_*_expr): These are now
9181         TypExpr's instead of Expression's.
9182         (TypeManager.ResolveExpressionTypes): New public static function;
9183         called from DeclSpace.GetTypeResolveEmitContext() to resolve all
9184         of them.        
9185
9186 2003-11-06  Miguel de Icaza  <miguel@ximian.com>
9187
9188         * expression.cs (New.DoResolve): Do not dereference value that
9189         might be a null return.
9190
9191         * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
9192         sure that the constant value has the right type.  Fixes an
9193         unreported bug, similar to 50425.
9194
9195         * const.cs (Const.LookupConstantValue): Call
9196         ImplicitStandardConversionExists before doing a conversion to
9197         avoid havng the TypeManager.ChangeType do conversions.
9198
9199         Reduced the number of casts used
9200
9201         (Const.ChangeType): New routine to enable reuse of the constant
9202         type changing code from statement.
9203
9204         * typemanager.cs (ChangeType): Move common initialization to
9205         static global variables.
9206
9207         Fixes #50425.
9208
9209         * convert.cs (ImplicitReferenceConversion): Somehow we allowed
9210         every value type to go through, even if it was void.  Fix that. 
9211
9212         * cs-tokenizer.cs: Use is_identifier_start_character on the start
9213         character of the define, and the is_identifier_part_character for
9214         the rest of the string.
9215
9216 2003-11-05  Miguel de Icaza  <miguel@ximian.com>
9217
9218         * expression.cs (UnaryMutator.EmitCode): When I updated
9219         LocalVariableReference.DoResolve, I overdid it, and dropped an
9220         optimization done on local variable references.
9221
9222 2003-11-04  Miguel de Icaza  <miguel@ximian.com>
9223
9224         * ecore.cs: Convert the return from Ldlen into an int.
9225
9226 2003-10-20  Miguel de Icaza  <miguel@ximian.com>
9227
9228         * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
9229         the accessibility, this is a special case for toplevel non-public
9230         classes (internal for instance).
9231
9232 2003-10-20  Nick Drochak <ndrochak@gol.com>
9233
9234         * ecore.cs: Fix typo and build.  Needed another right paren.
9235
9236 2003-10-19  Miguel de Icaza  <miguel@ximian.com>
9237
9238         * ecore.cs: Applied fix from Ben Maurer.   We were handling in the
9239         `internal' case regular and protected, but not allowing protected
9240         to be evaluated later.  Bug 49840
9241
9242 2003-10-15  Miguel de Icaza  <miguel@ximian.com>
9243
9244         * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
9245         to kb.Nlast, and not the kb.nFirst to isolate the switch
9246         statement.
9247
9248         Extract the underlying type, so enumerations of long/ulong are
9249         treated like long/ulong.
9250
9251 2003-10-14  Miguel de Icaza  <miguel@ximian.com>
9252
9253         * expression.cs (New): Overload the meaning of RequestedType to
9254         track the possible creation of the NewDelegate type, since
9255         DoResolve is invoked more than once for new constructors on field
9256         initialization.
9257
9258         See bugs: #48800 and #37014
9259
9260         * cs-parser.jay (declare_local_constants): Take an arraylist
9261         instead of a single constant.
9262
9263         (local_constant_declaration): It should take a
9264         constant_declarators, not a constant_declarator.  Fixes 49487
9265
9266         * convert.cs: Fix error report.
9267
9268 2003-10-13 Jackson Harper <jackson@ximian.com>
9269
9270         * typemanager.cs (TypeToCoreType): Add float and double this fixes
9271         bug #49611
9272         
9273 2003-11-03  Martin Baulig  <martin@ximian.com>
9274
9275         * expression.cs (ArrayAccess.GetStoreOpcode): Added
9276         `out bool has_type_arg'; if set, we need to pass the type to
9277         ig.Emit().
9278         (ArrayAccess.GetStoreOpcode, ArrayAccess.EmitLoadOpcode): Use
9279         Stelem_Any/Ldelem_Any for generic parameters.   
9280
9281 2003-11-02  Martin Baulig  <martin@ximian.com>
9282
9283         * expression.cs (Invocation.EmitCall): Use
9284         `TypeManager.IsValueType()' to check whether it's a value type.
9285         Don't set `struct_call' when calling a method on a type parameter.
9286
9287 2003-11-02  Martin Baulig  <martin@ximian.com>
9288
9289         * generics.cs (ConstructedType.Resolve): Renamed to ResolveType()
9290         and removed the TypeBuilder argument.
9291
9292         * typemanager.cs (TypeManager.IsValueType): Return
9293         `t.IsGenericParameter || t.IsValueType'.
9294
9295 2003-10-25  Martin Baulig  <martin@ximian.com>
9296
9297         * decl.cs (DeclSpace.ResolveType): If we're a ConstructedType,
9298         call ConstructedType.Resolve() on it.
9299
9300         * generic.cs (ConstructedType.Resolve): Set `type' on success.
9301
9302 2003-10-25  Martin Baulig  <martin@ximian.com>
9303
9304         * class.cs (TypeContainer.GetClassBases): Changed
9305         `out Type parent' into `out TypeExpr parent'.  Moved CS0644 and
9306         CS8214 reporting here.
9307         (TypeContainer.DefineType): GetClassBases() gives us a `TypeExpr'
9308         instead of a `Type' for our parent.  In case of a recursive
9309         declaration (see tests/gen-23.cs for an example), our parent is a
9310         ConstructedType and it doesn't have its type set.  So, first
9311         create our own TypeBuilder, then call constructed.Resolve() to get
9312         the parent's type and finally TypeBuilder.SetParent() it.
9313
9314         * ecore.cs (TypeExpr.Name): New public virtual property.
9315
9316         * generic.cs
9317         (ConstructedType): We're now a TypeExpr and not just an Expression.
9318         (ConstructedType.ResolveAsTypeStep): Don't resolve our type
9319         arguments here; this is done later.
9320         (ConstructedType.Resolve): New public method to resolve the type
9321         arguments and bind them.
9322
9323 2003-10-21  Martin Baulig  <martin@ximian.com>
9324
9325         * convert.cs: Use `TypeManager.IsValueType' instead of
9326         'type.IsValueType' everywhere.
9327
9328         * typemanager.cs (TypeManager.IsValueType): Return true for type
9329         parameters.  The reason for this is that we need to box a type
9330         parameter when converting it to a reference type.
9331
9332         * cs-parser.jay: Added support for default value expressions.
9333
9334         * generics.cs (DefaultValueExpression): New public class.       
9335
9336 2003-10-17  Martin Baulig  <martin@ximian.com>
9337
9338         * generic.cs (Constraints.Resolve): Take a DecpSpace instead of a
9339         TypeContainer so we can also use this for Interfaces.
9340         (TypeParameter.Resolve): Likewise.
9341
9342         * interface.cs (Interface.DefineType): Added support for generic
9343         interfaces.
9344
9345         * cs-parser.jay: Added support for generic structs and interfaces.
9346
9347 2003-10-17  Martin Baulig  <martin@ximian.com>
9348
9349         * generic.cs (GenericMemberAccess.DoResolve): We can now actually
9350         call generic methods :-)
9351
9352 2003-10-16  Martin Baulig  <martin@ximian.com>
9353
9354         * cs-parser.jay (namespace_or_type_name): Only create a
9355         GenericMemberAccess if we actually have type arguments.
9356
9357 2003-10-13  Martin Baulig  <martin@ximian.com>
9358
9359         * class.cs (Method.Define): If we're a generic method, call
9360         TypeBuilder.DefineGenericMethod () before resolving
9361         the parameters.
9362         (MethodData): Added .ctor which takes an additional MethodBuilder
9363         argument; this is used for generic methods.
9364         (MethodData.Define): Call `builder.SetGenericMethodSignature()' if
9365         we already have a MethodBuilder.
9366
9367 2003-10-10  Martin Baulig  <martin@ximian.com>
9368
9369         * class.cs (Method): Added .ctor which takes a `GenericMethod'
9370         instead of a `DeclSpace'.  This is used for generic methods.
9371
9372         * cs-parser.jay (method_header): Added support for generic
9373         methods; create a `GenericMethod' instance and pass it to the
9374         `Method's .ctor; it'll be used as the `DeclSpace' to lookup
9375         parameters and locals.
9376
9377         * decl.cs (DeclSpace.SetParameterInfo): Removed Location argument
9378         since we already have the location.  Check whether we're a generic
9379         type declaration or a generic method and create the correct type
9380         parameter.
9381
9382         * generic.cs (TypeParameter.DefineMethod): New public method.
9383         (GenericMethod): New public class; derives from DeclSpace and is
9384         used for generic methods.       
9385
9386 2003-10-09  Martin Baulig  <martin@ximian.com>
9387
9388         * class.cs (MethodCore): Added additional `DeclSpace ds' argument
9389         to the .ctor.
9390         (MethodCore.DoDefineParameters): Removed the TypeContainer
9391         argument; use the DeclSpace which was passed to the .ctor instead.
9392         (MethodCore.CheckParameter): Take a DeclSpace instead of a
9393         TypeContainer; we only need a DeclSpace here.
9394
9395 2003-10-09  Martin Baulig  <martin@ximian.com>
9396
9397         * class.cs (MethodData): Added additional `DeclSpace ds' argument
9398         to the .ctor.
9399         (MethodData.Define, MethodData.Emit): Pass the `ds' to the
9400         EmitContext's .ctor.    
9401
9402 2003-10-09  Martin Baulig  <martin@ximian.com>
9403
9404         * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
9405         (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
9406         AsAccessible(), moved them as well.
9407
9408         * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
9409
9410 2003-10-07  Miguel de Icaza  <miguel@ximian.com>
9411
9412         * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
9413         generation for >=, as spotted by Paolo, bug 48679.  
9414         Patch from David Waite.
9415
9416         * cs-tokenizer.cs: Add handling for #pragma.
9417
9418         * cs-parser.jay: Allow for both yield and yield return in the
9419         syntax.  The anti-cobolization of C# fight will go on!
9420
9421         * class.cs (TypeBuilder.DefineType): Catch error condition here
9422         (Parent.DefineType erroring out and returning null).
9423
9424         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
9425         coping with enumerations variables, we were mistakenly processing
9426         them as a regular value type instead of built-in types.  Fixes the
9427         bug #48063
9428
9429         * typemanager.cs (IsBuiltinOrEnum): New method.
9430
9431 2003-09-30  Miguel de Icaza  <miguel@ximian.com>
9432
9433         * cs-parser.jay: Upgrade: yield now needs the return clause.
9434
9435 2003-10-08  Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
9436
9437         * cs-parser.jay : Renamed yyName to yyNames related to jay.
9438
9439 2003-09-29  Martin Baulig  <martin@ximian.com>
9440
9441         * typemanager.cs (TypeManager.GetMethodFlags): Added support for
9442         inflated generic methods.
9443
9444         * generics.cs (ConstructedType): Distinguish between open and
9445         closed constructed types; correctly resolve the arguments.
9446
9447 2003-09-22  Martin Baulig  <martin@ximian.com>
9448
9449         * generic.cs (ConstructedType.ResolveAsTypeCheck): Check whether
9450         all type arguments meet their constraints.
9451
9452 2003-09-19  Martin Baulig  <martin@ximian.com>
9453
9454         * decl.cs (MemberCache.SetupCacheForInterface): Take a
9455         `MemberCache parent' argument.  Normally, an interface doesn't
9456         have a parent type except System.Object, but we use this in gmcs
9457         for generic type parameters.
9458
9459 2003-09-18  Martin Baulig  <martin@ximian.com>
9460
9461         * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
9462         on `type.IsInterface'; don't check whether the type has a parent
9463         to determine whether it's an interface.
9464
9465 2003-09-17  Martin Baulig  <martin@ximian.com>
9466
9467         * generic.cs (ConstructedType.ToString): Always use `name' as the
9468         type name.
9469
9470 2003-09-15  Martin Baulig  <martin@ximian.com>
9471
9472         * cs-parser.jay: Fix grammar wrt. type_parameter_constraints.
9473
9474         * generic.cs (Constraints.Resolve): New public method; this is
9475         called to resolve the constraint types and to check whether all
9476         the constraints are correct.
9477         (Constraints.Types): New public property.
9478         (TypeParameter.Resolve): New public method; resolves all the
9479         type's constraints.
9480
9481         * class.cs (TypeContainer.DefineType): Call
9482         TypeParameter.Resolve() before actually defining the type.
9483
9484 2003-09-15  Martin Baulig  <martin@ximian.com>
9485
9486         * class.cs (TypeContainer.DefineType): Added an error flag to
9487         avoid reporting duplicate CS0146's ("class definition is
9488         circular.").
9489
9490         * driver.cs (Driver.MainDriver): Abort if
9491         RootContext.ResolveTree() reported any errors.
9492
9493 2003-09-07  Martin Baulig  <martin@ximian.com>
9494
9495         * report.cs (Error, Warning): Added overloaded versions which take
9496         a `params object[] args' and call String.Format().
9497
9498 2003-09-07  Martin Baulig  <martin@ximian.com>
9499
9500         * decl.cs (DeclSpace..ctor): Don't call
9501         NamespaceEntry.DefineName() here; do it in RecordDecl() which is
9502         called from Tree.RecordDecl().  Fixes the CS0101 reporting.
9503         (DeclSpace.RecordDecl): New method.
9504
9505         * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
9506
9507 2003-09-02  Ravi Pratap  <ravi@ximian.com>
9508
9509         * attribute.cs (CheckAttributeTarget): Ensure that we allow return
9510         value attributes to be applied to ParameterBuilders.
9511
9512         * class.cs (MethodCore.LabelParameters): Make static and more
9513         generic so that it can be used from other places - like interface
9514         methods, for instance.
9515
9516         * interface.cs (Interface.Emit): Call LabelParameters before
9517         emitting attributes on the InterfaceMethod.
9518
9519 2003-09-07  Martin Baulig  <martin@ximian.com>
9520
9521         * generic.cs (ConstructedType.ResolveAsTypeStep): Report a CS8217
9522         if the number of type parameters doesn't match.
9523
9524 2003-09-04  Martin Baulig  <martin@ximian.com>
9525
9526         * expression.cs (ComposedCast.ResolveAsTypeStep): Added support
9527         for arrays of generic type params (ie. `!0[]').
9528
9529 2003-09-04  Martin Baulig  <martin@ximian.com>
9530
9531         * class.cs (TypeContainer.AsAccessible): Ignore generic parameters
9532         for the moment.
9533
9534 2003-09-04  Martin Baulig  <martin@ximian.com>
9535
9536         * decl.cs (DeclSpace.LookupGeneric): New method.
9537         (DeclSpace.CheckAccessLevel): Ignore generic parameters for the
9538         moment.
9539
9540         * generic.cs (TypeParameterExpr): Take a TypeParameter as
9541         argument, not just a string.
9542         (TypeParameter.Define): New public method; this is called to
9543         actually define the generic parameter; after this, you can use the
9544         new `Type' property to get the type.
9545
9546 2003-09-04  Martin Baulig  <martin@ximian.com>
9547
9548         * decl.cs (DeclSpace.SetParameterInfo): The `constraints' argument
9549         is now an ArrayList; initialize the result of the `TypeParameters'
9550         property here.
9551         (DeclSpace.GetGenericData): Removed.
9552         (DeclSpace.LookupGeneric): Temporarily removed; we need to
9553         implement this in a different way.
9554         (DeclSpace.GetTypeParameters): Removed; there's now a
9555         `TypeParameters' property.
9556         (DeclSpace.TypeParameters): New public property.
9557
9558         * generic.cs (Constraints): Make this class public.
9559         (TypeParameter): New public class.
9560
9561 2003-09-04  Martin Baulig  <martin@ximian.com>
9562
9563         * decl.cs (DeclSpace.GetTypeParameters): New method to return the
9564         generic parameters.
9565
9566         * class.cs (TypeContainer.DefineType): Call
9567         TypeBuilder.DefineGenericParameter () on all generic parameters if
9568         this is a generic type.
9569
9570 2003-08-28  Martin Baulig  <martin@ximian.com>
9571
9572         * sample-stack.il: Compile this with ilasm: "ilasm /dll
9573         sample-stack.il".
9574
9575         * sample-hello.cs: Compile this with gmcs: "gmcs
9576         /r:sample-stack.dll sample-hello.cs".
9577
9578 2003-08-28  Martin Baulig  <martin@ximian.com>
9579
9580         * generic.cs (ConstructedType.ResolveAsTypeStep): Actually bind
9581         the parameters to the generic type.
9582
9583 2003-08-28  Martin Baulig  <martin@ximian.com>
9584
9585         * cs-tokenizer.cs (parse_less_than): Also allow all builtin types.
9586
9587 2003-08-28  Martin Baulig  <martin@ximian.com>
9588
9589         * cs-parser.jay (opt_type_argument_list): Use
9590         `OP_GENERICS_LT type_arguments OP_GENERICS_GT'.
9591         (primary_expression): Replace `qualified_identifier' with `type_name'.
9592         (type_parameter_list): Use `OP_GENERICS_LT type_parameters OP_GENERICS_GT'.
9593
9594         * cs-tokenizer.cs (is_punct): When reading a `<', invoke a custom
9595         parser to check whether it is syntactically a type parameter list;
9596         return OP_GENERICS_LT/OP_GENERICS_GT instead of OP_LT/OP_GT in
9597         this case.
9598
9599 2003-08-26  Martin Baulig  <martin@ximian.com>
9600
9601         * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
9602         resolving aliases; fixes #47927.
9603
9604 2003-08-26  Martin Baulig  <martin@ximian.com>
9605
9606         * statement.cs (Using.DoResolve): This is internally emitting a
9607         try/finally clause, so we need to set ec.NeedExplicitReturn if we
9608         do not always return.  Fixes #47681.
9609
9610 2003-08-26  Martin Baulig  <martin@ximian.com>
9611
9612         * decl.cs (MemberCore): Moved WarningNotHiding(),
9613         Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
9614         into MemberBase.
9615         (AdditionResult): Make this nested in DeclSpace.
9616         (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
9617         argument; call NamespaceEntry.Define() unless we're nested in a
9618         class or struct.
9619
9620         * namespace.cs (Namespace.DefineName): New public function.  This
9621         is called from DeclSpace's .ctor to add 
9622         (Namespace.Lookup): Include DeclSpaces in the lookup.
9623
9624         * class.cs (Operator): Derive from MemberBase, not MemberCore.
9625
9626         * const.cs (Const): Derive from MemberBase, not MemberCore.     
9627
9628 2003-08-25  Martin Baulig  <martin@ximian.com>
9629
9630         * convert.cs (Convert.ExplicitReferenceConversion): When
9631         converting from an interface type to a class, unbox if the target
9632         type is a struct type.  Fixes #47822.
9633
9634 2003-08-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9635
9636         * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
9637         #47854.
9638
9639 2003-08-22  Martin Baulig  <martin@ximian.com>
9640
9641         * class.cs (TypeManager.DefineType): When defining a nested type,
9642         call DefineType() on our parent; fixes #47801.
9643
9644 2003-08-22  Martin Baulig  <martin@ximian.com>
9645
9646         * class.cs (MethodData.Define): While checking if a method is an
9647         interface implementation, improve the test a bit more to fix #47654.
9648
9649 2003-08-22  Martin Baulig  <martin@ximian.com>
9650
9651         * expression.cs (Probe.DoResolve): Check whether `expr' resolved
9652         correctly; fixes #47722.
9653
9654 2003-08-22  Martin Baulig  <martin@ximian.com>
9655
9656         * expression.cs (UnaryMutator.ResolveVariable): If the target is a
9657         LocalVariableReference, ensure it's not read-only.  Fixes #47536.
9658
9659         * statement.cs (Fixed.DoResolve): Make all variables read-only. 
9660
9661 2003-08-22  Martin Baulig  <martin@ximian.com>
9662
9663         * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
9664         can only be assigned in static constructors.  Fixes #47161.
9665
9666 2003-08-22  Martin Baulig  <martin@ximian.com>
9667
9668         Rewrote and improved the flow analysis code.
9669
9670         * flowbranching.cs (FlowBranching): Make this class abstract.
9671         (FlowBranching.CreateBranching): New static function to create a
9672         new flow branching.
9673         (FlowBranchingBlock, FlowBranchingException): New classes.
9674         (FlowBranching.UsageVector.Type): New public readonly field.
9675         (FlowBranching.UsageVector.Breaks): Removed the setter.
9676         (FlowBranching.UsageVector.Returns): Removed the setter.
9677         (FlowBranching.UsageVector): Added Break(), Return(),
9678         NeverReachable() and Throw() methods to modify the reachability.
9679         (FlowBranching.UsageVector.MergeChildren): Removed, this is now
9680         done by FlowBranching.Merge().
9681         (FlowBranching.UsageVector.MergeChild): New method; merges the
9682         merge result into the current vector.
9683         (FlowBranching.Merge): New abstract method to merge a branching.
9684
9685 2003-08-12  Martin Baulig  <martin@ximian.com>
9686
9687         * expression.cs (Indirection.CacheTemporaries): Create the
9688         LocalTemporary with the pointer type, not its element type.
9689
9690 2003-08-10  Miguel de Icaza  <miguel@ximian.com>
9691
9692         * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
9693         token was a keyword or not.
9694
9695         Add `error' options where an IDENTIFIER was expected;  Provide
9696         CheckToken and CheckIdentifierToken convenience error reporting
9697         functions. 
9698
9699         Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
9700
9701         * decl.cs: Rename `NamespaceEntry Namespace' public field into
9702         NameSpaceEntry NameSpaceEntry.
9703
9704         (LookupInterfaceOrClass): Avoid creating a full qualified name
9705         from namespace and name: avoid doing lookups when we know the
9706         namespace is non-existant.   Use new Tree.LookupByNamespace which
9707         looks up DeclSpaces based on their namespace, name pair.
9708
9709         * driver.cs: Provide a new `parser verbose' to display the
9710         exception thrown during parsing.  This is turned off by default
9711         now, so the output of a failure from mcs is more graceful.
9712
9713         * namespace.cs: Track all the namespaces defined in a hashtable
9714         for quick lookup.
9715
9716         (IsNamespace): New method
9717
9718 2003-08-09  Miguel de Icaza  <miguel@ximian.com>
9719
9720         * namespace.cs: Remove redundant call;  Avoid using MakeFQN when
9721         we know that we need to concatenate (full typename can never be
9722         null). 
9723
9724         * class.cs: ditto.
9725
9726         * statement.cs: Use a bitfield;  Do not initialize to null things
9727         which are done by the constructor by default.
9728
9729         * cs-parser.jay: bug fix, parameter was 4, not 3.
9730
9731         * expression.cs: Just use the property;
9732
9733         * statement.cs: No need for GetVariableInfo method.
9734
9735 2003-08-08  Martin Baulig  <martin@ximian.com>
9736
9737         * flowanalysis.cs (FlowReturns): This is now nested in the
9738         `FlowBranching' class.
9739         (MyBitVector): Moved this here from statement.cs.
9740         (FlowBranching.SiblingType): New enum type.
9741         (FlowBranching.CreateSibling): Added `SiblingType' argument.
9742
9743 2003-08-07  Martin Baulig  <martin@ximian.com>
9744
9745         * flowanalysis.cs (FlowBranchingType): This is now nested in the
9746         `FlowBranching' class and called `BranchingType'.
9747
9748 2003-08-07  Martin Baulig  <martin@ximian.com>
9749
9750         * flowanalysis.cs: Moved all the control flow analysis code into
9751         its own file.
9752
9753 2003-08-07  Martin Baulig  <martin@ximian.com>
9754
9755         * assign.cs (Assign.DoResolve): `target' must either be an
9756         IAssignMethod or an EventAccess; report a CS0131 otherwise.  Fixes
9757         #37319.
9758
9759 2003-08-07  Miguel de Icaza  <miguel@ximian.com>
9760
9761         * expression.cs (BinaryMethod): This kind of expression is created by the
9762         Binary class if it determines that the operator has to be handled
9763         by a method.
9764
9765         (BinaryDelegate): This kind of expression is created if we are
9766         dealing with a + or - operator on delegates.
9767
9768         (Binary): remove method, argumetns, and DelegateOperator: when
9769         dealing with methods, 
9770
9771         * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
9772
9773         * statement.cs (Block): use bitfields for the three extra booleans
9774         we had in use.   Remove unused topblock parameter.
9775
9776         * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
9777
9778         * assign.cs: Drop extra unneeded tests.
9779
9780 2003-08-06  Miguel de Icaza  <miguel@ximian.com>
9781
9782         * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
9783
9784         * statement.cs (Foreach): Use VariableStorage instead of
9785         LocalBuilders.   
9786
9787         * codegen.cs (VariableStorage): New class used by clients that
9788         require a variable stored: locals or fields for variables that
9789         need to live across yield.
9790
9791         Maybe provide a convenience api for EmitThis+EmitLoad?
9792
9793         (GetTemporaryLocal, FreeTemporaryLocal): Recycle
9794         these bad boys.
9795
9796 2003-08-05  Miguel de Icaza  <miguel@ximian.com>
9797
9798         * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
9799         RemapParameterLValue): New methods that are used to turn a
9800         precomputed FieldInfo into an expression like this:
9801
9802                 instance.FieldInfo
9803
9804         The idea is to use this instead of making LocalVariableReference
9805         have more than one meaning.
9806
9807         * cs-parser.jay: Add error production to BASE.
9808
9809         * ecore.cs: Deal with TypeManager.GetField returning null, which
9810         is now a valid return value.
9811
9812         (FieldExprNoAddress): New expression for Fields whose address can
9813         not be taken.
9814
9815         * expression.cs (LocalVariableReference): During the resolve
9816         phases, create new expressions if we are in a remapping context.
9817         Remove code that dealt with remapping here.
9818
9819         (ParameterReference): same.
9820
9821         (ProxyInstance): New expression, like the `This' expression, but
9822         it is born fully resolved.  We know what we are doing, so remove
9823         the errors that are targeted to user-provided uses of `this'.
9824
9825         * statement.cs (Foreach): our variable is now stored as an
9826         Expression;  During resolution, follow the protocol, dont just
9827         assume it will return this.
9828
9829 2003-08-06  Martin Baulig  <martin@ximian.com>
9830
9831         * support.cs (SeekableStreamReader.cs): New public class.
9832
9833         * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
9834         SeekableStreamReader instead of the normal StreamReader.
9835
9836 2003-08-04  Martin Baulig  <martin@ximian.com>
9837
9838         * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
9839         CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
9840         deambiguate casts and delegate invocations.
9841         (parenthesized_expression): Use the new tokens to ensure this is
9842         not a cast of method invocation.
9843
9844         * cs-tokenizer.cs (is_punct): Return one of the new special tokens
9845         when reading a `)' and Deambiguate_CloseParens () was previously
9846         called.
9847
9848         * expression.cs (ParenthesizedExpression): New class.  This is
9849         just used for the CS0075 test.
9850         (Binary.DoResolve): Check for CS0075.   
9851
9852 2003-07-29  Ravi Pratap  <ravi@ximian.com>
9853
9854         * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
9855         Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
9856         reference comparison.
9857
9858         (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
9859         examine the ReturnType for equality - this is necessary in the
9860         cases of implicit and explicit operators whose signature also
9861         includes the return type.
9862
9863 2003-07-26  Miguel de Icaza  <miguel@ximian.com>
9864
9865         * namespace.cs: Cache the result of the namespace computation,
9866         instead of computing it every time.
9867
9868 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
9869
9870         * decl.cs: Use a global arraylist that we reuse over invocations
9871         to avoid excesive memory consumption.  Reduces memory usage on an
9872         mcs compile by one meg (45 average).
9873
9874         * typemanager.cs (LookupTypeReflection): In .NET pointers are
9875         private, work around that.
9876
9877 2003-07-23  Miguel de Icaza  <miguel@ximian.com>
9878
9879         * literal.cs (IntLiteral): Define Zero and One static literals. 
9880
9881         * cs-parser.jay (integer_literal): use static literals to reduce
9882         memory usage for the most used literals (0, 1 and -1).  211kb
9883         reduced in memory usage.
9884
9885         Replace all calls to `new ArrayList' with `new
9886         ArrayList(4)' which is a good average number for most allocations,
9887         and also requires only 16 bytes of memory for its buffer by
9888         default. 
9889
9890         This reduced MCS memory usage in seven megabytes for the RSS after
9891         bootstrapping.
9892
9893 2003-07-28  Ravi Pratap  <ravi@ximian.com>
9894
9895         * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
9896         handle params methods the correct way by forming only one
9897         applicable set with params and normal methods in them. Earlier we
9898         were looking at params methods only if we found no normal methods
9899         which was not the correct thing to do.
9900
9901         (Invocation.BetterFunction): Take separate arguments indicating
9902         when candidate and the best method are params methods in their
9903         expanded form.
9904
9905         This fixes bugs #43367 and #46199.
9906
9907         * attribute.cs: Documentation updates.
9908
9909         (CheckAttribute): Rename to CheckAttributeTarget.
9910         (GetValidPlaces): Rename to GetValidTargets.
9911
9912         * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
9913         bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
9914
9915         Fixes bug #44468.
9916
9917 2003-07-28  Miguel de Icaza  <miguel@ximian.com>
9918
9919         * codegen.cs: Compute IsGeneric correctly.
9920
9921         * cs-parser.jay: Introduce OP_GENERIC_LT for the grammar ambiguity
9922         resolution. 
9923
9924         Bring back (temporarily) OP_LEFT_SHIFT, OP_RIGHT_SHIFT,
9925         OP_SHIFT_RIGHT_ASSIGN, OP_SHIFT_LEFT_ASSIGN.  There were too many
9926         regressions, and I was chasing more bugs than I required.
9927
9928         * interface.cs: Use expressions for base type names (like classes
9929         and structs have been doing for a while now), and resolve that.
9930         This patch should probably go into head as well.
9931
9932         This makes it one less user of FindType.
9933
9934 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
9935
9936         This compiler can not self host currently.  Need to fix that.
9937         
9938         * Makefile: compile to `gmcs.exe'
9939
9940         * driver.cs: Turn on v2 by default on gmcs.
9941
9942         * generic.cs (ConstructedType): Does no longer take a container
9943         type argument;  That will be taken care of later.
9944
9945         (ConstructedType.DoResolve, ConstructedType.ResolveAsTypeStep):
9946         Use SimpleName to resolve for now, so we can continue the work on
9947         the parser, until we get Type.GetType that understands generics.
9948
9949         (ConstructedType.ToString): Implement
9950
9951         (TypeArguments.Resolve): Resolve the child expressions as types. 
9952         
9953         * cs-parser.jay: Rename interface_constraints to
9954         type_parameter_constraints
9955
9956         (namespace_or_type_name): Only use constructed types for the basic
9957         construction, we will deal with identifier<...> later.
9958
9959         (type/type_name): No longer call DecomposeQI, as
9960         namespace_or_type_name is always decoded now.
9961         
9962 2003-07-22  Ravi Pratap  <ravi@ximian.com>
9963
9964         * expression.cs (Invocation.OverloadResolve): Follow the spec more
9965         closely: we eliminate methods in base types when we have an
9966         applicable method in a top-level type.
9967
9968         Please see section 14.5.5.1 for an exact description of what goes
9969         on. 
9970
9971         This fixes bug #45127 and a host of other related to corlib compilation.
9972
9973         * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
9974         array is the method corresponding to the top-level type (this is
9975         because of the changes made to icall.c) so we change this
9976         accordingly.
9977
9978         (MethodGroupExpr.Name): This too.
9979
9980         * typemanager.cs (GetElementType): New method which does the right
9981         thing when compiling corlib. 
9982
9983         * everywhere: Make use of the above in the relevant places.
9984
9985 2003-07-22  Martin Baulig  <martin@ximian.com>
9986
9987         * cs-parser.jay (invocation_expression): Moved
9988         `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
9989         `cast_expression', but create a InvocationOrCast which later
9990         resolves to either an Invocation or a Cast.
9991
9992         * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
9993         method; call this before EmitStatement() to make sure that this
9994         expression can be used as a statement.
9995
9996         * expression.cs (InvocationOrCast): New class; resolves to either
9997         an Invocation or a Cast.
9998
9999         * statement.cs (StatementExpression): Call ResolveStatement() on
10000         the ExpressionStatement before emitting it.
10001
10002 2003-07-21  Martin Baulig  <martin@ximian.com>
10003
10004         * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
10005         `ref' and `out' attributes match; fixes #46220.
10006         (MemberAccess.ResolveMemberAccess): You can't reference a type
10007         through an expression; fixes #33180.
10008         (Indexers.GetIndexersForType): Don't return the indexers from
10009         interfaces the class implements; fixes #46502.
10010
10011 2003-07-21  Martin Baulig  <martin@ximian.com>
10012
10013         * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
10014         CS0661 checks; fixes bug #30442.
10015
10016 2003-07-21  Martin Baulig  <martin@ximian.com>
10017
10018         * decl.cs (AdditionResult): Added `Error'.
10019
10020         * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
10021
10022         * typemanager.cs (TypeManager.ChangeType): Catch exceptions; makes
10023         cs0031.cs actually work.
10024
10025  2003-07-20  Miguel de Icaza  <miguel@ximian.com>
10026  
10027         * cs-parser.jay (namespace_name): do not use
10028         namespace_or_type_name, use qualified_identifier, because
10029         namespace_or_type_name will soon return a composed expression
10030         instead of a string.
10031  
10032         (namespace_or_type_name): Instead of returning a string, now this
10033         production returns an expression.
10034  
10035         * codegen.cs (EmitContext): Setup IsGeneric property based on
10036         whether our DeclSpace is generic, our the method is generic.
10037  
10038         * modifier.cs (Modifiers.METHOD_GENERIC): New definition, use if
10039         the method is generic.
10040  
10041         * cs-parser.jay (type_arguments, opt_type_argument_list,
10042         type_parameters, type_parameter_list, opt_type_parameter_list,
10043         type_parameter,, opt_type_parameter_constraints_clauses,
10044         type_parameter_constraints_clauses,
10045         type_parameter_constraint_clause, type_parameter_constraint,
10046         interface_constraints): Add new production
10047  
10048         * decl.cs (DeclSpace): IsGeneric, flag to track whether this
10049         DeclSpace is generic or not.
10050  
10051         (DeclSpace.SetParameterInfo): New routine, used to set the
10052         parameter info for a type.
10053  
10054         (DeclSpace.LookupGeneric): Lookups a name, and if it is a generic,
10055         returns a GenericTypeExpr
10056  
10057         * ecore.cs (SimpleName.ResolveAsTypeStep): If our container is
10058         generic, lookup the generic argument.
10059  
10060         * attribute.cs: Do not allow TypeParameterExpressions in
10061         Attributes.
10062  
10063         * class.cs: Do not allow the Main method to be defined in a
10064         Generic container.
10065  
10066         * expression.cs (SizeOf): Do not allow generic types to be used as
10067         arguments to sizeof.
10068  
10069         * typemanager.cs (IsGeneric): Wrapper for Reflection when we have
10070         it: whether a type is generic or not.  Only works for types we are
10071         currently building for now.
10072         
10073 2003-07-20  Martin Baulig  <martin@ximian.com>
10074
10075         * namespace.cs: Fixed that bug which caused a crash when compiling
10076         the debugger's GUI.
10077
10078 2003-07-20  Miguel de Icaza  <miguel@ximian.com>
10079
10080         * typemanager.cs (LookupTypeReflection): Never expose types which
10081         are NotPublic, NestedPrivate, NestedAssembly, or
10082         NestedFamANDAssem.  We used to return these, and later do a check
10083         that would report a meaningful error, but the problem is that we
10084         would not get the real match, if there was a name override.
10085
10086 2003-07-18  Miguel de Icaza  <miguel@ximian.com>
10087
10088         * namespace.cs (Namespace, Name): Do not compute the namespace
10089         name dynamically, compute it in the constructor.  This reduced
10090         memory usage by 1697 KB.
10091
10092         * driver.cs: Use --pause to pause at the end.
10093
10094 2003-07-17  Peter Williams  <peter@newton.cx>
10095
10096         * Makefile: Change the name of the test target so that it doesn't
10097         conflict with the recursive test target.
10098
10099 2003-07-17  Miguel de Icaza  <miguel@ximian.com>
10100
10101         * expression.cs (LocalVariableReference.Emit, EmitAssign,
10102         AddressOf): Do not use EmitThis, that was wrong, use the actual
10103         this pointer.
10104
10105 2003-07-15  Miguel de Icaza  <miguel@ximian.com>
10106
10107         * class.cs (MethodData.Define): While checking if a method is an
10108         interface implementation, improve the test: If we are not public
10109         (use new test here: use the computed MethodAttributes directly,
10110         instead of the parsed modifier flags) check if the `implementing'
10111         method comes from an interface or not.
10112
10113         * pending.cs (VerifyPendingMethods): Slightly better error
10114         message.
10115
10116         * makefile: add test target that does the mcs bootstrap.
10117
10118 2003-07-16  Ravi Pratap  <ravi@ximian.com>
10119
10120         * interface.cs (Define): Do nothing here since there are no
10121         members to populate etc. Move the attribute emission out of here
10122         since this was just totally the wrong place to put it. Attribute
10123         application happens during the 'Emit' phase, not in the 'Define'
10124         phase.
10125
10126         (Emit): Add this method and move the attribute emission here
10127
10128         * rootcontext.cs (EmitCode): Call the Emit method on interface
10129         types too.
10130
10131 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
10132
10133         * expression.cs (OverloadResolve): Report error only if Location
10134         is not 'Null' which means that there was a probe going on.
10135
10136 2003-07-14  Martin Baulig  <martin@ximian.com>
10137
10138         * expression.cs (ConditionalLogicalOperator): New public class to
10139         implement user defined conditional logical operators.
10140         This is section 14.11.2 in the spec and bug #40505.
10141
10142 2003-07-14  Martin Baulig  <martin@ximian.com>
10143
10144         * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
10145
10146 2003-07-14  Martin Baulig  <martin@ximian.com>
10147
10148         * codegen.cs (EmitContext.InFixedInitializer): New public field.
10149
10150         * ecore.cs (IVariable.VerifyFixed): New interface method.
10151
10152         * expression.cs (Unary.ResolveOperator): When resolving the `&'
10153         operator, check whether the variable is actually fixed.  Fixes bug
10154         #36055.  Set a variable definitely assigned when taking its
10155         address as required by the spec.
10156
10157         * statement.cs (LocalInfo.IsFixed): New field.
10158         (LocalInfo.MakePinned): Set `IsFixed' to true.
10159
10160 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
10161
10162         * attribute.cs (Attribute.Resolve): While doing a Member lookup
10163         for .ctors, ensure that we only ask for members declared in the
10164         attribute type (BindingFlags.DeclaredOnly).
10165
10166         Fixes bug #43632.
10167
10168         * expression.cs (Error_WrongNumArguments): Report error 1501
10169         correctly the way CSC does.
10170
10171 2003-07-13  Martin Baulig  <martin@ximian.com>
10172
10173         * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
10174         lookup on the fully qualified name, to make things like "X.X" work
10175         where "X.X" is a fully qualified type name, but we also have a
10176         namespace "X" in the using list.  Fixes #41975.
10177
10178 2003-07-13  Martin Baulig  <martin@ximian.com>
10179
10180         * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
10181         function. If we're a CompoundAssign, we need to create an embedded
10182         CompoundAssign, not an embedded Assign.
10183         (Assign.DoResolve): Make this work for embedded CompoundAssign's.
10184         Fixes #45854.
10185
10186 2003-07-13  Martin Baulig  <martin@ximian.com>
10187
10188         * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
10189         work to fix bug #46088.
10190
10191 2003-07-13  Ravi Pratap <ravi@ximian.com>
10192
10193         * class.cs (Operator.Emit): Do not emit attributes here - it is
10194         taken care of by the Method class that we delegate too. This takes
10195         care of bug #45876.
10196
10197 2003-07-10  Martin Baulig  <martin@ximian.com>
10198
10199         * expression.cs (TypeOfVoid): New class.
10200         (TypeOf): Report a CS0673 if it's System.Void.  Fixes #42264.
10201
10202 2003-07-10  Martin Baulig  <martin@ximian.com>
10203
10204         * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
10205         bug #35957.
10206
10207 2003-07-10  Martin Baulig  <martin@ximian.com>
10208
10209         * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
10210         not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
10211
10212         * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
10213
10214         * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
10215
10216 2003-07-10  Martin Baulig  <martin@ximian.com>
10217
10218         * expression.cs (ArrayCreation): Don't use a byte blob for arrays
10219         of decimal.  Fixes #42850.
10220
10221         NOTE: I also fixed the created byte blob, but this doesn't work on
10222         the MS runtime and csc never produces any byte blobs for decimal
10223         arrays.
10224
10225 2003-07-10  Martin Baulig  <martin@ximian.com>
10226
10227         * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
10228         structs; fixes #32068.
10229         (Block.AddChildVariableNames): Fixed #44302.
10230
10231 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10232
10233         * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
10234
10235 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
10236
10237         * attribute.cs: And this test is onger needed.
10238
10239 2003-07-08  Martin Baulig  <martin@ximian.com>
10240
10241         * rootcontext.cs (RootContext.NamespaceLookup): Ignore
10242         inaccessible types.  Fixes #36313.
10243
10244         * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
10245
10246         * namespace.cs (NamespaceEntry): Create implicit entries for all
10247         namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
10248         implicit entries for N1.N2 and N1.
10249
10250 2003-07-08  Martin Baulig  <martin@ximian.com>
10251
10252         Rewrote the handling of namespaces to fix a lot of the issues
10253         wrt. `using' aliases etc.
10254
10255         * namespace.cs (Namespace): Splitted this class into a
10256         per-assembly `Namespace' and a per-file `NamespaceEntry'.
10257
10258         * typemanager.cs (TypeManager.IsNamespace): Removed.
10259         (TypeManager.ComputeNamespaces): Only compute namespaces from
10260         loaded assemblies here, not the namespaces from the assembly we're
10261         currently compiling.
10262
10263 2003-07-08  Martin Baulig  <martin@ximian.com>
10264
10265         * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
10266
10267 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
10268
10269         * typemanager.cs: Reverted patch from Gonzalo, my previous patch
10270         already fixed it.  
10271
10272         I thought about the memory savings here, but LookupTypeReflection
10273         is used under already very constrained scenarios.  Compiling
10274         corlib or mcs only exposes one hit, so it would not really reduce
10275         any memory consumption.
10276
10277 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10278
10279         * typemanager.cs: fixes bug #45889 by only adding public types from
10280         other assemblies to the list of known types.
10281
10282 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
10283
10284         * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
10285         on the type we resolved.
10286
10287 2003-07-05  Martin Baulig  <martin@ximian.com>
10288
10289         * pending.cs (PendingImplementation.ParentImplements): Don't
10290         create the proxy if the parent is abstract.
10291
10292         * class.cs (TypeContainer.DefineIndexers): Process explicit
10293         interface implementations first.  Fixes #37714.
10294
10295 2003-07-04  Miguel de Icaza  <miguel@ximian.com>
10296
10297         * expression.cs (MemberAccess.ResolveMemberAccess): Events are
10298         defined recursively;  but since we modify the input parameters
10299         (left is set to `this' temporarily), we reset this value if the
10300         left_is_explicit is false, which gives the original semantics to
10301         the code.  
10302
10303         * literal.cs (NullPointer): new class used to represent a null
10304         literal in a pointer context.
10305
10306         * convert.cs (Convert.ImplicitReferenceConversion): Is the target
10307         type is a pointer, use a NullPointer object instead of a
10308         NullLiteral.   Closes 43687
10309
10310         (ExplicitConversion): Convert pointer values using
10311         the conv opcode to the proper type.
10312
10313         * ecore.cs (New): change ValueTypeVariable property into a method,
10314         that returns whether the valuetype is suitable for being used.
10315
10316         * expression.cs (Binary.DoNumericPromotions): Only return if we
10317         the int constant was a valid uint, and we can return both left and
10318         right as uints.  If not, we continue processing, to trigger the
10319         type conversion.  This fixes 39018.
10320
10321         * statement.cs (Block.EmitMeta): During constant resolution, set
10322         the CurrentBlock property on the emitcontext, so that we resolve
10323         constants propertly.
10324
10325 2003-07-02  Martin Baulig  <martin@ximian.com>
10326
10327         * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
10328         (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
10329
10330         * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
10331         than emitting it here.
10332
10333         * statement.cs: Fixed some more flow analysis bugs.
10334
10335 2003-07-02  Martin Baulig  <martin@ximian.com>
10336
10337         * class.cs (MethodData.Define): When implementing interface
10338         methods, set Final unless we're Virtual.
10339
10340         * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
10341         check work for interface methods.
10342
10343 2003-07-01  Martin Baulig  <martin@ximian.com>
10344
10345         * ecore.cs (EmitContext.This): Replaced this property with a
10346         GetThis() method which takes a Location argument.  This ensures
10347         that we get the correct error location for a CS0188.
10348
10349 2003-07-01  Miguel de Icaza  <miguel@ximian.com>
10350
10351         * ecore.cs: (Convert.ConvertIntLiteral): Add test for
10352         ImplicitStandardConversion.
10353
10354         * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
10355
10356 2003-07-01  Zoltan Varga  <vargaz@freemail.hu>
10357
10358         * expression.cs (ResolveOperator): Fix Concat (string, string, string)
10359         optimization.
10360
10361 2003-06-30  Miguel de Icaza  <miguel@ximian.com>
10362
10363         * class.cs (Constructor.Define): Turn off initlocals for unsafe
10364         constructors.
10365
10366         (MethodData.Define): Turn off initlocals for unsafe methods.
10367
10368 2003-06-29  Miguel de Icaza  <miguel@ximian.com>
10369
10370         * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
10371         complete;  Fixes #37521.
10372
10373         * delegate.cs: Use Modifiers.TypeAttr to compute the
10374         TypeAttributes, instead of rolling our own.  This makes the flags
10375         correct for the delegates.
10376
10377 2003-06-28  Miguel de Icaza  <miguel@ximian.com>
10378
10379         * class.cs (Constructor.Define): Set the private flag for static
10380         constructors as well.
10381
10382         * cs-parser.jay (statement_expression): Set the return value to
10383         null, to avoid a crash when we catch an error.
10384
10385 2003-06-24  Miguel de Icaza  <miguel@ximian.com>
10386
10387         * cs-parser.jay: Applied patch from Jackson that adds support for
10388         extern and unsafe modifiers to destructor declarations.
10389
10390         * expression.cs: Report error 21 if the user is trying to index a
10391         System.Array.
10392
10393         * driver.cs: Add an error message, suggested by the bug report.
10394
10395         * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
10396         if we do not have a ": this ()" constructor initializer.  Fixes 45149
10397
10398 2003-06-14  Miguel de Icaza  <miguel@ximian.com>
10399
10400         * namespace.cs: Add some information to reduce FAQs.
10401
10402 2003-06-13  Miguel de Icaza  <miguel@ximian.com>
10403
10404         * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
10405         underlying enumeration types.  Fixes #43915.
10406
10407         * expression.cs: Treat ushort/short as legal values to be used in
10408         bitwise operations.
10409
10410 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
10411
10412         * delegate.cs: transfer custom attributes for paramenters from
10413         the delegate declaration to Invoke and BeginInvoke.
10414
10415 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
10416
10417         * attribute.cs: handle custom marshalers and emit marshal info
10418         for fields, too.
10419
10420 2003-05-28  Hector E. Gomez Morales  <hgomez_36@flashmail.com>
10421
10422         * makefile.gnu: Added anonymous.cs to the compiler sources.
10423
10424 2003-05-28  Miguel de Icaza  <miguel@ximian.com>
10425
10426         * iterators.cs: Change the name of the proxy class to include two
10427         underscores.
10428
10429         * cs-parser.jay: Update grammar to include anonymous methods.
10430
10431         * anonymous.cs: new file.
10432
10433 2003-05-27  Miguel de Icaza  <miguel@ximian.com>
10434
10435         * class.cs (Field.Define): Add missing test for pointers and
10436         safety. 
10437
10438 2003-05-27  Ravi Pratap  <ravi@ximian.com>
10439
10440         * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
10441         we use the stobj opcode.
10442
10443         (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
10444         since it wasn't the correct fix. 
10445
10446         It still is puzzling that we are required to use stobj for IntPtr
10447         which seems to be a ValueType.
10448
10449 2003-05-26  Miguel de Icaza  <miguel@ximian.com>
10450
10451         * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
10452         during regular simple name resolution.   Now, the trick is that
10453         instead of returning for processing the simplename, we do a
10454         TypeManager.LookupType (ie, a rooted lookup as opposed to a
10455         contextual lookup type).   If a match is found, return that, if
10456         not, return for further composition.
10457
10458         This fixes long-standing 30485.
10459
10460         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
10461         using the address to initialize an object, do an Stobj instead of
10462         using the regular Stelem.
10463
10464         (IndexerAccess.Emit, IndexerAccess.EmitAssign):
10465         Pass `is_base_indexer' to Invocation.EmitCall instead of false.
10466         Because if we are a BaseIndexerAccess that value will be true.
10467         Fixes 43643.
10468
10469         * statement.cs (GotoCase.Resolve): Return after reporting an
10470         error, do not attempt to continue. 
10471
10472         * expression.cs (PointerArithmetic.Emit): If our operand is a
10473         long, convert our constants to match the operand before
10474         multiplying.  Convert to I type before adding.   Fixes 43670.
10475
10476 2003-05-14  Ravi Pratap  <ravi@ximian.com>
10477
10478         * enum.cs (ImplicitConversionExists) : Rename to
10479         ImplicitEnumConversionExists to remove ambiguity. 
10480
10481         * ecore.cs (NullCast): New type of cast expression class which
10482         basically is very similar to EmptyCast with the difference being
10483         it still is a constant since it is used only to cast a null to
10484         something else
10485         (eg. (string) null)
10486
10487         * convert.cs (ImplicitReferenceConversion): When casting a null
10488         literal, we return a NullCast.
10489
10490         * literal.cs (NullLiteralTyped): Remove - I don't see why this
10491         should be around anymore.
10492
10493         The renaming (reported was slightly wrong). Corrections:
10494
10495         ConvertImplicitStandard -> ImplicitConversionStandard
10496         ConvertExplicitStandard -> ExplicitConversionStandard
10497
10498         * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
10499         before passing them in !
10500
10501         * convert.cs (ImplicitConversionStandard): When comparing for
10502         equal expr and target types, ensure that expr is not a
10503         NullLiteral.
10504
10505         In general, we must not be checking (expr_type ==
10506         target_type) in the top level conversion methods
10507         (ImplicitConversion, ExplicitConversion etc). This checking is
10508         done in the methods that they delegate to.
10509
10510 2003-05-20  Miguel de Icaza  <miguel@ximian.com>
10511
10512         * convert.cs: Move Error_CannotConvertType,
10513         ImplicitReferenceConversion, ImplicitReferenceConversionExists,
10514         ImplicitNumericConversion, ImplicitConversionExists,
10515         ImplicitUserConversionExists, StandardConversionExists,
10516         FindMostEncompassedType, FindMostSpecificSource,
10517         FindMostSpecificTarget, ImplicitUserConversion,
10518         ExplicitUserConversion, GetConversionOperators,
10519         UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
10520         TryImplicitIntConversion, Error_CannotConvertImplicit,
10521         ConvertImplicitRequired, ConvertNumericExplicit,
10522         ExplicitReferenceConversionExists, ConvertReferenceExplicit,
10523         ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
10524         its own file.
10525
10526         Perform the following renames:
10527
10528         StandardConversionExists -> ImplicitStandardConversionExists
10529         ConvertImplicit -> ImplicitConversion
10530         ConvertImplicitStandard -> ImplicitStandardConversion
10531         TryImplicitIntConversion -> ImplicitIntConversion
10532         ConvertImplicitRequired -> ImplicitConversionRequired
10533         ConvertNumericExplicit -> ExplicitNumericConversion
10534         ConvertReferenceExplicit -> ExplicitReferenceConversion
10535         ConvertExplicit -> ExplicitConversion
10536         ConvertExplicitStandard -> ExplicitStandardConversion
10537
10538 2003-05-19  Martin Baulig  <martin@ximian.com>
10539
10540         * statement.cs (TypeInfo.StructInfo): Made this type protected.
10541         (TypeInfo): Added support for structs having structs as fields.
10542
10543         * ecore.cs (FieldExpr): Implement IVariable.
10544         (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
10545         VariableInfo for the field.
10546
10547 2003-05-18  Martin Baulig  <martin@ximian.com>
10548
10549         * expression.cs (This.DoResolve): Report a CS0027 if we're
10550         emitting a field initializer.
10551
10552 2003-05-18  Martin Baulig  <martin@ximian.com>
10553
10554         * expression.cs (This.ResolveBase): New public function.
10555         (This.DoResolve): Check for CS0188.
10556
10557         * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
10558         This.Resolve().
10559
10560         * ecore.cs (MethodGroupExpr.DoResolve): Set the
10561         `instance_expression' to null if we don't have any non-static
10562         methods.
10563
10564 2003-05-18  Martin Baulig  <martin@ximian.com>
10565
10566         Reworked the way how local variables and parameters are handled by
10567         the flow analysis code.
10568
10569         * statement.cs (TypeInfo, VariableMap): New public classes.
10570         (VariableInfo): New public class.  This is now responsible for
10571         checking whether a variable has been assigned.  It is used for
10572         parameters and local variables.
10573         (Block.EmitMeta): Take the InternalParameters as argument; compute
10574         the layout of the flow vectors here.
10575         (Block.LocalMap, Block.ParameterMap): New public properties.
10576         (FlowBranching): The .ctor doesn't get the InternalParameters
10577         anymore since Block.EmitMeta() now computes the layout of the flow
10578         vector.
10579         (MyStructInfo): This class is now known as `StructInfo' and nested
10580         in `TypeInfo'; we don't access this directly anymore.
10581
10582         * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
10583         property and removed IsAssigned(), IsFieldAssigned(),
10584         SetAssigned() and SetFieldAssigned(); we now call them on the
10585         VariableInfo so we don't need to duplicate this code everywhere.
10586
10587         * expression.cs (ParameterReference): Added `Block block' argument
10588         to the .ctor.
10589         (LocalVariableReference, ParameterReference, This): The new
10590         VariableInfo class is now responsible for all the definite
10591         assignment stuff.
10592
10593         * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
10594         IsParameterAssigned, SetParameterAssigned): Removed.
10595
10596 2003-05-18  Martin Baulig  <martin@ximian.com>
10597
10598         * typemanager.cs (InitCoreTypes): Try calling
10599         SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
10600         the 3-args-version.  Corlib now also needs our `void_type'.
10601         (GetMethod): Added overloaded version which takes an optional
10602         `bool report_errors' to allow lookups of optional methods.
10603
10604 2003-05-12  Martin Baulig  <martin@ximian.com>
10605
10606         * statement.cs (VariableInfo): Renamed to LocalInfo since it's
10607         only used for locals and not for parameters.
10608
10609 2003-05-12  Miguel de Icaza  <miguel@ximian.com>
10610
10611         * support.cs (InternalParameters.ParameterType): Return the
10612         ExternalType of the parameter.
10613
10614         * parameter.cs (Parameter.ExternalType): drop the two arguments,
10615         they were unused.
10616
10617 2003-05-11  Miguel de Icaza  <miguel@ximian.com>
10618
10619         * class.cs (MethodData.Define): Do not set the `newslot' on
10620         interface members, if they are also flagged as "override".
10621
10622         * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
10623         better code for ++i and i++.  This only works for static fields
10624         and local variables.
10625
10626         * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
10627         want to pull the DeclSpace out of the builder_to_declspace instead
10628         of the TypeBuilder (like in TypeContainer.FindMembers).
10629
10630         * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
10631         instead of LookupTypeContainer.  Fixes the crash on .NET for
10632         looking up interface members.
10633
10634         * const.cs: Create our own emit context during the Definition
10635         stage, so that constants are evaluated in the proper context, when
10636         a recursive definition happens.
10637
10638 2003-05-11  Martin Baulig  <martin@ximian.com>
10639
10640         * statement.cs (Block.CreateSwitchBlock): New method.  Creates a
10641         new block for a switch section.
10642         (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
10643         the adding/lookup in the switch block.  Fixes #39828.
10644
10645 2003-05-09  Miguel de Icaza  <miguel@ximian.com>
10646
10647         * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
10648         functionality: I needed to convert the data after I had performed
10649         the add/sub operation into the operands type size.
10650
10651         * ecore.cs (ImplicitReferenceConversion): When boxing an interface
10652         pass the type for the box operation, otherwise the resulting
10653         object would have been of type object.
10654
10655         (BoxedCast): Add constructor to specify the type to box as.
10656
10657 2003-05-07  Miguel de Icaza  <miguel@ximian.com>
10658
10659         * iterators.cs: I was reusing the `count' variable inadvertently,
10660         take steps to not allow this to happen.
10661
10662 2003-05-06  Miguel de Icaza  <miguel@ximian.com>
10663
10664         * attribute.cs (Attribute.Resolve): Params attributes are encoded
10665         by creating an array at the point where the params starts and
10666         putting all those arguments there, then adjusting the size of the
10667         array.
10668
10669 2003-05-05  Miguel de Icaza  <miguel@ximian.com>
10670
10671         * expression.cs (New.AddressOf): Implement interface
10672         IMemoryLocation.  This is used when the `new' operator is used in
10673         the context of an invocation to a method on a value type.
10674
10675         See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
10676         example. 
10677
10678         * namespace.cs: Also check the using aliases here.
10679
10680         * driver.cs: Move the test for using validity after the types have
10681         been entered, so we do a single pass that also includes the using
10682         aliases. 
10683
10684         * statement.cs (Try.Resolve): Avoid crashing if there is a failure
10685         in the regular case.   CreateSiblingForFinally is doing extra
10686         error checking.
10687
10688         * attribute.cs (GetAttributeArgumentExpression): Store the result
10689         on an out value, and use the return value to indicate failure
10690         instead of using null (which is a valid return for Constant.GetValue).
10691
10692         * statement.cs: Perform the analysis flow for the increment
10693         portion after the statement, because this will be the real flow of
10694         execution.  Fixes #42385
10695
10696         * codegen.cs (EmitContext.EmitArgument,
10697         EmitContext.EmitStoreArgument): New helper functions when the
10698         RemapToProxy flag is set.
10699
10700         * expression.cs (ParameterReference.EmitLdarg): Expose this useful
10701         function.
10702
10703         Add support for remapping parameters. 
10704
10705         * iterators.cs: Propagate parameter values;  Store parameter
10706         values in the proxy classes.
10707
10708 2003-05-04  Miguel de Icaza  <miguel@ximian.com>
10709
10710         * ecore.cs (FieldExpr): Fix an obvious bug.  static fields do not
10711         need a proxy reference;  I do not know what I was thinking
10712
10713         * cs-parser.jay (constructor_initializer): catch another error,
10714         and display nice message.
10715
10716         (field_declaration): catch void field declaration
10717         to flag a better error. 
10718
10719         * class.cs (MemberBase.CheckBase): Report an error instead of a
10720         warning if a new protected member is declared in a struct. 
10721         (Field.Define): catch the error of readonly/volatile.
10722
10723         * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
10724
10725         (FieldExpr.AddressOf): ditto.  Catch error where the address of a
10726         volatile variable is taken
10727
10728 2003-05-02  Miguel de Icaza  <miguel@ximian.com>
10729
10730         * statement.cs (Fixed.Resolve): Report an error if we are not in
10731         an unsafe context.
10732
10733 2003-05-01  Miguel de Icaza  <miguel@ximian.com>
10734
10735         * typemanager.cs: reuse the code that handles type clashes for
10736         delegates and enumerations.
10737
10738         * class.cs (Report28): Always report.
10739
10740         * expression.cs (EncodeAsAttribute): Allow nulls here.
10741
10742 2003-04-28  Miguel de Icaza  <miguel@ximian.com>
10743
10744         * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
10745         the functionality for testing whether an expression is valid for
10746         an attribute here.  Also handle the case of arrays of elements
10747         being stored. 
10748
10749         * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
10750         encoding a linear array into an array of objects that are suitable
10751         to be passed to an CustomAttributeBuilder.
10752
10753         * delegate.cs: Check unsafe types being used outside of an Unsafe context.
10754
10755         * ecore.cs: (FieldExpr): Handle field remapping here.
10756
10757         * iteratators.cs: Pass the instance variable (if the method is an
10758         instance method) to the constructors, so we can access the field
10759         variables on the class.
10760
10761         TODO: Test this with structs.  I think the THIS variable on
10762         structs might have to be a pointer, and not a refenrece
10763
10764 2003-04-27  Miguel de Icaza  <miguel@ximian.com>
10765
10766         * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
10767         local variables to fields in a proxy class.
10768
10769         * iterators.cs (PopulateProxy): Rename our internal fields to
10770         <XXX>.  
10771         Create a <THIS> field if we are an instance method, so we can
10772         reference our parent container variables.
10773         (MapVariable): Called back from the EmitContext code to enter a
10774         new variable to field mapping into the proxy class (we just create
10775         a FieldBuilder).
10776
10777         * expression.cs
10778         (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
10779         for using the remapped locals to fields.
10780
10781         I placed the code here, because that gives the same semantics to
10782         local variables, and only changes the Emit code.
10783
10784         * statement.cs (Fixed.Resolve): it is not allowed to have fixed
10785         statements inside iterators.
10786         (VariableInfo): Add a FieldBuilder for the cases when we are
10787         remapping local variables to fields in a proxy class
10788
10789         * ecore.cs (SimpleNameResolve): Avoid testing two times for
10790         current_block != null.
10791
10792         * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
10793         not cope with strings, as it has been moved to the
10794         TableSwitchEmit.  Fixed bug in switch generation.
10795
10796         * expression.cs (New.DoResolve): Provide more context for the user
10797         when reporting an error.
10798
10799         * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
10800         pointers. 
10801
10802         * expression.cs (MemberAccess.DoResolve): When we get a type back,
10803         check the permissions for it.  Note than in a type-resolution
10804         context the check was already present in DeclSpace.ResolveType,
10805         but was missing from the MemberAccess.
10806
10807         (ArrayCreation.CheckIndices): warn if the user has
10808         more nested levels of expressions, but there are no more
10809         dimensions specified.  Avoids crash on bug 41906.
10810
10811 2003-04-26  Miguel de Icaza  <miguel@ximian.com>
10812
10813         * statement.cs (Block): replace Implicit bool, for a generic
10814         flags.   
10815         New flag: `Unchecked'.  This is used during the EmitMeta phase
10816         (which is out-of-line with the regular Resolve/Emit process for a
10817         statement, as this is done ahead of time, but still gets a chance
10818         to call constant resolve).
10819
10820         (Block.Flags): new enum for adding a new flag.
10821
10822         (Block.EmitMeta): track the state of unchecked.
10823
10824         (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
10825         to enable constant resolution to work there as well.
10826
10827 2003-04-22  Miguel de Icaza  <miguel@ximian.com>
10828
10829         * typemanager.cs (ienumerable_type): Also look up
10830         System.Collections.IEnumerable. 
10831
10832 2003-04-21  Miguel de Icaza  <miguel@ximian.com>
10833
10834         TODO: Test more than one conditional per method.
10835
10836         * class.cs (Indexer.Define): Report the location where the user is
10837         referencing the unsupported feature.
10838
10839         (MethodData): Overload the use of `conditionals' to
10840         minimize the creation of needless ArrayLists.   This saves roughly
10841         212kb on my machine.
10842
10843         (Method): Implement the new IIteratorContainer interface.
10844         (Method.SetYields): Implement the method by setting the ModFlags
10845         to contain METHOD_YIELDS.
10846
10847         * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
10848         which just got set to null.
10849
10850         * iterators.cs: New file.
10851
10852         (Yield, YieldBreak): New statements.
10853
10854         * statement.cs (Return.Resolve): Flag an error if we are used in
10855         an iterator method.
10856
10857         * codegen.cs (InIterator): New flag set if the code is being
10858         compiled in an iterator method.
10859
10860         * modifiers.cs: New flag METHOD_YIELDS.  This modifier is an
10861         internal modifier, and we just use it to avoid adding extra
10862         fields, as this is seldom used.  
10863
10864         * cs-parser.jay: Add yield_statement (yield and yield break).
10865
10866         * driver.cs: New flag -v2 to turn on version 2 features. 
10867
10868         * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
10869         hashtable when v2 is enabled.
10870
10871 2003-04-20  Miguel de Icaza  <miguel@ximian.com>
10872
10873         * typemanager.cs (TypeManager.NamespaceClash): Use to check if
10874         there is already a namespace defined with this name.
10875
10876         (TypeManager.InitCoreTypes): Remove the temporary workaround, as
10877         people upgraded their corlibs.
10878
10879         (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
10880         always use fully qualified types, no need to use the compiler
10881         front end.
10882
10883         (TypeManager.IsNamespace): Use binarysearch.
10884
10885         * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
10886         AddDelegate): I did not quite use the new IsValid API properly: I
10887         have to pass the short-name and the fullname.  I was passing only
10888         the basename instead of the fullname sometimes. 
10889
10890         (TypeContainer.DefineType): call NamespaceClash.
10891
10892         * interface.cs (Interface.DefineType): use NamespaceClash before
10893         defining the type.
10894
10895         * delegate.cs (Delegate.DefineType): use NamespaceClash before
10896         defining the type.
10897
10898         * enum.cs: (Enum.DefineType): use NamespaceClash before
10899         defining the type.
10900
10901         * typemanager.cs (: 3-line patch that gives us some tasty 11%
10902         speed increase.  First, use the negative_hits cache when we get a
10903         negative.  Second, add the type with its full original name
10904         instead of the new . and + encoded name (reflection uses + to
10905         separate type from a nested type).  Use LookupTypeReflection
10906         directly which bypasses the type->name hashtable (that we already
10907         know does not contain the type.
10908
10909         * decl.cs (DeclSpace.ResolveTypeExpr): track the
10910         location/container type. 
10911
10912         * driver.cs: When passing utf8, use directly the UTF8Encoding.
10913
10914 2003-04-19  Miguel de Icaza  <miguel@ximian.com>
10915
10916         * decl.cs (ResolveTypeExpr): Mirror check acess here too.
10917
10918         * delegate.cs (NewDelegate.Resolve): Test whether an instance
10919         method is being referenced in the method group from a static
10920         context, and report error 120 if so.
10921
10922         * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
10923         Error118. 
10924
10925         * typemanager.cs: Add intermediate namespaces (if a namespace A.B
10926         is created, we create the A namespace).
10927
10928         * cs-parser.jay: A namespace also introduces a DeclarationFound.
10929         Fixes #41591
10930
10931 2003-04-18  Miguel de Icaza  <miguel@ximian.com>
10932
10933         * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
10934         invocation to ModuleBuilder.GetType with the same values will
10935         return a new type instance, so we need to cache its return
10936         values. 
10937
10938         * expression.cs (Binary.ResolveOperator): Only allow the compare
10939         operators on enums if they are of the same type.
10940
10941         * ecore.cs (Expression.ImplicitReferenceConversion): handle target
10942         types of ValueType on their own case.  Before we were giving them
10943         the same treatment as objects.
10944
10945         * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
10946         fullname.  Short name is used to compare against container name.
10947         Fullname is used to check against defined namespace names.
10948
10949         * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
10950         AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
10951
10952         (Method.CheckBase): Call parent.
10953         (MemberBase.CheckBase): Check for protected members on sealed
10954         classes.
10955         (PropertyBase.CheckBase): Call parent.
10956         (Field.Define): Call parent.
10957
10958         * report.cs: Negative error codes are now mapped to 8000 - code,
10959         so that the display is render more nicely.
10960
10961         * typemanager.cs: Do not use try/catch, instead report a regular
10962         error. 
10963
10964         (GetPointerType, GetReferenceType): These methods provide
10965         mechanisms to obtain the T* and T& from a T.  We had the code
10966         previously scattered around the code base, and it also used
10967         TypeManager.LookupType that would go through plenty of caches.
10968         This one goes directly to the type source.
10969
10970         In some places we did the Type.GetType followed by
10971         ModuleBuilder.GetType, but not in others, so this unifies the
10972         processing as well.
10973
10974         * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
10975         statements now that we have namespace information.
10976
10977         * typemanager.cs (IsNamespace): New method, returns whether the
10978         string presented is a namespace or not.
10979
10980         (ComputeNamespaces): New public entry point, computes the list of
10981         available namespaces, using the GetNamespaces API call in Mono, or
10982         the slower version in MS.NET.   
10983
10984         Now before we start the semantic analysis phase, we have a
10985         complete list of namespaces including everything that the user has
10986         provided.
10987
10988         Deleted old code to cache namespaces in .nsc files.
10989
10990 2003-04-17  Miguel de Icaza  <miguel@ximian.com>
10991
10992         * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
10993         class/struct location definition Location for the implicit
10994         constructor location.
10995
10996         (Operator.Define): Use the location of the operator for the
10997         implicit Method definition.
10998
10999         (Constructor.Emit): use the constructor location for the implicit
11000         base initializer constructor.
11001
11002         * ecore.cs: Remove ITypeExpression.  This interface is now gone,
11003         and the Expression class now contains two new methods:
11004
11005         ResolveAsTypeStep and ResolveAsTypeTerminal.  This is used to
11006         isolate type lookup from the rest of the resolution process.
11007
11008         Since we use Expressions to hold type definitions due to the way
11009         we parse the input we have historically overloaded Resolve to
11010         perform the Type lookups if a special flag is passed.  Now this is
11011         eliminated and two methods take their place. 
11012
11013         The differences in the two methods between xStep and xTerminal is
11014         that xStep is involved in our current lookup system that uses
11015         SimpleNames to compose a name, while xTerminal is used just to
11016         catch the case where the simplename lookup failed.
11017
11018 2003-04-16  Miguel de Icaza  <miguel@ximian.com>
11019
11020         * expression.cs (ResolveMemberAccess): Remove redundant code.
11021         TypeExpr expressions are always born fully resolved.
11022
11023         * interface.cs (PopulateMethod): Do not lookup the types twice.
11024         We were doing it once during SemanticAnalysis and once during
11025         PopulateMethod.
11026
11027         * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
11028         in local variable type definitions, were being returned as a
11029         SimpleName (we decomposed everything into a string), that is
11030         because primary_expression was being used instead of a type in the
11031         grammar (reduce/reduce conflicts).
11032
11033         The part that was wrong is that we converted the expression into a
11034         string (an oversimplification in one hand, compounded with primary
11035         expressions doing string concatenation).
11036
11037         So things like:
11038
11039         A.B.C [] x;
11040
11041         Would return "A.B.C[]" as a SimpleName.  This stopped things like
11042         using clauses from working on this particular context.  And a type
11043         was being matched directly against "A.B.C[]".
11044
11045         We now use the correct approach, and allow for ComposedCast to be
11046         part of the unary expression.  So the "A.B.C []" become a composed
11047         cast of "A.B.C" (as a nested group of MemberAccess with a
11048         SimpleName at the end) plus the rank composition "[]". 
11049
11050         Also fixes 35567
11051
11052 2003-04-10  Miguel de Icaza  <miguel@ximian.com>
11053
11054         * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
11055         for the access level checking.
11056
11057         * class.cs: Cosmetic changes.  Renamed `TypeContainer parent' to
11058         `TypeContainer container', because I kept getting confused when I
11059         was debugging this code.
11060
11061         * expression.cs (Indexers): Instead of tracking getters/setters,
11062         we now track them in parallel.  We create one arraylist less, but
11063         most importantly it is possible now for the LValue code to find a
11064         matching get for a set.
11065
11066         (IndexerAccess.DoResolveLValue): Update the code.
11067         GetIndexersForType has been modified already to extract all the
11068         indexers from a type.  The code assumed it did not.
11069
11070         Also make the code set the correct return type for the indexer.
11071         This was fixed a long time ago for properties, but was missing for
11072         indexers.  It used to be void_type.
11073
11074         (Binary.Emit): Test first for doubles instead of
11075         floats, as they are more common.
11076
11077         (Binary.EmitBranchable): Use the .un version of the branch opcodes
11078         when dealing with floats and the <=, >= operators.  This fixes bug
11079         #39314 
11080
11081         * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
11082         to load the array value by emitting a load on the foreach variable
11083         type.  This was incorrect.  
11084
11085         We now emit the code to load an element using the the array
11086         variable type, and then we emit the conversion operator.
11087
11088         Fixed #40176
11089
11090 2003-04-10  Zoltan Varga  <vargaz@freemail.hu>
11091
11092         * attribute.cs: Avoid allocation of ArrayLists in the common case.
11093
11094 2003-04-09  Miguel de Icaza  <miguel@ximian.com>
11095
11096         * class.cs (MethodSignature.InheritableMemberSignatureCompare):
11097         test for protection before we test for signatures. 
11098
11099         (MethodSignature.ToString): implement.
11100
11101         * expression.cs (Unary.TryReduceNegative): Add missing minus sign
11102         to the case where we reduced into a LongConstant.
11103
11104         * decl.cs (CheckAccessLevel): If the type is an array, we can not
11105         depend on whether the information is acurrate, because the
11106         Microsoft runtime will always claim that the array type is public,
11107         regardless of the real state.
11108
11109         If the type is a pointer, another problem happens: the type is
11110         reported as non-public in Microsoft.  
11111
11112         In both cases we have to call CheckAccessLevel recursively with
11113         the underlying type as the argument to be tested.
11114
11115 2003-04-08  Miguel de Icaza  <miguel@ximian.com>
11116
11117         * assign.cs (Assign.Emit): If we are dealing with a compound
11118         assignment expression, we should use the code path that stores the
11119         intermediate result in a temporary value.  This fixes #40903.
11120
11121         *expression.cs (Indirection.ToString): Provide ToString method for
11122         debugging. 
11123
11124 2003-04-08  Zoltan Varga  <vargaz@freemail.hu>
11125
11126         * class.cs: Null out fields holding references to Block objects so
11127         they can be garbage collected.
11128
11129         * expression.cs (OverloadResolve): Remove unused local.
11130
11131 2003-04-07  Martin Baulig  <martin@ximian.com>
11132
11133         * codegen.cs (EmitContext.CurrentFile): New public field.
11134         (EmitContext.Mark): Use the CurrentFile to check whether the
11135         location is in the correct file.
11136         (EmitContext.EmitTopBlock): Initialize CurrentFile here.
11137
11138 2003-04-07  Martin Baulig  <martin@ximian.com>
11139
11140         * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
11141
11142         * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
11143         location.  [FIXME: The location argument which gets passed to this
11144         method is sometimes wrong!]
11145
11146 2003-04-07  Nick Drochak <ndrochak@gol.com>
11147
11148         * codegen.cs: Be more verbose when we can't find the symbol writer dll.
11149
11150 2003-04-07  Miguel de Icaza  <miguel@ximian.com>
11151
11152         * expression.cs (Indirection.EmitAssign): We were using the
11153         temporary, but returning immediately instead of continuing the
11154         EmitAssing flow.
11155
11156 2003-04-06  Martin Baulig  <martin@ximian.com>
11157
11158         * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
11159         if it's a nested child, but also deriving from the outer class.
11160         See test 190.cs.
11161
11162         * typemanager.cs (IsNestedChildOf): Make this work if it's a
11163         nested child, but also deriving from the outer class.  See
11164         test-190.cs.
11165         (FilterWithClosure): We may access private members of the outer
11166         class if we're a nested child and deriving from the outer class.
11167         (RealMemberLookup): Only set `closure_private_ok' if the
11168         `original_bf' contained BindingFlags.NonPublic.
11169
11170 2003-04-05  Martin Baulig  <martin@ximian.com>
11171
11172         * expression.cs (SizeOf.DoResolve): Use ResolveTypeExpr, so we can
11173         probe if its a type parameter, and if so, flag an error.
11174
11175         * decl.cs: Move here the SetParameterInfo code from class.cs.
11176         Handle IsGeneric here.
11177
11178         Handle a variety of errors in the parameter info definition.
11179
11180         * ecore.cs (SimpleName.DoResolveType): Handle look ups for generic
11181         type parameters here.
11182
11183         * cs-parser.jay (class_declaration): report errors for parameters
11184         here as well.
11185
11186 2003-01-21  Miguel de Icaza  <miguel@ximian.com>
11187
11188         * generic.cs: New file, contains support code for generics.
11189
11190         * cs-parser.jay: Remove OP_SHIFT_LEFT, OP_SHIFT_RIGHT,
11191         OP_SHIFT_LEFT_ASSIGN, OP_SHIFT_RIGHT_ASSIGN.
11192
11193         Update parser for the above removals.
11194
11195         * cs-tokenizer.cs: Do not handle <<= or >>= specially.  This is
11196         now taken care of in the parser.
11197
11198 2003-04-02  Miguel de Icaza  <miguel@ximian.com>
11199
11200         * class.cs (Event.Define): Do not allow abstract events to have
11201         initializers. 
11202
11203 2003-04-01  Miguel de Icaza  <miguel@ximian.com>
11204
11205         * cs-parser.jay: Add error productions for ADD/REMOVE missing a
11206         block in event declarations.
11207
11208         * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
11209         value type, get its address.
11210
11211         * expression.cs (Is.Emit): For action `LeaveOnStack' we were
11212         leaving a class on the stack instead of a boolean value (int
11213         0/1).  Change the code so we compare against null, and then the
11214         result against zero.
11215
11216         * class.cs (TypeContainer.GetClassBases): We were checking for the
11217         parent class being sealed too late.
11218
11219         * expression.cs (Binary.Emit): For <= and >= when dealing with
11220         floating point values, use cgt.un and clt.un instead of cgt and
11221         clt alone.
11222
11223 2003-04-01  Zoltan Varga  <vargaz@freemail.hu>
11224
11225         * statement.cs: Apply the same optimization as MS: skip the 
11226         GetEnumerator returning an IEnumerator, and use the one returning a 
11227         CharEnumerator instead. This allows us to avoid the try-finally block 
11228         and the boxing.
11229
11230 2003-03-31  Gaurav Vaish <gvaish_mono@lycos.com>
11231
11232         * cs-parser.jay: Attributes cannot be applied to
11233                          namespaces. Fixes #40473
11234
11235 2003-03-31  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11236
11237         * class.cs:
11238         (Add*): check if the name is valid using the full name for constants,
11239         fields, properties and events.
11240
11241 2003-03-28  Miguel de Icaza  <miguel@ximian.com>
11242
11243         * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
11244         char constants to be part of the enumeration.
11245
11246         * expression.cs (Conditional.DoResolve): Add support for operator
11247         true. Implements the missing functionality from 14.12
11248
11249         * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
11250         operator true/false as required by the spec.
11251
11252         * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
11253         implicit conversion to boolean.
11254
11255         * statement.cs (Statement.ResolveBoolean): A boolean expression is
11256         also one where the type implements `operator true'. 
11257
11258         * ecore.cs (Expression.GetOperatorTrue): New helper routine to
11259         get an expression that will invoke operator true based on an
11260         expression.  
11261
11262         (GetConversionOperators): Removed the hack that called op_True
11263         here.  
11264
11265         (Expression.ResolveBoolean): Move this from Statement.
11266
11267 2003-03-17  Miguel de Icaza  <miguel@ximian.com>
11268
11269         * ecore.cs (FieldExpr): do not allow initialization of initonly
11270         fields on derived classes
11271
11272 2003-03-13  Martin Baulig  <martin@ximian.com>
11273
11274         * statement.cs (Block.Emit): Call ig.BeginScope() and
11275         ig.EndScope() when compiling with debugging info; call
11276         LocalBuilder.SetLocalSymInfo _after_ opening the scope.
11277
11278 2003-03-08  Miguel de Icaza  <miguel@ximian.com>
11279
11280         * expression.cs (Indexers): Do not construct immediately, allow
11281         for new members to be appended as we go.  Fixes 38143
11282
11283 2003-03-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11284
11285         * expression.cs: save/restore context when resolving an unchecked
11286         expression.
11287
11288 2003-03-05  Miguel de Icaza  <miguel@ximian.com>
11289
11290         * cfold.cs: Catch division by zero in modulus operator during
11291         constant folding.
11292
11293 2003-03-03  Miguel de Icaza  <miguel@ximian.com>
11294
11295         * interface.cs (Interface.DefineMembers): Avoid defining members
11296         twice. 
11297
11298 2003-02-27  Miguel de Icaza  <miguel@ximian.com>
11299
11300         * driver.cs: handle the +/- options for -noconfig
11301
11302         * statement.cs (Unckeched.Resolve): Also track the state of
11303         unchecked in the Resolve phase.
11304
11305 2003-02-27  Martin Baulig  <martin@ximian.com>
11306
11307         * ecore.cs (Expression.MemberLookup): Don't create a
11308         MethodGroupExpr for something which is not a method.  Fixes #38291.
11309
11310 2003-02-25  Miguel de Icaza  <miguel@ximian.com>
11311
11312         * class.cs (MemberBase.CheckParameters): Also check that the type
11313         is unmanaged if it is a pointer.
11314
11315         * expression.cs (SizeOf.Resolve): Add location information.
11316
11317         * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
11318         a managed type is declared.
11319
11320         * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
11321         parameter modifiers as well.  Fixes bug 38606
11322
11323         * class.cs: Very sad.  Am backing out the speed up changes
11324         introduced by the ArrayList -> Array in the TypeContainer, as they
11325         were not actually that much faster, and introduced a bug (no error
11326         reports on duplicated methods).
11327
11328         * assign.cs (CompoundAssign.DoLResolve): Resolve the original
11329         source first, this will guarantee that we have a valid expression
11330         before calling in lower levels functions that will require a
11331         resolved object.  Then use this original_source in the
11332         target.ResolveLValue instead of the original source that was
11333         passed to us.
11334
11335         Another change.  Use target.Resolve instead of LValueResolve.
11336         Although we are resolving for LValues, we will let the Assign code
11337         take care of that (it will be called again from Resolve).  This
11338         basically allows code like this:
11339
11340         class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
11341         class Y { void A (X x) { x [0] += o; }
11342
11343         The problem was that the indexer was trying to resolve for
11344         set_Item (idx, object o) and never finding one.  The real set_Item
11345         was set_Item (idx, X).  By delaying the process we get the right
11346         semantics. 
11347
11348         Fixes bug 36505
11349
11350 2003-02-23  Martin Baulig  <martin@ximian.com>
11351
11352         * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
11353         while calling DoEmit ().
11354
11355         * codegen.cs (EmitContext.Mark): Don't mark locations in other
11356         source files; if you use the #line directive inside a method, the
11357         compiler stops emitting line numbers for the debugger until it
11358         reaches the end of the method or another #line directive which
11359         restores the original file.
11360
11361 2003-02-23  Martin Baulig  <martin@ximian.com>
11362
11363         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
11364
11365 2003-02-23  Martin Baulig  <martin@ximian.com>
11366
11367         * statement.cs (Block.AddChildVariableNames): We need to call this
11368         recursively, not just for our immediate children.
11369
11370 2003-02-23  Martin Baulig  <martin@ximian.com>
11371
11372         * class.cs (Event.Define): Always make the field private, like csc does.
11373
11374         * typemanager.cs (TypeManager.RealMemberLookup): Make events
11375         actually work, fixes bug #37521.
11376
11377 2003-02-23  Miguel de Icaza  <miguel@ximian.com>
11378
11379         * delegate.cs: When creating the various temporary "Parameters"
11380         classes, make sure that we call the ComputeAndDefineParameterTypes
11381         on those new parameters (just like we do with the formal ones), to
11382         allow them to be resolved in the context of the DeclSpace.
11383
11384         This fixes the bug that Dick observed in Bugzilla #38530.
11385
11386 2003-02-22  Miguel de Icaza  <miguel@ximian.com>
11387
11388         * expression.cs (ResolveMemberAccess): When resolving a constant,
11389         do not attempt to pull a constant if the value was not able to
11390         generate a valid constant.
11391
11392         * const.cs (LookupConstantValue): Do not report more errors than required.
11393
11394 2003-02-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11395
11396         * expression.cs: fixes bug #38328.
11397
11398 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
11399
11400         * class.cs: Changed all the various members that can be part of a
11401         class from being an ArrayList to be an Array of the right type.
11402         During the DefineType type_list, interface_list, delegate_list and
11403         enum_list are turned into types, interfaces, delegates and enums
11404         arrays.  
11405
11406         And during the member population, indexer_list, event_list,
11407         constant_list, field_list, instance_constructor_list, method_list,
11408         operator_list and property_list are turned into their real arrays.
11409
11410         Although we could probably perform this operation earlier, for
11411         good error reporting we need to keep the lists and remove the
11412         lists for longer than required.
11413
11414         This optimization was triggered by Paolo profiling the compiler
11415         speed on the output of `gen-sample-program.pl' perl script. 
11416
11417         * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
11418         not crash in methods like MemberLookupFailed that use this field.  
11419
11420         This problem arises when the compiler fails to resolve a type
11421         during interface type definition for example.
11422
11423 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
11424
11425         * expression.cs (Indexers.GetIndexersForType): Interfaces do not
11426         inherit from System.Object, so we have to stop at null, not only
11427         when reaching System.Object.
11428
11429 2003-02-17  Miguel de Icaza  <miguel@ximian.com>
11430
11431         * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
11432         DeclaredOnly because the parent indexer might have had a different
11433         name, but did not loop until the top of the hierarchy was reached.
11434
11435         The problem this one fixes is 35492: when a class implemented an
11436         indexer from an interface, we were getting the interface method
11437         (which was abstract) and we were flagging an error (can not invoke
11438         abstract method).
11439
11440         This also keeps bug 33089 functioning, and test-148 functioning.
11441
11442         * typemanager.cs (IsSpecialMethod): The correct way of figuring
11443         out if a method is special is to see if it is declared in a
11444         property or event, or whether it is one of the predefined operator
11445         names.   This should fix correctly #36804.
11446
11447 2003-02-15  Miguel de Icaza  <miguel@ximian.com>
11448
11449         The goal here is to remove the dependency on EmptyCast.Peel ().
11450         Killing it completely.
11451
11452         The problem is that currently in a number of places where
11453         constants are expected, we have to "probe" for an EmptyCast, and
11454         Peel, which is not the correct thing to do, as this will be
11455         repetitive and will likely lead to errors. 
11456
11457         The idea is to remove any EmptyCasts that are used in casts that
11458         can be reduced to constants, so we only have to cope with
11459         constants. 
11460
11461         This bug hunt was triggered by Bug 37363 and the desire to remove
11462         the duplicate pattern where we were "peeling" emptycasts to check
11463         whether they were constants.  Now constants will always be
11464         constants.
11465
11466         * ecore.cs: Use an enumconstant here instead of wrapping with
11467         EmptyCast.  
11468
11469         * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
11470         throwing me off.  By handling this we can get rid of a few hacks.
11471
11472         * statement.cs (Switch): Removed Peel() code.
11473
11474 2003-02-14  Miguel de Icaza  <miguel@ximian.com>
11475
11476         * class.cs: Location information for error 508
11477
11478         * expression.cs (New.DoResolve): Add a guard against double
11479         resolution of an expression.  
11480
11481         The New DoResolve might be called twice when initializing field
11482         expressions (see EmitFieldInitializers, the call to
11483         GetInitializerExpression will perform a resolve on the expression,
11484         and later the assign will trigger another resolution
11485
11486         This leads to bugs (#37014)
11487
11488         * delegate.cs: The signature for EndInvoke should contain any ref
11489         or out parameters as well.  We were not doing this in the past. 
11490
11491         * class.cs (Field.Define): Do not overwrite the type definition
11492         inside the `volatile' group.  Turns out that volatile enumerations
11493         were changing the type here to perform a validity test, which
11494         broke conversions. 
11495
11496 2003-02-12  Miguel de Icaza  <miguel@ximian.com>
11497
11498         * ecore.cs (FieldExpr.AddressOf): In the particular case of This
11499         and structs, we do not want to load the instance variable
11500
11501         (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
11502         enum_type has to be handled like an object reference (implicit
11503         conversions exists from this to object), but the regular IsClass
11504         and IsValueType tests will never return true for this one.
11505
11506         Also we use TypeManager.IsValueType instead of type.IsValueType,
11507         just for consistency with the rest of the code (this is only
11508         needed if we ever use the construct exposed by test-180.cs inside
11509         corlib, which we dont today).
11510
11511 2003-02-12  Zoltan Varga  <vargaz@freemail.hu>
11512
11513         * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
11514         just InternalCall.
11515
11516 2003-02-09  Martin Baulig  <martin@ximian.com>
11517
11518         * namespace.cs (Namespace..ctor): Added SourceFile argument.
11519         (Namespace.DefineNamespaces): New static public method; this is
11520         called when we're compiling with debugging to add all namespaces
11521         to the symbol file.
11522
11523         * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
11524         pass it to the Namespace's .ctor.
11525
11526         * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
11527         and MethodBase arguments; pass the namespace ID to the symwriter;
11528         pass the MethodBase instead of the token to the symwriter.
11529         (SymbolWriter.DefineNamespace): New method to add a namespace to
11530         the symbol file.
11531
11532 2003-02-09  Martin Baulig  <martin@ximian.com>
11533
11534         * symbolwriter.cs: New file.  This is a wrapper around
11535         ISymbolWriter with a cleaner API.  We'll dynamically Invoke()
11536         methods here in near future.
11537
11538 2003-02-09  Martin Baulig  <martin@ximian.com>
11539
11540         * codegen.cs (EmitContext.Mark): Just pass the arguments to
11541         ILGenerator.MarkSequencePoint() which are actually used by the
11542         symbol writer.
11543
11544 2003-02-09  Martin Baulig  <martin@ximian.com>
11545
11546         * location.cs (SourceFile): New public sealed class.  This
11547         contains the name and an index which is used in the location's token.
11548         (Location): Reserve an appropriate number of bits in the token for
11549         the source file instead of walking over that list, this gives us a
11550         really huge performance improvement when compiling with debugging.
11551
11552         * driver.cs (Driver.parse, Driver.tokenize_file): Take a
11553         `SourceFile' argument instead of a string.
11554         (Driver.ProcessFile): Add all the files via Location.AddFile(),
11555         but don't parse/tokenize here, we need to generate the list of all
11556         source files before we do that.
11557         (Driver.ProcessFiles): New static function.  Parses/tokenizes all
11558         the files.
11559
11560         * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
11561         instead of a string.
11562
11563         * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
11564         of a string.
11565
11566 2003-02-09  Martin Baulig  <martin@ximian.com>
11567
11568         * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
11569         filename on `#line default'.
11570
11571 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
11572
11573         * statement.cs: don't clear the pinned var when the fixed statement
11574         returns from the method (fixes bug#37752).
11575
11576 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
11577
11578         * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban) 
11579         to IsValueType.
11580
11581 2003-02-07  Martin Baulig  <martin@ximian.com>
11582
11583         * driver.cs: Removed the `--debug-args' command line argument.
11584
11585         * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
11586         automatically by the AsssemblyBuilder.
11587         (CodeGen.InitializeSymbolWriter): We don't need to call any
11588         initialization function on the symbol writer anymore.  This method
11589         doesn't take any arguments.
11590
11591 2003-02-03  Miguel de Icaza  <miguel@ximian.com>
11592
11593         * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
11594         from referenced assemblies as well.
11595
11596 2003-02-02  Martin Baulig  <martin@ximian.com>
11597
11598         * class.cs (MethodData.Emit): Generate debugging info for external methods.
11599
11600 2003-02-02  Martin Baulig  <martin@ximian.com>
11601
11602         * class.cs (Constructor.Emit): Open the symbol writer before
11603         emitting the constructor initializer.
11604         (ConstructorInitializer.Emit): Call ec.Mark() to allow
11605         single-stepping through constructor initializers.
11606
11607 2003-01-30  Miguel de Icaza  <miguel@ximian.com>
11608
11609         * class.cs: Handle error 549: do not allow virtual methods in
11610         sealed classes. 
11611
11612 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
11613
11614         * decl.cs: Check access levels when resolving types
11615
11616 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
11617
11618         * statement.cs: Add parameters and locals set in catch blocks that might 
11619         return to set vector
11620
11621 2003-01-29  Miguel de Icaza  <miguel@ximian.com>
11622
11623         * class.cs (Operator): Set the SpecialName flags for operators.
11624
11625         * expression.cs (Invocation.DoResolve): Only block calls to
11626         accessors and operators on SpecialName methods.
11627
11628         (Cast.TryReduce): Handle conversions from char constants.
11629
11630
11631 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
11632
11633         * statement.cs: small memory and time optimization in FlowBranching.
11634
11635 2003-01-28  Pedro Mart  <yoros@wanadoo.es>
11636
11637         * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
11638         problem that the last fix but in the other sid (Set).
11639
11640         * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
11641         access when there is no indexer in the hierarchy.
11642
11643 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
11644
11645         * class.cs: Combine some if statements.
11646
11647 2003-01-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11648
11649         * driver.cs: fixed bug #37187.
11650
11651 2003-01-27  Pedro Martinez Juliá  <yoros@wanadoo.es>
11652
11653         * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
11654         any indexer, it's needed to build a list with all the indexers in the
11655         hierarchy (AllGetters), else we have problems. Fixes #35653.
11656
11657 2003-01-23  Miguel de Icaza  <miguel@ximian.com>
11658
11659         * class.cs (MethodData.Define): It is wrong for an interface
11660         implementation to be static in both cases: explicit and implicit.
11661         We were only handling this in one case.
11662
11663         Improve the if situation there to not have negations.
11664
11665         * class.cs (Field.Define): Turns out that we do not need to check
11666         the unsafe bit on field definition, only on usage.  Remove the test.
11667
11668 2003-01-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11669
11670         * driver.cs: use assembly.Location instead of Codebase (the latest
11671         patch made mcs fail when using MS assemblies).
11672
11673 2003-01-21  Tim Haynes <thaynes@openlinksw.com>
11674
11675         * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
11676         get the path to *corlib.dll.
11677
11678 2003-01-21  Nick Drochak <ndrochak@gol.com>
11679
11680         * cs-tokenizer.cs:
11681         * pending.cs:
11682         * typemanager.cs: Remove compiler warnings
11683
11684 2003-01-20  Duncan Mak  <duncan@ximian.com>
11685
11686         * AssemblyInfo.cs: Bump the version number to 0.19.
11687
11688 2003-01-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11689
11690         * cs-tokenizer.cs: little fixes to line numbering when #line is used.
11691
11692 2003-01-18  Zoltan Varga  <vargaz@freemail.hu>
11693
11694         * class.cs (Constructor::Emit): Emit debugging info for constructors.
11695
11696 2003-01-17  Miguel de Icaza  <miguel@ximian.com>
11697
11698         * cs-parser.jay: Small fix: we were not comparing the constructor
11699         name correctly.   Thanks to Zoltan for the initial pointer.
11700
11701 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
11702
11703         * cs-tokenizer.cs: Set file name when specified with #line
11704
11705 2003-01-15  Miguel de Icaza  <miguel@ximian.com>
11706
11707         * cs-parser.jay: Only perform the constructor checks here if we
11708         are named like the class;  This will help provider a better
11709         error.  The constructor path is taken when a type definition is
11710         not found, but most likely the user forgot to add the type, so
11711         report that rather than the constructor error.
11712
11713 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
11714
11715         * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
11716         allocations.
11717
11718 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
11719
11720         * cs-parser.jay: Add cleanup call.
11721
11722 2003-01-13  Duncan Mak  <duncan@ximian.com>
11723
11724         * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
11725         consistent with other methods.
11726
11727 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
11728
11729         * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
11730
11731 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
11732
11733         * attribute.cs: only set GuidAttr to true when we have a
11734         GuidAttribute.
11735
11736 2003-01-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11737
11738         * ecore.cs:
11739         * expression.cs:
11740         * typemanager.cs: fixes to allow mcs compile corlib with the new
11741         Type.IsSubclassOf fix.
11742
11743 2003-01-08  Miguel de Icaza  <miguel@ximian.com>
11744
11745         * expression.cs (LocalVariableReference.DoResolve): Classify a
11746         constant as a value, not as a variable.   Also, set the type for
11747         the variable.
11748
11749         * cs-parser.jay (fixed_statement): take a type instead of a
11750         pointer_type, so we can produce a better error message later.
11751
11752         * statement.cs (Fixed.Resolve): Flag types that are not pointers
11753         as an error.  
11754
11755         (For.DoEmit): Make inifinite loops have a
11756         non-conditional branch back.
11757
11758         (Fixed.DoEmit): First populate the pinned variables, then emit the
11759         statement, then clear the variables.  Before I was emitting the
11760         code once for each fixed piece.
11761
11762
11763 2003-01-08  Martin Baulig  <martin@ximian.com>
11764
11765         * statement.cs (FlowBranching.MergeChild): A break in a
11766         SWITCH_SECTION does not leave a loop.  Fixes #36155.
11767
11768 2003-01-08  Martin Baulig  <martin@ximian.com>
11769
11770         * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
11771         lives in the same number space than `param_map'.  Fixes #36154.
11772
11773 2003-01-07  Miguel de Icaza  <miguel@ximian.com>
11774
11775         * cs-parser.jay (constructor_declaration): Set the
11776         Constructor.ModFlags before probing for it.  This makes the
11777         compiler report 514, 515 and 132 (the code was there, but got
11778         broken). 
11779
11780         * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
11781         (GotoDefault.Resolve): Set `Returns' to ALWAYS.
11782         (GotoCase.Resolve): Set `Returns' to ALWAYS.
11783
11784 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
11785
11786         * enum.cs: create the enum static fields using the enum type.
11787
11788 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
11789
11790         * class.cs: don't try to create the ParamBuilder for the return
11791         type if it's not needed (and handle it breaking for the ms runtime
11792         anyway).
11793
11794 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
11795
11796         * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
11797
11798 2002-12-29  Miguel de Icaza  <miguel@ximian.com>
11799
11800         * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
11801         the command.   This showed up while compiling the JANET source
11802         code, which used \r as its only newline separator.
11803
11804 2002-12-28  Miguel de Icaza  <miguel@ximian.com>
11805
11806         * class.cs (Method.Define): If we are an operator (because it
11807         reuses our code), then set the SpecialName and HideBySig.  #36128
11808
11809 2002-12-22  Miguel de Icaza  <miguel@ximian.com>
11810
11811         * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
11812         exception, report error 120 `object reference required'.
11813
11814         * driver.cs: Add --pause option, used during to measure the size
11815         of the process as it goes with --timestamp.
11816
11817         * expression.cs (Invocation.DoResolve): Do not allow methods with
11818         SpecialName to be invoked.
11819
11820 2002-12-21  Miguel de Icaza  <miguel@ximian.com>
11821
11822         * cs-tokenizer.cs: Small fix to the parser: compute the ascii
11823         number before adding it.
11824
11825 2002-12-21  Ravi Pratap  <ravi@ximian.com>
11826
11827         * ecore.cs (StandardImplicitConversion): When in an unsafe
11828         context, we allow conversion between void * to any other pointer
11829         type. This fixes bug #35973.
11830
11831 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
11832
11833         * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
11834         is not thrown when extensionless outputs are used 
11835
11836 2002-12-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11837
11838         * rootcontext.cs: fixed compilation of corlib.
11839
11840 2002-12-19  Miguel de Icaza  <miguel@ximian.com>
11841
11842         * attribute.cs (Attributes.Contains): Add new method.
11843
11844         * class.cs (MethodCore.LabelParameters): if the parameter is an
11845         `out' parameter, check that no attribute `[In]' has been passed.
11846
11847         * enum.cs: Handle the `value__' name in an enumeration.
11848
11849 2002-12-14  Jaroslaw Kowalski <jarek@atm.com.pl>
11850
11851         * decl.cs: Added special case to allow overrides on "protected
11852         internal" methods
11853
11854 2002-12-18  Ravi Pratap  <ravi@ximian.com>
11855
11856         * attribute.cs (Attributes.AddAttributeSection): Rename to this
11857         since it makes much more sense.
11858
11859         (Attributes.ctor): Don't require a Location parameter.
11860
11861         * rootcontext.cs (AddGlobalAttributeSection): Rename again.
11862
11863         * attribute.cs (ApplyAttributes): Remove extra Location parameters
11864         since we already have that information per attribute.
11865
11866         * everywhere : make appropriate changes.
11867
11868         * class.cs (LabelParameters): Write the code which actually
11869         applies attributes to the return type. We can't do this on the MS
11870         .NET runtime so we flag a warning in the case an exception is
11871         thrown.
11872
11873 2002-12-18  Miguel de Icaza  <miguel@ximian.com>
11874
11875         * const.cs: Handle implicit null conversions here too.
11876
11877 2002-12-17  Ravi Pratap  <ravi@ximian.com>
11878
11879         * class.cs (MethodCore.LabelParameters): Remove the extra
11880         Type [] parameter since it is completely unnecessary. Instead
11881         pass in the method's attributes so that we can extract
11882         the "return" attribute.
11883
11884 2002-12-17  Miguel de Icaza  <miguel@ximian.com>
11885
11886         * cs-parser.jay (parse): Use Report.Error to flag errors instead
11887         of ignoring it and letting the compile continue.
11888
11889         * typemanager.cs (ChangeType): use an extra argument to return an
11890         error condition instead of throwing an exception.
11891
11892 2002-12-15  Miguel de Icaza  <miguel@ximian.com>
11893
11894         * expression.cs (Unary.TryReduce): mimic the code for the regular
11895         code path.  Perform an implicit cast in the cases where we can
11896         implicitly convert to one of the integral types, and then reduce
11897         based on that constant.   This fixes bug #35483.
11898
11899 2002-12-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11900
11901         * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
11902
11903 2002-12-13  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11904
11905         * namespace.cs: fixed bug #35489.
11906
11907 2002-12-12  Miguel de Icaza  <miguel@ximian.com>
11908
11909         * class.cs: Remove some dead code.
11910
11911         * cs-parser.jay: Estimate the number of methods needed
11912         (RootContext.MethodCount);
11913
11914         * cs-tokenizer.cs: Use char arrays for parsing identifiers and
11915         numbers instead of StringBuilders.
11916
11917         * support.cs (PtrHashtable): Add constructor with initial size;
11918         We can now reduce reallocations of the method table.
11919
11920 2002-12-10  Ravi Pratap  <ravi@ximian.com>
11921
11922         * attribute.cs (ApplyAttributes): Keep track of the emitted
11923         attributes on a per-target basis. This fixes bug #35413.
11924
11925 2002-12-10  Miguel de Icaza  <miguel@ximian.com>
11926
11927         * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
11928         default to the Windows 1252 encoding.
11929
11930         (UnixParseOption): Support version, thanks to Alp for the missing
11931         pointer. 
11932
11933         * AssemblyInfo.cs: Add nice assembly information.
11934
11935         * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
11936         (bug 35169).
11937
11938         * cs-parser.jay: Allow a trailing comma before the close bracked
11939         in the attribute_section production.
11940
11941         * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
11942         address of the instance was being taken, I will take this out,
11943         because we take the address of the object immediately here.
11944
11945 2002-12-09  Ravi Pratap  <ravi@ximian.com>
11946
11947         * typemanager.cs (AreMultipleAllowed): Take care of the most
11948         obvious case where attribute type is not in the current assembly -
11949         stupid me ;-)
11950
11951 2002-12-08  Miguel de Icaza  <miguel@ximian.com>
11952
11953         * ecore.cs (SimpleName.DoResolve): First perform lookups on using
11954         definitions, instead of doing that afterwards.  
11955
11956         Also we use a nice little hack, depending on the constructor, we
11957         know if we are a "composed" name or a simple name.  Hence, we
11958         avoid the IndexOf test, and we avoid 
11959
11960         * codegen.cs: Add code to assist in a bug reporter to track down
11961         the source of a compiler crash. 
11962
11963 2002-12-07  Ravi Pratap  <ravi@ximian.com>
11964
11965         * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
11966         types have been emitted for a given element and flag an error
11967         if something which does not have AllowMultiple set is used more
11968         than once.
11969
11970         * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
11971         attribute types and their corresponding AllowMultiple properties
11972
11973         (AreMultipleAllowed): Check the property for a given type.
11974
11975         * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
11976         property in the case we have a TypeContainer.
11977
11978         (Attributes.AddAttribute): Detect duplicates and just skip on
11979         adding them. This trivial fix catches a pretty gross error in our
11980         attribute emission - global attributes were being emitted twice!
11981
11982         Bugzilla bug #33187 is now fixed.
11983
11984 2002-12-06  Miguel de Icaza  <miguel@ximian.com>
11985
11986         * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
11987         instead of pp_and).
11988
11989         * expression.cs (Binary.ResolveOperator): I can only use the
11990         Concat (string, string, string) and Concat (string, string,
11991         string, string) if the child is actually a concatenation of
11992         strings. 
11993
11994 2002-12-04  Miguel de Icaza  <miguel@ximian.com>
11995
11996         * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
11997         context where we need a 2-character lookahead.
11998
11999         * pending.cs (PendingImplementation): Rework so we can keep track
12000         of interface types all the time, and flag those which were
12001         implemented by parents as optional.
12002
12003 2002-12-03  Miguel de Icaza  <miguel@ximian.com>
12004
12005         * expression.cs (Binary.ResolveOperator): Use
12006         String.Concat(string,string,string) or
12007         String.Concat(string,string,string,string) when possible. 
12008
12009         * typemanager: More helper methods.
12010
12011
12012 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
12013
12014         * pending.cs: remove the bogus return from GetMissingInterfaces()
12015         (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
12016
12017 2002-12-02  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12018
12019         * namespace.cs: avoid duplicated 'using xxx' being added to
12020         using_clauses. This prevents mcs from issuing and 'ambiguous type' error
12021         when we get more than one 'using' statement for the same namespace.
12022         Report a CS0105 warning for it.
12023
12024 2002-11-30  Miguel de Icaza  <miguel@ximian.com>
12025
12026         * cs-tokenizer.cs (consume_identifier): use read directly, instead
12027         of calling getChar/putback, uses internal knowledge of it.    
12028
12029         (xtoken): Reorder tokenizer so most common patterns are checked
12030         first.  This reduces the compilation time in another 5% (from 8.11s
12031         average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
12032
12033         The parsing time is 22% of the compilation in mcs, and from that
12034         64% is spent on the tokenization process.  
12035
12036         I tried using a binary search for keywords, but this is slower
12037         than the hashtable.  Another option would be to do a couple of
12038         things:
12039
12040                 * Not use a StringBuilder, instead use an array of chars,
12041                   with a set value.  Notice that this way we could catch
12042                   the 645 error without having to do it *afterwards*.
12043
12044                 * We could write a hand-parser to avoid the hashtable
12045                   compares altogether.
12046
12047         The identifier consumption process takes 37% of the tokenization
12048         time.  Another 15% is spent on is_number.  56% of the time spent
12049         on is_number is spent on Int64.Parse:
12050
12051                 * We could probably choose based on the string length to
12052                   use Int32.Parse or Int64.Parse and avoid all the 64-bit
12053                   computations. 
12054
12055         Another 3% is spend on wrapping `xtoken' in the `token' function.
12056
12057         Handle 0xa0 as whitespace (#34752)
12058
12059 2002-11-26  Miguel de Icaza  <miguel@ximian.com>
12060
12061         * typemanager.cs (IsCLRType): New routine to tell whether a type
12062         is one of the builtin types.  
12063
12064         Maybe it needs to use TypeCodes to be faster.  Maybe we could use
12065         typecode in more places instead of doing pointer comparissions.
12066         We could leverage some knowledge about the way the typecodes are
12067         laid out.
12068
12069         New code to cache namespaces in assemblies, it is currently not
12070         invoked, to be used soon.
12071
12072         * decl.cs (DeclSpace.MakeFQN): Simple optimization.
12073
12074         * expression.cs (Binary.ResolveOperator): specially handle
12075         strings, and do not perform user-defined operator overloading for
12076         built-in types.
12077
12078 2002-11-24  Miguel de Icaza  <miguel@ximian.com>
12079
12080         * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
12081         internalcall as it is a pretty simple operation;  Avoid whenever
12082         possible to call Char.IsLetter.
12083
12084         (consume_identifier): Cut by half the number of
12085         hashtable calls by merging the is_keyword and GetKeyword behavior.
12086
12087         Do not short-circuit, because if we do, we
12088         report errors (ie, #if false && true would produce an invalid
12089         directive error);
12090
12091
12092 2002-11-24  Martin Baulig  <martin@ximian.com>
12093
12094         * expression.cs (Cast.TryReduce): If we're in checked syntax,
12095         check constant ranges and report a CS0221.  Fixes #33186.
12096
12097 2002-11-24  Martin Baulig  <martin@ximian.com>
12098
12099         * cs-parser.jay: Make this work for uninitialized variable
12100         declarations in the `for' initializer.  Fixes #32416.
12101
12102 2002-11-24  Martin Baulig  <martin@ximian.com>
12103
12104         * ecore.cs (Expression.ConvertExplicit): Make casting from/to
12105         System.Enum actually work.  Fixes bug #32269, added verify-6.cs.
12106
12107 2002-11-24  Martin Baulig  <martin@ximian.com>
12108
12109         * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
12110         argument; if true, we also check for user-defined conversions.
12111         This is only needed if both arguments are of a user-defined type.
12112         Fixes #30443, added test-175.cs.
12113         (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
12114
12115         * ecore.cs (Expression.ImplicitUserConversionExists): New method.
12116
12117 2002-11-24  Martin Baulig  <martin@ximian.com>
12118
12119         * expression.cs (ArrayAccess.GetStoreOpcode): New public static
12120         function to get the store opcode.
12121         (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
12122         only emit the Ldelema if the store opcode is Stobj.  You must run
12123         both test-34 and test-167 to test this.  Fixes #34529.
12124
12125 2002-11-23  Martin Baulig  <martin@ximian.com>
12126
12127         * ecore.cs (Expression.MemberLookup): Added additional
12128         `qualifier_type' argument which is used when we're being called
12129         from MemberAccess.DoResolve() and null if we're called from a
12130         SimpleName lookup.
12131         (Expression.MemberLookupFailed): New method to report errors; this
12132         does the CS1540 check and reports the correct error message.
12133
12134         * typemanager.cs (MemberLookup): Added additional `qualifier_type'
12135         argument for the CS1540 check and redone the way how we're dealing
12136         with private members.  See the comment in the source code for details.
12137         (FilterWithClosure): Reverted this back to revision 1.197; renamed
12138         `closure_start_type' to `closure_qualifier_type' and check whether
12139         it's not null.  It was not this filter being broken, it was just
12140         being called with the wrong arguments.
12141
12142         * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
12143         and pass it the correct `qualifier_type'; this also does the error
12144         handling for us.
12145
12146 2002-11-22  Miguel de Icaza  <miguel@ximian.com>
12147
12148         * expression.cs (Invocation.EmitParams): If the we are dealing
12149         with a non-built-in value type, load its address as well.
12150
12151         (ArrayCreation): Use a a pretty constant instead
12152         of the hardcoded value 2.   Use 6 instead of 2 for the number of
12153         static initializers.  
12154
12155         (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
12156         because they are not really value types, just glorified integers. 
12157
12158         * driver.cs: Do not append .exe, the CSC compiler does not do it.
12159
12160         * ecore.cs: Remove redundant code for enumerations, make them use
12161         the same code path as everything else, fixes the casting issue
12162         with enumerations in Windows.Forms.
12163
12164         * attribute.cs: Do only cast to string if it is a string, the
12165         validation happens later.
12166
12167         * typemanager.cs: Temproary hack to avoid a bootstrap issue until
12168         people upgrade their corlibs.
12169
12170         * ecore.cs: Oops, enumerations were not following the entire code path
12171
12172 2002-11-21  Miguel de Icaza  <miguel@ximian.com>
12173
12174         * typemanager.cs (FilterWithClosure): Commented out the test for
12175         1540 in typemanager.cs, as it has problems when accessing
12176         protected methods from a parent class (see test-174.cs). 
12177
12178         * attribute.cs (Attribute.ValidateGuid): new method.
12179         (Attribute.Resolve): Use above.
12180
12181 2002-11-19  Miguel de Icaza  <miguel@ximian.com>
12182
12183         * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
12184
12185         * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
12186         handling for enumerations, as we only needed the TypeContainer
12187         functionality to begin with (this is required for the fix below to
12188         work for enums that reference constants in a container class for
12189         example). 
12190
12191         * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
12192
12193         * enum.cs (Enum.Define): Use `this' instead of parent, so we have
12194         a valid TypeBuilder to perform lookups on.o
12195
12196         * class.cs (InheritableMemberSignatureCompare): Use true in the
12197         call to GetGetMethod and GetSetMethod, because we are comparing
12198         the signature, and we need to get the methods *even* if they are
12199         private. 
12200
12201         (PropertyBase.CheckBase): ditto.
12202
12203         * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
12204         GotoCase.Resolve): Use Peel on EmpytCasts.
12205
12206         * ecore.cs (EmptyCast): drop child, add Peel method.
12207
12208 2002-11-17  Martin Baulig  <martin@ximian.com>
12209
12210         * ecore.cs (EmptyCast.Child): New public property.
12211
12212         * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
12213         label resolved to an EmptyCast.  Fixes #34162.
12214         (GotoCase.Resolve): Likewise.
12215         (Block.EmitMeta): Likewise.
12216
12217 2002-11-17  Martin Baulig  <martin@ximian.com>
12218
12219         * expression.cs (Invocation.BetterConversion): Prefer int over
12220         uint; short over ushort; long over ulong for integer literals.
12221         Use ImplicitConversionExists instead of StandardConversionExists
12222         since we also need to check for user-defined implicit conversions.
12223         Fixes #34165.  Added test-173.cs.
12224
12225 2002-11-16  Martin Baulig  <martin@ximian.com>
12226
12227         * expression.cs (Binary.EmitBranchable): Eliminate comparisions
12228         with the `true' and `false' literals.  Fixes #33151.
12229
12230 2002-11-16  Martin Baulig  <martin@ximian.com>
12231
12232         * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
12233         October 22nd; don't do the cs1540 check for static members.
12234
12235         * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
12236         now using our own filter here and doing the cs1540 check again.
12237
12238 2002-11-16  Martin Baulig  <martin@ximian.com>
12239
12240         * support.cs (InternalParameters): Don't crash if we don't have
12241         any fixed parameters.  Fixes #33532.
12242
12243 2002-11-16  Martin Baulig  <martin@ximian.com>
12244
12245         * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
12246         when looking up static methods to make this work on Windows.
12247         Fixes #33773.
12248
12249 2002-11-16  Martin Baulig  <martin@ximian.com>
12250
12251         * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
12252         a setter rather than using PropertyInfo.CanWrite.
12253
12254 2002-11-15  Nick Drochak  <ndrochak@gol.com>
12255
12256         * class.cs: Allow acces to block member by subclasses. Fixes build
12257         breaker.
12258
12259 2002-11-14  Martin Baulig  <martin@ximian.com>
12260
12261         * class.cs (Constructor.Emit): Added the extern/block check.
12262         Fixes bug #33678.
12263
12264 2002-11-14  Martin Baulig  <martin@ximian.com>
12265
12266         * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
12267         iteration while looking for indexers, this is needed because the
12268         indexer may have a different name in our base classes.  Fixed the
12269         error reporting (no indexers at all, not get accessor, no
12270         overloaded match).  Fixes bug #33089.
12271         (IndexerAccess.DoResolveLValue): Likewise.
12272
12273 2002-11-14  Martin Baulig  <martin@ximian.com>
12274
12275         * class.cs (PropertyBase.CheckBase): Make this work for multiple
12276         indexers.  Fixes the first part of bug #33089.
12277         (MethodSignature.InheritableMemberSignatureCompare): Added support
12278         for properties.
12279
12280 2002-11-13  Ravi Pratap  <ravi@ximian.com>
12281
12282         * attribute.cs (Attribute.Resolve): Catch the
12283         NullReferenceException and report it since it isn't supposed to
12284         happen. 
12285
12286 2002-11-12  Miguel de Icaza  <miguel@ximian.com>
12287
12288         * expression.cs (Binary.EmitBranchable): Also handle the cases for
12289         LogicalOr and LogicalAnd that can benefit from recursively
12290         handling EmitBranchable.  The code now should be nice for Paolo.
12291
12292 2002-11-08  Miguel de Icaza  <miguel@ximian.com>
12293
12294         * typemanager.cs (LookupType): Added a negative-hit hashtable for
12295         the Type lookups, as we perform quite a number of lookups on
12296         non-Types.  This can be removed once we can deterministically tell
12297         whether we have a type or a namespace in advance.
12298
12299         But this might require special hacks from our corlib.
12300
12301         * TODO: updated.
12302
12303         * ecore.cs (TryImplicitIntConversion): Handle conversions to float
12304         and double which avoids a conversion from an integer to a double.
12305
12306         * expression.cs: tiny optimization, avoid calling IsConstant,
12307         because it effectively performs the lookup twice.
12308
12309 2002-11-06  Miguel de Icaza  <miguel@ximian.com>
12310
12311         But a bogus return here to keep the semantics of the old code
12312         until the Mono runtime is fixed.
12313
12314         * pending.cs (GetMissingInterfaces): New method used to remove all
12315         the interfaces that are already implemented by our parent
12316         classes from the list of pending methods. 
12317
12318         * interface.cs: Add checks for calls after ResolveTypeExpr.
12319
12320 2002-11-05  Miguel de Icaza  <miguel@ximian.com>
12321
12322         * class.cs (Class.Emit): Report warning 67: event not used if the
12323         warning level is beyond 3.
12324
12325         * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
12326         being a NullLiteral.
12327
12328         * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
12329         specifiers. 
12330
12331         * class.cs (TypeContainer.GetClassBases): Cover a missing code
12332         path that might fail if a type can not be resolved.
12333
12334         * expression.cs (Binary.Emit): Emit unsigned versions of the
12335         operators. 
12336
12337         * driver.cs: use error 5.
12338
12339 2002-11-02  Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
12340
12341         * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
12342
12343 2002-11-01  Miguel de Icaza  <miguel@ximian.com>
12344
12345         * cs-parser.jay (switch_section): A beautiful patch from Martin
12346         Baulig that fixed 33094.
12347
12348 2002-10-31  Miguel de Icaza  <miguel@ximian.com>
12349
12350         * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
12351         Check whether the base is abstract and report an error if so.
12352
12353         * expression.cs (IndexerAccess.DoResolveLValue,
12354         IndexerAccess.DoResolve): ditto. 
12355
12356         (Invocation.DoResolve): ditto.
12357
12358         (Invocation.FullMethodDesc): Improve the report string.
12359
12360         * statement.cs (Block): Eliminate IsVariableDefined as it is
12361         basically just a wrapper for GetVariableInfo.
12362
12363         * ecore.cs (SimpleName): Use new 
12364
12365         * support.cs (ReflectionParamter.ParameterType): We unwrap the
12366         type, as we return the actual parameter ref/unref state on a
12367         different call.
12368
12369 2002-10-30  Miguel de Icaza  <miguel@ximian.com>
12370
12371         * support.cs: Return proper flags REF/OUT fixing the previous
12372         commit.  
12373
12374         * expression.cs: Reverted last patch, that was wrong.  Is_ref is
12375         not used to mean `ref' but `ref or out' in ParameterReference
12376
12377         * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
12378         full type signature instead of calling TypeManger.CSharpName
12379         ourselves. 
12380
12381         * support.cs (InternalParameters.ParameterDesc): Do not compare
12382         directly to the modflags, because REF/OUT will actually be bitsets
12383         if set. 
12384
12385         * delegate.cs (VerifyMethod): Check also the modifiers.
12386
12387         * cs-tokenizer.cs: Fix bug where floating point values with an
12388         exponent where a sign was missing was ignored.
12389
12390         * driver.cs: Allow multiple assemblies to be specified in a single
12391         /r: argument
12392
12393 2002-10-28  Miguel de Icaza  <miguel@ximian.com>
12394
12395         * cs-parser.jay: Ugly.  We had to add a multiplicative_expression,
12396         because identifiers after a parenthesis would end up in this kind
12397         of production, and we needed to desamiguate it for having casts
12398         like:
12399
12400                 (UserDefinedType *) xxx
12401
12402 2002-10-24  Miguel de Icaza  <miguel@ximian.com>
12403
12404         * typemanager.cs (RealMemberLookup): when we deal with a subclass,
12405         we should set on the Bindingflags.NonPublic, but not turn on
12406         private_ok.  private_ok controls whether a Private member is
12407         returned (this is chekced on the filter routine), while the
12408         BindingFlags.NonPublic just controls whether private/protected
12409         will be allowed.   This fixes the problem part of the problem of
12410         private properties being allowed to be used in derived classes.
12411
12412         * expression.cs (BaseAccess): Provide an DoResolveLValue method,
12413         so we can call the children DoResolveLValue method (this will
12414         properly signal errors on lvalue assignments to base properties)
12415
12416         * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
12417         getter are null, and we have a property info, we know that this
12418         happened because the lookup failed, so we report an error 122 for
12419         protection level violation.
12420
12421         We also silently return if setter and getter are null in the
12422         resolve functions, this condition only happens if we have flagged
12423         the error before.  This is the other half of the problem. 
12424
12425         (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
12426         not have accessibility information, that is why we were returning
12427         true in the filter function in typemanager.cs.
12428
12429         To properly report 122 (property is inaccessible because of its
12430         protection level) correctly, we report this error in ResolveAccess
12431         by failing if both the setter and the getter are lacking (ie, the
12432         lookup failed). 
12433
12434         DoResolve and DoLResolve have been modified to check for both
12435         setter/getter being null and returning silently, the reason being
12436         that I did not want to put the knowledge about this error in upper
12437         layers, like:
12438
12439         int old = Report.Errors;
12440         x = new PropertyExpr (...);
12441         if (old != Report.Errors)
12442                 return null;
12443         else
12444                 return x;
12445
12446         So the property expr is returned, but it is invalid, so the error
12447         will be flagged during the resolve process. 
12448
12449         * class.cs: Remove InheritablePropertySignatureCompare from the
12450         class, as we no longer depend on the property signature to compute
12451         whether it is possible to implement a method or not.
12452
12453         The reason is that calling PropertyInfo.GetGetMethod will return
12454         null (in .NET, in Mono it works, and we should change this), in
12455         cases where the Get Method does not exist in that particular
12456         class.
12457
12458         So this code:
12459
12460         class X { public virtual int A { get { return 1; } } }
12461         class Y : X { }
12462         class Z : Y { public override int A { get { return 2; } } }
12463
12464         Would fail in Z because the parent (Y) would not have the property
12465         defined.  So we avoid this completely now (because the alternative
12466         fix was ugly and slow), and we now depend exclusively on the
12467         method names.
12468
12469         (PropertyBase.CheckBase): Use a method-base mechanism to find our
12470         reference method, instead of using the property.
12471
12472         * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
12473         routines are gone now.
12474
12475         * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
12476         names, they were incorrectly named.
12477
12478         * cs-tokenizer.cs: Return are more gentle token on failure. 
12479
12480         * pending.cs (PendingImplementation.InterfaceMethod): This routine
12481         had an out-of-sync index variable, which caused it to remove from
12482         the list of pending methods the wrong method sometimes.
12483
12484 2002-10-22  Miguel de Icaza  <miguel@ximian.com>
12485
12486         * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
12487         CanWrite, because those refer to this particular instance of the
12488         property, and do not take into account the fact that we can
12489         override single members of a property.
12490
12491         Constructor requires an EmitContext.  The resolution process does
12492         not happen here, but we need to compute the accessors before,
12493         because the resolution does not always happen for properties.
12494
12495         * typemanager.cs (RealMemberLookup): Set private_ok if we are a
12496         subclass, before we did not update this flag, but we did update
12497         bindingflags. 
12498
12499         (GetAccessors): Drop this routine, as it did not work in the
12500         presence of partially overwritten set/get methods. 
12501
12502         Notice that this broke the cs1540 detection, but that will require
12503         more thinking. 
12504
12505 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12506
12507         * class.cs:
12508         * codegen.cs:
12509         * driver.cs: issue a warning instead of an error if we don't support
12510         debugging for the platform. Also ignore a couple of errors that may
12511         arise when trying to write the symbols. Undo my previous patch.
12512
12513 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12514
12515         * driver.cs: ignore /debug switch except for Unix platforms.
12516
12517 2002-10-23  Nick Drochak  <ndrochak@gol.com>
12518
12519         * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
12520
12521 2002-10-21  Miguel de Icaza  <miguel@ximian.com>
12522
12523         * driver.cs: Do not make mcs-debug conditional, so we do not break
12524         builds that use it.
12525
12526         * statement.cs (UsageVector.MergeChildren): I would like Martin to
12527         review this patch.  But basically after all the children variables
12528         have been merged, the value of "Breaks" was not being set to
12529         new_breaks for Switch blocks.  I think that it should be set after
12530         it has executed.  Currently I set this to the value of new_breaks,
12531         but only if new_breaks is FlowReturn.ALWAYS, which is a bit
12532         conservative, but I do not understand this code very well.
12533
12534         I did not break anything in the build, so that is good ;-)
12535
12536         * cs-tokenizer.cs: Also allow \r in comments as a line separator.
12537
12538 2002-10-20  Mark Crichton  <crichton@gimp.org>
12539
12540         * cfold.cs: Fixed compile blocker.  Really fixed it this time.
12541
12542 2002-10-20  Nick Drochak  <ndrochak@gol.com>
12543
12544         * cfold.cs: Fixed compile blocker.
12545
12546 2002-10-20  Miguel de Icaza  <miguel@ximian.com>
12547
12548         * driver.cs: I was chekcing the key, not the file.
12549
12550 2002-10-19  Ravi Pratap  <ravi@ximian.com>
12551
12552         * ecore.cs (UserDefinedConversion): Get rid of the bogus error
12553         message that we were generating - we just need to silently return
12554         a null.
12555
12556 2002-10-19  Miguel de Icaza  <miguel@ximian.com>
12557
12558         * class.cs (Event.Define): Change my previous commit, as this
12559         breaks the debugger.  This is a temporary hack, as it seems like
12560         the compiler is generating events incorrectly to begin with.
12561
12562         * expression.cs (Binary.ResolveOperator): Added support for 
12563         "U operator - (E x, E y)"
12564
12565         * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
12566         y)".
12567
12568         * ecore.cs (FieldExpr.AddressOf): We had a special code path for
12569         init-only variables, but this path did not take into account that
12570         there might be also instance readonly variables.  Correct this
12571         problem. 
12572
12573         This fixes bug 32253
12574
12575         * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
12576         delegates as well.
12577
12578         * driver.cs: Change the extension for modules to `netmodule'
12579
12580         * cs-parser.jay: Improved slightly the location tracking for
12581         the debugger symbols.
12582
12583         * class.cs (Event.Define): Use Modifiers.FieldAttr on the
12584         modifiers that were specified instead of the hardcoded value
12585         (FamAndAssem).  This was basically ignoring the static modifier,
12586         and others.  Fixes 32429.
12587
12588         * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
12589         fixed a bug in the process (32476)
12590
12591         * expression.cs (ArrayAccess.EmitAssign): Patch from
12592         hwang_rob@yahoo.ca that fixes bug 31834.3
12593
12594 2002-10-18  Miguel de Icaza  <miguel@ximian.com>
12595
12596         * driver.cs: Make the module extension .netmodule.
12597
12598 2002-10-16  Miguel de Icaza  <miguel@ximian.com>
12599
12600         * driver.cs: Report an error if the resource file is not found
12601         instead of crashing.
12602
12603         * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
12604         false, like Emit does.
12605
12606 2002-10-16  Nick Drochak  <ndrochak@gol.com>
12607
12608         * typemanager.cs: Remove unused private member.  Also reported mcs
12609         bug to report this as a warning like csc.
12610
12611 2002-10-15  Martin Baulig  <martin@gnome.org>
12612
12613         * statement.cs (Statement.Emit): Made this a virtual method; emits
12614         the line number info and calls DoEmit().
12615         (Statement.DoEmit): New protected abstract method, formerly knows
12616         as Statement.Emit().
12617
12618         * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
12619
12620 2002-10-11  Miguel de Icaza  <miguel@ximian.com>
12621
12622         * class.cs: Following the comment from 2002-09-26 to AddMethod, I
12623         have fixed a remaining problem: not every AddXXXX was adding a
12624         fully qualified name.  
12625
12626         Now everyone registers a fully qualified name in the DeclSpace as
12627         being defined instead of the partial name.  
12628
12629         Downsides: we are slower than we need to be due to the excess
12630         copies and the names being registered this way.  
12631
12632         The reason for this is that we currently depend (on the corlib
12633         bootstrap for instance) that types are fully qualified, because
12634         we dump all the types in the namespace, and we should really have
12635         types inserted into the proper namespace, so we can only store the
12636         basenames in the defined_names array.
12637
12638 2002-10-10  Martin Baulig  <martin@gnome.org>
12639
12640         * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
12641         from bug #31834, see the bug report for a testcase which is
12642         miscompiled.
12643
12644 2002-10-10  Martin Baulig  <martin@gnome.org>
12645
12646         * codegen.cs (EmitContext.Breaks): Removed, we're now using the
12647         flow analysis code for this.
12648
12649         * statement.cs (Do, While, For): Tell the flow analysis code about
12650         infinite loops.
12651         (FlowBranching.UsageVector): Added support for infinite loops.
12652         (Block.Resolve): Moved the dead code elimination here and use flow
12653         analysis to do it.
12654
12655 2002-10-09  Miguel de Icaza  <miguel@ximian.com>
12656
12657         * class.cs (Field.Define): Catch cycles on struct type
12658         definitions. 
12659
12660         * typemanager.cs (IsUnmanagedtype): Do not recursively check
12661         fields if the fields are static.  We only need to check instance
12662         fields. 
12663
12664         * expression.cs (As.DoResolve): Test for reference type.
12665
12666         * statement.cs (Using.ResolveExpression): Use
12667         ConvertImplicitRequired, not ConvertImplicit which reports an
12668         error on failture
12669         (Using.ResolveLocalVariableDecls): ditto.
12670
12671         * expression.cs (Binary.ResolveOperator): Report errors in a few
12672         places where we had to.
12673
12674         * typemanager.cs (IsUnmanagedtype): Finish implementation.
12675
12676 2002-10-08  Miguel de Icaza  <miguel@ximian.com>
12677
12678         * expression.cs: Use StoreFromPtr instead of extracting the type
12679         and then trying to use Stelem.  Patch is from hwang_rob@yahoo.ca
12680
12681         * ecore.cs (ImplicitReferenceConversion): It is possible to assign
12682         an enumeration value to a System.Enum, but System.Enum is not a
12683         value type, but an class type, so we need to box.
12684
12685         (Expression.ConvertExplicit): One codepath could return
12686         errors but not flag them.  Fix this.  Fixes #31853
12687
12688         * parameter.cs (Resolve): Do not allow void as a parameter type.
12689
12690 2002-10-06  Martin Baulig  <martin@gnome.org>
12691
12692         * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
12693         if it's a class type and not a struct.  Fixes #31815.
12694
12695 2002-10-06  Martin Baulig  <martin@gnome.org>
12696
12697         * statement.cs: Reworked the flow analysis code a bit to make it
12698         usable for dead code elimination.
12699
12700 2002-10-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12701
12702         * cs-parser.jay: allow empty source files. Fixes bug #31781.
12703
12704 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
12705
12706         * expression.cs (ComposedCast.DoResolveType): A quick workaround
12707         to fix the test 165, will investigate deeper.
12708
12709 2002-10-04  Martin Baulig  <martin@gnome.org>
12710
12711         * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
12712         finally blocks actually work.
12713         (Try.Resolve): We don't need to create a sibling for `finally' if
12714         there is no finally block.
12715
12716 2002-10-04  Martin Baulig  <martin@gnome.org>
12717
12718         * class.cs (Constructor.Define): The default accessibility for a
12719         non-default constructor is private, not public.
12720
12721 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
12722
12723         * class.cs (Constructor): Make AllowedModifiers public, add
12724         EXTERN.
12725
12726         * cs-parser.jay: Perform the modifiers test here, as the
12727         constructor for the Constructor class usually receives a zero
12728         because of the way we create it (first we create, later we
12729         customize, and we were never checking the modifiers).
12730
12731         * typemanager.cs (Typemanager.LookupTypeDirect): This new function
12732         is a version of LookupTypeReflection that includes the type-name
12733         cache.  This can be used as a fast path for functions that know
12734         the fully qualified name and are only calling into *.GetType() to
12735         obtain a composed type.
12736
12737         This is also used by TypeManager.LookupType during its type
12738         composition.
12739
12740         (LookupType): We now also track the real type name, as sometimes
12741         we can get a quey for the real type name from things like
12742         ComposedCast.  This fixes bug 31422.
12743
12744         * expression.cs (ComposedCast.Resolve): Since we are obtaining a
12745         complete type fullname, it does not have to go through the type
12746         resolution system to obtain the composed version of the type (for
12747         obtaining arrays or pointers).
12748
12749         (Conditional.Emit): Use the EmitBoolExpression to
12750         generate nicer code, as requested by Paolo.
12751
12752         (ArrayCreation.CheckIndices): Use the patch from
12753         hwang_rob@yahoo.ca to validate the array initializers. 
12754
12755 2002-10-03  Miguel de Icaza  <miguel@ximian.com>
12756
12757         * class.cs (ConstructorInitializer.Emit): simplify code by using
12758         Invocation.EmitCall, and at the same time, fix the bugs in calling
12759         parent constructors that took variable arguments. 
12760
12761         * ecore.cs (Expression.ConvertNumericExplicit,
12762         Expression.ImplicitNumericConversion): Remove the code that
12763         manually wrapped decimal (InternalTypeConstructor call is now gone
12764         as well).
12765
12766         * expression.cs (Cast.TryReduce): Also handle decimal types when
12767         trying to perform a constant fold on the type.
12768
12769         * typemanager.cs (IsUnmanagedtype): Partially implemented.
12770
12771         * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
12772         that only turned off an error report, and did nothing else. 
12773
12774 2002-10-02  Miguel de Icaza  <miguel@ximian.com>
12775
12776         * driver.cs: Handle and ignore /fullpaths
12777
12778 2002-10-01  Miguel de Icaza  <miguel@ximian.com>
12779
12780         * expression.cs (Binary.ResolveOperator): Catch the case where
12781         DoNumericPromotions returns true, 
12782
12783         (Binary.DoNumericPromotions): Simplify the code, and the tests.
12784
12785 2002-09-27  Miguel de Icaza  <miguel@ximian.com>
12786
12787         * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
12788         report error 70.
12789
12790 2002-09-26  Miguel de Icaza  <miguel@ximian.com>
12791
12792         * ecore.cs (ConvertNumericExplicit): It is not enough that the
12793         conversion exists, but it is also required that the conversion be
12794         performed.  This manifested in "(Type64Enum) 2".  
12795
12796         * class.cs (TypeManager.AddMethod): The fix is not to change
12797         AddEnum, because that one was using a fully qualified name (every
12798         DeclSpace derivative does), but to change the AddMethod routine
12799         that was using an un-namespaced name.  This now correctly reports
12800         the duplicated name.
12801
12802         Revert patch until I can properly fix it.  The issue
12803         is that we have a shared Type space across all namespaces
12804         currently, which is wrong.
12805
12806         Options include making the Namespace a DeclSpace, and merge
12807         current_namespace/current_container in the parser.
12808
12809 2002-09-25  Miguel de Icaza  <miguel@ximian.com>
12810
12811         * cs-parser.jay: Improve error reporting when we get a different
12812         kind of expression in local_variable_type and
12813         local_variable_pointer_type. 
12814
12815         Propagate this to avoid missleading errors being reported.
12816
12817         * ecore.cs (ImplicitReferenceConversion): treat
12818         TypeManager.value_type as a target just like object_type.   As
12819         code like this:
12820
12821         ValueType v = 1;
12822
12823         Is valid, and needs to result in the int 1 being boxed before it
12824         is assigned to the value type v.
12825
12826         * class.cs (TypeContainer.AddEnum): Use the basename, not the name
12827         to validate the enumeration name.
12828
12829         * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
12830         EmitDynamicInitializers for the criteria to use Ldelema.  Thanks
12831         to hwang_rob@yahoo.ca for finding the bug and providing a patch.
12832
12833         * ecore.cs (TryImplicitIntConversion): When doing an
12834         implicit-enumeration-conversion, check if the type is 64-bits and
12835         perform a conversion before passing to EnumConstant.
12836
12837 2002-09-23  Miguel de Icaza  <miguel@ximian.com>
12838
12839         * decl.cs (Error_AmbiguousTypeReference); New routine used to
12840         report ambiguous type references.  Unlike the MS version, we
12841         report what the ambiguity is.   Innovation at work ;-)
12842
12843         (DeclSpace.FindType): Require a location argument to
12844         display when we display an ambiguous error.
12845
12846         * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
12847
12848         * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
12849
12850         * expression.cs (EmitDynamicInitializers): Apply patch from
12851         hwang_rob@yahoo.ca that fixes the order in which we emit our
12852         initializers. 
12853
12854 2002-09-21  Martin Baulig  <martin@gnome.org>
12855
12856         * delegate.cs (Delegate.VerifyApplicability): Make this work if the
12857         delegate takes no arguments.
12858
12859 2002-09-20  Miguel de Icaza  <miguel@ximian.com>
12860
12861         * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
12862         from integers.
12863
12864         * expression.cs: Extract the underlying type.
12865
12866         * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
12867
12868         * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
12869
12870 2002-09-19  Miguel de Icaza  <miguel@ximian.com>
12871
12872         * class.cs (TypeContainer.DefineType): We can not use the nice
12873         PackingSize with the size set to 1 DefineType method, because it
12874         will not allow us to define the interfaces that the struct
12875         implements.
12876
12877         This completes the fixing of bug 27287
12878
12879         * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
12880         means also structs.  This fixes part of the problem. 
12881         (Expresion.ImplicitReferenceConversionExists): ditto.
12882
12883         * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
12884         error if there were no errors reported during the type lookup
12885         process, to avoid duplicates or redundant errors.  Without this
12886         you would get an ambiguous errors plus a type not found.  We have
12887         beaten the user enough with the first error.  
12888
12889         (DeclSparce.FindType): Emit a warning if we have an ambiguous
12890         reference. 
12891
12892         * ecore.cs (SimpleName.DoResolveType): If an error is emitted
12893         during the resolution process, stop the lookup, this avoids
12894         repeated error reports (same error twice).
12895
12896         * rootcontext.cs: Emit a warning if we have an ambiguous reference.
12897
12898         * typemanager.cs (LookupType): Redo the type lookup code to match
12899         the needs of System.Reflection.  
12900
12901         The issue is that System.Reflection requires references to nested
12902         types to begin with a "+" sign instead of a dot.  So toplevel
12903         types look like: "NameSpace.TopLevelClass", and nested ones look
12904         like "Namespace.TopLevelClass+Nested", with arbitrary nesting
12905         levels. 
12906
12907 2002-09-19  Martin Baulig  <martin@gnome.org>
12908
12909         * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
12910         says that a method always returns or always throws an exception,
12911         don't report the CS0161.
12912
12913         * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
12914         set `Returns = new_returns'.
12915
12916 2002-09-19  Martin Baulig  <martin@gnome.org>
12917
12918         * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
12919         to an enum constant, check for a CS0176.
12920
12921 2002-09-18  Miguel de Icaza  <miguel@ximian.com>
12922
12923         * class.cs (TypeContainer.CheckPairedOperators): Now we check
12924         for operators that must be in pairs and report errors.
12925
12926         * ecore.cs (SimpleName.DoResolveType): During the initial type
12927         resolution process, when we define types recursively, we must
12928         check first for types in our current scope before we perform
12929         lookups in the enclosing scopes.
12930
12931         * expression.cs (MakeByteBlob): Handle Decimal blobs.
12932
12933         (Invocation.VerifyArgumentsCompat): Call
12934         TypeManager.TypeToCoreType on the parameter_type.GetElementType.
12935         I thought we were supposed to always call this, but there are a
12936         few places in the code where we dont do it.
12937
12938 2002-09-17  Miguel de Icaza  <miguel@ximian.com>
12939
12940         * driver.cs: Add support in -linkres and -resource to specify the
12941         name of the identifier.
12942
12943 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
12944
12945         * ecore.cs (StandardConversionExists): Sync with the conversion
12946         code: allow anything-* to void* conversions.
12947
12948         (FindMostSpecificSource): Use an Expression argument
12949         instead of a Type, because we might be handed over a Literal which
12950         gets a few more implicit conversions that plain types do not.  So
12951         this information was being lost.
12952
12953         Also, we drop the temporary type-holder expression when not
12954         required.
12955
12956 2002-09-17  Martin Baulig  <martin@gnome.org>
12957
12958         * class.cs (PropertyBase.CheckBase): Don't check the base class if
12959         this is an explicit interface implementation.
12960
12961 2002-09-17  Martin Baulig  <martin@gnome.org>
12962
12963         * class.cs (PropertyBase.CheckBase): Make this work for indexers with
12964         different `IndexerName' attributes.
12965
12966         * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
12967         (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
12968         virtual CommonResolve().
12969
12970 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
12971
12972         * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
12973         and convert that to the UnderlyingType.
12974
12975         * statement.cs (Foreach.Resolve): Indexers are just like variables
12976         or PropertyAccesses.
12977
12978         * cs-tokenizer.cs (consume_string): Track line numbers and columns
12979         inside quoted strings, we were not doing this before.
12980
12981 2002-09-16  Martin Baulig  <martin@gnome.org>
12982
12983         * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
12984         resolve it.  This is needed for the definite assignment check of the
12985         instance expression, fixes bug #29846.
12986         (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
12987
12988 2002-09-16  Nick Drochak  <ndrochak@gol.com>
12989
12990         * parameter.cs: Fix compile error.  Cannot reference static member
12991         from an instance object.  Is this an mcs bug?
12992
12993 2002-09-14  Martin Baulig  <martin@gnome.org>
12994
12995         * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
12996         multiple times.  Fixes bug #30295, added test-166.cs.
12997
12998 2002-09-14  Martin Baulig  <martin@gnome.org>
12999
13000         * statement.cs (Block.Emit): Don't emit unreachable code.
13001         (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
13002         `break' statements.
13003         (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
13004
13005 2002-09-14  Martin Baulig  <martin@gnome.org>
13006
13007         * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
13008         is set.
13009
13010 2002-09-14  Martin Baulig  <martin@gnome.org>
13011
13012         * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
13013         if `type == parent' since in this case `type.IsSubclassOf (parent)' will
13014         be false on the ms runtime.
13015
13016 2002-09-13  Martin Baulig  <martin@gnome.org>
13017
13018         * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
13019         the CS0038 error message.
13020
13021 2002-09-12  Miguel de Icaza  <miguel@ximian.com>
13022
13023         * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
13024         constant inside, return it.
13025
13026 2002-09-12  Martin Baulig  <martin@gnome.org>
13027
13028         * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
13029         implicit conversion can be done between enum types.
13030
13031         * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
13032         check whether an implicit conversion to the current enum's UnderlyingType
13033         exists and report an error if not.
13034
13035         * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
13036         without debugging support.
13037
13038         * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
13039         Fixes bug #30235.  Thanks to Ricardo Fernández Pascual.
13040
13041 2002-09-12  Martin Baulig  <martin@gnome.org>
13042
13043         * typemanager.cs (TypeManager.IsNestedChildOf): New method.
13044
13045         * ecore.cs (IMemberExpr.DeclaringType): New property.
13046         (SimpleName.SimpleNameResolve): Check whether we're accessing a
13047         nonstatic member of an outer type (CS0038).
13048
13049 2002-09-11  Miguel de Icaza  <miguel@ximian.com>
13050
13051         * driver.cs: Activate the using-error detector at warning level
13052         4 (at least for MS-compatible APIs).
13053
13054         * namespace.cs (VerifyUsing): Small buglett fix.
13055
13056         * pending.cs (PendingImplementation): pass the container pointer. 
13057
13058         * interface.cs (GetMethods): Allow for recursive definition.  Long
13059         term, I would like to move every type to support recursive
13060         definitions, not the current ordering mechanism that we have right
13061         now.
13062
13063         The situation is this: Attributes are handled before interfaces,
13064         so we can apply attributes to interfaces.  But some attributes
13065         implement interfaces, we will now handle the simple cases
13066         (recursive definitions will just get an error).  
13067
13068         * parameter.cs: Only invalidate types at the end if we fail to
13069         lookup all types.  
13070
13071 2002-09-09  Martin Baulig  <martin@gnome.org>
13072
13073         * ecore.cs (PropertyExpr.Emit): Also check for
13074         TypeManager.system_int_array_get_length so this'll also work when
13075         compiling corlib.  Fixes #30003.
13076
13077 2002-09-09  Martin Baulig  <martin@gnome.org>
13078
13079         * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
13080         and throw an exception if we can't get the type's size.  Fixed #30040,
13081         added test-165.cs.
13082
13083 2002-09-09  Martin Baulig  <martin@gnome.org>
13084
13085         * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
13086
13087         * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
13088         context.  Fixes bug #30027.
13089
13090         * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
13091         virtual functions.  Fixes bug #30043, added test-164.cs.
13092
13093 2002-09-08  Ravi Pratap  <ravi@ximian.com>
13094
13095         * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
13096
13097 2002-09-08  Nick Drochak  <ndrochak@gol.com>
13098
13099         * driver.cs: Use an object to get the windows codepage since it's not a
13100         static property.
13101
13102 2002-09-08  Miguel de Icaza  <miguel@ximian.com>
13103
13104         * statement.cs (For.Emit): for infinite loops (test == null)
13105         return whether there is a break inside, not always "true".
13106
13107         * namespace.cs (UsingEntry): New struct to hold the name of the
13108         using definition, the location where it is defined, and whether it
13109         has been used in a successful type lookup.
13110
13111         * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
13112         strings.
13113
13114         * decl.cs: ditto.
13115
13116 2002-09-06  Ravi Pratap  <ravi@ximian.com>
13117
13118         * attribute.cs : Fix incorrect code which relied on catching
13119         a NullReferenceException to detect a null being passed in
13120         where an object was expected.
13121
13122 2002-09-06  Miguel de Icaza  <miguel@ximian.com>
13123
13124         * statement.cs (Try): flag the catch variable as assigned
13125
13126         * expression.cs (Cast): Simplified by using ResolveType instead of
13127         manually resolving.
13128
13129         * statement.cs (Catch): Fix bug by using ResolveType.
13130
13131 2002-09-06  Ravi Pratap  <ravi@ximian.com>
13132
13133         * expression.cs (BetterConversion): Special case for when we have
13134         a NullLiteral as the argument and we have to choose between string
13135         and object types - we choose string the way csc does.
13136
13137         * attribute.cs (Attribute.Resolve): Catch the
13138         NullReferenceException and report error #182 since the Mono
13139         runtime no more has the bug and having this exception raised means
13140         we tried to select a constructor which takes an object and is
13141         passed a null.
13142
13143 2002-09-05  Ravi Pratap  <ravi@ximian.com>
13144
13145         * expression.cs (Invocation.OverloadResolve): Flag a nicer error
13146         message (1502, 1503) when we can't locate a method after overload
13147         resolution. This is much more informative and closes the bug
13148         Miguel reported.
13149
13150         * interface.cs (PopulateMethod): Return if there are no argument
13151         types. Fixes a NullReferenceException bug.
13152
13153         * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
13154         expressions too. Previously we were checking only in one place for
13155         positional arguments leaving out named arguments.
13156
13157         * ecore.cs (ImplicitNumericConversion): Conversion from underlying
13158         type to the enum type is not allowed. Remove code corresponding to
13159         that.
13160
13161         (ConvertNumericExplicit): Allow explicit conversions from
13162         the underlying type to enum type. This precisely follows the spec
13163         and closes a bug filed by Gonzalo.
13164
13165 2002-09-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13166
13167         * compiler.csproj:
13168         * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
13169
13170 2002-09-03  Miguel de Icaza  <miguel@ximian.com>
13171
13172         * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
13173         it was important that we stored the right value after the
13174         reduction in `converted'.
13175
13176 2002-09-04  Martin Baulig  <martin@gnome.org>
13177
13178         * location.cs (Location.SymbolDocument): Use full pathnames for the
13179         source files.
13180
13181 2002-08-30  Miguel de Icaza  <miguel@ximian.com>
13182
13183         * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
13184         of the expression resolve mechanism, because that will catch the
13185         SimpleName error failures.
13186
13187         (Conditional): If we can not resolve the
13188         expression, return, do not crash.
13189
13190 2002-08-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13191
13192         * cs-tokenizer.cs:
13193         (location): display token name instead of its number.
13194
13195 2002-08-28  Martin Baulig  <martin@gnome.org>
13196
13197         * expression.cs (Binary.ResolveOperator): Don't silently return
13198         but return an error if an operator cannot be applied between two
13199         enum types.
13200
13201 2002-08-28  Martin Baulig  <martin@gnome.org>
13202
13203         * class.cs (Constructor.Define): Set the permission attributes
13204         correctly instead of making all constructors public.
13205
13206 2002-08-28  Martin Baulig  <martin@gnome.org>
13207
13208         * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
13209         for private members before reporting a CS0103; if we find anything,
13210         it's a CS0122.
13211
13212 2002-08-28  Martin Baulig  <martin@gnome.org>
13213
13214         * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
13215         to check whether `closure_start_type == closure_invocation_type',
13216         we also need to check whether `m.DeclaringType == closure_invocation_type'
13217         before bypassing the permission checks.  We might be accessing
13218         protected/private members from the base class.
13219         (TypeManager.RealMemberLookup): Only set private_ok if private
13220         members were requested via BindingFlags.NonPublic.
13221
13222         * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
13223
13224         * expression.cs (MemberAccess.ResolveMemberAccess): Set
13225         MethodGroupExpr.IsExplicitImpl if appropriate.
13226         (Invocation.DoResolve): Don't report the CS0120 for explicit
13227         interface implementations.
13228
13229 2002-08-27  Martin Baulig  <martin@gnome.org>
13230
13231         * expression.cs (Invocation.DoResolve): If this is a static
13232         method and we don't have an InstanceExpression, we must report
13233         a CS0120.
13234
13235 2002-08-25  Martin Baulig  <martin@gnome.org>
13236
13237         * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
13238         `==' between a valuetype and an object.
13239
13240 2002-08-25  Miguel de Icaza  <miguel@ximian.com>
13241
13242         * ecore.cs (TypeExpr): Provide a ToString method.
13243
13244 2002-08-24  Martin Baulig  <martin@gnome.org>
13245
13246         * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
13247         now called proggie.dbg and it's a binary file.
13248
13249 2002-08-23  Martin Baulig  <martin@gnome.org>
13250
13251         * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
13252
13253 2002-08-23  Martin Baulig  <martin@gnome.org>
13254
13255         * struct.cs (MyStructInfo.ctor): Make this work with empty
13256         structs; it's not allowed to use foreach() on null.
13257
13258 2002-08-23  Martin Baulig  <martin@gnome.org>
13259
13260         * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
13261         writer the full pathname of the generated assembly.
13262
13263 2002-08-23  Martin Baulig  <martin@gnome.org>
13264
13265         * statements.cs (FlowBranching.UsageVector.MergeChildren):
13266         A `finally' block never returns or breaks; improved handling of
13267         unreachable code.
13268
13269 2002-08-23  Martin Baulig  <martin@gnome.org>
13270
13271         * statement.cs (Throw.Resolve): Allow `throw null'.
13272
13273 2002-08-23  Martin Baulig  <martin@gnome.org>
13274
13275         * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
13276         EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
13277         `ee.EventInfo.DeclaringType == ec.ContainerType'.  The
13278         MemberLookup would return a wrong event if this is an explicit
13279         interface implementation and the class has an event with the same
13280         name.
13281
13282 2002-08-23  Martin Baulig  <martin@gnome.org>
13283
13284         * statement.cs (Block.AddChildVariableNames): New public method.
13285         (Block.AddChildVariableName): Likewise.
13286         (Block.IsVariableNameUsedInChildBlock): Likewise.
13287         (Block.AddVariable): Check whether a variable name has already
13288         been used in a child block.
13289
13290         * cs-parser.jay (declare_local_variables): Mark all variable names
13291         from the current block as being used in a child block in the
13292         implicit block.
13293
13294 2002-08-23  Martin Baulig  <martin@gnome.org>
13295
13296         * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
13297         find the symbol writer.
13298
13299         * driver.cs: csc also allows the arguments to /define being
13300         separated by commas, not only by semicolons.
13301
13302 2002-08-23  Martin Baulig  <martin@gnome.org>
13303
13304         * interface.cs (Interface.GetMembers): Added static check for events.
13305
13306 2002-08-15  Martin Baulig  <martin@gnome.org>
13307
13308         * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
13309         call, use ec.ContainerType.BaseType as queried_type and invocation_type.
13310
13311         * ecore.cs (Expression.MemberLookup): Added documentation and explained
13312         why the MethodData.EmitDestructor() change was necessary.
13313
13314 2002-08-20  Martin Baulig  <martin@gnome.org>
13315
13316         * class.cs (TypeContainer.FindMembers): Added static check for events.
13317
13318         * decl.cs (MemberCache.AddMembers): Handle events like normal members.
13319
13320         * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
13321         use Type.GetEvents(), not Type.FindMembers().
13322
13323 2002-08-20  Martin Baulig  <martin@gnome.org>
13324
13325         * decl.cs (MemberCache): Added a special method cache which will
13326         be used for method-only searched.  This ensures that a method
13327         search will return a MethodInfo with the correct ReflectedType for
13328         inherited methods.      
13329
13330 2002-08-20  Martin Baulig  <martin@gnome.org>
13331
13332         * decl.cs (DeclSpace.FindMembers): Made this public.
13333
13334 2002-08-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13335
13336         * delegate.cs: fixed build on windows.
13337         [FIXME:  Filed as bug #29150: MCS must report these errors.]
13338
13339 2002-08-19  Ravi Pratap  <ravi@ximian.com>
13340
13341         * ecore.cs (StandardConversionExists): Return a false
13342         if we are trying to convert the void type to anything else
13343         since that is not allowed.
13344
13345         * delegate.cs (DelegateInvocation.DoResolve): Ensure that
13346         we flag error 70 in the event an event is trying to be accessed
13347         directly from outside the declaring type.
13348
13349 2002-08-20  Martin Baulig  <martin@gnome.org>
13350
13351         * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
13352         MemberCache from typemanager.cs to decl.cs.
13353
13354 2002-08-19  Martin Baulig  <martin@gnome.org>
13355
13356         * class.cs (TypeContainer): Implement IMemberContainer.
13357         (TypeContainer.DefineMembers): Create the MemberCache.
13358         (TypeContainer.FindMembers): Do better BindingFlags checking; only
13359         return public members if BindingFlags.Public was given, check
13360         whether members are static.
13361
13362 2002-08-16  Martin Baulig  <martin@gnome.org>
13363
13364         * decl.cs (DeclSpace.Define): Splitted this in Define and
13365         DefineMembers.  DefineMembers is called first and initializes the
13366         MemberCache.
13367
13368         * rootcontext.cs (RootContext.DefineMembers): New function.  Calls
13369         DefineMembers() on all our DeclSpaces.
13370
13371         * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
13372         but call DefineMembers() on all nested interfaces.  We call their
13373         Define() in our new Define() function.
13374
13375         * interface.cs (Interface): Implement IMemberContainer.
13376         (Interface.Define): Moved all code except the attribute stuf to
13377         DefineMembers().
13378         (Interface.DefineMembers): Initialize the member cache.
13379
13380         * typemanager.cs (IMemberFinder): Removed this interface, we don't
13381         need this anymore since we can use MemberCache.FindMembers directly.
13382
13383 2002-08-19  Martin Baulig  <martin@gnome.org>
13384
13385         * typemanager.cs (MemberCache): When creating the cache for an
13386         interface type, add all inherited members.
13387         (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
13388         to `out bool used_cache' and documented it.
13389         (TypeManager.MemberLookup): If we already used the cache in the first
13390         iteration, we don't need to do the interfaces check.
13391
13392 2002-08-19  Martin Baulig  <martin@gnome.org>
13393
13394         * decl.cs (DeclSpace.FindMembers): New abstract method.  Moved this
13395         here from IMemberFinder and don't implement this interface anymore.
13396         (DeclSpace.MemberCache): Moved here from IMemberFinder.
13397
13398         * typemanager.cs (IMemberFinder): This interface is now only used by
13399         classes which actually support the member cache.
13400         (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
13401         since we only put DeclSpaces into this Hashtable.
13402         (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
13403         a dynamic type and TypeHandle.GetTypeHandle() otherwise.
13404
13405 2002-08-16  Martin Baulig  <martin@gnome.org>
13406
13407         * typemanager.cs (ICachingMemberFinder): Removed.
13408         (IMemberFinder.MemberCache): New property.
13409         (TypeManager.FindMembers): Merged this with RealFindMembers().
13410         This function will never be called from TypeManager.MemberLookup()
13411         so we can't use the cache here, just the IMemberFinder.
13412         (TypeManager.MemberLookup_FindMembers): Check whether the
13413         IMemberFinder has a MemberCache and call the cache's FindMembers
13414         function.
13415         (MemberCache): Rewrote larger parts of this yet another time and
13416         cleaned it up a bit.
13417
13418 2002-08-15  Miguel de Icaza  <miguel@ximian.com>
13419
13420         * driver.cs (LoadArgs): Support quoting.
13421
13422         (Usage): Show the CSC-like command line arguments.
13423
13424         Improved a few error messages.
13425
13426 2002-08-15  Martin Baulig  <martin@gnome.org>
13427
13428         * typemanager.cs (IMemberContainer.Type): New property.
13429         (IMemberContainer.IsInterface): New property.
13430
13431         The following changes are conditional to BROKEN_RUNTIME, which is
13432         defined at the top of the file.
13433
13434         * typemanager.cs (MemberCache.MemberCache): Don't add the base
13435         class'es members, but add all members from TypeHandle.ObjectType
13436         if we're an interface.
13437         (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
13438         is the current type.
13439         (MemberCache.CacheEntry.Container): Removed this field.
13440         (TypeHandle.GetMembers): Include inherited members.
13441
13442 2002-08-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13443
13444         * typemanager.cs: fixed compilation and added a comment on a field that
13445         is never used.
13446
13447 2002-08-15  Martin Baulig  <martin@gnome.org>
13448
13449         * class.cs (ConstructorInitializer.Resolve): In the
13450         Expression.MemberLookup call, use the queried_type as
13451         invocation_type.
13452
13453         * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
13454         declared' attribute, it's always true.
13455         (IMemberContainer.Parent, IMemberContainer.Name): New properties.
13456         (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
13457         temporary wrapper for FindMembers which tells MemberLookup whether
13458         members from the base classes are included in the return value.
13459         This will go away soon.
13460         (TypeManager.MemberLookup): Use this temporary hack here; once the
13461         new MemberCache is completed, we don't need to do the DeclaredOnly
13462         looping here anymore since the MemberCache will take care of this.
13463         (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
13464         (MemberCache): When creating the MemberCache for a class, get
13465         members from the current class and all its base classes.
13466         (MemberCache.CacheEntry.Container): New field.  This is a
13467         temporary hack until the Mono runtime is fixed to distinguish
13468         between ReflectedType and DeclaringType.  It allows us to use MCS
13469         with both the MS runtime and the unfixed Mono runtime without
13470         problems and without accecting performance.
13471         (MemberCache.SearchMembers): The DeclaredOnly looping from
13472         TypeManager.MemberLookup is now done here.      
13473
13474 2002-08-14  Martin Baulig  <martin@gnome.org>
13475
13476         * statement.cs (MyStructInfo.MyStructInfo): Don't call
13477         Type.GetFields on dynamic types but get the fields from the
13478         corresponding TypeContainer.
13479         (MyStructInfo.GetStructInfo): Added check for enum types.
13480
13481         * typemanager.cs (MemberList.IsSynchronized): Implemented.
13482         (MemberList.SyncRoot): Implemented.
13483         (TypeManager.FilterWithClosure): No need to check permissions if
13484         closure_start_type == closure_invocation_type, don't crash if
13485         closure_invocation_type is null.
13486
13487 2002-08-13  Martin Baulig  <martin@gnome.org>
13488
13489         Rewrote TypeContainer.FindMembers to use a member cache.  This
13490         gives us a speed increase of about 35% for the self-hosting MCS
13491         build and of about 15-20% for the class libs (both on GNU/Linux).
13492
13493         * report.cs (Timer): New class to get enhanced profiling.  This
13494         whole class is "TIMER" conditional since it remarkably slows down
13495         compilation speed.
13496
13497         * class.cs (MemberList): New class.  This is an IList wrapper
13498         which we're now using instead of passing MemberInfo[]'s around to
13499         avoid copying this array unnecessarily.
13500         (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
13501         (ICachingMemberFinder, IMemberContainer): New interface.
13502         (TypeManager.FilterWithClosure): If `criteria' is null, the name
13503         has already been checked, otherwise use it for the name comparision.
13504         (TypeManager.FindMembers): Renamed to RealMemberFinder and
13505         provided wrapper which tries to use ICachingMemberFinder.FindMembers
13506         if possible.  Returns a MemberList, not a MemberInfo [].
13507         (TypeHandle): New class, implements IMemberContainer.  We create
13508         one instance of this class per type, it contains a MemberCache
13509         which is used to do the member lookups.
13510         (MemberCache): New class.  Each instance of this class contains
13511         all members of a type and a name-based hash table.
13512         (MemberCache.FindMembers): This is our new member lookup
13513         function.  First, it looks up all members of the requested name in
13514         the hash table.  Then, it walks this list and sorts out all
13515         applicable members and returns them.
13516
13517 2002-08-13  Martin Baulig  <martin@gnome.org>
13518
13519         In addition to a nice code cleanup, this gives us a performance
13520         increase of about 1.4% on GNU/Linux - not much, but it's already
13521         half a second for the self-hosting MCS compilation.
13522
13523         * typemanager.cs (IMemberFinder): New interface.  It is used by
13524         TypeManager.FindMembers to call FindMembers on a TypeContainer,
13525         Enum, Delegate or Interface.
13526         (TypeManager.finder_to_member_finder): New PtrHashtable.
13527         (TypeManager.finder_to_container): Removed.
13528         (TypeManager.finder_to_delegate): Removed.
13529         (TypeManager.finder_to_interface): Removed.
13530         (TypeManager.finder_to_enum): Removed.
13531
13532         * interface.cs (Interface): Implement IMemberFinder.
13533
13534         * delegate.cs (Delegate): Implement IMemberFinder.
13535
13536         * enum.cs (Enum): Implement IMemberFinder.
13537
13538         * class.cs (TypeContainer): Implement IMemberFinder.
13539
13540 2002-08-12  Martin Baulig  <martin@gnome.org>
13541
13542         * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
13543
13544 2002-08-12  Martin Baulig  <martin@gnome.org>
13545
13546         * ecore.cs (ITypeExpression): New interface for expressions which
13547         resolve to a type.
13548         (TypeExpression): Renamed to TypeLookupExpression.
13549         (Expression.DoResolve): If we're doing a types-only lookup, the
13550         expression must implement the ITypeExpression interface and we
13551         call DoResolveType() on it.
13552         (SimpleName): Implement the new ITypeExpression interface.
13553         (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
13554         hack, the situation that we're only looking up types can't happen
13555         anymore when this method is called.  Moved the type lookup code to
13556         DoResolveType() and call it.
13557         (SimpleName.DoResolveType): This ITypeExpression interface method
13558         is now doing the types-only lookup.
13559         (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
13560         (ResolveFlags): Added MaskExprClass.
13561
13562         * expression.cs (MemberAccess): Implement the ITypeExpression
13563         interface.
13564         (MemberAccess.DoResolve): Added support for a types-only lookup
13565         when we're called via ITypeExpression.DoResolveType().
13566         (ComposedCast): Implement the ITypeExpression interface.
13567
13568         * codegen.cs (EmitContext.OnlyLookupTypes): Removed.  Call
13569         Expression.Resolve() with ResolveFlags.Type instead.
13570
13571 2002-08-12  Martin Baulig  <martin@gnome.org>
13572
13573         * interface.cs (Interface.Define): Apply attributes.
13574
13575         * attribute.cs (Attribute.ApplyAttributes): Added support for
13576         interface attributes.
13577
13578 2002-08-11  Martin Baulig  <martin@gnome.org>
13579
13580         * statement.cs (Block.Emit): Only check the "this" variable if we
13581         do not always throw an exception.
13582
13583         * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
13584         whether the property has a set accessor.
13585
13586 2002-08-11  Martin Baulig  <martin@gnome.org>
13587
13588         Added control flow analysis support for structs.
13589
13590         * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
13591         with control flow analysis turned off.
13592         (IVariable): New interface.
13593         (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
13594         returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
13595         (FieldExpr.DoResolve): Resolve the instance expression with flow
13596         analysis turned off and do the definite assignment check after the
13597         resolving when we know what the expression will resolve to.
13598
13599         * expression.cs (LocalVariableReference, ParameterReference):
13600         Implement the new IVariable interface, only call the flow analysis
13601         code if ec.DoFlowAnalysis is true.
13602         (This): Added constructor which takes a Block argument.  Implement
13603         the new IVariable interface.
13604         (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
13605         DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
13606         This does the definite assignment checks for struct members.
13607
13608         * class.cs (Constructor.Emit): If this is a non-static `struct'
13609         constructor which doesn't have any initializer, call
13610         Block.AddThisVariable() to tell the flow analysis code that all
13611         struct elements must be initialized before control returns from
13612         the constructor.
13613
13614         * statement.cs (MyStructInfo): New public class.
13615         (UsageVector.this [VariableInfo vi]): Added `int field_idx'
13616         argument to this indexer.  If non-zero, check an individual struct
13617         member, not the whole struct.
13618         (FlowBranching.CheckOutParameters): Check struct members.
13619         (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
13620         overloaded versions of these methods which take an additional
13621         `int field_idx' argument to check struct members.
13622         (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
13623         overloaded versions of these methods which take an additional
13624         `string field_name' argument to check struct member.s
13625         (VariableInfo): Implement the IVariable interface.
13626         (VariableInfo.StructInfo): New public property.  Returns the
13627         MyStructInfo instance of the variable if it's a struct or null.
13628         (Block.AddThisVariable): New public method.  This is called from
13629         Constructor.Emit() for non-static `struct' constructor which do
13630         not have any initializer.  It creates a special variable for the
13631         "this" instance variable which will be checked by the flow
13632         analysis code to ensure that all of the struct's fields are
13633         initialized before control returns from the constructor.
13634         (UsageVector): Added support for struct members.  If a
13635         variable/parameter is a struct with N members, we reserve a slot
13636         in the usage vector for each member.  A struct is considered fully
13637         initialized if either the struct itself (slot 0) or all its
13638         members are initialized.
13639
13640 2002-08-08  Martin Baulig  <martin@gnome.org>
13641
13642         * driver.cs (Driver.MainDriver): Only report an error CS5001
13643         if there were no compilation errors.
13644
13645         * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
13646         `UnsafeContext' property to determine whether the parent is in
13647         unsafe context rather than checking the parent's ModFlags:
13648         classes nested in an unsafe class are unsafe as well.
13649
13650 2002-08-08  Martin Baulig  <martin@gnome.org>
13651
13652         * statement.cs (UsageVector.MergeChildren): Distinguish between
13653         `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
13654         we return.  Added test17() and test18() to test-154.cs.
13655
13656 2002-08-08  Martin Baulig  <martin@gnome.org>
13657
13658         * typemanager.cs (TypeManager.FilterWithClosure): If we have
13659         Family access, make sure the invoking type isn't a subclass of the
13660         queried type (that'd be a CS1540).
13661
13662         * ecore.cs (Expression.MemberLookup): Added overloaded version of
13663         this method which takes an additional `Type invocation_type'.
13664
13665         * expression.cs (BaseAccess.DoResolve): Use the base type as
13666         invocation and query type.
13667         (MemberAccess.DoResolve): If the lookup failed and we're about to
13668         report a CS0122, try a lookup with the ec.ContainerType - if this
13669         succeeds, we must report a CS1540.
13670
13671 2002-08-08  Martin Baulig  <martin@gnome.org>
13672
13673         * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
13674         (MethodGroupExpr): Implement the IMemberExpr interface.
13675
13676         * expression (MemberAccess.ResolveMemberAccess): No need to have
13677         any special code for MethodGroupExprs anymore, they're now
13678         IMemberExprs.   
13679
13680 2002-08-08  Martin Baulig  <martin@gnome.org>
13681
13682         * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
13683         Family, FamANDAssem and FamORAssem permissions.
13684         (TypeManager.IsSubclassOrNestedChildOf): New public method.
13685
13686 2002-08-08  Martin Baulig  <martin@gnome.org>
13687
13688         * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
13689         (UsageVector.MergeChildren): `break' breaks unless we're in a switch
13690         or loop block.
13691
13692 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
13693
13694         * driver.cs: implemented /resource option to embed managed resources.
13695
13696 2002-08-07  Martin Baulig  <martin@gnome.org>
13697
13698         * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
13699         (FieldBase.HasFieldInitializer): New public property.
13700         (FieldBase.GetInitializerExpression): New public method.  Resolves and
13701         returns the field initializer and makes sure it is only resolved once.
13702         (TypeContainer.EmitFieldInitializers): Call
13703         FieldBase.GetInitializerExpression to get the initializer, this ensures
13704         that it isn't resolved multiple times.
13705
13706         * codegen.cs (EmitContext): Added `bool IsFieldInitialier'.  This tells
13707         the resolving process (SimpleName/MemberLookup) that we're currently
13708         emitting a field initializer (which must not access any instance members,
13709         this is an error CS0236).
13710
13711         * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
13712         argument, if the `IsFieldInitializer' flag is set, we must report and
13713         error CS0236 and not an error CS0120.   
13714
13715 2002-08-07  Martin Baulig  <martin@gnome.org>
13716
13717         * ecore.cs (IMemberExpr): New public interface.
13718         (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
13719         (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
13720         if the expression is an IMemberExpr.
13721
13722         * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
13723         to be null, implicitly default to `this' if we're non-static in
13724         this case.  Simplified the code a lot by using the new IMemberExpr
13725         interface.  Also fixed bug #28176 here.
13726
13727 2002-08-06  Martin Baulig  <martin@gnome.org>
13728
13729         * cs-parser.jay (SimpleLookup): Removed.  We need to create
13730         ParameterReferences during semantic analysis so that we can do a
13731         type-only search when resolving Cast, TypeOf and SizeOf.
13732         (block): Pass the `current_local_parameters' to the Block's
13733         constructor.
13734
13735         * class.cs (ConstructorInitializer): Added `Parameters parameters'
13736         argument to the constructor.
13737         (ConstructorInitializer.Resolve): Create a temporary implicit
13738         block with the parameters.
13739
13740         * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
13741         references here if we aren't doing a type-only search.
13742
13743         * statement.cs (Block): Added constructor which takes a
13744         `Parameters parameters' argument.
13745         (Block.Parameters): New public property.
13746
13747         * support.cs (InternalParameters.Parameters): Renamed `parameters'
13748         to `Parameters' and made it public readonly.
13749
13750 2002-08-06  Martin Baulig  <martin@gnome.org>
13751
13752         * ecore.cs (Expression.Warning): Made this public as well.
13753
13754         * report.cs (Report.Debug): Print the contents of collections.
13755
13756 2002-08-06  Martin Baulig  <martin@gnome.org>
13757
13758         * ecore.cs (Expression.ResolveFlags): New [Flags] enum.  This is
13759         used to tell Resolve() which kinds of expressions it may return.
13760         (Expression.Resolve): Added overloaded version of this method which
13761         takes a `ResolveFlags flags' argument.  This can be used to tell
13762         Resolve() which kinds of expressions it may return.  Reports a
13763         CS0118 on error.
13764         (Expression.ResolveWithSimpleName): Removed, use Resolve() with
13765         ResolveFlags.SimpleName.
13766         (Expression.Error118): Added overloaded version of this method which
13767         takes a `ResolveFlags flags' argument.  It uses the flags to determine
13768         which kinds of expressions are allowed.
13769
13770         * expression.cs (Argument.ResolveMethodGroup): New public method.
13771         Resolves an argument, but allows a MethodGroup to be returned.
13772         This is used when invoking a delegate.
13773
13774         * TODO: Updated a bit.
13775
13776 2002-08-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13777
13778         Fixed compilation with csc.
13779
13780         * ecore.cs: Expression.Error made public. Is this correct? Should
13781         Warning be made public too?
13782
13783         * expression.cs: use ea.Location instead of ea.loc.
13784         [FIXME:  Filed as bug #28607: MCS must report these errors.]
13785
13786 2002-08-06  Martin Baulig  <martin@gnome.org>
13787
13788         * ecore.cs (Expression.loc): Moved the location here instead of
13789         duplicating it in all derived classes.
13790         (Expression.Location): New public property.
13791         (Expression.Error, Expression.Warning): Made them non-static and
13792         removed the location argument.
13793         (Expression.Warning): Added overloaded version which takes an
13794         `int level' argument.
13795         (Expression.Error118): Make this non-static and removed the
13796         expression and location arguments.
13797         (TypeExpr): Added location argument to the constructor.
13798
13799         * expression.cs (StaticCallExpr): Added location argument to
13800         the constructor.
13801         (Indirection, PointerArithmetic): Likewise.
13802         (CheckedExpr, UnCheckedExpr): Likewise.
13803         (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
13804         (StringPtr): Likewise.
13805
13806
13807 2002-08-05  Martin Baulig  <martin@gnome.org>
13808
13809         * expression.cs (BaseAccess.DoResolve): Actually report errors.
13810
13811         * assign.cs (Assign.DoResolve): Check whether the source
13812         expression is a value or variable.
13813
13814         * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
13815         while resolving the corresponding blocks.
13816
13817         * interface.cs (Interface.GetInterfaceTypeByName): Actually report
13818         an error, don't silently return null.
13819
13820         * statement.cs (Block.AddVariable): Do the error reporting here
13821         and distinguish between CS0128 and CS0136.
13822         (Block.DoResolve): Report all unused labels (warning CS0164).
13823         (LabeledStatement): Pass the location to the constructor.
13824         (LabeledStatement.HasBeenReferenced): New property.
13825         (LabeledStatement.Resolve): Set it to true here.
13826
13827         * statement.cs (Return.Emit): Return success even after reporting
13828         a type mismatch error (CS0126 or CS0127), this is what csc does and
13829         it avoids confusing the users with any consecutive errors.
13830
13831 2002-08-05  Martin Baulig  <martin@gnome.org>
13832
13833         * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
13834
13835         * const.cs (Const.LookupConstantValue): Catch circular definitions.
13836
13837         * expression.cs (MemberAccess.DoResolve): Silently return if an
13838         error has already been reported.
13839
13840         * ecore.cs (Expression.MemberLookupFinal): Silently return if an
13841         error has already been reported.
13842
13843 2002-08-05  Martin Baulig  <martin@gnome.org>
13844
13845         * statement.cs (UsageVector): Only initialize the `parameters'
13846         vector if we actually have any "out" parameters.
13847
13848 2002-08-05  Martin Baulig  <martin@gnome.org>
13849
13850         * expression.cs (Binary.ResolveOperator): When combining delegates,
13851         they must have the same type.
13852
13853 2002-08-05  Martin Baulig  <martin@gnome.org>
13854
13855         * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
13856         PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
13857         work with the ms runtime and we also don't need it: if we're a
13858         PropertyBuilder and not in the `indexer_arguments' hash, then we
13859         are a property and not an indexer.
13860
13861         * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
13862         Type.IsPointer and Type.IsByRef instead of Type.HasElementType
13863         since the latter one doesn't work with the ms runtime.
13864
13865 2002-08-03  Martin Baulig  <martin@gnome.org>
13866
13867         Fixed bugs #27998 and #22735.
13868
13869         * class.cs (Method.IsOperator): New public field.
13870         (Method.CheckBase): Report CS0111 if there's already a method
13871         with the same parameters in the current class.  Report CS0508 when
13872         attempting to change the return type of an inherited method.
13873         (MethodData.Emit): Report CS0179 if a method doesn't have a body
13874         and it's not marked abstract or extern.
13875         (PropertyBase): New abstract base class for Property and Indexer.
13876         (PropertyBase.CheckBase): Moved here from Property and made it work
13877         for indexers.
13878         (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
13879         the same so we can reuse it there.
13880         (Property, Indexer): Derive from PropertyBase.
13881         (MethodSignature.inheritable_property_signature_filter): New delegate
13882         to find properties and indexers.
13883
13884         * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
13885         argument and improved error reporting.
13886
13887         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
13888         EmptyReadOnlyParameters and made it a property.
13889
13890         * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
13891         version of this method which takes a `PropertyInfo indexer'.
13892         (TypeManager.RegisterIndexer): New method.
13893
13894         * class.cs: Added myself as author of this file :-)
13895
13896 2002-08-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13897
13898         * class.cs: fixed compilation on windoze.
13899
13900 2002-08-03  Martin Baulig  <martin@gnome.org>
13901
13902         * interface.cs (Interface.GetInterfaceBases): Check whether all
13903         base interfaces are at least as accessible than the current one.
13904
13905         * class.cs (TypeContainer.GetClassBases): Check whether base types
13906         are at least as accessible than the current type.
13907         (TypeContainer.AsAccessible): Implemented and made non-static.
13908         (MemberBase.CheckParameters): Report errors if the accessibility
13909         checks fail.
13910
13911         * delegate.cs (Delegate.Delegate): The default visibility is
13912         internal for top-level types and private for nested types.
13913         (Delegate.Define): Report errors if the accessibility checks fail.
13914
13915         * enum.cs (Enum.Enum): The default visibility is internal for
13916         top-level types and private for nested types.
13917         (Enum.DefineType): Compute the correct visibility.
13918
13919         * modifiers.cs (Modifiers.TypeAttr): Added a version of this
13920         function which takes a `bool is_toplevel' instead of a TypeContainer.
13921
13922         * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
13923         builtin type.
13924
13925 2002-08-02  Martin Baulig  <martin@gnome.org>
13926
13927         * expression.cs (LocalVariableReferenc): Added constructor which
13928         takes additional `VariableInfo vi' and `bool is_readonly' arguments.
13929         (LocalVariableReference.IsReadOnly): New property.
13930         (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
13931         variable is readonly, use our own readonly flag to do this; you can
13932         use the new constructor to get a writable reference to a read-only
13933         variable.
13934
13935         * cs-parser.jay (foreach_statement, using_statement): Get a writable
13936         reference to the local variable.
13937
13938 2002-08-01  Miguel de Icaza  <miguel@ximian.com>
13939
13940         * rootcontext.cs (ResolveCore): Also include System.Exception
13941
13942         * statement.cs (Block.Emit): Do not emit the dead-code warnings if
13943         we reach an EmptyStatement.
13944
13945         (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
13946         is also fine.
13947
13948         * expression.cs (Binary.ResolveOperator): Check error result in
13949         two places.
13950
13951         use brtrue/brfalse directly and avoid compares to null.
13952
13953 2002-08-02  Martin Baulig  <martin@gnome.org>
13954
13955         * class.cs (TypeContainer.Define): Define all nested interfaces here.
13956         Fixes bug #28407, added test-155.cs.
13957
13958 2002-08-01  Martin Baulig  <martin@gnome.org>
13959
13960         * class.cs (Event.EmitDefaultMethod): Make this work with static
13961         events.  Fixes #28311, added verify-3.cs.
13962
13963 2002-08-01  Martin Baulig  <martin@gnome.org>
13964
13965         * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
13966         `is_disposable' fields.
13967         (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
13968         `hm.is_disposable' if we're using the collection pattern.
13969         (Foreach.EmitCollectionForeach): Use the correct type for the
13970         enumerator's local variable, only emit the try/finally block if
13971         necessary (fixes #27713).
13972
13973 2002-08-01  Martin Baulig  <martin@gnome.org>
13974
13975         * ecore.cs (Expression.report118): Renamed to Error118 and made
13976         it public static.
13977
13978         * statement.cs (Throw.Resolve): Check whether the expression is of
13979         the correct type (CS0118) and whether the type derives from
13980         System.Exception (CS0155).
13981         (Catch.Resolve): New method.  Do the type lookup here and check
13982         whether it derives from System.Exception (CS0155).
13983         (Catch.CatchType, Catch.IsGeneral): New public properties.
13984
13985         * typemanager.cs (TypeManager.exception_type): Added.
13986
13987 2002-07-31  Miguel de Icaza  <miguel@ximian.com>
13988
13989         * driver.cs: Updated About function.
13990
13991 2002-07-31  Martin Baulig  <martin@gnome.org>
13992
13993         Implemented Control Flow Analysis.
13994
13995         * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
13996         (EmitContext.CurrentBranching): Added.
13997         (EmitContext.StartFlowBranching): Added.
13998         (EmitContext.EndFlowBranching): Added.
13999         (EmitContext.KillFlowBranching): Added.
14000         (EmitContext.IsVariableAssigned): Added.
14001         (EmitContext.SetVariableAssigned): Added.
14002         (EmitContext.IsParameterAssigned): Added.
14003         (EmitContext.SetParameterAssigned): Added.
14004         (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
14005         Added control flow analysis stuff here.
14006
14007         * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
14008         resolve the expression as lvalue.
14009         (LocalVariableReference.DoResolve): Check whether the variable has
14010         already been assigned.
14011         (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
14012         the parameter as assigned here.
14013         (ParameterReference.DoResolve): Check whether the parameter has already
14014         been assigned.
14015         (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
14016         expression as lvalue.
14017
14018         * statement.cs (FlowBranching): New class for the flow analysis code.
14019         (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
14020         (LabeledStatement.IsDefined): New public property.
14021         (LabeledStatement.AddUsageVector): New public method to tell flow
14022         analyis that the label may be reached via a forward jump.
14023         (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
14024         flow analysis.
14025         (VariableInfo.Number): New public field.  This is used by flow analysis
14026         to number all locals of a block.
14027         (Block.CountVariables): New public property.  This is the number of
14028         local variables in this block (including the locals from all parent
14029         blocks).
14030         (Block.EmitMeta): Number all the variables.
14031
14032         * statement.cs: Added flow analysis support to all classes.
14033
14034 2002-07-31  Martin Baulig  <martin@gnome.org>
14035
14036         * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
14037         To get debugging messages, compile mcs with /define:MCS_DEBUG and
14038         then use this argument.
14039
14040         * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
14041
14042         * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
14043         use this to specify /define options.
14044
14045 2002-07-29  Martin Baulig  <martin@gnome.org>
14046
14047         * statement.cs (Fixed): Moved all code that does variable lookups
14048         and resolvings from Emit to Resolve.
14049
14050         * statement.cs (For): Moved all code that does variable lookups
14051         and resolvings from Emit to Resolve.
14052
14053         * statement.cs (Using): Moved all code that does variable lookups
14054         and resolvings from Emit to Resolve.
14055
14056 2002-07-29  Martin Baulig  <martin@gnome.org>
14057
14058         * attribute.cs (Attribute.Resolve): Explicitly catch a
14059         System.NullReferenceException when creating the
14060         CustromAttributeBuilder and report a different warning message.
14061
14062 2002-07-29  Martin Baulig  <martin@gnome.org>
14063
14064         * support.cs (ParameterData.ParameterName): Added method to
14065         get the name of a parameter.
14066
14067         * typemanager.cs (TypeManager.IsValueType): New public method.
14068
14069 2002-07-29  Martin Baulig  <martin@gnome.org>
14070
14071         * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'.  This
14072         is a flag which specifies that it's either ref or out.
14073         (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
14074         the out parameter to `out Parameter.Modifier mod', also set the
14075         Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
14076
14077         * support.cs (InternalParameters.ParameterModifier): Distinguish
14078         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
14079         Parameter.Modifier.ISBYREF flag if it's either ref or out.
14080
14081         * expression.cs (Argument.GetParameterModifier): Distinguish
14082         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
14083         Parameter.Modifier.ISBYREF flag if it's either ref or out.
14084
14085 2002-07-29  Martin Baulig  <martin@gnome.org>
14086
14087         * expression.cs (ParameterReference.ParameterReference): Added
14088         `Location loc' argument to the constructor.
14089
14090         * cs-parser.jay: Pass location to ParameterReference.
14091
14092 2002-07-28  Miguel de Icaza  <miguel@ximian.com>
14093
14094         * statement.cs (Try): Initialize the location.
14095
14096         * cs-parser.jay: pass location to Try.
14097
14098         * expression.cs (Unary.Reduce): Change the prototype to return
14099         whether a constant fold could be performed or not.  The result is
14100         returned in an out parameters.  In the case of Indirection and
14101         AddressOf, we want to perform the full tests.
14102
14103 2002-07-26  Miguel de Icaza  <miguel@ximian.com>
14104
14105         * statement.cs (Statement.Emit): Flag dead code.
14106
14107 2002-07-27  Andrew Birkett  <andy@nobugs.org>
14108
14109         * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
14110
14111 2002-07-27  Martin Baulig  <martin@gnome.org>
14112
14113         * class.cs (MethodData.Define): Put back call to
14114         TypeManager.AddMethod(), accidentally commented this out.
14115
14116         * report.cs (Debug): New public method to print debugging information,
14117         this is `[Conditional ("DEBUG")]'.
14118
14119 2002-07-26  Martin Baulig  <martin@gnome.org>
14120
14121         * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
14122         (switch_statement): Push the current_block to the switch_stack and
14123         pop it again when we're done with the switch.
14124         (switch_section): The new block is a child of the current_block.
14125         Fixes bug #24007, added test-152.cs.
14126
14127 2002-07-27  Martin Baulig  <martin@gnome.org>
14128
14129         * expression.cs (Invocation.EmitArguments): When calling a varargs
14130         function with only its fixed arguments, we need to pass an empty
14131         array.
14132
14133 2002-07-27  Martin Baulig  <martin@gnome.org>
14134
14135         Mono 0.13 has been released.
14136
14137 2002-07-25  Miguel de Icaza  <miguel@ximian.com>
14138
14139         * driver.cs: Rename --resource to --linkres, because that is what
14140         we do currently, we dont support --resource yet.
14141
14142         * cs-tokenizer.cs: Fix test for reporting endif mismatches.
14143
14144 2002-07-25  Martin Baulig  <martin@gnome.org>
14145
14146         * class.cs (MethodData): New public class.  This is a `method builder'
14147         class for a method or one accessor of a Property/Indexer/Event.
14148         (MethodData.GetMethodFlags): Moved here from MemberBase.
14149         (MethodData.ApplyAttributes): Likewise.
14150         (MethodData.ApplyObsoleteAttribute): Likewise.
14151         (MethodData.ApplyConditionalAttribute): Likewise.
14152         (MethodData.ApplyDllImportAttribute): Likewise.
14153         (MethodData.CheckAbstractAndExternal): Likewise.
14154         (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
14155         (MethodData.Emit): Formerly known as Method.Emit().
14156         (MemberBase): Moved everything which was specific to a single
14157         accessor/method to MethodData.
14158         (Method): Create a new MethodData and call Define() and Emit() on it.
14159         (Property, Indexer, Event): Create a new MethodData objects for each
14160         accessor and call Define() and Emit() on them.
14161
14162 2002-07-25  Martin Baulig  <martin@gnome.org>
14163
14164         Made MethodCore derive from MemberBase to reuse the code from there.
14165         MemberBase now also checks for attributes.
14166
14167         * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
14168         (MemberBase.GetMethodFlags): Moved here from class Method and marked
14169         as virtual.
14170         (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
14171         `CallingConventions cc' and `Attributes opt_attrs' arguments.
14172         (MemberBase.ApplyAttributes): New virtual method; applies the
14173         attributes to a method or accessor.
14174         (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
14175         (MemberBase.ApplyConditionalAttribute): Likewise.
14176         (MemberBase.ApplyDllImportAttribute): Likewise.
14177         (MemberBase.CheckAbstractAndExternal): Likewise.
14178         (MethodCore.ParameterTypes): This is now a property instead of a
14179         method, it's initialized from DoDefineParameters().
14180         (MethodCore.ParameterInfo): Removed the set accessor.
14181         (MethodCore.DoDefineParameters): New protected virtual method to
14182         initialize ParameterTypes and ParameterInfo.
14183         (Method.GetReturnType): We can now simply return the MemberType.
14184         (Method.GetMethodFlags): Override the MemberBase version and add
14185         the conditional flags.
14186         (Method.CheckBase): Moved some code from Define() here, call
14187         DoDefineParameters() here.
14188         (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
14189         here to avoid some larger code duplication.
14190         (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
14191         ensure that abstract and external accessors don't declare a body.
14192
14193         * attribute.cs (Attribute.GetValidPieces): Make this actually work:
14194         `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
14195         lookup in the attribute's parent classes, so we need to abort as soon
14196         as we found the first match.
14197         (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
14198         the attribute has no arguments.
14199
14200         * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
14201         of a Method.
14202
14203 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14204
14205         * cs-parser.jay: reverted previous patch.
14206
14207 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14208
14209         * cs-parser.jay: fixed bug #22119.
14210
14211 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14212
14213         * attribute.cs: fixed compilation. The error was:
14214         "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must 
14215         be assigned to before control leaves the current method."
14216         [FIXME:  Filed as bug #28186: MCS must report this error.]
14217
14218 2002-07-25  Martin Baulig  <martin@gnome.org>
14219
14220         * attribute.cs (Attribute.Conditional_GetConditionName): New static
14221         method to pull the condition name ouf of a Conditional attribute.
14222         (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
14223         the obsolete message and error flag out of an Obsolete attribute.
14224
14225         * class.cs (Method.GetMethodFlags): New public method to get the
14226         TypeManager.MethodFlags for this method.
14227         (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
14228         private methods.
14229         (Method.Define): Get and apply the Obsolete and Conditional attributes;
14230         if we're overriding a virtual function, set the new private variable
14231         `parent_method'; call the new TypeManager.AddMethod().
14232
14233         * typemanager.cs (TypeManager.AddMethod): New static method.  Stores
14234         the MethodBuilder and the Method in a PtrHashtable.
14235         (TypeManager.builder_to_method): Added for this purpose.
14236         (TypeManager.MethodFlags): Added IsObsoleteError.
14237         (TypeManager.GetMethodFlags): Added `Location loc' argument.  Lookup
14238         Obsolete and Conditional arguments in MethodBuilders.  If we discover
14239         an Obsolete attribute, emit an appropriate warning 618 / error 619 with
14240         the message from the attribute.
14241
14242 2002-07-24  Martin Baulig  <martin@gnome.org>
14243
14244         * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
14245         preprocessor directives, ensure that the argument to #define/#undef is
14246         exactly one identifier and that it's actually an identifier.
14247
14248         Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
14249         did not work ....
14250
14251 2002-07-24  Martin Baulig  <martin@gnome.org>
14252
14253         * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
14254         initialize it to TypeManager.object_type in the constructor.
14255         (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
14256         of the `hm.get_current' method if we're using the collection pattern.
14257         (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
14258         for the explicit conversion to make it work when we're using the collection
14259         pattern and the `Current' property has a different return type than `object'.
14260         Fixes #27713.
14261
14262 2002-07-24  Martin Baulig  <martin@gnome.org>
14263
14264         * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
14265         does not match, but don't report any errors.  This method is called in
14266         order for all methods in a MethodGroupExpr until a matching method is
14267         found, so we don't want to bail out if the first method doesn't match.
14268         (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
14269         matches, report the 123.  Fixes #28070.
14270
14271 2002-07-24  Martin Baulig  <martin@gnome.org>
14272
14273         * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
14274         TypeManager.TypeToCoreType() to the top of the method so the
14275         following equality checks will work.  Fixes #28107.
14276
14277 2002-07-24  Martin Baulig  <martin@gnome.org>
14278
14279         * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
14280         operand is of type uint, and the other operand is of type sbyte,
14281         short or int, the operands are converted to type long." -
14282         Actually do what this comment already told us.  Fixes bug #28106,
14283         added test-150.cs.
14284
14285 2002-07-24  Martin Baulig  <martin@gnome.org>
14286
14287         * class.cs (MethodBase): New abstract class.  This is now a base
14288         class for Property, Indexer and Event to avoid some code duplication
14289         in their Define() and DefineMethods() methods.
14290         (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
14291         generic methods for Define() and DefineMethods().
14292         (FieldBase): Derive from MemberBase, not MemberCore.
14293         (Property): Derive from MemberBase, not MemberCore.
14294         (Property.DefineMethod): Moved all the code from this method to the
14295         new MethodBase.DefineAccessor(), just call it with appropriate
14296         argumetnts.
14297         (Property.Define): Call the new Property.DoDefine(), this does some
14298         sanity checks and we don't need to duplicate the code everywhere.
14299         (Event): Derive from MemberBase, not MemberCore.
14300         (Event.Define): Use the new MethodBase.DefineAccessor() to define the
14301         accessors, this will also make them work with interface events.
14302         (Indexer): Derive from MemberBase, not MemberCore.
14303         (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
14304         (Indexer.Define): Use the new MethodBase functions.
14305
14306         * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
14307         argument to the constructor.
14308         (Interface.FindMembers): Added support for interface events.
14309         (Interface.PopluateEvent): Implemented.
14310
14311         Added test-149.cs for this.  This also fixes bugs #26067 and #24256.
14312
14313 2002-07-22  Miguel de Icaza  <miguel@ximian.com>
14314
14315         * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
14316         but this is required to check for a method name being the same as
14317         the containing class.  
14318
14319         Handle this now.
14320
14321 2002-07-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14322
14323         * interface.cs: initialize variable.
14324
14325 2002-07-23  Martin Baulig  <martin@gnome.org>
14326
14327         Implemented the IndexerName attribute in interfaces.
14328
14329         * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
14330         name if this is an explicit interface implementation.
14331         (Indexer.InterfaceIndexerName): New public variable.  If we're
14332         implementing an interface indexer, this is the IndexerName in that
14333         interface.  Otherwise, it's the IndexerName.
14334         (Indexer.DefineMethod): If we're implementing interface indexer,
14335         set InterfaceIndexerName.  Use the new Pending.IsInterfaceIndexer
14336         and Pending.ImplementIndexer methods.
14337         (Indexer.Define): Also define the PropertyBuilder if we're
14338         implementing an interface indexer and this is neither an explicit
14339         interface implementation nor do the IndexerName match the one in
14340         the interface.
14341
14342         * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
14343         If a method is defined here, then we always need to create a proxy
14344         for it.  This is used when implementing interface indexers.
14345         (Pending.IsInterfaceIndexer): New public method.
14346         (Pending.ImplementIndexer): New public method.
14347         (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
14348         This is used when implementing interface indexers to define a proxy
14349         if necessary.
14350         (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
14351         define a proxy if necessary.
14352
14353         * interface.cs (Interface.IndexerName): New public variable.
14354         (Interface.PopulateIndexer): Set the IndexerName.
14355         (Interface.DefineIndexers): New private method.  Populate all the
14356         indexers and make sure their IndexerNames match.
14357
14358         * typemanager.cs (IndexerPropertyName): Added support for interface
14359         indexers.
14360
14361 2002-07-22  Martin Baulig  <martin@gnome.org>
14362
14363         * codegen.cs (EmitContext.HasReturnLabel): New public variable.
14364         (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
14365         ret if HasReturnLabel.
14366         (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
14367         variables.
14368
14369         * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
14370         and set the ec.LoopBeginTryCatchLevel.
14371         (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
14372         (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
14373         the current ec.TryCatchLevel, the branch goes out of an exception
14374         block.  In this case, we need to use Leave and not Br.
14375
14376 2002-07-22  Martin Baulig  <martin@gnome.org>
14377
14378         * statement.cs (Try.Emit): Emit an explicit ret after the end of the
14379         block unless the block does not always return or it is contained in
14380         another try { ... } catch { ... } block.  Fixes bug #26506.
14381         Added verify-1.cs to the test suite.
14382
14383 2002-07-22  Martin Baulig  <martin@gnome.org>
14384
14385         * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
14386         then we do not always return.  Fixes bug #24985.
14387
14388 2002-07-22  Martin Baulig  <martin@gnome.org>
14389
14390         * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
14391         lookup on a per-class level; ie. walk up the class hierarchy until we
14392         found at least one applicable method, then choose the best among them.
14393         Fixes bug #24463 and test-29.cs.
14394
14395 2002-07-22  Martin Baulig  <martin@gnome.org>
14396
14397         * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
14398         return types of the methods.  The return type is not part of the
14399         signature and we must not check it to make the `new' modifier work.
14400         Fixes bug #27999, also added test-147.cs.
14401         (TypeManager.TypeToCoreType): Added TypeManager.type_type.
14402
14403         * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
14404         on the method's return type.
14405
14406 2002-07-21  Martin Baulig  <martin@gnome.org>
14407
14408         * assign.cs: Make this work if the rightmost source is a constant and
14409         we need to do an implicit type conversion.  Also adding a few more tests
14410         to test-38.cs which should have caught this.
14411
14412         * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
14413         target in the makefile for this.  The makefile.gnu is primarily intended
14414         for end-users who don't want to debug the compiler.
14415
14416 2002-07-21  Martin Baulig  <martin@gnome.org>
14417
14418         * assign.cs: Improved the Assign class so it can now handle embedded
14419         assignments (X = Y = Z = something).  As a side-effect this'll now also
14420         consume less local variables.  test-38.cs now passes with MCS, added
14421         a few new test cases to that test.
14422
14423 2002-07-20  Martin Baulig  <martin@gnome.org>
14424
14425         * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
14426         instructions.  Fixes bug #27977, also added test-146.cs.
14427
14428 2002-07-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14429
14430         * cs-tokenizer.cs: fixed getHex ().
14431
14432 2002-07-19  Martin Baulig  <martin@gnome.org>
14433
14434         * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
14435         not Type.GetType() to lookup the array type.  This is needed when
14436         we're constructing an array of a user-defined type.
14437         (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
14438         single-dimensional arrays, but also for single-dimensial arrays of
14439         type decimal.
14440
14441 2002-07-19  Martin Baulig  <martin@gnome.org>
14442
14443         * expression.cs (New.DoEmit): Create a new LocalTemporary each time
14444         this function is called, it's not allowed to share LocalBuilders
14445         among ILGenerators.
14446
14447 2002-07-19  Martin Baulig  <martin@gnome.org>
14448
14449         * expression.cs (Argument.Resolve): Report an error 118 when trying
14450         to pass a type as argument.
14451
14452 2002-07-18  Martin Baulig  <martin@gnome.org>
14453
14454         * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
14455         Conv_R_Un for the signed `long' type.
14456
14457 2002-07-15  Miguel de Icaza  <miguel@ximian.com>
14458
14459         * expression.cs (MemberAccess.DoResolve): Do not reuse the field
14460         `expr' for the temporary result, as that will fail if we do
14461         multiple resolves on the same expression.
14462
14463 2002-07-05  Miguel de Icaza  <miguel@ximian.com>
14464
14465         * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
14466         ec.TypeContainer for looking up aliases. 
14467
14468         * class.cs (TypeContainer): Remove LookupAlias from here.
14469
14470         * decl.cs (DeclSpace); Move here.
14471
14472 2002-07-01  Miguel de Icaza  <miguel@ximian.com>
14473
14474         * class.cs (FindMembers): Only call filter if the constructor
14475         bulider is not null.
14476
14477         Also handle delegates in `NestedTypes' now.  Now we will perform
14478         type lookups using the standard resolution process.  This also
14479         fixes a bug.
14480
14481         * decl.cs (DeclSpace.ResolveType): New type resolution routine.
14482         This uses Expressions (the limited kind that can be parsed by the
14483         tree) instead of strings.
14484
14485         * expression.cs (ComposedCast.ToString): Implement, used to flag
14486         errors since now we have to render expressions.
14487
14488         (ArrayCreation): Kill FormElementType.  Use ComposedCasts in
14489         FormArrayType. 
14490
14491         * ecore.cs (SimpleName.ToString): ditto.
14492
14493         * cs-parser.jay: Instead of using strings to assemble types, use
14494         Expressions to assemble the type (using SimpleName, ComposedCast,
14495         MemberAccess).  This should fix the type lookups in declarations,
14496         because we were using a different code path for this.
14497
14498         * statement.cs (Block.Resolve): Continue processing statements
14499         even when there is an error.
14500
14501 2002-07-17  Miguel de Icaza  <miguel@ximian.com>
14502
14503         * class.cs (Event.Define): Also remove the `remove' method from
14504         the list of pending items.
14505
14506         * expression.cs (ParameterReference): Use ldarg.N (0..3) to
14507         generate more compact code. 
14508
14509 2002-07-17  Martin Baulig  <martin@gnome.org>
14510
14511         * const.cs (Const.LookupConstantValue): Add support for constant
14512         `unchecked' and `checked' expressions.
14513         Also adding test case test-140.cs for this.
14514
14515 2002-07-17  Martin Baulig  <martin@gnome.org>
14516
14517         * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
14518         check whether mi.ReturnType implements the IEnumerator interface; the
14519         `==' and the IsAssignableFrom() will fail in this situation.
14520
14521 2002-07-16  Ravi Pratap  <ravi@ximian.com>
14522
14523         * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix 
14524         here too.
14525
14526 2002-07-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14527
14528         * expression.cs: fixed bug #27811.
14529
14530 2002-07-14  Miguel de Icaza  <miguel@ximian.com>
14531
14532         * expression.cs (ParameterReference.AddressOf): Patch from Paolo
14533         Molaro: when we are a ref, the value already contains a pointer
14534         value, do not take the address of it.
14535
14536 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
14537         * removed mb-parser.jay and mb-tokenizer.cs
14538
14539 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
14540
14541         * expression.cs: check against the building corlib void type.
14542
14543 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
14544
14545         * ecore.cs: fix for valuetype static readonly fields: when 
14546         initializing them, we need their address, not the address of a copy.
14547
14548 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
14549
14550         * typemanager.cs: register also enum_type in corlib.
14551
14552 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
14553
14554         * class.cs: allow calling this (but not base) initializers in structs.
14555
14556 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
14557
14558         * ecore.cs: make sure we compare against the building base types
14559         in GetTypeSize ().
14560
14561 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
14562
14563         * typemanager.cs: fix TypeToCoreType() to handle void and object
14564         (corlib gets no more typerefs after this change).
14565
14566 2002-07-12  Miguel de Icaza  <miguel@ximian.com>
14567
14568         * expression.cs (ArrayCreation.EmitArrayArguments): use
14569         Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
14570
14571         (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
14572         Conv_Ovf_I_Un for the array arguments.  Even if C# allows longs as
14573         array indexes, the runtime actually forbids them.
14574
14575         * ecore.cs (ExpressionToArrayArgument): Move the conversion code
14576         for array arguments here.
14577
14578         * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
14579         instead of the default for ValueTypes.
14580
14581         (New.DoEmit): Use IsValueType instead of
14582         IsSubclassOf (value_type)
14583         (New.DoResolve): ditto.
14584         (Invocation.EmitCall): ditto.
14585
14586         * assign.cs (Assign): ditto.
14587
14588         * statement.cs (Unsafe): Ok, so I got the semantics wrong.
14589         Statements *are* currently doing part of their resolution during
14590         Emit.  
14591
14592         Expressions do always resolve during resolve, but statements are
14593         only required to propagate resolution to their children.
14594
14595 2002-07-11  Miguel de Icaza  <miguel@ximian.com>
14596
14597         * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
14598
14599         (LoadAssembly): Do not add the dll if it is already specified
14600
14601         (MainDriver): Add the System directory to the link path at the end,
14602         after all the other -L arguments. 
14603
14604         * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
14605         wrong opcode for loading bytes and bools (ldelem.i1 instead of
14606         ldelem.u1) and using the opposite for sbytes.
14607
14608         This fixes Digger, and we can finally run it.
14609
14610         * driver.cs (UnixParseOption): Move the option parsing here.  
14611         (CSCParseOption): Implement CSC-like parsing of options.
14612
14613         We now support both modes of operation, the old Unix way, and the
14614         new CSC-like way.  This should help those who wanted to make cross
14615         platform makefiles.
14616
14617         The only thing broken is that /r:, /reference: and /lib: are not
14618         implemented, because I want to make those have the same semantics
14619         as the CSC compiler has, and kill once and for all the confussion
14620         around this.   Will be doing this tomorrow.
14621
14622         * statement.cs (Unsafe.Resolve): The state is checked during
14623         resolve, not emit, so we have to set the flags for IsUnsfe here.
14624
14625 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
14626
14627         * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
14628         not catch the Error_ObjectRefRequired in SimpleName (as it is
14629         possible to have a class/instance variable name that later gets
14630         deambiguated), we have to check this here.      
14631
14632 2002-07-10  Ravi Pratap  <ravi@ximian.com>
14633
14634         * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
14635         make static and put into Expression.
14636
14637         (Event.Define): Register the private field of the event with the 
14638         TypeManager so that GetFieldFromEvent can get at it.
14639
14640         (TypeManager.RegisterPrivateFieldOfEvent): Implement to
14641         keep track of the private field associated with an event which
14642         has no accessors.
14643
14644         (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
14645         private field.
14646
14647         * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
14648
14649 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
14650
14651         * expression.cs (Binary.EmitBranchable): this routine emits the
14652         Binary expression in a branchable context.  This basically means:
14653         we need to branch somewhere, not just get the value on the stack.
14654
14655         This works together with Statement.EmitBoolExpression.
14656
14657         * statement.cs (Statement.EmitBoolExpression): Use
14658         EmitBranchable. 
14659
14660 2002-07-09  Miguel de Icaza  <miguel@ximian.com>
14661
14662         * statement.cs (For): Reduce the number of jumps in loops.
14663
14664         (For): Implement loop inversion for the For statement.
14665
14666         (Break): We can be breaking out of a Try/Catch controlled section
14667         (foreach might have an implicit try/catch clause), so we need to
14668         use Leave instead of Br.
14669
14670         * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
14671         now).  If the instace expression supports IMemoryLocation, we use
14672         the AddressOf method from the IMemoryLocation to extract the
14673         address instead of emitting the instance.
14674
14675         This showed up with `This', as we were emitting the instance
14676         always (Emit) instead of the Address of This.  Particularly
14677         interesting when This is a value type, as we dont want the Emit
14678         effect (which was to load the object).
14679
14680 2002-07-08  Miguel de Icaza  <miguel@ximian.com>
14681
14682         * attribute.cs: Pass the entry point to the DefinePInvokeMethod
14683
14684         * statement.cs (Checked): Set the CheckedState during the resolve
14685         process too, as the ConvCast operations track the checked state on
14686         the resolve process, and not emit.
14687
14688         * cs-parser.jay (namespace_member_declaration): Flag that we have
14689         found a declaration when we do.  This is used to flag error 1529
14690
14691         * driver.cs: Report ok when we display the help only.
14692
14693 2002-07-06  Andrew Birkett  <adb@tardis.ed.ac.uk>
14694
14695         * cs-tokenizer.cs (xtoken): Improve handling of string literals.
14696
14697 2002-07-04  Miguel de Icaza  <miguel@ximian.com>
14698
14699         * cs-tokenizer.cs (define): We also have to track locally the
14700         defines.  AllDefines is just used for the Conditional Attribute,
14701         but we also need the local defines for the current source code. 
14702
14703 2002-07-03  Miguel de Icaza  <miguel@ximian.com>
14704
14705         * statement.cs (While, For, Do): These loops can exit through a
14706         Break statement, use this information to tell whether the
14707         statement is the last piece of code.
14708
14709         (Break): Flag that we break.
14710
14711         * codegen.cs (EmitContexts): New `Breaks' state variable.
14712
14713 2002-07-03  Martin Baulig  <martin@gnome.org>
14714
14715         * class.cs (TypeContainer.MethodModifiersValid): Allow override
14716         modifiers in method declarations in structs.  Otherwise, you won't
14717         be able to override things like Object.Equals().
14718
14719 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
14720
14721         * class.cs (Method, Property, Indexer): Do not allow the public
14722         modifier to be used in explicit interface implementations.
14723
14724         (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
14725         override modifiers in method declarations in structs
14726
14727 2002-07-02   Andrew Birkett <adb@tardis.ed.ac.uk>
14728
14729         * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
14730         integer or real overflow, report an error
14731
14732 2002-07-02  Martin Baulig  <martin@gnome.org>
14733
14734         * typemanager.cs (TypeManager.InitCoreTypes): When compiling
14735         corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
14736         to tell the runtime about our newly created System.Object and
14737         System.ValueType types.
14738
14739 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
14740
14741         * expression.cs (This): Use Stobj/Ldobj when we are a member of a
14742         struct instead of Ldarg/Starg.
14743
14744 2002-07-02  Martin Baulig  <martin@gnome.org>
14745
14746         * expression.cs (Indirection.Indirection): Call
14747         TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
14748
14749 2002-07-02  Martin Baulig  <martin@gnome.org>
14750
14751         * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
14752         ValueType, call TypeManager.TypeToCoreType() on it.
14753         (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
14754         the OpCodes.Newarr argument.
14755
14756 2002-07-02  Martin Baulig  <martin@gnome.org>
14757
14758         * expression.cs (Invocation.EmitCall): When compiling corlib,
14759         replace all calls to the system's System.Array type to calls to
14760         the newly created one.
14761
14762         * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
14763         System.Array methods.
14764         (TypeManager.InitCoreTypes): When compiling corlib, get the methods
14765         from the system's System.Array type which must be replaced.
14766
14767 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
14768
14769         * typemanager.cs: load unverifiable_code_ctor so we can build
14770         corlib using the correct type. Avoid using GetTypeCode() with
14771         TypeBuilders.
14772         * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
14773         TypeManager.object_type to allow building corlib.
14774
14775 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
14776
14777         * ecore.cs: handle System.Enum separately in LoadFromPtr().
14778
14779 2002-07-01  Martin Baulig  <martin@gnome.org>
14780
14781         * class.cs: Make the last change actually work, we need to check
14782         whether `ifaces != null' to avoid a crash.
14783
14784 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
14785
14786         * class.cs: when we build structs without fields that implement
14787         interfaces, we need to add the interfaces separately, since there is
14788         no API to both set the size and add the interfaces at type creation
14789         time.
14790
14791 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
14792
14793         * expression.cs: the dimension arguments to the array constructors
14794         need to be converted if they are a long.
14795
14796 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
14797
14798         * class.cs: don't emit ldarg.0 if there is no parent constructor
14799         (fixes showstopper for corlib).
14800
14801 2002-06-29  Martin Baulig  <martin@gnome.org>
14802
14803         MCS now compiles corlib on GNU/Linux :-)
14804
14805         * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
14806         ie. check for MethodImplOptions.InternalCall.
14807
14808         * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
14809         and TypeManager.attribute_type are null, so we must explicitly check
14810         whether parent is not null to find out whether it's an attribute type.
14811         (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
14812         and SetBuilder, not only if the property is neither abstract nor external.
14813         This is necessary to set the MethodImplOptions on the accessor methods.
14814         (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
14815         SetBuilder, see Property.Emit().
14816
14817         * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
14818         populate "System.Object", "System.ValueType" and "System.Attribute" since
14819         they've already been populated from BootCorlib_PopulateCoreTypes().
14820
14821 2002-06-29  Martin Baulig  <martin@gnome.org>
14822
14823         * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
14824         is the NullLiteral, we also need to make sure that target_type is not
14825         an enum type.   
14826
14827 2002-06-29  Martin Baulig  <martin@gnome.org>
14828
14829         * rootcontext.cs (RootContext.ResolveCore): We must initialize
14830         `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
14831         before calling BootstrapCorlib_ResolveDelegate ().
14832
14833 2002-06-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14834
14835         * statement.cs: fixed build-breaker. All tests passed ok.
14836
14837 2002-06-27  Martin Baulig  <martin@gnome.org>
14838
14839         * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
14840         for System.Decimal when compiling corlib.
14841
14842 2002-06-27  Martin Baulig  <martin@gnome.org>
14843
14844         * statement.cs (Switch.TableSwitchEmit): Make this work with empty
14845         switch blocks which contain nothing but a default clause.
14846
14847 2002-06-26  Andrew  <adb@tardis.ed.ac.uk>
14848
14849        * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
14850
14851 2002-06-27  Martin Baulig  <martin@gnome.org>
14852
14853         * ecore.cs (PropertyExpr.PropertyExpr): Call
14854         TypeManager.TypeToCoreType() on the `pi.PropertyType'.
14855
14856         * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
14857         is already a TypeBuilder.
14858
14859 2002-06-27  Martin Baulig  <martin@gnome.org>
14860
14861         * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
14862         `target_type == TypeManager.array_type', not IsAssignableFrom() in
14863         the "from an array-type to System.Array" case.  This makes it work
14864         when compiling corlib.
14865
14866 2002-06-27  Martin Baulig  <martin@gnome.org>
14867
14868         * ecore.cs (Expression.SimpleNameResolve): If the expression is a
14869         non-static PropertyExpr, set its InstanceExpression.  This makes
14870         the `ICollection.Count' property work in System/Array.cs.
14871
14872 2002-06-25  Andrew Birkett  <adb@tardis.ed.ac.uk>
14873
14874         * driver.cs: Made error handling more consistent.  Errors now
14875         tracked by Report class, so many methods which used to return int
14876         now return void.  Main() now prints success/failure and 
14877         errors/warnings message.
14878
14879         Renamed '--probe' compiler argument to '--expect-error'.  Removed
14880         the magic number return values (123 and 124).  Now, if the
14881         expected error occurs, the compiler exits with success (exit value
14882         0).  If the compilation completes without seeing that particular
14883         error, the compiler exits with failure (exit value 1).  The
14884         makefile in mcs/errors has been changed to handle the new behaviour.
14885
14886         * report.cs: Made 'expected error' number a property and renamed
14887         it from 'Probe' to 'ExpectedError'.
14888
14889         * genericparser.cs: Removed error handling support, since it is
14890         now all done by Report class.
14891
14892         * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
14893         class, so parse() no longer returns an int.
14894
14895         * namespace.cs: Use Report.Error instead of GenericParser.error
14896
14897 2002-06-22  Miguel de Icaza  <miguel@ximian.com>
14898
14899         * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
14900         TypeContainer.AddOperator): At the front of the list put the
14901         explicit implementations, so they get resolved/defined first. 
14902
14903 2002-06-21  Miguel de Icaza  <miguel@ximian.com>
14904
14905         * class.cs (TypeContainer.VerifyImplements): Verifies that a given
14906         interface type is implemented by this TypeContainer.  Used during
14907         explicit interface implementation.
14908
14909         (Property.Define, Indexer.Define, Method.Define): Validate that
14910         the given interface in the explicit implementation is one of the
14911         base classes for the containing type.
14912
14913         Also if we are explicitly implementing an interface, but there is
14914         no match in the pending implementation table, report an error.
14915
14916         (Property.Define): Only define the property if we are
14917         not explicitly implementing a property from an interface.  Use the
14918         correct name also for those properties (the same CSC uses,
14919         although that is really not needed).
14920
14921         (Property.Emit): Do not emit attributes for explicitly implemented
14922         properties, as there is no TypeBuilder.
14923
14924         (Indexer.Emit): ditto.
14925
14926         Hiding then means that we do not really *implement* a pending
14927         implementation, which makes code fail.
14928
14929 2002-06-22  Martin Baulig  <martin@gnome.org>
14930
14931         * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
14932         the return value of Object.GetType().  [FIXME: we need to do this whenever
14933         we get a type back from the reflection library].
14934
14935 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
14936
14937         * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
14938
14939 2002-06-20  Miguel de Icaza  <miguel@ximian.com>
14940
14941         * attribute.cs: Return null if we can not look up the type.
14942
14943         * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
14944         the interface types found.
14945
14946         * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
14947         interface types found.
14948
14949         * typemanager.cs (GetInterfaces): Make this routine returns alll
14950         the interfaces and work around the lame differences between
14951         System.Type and System.Reflection.Emit.TypeBuilder in the results
14952         result for GetInterfaces.
14953
14954         (ExpandInterfaces): Given an array of interface types, expand and
14955         eliminate repeated ocurrences of an interface.  This expands in
14956         context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
14957         be IA, IB, IC.
14958
14959 2002-06-21  Martin Baulig  <martin@gnome.org>
14960
14961         * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
14962         on System.Enum.
14963
14964 2002-06-21  Martin Baulig  <martin@gnome.org>
14965
14966         * typemanager.cs (TypeManager.TypeToCoreType): New function.  When compiling corlib
14967         and called with one of the core types, return the corresponding typebuilder for
14968         that type.
14969
14970         * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
14971         element type.
14972
14973 2002-06-21  Martin Baulig  <martin@gnome.org>
14974
14975         * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
14976         `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
14977         (Expression.ConvertReferenceExplicit): Likewise.
14978
14979         * expression.cs (ElementAccess.DoResolve): Likewise.
14980         (ElementAccess.DoResolveLValue): Likewise.
14981
14982 2002-06-10  Martin Baulig  <martin@gnome.org>
14983
14984         * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
14985         add the "value" parameter to the parameter list.
14986
14987         * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
14988         to our caller.
14989
14990 2002-06-19  Miguel de Icaza  <miguel@ximian.com>
14991
14992         * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
14993         the argument to an int, uint, long or ulong, per the spec.  Also
14994         catch negative constants in array creation.
14995
14996 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
14997
14998         * class.cs: do not allow the same interface to appear twice in
14999         the definition list.
15000
15001 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
15002
15003         * ecore.cs: don't use ldlen with System.Array.
15004
15005 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
15006
15007         * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
15008
15009 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
15010
15011         * modifiers.cs: produce correct field attributes for protected
15012         internal. Easy fix so miguel can work on ther harder stuff:-)
15013
15014 2002-06-18  Miguel de Icaza  <miguel@ximian.com>
15015
15016         * pending.cs: New file.  Move the code from class.cs here.
15017         Support clearning the pending flag for all methods (when not doing
15018         explicit interface implementation).
15019
15020 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
15021
15022         * rootcontext.cs: added a couple more types needed to bootstrap.
15023
15024 2002-06-17  Miguel de Icaza  <miguel@ximian.com>
15025
15026         * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
15027         constructor in the type, instead of any constructor in the type
15028         hierarchy.  Thanks to Paolo for finding this bug (it showed up as
15029         a bug in the Mono runtime when applying the params attribute). 
15030
15031 2002-06-16  Rafael Teixeira  <rafaelteixeirabr@hotmail.com>
15032         * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
15033
15034 2002-06-14  Rachel Hestilow  <hestilow@ximian.com>
15035
15036         * expression.cs (Unary.ResolveOperator): Use TypeManager
15037         to resolve the type.
15038
15039 2002-06-13  Ravi Pratap  <ravi@ximian.com>
15040
15041         * cs-parser.jay (enum_member_declaration): Pass in the attributes
15042         attached.
15043
15044         * enum.cs (AddEnumMember): Add support to store the attributes associated 
15045         with each member too.
15046
15047         * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
15048         field builders too - this takes care of the enum member case.
15049
15050 2002-06-10  Rachel Hestilow  <hestilow@ximian.com>
15051
15052         * typemanager.cs (TypeManager.VerifyUnManaged): Allow
15053         address-of operator on both value types and pointers.
15054
15055 2002-06-10  Martin Baulig  <martin@gnome.org>
15056
15057         * interface.cs (Interface.PopulateIndexer): Add the indexer's
15058         PropertyBuilder to the `property_builders' list.
15059
15060         * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
15061         (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
15062         `lookup_type' and all its interfaces.  Unfortunately, Type.FindMembers() won't
15063         find any indexers which are inherited from an interface.
15064
15065 2002-06-09  Martin Baulig  <martin@gnome.org>
15066
15067         * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
15068         the same type as the constant if necessary.  There's also a test-130.cs
15069         for this.
15070
15071         * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
15072
15073         * typemanager.cs (TypeManager.ChangeType): Previously known as
15074         Enum.ChangeEnumType().
15075
15076 2002-06-09  Martin Baulig  <martin@gnome.org>
15077
15078         * expression.cs (Cast.TryReduce): Added support for consts.
15079
15080 2002-06-08  Ravi Pratap  <ravi@ximian.com>
15081
15082         * class.cs (Accessor): Hold attributes information so we can pass
15083         it along.
15084
15085         * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
15086         Modify to pass in attributes attached to the methods.
15087
15088         (add_accessor_declaration, remove_accessor_declaration): Ditto.
15089
15090         * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
15091         to handle the Accessor kind :-)
15092
15093         * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
15094
15095 2002-06-08  Martin Baulig  <martin@gnome.org>
15096
15097         * expression.cs (Unary.TryReduceNegative): Added support for
15098         ULongConstants.
15099
15100 2002-06-08  Martin Baulig  <martin@gnome.org>
15101
15102         * enum.cs (Enum.LookupEnumValue): Don't report an error if the
15103         name can't be found in the `defined_names' - the caller will do a
15104         MemberLookup in this case and thus find methods in System.Enum
15105         such as Enum.IsDefined().
15106
15107 2002-06-08  Martin Baulig  <martin@gnome.org>
15108
15109         * enum.cs (Enum.ChangeEnumType): This is a custom version of
15110         Convert.ChangeType() which works with TypeBuilder created types.
15111         (Enum.LookupEnumValue, Enum.Define): Use it here.
15112
15113         * class.cs (TypeContainer.RegisterRequiredImplementations): Added
15114         `TypeBuilder.BaseType != null' check.
15115         (TypeContainer.FindMembers): Only lookup parent members if we
15116         actually have a parent.
15117         (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
15118         (ConstructorInitializer.Resolve): Likewise.
15119
15120         * interface.cs (Interface.FindMembers): Added
15121         `TypeBuilder.BaseType != null' check.
15122
15123         * rootcontext.cs (RootContext.ResolveCore): Added
15124         "System.Runtime.CompilerServices.IndexerNameAttribute" to
15125         classes_second_stage.
15126
15127         * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
15128         debug_type and trace_type when compiling with --nostdlib.       
15129
15130 2002-06-07  Martin Baulig  <martin@gnome.org>
15131
15132         * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
15133         (AddField): Set it to true when adding a non-static field.
15134         (DefineType): Use `have_nonstatic_fields' to find out whether we
15135         have non-static fields, not `Fields != null'.
15136
15137 2002-06-02  Miguel de Icaza  <miguel@ximian.com>
15138
15139         * ecore.cs (SimpleNameResolve): Removed simple bug (we were
15140         dereferencing a null on the static-field code path)
15141
15142 2002-05-30  Martin Baulig  <martin@gnome.org>
15143
15144         * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
15145         to take command line arguments.  Use reflection to call the new
15146         custom `Initialize' function on the symbol writer and pass it the
15147         command line arguments.
15148
15149         * driver.cs (--debug-args): New command line argument to pass command
15150         line arguments to the symbol writer.
15151
15152 2002-05-28  Miguel de Icaza  <miguel@ximian.com>
15153
15154         * assign.cs (DoResolve): Forgot to do the implicit conversion to
15155         the target type for indexers and properties.  Thanks to Joe for
15156         catching this.
15157
15158 2002-05-27  Miguel de Icaza  <miguel@ximian.com>
15159
15160         * typemanager.cs (MethodFlags): returns the method flags
15161         (Obsolete/ShouldIgnore) that control warning emission and whether
15162         the invocation should be made, or ignored. 
15163
15164         * expression.cs (Invocation.Emit): Remove previous hack, we should
15165         not do this on matching a base type, we should do this based on an attribute
15166
15167         Only emit calls to System.Diagnostics.Debug and
15168         System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
15169         on the command line.
15170
15171         * rootcontext.cs: Global settings for tracing and debugging.
15172
15173         * cs-tokenizer.cs (define): New utility function to track
15174         defines.   Set the global settings for TRACE and DEBUG if found.
15175
15176 2002-05-25  Ravi Pratap  <ravi@ximian.com>
15177
15178         * interface.cs (Populate*): Pass in the TypeContainer as well as
15179         the DeclSpace as parameters so that we can create EmitContexts and
15180         then use that to apply attributes etc.
15181
15182         (PopulateMethod, PopulateEvent, PopulateProperty)
15183         (PopulateIndexer): Apply attributes everywhere.
15184
15185         * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
15186         etc.
15187
15188         (ApplyAttributes): Update accordingly.
15189
15190         We now apply interface attributes for all members too.
15191
15192 2002-05-26  Miguel de Icaza  <miguel@ximian.com>
15193
15194         * class.cs (Indexer.Define); Correctly check if we are explicit
15195         implementation (instead of checking the Name for a ".", we
15196         directly look up if the InterfaceType was specified).
15197
15198         Delay the creation of the PropertyBuilder.
15199
15200         Only create the PropertyBuilder if we are not an explicit
15201         interface implementation.   This means that explicit interface
15202         implementation members do not participate in regular function
15203         lookups, and hence fixes another major ambiguity problem in
15204         overload resolution (that was the visible effect).
15205
15206         (DefineMethod): Return whether we are doing an interface
15207         implementation. 
15208
15209         * typemanager.cs: Temporary hack until we get attributes in
15210         interfaces (Ravi is working on that) and we get IndexerName
15211         support in interfaces.
15212
15213         * interface.cs: Register the indexers as properties.
15214
15215         * attribute.cs (Attribute.Resolve): Catch the error, and emit a
15216         warning, I have verified that this is a bug in the .NET runtime
15217         (JavaScript suffers of the same problem).
15218
15219         * typemanager.cs (MemberLookup): When looking up members for
15220         interfaces, the parent of an interface is the implicit
15221         System.Object (so we succeed in searches of Object methods in an
15222         interface method invocation.  Example:  IEnumerable x;  x.ToString
15223         ()) 
15224
15225 2002-05-25  Miguel de Icaza  <miguel@ximian.com>
15226
15227         * class.cs (Event): Events should also register if they do
15228         implement the methods that an interface requires.
15229
15230         * typemanager.cs (MemberLookup); use the new GetInterfaces
15231         method. 
15232
15233         (GetInterfaces): The code used to lookup interfaces for a type is
15234         used in more than one place, factor it here. 
15235
15236         * driver.cs: Track the errors at the bottom of the file, we kept
15237         on going.
15238
15239         * delegate.cs (NewDelegate.Emit): We have to emit a null as the
15240         instance if the method we are calling is static!
15241
15242 2002-05-24  Miguel de Icaza  <miguel@ximian.com>
15243
15244         * attribute.cs (ApplyAttributes): Make this function filter out
15245         the IndexerName attribute (as that attribute in reality is never
15246         applied) and return the string constant for the IndexerName
15247         attribute. 
15248
15249         * class.cs (TypeContainer.Emit): Validate that all the indexers
15250         have the same IndexerName attribute, and if so, set the
15251         DefaultName attribute on the class. 
15252
15253         * typemanager.cs: The return value might contain other stuff (not
15254         only methods).  For instance, consider a method with an "Item"
15255         property and an Item method.
15256
15257         * class.cs: If there is a problem with the parameter types,
15258         return. 
15259
15260 2002-05-24  Ravi Pratap  <ravi@ximian.com>
15261
15262         * ecore.cs (ImplicitConversionExists): Wrapper function which also
15263         looks at user defined conversion after making a call to 
15264         StandardConversionExists - we need this for overload resolution.
15265
15266         * expression.cs : Update accordingly the various method calls.
15267
15268         This fixes 2 bugs filed against implicit user defined conversions 
15269
15270 2002-05-22  Miguel de Icaza  <miguel@ximian.com>
15271
15272         * statement.cs: Track the result of the assignment.
15273
15274 2002-05-21  Miguel de Icaza  <miguel@ximian.com>
15275
15276         * expression.cs (MemberAccess): Improved error reporting for
15277         inaccessible members.
15278
15279 2002-05-22  Martin Baulig  <martin@gnome.org>
15280
15281         * makefile (mcs-mono2.exe): New target.  This is mcs compiled with
15282         itself with debugging support.
15283
15284 2002-05-22  Martin Baulig  <martin@gnome.org>
15285
15286         * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
15287         Removed, this isn't needed anymore.
15288
15289 2002-05-20  Martin Baulig  <martin@gnome.org>
15290
15291         * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
15292         be underlying type for an enum.
15293
15294 2002-05-20  Miguel de Icaza  <miguel@ximian.com>
15295
15296         * typemanager.cs (InitEnumUnderlyingTypes): New helper function
15297         that splits out the loading of just the core types.
15298
15299         * rootcontext.cs (ResolveCore): Split the struct resolution in
15300         two, so we can load the enumeration underlying types before any
15301         enums are used.
15302
15303         * expression.cs (Is): Bandaid until we fix properly Switch (see
15304         bug #24985 for details).
15305
15306         * typemanager.cs (ImplementsInterface): The hashtable will contain
15307         a null if there are no interfaces implemented.
15308
15309 2002-05-18  Miguel de Icaza  <miguel@ximian.com>
15310
15311         * cs-parser.jay (indexer_declarator): It is fine to have array
15312         parameters
15313
15314 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
15315
15316         * typemanager.cs: (RegisterBuilder): New function used to register
15317         TypeBuilders that implement interfaces.  Since
15318         TypeBuilder.GetInterfaces (as usual) does not work with lame
15319         Reflection.Emit. 
15320         (AddUserType): register interfaces.
15321
15322         (ImplementsInterface): Use the builder_to_ifaces hash if we are
15323         dealing with TypeBuilder.  Also, arrays are showing up as
15324         SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
15325         methods can not be invoked on them!
15326
15327         * ecore.cs (ExplicitReferenceConversionExists): Made public.
15328         (ImplicitReferenceConversionExists): Split out from
15329         StandardConversionExists. 
15330
15331         * expression.cs (As): We were only implementing one of the three
15332         cases for the as operator.  We now implement them all.
15333         (Is): Implement the various other cases for Is as well.
15334
15335         * typemanager.cs (CACHE): New define used to control if we want or
15336         not the FindMembers cache.  Seems to have a negative impact on
15337         performance currently
15338
15339         (MemberLookup): Nested types have full acess to
15340         enclosing type members
15341
15342         Remove code that coped with instance/static returns for events, we
15343         now catch this in RealFindMembers.
15344
15345         (RealFindMembers): only perform static lookup if the instance
15346         lookup did not return a type or an event.  
15347
15348 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
15349
15350         * assign.cs (CompoundAssign): We pass more semantic information
15351         now to Compound Assignments than we did before: now we have all
15352         the information at hand, and now we resolve the target *before* we
15353         do the expression expansion, which allows the "CacheValue" method
15354         to have the effect we intended (before, a [x] += 1 would generate
15355         two differen ArrayAccess expressions from the ElementAccess,
15356         during the resolution process).
15357
15358         (CompoundAssign.DoResolve): Resolve target and original_source here.
15359
15360 2002-05-16  Miguel de Icaza  <miguel@ximian.com>
15361
15362         * expression.cs (ArrayAccess): dropped debugging information. 
15363
15364         * typemanager.cs: Small bug fix: I was always returning i_members,
15365         instead of one of i_members or s_members (depending on which had
15366         the content).
15367
15368         * assign.cs (IAssignMethod.CacheTemporaries): New method.  This
15369         method is invoked before any code generation takes place, and it
15370         is a mechanism to inform that the expression will be invoked more
15371         than once, and that the method should use temporary values to
15372         avoid having side effects
15373
15374         (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
15375
15376         * ecore.cs (Expression.CacheTemporaries): Provide empty default
15377         implementation.
15378
15379         * expression.cs (Indirection, ArrayAccess): Add support for
15380         CacheTemporaries in these two bad boys. 
15381
15382         * ecore.cs (LoadFromPtr): figure out on our own if we need to use
15383         ldobj or ldind_ref.  
15384         (StoreFromPtr): Handle stobj as well.
15385
15386         * expression.cs (UnaryMutator): Share more code.
15387
15388         * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
15389         down: I was not tracking the Filter function as well, which
15390         was affecting the results of the cache.
15391
15392 2002-05-15  Miguel de Icaza  <miguel@ximian.com>
15393
15394         * attribute.cs: Remove the hack to handle the CharSet property on
15395         StructLayouts. 
15396
15397 2002-05-14  Miguel de Icaza  <miguel@ximian.com>
15398
15399         * attribute.cs (DoResolve): More uglyness, we now only try to
15400         resolve the attribute partially, to extract the CharSet
15401         information (only if we are a StructLayout attribute).  Otherwise 
15402
15403         (GetExtraTypeInfo): Add some code to conditionally kill in the
15404         future this.   I am more and more convinced that the .NET
15405         framework has special code to handle the attribute setting on
15406         certain elements.
15407
15408         * expression.cs (IsParamsMethodApplicable): Revert my previous
15409         foreach change here, it was wrong.
15410
15411 2002-05-13  Miguel de Icaza  <miguel@ximian.com>
15412
15413         * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
15414         (pp_expr): do not abort on unknown input, just return.
15415         (eval): abort if there are pending chars.
15416
15417         * attribute.cs (Attribute.Resolve): Positional parameters are
15418         optional.  Deal with that case.
15419
15420         * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
15421         the Ansi/Unicode/Auto information for the type.
15422
15423         (TypeContainer.DefineType): instantiate the EmitContext here, as
15424         we will be using it during the type definition (to resolve
15425         attributes) and during the emit phase.
15426
15427         * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
15428         to pull type information out of the attributes
15429
15430         (Attribute.Resolve): track the constructor builder, and allow for
15431         multiple invocations (structs and classes will use this).
15432
15433         * ecore.cs (MemberLookupFinal): new version with all the
15434         parameters customizable.
15435
15436         * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
15437         constructors.  Return if the result value is null (as the error
15438         would have been flagged already by MemberLookupFinal)
15439
15440         Do not allow instances of abstract classes or interfaces to be
15441         created.
15442
15443         * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
15444         We have to compare the assembly property here when dealing with
15445         FamANDAssem and Assembly access modifiers, because we might be
15446         creating an assembly from *modules* (that means that we are not
15447         getting TypeBuilders for types defined in other modules that are
15448         part of this assembly).
15449
15450         (Method.Emit): If the method is marked abstract and has a body,
15451         emit an error. 
15452
15453         (TypeContainer.DefineMembers): If both the defined member and the
15454         parent name match are methods, then do not emit any warnings: let
15455         the Method.Define routine take care of flagging warnings.  But if
15456         there is a mismatch (method overrides something else, or method is
15457         overriwritten by something, then emit warning).
15458
15459         (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
15460         set to null, this means `do not check for the return type on the
15461         signature'. 
15462
15463         (Method.Define): set the return type for the method signature to
15464         null, so that we get methods with the same name and parameters and
15465         different return types.  This is used to flag warning 114 (you are
15466         hiding a method, and you probably want to use the new/override
15467         keywords instead).
15468
15469         * typemanager.cs (MemberLookup): Implemented proper access
15470         control, closing a long standing set of bug reports.  The problem
15471         was that the Framework only has two bits: Public and NonPublic,
15472         and NonPublic includes private and protected methods, but we need
15473         to enforce the FamANDAssem, FamOrAssem and Family. 
15474
15475 2002-05-11  Miguel de Icaza  <miguel@ximian.com>
15476
15477         * statement.cs (GotoCase): Return true: Ammounts to giving up
15478         knowledge on whether we return or not, and letting the other case
15479         be responsible for it.
15480
15481 2002-05-10  Miguel de Icaza  <miguel@ximian.com>
15482
15483         * driver.cs: Do not load directories for each file processed, only
15484         do it if there is a pattern.
15485
15486         * ecore.cs: Report readonly assigns here as well, as we might have
15487         been resolved only by MemberAccess.
15488
15489         (SimpleName.SimpleNameResolve): Also be useful for LValue
15490         resolution.   We need this to propagate assign to local readonly variables
15491
15492         * typemanager.cs: Use a ptrhashtable for the criteria, because we
15493         do not want to reuse potential criteria memory.
15494
15495         * class.cs (MyEventBuilder): Set reflected_type;
15496
15497         * ecore.cs (Constantify): Added support for constifying bools.
15498
15499         (RootContext.LookupType): Added a cache for values looked up in
15500         the declaration space.
15501
15502         * typemanager.cs (FindMembers): Now is a front-end to
15503         RealFindMembers, and provides a two-level hashtable-based cache to
15504         the request.  
15505
15506         15% performance improvement: from 22.5 to 19.2 seconds.
15507
15508         * expression.cs (IsParamsMethodApplicable): use foreach.
15509         (Invocation.DoResolve): ditto.
15510         (New.DoResolve): ditto.
15511         (ArrayCreation.DoResolve): ditto.
15512
15513         * ecore.cs (FindMostEncompassingType): use foreach.
15514
15515         * delegate.cs (NewDelegate.DoResolve): Use foreach
15516
15517         * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
15518         (RemoveMethods): use foreach.
15519
15520         * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
15521         nested foreach statements instead of for, and also break out of
15522         the inner loop once a match is found.
15523
15524         (Invocation.OverloadResolve): Use foreach, simplify the code. 
15525
15526 2002-05-08  Miguel de Icaza  <miguel@ximian.com>
15527
15528         * cfold.cs (BinaryFold): During an enumeration evaluation context,
15529         we actually unwrap the expression to allow for extra information
15530         to be extracted. 
15531
15532         * expression.cs: Use Shr_Un on unsigned operations. 
15533
15534 2002-05-08  Ravi Pratap  <ravi@ximian.com>
15535
15536         * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of 
15537         applicable operators was not being considered correctly. This closes
15538         the bug Miguel reported.
15539
15540 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
15541
15542         * attribute.cs: check that the type derives from System.Attribute
15543         and report the correct error in that case (moved the duplicate code to
15544         its own method, too).
15545
15546 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
15547
15548         * attribute.cs: lookup attribute type name as the spec says: first the
15549         bare attribute name and then name + "Attribute" (nant compiles with
15550         mcs after this fix).
15551
15552 2002-05-07  Miguel de Icaza  <miguel@ximian.com>
15553
15554         * expression.cs (Unary.TryReduceNegative): Ah!  Tricky!  Tricky!
15555         Because of the way we parse things, we should try to see if a
15556         UIntConstant can fit in an integer.
15557
15558 2002-05-07  Ravi Pratap  <ravi@ximian.com>
15559
15560         * ecore.cs (GetConversionOperators): Do not pick up op_True operators
15561         when we are in an explicit context.
15562
15563         (ConvertReferenceExplicit): When converting from Iface type S to Class
15564         T make sure the rules are implemented as an OR.
15565
15566         * parameter.cs (ParameterType): Make it a property for now although the
15567         purpose really isn't anything immediate.
15568
15569         * expression.cs (Is*Applicable): Do better checking on the parameter type
15570         of a ref/out parameter. The ones from the system assemblies are already 
15571         marked with the correct type so we don't need to do any correction.
15572
15573         * ecore.cs (StandardConversionExists): Conversion from Interface types to 
15574         the object type is standard too so include that.
15575
15576 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
15577
15578         * ecore.cs (StandardConversionExists): Augment with missing code:
15579         deal with IntConstant, LongConstants and Enumerations.
15580
15581         * assign.cs: Report the error, instead of failing silently
15582
15583         * rootcontext.cs (AddGlobalAttributes): Track attributes on the
15584         typecontainer that they are declared, because the
15585         typecontainer/namespace will have the list of using clauses that
15586         need to be applied.
15587
15588         Assembly Attributes were escaping the normal registration
15589         mechanism. 
15590
15591         (EmitCode): Apply attributes within an EmitContext that represents
15592         the container they were declared on.
15593
15594         * cs-parser.jay: Track bases for structs.  How did I get this wrong?
15595
15596 2002-05-06  Ravi Pratap  <ravi@ximian.com>
15597
15598         * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
15599         Revamp completely - make much cleaner as we now operate only
15600         on a set of Types.
15601
15602         (FindMostSpecificSource, FindMostSpecificTarget): New methods
15603         to implement the logic detailed in the spec more correctly.
15604
15605         (UserDefinedConversion): Update accordingly.
15606
15607 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
15608
15609         * statement.cs: Return flow analysis information up.
15610
15611         * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
15612         and the default.
15613
15614         (token): Do not consume an extra character before calling
15615         decimal_digits.
15616
15617 2002-05-06  Piers Haken <piersh@friskit.com>
15618
15619         * cs-parser.jay: add 'override' attribute to System.Object.Finalize
15620
15621 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
15622
15623         * class.cs (Constructor.Emit): Set the IsStatic flag in the
15624         EmitContext during the instance constructor initializer
15625         resolution, to stop access to instance variables.
15626
15627         This is mandated by the spec, last paragraph of the `constructor
15628         initializers' section. 
15629
15630 2002-05-05  Miguel de Icaza  <miguel@ximian.com>
15631
15632         * cs-parser.jay, class.cs (Accessor): new class used to represent
15633         an accessor (get or set).  In the past we used `null' to represent
15634         a missing accessor.  But this is ambiguous because there was no
15635         way to tell in abstract indexers/properties if one of them was
15636         specified.
15637
15638         Now there is a way of addressing that.
15639
15640         * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
15641         instead of FindMembers.
15642
15643         * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
15644         the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
15645
15646         * attribute.cs: Treat indexers and properties as the same in terms
15647         of applying attributes
15648
15649         * ecore.cs (FindMostEncompassedType): Use statically initialized
15650         EmptyExpressions()s like we do elsewhere to avoid creating useless
15651         objects (and we take this out of the tight loop).
15652
15653         (GetConversionOperators): Move the code to extract the actual
15654         operators to a separate routine to clean things up.
15655
15656 2002-05-04  Miguel de Icaza  <miguel@ximian.com>
15657
15658         * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
15659         events are always registered FieldBuilders.
15660
15661         * class.cs (FieldBase): New class shared by Fields 
15662
15663         * delegate.cs: If we are a toplevel delegate, use our full name.
15664         If we are a nested delegate, then only use our tail name.
15665
15666 2002-05-02  Ravi Pratap  <ravi@ximian.com>
15667
15668         * expression.cs (IsApplicable): Ensure that we add the "&" to
15669         ref/out types before comparing it with the type of the argument.
15670
15671         (IsParamsMethodApplicable): Ditto.
15672
15673         (Argument.Type): Use TypeManager.LookupType instead of Type.GetType - 
15674         silly me ;-)
15675
15676         * delegate.cs : Handle the case when we have more than one applicable
15677         method. Flag an error only when we finish checking all.
15678
15679 2002-05-02  Miguel de Icaza  <miguel@ximian.com>
15680
15681         * expression.cs: Add support for boolean static initializers.
15682
15683 2002-05-01  Miguel de Icaza  <miguel@ximian.com>
15684
15685         * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
15686
15687         * parameter.cs (ComputeParameterTypes,
15688         ComputeAndDefineParameterTypes): Better error handling: now we
15689         clear the `types' cache if we fail during any of the type lookups.
15690         We also return the status code correctly to our caller
15691
15692         * delegate.cs: If we fail to define a delegate, abort the extra
15693         steps. 
15694
15695         * expression.cs (Binary.ResolveOperator): for
15696         operator==(object,object) and operator !=(object, object) we also
15697         have to verify that there is an implicit conversion from one to
15698         the other.
15699
15700         (ArrayAccess.DoResolve): Array Access can operate on
15701         non-variables. 
15702
15703 2002-04-30  Miguel de Icaza  <miguel@ximian.com>
15704
15705         * assign.cs (CompoundAssign): A new class used as a "flag" that
15706         the assignment actually is happening as part of a compound
15707         assignment operator.
15708
15709         During compound assignment, a few new rules exist to enable things
15710         like:
15711
15712         byte b |= 1 + 2
15713
15714         From the spec:
15715
15716         x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
15717         to the type of x) if y is implicitly convertible to the type of x,
15718         and the operator is a builtin operator and the return type of the
15719         operator is explicitly convertible to the type of x. 
15720
15721         * rootcontext.cs: Reset warning level to 2.  4 catches various
15722         "interesting" features in mcs, we must clean this up at some
15723         point, but currently am trying to kill other bugs ;-)
15724
15725         * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
15726         in container classes as well.  
15727
15728         * expression.cs (Binary.ResolveOperator): Handle string case
15729         before anything else (as operator overloading does emit an error
15730         before doing anything else).
15731
15732         This code could go away when we move to a table driven model, but
15733         i could not come up with a good plan last night.
15734
15735 2002-04-30  Lawrence Pit <loz@cable.a2000.nl>
15736
15737         * typemanager.cs (CSharpName): reimplementation using regex.
15738         * class.cs: added null check for fields in Emit
15739         * rootcontext.cs: set warninglevel to 4
15740
15741 2002-04-29  Miguel de Icaza  <miguel@ximian.com>
15742
15743         * typemanager.cs (CSharpName): reimplemented with Lupus
15744         suggestion.
15745
15746 2002-04-28  Miguel de Icaza  <miguel@ximian.com>
15747
15748         * statement.cs (If): correclty implement Resolve, because we were
15749         not catching sem errors in there.  The same process is needed
15750         everywhere else. 
15751         (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
15752
15753
15754         (Statement.Warning_DeadCodeFound): Factorize code.
15755         (While): Report dead code here too.
15756
15757         (Statement): Added Resolve virtual method to allow
15758         for resolution split from the emit code.
15759
15760 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
15761
15762         * statement.cs (EmitBoolExpression): No longer try to resolve the
15763         expression here.    
15764         (MakeBoolean): New utility function that resolve, implicitly
15765         converts to boolean and tags the expression. 
15766
15767
15768         (If, Do): Implement dead code elimination.
15769         (While): Implement loop inversion
15770
15771         (Do, While, For, If): Resolve the expression prior to calling our
15772         code generation.
15773
15774 2002-04-22  Lawrence Pit <loz@cable.a2000.nl>
15775
15776         * class.cs:
15777           - added method Report28 (warning: program has more than one entry point)
15778           - added method IsEntryPoint, implements paragraph 10.1 of the spec
15779           - modified method Method.Define, the part at the end of the method
15780
15781         * rootcontext.cs: added static public Location EntryPointLocation;
15782           
15783         * ../errors/cs0028.cs : Add test case for the above warning.              
15784
15785         * typemanager.cs:
15786           - modified method CSharpName to allow arrays of primitive type to
15787             be printed nicely (e.g. instead of System.Int32[][] it now prints
15788             int[][])
15789           - added method CSharpSignature: returns the signature of a method
15790             in string format to be used in reporting errors, warnings, etc.
15791
15792         * support.cs: InternalParameters.ParameterDesc variable tmp initialized
15793         with String.Empty.
15794
15795 2002-04-26  Ravi Pratap  <ravi@ximian.com>
15796
15797         * delegate.cs (Define): Fix extremely silly bug where I was
15798         setting the type of the 'object' parameter of the BeginInvoke
15799         method to System.IAsyncResult instead of System.Object ;-)
15800
15801 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
15802
15803         * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
15804         here. 
15805
15806         (Constructor.Emit): return if we fail to initialize the
15807         constructor.  Another door closed!  
15808
15809         * expression.cs (New.DoResolve): Improve error message (from -6 to
15810         1501).  Use DeclaredOnly lookup to find the exact constructor.
15811
15812         * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
15813         loop.  This is useful.
15814
15815         * cs-parser.jay: Adjust the default parameters so that destructors
15816         have the proper signature.
15817
15818 2002-04-26  Martin Baulig  <martin@gnome.org>
15819
15820         * driver.cs (LoadAssembly): If `assembly' contains any characters
15821         which are only valid in path names and not in assembly names
15822         (currently slash, backslash and point), use Assembly.LoadFrom ()
15823         instead of Assembly.Load () on the `assembly' (before iteration
15824         over the link_paths).
15825
15826 2002-04-26  Martin Baulig  <martin@gnome.org>
15827
15828         * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
15829
15830 2002-04-25  Miguel de Icaza  <miguel@ximian.com>
15831
15832         * class.cs (Property): use the new typemanager.MemberLookup
15833
15834         (TypeContainer.MemberLookup): Implement using the
15835         TypeManager.MemberLookup now. 
15836
15837         * typemanager.cs: Make MemberLookup a function of the TypeManager,
15838         and return MemberInfos, so that these can be used without an
15839         EmitContext (what we had before).
15840
15841 2002-04-24  Miguel de Icaza  <miguel@ximian.com>
15842
15843         * expression.cs: Fix the case where the argument to params if the
15844         type of the params.  I omitted handling this before.   Fixed
15845
15846 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
15847
15848         * driver.cs: Call BootCorlib_PopulateCoreType
15849
15850         * class.cs (Property.CheckBase): Check for properties only, not
15851         for all members. 
15852
15853         * interface.cs: Temporary hack: try/catch around the
15854         CustomAttributeBuilder, because I am getting an exception that I
15855         do not understand.
15856
15857         * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
15858         types whose definitions are required to be there (attributes are
15859         defined before standard types).
15860
15861         Compute definitions as we boot the various types, as they are used
15862         immediately (value_type class will need object_type, but if we do
15863         not initialize object_type, we will pass a null, which will let
15864         the runtime pick the System.Object from the existing corlib, which
15865         is not what we want).
15866
15867 2002-04-22  Patrik Torstensson <totte@labs2.com>
15868
15869         * cs-tokenizer.cs: fixed a number of trim() issues.
15870
15871 2002-04-22  Ravi Pratap  <ravi@ximian.com>
15872
15873         * expression.cs (Argument.Type): Ensure that we return the correct
15874         type when we have out or ref parameters [in which case we 
15875         append a "&"].
15876
15877 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
15878
15879         * class.cs (Property, Indexer): Allow extern modifier in there. 
15880
15881         * typemanager.cs (InitBaseTypes): Initializes object_type and
15882         value_type, since those will be used early on during the bootstrap
15883         process to compile corlib.
15884
15885         (InitCoreTypes): Move code from here to InitBaseTypes.
15886
15887 2002-04-21  Miguel de Icaza  <miguel@ximian.com>
15888
15889         * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
15890         single-dimension arrays as using the ldlen opcode.  
15891
15892         Daniel Lewis discovered this optimization.  
15893
15894         * typemanager.cs: Add signature for System.Array::get_Length
15895
15896 2002-04-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15897
15898         * statement.cs: report the error when the foreach does not apply to an
15899         array nor a collection.
15900
15901 2002-04-19  Miguel de Icaza  <miguel@ximian.com>
15902
15903         * expression.cs: Add implicit conversions to the operator ~.
15904
15905         * constant.cs (DecimalConstant.Emit): Emit decimal value.
15906
15907         * typemanager.cs: Locate the decimal constructor.
15908
15909 2002-04-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15910
15911         * attribute.cs: use the new property of TypeOf.
15912         * expression.cs: added 'get' property around typearg.
15913
15914         These changes fix a build breaker reported by NickD. Is this the
15915         correct way to fix?  If not, please, revert my changes and make it
15916         work :-).
15917
15918 2002-04-17  Miguel de Icaza  <miguel@ximian.com>
15919
15920         * attribute.cs: Add support for typeof in attribute invocations.
15921         I am not sure that this is right though.
15922
15923 2002-04-14  Duncan Mak  <duncan@ximian.com>
15924
15925         * cfold.cs (BinaryFold): Catch DivideByZeroException in the
15926         Binary.Operator.Division case.
15927
15928 2002-04-13  Ravi Pratap  <ravi@ximian.com>
15929
15930         * class.cs (DefineType): Ensure that we do a proper check on
15931         attribute types and also register it with the TypeManager.
15932
15933         (TypeContainer.Targets): The default for attribute types is
15934         AttributeTargets.All.
15935
15936         * attribute.cs (ApplyAttributes): Registering the attribute type
15937         is done elsewhere, not when we discover we have a Usage attribute.
15938
15939 2002-04-12  Ravi Pratap  <ravi@ximian.com>
15940
15941         * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
15942         and get rid of is_delegate parameter.
15943
15944         * everywhere : update.
15945
15946 2002-04-12  Ravi Pratap  <ravi@ximian.com>
15947
15948         * cs-parser.jay (compilation_unit): Revamp completely to use
15949         some new ideas that I got from Rhys' grammar to solve the problems
15950         with assembly level attributes.
15951
15952         (outer_declaration): New grammar production.
15953
15954         (attribute_sections): Add.
15955
15956         (opt_attributes): Base on attribute_sections
15957
15958         (namespace_declaration): Allow opt_attributes to tackle the case
15959         when we have assembly level attributes - we are clever in this
15960         regard now ;-)
15961
15962         * attribute.cs (ApplyAttributes): Do not worry about assembly 
15963         attributes in the non-global context.
15964
15965         * rootcontext.cs (AddGlobalAttributes): Go back to using this
15966         instead of SetGlobalAttributes.
15967
15968         * class.cs, rootcontext.cs : Ensure we define and generate 
15969         attribute types before anything else.
15970
15971         * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
15972         and flag the new error -20 for the case when the attribute type
15973         does not have valid targets specified. csc does not catch this.
15974
15975         * ../errors/errors.txt : update for error # -20
15976
15977 2002-04-11  Ravi Pratap  <ravi@ximian.com>
15978
15979         * support.cs (InternalParameters.ParameterModifier): Do some null
15980         checking and return sane values.
15981
15982         * class.cs (Method.Define): If we are a PInvoke method, ensure
15983         that we are static and extern. Report error # 601
15984
15985         * ../errors/cs0601.cs : Add test case for the above error.
15986
15987 2002-04-07  Ravi Pratap  <ravi@ximian.com>
15988
15989         * rootcontext.cs (attribute_types): We need to keep type of
15990         all attribute types separately and emit code for them first.
15991
15992         (RegisterAttribute) : Implement.
15993
15994         * class.cs (DefineType): Check if the current Type is a custom
15995         attribute type and register it accordingly.
15996
15997         * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
15998         adding the first attribute twice and rename to
15999
16000         (SetGlobalAttributes): this.
16001
16002         * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
16003         lookups.
16004
16005         * attribute.cs (ApplyAttributes): Take an additional argument telling us
16006         if we are processing global arguments. Hmm, I am unsure of this.
16007
16008 2002-04-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16009
16010         * expression.cs: added static array of strings to avoid calling
16011         Enum.ToString () for Operator in Binary. Significant recover of
16012         performance.
16013
16014 2002-04-10  Miguel de Icaza  <miguel@ximian.com>
16015
16016         * class.cs (FindMembers): Allow the Builders of the various
16017         members to be null.  If they are skip them.  This only happens
16018         during the PInvoke declaration.
16019
16020 2002-04-09  Miguel de Icaza  <miguel@ximian.com>
16021
16022         * parameter.cs (Parameters.ComputeParameterTypes): Flag the
16023         failure, so we do not keep going afterwards.
16024
16025         * expression.cs: (Invocation.OverloadResolve): I believe Ravi
16026         wanted to pass `false' as the `is_delegate' argument.  If this is
16027         the case, why not use delegate_type == null to mean `is_delegate =
16028         false' and anything else as is_delegate = true.
16029
16030 Tue Apr  9 05:40:12  2002 Piers Haken <piersh@friskit.com>
16031
16032         * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
16033         code for the section, not the beginning of the tests.
16034
16035 2002-04-08  Miguel de Icaza  <miguel@ximian.com>
16036
16037         * cfold.cs: Handle operator + (Enum x, Underlying x) 
16038
16039         * expression.cs (Binary): same.  Warn about errors where we have
16040         Enum/Enum in operator + as well.
16041
16042 Mon Apr  8 06:29:03  2002 Piers Haken <piersh@friskit.com>
16043
16044         * statement.cs:
16045                 - added support for switch(bool)
16046                 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
16047                 - add TableSwitchEmit() to handle table-based switch statements
16048
16049 2002-04-05  Ravi Pratap  <ravi@ximian.com>
16050
16051         * expression.cs (Invocation.OverloadResolve): Factor out code which
16052         does parameter compatibility checking with arguments so that we can 
16053         re-use the code even from Delegate.VerifyApplicability
16054
16055         (VerifyArgumentsCompat): Move above code here.
16056
16057         * delegate.cs (VerifyApplicability): Get rid of duplicate code
16058         and instead make a call to the above method.
16059
16060 2002-03-31  Ravi Pratap  <ravi@ximian.com>
16061
16062         * typemanager.cs (attribute_type): Corresponds to System.Attribute.
16063         We use it to keep track of classes which are attribute types.
16064
16065 2002-04-02  Miguel de Icaza  <miguel@ximian.com>
16066
16067         * delegate.cs (Delegate.Define): Correctly define the types in the
16068         presence of fixed and array parameters.
16069
16070         * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
16071         doing FindMembers.
16072
16073         * ecore.cs (Expression.MemberLookup): Reset binding flags to not
16074         include NonPublic after the first iteration.
16075
16076         * class.cs (Indexer.CheckBase): Only check if both parents are
16077         non-null. 
16078
16079         * cs-parser.jay (accessor_body): If empty, set to null.
16080
16081         * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
16082         same code path here to resolve constants names that we did have in
16083         MemberAccess.DoResolve.  There is too much code duplicated here.
16084
16085 2002-04-01  Miguel de Icaza  <miguel@ximian.com>
16086
16087         * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
16088
16089         * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
16090         to MakeUnionSet.
16091
16092         * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
16093         tokens, numbers and strings.
16094
16095         * ecore.cs (MethodGroupExpr): Make Emit warn about missing
16096         parenthesis.
16097
16098         * delegate.cs: Use ComputeAndDefineParameterTypes for both the
16099         asyncronous parameters and the regular parameters.  
16100
16101         * codegen.cs (CodeGen.Init): Use the constructor that allows us to
16102         specify the target directory.
16103
16104         * expression.cs: (This.DoResolve): Simplify
16105         (As.Emit): Optimize, do not generate IsInst if the expression is
16106         always of the given type.
16107
16108         (Is.DoResolve): Bug fix, we were reporting both always/never for
16109         the is expression.
16110
16111         * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
16112         creating too many unnecessary arrays.
16113
16114 2002-03-31  Miguel de Icaza  <miguel@ximian.com>
16115
16116         * class.cs (EmitFieldInitializer): Use Assign expression to assign
16117         fields instead of rolling our own initializer.   Takes care of all
16118         implicit conversions, and drops unnecessary static checks/argument.
16119
16120 2002-03-31  Dick Porter  <dick@ximian.com>
16121
16122         * driver.cs: use the GetDirectories() return values properly, and
16123         use "/" as path separator.
16124
16125 2002-03-30  Miguel de Icaza  <miguel@ximian.com>
16126
16127         * expression.cs (Unary): Optimize - - expr into expr.
16128         (Binary): Optimize a + (-b) into a -b.
16129
16130         * codegen.cs (CodeGen): Made all methods static.
16131
16132 2002-03-29  Miguel de Icaza  <miguel@ximian.com>
16133
16134         * rootcontext.cs: 
16135
16136         * decl.cs: Rename `definition' into `TypeBuilder' and drop the
16137         TypeBuilder property.
16138
16139         * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
16140         instead. 
16141
16142         * tree.cs: Removed the various RecordXXXX, and replaced with a
16143         single RecordDecl.  Removed all the accessor methods, and just
16144         left a single access point Type 
16145
16146         * enum.cs: Rename DefineEnum to DefineType.
16147
16148         * decl.cs: New abstract method `DefineType' used to unify the
16149         Defines for Enumerations, Interfaces, TypeContainers and
16150         Delegates.
16151
16152         (FindType): Moved LookupInterfaceOrClass here.  Moved the
16153         LookupBaseClasses method that used to live in class.cs and
16154         interface.cs here, and renamed to FindType.
16155
16156         * delegate.cs: Implement DefineType.  Take advantage of the
16157         refactored pattern for locating the parent builder without taking
16158         the parent_builder argument (which we know does not work if we are
16159         nested, and triggering a toplevel definition).
16160
16161 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
16162
16163         * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
16164         accessibility of a member has changed during override and report
16165         an error if so.
16166
16167         * class.cs (Method.Define, Property.Define): Only complain on
16168         overrides if the method is private, any other accessibility is
16169         fine (and since we just checked the permission is the same, we are
16170         good to go).
16171
16172         * cs-tokenizer.cs: only line, region, endregion, if, endif, else
16173         and elif are processed always.  The other pre-processing
16174         directives are only processed if we are "taking" the path
16175
16176 2002-03-29  Martin Baulig  <martin@gnome.org>
16177
16178         * class.cs (Method.Emit): Only emit symbolic debugging info if the
16179         current location is not Null.
16180
16181         * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
16182         a separate method so we can profile it.
16183
16184         * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
16185         `span.Seconds' are just seconds, but no minutes or hours.
16186         (MainDriver): Profile the CodeGen.SaveSymbols calls.
16187
16188 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
16189
16190         * class.cs (Method.Define), (Property.Define), (Indexer.Define):
16191         Remove the gratuitous set of Final:
16192
16193                                 // If an interface implementation, then we can set Final.
16194                                 if (((flags & MethodAttributes.Abstract) == 0) &&
16195                                     implementing.DeclaringType.IsInterface)
16196                                         flags |= MethodAttributes.Final;
16197
16198         I do not know what I was smoking when I used that.
16199
16200
16201         * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
16202         step into fixing the name resolution issues for delegates and
16203         unifying the toplevel name resolution.
16204
16205 2002-03-28  Martin Baulig  <martin@gnome.org>
16206
16207         * class.cs (Method.Emit): If we have a symbol writer, call its
16208         OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
16209         tell it about the current method.
16210
16211         * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
16212         writer that we're going to emit the first byte of IL code for a new
16213         statement (a new source line).
16214         (EmitContext.EmitTopBlock): If we have a symbol writer, call
16215         EmitContext.Mark() before emitting any code.
16216
16217         * location.cs (SymbolDocument): Return null when we're Null.
16218
16219         * statement.cs (Statement): Moved the `Location loc' variable here.
16220         (Statement.EmitBoolExpression): If we have a symbol writer, call
16221         ec.Mark() before emitting any code to tell it that we're at the
16222         beginning of a new statement.
16223         (StatementExpression): Added `Location' argument to the constructor.
16224         (Block): Added public readonly variable `StartLocation' and public
16225         variable `EndLocation'.  The latter is to be set using SetEndLocation().
16226         (Block): Added constructor which takes a start and end location.
16227         (Block.SetEndLocation): New method. This sets the end location.
16228         (Block.EmitMeta): If we have a symbol writer, tell it the names of the
16229         local variables we create.
16230         (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
16231         each statement and do also mark the begin and end of the block.
16232
16233         * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
16234         tell it the current lexer.Location, use Location.Null for the end of the
16235         block.
16236         (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
16237         current block, set its end location using SetEndLocation().
16238         (statement_expression): StatementExpression constructor now takes the
16239         lexer.Location as additional argument.
16240         (for_statement, declare_local_variables): Likewise.
16241         (declare_local_variables): When creating a new implicit block, use the
16242         new Block constructor and pass it the lexer.Location.
16243
16244 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
16245
16246         * ecore.cs (Expression.MemberLookup): On interfaces, lookup
16247         members also on the parent interfaces recursively.
16248
16249 2002-03-27  Miguel de Icaza  <miguel@ximian.com>
16250
16251         * report.cs: Use new formats, since Gonzalo finished the missing
16252         bits. 
16253
16254         * expression.cs (Binary.ResolveOperator): added missing operator|
16255         operator& and operator^ for bool/bool.
16256
16257         * cs-parser.jay: CheckDef now takes a Location argument that is
16258         used to report errors more precisly (instead of reporting the end
16259         of a definition, we try to track something which is a lot closer
16260         to the source of the problem).
16261
16262         * cs-tokenizer.cs: Track global token use, so we can properly flag
16263         the use of #define/#undef after the first token has been seen.
16264
16265         Also, rename the reportXXXX to Error_DescriptiveName
16266
16267         * decl.cs (DeclSpace.IsTopLevel): Move property here from
16268         TypeContainer, so that Enum and Interface can use this too.
16269
16270         * class.cs (TypeContainer.LookupInterfaceOrClass,
16271         GetInterfaceOrClass, GetClassBases, DefineType): Drop the
16272         `builder' argument.  Typically this was used to pass the parent
16273         builder (a ModuleBuilder or a TypeBuilder from whoever triggered
16274         the definition).  
16275
16276         The problem is that a nested class could trigger the definition of
16277         a toplevel class, and the builder would be obviously wrong in that
16278         case. 
16279
16280         So we drop this argument, and we compute dynamically the
16281         TypeBuilder/ModuleBuilder (the correct information was available
16282         to us anyways from DeclSpace.Parent)
16283
16284         * interface.cs (Interface.DefineInterface): Drop builder
16285         parameter cleanup like class.cs
16286
16287         * enum.cs (Enum.DefineEnum): Drop builder parameter.  Clean up
16288         like class.cs
16289
16290         * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
16291         values. 
16292
16293         (Try.Emit): Propagate the returns value from the statement.
16294
16295         (Return.Emit): Even if we are leavning 
16296
16297         * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
16298
16299         * modifiers.cs: Fix the computation of MethodAttributes flags.
16300
16301 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
16302
16303         * driver.cs: allow compilation of files that start with '/'.
16304         Add a default case when checking the argument of --target.
16305
16306 2002-03-25  Miguel de Icaza  <miguel@ximian.com>
16307
16308         * interface.cs: Implement the same search algorithm for types in
16309         the interface code.
16310
16311         * delegate.cs: Do not allow multiple definition.
16312
16313         * Recovered ChangeLog that got accidentally amputated
16314
16315         * interface.cs (Interface.DefineInterface): Prevent from double definitions.
16316
16317         * rootcontext.cs: Load manually enum to allow core classes to
16318         contain enumerations.
16319
16320         * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
16321         Update to new static methods in TypeManager.
16322
16323         * typemanager.cs (GetMethod, GetConstructor): Use our
16324         implementation of FindMembers to find the members, since during
16325         corlib compilation, the types are TypeBuilders and GetMethod and
16326         GetConstructor do not work.
16327
16328         Make all methods in TypeManager static.
16329
16330         (InitCodeHelpers): Split the functionality from
16331         the InitCodeTypes function.
16332
16333         * driver.cs: Call InitCodeHelpers after we have populated the
16334         types. 
16335
16336         * cs-parser.jay (delegate_declaration): we did not used to compute
16337         the delegate name correctly for void delegates.
16338
16339 2002-03-24  Miguel de Icaza  <miguel@ximian.com>
16340
16341         * rootcontext.cs (RootContext): Init the interface_resolve_order
16342         and type_container_resolve_order always.
16343
16344         (ResolveCore, BootstrapCorlib_ResolveClass,
16345         BootstrapCorlib_ResolveStruct): New functions to bootstrap the
16346         compiler when compiling with --nostdlib
16347
16348         * class.cs (TypeContainer.DefineType): Check that our parent is
16349         not null.  This test is most important when we are bootstraping
16350         the core types.
16351
16352         * codegen.cs: Split out the symbol writing code.
16353
16354 2002-03-25  Martin Baulig  <martin@gnome.org>
16355
16356         * driver.cs (-g): Made -g an alias for --debug.
16357
16358 2002-03-24  Martin Baulig  <martin@gnome.org>
16359
16360         * codegen.cs (SymbolWriter): New public variable. Returns the
16361         current symbol writer.
16362         (CodeGen): Added `bool want_debugging_support' argument to the
16363          constructor. If true, tell the ModuleBuild that we want debugging
16364         support and ask it for the ISymbolWriter.
16365         (Save): If we have a symbol writer, call it's Close() method after
16366         saving the assembly.
16367
16368         * driver.c (--debug): New command line argument to create a
16369         debugger information file.
16370
16371         * location.cs (SymbolDocument): New public property. Returns an
16372         ISymbolDocumentWriter object for the current source file or null
16373         if we don't have a symbol writer.
16374
16375 2002-03-21  Miguel de Icaza  <miguel@ximian.com>
16376
16377         * driver.cs (LoadAssembly): Correctly return when all the paths
16378         have been tried and not before.
16379
16380         * statement.cs (Switch.Emit): return the actual coverage for this
16381         statement (returns/not-returns)
16382
16383         (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
16384         switch of the statement if we are the last switch section.  That
16385         kills two problems: try/catch problems (we used to emit an empty
16386         nop at the end) and switch statements where all branches would
16387         return. 
16388
16389 2002-03-19  Miguel de Icaza  <miguel@ximian.com>
16390
16391         * driver.cs: Add default assemblies (the equivalent to the
16392         Microsoft CSC.RSP file)
16393
16394         * cs-tokenizer.cs: When updating `cols and setting it to zero,
16395         also update tokens_seen and set it to false.
16396
16397         * driver.cs: Implement --recurse for Mike.
16398
16399         * driver.cs (SplitPathAndPattern): Small bug fix, I was not
16400         correctly splitting out the paths.
16401
16402 2002-03-18  Miguel de Icaza  <miguel@ximian.com>
16403
16404         * interface.cs (Interface.PopulateProperty): Instead of using
16405         `parent' as the declaration space for the set parameters, use
16406         `this' 
16407
16408         * support.cs (InternalParameters): InternalParameters constructor
16409         takes a DeclSpace instead of a TypeContainer.
16410
16411         * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
16412         types are being initialized, load the address of it before calling
16413         the function.  
16414
16415         (New): Provide a mechanism to disable the generation of local
16416         value type temporaries when the caller will be providing us with
16417         an address to store it.
16418
16419         (ArrayCreation.EmitDynamicInitializers): Use it.
16420
16421 2002-03-17  Miguel de Icaza  <miguel@ximian.com>
16422
16423         * expression.cs (Invocation.EmitArguments): Only probe for array
16424         property if there is more than one argument.  Sorry about that.
16425
16426         * class.cs (Invocation.EmitArguments): Fix to emit arguments for
16427         empty param arrays.
16428
16429         * class.cs (Method.LabelParameters): Fix incorrect code path that
16430         prevented the `ParamArrayAttribute' from being applied to the
16431         params attribute.
16432
16433 2002-03-16  Miguel de Icaza  <miguel@ximian.com>
16434
16435         * support.cs (ReflectionParameters): Correctly compute whether the
16436         last argument is a params array.  Fixes the problem with
16437         string.Split ('a')
16438
16439         * typemanager.cs: Make the assemblies array always be non-null
16440         (empty, but non-null)
16441
16442         * tree.cs (RecordDecl): New function that abstracts the recording
16443         of names.  This reports error 101, and provides a pointer to the
16444         previous declaration.  Fixes a crash in the compiler.
16445
16446         * cs-parser.jay (constructor_declaration): Update to new grammar,
16447         and provide a constructor_body that can be empty.
16448
16449 2002-03-15  Miguel de Icaza  <miguel@ximian.com>
16450
16451         * driver.cs: Add support for --resources.
16452
16453         * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
16454         Make all types for the various array helper methods be integer.
16455
16456         * ecore.cs (Expression.ConvertNumericExplicit): Pass the
16457         CheckState to ConvCast.
16458
16459         (ConvCast): Now it takes a `checked' state argument, to avoid
16460         depending on the emit context for the conversion, and just using
16461         the resolve time setting.
16462
16463         * expression.cs (ArrayCreation.EmitArrayArguments): New function,
16464         instead of Invocation.EmitArguments.  We do not emit the original
16465         arguments, instead we emit those which have been converted to
16466         unsigned int expressions.
16467
16468         * statement.cs (Block.EmitMeta): Drop tracking of indexes.
16469
16470         * codegen.cs: ditto.
16471
16472         * expression.cs (LocalVariableReference): Drop the use of the
16473         Store function that depended on the variable index.
16474
16475         * statement.cs (VariableInfo): Drop the `Idx' property from this
16476         class, as this is not taking into account the indexes for
16477         temporaries tat we generate during the execution, getting the
16478         indexes wrong.
16479
16480         * class.cs: First emit class initializers, then call the parent
16481         constructor. 
16482
16483         * expression.cs (Binary): Fix opcode emision.
16484         (UnaryMutator.EmitCode): Support checked code generation
16485
16486         * ecore.cs (MemberLookup): TypeManager.FindMembers will return
16487         matches for events for both the Static and Instance scans,
16488         pointing to the same element.   Fix that.
16489
16490 2002-03-14  Miguel de Icaza  <miguel@ximian.com>
16491
16492         * rootcontext.cs (ResolveTree): Always set the
16493         interface_resolve_order, because nested interfaces will be calling
16494         into us.
16495
16496         * class.cs (GetInterfaceOrClass): Track the same resolution
16497         process used by TypeManager.LookupType.  This fixes the nested
16498         type lookups in class declarations (separate path from
16499         LookupType). 
16500
16501         (TypeContainer.DefineType): Also define nested interfaces.
16502         (TypeContainer.RegisterOrder): New public function used to
16503         register the order in which child interfaces need to be closed.
16504
16505         Nested interfaces need to be closed after their parents have been
16506         created. 
16507
16508         * interface.cs (InterfaceAttr): Put all the logic for computing
16509         the interface attribute here. 
16510
16511         (DefineInterface): Register our interface order with the
16512         RootContext or with the TypeContainer depending on the case.
16513
16514 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
16515
16516         * cs-parser.jay: rework foreach statement to work with the new
16517         changes to the policy on SimpleNames.
16518
16519         * report.cs: support Stacktrace on warnings as well.
16520
16521         * makefile: drop --unsafe and /unsafe from the compile.
16522
16523 2002-03-13  Ravi Pratap  <ravi@ximian.com>
16524
16525         * ecore.cs (StandardConversionExists): Modify to take an Expression
16526         as the first parameter. Ensure we do null -> reference type conversion
16527         checking.
16528
16529         * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
16530         temporary Expression objects.
16531
16532 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
16533
16534         * interface.cs: workaround bug in method overloading resolution
16535         (there is already a bugzilla bug for it).
16536
16537 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
16538
16539         We could also solve this problem by having a separate path for
16540         performing type lookups, instead of DoResolve, we could have a
16541         ResolveType entry point, and only participating pieces of the
16542         production (simplename, deref, array) would implement this. 
16543
16544         * codegen.cs (EmitContext): New field OnlyLookupTypes used to
16545         signal SimpleName to only resolve type names and not attempt to
16546         resolve anything else.
16547
16548         * expression.cs (Cast): Set the flag.
16549
16550         * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
16551
16552         * class.cs: Only report 108 if there is no `new' modifier.
16553
16554         * cs-parser.jay: rework foreach statement to work with the new
16555         changes to the policy on SimpleNames.
16556         
16557         * report.cs: support Stacktrace on warnings as well.
16558
16559         * makefile: drop --unsafe and /unsafe from the compile.
16560
16561 2002-03-11  Miguel de Icaza  <miguel@ximian.com>
16562
16563         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
16564         lookups here, instead of doing that at parse time.  This means
16565         that our grammar will not introduce `LocalVariableReferences' as
16566         expressions at this point.  That solves the problem of code like
16567         this:
16568
16569         class X {
16570            static void Main ()
16571            { int X = 1;
16572             { X x = null }}}
16573
16574         This is only half the fix.  The full fix requires parameters to
16575         also be handled in this way.
16576
16577         * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
16578         makes the use more obvious of the DeclSpace.  The
16579         ec.TypeContainer.TypeBuilder is now only used to pull the
16580         TypeBuilder for it.
16581
16582         My theory is that I can get rid of the TypeBuilder completely from
16583         the EmitContext, and have typecasts where it is used (from
16584         DeclSpace to where it matters).  
16585
16586         The only pending problem is that the code that implements Aliases
16587         is on TypeContainer, and probably should go in DeclSpace.
16588
16589         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
16590         lookups here, instead of doing that at parse time.  This means
16591         that our grammar will not introduce `LocalVariableReferences' as
16592         expressions at this point.  That solves the problem of code like
16593         this:
16594
16595         class X {
16596            static void Main ()
16597            { int X = 1;
16598             { X x = null }}}
16599
16600         This is only half the fix.  The full fix requires parameters to
16601         also be handled in this way.
16602
16603         * class.cs (Property.DefineMethod): When implementing an interface
16604         method, set newslot, when implementing an abstract method, do not
16605         set the flag (before we tried never setting it, or always setting
16606         it, which is the difference).
16607         (Indexer.DefineMethod): same.
16608         (Method.DefineMethod): same.
16609
16610         * ecore.cs: Only set the status used flag if we get back a Field.
16611
16612         * attribute.cs: Temporary hack, so Paolo can keep working.
16613
16614 2002-03-08  Ravi Pratap  <ravi@ximian.com>
16615
16616         * attribute.cs (Attribute.UnmanagedType): This is to keep track of
16617         the unmanaged type in the case we have a MarshalAs attribute.
16618
16619         (Resolve): Handle the case when we are parsing the special MarshalAs
16620         attribute [we need to store the unmanaged type to use later]
16621
16622         * typemanager.cs (marshal_as_attr_type): Built in type for the 
16623         MarshalAs Attribute.
16624
16625         * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute 
16626         on parameters and accordingly set the marshalling info.
16627
16628 2002-03-09  Miguel de Icaza  <miguel@ximian.com>
16629
16630         * class.cs: Optimizing slightly by removing redundant code after
16631         we switched to the `NoTypes' return value.
16632         (Property.DefineMethod): use NoTypes here too.
16633
16634         This fixes the bug I introduced in my last batch of changes.
16635
16636 2002-03-05  Ravi Pratap  <ravi@ximian.com>
16637
16638         * tree.cs (RecordEnum): Add. We now keep track of enums too.
16639
16640         * class.cs (LookupInterfaceOrClass): Check against the list of recorded
16641         Enums since those are types too. 
16642
16643         * cs-parser.jay (enum_declaration): Record enums as we parse them.
16644
16645         * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined 
16646         thanks to a call during the lookup process.
16647
16648 2002-03-07  Miguel de Icaza  <miguel@ximian.com>
16649
16650         * statement.cs (Foreach): Lots of work to accomodate a particular
16651         kind of foreach statement that I had not kept in mind.  It is
16652         possible to have foreachs on classes that provide a GetEnumerator
16653         method that return objects that implement the "pattern" for using
16654         a foreach, there is no need to support GetEnumerator
16655         specifically. 
16656
16657         This is needed to compile nant.
16658
16659         * decl.cs: Only report 114 if the member is not `Finalize' and if
16660         the warning level is at least 2.
16661
16662         * class.cs: Moved the compare function from Method to
16663         MethodSignature. 
16664
16665         (MethodSignature.InheritableMemberSignatureCompare): Add new
16666         filter function that is used to extract inheritable methods from a
16667         class. 
16668
16669         (Method.Define): Use the new `inheritable_method_signature_filter'
16670         delegate
16671
16672         * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
16673         command. 
16674
16675 2002-03-06  Miguel de Icaza  <miguel@ximian.com>
16676
16677         * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
16678
16679         * cs-parser.jay: Add opt_semicolon to the interface declaration.
16680
16681         * expression.cs: Pass location information to
16682         ConvertImplicitStandard. 
16683
16684         * class.cs: Added debugging code to track return values from
16685         interfaces. 
16686
16687 2002-03-05  Miguel de Icaza  <miguel@ximian.com>
16688
16689         * expression.cs (Is.DoResolve): If either side of the `is' is an
16690         interface, do not flag the warning.
16691
16692         * ecore.cs (ImplicitReferenceConversion): We need a separate test
16693         for interfaces
16694
16695         * report.cs: Allow for --fatal to be used with --probe.
16696
16697         * typemanager.cs (NoTypes): Move the definition for the empty Type
16698         array here. 
16699
16700         * class.cs (TypeContainer.FindMembers): Also look for methods defined by
16701         properties. 
16702         (TypeContainer.DefineProxy): New function used to proxy to parent
16703         implementations when implementing interfaces.
16704         (TypeContainer.ParentImplements): used to lookup if our parent
16705         implements a public function that is required by an interface.
16706         (TypeContainer.VerifyPendingMethods): Hook this up.
16707
16708         * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
16709         `modules' and `assemblies' arraylists into arrays.  We only grow
16710         these are the very early start up of the program, so this improves
16711         the speedof LookupType (nicely measured).
16712
16713         * expression.cs (MakeByteBlob): Replaced unsafe code with
16714         BitConverter, as suggested by Paolo.
16715
16716         * cfold.cs (ConstantFold.Binary): Special case: perform constant
16717         folding of string concatenation, but if either side is a string,
16718         and the other is not, then return null, and let the runtime use
16719         the concatenation on the string plus the object (using
16720         `Object.ToString'). 
16721
16722 2002-03-04  Miguel de Icaza  <miguel@ximian.com>
16723
16724         Constant Folding has been implemented now.
16725
16726         * expression.cs (Unary.Reduce): Do not throw an exception, catch
16727         the error instead on types that are not supported in one's
16728         complement. 
16729
16730         * constant.cs (Constant and all children): New set of functions to
16731         perform implict and explicit conversions.
16732
16733         * ecore.cs (EnumConstant): Implement the new functions to perform
16734         conversion by proxying to the child expression.
16735
16736         * codegen.cs: (ConstantCheckState): Constant evaluation has its
16737         own separate setting that can not be turned off from the command
16738         line using --unchecked or --checked and is only controlled using
16739         the checked/unchecked statements and expressions.  This setting is
16740         used by the constant folder to flag errors.
16741
16742         * expression.cs (CheckedExpr, UncheckedExpr): Set the
16743         ConstantCheckState as well.   
16744
16745         During Resolve, they also have to flag the state, because the
16746         constant folder runs completely in the Resolve phase.
16747
16748         * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
16749         well.
16750
16751 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
16752
16753         * cfold.cs: New file, this file contains the constant folder.
16754
16755         * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
16756         argument to track whether we are using the resulting address to
16757         load or store a value and provide better error messages. 
16758
16759         (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
16760         new AddressOf arguments.
16761
16762         * statement.cs (Foreach.EmitCollectionForeach): Update
16763
16764         * expression.cs (Argument.Emit): Call AddressOf with proper
16765         arguments to track usage.
16766
16767         (New.DoEmit): Call AddressOf with new arguments.
16768
16769         (Unary.Emit): Adjust AddressOf call.
16770
16771 2002-03-01  Ravi Pratap  <ravi@ximian.com>
16772
16773         * cs-parser.jay (member_access): Change the case for pre-defined types
16774         to use a MemberAccess instead of a SimpleName. Thanks to Felix again for 
16775         this suggestion.
16776
16777         * class.cs (Operator::Emit): If we are abstract or extern, we don't have
16778         a method body.
16779
16780         * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
16781         essentially like methods and apply attributes like MethodImplOptions to them too.
16782
16783         * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
16784         not being null.
16785
16786         * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
16787         DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
16788         is the DeclSpace.
16789
16790         * Update code everywhere accordingly.
16791
16792         * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
16793
16794         * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
16795
16796 2002-02-28  Ravi Pratap  <ravi@ximian.com>
16797
16798         * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
16799         try performing lookups against those instead of jumping straight into using
16800         the 'using' clauses.
16801
16802         (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
16803
16804         (LookupType): Perform lookups in implicit parents too.
16805
16806         * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
16807         sequence as RootContext.LookupType. 
16808
16809         * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries 
16810         the various cases of namespace lookups into this method.
16811
16812 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
16813
16814         * cs-parser.jay: Add support for [Attribute ()] (empty arguments
16815         in positional arguments)
16816
16817         * class.cs (Operator): Update the AllowedModifiers to contain
16818         extern. 
16819
16820         * cs-parser.jay: Update operator declaration to allow for the
16821         operator body to be empty.
16822
16823         * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
16824         values. 
16825
16826 2002-02-27  Miguel de Icaza  <miguel@ximian.com>
16827
16828         * class.cs (Method.Emit): Label parameters.
16829
16830         * driver.cs: Return 1 or 0 as the program exit code.
16831
16832 2002-02-26  Miguel de Icaza  <miguel@ximian.com>
16833
16834         * expression.cs: Special case the `null' object when trying to
16835         auto-compute the type, as anything can be explicitly converted to
16836         that. 
16837
16838         * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
16839         spotting this Paolo.
16840
16841         (Expression.ImplicitNumericConversion): Perform comparissions of
16842         the type using the underlying type in the case of an enumeration
16843         rather than using the enumeration type for the compare.
16844
16845         Cope with the underlying == type case, which is not possible to
16846         catch before. 
16847
16848         (Expression.ConvertNumericExplicit): Perform comparissions of
16849         the type using the underlying type in the case of an enumeration
16850         rather than using the enumeration type for the compare.
16851
16852         * driver.cs: If the user does not supply an extension, assume .exe
16853
16854         * cs-parser.jay (if_statement): Rewrote so that we can track the
16855         location for the if statement.
16856
16857         * expression.cs (Binary.ConstantFold): Only concat strings when
16858         the operation is "+", not everything ;-)
16859
16860         * statement.cs (Statement.EmitBoolExpression): Take a location
16861         argument. 
16862         (If, While, Do): Track location.
16863
16864         * expression.cs (Binary.ResolveOperator): In the object + string
16865         case, I was missing a call to ConvertImplicit
16866
16867 2002-02-25  Ravi Pratap  <ravi@ximian.com>
16868
16869         * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
16870         Location arguments. Ensure we use RootContext.LookupType to do our work
16871         and not try to do a direct Type.GetType and ModuleBuilder.GetType
16872
16873         * interface.cs (PopulateMethod): Handle the type of the parameter being
16874         null gracefully.
16875
16876         * expression.cs (Invocation.BetterFunction): Handle the case when we 
16877         have a params method with no fixed arguments and a call is made with no
16878         arguments.
16879
16880 2002-02-25  Miguel de Icaza  <miguel@ximian.com>
16881
16882         * cs-tokenizer.cs: Add support for the quote-escape-sequence in
16883         the verbatim-string-literal
16884
16885         * support.cs (InternalParameters.ParameterModifier): handle null
16886         fixed parameters.
16887         (InternalParameters.ParameterType): ditto.
16888
16889         * parameter.cs (VerifyArgs): Also check if the fixed parameter is
16890         duplicating the name of the variable parameter.
16891         (GetParameterByName): Fix bug where we were not looking up array
16892         paramters if they were the only present (thanks Paolo!).
16893         (GetParameterInfo): We only have an empty set of types if both
16894         fixed and array are set to null.
16895         (GetParameterInfo-idx): Handle FixedParameter == null
16896
16897         * cs-parser.jay: Handle the case where there is no catch
16898         statements (missing null test).
16899
16900 2002-02-22  Miguel de Icaza  <miguel@ximian.com>
16901
16902         * driver.cs (MainDriver): Be conservative on our command line
16903         handling.
16904
16905         Catch DirectoryNotFoundException when calling GetFiles.
16906
16907         (SplitPathAndPattern): Used to split the input specification into
16908         a path and a pattern that we can feed to Directory.GetFiles.
16909
16910 2002-02-21  Miguel de Icaza  <miguel@ximian.com>
16911
16912         * statement.cs (Fixed): Implement the last case of the Fixed
16913         statement (string handling).
16914
16915         * expression.cs (StringPtr): New class used to return a char * to
16916         a string;  Used by the Fixed statement.
16917
16918         * typemanager.cs: Add char_ptr_type.  Add get_OffsetToStringData method.
16919
16920         * expression.cs (Binary.ResolveOperator): Remove redundant
16921         MemberLookup pn parent type.
16922         Optimize union call, we do not need a union if the types are the same.
16923         (Unary.ResolveOperator): REmove redundant MemberLookup on parent
16924         type.
16925
16926         Specialize the use of MemberLookup everywhere, instead of using
16927         the default settings. 
16928
16929         (StackAlloc): Implement stackalloc keyword.
16930
16931         * cs-parser.jay: Add rule to parse stackalloc.
16932
16933         * driver.cs: Handle /h, /help, /?
16934
16935         * expression.cs (MakeByteBlob): Removed the hacks we had in place
16936         before we supported unsafe code.
16937
16938         * makefile: add --unsafe to the self compilation of mcs.
16939
16940 2002-02-20  Miguel de Icaza  <miguel@ximian.com>
16941
16942         * expression.cs (PointerArithmetic): New class that is used to
16943         perform pointer arithmetic.
16944         (Binary.Resolve): Handle pointer arithmetic
16945         Handle pointer comparission.
16946         (ArrayPtr): Utility expression class that is used to take the
16947         address of an array.
16948
16949         (ElementAccess): Implement array access for pointers
16950
16951         * statement.cs (Fixed): Implement fixed statement for arrays, we
16952         are missing one more case before we are done.
16953
16954         * expression.cs (Indirection): Implement EmitAssign and set the
16955         ExprClass to Variable.  This allows pointer dereferences to be
16956         treated as variables, and to have values assigned to them.
16957
16958         * ecore.cs (Expression.StoreFromPtr): New utility function to
16959         store values dereferencing.
16960
16961 2002-02-20  Ravi Pratap  <ravi@ximian.com>
16962
16963         * expression.cs (Binary.ResolveOperator): Ensure that we are
16964         not trying to operate on a void type - this fixes the reported
16965         bug.
16966
16967         * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
16968         the parent implementation is sealed.
16969
16970         * ../errors/cs0239.cs : Add.
16971
16972         * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
16973
16974         * typemanager.cs (unverifiable_code_type): Corresponds to 
16975         System.Security.UnverifiableCodeAttribute. We need to emit this for modules
16976         which have unsafe code in them.
16977
16978         * rootcontext.cs (EmitCode): Emit the above attribute when we are in an 
16979         unsafe context.
16980
16981 2002-02-19  Miguel de Icaza  <miguel@ximian.com>
16982
16983         * cs-tokenizer.cs: Add support for @"litreal strings"
16984
16985         Make tokenizer accept pre-processor directives
16986         on any column (remove the old C-like limitation). 
16987
16988         * rootcontext.cs (EmitCode): Emit any global attributes.
16989         (AddGlobalAttributes): Used to keep track of assembly attributes. 
16990
16991         * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
16992
16993         * cs-parser.jay: Add support for global attributes.  
16994
16995 2002-02-17  Miguel de Icaza  <miguel@ximian.com>
16996
16997         * expression.cs (Indirection): New helper class.  Unary will
16998         create Indirection classes to be able to implement the
16999         IMemoryLocation interface on it.
17000
17001 2002-02-16  Miguel de Icaza  <miguel@ximian.com>
17002
17003         * cs-parser.jay (fixed_statement): reference the right statement.
17004
17005         * statement.cs (Fixed.Emit): Finish implementing the fixed
17006         statement for the &x case.
17007
17008 2002-02-14  Miguel de Icaza  <miguel@ximian.com>
17009
17010         * class.cs (Property.Define, Method.Define): Remove newslot when
17011         `implementing'.  
17012
17013         * modifiers.cs: My use of NewSlot when `Abstract' was set was
17014         wrong.  NewSlot should only be used if the `new' keyword is present.
17015
17016         * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
17017         locating our system dir.  Sorry about this.
17018
17019 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
17020
17021         * driver.cs (GetSystemDir): Compute correctly the location of our
17022         system assemblies.  I was using the compiler directory instead of
17023         the library directory.
17024
17025 2002-02-13  Ravi Pratap  <ravi@ximian.com>
17026
17027         * expression.cs (BetterFunction): Put back in what Miguel commented out
17028         since it is the correct fix. The problem is elsewhere ;-)
17029
17030         (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
17031         parameters of the parms method are themselves compatible or not !
17032
17033         (StandardConversionExists): Fix very dangerous bug where we were forgetting
17034         to check that a class implements an interface before saying that an implicit
17035         conversion was allowed. Use ImplementsInterface to do the checking.
17036
17037 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
17038
17039         * class.cs (Method.Define): Track whether we are an explicit
17040         implementation or not.  And only call DefineMethodOverride if we
17041         are an explicit implementation.
17042
17043         (Property.DefineMethod): Ditto.
17044
17045 2002-02-11  Ravi Pratap  <ravi@ximian.com>
17046
17047         * expression.cs (BetterFunction): Catch hideous bug which was
17048          preventing us from detecting ambiguous calls due to implicit casts i.e
17049         cs0121.
17050
17051 2002-01-29  Miguel de Icaza  <miguel@ximian.com>
17052
17053         * support.cs (Pair): Remove un-needed method.  I figured why I was
17054         getting the error in cs-parser.jay, the variable in a foreach loop
17055         is readonly, and the compiler does not really treat this as a variable.
17056
17057         * cs-parser.jay (fixed_statement): Fix grammar.  Use ASSIGN
17058         instead of EQUALS in grammar.  
17059
17060         * typemanager.cs (VerifyUnmanaged): Report correct error (208)
17061
17062         * expression.cs (Unary.DoResolve): Check whether the argument is
17063         managed or not.
17064
17065 2002-01-28  Miguel de Icaza  <miguel@ximian.com>
17066
17067         * support.cs: Api for Pair to set a value.  Despite the fact that
17068         the variables are public the MS C# compiler refuses to compile
17069         code that accesses the field if the variable is part of a foreach
17070         statement. 
17071
17072         * statement.cs (Fixed): Begin implementation of the fixed
17073         statement.
17074
17075         (Block.AddVariable): Return the VariableInfo on success and null
17076         on failure instead of true/false. 
17077
17078         * cs-parser.jay (foreach): Catch errors on variables already
17079         defined (we were ignoring this value before) and properly unwind
17080         the block hierarchy
17081
17082         (fixed_statement): grammar for the fixed statement.
17083
17084 2002-01-25  Miguel de Icaza  <miguel@ximian.com>
17085
17086         * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
17087         pointer types to be incretemented.
17088
17089         (SizeOf): Implement.
17090
17091         * cs-parser.jay (pointer_member_access): Implement
17092         expr->IDENTIFIER production.
17093
17094         * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
17095         MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
17096         on safe contexts.
17097
17098         (Unary): Implement indirection.
17099
17100         * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
17101         use in non-unsafe context).
17102
17103         (SimpleName.DoResolve): Check for pointers in field access on safe
17104         contexts. 
17105
17106         (Expression.LoadFromPtr): Factor the load-indirect code in this
17107         function.  This was duplicated in UnboxCast and ParameterReference
17108
17109 2002-01-24  Miguel de Icaza  <miguel@ximian.com>
17110
17111         * expression.cs (ComposedCast): report an error if a pointer cast
17112         is used in a safe region.
17113
17114         * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
17115         pointer type casts in unsafe context.
17116
17117         * codegen.cs (EmitContext): Set up IsUnsafe.
17118
17119         * cs-parser.jay (non_expression_type): Add productions for pointer
17120         casts. 
17121
17122         * expression.cs (Invocation.EmitCall): Remove chunk of buggy
17123         code.  We should not use force into static mode if the method is
17124         not virtual.  Fixes bug in MIS
17125
17126         * statement.cs (Do.Emit, While.Emit, For.Emit,
17127         Statement.EmitBoolExpression): Add support to Do and While to
17128         propagate infinite loop as `I do return' semantics.
17129
17130         Improve the For case to also test for boolean constants.
17131
17132         * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
17133         to the list of attributes we can add.
17134
17135         Remove `EmitContext' argument.
17136
17137         * class.cs (Method.Define): Apply parameter attributes.
17138         (Constructor.Define): Apply parameter attributes.
17139         (MethodCore.LabelParameters): Move here the core of labeling
17140         parameters. 
17141
17142         * support.cs (ReflectionParameters.ParameterModifier,
17143         InternalParameters.ParameterModifier): Use IsByRef on the type and
17144         only return the OUT bit for these parameters instead of in/out/ref
17145         flags.
17146
17147         This is because I miss-understood things.  The ParameterInfo.IsIn
17148         and IsOut represent whether the parameter has the [In] and [Out]
17149         attributes set.  
17150
17151 2002-01-22  Miguel de Icaza  <miguel@ximian.com>
17152
17153         * ecore.cs (FieldExpr.Emit): Release temporaries.
17154
17155         * assign.cs (LocalTemporary.Release): new function.
17156
17157         * codegen.cs (EmitContext.GetTemporaryStorage,
17158         EmitContext.FreeTemporaryStorage): Rework the way we deal with
17159         temporary storage.  Now we can "put back" localbuilders when we
17160         are done with them
17161
17162 2002-01-21  Miguel de Icaza  <miguel@ximian.com>
17163
17164         * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
17165         need to make a copy of the variable to generate verifiable code.
17166
17167 2002-01-19  Miguel de Icaza  <miguel@ximian.com>
17168
17169         * driver.cs: Compute dynamically the system directory.
17170
17171         * ecore.cs (CopyNewMethods): reworked, exposed, made public.
17172         Slower, but more generally useful.  Used by the abstract
17173         registering implementation. 
17174
17175         * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
17176         the rules for the special rule on Type/instances.  First check if
17177         we have the same name, and if so, try that special static path
17178         rather than the instance path.
17179
17180 2002-01-18  Miguel de Icaza  <miguel@ximian.com>
17181
17182         * cs-parser.jay: Emit 642 (warning: possible empty statement) for
17183         for, while and if.
17184
17185         * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
17186         Enum, ValueType, Delegate or Array for non-corlib compiles.
17187
17188         * cs-tokenizer.cs: Catch long identifiers (645)
17189
17190         * typemanager.cs (IndexerPropetyName): Ravi never tested this
17191         piece of code.
17192
17193         * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
17194         fix, we were returning too early, so we were not registering
17195         pending methods from abstract classes.
17196
17197         Do not register pending methods if the class is abstract.
17198
17199         * expression.cs (Conditional.DoResolve): Report circular implicit
17200         conversions when we neecd to compute it for conditional
17201         expressions. 
17202
17203         (Is.DoResolve): If the expression is always of the provided type,
17204         flag warning 183.  If the expression can not ever be of the
17205         provided type flag warning 184.
17206
17207         * class.cs: Catch 169 as well.
17208
17209         * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
17210         read. 
17211
17212 2002-01-18  Nick Drochak  <ndrochak@gol.com>
17213
17214         * makefile: remove path to beta2 csc.exe.  path to csc.exe must be in PATH instead.
17215
17216 2002-01-17  Miguel de Icaza  <miguel@ximian.com>
17217
17218         * interface.cs: (PopulateMethod): Check for pointers being defined
17219         only if the unsafe context is active.
17220         (PopulateProperty): ditto.
17221         (PopulateIndexer): ditto.
17222
17223         * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
17224         specified.  If pointers are present, make sure that they are
17225         present in an unsafe context.
17226         (Constructor, Constructor.Define): ditto.
17227         (Field, Field.Define): ditto.
17228         (Property, Property.Define): ditto.
17229         (Event, Event.Define): ditto.
17230
17231         * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
17232         hashtable if there are classes or structs defined.
17233
17234         * expression.cs (LocalVariableReference.DoResolve): Simplify this
17235         code, as the constant resolution moved.
17236
17237         * statement.cs (Block.EmitMeta): Resolve all constants as we emit
17238         the metadata, so we can flag error 133. 
17239
17240         * decl.cs (MemberCore.UnsafeOK): New function to test that a
17241         pointer is being declared in an unsafe context.
17242
17243 2002-01-16  Miguel de Icaza  <miguel@ximian.com>
17244
17245         * modifiers.cs (Modifiers.Check): Require a Location argument.
17246         Report error 227 for Unsafe use.
17247
17248         * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
17249
17250         * statement.cs (For.Emit): If the test is null, then report that
17251         we do `return', as we wont reach anything afterwards.
17252
17253         (Switch.SwitchGoverningType): Track the expression that matched
17254         the conversion.
17255
17256         * driver.cs: Allow negative numbers as an error code to flag.
17257
17258         * cs-parser.jay: Handle 1551.
17259
17260         * namespace.cs: Add 1537 checking (repeated using alias namespaces).
17261
17262 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
17263
17264         * cs-parser.jay: Report 1518 (type declaration can only contain
17265         class, struct, interface, enum or delegate)
17266
17267         (switch_label): Report 1523 (keywords `case' or `default' must
17268         preced code)
17269
17270         (opt_switch_sections): Report 1522 (empty switch)
17271
17272         * driver.cs: Report 1515 (response file specified multiple times)
17273         Report 1516 (Source file specified multiple times).
17274
17275         * expression.cs (Argument.Resolve): Signal 1510
17276
17277         (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
17278         access not allowed in static code)
17279
17280 2002-01-11  Ravi Pratap  <ravi@ximian.com>
17281
17282         * typemanager.cs (IsPointerType): Utility method which we are going
17283         to need a lot.
17284
17285         * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
17286         the object type, so we take care of that.
17287
17288         * expression.cs (FullMethodDesc): Also include the return type in descriptions.
17289
17290         * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
17291         added to non-params parameters :-)
17292
17293         * typemanager.cs (CSharpName): Include 'void' type too. 
17294
17295         (void_ptr_type): Include in the set of core types.
17296
17297         * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of 
17298         duplicating code.
17299
17300         (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have 
17301         an unsafe context.
17302
17303         * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had 
17304         completely forgotten about it.
17305
17306 2002-01-10  Ravi Pratap  <ravi@ximian.com>
17307
17308         * cs-parser.jay (pointer_type): Add. This begins our implementation
17309         of parsing rules for unsafe code.
17310
17311         (unsafe_statement): Implement.
17312
17313         (embedded_statement): Modify to include the above.
17314
17315         * statement.cs (Unsafe): Implement new class for unsafe blocks.
17316
17317         * codegen.cs (EmitContext.InUnsafe): Add. This determines
17318         if the current context is an unsafe one.
17319
17320         * cs-parser.jay (local_variable_pointer_type): Since local variable types
17321         are handled differently, we need separate rules for them.
17322
17323         (local_variable_declaration): Update to use local_variable_pointer_type
17324         to allow variable declarations of unmanaged pointer types.
17325
17326         * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
17327         in unsafe contexts.
17328
17329         * ../errors/cs0214.cs : Add.
17330
17331 2002-01-16  Nick Drochak  <ndrochak@gol.com>
17332
17333         * makefile: remove 'response' file when cleaning.
17334
17335 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
17336
17337         * cs-parser.jay: Report 1524.
17338
17339 2002-01-14  Miguel de Icaza  <miguel@ximian.com>
17340
17341         * typemanager.cs (RegisterMethod): drop checking if we have
17342         registered this from here
17343
17344 2002-01-12  Miguel de Icaza  <miguel@ximian.com>
17345
17346         * class.cs (Method.EmitDestructor): Implement calling our base
17347         destructor. 
17348
17349         * statement.cs (Try.Emit): Fix to reset the InFinally to the old
17350         value of InFinally.
17351
17352         * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
17353         this routine and will wrap the call in a try/catch block.  Deal
17354         with the case.
17355
17356 2002-01-11  Miguel de Icaza  <miguel@ximian.com>
17357
17358         * ecore.cs (Expression.MemberLookup): instead of taking a
17359         parameter `same_type' that was used to tell whether we could
17360         access private members we compute our containing type from the
17361         EmitContext.
17362
17363         (FieldExpr): Added partial support for volatile fields.  This does
17364         not work for volatile fields exposed from assemblies, as I can not
17365         figure out how to extract the modreq from it.
17366
17367         Updated all the source files to use this.
17368
17369         * codegen.cs (EmitContext): Compute ContainerType ahead of time,
17370         because it is referenced by MemberLookup very often. 
17371
17372 2002-01-09  Ravi Pratap  <ravi@ximian.com>
17373
17374         * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
17375         TypeBuilder.GetCustomAttributes to retrieve what we need.
17376
17377         Get rid of redundant default_member_attr_type as this is the same as
17378         default_member_type which already exists.
17379
17380         * interface.cs, attribute.cs : Update accordingly.
17381
17382 2002-01-08  Miguel de Icaza  <miguel@ximian.com>
17383
17384         * typemanager.cs: Enable IndexerPropertyName again.  It does not
17385         work for TYpeBuilders though.  Ravi, can you please fix this?
17386
17387         * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
17388
17389         * expression.cs (Argument.Emit): Handle the case of ref objects
17390         being passed to ref functions;  
17391
17392         (ParameterReference.EmitLoad): Loads the content of the pointer
17393         without dereferencing.
17394
17395 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
17396
17397         * cs-tokenizer.cs: Implemented the pre-processing expressions.
17398
17399 2002-01-08  Ravi Pratap  <ravi@ximian.com>
17400
17401         * class.cs (Indexer.DefineMethod): Incorporate the interface
17402         type in the name of the method if we are doing explicit interface
17403         implementation.
17404
17405         * expression.cs (ConversionExists): Remove as it is completely obsolete.
17406
17407         (BetterConversion): Fix extremely trivial bug where we were referring to
17408         ConversionExists instead of StandardConversionExists ! Hooray, things are fine
17409         again !
17410
17411         * ../errors/bug16.cs : Add although we have fixed it.
17412
17413 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
17414
17415         * expression.cs (BaseIndexer): Begin implementation.
17416
17417         * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
17418
17419         * cs-parser.jay (indexer_declarator): Use qualified_identifier
17420         production directly to remove a shift/reduce, and implement
17421         explicit interface implementation.
17422
17423         * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
17424         after a floating point suffix.
17425
17426         * expression.cs (DoNumericPromotions): Improved the conversion for
17427         uint/uint.  If we have a constant, we avoid doing a typecast to a
17428         larger type.
17429
17430         * class.cs (Indexer): Implement explicit interface implementation
17431         for indexers.
17432
17433 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
17434
17435         * class.cs: make the default instance constructor public and hidebysig.
17436
17437 2001-01-03  Ravi Pratap  <ravi@ximian.com>
17438
17439         * interface.cs (EmitDefaultMemberAttr): Make this helper method static
17440         so we can call it from elsewhere.
17441
17442         * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
17443         we emit it internally if the class has a defined indexer; otherwise the user
17444         emits it by decorating the class definition with the DefaultMemberAttribute.
17445
17446         * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
17447         attribute is not used on a type which defines an indexer.
17448
17449         * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
17450         character when we skip whitespace.
17451
17452         * ../errors/cs0646.cs : Add.
17453
17454 2002-01-03  Miguel de Icaza  <miguel@ximian.com>
17455
17456         * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
17457         again. 
17458
17459         * makefile: Add practical target `mcs3.exe' which builds the third
17460         generation compiler. 
17461
17462         * expression.cs (New): Fix structures constructor calling.
17463
17464         * class.cs (Property, Method, Indexer): Emit Final flag on the
17465         method if we are an interface implementation and we are not
17466         abstract. 
17467
17468         * ecore.cs (PropertyExpr): New public field `IsBase', tells
17469         whether this property is referencing a `base' method.
17470
17471         * expression.cs (Invocation.EmitCall): take an extra argument:
17472         is_base, this is used to determine whether the `call' or
17473         `callvirt' opcode should be used.
17474
17475
17476         * delegate.cs: update EmitCall.
17477
17478         * class.cs (Method.Define): Set NewSlot for the cases where we are
17479         not implementing an interface method.
17480
17481         (Property.Define): ditto.
17482
17483 2002-01-02  Miguel de Icaza  <miguel@ximian.com>
17484
17485         * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
17486         'r'.  Allows mcs to parse itself fully.
17487
17488 2002-01-02  Ravi Pratap  <ravi@ximian.com>
17489
17490         * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
17491         of the number of initializers that require the InitializeArray method.
17492
17493         (CheckIndices): Store the Expression in all cases - not the plain value. Also
17494         update the above field where necessary.
17495
17496         (MakeByteBlob): Update accordingly.
17497
17498         (DoEmit): Call EmitStaticInitializers only if the number of initializers is 
17499         greater than 2.
17500
17501         (EmitDynamicInitializers): Update in accordance with the new optimization.
17502
17503         (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
17504         same OpCode applies.
17505
17506         * cs-parser.jay : Fix some glaring errors I introduced.
17507
17508 2002-01-01  Ravi Pratap  <ravi@ximian.com> 
17509
17510         * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
17511         so that we can check for name clashes there too.
17512
17513         * typemanager.cs (default_member_attr_type): The attribute that we need to emit
17514         for interface indexers.
17515
17516         * interfaces.cs (Define): Emit the default member attribute.
17517
17518         * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
17519         variable was being referred to while setting the value ;-)
17520
17521 2002-01-01  Miguel de Icaza  <miguel@ximian.com>
17522
17523         * expression.cs (MakeByteBlob): Optimize: we do not need to fill
17524         byte-by-byte information when we know the data is zero.
17525
17526         Make the block always a multiple of 4, because
17527         DefineInitializedData has a bug.
17528
17529         * assign.cs: Fix, we should assign from the temporary, not from
17530         the source. 
17531
17532         * expression.cs (MakeByteBlob): Fix my incorrect code.
17533
17534 2001-12-31  Miguel de Icaza  <miguel@ximian.com>
17535
17536         * typemanager.cs (EnumToUnderlying): This function is used to get
17537         the underlying type from an enumeration, because it does not
17538         always work. 
17539
17540         * constant.cs: Use the I4_S form for values between -128 and 127.
17541
17542         * statement.cs (Block.LookupLabel): Looks up a label.
17543         (Block): Drop support for labeled blocks.
17544
17545         (LabeledStatement): New kind of statement that represents a label
17546         only.
17547
17548         (Goto): Finally implement this bad boy.
17549
17550         * cs-parser.jay: Update to reflect new mechanism to implement
17551         labels.
17552
17553 2001-12-30  Miguel de Icaza  <miguel@ximian.com>
17554
17555         * codegen.cs (EmitContext.This): a codegen property that keeps the
17556         a single instance of this instead of creating many different this
17557         instances. 
17558
17559         * delegate.cs (Delegate.DoResolve): Update to use the property;
17560
17561         * ecore.cs (SimpleName.SimpleNameResolve): Ditto
17562
17563         * expression.cs (BaseAccess.DoResolve): Ditto.
17564
17565 2001-12-29  Ravi Pratap  <ravi@ximian.com>
17566
17567         * typemanager.cs (methodimpl_attr_type): Add to hold the type
17568         corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
17569
17570         (InitCoreTypes): Update accordingly.
17571
17572         * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
17573         so we can quickly store the state.
17574
17575         (ApplyAttributes): Set the correct implementation flags
17576         for InternalCall methods.
17577
17578 2001-12-29  Miguel de Icaza  <miguel@ximian.com>
17579
17580         * expression.cs (EmitCall): if a method is not virtual, then do
17581         not use callvirt on it.
17582
17583         (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
17584         user defined stuff) requires the use of stobj, which takes an
17585         address on the stack instead of an array and an index.  So emit
17586         the Ldelema operation for it.
17587
17588         (EmitStoreOpcode): Use stobj for valuetypes.
17589
17590         (UnaryMutator.EmitCode): Use the right 1 value depending on
17591         whether we are dealing with int64/uint64, float or doubles.
17592
17593         * class.cs (TypeContainer.AddConstructor): Fix the logic to define
17594         constructors that I implemented last night.
17595
17596         (Constructor.IsDefault): Fix to work properly for static
17597         constructors.
17598
17599         * cs-parser.jay (CheckDef): report method signature errors.
17600         Update error number 103 to be 132.
17601
17602         * decl.cs: New AdditionResult enumeration value: MethodExists.
17603         Although we do this check for methods later on in the semantic
17604         analysis, catching repeated default constructors is so easy that
17605         we catch these here. 
17606
17607         * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
17608         promotions code.
17609
17610         (ParameterReference.EmitAssign, Emit): handle
17611         bools as bytes.
17612
17613         (ArrayAccess.EmitLoadOpcode): Handle bool type here.
17614         (ArrayAccess.EmitStoreOpcode): ditto.
17615
17616         * cs-tokenizer.cs (is_punct): Eliminated empty computation.
17617
17618         * expression.cs (MakeByteBlob): Complete all the missing types
17619         (uint, short, ushort, byte, sbyte)
17620
17621         * class.cs: Only init instance field initializers on instance
17622         constructors. 
17623
17624         Rename `constructors' to instance_constructors. 
17625
17626         (TypeContainer.AddConstructor): Only add constructors to the list
17627         if it is not static.
17628
17629         Make sure that we handle default_static_constructor independently
17630         everywhere where we handle instance_constructors
17631
17632 2001-12-28  Miguel de Icaza  <miguel@ximian.com>
17633
17634         * class.cs: Do not lookup or create a base initializer for a
17635         static constructor.
17636
17637         (ConstructorInitializer.Resolve): use the proper type to lookup
17638         for constructors.
17639
17640         * cs-parser.jay: Report error 1585 (modifiers between type and name).
17641
17642         * enum.cs, interface.cs: Remove CloseType, this is taken care by
17643         in DeclSpace. 
17644
17645         * decl.cs: CloseType is now an virtual method, the default
17646         implementation just closes this type.
17647
17648 2001-12-28  Ravi Pratap  <ravi@ximian.com>
17649
17650         * attribute.cs (DefinePInvokeMethod): Set the implementation flags
17651         to PreserveSig by default. Also emit HideBySig on such methods.
17652
17653         Basically, set the defaults to standard values.
17654
17655         * expression.cs (Invocation.BetterFunction): We need to make sure that for each
17656         argument, if candidate is better, it can't be worse than the best !
17657
17658         (Invocation): Re-write bits to differentiate between methods being
17659         applicable in their expanded form and their normal form - for params
17660         methods of course.
17661
17662         Get rid of use_standard everywhere as only standard conversions are allowed
17663         in overload resolution. 
17664
17665         More spec conformance.
17666
17667 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
17668
17669         * driver.cs: Add --timestamp, to see where the compiler spends
17670         most of its time.
17671
17672         * ecore.cs (SimpleName.DoResolve): Do not create an implicit
17673         `this' in static code.
17674
17675         (SimpleName.DoResolve): Implement in terms of a helper function
17676         that allows static-references to be passed upstream to
17677         MemberAccess.
17678
17679         (Expression.ResolveWithSimpleName): Resolve specially simple
17680         names when called by MemberAccess to implement the special
17681         semantics. 
17682
17683         (Expression.ImplicitReferenceConversion): Handle conversions from
17684         Null to reference types before others, as Null's type is
17685         System.Object. 
17686
17687         * expression.cs (Invocation.EmitCall): Handle the special case of
17688         calling methods declared on a reference type from a ValueType
17689         (Base classes System.Object and System.Enum)
17690
17691         (MemberAccess.Resolve): Only perform lookups on Enumerations if
17692         the left hand side is a TypeExpr, not on every enumeration. 
17693
17694         (Binary.Resolve): If types are reference types, then do a cast to
17695         object on operators != and == of both arguments.
17696
17697         * typemanager.cs (FindMembers): Extract instance and static
17698         members if requested.
17699
17700         * interface.cs (PopulateProperty): Use void_type instead of null
17701         as the return type for the setter method.
17702
17703         (PopulateIndexer): ditto.
17704
17705 2001-12-27  Ravi Pratap  <ravi@ximian.com>
17706
17707         * support.cs (ReflectionParameters): Fix minor bug where we
17708         were examining the wrong parameter for the ParamArray attribute.
17709
17710         Cope with requests for the type of the parameter at position
17711         greater than the params parameter's. We now return the element
17712         type of the params array as that makes more sense.
17713
17714         * expression.cs (Invocation.IsParamsMethodApplicable): Update 
17715         accordingly as we no longer have to extract the element type
17716         ourselves.
17717
17718         (Invocation.OverloadResolve): Update.
17719
17720 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
17721
17722         * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
17723         against IEnumerator, test whether the return value is a descendant
17724         of the IEnumerator interface.
17725
17726         * class.cs (Indexer.Define): Use an auxiliary method to implement
17727         the other bits of the method definition.  Begin support for
17728         explicit interface implementation.
17729
17730         (Property.DefineMethod): Use TypeManager.void_type instead of null
17731         for an empty return value.
17732
17733 2001-12-26  Miguel de Icaza  <miguel@ximian.com>
17734
17735         * expression.cs (MemberAccess.ResolveMemberAccess): if we are
17736         dealing with a FieldExpr which is composed of a FieldBuilder, in
17737         the code path we did extract the constant, but we should have
17738         obtained the underlying value to be able to cast it (otherwise we
17739         end up in an infinite loop, this is what Ravi was running into).
17740
17741         (ArrayCreation.UpdateIndices): Arrays might be empty.
17742
17743         (MemberAccess.ResolveMemberAccess): Add support for section
17744         14.5.4.1 that deals with the special case of E.I when E is a type
17745         and something else, that I can be a reference to a static member.
17746
17747         (ArrayCreation.MakeByteBlob): It is not an error to not be able to
17748         handle a particular array type to create byte blobs, it is just
17749         something we dont generate byteblobs for.
17750
17751         * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
17752         arguments. 
17753
17754         * location.cs (Push): remove the key from the hashtable that we
17755         are about to add.   This happens for empty files.
17756
17757         * driver.cs: Dispose files after we have parsed them.
17758
17759         (tokenize): new function that only runs the tokenizer on its
17760         input, for speed testing.
17761
17762 2001-12-26  Ravi Pratap  <ravi@ximian.com>
17763
17764         * class.cs (Event.Define): Define the private field only if there
17765         are no accessors defined.
17766
17767         * expression.cs (ResolveMemberAccess): If there is no associated
17768         field with the event, that means we have an event defined with its
17769         own accessors and we should flag error cs0070 since transforming
17770         ourselves into a field is not valid in that case.
17771
17772         * ecore.cs (SimpleName.DoResolve): Same as above.
17773
17774         * attribute.cs (DefinePInvokeMethod): Set the default calling convention
17775         and charset to sane values.
17776
17777 2001-12-25  Ravi Pratap  <ravi@ximian.com>
17778
17779         * assign.cs (DoResolve): Perform check on events only if they 
17780         are being accessed outside the declaring type.
17781
17782         * cs-parser.jay (event_declarations): Update rules to correctly
17783         set the type of the implicit parameter etc.
17784
17785         (add_accessor, remove_accessor): Set current local parameters.
17786
17787         * expression.cs (Binary): For delegate addition and subtraction,
17788         cast the return value from the method into the appropriate delegate
17789         type.
17790
17791 2001-12-24  Ravi Pratap  <ravi@ximian.com>
17792
17793         * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
17794         of these as the workaround is unnecessary.
17795
17796         * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
17797         delegate data - none of that is needed at all.
17798
17799         Re-write bits to extract the instance expression and the delegate method
17800         correctly.
17801
17802         * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator 
17803         on delegates too.
17804
17805         * attribute.cs (ApplyAttributes): New method to take care of common tasks
17806         of attaching attributes instead of duplicating code everywhere.
17807
17808         * everywhere : Update code to do attribute emission using the above method.
17809
17810 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
17811
17812         * expression.cs (IsParamsMethodApplicable): if there are not
17813         parameters, return immediately.
17814
17815         * ecore.cs: The 0 literal can be implicity converted to an enum
17816         type. 
17817
17818         (SimpleName.DoResolve): First lookup the type, then lookup the
17819         members. 
17820
17821         (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
17822         want to get its address.  If the InstanceExpression is not
17823         addressable, store the result in a temporary variable, then get
17824         the address of it.
17825
17826         * codegen.cs: Only display 219 errors on warning level or above. 
17827
17828         * expression.cs (ArrayAccess): Make it implement the
17829         IMemoryLocation interface.
17830
17831         (Binary.DoResolve): handle the operator == (object a, object b)
17832         and operator != (object a, object b) without incurring into a
17833         BoxedCast (because 5 != o should never be performed).
17834
17835         Handle binary enumerator operators.
17836
17837         (EmitLoadOpcode): Use Ldelema if the object we are loading is a
17838         value type, otherwise use Ldelem_ref.
17839
17840         Use precomputed names;
17841
17842         (AddressOf): Implement address of
17843
17844         * cs-parser.jay (labeled_statement): Fix recursive block
17845         addition by reworking the production.
17846
17847         * expression.cs (New.DoEmit): New has a special case:
17848                 
17849                  If we are dealing with a ValueType, we have a few
17850                  situations to deal with:
17851                 
17852                     * The target of New is a ValueType variable, that is
17853                       easy, we just pass this as the variable reference
17854                 
17855                     * The target of New is being passed as an argument,
17856                       to a boxing operation or a function that takes a
17857                       ValueType.
17858                 
17859                       In this case, we need to create a temporary variable
17860                       that is the argument of New.
17861
17862
17863 2001-12-23  Ravi Pratap  <ravi@ximian.com>
17864
17865         * rootcontext.cs (LookupType): Check that current_type is not null before
17866         going about looking at nested types.
17867
17868         * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
17869         not implement the IAssignMethod interface any more.
17870
17871         * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
17872         where we tranform them into FieldExprs if they are being resolved from within
17873         the declaring type.
17874
17875         * ecore.cs (SimpleName.DoResolve): Do the same here.
17876
17877         * assign.cs (DoResolve, Emit): Clean up code considerably. 
17878
17879         * ../errors/bug10.cs : Add.
17880
17881         * ../errors/cs0070.cs : Add.
17882
17883         * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
17884
17885         * assign.cs : Get rid of EventIsLocal everywhere.
17886
17887 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
17888
17889         * ecore.cs (ConvertIntLiteral): finished the implementation.
17890
17891         * statement.cs (SwitchLabel): Convert the value we are using as a
17892         key before looking up the table.
17893
17894 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
17895
17896         * codegen.cs (EmitTopBlock): Require a Location argument now.
17897
17898         * cs-parser.jay (constructor_declarator): We need to setup
17899         current_local_parameters before we parse the
17900         opt_constructor_initializer, to allow the variables to be bound
17901         to the constructor arguments.
17902
17903         * rootcontext.cs (LookupType): First lookup nested classes in our
17904         class and our parents before we go looking outside our class.
17905
17906         * expression.cs (ConstantFold): Extract/debox the values at the
17907         beginnning. 
17908
17909         * rootcontext.cs (EmitCode): Resolve the constants first before we
17910         resolve the types.  This is not really needed, but it helps debugging.
17911
17912         * statement.cs: report location.
17913
17914         * cs-parser.jay: pass location to throw statement.
17915
17916         * driver.cs: Small bug fix.
17917
17918         * report.cs: Updated format to be 4-zero filled digits.
17919
17920 2001-12-22  Ravi Pratap  <ravi@ximian.com>
17921
17922         * expression.cs (CheckIndices): Fix minor bug where the wrong
17923         variable was being referred to ;-)
17924
17925         (DoEmit): Do not call EmitStaticInitializers when the 
17926         underlying type is System.Object.
17927
17928 2001-12-21  Ravi Pratap  <ravi@ximian.com>
17929
17930         * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
17931         and do the usual workaround for SRE.
17932
17933         * class.cs (MyEventBuilder.EventType): New member to get at the type
17934         of the event, quickly.
17935
17936         * expression.cs (Binary.ResolveOperator): Handle delegate addition.
17937
17938         * assign.cs (Assign.DoResolve): Handle the case when the target
17939         is an EventExpr and perform the necessary checks.
17940
17941         * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
17942         interface.
17943
17944         (SimpleName.MemberStaticCheck): Include check for EventExpr.
17945
17946         (EventExpr): Set the type in the constructor itself since we 
17947         are meant to be born fully resolved.
17948
17949         (EventExpr.Define): Revert code I wrote earlier.
17950                 
17951         * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
17952         instance expression is null. The instance expression is a This in that case
17953         or a null, depending on whether it is a static method or not.
17954
17955         Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
17956         refers to more than one method.
17957
17958         * assign.cs (DoResolve): Check whether the event belongs to the same Type container
17959         and accordingly flag errors.
17960
17961 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
17962
17963         * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
17964
17965 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
17966
17967         * location.cs (ToString): Provide useful rutine.
17968
17969 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
17970
17971         * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
17972         objects, return the actual integral boxed.
17973
17974         * statement.cs (SwitchLabel): define an ILLabel for each
17975         SwitchLabel. 
17976
17977         (Switch.CheckSwitch): If the value is a Literal, extract
17978         the underlying literal.
17979
17980         Also in the unused hashtable we had, add the SwitchLabel so we can
17981         quickly look this value up.
17982
17983         * constant.cs: Implement a bunch of new constants.  Rewrite
17984         Literal based on this.  Made changes everywhere to adapt to this.
17985
17986         * expression.cs (Expression.MakeByteBlob): Optimize routine by
17987         dereferencing array only once, and also copes with enumrations.
17988
17989         bytes are two bytes wide, not one.
17990
17991         (Cast): Perform constant conversions.
17992
17993         * ecore.cs (TryImplicitIntConversion): Return literals instead of
17994         wrappers to the literals here.
17995
17996         * expression.cs (DoNumericPromotions): long literals can converted
17997         to ulong implicity (this is taken care of elsewhere, but I was
17998         missing this spot).
17999
18000         * ecore.cs (Expression.Literalize): Make the return type Literal,
18001         to improve type checking.
18002
18003         * rootcontext.cs: Lookup for nested classes in our class hierarchy.
18004
18005 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
18006
18007         * literal.cs: Revert code from ravi that checked the bounds.  The
18008         bounds are sane by the definition of the type itself. 
18009
18010         * typemanager.cs: Fix implementation of ImplementsInterface.  We
18011         need to actually look up in our parent hierarchy for interfaces
18012         implemented. 
18013
18014         * const.cs: Use the underlying type for enumerations
18015
18016         * delegate.cs: Compute the basename for the delegate creation,
18017         that should fix the delegate test case, and restore the correct
18018         Type Lookup semantics in rootcontext
18019
18020         * rootcontext.cs: Revert Ravi's last patch.  The correct way of
18021         referencing a nested type with the Reflection API is using the "+"
18022         sign. 
18023
18024         * cs-parser.jay: Do not require EOF token at the end.
18025
18026 2001-12-20  Ravi Pratap  <ravi@ximian.com>
18027
18028         * rootcontext.cs (LookupType): Concatenate type names with
18029         a '.' instead of a '+' The test suite passes again.
18030
18031         * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
18032         field of the enumeration.
18033
18034         * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
18035         the case when the member is an EventExpr.
18036
18037         * ecore.cs (EventExpr.InstanceExpression): Every event which is not
18038         static has an associated instance expression.
18039
18040         * typemanager.cs (RegisterEvent): The usual workaround, now for events.
18041
18042         (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
18043
18044         * class.cs (Event.Define): Register event and perform appropriate checks
18045         for error #111.
18046
18047         We define the Add and Remove methods even if the use provides none because
18048         in that case, we provide default implementations ourselves.
18049
18050         Define a private field of the type of the event. This is done by the CSC compiler
18051         and we should be doing it too ;-)
18052
18053         * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
18054         More methods we use in code we generate.
18055
18056         (multicast_delegate_type, delegate_type): Two separate types since the distinction
18057         is important.
18058
18059         (InitCoreTypes): Update accordingly for the above.
18060
18061         * class.cs (Event.Emit): Generate code for default accessors that we provide
18062
18063         (EmitDefaultMethod): Do the job in the above.
18064
18065         * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the 
18066         appropriate place.
18067
18068 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
18069
18070         * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
18071         builders even if we were missing one.
18072
18073         * interface.cs, class.cs, enum.cs: When calling DefineNestedType
18074         pass the Basename as our class name instead of the Name.  The
18075         basename will be correctly composed for us.
18076
18077         * parameter.cs (Paramters): Now takes a Location argument.
18078
18079         * decl.cs (DeclSpace.LookupType): Removed convenience function and
18080         make all the code call directly LookupType in RootContext and take
18081         this chance to pass the Location information everywhere.
18082
18083         * Everywhere: pass Location information.
18084
18085 2001-12-19  Miguel de Icaza  <miguel@ximian.com>
18086
18087         * class.cs (Constructor.Define): Updated way of detecting the
18088         length of the parameters.
18089
18090         (TypeContainer.DefineType): Use basename as the type name for
18091         nested types.
18092
18093         (TypeContainer.Define): Do not recursively define types here, as
18094         definition is taken care in order by the RootContext.
18095
18096         * tree.cs: Keep track of namespaces in a per-file basis.
18097
18098         * parameter.cs (Parameter.ComputeSignature): Update to use
18099         DeclSpace. 
18100
18101         (Parameters.GetSignature): ditto.
18102
18103         * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
18104         instead of a TypeContainer.
18105
18106         (Interface.SemanticAnalysis): Use `this' instead of our parent to
18107         resolve names.  Because we need to be resolve in our context, not
18108         our parents.
18109
18110         * driver.cs: Implement response files.
18111
18112         * class.cs (TypeContainer.DefineType): If we are defined, do not
18113         redefine ourselves.
18114
18115         (Event.Emit): Emit the code for add/remove handlers.
18116         (Event.Define): Save the MethodBuilders for add/remove.
18117
18118         * typemanager.cs: Use pair here too.
18119
18120         * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
18121         DictionaryEntry requires the first argument to be non-null.  
18122
18123         (enum_declaration): Compute full name for registering the
18124         enumeration.
18125
18126         (delegate_declaration): Instead of using
18127         formal_parameter_list, use opt_formal_parameter_list as the list
18128         can be empty.
18129
18130         * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
18131         (EventParsing): New property that controls whether `add' and
18132         `remove' are returned as tokens or identifiers (for events);
18133
18134 2001-12-19  Ravi Pratap  <ravi@ximian.com>
18135
18136         * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
18137         use MyEventBuilder only and let it wrap the real builder for us.
18138
18139         (MyEventBuilder): Revamp constructor etc.
18140
18141         Implement all operations that we perform on EventBuilder in precisely the same
18142         way here too.
18143
18144         (FindMembers): Update to use the EventBuilder member.
18145
18146         (Event.Emit): Update accordingly.
18147
18148 2001-12-18  Ravi Pratap  <ravi@ximian.com>
18149
18150         * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
18151         by calling the appropriate methods.
18152
18153         (GetCustomAttributes): Make stubs as they cannot possibly do anything
18154         useful.
18155
18156         (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
18157
18158 2001-12-17  Ravi Pratap  <ravi@ximian.com>
18159
18160         * delegate.cs (Delegate.Populate): Check that the return type
18161         and various parameters types are indeed accessible.
18162
18163         * class.cs (Constructor.Define): Same here.
18164
18165         (Field.Define): Ditto.
18166
18167         (Event.Define): Ditto.
18168
18169         (Operator.Define): Check that the underlying Method defined itself
18170         correctly - so it's MethodBuilder should not be null.
18171
18172         * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
18173         expression happens to be null.
18174
18175         * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
18176         members but as of now we don't seem to be able to do anything really useful with it.
18177
18178         (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
18179         not the EventBuilder.
18180
18181 2001-12-18  Miguel de Icaza  <miguel@ximian.com>
18182
18183         * cs-tokenizer.cs: Add support for defines.
18184         Add support for #if, #elif, #else, #endif
18185
18186         (eval_var): evaluates a variable.
18187         (eval): stubbed for evaluating functions.
18188
18189         * cs-parser.jay: Pass the defines information
18190
18191         * driver.cs: Add --define command line option.
18192
18193         * decl.cs: Move MemberCore here.
18194
18195         Make it the base class for DeclSpace.  This allows us to catch and
18196         report 108 and 109 for everything now.
18197
18198         * class.cs (TypeContainer.Define): Extract all the members
18199         before populating and emit the warning 108 (new keyword required
18200         to override) instead of having each member implement this.
18201
18202         (MemberCore.Define): New abstract method, we will be using this in
18203         the warning reporting engine in Populate.
18204
18205         (Operator.Define): Adjust to new MemberCore protocol. 
18206
18207         * const.cs (Const): This does not derive from Expression, it is a
18208         temporary object we use to create fields, it is a MemberCore. 
18209
18210         * class.cs (Method.Define): Allow the entry point to be in a
18211         specific class.
18212
18213         * driver.cs: Rewrite the argument handler to clean it up a bit.
18214
18215         * rootcontext.cs: Made it just an auxiliary namespace feature by
18216         making everything static.
18217
18218         * driver.cs: Adapt code to use RootContext type name instead of
18219         instance variable.
18220
18221         * delegate.cs: Remove RootContext argument.
18222
18223         * class.cs: (Struct, TypeContainer, Class): Remove RootContext
18224         argument. 
18225
18226         * class.cs (Event.Define): The lookup can fail.
18227
18228         * cs-tokenizer.cs: Begin implementation of pre-procesor. 
18229
18230         * expression.cs: Resolve the this instance before invoking the code.
18231
18232 2001-12-17  Miguel de Icaza  <miguel@ximian.com>
18233
18234         * cs-parser.jay: Add a production in element_access that allows
18235         the thing to become a "type" reference.  This way we can parse
18236         things like "(string [])" as a type.
18237
18238         Note that this still does not handle the more complex rules of
18239         casts. 
18240
18241
18242         * delegate.cs (Delegate.Populate): Register the delegage constructor builder here. 
18243
18244         * ecore.cs: (CopyNewMethods): new utility function used to
18245         assemble the list of methods from running FindMembers.
18246
18247         (MemberLookup): Rework FindMembers so that 
18248
18249 2001-12-16  Miguel de Icaza  <miguel@ximian.com>
18250
18251         * class.cs (TypeContainer): Remove Delegates who fail to be
18252         defined.
18253
18254         * delegate.cs (Populate): Verify that we dont get null return
18255         values.   TODO: Check for AsAccessible.
18256
18257         * cs-parser.jay: Use basename to emit error 574 (destructor should
18258         have the same name as container class), not the full name.
18259
18260         * cs-tokenizer.cs (adjust_int): Fit the integer in the best
18261         possible representation.  
18262
18263         Also implements integer type suffixes U and L.
18264
18265 2001-12-15  Miguel de Icaza  <miguel@ximian.com>
18266
18267         * expression.cs (ArrayCreation.DoResolve): We need to do the
18268         argument resolution *always*.
18269
18270         * decl.cs: Make this hold the namespace.  Hold the root context as
18271         well.
18272         (LookupType): Move here.
18273
18274         * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
18275
18276         * location.cs (Row, Name): Fixed the code, it was always returning
18277         references to the first file.
18278
18279         * interface.cs: Register properties defined through interfaces.
18280
18281         * driver.cs: Add support for globbing on the command line
18282
18283         * class.cs (Field): Make it derive from MemberCore as well.
18284         (Event): ditto.
18285
18286 2001-12-15  Ravi Pratap  <ravi@ximian.com>
18287
18288         * class.cs (Event::Define): Check that the type of the event is a delegate
18289         type else flag error #66.
18290
18291         Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
18292         same.
18293
18294         * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
18295         values of EntryPoint, CharSet etc etc.
18296
18297         Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
18298
18299         * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
18300         be null and we should ignore this. I am not sure if this is really clean. Apparently,
18301         there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
18302         which needs this to do its work.
18303
18304         * ../errors/cs0066.cs : Add.
18305
18306 2001-12-14  Miguel de Icaza  <miguel@ximian.com>
18307
18308         * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
18309         helper functions.
18310
18311         * class.cs: (MethodSignature.MethodSignature): Removed hack that
18312         clears out the parameters field.
18313         (MemberSignatureCompare): Cleanup
18314
18315         (MemberCore): New base class used to share code between MethodCore
18316         and Property.
18317
18318         (RegisterRequiredImplementations) BindingFlags.Public requires
18319         either BindingFlags.Instace or Static.  Use instance here.
18320
18321         (Property): Refactored code to cope better with the full spec.
18322
18323         * parameter.cs (GetParameterInfo): Return an empty array instead
18324         of null on error.
18325
18326         * class.cs (Property): Abstract or extern properties have no bodies.
18327
18328         * parameter.cs (GetParameterInfo): return a zero-sized array.
18329
18330         * class.cs (TypeContainer.MethodModifiersValid): Move all the
18331         method modifier validation to the typecontainer so we can reuse
18332         this on properties.
18333
18334         (MethodCore.ParameterTypes): return an empty sized array of types.
18335
18336         (Property.Define): Test property modifier validity.
18337
18338         Add tests for sealed/override too.
18339
18340         (Method.Emit): abstract or extern methods have no bodies.
18341
18342 2001-12-14  Ravi Pratap  <ravi@ximian.com>
18343
18344         * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
18345         thing.
18346
18347         (Method::Define, ::Emit): Modify accordingly.
18348
18349         * expression.cs (Invocation::OverloadResolve): Handle error # 121.
18350
18351         (ArrayCreation::MakeByteBlob): Handle floats and doubles.
18352
18353         * makefile: Pass in /unsafe.
18354
18355 2001-12-13  Miguel de Icaza  <miguel@ximian.com>
18356
18357         * class.cs (MakeKey): Kill routine.
18358
18359         * class.cs (TypeContainer.Define): Correctly define explicit
18360         method implementations (they require the full interface name plus
18361         the method name).
18362
18363         * typemanager.cs: Deply the PtrHashtable here and stop using the
18364         lame keys.  Things work so much better.
18365
18366         This of course broke everyone who depended on `RegisterMethod' to
18367         do the `test for existance' test.  This has to be done elsewhere.
18368
18369         * support.cs (PtrHashtable): A hashtable that avoid comparing with
18370         the object stupid Equals method (because, that like fails all over
18371         the place).  We still do not use it.
18372
18373         * class.cs (TypeContainer.SetRequiredInterface,
18374         TypeContainer.RequireMethods): Killed these two routines and moved
18375         all the functionality to RegisterRequiredImplementations.
18376
18377         (TypeContainer.RegisterRequiredImplementations): This routine now
18378         registers all the implementations required in an array for the
18379         interfaces and abstract methods.  We use an array of structures
18380         which can be computed ahead of time to reduce memory usage and we
18381         also assume that lookups are cheap as most classes will not
18382         implement too many interfaces.
18383
18384         We also avoid creating too many MethodSignatures.
18385
18386         (TypeContainer.IsInterfaceMethod): Update and optionally does not
18387         clear the "pending" bit if we find that there are problems with
18388         the declaration.
18389
18390         (TypeContainer.VerifyPendingMethods): Update to report errors of
18391         methods that look like implementations but are not.
18392
18393         (TypeContainer.Define): Add support for explicit interface method
18394         implementation. 
18395
18396 2001-12-12  Miguel de Icaza  <miguel@ximian.com>
18397
18398         * typemanager.cs: Keep track of the parameters here instead of
18399         being a feature of the TypeContainer.
18400
18401         * class.cs: Drop the registration of parameters here, as
18402         InterfaceMethods are also interface declarations.
18403
18404         * delegate.cs: Register methods with the TypeManager not only with
18405         the TypeContainer.  This code was buggy.
18406
18407         * interface.cs: Full registation here.
18408
18409 2001-12-11  Miguel de Icaza  <miguel@ximian.com>
18410
18411         * expression.cs: Remove reducer for binary expressions, it can not
18412         be done this way.
18413
18414         * const.cs: Put here the code that used to go into constant.cs
18415
18416         * constant.cs: Put here the code for constants, this is a new base
18417         class for Literals.
18418
18419         * literal.cs: Make Literal derive from Constant.
18420
18421 2001-12-09  Miguel de Icaza  <miguel@ximian.com>
18422
18423         * statement.cs (Return.Emit): Report error 157 if the user
18424         attempts to return from a finally block.
18425
18426         (Return.Emit): Instead of emitting a return, jump to the end of
18427         the function.
18428
18429         * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
18430         LocalBuilder to store the result of the function.  ReturnLabel is
18431         the target where we jump.
18432
18433
18434 2001-12-09  Radek Doulik  <rodo@ximian.com>
18435
18436         * cs-parser.jay: remember alias in current namespace
18437
18438         * ecore.cs (SimpleName::DoResolve): use aliases for types or
18439         namespaces
18440
18441         * class.cs (LookupAlias): lookup alias in my_namespace
18442
18443         * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
18444         aliases hashtable
18445         (LookupAlias): lookup alias in this and if needed in parent
18446         namespaces
18447
18448 2001-12-08  Miguel de Icaza  <miguel@ximian.com>
18449
18450         * support.cs: 
18451
18452         * rootcontext.cs: (ModuleBuilder) Made static, first step into
18453         making things static.  I need this to avoid passing the
18454         TypeContainer when calling ParameterType.
18455
18456         * support.cs (InternalParameters.ParameterType): Remove ugly hack
18457         that did string manipulation to compute the type and then call
18458         GetType.  Use Parameter.ParameterType instead.
18459
18460         * cs-tokenizer.cs: Consume the suffix for floating values.
18461
18462         * expression.cs (ParameterReference): figure out whether this is a
18463         reference parameter or not.  Kill an extra variable by computing
18464         the arg_idx during emission.
18465
18466         * parameter.cs (Parameters.GetParameterInfo): New overloaded
18467         function that returns whether a parameter is an out/ref value or not.
18468
18469         (Parameter.ParameterType): The type of the parameter (base,
18470         without ref/out applied).
18471
18472         (Parameter.Resolve): Perform resolution here.
18473         (Parameter.ExternalType): The full type (with ref/out applied).
18474
18475         * statement.cs (Using.Emit, Using.EmitExpression): Implement
18476         support for expressions on the using statement.
18477
18478 2001-12-07  Miguel de Icaza  <miguel@ximian.com>
18479
18480         * statement.cs (Using.EmitLocalVariableDecls): Split the
18481         localvariable handling of the using statement.
18482
18483         (Block.EmitMeta): Keep track of variable count across blocks.  We
18484         were reusing slots on separate branches of blocks.
18485
18486         (Try.Emit): Emit the general code block, we were not emitting it. 
18487
18488         Check the type of the declaration to be an IDisposable or
18489         something that can be implicity converted to it. 
18490
18491         Emit conversions if required.
18492
18493         * ecore.cs (EmptyExpression): New utility class.
18494         (Expression.ImplicitConversionExists): New utility function.
18495
18496 2001-12-06  Miguel de Icaza  <miguel@ximian.com>
18497
18498         * statement.cs (Using): Implement.
18499
18500         * expression.cs (LocalVariableReference): Support read only variables.
18501
18502         * statement.cs: Remove the explicit emit for the Leave opcode.
18503         (VariableInfo): Add a readonly field.
18504
18505 2001-12-05  Miguel de Icaza  <miguel@ximian.com>
18506
18507         * ecore.cs (ConvCast): new class used to encapsulate the various
18508         explicit integer conversions that works in both checked and
18509         unchecked contexts.
18510
18511         (Expression.ConvertNumericExplicit): Use new ConvCast class to
18512         properly generate the overflow opcodes.
18513
18514 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
18515
18516         * statement.cs: The correct type for the EmptyExpression is the
18517         element_type, not the variable type.  Ravi pointed this out.
18518
18519 2001-12-04  Ravi Pratap  <ravi@ximian.com>
18520
18521         * class.cs (Method::Define): Handle PInvoke methods specially
18522         by using DefinePInvokeMethod instead of the usual one.
18523
18524         * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
18525         above to do the task of extracting information and defining the method.
18526
18527 2001-12-04  Ravi Pratap  <ravi@ximian.com>
18528
18529         * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
18530         of the condition for string type.
18531
18532         (Emit): Move that here. 
18533
18534         (ArrayCreation::CheckIndices): Keep string literals in their expression
18535         form.
18536
18537         (EmitDynamicInitializers): Handle strings appropriately.
18538
18539 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
18540
18541         * codegen.cs (EmitContext): Replace multiple variables with a
18542         single pointer to the current Switch statement.
18543
18544         * statement.cs (GotoDefault, Switch): Adjust to cleaned up
18545         EmitContext.
18546
18547 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
18548
18549         * statement.cs 
18550
18551         * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
18552         default'.
18553
18554         (Foreach.Emit): Foreach on arrays was not setting
18555         up the loop variables (for break/continue).
18556
18557         (GotoCase): Semi-implented.
18558
18559 2001-12-03  Ravi Pratap  <ravi@ximian.com>
18560
18561         * attribute.cs (CheckAttribute): Handle system attributes by using
18562         Attribute.GetAttributes to examine information we need.
18563
18564         (GetValidPlaces): Same here.
18565
18566         * class.cs (Method::Define): Catch invalid use of extern and abstract together.
18567
18568         * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
18569
18570         * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
18571
18572         (Method::Define): Set appropriate flags if we have a DllImport attribute.
18573
18574         (Method::Emit): Handle the case when we are a PInvoke method.
18575
18576 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
18577
18578         * expression.cs: Use ResolveWithSimpleName on compound names.
18579
18580 2001-12-02  Ravi Pratap  <ravi@ximian.com>
18581
18582         * constant.cs (EmitConstant): Make sure we resolve the associated expression
18583         before trying to reduce it.
18584
18585         * typemanager.cs (RegisterConstant, LookupConstant): Implement.
18586
18587         * constant.cs (LookupConstantValue): Implement.
18588
18589         (EmitConstant): Use the above in emitting the constant.
18590
18591         * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
18592         that are user-defined by doing a LookupConstantValue on them.
18593
18594         (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
18595         too, like above.
18596
18597 2001-11-29  Miguel de Icaza  <miguel@ximian.com>
18598
18599         * expression.cs (BaseAccess, BaseIndexer): Also split this out.
18600
18601         (BaseAccess.DoResolve): Implement.
18602
18603         (MemberAccess.DoResolve): Split this routine into a
18604         ResolveMemberAccess routine that can be used independently
18605
18606 2001-11-28  Miguel de Icaza  <miguel@ximian.com>
18607
18608         * expression.cs (Probe, Is, As): Split Probe in two classes Is and
18609         As that share bits of the implementation.  Is returns a boolean,
18610         while As returns the Type that is being probed.
18611
18612 2001-12-01  Ravi Pratap  <ravi@ximian.com>
18613
18614         * enum.cs (LookupEnumValue): Re-write various bits, return an object value
18615         instead of a Literal - much easier.
18616
18617         (EnumInTransit): Remove - utterly useless :-)
18618
18619         (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
18620
18621         * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
18622
18623         * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
18624         chain when we have no associated expression.
18625
18626 2001-11-30  Ravi Pratap  <ravi@ximian.com>
18627
18628         * constant.cs (Define): Use Location while reporting the errror.
18629
18630         Also emit a warning when 'new' is used and there is no inherited
18631         member to hide.
18632
18633         * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being 
18634         populated.
18635
18636         (LookupEnumValue): Implement to lookup an enum member's value and define it
18637         if necessary.
18638
18639         (Populate): Re-write accordingly to use the above routine.
18640
18641 2001-11-27  Miguel de Icaza  <miguel@ximian.com>
18642
18643         * expression.cs (This): Fix prototype for DoResolveLValue to
18644         override the base class DoResolveLValue.
18645
18646         * cs-parser.cs: Report errors cs574 and cs575 (destructor
18647         declarations) 
18648
18649         * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
18650         (we need to load the address of the field here).  This fixes
18651         test-22. 
18652
18653         (FieldExpr.DoResolveLValue): Call the DoResolve
18654         function to initialize the Instance expression.
18655
18656         * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
18657         correctly the GetEnumerator operation on a value type.
18658
18659         * cs-parser.jay: Add more simple parsing error catches.
18660
18661         * statement.cs (Switch): Add support for string switches.
18662         Handle null specially.
18663
18664         * literal.cs (NullLiteral): Make NullLiteral objects singletons. 
18665
18666 2001-11-28  Ravi Pratap  <ravi@ximian.com>
18667
18668         * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
18669
18670         (declare_local_constant): New helper function.
18671
18672         * statement.cs (AddConstant): Keep a separate record of constants
18673
18674         (IsConstant): Implement to determine if a variable is a constant.
18675
18676         (GetConstantExpression): Implement.
18677
18678         * expression.cs (LocalVariableReference): Handle the case when it is a constant.
18679
18680         * statement.cs (IsVariableDefined): Re-write.
18681
18682 2001-11-27  Ravi Pratap  <ravi@ximian.com>
18683
18684         * class.cs (TypeContainer::FindMembers): Look for constants
18685         in the case when we are looking for MemberTypes.Field
18686
18687         * expression.cs (MemberAccess::DoResolve): Check that in the
18688         case we are a FieldExpr and a Literal, we are not being accessed
18689         by an instance reference.
18690
18691         * cs-parser.jay (local_constant_declaration): Implement.
18692
18693         (declaration_statement): Implement for constant declarations.
18694
18695 2001-11-26  Miguel de Icaza  <miguel@ximian.com>
18696
18697         * statement.cs (Switch): Catch double defaults.
18698
18699         (Switch): More work on the switch() statement
18700         implementation.  It works for integral values now, need to finish
18701         string support.
18702
18703
18704 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
18705
18706         * ecore.cs (Expression.ConvertIntLiteral): New function to convert
18707         integer literals into other integer literals.  To be used by
18708         switch. 
18709
18710 2001-11-24  Ravi Pratap  <ravi@ximian.com>
18711
18712         * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
18713         some memory.
18714
18715         (EmitDynamicInitializers): Cope with the above since we extract data
18716         directly from ArrayData now.
18717
18718         (ExpectInitializers): Keep track of whether initializers are mandatory
18719         or not.
18720
18721         (Bounds): Make it a hashtable to prevent the same dimension being 
18722         recorded for every element in that dimension.
18723
18724         (EmitDynamicInitializers): Fix bug which prevented the Set array method
18725         from being found.
18726
18727         Also fix bug which was causing the indices to be emitted in the reverse
18728         order.
18729
18730 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
18731
18732         * expression.cs (ArrayCreation): Implement the bits that Ravi left
18733         unfinished.  They do not work, because the underlying code is
18734         sloppy.
18735
18736 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
18737
18738         * cs-parser.jay: Remove bogus fixme.
18739
18740         * statement.cs (Switch, SwitchSection, SwithLabel): Started work
18741         on Switch statement.
18742
18743 2001-11-23  Ravi Pratap  <ravi@ximian.com>
18744
18745         * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
18746         the same. 
18747
18748         * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
18749         parameter. Apparently, any expression is allowed. 
18750
18751         (ValidateInitializers): Update accordingly.
18752
18753         (CheckIndices): Fix some tricky bugs thanks to recursion.
18754
18755         * delegate.cs (NewDelegate::DoResolve): Re-write large portions as 
18756         I was being completely brain-dead.
18757
18758         (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
18759         and re-write acordingly.
18760
18761         (DelegateInvocation): Re-write accordingly.
18762
18763         * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
18764
18765         (MakeByteBlob): Handle types more correctly.
18766
18767         * expression.cs (ArrayCreation:Emit): Write preliminary code to do
18768         initialization from expressions but it is incomplete because I am a complete
18769         Dodo :-|
18770
18771 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
18772
18773         * statement.cs (If.Emit): Fix a bug that generated incorrect code
18774         on If.  Basically, we have to return `true' (ie, we do return to
18775         our caller) only if both branches of the if return.
18776
18777         * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
18778         short-circuit operators, handle them as short circuit operators. 
18779
18780         (Cast.DoResolve): Resolve type.
18781         (Cast.Cast): Take an expression as the target type.
18782
18783         * cs-parser.jay (cast_expression): Remove old hack that only
18784         allowed a limited set of types to be handled.  Now we take a
18785         unary_expression and we resolve to a type during semantic
18786         analysis.
18787
18788         Use the grammar productions from Rhys to handle casts (this is
18789         not complete like Rhys syntax yet, we fail to handle that corner
18790         case that C# has regarding (-x), but we will get there.
18791
18792 2001-11-22  Ravi Pratap  <ravi@ximian.com>
18793
18794         * class.cs (EmitFieldInitializer): Take care of the case when we have a
18795         field which is an array type.
18796
18797         * cs-parser.jay (declare_local_variables): Support array initialization too.
18798
18799         * typemanager.cs (MakeKey): Implement.
18800
18801         (everywhere): Use the above appropriately.
18802
18803         * cs-parser.jay (for_statement): Update for array initialization while
18804         declaring variables.
18805
18806         * ecore.cs : The error message was correct, it's the variable's names that
18807         were misleading ;-) Make the code more readable.
18808
18809         (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
18810         the correct type etc.
18811
18812         (ConvertExplicit): Handle Enum types by examining the underlying type.
18813
18814 2001-11-21  Ravi Pratap  <ravi@ximian.com>
18815
18816         * parameter.cs (GetCallingConvention): Always return
18817         CallingConventions.Standard for now.
18818
18819 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
18820
18821         * expression.cs (Binary.ResolveOperator): Update the values of `l'
18822         and `r' after calling DoNumericPromotions.
18823
18824         * ecore.cs: Fix error message (the types were in the wrong order).
18825
18826         * statement.cs (Foreach.ProbeCollectionType): Need to pass
18827         BindingFlags.Instance as well 
18828
18829         * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
18830         implicit int literal conversion in an empty cast so that we
18831         propagate the right type upstream.
18832
18833         (UnboxCast): new class used to unbox value types.
18834         (Expression.ConvertExplicit): Add explicit type conversions done
18835         by unboxing.
18836
18837         (Expression.ImplicitNumericConversion): Oops, forgot to test for
18838         the target type before applying the implicit LongLiterals to ULong
18839         literal cast.
18840
18841 2001-11-21  Miguel de Icaza  <miguel@ximian.com>
18842
18843         * cs-parser.jay (for_statement): Reworked the way For works: now
18844         we declare manually any variables that are introduced in
18845         for_initializer to solve the problem of having out-of-band code
18846         emition (that is what got for broken).
18847
18848         (declaration_statement): Perform the actual variable declaration
18849         that used to be done in local_variable_declaration here.
18850
18851         (local_variable_declaration): Do not declare anything, just pass
18852         the information on a DictionaryEntry
18853
18854 2001-11-20  Ravi Pratap  <ravi@ximian.com>
18855
18856         * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
18857         re-write of the logic to now make it recursive.
18858
18859         (UpdateIndices): Re-write accordingly.
18860
18861         Store element data in a separate ArrayData list in the above methods.
18862
18863         (MakeByteBlob): Implement to dump the array data into a byte array.
18864
18865 2001-11-19  Ravi Pratap  <ravi@ximian.com>
18866
18867         * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
18868         into CheckIndices.
18869
18870         * constant.cs (Define): Implement.
18871
18872         (EmitConstant): Re-write fully.
18873
18874         Pass in location info.
18875
18876         * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
18877         respectively.
18878
18879         * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
18880         DictionaryEntry since we need location info too.
18881
18882         (constant_declaration): Update accordingly.
18883
18884         * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
18885         code into another method : UpdateIndices.
18886
18887 2001-11-18  Ravi Pratap  <ravi@ximian.com>
18888
18889         * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
18890         some type checking etc.
18891
18892 2001-11-17  Ravi Pratap  <ravi@ximian.com>
18893
18894         * expression.cs (ArrayCreation::ValidateInitializers): Implement
18895         bits to provide dimension info if the user skips doing that.
18896
18897         Update second constructor to store the rank correctly.
18898
18899 2001-11-16  Ravi Pratap  <ravi@ximian.com>
18900
18901         * expression.cs (ArrayCreation::ValidateInitializers): Poke around
18902         and try to implement.
18903
18904         * ../errors/cs0150.cs : Add.
18905
18906         * ../errors/cs0178.cs : Add.
18907
18908 2001-11-16  Miguel de Icaza  <miguel@ximian.com>
18909
18910         * statement.cs: Implement foreach on multi-dimensional arrays. 
18911
18912         * parameter.cs (Parameters.GetParameterByName): Also lookup the
18913         name of the params argument.
18914
18915         * expression.cs: Use EmitStoreOpcode to get the right opcode while
18916         initializing the array.
18917
18918         (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
18919         we can use this elsewhere.
18920
18921         * statement.cs: Finish implementation of foreach for single
18922         dimension arrays.
18923
18924         * cs-parser.jay: Use an out-of-band stack to pass information
18925         around, I wonder why I need this.
18926
18927         foreach_block: Make the new foreach_block the current_block.
18928
18929         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
18930         function used to return a static Parameters structure.  Used for
18931         empty parameters, as those are created very frequently.
18932
18933         * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
18934
18935 2001-11-15  Ravi Pratap  <ravi@ximian.com>
18936
18937         * interface.cs : Default modifier is private, not public. The
18938         make verify test passes again.
18939
18940 2001-11-15  Ravi Pratap  <ravi@ximian.com>
18941
18942         * support.cs (ReflectionParameters): Fix logic to determine
18943         whether the last parameter is a params one. Test 9 passes again.
18944
18945         * delegate.cs (Populate): Register the builders we define with
18946         RegisterParameterForBuilder. Test 19 passes again.
18947
18948         * cs-parser.jay (property_declaration): Reference $6 instead
18949         of $$ to get at the location.
18950
18951         (indexer_declaration): Similar stuff.
18952
18953         (attribute): Ditto.
18954
18955         * class.cs (Property): Register parameters for the Get and Set methods
18956         if they exist. Test 23 passes again.
18957
18958         * expression.cs (ArrayCreation::Emit): Pass null for the method in the
18959         call to EmitArguments as we are sure there aren't any params arguments. 
18960         Test 32 passes again.
18961
18962         * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
18963         IndexOutOfRangeException. 
18964
18965         * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
18966         Test 33 now passes again.
18967
18968 2001-11-15  Miguel de Icaza  <miguel@ximian.com>
18969
18970         * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
18971         broke a bunch of things.  Will have to come up with a better way
18972         of tracking locations.
18973
18974         * statement.cs: Implemented foreach for single dimension arrays.
18975
18976 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
18977
18978         * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
18979         an error.  This removes the lookup from the critical path.
18980
18981         * cs-parser.jay: Removed use of temporary_loc, which is completely
18982         broken. 
18983
18984 2001-11-14  Miguel de Icaza  <miguel@ximian.com>
18985
18986         * support.cs (ReflectionParameters.ParameterModifier): Report
18987         whether the argument is a PARAMS argument or not.
18988
18989         * class.cs: Set the attribute `ParamArrayAttribute' on the
18990         parameter argument.
18991
18992         * typemanager.cs: Define param_array_type (ParamArrayAttribute)
18993         and cons_param_array_attribute (ConstructorInfo for
18994         ParamArrayAttribute)., 
18995
18996         * codegen.cs: Emit the return using the `Return' statement, that
18997         way we can report the error correctly for missing return values. 
18998
18999         * class.cs (Method.Emit): Clean up.
19000
19001         * expression.cs (Argument.Resolve): Take another argument: the
19002         location where this argument is used.  Notice that this is not
19003         part of the "Argument" class as to reduce the size of the
19004         structure (we know the approximate location anyways).
19005
19006         Test if the argument is a variable-reference, if not, then
19007         complain with a 206.
19008
19009         (Argument.Emit): Emit addresses of variables.
19010
19011         (Argument.FullDesc): Simplify.
19012
19013         (Invocation.DoResolve): Update for Argument.Resolve.
19014
19015         (ElementAccess.DoResolve): ditto.
19016
19017         * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
19018         method should be virtual, as this method is always virtual.
19019
19020         (NewDelegate.DoResolve): Update for Argument.Resolve.
19021
19022         * class.cs (ConstructorInitializer.DoResolve): ditto.
19023
19024         * attribute.cs (Attribute.Resolve): ditto.
19025
19026 2001-11-13  Miguel de Icaza  <miguel@ximian.com>
19027
19028         * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
19029
19030         * expression.cs (ParameterReference): Drop IStackStorage and implement
19031         IAssignMethod instead. 
19032
19033         (LocalVariableReference): ditto.
19034
19035         * ecore.cs (FieldExpr): Drop IStackStorage and implement
19036         IAssignMethod instead. 
19037
19038 2001-11-13  Miguel de Icaza <miguel@ximian.com>
19039
19040         * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
19041         enumerations that are used in heavily used structures derive from
19042         byte in a laughable and pathetic attempt to reduce memory usage.
19043         This is the kind of pre-optimzations that you should not do at
19044         home without adult supervision.
19045
19046         * expression.cs (UnaryMutator): New class, used to handle ++ and
19047         -- separatedly from the other unary operators.  Cleans up the
19048         code, and kills the ExpressionStatement dependency in Unary.
19049
19050         (Unary): Removed `method' and `Arguments' from this class, making
19051         it smaller, and moving it all to SimpleCall, so I can reuse this
19052         code in other locations and avoid creating a lot of transient data
19053         strucutres when not required.
19054
19055         * cs-parser.jay: Adjust for new changes.
19056
19057 2001-11-11  Miguel de Icaza  <miguel@ximian.com>
19058
19059         * enum.cs (Enum.Populate): If there is a failure during
19060         definition, return
19061
19062         * cs-parser.jay (opt_enum_base): we used to catch type errors
19063         here, but this is really incorrect.  The type error should be
19064         catched during semantic analysis.
19065
19066 2001-12-11  Ravi Pratap  <ravi@ximian.com>
19067
19068         * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
19069         current_local_parameters as expected since I, in my stupidity, had forgotten
19070         to do this :-)
19071
19072         * attribute.cs (GetValidPlaces): Fix stupid bug.
19073
19074         * class.cs (Method::Emit): Perform check on applicability of attributes.
19075
19076         (Constructor::Emit): Ditto.
19077
19078         (Field::Emit): Ditto.
19079
19080         (Field.Location): Store location information.
19081
19082         (Property, Event, Indexer, Operator): Ditto.
19083
19084         * cs-parser.jay (field_declaration): Pass in location for each field.
19085
19086         * ../errors/cs0592.cs : Add.
19087
19088 2001-11-12  Ravi Pratap  <ravi@ximian.com>
19089
19090         * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
19091
19092         (InitCoreTypes): Update accordingly.
19093
19094         (RegisterAttrType, LookupAttr): Implement.
19095
19096         * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
19097         info about the same.
19098
19099         (Resolve): Update to populate the above as necessary.
19100
19101         (Error592): Helper.
19102
19103         (GetValidPlaces): Helper to the above.
19104
19105         (CheckAttribute): Implement to perform validity of attributes on declarative elements.
19106
19107         * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
19108
19109 2001-11-12  Ravi Pratap  <ravi@ximian.com>
19110
19111         * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
19112
19113         * ../errors/cs0617.cs : Add.
19114
19115 2001-11-11  Ravi Pratap  <ravi@ximian.com>
19116
19117         * enum.cs (Emit): Rename to Populate to be more consistent with what
19118         we expect it to do and when exactly it is called.
19119
19120         * class.cs, rootcontext.cs : Update accordingly.
19121
19122         * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
19123         FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
19124
19125         * enum.cs (Populate): Register fields with TypeManager.RegisterField.
19126
19127         * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
19128         of a fieldinfo using the above, when dealing with a FieldBuilder.
19129
19130 2001-11-10  Ravi Pratap  <ravi@ximian.com>
19131
19132         * ../errors/cs0031.cs : Add.
19133
19134         * ../errors/cs1008.cs : Add.
19135
19136         * ../errrors/cs0543.cs : Add.
19137
19138         * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
19139         enum type.
19140
19141         (FindMembers): Implement.
19142
19143         * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
19144         enums and delegates too.
19145
19146         (enum_types): Rename to builder_to_enum.
19147
19148         (delegate_types): Rename to builder_to_delegate.
19149
19150         * delegate.cs (FindMembers): Implement.
19151
19152 2001-11-09  Ravi Pratap  <ravi@ximian.com>
19153
19154         * typemanager.cs (IsEnumType): Implement.
19155
19156         * enum.cs (Emit): Re-write parts to account for the underlying type
19157         better and perform checking etc.
19158
19159         (GetNextDefaultValue): Helper to ensure we don't overshoot max value
19160         of the underlying type.
19161
19162         * literal.cs (GetValue methods everywhere): Perform bounds checking and return
19163         value
19164
19165         * enum.cs (error31): Helper to report error #31.
19166
19167         * cs-parser.jay (enum_declaration): Store location of each member too.
19168
19169         * enum.cs (member_to_location): New hashtable. 
19170
19171         (AddEnumMember): Update location hashtable.
19172
19173         (Emit): Use the location of each member while reporting errors.
19174
19175 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
19176
19177         * cs-parser.jay: A for_initializer if is a
19178         local_variable_declaration really ammount to have an implicit
19179         block with the variable declaration and no initializer for for.
19180
19181         * statement.cs (For.Emit): Cope with null initializers.
19182
19183         This fixes the infinite loop on for initializers.
19184
19185 2001-11-08  Miguel de Icaza  <miguel@ximian.com>
19186
19187         * enum.cs: More cleanup.
19188
19189         * ecore.cs: Remove dead code.
19190
19191         * class.cs (Property.Emit): More simplification.
19192         (Event.Emit): ditto.
19193
19194         Reworked to have less levels of indentation.
19195
19196 2001-11-08  Ravi Pratap  <ravi@ximian.com>
19197
19198         * class.cs (Property): Emit attributes.
19199
19200         (Field): Ditto.
19201
19202         (Event): Ditto.
19203
19204         (Indexer): Ditto.
19205
19206         (Operator): Ditto.
19207
19208         * enum.cs (Emit): Ditto.
19209
19210         * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
19211         Enums too.
19212
19213         * class.cs (Field, Event, etc.): Move attribute generation into the
19214         Emit method everywhere.
19215
19216         * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
19217         we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
19218         as we had no way of defining nested enums !
19219
19220         * rootcontext.cs : Adjust code accordingly.
19221
19222         * typemanager.cs (AddEnumType): To keep track of enum types separately.
19223
19224 2001-11-07  Ravi Pratap  <ravi@ximian.com>
19225
19226         * expression.cs (EvalConstantExpression): Move into ecore.cs
19227
19228         * enum.cs (Enum): Rename some members and make them public and readonly
19229         according to our convention.
19230
19231         * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
19232         nothing else.
19233
19234         * enum.cs (Enum::Define): Use the above instead of TypeAttr.
19235
19236         (Enum::Emit): Write a simple version for now which doesn't try to compute
19237         expressions. I shall modify this to be more robust in just a while.
19238
19239         * class.cs (TypeContainer::Emit): Make sure we include Enums too.
19240
19241         (TypeContainer::CloseType): Create the Enum types too.
19242
19243         * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
19244
19245         * expression.cs (EvalConstantExpression): Get rid of completely.
19246
19247         * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
19248         user-defined values and other cases.
19249
19250         (IsValidEnumLiteral): Helper function.
19251
19252         * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing 
19253         out there in the case we had a literal FieldExpr.
19254
19255         (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
19256
19257         (Literalize): Revamp a bit to take two arguments.
19258
19259         (EnumLiteral): New class which derives from Literal to wrap enum literals.
19260
19261 2001-11-06  Ravi Pratap  <ravi@ximian.com>
19262
19263         * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
19264
19265         * expression.cs (ArrayCreation::ValidateInitializers): Implement.
19266
19267         (Resolve): Use the above to ensure we have proper initializers.
19268
19269 2001-11-05  Ravi Pratap  <ravi@ximian.com>
19270
19271         * expression.cs (Expression::EvalConstantExpression): New method to 
19272         evaluate constant expressions.
19273
19274         * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
19275
19276 2001-11-07  Miguel de Icaza  <miguel@ximian.com>
19277
19278         * expression.cs (ArrayCreation.Emit): Some bits to initialize data
19279         in an array.
19280
19281         (Binary.ResolveOperator): Handle operator != (object a, object b)
19282         and operator == (object a, object b);
19283
19284         (Binary.DoNumericPromotions): Indicate whether the numeric
19285         promotion was possible.
19286
19287         (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
19288         Implement.  
19289
19290         Made the ArrayAccess implement interface IAssignMethod instead of
19291         IStackStore as the order in which arguments are passed reflects
19292         this.
19293
19294         * assign.cs: Instead of using expr.ExprClass to select the way of
19295         assinging, probe for the IStackStore/IAssignMethod interfaces.
19296
19297         * typemanager.cs: Load InitializeArray definition.
19298
19299         * rootcontext.cs (RootContext.MakeStaticData): Used to define
19300         static data that can be used to initialize arrays. 
19301
19302 2001-11-05  Miguel de Icaza  <miguel@ximian.com>
19303
19304         * expression.cs: Handle operator== and operator!= for booleans.
19305
19306         (Conditioal.Reduce): Implement reducer for the ?: operator.
19307
19308         (Conditional.Resolve): Implement dead code elimination.
19309
19310         (Binary.Resolve): Catch string literals and return a new
19311         concatenated string.
19312
19313         (Unary.Reduce): Implement reduction of unary expressions.
19314
19315         * ecore.cs: Split out the expression core handling here.
19316
19317         (Expression.Reduce): New method used to perform constant folding
19318         and CSE.  This is needed to support constant-expressions. 
19319
19320         * statement.cs (Statement.EmitBoolExpression): Pass true and false
19321         targets, and optimize for !x.
19322
19323 2001-11-04  Ravi Pratap  <ravi@ximian.com>
19324
19325         * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
19326         of an attribute gives us a CustomAttributeBuilder which we use accordingly to
19327         set custom atttributes.
19328
19329         * literal.cs (Literal::GetValue): New abstract method to return the actual
19330         value of the literal, cast as an object.
19331
19332         (*Literal): Implement GetValue method.
19333
19334         * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
19335         expressions to the arraylist but objects of type Argument.
19336
19337         * class.cs (TypeContainer::Emit): Emit our attributes too.
19338
19339         (Method::Emit, Constructor::Emit): Ditto.
19340
19341         * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
19342         to be ignoring earlier.
19343
19344 2001-11-03  Ravi Pratap  <ravi@ximian.com>
19345
19346         * attribute.cs (AttributeSection::Define): Implement to do the business
19347         of constructing a CustomAttributeBuilder.
19348
19349         (Attribute): New trivial class. Increases readability of code.  
19350
19351         * cs-parser.jay : Update accordingly.
19352
19353         (positional_argument_list, named_argument_list, named_argument): New rules
19354
19355         (attribute_arguments): Use the above so that we are more correct.
19356
19357 2001-11-02  Ravi Pratap  <ravi@ximian.com>
19358
19359         * expression.cs (Invocation::IsParamsMethodApplicable): Implement
19360         to perform all checks for a method with a params parameter.
19361
19362         (Invocation::OverloadResolve): Update to use the above method and therefore
19363         cope correctly with params method invocations.
19364
19365         * support.cs (InternalParameters::ParameterDesc): Provide a desc for 
19366         params too.
19367
19368         * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
19369         constructors in our parent too because we can't afford to miss out on 
19370         protected ones ;-)
19371
19372         * attribute.cs (AttributeSection): New name for the class Attribute
19373
19374         Other trivial changes to improve readability.
19375
19376         * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
19377         use the new class names.
19378
19379 2001-11-01  Ravi Pratap  <ravi@ximian.com>
19380
19381         * class.cs (Method::Define): Complete definition for params types too
19382
19383         (Indexer::Define): Ditto.
19384
19385         * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
19386         Cope everywhere with a request for info about the array parameter.
19387
19388 2001-11-01  Ravi Pratap  <ravi@ximian.com>
19389
19390         * tree.cs (RecordNamespace): Fix up to check for the correct key.
19391
19392         * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in 
19393         local_variable_type to extract the string corresponding to the type.
19394
19395         (local_variable_type): Fixup the action to use the new helper method.
19396
19397         * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to 
19398         go.
19399
19400         * expression.cs : Clean out code which uses the above.
19401
19402 2001-10-31  Ravi Pratap  <ravi@ximian.com>
19403
19404         * typemanager.cs (RegisterMethod): Check if we already have an existing key
19405         and bale out if necessary by returning a false.
19406
19407         (RegisterProperty): Ditto.
19408
19409         * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
19410         and print out appropriate error messages.
19411
19412         * interface.cs (everywhere): Ditto.
19413
19414         * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
19415         location to constructor.
19416
19417         * class.cs (Property, Event, Indexer): Update accordingly.
19418
19419         * ../errors/cs111.cs : Added.
19420
19421         * expression.cs (Invocation::IsApplicable): New static method to determine applicability
19422         of a method, as laid down by the spec.
19423
19424         (Invocation::OverloadResolve): Use the above method.
19425
19426 2001-10-31  Ravi Pratap  <ravi@ximian.com>
19427
19428         * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
19429         now take a TypeContainer and a Parameters object.
19430
19431         (ParameterData): Modify return type of ParameterModifier method to be 
19432         Parameter.Modifier and not a string.
19433
19434         (ReflectionParameters, InternalParameters): Update accordingly.
19435
19436         * expression.cs (Argument::GetParameterModifier): Same here.
19437
19438         * support.cs (InternalParameters::ParameterType): Find a better way of determining
19439         if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
19440         symbol in it at all so maybe this is only for now.
19441
19442 2001-10-30  Ravi Pratap  <ravi@ximian.com>
19443
19444         * support.cs (InternalParameters): Constructor now takes an extra argument 
19445         which is the actual Parameters class.
19446
19447         (ParameterDesc): Update to provide info on ref/out modifiers.
19448
19449         * class.cs (everywhere): Update call to InternalParameters to pass in
19450         the second argument too.
19451
19452         * support.cs (ParameterData): Add ParameterModifier, which is a method 
19453         to return the modifier info [ref/out etc]
19454
19455         (InternalParameters, ReflectionParameters): Implement the above.
19456
19457         * expression.cs (Argument::ParameterModifier): Similar function to return
19458         info about the argument's modifiers.
19459
19460         (Invocation::OverloadResolve): Update to take into account matching modifiers 
19461         too.
19462
19463         * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
19464         a new SetFormalParameters object which we pass to InternalParameters.
19465
19466 2001-10-30  Ravi Pratap  <ravi@ximian.com>
19467
19468         * expression.cs (NewArray): Merge into the ArrayCreation class.
19469
19470 2001-10-29  Ravi Pratap  <ravi@ximian.com>
19471
19472         * expression.cs (NewArray): Merge classes NewBuiltinArray and 
19473         NewUserdefinedArray into one as there wasn't much of a use in having
19474         two separate ones.
19475
19476         * expression.cs (Argument): Change field's name to ArgType from Type.
19477
19478         (Type): New readonly property which returns the proper type, taking into 
19479         account ref/out modifiers.
19480
19481         (everywhere): Adjust code accordingly for the above.
19482
19483         * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
19484         whether we are emitting for a ref or out parameter.
19485
19486         * expression.cs (Argument::Emit): Use the above field to set the state.
19487
19488         (LocalVariableReference::Emit): Update to honour the flag and emit the
19489         right stuff.
19490
19491         * parameter.cs (Attributes): Set the correct flags for ref parameters.
19492
19493         * expression.cs (Argument::FullDesc): New function to provide a full desc.
19494
19495         * support.cs (ParameterData): Add method ParameterDesc to the interface.
19496
19497         (ReflectionParameters, InternalParameters): Implement the above method.
19498
19499         * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
19500         reporting errors.
19501
19502         (Invocation::FullMethodDesc): Ditto. 
19503
19504 2001-10-29  Miguel de Icaza  <miguel@ximian.com>
19505
19506         * cs-parser.jay: Add extra production for the second form of array
19507         creation. 
19508
19509         * expression.cs (ArrayCreation): Update to reflect the above
19510         change. 
19511
19512         * Small changes to prepare for Array initialization.
19513
19514 2001-10-28  Miguel de Icaza  <miguel@ximian.com>
19515
19516         * typemanager.cs (ImplementsInterface): interface might be null;
19517         Deal with this problem;
19518
19519         Also, we do store negative hits on the cache (null values), so use
19520         this instead of calling t.GetInterfaces on the type everytime.
19521
19522 2001-10-28  Ravi Pratap  <ravi@ximian.com>
19523
19524         * typemanager.cs (IsBuiltinType): New method to help determine the same.
19525
19526         * expression.cs (New::DoResolve): Get rid of array creation code and instead
19527         split functionality out into different classes.
19528
19529         (New::FormArrayType): Move into NewBuiltinArray.
19530
19531         (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
19532         quite useless.
19533
19534         (NewBuiltinArray): New class to handle creation of built-in arrays.
19535
19536         (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
19537         account creation of one-dimensional arrays.
19538
19539         (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
19540
19541         (NewUserdefinedArray::DoResolve): Implement.
19542
19543         * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
19544
19545         * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
19546         we maintain inside the TypeManager. This is necessary to perform lookups on the
19547         module builder.
19548
19549         (LookupType): Update to perform GetType on the module builders too.     
19550
19551         * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
19552
19553         * exprssion.cs (NewUserdefinedArray::Emit): Implement.
19554
19555 2001-10-23  Ravi Pratap  <ravi@ximian.com>
19556
19557         * expression.cs (New::DoResolve): Implement guts of array creation.
19558
19559         (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
19560
19561 2001-10-27  Miguel de Icaza  <miguel@ximian.com>
19562
19563         * expression.cs: Fix bug I introduced lsat night that broke
19564         Delegates. 
19565
19566         (Expression.Resolve): Report a 246 error (can not resolve name)
19567         if we find a SimpleName in the stream.
19568
19569         (Expression.ResolveLValue): Ditto.
19570
19571         (Expression.ResolveWithSimpleName): This function is a variant of
19572         ResolveName, this one allows SimpleNames to be returned without a
19573         warning.  The only consumer of SimpleNames is MemberAccess
19574
19575 2001-10-26  Miguel de Icaza  <miguel@ximian.com>
19576
19577         * expression.cs (Invocation::DoResolve): Catch SimpleNames that
19578         might arrive here.  I have my doubts that this is correct.
19579
19580         * statement.cs (Lock): Implement lock statement.
19581
19582         * cs-parser.jay: Small fixes to support `lock' and `using'
19583
19584         * cs-tokenizer.cs: Remove extra space
19585
19586         * driver.cs: New flag --checked, allows to turn on integer math
19587         checking. 
19588
19589         * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
19590         Threading.Monitor.Exit 
19591
19592 2001-10-23  Miguel de Icaza  <miguel@ximian.com>
19593
19594         * expression.cs (IndexerAccess::DoResolveLValue): Set the
19595         Expression Class to be IndexerAccess.
19596
19597         Notice that Indexer::DoResolve sets the eclass to Value.
19598
19599 2001-10-22  Miguel de Icaza  <miguel@ximian.com>
19600
19601         * class.cs (TypeContainer::Emit): Emit code for indexers.
19602
19603         * assign.cs (IAssignMethod): New interface implemented by Indexers
19604         and Properties for handling assignment.
19605
19606         (Assign::Emit): Simplify and reuse code. 
19607
19608         * expression.cs (IndexerAccess, PropertyExpr): Implement
19609         IAssignMethod, clean up old code. 
19610
19611 2001-10-22  Ravi Pratap  <ravi@ximian.com>
19612
19613         * typemanager.cs (ImplementsInterface): New method to determine if a type
19614         implements a given interface. Provides a nice cache too.
19615
19616         * expression.cs (ImplicitReferenceConversion): Update checks to use the above
19617         method.
19618
19619         (ConvertReferenceExplicit): Ditto.
19620
19621         * delegate.cs (Delegate::Populate): Update to define the parameters on the 
19622         various methods, with correct names etc.
19623
19624         * class.cs (Operator::OpType): New members Operator.UnaryPlus and 
19625         Operator.UnaryNegation.
19626
19627         * cs-parser.jay (operator_declarator): Be a little clever in the case where
19628         we have a unary plus or minus operator.
19629
19630         * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and 
19631         UnaryMinus.
19632
19633         * everywhere : update accordingly.
19634
19635         * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
19636         respectively.
19637
19638         * class.cs (Method::Define): For the case where we are implementing a method
19639         inherited from an interface, we need to set the MethodAttributes.Final flag too. 
19640         Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
19641
19642 2001-10-21  Ravi Pratap  <ravi@ximian.com>
19643
19644         * interface.cs (FindMembers): Implement to work around S.R.E
19645         lameness.
19646
19647         * typemanager.cs (IsInterfaceType): Implement.
19648
19649         (FindMembers): Update to handle interface types too.
19650
19651         * expression.cs (ImplicitReferenceConversion): Re-write bits which
19652         use IsAssignableFrom as that is not correct - it doesn't work.
19653
19654         * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
19655         and accordingly override EmitStatement.
19656
19657         * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
19658         using the correct logic :-)
19659
19660 2001-10-19  Ravi Pratap  <ravi@ximian.com>
19661
19662         * ../errors/cs-11.cs : Add to demonstrate error -11 
19663
19664 2001-10-17  Miguel de Icaza  <miguel@ximian.com>
19665
19666         * assign.cs (Assign::Resolve): Resolve right hand side first, and
19667         then pass this as a hint to ResolveLValue.
19668
19669         * expression.cs (FieldExpr): Add Location information
19670
19671         (FieldExpr::LValueResolve): Report assignment to readonly
19672         variable. 
19673
19674         (Expression::ExprClassFromMemberInfo): Pass location information.
19675
19676         (Expression::ResolveLValue): Add new method that resolves an
19677         LValue. 
19678
19679         (Expression::DoResolveLValue): Default invocation calls
19680         DoResolve. 
19681
19682         (Indexers): New class used to keep track of indexers in a given
19683         Type. 
19684
19685         (IStackStore): Renamed from LValue, as it did not really describe
19686         what this did.  Also ResolveLValue is gone from this interface and
19687         now is part of Expression.
19688
19689         (ElementAccess): Depending on the element access type
19690
19691         * typemanager.cs: Add `indexer_name_type' as a Core type
19692         (System.Runtime.CompilerServices.IndexerNameAttribute)
19693
19694         * statement.cs (Goto): Take a location.
19695
19696 2001-10-18  Ravi Pratap  <ravi@ximian.com>
19697
19698         * delegate.cs (Delegate::VerifyDelegate): New method to verify
19699         if two delegates are compatible.
19700
19701         (NewDelegate::DoResolve): Update to take care of the case when
19702         we instantiate a delegate from another delegate.
19703
19704         * typemanager.cs (FindMembers): Don't even try to look up members
19705         of Delegate types for now.
19706
19707 2001-10-18  Ravi Pratap  <ravi@ximian.com>
19708
19709         * delegate.cs (NewDelegate): New class to take care of delegate
19710         instantiation.
19711
19712         * expression.cs (New): Split the delegate related code out into 
19713         the NewDelegate class.
19714
19715         * delegate.cs (DelegateInvocation): New class to handle delegate 
19716         invocation.
19717
19718         * expression.cs (Invocation): Split out delegate related code into
19719         the DelegateInvocation class.
19720
19721 2001-10-17  Ravi Pratap  <ravi@ximian.com>
19722
19723         * expression.cs (New::DoResolve): Implement delegate creation fully
19724         and according to the spec.
19725
19726         (New::DoEmit): Update to handle delegates differently.
19727
19728         (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
19729         because of which we were printing out arguments in reverse order !
19730
19731         * delegate.cs (VerifyMethod): Implement to check if the given method
19732         matches the delegate.
19733
19734         (FullDelegateDesc): Implement.
19735
19736         (VerifyApplicability): Implement.
19737
19738         * expression.cs (Invocation::DoResolve): Update to accordingly handle
19739         delegate invocations too.
19740
19741         (Invocation::Emit): Ditto.
19742
19743         * ../errors/cs1593.cs : Added.
19744
19745         * ../errors/cs1594.cs : Added.
19746
19747         * delegate.cs (InstanceExpression, TargetMethod): New properties.
19748
19749 2001-10-16  Ravi Pratap  <ravi@ximian.com>
19750
19751         * typemanager.cs (intptr_type): Core type for System.IntPtr
19752
19753         (InitCoreTypes): Update for the same.
19754
19755         (iasyncresult_type, asynccallback_type): Ditto.
19756
19757         * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
19758         correct.
19759
19760         * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
19761         too.
19762
19763         * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
19764         the builders for the 4 members of a delegate type :-)
19765
19766         (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
19767         type.
19768
19769         * expression.cs (New::DoResolve): Implement guts for delegate creation.
19770
19771         * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
19772
19773 2001-10-15  Miguel de Icaza  <miguel@ximian.com>
19774
19775         * statement.cs (Break::Emit): Implement.   
19776         (Continue::Emit): Implement.
19777
19778         (For::Emit): Track old being/end loops;  Set Begin loop, ack end loop
19779         (While::Emit): Track old being/end loops;  Set Begin loop, ack end loop
19780         (Do::Emit): Track old being/end loops;  Set Begin loop, ack end loop
19781         (Foreach::Emit): Track old being/end loops;  Set Begin loop, ack
19782         end loop
19783
19784         * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
19785         properties that track the label for the current loop (begin of the
19786         loop and end of the loop).
19787
19788 2001-10-15  Ravi Pratap  <ravi@ximian.com>
19789
19790         * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
19791         use of emitting anything at all.
19792
19793         * class.cs, rootcontext.cs : Get rid of calls to the same.
19794
19795         * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
19796
19797         (Populate): Define the constructor correctly and set the implementation
19798         attributes.
19799
19800         * typemanager.cs (delegate_types): New hashtable to hold delegates that
19801         have been defined.
19802
19803         (AddDelegateType): Implement.
19804
19805         (IsDelegateType): Implement helper method.
19806
19807         * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
19808
19809         * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
19810         and accordingly handle it.
19811
19812         * delegate.cs (Populate): Take TypeContainer argument.
19813         Implement bits to define the Invoke method. However, I still haven't figured out
19814         how to take care of the native int bit :-(
19815
19816         * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-) 
19817         Qualify the name of the delegate, not its return type !
19818
19819         * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
19820         conversion.
19821
19822         (StandardConversionExists): Checking for array types turns out to be recursive.
19823
19824         (ConvertReferenceExplicit): Implement array conversion.
19825
19826         (ExplicitReferenceConversionExists): New method to determine precisely that :-)
19827
19828 2001-10-12  Ravi Pratap  <ravi@ximian.com>
19829
19830         * cs-parser.jay (delegate_declaration): Store the fully qualified
19831         name as it is a type declaration.
19832
19833         * delegate.cs (ReturnType, Name): Rename members to these. Make them 
19834         readonly.
19835
19836         (DefineDelegate): Renamed from Define. Does the same thing essentially,
19837         as TypeContainer::DefineType.
19838
19839         (Populate): Method in which all the definition of the various methods (Invoke)
19840         etc is done.
19841
19842         (Emit): Emit any code, if necessary. I am not sure about this really, but let's
19843         see.
19844
19845         (CloseDelegate): Finally creates the delegate.
19846
19847         * class.cs (TypeContainer::DefineType): Update to define delegates.
19848         (Populate, Emit and CloseType): Do the same thing here too.
19849
19850         * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
19851         delegates in all these operations.
19852
19853 2001-10-14  Miguel de Icaza  <miguel@ximian.com>
19854
19855         * expression.cs: LocalTemporary: a new expression used to
19856         reference a temporary that has been created.
19857
19858         * assign.cs: Handle PropertyAccess back here, so that we can
19859         provide the proper semantic access to properties.
19860
19861         * expression.cs (Expression::ConvertReferenceExplicit): Implement
19862         a few more explicit conversions. 
19863
19864         * modifiers.cs: `NEW' modifier maps to HideBySig.
19865
19866         * expression.cs (PropertyExpr): Make this into an
19867         ExpressionStatement, and support the EmitStatement code path. 
19868
19869         Perform get/set error checking, clean up the interface.
19870
19871         * assign.cs: recognize PropertyExprs as targets, and if so, turn
19872         them into toplevel access objects.
19873
19874 2001-10-12  Miguel de Icaza  <miguel@ximian.com>
19875
19876         * expression.cs: PropertyExpr::PropertyExpr: use work around the
19877         SRE.
19878
19879         * typemanager.cs: Keep track here of our PropertyBuilders again to
19880         work around lameness in SRE.
19881
19882 2001-10-11  Miguel de Icaza  <miguel@ximian.com>
19883
19884         * expression.cs (LValue::LValueResolve): New method in the
19885         interface, used to perform a second resolution pass for LValues. 
19886
19887         (This::DoResolve): Catch the use of this in static methods.
19888
19889         (This::LValueResolve): Implement.
19890
19891         (This::Store): Remove warning, assigning to `this' in structures
19892         is 
19893
19894         (Invocation::Emit): Deal with invocation of
19895         methods on value types.  We need to pass the address to structure
19896         methods rather than the object itself.  (The equivalent code to
19897         emit "this" for structures leaves the entire structure on the
19898         stack instead of a pointer to it). 
19899
19900         (ParameterReference::DoResolve): Compute the real index for the
19901         argument based on whether the method takes or not a `this' pointer
19902         (ie, the method is static).
19903
19904         * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
19905         value types returned from functions when we need to invoke a
19906         method on the sturcture.
19907
19908
19909 2001-10-11  Ravi Pratap  <ravi@ximian.com>
19910
19911         * class.cs (TypeContainer::DefineType): Method to actually do the business of
19912         defining the type in the Modulebuilder or Typebuilder. This is to take
19913         care of nested types which need to be defined on the TypeBuilder using
19914         DefineNestedMethod.
19915
19916         (TypeContainer::GetClassBases): Implement. Essentially the code from the 
19917         methods in RootContext, only ported to be part of TypeContainer.
19918
19919         (TypeContainer::GetInterfaceOrClass): Ditto.
19920
19921         (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
19922
19923         * interface.cs (Interface::DefineInterface): New method. Does exactly
19924         what RootContext.CreateInterface did earlier, only it takes care of nested types 
19925         too.
19926
19927         (Interface::GetInterfaces): Move from RootContext here and port.
19928
19929         (Interface::GetInterfaceByName): Same here.
19930
19931         * rootcontext.cs (ResolveTree): Re-write.
19932
19933         (PopulateTypes): Re-write.
19934
19935         * class.cs (TypeContainer::Populate): Populate nested types too.
19936         (TypeContainer::Emit): Emit nested members too.
19937
19938         * typemanager.cs (AddUserType): Do not make use of the FullName property,
19939         instead just use the name argument passed in as it is already fully
19940         qualified.
19941
19942         (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
19943         to TypeContainer mapping to see if a type is user-defined.
19944
19945         * class.cs (TypeContainer::CloseType): Implement. 
19946
19947         (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
19948         the default constructor.
19949
19950         (TypeContainer::Populate): Fix minor bug which led to creating default constructors
19951         twice.
19952
19953         (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
19954
19955         * interface.cs (CloseType): Create the type here.
19956
19957         * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
19958         the hierarchy.
19959
19960         Remove all the methods which are now in TypeContainer.
19961
19962 2001-10-10  Ravi Pratap  <ravi@ximian.com>
19963
19964         * delegate.cs (Define): Re-write bits to define the delegate
19965         correctly.
19966
19967 2001-10-10  Miguel de Icaza  <miguel@ximian.com>
19968
19969         * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
19970
19971         * expression.cs (ImplicitReferenceConversion): handle null as well
19972         as a source to convert to any reference type.
19973
19974         * statement.cs (Return): Perform any implicit conversions to
19975         expected return type.  
19976
19977         Validate use of return statement.  
19978
19979         * codegen.cs (EmitContext): Pass the expected return type here.
19980
19981         * class.cs (Method, Constructor, Property): Pass expected return
19982         type to EmitContext.
19983
19984 2001-10-09  Miguel de Icaza  <miguel@ximian.com>
19985
19986         * expression.cs: Make DoResolve take an EmitContext instead of a
19987         TypeContainer.
19988
19989         Replaced `l' and `location' for `loc', for consistency.
19990
19991         (Error, Warning): Remove unneeded Tc argument.
19992
19993         * assign.cs, literal.cs, constant.cs: Update to new calling
19994         convention. 
19995
19996         * codegen.cs: EmitContext now contains a flag indicating whether
19997         code is being generated in a static method or not.
19998
19999         * cs-parser.jay: DecomposeQI, new function that replaces the old
20000         QualifiedIdentifier.  Now we always decompose the assembled
20001         strings from qualified_identifier productions into a group of
20002         memberaccesses.
20003
20004 2001-10-08  Miguel de Icaza  <miguel@ximian.com>
20005
20006         * rootcontext.cs: Deal with field-less struct types correctly now
20007         by passing the size option to Define Type.
20008
20009         * class.cs: Removed hack that created one static field. 
20010
20011 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
20012
20013         * statement.cs: Moved most of the code generation here. 
20014
20015 2001-10-09  Ravi Pratap  <ravi@ximian.com>
20016
20017         * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
20018         seem very right.
20019
20020         (ElementAccess): Remove useless bits for now - keep checks as the spec
20021         says.
20022
20023 2001-10-08  Ravi Pratap  <ravi@ximian.com>
20024
20025         * expression.cs (ElementAccess::DoResolve): Remove my crap code
20026         and start performing checks according to the spec.
20027
20028 2001-10-07  Ravi Pratap  <ravi@ximian.com>
20029
20030         * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
20031         rank_specifiers instead.
20032
20033         (rank_specifiers): Change the order in which the rank specifiers are stored
20034
20035         (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
20036
20037         * expression.cs (ElementAccess): Implement the LValue interface too.
20038
20039 2001-10-06  Ravi Pratap  <ravi@ximian.com>
20040
20041         * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
20042         except that user defined conversions are not included.
20043
20044         (UserDefinedConversion): Update to use the ConvertExplicitStandard to 
20045         perform the conversion of the return type, if necessary.
20046
20047         (New::DoResolve): Check whether we are creating an array or an object
20048         and accordingly do the needful.
20049
20050         (New::Emit): Same here.
20051
20052         (New::DoResolve): Implement guts of array creation.
20053
20054         (New::FormLookupType): Helper function.
20055
20056 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
20057
20058         * codegen.cs: Removed most of the code generation here, and move the
20059         corresponding code generation bits to the statement classes. 
20060
20061         Added support for try/catch/finalize and throw.
20062
20063         * cs-parser.jay: Added support for try/catch/finalize.
20064
20065         * class.cs: Catch static methods having the flags override,
20066         virtual or abstract.
20067
20068         * expression.cs (UserCast): This user cast was not really doing
20069         what it was supposed to do.  Which is to be born in fully resolved
20070         state.  Parts of the resolution were being performed at Emit time! 
20071
20072         Fixed this code.
20073
20074 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
20075
20076         * expression.cs: Implicity convert the result from UserCast.
20077
20078 2001-10-05  Ravi Pratap  <ravi@ximian.com>
20079
20080         * expression.cs (Expression::FindMostEncompassingType): Fix bug which
20081         prevented it from working correctly. 
20082
20083         (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
20084         merely ConvertImplicit.
20085
20086 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
20087
20088         * typemanager.cs: Make the LookupTypeContainer function static,
20089         and not per-instance.  
20090
20091         * class.cs: Make static FindMembers (the one that takes a Type
20092         argument). 
20093
20094         * codegen.cs: Add EmitForeach here.
20095
20096         * cs-parser.jay: Make foreach a toplevel object instead of the
20097         inline expansion, as we need to perform semantic analysis on it. 
20098
20099 2001-10-05  Ravi Pratap  <ravi@ximian.com>
20100
20101         * expression.cs (Expression::ImplicitUserConversion): Rename to
20102         UserDefinedConversion.
20103
20104         (Expression::UserDefinedConversion): Take an extra argument specifying 
20105         whether we look for explicit user conversions too.
20106
20107         (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
20108
20109         (UserDefinedConversion): Incorporate support for user defined explicit conversions.
20110
20111         (ExplicitUserConversion): Make it a call to UserDefinedConversion
20112         with the appropriate arguments.
20113
20114         * cs-parser.jay (cast_expression): Record location too.
20115
20116         * expression.cs (Cast): Record location info.
20117
20118         (Expression::ConvertExplicit): Take location argument.
20119
20120         (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
20121         to determine if we are doing explicit conversions.
20122
20123         (UserCast::Emit): Update accordingly.
20124
20125         (Expression::ConvertExplicit): Report an error if everything fails.
20126
20127         * ../errors/cs0030.cs : Add.
20128
20129 2001-10-04  Miguel de Icaza  <miguel@ximian.com>
20130
20131         * modifiers.cs: If the ABSTRACT keyword is present, also set the
20132         virtual and newslot bits. 
20133
20134         * class.cs (TypeContainer::RegisterRequiredImplementations):
20135         Record methods we need.
20136
20137         (TypeContainer::MakeKey): Helper function to make keys for
20138         MethodBases, since the Methodbase key is useless.
20139
20140         (TypeContainer::Populate): Call RegisterRequiredImplementations
20141         before defining the methods.   
20142
20143         Create a mapping for method_builders_to_methods ahead of time
20144         instead of inside a tight loop.
20145
20146         (::RequireMethods):  Accept an object as the data to set into the
20147         hashtable so we can report interface vs abstract method mismatch.
20148
20149 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
20150
20151         * report.cs: Make all of it static.
20152
20153         * rootcontext.cs: Drop object_type and value_type computations, as
20154         we have those in the TypeManager anyways.
20155
20156         Drop report instance variable too, now it is a global.
20157
20158         * driver.cs: Use try/catch on command line handling.
20159
20160         Add --probe option to debug the error reporting system with a test
20161         suite. 
20162
20163         * report.cs: Add support for exiting program when a probe
20164         condition is reached.
20165
20166 2001-10-03  Ravi Pratap  <ravi@ximian.com>
20167
20168         * expression.cs (Binary::DoNumericPromotions): Fix the case when
20169         we do a forcible conversion regardless of type, to check if 
20170         ForceConversion returns a null.
20171
20172         (Binary::error19): Use location to report error.
20173
20174         (Unary::error23): Use location here too.
20175
20176         * ../errors/cs0019.cs : Check in.
20177
20178         * ../errors/cs0023.cs : Check in.
20179
20180         * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
20181         case of a non-null MethodInfo object with a length of 0 !
20182
20183         (Binary::ResolveOperator): Flag error if overload resolution fails to find
20184         an applicable member - according to the spec :-)
20185         Also fix logic to find members in base types.
20186
20187         (Unary::ResolveOperator): Same here.
20188
20189         (Unary::report23): Change name to error23 and make first argument a TypeContainer
20190         as I was getting thoroughly confused between this and error19 :-)
20191
20192         * expression.cs (Expression::ImplicitUserConversion): Re-write fully
20193         (::FindMostEncompassedType): Implement.
20194         (::FindMostEncompassingType): Implement.
20195         (::StandardConversionExists): Implement.
20196
20197         (UserImplicitCast): Re-vamp. We now need info about most specific
20198         source and target types so that we can do the necessary conversions.
20199
20200         (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
20201         mathematical union with no duplicates.
20202
20203 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
20204
20205         * rootcontext.cs (RootContext::PopulateTypes): Populate containers
20206         in order from base classes to child classes, so that we can in
20207         child classes look up in our parent for method names and
20208         attributes (required for handling abstract, virtual, new, override
20209         constructs: we need to instrospect our base class, and if we dont
20210         populate the classes in order, the introspection might be
20211         incorrect.  For example, a method could query its parent before
20212         the parent has any methods and would determine that the parent has
20213         no abstract methods (while it could have had them)).
20214
20215         (RootContext::CreateType): Record the order in which we define the
20216         classes.
20217
20218 2001-10-02  Miguel de Icaza  <miguel@ximian.com>
20219
20220         * class.cs (TypeContainer::Populate): Also method definitions can
20221         fail now, keep track of this.
20222
20223         (TypeContainer::FindMembers): Implement support for
20224         DeclaredOnly/noDeclaredOnly flag.
20225
20226         (Constructor::Emit) Return the ConstructorBuilder.
20227
20228         (Method::Emit) Return the MethodBuilder. 
20229         Check for abstract or virtual methods to be public.
20230
20231         * rootcontext.cs (RootContext::CreateType): Register all the
20232         abstract methods required for the class to be complete and the
20233         interface methods that must be implemented. 
20234
20235         * cs-parser.jay: Report error 501 (method requires body if it is
20236         not marked abstract or extern).
20237
20238         * expression.cs (TypeOf::Emit): Implement.
20239
20240         * typemanager.cs: runtime_handle_type, new global type.
20241
20242         * class.cs (Property::Emit): Generate code for properties.
20243
20244 2001-10-02  Ravi Pratap  <ravi@ximian.com>
20245
20246         * expression.cs (Unary::ResolveOperator): Find operators on base type
20247         too - we now conform exactly to the spec.
20248
20249         (Binary::ResolveOperator): Same here.
20250
20251         * class.cs (Operator::Define): Fix minor quirk in the tests.
20252
20253         * ../errors/cs0215.cs : Added.
20254
20255         * ../errors/cs0556.cs : Added.
20256
20257         * ../errors/cs0555.cs : Added.
20258
20259 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
20260
20261         * cs-tokenizer.cs: Reimplemented Location to be a struct with a
20262         single integer which is really efficient
20263
20264 2001-10-01  Ravi Pratap  <ravi@ximian.com>
20265
20266         *  expression.cs (Expression::ImplicitUserConversion): Use location
20267         even in the case when we are examining True operators.
20268  
20269         * class.cs (Operator::Define): Perform extensive checks to conform
20270         with the rules for operator overloading in the spec.
20271
20272         * expression.cs (Expression::ImplicitReferenceConversion): Implement
20273         some of the other conversions mentioned in the spec.
20274
20275         * typemanager.cs (array_type): New static member for the System.Array built-in
20276         type.
20277
20278         (cloneable_interface): For System.ICloneable interface.
20279
20280         * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
20281         we start resolving the tree and populating types.
20282
20283         * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
20284  
20285 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
20286
20287         * expression.cs (Expression::ExprClassFromMemberInfo,
20288         Expression::Literalize): Create literal expressions from
20289         FieldInfos which are literals.
20290
20291         (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
20292         type casts, because they were wrong.  The test suite in tests
20293         caught these ones.
20294
20295         (ImplicitNumericConversion): ushort to ulong requires a widening
20296         cast. 
20297
20298         Int32 constant to long requires widening cast as well.
20299
20300         * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
20301         for integers because the type on the stack is not i4.
20302
20303 2001-09-30  Miguel de Icaza  <miguel@ximian.com>
20304
20305         * expression.cs (report118): require location argument. 
20306
20307         * parameter.cs: Do not dereference potential null value.
20308
20309         * class.cs: Catch methods that lack the `new' keyword when
20310         overriding a name.  Report warnings when `new' is used without
20311         anything being there to override.
20312
20313         * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
20314
20315         * class.cs: Only add constructor to hashtable if it is non-null
20316         (as now constructors can fail on define).
20317
20318         (TypeManager, Class, Struct): Take location arguments.
20319
20320         Catch field instance initialization in structs as errors.
20321
20322         accepting_filter: a new filter for FindMembers that is static so
20323         that we dont create an instance per invocation.
20324
20325         (Constructor::Define): Catch errors where a struct constructor is
20326         parameterless 
20327
20328         * cs-parser.jay: Pass location information for various new
20329         constructs. 
20330
20331         * delegate.cs (Delegate): take a location argument.
20332
20333         * driver.cs: Do not call EmitCode if there were problesm in the
20334         Definition of the types, as many Builders wont be there. 
20335
20336         * decl.cs (Decl::Decl): Require a location argument.
20337
20338         * cs-tokenizer.cs: Handle properly hex constants that can not fit
20339         into integers, and find the most appropiate integer for it.
20340
20341         * literal.cs: Implement ULongLiteral.
20342
20343         * rootcontext.cs: Provide better information about the location of
20344         failure when CreateType fails.
20345
20346 2001-09-29  Miguel de Icaza  <miguel@ximian.com>
20347
20348         * rootcontext.cs (RootContext::PopulateTypes): Populates structs
20349         as well.
20350
20351         * expression.cs (Binary::CheckShiftArguments): Add missing type
20352         computation.
20353         (Binary::ResolveOperator): Add type to the logical and and logical
20354         or, Bitwise And/Or and Exclusive Or code paths, it was missing
20355         before.
20356
20357         (Binary::DoNumericPromotions): In the case where either argument
20358         is ulong (and most signed types combined with ulong cause an
20359         error) perform implicit integer constant conversions as well.
20360
20361 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
20362
20363         * expression.cs (UserImplicitCast): Method should always be
20364         non-null. 
20365         (Invocation::BetterConversion): Simplified test for IntLiteral.
20366
20367         (Expression::ImplicitNumericConversion): Split this routine out.
20368         Put the code that performs implicit constant integer conversions
20369         here. 
20370
20371         (Expression::Resolve): Become a wrapper around DoResolve so we can
20372         check eclass and type being set after resolve.
20373
20374         (Invocation::Badness): Remove this dead function
20375
20376         (Binary::ResolveOperator): Do not compute the expensive argumnets
20377         unless we have a union for it.
20378
20379         (Probe::Emit): Is needs to do an isinst and then
20380         compare against null.
20381
20382         (::CanConvert): Added Location argument.  If the Location argument
20383         is null (Location.Null), then we do not report errors.  This is
20384         used by the `probe' mechanism of the Explicit conversion.  We do
20385         not want to generate an error for something that the user
20386         explicitly requested to be casted.  But the pipeline for an
20387         explicit cast first tests for potential implicit casts.
20388
20389         So for now, if the Location is null, it means `Probe only' to
20390         avoid adding another argument.   Might have to revise this
20391         strategy later.
20392
20393         (ClassCast): New class used to type cast objects into arbitrary
20394         classes (used in Explicit Reference Conversions).
20395
20396         Implement `as' as well.
20397
20398         Reverted all the patches from Ravi below: they were broken:
20399
20400                 * The use of `level' as a mechanism to stop recursive
20401                   invocations is wrong.  That was there just to catch the
20402                   bug with a strack trace but not as a way of addressing
20403                   the problem.
20404
20405                   To fix the problem we have to *understand* what is going
20406                   on and the interactions and come up with a plan, not
20407                   just get things going.
20408
20409                 * The use of the type conversion cache that I proposed
20410                   last night had an open topic: How does this work across
20411                   protection domains.  A user defined conversion might not
20412                   be public in the location where we are applying the
20413                   conversion, a different conversion might be selected
20414                   (ie, private A->B (better) but public B->A (worse),
20415                   inside A, A->B applies, but outside it, B->A will
20416                   apply).
20417
20418                 * On top of that (ie, even if the above is solved),
20419                   conversions in a cache need to be abstract.  Ie, `To
20420                   convert from an Int to a Short use an OpcodeCast', not
20421                   `To convert from an Int to a Short use the OpcodeCast on
20422                   the variable 5' (which is what this patch was doing).
20423
20424 2001-09-28  Ravi Pratap  <ravi@ximian.com>
20425
20426         * expression.cs (Invocation::ConversionExists): Re-write to use
20427         the conversion cache
20428
20429         (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
20430         cache all conversions done, not just user-defined ones.
20431
20432         (Invocation::BetterConversion): The real culprit. Use ConversionExists
20433         to determine if a conversion exists instead of acutually trying to 
20434         perform the conversion. It's faster too.
20435
20436         (Expression::ConvertExplicit): Modify to use ConversionExists to check
20437         and only then attempt the implicit conversion.
20438
20439 2001-09-28  Ravi Pratap  <ravi@ximian.com>
20440
20441         * expression.cs (ConvertImplicit): Use a cache for conversions
20442         already found. Check level of recursion and bail out if necessary.
20443
20444 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
20445
20446         * typemanager.cs (string_concat_string_string, string_concat_object_object):
20447         Export standard methods that we expect for string operations.
20448
20449         * statement.cs (Block::UsageWarning): Track usage of variables and
20450         report the errors for not used variables.
20451
20452         * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
20453         operator. 
20454
20455 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
20456
20457         * codegen.cs: remove unnneded code 
20458
20459         * expression.cs: Removed BuiltinTypeAccess class
20460
20461         Fix the order in which implicit conversions are
20462         done.  
20463
20464         The previous fixed dropped support for boxed conversions (adding a
20465         test to the test suite now)
20466
20467         (UserImplicitCast::CanConvert): Remove test for source being null,
20468         that code is broken.  We should not feed a null to begin with, if
20469         we do, then we should track the bug where the problem originates
20470         and not try to cover it up here.
20471
20472         Return a resolved expression of type UserImplicitCast on success
20473         rather than true/false.  Ravi: this is what I was talking about,
20474         the pattern is to use a static method as a "constructor" for
20475         objects. 
20476
20477         Also, do not create arguments until the very last minute,
20478         otherwise we always create the arguments even for lookups that
20479         will never be performed. 
20480
20481         (UserImplicitCast::Resolve): Eliminate, objects of type
20482         UserImplicitCast are born in a fully resolved state. 
20483
20484         * typemanager.cs (InitCoreTypes): Init also value_type
20485         (System.ValueType). 
20486
20487         * expression.cs (Cast::Resolve): First resolve the child expression.
20488
20489         (LValue): Add new method AddressOf to be used by
20490         the `&' operator.  
20491
20492         Change the argument of Store to take an EmitContext instead of an
20493         ILGenerator, because things like FieldExpr need to be able to call
20494         their children expression to generate the instance code. 
20495
20496         (Expression::Error, Expression::Warning): Sugar functions for
20497         reporting errors.
20498
20499         (Expression::MemberLookup): Accept a TypeContainer instead of a
20500         Report as the first argument.
20501
20502         (Expression::ResolvePrimary): Killed.  I still want to improve
20503         this as currently the code is just not right.
20504
20505         (Expression::ResolveMemberAccess): Simplify, but it is still
20506         wrong. 
20507
20508         (Unary::Resolve): Catch errors in AddressOf operators.
20509
20510         (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
20511         index to a byte for the short-version, or the compiler will choose
20512         the wrong Emit call, which generates the wrong data.
20513
20514         (ParameterReference::Emit, ::Store): same.
20515
20516         (FieldExpr::AddressOf): Implement.
20517
20518         * typemanager.cs: TypeManager: made public variable instead of
20519         property.
20520
20521         * driver.cs: document --fatal.
20522
20523         * report.cs (ErrorMessage, WarningMessage): new names for the old
20524         Error and Warning classes.
20525
20526         * cs-parser.jay (member_access): Turn built-in access to types
20527         into a normal simplename
20528
20529 2001-09-27  Ravi Pratap  <ravi@ximian.com>
20530
20531         * expression.cs (Invocation::BetterConversion): Fix to cope
20532         with q being null, since this was introducing a bug.
20533
20534         * expression.cs (ConvertImplicit): Do built-in conversions first.
20535
20536 2001-09-27  Ravi Pratap  <ravi@ximian.com>
20537
20538         * expression.cs (UserImplicitCast::Resolve): Fix bug.
20539
20540 2001-09-27  Ravi Pratap  <ravi@ximian.com>
20541
20542         * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
20543         I had introduced long ago (what's new ?).
20544
20545         * expression.cs (UserImplicitCast::CanConvert): Static method to do 
20546         the work of all the checking. 
20547         (ConvertImplicit): Call CanConvert and only then create object if necessary.
20548         (UserImplicitCast::CanConvert, ::Resolve): Re-write.
20549
20550         (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
20551         that is the right way. 
20552
20553         (Invocation::MakeUnionSet): Convenience function to make unions of sets for 
20554         overloading resolution. Use everywhere instead of cutting and pasting code.
20555
20556         (Binary::ResolveOperator): Use MakeUnionSet.
20557
20558         (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when 
20559         we have to convert to bool types. Not complete yet.
20560
20561 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
20562
20563         * typemanager.cs (TypeManager::CSharpName): support ushort.
20564
20565         * expression.cs (Expression::TryImplicitIntConversion): Attempts
20566         to provide an expression that performsn an implicit constant int
20567         conversion (section 6.1.6).
20568         (Expression::ConvertImplicitRequired): Reworked to include
20569         implicit constant expression conversions.
20570
20571         (Expression::ConvertNumericExplicit): Finished.
20572
20573         (Invocation::Emit): If InstanceExpression is null, then it means
20574         that we perform a call on this.
20575
20576 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
20577
20578         * expression.cs (Unary::Emit): Remove some dead code.
20579         (Probe): Implement Resolve and Emit for `is'.
20580         (Expression::ConvertImplicitRequired): Attempt to do constant
20581         expression conversions here.  Maybe should be moved to
20582         ConvertImplicit, but I am not sure.
20583         (Expression::ImplicitLongConstantConversionPossible,
20584         Expression::ImplicitIntConstantConversionPossible): New functions
20585         that tell whether is it possible to apply an implicit constant
20586         expression conversion.
20587
20588         (ConvertNumericExplicit): Started work on explicit numeric
20589         conversions.
20590
20591         * cs-parser.jay: Update operator constants.
20592
20593         * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
20594         (Parameters::GetSignature): Hook up VerifyArgs here.
20595         (Parameters::VerifyArgs): Verifies that no two arguments have the
20596         same name. 
20597
20598         * class.cs (Operator): Update the operator names to reflect the
20599         ones that the spec expects (as we are just stringizing the
20600         operator names).
20601
20602         * expression.cs (Unary::ResolveOperator): Fix bug: Use
20603         MethodInfo's ReturnType instead of LookupMethodByBuilder as the
20604         previous usage did only work for our methods.
20605         (Expression::ConvertImplicit): Handle decimal implicit numeric
20606         conversions as well.
20607         (Expression::InternalTypeConstructor): Used to invoke constructors
20608         on internal types for default promotions.
20609
20610         (Unary::Emit): Implement special handling for the pre/post
20611         increment/decrement for overloaded operators, as they need to have
20612         the same semantics as the other operators.
20613
20614         (Binary::ResolveOperator): ditto.
20615         (Invocation::ConversionExists): ditto.
20616         (UserImplicitCast::Resolve): ditto.
20617
20618 2001-09-26  Ravi Pratap  <ravi@ximian.com>
20619
20620         * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
20621         operator, return after emitting body. Regression tests pass again !
20622
20623         * expression.cs (ConvertImplicit): Take TypeContainer as first argument
20624         (Unary::ForceConversion, Binary::ForceConversion): Ditto.
20625         (Invocation::OverloadResolve): Ditto.
20626         (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
20627
20628         * everywhere : update calls to the above methods accordingly.
20629
20630 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
20631
20632         * assign.cs (Assign): Make it inherit from ExpressionStatement.
20633
20634         * expression.cs (ExpressionStatement): New base class used for
20635         expressions that can appear in statements, so that we can provide
20636         an alternate path to generate expression that do not leave a value
20637         on the stack.
20638
20639         (Expression::Emit, and all the derivatives): We no longer return
20640         whether a value is left on the stack or not.  Every expression
20641         after being emitted leaves a single value on the stack.
20642
20643         * codegen.cs (EmitContext::EmitStatementExpression): Use the
20644         facilties of ExpressionStatement if possible.
20645
20646         * cs-parser.jay: Update statement_expression.
20647
20648 2001-09-25  Miguel de Icaza  <miguel@ximian.com>
20649
20650         * driver.cs: Change the wording of message
20651
20652 2001-09-25  Ravi Pratap  <ravi@ximian.com>
20653
20654         * expression.cs (Binary::ResolveOperator): Had forgottten to set 
20655         the type of the expression to the return type of the method if
20656         we have an overloaded operator match ! The regression tests pass again !
20657         (Unary::ResolveOperator): Ditto.
20658
20659         * expression.cs (Invocation::ConversionExists): Correct the member lookup
20660         to find "op_Implicit", not "implicit" ;-)
20661         (UserImplicitCast): New class to take care of user-defined implicit conversions.
20662         (ConvertImplicit, ForceConversion): Take TypeContainer argument
20663
20664         * everywhere : Correct calls to the above accordingly.
20665
20666         * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
20667         (ConvertImplicit): Do user-defined conversion if it exists.
20668
20669 2001-09-24  Miguel de Icaza  <miguel@ximian.com>
20670
20671         * assign.cs: track location.
20672         (Resolve): Use implicit conversions on assignment.
20673
20674         * literal.cs: Oops.  Not good, Emit of short access values should
20675         pass (Bytes) or the wrong argument will be selected.
20676
20677         * expression.cs (Unary::Emit): Emit code for -expr.
20678
20679         (Unary::ResolveOperator): Handle `Substract' for non-constants
20680         (substract from zero from the non-constants).
20681         Deal with Doubles as well. 
20682
20683         (Expression::ConvertImplicitRequired): New routine that reports an
20684         error if no implicit conversion exists. 
20685
20686         (Invocation::OverloadResolve): Store the converted implicit
20687         expressions if we make them
20688
20689 2001-09-24  Ravi Pratap  <ravi@ximian.com>
20690
20691         * class.cs (ConstructorInitializer): Take a Location argument.
20692         (ConstructorBaseInitializer): Same here.
20693         (ConstructorThisInitializer): Same here.
20694
20695         * cs-parser.jay : Update all calls accordingly.
20696
20697         * expression.cs (Unary, Binary, New): Take location argument.
20698         Update accordingly everywhere.
20699
20700         * cs-parser.jay : Update all calls to the above to take a location
20701         argument.
20702
20703         * class.cs : Ditto.
20704
20705 2001-09-24  Ravi Pratap  <ravi@ximian.com>
20706
20707         * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
20708         (Invocation::BetterConversion): Same here
20709         (Invocation::ConversionExists): Ditto.
20710
20711         (Invocation::ConversionExists): Implement.
20712
20713 2001-09-22  Ravi Pratap  <ravi@ximian.com>
20714
20715         * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
20716         Also take an additional TypeContainer argument.
20717
20718         * All over : Pass in TypeContainer as argument to OverloadResolve.
20719
20720         * typemanager.cs (CSharpName): Update to check for the string type and return
20721         that too.
20722
20723         * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
20724         a given method.
20725
20726 2001-09-21  Ravi Pratap  <ravi@ximian.com>
20727
20728         * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
20729         (Invocation::BetterFunction): Implement.
20730         (Invocation::BetterConversion): Implement.
20731         (Invocation::ConversionExists): Skeleton, no implementation yet.
20732
20733         Okay, things work fine !
20734
20735 2001-09-21  Miguel de Icaza  <miguel@ximian.com>
20736
20737         * typemanager.cs: declare and load enum_type, delegate_type and
20738         void_type. 
20739
20740         * expression.cs (Expression::Emit): Now emit returns a value that
20741         tells whether a value is left on the stack or not.  This strategy
20742         might be reveted tomorrow with a mechanism that would address
20743         multiple assignments.
20744         (Expression::report118): Utility routine to report mismatches on
20745         the ExprClass.
20746
20747         (Unary::Report23): Report impossible type/operator combination
20748         utility function.
20749
20750         (Unary::IsIncrementableNumber): Whether the type can be
20751         incremented or decremented with add.
20752         (Unary::ResolveOperator): Also allow enumerations to be bitwise
20753         complemented. 
20754         (Unary::ResolveOperator): Implement ++, !, ~,
20755
20756         (Invocation::Emit): Deal with new Emit convetion.
20757
20758         * All Expression derivatives: Updated their Emit method to return
20759         whether they leave values on the stack or not.
20760
20761         * codegen.cs (CodeGen::EmitStatement): Pop values left on the
20762         stack for expressions that are statements. 
20763
20764 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
20765
20766         * expression.cs (LValue): New interface.  Must be implemented by
20767         LValue objects.
20768         (LocalVariableReference, ParameterReference, FieldExpr): Implement
20769         LValue interface.
20770
20771         * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
20772         interface for generating code, simplifies the code.
20773
20774 2001-09-20  Ravi Pratap  <ravi@ximian.com>
20775
20776         * expression.cs (everywhere): Comment out return statements in ::Resolve
20777         methods to avoid the warnings.
20778
20779 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
20780
20781         * driver.cs (parse): Report error 2001 if we can not open the
20782         source file.
20783
20784         * expression.cs (SimpleName::ResolveSimpleName): Error if we can
20785         not resolve it.
20786
20787         * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
20788         object. 
20789
20790         * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
20791         otherwise nested blocks end up with the same index.
20792
20793         * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
20794
20795         * expression.cs:  Instead of having FIXMEs in the Resolve
20796         functions, throw exceptions so it is obvious that we are facing a
20797         bug. 
20798
20799         * cs-parser.jay (invocation_expression): Pass Location information.
20800
20801         * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
20802         Use a basename for those routines because .NET does not like paths
20803         on them. 
20804
20805         * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
20806         already defined.
20807
20808 2001-09-19  Miguel de Icaza  <miguel@ximian.com>
20809
20810         * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
20811         are loading the correct data types (throws an exception if not).
20812         (TypeManager::InitCoreTypes): Use CoreLookupType
20813
20814         * expression.cs (Unary::ResolveOperator): return the child
20815         expression for expressions which are just +expr.
20816         (Unary::ResolveOperator): Return negative literals for -LITERAL
20817         expressions (otherwise they are Unary {Literal}).
20818         (Invocation::Badness): Take into account `Implicit constant
20819         expression conversions'.
20820
20821         * literal.cs (LongLiteral): Implement long literal class.
20822         (IntLiteral): export the `Value' of the intliteral. 
20823
20824 2001-09-19  Ravi Pratap  <ravi@ximian.com>
20825
20826         * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
20827
20828         * class.cs (Operator::Define): Change the methodname prefix to 'op_' 
20829         instead of 'Operator'
20830
20831         * expression.cs (Binary::ResolveOperator): Update accordingly.
20832         (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
20833         and 'Minus'
20834
20835         * cs-parser.jay (unary_expression): Update to use the new names.
20836
20837         * gen-treedump.cs (GetUnary): Same here.
20838
20839         * expression.cs (Unary::Resolve): Implement.
20840         (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded 
20841         operators are found instead of making noise ;-)
20842         (Unary::ResolveOperator): New method to do precisely the same thing which
20843         Binary::ResolveOperator does for Binary expressions.
20844         (Unary.method, .Arguments): Add.
20845         (Unary::OperName): Implement.   
20846         (Unary::ForceConversion): Copy and Paste !
20847
20848         * class.cs (Operator::Define): Fix a small bug for the case when we have 
20849         a unary operator.
20850
20851         * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
20852         for the inbuilt operators. Only overloading works for now ;-)
20853
20854 2001-09-18  Miguel de Icaza  <miguel@ximian.com>
20855
20856         * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
20857         UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
20858
20859         * expression.cs (This::Emit): Implement. 
20860         (This::Resolve): Implement.
20861         (TypeOf:Resolve): Implement.
20862         (Expression::ResolveSimpleName): Add an implicit this to instance
20863         field references. 
20864         (MemberAccess::Resolve): Deal with Parameters and Fields. 
20865         Bind instance variable to Field expressions.
20866         (FieldExpr::Instance): New field used to track the expression that
20867         represents the object instance.
20868         (FieldExpr::Resolve): Track potential errors from MemberLookup not
20869         binding 
20870         (FieldExpr::Emit): Implement.
20871
20872         * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
20873         the last instruction contains a return opcode to avoid generating
20874         the last `ret' instruction (this generates correct code, and it is
20875         nice to pass the peverify output).
20876
20877         * class.cs (TypeContainer::EmitFieldInitializers): Implement field
20878         initializer for static and instance variables.
20879         (Constructor::Emit): Allow initializer to be null in the case of
20880         static constructors.  Only emit initializer for instance
20881         constructors. 
20882
20883         (TypeContainer::FindMembers): Return a null array if there are no
20884         matches.
20885
20886         Also fix the code for the MemberTypes.Method branch, as it was not
20887         scanning that for operators (or tried to access null variables before).
20888
20889         * assign.cs (Assign::Emit): Handle instance and static fields. 
20890
20891         * TODO: Updated.
20892
20893         * driver.cs: Stop compilation if there are parse errors.
20894
20895         * cs-parser.jay (constructor_declaration): Provide default base
20896         initializer for non-static constructors.
20897         (constructor_declarator): Do not provide a default base
20898         initializers if none was specified.
20899         Catch the fact that constructors should not have parameters.
20900
20901         * class.cs: Do not emit parent class initializers for static
20902         constructors, that should be flagged as an error.
20903
20904 2001-09-18  Ravi Pratap  <ravi@ximian.com>
20905
20906         * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
20907         Move back code into TypeContainer::Populate.
20908
20909 2001-09-18  Ravi Pratap  <ravi@ximian.com>
20910
20911         * class.cs (TypeContainer::AddConstructor): Fix the check to
20912         compare against Name, not Basename. 
20913         (Operator::OpType): Change Plus and Minus to Add and Subtract.
20914
20915         * cs-parser.jay : Update accordingly.
20916
20917         * class.cs (TypeContainer::FindMembers): For the case where we are searching
20918         for methods, don't forget to look into the operators too.
20919         (RegisterMethodBuilder): Helper method to take care of this for
20920         methods, constructors and operators.
20921         (Operator::Define): Completely revamp.
20922         (Operator.OperatorMethod, MethodName): New fields.
20923         (TypeContainer::Populate): Move the registering of builders into
20924         RegisterMethodBuilder.
20925         (Operator::Emit): Re-write.
20926
20927         * expression.cs (Binary::Emit): Comment out code path to emit method
20928         invocation stuff for the case when we have a user defined operator. I am
20929         just not able to get it right !
20930
20931 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
20932
20933         * expression.cs (Expression::OverloadResolve): Drop TypeContainer
20934         argument. 
20935
20936         (Expression::MemberLookup): Provide a version that allows to
20937         specify the MemberTypes and BindingFlags. 
20938
20939         * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
20940         so it was not fetching variable information from outer blocks.
20941
20942         * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
20943         Beforefieldinit as it was buggy.
20944
20945         * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
20946         that Ravi put here.  
20947
20948         * class.cs (Constructor::Emit): Only emit if block is not null.
20949         (TypeContainer::EmitDefaultConstructor): Removed routine, now we
20950         deal with this by semantically definining it as if the user had
20951         done it.
20952
20953         (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
20954         constructors as we now "emit" them at a higher level.
20955
20956         (TypeContainer::DefineDefaultConstructor): Used to define the
20957         default constructors if none was provided.
20958
20959         (ConstructorInitializer): Add methods Resolve and Emit. 
20960
20961         * expression.cs: Cast to ConstructorInfo instead of MethodInfo
20962
20963 2001-09-17  Ravi Pratap  <ravi@ximian.com>
20964
20965         * class.cs (TypeContainer::EmitDefaultConstructor): Register
20966         the default constructor builder with our hashtable for methodbuilders
20967         to methodcores.
20968
20969         * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
20970         and argument_count is 0 in which case we have a match.
20971         (Binary::ResolveOperator): More null checking and miscellaneous coding
20972         style cleanup.
20973
20974 2001-09-17  Ravi Pratap  <ravi@ximian.com>
20975
20976         * rootcontext.cs (IsNameSpace): Compare against null.
20977
20978         * everywhere : Correct spelling to 'Greater' and to 'Subtract'
20979
20980         * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
20981         and Unary::Operator.
20982
20983         * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
20984         accordingly.
20985
20986         * expression.cs (Binary::method): New member to hold the MethodBase for the case when
20987         we have overloaded operators.
20988         (Binary::ResolveOperator): Implement the part which does the operator overload
20989         resolution.
20990
20991         * class.cs (Operator::Emit): Implement.
20992         (TypeContainer::Emit): Emit the operators we have too.
20993
20994         * expression.cs (Binary::Emit): Update to emit the appropriate code for
20995         the case when we have a user-defined operator.
20996
20997 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
20998
20999         * rootcontext.cs: Fix bug: tree.Namespaces might be null.
21000
21001 2001-09-16  Ravi Pratap  <ravi@ximian.com>
21002
21003         * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
21004         (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
21005         (Constructor::Emit): Implement.
21006         (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
21007         if we have no work to do. 
21008         (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's 
21009         Emit method.
21010
21011         * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
21012         (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
21013
21014         * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
21015         of parent.parent.
21016
21017 2001-09-15  Ravi Pratap  <ravi@ximian.com>
21018
21019         * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
21020         in the source.
21021         (Tree::RecordNamespace): Method to do what the name says ;-)
21022         (Tree::Namespaces): Property to get at the namespaces hashtable.
21023
21024         * cs-parser.jay (namespace_declaration): Call RecordNamespace to 
21025         keep track.
21026
21027         * rootcontext.cs (IsNamespace): Fixed it :-)
21028
21029 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
21030
21031         * class.cs (TypeContainer::FindMembers): Add support for
21032         constructors. 
21033         (MethodCore): New class that encapsulates both the shared aspects
21034         of a Constructor and a Method.  
21035         (Method, Constructor): Factored pieces into MethodCore.
21036
21037         * driver.cs: Added --fatal which makes errors throw exceptions.
21038         Load System assembly as well as part of the standard library.
21039
21040         * report.cs: Allow throwing exceptions on errors for debugging.
21041
21042         * modifiers.cs: Do not use `parent', instead use the real type
21043         container to evaluate permission settings.
21044
21045         * class.cs: Put Ravi's patch back in.  He is right, and we will
21046         have to cope with the
21047
21048 2001-09-14  Ravi Pratap  <ravi@ximian.com>
21049
21050         * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
21051         FamORAssem, not FamANDAssem.
21052
21053 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
21054
21055         * driver.cs: Added --parse option that only parses its input files
21056         and terminates.
21057
21058         * class.cs: Reverted last change from Ravi to IsTopLevel.  That is
21059         incorrect.  IsTopLevel is not used to tell whether an object is
21060         root_types or not (that can be achieved by testing this ==
21061         root_types).  But to see if this is a top-level *class* (not
21062         necessarly our "toplevel" container). 
21063
21064 2001-09-14  Ravi Pratap  <ravi@ximian.com>
21065
21066         * enum.cs (Enum::Define): Modify to call the Lookup method on the
21067         parent instead of a direct call to GetType.
21068
21069 2001-09-14  Ravi Pratap  <ravi@ximian.com>
21070
21071         * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
21072         Modifiers.TypeAttr. This should just be a call to that method.
21073
21074         * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
21075         object so that we can determine if we are top-level or not.
21076
21077         * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the 
21078         TypeContainer too.
21079
21080         * enum.cs (Enum::Define): Ditto.
21081
21082         * modifiers.cs (FieldAttr): Re-write.
21083
21084         * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
21085         (TypeContainer::HaveStaticConstructor): New property to provide access
21086         to precisely that info.
21087
21088         * modifiers.cs (MethodAttr): Re-write.
21089         (EventAttr): Remove altogether as there seems to be no ostensible use for it.
21090
21091         * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
21092         of top-level types as claimed.
21093
21094 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
21095
21096         * expression.cs (MemberLookup): Fruitless attempt to lookup
21097         constructors.  Maybe I need to emit default constructors?  That
21098         might be it (currently .NET emits this for me automatically).
21099         (Invocation::OverloadResolve): Cope with Arguments == null.
21100         (Invocation::EmitArguments): new function, shared by the new
21101         constructor and us.
21102         (Invocation::Emit): Handle static and instance methods.  Emit
21103         proper call instruction for virtual or non-virtual invocations.
21104         (New::Emit): Implement.
21105         (New::Resolve): Implement.
21106         (MemberAccess:Resolve): Implement.
21107         (MethodGroupExpr::InstanceExpression): used conforming to the spec
21108         to track instances.
21109         (FieldExpr::Resolve): Set type.
21110
21111         * support.cs: Handle empty arguments.
21112                 
21113         * cs-parser.jay (CompositeLookup, QualifierIdentifier,
21114         SimpleLookup): Auxiliary routines to help parse a qualifier
21115         identifier.  
21116
21117         Update qualifier_identifier rule.
21118
21119         * codegen.cs: Removed debugging messages.
21120
21121         * class.cs: Make this a global thing, this acts just as a "key" to
21122         objects that we might have around.
21123
21124         (Populate): Only initialize method_builders_to_methods once.
21125
21126         * expression.cs (PropertyExpr): Initialize type from the
21127         PropertyType. 
21128
21129         * codegen.cs (EmitContext::EmitBoolExpression): Use propper
21130         Resolve pattern.  Attempt to implicitly convert value to boolean.
21131         Emit code.
21132
21133         * expression.cs: Set the type for the int32/int32 argument case.
21134         (Binary::ResolveOperator): Set the return type to boolean for
21135         comparission operators
21136
21137         * typemanager.cs: Remove debugging print code.
21138
21139         (Invocation::Resolve): resolve type.
21140
21141         * class.cs: Allocate a MemberInfo of the correct size, as the code
21142         elsewhere depends on the test to reflect the correct contents.
21143
21144         (Method::) Keep track of parameters, due to System.Reflection holes
21145
21146         (TypeContainer::Populate): Keep track of MethodBuilders to Method
21147         mapping here.
21148
21149         (TypeContainer::FindMembers): Use ArrayList and then copy an array
21150         of the exact size and return that.
21151
21152         (Class::LookupMethodByBuilder): New function that maps
21153         MethodBuilders to its methods.  Required to locate the information
21154         on methods because System.Reflection bit us again.
21155
21156         * support.cs: New file, contains an interface ParameterData and
21157         two implementations: ReflectionParameters and InternalParameters
21158         used to access Parameter information.  We will need to grow this
21159         as required.
21160
21161         * expression.cs (Invocation::GetParameterData): implement a cache
21162         and a wrapper around the ParameterData creation for methods. 
21163         (Invocation::OverloadResolve): Use new code.
21164
21165 2001-09-13  Ravi Pratap  <ravi@ximian.com>
21166
21167         * class.cs (TypeContainer::EmitField): Remove and move into 
21168         (Field::Define): here and modify accordingly.
21169         (Field.FieldBuilder): New member.
21170         (TypeContainer::Populate): Update accordingly.
21171         (TypeContainer::FindMembers): Implement.
21172
21173 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
21174
21175         * statement.cs: (VariableInfo::VariableType): New field to be
21176         initialized with the full type once it is resolved. 
21177
21178 2001-09-12  Miguel de Icaza  <miguel@ximian.com>
21179
21180         * parameter.cs (GetParameterInfo): Use a type cache to compute
21181         things only once, and to reuse this information
21182
21183         * expression.cs (LocalVariableReference::Emit): Implement.
21184         (OpcodeCast::Emit): fix.
21185
21186         (ParameterReference::Resolve): Implement.
21187         (ParameterReference::Emit): Implement.
21188
21189         * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
21190         that are expressions need to stay as Expressions.
21191
21192         * typemanager.cs (CSharpName): Returns the C# name of a type if
21193         possible. 
21194
21195         * expression.cs (Expression::ConvertImplicit): New function that
21196         implements implicit type conversions.
21197
21198         (Expression::ImplicitReferenceConversion): Implements implicit
21199         reference conversions.
21200
21201         (EmptyCast): New type for transparent casts.
21202
21203         (OpcodeCast): New type for casts of types that are performed with
21204         a sequence of bytecodes.
21205
21206         (BoxedCast): New type used for casting value types into reference
21207         types.  Emits a box opcode.
21208
21209         (Binary::DoNumericPromotions): Implements numeric promotions of
21210         and computation of the Binary::Type.
21211
21212         (Binary::EmitBranchable): Optimization.
21213
21214         (Binary::Emit): Implement code emission for expressions.
21215
21216         * typemanager.cs (TypeManager): Added two new core types: sbyte
21217         and byte.
21218
21219 2001-09-12  Ravi Pratap  <ravi@ximian.com>
21220
21221         * class.cs (TypeContainer::FindMembers): Method which does exactly
21222         what Type.FindMembers does, only we don't have to use reflection. No
21223         implementation yet.
21224
21225         * typemanager.cs (typecontainers): New hashtable to hold the corresponding
21226         typecontainer objects as we need to get at them.
21227         (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
21228
21229         * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
21230         typecontainer object.
21231
21232         * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
21233         of just a Report object.
21234
21235 2001-09-11  Ravi Pratap  <ravi@ximian.com>
21236
21237         * class.cs (Event::Define): Go back to using the prefixes "add_" and
21238         "remove_"
21239         (TypeContainer::Populate): Now define the delegates of the type too.
21240         (TypeContainer.Delegates): Property to access the list of delegates defined
21241         in the type.
21242
21243         * delegates.cs (Delegate::Define): Implement partially.
21244
21245         * modifiers.cs (TypeAttr): Handle more flags.
21246
21247 2001-09-11  Ravi Pratap  <ravi@ximian.com>
21248
21249         * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
21250         and not <=
21251         (Operator::Define): Re-write logic to get types by using the LookupType method
21252         instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
21253         (Indexer::Define): Ditto.
21254         (Event::Define): Ditto.
21255         (Property::Define): Ditto.
21256
21257 2001-09-10  Ravi Pratap  <ravi@ximian.com>
21258
21259         * class.cs (TypeContainer::Populate): Now define operators too. 
21260         (TypeContainer.Operators): New property to access the list of operators
21261         in a type.
21262         (Operator.OperatorMethodBuilder): New member to hold the method builder
21263         for the operator we are defining.
21264         (Operator::Define): Implement.
21265
21266 2001-09-10  Ravi Pratap  <ravi@ximian.com>
21267
21268         * class.cs (Event::Define): Make the prefixes of the accessor methods
21269         addOn_ and removeOn_ 
21270
21271         * genericparser.cs (GenericParser::error): Overloaded method to handle the case
21272         of the location being passed in too. Ideally, this should go later since all
21273         error reporting should be done through the Report object.
21274
21275         * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
21276         (Populate): Iterate thru the indexers we have and define them too.
21277         (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
21278         for the get and set accessors.
21279         (Indexer::Define): Implement.
21280
21281 2001-09-09  Miguel de Icaza  <miguel@ximian.com>
21282
21283         * expression.cs (Binary::Resolve): Beginning of it.  I scratched
21284         my previous implementation, did not work.
21285
21286         * typemanager.cs: Add a couple of missing types (the longs).
21287
21288         * literal.cs: Use TypeManager.bool_type instead of getting it.
21289
21290         * expression.cs (EventExpr): New kind of expressions.
21291         (Expressio::ExprClassFromMemberInfo): finish
21292
21293 2001-09-08  Miguel de Icaza  <miguel@ximian.com>
21294
21295         * assign.cs: Emit stores to static fields differently.
21296
21297 2001-09-08  Ravi Pratap  <ravi@ximian.com>
21298
21299         * Merge in changes and adjust code to tackle conflicts. Backed out my
21300         code in Assign::Resolve ;-) 
21301
21302 2001-09-08  Ravi Pratap  <ravi@ximian.com>
21303
21304         * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
21305         instead Report.Error and also pass in the location.
21306         (CSharpParser::Lexer): New readonly property to return the reference
21307         to the Tokenizer object.
21308         (declare_local_variables): Use Report.Error with location instead of plain 
21309         old error.
21310         (CheckDef): Ditto.
21311
21312         * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
21313         (Operator.CheckBinaryOperator): Ditto.
21314
21315         * cs-parser.jay (operator_declarator): Update accordingly.
21316
21317         * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
21318         (CheckBinaryOperator): Same here.
21319
21320         * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
21321         on the name without any prefixes of namespace names etc. This is because we
21322         already might have something already fully qualified like 
21323         'System.Console.WriteLine'
21324
21325         * assign.cs (Resolve): Begin implementation. Stuck ;-)
21326
21327 2001-09-07  Ravi Pratap  <ravi@ximian.com>
21328
21329         * cs-tokenizer.cs (location): Return a string which also contains
21330         the file name.
21331
21332         * expression.cs (ElementAccess): New class for expressions of the
21333         type 'element access.'
21334         (BaseAccess): New class for expressions of the type 'base access.'
21335         (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
21336         respectively.
21337
21338         * cs-parser.jay (element_access): Implement action.
21339         (base_access): Implement actions.
21340         (checked_expression, unchecked_expression): Implement.
21341
21342         * cs-parser.jay (local_variable_type): Correct and implement.
21343         (type_suffixes, type_suffix_list, type_suffix): Implement actions.
21344
21345         * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
21346
21347         * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
21348         name and the specifiers.
21349
21350         * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
21351
21352         * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of 
21353         making them all public ;-)
21354
21355         * cs-parser.jay (error): Remove entirely as we have an implementation in the base
21356         class anyways.
21357
21358 2001-09-07  Miguel de Icaza  <miguel@ximian.com>
21359
21360         * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
21361         PropertyExprs.
21362         (FieldExpr, PropertyExprs): New resolved expressions.
21363         (SimpleName::MemberStaticCheck): Perform static checks for access
21364         to non-static fields on static methods. Maybe this should be
21365         generalized for MemberAccesses. 
21366         (SimpleName::ResolveSimpleName): More work on simple name
21367         resolution. 
21368
21369         * cs-parser.jay (primary_expression/qualified_identifier): track
21370         the parameter index.
21371
21372         * codegen.cs (CodeGen::Save): Catch save exception, report error.
21373         (EmitContext::EmitBoolExpression): Chain to expression generation
21374         instead of temporary hack.
21375         (::EmitStatementExpression): Put generic expression code generation.
21376
21377         * assign.cs (Assign::Emit): Implement variable assignments to
21378         local variables, parameters and fields.
21379
21380 2001-09-06  Miguel de Icaza  <miguel@ximian.com>
21381
21382         * statement.cs (Block::GetVariableInfo): New method, returns the
21383         VariableInfo for a variable name in a block.
21384         (Block::GetVariableType): Implement in terms of GetVariableInfo
21385
21386         * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
21387         DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
21388
21389 2001-09-06  Ravi Pratap  <ravi@ximian.com>
21390
21391         * cs-parser.jay (operator_declaration): Continue on my quest : update
21392         to take attributes argument.
21393         (event_declaration): Ditto.
21394         (enum_declaration): Ditto.
21395         (indexer_declaration): Ditto.
21396
21397         * class.cs (Operator::Operator): Update constructor accordingly.
21398         (Event::Event): Ditto.
21399
21400         * delegate.cs (Delegate::Delegate): Same here.
21401
21402         * enum.cs (Enum::Enum): Same here.
21403
21404 2001-09-05  Ravi Pratap  <ravi@ximian.com>
21405
21406         * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
21407
21408         * ../tests/cs0658.cs : New file to demonstrate error 0658.
21409
21410         * attribute.cs (Attributes): New class to encapsulate all attributes which were
21411         being passed around as an arraylist.
21412         (Attributes::AddAttribute): Method to add attribute sections.
21413
21414         * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
21415         (struct_declaration): Update accordingly.
21416         (constant_declaration): Update.
21417         (field_declaration): Update.
21418         (method_header): Update.
21419         (fixed_parameter): Update.
21420         (parameter_array): Ditto.
21421         (property_declaration): Ditto.
21422         (destructor_declaration): Ditto.
21423
21424         * class.cs (Struct::Struct): Update constructors accordingly.
21425         (Class::Class): Ditto.
21426         (Field::Field): Ditto.
21427         (Method::Method): Ditto.
21428         (Property::Property): Ditto.
21429         (TypeContainer::OptAttribute): update property's return type.
21430
21431         * interface.cs (Interface.opt_attributes): New member.
21432         (Interface::Interface): Update to take the extra Attributes argument.
21433
21434         * parameter.cs (Parameter::Parameter): Ditto.
21435
21436         * constant.cs (Constant::Constant): Ditto.
21437
21438         * interface.cs (InterfaceMemberBase): New OptAttributes field.
21439         (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take 
21440         the attributes as a parameter.
21441         (InterfaceProperty): Update constructor call.
21442         (InterfaceEvent): Ditto.
21443         (InterfaceMethod): Ditto.
21444         (InterfaceIndexer): Ditto.
21445
21446         * cs-parser.jay (interface_indexer_declaration): Update call to constructor to 
21447         pass the attributes too.
21448         (interface_event_declaration): Ditto.
21449         (interface_property_declaration): Ditto.
21450         (interface_method_declaration): Ditto.
21451         (interface_declaration): Ditto.
21452
21453 2001-09-05  Miguel de Icaza  <miguel@ximian.com>
21454
21455         * class.cs (Method::Define): Track the "static Main" definition to
21456         create an entry point. 
21457
21458         * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
21459         EntryPoint if we find it. 
21460
21461         * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
21462         (EmitContext::ig): Make this variable public.
21463
21464         * driver.cs: Make the default output file be the first file name
21465         with the .exe extension.  
21466
21467         Detect empty compilations
21468
21469         Handle various kinds of output targets.  Handle --target and
21470         rename -t to --dumper.
21471
21472         * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
21473         methods inherited from Expression return now an Expression.  This
21474         will is used during the tree rewriting as we resolve them during
21475         semantic analysis.
21476
21477         (Expression::MemberLookup): Implements the MemberLookup (7.3) from
21478         the spec.  Missing entirely is the information about
21479         accessability of elements of it.
21480
21481         (Expression::ExprClassFromMemberInfo): New constructor for
21482         Expressions that creates a fully initialized Expression based on
21483         a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
21484         a Type.
21485
21486         (Invocation::Resolve): Begin implementing resolution of invocations.
21487
21488         * literal.cs (StringLiteral):  Implement Emit.
21489
21490 2001-09-05  Ravi Pratap  <ravi@ximian.com>
21491
21492         * cs-parser.jay (error): Add new modifier because we are hiding an inherited
21493         member.
21494
21495 2001-09-04  Ravi Pratap  <ravi@ximian.com>
21496
21497         * cs-parser.jay (attribute_arguments): Implement actions.
21498         (attribute): Fix bug in production. Implement action.
21499         (attribute_list): Implement.
21500         (attribute_target): Implement.
21501         (attribute_target_specifier, opt_target_specifier): Implement
21502         (CheckAttributeTarget): New method to check if the attribute target
21503         is valid.
21504         (attribute_section): Implement.
21505         (opt_attributes): Implement.
21506
21507         * attribute.cs : New file to handle attributes.
21508         (Attribute): Class to hold attribute info.
21509
21510         * cs-parser.jay (opt_attribute_target_specifier): Remove production
21511         (attribute_section): Modify production to use 2 different rules to 
21512         achieve the same thing. 1 s/r conflict down !
21513         Clean out commented, useless, non-reducing dimension_separator rules.
21514
21515         * class.cs (TypeContainer.attributes): New member to hold list
21516         of attributes for a type.
21517         (Struct::Struct): Modify to take one more argument, the attribute list.
21518         (Class::Class): Ditto.
21519         (Field::Field): Ditto.
21520         (Method::Method): Ditto.
21521         (Property::Property): Ditto.
21522
21523         * cs-parser.jay (struct_declaration): Update constructor call to
21524         pass in the attributes too.
21525         (class_declaration): Ditto.
21526         (constant_declaration): Ditto.
21527         (field_declaration): Ditto.
21528         (method_header): Ditto.
21529         (fixed_parameter): Ditto.
21530         (parameter_array): Ditto.
21531         (property_declaration): Ditto.
21532
21533         * constant.cs (Constant::Constant): Update constructor similarly.
21534         Use System.Collections.
21535
21536         * parameter.cs (Parameter::Parameter): Update as above.
21537
21538 2001-09-02  Ravi Pratap  <ravi@ximian.com>
21539
21540         * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
21541         (TypeContainer.delegates): New member to hold list of delegates.
21542
21543         * cs-parser.jay (delegate_declaration): Implement the action correctly 
21544         this time as I seem to be on crack ;-)
21545
21546 2001-09-02  Miguel de Icaza  <miguel@ximian.com>
21547
21548         * rootcontext.cs (RootContext::IsNamespace): new function, used to
21549         tell whether an identifier represents a namespace.
21550
21551         * expression.cs (NamespaceExpr): A namespace expression, used only
21552         temporarly during expression resolution.
21553         (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
21554         utility functions to resolve names on expressions.
21555
21556 2001-09-01  Miguel de Icaza  <miguel@ximian.com>
21557
21558         * codegen.cs: Add hook for StatementExpressions. 
21559
21560         * class.cs: Fix inverted test for static flag in methods.
21561
21562 2001-09-02  Ravi Pratap  <ravi@ximian.com>
21563
21564         * class.cs (Operator::CheckUnaryOperator): Correct error number used
21565         to make it coincide with MS' number.
21566         (Operator::CheckBinaryOperator): Ditto.
21567
21568         * ../errors/errors.txt : Remove error numbers added earlier.
21569
21570         * ../errors/cs1019.cs : Test case for error # 1019
21571
21572         * ../errros/cs1020.cs : Test case for error # 1020
21573
21574         * cs-parser.jay : Clean out commented cruft.
21575         (dimension_separators, dimension_separator): Comment out. Ostensibly not
21576         used anywhere - non-reducing rule.
21577         (namespace_declarations): Non-reducing rule - comment out.
21578
21579         * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
21580         with TypeContainer::AddEnum.
21581
21582         * delegate.cs : New file for delegate handling classes.
21583         (Delegate): Class for declaring delegates.
21584
21585         * makefile : Update.
21586
21587         * cs-parser.jay (delegate_declaration): Implement.
21588
21589 2001-09-01  Ravi Pratap  <ravi@che.iitm.ac.in>
21590
21591         * class.cs (Event::Define): Implement.
21592         (Event.EventBuilder): New member.
21593
21594         * class.cs (TypeContainer::Populate): Update to define all enums and events
21595         we have.
21596         (Events): New property for the events arraylist we hold. Shouldn't we move to using
21597         readonly fields for all these cases ?
21598
21599 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
21600
21601         * class.cs (Property): Revamp to use the convention of making fields readonly.
21602         Accordingly modify code elsewhere.
21603
21604         * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
21605         the Define method of the Property class.
21606
21607         * class.cs : Clean up applied patch and update references to variables etc. Fix 
21608         trivial bug.
21609         (TypeContainer::Populate): Update to define all the properties we have. Also
21610         define all enumerations.
21611
21612         * enum.cs (Define): Implement.
21613
21614 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
21615
21616         * cs-parser.jay (overloadable_operator): The semantic value is an
21617         enum of the Operator class.
21618         (operator_declarator): Implement actions.
21619         (operator_declaration): Implement.
21620
21621         * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
21622         validity of definitions.
21623         (Operator::CheckBinaryOperator): Static method to check for binary operators
21624         (TypeContainer::AddOperator): New method to add an operator to a type.
21625
21626         * cs-parser.jay (indexer_declaration): Added line to actually call the
21627         AddIndexer method so it gets added ;-)
21628
21629         * ../errors/errors.txt : Update to include new error numbers. Are these numbers 
21630         already taken care of by the MS compiler ?  
21631
21632 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
21633
21634         * class.cs (Operator): New class for operator declarations.
21635         (Operator::OpType): Enum for the various operators.
21636
21637 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
21638
21639         * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
21640         ostensibly handle this in semantic analysis.
21641
21642         * cs-parser.jay (general_catch_clause): Comment out
21643         (specific_catch_clauses, specific_catch_clause): Ditto.
21644         (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
21645         (catch_args, opt_catch_args): New productions.
21646         (catch_clause): Rewrite to use the new productions above
21647         (catch_clauses): Modify accordingly.
21648         (opt_catch_clauses): New production to use in try_statement
21649         (try_statement): Revamp. Basically, we get rid of one unnecessary rule
21650         and re-write the code in the actions to extract the specific and
21651         general catch clauses by being a little smart ;-)
21652
21653         * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
21654         Hooray, try and catch statements parse fine !
21655
21656 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
21657
21658         * statement.cs (Block::GetVariableType): Fix logic to extract the type
21659         string from the hashtable of variables.
21660
21661         * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
21662         I end up making that mistake ;-)
21663         (catch_clauses): Fixed gross error which made Key and Value of the 
21664         DictionaryEntry the same : $1 !!
21665
21666 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
21667
21668         * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
21669
21670         * cs-parser.jay (event_declaration): Correct to remove the semicolon
21671         when the add and remove accessors are specified. 
21672
21673 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
21674
21675         * cs-parser.jay (IndexerDeclaration): New helper class to hold
21676         information about indexer_declarator.
21677         (indexer_declarator): Implement actions.
21678         (parsing_indexer): New local boolean used to keep track of whether
21679         we are parsing indexers or properties. This is necessary because 
21680         implicit_parameters come into picture even for the get accessor in the 
21681         case of an indexer.
21682         (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
21683
21684         * class.cs (Indexer): New class for indexer declarations.
21685         (TypeContainer::AddIndexer): New method to add an indexer to a type.
21686         (TypeContainer::indexers): New member to hold list of indexers for the
21687         type.
21688
21689 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
21690
21691         * cs-parser.jay (add_accessor_declaration): Implement action.
21692         (remove_accessor_declaration): Implement action.
21693         (event_accessors_declaration): Implement
21694         (variable_declarators): swap statements for first rule - trivial.
21695
21696         * class.cs (Event): New class to hold information about event
21697         declarations.
21698         (TypeContainer::AddEvent): New method to add an event to a type
21699         (TypeContainer::events): New member to hold list of events.
21700
21701         * cs-parser.jay (event_declaration): Implement actions.
21702
21703 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
21704
21705         * cs-parser.jay (dim_separators): Implement. Make it a string
21706         concatenating all the commas together, just as they appear.
21707         (opt_dim_separators): Modify accordingly
21708         (rank_specifiers): Update accordingly. Basically do the same
21709         thing - instead, collect the brackets here.
21710         (opt_rank_sepcifiers): Modify accordingly.
21711         (array_type): Modify to actually return the complete type string
21712         instead of ignoring the rank_specifiers.
21713         (expression_list): Implement to collect the expressions
21714         (variable_initializer): Implement. We make it a list of expressions
21715         essentially so that we can handle the array_initializer case neatly too.
21716         (variable_initializer_list): Implement.
21717         (array_initializer): Make it a list of variable_initializers
21718         (opt_array_initializer): Modify accordingly.
21719
21720         * expression.cs (New::NType): Add enumeration to help us
21721         keep track of whether we have an object/delegate creation
21722         or an array creation.
21723         (New:NewType, New::Rank, New::Indices, New::Initializers): New
21724         members to hold data about array creation.
21725         (New:New): Modify to update NewType
21726         (New:New): New Overloaded contructor for the array creation
21727         case.
21728
21729         * cs-parser.jay (array_creation_expression): Implement to call
21730         the overloaded New constructor.
21731
21732 2001-08-26  Ravi Pratap  <ravi@che.iitm.ac.in>
21733
21734         * class.cs (TypeContainer::Constructors): Return member
21735         constructors instead of returning null.
21736
21737 2001-08-26  Miguel de Icaza  <miguel@ximian.com>
21738
21739         * typemanager.cs (InitCoreTypes): Initialize the various core
21740         types after we have populated the type manager with the user
21741         defined types (this distinction will be important later while
21742         compiling corlib.dll)
21743
21744         * expression.cs, literal.cs, assign.cs, constant.cs: Started work
21745         on Expression Classification.  Now all expressions have a method
21746         `Resolve' and a method `Emit'.
21747
21748         * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
21749         generation from working.     Also add some temporary debugging
21750         code. 
21751
21752 2001-08-24  Miguel de Icaza  <miguel@ximian.com>
21753
21754         * codegen.cs: Lots of code generation pieces.  This is only the
21755         beginning, will continue tomorrow with more touches of polish.  We
21756         handle the fundamentals of if, while, do, for, return.  Others are
21757         trickier and I need to start working on invocations soon.
21758
21759         * gen-treedump.cs: Bug fix, use s.Increment here instead of
21760         s.InitStatement. 
21761
21762         * codegen.cs (EmitContext): New struct, used during code
21763         emission to keep a context.   Most of the code generation will be
21764         here. 
21765
21766         * cs-parser.jay: Add embedded blocks to the list of statements of
21767         this block.  So code generation proceeds in a top down fashion.
21768
21769 2001-08-23  Miguel de Icaza  <miguel@ximian.com>
21770
21771         * statement.cs: Add support for multiple child blocks.
21772
21773 2001-08-22  Miguel de Icaza  <miguel@ximian.com>
21774
21775         * codegen.cs (EmitCode): New function, will emit the code for a
21776         Block of code given a TypeContainer and its ILGenerator. 
21777
21778         * statement.cs (Block): Standard public readonly optimization.
21779         (Block::Block constructors): Link children. 
21780         (Block::Child): Child Linker.
21781         (Block::EmitVariables): Emits IL variable declarations.
21782
21783         * class.cs: Drop support for MethodGroups here, delay until
21784         Semantic Analysis.
21785         (Method::): Applied the same simplification that I did before, and
21786         move from Properties to public readonly fields.
21787         (Method::ParameterTypes): Returns the parameter types for the
21788         function, and implements a cache that will be useful later when I
21789         do error checking and the semantic analysis on the methods is
21790         performed.
21791         (Constructor::GetCallingConvention): Renamed from CallingConvetion
21792         and made a method, optional argument tells whether this is a class
21793         or a structure to apply the `has-this' bit.
21794         (Method::GetCallingConvention): Implement, returns the calling
21795         convention. 
21796         (Method::Define): Defines the type, a second pass is performed
21797         later to populate the methods.
21798
21799         (Constructor::ParameterTypes): implement a cache similar to the
21800         one on Method::ParameterTypes, useful later when we do semantic
21801         analysis. 
21802
21803         (TypeContainer::EmitMethod):  New method.  Emits methods.
21804
21805         * expression.cs: Removed MethodGroup class from here.
21806
21807         * parameter.cs (Parameters::GetCallingConvention): new method.
21808
21809 2001-08-21  Miguel de Icaza  <miguel@ximian.com>
21810
21811         * class.cs (TypeContainer::Populate): Drop RootContext from the
21812         argument. 
21813
21814         (Constructor::CallingConvention): Returns the calling convention.
21815         (Constructor::ParameterTypes): Returns the constructor parameter
21816         types. 
21817
21818         (TypeContainer::AddConstructor): Keep track of default constructor
21819         and the default static constructor.
21820
21821         (Constructor::) Another class that starts using `public readonly'
21822         instead of properties. 
21823
21824         (Constructor::IsDefault): Whether this is a default constructor. 
21825
21826         (Field::) use readonly public fields instead of properties also.
21827
21828         (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
21829         track of static constructors;  If none is used, turn on
21830         BeforeFieldInit in the TypeAttributes. 
21831
21832         * cs-parser.jay (opt_argument_list): now the return can be null
21833         for the cases where there are no arguments. 
21834
21835         (constructor_declarator): If there is no implicit `base' or
21836         `this', then invoke the default parent constructor. 
21837
21838         * modifiers.cs (MethodAttr): New static function maps a set of
21839         modifiers flags into a MethodAttributes enum
21840         (FieldAttr): renamed from `Map'.  So now we have FieldAttr,
21841         MethodAttr, TypeAttr to represent the various mappings where the
21842         modifiers are used.
21843         (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'  
21844
21845 2001-08-19  Miguel de Icaza  <miguel@ximian.com>
21846
21847         * parameter.cs (GetParameterInfo): Fix bug where there would be no
21848         method arguments.
21849
21850         * interface.cs (PopulateIndexer): Implemented the code generator
21851         for interface indexers.
21852
21853 2001-08-17  Miguel de Icaza  <miguel@ximian.com>
21854
21855         * interface.cs (InterfaceMemberBase): Now we track the new status
21856         here.  
21857
21858         (PopulateProperty): Implement property population.  Woohoo!  Got
21859         Methods and Properties going today. 
21860
21861         Removed all the properties for interfaces, and replaced them with
21862         `public readonly' fields. 
21863
21864 2001-08-16  Miguel de Icaza  <miguel@ximian.com>
21865
21866         * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
21867         initialize their hashtables/arraylists only when they are needed
21868         instead of doing this always.
21869
21870         * parameter.cs: Handle refs and out parameters.
21871
21872         * cs-parser.jay: Use an ArrayList to construct the arguments
21873         instead of the ParameterCollection, and then cast that to a
21874         Parameter[] array.
21875
21876         * parameter.cs: Drop the use of ParameterCollection and use
21877         instead arrays of Parameters.
21878
21879         (GetParameterInfo): Use the Type, not the Name when resolving
21880         types. 
21881
21882 2001-08-13  Miguel de Icaza  <miguel@ximian.com>
21883
21884         * parameter.cs: Eliminate the properties Name, Type and ModFlags,
21885         and instead use public readonly fields.
21886
21887         * class.cs: Put back walking code for type containers.
21888
21889 2001-08-11  Miguel de Icaza  <miguel@ximian.com>
21890
21891         * class.cs (MakeConstant): Code to define constants.
21892
21893         * rootcontext.cs (LookupType): New function.  Used to locate types 
21894
21895
21896 2001-08-08  Miguel de Icaza  <miguel@ximian.com>
21897
21898         * rootcontext.cs: OH MY!  My trick works!   It is amazing how nice
21899         this System.Reflection code is.  Kudos to Microsoft
21900
21901         * typemanager.cs: Implement a type cache and avoid loading all
21902         types at boot time.  Wrap in LookupType the internals.  This made
21903         the compiler so much faster.  Wow.  I rule!
21904
21905         * driver.cs: Make sure we always load mscorlib first (for
21906         debugging purposes, nothing really important).
21907
21908         * Renamespaced things that were on `CSC' to `CIR'.  Maybe I should
21909         have moved to `CSC' rather than `CIR'.  Oh man!  The confussion!  
21910
21911         * rootcontext.cs: Lookup types on their namespace;  Lookup types
21912         on namespaces that have been imported using the `using' keyword.
21913
21914         * class.cs (TypeContainer::TypeAttr): Virtualize.
21915         (Class::TypeAttr): Return attributes suitable for this bad boy.
21916         (Struct::TypeAttr): ditto.
21917         Handle nested classes.
21918         (TypeContainer::) Remove all the type visiting code, it is now
21919         replaced with the rootcontext.cs code
21920
21921         * rootcontext.cs (GetClassBases): Added support for structs. 
21922
21923 2001-08-06  Miguel de Icaza  <miguel@ximian.com>
21924
21925         * interface.cs, statement.cs, class.cs, parameter.cs,
21926         rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
21927         Drop use of TypeRefs, and use strings instead.
21928
21929 2001-08-04  Miguel de Icaza  <miguel@ximian.com>
21930
21931         * rootcontext.cs: 
21932
21933         * class.cs (Struct::Struct): set the SEALED flags after
21934         checking the modifiers.
21935         (TypeContainer::TypeAttr): new property, returns the
21936         TypeAttributes for a class.  
21937
21938         * cs-parser.jay (type_list): Oops, list production was creating a
21939         new list of base types.
21940
21941         * rootcontext.cs (StdLib): New property.
21942         (GetInterfaceTypeByName): returns an interface by type name, and
21943         encapsulates error handling here.
21944         (GetInterfaces): simplified.
21945         (ResolveTree): Encapsulated all the tree resolution here.
21946         (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
21947         types. 
21948
21949         * driver.cs: Add support for --nostdlib, to avoid loading the
21950         default assemblies.
21951         (Main): Do not put tree resolution here. 
21952
21953         * rootcontext.cs: Beginning of the class resolution.
21954
21955 2001-08-03  Miguel de Icaza  <miguel@ximian.com>
21956
21957         * rootcontext.cs: Provide better error reporting. 
21958
21959         * cs-parser.jay (interface_base): set our $$ to be interfaces.
21960
21961         * rootcontext.cs (CreateInterface): Handle the case where there
21962         are no parent interfaces.
21963
21964         (CloseTypes): Routine to flush types at the end.
21965         (CreateInterface): Track types.
21966         (GetInterfaces): Returns an array of Types from the list of
21967         defined interfaces.
21968
21969         * typemanager.c (AddUserType): Mechanism to track user types (puts
21970         the type on the global type hash, and allows us to close it at the
21971         end). 
21972
21973 2001-08-02  Miguel de Icaza  <miguel@ximian.com>
21974
21975         * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
21976         RecordInterface instead.
21977
21978         * cs-parser.jay: Updated to reflect changes above.
21979
21980         * decl.cs (Definition): Keep track of the TypeBuilder type that
21981         represents this type here.  Not sure we will use it in the long
21982         run, but wont hurt for now.
21983
21984         * driver.cs: Smaller changes to accomodate the new code.
21985
21986         Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
21987         when done. 
21988
21989         * rootcontext.cs (CreateInterface):  New method, used to create
21990         the System.TypeBuilder type for interfaces.
21991         (ResolveInterfaces): new entry point to resolve the interface
21992         hierarchy. 
21993         (CodeGen): Property, used to keep track of the code generator.
21994
21995 2001-07-26  Miguel de Icaza  <miguel@ximian.com>
21996
21997         * cs-parser.jay: Add a second production for delegate_declaration
21998         with `VOID'.
21999
22000         (enum_body): Put an opt_comma here instead of putting it on
22001         enum_body or enum_member_declarations so we can handle trailing
22002         commas on enumeration members.  Gets rid of a shift/reduce.
22003
22004         (type_list): Need a COMMA in the middle.
22005
22006         (indexer_declaration): Tell tokenizer to recognize get/set
22007
22008         * Remove old targets.
22009
22010         * Re-add the parser target.
22011
22012 2001-07-13  Simon Cozens <simon@simon-cozens.org>
22013
22014         * cs-parser.jay: Add precendence rules for a number of operators
22015         ot reduce the number of shift/reduce conflicts in the grammar.
22016
22017 2001-07-17  Miguel de Icaza  <miguel@ximian.com>
22018
22019         * tree.cs: moved IGenerator interface and renamed it to ITreeDump
22020         and put it here.
22021
22022         Get rid of old crufty code.
22023
22024         * rootcontext.cs: Use this to keep track of the parsed
22025         representation and the defined types available to the program. 
22026
22027         * gen-treedump.cs: adjust for new convention.
22028
22029         * type.cs: Split out the type manager, and the assembly builder
22030         from here. 
22031
22032         * typemanager.cs: the type manager will live here now.
22033
22034         * cil-codegen.cs: And the code generator here. 
22035
22036 2001-07-14  Sean MacIsaac  <macisaac@ximian.com>
22037
22038         * makefile: Fixed up for easy making.
22039
22040 2001-07-13  Simon Cozens <simon@simon-cozens.org>
22041
22042         * cs-parser.jay (rank_specifier): Remove a conflict by reordering
22043         the 
22044
22045         (unary_expression): Expand pre_increment_expression and
22046         post_decrement_expression to reduce a shift/reduce.
22047
22048 2001-07-11  Simon Cozens
22049
22050         * cs-tokenizer.cs: Hex numbers should begin with a 0.
22051
22052         Improve allow_keyword_as_indent name.
22053
22054 2001-06-19  Miguel de Icaza  <miguel@ximian.com>
22055
22056         * Adjustments for Beta2. 
22057
22058 2001-06-13  Miguel de Icaza  <miguel@ximian.com>
22059
22060         * decl.cs: Added `Define' abstract method.
22061         (InTransit): new property, used to catch recursive definitions. 
22062
22063         * interface.cs: Implement `Define'. 
22064
22065         * modifiers.cs: Map Modifiers.constants to
22066         System.Reflection.TypeAttribute flags.
22067
22068         * class.cs: Keep track of types and user-defined types.
22069         (BuilderInit): New method for creating an assembly
22070         (ResolveType): New function to launch the resolution process, only
22071         used by interfaces for now.
22072
22073         * cs-parser.jay: Keep track of Classes, Structs and Interfaces
22074         that are inserted into the name space. 
22075
22076 2001-06-08  Miguel de Icaza  <miguel@ximian.com>
22077
22078         * ARGH.  I have screwed up my tree so many times due to the use of
22079         rsync rather than using CVS.  Going to fix this at once. 
22080
22081         * driver.cs: Objetify driver.  Load assemblies, use assemblies to
22082         load types.
22083
22084 2001-06-07  Miguel de Icaza  <miguel@ximian.com>
22085
22086         * Experiment successful: Use System.Type rather that our own
22087         version of Type.  
22088
22089 2001-05-25  Miguel de Icaza  <miguel@ximian.com>
22090
22091         * cs-parser.jay: Removed nsAliases from here.
22092
22093         Use new namespaces, handle `using XXX;' 
22094
22095         * namespace.cs: Reimplemented namespace handling, use a recursive
22096         definition of the class.  Now we can keep track of using clauses
22097         and catch invalid using clauses.
22098
22099 2001-05-24  Miguel de Icaza  <miguel@ximian.com>
22100
22101         * gen-treedump.cs: Adapted for all the renaming.
22102
22103         * expression.cs (Expression): this class now has a Type property
22104         which returns an expression Type.
22105
22106         (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
22107         `Type', as this has a different meaning now in the base
22108
22109 2001-05-22  Miguel de Icaza  <miguel@ximian.com>
22110
22111         * interface.cs, class.cs: Removed from all the sources the
22112         references to signature computation, as we can not do method
22113         signature computation during the parsing time, as we are not
22114         trying to solve at that point distinguishing:
22115
22116         class X {
22117                 void a (Blah x) {}
22118                 void a (NS.Blah x) {}
22119         }
22120
22121         Which depending on the context might be valid or not, as we do not
22122         know if Blah is the same thing as NS.Blah at that point.
22123
22124         * Redid everything so the code uses TypeRefs now instead of
22125         Types.  TypeRefs are just temporary type placeholders, that need
22126         to be resolved.  They initially have a pointer to a string and the
22127         current scope in which they are used.  This is used later by the
22128         compiler to resolve the reference to an actual Type. 
22129
22130         * DeclSpace is no longer a CIR.Type, and neither are
22131         TypeContainers (Class and Struct) nor Interfaces nor Enums.  They
22132         are all DeclSpaces, but no Types. 
22133
22134         * type.cs (TypeRefManager): This implements the TypeRef manager,
22135         which keeps track of all the types that need to be resolved after
22136         the parsing has finished. 
22137
22138 2001-05-13  Miguel de Icaza  <miguel@ximian.com>
22139
22140         * ARGH.  We are going to have to store `foreach' as a class rather
22141         than resolving it, as we need to verify error 1579 after name
22142         resolution.   *OR* we could keep a flag that says `This request to
22143         IEnumerator comes from a foreach statement' which we can then use
22144         to generate the error.
22145
22146 2001-05-10  Miguel de Icaza  <miguel@ximian.com>
22147
22148         * class.cs (TypeContainer.AddMethod): we now add methods to the
22149         MethodGroup instead of the method hashtable.  
22150
22151         * expression.cs: Add MethodGroup abstraction, which gets us one
22152         step closer to the specification in the way we handle method
22153         declarations.  
22154
22155         * cs-parser.jay (primary_expression): qualified_identifier now
22156         tried to match up an identifier to a local variable reference or
22157         to a parameter reference.
22158
22159         current_local_parameters is now a parser global variable that
22160         points to the current parameters for the block, used during name
22161         lookup.
22162
22163         (property_declaration): Now creates an implicit `value' argument to
22164         the set accessor.
22165
22166 2001-05-09  Miguel de Icaza  <miguel@ximian.com>
22167
22168         * parameter.cs: Do not use `param' arguments as part of the
22169         signature, per the spec.
22170
22171 2001-05-08  Miguel de Icaza  <miguel@ximian.com>
22172
22173         * decl.cs: Base class for classes, structs and interfaces.  This
22174         is the "Declaration Space" 
22175
22176         * cs-parser.jay: Use CheckDef for checking declaration errors
22177         instead of having one on each function.
22178
22179         * class.cs: Factor out some code for handling error handling in
22180         accordance to the "Declarations" section in the "Basic Concepts"
22181         chapter in the ECMA C# spec.
22182
22183         * interface.cs: Make all interface member classes derive from
22184         InterfaceMemberBase.
22185
22186 2001-05-07  Miguel de Icaza  <miguel@ximian.com>
22187
22188         * Many things: all interfaces are parsed and generated in
22189         gen-treedump.  Support for member variables, constructors,
22190         destructors, properties, constants is there.
22191
22192         Beginning of the IL backend, but very little done, just there for
22193         testing purposes. 
22194
22195 2001-04-29  Miguel de Icaza  <miguel@ximian.com>
22196
22197         * cs-parser.jay: Fix labeled statement.
22198
22199         * cs-tokenizer.cs (escape): Escape " and ' always.
22200         ref_line, ref_name: keep track of the line/filename as instructed
22201         by #line by the compiler.
22202         Parse #line.
22203
22204 2001-04-27  Miguel de Icaza  <miguel@ximian.com>
22205
22206         * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
22207         to match the values in System.CodeDOM.
22208
22209         Divid renamed to Divide.
22210
22211         * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
22212         statements. 
22213         (Statements.set): remove.
22214
22215         * System.CodeDOM/CodeCatchClause.cs: always have a valid
22216         statements. 
22217
22218         * System.CodeDOM/CodeIfStatement.cs: trueStatements and
22219         falseStatements always have valid values. 
22220
22221         * cs-parser.jay: Use System.CodeDOM now.
22222