2005-06-15 Martin Baulig <martin@ximian.com>
[mono.git] / mcs / gmcs / ChangeLog
1 2005-06-15  Martin Baulig  <martin@ximian.com>
2
3         * attribute.cs (Attribute.CheckSecurityActionValidity): Remove the
4         obsolete `SecurityAction' values.
5
6 2005-06-06  Marek Safar  <marek.safar@seznam.cz>
7
8         * rootcontext.cs: Reset TargetExt as well.
9         
10 2005-06-09  Martin Baulig  <martin@ximian.com>
11
12         * delegate.cs (Delegate.VerifyMethod): Added
13         `MethodGroupExpr old_mg' argument; inherit its
14         `HasTypeParameters'; fix #75085.
15
16 2005-06-09  Martin Baulig  <martin@ximian.com>
17
18         * expression.cs (Invocation.OverloadResolve): Correctly handle
19         generic methods for the SetMemberIsUsed(); fix #75064.
20
21 2005-06-09  Martin Baulig  <martin@ximian.com>
22
23         * statement.cs (Throw.Resolve): Use TypeManager.IsSubclassOf();
24         fixes #75062.
25
26 2005-06-08  Martin Baulig  <martin@ximian.com>
27
28         * cs-parser.jay (nullable_type_or_conditional): If we put the
29         nullable back and our `type' is a `ComposedCast', remove the
30         nullable from it.  Fixes #75156.
31
32         * expression.cs (ComposedCast.RemoveNullable): New public method.
33
34 2005-06-08  Martin Baulig  <martin@ximian.com>
35
36         The big Iterators rewrite :-)
37
38         * iterators.cs: Rewrite this to use the anonymous methods framework.
39
40         * rootcontext.cs (RootContext.DefineTypes): Define Delegates
41         before the TypeContainers; see 2test-21.cs.
42
43         * class.cs
44         (TypeContainer.DefineType): Don't create a new EmitContext if we
45         already have one (this only happens if we're an Iterator).
46         (TypeContainer.Define): Also call Define() on all our iterators.
47         (Method.CreateEmitContext): Added support for iterators.
48
49         * anonymous.cs
50         (AnonymousContainer): New abstract base class for `AnonymousMethod'.
51         (AnonymousContainer.CreateMethodHost): Moved here from
52         AnonymousMethod and made abstract.
53         (AnonymousContainer.CreateScopeType): New abstract method.
54         (AnonymousContainer.IsIterator): New public property.
55         (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
56         get the ScopeTypeBuilder rather than manually defining it here. 
57         (ScopeInfo.EmitScopeInstance): New public method; correctly handle
58         iterators here.
59
60         * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
61         before RootContext.DefineTypes().
62
63         * codegen.cs (EmitContext.RemapToProxy): Removed.
64         (EmitContext.CurrentAnonymousMethod): Changed type from
65         AnonymousMethod -> AnonymousContainer.
66         (EmitContext.ResolveTopBlock): Protect from being called twice.
67         (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
68         (EmitContext.EmitThis): Removed the iterators hacks; use the
69         anonymous methods framework for that.
70
71         * statement.cs
72         (ToplevelBlock.Container): Make this a property, not a field.
73         (ToplevelBlock.ReParent): New public method; move the
74         ToplevelBlock into a new container.
75         (Foreach.TemporaryVariable): Simplify.
76
77 2005-06-05  Martin Baulig  <martin@ximian.com>
78
79         * statement.cs (LocalInfo.CompilerGenerated): New flag.
80         (Block.AddTemporaryVariable): New public method; creates a new
81         `LocalInfo' for a temporary variable.
82         (Block.EmitMeta): Create the LocalBuilders for all the temporary
83         variables here.
84         (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
85         non-iterator variables.
86
87 2005-06-05  Martin Baulig  <martin@ximian.com>
88
89         * statement.cs (Foreach.TemporaryVariable): Create the
90         LocalBuilder in the Emit phase and not in Resolve since in some
91         situations, we don't have an ILGenerator during Resolve; see
92         2test-19.cs for an example.
93
94 2005-06-04  Martin Baulig  <martin@ximian.com>
95
96         The big Foreach rewrite - Part II.
97
98         * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
99         with `PropertyInfo ienumerator_getcurrent'.
100
101         * codegen.cs (VariableStorage): Removed.
102
103         * statement.cs
104         (Foreach): Derive from Statement, not ExceptionStatement.
105         (Foreach.CollectionForeach): New nested class.  Moved all the code
106         dealing with collection foreach here.
107         (Foreach.ForeachHelperMethods): Removed.
108         (Foreach.TemporaryVariable): Implement IMemoryLocation.
109
110 2005-05-23  Martin Baulig  <martin@ximian.com>
111
112         * statement.cs (Try.DoResolve): Don't create a `finally' if we
113         don't need to.  Fix #75014.
114
115 2005-05-20  Miguel de Icaza  <miguel@novell.com>
116
117         * typemanager.cs: Do not throw an exception in the TypeBuilder
118         case, we take care of it on the TypeCode.
119
120 2005-05-17  Marek Safar  <marek.safar@seznam.cz>
121         
122         * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
123         is back.
124         
125         * cs-parser.jay: Catch more lexical errors.
126         
127         * report.cs: Add one more Error method.
128         
129         * rootcontext.cs,
130         * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
131
132 2005-05-20  Martin Baulig  <martin@ximian.com>
133
134         * class.cs (TypeContainer.CircularDepException): Removed.
135         (TypeContainer.DefineType): Removed the `InTransit' stuff.
136         (TypeContainer.CheckRecursiveDefinition): Check for circular class
137         (CS0146) and interface (CS0529) dependencies here.
138
139 2005-05-20  Martin Baulig  <martin@ximian.com>
140
141         * expression.cs (New.DoResolve): Move the CS0712 check above the
142         CS0144 check; otherwise it can never be reached.
143
144 2005-05-20  Martin Baulig  <martin@ximian.com>
145
146         * cs-parser.jay: Fix CS0080 check; add CS0231 and CS0257 from MCS.
147
148 2005-05-20  Martin Baulig  <martin@ximian.com>
149
150         * class.cs (TypeContainer.DefineType): Fix CS0698 check.
151
152         * typemanager.cs (TypeManager.IsAttributeType): New public method.
153
154 2005-05-19  Martin Baulig  <martin@ximian.com>
155
156         * delegate.cs
157         (ImplicitDelegateCreation.Check): Added `bool check_only' argument
158         to disable error reporting.
159
160         * convert.cs (Convert.ImplicitStandardConversionExists): Use it
161         here since we don't want to report an error; see the new test-336.cs.
162
163 2005-05-19  Raja R Harinath  <rharinath@novell.com>
164
165         * statement.cs (ToplevelBlock.GetParameterReference)
166         (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
167         Move here from class Block.
168         * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
169         * expression.cs (ParameterReference.DoResolveBase): Likewise.
170
171 2005-05-18  Martin Baulig  <martin@ximian.com>
172
173         Fix #74978.
174
175         * flowanalysis.cs
176         (FlowBranching.Reachability): Add non-static public And() and Or()
177         methods.
178         (FlowBranchingSwitch): New class; do the `break_origins' thing
179         like in FlowBranchingLoop.
180         (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
181         reachability, not just locals and parameters.
182         (FlowBranching.MergeChild): Remove some of the hacks for loop and
183         switch; MergeBreakOrigins() now takes care of that.
184
185 2005-05-18  Martin Baulig  <martin@ximian.com>
186
187         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
188         a loop and may leave it, reset the barrier; fixes #74974.
189
190 2005-05-16  Raja R Harinath  <rharinath@novell.com>
191
192         Fix test-382.cs.  Emit values of decimal constants.
193         * class.cs (TypeContainer.RegisterFieldForInitialization): New.
194         Carved out of ...
195         (TypeContainer.AddField): ... this.
196         (TypeContainer.EmitFieldInitializers): Allow the list of fields
197         with initializers to include 'Const's.
198         (ClassPart.RegisterFieldForInitialization): Forward to
199         PartialContainer.
200         * const.cs (Const.Const): Pass initializer to base class.
201         (Const.Define): In case of decimal constants, register them for
202         initialization in a static constructor.
203
204 2005-05-14  Martin Baulig  <martin@ximian.com>
205
206         * statement.cs (Block.Resolve): Correctly handle unreachable code;
207         do not call ResolveUnreachable() on unreachable statements in
208         here, see the comment in the source code.
209
210 2005-05-13  Raja R Harinath  <rharinath@novell.com>
211
212         Fix #74934.
213         * expression.cs (BinaryResolveOperator): If one of the operands of
214         an equality comparison is 'null' and the other is a pointer type,
215         convert the null to a NullPointer.
216         * convert.cs (ImplicitReferenceConversion): If the expression is a
217         NullLiteral and the target type is a pointer type, return a
218         NullPointer instead.
219         (ImplicitConversionStandard): Likewise.
220
221 2005-05-13  Marek Safar  <marek.safar@seznam.cz>
222         
223         * cs-parser.jay: Set readonly context based on special constructs.
224         
225         * expression.cs (LocalVariableReference.DoResolveBase): Improved
226         readonly variable error handling.
227         
228         * rootcontext.cs (EmitCode): Don't verify members when error
229         occurred.
230         
231         * statement.cs (LocalInfo): Add reaodnly context information.
232         (SetReadOnlyContext, GetReadOnlyContext): New methods.
233
234 2005-05-17  Martin Baulig  <martin@ximian.com>
235
236         * expression.cs (Argument.Resolve): Turn on flow analysis; fix
237         #70970. 
238
239 2005-05-13  Martin Baulig  <martin@ximian.com>
240
241         * statement.cs (Block.Resolve, ResolveUnreachable): Correctly
242         handle unreachable blocks.
243
244 2005-05-13  Martin Baulig  <martin@ximian.com>
245
246         * class.cs
247         (ConstructorInitializer.GetOverloadedConstructor): Don't crash.
248         (MethodCore.CheckCore): Use TypeManager.IsEqual(); fix #74904 and
249         #74905. 
250
251 2005-05-13  Martin Baulig  <martin@ximian.com>
252
253         * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
254         instance variable, not a local.  Fix #74873.
255         (Block.ResolveUnreachable): Set it to true here.
256
257 2005-05-12  Martin Baulig  <martin@ximian.com>
258
259         * cs-parser.jay (property_declaration): Pass the `current_class',
260         not the `current_container' to Property's .ctor.  Fixes #74912.
261
262 2005-05-11  Martin Baulig  <martin@ximian.com>
263
264         * typemanager.cs (Closure): Copy this from MCS and merge all the
265         GMCS-specific changes into it.
266
267 2005-05-12  Raja R Harinath  <harinath@gmail.com>
268
269         Fix #74920.
270         * typemanager.cs (unmanaged_enclosing_types): New.
271         (IsUnmanagedType): Avoid infloops by using
272         'unmanaged_enclosing_types' to talk with recursive invocations.
273
274 2005-05-11  Duncan Mak  <duncan@novell.com>
275
276         * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
277         continuing to process for 'arg'.
278         (handle_preprocessing_directive): Check the argument of the #endif
279         directive and report error CS1025 if there are any trailing
280         characters.
281
282         According to the C# spec, having even whitespace after the #endif
283         directive is illegal; however, because we call arg.TrimEnd ()
284         beforehand, we have the same behavior as csc, allowing whitespace
285         after the directive.
286
287         Fixes #74892.
288
289 2005-05-11  Marek Safar  <marek.safar@seznam.cz>
290
291         Fix #74863.
292         
293         * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
294         (Constructor.GetObsoleteAttribute): Implemented correctly.
295
296 2005-05-10  Martin Baulig  <martin@ximian.com>
297
298         * generic.cs (Constraints.Resolve): Report CS0246 if we cannot
299         resolve the type; fixes #74864.
300         (DefaultValueExpression): Create the LocalTemporary in Emit(), not
301         in DoResolve(); fixes #74862.
302
303 2005-05-10  Martin Baulig  <martin@ximian.com>
304
305         * support.cs (ReflectionParameters.ParameterModifier): Use
306         `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
307         and `ParameterAttributes.In'.  Fixes #74884.
308
309 2005-05-10  Martin Baulig  <martin@ximian.com>
310
311         * typemanager.cs (TypeManager.MemberLookup_FindMembers): Don't use
312         the cache if we're just looking for `MemberTypes.NestedType' in a
313         generic instance.
314
315         * ecore.cs (Expression.ResolveAsTypeTerminal): Don't check the
316         constraints if we're still resolving the type tree.
317         (Expression.MemberLookup): If we're resolving the type tree, only
318         look for `MemberTypes.NestedType' since we're only interested in
319         getting types.
320
321         * class.cs (TypeContainer.DefineType): Don't resolve the type
322         parameters here; do this later in ResolveType() after the type
323         tree has been resolved.
324         (TypeContainer.ResolveType): New public method; this is called
325         after the type tree is resolved and before the types are being
326         populated.  We resolve the generic constraints here.
327         (TypeContainer.DoDefineMember): Check the constraints on our base
328         class and interfaces.
329
330         * decl.cs (DeclSpace.ResolveBaseTypeExpr): Make this protected;
331         set the `ResolvingTypeTree' flag on the EmitContext.
332
333         * codegen.cs (EmitContext.ResolvingTypeTree): New public field.
334
335 2005-05-10  Marek Safar  <marek.safar@seznam.cz>
336
337         * class.cs (Method.Define): Catch attempt for Finalizer declaration.
338         
339         * expression.cs (Argument.GetParameterModifier): Turned to property.
340         (Invocation.Error_InvalidArguments): Add more descriptive errors.
341         
342         * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
343         its C# equivalent.
344         
345 2005-05-09  Raja R Harinath  <rharinath@novell.com>
346
347         Fix #74852.
348         * decl.cs (MemberCache.AddMethods): Register override methods,
349         rather than non-override methods.
350         * typemanager.cs (RegisterOverride): New.
351         (IsOverride): Update.
352
353 2005-05-09  Marek Safar  <marek.safar@seznam.cz>
354
355         * typemanager.cs (TypeManager): Moved InitGenerics to Reset method.
356
357 2005-05-06  Martin Baulig  <martin@ximian.com>
358
359         * attribute.cs
360         (Attributable.IsClsComplianceRequired): Fix typo in the method name.
361         (AttributeTester.AnalyzeTypeCompliance): Add generics support.
362
363 2005-05-09  Marek Safar  <marek.safar@seznam.cz>
364
365         Fix #73105.
366         
367         * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
368         recursive declaration.
369         
370         * statement.cs (Block.ResolveMeta): Report any error in resolving.
371         
372 2005-05-06  Marek Safar  <marek.safar@seznam.cz>
373
374         * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
375         
376         * expression.cs (Binary.DoResolve): (x && 0) is always 0.
377
378 2005-05-05  Raja R Harinath  <rharinath@novell.com>
379
380         Fix #74797.
381         * decl.cs (DeclSpace.FamilyAccessible): 
382         Use TypeManager.IsNestedFamilyAccessible.
383
384         Fix reopened #64812.
385         * typemanager.cs (Closure.Filter): Introduce checks for 'protected
386         internal'.
387
388 2005-05-04  Raja R Harinath  <rharinath@novell.com>
389             Abin Thomas  <projectmonokochi@rediffmail.com>
390             Anoob V E  <projectmonokochi@rediffmail.com>
391             Harilal P R  <projectmonokochi@rediffmail.com>
392
393         Fix #64812.
394         * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
395         allow access to all static members.
396
397 2005-05-04  Martin Baulig  <martin@ximian.com>
398
399         * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
400
401 2005-05-04  Martin Baulig  <martin@ximian.com>
402
403         Fix #74655.
404
405         * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
406         section at the end; make things work if `default' is not the last
407         section.        
408
409 2005-05-04  Martin Baulig  <martin@ximian.com>
410
411         Fix #70400.
412
413         * statement.cs (Switch): Replaced the `got_default' field with a
414         `default_section' one.
415         (Switch.CheckSwitch): Set `default_section' here.
416         (Switch.Resolve): If we're a constant switch and the constant is
417         not found, use the default section.
418
419 2005-05-03  Martin Baulig  <martin@ximian.com>
420
421         * expression.cs (ArrayAccess.EmitGetLength): New public method.
422
423         * statement.cs (Foreach.ArrayForeach): New nested class.
424         (Foreach.TemporaryVariable): New nested class.
425         (Foreach.EmitArrayForeach): Removed; this is now in the new
426         ArrayForeach class.
427
428 2005-05-03  Raja R Harinath  <rharinath@novell.com>
429
430         * pending.cs (BaseImplements): Move the #74773 fix here.  This is
431         more conservative.
432         (VerifyPendingMethods): Revert change below.
433
434         * typemanager.cs (IsOverride, RegisterNonOverride): New.
435         * decl.cs (MemberCache.AddMethod): Register "non-override" methods
436         that used to trigger warning -28.  Remove warning -28.
437         * expression.cs (Invocation.OverloadResolve): Use
438         TypeManager.IsOverride to distinguish override methods.
439
440         Fix #74773.
441         * pending.cs (VerifyPendingMethods): If a base type implements the
442         requested interface, don't bother checking individual methods of
443         the base type.  As a side-effect, this prevents the creation of
444         unnecessary proxies.
445
446 2005-05-02  Martin Baulig  <martin@ximian.com>
447
448         Fix #70182.
449
450         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
451         Also `And' the locals if the old vector is null.
452         (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
453         null; in this case we basically reset all the variables.        
454
455 2005-05-02  Martin Baulig  <martin@ximian.com>
456
457         Fix #74529.
458
459         * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
460         Added `FlowBranching branching' argument; always `and' the
461         variables instead of `or'ing them unless we're an infinite loop.
462
463         * statement.cs (While.Resolve): Create a new sibling unless we're
464         infinite.       
465
466 2005-05-02  Martin Baulig  <martin@ximian.com>
467
468         Fix #70140.
469
470         * class.cs (ConstructorInitializer.Resolve): Added `Block block'
471         arguments; use it instead of creating a new TopLevelBlock.
472         (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
473         our ConstructorInitializer.
474
475         * statement.cs
476         (TopLevelBlock.TopLevelBranching): New public property.
477         (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
478         and create our `TopLevelBranching'.
479
480         * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
481         anonymous method host, use `block.TopLevelBranching' rather than
482         creating a new branching.
483
484 2005-04-20  Miguel de Icaza  <miguel@novell.com>
485
486         * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
487         a ScopeInfo, if any of the current children is a child of the new
488         entry, move those children there.
489
490 2005-04-30  Martin Baulig  <martin@ximian.com>
491
492         * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
493         at the beginning of a SwitchSection.  Fix #73335.
494
495 2005-04-27  Marek Safar  <marek.safar@seznam.cz>
496
497         Fix #74378
498         * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
499         
500         * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
501         (FieldExpr.DoResolve): Obsolete members are ignored for field
502         initializers.
503         
504 2005-04-26  Marek Safar  <marek.safar@seznam.cz>
505
506         * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
507         of arrays detection.
508
509         * class.cs (Interface.VerifyClsCompliance): Add base interfaces
510         verification.
511         (Field.VerifyClsCompliance): Volatile fields are not compliant.
512
513         * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
514         arrays report.
515
516 2005-04-25  Ben Maurer  <bmaurer@ximian.com>
517
518         * cs-parser.jay: Use the prefered version of -unsafe in error
519         message.
520
521 2005-04-22  Marek Safar  <marek.safar@seznam.cz>
522
523         * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
524         circumstances.
525
526 2005-04-20  John Luke  <john.luke@gmail.com>
527
528         * driver.cs: fix typo in error message, --outout to --output
529
530 2005-04-30  Martin Baulig  <martin@ximian.com>
531
532         * attribute.cs (Attribute.CheckSecurityActionValidity): Correctly
533         handle the .NET 2.x security attributes.
534
535 2005-04-30  Martin Baulig  <martin@ximian.com>
536
537         * typemanager.cs
538         (TypeManager.ExpandInterfaces): Don't add things twice.
539
540         * class.cs
541         (TypeContainer.VerifyClsCompliance): Allow generic instances.
542
543 2005-04-29  Martin Baulig  <martin@ximian.com>
544
545         * generic.cs (Constraints.ResolveTypes): Expand interfaces.
546
547         * anonymous.cs: Added support for anonymous generic methods.
548
549 2005-04-29  Martin Baulig  <martin@ximian.com>
550
551         * typemanager.cs (TypeManager.GetInterfaces): Correctly handle
552         generic instances.
553
554 2005-04-29  Martin Baulig  <martin@ximian.com>
555
556         * generic.cs (TypeManager.HasConstructorConstraint): Removed.
557
558         * expression.cs (New.DoResolve): Fix the CS0304 check.
559
560 2005-04-29  Martin Baulig  <martin@ximian.com>
561
562         * typemanager.cs (TypeManager.GetFullName): Updated to the new
563         naming schema.
564
565         * class.cs (MethodCore.IsDuplicateImplementation): If we're an
566         explicit interface implementation, compare the interface types.
567         (MethodData.Define): Use the new naming scheme from the latest
568         .NET 2.x beta2.
569         (MemberBase.DoDefineBase): Resolve `InterfaceType' here.
570
571         * decl.cs (MemberName.GetMemberName): Removed.
572         (MemberName.MethodName, FullName): New properties.
573
574 2005-04-25  Raja R Harinath  <rharinath@novell.com>
575
576         * gmcs.exe.config: Update v2.0.40607 -> v2.0.50215.
577
578 2005-04-22  Martin Baulig  <martin@ximian.com>
579
580         * generic.cs (GenericMethod): Create the EmitContext in the
581         `Define()'; in `Define(MethodBuilder)', create the type parameters
582         before calling `Define()'.  Fixes #73933.
583
584 2005-04-22  Martin Baulig  <martin@ximian.com>
585
586         * generic.cs
587         (Constraints.Resolve): Make things work wrt. the new type lookup system.
588         (ConstructedType.ResolveAsTypeTerminal): Don't override this.
589
590         * ecore.cs (Expression.ResolveAsTypeTerminal): If `te' is a
591         ConstructedType, check its constraints.
592
593 2005-04-20  Marek Safar  <marek.safar@seznam.cz>
594
595         * codegen.cs (InRefOutArgumentResolving): New field.
596         
597         * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
598         fields outside contructor.
599         
600         * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
601         
602 2005-04-19  Miguel de Icaza  <miguel@novell.com>
603
604         * anonymous.cs (CaptureContext.EmitParameterInstance): The
605         parameter code was not completed ever, so it was not as up-to-date
606         as local variables.  Must finish it.
607
608         The bug fix was to compare the Toplevel of the block, not the
609         current block.  Thanks for Ben for pointing this out. 
610
611 2005-04-19  Raja R Harinath  <rharinath@novell.com>
612
613         * decl.cs (AddMethods): Use the declaring type of the problem
614         method to determine if we want to squash a warning.
615
616 2005-04-19  Marek Safar  <marek.safar@seznam.cz>
617
618         * attribute.cs: Removed debug output.
619
620         * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
621         
622         * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
623         Report.Stderr.
624         
625 2005-04-18  Raja R Harinath  <rharinath@novell.com>
626
627         Fix #74481.
628         * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
629         (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
630         all null comparisons against reference types.
631
632 2005-04-18  Marek Safar  <marek.safar@seznam.cz>
633
634         Fix# 74565
635         * class.cs (TypeContainer.CircularDepException) New nested
636         exception class.
637         (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
638         (TypeContainer.DefineType): Removed error, reset InTransit before
639         exit.
640         (Class.DefineType): Throw exception when is in Transit.
641         Catch exception and report error.
642         (Struct.DefineType): Throw exception when is in Transit.
643         Catch exception and report error.
644         (Interface.DefineType): Throw exception when is in Transit.
645         Catch exception and report error.
646
647         * codegen.cs: Add InCatch,InFinally to EmitContext to easily
648         handle nested exception handlers.
649
650         * flowanalysis.cs (InTryWithCatch): New method, search for try with
651         a catch.
652
653         * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
654         InFinally and InCatch storage.
655
656         * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
657         (Catch.Resolve): Set and Restore ec.InCatch.
658         (Try.Resolve): Set and Restore ec.InFinally.
659         (Try.HasCatch): True when try has catch.
660
661 2005-04-17  Atsushi Enomoto  <atsushi@ximian.com>
662
663         * doc.cs : In some cases FilterName returns MonoEvent and MonoField
664           for the same event member, so exclude such cases from warning 419.
665           Fixed bug #74633.
666
667 2005-04-16  Miguel de Icaza  <miguel@novell.com>
668
669         * expression.cs (Binary.ResolveOperator): Apply patch from John
670         Luke to fix bug 59864: operators &, | and ^ on enumerations
671         require that the same enum type on both sides.
672
673         * driver.cs: Add warnings to old flag usage, this is to assist
674         people who produce Makefiles and hope that the Makefiles will be
675         used on Windows.
676
677         * class.cs (TypeContainer.EmitType): Moved the definition of the
678         special $PRIVATE$ field from the resolve phase to the Emit phase.
679         During resolve we do not know if we are a struct with
680         HasExplicitLayout, we know this only after the attributes for the
681         type are emitted.
682
683         Set the FieldOffset to zero on the dummy field that we create for
684         the class.   Fixes 74590.
685
686 2005-04-16  Raja R Harinath  <rharinath@novell.com>
687
688         Fix #73834.
689         * ecore.cs (PropertyExpr.resolved): New.
690         (DoResolve): Use it to handle a case of double resolution here.
691         Handle a case of identical-name-and-type-name.
692         * expression.cs (ArrayCreation.CheckIndices): Avoid double
693         resolution by storing the results of expression resolution back
694         into the "probes" array.
695
696 2005-04-15  Raja R Harinath  <rharinath@novell.com>
697
698         Fix cs0208-7.cs and cs0208-8.cs.
699         * typemanager.cs (IsUnmanagedType): Arrays are not allowed
700         (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0).  Improve
701         error reporting to point out the reason a struct is not unmanaged.
702
703 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
704
705         * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and 
706           just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
707
708 2005-04-13  Raja R Harinath  <rharinath@novell.com>
709
710         Fix #74528.
711         * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
712         IdenticalNameAndTypeName here.
713         (EventExpr.InstanceResolve): Likewise.
714
715 2005-04-13  Marek Safar  <marek.safar@seznam.cz>
716
717         C# 2.0 DefaultCharSetAttribute implementation
718         
719         * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
720         which allows us to set GlobalNamespace for every resolve.
721         (Attribute.ResolveArguments): Cut from Resolve.
722         (Attribute.GetCharSetValue): Returns CharSet named argument.
723         (Attribute.DefinePInvokeMethod): Gets default charset from
724         module settings.
725         (GlobalAttribute.ResolveAsTypeStep): Override.
726         (GlobalAttribute.ResolveArguments): Override.
727         
728         * class.cs (TypeAttr): Is protected.
729         
730         * codegen.cs (ModuleClass.DefaultCharSet): New member.
731         (ModuleClass.DefaultCharSetType): New memeber.
732         (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
733         
734         * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
735         charset from module.
736         
737         * delegate.cs (TypeAttr): Override.
738         (Delegate.DefineType): Use this TypeAttr.
739         
740         * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
741         at very early stage (before types are defined) to resolve model
742         module attributes. It will probably not work with corlib but it
743         should be ok.
744         
745         * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
746         charset from module.
747         
748         * typemanager.cs (default_charset_type): New type.
749
750 2005-04-13  Raja R Harinath  <rharinath@novell.com>
751
752         * decl.cs (MemberCache.AddMethods): Don't warn if
753         System.Object.Finalize has buggy MethodAttributes.
754
755         * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
756         removed below.
757
758 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
759
760         * doc.cs : detect ambiguous reference to overloaded members.
761           Fixed bug #71603. MS 1.1 csc does not detect it.
762
763 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
764
765         * doc.cs : delegates must not be referenced with parameters.
766           Fixed bug #71605.
767
768 2005-04-12  Miguel de Icaza  <miguel@novell.com>
769
770         * typemanager.cs (IsUnmanagedType): Arrays are allowed.
771
772 2005-04-10  Miguel de Icaza  <miguel@novell.com>
773
774         * driver.cs (MainDriver): Stop processing if the CLS stage found
775         errors. 
776
777         (CompilerCallableEntryPoint.InvokeCompiler): Always
778         reset after execution;   Take a TextWriter argument for the
779         output.
780
781         * report.cs: Use the error stream instead of hardcoding stderr. 
782
783 2005-04-09  Miguel de Icaza  <miguel@novell.com>
784
785         * class.cs: Reduce code paths to test, too small of an
786         optimization to make it worth the extra testing.  Always perform
787         it. 
788
789 2005-04-08  Raja R Harinath  <rharinath@novell.com>
790
791         Fix #74510.
792         * class.cs (OperatorArrayList.CheckPairedOperators): Skip
793         operators that had errors reported on them.
794
795 2005-04-08  Marek Safar  <marek.safar@seznam.cz>
796
797         * attribute.cs (Attribute.IsValidArgumentType): Test valid named
798         argument types.
799         (Attribute.Resolve): Add named argument type checking.
800         
801         * class.cs (FixedField.Define): Use IsPrimitiveType
802         
803         * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
804         
805         * iterators.cs (Iterator.DefineIterator): Add check for arglist and
806         unsafe parameter types.
807         
808         * statement.cs (Using.ResolveExpression): Add better error description.
809         
810         * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
811         
812 2005-04-08  Raja R Harinath  <rharinath@novell.com>
813
814         Fix #74484.
815         * attribute.cs (Attribute.GetAttributeUsage): Resolve
816         AttributeUsageAttribute in the emitcontext of the attribute class,
817         not in the emitcontext of the attributable entity it was attached to.
818         * cs-parser.jay: Use 'current_class', not 'current_container',
819         when creating a GlobalAttribute.
820
821 2005-04-08  Alp Toker  <alp@atoker.com>
822
823         * pending.cs: The fix to #58413 failed to compile methods implementing
824         interfaces with/without params modifiers and vice versa, even though
825         params modifiers aren't part of the signature. Make the modifier check
826         less strict as in csc.
827
828 2005-04-07  Abin Thomas  <projectmonokochi@rediffmail.com>
829             Anoob V E  <projectmonokochi@rediffmail.com>
830             Harilal P R  <projectmonokochi@rediffmail.com>
831
832         Fix #58413.
833         * pending.cs (TypeAndMethods.mods): New.  Store the parameter
834         modifiers of pending methods.
835         (PendingImplementation.PendingImplementation): Initialize it.
836         Add Parameter.Modifier [][] mods and initialize it with ParameterData.
837         (PendingImplementation.InterFaceMethod): Repalce Type[] argument
838         with ParameterData.  Add check for modifiers.
839         * class.cs (MethodData.Define): Update to changes.
840
841 2005-04-07  Raja R Harinath  <rharinath@novell.com>
842
843         * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
844
845 2005-04-07  Marek Safar  <marek.safar@seznam.cz>
846
847         * class.cs (PropertyMethod.Define): Check private accessor in abstract
848         property.
849         
850         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
851         
852         * rootcontext.cs,
853         * typemanager.cs: Registered RequiredAttributeAttribute.
854         
855 2005-04-06  Marek Safar  <marek.safar@seznam.cz>
856
857         * class.cs (VerifyMembers): Doesn't need EmitContext argument.
858         Warning CS0169 is back at level 3.
859         (IMethodData.SetMemberIsUsed): New method.
860         
861         * decl.cs (IsUsed): New value; moved from FieldBase.Status
862         (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
863         
864         * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
865
866         * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
867         contants.
868         (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
869         is used.
870         
871         * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
872         is used.
873         
874         * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
875         to avoid the problems with nested types.
876
877 2005-04-05  Abin Thomas  <projectmonokochi@rediffmail.com>
878             Anoob V.E  <projectmonokochi@rediffmail.com>
879             Harilal P.R  <projectmonokochi@rediffmail.com>
880             Raja R Harinath  <rharinath@novell.com>
881
882         Fix #73820.
883         * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
884         attribute.
885         * typemanager (GetConstructor): Make public.
886
887 2005-04-05  John Luke  <john.luke@gmail.com>
888             Raja R Harinath  <rharinath@novell.com>
889
890         Fix #62232.
891         * typemanager.cs (IsUnmanagedType): Check non-public fields of a
892         struct too.  Return false quicker in a few cases.
893         (VerifyUnManaged): Use it.
894
895 2005-04-05  Raja R Harinath  <rharinath@novell.com>
896
897         Fix #74041.
898         * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
899         not 'unreachable_seen'.
900
901 2005-04-04  Marek Safar  <marek.safar@seznam.cz>
902
903         * attribute.cs (Attribute.GetValue): Removed unused.
904         
905         * codegen.cs (CodeGen.TrimExt): Removed unused.
906         
907         * cs-parser.jay (output): Removed unused.
908         
909         * cs-tokenizer.cs (hex_digits): Removed unused.
910         
911         * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
912         
913         * expression.cs (Indirection.LoadExprValue): Removed unused.
914         (ArrayCreation.ExpressionToArrayArgument): Removed unused.
915         
916         * iterators.cs (Iterator.param_types): Removed unused.
917         
918         * statement.cs (Goto.block): Removed unused.
919         (ToplevelBlock.did): Removed unused.
920         (Switch.ResolveConstantSwitch): Removed unused.
921
922 2005-04-01  Ben Maurer  <bmaurer@ximian.com>
923
924         * rootcontext.cs: Allow mcs to bootstrap with the compilation
925         resetting thingy.
926
927 2005-04-19  Martin Baulig  <martin@ximian.com>
928
929         Merged r42462 from MCS and made it work for GMCS.
930
931         * class.cs (MethodCore.ds): Moved this field to `MemberBase'.
932
933         * generic.cs (GenericMethod.Define): Removed `return_type' argument.
934
935 2005-04-01  Raja R Harinath  <rharinath@novell.com>
936
937         Fix #74232 and cs0208-3.cs.
938         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
939         * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
940         unmanaged type.  Don't use FieldBuilders when 't' is a
941         TypeBuilder.  Use ModFlags and MemberType fields.
942         * class.cs (MemberBase.member_type): Rename from MemberType.
943         (MemberBase.MemberType): New property.  Determines member_type on
944         demand.
945         (MemberBase.DoDefine): Don't initialize MemberType here.
946         (FieldMember.Define): Likewise.
947
948 2005-04-01  Marek Safar  <marek.safar@seznam.cz>
949
950         Fix #74241
951         * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
952         Attributes are emitted there.
953         
954 2005-04-01  Raja R Harinath  <rharinath@novell.com>
955
956         * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
957         keyword in 'partial enum' too.
958         * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
959         is not allowed).
960         Report from Kamil Skalski <nazgul@omega.pl>.
961
962         Fix #74309.
963         * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
964         have partial containers too.
965
966         * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
967         in block' checks to Block.CheckInvariantMeaningInBlock.
968         * statement.cs (Block.GetKnownVariableInfo): Make private.
969         (Block.IsVariableUsedInChildBlock): Remove.
970         (Block.IsVariableUsedInBlock): Likewise.
971         (Block.CheckInvariantMeaningInBlock): New.  Show location of
972         conflicting declaration.
973         (Block.AddVariable): Make error messages less long-winded and more
974         specific.  Show location of conflicting declaration.
975         * parameter.cs (Parameters.Location): New readonly property.
976
977 2005-03-31  Raja R Harinath  <rharinath@novell.com>
978
979         Clean up semantics of invoking ResolveMemberAccess.
980         * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
981         can have an instance, ensure that we pass in a non-TypeExpression
982         to ResolveMemberAccess.  Tighten up IdenticalNameAndTypeName checks.
983         (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
984         argument.  Update to changes and simplify.
985         (FieldExpr.Emitinstance): Remove CS0120 check.
986         (PropertyExpr.EmitInstance): Likewise.
987         * expression.cs (Argument.Resolve): Likewise.
988         (Invocation.DoResolve): Update to changes in semantics of
989         InstanceExpression.
990
991 2005-03-31  Marek Safar  <marek.safar@seznam.cz>
992
993         Fix #74241
994         * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
995         customization.
996         
997         * decl.cs (MemberCache.AddMethods): Fix infinite loop.
998
999 2005-03-31  Raja R Harinath  <rharinath@novell.com>
1000
1001         Fix difference in behaviour with commandline invocation.
1002         * driver.cs (Driver.Reset): New.
1003         (CompilerCallableEntryPoint): Call it.
1004
1005         * statement.cs (If.Resolve): Avoid spurious "uninitialized
1006         variable" warnings if the boolean expression failed to resolve.
1007
1008 2005-03-30  Sebastien Pouliot  <sebastien@ximian.com>
1009
1010         * attribute.cs: Fix the union of several permissions when some of them
1011         are unrestricted (so the result isn't an unrestricted permission set).
1012         Fix #74036.
1013
1014 2005-03-30  Raja R Harinath  <rharinath@novell.com>
1015
1016         * ecore.cs (MemberExpr): New class.  Convert from interface
1017         IMemberExpr.
1018         (MemberExpr.ResolveMemberAccess): Refactor and move here from
1019         MemberAccess.ResolveMemberAccess.  Tighten up pre-conditions and
1020         error checks.
1021         (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
1022         (MethodGroupExpr.IsExplicitImpl): Remove.
1023         (Expression.GetFieldFromEvent): Remove.
1024         (SimpleName.MemberStaticCheck): Remove.
1025         (SimpleName.DoSimpleNameResolve): Update to changes.
1026         * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
1027         (MemberAccess.IdenticalNameAndTypeName): Remove.
1028         (MemberAccess.error176): Move to MemberExpr.
1029         (MemberAccess.DoResolve): Update to changes.
1030         (BaseAccess.DoResolve): Likewise.
1031
1032 2005-03-30  Marek Safar  <marek.safar@seznam.cz>
1033
1034         C# 2.0 Conditional attribute class implementation
1035         
1036         * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
1037         Analyzes class whether it has attribute which has ConditionalAttribute
1038         and its condition is not defined.
1039         
1040         * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
1041         (Class.IsExcluded): New method. Search for at least one defined
1042         condition in ConditionalAttribute of attribute class.
1043
1044 2005-03-30  Raja R Harinath  <rharinath@novell.com>
1045
1046         * ecore.cs (PropertyExpr): Derive from Expression, not
1047         ExpressionStatement.
1048         (PropertyExpr.EmitStatement): Remove.
1049
1050 2005-03-29  Raja R Harinath  <rharinath@novell.com>
1051
1052         Fix #74060.
1053         * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
1054         internal field "value__" of an enum be private.  The examples for
1055         "value__" that I found on MSDN all used FieldAttributes.Private.
1056
1057         * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
1058         Don't mention IL method attribute names.
1059
1060         Fix #47991.  Remove a TODO.
1061         * statement.cs (Block.Toplevel): Make into a field.
1062         (Block.Parameters): Move into ToplevelBlock.
1063         (Block.known_variables): Rename from child_variable_names.
1064         (Block.Block): Remove variants that take Parameters.  Initialize
1065         'Toplevel' with the immediately surrounding toplevel block.
1066         (Block.AddKnownVariable): Rename from AddChildVariableName.  Add a
1067         LocalInfo parameter.
1068         (Block.GetKnownVariableInfo): New.
1069         (Block.IsVariableNameUsedInChildBlock): Update.
1070         (Block.IsVariableNameUsedInBlock): New.  Checks if a name is used in
1071         the block, even though it may not be in scope.
1072         (Block.AddVariable): Remove Parameters parameter.  Use
1073         Toplevel.Parameters instead.
1074         (Block.AddConstant): Remove Parameters parameter.
1075         (Block.GetParameterReference): Update to use Toplevel.Parameters.
1076         (Block.IsParamaterReference): Likewise.
1077         (Block.IsLocalParameter): Likewise.  Simplify a lot.
1078         (ToplevelBlock.Parameters): New.  Moved from Block.
1079         (ToplevelBlock.ToplevelBlock): Update to changes.  Always
1080         initialize Parameters to a non-null value.
1081         * cs-parser.jay: Update to changes.
1082         * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
1083         simple names that mean different things in the same block.  Use
1084         Block.IsVariableNameUsedInBlock.
1085
1086 2005-03-28  Raja R Harinath  <rharinath@novell.com>
1087
1088         * enum.cs (Enum.LookupEnumValue): Remove debugging code.
1089
1090 2005-03-26  Raja R Harinath  <harinath@acm.org>
1091
1092         Fix #73038.
1093         * assign.cs (Assign.DoResolve): When the RHS of an assignment
1094         fails to resolve, ensure that the LHS is still resolved as an
1095         lvalue.
1096
1097 2005-03-25  Raja R Harinath  <harinath@acm.org>
1098
1099         * enum.cs (Enum.DefineType): Set ec.InEnumContext and
1100         ec.ContainerType.
1101         (Enum.current_ec): Remove.
1102         (Enum.LookupEnumValue): Remove EmitContext argument.
1103         Just uses the one created during DefineType.
1104         (Enum.FindMembers): Update.
1105         * expression.cs (MemberAccess.DoResolve): Update.
1106
1107 2005-03-22  Marek Safar  <marek.safar@seznam.cz>
1108
1109         * assign.cs (Assign.DoResolve): Check for CS1717 when
1110         source and target are same (uses Equals).
1111
1112         * expression.cs (LocalVariableReference, ParameterReference,
1113         This): Implemented Equals, GetHashCode.
1114
1115         * statement.cs (Block.GetParameterReference): Removed useless
1116         local variable.
1117
1118 2005-03-22  Raja R Harinath  <rharinath@novell.com>
1119
1120         Fix cs0128.cs
1121         * statement.cs (Block.AddVariable): Ensure that we skip implicit
1122         blocks before deciding whether the error is cs0136 or cs0128.
1123
1124         * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
1125         (using_alias_directive, using_namespace_directive): Pass
1126         MemberName, not an expression to Namespace.UsingAlias and
1127         Namespace.Using.
1128         (MakeName): Use the MemberName of the namespace.
1129         * namespace.cs (Namespace.MemberName): New.
1130         (UsingEntry.UsingEntry): Take a MemberName, not an expression.
1131         (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
1132         Likewise.
1133         * decl.cs (MemberName.Name): Make readonly.
1134         (MemberName.FromDotted): New "constructor".
1135         (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
1136         (MemberCore.Name): Compute from MemberName on demand.
1137         (MemberCore.SetMemberName): Provide a way to change the
1138         MemberName.
1139         (MemberCore.AddToContainer): Don't take a fullname parameter.
1140         * class.cs (TypeContainer.AddToMemberContainer): Don't add the
1141         fully qualified name of the container to the member name.
1142         (TypeContainer.AddToTypeContainer): Use a fully qualified name
1143         only if the type is a member of the root container.
1144         (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
1145         MemberName.Left rather than searching for an embedded ".".
1146         (PartialContainer.CreatePart): Update to changes in RootContext.
1147         (MemberBase.ShortName): Turn into a property.  Use
1148         MemberCore.SetMemberName.
1149         (MemberBase.ExplicitInterfaceName): Remove.
1150         (MemberBase.UpdateMemberName): Remove.
1151         (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
1152         (PropertyBase.SetMemberName): New override.
1153         * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
1154         (Tree.GetDecl): New.
1155         (Tree.AllDecls): Rename from Decls.
1156         * attribute.cs, enum.cs, report.cs: Update to changes.
1157         * driver.cs (MainDriver): Use MemberName.FromDotted on
1158         RootContext.MainClass.
1159
1160 2005-03-21  Marek Safar  <marek.safar@seznam.cz>
1161
1162         * class.cs (FixedField.Define): Check for CS1664 and more sanity
1163         checks.
1164
1165         * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
1166
1167 2005-03-18  Marek Safar  <marek.safar@seznam.cz>
1168
1169         * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
1170         property accessor modifiers.
1171
1172         * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
1173         fixed buffer attribute (CS1716).
1174         (PropertyMethod.HasCustomAccessModifier): When property accessor
1175         has custom modifier.
1176
1177         * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
1178         modifiers.
1179         (PropertyExpr.DoResolveLValue): Add CS0272.
1180
1181 2005-03-17  Miguel de Icaza  <miguel@novell.com>
1182
1183         * convert.cs: When converting to a pointer, use the proper Conv.U
1184         or Conv.I depending on the source data type.
1185
1186         * cs-tokenizer.cs: Make the size for large decimal constants,
1187         fixes #72957.
1188
1189 2005-03-17  Martin Baulig  <martin@ximian.com>
1190
1191         * anonymous.cs (AnonymousMethod.method_modifiers): Change default
1192         from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'.  Fixes #73260.
1193
1194 2005-03-17  Martin Baulig  <martin@ximian.com>
1195
1196         * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
1197         to bool so we can return an error condition.
1198         (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
1199         returned an error.
1200
1201 2005-03-16  Zoltan Varga  <vargaz@freemail.hu>
1202
1203         * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
1204         attributes.
1205
1206 2005-03-16  Raja R Harinath  <rharinath@novell.com>
1207
1208         Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
1209         Refactor to avoid traversing the list of assemblies, and to avoid
1210         string concatenation.
1211         * typemanager.cs (guid_attr_type): Remove.
1212         (negative_hits, pointers, references): Remove hashes.
1213         (type_hash): New.
1214         (GetConstructedType): New.  Uses type_hash to handle constructed
1215         types (arrays, references, pointers).
1216         (GetReferenceType, GetPointerType): Use it.
1217         (GetNestedType): New.  Uses type_hash to handle nested types of
1218         reflected types.
1219         (LookupType, LookupTypeDirect): Remove.
1220         (CoreLookupType): Inline parts of old LookupTypeDirect code.  Use
1221         'types' hash and LookupTypeReflection directly.
1222         (params_string, params_object): Use GetConstructedType.
1223         * namespace.cs (Namespace.cached_types): New.  Cache of reflected
1224         top-level types.
1225         (Namespace.Lookup): Use cached_types.
1226         (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
1227         provided by old TypeManager.LookupType.
1228         * rootcontext.cs (MakeFQN): Remove.
1229         * decl.cs (DeclSpace.MakeFQN): Likewise.
1230         (DeclSpace.LookupType): Use TypeManager.GetNestedType.
1231         * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
1232         TypeManager.GetConstructedType.
1233         * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
1234
1235 2005-04-16  Zoltan Varga  <vargaz@freemail.hu>
1236
1237         * cs-parser.jay: Fix build.
1238
1239 2005-03-15  Marek Safar  <marek.safar@seznam.cz>
1240
1241         * class.cs (TypeContainer.CircularDepException) New nested
1242         (MethodCore.CheckBase): Report CS1715 for properties and indexers.
1243
1244         * cs-parser.jay: Reports CS1527 for any namespace element.
1245
1246         * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
1247         Added CS0407.
1248
1249         * expression.cs (ParameterReference.IsAssigned): Changed error to
1250         CS0269.
1251         (Error_WrongNumArguments): Moved CS0245 detection here.
1252
1253         * statement.cs (Return.Resolve): Add CS1622 report.
1254
1255 2005-03-11  Marek Safar  <marek.safar@seznam.cz>
1256
1257         * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
1258
1259 2005-03-11  Zoltan Varga  <vargaz@freemail.hu>
1260
1261         * attribute.cs expression.cs: Get rid of some allocations.
1262
1263 2004-03-11  Atsushi Enomoto  <atsushi@ximian.com>
1264
1265         * doc.cs : just eliminate the latest change.
1266
1267 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
1268
1269         * doc.cs : commented out the latest change. It breaks xml-030.cs
1270
1271 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
1272
1273         * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
1274           fail. So invoke CreateType() in FindDocumentedType().
1275
1276 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
1277
1278         * cs-tokenizer.cs : added IsKeyword().
1279         * doc.cs : Detect keyword incorrectly used as identifier.
1280           Allow identifiers prefixed by @.
1281
1282 2005-03-10  Marek Safar  <marek.safar@seznam.cz>
1283
1284         * attributes.cs (Attributes.Emit): Continue after CheckTargets.
1285         It caused exception in namespace resolving (again!).
1286         
1287         * class.cs (Class.ctor): Removed exit.
1288         (PropertyMethod.ctor): ditto.
1289         
1290         * codegen.cs (Codegen.Reset): Reset static data.
1291         (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
1292         
1293         * cs-tokenizer.cs (Cleanup): Removed.
1294         
1295         * driver.cs (GetSystemDir): Rewrote to one line command.
1296         It caused problem with unloaded dynamic modules.
1297         (UnixParseOption): Removed Exit.
1298         (CompilerCallableEntryPoint.InvokeCompiler): Make static.
1299         (CompilerCallableEntryPoint.Reset): Reset suitable static data.
1300         Now can be mcs used as library.
1301         
1302         * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
1303         empty location.
1304         
1305         * location.cs (Reset): Reset static data.
1306         
1307         * namespace.cs (Reset): Reset static data.
1308         
1309         * report.cs (Report.Reset): Reset static data.
1310         
1311         * rootcontext.cs (RootContext.Reset): Reset static data.
1312         
1313         * tree.cs (RootTypes.ctor): Use Location.Null
1314         
1315         * typemanager.cs (TypeManager.Reset): Reset static data.
1316         (CoreLookupType): Removed Exit.
1317         (TypeHandle.Reset): Reset static data.
1318         
1319 2005-03-10  Raja R Harinath  <rharinath@novell.com>
1320
1321         Fix #73516.
1322         * typemanager.cs (ComputeNamespaces): Import namespaces from
1323         referenced modules too.
1324
1325 2005-03-09  Raja R Harinath  <rharinath@novell.com>
1326
1327         * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
1328         than '.'.
1329
1330 2005-03-09  Raja R Harinath  <rharinath@novell.com>
1331
1332         * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
1333         enclosing DeclSpace.  This ensures that a name-lookup populates
1334         more caches and there are fewer 'TypeExpression's.  Carve out
1335         nested type lookup into ...
1336         (LookupNestedTypeInHierarchy): ... this.
1337
1338 2005-04-15  Martin Baulig  <martin@ximian.com>
1339
1340         Merged r41590 from MCS and make it work in the generics land.
1341
1342         * generic.cs (TypeParameter.UpdateConstraints): Removed the
1343         `check' argument.
1344
1345         * class.cs (PartialContainer.UpdateConstraints): Removed.
1346         (PartialContainer.CheckConstraints): Removed.
1347         (PartialContainer.SetParameterInfo): Store the constraints here.
1348         (PartialContainer.DefineTypeParameters): New public method;
1349         resolve the type parameter's constraints here.  Note that the
1350         PartialContainer doesn't have an EmitContext anymore, so we must
1351         do this in the ClassPart.
1352
1353 2005-03-09  Raja R Harinath  <rharinath@novell.com>
1354
1355         Clean up a few partial-class semantics.  
1356         Fixes test-357.cs and cs1618-2.cs.
1357         * cs-parser.jay (struct_declaration): Use 'current_class' as
1358         parent of newly-created struct.  Remove call to Register ().
1359         Use 'pop_current_class' to complete handing the current struct.
1360         (interface_declaration): Likewise.
1361         (class_declaration): Likewise.
1362         (enum_declaration): Use 'current_class' as parent of newly created
1363         enum.
1364         (delegate_declaration): Likewise.
1365         (pop_current_class): New function.  This is used to handle closing
1366         up the 'current_class' and 'current_container', and pointing them
1367         to the enclosing class/container.
1368         (CSharpParser): Initialize 'current_class' too.
1369         * decl.cs (MemberCore): Add check for invariant: a partial
1370         container is not a parsed entity, and thus does not enclose any
1371         parsed members.
1372         (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
1373         (DeclSpace.BaseTypeExpr): Use it.
1374         (DeclSpace.LookupType): Add check for invariant.
1375         * class.cs (TypeContainer): Add check for invariant: a nested
1376         class should have the same NamespaceEntry as its enclosing class.
1377         (TypeContainer.EmitFieldInitializers): Make virtual.
1378         (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
1379         MemberCore.
1380         (TypeContainer.Register): Remove.
1381         (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
1382         null.  Use TypeResolveEmitContext for resolving base types and
1383         interfaces.  Move initialization of Parts.TypeBuilder here from
1384         ...
1385         (TypeContainer.DefineNestedTypes): ... here.
1386         (PartialContainer): Take a Namespace not a NamespaceEntry.
1387         (PartialContainer.Create): Don't use Register.  Call the
1388         appropriate Add... function directly.
1389         (ClassPart): Take both the PartialContainer and the enclosing
1390         class as constructor arguments.
1391         (ClassPart.EmitFieldInitializers): Override.
1392         (ClassPart.PartFindNestedTypes): Remove.
1393         (FieldBase.GetInitializerExpression): Resolve the initializer
1394         expression in the emit context of the enclosing class.
1395         * tree.cs (RootTypes): Remove Register ().
1396         
1397 2005-03-08  Marek Safar  <marek.safar@seznam.cz>
1398
1399         * cs-parser.jay: Removed CS0134.
1400         
1401         * driver.cs: Removed CS1901.
1402         
1403         * expression.cs (SizeOf.DoResolve): Don't report CS0233
1404         for predefined types.
1405
1406 2005-03-07  Duncan Mak  <duncan@novell.com>
1407
1408         * codegen.cs (Save):  Catch UnauthorizedAccessException as
1409         well. Fixes bug #73454.
1410
1411 2005-03-07  Marek Safar  <marek.safar@seznam.cz>
1412
1413         * cs-tokenizer.cs (xtoken): Add CS1035.
1414         
1415         * class.cs (MethodData.Define): Add CS0683.
1416         (FieldMember.ctor): Add CS0681.
1417
1418 2005-03-07  Raja R Harinath  <rharinath@novell.com>
1419
1420         * ecore.cs (SimpleName.DoResolve): Rename from
1421         SimpleName.DoResolveAllowStatic.
1422         (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
1423         Pass 'intermediate' flag to MemberStaticCheck.
1424         (SimpleName.MemberStaticCheck): Skip "static check" only in case
1425         of "intermediate" lookups via MemberAccess.
1426         (SimpleName.IdenticalNameAndTypeName): New.  Carved out of ...
1427         * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
1428
1429 2005-03-07  Raja R Harinath  <rharinath@novell.com>
1430
1431         Fix #73394.
1432         * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
1433         slipped in because of variable names that are identical to a
1434         builtin type's BCL equivalent ('string String;', 'int Int32;').
1435         (PropertyExpr.EmitInstance): Likewise.
1436
1437 2005-03-04  Marek Safar  <marek.safar@seznam.cz>
1438
1439         * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
1440         
1441         * report.cs (warning_ignore_table): Made public.
1442
1443 2005-03-04  Raja R Harinath  <rharinath@novell.com>
1444
1445         Fix #73282.
1446         * class.cs (MethodData.Emit): Pass 'container' to
1447         container.GetObsoleteAttribute instead of 'container.Parent'.
1448
1449 2005-03-03  Marek Safar  <marek.safar@seznam.cz>
1450
1451         * cs-parser.jay: Add 1534 error test.
1452
1453         * iterators.cs (Yield.CheckContext): Add error 1629.
1454         (Iterator.ctor): Save unsafe modifier.
1455         (MoveNextMethod.DoEmit): Restore unsafe context.
1456
1457         * namespace.cs (UsingAlias): Better error message.
1458
1459 2005-03-03  Dan Winship  <danw@novell.com>
1460
1461         * convert.cs (Error_CannotImplicitConversion): fix two bugs in
1462         the warning message [#73219]
1463
1464 2005-03-03  Raja R Harinath  <rharinath@novell.com>
1465
1466         Fix compile with MCS 1.0.0.0.
1467         * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
1468         w_restore to not depend on string constant folding.
1469
1470 2005-03-03  Raja R Harinath  <rharinath@novell.com>
1471
1472         * decl.cs (DeclSpace.LookupType): Remove 'silent' argument.  Move
1473         CS0246 check to users who passed 'silent = false'.
1474         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
1475         check.
1476         (SimpleName.SimpleNameResolve): Update.
1477         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
1478         (MemberAccess.IdenticalNameAndTypeName): Update.
1479         * doc.cs (FindDocumentedTypeNonArray): Update.
1480
1481 2005-03-03  Raja R Harinath  <rharinath@novell.com>     
1482
1483         * codegen.cs (EmitContext): Remove ResolvingTypeTree.
1484         * parameters.cs (ComputeAndDefineParameters): Remove.
1485         * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
1486         * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
1487         Use GetParameterInfo.
1488
1489 2005-03-02  Marek Safar  <marek.safar@seznam.cz>
1490
1491         * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
1492
1493 2005-03-02  Raja R Harinath  <rharinath@novell.com>
1494
1495         Unify DeclSpace.LookupType and DeclSpace.FindType.
1496         * decl.cs (DeclSpace.FindNestedType): New virtual function.  This
1497         is in charge of defining nested types on demand.
1498         (DeclSpace.LookupType): Use it when the current_type is a
1499         TypeBuilder.  Use LookupTypeDirect for reflected types.
1500         (DeclSpace.FindType): Remove.
1501         (DeclSpace.LookupInterfaceOrClass): Likewise.
1502         (DeclSpace.DefineTypeAndParents): Likewise.
1503         * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
1504         DeclSpace.LookupType.
1505         * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
1506         * typemanager.cs (LookupType): Simplify.
1507         (AddUserType): Remove type from negative_hits.
1508         * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
1509         * class.cs (TypeContainer.FindMembers): Move handling of nested
1510         types ...
1511         (TypeContainer.FindMembers_NestedTypes): ... here.
1512         (TypeContainer.FindNestedType): Implement override.
1513         (ClassPart.FindNestedType): Delegate to PartialContainer.
1514         (ClassPart.PartFindNestedType): Looks up the nested types of the
1515         part alone.
1516
1517 2005-04-14  Martin Baulig  <martin@ximian.com>
1518
1519         * generic.cs (ConstructedType): Moved all the type lookup and
1520         nested class logic into SimpleName.
1521         (ConstructedType.ResolveConstructedType): Our underlying type is
1522         already fully resolved; all the type lookup stuff is in
1523         SimpleName.
1524
1525         * ecore.cs (SimpleName.ResolveAsTypeStep): Resolve nested
1526         constructed types here instead of in ConstructedType.
1527
1528         * decl.cs (MemberName.GetTypeExpression): Always create a
1529         SimpleName, not a ConstructedType.
1530         (DeclSpace.ResolveNestedType): Removed; this is now in SimpleName.
1531
1532 2005-03-02  Martin Baulig  <martin@ximian.com>
1533
1534         * class.cs (TypeContainer.DoDefineMembers): We also need a default
1535         static constructor in static classes.
1536
1537 2005-03-01  Zoltan Varga  <vargaz@freemail.hu>
1538
1539         * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
1540         sizeParamIndex is not specified.
1541
1542 2005-03-01  Marek Safar  <marek.safar@seznam.cz>
1543
1544         Fix #73117
1545         * report.cs (WarningMessage.IsEnabled): Missing null check.
1546
1547 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
1548
1549         * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
1550         in the fields and not in the properties.
1551
1552 2005-02-28  Zoltan Varga  <vargaz@freemail.hu>
1553
1554         * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex 
1555         fields as well.
1556
1557 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
1558
1559         * attribute.cs: Small refactoring (improved robustness).
1560         (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
1561         (ValidateGuid): Removed.
1562         (Resolve): Removed referenced to above mentioned.
1563         (GetAttributeUsage): Made private and changed to work without
1564         class assistance.
1565         (GetIndexerAttributeValue): Don't crash.
1566         (GetConditionalAttributeValue): Ditto.
1567         (GetClsCompliantAttributeValue): Ditto.
1568         (ExtractSecurityPermissionSet): All attributes exceptions are
1569         error 648.
1570         (GetPropertyValue): New helper.
1571         (GetMethodImplOptions): New method.
1572         (DefinePInvokeMethod): Reuse common code. Implemented handling of
1573         some missing properties.
1574         
1575         * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
1576         (Method.ApplyAttributeBuilder): Updated.
1577         
1578         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
1579         exception.
1580
1581 2005-02-28  Raja R Harinath  <rharinath@novell.com>
1582
1583         Fix #73052.
1584         * report.cs (Report.SymbolRelatedToPreviousError): Handle
1585         non-simple types (array, pointer, reference).
1586
1587 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
1588
1589         * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
1590
1591         * class.cs (MethodCore.IsDuplicateImplementation): Special error
1592         for operators.
1593         (Method.CheckBase): Catch wrong destructor here.
1594         (MethodData.Define): Add errors 550, 668.
1595
1596         * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
1597
1598         * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
1599
1600         * pending.cs (VerifyPendingMethods): Add error 551.
1601
1602         * typemanager.cs (CSharpName): Next error report helper.
1603
1604 2005-02-25  Marek Safar  <marek.safar@seznam.cz>
1605
1606         * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
1607         attributes. Removed useless attribute double check.
1608         It saves almost 2MBs for corlib.
1609
1610 2005-02-25  Raja R Harinath  <rharinath@novell.com>
1611
1612         Fix #72924.
1613         * statement.cs (ExpressionStatement.Resolve): Make robust to being
1614         called twice in case of error.
1615
1616 2005-02-23  Chris Toshok  <toshok@ximian.com>
1617
1618         Fix compiler portions of #72827.
1619         * statement.cs (Block.Emit): call Begin/EndScope on the
1620         EmitContext instead of the ILGenerator.
1621
1622         * codegen.cs (EmitContext.BeginScope): new method, call
1623         ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
1624         we have one.)
1625         (EmitContext.BeginScope): same, but EndScope and CloseScope
1626
1627         * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
1628         offset and call the superclass's OpenScope(int) with it.
1629         (SymbolWriter.CloseScope): get the current il
1630         offset and call superclass's CloseScope(int) with it.
1631
1632 2005-02-23  Marek Safar  <marek.safar@seznam.cz>
1633
1634         * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
1635         CS1677 for out and ref as well.
1636
1637         * class.cs (Method.Define): Add error CS1599 detection.
1638         
1639         * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
1640         
1641         * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
1642         
1643         * delegate.cs (Delegate.Define): Add error CS1599 detection.
1644         
1645         * support.cs.cs (ModifierDesc): New helper method.
1646
1647 2005-02-23  Raja R Harinath  <rharinath@novell.com>
1648             Abin Thomas  <projectmonokochi@rediffmail.com>
1649             Anoob V E  <projectmonokochi@rediffmail.com>
1650             Harilal P R  <projectmonokochi@rediffmail.com>
1651
1652         Fix #57851, #72718.
1653         * class.cs (ConstructorBuilder.Resolve): Make sure that the second
1654         MemberLookup (used for error reporting) actually returns a result.
1655         Fix error report number (122, not 112).
1656
1657 2005-02-22  Abin Thomas  <projectmonokochi@rediffmail.com>
1658             Anoob V E  <projectmonokochi@rediffmail.com>
1659             Harilal P R  <projectmonokochi@rediffmail.com>
1660
1661         Fix #71134.
1662         * pending.cs (PendingImplementation.GetAbstractMethods):
1663         Find NonPublic members too.
1664
1665 2005-02-22  Marek Safar  <marek.safar@seznam.cz>
1666
1667         * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
1668         Fixed error 217.
1669         
1670         * class.cs (MethodCore.CheckMethodAgainstBase):
1671         Add error 239 report.
1672
1673 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
1674
1675         * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
1676         
1677         * class.cs (Operator.Define): Add error 217 report.
1678         
1679 2005-02-21  Raja R Harinath  <rharinath@novell.com>
1680
1681         Fix #68955.
1682         * expression.cs (Invocation.IsApplicable): Make public.
1683         (Invocation.IsParamsMethodApplicable): Likewise.
1684         * delegate.cs (Delegate.VerifyApplicability): Don't use
1685         Invocation.VerifyArgumentCompat for parameter applicability
1686         testing.  Use Invocation.IsApplicable and
1687         Invocation.IsParamsMethodApplicable.
1688
1689 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
1690
1691         * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
1692         
1693         * class.cs (Operator.Define): Add error 217 report.
1694         
1695 2005-02-21  Raja R Harinath  <rharinath@novell.com>
1696
1697         * namespace.cs (UsingEntry.Resolve): Undo change below.
1698
1699 2005-02-21  Raja R Harinath  <rharinath@novell.com>
1700
1701         Fix #72756.
1702         * ecore.cs (Expression.MemberLookupFailed): Add argument to
1703         disable the error message when the extended MemberLookup also
1704         fails.
1705         (Expression.MemberLookupFinal): Update.
1706         (SimpleName.DoSimpleNameResolve): Update.
1707         * expression.cs (MemberAccess.ResolveNamespaceOrType):
1708         Don't use MemberLookupFinal.
1709         (New.DoResolve): Update.
1710         (BaseAccess.CommonResolve): Update.
1711
1712 2005-02-21  Raja R Harinath  <rharinath@novell.com>
1713
1714         Fix #72732.
1715         * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
1716         occured previously, don't resolve again.
1717
1718 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
1719
1720         Fix #69949
1721         * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
1722         argument. Call ResolveAttributeUsage for unresolved.
1723         when types doesn't match ctor arguments.
1724         
1725         * class.cs (DoDefineMembers.TypeContainer): Removed safety check
1726         for nested attribute classes.
1727         (Class.attribute_usage): Removed.
1728         (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
1729         for attribute class.
1730         
1731         * ecore.cs (IsAttribute): Removed.
1732         
1733         * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
1734         
1735         * rootcontext.cs (RegisterAttribute): Removed, attributes are
1736         now normal types.
1737         (attribute_types): Removed.
1738         (EmitCode): Global attributes are emited as the latest.
1739
1740 2005-02-18  Marek Safar  <marek.safar@seznam.cz>
1741
1742         * class.cs (EmitFieldInitializers): Don't emit field initializer
1743         for default values when optimilization is on.
1744         
1745         * constant.cs (Constant.IsDefaultValue): New property.
1746         
1747         * driver.cs: Add /optimize handling.
1748         
1749         * constant.cs,
1750         * ecore.cs,
1751         * literal.cs: Implement new IsDefaultValue property.
1752         
1753         * rootcontext.cs (Optimize): New field, holds /optimize option.
1754
1755 2005-02-18  Raja R Harinath  <rharinath@novell.com>
1756
1757         Fix crasher in re-opened #72347.
1758         * namespace.cs (Namespace.Lookup): Return null if
1759         DeclSpace.DefineType returns null.
1760
1761         Fix #72678.
1762         * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
1763
1764 2005-02-18  Raja R Harinath  <rharinath@novell.com>
1765
1766         Fix remainder of #63202.  Change semantics of DoResolveLValue: it
1767         now returns null if it cannot resolve to an lvalue.
1768         * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
1769         (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
1770         returned null.  Remove check for SimpleName.
1771         (EventExpr.DoResolveLValue): New.
1772         * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
1773         * expression.cs (Argument.Error_LValueRequired): New.  Move CS1510
1774         error from ...
1775         (Argument.Resolve): ... here.  Use it.  Use DoResolveLValue to
1776         avoid CS0131 error.
1777         (Unary.ResolveOperator): Move CS0211 check ...
1778         (Unary.DoResolve): ... here.  Use DoResolveLValue to avoid
1779         CS0131 error.
1780         (Unary.DoResolveLValue): Simplify.
1781         (AddressOf.DoResolveLValue): New.
1782         (ArrayAccess.DoResolveLValue): New.
1783
1784 2005-02-16  Marek Safar  <marek.safar@seznam.cz>
1785
1786         * attribute.cs (Attribute.Resolve): Add arguments casting for
1787         when types doesn't match ctor arguments.
1788
1789 2005-02-16  Raja R Harinath  <rharinath@novell.com>
1790
1791         Fix parts of #63202.
1792         * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
1793         lookup of operator in base type.  Ensure that all checks happen
1794         when the operator resolves to an "op_..." method.
1795
1796 2005-02-15  Raja R Harinath  <rharinath@novell.com>
1797
1798         Fix #71992.
1799         * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
1800         'ignore_cs0104' parameter.  Pass it to ...
1801         (NamespaceEntry.Lookup): ... this.
1802         * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
1803         * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
1804         (TypeLookupExpression.DoResolveAsTypeStep): Update.
1805         * expression.cs (MemberAccess.IdenticalNameAndTypeName):
1806         Update.  Request that cs0104 errors be ignored.
1807         (ComposedCast.ResolveAsTypeStep): Update.
1808
1809 2005-02-14  Raja R Harinath  <rharinath@novell.com>
1810
1811         Fix #59209.
1812         * expression.cs (Invocation.BetterFunction): Remove support for
1813         comparing virtual functions and their overrides.
1814         (Invocation.IsOverride): New.
1815         (Invocation.OverloadResolve): Don't consider 'override' functions
1816         during candidate selection.  Store them in a lookaside list.
1817         If the selected method is a 'virtual' function, use the list to
1818         find any overrides that are closer to the LHS type.
1819
1820 2005-02-14  Marek Safar  <marek.safar@seznam.cz>
1821
1822         * expression.cs (New.DoResolve): Add complex core type reduction.
1823         (New.Constantify): Converts complex core type syntax like 'new int ()'
1824         to simple constant.
1825         
1826 2005-02-14  Raja R Harinath  <rharinath@novell.com>
1827
1828         * decl.cs (EntryType.EntryType): New constructor to create an
1829         updated copy of a cache entry.
1830         (MemberCache.AddMethods): Use it.
1831         (MemberCache.ClearDeclaredOnly): Remove.
1832         (MemberCache.MemberCache): Update.
1833
1834 2005-02-11  Miguel de Icaza  <miguel@novell.com>
1835
1836         * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
1837         variable.  This one is represents the actual low-level declaration
1838         of the method, as opposed to the semantic level `IsStatic'.   
1839
1840         An anonymous method which is hosted into a static method might be
1841         actually an instance method.  IsStatic would reflect the
1842         container, while MethodIsStatic represents the actual code
1843         generated.
1844
1845         * expression.cs (ParameterReference): Use the new MethodIsStatic
1846         instead of IsStatic.
1847
1848         * anonymous.cs (AnonymousMethod.Compatible): Pass the
1849         Modifiers.STATIC to the Anonymous' Method EmitContext if static is
1850         set on the current EmitContext. 
1851
1852         * expression.cs (Cast): Overload DoResolveLValue so we can pass
1853         resolve our casted expression as an LValue.  This triggers the
1854         proper LValue processing that is later required by Assign.
1855
1856         This fixes 72347.
1857
1858         * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
1859
1860 2005-02-11  Marek Safar  <marek.safar@seznam.cz>
1861
1862         C# 2.0 Fixed buffer implementation
1863
1864         * anonymous.cs: Update after RegisterHelperClass renaming.
1865
1866         * attribute.cs (AttributeTester.fixed_buffer_cache):
1867         Cache of external fixed buffers.
1868         (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
1869         implementation if field is fixed buffer else null.
1870
1871         * class.cs
1872         (TypeContainer.AddField): Accept FieldMember instead of Field.
1873         (FieldBase.IsFieldClsCompliant): Extracted code from
1874         VerifyClsCompliance descendant customization.
1875         (FixedField): New class handles fixed buffer fields.
1876         (FixedFieldExternal): Keeps information about imported fixed
1877         buffer.
1878         (IFixedField): Make access to internal or external fixed buffer
1879         same.
1880
1881         * cs-parser.jay: Add fixed buffer parsing.
1882
1883         * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
1884         buffer.
1885
1886         * expression.cs (Indirection): Extended implementation to accept
1887         fixed buffer field.
1888         (PointerArithmetic.Emit): Get element from fixed buffer as well.
1889         (ElementAccess.MakePointerAccess): Get type as parameter.
1890         (DoResolve): Add fixed buffer field expression conversion.
1891         (DoResolveLValue): Ditto.
1892         (FixedBufferPtr): New class. Moved most of original ArrayPtr.
1893         (ArrayPtr): Derives from FixedBufferPtr.
1894         (ArrayPtr.Emit): Add extra emit for array elements.
1895
1896         * flowanalysis.cs.cs (StructInfo): Use FieldMember.
1897
1898         * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
1899         for compiler generated types.
1900         (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
1901
1902         * statement.cs (Fixed): Refactored to be easier add fixed buffer
1903         and consume less memory.
1904         (Fixed.Resolve): Add fixed buffer case.
1905
1906         * typemanager.cs (compiler_generated_attr_ctor,
1907         fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
1908         (HasElementType): Add our own implementation to work on every
1909         runtime.
1910
1911 2005-02-11  Miguel de Icaza  <miguel@novell.com>
1912
1913         * anonymous.cs (CaptureContext): Track whether `this' has been
1914         referenced.   
1915
1916         * expression.cs (This.ResolveBase): Call CaptureThis.  Before we
1917         only captured `this' if it was implicitly done (instance
1918         methods/variables were used). 
1919
1920         * codegen.cs (EmitContext.CaptureThis): New method to flag that
1921         `this' must be captured.
1922
1923 2005-01-30  Miguel de Icaza  <miguel@novell.com>
1924  
1925         * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
1926         is null it means that there has been no need to capture anything,
1927         so we just create a sibling.
1928
1929         Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
1930
1931         Just a partial fix.  The other half is fairly elusive.
1932         
1933 2005-02-10  Raja R Harinath  <rharinath@novell.com>
1934
1935         Fix #52586, cs0121-4.cs.
1936         * decl.cs (MemberCache.DeepCopy): Rename from SetupCache.  Take
1937         and return a hashtable.
1938         (MemberCache.ClearDeclaredOnly): New.
1939         (MemberCache.MemberCache): Update to change.  Make a deep copy of
1940         the method_hash of a base type too.
1941         (MemberCache.AddMethods): Adapt to having a deep copy of the base
1942         type methods.  Overwrite entries with the same MethodHandle so
1943         that the ReflectedType is correct.  The process leaves in base
1944         virtual functions and their overrides as distinct entries.
1945         (CacheEntry): Now a class instead of a struct.  It shouldn't alter
1946         matters since it was boxed in a ArrayList before.
1947         (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
1948         modifier.
1949         * expression.cs (Invocation.BetterFunction): Simplify.  Handle the
1950         case of a virtual function and its override (choose the overload
1951         as better).
1952         (Invocation.OverloadResolve): Avoid 'override' members during
1953         'applicable_type' calculation.
1954
1955 2005-03-28  Raja R Harinath  <rharinath@novell.com>
1956
1957         * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
1958         (TypeHandle.TypeHandle): Use LookupMemberCache rather than
1959         GetTypeHandle.  It is possible for a reflected type to derive from
1960         a TypeBuilder (e.g., int[] derives from the TypeBuilder
1961         System.Array during mscorlib compilation).
1962         * decl.cs (MemberCache.MemberCache): If the base cache doesn't
1963         contain a method_hash, don't create one either.  Don't create a
1964         deep copy of the base cache's method_hash.
1965         (MemberCache.SetupCache): Rename back from DeepCopy.
1966         (MemberCache.AddMethods): Rewrite, now that method_hash isn't
1967         already initialized.  If we see an override function, add its
1968         underlying base virtual function to the member_hash too.
1969
1970 2005-02-09  Raja R Harinath  <rharinath@novell.com>
1971
1972         Combine two near-redundant caches.
1973         * typemanager.cs (method_params): Rename from method_internal_params.
1974         (TypeManager.GetParameterData): New.  Replace
1975         Invocation.GetParameterData.
1976         (TypeManager.LookupParametersByBuilder): Remove.
1977         * expression.cs (Invocation.method_parameter_cache): Remove.
1978         (Invocation.GetParameterData): Remove.
1979         Update to changes.
1980         * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
1981         Update to changes.
1982
1983 2005-02-08  Raja R Harinath  <rharinath@novell.com>
1984
1985         Fix #72015.
1986         * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
1987         TypeManager.multicast_delegate_type is null, resolve it by looking
1988         up "System.MulticastDelegate".
1989         * rootcontext.cs (RootContext.ResolveCore): Simplify.
1990
1991 2005-02-07  Abin Thomas (NOSIP)  <projectmonokochi@rediffmail.com>
1992             Anoob V.E (NOSIP)  <projectmonokochi@rediffmail.com>
1993             Harilal P.R (NOSIP)  <projectmonokochi@rediffmail.com>
1994
1995         Fix cs0164.cs.
1996         * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
1997         (LabeledStatement.AddReference): New.  Set 'referenced'.
1998         (Goto.Resolve): Use it.
1999
2000 2005-02-05  John Luke  <john.luke@gmail.com>
2001
2002         * driver.cs: remove duplicate -doc line in Usage ()
2003
2004 2005-02-04  Raja R Harinath  <rharinath@novell.com>
2005
2006         * location.cs (Location.AddFile): Fix CS2002 error report.
2007
2008 2005-02-02  Martin Baulig  <martin@ximian.com>
2009
2010         * delegate.cs (Delegate.DefineType): Report an internal error if
2011         TypeManager.multicast_delegate_type is null.  See bug #72015 for
2012         details.        
2013
2014 2005-02-02  Raja R Harinath  <rharinath@novell.com>
2015
2016         Fix a crasher in a variant of #31984.
2017         * const.cs (Constant.CheckBase): New override that defers the
2018         new-or-override check in case the base type hasn't been populated
2019         yet.
2020         (Constant.Define): Ensure the new-or-override check is performed.
2021
2022 2005-02-01  Duncan Mak  <duncan@ximian.com>
2023
2024         * const.cs (LookupConstantValue): Check that `ce' is not null
2025         before calling GetValue ().
2026
2027 2005-02-01  Raja R Harinath  <rharinath@novell.com>
2028
2029         Fix test-334.cs (#69519).
2030         * cs-parser.jay (using_alias_directive): Pass in an expression to
2031         NamespaceEntry.UsingAlias.
2032         (using_namespace_directive): Pass in an expression to
2033         NamespaceEntry.Using.
2034         (namespace_name): Don't flatten to a string.
2035         * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
2036         (NamespaceEntry.AliasEntry.Resolve): Lookup using
2037         ResolveAsTypeStep.
2038         (NamespaceEntry.UsingEntry): Likewise.
2039         (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
2040         changes.
2041         (NamespaceEntry.LookupForUsing): Remove.
2042         (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
2043         names.
2044         (NamespaceEntry.Lookup): Remove support for dotted names.
2045
2046 2005-02-01  Raja R Harinath  <rharinath@novell.com>
2047
2048         * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
2049         split into two.
2050         (NamespaceEntry.ImplicitParent): Compute on demand.
2051         (NamespaceEntry.Doppelganger): New implicit namespace-entry that
2052         parallels the current.
2053         (NamespaceEntry.LookupForUsing): Use it.
2054         (NamespaceEntry.Lookup): If the current namespace-entry is
2055         implicit, don't search aliases and using tables.
2056
2057 2005-02-01  Raja R Harinath  <rharinath@novell.com>
2058
2059         Fix #31984.
2060         * class.cs (TypeContainer.DoDefineMembers): Don't initialize
2061         BaseCache here.
2062         (TypeContainer.BaseCache): Compute on demand.
2063         (TypeContainer.FindMembers): Define constants and types if they're
2064         not already created.
2065         (FieldMember.Define): Move resetting of ec.InUnsafe before error
2066         check.
2067         * const.cs (Constant.Define): Make idempotent.
2068
2069 2005-01-29  Miguel de Icaza  <miguel@novell.com>
2070
2071         * pending.cs: Produce better code (no nops produced by using Ldarg
2072         + value).
2073         
2074         * pending.cs (PendingImplementation.DefineProxy): It was not `arg
2075         i - 1' it should be arg + 1.
2076
2077         Fixes bug #71819.
2078
2079 2005-01-28  Raja R Harinath  <rharinath@novell.com>
2080
2081         * attribute.cs (Attribute.CheckAttributeType): Make private
2082         non-virtual.
2083         (Attribute.ResolveType): Make virtual.
2084         (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
2085         handling of RootContext.Tree.Types.
2086
2087 2005-01-27  Raja R Harinath  <rharinath@novell.com>
2088
2089         Update attribute-handling to use the SimpleName/MemberAccess
2090         mechanisms.
2091         * cs-parser.jay (attribute): Pass in an expression to the
2092         constructors of Attribute and GlobalAttribute.
2093         * attribute.cs (Attribute): Take an expression for the name.
2094         (Attribute.ResolvePossibleAttributeTypes): New.  Resolves the
2095         passed in attribute name expression.
2096         (Attribute.CheckAttributeType): Use it.
2097         * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
2098         * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
2099         (MemberAccess.ResolveNamespaceOrType): ... here.  Add 'silent'
2100         argument to prevent error messages if the lookup fails.
2101
2102 2005-01-27  Marek Safar  <marek.safar@seznam.cz>
2103
2104         * expression.cs (Indirection): Implemented IVariable interface
2105         to support indirection in AddressOf operator.
2106         (PointerArithmetic.Emit): Add optimalization for case where
2107         result can be precomputed.
2108
2109 2005-01-26  Martin Baulig  <martin@ximian.com>
2110
2111         * class.cs (TypeContainer.AttributeTargets): Return the correct
2112         AttributeTargets depending on our `Kind' instead of throwing an
2113         exception; fixes #71632.
2114
2115 2005-01-26  Marek Safar  <marek.safar@seznam.cz>
2116
2117         Fix #71257
2118         * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
2119         constant members.
2120
2121 2005-03-17  Martin Baulig  <martin@ximian.com>
2122
2123         * anonymous.cs (AnonymousMethod.method_modifiers): Change default
2124         from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'.  Fixes #73260.
2125
2126 2005-03-17  Martin Baulig  <martin@ximian.com>
2127
2128         * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
2129         to bool so we can return an error condition.
2130         (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
2131         returned an error.
2132
2133 2005-03-17  Martin Baulig  <martin@ximian.com>
2134
2135         * generic.cs (TypeMananager.IsIEnumerable): New public method.
2136
2137         * convert.cs (Convert.ImplicitReferenceConversion(Exists)): Allow
2138         converting from an array-type of T to `IEnumerable<T>'.
2139
2140 2005-03-16  Martin Baulig  <martin@ximian.com>
2141
2142         * generic.cs (Nullable.Unwrap): Implement IAssignMethod.
2143         (Nullable.LiftedUnaryMutator): New public class.
2144
2145         * expression.cs (UnaryMutator.DoResolve): Added support for
2146         Nullable Types.
2147
2148 2005-03-14  Martin Baulig  <martin@ximian.com>
2149
2150         * generic.cs (Nullable.NullCoalescingOperator): Implemented.
2151
2152 2005-03-14  Martin Baulig  <martin@ximian.com>
2153
2154         * generic.cs (Nullable.LiftedBinaryOperator): Added support for
2155         the comparision operators `<', `>', `<=' and `>='.
2156
2157 2005-03-13  Martin Baulig  <martin@ximian.com>
2158
2159         * generic.cs
2160         (Nullable.NullLiteral): Renamed to `Nullable.NullableLiteral' to
2161         avoid confusion with the `NullLiteral'.
2162         (Nullable.LiftedBinaryOperator): Correctly implement `==' and '!='.
2163
2164 2005-03-13  Martin Baulig  <martin@ximian.com>
2165
2166         * expression.cs (Binary.ResolveOperator): For `==' and `!=', allow
2167         comparing arbitrary types with the null literal.
2168
2169 2005-03-13  Martin Baulig  <martin@ximian.com>
2170
2171         * generic.cs (Nullable.LiftedBinaryOperator): Add support for the
2172         boolean operators '&&', '||', '&' and '|'.
2173         (Nullable.OperatorTrueOrFalse): New public class.
2174
2175         * ecore.cs (Expression.GetOperatorTrue/False): Return an `Expression'
2176         instead of a `StaticCallExpr'; added support for nullables.
2177
2178 2005-03-10  Martin Baulig  <martin@ximian.com>
2179
2180         * expression.cs
2181         (ArrayAccess.EmitDynamicInitializers): Use `etype.IsValueType'
2182         rather than `etype.IsSubclassOf (TypeManager.value_type)'.      
2183
2184 2005-03-07  Martin Baulig  <martin@ximian.com>
2185
2186         * generic.cs (Nullable.Unwrap): Implement IMemoryLocation and make
2187         it work if `expr' is not an IMemoryLocation.
2188         (Nullable.Lifted): Implement IMemoryLocation.
2189         (Nullable.LiftedConversion.ResolveUnderlying): Use the correct
2190         target type.
2191
2192 2005-03-05  Martin Baulig  <martin@ximian.com>
2193
2194         * generic.cs (Nullable.Unwrap, Wrap): New protected classes.
2195         (Nullable.Lifted): New abstract class; rewrote the lifted conversions.
2196         (Nullable): Added support for lifted unary and binary operators.
2197
2198         * expression.cs (Unary.DoResolve): Added support for nullable types.
2199         (Binary.DoResolve): Likewise.
2200         (Conditional.DoResolve): Likewise.
2201
2202 2005-03-02  Martin Baulig  <martin@ximian.com>
2203
2204         * decl.cs (DeclSpace.SetParameterInfo): Make this virtual.
2205
2206         * class.cs (ClassPart.SetParameterInfo): Override this.
2207         (PartialContainer.SetParameterInfo): Override this.
2208         (TypeContainer.CheckConstraints): New protected method.
2209         (PartialContainer.CheckConstraints): Override this and check
2210         whether the same contraints were specified in all parts of a
2211         partial generic type definition.
2212         (PartialContainer.UpdateConstraints): New public method.
2213
2214         * generic.cs (TypeParameter.UpdateConstraints): New public method.
2215
2216 2005-03-02  Martin Baulig  <martin@ximian.com>
2217
2218         Committing a patch from Carlos Alberto Cortez to fix #72887.
2219
2220         * convert.cs (Convert.ExplicitReferenceConversionExists): Allow
2221         casts from `T []' to `int []'.
2222
2223 2005-03-02  Martin Baulig  <martin@ximian.com>
2224
2225         * generic.cs (TypeManager.IsEqual): Make this symmetric.
2226
2227         * expression.cs (Binary.ResolveOperator): When resolving a
2228         BinaryDelegate, use `TypeManager.IsEqual (l, r)' rather than just
2229         `=='.  Fixes #71866.  See gen-127.cs.
2230
2231 2005-03-02  Martin Baulig  <martin@ximian.com>
2232
2233         * class.cs (TypeContainer.DoDefineMembers): We also need a default
2234         static constructor in static classes.
2235
2236 2005-03-02  Martin Baulig  <martin@ximian.com>
2237
2238         * generic.cs
2239         (NullableType.Name, NullableType.FullName): Add a "?" to the name.
2240         (Nullable.LiftedConversion): Added support for user-defined
2241         conversions.
2242
2243         * cs-tokenizer.cs (Tokenizer.PutbackCloseParens): New public method.
2244
2245         * cs-parser.jay: Use ComposedCast everywhere instead of
2246         NullableType, so we don't need to check for NullableType
2247         everywhere.
2248         (conditional_expression): Added `INTERR CLOSE_PARENS' rule for the
2249         case where we'll be resolved into a `parenthesized_expression_0'
2250         afterwards.
2251
2252         * convert.cs
2253         (Convert.UserDefinedConversion): Added nullable conversions.
2254
2255 2005-02-28  Martin Baulig  <martin@ximian.com>
2256
2257         * generic.cs (TypeManager.IsNullableType): New static method.
2258         (Nullable): New abstract class.
2259         (Nullable.NullLiteral): New public class.
2260         (Nullable.LiftedConversion): New public class.
2261
2262         * cs-parser.jay (non_expression_type): Changed `builtin_types' to
2263         `builtin_types opt_nullable'.
2264
2265         * convert.cs
2266         (Convert.ImplicitConversionStandard): Added nullable conversions.
2267         (Convert.ExplicitConversionStandard): Likewise.
2268         (Convert.ExplicitConversion): Likewise.
2269
2270 2005-02-26  Martin Baulig  <martin@ximian.com>
2271
2272         * expression.cs (ComposedCast.DoResolveAsTypeStep): Allow `dim' to
2273         begin with a "?", for instance "?[]".  Don't do a type lookup if
2274         `dim' is empty.
2275
2276 2005-02-25  Martin Baulig  <martin@ximian.com>
2277
2278         The first part of Nullable Types :-)
2279
2280         * generic.cs (NullableType): New public class.
2281         (NullCoalescingOperator): New public class.
2282         (TypeArguments.Resolve): Add a CS0306 check.
2283
2284         * cs-parser.jay (opt_error_modifier): Removed, this was unused.
2285         (opt_nullable): New rule.
2286         (type): Added `opt_nullable' to `namespace_or_type_name',
2287         `builtin_types' and `pointer_type'.
2288         (array_type): Added `opt_nullable'.
2289         (opt_rank_specifier_or_nullable): New rule; this is the
2290         combination of `opt_rank_specifier' and `opt_nullable'.
2291         (opt_error): New rule; catch errors here.
2292         (nullable_type_or_conditional): New rule; we use this to check for
2293         nullable and still detect the conditional operator.
2294         (local_variable_type): Use `opt_rank_specifier_or_nullable'
2295         instead `opt_rank_specifier'.
2296
2297         * expression.cs (ComposedCast.DoResolveAsTypeStep): Added support
2298         for nullables.
2299
2300 2005-02-24  Martin Baulig  <martin@ximian.com>
2301
2302         * README, README.Changes: Removed; they're old and obsolete.
2303
2304 2005-02-22  Martin Baulig  <martin@ximian.com>
2305
2306         * generic.cs (TypeParameter.Resolve): If resolving the constraints
2307         returned an error, set `constraints' to null to avoid a crash
2308         later on.
2309         (TypeParameter.ResolveType): Likewise.
2310
2311 2005-02-22  Martin Baulig  <martin@ximian.com>
2312
2313         * generic.cs
2314         (Constraints.ResolveTypes): Protect against being called twice.
2315         (Constraints.CheckInterfaceMethod): Don't call ResolveTypes().
2316         (TypeParameter.ResolveType): New public method; calls
2317         constraints.ResolveTypes().
2318         (TypeParameter.DefineType): Moved constraints.ResolveType() out
2319         into the new ResolveType().
2320         (GenericMethod.Define): Call ResolveType() on all our
2321         TypeParameter's.        
2322
2323 2005-02-21  Martin Baulig  <martin@ximian.com>
2324
2325         * generic.cs
2326         (TypeManager.generic_nullable_type): New static public field.
2327         (TypeManager.InitGenericCoreType): Lookup "System.Nullable`1".
2328
2329         * rootcontext.cs
2330         (RootContext.ResolveCore): Resolve "System.Nullable`1".
2331
2332 2005-02-15  Martin Baulig  <martin@ximian.com>
2333
2334         * generic.cs (ConstructedType.Constraints): Correctly check
2335         constraints if the argument type is a type parameter; fixes
2336         #72326. 
2337
2338 2005-02-02  Martin Baulig  <martin@ximian.com>
2339
2340         * delegate.cs (Delegate.DefineType): Report an internal error if
2341         TypeManager.multicast_delegate_type is null.  See bug #72015 for
2342         details.        
2343
2344 2005-01-29  Miguel de Icaza  <miguel@novell.com>
2345
2346         * pending.cs: Produce better code (no nops produced by using Ldarg
2347         + value).
2348         
2349         * pending.cs (PendingImplementation.DefineProxy): It was not `arg
2350         i - 1' it should be arg + 1.
2351
2352         Fixes bug #71819.
2353         
2354 2005-01-26  Martin Baulig  <martin@ximian.com>
2355
2356         * cs-parser.jay (indexer_declarator): Don't report an error if we
2357         have type parameters since we can be an explicit interface
2358         implementation; fixes #71449.
2359
2360 2005-01-26  Martin Baulig  <martin@ximian.com>
2361
2362         * class.cs (TypeContainer.AttributeTargets): Return the correct
2363         AttributeTargets depending on our `Kind' instead of throwing an
2364         exception; fixes #71632.
2365
2366 2005-01-26  Martin Baulig  <martin@ximian.com>
2367
2368         * delegate.cs (Delegate.DefineType): Correctly define our type
2369         parameters.  Fixes #71483.
2370
2371 2005-01-25  Raja R Harinath  <rharinath@novell.com>
2372
2373         Fix #71602.
2374         * expression.cs (MemberAccess.DoResolve): Don't complain with
2375         cs0572 when the LHS of a member access has identical name and type
2376         name.
2377
2378 2005-01-25  Marek Safar  <marek.safar@seznam.cz>
2379
2380         Fix #71651, #71675
2381         * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
2382         CreatePermission.
2383         Create custom PermissionSet only for PermissionSetAttribute.
2384
2385 2005-01-24  Marek Safar  <marek.safar@seznam.cz>
2386
2387         Fix #71649
2388         * class.cs (StaticClass.DefineContainerMembers): Enable enums and
2389         delegates in static class.
2390
2391 2005-01-24  Martin Baulig  <martin@ximian.com>
2392
2393         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
2394         merging an implicit block, just use its reachability.
2395
2396         * statement.cs (Block.Resolve): Make the unreachable code check
2397         work wrt. implicit blocks; see test-337 from #63842.
2398
2399 2005-01-21  Alp Toker  <alp@atoker.com>
2400  
2401         * cs-parser.jay: destructor_declaration's container is PartialContainer
2402         not Class when partial types are used, so use Kind prop instead of
2403         'is'.
2404         
2405 2005-01-22  Miguel de Icaza  <miguel@ximian.com>
2406
2407         * cs-parser.jay: Improve error reporting when an interface
2408         declares new types.
2409
2410 2005-01-20  Dick Porter  <dick@ximian.com>
2411
2412         * support.cs: SeekableStreamReader fix from Sandor Dobos
2413         (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
2414         chars are read.  Fixes bug 70369.
2415
2416 2005-01-20  Raja R Harinath  <rharinath@novell.com>
2417
2418         * cs-parser.jay (catch_clause): Simplify current_block handling
2419         somewhat.
2420
2421 2005-01-17  Miguel de Icaza  <miguel@ximian.com>
2422
2423         * convert.cs (ImplicitStandardConversionExists): Synchronize the
2424         code with ImplicitStandardConversion to handle the implicit
2425         conversion of method groups into valid delegate invocations. 
2426
2427         The problem is that in parameter handling we were using this code
2428         path.  Fixes bug #64698
2429
2430 2005-01-19  Raja R Harinath  <rharinath@novell.com>
2431
2432         * cs-parser.jay: Fix several infelicities.
2433         - Avoid assigning to the parser value stack.  Code like 
2434           '$3 = null' is unclean.  Synthesize a value for the code block
2435           instead. 
2436         - Avoid using oob_stack for storing location information.  Use ...
2437         (_mark_): ... this.  New (empty) rule.  Saves the current location
2438         in $$.
2439         (foreach_statement): Avoid using oob_stack for current_block
2440         handling.  Use technique used in for_statement and
2441         using_statement.  Synthesize a value for the code block to store
2442         additional intermediate information.
2443
2444 2005-01-13  Miguel de Icaza  <miguel@ximian.com>
2445
2446         * ecore.cs (IsAccessorAccessible): Accessibility to private fields
2447         of a different type is only allowed to private fields of a
2448         containing type, not on fields of a base class.
2449
2450         See test-174.cs and error cs0122-9.cs
2451
2452 2005-01-13  Raja R Harinath  <rharinath@novell.com>
2453
2454         Fix test-335.cs (bug #58126).
2455         * cs-parser.jay (argument): Split out non-expression parts of the
2456         rule into 'non_simple_argument'.
2457         (invocation_expression): Support parenthesized invocations with
2458         multiple arguments, and with single non-simple arguments.
2459
2460 2005-01-13  Raja R Harinath  <rharinath@novell.com>
2461
2462         * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
2463         places.
2464
2465 2005-01-12  Raja R Harinath  <rharinath@novell.com>
2466
2467         Fix cs0038-1.cs, cs1640-6.cs.
2468         * ecore.cs (Expression.Resolve): Remove special-case for
2469         SimpleName in error-handling.
2470         (Expression.almostMatchedMembers): Relax access permission to
2471         protected.
2472         (Expression.MemberLookupFailed): Handle duplicates in
2473         almostMatchedMembers list.
2474         (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
2475         * expression.cs (New.DoResolve): Report CS1540 for more cases.
2476         * typemanager.cs (GetFullNameSignature): Use the MethodBase
2477         overload if the passed in MemberInfo is a MethodBase.
2478
2479 2005-01-25  Martin Baulig  <martin@ximian.com>
2480
2481         * doc.cs
2482         (DocUtil.emptyParamList): Removed; use `Type.EmptyTypes' instead.
2483
2484 2005-01-12  Marek Safar  <marek.safar@seznam.cz>
2485
2486         Fix #70749
2487         * attribute.cs (ExtractSecurityPermissionSet): Don't report error
2488         for non-CAS & merge permission sets properly.
2489
2490 2005-01-11  Raja R Harinath  <rharinath@novell.com>
2491
2492         Improve standard-compliance of simple name and member access 
2493         resolution.  Fixes bugs #52697, #57200, #67520, #69519.
2494         * ecore.cs (FullNamedExpression): New abstract base class 
2495         for Namespaces and TypeExpressions.
2496         (ResolveFlags.SimpleName): Remove.
2497         (SimpleName): Remove support for dotted names.
2498         (SimpleName.ResolveAsTypeStep): Simplify.  Now just a wrapper to 
2499         DeclSpace.FindType and DeclSpace.LookupType.
2500         (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
2501         (Expression.ExprClassName): Make member function.
2502         * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
2503         a namespace.  Remove creation of dotted "SimpleName"s.
2504         (MemberAccess.DoResolve): Likewise.
2505         * decl.cs (DeclSpace.Cache): Make private.
2506         (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
2507         (DeclSpace.FindType): Update.
2508         (DeclSpace.LookupType): Move here from RootContext.  Return a 
2509         FullNamedExpression.
2510         * namespace.cs (Namespace): Derive from FullNamedExpression
2511         so that it can be part of expression resolution.
2512         (Namespace.Lookup): Return an FullNamedExpression.
2513         (NamespaceEntry.LookupAlias): Lookup aliases only in current
2514         namespace.
2515         * rootcontext.cs (NamespaceLookup): Remove.
2516         (LookupType): Move to DeclSpace.
2517         * attribute.cs (CheckAttributeType): Update.
2518         * doc.cs (FindDocumentedType): Remove allowAlias argument.
2519         (FindDocumentedTypeNonArray): Likewise.
2520
2521 2005-01-11  Raja R Harinath  <rharinath@novell.com>
2522
2523         Fix cs0509.cs, cs1632.cs.
2524         * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
2525         is the same as IsInterface.
2526         (TypeContainer.GetClassBases): Likewise.
2527         * statement.cs (LabeledStatement.ig): New field.
2528         (LabeledStatement.LabelTarget): Save ILGenerator which created the
2529         label.
2530         (LabeledStatement.DoEmit): Check that the label was created with
2531         the same ILGenerator.
2532
2533 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
2534
2535         Fix #71058
2536         * attribute.cs (GetMethodObsoleteAttribute): Need to transform
2537         accessors to its properties.
2538
2539         * ecore.cs (PropertyExpr): Add AccessorTable to help track back
2540         from accessors to property.
2541         
2542 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
2543
2544         Fix #70722
2545         * class.cs (MethodCore.CheckBase): Test base method obsoleteness
2546         only for overrides.
2547         
2548 2005-01-08  Miguel de Icaza  <miguel@ximian.com>
2549
2550         * attribute.cs: Check for null and empty strings.  
2551
2552         I have lost another battle to Paolo.
2553
2554 2005-01-07  Marek Safar  <marek.safar@seznam.cz>
2555
2556         Fix #70942
2557         * class.cs (PropertyMethod): Set Parent field in ctors.
2558         (SetMethod.InternalParameters): Add unsafe switch hack.
2559         Override MarkForDuplicationCheck where it is appropriate.
2560
2561         * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
2562         It says whether container allows members with the same name.
2563         Base default is no.
2564         (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
2565         Removed is_method parameter.
2566
2567 2005-01-06  Duncan Mak  <duncan@ximian.com>
2568
2569         * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
2570         because the previous change led to incorrect reporting of CS1032
2571         ("Cannot define/undefine preprocessor symbols after first token in
2572         file"). Instead of using `tokens_seen' as the only flag that
2573         triggers CS1040, introduce `comments_seen'. This new flag is used
2574         to signify having seen comments on the current line, so it is
2575         unset after a newline.
2576
2577 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
2578
2579         * doc.cs : When searching for a type, find nested type too.
2580           This fixes bug #71040.
2581
2582 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
2583
2584         * doc.cs :
2585           - Warn missing member comment on those classes which also does not
2586             have doc comments. Fixed bug #71041.
2587           - Don't warn missing doc comment on default constructor.
2588             Fixed bug #71042.
2589
2590 2005-01-06  Duncan Mak  <duncan@ximian.com>
2591
2592         * cs-tokenizer.cs (xtoken): After handling traditional C-style
2593         comments, set `tokens_seen' to true. This allows us to detect
2594         misplaced preprocessor directives (i.e. not at the beginning of
2595         the a line, nor after whitespaces). In that case, report error
2596         CS1040. This fixes bug #56460.
2597
2598         * cs-parser.jay (interface_member_declaration): Add checks for
2599         IsExplicitImpl, and report CS0541 error if an interface member is
2600         defined as an explicit interface declaration.
2601
2602 2005-01-06  Marek Safar  <marek.safar@seznam.cz>
2603
2604         Fix #70817
2605         * class.cs (PropertyMethod): Set Parent field in ctors.
2606         (SetMethod.InternalParameters): Add unsafe switch hack.
2607         
2608         * decl.cs (MemberCore.Parent): Cannot be readonly.
2609
2610 2005-01-06  Raja R Harinath  <rharinath@novell.com>
2611
2612         * decl.cs (DeclSpace.ResolveType): Remove.
2613         (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
2614         Merge in code from ...
2615         (DeclSpace.GetTypeResolvingEmitContext): ... here.  Remove.
2616         * class.cs, enum.cs: Update to changes.
2617
2618 2005-01-06  Miguel de Icaza  <miguel@ximian.com>
2619
2620         * anonymous.cs: Ensure that we init the scope of our parent if it
2621         has not been initialized yet.
2622
2623 2004-12-30  Duncan Mak  <duncan@ximian.com>
2624
2625         * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
2626         if field.FieldBuilder is null. Fixes #70758.
2627
2628         * convert.cs: Fixed some typos and updated some of the comments.
2629         (ImplicitStandardConversionExists):
2630         (TryImplicitIntConversion): If `target_type' is an interface and
2631         the type of `ic' implements this interface, return true or a new
2632         BoxedCast instead of null. This fixes #70468.
2633
2634 2004-12-29  Duncan Mak  <duncan@ximian.com>
2635
2636         * expression.cs (Argument.Emit): Check that Expr is
2637         IMemoryLocation before casting to it, and report CS1510 otherwise.
2638
2639         This fixes #70402.
2640
2641 2004-12-21  Ben Maurer  <bmaurer@ximian.com>
2642
2643         * statement.cs (Block.ThisVariable): remove the recursion here, to
2644         make the --profile more sane.
2645
2646 2004-12-17  Carlos Cortez <calberto.cortez@gmail.com>
2647
2648         * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
2649         assembly, by JB Evain.
2650
2651 2004-12-17  Raja R Harinath  <rharinath@novell.com>
2652
2653         * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs, 
2654           rootcontext.cs, typemanager.cs: Make nomenclature consistent.
2655         "parent" refers to enclosing type/class.  "base" refers to superclass.
2656
2657 2004-12-17  Raja R Harinath  <rharinath@novell.com>
2658
2659         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
2660         Ensure that we only have GlobalAttributes.
2661         * attribute.cs (Attribute.Emit): Make non-virtual.
2662         (GlobalAttribute.Emit): Remove.
2663         (Attribute.Resolve): Make virtual.
2664         (GlobalAttribute.Resolve): New.  Set Rootcontext.Tree.Types.NamespaceEntry.
2665         (Attribute.GetConditionalAttributeValue): Take an EmitContext as
2666         the argument. Don't create one.
2667         (Attribute.GetObsoleteAttribute): Likewise.
2668         (Attribute.GetClsCompliantAttributeValue): Likewise.
2669         * class.cs, decl.cs: Update to changes.
2670
2671 2004-12-17  Marek Safar  <marek.safar@seznam.cz>
2672
2673         * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
2674         
2675         * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
2676         
2677         * statement.cs (Foreach.Resolve): Add error 186 report.
2678
2679 2004-12-16  Marek Safar  <marek.safar@seznam.cz>
2680
2681         * expression.cs (Conditional.DoResolve): Add warning 429.
2682         
2683         * statement.cs (If.Resolve): Add warning 665.
2684
2685 2004-12-16  Raja R Harinath  <rharinath@novell.com>
2686
2687         New invariant: RootContext.Tree.Types.NamespaceEntry == null
2688         except when in the parser, and in GlobalAttribute.
2689         * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
2690         * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
2691         RootContext.Tree.Types.NamespaceEntry once work is done.
2692         (GlobalAttribute.Emit): New.  Wrapper for Attribute.Emit, but sets
2693         and resets RootContext.Tree.Types.NamespaceEntry.
2694
2695 2004-12-15  Marek Safar  <marek.safar@seznam.cz>
2696
2697         * cs-parser.jay: Don't create a block for every variable.
2698
2699 2004-12-14  Miguel de Icaza  <miguel@ximian.com>
2700
2701         * location.cs: Provide extra information.
2702
2703         * statement.cs: The instance is not `ldarg_0.THIS' when accessing
2704         variables from the captured environment, it is the ldarg_0.
2705
2706 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
2707
2708         * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
2709         find a conclusion.
2710         
2711         * class.cs: Changed warning level for 169 to avoid developer
2712         displeasure from warning flooding. It will be changed back when they
2713         fix most of current BCL warnings.
2714         
2715         * RootContext.cs: Pushed default WarningLevel to 3.
2716         
2717         * statement.cs: Removed unused variable.
2718
2719 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
2720
2721         * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
2722         (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
2723         Add error 502 report.
2724         (StaticClass.DefineType): Add error 441 report.
2725         (Class.AllowedModifiersProp): New virtual property as temporary
2726         extension to AllowedModifiers.
2727         (Class.DefineType): Add error 418 report. Moved ModFlags check here
2728         to share implementation with StaticClass and don't call virtual
2729         methods from ctor.
2730         
2731         * driver.cs (MainDriver): Add error 1558 test.
2732
2733         * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
2734         report. Moved error 36 test here.
2735
2736         * statement.cs (Throw.Resolve): Add error 724 report.
2737
2738         * typemanager.cs: Add out_attribute_type core type.
2739         
2740 2004-12-13  Marek Safar  <marek.safar@seznam.cz>
2741
2742         * class.cs (TypeContainer.VerifyClsCompliance): Add error
2743         3018 report.
2744         (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
2745
2746         * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
2747         3017 report.
2748         
2749         * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
2750
2751         * parameter.cs (ReturnParameter.ApplyAttributeBuilder): 
2752         Add error 3023 report.
2753         (Parameter.ApplyAttributeBuilder): Add error 3022 report.
2754
2755         * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
2756         implementation.
2757
2758 2004-12-12  John Luke  <john.luke@gmail.com>
2759
2760         * driver.cs (AddArgs): take -- into account when
2761         adding arguments, fixes bug 65710 
2762
2763 2004-12-12  Martin Baulig  <martin@ximian.com>
2764
2765         * expression.cs (Unary.TryReduceNegative): Added support for
2766         SByteConstant and ByteConstant.
2767         (Unary.Reduce): Check error values from TryReduceNegative().
2768
2769 2004-12-10  Marek Safar  <marek.safar@seznam.cz>
2770
2771         * attributes.cs (Attribute.Resolve): Avoid multiple error report
2772         and report exception as error 182.
2773
2774 2004-12-10  Raja R Harinath  <rharinath@novell.com>
2775
2776         * driver.cs (Main): Fix message when there are warnings.
2777
2778 2004-12-09  Miguel de Icaza  <miguel@ximian.com>
2779
2780         * delegate.cs: Fixed my fix from yesterday, sorry about that.
2781
2782 2004-12-09  Marek Safar  <marek.safar@seznam.cz>
2783
2784         * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs: 
2785         Reduced number of warnings.
2786         
2787         * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
2788
2789 2004-12-08  Miguel de Icaza  <miguel@ximian.com>
2790
2791         * driver.cs: Removed message.
2792
2793         * delegate.cs: Fix bug introduced in 1.1.x: 70219.
2794
2795 2004-12-08    <vargaz@freemail.hu>
2796
2797         * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
2798
2799 2004-12-08  Martin Baulig  <martin@ximian.com>
2800
2801         * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
2802         instead of a CS3002 for properties and indexer.
2803
2804 2004-12-08  Martin Baulig  <martin@ximian.com>
2805
2806         * decl.cs (MemberName.ToString): Make this work again.
2807
2808 2004-12-08  Marek Safar  <marek.safar@seznam.cz>
2809
2810         * attribute.cs (Resolve): Add error 591 detection.
2811
2812         * class.cs (FieldMember.Define): Add error 1547 detection.
2813         (Indexer.Define): Add error 620 detection.
2814         (Operator.Define): Add error 590 detection.
2815
2816         * ecore.cs: Missing argument for error 79.
2817
2818         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
2819         detection.
2820
2821 2004-12-07  Marek Safar  <marek.safar@seznam.cz>
2822
2823         Fix #70106
2824         * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
2825         only.
2826
2827 2004-12-07  Atsushi Enomoto  <atsushi@ximian.com>
2828
2829         * cs-parser.jay : handle doc comments on implicit/explicit operators.
2830           Some operator comments were suppressed.
2831         * doc.cs : Implicit/explicit operator name in doc comments are like
2832           "op_Explicit(type)~returnType", so added suffix handling.
2833
2834 2005-01-21  Alp Toker  <alp@atoker.com>
2835
2836         * cs-parser.jay: destructor_declaration's container is PartialContainer
2837         not Class when partial types are used, so use Kind prop instead of 'is'.
2838
2839 2004-12-12  Martin Baulig  <martin@ximian.com>
2840
2841         * expression.cs (Unary.TryReduceNegative): Added support for
2842         SByteConstant and ByteConstant.
2843         (Unary.Reduce): Check error values from TryReduceNegative().
2844
2845 2004-12-11  Martin Baulig  <martin@ximian.com>
2846
2847         * support.cs (ReflectionParameters.ParameterName): If we have a
2848         `gpd', call `ParameterName' on it.
2849
2850         * parameter.cs (Parameter.GetParameterAttributes): New static method.
2851
2852         * pending.cs (PendingImplementation.DefineProxy): Call
2853         DefineParameter() for all of the MethodBuilder's arguments.
2854
2855 2004-12-09  Martin Baulig  <martin@ximian.com>
2856
2857         * doc.cs (DocUtil): Make this a static class.
2858
2859 2004-12-09  Martin Baulig  <martin@ximian.com>
2860
2861         * expression.cs (Invocation.InferType): Moved the type inference
2862         implementation into TypeManager.
2863
2864         * generics.cs (TypeManager): Moved the type inference
2865         implementation here.
2866
2867 2004-12-09  Martin Baulig  <martin@ximian.com>
2868
2869         * typemanager.cs (TypeManager): Make this a partial class.
2870
2871         * generics.cs
2872         (TypeManager): Move the generics part of `TypeManager' here.
2873
2874 2004-12-08  Martin Baulig  <martin@ximian.com>
2875
2876         * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
2877         instead of a CS3002 for properties and indexer.  Added CS3024
2878         check for generic interfaces.
2879
2880         * attributes.cs (AttributeTester.AnalyzeTypeCompliance): Generic
2881         instances are not CLS-compliant.
2882
2883 2004-12-08  Martin Baulig  <martin@ximian.com>
2884
2885         * cs-parser.jay
2886         (void_pointer_expression): New rule for `void*', `void**' etc.
2887         (typeof_expression): Add `void_pointer_expression'; fixes #66846.       
2888
2889 2004-12-08  Martin Baulig  <martin@ximian.com>
2890
2891         * expression.cs (Invocation.InferType): Removed the hack for
2892         MethodCore.MayUnify().  
2893
2894         * typemanager.cs (TypeManager.MayBecomeEqualGenericTypes): Make
2895         this actually work.
2896
2897         * class.cs (MethodCore.MayUnify): Use
2898         TypeManager.MayBecomeEqualGenericTypes().       
2899
2900 2004-12-08  Martin Baulig  <martin@ximian.com>
2901
2902         * expression.cs (Is.DoResolve, As.DoResolve): If we're a type
2903         parameter, box it.  Fixes #69233.
2904
2905 2004-12-08  Martin Baulig  <martin@ximian.com>
2906
2907         * generic.cs (ConstructedType.CheckConstraints): Valuetypes always
2908         have the ctor constraint.  Fixes #68326.
2909
2910 2004-12-07  Atsushi Enomoto  <atsushi@ximian.com>
2911
2912         * cs-parser.jay : interface comment was not consumed because of
2913           extra opt_semicolon before doc handling.
2914
2915 2004-12-03  Raja R Harinath  <rharinath@novell.com>
2916
2917         Fix test-327.cs, test-328.cs, and put in early infrastructure
2918         for eventually fixing #52697.
2919         * namespace.cs (NamespaceEntry.LookupForUsing): New method.
2920         (NamespaceEntry.LookupNamespaceOrType): New method, refactored
2921         from other methods.
2922         (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
2923         (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
2924         (VerifyUsing, error246): Update.
2925         * rootcontext.cs (RootContext.NamespaceLookup): Just use
2926         'NamespaceEntry.LookupNamespaceOrType'.
2927
2928 2004-12-07  Martin Baulig  <martin@ximian.com>
2929
2930         * driver.cs: Call it "BETA SOFTWARE" :-)
2931
2932 2004-12-06  Raja R Harinath  <rharinath@novell.com>
2933
2934         Fix crash on cs0657-17.cs.
2935         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
2936         Use RootContext.Tree.Types, not 'new RootTypes ()'.
2937         * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
2938         the case where the NamespaceEntry gets overwritten.
2939
2940 2004-12-06  Marek Safar  <marek.safar@seznam.cz>
2941
2942         Fixed #69195, #56821
2943         * ecore.cs (ResolveBoolean): Tiny refactoring.
2944
2945         * expression.cs (Binary.DoResolve): Add warning 429 and skipping
2946         of right expression resolving when left is false constant and
2947         operator is LogicalAnd OR true constant and operator is LogicalOr.
2948
2949         * statement.cs (ResolveUnreachable): Always reports warning.
2950
2951 2004-12-05  Miguel de Icaza  <miguel@ximian.com>
2952
2953         * class.cs: Distinguish between 1721 and 1722 (just a little help
2954         for the programmer).
2955
2956 2004-12-03  Miguel de Icaza  <miguel@ximian.com>
2957
2958         * delegate.cs: Only allow this on new versions of the language. 
2959
2960 2004-12-02  Duncan Mak  <duncan@ximian.com>
2961
2962         * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
2963         Expression class.
2964         (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
2965         here as a static method. Take an additional bool out parameter
2966         `must_do_cs1540_check' for signaling to InstanceResolve.
2967         (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
2968         member field from PropertyExpr class and made it an argument of
2969         the method instead.
2970         (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
2971         check for MarshalByRefObject, and report CS0122 instead of CS1540.
2972         (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
2973         and `remove_accessor' as well as InstanceResolve: report CS0122
2974         where applicable.
2975
2976         Fixes #70129.
2977
2978 2004-12-07  Martin Baulig  <martin@ximian.com>
2979
2980         * decl.cs (DeclSpace.AddToContainer): Report correct errors CS0694
2981         and CS0692 where appropriate.
2982
2983 2004-12-06  Martin Baulig  <martin@ximian.com>
2984
2985         * class.cs (MethodCore.MayUnify): Moved the CS0408 check here from
2986         IsDuplicateImplementation() and improved it.
2987
2988         * expression.cs (Invocation.InferTypeArguments): Added
2989         `Type[] inferred_class_types' argument (for MethodCore.MayUnify)
2990         and removed the "ref" modifier from `infered_types'.
2991
2992         * decl.cs (MemberName.ToString): Removed the exception.
2993
2994 2004-12-03  Atsushi Enomoto  <atsushi@ximian.com>
2995
2996         * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
2997           comments are allowed.
2998
2999 2004-12-03  Carlos Alberto Cortez <calberto.cortez@gmail.com>
3000
3001         * delegate.cs: Add checks for subtypes in paramaters and return values
3002         in VerifyMethod () to add support for Covariance/Contravariance
3003         in delegates.
3004         
3005 2004-12-02  Miguel de Icaza  <miguel@ximian.com>
3006
3007         * report.cs: Remove extra closing parenthesis.
3008
3009         * convert.cs (Error_CannotImplicitConversion): If the name of the
3010         types are the same, provide some extra information.
3011
3012 2004-12-02  Marek Safar  <marek.safar@seznam.cz>
3013
3014         Fix bug #70102
3015         * attribute.cs (Resolve): Improved implementation of params
3016         attribute arguments.
3017
3018         * support.cs (ParameterData): Add HasParams to be faster.
3019
3020 2004-12-02  Atsushi Enomoto  <atsushi@ximian.com>
3021
3022         all things are for /doc support:
3023
3024         * doc.cs: new file that supports XML documentation generation.
3025         * mcs.exe.sources: added doc.cs.
3026         * driver.cs:
3027           Handle /doc command line option.
3028           Report error 2006 instead of 5 for missing file name for /doc.
3029           Generate XML documentation when required, after type resolution.
3030         * cs-tokenizer.cs:
3031           Added support for picking up documentation (/// and /** ... */),
3032           including a new XmlCommentState enumeration.
3033         * cs-parser.jay:
3034           Added lines to fill Documentation element for field, constant,
3035           property, indexer, method, constructor, destructor, operator, event
3036           and class, struct, interface, delegate, enum.
3037           Added lines to warn incorrect comment.
3038         * rootcontext.cs :
3039           Added Documentation field (passed only when /doc was specified).
3040         * decl.cs:
3041           Added DocComment, DocCommentHeader, GenerateDocComment() and
3042           OnGenerateDocComment() and some supporting private members for
3043           /doc feature to MemberCore.
3044         * class.cs:
3045           Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
3046         * delegate.cs:
3047           Added overriden DocCommentHeader.
3048         * enum.cs:
3049           Added overriden DocCommentHeader and GenerateDocComment().
3050
3051 2004-12-01  Miguel de Icaza  <miguel@ximian.com>
3052
3053         * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
3054         unwrapping the enumeration values, chain to
3055         DoConstantNumericPromotions again, so we can promote things to the
3056         fundamental types (takes care of enums that are bytes, sbytes).
3057
3058         Fixes bug #62054.
3059
3060 2004-12-01  Raja R Harinath  <rharinath@novell.com>
3061
3062         * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
3063         Fix long-standing bug in type-lookup.  Use FindType instead of
3064         LookupType when ec.ResolvingTypeTree.
3065         (Attribute.ResolveType, Attribute.Resolve)
3066         (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
3067         Update to changes.
3068         (Attributes.Search): Remove internal version.  Update.
3069         (Attributes.SearchMulti): Update.
3070         (Attributes.GetClsCompliantAttribute): Remove.
3071         (Attributes.GetIndexerNameAttribute): Remove.
3072         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
3073         (DeclSpace.GetClsCompliantAttributeValue): Likewise.
3074         * class.cs (Indexer.Define): Likewise.
3075
3076 2004-12-01  Marek Safar  <marek.safar@seznam.cz>
3077
3078         Fix bug #68790
3079         * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
3080         MarshallByReference members access.
3081
3082         * expression.cs: Use CheckMarshallByRefAccess;
3083         Better error CS0197 message.
3084
3085         * report.cs: Print whole related error message.
3086
3087 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
3088
3089         * class (GetClassBases): Better error 60 report.
3090         (EventProperty): Disabled warning 67 detection.
3091
3092 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
3093
3094         Fix bug #60324
3095         * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
3096
3097         * constant.cs (DecimalConstant.Emit): Don't use int ctor for
3098         precise values.
3099
3100 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
3101
3102         Fix bug #49488
3103         * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
3104
3105         * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
3106
3107 2004-11-26  Miguel de Icaza  <miguel@ximian.com>
3108
3109         * attribute.cs (Attribute.Resolve): Refine error reporting and
3110         report a cs0117 if the identifier does not exist, to distinguish
3111         from 0617 which is a miss-use of the actual identifier.
3112
3113         * ecore.cs (EventExpr.Emit): Refine error report and distinguish
3114         between cs0070 and cs0079.
3115
3116         * class.cs (MemberBase.DoDefine): When reporting a wrong
3117         accessibility level, we use MethodCore to compare instead of
3118         Method (this was a regression in some refactoring effort).
3119
3120         So now we correctly report cs0056 again.
3121
3122         * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
3123         testing the target_type (which was known to be object_type) and
3124         not the source type (which is anonymous_method).
3125
3126         Fixed reporting of error cs1660.
3127
3128         * expression.cs (UserCast.Source): Expose the underlying cast.
3129
3130         * statement.cs (Switch.SwitchGoverningType): Sort the list of
3131         allowed types to find a match to int32 first (most common).
3132
3133         In addition, it ignores any ImplicitUserConversions that did an
3134         internal implicit conversion (as the switch statement allows only
3135         one integral conversion to exist).
3136
3137         * class.cs (PartialContainer.Create): rename `name' to
3138         `member_name' for clarity.  Then replace the string calls with a
3139         call to MemberName.GetPartialName, as now using
3140         MemberName.ToString is an error (this is due to the side effects
3141         it had, that were fixed in the past).
3142
3143         This will restore the error reporting on a number of partial class
3144         errors that were missusing this (and getting an exception as a
3145         results, which is now just a plain textual warning, because
3146         yyparse debug output would crash otherwise).
3147
3148 2004-11-26  Raja R Harinath  <rharinath@novell.com>
3149
3150         * Makefile (PROGRAM_INSTALL_DIR): Remove.
3151
3152 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
3153
3154         * rootcontext.cs (LookupType): Make sure to cache lookups that
3155         don't give us a negative result. This saves about 5% of corlib
3156         compilation time.
3157
3158 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
3159
3160         * report.cs (AbstractMessage.Print): messages are sent to stderr
3161
3162         * class.cs (TypeContainer.GetClassBases): It is an error to have a
3163         non-interface in the list of interfaces (at this point, either
3164         parent was properly set, or a base class is being listed in the
3165         interfaces section).
3166
3167         This flags error 1722, and resolves the crash from bug 69259.
3168
3169 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
3170
3171         * statement.cs (Using.EmitExpressionFinally): make this work right
3172         for valuetypes. Fixes 69926.
3173
3174 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
3175
3176         * const.cs (Const.ChangeType): Cope with the "0 literal can be
3177         converted to an enum" here, before we try to change the underlying
3178         type.  This code exists, but it is a different code path than the
3179         one used while encoding constants.
3180
3181         (ImplicitReferenceConversionExists): In addition, resynchronized
3182         the code here, so it matches the same code in
3183         ImplicitReferenceConversionExists for the `from any class-type S
3184         to any interface-type T'.       
3185
3186 2004-11-25  Marek Safar  <marek.safar@seznam.cz>
3187
3188         * cfold.cs (BinaryFold): Add addition for DecimalConstant.
3189
3190 2004-11-24  Miguel de Icaza  <miguel@ximian.com>
3191
3192         * cs-parser.jay: Use verbosity accordingly. 
3193
3194 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
3195
3196         * expression.cs (Unary.ResolveOperator): Do not report warning;
3197         AddressOf reads from variable.
3198         
3199         (LocalVariableReferences.DoResolveBase): Improved my previous fix.
3200
3201 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
3202
3203         Fix bug #69462
3204
3205         * attribute.cs (Attributable): Removed CheckTargets.
3206         (Attributes.Emit): Explicit attribute targets are tested here.
3207
3208         * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
3209         not enabled for interfaces.
3210
3211         * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
3212         (GetAssemblyName): Ouch next bug there.
3213
3214 2004-11-23  Carlos Alberto Cortez <calberto.cortez@gmail.com>
3215
3216         * expression.cs: Error 275 added.
3217         
3218 2004-11-23  Marek Safar  <marek.safar@seznam.cz>
3219
3220         Fix bug #69177 (Implemented decimal constant support)
3221
3222         * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
3223         (BinaryFold): Add DecimalConstant.
3224
3225         * const.cs (Define): Decimal constant 
3226         (is not constant.
3227         (ChangeType): Add decimal type handling.
3228         (LookupConstantValue): Don't set value for decimal type but
3229         emit DecimalConstantAttribute. Needed for constant optimization.
3230
3231         * constant.cs (ToDecimal): New method.
3232         (ConvertToDecimal): New method.
3233         (IntConstant): Implemented ConvertToDecimal.
3234         (DecimalConstant.Emit): Emit optimized version for decimals in
3235         int range.
3236
3237         * expression.cs (ResolveOperator): Changed order of constant
3238         reduction to work correctly with native types which have
3239         overloaded operators.
3240         (ResolveMemberAccess): Extract constant value from attribute
3241         for decimal type.
3242
3243         * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
3244
3245         * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
3246         void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
3247         (ChangeType): Decimal is special.
3248         (TypeToCoreType): Add decimal type.
3249
3250 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
3251
3252         * convert.cs (ImplicitConversionRequired): Add error cs0642 for
3253         decimal types.
3254
3255 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
3256
3257         * class.cs (EventField.ApplyAttributeBuilder): Fix error
3258         test cs1667-5.cs.
3259
3260 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
3261
3262         * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
3263
3264         * pending.cs (PendingImplementation): Grab only interfaces.
3265
3266 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
3267
3268         * statement.cs (ForeachHelperMethods): Add location member and
3269         error 202 detection.
3270
3271 2004-11-18  Marek Safar  <marek.safar@seznam.cz>
3272
3273         * expression.cs (DoResolveBase): Fixed wrong warning for out
3274         variables.
3275
3276 2004-12-04  Martin Baulig  <martin@ximian.com>
3277
3278         * convert.cs (Convert.TypeParameter_to_Null): Use the constraints
3279         to check whether the conversion is ok.
3280
3281         * typemanager.cs (TypeManager.GetTypeArguments): Just return
3282         `Type.EmptyTypes' if we're not a generic TypeContainer.
3283
3284 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
3285
3286         * convert.cs (ImplicitReferenceConversionExists): A surprisingly
3287         old bug: when converting from the null literal to a pointer,
3288         return an EmptyCast, not the NullLiteral.
3289
3290         This fixes #69921, the recent null_type changes probably made this
3291         bug more prominent.
3292
3293 2004-12-03  Martin Baulig  <martin@ximian.com>
3294
3295         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
3296         method as our child, call AnonymousMethod.Compatible() on it.
3297
3298 2004-12-02  Miguel de Icaza  <miguel@ximian.com>
3299
3300         * class.cs (FieldBase): Use an unused bit field from the field to
3301         encode the `has_offset' property from the FieldMember.  This saves
3302         a couple of Ks on bootstrap compilation.
3303
3304         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
3305         method as our child, return the AnonymousMethod resolved
3306         expression.
3307
3308         * expression.cs (New.DoResolve): Allow return values from
3309         NewDelegate to also include AnonymousMethods.
3310
3311         Fixes #70150.
3312
3313 2004-11-29  Raja R Harinath  <rharinath@novell.com>
3314
3315         * decl.cs (MemberCore.MemberName): Remove readonly to fix an error
3316         cs1648 report.
3317         * rootcontext.cs (ResolveCore::interfaces_first_stage): Add
3318         System.Runtime.InteropServices._Exception, since it's a base
3319         interface of the core type System.Exception in the net_2_0 profile.
3320
3321 2004-11-27  Martin Baulig  <martin@ximian.com>
3322
3323         * ecore.cs (Expression.StoreFromPtr): Use `stobj' for generic parameters.
3324
3325 2004-11-26  Raja R Harinath  <rharinath@novell.com>
3326
3327         * Makefile: Convert to use executable.make.
3328         * gmcs.exe.sources: New.
3329
3330 2004-11-25  Martin Baulig  <martin@ximian.com>
3331
3332         * expression.cs (Invocation.InferType): Added support for byref types.
3333
3334 2004-11-25  Martin Baulig  <martin@ximian.com>
3335
3336         * statement.cs (Foreach.FetchMethodMoveNext): Wrap `mi.ReturnType'
3337         in TypeManager.TypeToCoreType().
3338
3339 2004-11-25  Martin Baulig  <martin@ximian.com>
3340
3341         * iterators.cs (Iterator.DoDefineMembers): Override and lookup the
3342         "Dispose" method from the `current_type'.
3343         (Iterator.EmitMoveNext): Use the `dispose_method' we looked up in
3344         DoDefineMembers() instead of using the MethodBuilder; this is
3345         required for generic iterators.
3346
3347         * class.cs (TypeContainer.DoDefineMembers): Make this virtual.
3348
3349 2004-11-24  Martin Baulig  <martin@ximian.com>
3350
3351         * ecore.cs (Expression.LoadFromPtr): Use `ldobj' for generic parameters.
3352
3353 2004-11-20  Martin Baulig  <martin@ximian.com>
3354
3355         * expression.cs (Invocation.InferType): Correctly infer generic
3356         instances; see gen-103.cs.
3357         (Invocation.InferTypeArguments): If a generic method doesn't have
3358         any unbound type parameters, we don't need to infer anything.
3359
3360 2004-11-19  Raja R Harinath  <rharinath@novell.com>
3361
3362         * Makefile (gmcs.exe): Update to new location of bootstrap mcs.exe.
3363
3364 2004-11-17  Raja R Harinath  <rharinath@novell.com>
3365
3366         * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
3367         (TypeHandle.GetMemberCache): New.
3368         (TypeHandle.TypeHandle): Update.
3369         (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
3370         (TypeManager.LookupParentInterfacesCache):
3371         Rename from LookupInterfaceCache.  Optimize slightly.
3372         (TypeManager.MemberLookup_FindMembers): Update.
3373         * decl.cs (MemberCache.MemberCache): Set Container to null in the
3374         multi-type variant.
3375         (AddCacheContents): Rename from AddHashtable.
3376         * class.cs (TypeContainer.parent_container): Remove.
3377         (TypeContainer.VerifyClsCompliance): Don't use parent_container.
3378         (TypeContainer.DoDefineMembers): Don't initialize it.
3379         Update to name changes.
3380         
3381 2004-11-17  Miguel de Icaza  <miguel@ximian.com>
3382
3383         * class.cs (MethodCore.CheckAccessModifiers): New helper routine
3384         that factors the code to check access modifiers on override.  
3385
3386         (PropertyBase): Use the code here.
3387
3388         Patch from Lluis S'anchez, fixes bug #69361.
3389
3390 2004-11-15  Miguel de Icaza  <miguel@ximian.com>
3391
3392         * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
3393         routine that is used to report the use of a captured variable
3394         whose address has been taken.
3395
3396         There are two checks: one when variables are being captured and
3397         the other check is when the address of a variable is taken. 
3398         
3399         (because an anonymous methods might be resolved before *or* after
3400         the address has been taken) and 
3401
3402         * expression.cs (Conditional.DoResolve): Remove the special
3403         casing that Martin added to trueExpr and falseExpr being both
3404         NullLiteral.  We get the right behavior now just by introducing
3405         the null_type into the compiler. 
3406
3407         * convert.cs (ExplicitConversion): Change the code to use
3408         null_type instead of testing `expr is NullLiteral'.
3409         (ImplicitConversionStandard): use null_type too.
3410         (ImplicitReferenceConversionExists): use null_type too.
3411         (ImplicitReferenceConversion): use null_type too.
3412
3413         * literal.cs: The type of `NullLiteral' is now null_type instead
3414         of object_type. 
3415         (Resolve): Set the type here.
3416
3417         * typemanager.cs: Introduce null_type.
3418
3419 2004-11-18  Martin Baulig  <martin@ximian.com>
3420
3421         * rootcontext.cs
3422         (RootContext.LookupType): Return a `Type', not a `TypeExpr'.
3423
3424 2004-11-18  Martin Baulig  <martin@ximian.com>
3425
3426         * ecore.cs (TypeExpr.DoResolveAsTypeStep): Make this protected.
3427
3428 2004-11-18  Martin Baulig  <martin@ximian.com>
3429
3430         * generic.cs (Constraints.Resolve): Take an `EmitContext' instead
3431         of a `DeclSpace'.  If one of our constraints is a `ConstructedType',
3432         call ResolveConstructedType() on it to resolve it without checking
3433         constraints.
3434         (Constraints.ResolveTypes): Check them here.
3435         (ConstructedType.DoResolveAsTypeStep): Fully resolve ourselves,
3436         but don't check constraints.
3437         (ConstructedType.ResolveAsTypeTerminal): Override this and also
3438         check constraints here.
3439         (ConstructedType.ResolveConstructedType): New public method.  This
3440         is called from DoResolveAsTypeStep() and Constraints.Resolve() to
3441         resolve ourselves without checking constraints.
3442
3443         * ecore.cs (Expression.ResolveAsTypeTerminal): Make this virtual.
3444
3445 2004-11-18  Martin Baulig  <martin@ximian.com>
3446
3447         * decl.cs
3448         (DeclSpace.CurrentType): Changed type from `TypeExpr' to `Type'.
3449
3450         * delegate.cs (Delegate.DefineType): Always create the EmitContext.
3451
3452 2004-11-18  Martin Baulig  <martin@ximian.com>
3453
3454         * ecore.cs (TypeExpr.ResolveType): Removed.
3455         (Expression.ResolveAsTypeTerminal): We always return a fully
3456         resolved `TypeExpr', so we can just access its `Type'.
3457
3458         * class.cs (TypeContainer.DefineType): Resolve `CurrentType' here.
3459
3460 2004-11-17  Martin Baulig  <martin@ximian.com>
3461
3462         * ecore.cs (IAlias.Type): Replaced with ResolveAsType() to make
3463         sure we don't return any unresolved TypeExpr's.
3464         (TypeAliasExpression): The .ctor now takes an `IAlias' instead of
3465         a `TypeExpr'.
3466         (Expression.ResolveAsTypeTerminal): Make sure `te.Type != null'.
3467
3468         * expression.cs (MemberAccess.ResolveAsTypeStep): Don't return any
3469         unresolved `ConstructedType's.
3470
3471 2004-11-17  Martin Baulig  <martin@ximian.com>
3472
3473         * ecore.cs (TypeExpr.ResolveType): Don't make this virtual.
3474
3475 2004-11-17  Martin Baulig  <martin@ximian.com>
3476
3477         * ecore.cs
3478         (Expression.ResolveAsTypeTerminal): Removed the `bool silent' argument.
3479
3480         * decl.cs (DeclSpace.ResolveType): Removed.
3481         (DeclSpace.ResolveTypeExpr): Removed the `bool silent' argument.
3482
3483 2004-11-17  Martin Baulig  <martin@ximian.com>
3484
3485         * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
3486         direction, like FindMembers() does.  Fixes #69546, testcase is in
3487         test-315.cs.    
3488
3489 2004-11-16  Martin Baulig  <martin@ximian.com>
3490
3491         This is based on a patch from Marek Safar, see bug #69082.
3492         Fixes bugs #63705 and #67130.
3493
3494         * typemanager.cs (TypeManager.LookupInterfaceCache): New public
3495         method; create a MemberCache for an interface type and cache the
3496         result.
3497
3498         * decl.cs (IMemberContainer.ParentContainer): Removed.
3499         (IMemberContainer.ParentCache): New property.
3500         (MemberCache.SetupCacheForInterface): Removed.
3501         (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
3502         to create a cache for an interface's "parent".
3503
3504         * class.cs (TypeContainer.DoDefineMembers): Setup cache for
3505         interfaces too.
3506
3507 2004-11-14  Ben Maurer  <bmaurer@ximian.com>
3508
3509         * statement.cs: Avoid adding bools to a hashtable.
3510
3511 2004-11-15  Martin Baulig  <martin@ximian.com>
3512
3513         * decl.cs (MemberName.GetPartialName): Removed, use GetTypeName() instead.
3514
3515 2004-11-11  Martin Baulig  <martin@ximian.com>
3516
3517         * typemanager.cs (TypeManager.GetMethodName): New method.
3518
3519         * class.cs (MethodData.Define): Include the generic arity in the
3520         name of an explicit interface; also add it to the method name.
3521
3522         * pending.cs (PendingImplementation.InterfaceMethod): The method
3523         name now includes the generic arity.
3524
3525 2004-11-07  Miguel de Icaza  <miguel@ximian.com>
3526
3527         * expression.cs (Invocation.OverloadResolve): Flag error if we are
3528         calling an unsafe method from a safe location.
3529
3530 2004-11-06  Marek Safar  <marek.safar@seznam.cz>
3531
3532         Fix #69167
3533         * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
3534
3535 2004-11-06  Miguel de Icaza  <miguel@ximian.com>
3536
3537         * namespace.cs (VerifyUsing): use GetPartialName instead of
3538         ToString. 
3539
3540 2004-11-05  Miguel de Icaza  <miguel@ximian.com>
3541
3542         * statement.cs (Return.Resolve): Fix regression in typo: if
3543         `in_exc', we have to request a NeedReturnLabel, this was a typo
3544         introduced in the anonymous method check-in.  Fixes #69131.
3545
3546         * Indexers were using the ShortName when defining themselves,
3547         causing a regression in the compiler bootstrap when applying the
3548         patch from 2004-11-02 (first part), now they use their full name
3549         and the bug is gone.
3550
3551 2004-11-04  Zoltan Varga  <vargaz@freemail.hu>
3552
3553         * driver.cs: Strip the path from the names of embedded resources. Fixes
3554         #68519.
3555
3556 2004-11-04  Raja R Harinath  <rharinath@novell.com>
3557
3558         Fix error message regression: cs0104-2.cs.
3559         * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
3560         (AliasEntry.Resolve): Update.
3561         * rootcontext.cs (RootContext.NamespaceLookup): Update.  Remove
3562         'silent' flag.
3563         (RootContext.LookupType): Update.
3564
3565 2004-11-03  Carlos Alberto Cortez <carlos@unixmexico.org>
3566
3567         * cs-parser.jay: Add support for handling accessor modifiers
3568         * class: Add support port accessor modifiers and error checking,
3569         define PropertyMethod.Define as virtual (not abstract anymore)
3570         * ecore.cs: Add checking for proeprties access with access modifiers
3571         * iterators.cs: Modify Accessor constructor call based in the modified
3572         constructor
3573 2004-11-02  Ben Maurer  <bmaurer@ximian.com>
3574
3575         * expression.cs (StringConcat): Handle being called twice,
3576         as when we have a concat in a field init with more than two
3577         ctors in the class
3578
3579 2004-11-02  Miguel de Icaza  <miguel@ximian.com>
3580
3581         * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
3582         special case explicit implementations, we should always produce
3583         the .property or .event declaration.
3584         
3585         * decl.cs (MemberName): Renamed GetFullName to GetPartialName
3586         since it will not return correct data if people use this
3587         unresolved in the presence of using statements (see test-313).
3588
3589         * class.cs (MethodData.Define): If we are an explicit interface
3590         implementation, set the method name to the full name of the
3591         interface plus the name of the method.  
3592
3593         Notice that using the method.MethodName.GetFullName() does not
3594         work, as it will only contain the name as declared on the source
3595         file (it can be a shorthand in the presence of using statements)
3596         and not the fully qualifed type name, for example:
3597
3598         using System;
3599
3600         class D : ICloneable {
3601                 object ICloneable.Clone ()  {
3602                 }
3603         }
3604
3605         Would produce a method called `ICloneable.Clone' instead of
3606         `System.ICloneable.Clone'.
3607
3608         * namespace.cs (Alias.Resolve): Use GetPartialName.
3609         
3610 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
3611
3612         * cs-parser.jay: Add error 1055 report.
3613
3614 2004-11-01  Miguel de Icaza  <miguel@ximian.com>
3615
3616         * assign.cs (Assign.DoResolve): Only do the transform of
3617         assignment into a New if the types are compatible, if not, fall
3618         through and let the implicit code deal with the errors and with
3619         the necessary conversions. 
3620
3621 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
3622
3623         * cs-parser.jay: Add error 1031 report.
3624
3625         * cs-tokenizer.cs: Add location for error 1038.
3626
3627 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
3628
3629         * cs-parser.jay: Add error 1016 report.
3630
3631 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
3632
3633         * cs-parser.jay: Add errors 1575,1611 report.
3634
3635 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
3636
3637         * cs-parser.jay: Add error 1001 report.
3638
3639 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
3640
3641         Fix #68850
3642         * attribute.cs (GetMarshal): Add method argument for
3643         caller identification.
3644
3645         * class.cs, codegen.cs, enum.cs, parameter.cs: Added
3646         agument for GetMarshal and RuntimeMissingSupport.
3647
3648 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
3649
3650         * attribute.cs (ExtractSecurityPermissionSet): Removed
3651         TypeManager.code_access_permission_type.
3652
3653         * typemanager.cs: Removed TypeManager.code_access_permission_type.
3654
3655 2004-10-27  Miguel de Icaza  <miguel@ximian.com>
3656
3657         * expression.cs (LocalVariableReference.DoResolveLValue): Check
3658         for obsolete use of a variable here.   Fixes regression on errors
3659         cs0619-25 and cs0619-26.
3660
3661 2004-10-27  Marek Safar  <marek.safar@seznam.cz>
3662
3663         Fix #62358, implemented security attribute encoding.
3664
3665         * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
3666         Tests permitted SecurityAction for assembly or other types.
3667         (Assembly.ExtractSecurityPermissionSet): New method. Transforms
3668         data from SecurityPermissionAttribute to PermisionSet class.
3669
3670         * class.cs (ApplyAttributeBuilder): Added special handling
3671         for System.Security.Permissions.SecurityAttribute based types.
3672
3673         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
3674         special handling for System.Security.Permissions.SecurityAttribute
3675         based types.
3676
3677         * enum.cs (ApplyAttributeBuilder): Added special handling
3678         for System.Security.Permissions.SecurityAttribute based types.
3679
3680         * parameter.cs (ApplyAttributeBuilder): Added special handling
3681         for System.Security.Permissions.SecurityAttribute based types.
3682
3683         * rootcontext.cs: Next 2 core types.
3684
3685         * typemanager.cs (TypeManager.security_permission_attr_type):
3686         Built in type for the SecurityPermission Attribute.
3687         (code_access_permission_type): Build in type.
3688
3689 2004-10-17  Miguel de Icaza  <miguel@ximian.com>
3690
3691         * expression.cs (LocalVariableReference.DoResolveBase, Emit):
3692         Remove the tests for `ec.RemapToProxy' from here, and encapsulate
3693         all of this information into
3694         EmitContext.EmitCapturedVariableInstance.
3695         
3696         * codegen.cs (EmitCapturedVariableInstance): move here the
3697         funcionality of emitting an ldarg.0 in the presence of a
3698         remapping.   This centralizes the instance emit code.
3699
3700         (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
3701         then emit a load of this: it means that we have reached the
3702         topmost ScopeInfo: the one that contains the pointer to the
3703         instance of the class hosting the anonymous method.
3704
3705         * anonymous.cs (AddField, HaveCapturedFields): Propagate field
3706         captures to the topmost CaptureContext.
3707
3708 2004-10-12  Miguel de Icaza  <miguel@ximian.com>
3709
3710         * expression.cs (LocalVariableReference): Move the knowledge about
3711         the iterators into codegen's EmitCapturedVariableInstance.
3712
3713 2004-10-11  Miguel de Icaza  <miguel@ximian.com>
3714
3715         * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
3716         all code paths return a value from an anonymous method (it is the
3717         same as the 161 error, but for anonymous methods).
3718
3719 2004-10-08  Miguel de Icaza  <miguel@ximian.com>
3720
3721         The introduction of anonymous methods in the compiler changed
3722         various ways of doing things in the compiler.  The most
3723         significant one is the hard split between the resolution phase
3724         and the emission phases of the compiler.
3725
3726         For instance, routines that referenced local variables no
3727         longer can safely create temporary variables during the
3728         resolution phase: they must do so from the emission phase,
3729         since the variable might have been "captured", hence access to
3730         it can not be done with the local-variable operations from the runtime.
3731         
3732         * statement.cs 
3733
3734         (Block.Flags): New flag `IsTopLevel' to indicate that this block
3735         is a toplevel block.
3736
3737         (ToplevelBlock): A new kind of Block, these are the blocks that
3738         are created by the parser for all toplevel method bodies.  These
3739         include methods, accessors and anonymous methods.
3740
3741         These contain some extra information not found in regular blocks:
3742         A pointer to an optional CaptureContext (for tracking captured
3743         local variables and parameters).  A pointer to the parent
3744         ToplevelBlock.
3745         
3746         (Return.Resolve): Catch missmatches when returning a value from an
3747         anonymous method (error 1662).
3748         Invoke NeedReturnLabel from the Resolve phase instead of the emit
3749         phase.
3750
3751         (Break.Resolve): ditto.
3752
3753         (SwitchLabel): instead of defining the labels during the
3754         resolution phase, we now turned the public ILLabel and ILLabelCode
3755         labels into methods called GetILLabelCode() and GetILLabel() that
3756         only define the label during the Emit phase.
3757
3758         (GotoCase): Track the SwitchLabel instead of the computed label
3759         (its contained therein).  Emit the code by using
3760         SwitchLabel.GetILLabelCode ().
3761
3762         (LocalInfo.Flags.Captured): A new flag has been introduce to track
3763         whether the Local has been captured or not.
3764
3765         (LocalInfo.IsCaptured): New property, used to tell whether the
3766         local has been captured.
3767         
3768         * anonymous.cs: Vastly updated to contain the anonymous method
3769         support.
3770
3771         The main classes here are: CaptureContext which tracks any
3772         captured information for a toplevel block and ScopeInfo used to
3773         track the activation frames for various local variables.   
3774
3775         Each toplevel block has an optional capture context associated
3776         with it.  When a method contains an anonymous method both the
3777         toplevel method and the anonymous method will create a capture
3778         context.   When variables or parameters are captured, they are
3779         recorded on the CaptureContext that owns them, for example:
3780
3781         void Demo () {
3782              int a;
3783              MyDelegate d = delegate {
3784                  a = 1;
3785              }
3786         }
3787
3788         Here `a' will be recorded as captured on the toplevel
3789         CapturedContext, the inner captured context will not have anything
3790         (it will only have data if local variables or parameters from it
3791         are captured in a nested anonymous method.
3792
3793         The ScopeInfo is used to track the activation frames for local
3794         variables, for example:
3795
3796         for (int i = 0; i < 10; i++)
3797                 for (int j = 0; j < 10; j++){
3798                    MyDelegate d = delegate {
3799                         call (i, j);
3800                    }
3801                 }
3802
3803         At runtime this captures a single captured variable `i', but it
3804         captures 10 different versions of the variable `j'.  The variable
3805         `i' will be recorded on the toplevel ScopeInfo, while `j' will be
3806         recorded on a child.  
3807
3808         The toplevel ScopeInfo will also track information like the `this'
3809         pointer if instance variables were referenced (this is necessary
3810         as the anonymous method lives inside a nested class in the host
3811         type of the method). 
3812
3813         (AnonymousMethod): Expanded to track the Toplevel, implement
3814         `AnonymousMethod.Compatible' to tell whether an anonymous method
3815         can be converted to a target delegate type. 
3816
3817         The routine now also produces the anonymous method content
3818
3819         (AnonymousDelegate): A helper class that derives from
3820         DelegateCreation, this is used to generate the code necessary to
3821         produce the delegate for the anonymous method that was created. 
3822
3823         * assign.cs: API adjustments for new changes in
3824         Convert.ImplicitStandardConversionExists.
3825
3826         * class.cs: Adjustments to cope with the fact that now toplevel
3827         blocks are of type `ToplevelBlock'. 
3828
3829         * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
3830         insteda of standard blocks.
3831
3832         Flag errors if params arguments are passed to anonymous methods.
3833
3834         * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
3835         `CurrentAnonymousMethod' which points to the current Anonymous
3836         Method.  The variable points to the AnonymousMethod class that
3837         holds the code being compiled.  It is set in the new EmitContext
3838         created for the anonymous method.
3839
3840         (EmitContext.Phase): Introduce a variable and an enumeration to
3841         assist in enforcing some rules about when and where we are allowed
3842         to invoke certain methods (EmitContext.NeedsReturnLabel is the
3843         only one that enfonces this right now).
3844
3845         (EmitContext.HaveCaptureInfo): new helper method that returns
3846         whether we have a CapturedContext initialized.
3847
3848         (EmitContext.CaptureVariable): New method used to register that a
3849         LocalInfo must be flagged for capturing. 
3850
3851         (EmitContext.CapturedParameter): New method used to register that a
3852         parameters must be flagged for capturing. 
3853         
3854         (EmitContext.CapturedField): New method used to register that a
3855         field must be flagged for capturing. 
3856
3857         (EmitContext.HaveCapturedVariables,
3858         EmitContext.HaveCapturedFields): Return whether there are captured
3859         variables or fields. 
3860
3861         (EmitContext.EmitMethodHostInstance): This is used to emit the
3862         instance for the anonymous method.  The instance might be null
3863         (static methods), this (for anonymous methods that capture nothing
3864         and happen to live side-by-side with the current method body) or a
3865         more complicated expression if the method has a CaptureContext.
3866
3867         (EmitContext.EmitTopBlock): Routine that drives the emission of
3868         code: it will first resolve the top block, then emit any metadata
3869         and then emit the code.  The split is done so that we can extract
3870         any anonymous methods and flag any captured variables/parameters.
3871         
3872         (EmitContext.ResolveTopBlock): Triggers the resolution phase,
3873         during this phase, the ILGenerator should not be used as labels
3874         and local variables declared here might not be accessible to any
3875         code that is part of an anonymous method.  
3876
3877         Exceptions to this include the temporary variables that are
3878         created by some statements internally for holding temporary
3879         variables. 
3880         
3881         (EmitContext.EmitMeta): New routine, in charge of emitting all the
3882         metadata for a cb
3883
3884         (EmitContext.TemporaryReturn): This method is typically called
3885         from the Emit phase, and its the only place where we allow the
3886         ReturnLabel to be defined other than the EmitMeta.  The reason is
3887         that otherwise we would have to duplicate a lot of logic in the
3888         Resolve phases of various methods that today is on the Emit
3889         phase. 
3890
3891         (EmitContext.NeedReturnLabel): This no longer creates the label,
3892         as the ILGenerator is not valid during the resolve phase.
3893
3894         (EmitContext.EmitThis): Extended the knowledge in this class to
3895         work in anonymous methods in addition to iterators. 
3896
3897         (EmitContext.EmitCapturedVariableInstance): This emits whatever
3898         code is necessary on the stack to access the instance to a local
3899         variable (the variable will be accessed as a field).
3900
3901         (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
3902         EmitContext.EmitAddressOfParameter): Routines to support
3903         parameters (not completed at this point). 
3904         
3905         Removals: Removed RemapLocal and RemapLocalLValue.  We probably
3906         will also remove the parameters.
3907
3908         * convert.cs (Convert): Define a `ConstantEC' which points to a
3909         null.  This is just to prefity some code that uses
3910         ImplicitStandardConversion code and do not have an EmitContext
3911         handy.
3912
3913         The idea is to flag explicitly that at that point in time, it is
3914         known that the conversion will not trigger the delegate checking
3915         code in implicit conversions (which requires a valid
3916         EmitContext). 
3917
3918         Everywhere: pass new EmitContext parameter since
3919         ImplicitStandardConversionExists now requires it to check for
3920         anonymous method conversions. 
3921
3922         (Convert.ImplicitStandardConversionExists): If the type of an
3923         expression is the anonymous_method_type, and the type is a
3924         delegate, we invoke the AnonymousMethod.Compatible method to check
3925         whether an implicit conversion is possible. 
3926
3927         (Convert.ImplicitConversionStandard): Only do implicit method
3928         group conversions if the language level is not ISO_1.
3929
3930         * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
3931         MethodInfo for the Invoke method.  used by Delegate and
3932         AnonymousDelegate.
3933
3934         * expression.cs (Binary.DoNumericPromotions): only allow anonymous
3935         method conversions if the target type is a delegate.
3936
3937         Removed extra debugging nops.
3938
3939         (LocalVariableReference): Turn the `local_info' into a public
3940         field. 
3941
3942         Add `prepared' field, the same hack used for FieldExprs to cope
3943         with composed assignments, as Local variables do not necessarily
3944         operate purely on the stack as they used to: they can be captured
3945         fields. 
3946
3947         Add `temp' for a temporary result, like fields.
3948
3949         Refactor DoResolve and DoResolveLValue into DoResolveBase.
3950
3951         It now copes with Local variables that are captured and emits the
3952         proper instance variable to load it from a field in the captured
3953         case. 
3954
3955         (ParameterReference.DoResolveBase): During the resolve phase,
3956         capture parameters if we are in an anonymous method.
3957
3958         (ParameterReference.Emit, ParameterReference.AddressOf): If in an
3959         anonymous method, use the EmitContext helper routines to emit the
3960         parameter reference.
3961
3962         * iterators.cs: Set RemapToProxy to true/false during the
3963         EmitDispose class.
3964
3965         * parameters.cs (GetParameterByName): New helper method. 
3966
3967         * typemanager.cs (anonymous_method_type) a new type that
3968         represents an anonyous method.  This is always an internal type,
3969         used as a fencepost to test against the anonymous-methodness of an
3970         expression. 
3971         
3972 2004-10-20  Marek Safar  <marek.safar@seznam.cz>
3973
3974         * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
3975         561 report.
3976         (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
3977
3978 2004-11-10  Martin Baulig  <martin@ximian.com>
3979
3980         * expression.cs (Invocation.BetterFunction): If two methods have
3981         equal parameter types, but only one of them is generic, the
3982         non-generic one wins.
3983         (New.DoResolve): Don't set `is_struct' to false if we're a generic
3984         instance; just use `Type.IsValueType' to determine whether
3985         something is a struct or not.
3986         (MemberAccess.DoResolveAsTypeStep): Don't modify the `args' field,
3987         so we can be called multiple times.
3988
3989 2004-11-10  Martin Baulig  <martin@ximian.com>
3990
3991         * generic.cs (TypeParameter.DefineConstraints): New public method.
3992         (TypeParameter.CheckAccessLevel): Override this and return true.
3993         (ConstructedType.ResolveType): Renamed to DoResolveType(), don't
3994         override ResolveType() anymore.
3995         (ConstructedType.DoResolveAsTypeStep): Call DoResolveType() here.
3996
3997 2004-11-10  Martin Baulig  <martin@ximian.com>
3998
3999         * rootcontext.cs (RootContext.LookupType): If we're a nested type,
4000         call DeclSpace.ResolveNestedType() on it.
4001
4002 2004-11-10  Martin Baulig  <martin@ximian.com>
4003
4004         * support.cs (ReflectionParameters.ParameterModifier): If `gpd' is
4005         non-null, call ParameterModifier() on it.
4006
4007 2004-11-10  Martin Baulig  <martin@ximian.com>
4008
4009         * iterators.cs
4010         (Iterators): Added `current_type' and `this_type' fields.
4011         (Iterators.DefineIterator): Create a new EmitContext and store it
4012         in `ec'; compute `this_type'.
4013
4014 2004-11-10  Martin Baulig  <martin@ximian.com>
4015
4016         * typemanager.cs
4017         (TypeManager.IsPrivateAccessible): New public method.
4018         (Closure.Filter): Use IsPrivateAccessible() instead of IsEqual().
4019
4020 2004-11-10  Martin Baulig  <martin@ximian.com>
4021
4022         * class.cs (TypeContainer.DefineType): Call
4023         TypeBuilder.DefineGenericParameters() before resolving the type
4024         parameters.
4025         (MethodData.parent_method): New protected field.
4026         (MethodData..ctor): Added `MethodInfo parent_method' argument.
4027         (MethodData.Define): Compute `parent_method'.
4028
4029         * decl.cs
4030         (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
4031         (MemberCore.GetClsCompliantAttributeValue): Likewise.
4032         (DeclSpace.ec): New protected field; store the EmitContext here.
4033         (DeclSpace.EmitContext): New public property.
4034         (DeclSpace.ResolveType): Un-comment from the [Obsolte] attribute.
4035         (DeclSpace.ResolveNestedType): New public method.
4036         (DeclSpace.ResolveTypeExpr): Just call ResolveAsTypeTerminal() here.
4037         (DeclSpace.NestedAccessible): Added `Type tb' argument.
4038         (DeclSpace.FamilyAccessible): Likewise.
4039         (DeclSpace.FindType): Call ResolveNestedType() for nested types.
4040         (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
4041         EmitContext.
4042
4043         * delegate.cs (Delegate.Define): Store the EmitContext in the `ec'
4044         field.
4045
4046         * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
4047         (Enum.Emit): Don't create a new EmitContext.
4048
4049 2004-10-18  Martin Baulig  <martin@ximian.com>
4050
4051         * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
4052         `Type' directly, but call ResolveType() on it.
4053         (Catch.Resolve): Likewise.
4054         (Foreach.Resolve): Likewise.
4055
4056 2004-10-18  Martin Baulig  <martin@ximian.com>
4057
4058         * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
4059         `Type' directly, but call ResolveType() on it.
4060         (Probe.DoResolve): Likewise.
4061         (ArrayCreation.LookupType): Likewise.
4062         (TypeOf.DoResolve): Likewise.
4063         (SizeOf.DoResolve): Likewise.
4064
4065 2004-10-18  Raja R Harinath  <rharinath@novell.com>
4066
4067         * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
4068         the ResolveType.
4069
4070 2004-10-17  John Luke  <john.luke@gmail.com>
4071
4072         * class.cs (Operator.GetSignatureForError): use CSharpName
4073
4074         * parameter.cs (Parameter.GetSignatureForError): Returns
4075         correct name even if was not defined.
4076
4077 2004-10-13  Raja R Harinath  <rharinath@novell.com>
4078
4079         Fix #65816.
4080         * class.cs (TypeContainer.EmitContext): New property.
4081         (DefineNestedTypes): Create an emitcontext for each part.
4082         (MethodCore.DoDefineParameters): Use container's emitcontext.
4083         Pass type array to InternalParameters.
4084         (MemberBase.DoDefine): Use container's emitcontext.
4085         (FieldMember.Define): Likewise.
4086         (Event.Define): Likewise.
4087         (SetMethod.GetParameterInfo): Change argument to EmitContext.
4088         Pass type array to InternalParameters.
4089         (SetIndexerMethod.GetParameterInfo): Likewise.
4090         (SetMethod.Define): Pass emitcontext to GetParameterInfo.
4091         * delegate.cs (Define): Pass emitcontext to
4092         ComputeAndDefineParameterTypes and GetParameterInfo.  Pass type
4093         array to InternalParameters.
4094         * expression.cs (ParameterReference.DoResolveBase): Pass
4095         emitcontext to GetParameterInfo.
4096         (ComposedCast.DoResolveAsTypeStep): Remove check on
4097         ec.ResolvingTypeTree.
4098         * parameter.cs (Parameter.Resolve): Change argument to
4099         EmitContext.  Use ResolveAsTypeTerminal.
4100         (Parameter.GetSignature): Change argument to EmitContext.
4101         (Parameters.ComputeSignature): Likewise.
4102         (Parameters.ComputeParameterTypes): Likewise.
4103         (Parameters.GetParameterInfo): Likewise.
4104         (Parameters.ComputeAndDefineParameterTypes): Likewise.
4105         Re-use ComputeParameterTypes.  Set ec.ResolvingTypeTree.
4106         * support.cs (InternalParameters..ctor): Remove variant that takes
4107         a DeclSpace.
4108         * typemanager.cs (system_intptr_expr): New.
4109         (InitExpressionTypes): Initialize it.
4110
4111 2004-10-12  Chris Toshok  <toshok@ximian.com>
4112
4113         * cs-parser.jay: fix location for try_statement and catch_clause.
4114
4115 2004-10-18  Martin Baulig  <martin@ximian.com>
4116
4117         * class.cs (FieldMember.Define): Don't access the TypeExpr's
4118         `Type' directly, but call ResolveType() on it.
4119         (MemberBase.DoDefine): Likewise.
4120
4121         * expression.cs (New.DoResolve): Don't access the TypeExpr's
4122         `Type' directly, but call ResolveType() on it.
4123         (ComposedCast.DoResolveAsTypeStep): Likewise.
4124
4125         * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
4126         `Type' directly, but call ResolveType() on it.
4127
4128 2004-10-17  John Luke  <john.luke@gmail.com>
4129
4130         * class.cs (Operator.GetSignatureForError): use CSharpName
4131
4132         * parameter.cs (Parameter.GetSignatureForError): Returns
4133         correct name even if was not defined.
4134
4135 2004-10-13  Raja R Harinath  <rharinath@novell.com>
4136
4137         Fix #65816.
4138         * class.cs (TypeContainer.EmitContext): New property.
4139         (DefineNestedTypes): Create an emitcontext for each part.
4140         (MethodCore.DoDefineParameters): Use container's emitcontext.
4141         Pass type array to InternalParameters.
4142         (MemberBase.DoDefine): Use container's emitcontext.
4143         (FieldMember.Define): Likewise.
4144         (Event.Define): Likewise.
4145         (SetMethod.GetParameterInfo): Change argument to EmitContext.
4146         Pass type array to InternalParameters.
4147         (SetIndexerMethod.GetParameterInfo): Likewise.
4148         (SetMethod.Define): Pass emitcontext to GetParameterInfo.
4149         * delegate.cs (Define): Pass emitcontext to
4150         ComputeAndDefineParameterTypes and GetParameterInfo.  Pass type
4151         array to InternalParameters.
4152         * expression.cs (ParameterReference.DoResolveBase): Pass
4153         emitcontext to GetParameterInfo.
4154         (ComposedCast.DoResolveAsTypeStep): Remove check on
4155         ec.ResolvingTypeTree.
4156         * parameter.cs (Parameter.Resolve): Change argument to
4157         EmitContext.  Use ResolveAsTypeTerminal.
4158         (Parameter.GetSignature): Change argument to EmitContext.
4159         (Parameters.ComputeSignature): Likewise.
4160         (Parameters.ComputeParameterTypes): Likewise.
4161         (Parameters.GetParameterInfo): Likewise.
4162         (Parameters.ComputeAndDefineParameterTypes): Likewise.
4163         Re-use ComputeParameterTypes.  Set ec.ResolvingTypeTree.
4164         * support.cs (InternalParameters..ctor): Remove variant that takes
4165         a DeclSpace.
4166         * typemanager.cs (system_intptr_expr): New.
4167         (InitExpressionTypes): Initialize it.
4168
4169 2004-10-12  Chris Toshok  <toshok@ximian.com>
4170
4171         * cs-parser.jay: fix location for try_statement and catch_clause.
4172
4173 2004-10-07  Raja R Harinath  <rharinath@novell.com>
4174
4175         More DeclSpace.ResolveType avoidance.
4176         * decl.cs (MemberCore.InUnsafe): New property.
4177         * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal 
4178         with newly created EmitContext.
4179         (FieldMember.Define): Likewise.
4180         * delegate.cs (Delegate.Define): Likewise.
4181         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
4182         only if normal name-lookup fails.
4183         (TypeExpr.DoResolve): Enable error-checking.
4184         * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
4185         (SizeOf.DoResolve): Likewise.
4186         (ComposedCast.DoResolveAsTypeStep): Likewise.
4187         (StackAlloc.DoResolve): Likewise.
4188         * statement.cs (Block.Flags): Add new flag 'Unsafe'.
4189         (Block.Unsafe): New property.
4190         (Block.EmitMeta): Set ec.InUnsafe as appropriate.
4191         (Unsafe): Set 'unsafe' flag of contained block.
4192         (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
4193         (Fixed.Resolve): Likewise.
4194         (Catch.Resolve): Likewise.
4195         (Using.ResolveLocalVariableDecls): Likewise.
4196         (Foreach.Resolve): Likewise.
4197
4198 2004-10-05  John Luke <john.luke@gmail.com>
4199
4200         * cs-parser.jay: add location to error CS0175
4201
4202 2004-10-04  Miguel de Icaza  <miguel@ximian.com>
4203
4204         * ecore.cs (Expression.Constantity): Add support for turning null
4205         into a constant.
4206
4207         * const.cs (Const.Define): Allow constants to be reference types
4208         as long as the value is Null.
4209
4210 2004-10-04  Juraj Skripsky  <js@hotfeet.ch>
4211
4212         * namespace.cs (NamespaceEntry.Using): No matter which warning
4213         level is set, check if this namespace name has already been added.
4214
4215 2004-10-03 Ben Maurer  <bmaurer@ximian.com>
4216
4217         * expression.cs: reftype [!=]= null should always use br[true,false].
4218         # 67410
4219
4220 2004-10-03  Marek Safar  <marek.safar@seznam.cz>
4221
4222         Fix #67108
4223         * attribute.cs: Enum conversion moved to 
4224         GetAttributeArgumentExpression to be applied to the all
4225         expressions.
4226
4227 2004-10-01  Raja R Harinath  <rharinath@novell.com>
4228
4229         Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
4230         * class.c (TypeContainer.DefineType): Flag error if
4231         base types aren't accessible due to access permissions.
4232         * decl.cs (DeclSpace.ResolveType): Move logic to
4233         Expression.ResolveAsTypeTerminal.
4234         (DeclSpace.ResolveTypeExpr): Thin layer over
4235         Expression.ResolveAsTypeTerminal.
4236         (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
4237         Refactor code into NestedAccess.  Use it.
4238         (DeclSpace.NestedAccess): New.
4239         * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
4240         argument to silence errors.  Check access permissions.
4241         (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
4242         * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
4243         (Cast.DoResolve): Likewise.
4244         (New.DoResolve): Likewise.
4245         (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
4246         (TypeOf.DoResolve): Likewise.
4247
4248         * expression.cs (Invocation.BetterConversion): Return the Type of
4249         the better conversion.  Implement section 14.4.2.3 more faithfully.
4250         (Invocation.BetterFunction): Make boolean.  Make correspondence to
4251         section 14.4.2.2 explicit.
4252         (Invocation.OverloadResolve): Update.
4253         (Invocation): Remove is_base field.
4254         (Invocation.DoResolve): Don't use is_base.  Use mg.IsBase.
4255         (Invocation.Emit): Likewise.
4256
4257 2004-09-24  Marek Safar  <marek.safar@seznam.cz>
4258
4259         * cs-parser.jay: Reverted 642 warning fix.
4260
4261 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
4262
4263         Fix bug #66615
4264         * decl.cs (FindMemberWithSameName): Indexer can have more than
4265         1 argument.
4266
4267 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
4268
4269         * expression.cs (LocalVariableReference.DoResolveLValue):
4270         Do not report warning 219 for out values.
4271         (EmptyExpression.Null): New member to avoid extra allocations.
4272
4273 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
4274
4275         * cs-parser.jay: Fix wrong warning 642 report.
4276
4277         * cs-tokenizer.cs (CheckNextToken): New helper;
4278         Inspect next character if is same as expected.
4279
4280 2004-09-23  Martin Baulig  <martin@ximian.com>
4281
4282         * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
4283         (Convert.ImplicitReferenceConversionExists): Likewise.
4284
4285 2004-11-09  Raja R Harinath  <rharinath@novell.com>
4286
4287         * Makefile (DISTFILES): Comment out a few missing files.
4288
4289 2004-10-29  Raja R Harinath  <rharinath@novell.com>
4290
4291         * Makefile (bootstrap_libs,bootstrap_libfiles): New.
4292         (bootstrap-libs): New target.  Invokes the net_2_0_bootstrap profile.
4293         (gmcs.exe): Invoke bootstrap-libs.
4294         (clean-local): Clean the net_2_0_bootstrap profile too.
4295         (PROGRAM_INSTALL_DIR): New.
4296         (install-local): Use it.
4297
4298 2004-10-13  Martin Baulig  <martin@ximian.com>
4299
4300         * generic.cs (TypeManager.InflatedConstraints): New nested class.
4301         (TypeParameter.DefineType): If we're a method type parameter and
4302         that method is overriding something, "inflate" its constraints.
4303
4304 2004-10-12  Martin Baulig  <martin@ximian.com>
4305
4306         * expression.cs (MemberAccess.DoResolve): If we're a SimpleName
4307         and have type arguments, create and resolve a ConstructedType.
4308
4309 2004-10-12  Martin Baulig  <martin@ximian.com>
4310
4311         * decl.cs (MemberCache.FindMemberToOverride): Use
4312         TypeManager.IsEqual() to compare the parameters and Type.Equals()
4313         to compare the invocationType.
4314
4315         * typemanager.cs (TypeManager.IsEqual): Added support for arrays.
4316         When comparing two type parameters, only do the signature-only
4317         comparision for method type parameters.
4318
4319 2004-10-11  Martin Baulig  <martin@ximian.com>
4320
4321         * report.cs: Don't make --fatal abort on warnings, we have
4322         -warnaserror for that.
4323
4324 2004-10-11  Martin Baulig  <martin@ximian.com>
4325
4326         * typemanager.cs
4327         (TypeManager.IsEqualGenericType): Removed, use IsEqual() instead.
4328         (TypeManager.IsEqual): Call ourself recursively instead of using
4329         Type.IsEqual(). 
4330
4331 2004-10-11  Martin Baulig  <martin@ximian.com>
4332
4333         * class.cs (TypeContainer.DefineType): Only call TypeParameter.Define()
4334         on our own type parameters, not on the ones we inherit from a containing
4335         class.
4336
4337         * expression.cs (Invocation.InferType): Use `==', not `Equals()' for
4338         the comparision.
4339
4340         * generic.cs (TypeParameter.Define): We may only be called once.
4341
4342         * pending.cs (Pending.InterfaceMethod): Call TypeManager.Real_IsEqual()
4343         instead of TypeManager.IsEqual().
4344
4345 2004-09-28  Martin Baulig  <martin@ximian.com>
4346
4347         * generic.cs
4348         (GenericConstraints.EffectiveBaseClass): New public property.
4349         (TypeParameter.GenericConstraints): New public property.
4350         (ConstructedType.CheckConstraints): Improved.
4351
4352         * convert.cs (Convert.TypeParam_EffectiveBaseType): New private method.
4353         (Convert.TypeParameterConversion): New private method; use this in
4354         ImplicitReferenceConversion() and ImplicitReferenceConversionExists()
4355         for all conversions related to type parameters.
4356
4357 2004-09-24  Martin Baulig  <martin@ximian.com>
4358
4359         * convert.cs (Convert.ImplicitReferenceConversion): Added implicit
4360         type parameter conversions for type parameters which are known to
4361         be reference types.
4362
4363 2004-09-24  Martin Baulig  <martin@ximian.com>
4364
4365         * generic.cs (GenericConstraints): Added `IsReferenceType' and
4366         `IsValueType' properties.
4367
4368         * support.cs (ReflectionConstraints): Use
4369         Type.GetGenericParameterConstraints() instead of the old hack.
4370
4371 2004-09-24  Martin Baulig  <martin@ximian.com>
4372
4373         * generic.cs (GenericConstraints): Moved here and made it an
4374         abstract class.
4375
4376         * support.cs (GenericConstraints): Moved to generic.cs.
4377
4378 2004-09-24  Martin Baulig  <martin@ximian.com>
4379
4380         * support.cs
4381         (ReflectionConstraints): Un-nested this class and made it public.
4382
4383         * typemanager.cs
4384         (TypeManager.GetTypeParameterConstraints): New public method.
4385         (TypeManager.HasConstructorConstraint): Use the attributes.
4386
4387 2004-09-24  Martin Baulig  <martin@ximian.com>
4388
4389         * support.cs (GenericConstraints): Replaced `HasConstructor',
4390         `IsReferenceType' and `IsValueType' with `Attributes'.
4391         (ReflectionParameters.ReflectionConstraints): Removed the Create()
4392         method and made the .ctor public.
4393
4394         * generic.cs (Constraints.Attributes): New public property.
4395         (Constraints): Renamed `HasConstructor' -> `HasConstructorConstraint',
4396         `IsReferenceType' -> `HasReferenceTypeConstraint' and
4397         `IsValueType' -> `HasValueTypeConstraint'.
4398
4399 2004-09-23  Martin Baulig  <martin@ximian.com>
4400
4401         * generic.cs (Constraints): Reflect latest runtime changes.
4402
4403 2004-09-23  Martin Baulig  <martin@ximian.com>
4404
4405         * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
4406         (Convert.ImplicitReferenceConversionExists): Likewise.
4407
4408 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
4409
4410         * class.cs (Operator.Define): Add error 448 and 559 report.
4411         
4412 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
4413
4414         * class.cs (MemberBase.IsTypePermitted): New protected
4415         method for checking error CS0610.
4416
4417 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
4418
4419         * class.cs (TypeContainer.HasExplicitLayout): New property
4420         Returns whether container has StructLayout attribute set Explicit.
4421         (FieldMember): New abstract class for consts and fields.
4422         (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
4423         (Field): Reuse FieldMember.
4424
4425         * const.cs (Const): Reuse FieldMember.
4426
4427         * rootcontext.cs: EmitConstants call moved to class.
4428
4429 2004-09-22  Martin Baulig  <martin@ximian.com>
4430
4431         Marek and me just fixed one of our oldest bugs: #28562 :-)
4432
4433         * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
4434
4435         * attribute.cs (Attribute.GetAttributeArgumentExpression): If
4436         we're an EnumConstant, just return that.
4437         (Attribute.Resolve): GetAttributeArgumentExpression() may give us
4438         an EnumConstant.  In this case, we need to use GetValueAsEnumType()
4439         to get the value which'll actually be written into the attribute.
4440         However, we have to use GetValue() to access the attribute's value
4441         in the compiler.        
4442
4443 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
4444
4445         * constant.cs (Constant.IsNegative): New abstract property
4446         IsNegative.
4447
4448         * expression.cs (ArrayAccess.DoResolve): Add warning 251.
4449         (StackAlloc.DoResolve): Reused IsNegative.
4450
4451 2004-09-22  Martin Baulig  <martin@ximian.com>
4452
4453         * typemanager.cs (TypeManager.LookupGenericTypeContainer): New
4454         public method; like LookupTypeContainer, but also works for
4455         generic instances.
4456
4457         * report.cs (Report.SymbolRelatedToPreviousError): Use
4458         TypeManager.LookupGenericTypeContainer().       
4459
4460 2004-09-22  Martin Baulig  <martin@ximian.com>
4461
4462         Thanks to Peter Sestoft for this bug report.
4463
4464         * expression.cs (Conditional): If both the `trueExpr' and the
4465         `falseExpr' is a NullLiteral, return a NullLiteral.
4466
4467 2004-09-22  Martin Baulig  <martin@ximian.com>
4468
4469         * statement.cs (Foreach.EmitCollectionForeach): If we're in an
4470         iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
4471         for the "get_Current" call.
4472
4473 2004-09-21  Martin Baulig  <martin@ximian.com>
4474
4475         * convert.cs (Convert.ImplicitReferenceConversion): When
4476         converting to an interface type, first check whether we're
4477         converting from a reference type.
4478
4479 2004-09-14  Martin Baulig  <martin@ximian.com>
4480
4481         * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
4482
4483 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
4484
4485         Fixed bug #61902
4486         * codegen.cs (TestObsoleteMethodUsage): Trace when method is
4487         called and is obsolete then this member suppress message
4488         when call is inside next [Obsolete] method or type.
4489
4490         * expression.cs: Use TestObsoleteMethodUsage member.
4491
4492 2004-09-14  Martin Baulig  <martin@ximian.com>
4493
4494         * genericparser.cs: Removed.
4495
4496 2004-09-13  Marek Safar  <marek.safar@seznam.cz>
4497
4498         * class.cs (MethodCore.CheckBase): Fix bug #65757.
4499
4500 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
4501
4502         * attribute.cs (Attribute.Resolve): Add error 653 report.
4503
4504         * class.cs (Class.ApplyAttributeBuilder): Add error 641
4505         report.
4506         (Method.ApplyAttributeBuilder): Add error 685 report.
4507         (Operator.Define): Add error 564 report.
4508
4509         * cs-tokenizer.cs (handle_hex): Add error 1013 report.
4510
4511         * expression.cs (Invocation.DoResolve): Add error
4512         245 and 250 report.
4513
4514         * parameter.cs (Parameter.ApplyAttributeBuilder): Add
4515         error 674 report.
4516
4517 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
4518
4519         * class.cs (ConstructorInitializer.Resolve):
4520         Wrong error number (515->516).
4521
4522 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
4523
4524         * class.cs (Indexer.Define): Add error 631 report.
4525
4526 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
4527
4528         * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
4529
4530 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
4531
4532         * expression.cs (Probe.DoResolve): Add error CS0241 report.
4533
4534 2004-09-10  Marek Safar  <marek.safar@seznam.cz>
4535
4536         * cs-parser.jay: Added error CS0241 report.
4537
4538 2004-09-10  Raja R Harinath  <rharinath@novell.com>
4539
4540         * cs-parser.jay (fixed_statement): Introduce a scope for the
4541         declaration in the 'fixed' statement.
4542
4543 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
4544
4545         * cs-parser.jay: Added CS0230 error report.
4546
4547 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
4548
4549         * cs-parser.jay: Added errors CS0231 and CS0257 report.
4550
4551 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
4552
4553         * expression.cs (Argument.Resolve): Added error CS0192 and
4554         CS0199 report.
4555
4556 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
4557
4558         C# 2.0 #pragma warning feature
4559
4560         * cs-tokenizer.cs (PreProcessPragma): New method; 
4561         Handles #pragma directive.
4562
4563         * report.cs (WarningRegions): New class; Support
4564         class for #pragma warning directive. It tests whether
4565         warning is enabled for a given line.
4566
4567 2004-09-08  Miguel de Icaza  <miguel@ximian.com>
4568
4569         * const.cs: Add more descriptive error report, tahnks to
4570         Sebastien. 
4571
4572 2004-09-08  Marek Safar  <marek.safar@seznam.cz>
4573
4574         * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
4575
4576 2004-09-07  Miguel de Icaza  <miguel@ximian.com>
4577
4578         * expression.cs: Apply patch from Ben: Remove dead code from
4579         ArrayCreation, and remove the TurnintoConstant call in const.cs,
4580         as that code just threw an exception anwyays.
4581
4582         * const.cs: Remove the call to the turnintoconstant, for details
4583         see bug: #63144
4584         
4585         * literal.cs: The type of the null-literal is the null type;  So
4586         we use a placeholder type (literal.cs:System.Null, defined here)
4587         for it.
4588
4589         * expression.cs (Conditional.DoResolve): Remove some old code that
4590         is no longer needed, conversions have been fixed.
4591
4592         (ArrayCreationExpression.DoResolve): Return false if we fail to
4593         resolve the inner expression.
4594
4595 2004-09-07  Raja R Harinath  <rharinath@novell.com>
4596
4597         Fix test-290.cs.
4598         * cs-parser.jay (delegate_declaration): Record a delegate
4599         declaration as a type declaration.
4600         Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
4601
4602 2004-09-06  Miguel de Icaza  <miguel@ximian.com>
4603
4604         * parameter.cs: Do not crash if the type can not be resolved. 
4605
4606         * expression.cs: Report errors with unsafe pointers, fixes #64896
4607
4608 2004-09-06 Ben Maurer  <bmaurer@users.sourceforge.net>
4609
4610         * expression.cs: Pointer arith always needs to do a conv.i
4611         if the operand is a long. fix 65320
4612
4613 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
4614
4615         Fixed cs0619-37.cs, cs0619-38.cs
4616
4617         * enum.cs (GetObsoleteAttribute): Removed.
4618
4619         * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
4620         on Enum member is double staged. The first is tested member
4621         and then enum.
4622
4623 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
4624
4625         Fixed #56986, #63631, #65231
4626
4627         * class.cs: (TypeContainer.AddToMemberContainer): New method,
4628         adds member to name container.
4629         (TypeContainer.AddToTypeContainer): New method, adds type to
4630         name container.
4631         (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
4632         AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
4633         AddOperator): Simplified by reusing AddToMemberContainer.
4634         (TypeContainer.UserDefinedStaticConstructor): Changed to property
4635         instead of field.
4636         (Method.CheckForDuplications): Fixed implementation to test all
4637         possibilities.
4638         (MemberBase): Detection whether member is explicit interface
4639         implementation is now in constructor.
4640         (MemberBase.UpdateMemberName): Handles IndexerName.
4641         (Accessor): Changed to keep also location information.
4642         (AbstractPropertyEventMethod): Is derived from MemberCore.
4643         (AbstractPropertyEventMethod.IsDummy): Says whether accessor
4644         will be emited or not.
4645         (PropertyBase.AreAccessorsDuplicateImplementation):
4646         Tests whether accessors are not in collision with some method.
4647         (Operator): Is derived from MethodCore to simplify common
4648         operations.
4649
4650         * decl.cs (Flags.TestMethodDuplication): Test for duplication
4651         must be performed.
4652         (DeclSpace.AddToContainer): Adds the member to defined_names
4653         table. It tests for duplications and enclosing name conflicts.
4654
4655         * enum.cs (EnumMember): Clean up to reuse the base structures
4656
4657 2004-09-03  Martin Baulig  <martin@ximian.com>
4658
4659         Merged latest changes into gmcs.  Please keep this comment in
4660         here, it makes it easier for me to see what changed in MCS since
4661         the last time I merged.
4662
4663 2004-09-03  Martin Baulig  <martin@ximian.com>
4664
4665         * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
4666         into TypeContainer, to make partial classes work again.
4667
4668 2004-09-03  Martin Baulig  <martin@ximian.com>
4669
4670         * rootcontext.cs (RootContext.V2): Removed.
4671
4672 2004-03-23  Martin Baulig  <martin@ximian.com>
4673
4674         * expression.cs (Invocation.OverloadResolve): Added `bool
4675         may_fail' argument and use it instead of the Location.IsNull() hack.
4676
4677 2004-09-09  Martin Baulig  <martin@ximian.com>
4678
4679         * cs-parser.jay (namespace_declaration): Fixed CS0134 reporting.
4680
4681 2004-09-09  Martin Baulig  <martin@ximian.com>
4682
4683         * generic.cs (TypeParameter.DefineType): Added support for
4684         explicit interface methods.
4685
4686 2004-09-09  Martin Baulig  <martin@ximian.com>
4687
4688         * README.Changes: New document.  Started to list important changes
4689         between MCS and GMCS here.
4690
4691 2004-09-08  Martin Baulig  <martin@ximian.com>
4692
4693         * class.cs
4694         (TypeContainer.CheckRecursiveDefinition): New protected method.
4695         (TypeContainer.DefineType): Move the CS0146 check into
4696         CheckRecursiveDefinition().     
4697
4698 2004-09-06  Martin Baulig  <martin@ximian.com>
4699
4700         * generic.cs (ConstructedType.CheckConstraints): Allow builtin
4701         types for the constructor constraint.
4702
4703 2004-09-03  Martin Baulig  <martin@ximian.com>
4704
4705         * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
4706         into TypeContainer, to make partial classes work again.
4707
4708 2004-09-03  Martin Baulig  <martin@ximian.com>
4709
4710         * rootcontext.cs (RootContext.V2): Removed.
4711
4712 2004-03-23  Martin Baulig  <martin@ximian.com>
4713
4714         * expression.cs (Invocation.OverloadResolve): Added `bool
4715         may_fail' argument and use it instead of the Location.IsNull() hack.
4716
4717 2004-09-03  Martin Baulig  <martin@ximian.com>
4718
4719         Merged latest changes into gmcs.  Please keep this comment in
4720         here, it makes it easier for me to see what changed in MCS since
4721         the last time I merged.
4722
4723 2004-09-03  Raja R Harinath  <rharinath@novell.com>
4724
4725         Fix #61128.
4726         * expression.cs (BetterConversion): Don't allow either conversion 
4727         to be null.  Remove redundant implicit conversion test when 'q ==
4728         null' -- when this function is invoked, we already know that the
4729         implicit conversion exists.
4730         (BetterFunction): Assume that 'best' is non-null.  Remove
4731         redundant reimplementation of IsApplicable when 'best' is null.
4732         (IsParamsMethodApplicable, IsApplicable): Add new parameter for
4733         number of arguments.
4734         (IsAncestralType): Extract from OverloadResolve.
4735         (OverloadResolve): Make robust to the MethodGroupExpr being
4736         unsorted.  Implement all the logic of Section 14.5.5.1, and
4737         support overloading of methods from multiple applicable types.
4738         Clean up logic somewhat.  Don't pass null methods to BetterFunction.
4739
4740         * report.cs (SymbolRelatedToPreviousError): Cleanup output.
4741         (RealError, Warning): Append type of report to related symbol.
4742
4743 2004-09-03  Marek Safar  <marek.safar@seznam.cz>
4744
4745         * enum.cs: Fixed CLS-Compliance checks for enum members.
4746         Error tests cs3008-8.cs, cs3014-8.cs
4747
4748 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
4749
4750         Fixed bug #62342, #63102
4751         * class.cs: ImplementIndexer uses member.IsExplicitImpl
4752         like ImplementMethod.
4753
4754 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
4755
4756         * attribute.cs (Attribute.GetAttributeArgumentExpression):
4757         Fixed bug #65170.
4758
4759 2004-09-02  Martin Baulig  <martin@ximian.com>
4760
4761         * statement.cs (Using.EmitLocalVariableDeclFinally): Use
4762         TypeManager.GetArgumentTypes() rather than calling GetParameters()
4763         on the MethodBase.
4764
4765 2004-09-01  Marek Safar  <marek.safar@seznam.cz>
4766
4767         C# 2.0 Static classes implemented
4768
4769         * class.cs (TypeContainer): instance_constructors,
4770         initialized_fields, initialized_static_fields,
4771         default_constructor, base_inteface_types are protected to be
4772         accessible from StaticClass.
4773         (TypeContainer.DefineDefaultConstructor): New virtual method
4774         for custom default constructor generating
4775         (StaticClass): New class to handle "Static classes" feature.
4776
4777         * cs-parser.jay: Handle static keyword on class like instance
4778         of StaticClass.
4779
4780         * driver.cs: Added "/langversion" command line switch with two
4781         options (iso-1, default).
4782
4783 2004-08-31  Marek Safar  <marek.safar@seznam.cz>
4784
4785         * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
4786
4787 2004-08-31  Miguel de Icaza  <miguel@ximian.com>
4788
4789         * delegate.cs: Style.
4790
4791 2004-08-31 Ben Maurer  <bmaurer@users.sourceforge.net>
4792
4793         * delegate.cs: Add seperate instance expr field for miguel.
4794
4795 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
4796
4797         * PointerArithmetic (Resolve): make sure we are not doing
4798         pointer arith on void*. Also, make sure we are resolved
4799         by not setting eclass until resolve.
4800
4801         All callers: Make sure that PointerArithmetic gets resolved.
4802
4803 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
4804
4805         * ArrayCreation (LookupType): If the type does not resolve 
4806         to an array, give an error.
4807
4808 2004-08-27  Marek Safar  <marek.safar@seznam.cz>
4809
4810         * statement.cs (Try.Resolve): Fixed bug #64222
4811
4812 2004-08-27  Martin Baulig  <martin@ximian.com>
4813
4814         * class.cs
4815         (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
4816         crash here.     
4817
4818 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
4819
4820         * ecore.cs (Constantify): Get underlying type via
4821         System.Enum.GetUnderlyingType to avoid StackOverflow on the
4822         Windows in special cases.
4823
4824 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
4825
4826         * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
4827         for obtaining also private methods.
4828         (GetRemoveMethod): Used GetRemoveMethod (true)
4829         for obtaining also private methods.
4830
4831 2004-09-02  Martin Baulig  <martin@ximian.com>
4832
4833         * statement.cs (Using.EmitLocalVariableDeclFinally): Use
4834         TypeManager.GetArgumentTypes() rather than calling GetParameters()
4835         on the MethodBase.
4836
4837 2004-08-27  Martin Baulig  <martin@ximian.com>
4838
4839         * class.cs
4840         (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
4841         crash here.     
4842
4843 2004-08-25  Martin Baulig  <martin@ximian.com>
4844
4845         * support.cs (ReflectionParameters..ctor): If this is a generic
4846         method, retrieve and store its type parameters.
4847         (InternalParameters..ctor): Added `TypeParameter[]' argument.
4848         (ReflectionParameters.GenericConstraints): The argument specifies
4849         the type parameter, not the method parameter.
4850         (InternalParameters.GenericConstraints): Likewise.
4851
4852         * generic.cs (TypeParameter.DefineType): Correctly handle
4853         constraints wrt. generic methods in interfaces and their
4854         implementations.        
4855
4856 2004-08-24  Martin Baulig  <martin@ximian.com>
4857
4858         * generic.cs (TypeParameter.IsSubclassOf): New public method.
4859         (Constraints.IsSubclassOf): New internal method.
4860
4861         * typemanager.cs (TypeManager.FindMembers): Added special support
4862         for GenericTypeParameterBuilder's.      
4863         (TypeManager.IsSubclassOf, IsFamilyAccessible): Added support for
4864         type parameters.
4865
4866 2004-08-24  Martin Baulig  <martin@ximian.com>
4867
4868         * typemanager.cs
4869         (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
4870         this for accessibility checks.
4871         (TypeManager.IsSubclassOrNestedChildOf): Renamed to
4872         IsNestedFamilyAccessible.
4873         (TypeManager.IsSubclassOf): New method, do what the name actually
4874         says.   
4875
4876 2004-08-24  Martin Baulig  <martin@ximian.com>
4877
4878         * expression.cs (MemberAccess.DoResolve): When resolving ourselves
4879         as a SimpleName, include the generic arity.
4880
4881 2004-08-24  Martin Baulig  <martin@ximian.com>
4882
4883         * class.cs (Method.Define): Set MethodAttributes.SpecialName and
4884         MethodAttributes.HideBySig for operators.
4885
4886 2004-08-23  Martin Baulig  <martin@ximian.com>
4887
4888         Back to the old error reporting system :-)
4889
4890         * report.cs (Message): Removed.
4891         (Report.MessageData, ErrorData, WarningData): Removed.
4892         (Report.Error, Warning): Back to the old system.
4893
4894 2004-08-23  Martin Baulig  <martin@ximian.com>
4895
4896         * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
4897
4898         * class.cs (TypeContainer.ParentContainer): New public virtual
4899         method; replaces the explicit interface implementation.
4900         (ClassPart.ParentContainer): Override.
4901
4902 2004-08-23  Martin Baulig  <martin@ximian.com>
4903
4904         * statement.cs (Switch): Added support for constant switches; see
4905         #59428 or test-285.cs.
4906
4907 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
4908
4909         Fixed bug #62740.
4910         * statement.cs (GetEnumeratorFilter): Removed useless
4911         logic because C# specs is strict. GetEnumerator must be
4912         public.
4913
4914 2004-08-22  Martin Baulig  <martin@ximian.com>
4915
4916         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
4917         a switch and may break, reset the barrier.  Fixes #59867.
4918
4919 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
4920
4921         CLS-Compliance speed up (~5% for corlib)
4922
4923         * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
4924         New method. Tests container for CLS-Compliant names
4925
4926         * class.cs (TypeContainer.VerifyClsName): New method.
4927         Checks whether container name is CLS Compliant.
4928         (Constructor): Implements IMethodData.
4929
4930         * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
4931         low-case table for CLS Compliance test.
4932         (MemberCache.VerifyClsParameterConflict): New method.
4933         Checks method parameters for CS3006 error.
4934
4935         * enum.cs (EnumMember): Is derived from MemberCore.
4936         (Enum.VerifyClsName): Optimized for better performance.
4937
4938 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
4939
4940         * report.cs: Renamed Error_T to Error and changed all
4941         references.
4942
4943 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
4944
4945         * class.cs (TypeContainer.IndexerArrayList): New inner class
4946         container for indexers.
4947         (TypeContainer.DefaultIndexerName): New constant for default
4948         indexer name. Replaced all "Item" with this constant.
4949         (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
4950
4951         * typemanager.cs (TypeManager.default_member_ctor): Cache here
4952         DefaultMemberAttribute constructor.
4953
4954 2004-08-05  Martin Baulig  <martin@ximian.com>
4955
4956         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
4957         Fix bug #59429.
4958
4959 2004-08-05  Marek Safar  <marek.safar@seznam.cz>
4960
4961         * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
4962         multi platforms problem.
4963
4964         * compiler.csproj: Included shared files.
4965
4966 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
4967
4968         Fix bug 60333, 55971 in the more general way
4969         * attribute.cs (Attribute.GetAttributeArgumentExpression):
4970         Added arg_type argument for constant conversion.
4971         (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
4972
4973 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
4974
4975         Fix bug #59760
4976         * class.cs (TypeContainer ): New inner classes MethodArrayList, 
4977         OperatorArrayList, MethodCoreArrayList for typecontainer
4978         containers. Changed class member types to these new types.
4979         (MethodArrayList.DefineMembers): Added test for CS0659.
4980
4981 2004-08-04  Miguel de Icaza  <miguel@ximian.com>
4982
4983         * cfold.cs: Synchronize the folding with the code in expression.cs
4984         Binary.DoNumericPromotions for uint operands.
4985
4986         * attribute.cs: Revert patch from Raja, it introduced a regression
4987         while building Blam-1.2.1 (hard to isolate a test case).
4988
4989 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
4990
4991         Fix for #55382
4992         * class.cs:
4993         (TypeContainer.Define): Renamed to DefineContainerMembers because of
4994         name collision.
4995         (MethodCore.parent_method): New member. The method we're overriding
4996         if this is an override method.
4997         (MethodCore.CheckBase): Moved from Method class and made common.
4998         (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
4999         private.
5000         (MethodCore.CheckForDuplications): New abstract method. For custom
5001         member duplication search in a container
5002         (MethodCore.FindOutParentMethod): New abstract method. Gets parent
5003         method and its return type.
5004         (Event.conflict_symbol): New member. Symbol with same name in the
5005         parent class.
5006
5007         * decl.cs:
5008         (MemberCache.FindMemberWithSameName): New method. The method
5009         is looking for conflict with inherited symbols.
5010
5011 2004-08-04  Martin Baulig  <martin@ximian.com>
5012
5013         * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
5014
5015         * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
5016
5017 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
5018
5019         * report.cs (Message): New enum for better error, warning reference in
5020         the code.
5021         (MessageData): New inner abstract class. It generally handles printing of
5022         error and warning messages.
5023         Removed unused Error, Warning, Message methods.
5024
5025 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
5026
5027         Fix for cs0592-8.cs test
5028         * attribute.cs
5029         (Attributable.ValidAttributeTargets): Made public.
5030         (Attribute.ExplicitTarget): New member for explicit target value.
5031         (Attribute.CheckTargets): Now we translate explicit attribute
5032         target to Target here.
5033
5034 2004-08-03  Ben Maurer  <bmaurer@ximian.com>
5035
5036         * ecore.cs (MethodGroupExpr): new IsBase property.
5037
5038         * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
5039
5040         * delegate.cs (DelegateCreation): store a MethodGroupExpr
5041         rather than an instance expr.
5042
5043         (DelegateCreation.Emit): Use the method group rather than
5044         the instance expression. Also, if you have base.Foo as the
5045         method for a delegate, make sure to emit ldftn, not ldftnvirt.
5046
5047         (ResolveMethodGroupExpr): Use the MethodGroupExpr. 
5048
5049         (NewDelegate.DoResolve): Only check for the existance of Invoke
5050         if the method is going to be needed. Use MethodGroupExpr.
5051
5052         (NewDelegate.Emit): Remove, DelegateCreation implements this.   
5053
5054         * expression.cs: For pointer arith., make sure to use
5055         the size of the type, not the size of the pointer to
5056         the type.
5057
5058 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
5059
5060         Fix for #60722
5061         * class.cs (Class): Added error CS0502 test.
5062
5063 2004-08-03  John Luke  <jluke@cfl.rr.com>
5064             Raja R Harinath  <rharinath@novell.com>
5065
5066         Fix for #60997.
5067         * attribute.cs (Attribute.complained_before): New flag.
5068         (Attribute.ResolveType, Attribute.Resolve),
5069         (Attribute.DefinePInvokeMethod): Set it.
5070         (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
5071         
5072 2004-08-03  Martin Baulig  <martin@ximian.com>
5073
5074         * expression.cs (Binary.ResolveOperator): Don't abort if we can't
5075         use a user-defined operator; we still need to do numeric
5076         promotions in case one argument is a builtin type and the other
5077         one has an implicit conversion to that type.  Fixes #62322.
5078
5079 2004-08-18  Martin Baulig  <martin@ximian.com>
5080
5081         * class.cs (Method.Define): Use the correct method name when
5082         creating the MethodBuilder for a generic method.
5083
5084 2004-08-17  Martin Baulig  <martin@ximian.com>
5085
5086         * generic.cs (Constraints): Support type parameter constraints.
5087
5088 2004-08-16  Martin Baulig  <martin@ximian.com>
5089
5090         * cs-tokenizer.cs (Tokenizer.TypeOfParsing): New public property.
5091         (Token.GENERIC_DIMENSION): New token; this is returned if we
5092         encounter an unbound generic type in a typeof() expression.
5093
5094         * cs-parser.jay (opt_type_argument_list): Added GENERIC_DIMENSION;
5095         this token is only generated while parsing a typeof() expression.
5096         (typeof_expression): Removed the old unbound_type hack.
5097
5098         * generic.cs (TypeArguments.IsUnbound): New public property.
5099
5100         * decl.cs (MemberName): Added support for unbound types.
5101
5102 2004-08-14  Martin Baulig  <martin@ximian.com>
5103
5104         * typemanager.cs
5105         (TypeManager.IsEqualGenericInstance): New static method.
5106         (TypeManager.IsSubclassOrNestedChildOf, IsSubclassOf): This is
5107         just used to check accessibility, so follow the rules of 26.1.6.        
5108
5109         * expression.cs (MemberAccess.ResolveAsTypeStep): Return a
5110         ConstructedType instead of a TypeExpression if we have type arguments.
5111
5112         * cs-parser.jay (typeof_expression): Support unbound generic types.
5113
5114         * ecore.cs (UnboundTypeExpression): New public class.
5115
5116 2004-08-12  Martin Baulig  <martin@ximian.com>
5117
5118         * typemanager.cs (TypeManager.IsNestedChildOf): Use
5119         TypeManager.IsEqual() rather than `=='.
5120
5121         * decl.cs (DeclSpace.CheckAccessLevel): Use `tb.FullName' for
5122         generic instances as well.
5123
5124 2004-08-12  Martin Baulig  <martin@ximian.com>
5125
5126         * expression.cs (Invocation.InferType): We can only infer method
5127         type parameters.  Fixes #62647.
5128
5129 2004-08-11  Martin Baulig  <martin@ximian.com>
5130
5131         * class.cs (TypeContainer.DefineType): Create the TypeBuilder
5132         before resolving the base classes.
5133
5134 2004-08-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
5135
5136         * Makefile: install .mdb file too.
5137
5138 2004-08-05  Martin Baulig  <martin@ximian.com>
5139
5140         * ecore.cs (FieldExpr.DoResolveLValue): If we're resolving a field
5141         initializer, the current type is just the TypeBuilder, not the
5142         instantiated generic type.
5143         (FieldExpr.IsFieldInitializer): New public property.
5144
5145 2004-08-04  Martin Baulig  <martin@ximian.com>
5146
5147         * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
5148
5149         * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
5150
5151 2004-08-03  Martin Baulig  <martin@ximian.com>
5152
5153         * class.cs (MethodData.Define): If we're an explicit
5154         implementation, remove the generic arity from the type name.
5155
5156 2004-08-03  Martin Baulig  <martin@ximian.com>
5157
5158         * expression.cs (Binary.ResolveOperator): Don't abort if we can't
5159         use a user-defined operator; we still need to do numeric
5160         promotions in case one argument is a builtin type and the other
5161         one has an implicit conversion to that type.  Fixes #62322.
5162
5163 2004-08-02  Martin Baulig  <martin@ximian.com>
5164
5165         * class.cs (TypeContainer.ifaces): Make this a `Type[]', not a
5166         `TypeExpr[]' array.
5167         (TypeContainer.GetClassBases): Return the unexpanded list of
5168         interfaces; we expand them later.
5169         (TypeContainer.DefineType): After creating the TypeBuilder, call
5170         TypeManager.ExpandInterfaces() to get an expanded and resolved
5171         list of interfaces.
5172
5173         * ecore.cs (TypeExpr.GetInterfaces): Removed
5174
5175         * generics.cs (Constraints.InterfaceConstraints): Remove.
5176         (TypeParameter.DefineType): Call TypeManager.RegisterBuilder() to
5177         register the interface constraints.
5178
5179         * typemanager.cs
5180         (TypeManager.AddUserType): Removed the `ifaces' argument.
5181         (TypeManager.AddTypeParameter): Likewise.
5182         (TypeManager.AddUserInterface): Removed, was unused.
5183         (TypeManager.RegisterBuilder): Take a `Type[]' instead of a
5184         `TypeExpr[]' array for the interfaces.
5185         (TypeManager.ExpandInterfaces): Call this after the TypeBuilder
5186         has been defined, returns a list of the resolved interfaces types.
5187         (TypeManager.GetInterfaces): Return a `Type[]', not a `TypeExpr[]'.
5188         (TypeManager.GetExplicitInterfaces): Likewise.  
5189
5190 2004-08-02  Martin Baulig  <martin@ximian.com>
5191
5192         * expression.cs (Invocation.EmitCall): If we're invoking a method
5193         on a type parameter, use the new `Constrained' prefix opcode.
5194
5195 2004-08-02  Martin Baulig  <martin@ximian.com>
5196
5197         * statement.cs (LocalInfo.Flags): Added `IsThis'.
5198         (LocalInfo.IsThis): New public property.
5199         (Block.EmitMeta): Don't create a LocalBuilder for `this'.
5200
5201 2004-08-01  Martin Baulig  <martin@ximian.com>
5202
5203         * class.cs (TypeContainer.GetClassBases): Don't set the default
5204         here since we may get called from GetPartialBases().
5205         (TypeContainer.DefineType): If GetClassBases() didn't return a
5206         parent, use the default one.
5207
5208 2004-07-30  Martin Baulig  <martin@ximian.com>
5209
5210         * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
5211
5212         * class.cs (SourceMethod): New public class, derive from the
5213         symbol writer's ISourceMethod.
5214         (Method): Use the new symbol writer API.
5215
5216         * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
5217         as argument and use the new symbol writer.
5218
5219         * location.cs
5220         (SourceFile): Implement the symbol writer's ISourceFile.
5221         (Location.SymbolDocument): Removed.
5222         (Location.SourceFile): New public property.
5223
5224         * symbolwriter.cs: Use the new symbol writer API.
5225
5226 2004-07-30  Raja R Harinath  <rharinath@novell.com>
5227
5228         * Makefile (install-local): Remove.  Functionality moved to
5229         executable.make.
5230
5231 2004-07-28  Lluis Sanchez Gual  <lluis@novell.com>
5232
5233         * Makefile: Install mcs.exe.config file together with mcs.exe.
5234         * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
5235         correct runtime version.
5236         
5237 2004-07-25  Martin Baulig  <martin@ximian.com>
5238
5239         * class.cs
5240         (TypeContainer.RegisterOrder): Removed, this was unused.
5241         (TypeContainer, interface_order): Removed.
5242         (TypeContainer.AddClass, AddStruct, AddInterface): Take a
5243         TypeContainer as argument since we can also be called with a
5244         `PartialContainer' for a partial class/struct/interface.
5245         (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
5246         of checking whether we're an `Interface' - we could be a
5247         `PartialContainer'.
5248         (PartialContainer.Register): Override; call
5249         AddClass()/AddStruct()/AddInterface() on our parent.
5250
5251         * cs-parser.jay (interface_member_declaration): Add things to the
5252         `current_container', not the `current_class'.
5253
5254         * rootcontext.cs (RegisterOrder): The overloaded version which
5255         takes an `Interface' was unused, removed.
5256
5257         * typemanager.cs (TypeManager.LookupInterface): Return a
5258         `TypeContainer', not an `Interface'.
5259         (TypeManager.IsInterfaceType): The `builder_to_declspace' may
5260         contain a `PartialContainer' for an interface, so check it's
5261         `Kind' to figure out what it is.
5262
5263 2004-07-25  Martin Baulig  <martin@ximian.com>
5264
5265         * class.cs (Class.DefaultTypeAttributes): New public constant.
5266         (Struct.DefaultTypeAttributes): Likewise.
5267         (Interface.DefaultTypeAttributes): Likewise.
5268         (PartialContainer.TypeAttr): Override this and add the
5269         DefaultTypeAttributes.
5270
5271 2004-07-25  Martin Baulig  <martin@ximian.com>
5272
5273         * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
5274         we can just use the `Parent' field instead.
5275
5276 2004-07-25  Martin Baulig  <martin@ximian.com>
5277
5278         * class.cs (TypeContainer.Emit): Renamed to EmitType().
5279
5280 2004-07-25  Martin Baulig  <martin@ximian.com>
5281
5282         * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
5283         our parts before defining any methods.
5284         (TypeContainer.VerifyImplements): Make this virtual.
5285         (ClassPart.VerifyImplements): Override and call VerifyImplements()
5286         on our PartialContainer.
5287
5288 2004-07-25  Martin Baulig  <martin@ximian.com>
5289
5290         * iterators.cs (Iterator.Define): Renamed to DefineIterator().
5291
5292         * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
5293         argument, we can just use the `Parent' field instead.
5294
5295         * class.cs
5296         (MemberBase.CheckBase): Removed the `TypeContainer' argument.   
5297         (MemberBase.DoDefine): Likewise.
5298
5299 2004-07-24  Martin Baulig  <martin@ximian.com>
5300
5301         * decl.cs (MemberCore.Parent): New public field.
5302         (DeclSpace.Parent): Moved to MemberCore.
5303
5304         * class.cs (MethodCore.ds): Removed; use `Parent' instead.
5305         (MemberBase.ctor): Added TypeContainer argument, pass it to our
5306         parent's .ctor.
5307         (FieldBase, Field, Operator): Likewise.
5308         (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
5309         (EventField, Event): Likewise.
5310
5311 2004-07-23  Martin Baulig  <martin@ximian.com>
5312
5313         * class.cs (PartialContainer): New public class.
5314         (ClassPart): New public class.
5315         (TypeContainer): Added support for partial classes.
5316         (TypeContainer.GetClassBases): Splitted some of the functionality
5317         out into GetNormalBases() and GetPartialBases().
5318
5319         * cs-tokenizer.cs (Token.PARTIAL): New token.
5320         (Tokenizer.consume_identifier): Added some hacks to recognize
5321         `partial', but only if it's immediately followed by `class',
5322         `struct' or `interface'.
5323
5324         * cs-parser.jay: Added support for partial clases.
5325
5326 2004-07-23  Martin Baulig  <martin@ximian.com>
5327
5328         * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
5329         a `DeclSpace' and also made it readonly.
5330         (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
5331         (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
5332         (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
5333
5334         * cs-parser.jay: Pass the `current_class', not the
5335         `current_container' (at the moment, this is still the same thing)
5336         to a new Method, Property, Event, Indexer or Constructor.
5337
5338 2004-07-23  Martin Baulig  <martin@ximian.com>
5339
5340         * cs-parser.jay (CSharpParser): Added a new `current_class' field
5341         and removed the `current_interface' one.
5342         (struct_declaration, class_declaration, interface_declaration):
5343         Set `current_class' to the newly created class/struct/interface;
5344         set their `Bases' and call Register() before parsing their body.
5345
5346 2004-07-23  Martin Baulig  <martin@ximian.com>
5347
5348         * class.cs (Kind): New public enum.
5349         (TypeContainer): Made this class abstract.
5350         (TypeContainer.Kind): New public readonly field.
5351         (TypeContainer.CheckDef): New public method; moved here from
5352         cs-parser.jay.
5353         (TypeContainer.Register): New public abstract method.
5354         (TypeContainer.GetPendingImplementations): New public abstract
5355         method.
5356         (TypeContainer.GetClassBases): Removed the `is_class' and
5357         `is_iface' parameters.
5358         (TypeContainer.DefineNestedTypes): Formerly known as
5359         DoDefineType().
5360         (ClassOrStruct): Made this class abstract.
5361
5362         * tree.cs (RootTypes): New public type. 
5363
5364 2004-07-20  Martin Baulig  <martin@ximian.com>
5365
5366         * tree.cs (Tree.RecordNamespace): Removed.
5367         (Tree.Namespaces): Removed.
5368
5369         * rootcontext.cs (RootContext.IsNamespace): Removed.
5370
5371         * cs-parser.jay (namespace_declaration): Just create a new
5372         NamespaceEntry here.
5373
5374 2004-07-21  Lluis Sanchez Gual  <lluis@novell.com>
5375
5376         * Makefile: Install gmcs.exe.config file together with gmcs.exe.
5377         * gmcs.exe.config: Renamed from mcs.exe.config. Added supportedRuntime
5378         entry to make sure it runs in the correct runtime version.
5379         
5380 2004-07-18  Martin Baulig  <martin@ximian.com>
5381
5382         * generic.cs (ConstructedType.CheckConstraints): Improved
5383         constraints checking.
5384
5385 2004-07-18  Martin Baulig  <martin@ximian.com>
5386
5387         * expression.cs (Invocation.BetterMethod): Call
5388         TypeManager.TypeToCoreType() on all types and removed my previous
5389         hack; we're already doig the right thing here.
5390
5391 2004-07-17  Martin Baulig  <martin@ximian.com>
5392
5393         * decl.cs (MemberName.MakeName): Create the "class`1" names here.
5394
5395 2004-07-16  Martin Baulig  <martin@ximian.com>
5396
5397         * iterators.cs: Added generics support.
5398
5399 2004-07-16  Martin Baulig  <martin@ximian.com>
5400
5401         * iterators.cs: Rewrote this.  We're now using one single Proxy
5402         class for both the IEnumerable and the IEnumerator interface and
5403         `Iterator' derives from Class so we can use the high-level API.
5404
5405         * class.cs (TypeContainer.AddIterator): New method.
5406         (TypeContainer.DoDefineType): New protected virtual method, which
5407         is called from DefineType().
5408         (TypeContainer.DoDefineMembers): Call DefineType() and
5409         DefineMembers() on all our iterators.
5410         (TypeContainer.Emit): Call Emit() on all our iterators.
5411         (TypeContainer.CloseType): Call CloseType() on all our iterators.
5412
5413         * codegen.cs (EmitContext.CurrentIterator): New public field.
5414
5415 2004-07-15  Martin Baulig  <martin@ximian.com>
5416
5417         * typemanager.cs
5418         (TypeManager.not_supported_exception_type): New type.   
5419
5420 2004-07-14  Martin Baulig  <martin@ximian.com>
5421
5422         * typemanager.cs
5423         (TypeManager.generic_ienumerable_type): New type.
5424         (TypeManager.generic_ienumerator_type): New type.
5425
5426         * rootcontext.cs
5427         (RootContext.interfaces_first_stage): Added
5428         "System.Collections.Generic.IEnumerator`1" and
5429         "System.Collections.Generic.IEnumerable`1".     
5430
5431 2004-07-14  Martin Baulig  <martin@ximian.com>
5432
5433         * iterators.cs: Use real error numbers.
5434
5435 2004-07-14  Martin Baulig  <martin@ximian.com>
5436
5437         * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
5438         requires this to be a System.Collection.IEnumerable and not a
5439         class implementing that interface.
5440         (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.      
5441
5442 2004-07-13  Marek Safar  <marek.safar@seznam.cz>
5443
5444         * class.cs: Fixed previous fix, it broke some error tests.
5445
5446 2004-07-12  Martin Baulig  <martin@ximian.com>
5447
5448         * enum.cs (Enum.Define): Call Emit() to emit the attributes.
5449         Fixes #61293.
5450
5451 2004-07-14  Martin Baulig  <martin@ximian.com>
5452
5453         * decl.cs, expression.cs, generic.cs: Use a backqoute (`) and not
5454         an exclamation mark (!) for the generic arity to reflect the
5455         latest spec changes; ie. use "System.Collections.Generic.IList`1".
5456
5457 2004-07-13  Martin Baulig  <martin@ximian.com>
5458
5459         * cs-tokenizer.cs (Tokenizer.parse_less_than): Allow array rank
5460         specifiers being part of a type argument.
5461
5462 2004-07-13  Martin Baulig  <martin@ximian.com>
5463
5464         * expression.cs (MemberAccess.ResolveAsTypeStep): Use the full `!'
5465         name for generic types.
5466
5467 2004-07-13  Martin Baulig  <martin@ximian.com>
5468
5469         * assign.cs (Assign.DoResolve): Moved the CS0131 check up a little
5470         bit to fix #60119.
5471
5472 2004-07-09  Miguel de Icaza  <miguel@ximian.com>
5473
5474         * assign.cs (LocalTemporary): Add new argument: is_address,If
5475         `is_address' is true, then the value that we store is the address
5476         to the real value, and not the value itself.
5477         
5478         * ecore.cs (PropertyExpr): use the new local temporary
5479         stuff to allow us to handle X.Y += z (where X is a struct)
5480
5481 2004-07-08  Martin Baulig  <martin@ximian.com>
5482
5483         * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
5484         not always return, just like we're doing in Using.Resolve().
5485
5486 2004-07-07  Miguel de Icaza  <miguel@ximian.com>
5487
5488         * cs-parser.jay (fixed_statement): flag this as Pinned.
5489
5490 2004-07-06  Miguel de Icaza  <miguel@ximian.com>
5491
5492         * typemanager.cs (TypeManager): Removed MakePinned method, this
5493         mechanism is replaced with the .NET 2.x compatible mechanism of
5494         calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
5495
5496         * statement.cs (LocalInfo): Remove MakePinned, add Pinned property 
5497         Rename `Fixed' to `Pinned' as a flag, to distinguish from the
5498         `IsFixed' property which has a different meaning.
5499
5500 2004-07-02  Raja R Harinath  <rharinath@novell.com>
5501
5502         * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
5503         visible from inside a nested class, not just the names of the
5504         immediately enclosing class.
5505         Fix for bug #60730.
5506
5507 2004-06-24  Raja R Harinath  <rharinath@novell.com>
5508
5509         * expression.cs (BetterConversion): Remove buggy special-case
5510         handling of "implicit constant expression conversions".  At this
5511         point, we already know that the conversion is possible -- we're
5512         only checking to see which is better.
5513
5514 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
5515
5516         * cs-parser.jay: Added error CS0210 test.
5517
5518 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
5519
5520         * cs-parser.jay: Added error CS0134 test.
5521
5522 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
5523
5524         Fix bug #52507
5525         * cs-parser.jay: Added error CS0145 test.
5526
5527 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
5528
5529         * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
5530
5531 2004-06-23  Ben Maurer  <bmaurer@ximian.com>
5532         
5533         * expression.cs (StackAlloc.Resolve): The argument may not
5534         be a constant; deal with this case.
5535         
5536 2004-06-23  Marek Safar  <marek.safar@seznam.cz>
5537
5538         * attribute.cs (IndexerName_GetIndexerName): Renamed to
5539         GetIndexerAttributeValue.
5540         (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
5541
5542         * class.cs (Indexer.Define): Added error tests for CS0415,
5543         CS0609.
5544
5545 2004-06-23  Miguel de Icaza  <miguel@ximian.com>
5546
5547         * attribute.cs (Attribute.Resolve): Keep field code in sync with
5548         property code.
5549
5550 2004-06-23  Martin Baulig  <martin@ximian.com>
5551
5552         * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
5553         neither return nor throw, reset the barrier as well.  Fixes #60457.
5554
5555 2004-06-22  Atsushi Enomoto  <atsushi@ximian.com>
5556
5557         * class.cs : EventAttributes is now set to None by default.
5558           This fixes bug #60459.
5559
5560 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
5561
5562         Fix bug #60219
5563         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
5564         Don't throw exception but return null (it's sufficient now).
5565
5566 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
5567
5568         * typemanager.cs (GetArgumentTypes): Faster implementation.
5569
5570 2004-06-18  Martin Baulig  <martin@ximian.com>
5571
5572         * attribute.cs (Attribute.Resolve): Check whether we're an
5573         EmptyCast which a Constant child.  Fixes #60333.
5574
5575 2004-06-17  Ben Maurer  <bmaurer@ximian.com>
5576
5577         * statement.cs (EmitCollectionForeach): Account for the fact that
5578         not all valuetypes are in areas which we can take the address of.
5579         For these variables, we store to a temporary variable. Also, make
5580         sure that we dont emit a `callvirt' on a valuetype method.
5581
5582 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
5583
5584         * expression.cs (StackAlloc.DoReSolve): Added test for
5585         negative parameter (CS0247).
5586
5587 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
5588
5589         Fix bug #59792
5590         * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
5591
5592 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
5593
5594         Fix bug #59781
5595         * expression.cs: (Binary.DoNumericPromotions): Added conversion for
5596         ulong.
5597
5598 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
5599
5600         Fix bug #58254 & cs1555.cs, cs1556.cs
5601         * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
5602
5603 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
5604
5605         * cs-parser.jay: Added error CS1669 test for indexers.
5606
5607 2004-06-18  Martin Baulig  <martin@ximian.com>
5608
5609         * generics.cs (GenericMethod.ctor): Don't take an Attributes
5610         argument.  Fixes #60441.
5611
5612 2004-06-16  Ben Maurer  <bmaurer@ximian.com>
5613         * ecore.cs (MethodGroupExpr.Name): Revert Martin's patch.
5614         The name needs to have the actual name of the method in order
5615         for other tests (such as the one in OverloadResolve for Invoke
5616         on a delegate) to work. As well, it does not really help
5617         error reporting because the method group had multiple methods.
5618         * Makefile: Remove MCS_DEBUG, you can enable with the DEBUG_FLAGS.
5619         Make profiling work.
5620         
5621 2004-06-13  Martin Baulig  <martin@ximian.com>
5622
5623         * cs-parser.jay: Don't allow generic attributes.
5624
5625 2004-06-13  Martin Baulig  <martin@ximian.com>
5626
5627         * class.cs (MemberBase.DoDefineBase): New protected method.
5628         (MemberBase.DoDefine): Compute the `flags' in the new
5629         DoDefineBase() which must be called first.
5630         (Method.Define): Call DoDefineBase() first so we have the flags
5631         when defining the generic method.
5632
5633         * cs-parser.jay (interface_method_declaration): Support generic methods.
5634
5635 2004-06-13  Martin Baulig  <martin@ximian.com>
5636
5637         * decl.cs (TypeName): Removed.
5638         (MemberName): Removed TypeName and MemberNow; now we just have
5639         MemberName.
5640
5641         * cs-parser.jay: Don't distinguish between type arguments and type
5642         parameters in the grammar and simplified the rules a bit.  The
5643         reduce/reduce conflicts are now gone (except the one we inherited
5644         from mcs).
5645
5646 2004-06-11  Martin Baulig  <martin@ximian.com>
5647
5648         * expression.cs (Invocation.IsParamsMethodApplicable): We need to
5649         call this twice: for params and varargs methods.
5650
5651 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
5652
5653         * class.cs:
5654         (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
5655
5656 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
5657
5658         * attribute.cs (Attribute.GetValidTargets): Made public.
5659
5660         * class.cs: 
5661         (AbstractPropertyEventMethod): New class for better code sharing.
5662         (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
5663         CS1667 report.
5664         (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
5665
5666 2004-06-09  Martin Baulig  <martin@ximian.com>
5667
5668         * cs-parser.jay: Removed a reduce/reduce conflict.
5669
5670 2004-06-03  Martin Baulig  <martin@ximian.com>
5671
5672         * generic.cs (ConstructedType.GetMemberAccess): Renamed to
5673         GetSimpleName() and return a SimpleName.
5674
5675         * ecore.cs (SimpleName.Arguments): New public field.
5676         (SimpleName): Added overloaded ctor which takes an additional
5677         TypeArguments argument.
5678         (SimpleName.SimpleNameResolve): Added support for generic methods.
5679         (MethodGroupExpr.ResolveGeneric): New public method.  The code was
5680         formerly in MemberAccess.DoResolve(), but we also need it in
5681         SimpleNameResolve().
5682
5683         * expression.cs (MemberAccess.DoResolve): Use the new
5684         MethodGroupExpr.ResolveGeneric().       
5685
5686 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
5687
5688         * decl.cs: If possible, use lookuptypedirect here. We can only do
5689         this if there is no `.' after the namespace. Avoids using
5690         LookupType, which does lots of slow processing.
5691         (FindNestedType) New method, does what it says :-).
5692         * namespace.cs: use LookupTypeDirect.
5693         * rootcontext.cs: use membercache, if possible.
5694         * typemanager.cs (LookupTypeDirect): Cache negative hits too.
5695
5696 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
5697
5698         * expression.cs:
5699         According to the spec, 
5700
5701         In a member access of the form E.I, if E is a single identifier,
5702         and if the meaning of E as a simple-name (§7.5.2) is a constant,
5703         field, property, localvariable, or parameter with the same type as
5704         the meaning of E as a type-name (§3.8), then both possible
5705         meanings of E are permitted.
5706
5707         We did not check that E as a simple-name had the same type as E as
5708         a type name.
5709
5710         This trivial check gives us 5-7% on bootstrap time.
5711
5712 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
5713
5714         * expression.cs (Invocation.OverloadResolve): Avoid the
5715         use of hashtables and boxing here by allocating on demand.
5716
5717 2004-05-30  Martin Baulig  <martin@ximian.com>
5718
5719         * rootcontext.cs (RootContext.LookupType): Don't cache things if
5720         we're doing a silent lookup.  Don't try to lookup nested types in
5721         TypeManager.object_type (thanks to Ben Maurer).
5722
5723 2004-05-30  Martin Baulig  <martin@ximian.com>
5724
5725         Committing a patch from Ben Maurer.
5726
5727         * rootcontext.cs (RootContext.LookupType): Cache negative results.
5728
5729 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
5730
5731         * convert.cs: add a trivial cache for overload operator resolution.
5732
5733 2004-05-31  Marek Safar  <marek.safar@seznam.cz>
5734
5735         * attribute.cs
5736         (AttributeTester.GetObsoleteAttribute): Returns instance of
5737         ObsoleteAttribute when type is obsolete.
5738
5739         * class.cs
5740         (TypeContainer.VerifyObsoleteAttribute): Override.
5741         (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
5742         (MethodCode.VerifyObsoleteAttribute): Override.
5743         (MemberBase.VerifyObsoleteAttribute): Override.
5744
5745         * decl.cs
5746         (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
5747         and report proper error.
5748
5749         *delegate.cs
5750         (Delegate.VerifyObsoleteAttribute): Override.
5751
5752         * ecore.cs
5753         (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
5754         and report proper error.
5755         (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
5756
5757         * enum.cs
5758         (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
5759         and enum member.
5760
5761         * expression.cs
5762         (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
5763         New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
5764         Added test for ObsoleteAttribute.
5765
5766         * statement.cs
5767         (Catch): Derived from Statement.
5768
5769 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
5770
5771         * decl.cs: If possible, use lookuptypedirect here. We can only do
5772         this if there is no `.' after the namespace. Avoids using
5773         LookupType, which does lots of slow processing.
5774         (FindNestedType) New method, does what it says :-).
5775         * namespace.cs: use LookupTypeDirect.
5776         * rootcontext.cs: use membercache, if possible.
5777         * typemanager.cs (LookupTypeDirect): Cache negative hits too.
5778
5779 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
5780
5781         * expression.cs:
5782         According to the spec, 
5783
5784         In a member access of the form E.I, if E is a single identifier,
5785         and if the meaning of E as a simple-name (§7.5.2) is a constant,
5786         field, property, localvariable, or parameter with the same type as
5787         the meaning of E as a type-name (§3.8), then both possible
5788         meanings of E are permitted.
5789
5790         We did not check that E as a simple-name had the same type as E as
5791         a type name.
5792
5793         This trivial check gives us 5-7% on bootstrap time.
5794
5795 2004-05-30  Marek Safar  <marek.safar@seznam.cz>
5796
5797         Fixed bug #59071 & cs0160.cs
5798         * statement.cs (Try.Resolve): Check here whether order of catch
5799         clauses matches their dependencies.
5800
5801 2004-05-30  Marek Safar  <marek.safar@seznam.cz>
5802
5803         Fixed bug #58624
5804         * ecore.cs (SimpleName.SimpleNameResolve): Added test for
5805         unsafe type.
5806
5807 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
5808
5809         * expression.cs (Invocation.OverloadResolve): Avoid the
5810         use of hashtables and boxing here by allocating on demand.
5811
5812 2004-05-30  Martin Baulig  <martin@ximian.com>
5813
5814         * rootcontext.cs (RootContext.LookupType): Don't cache things if
5815         we're doing a silent lookup.  Don't try to lookup nested types in
5816         TypeManager.object_type (thanks to Ben Maurer).
5817
5818 2004-05-30  Martin Baulig  <martin@ximian.com>
5819
5820         Committing a patch from Ben Maurer.
5821
5822         * rootcontext.cs (RootContext.LookupType): Cache negative results.      
5823
5824 2004-05-29  Martin Baulig  <martin@ximian.com>
5825
5826         * class.cs (IMethodData.ShouldIgnore): New method.
5827
5828         * typemanager.cs (TypeManager.MethodFlags): Don't take a
5829         `Location' argument, we don't need it anywhere.  Use
5830         `IMethodData.ShouldIgnore ()' instead of
5831         `MethodData.GetMethodFlags ()'.
5832         (TypeManager.AddMethod): Removed.
5833         (TypeManager.AddMethod2): Renamed to AddMethod.
5834
5835 2004-05-29  Martin Baulig  <martin@ximian.com>
5836
5837         Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
5838
5839         * convert.cs (Convert.ImplicitReferenceConversion): If we're
5840         converting from a class type S to an interface type and we already
5841         have an object on the stack, don't box it again.  Fixes #52578.
5842
5843 2004-05-29  Martin Baulig  <martin@ximian.com>
5844
5845         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
5846         Added support for `params' parameters.  Fixes #59267.
5847
5848 2004-05-29  Martin Baulig  <martin@ximian.com>
5849
5850         * literal.cs (NullPointer): Provide a private .ctor which sets
5851         `type' to TypeManager.object_type.  Fixes #59048.
5852
5853 2004-05-29  Martin Baulig  <martin@ximian.com>
5854
5855         * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
5856         EventExpr, set `ee.InstanceExpression = left'.  Fixes #59188.
5857
5858         * ecore.cs (EventExpr.instance_expr): Make the field private.
5859
5860 2004-05-26  Marek Safar  <marek.safar@seznam.cz>
5861
5862         Fixed bug #50080 & cs0214-2.cs
5863         * expression.cs (Cast.DoResolve): Check unsafe context here.
5864         
5865         * statement.cs (Resolve.DoResolve): Likewise.
5866
5867 2004-05-26  Martin Baulig  <martin@ximian.com>
5868
5869         * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
5870
5871         * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
5872         (RootContext.LookupType): Pass down the `silent' flag.
5873
5874 2004-05-25  Martin Baulig  <martin@ximian.com>
5875
5876         * expression.cs
5877         (MethodGroupExpr.IdenticalTypeName): New public property.
5878         (Invocation.DoResolve): Don't report a CS0176 if the "instance"
5879         expression actually refers to a type.
5880
5881 2004-05-25  Martin Baulig  <martin@ximian.com>
5882
5883         * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
5884         for #56176 and made it actually work.
5885
5886 2004-05-25  Martin Baulig  <martin@ximian.com>
5887
5888         * ecore.cs (Expression.CacheTemporaries): Make this virtual.
5889         (FieldExpr, PropertyExpr): Override and implement
5890         CacheTemporaries.  Fixes #52279.
5891
5892 2004-05-25  Miguel de Icaza  <miguel@ximian.com>
5893
5894         * location.cs: In the new compiler listing a file twice is a
5895         warning, not an error.
5896
5897 2004-05-24  Martin Baulig  <martin@ximian.com>
5898
5899         * enum.cs (Enum.DefineType): For the `BaseType' to be a
5900         TypeLookupExpression; otherwise, report a CS1008.  Fixes #58571.
5901
5902 2004-05-24  Martin Baulig  <martin@ximian.com>
5903
5904         * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
5905         walking the `using' list.  Fixes #53921.
5906
5907 2004-05-24  Martin Baulig  <martin@ximian.com>
5908
5909         * const.cs (Const.LookupConstantValue): Added support for
5910         EmptyCast's; fixes #55251.
5911
5912 2004-05-24  Martin Baulig  <martin@ximian.com>
5913
5914         * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
5915         DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
5916         which does the CS0135 check.  The reason is that we first need to
5917         check whether the variable actually exists.
5918
5919 2004-05-24  Martin Baulig  <martin@ximian.com>
5920
5921         * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
5922         than RootContext.LookupType() to find the explicit interface
5923         type.  Fixes #58584.
5924
5925 2004-05-24  Raja R Harinath  <rharinath@novell.com>
5926
5927         * Makefile: Simplify.  Use executable.make.
5928         * mcs.exe.sources: New file.  List of sources of mcs.exe.
5929
5930 2004-05-24  Anders Carlsson  <andersca@gnome.org>
5931
5932         * decl.cs:
5933         * enum.cs:
5934         Use the invariant culture when doing String.Compare for CLS case
5935         sensitivity.
5936         
5937 2004-05-23  Martin Baulig  <martin@ximian.com>
5938
5939         * decl.cs (DeclSpace.FindType): Only check the `using' list if we
5940         don't have any dots.  Fixes #52622, added cs0246-8.cs.
5941
5942         * namespace.cs (NamespaceEntry.Lookup): Likewise.
5943
5944 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
5945
5946         * class.cs (MemberBase.Define): Reuse MemberType member for 
5947         resolved type. Other methods can use it too.
5948
5949 2004-05-23  Martin Baulig  <martin@ximian.com>
5950
5951         * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
5952         the variable also exists in the current block (otherwise, we need
5953         to report a CS0103).  Fixes #58670.
5954
5955 2004-05-23  Martin Baulig  <martin@ximian.com>
5956
5957         * flowanalysis.cs (Reachability.Reachable): Compute this
5958         on-the-fly rather than storing it as a field.
5959
5960 2004-05-23  Martin Baulig  <martin@ximian.com>
5961
5962         * flowanalysis.cs (Reachability.And): Manually compute the
5963         resulting `barrier' from the reachability.      
5964        
5965 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
5966
5967         Fix bug #57835
5968         * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
5969         instance of ObsoleteAttribute when symbol is obsolete.
5970
5971         * class.cs
5972         (IMethodData): Extended interface for ObsoleteAttribute support.
5973
5974 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
5975
5976         * attribute.cs: Fix bug #55970
5977
5978 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
5979
5980         Fix bug #52705
5981         * attribute.cs
5982         (GetObsoleteAttribute): New method. Creates the instance of
5983         ObsoleteAttribute.
5984         (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
5985         ObsoleteAttribute when member is obsolete.
5986         (AttributeTester.Report_ObsoleteMessage): Common method for
5987         Obsolete error/warning reporting.
5988
5989         * class.cs
5990         (TypeContainer.base_classs_type): New member for storing parent type.
5991
5992         * decl.cs
5993         (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
5994         for this MemberCore.
5995
5996 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
5997
5998         * attribute.cs, const.cs: Fix bug #58590
5999
6000 2004-05-21  Martin Baulig  <martin@ximian.com>
6001
6002         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
6003         out parameters if the end of the method is unreachable.  Fixes
6004         #58098. 
6005
6006 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
6007
6008         * codegen.cs, cs-parser.jay: Removed SetAttributes method.
6009         Hari was right, why extra method.
6010
6011 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
6012
6013         * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
6014
6015 2004-05-20  Martin Baulig  <martin@ximian.com>
6016
6017         * delegate.cs: Convert this file to Unix mode - like the original
6018         version in mcs is.
6019
6020 2004-05-20  Martin Baulig  <martin@ximian.com>
6021
6022         * attribute.cs: Convert this file to Unix mode - like the original
6023         version in mcs is.
6024
6025 2004-05-19  Marek Safar  <marek.safar@seznam.cz>
6026
6027        Fix bug #58688 (MCS does not report error when the same attribute
6028        is assigned twice)
6029
6030        * attribute.cs (Attribute.Emit): Distinction between null and default.
6031
6032 2004-05-19  Raja R Harinath  <rharinath@novell.com>
6033
6034        * cs-parser.jay (attribute): Create a GlobalAttribute for the case
6035        of a top-level attribute without an attribute target.
6036        * attribute.cs (Attribute.Error_AttributeConstructorMismatch): 
6037        Make non-static.
6038        (Attribute.Conditional_GetConditionName), 
6039        (Attribute.Obsolete_GetObsoleteMessage): Update.
6040        (Attribute.IndexerName_GetIndexerName): New.  Attribute-specific
6041        part of ScanForIndexerName.
6042        (Attribute.CanIgnoreInvalidAttribute): New function.
6043        (Attribute.ScanForIndexerName): Move to ...
6044        (Attributes.ScanForIndexerName): ... here.
6045        (Attributes.Attrs): Rename from now-misnamed AttributeSections.
6046        (Attributes.Search): New internal variant that can choose not to
6047        complain if types aren't resolved.  The original signature now
6048        complains.
6049        (Attributes.GetClsCompliantAttribute): Use internal variant, with
6050        complaints suppressed.
6051        (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
6052        only if it not useful.
6053        (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
6054        top-level for attributes that are shared between the assembly
6055        and a top-level class.
6056        * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
6057        * class.cs: Update to reflect changes.
6058        (DefineIndexers): Fuse loops.
6059        * codegen.cs (GetAssemblyName): Update to reflect changes.  Accept
6060        a couple more variants of attribute names.
6061
6062 2004-05-18  Marek Safar  <marek.safar@seznam.cz>
6063
6064         Fix bug #52585 (Implemented explicit attribute declaration)
6065
6066         * attribute.cs:
6067         (Attributable.ValidAttributeTargets): New abstract method. It gets
6068         list of valid attribute targets for explicit target declaration.
6069         (Attribute.Target): It holds target itself.
6070         (AttributeSection): Removed.
6071         (Attribute.CheckTargets): New method. It checks whether attribute
6072         target is valid for the current element.
6073
6074         * class.cs:
6075         (EventProperty): New class. For events that are declared like
6076         property (with add and remove accessors).
6077         (EventField): New class. For events that are declared like field.
6078         class.cs
6079
6080         * cs-parser.jay: Implemented explicit attribute target declaration.
6081
6082         * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:        
6083         Override ValidAttributeTargets.
6084
6085         * parameter.cs:
6086         (ReturnParameter): Class for applying custom attributes on 
6087         the return type.
6088         (ParameterAtribute): New class. Class for applying custom
6089         attributes on the parameter type.
6090
6091 2004-05-17  Miguel de Icaza  <miguel@ximian.com>
6092
6093         * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
6094         definitions. 
6095
6096         (Method): Allow UNSAFE here.
6097
6098         * modifiers.cs: Support unsafe reporting.
6099
6100 2004-05-17  Marek Safar  <marek.safar@seznam.cz>
6101
6102         * decl.cs: Fix bug #58478.
6103
6104 2004-05-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
6105
6106         * statement.cs: When checking for unreachable code on an EmptyStatement,
6107         set the location. Fixes bug #58488.
6108
6109 2004-05-13  Miguel de Icaza  <miguel@ximian.com>
6110
6111         * driver.cs: Add -pkg handling.
6112
6113         From Gonzalo: UseShelLExecute=false
6114
6115 2004-05-12  Marek Safar  <marek.safar@seznam.cz>
6116
6117         * attribute.cs:
6118         (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
6119         for attribute.
6120         (Attribute.IsClsCompliaceRequired): Moved to base for better
6121         accesibility.
6122         (Attribute.UsageAttribute): New property for AttributeUsageAttribute
6123         when attribute is AttributeUsageAttribute.
6124         (Attribute.GetValidTargets): Simplified.
6125         (Attribute.GetAttributeUsage): New method returns AttributeUsage
6126         attribute for this type.
6127         (Attribute.ApplyAttributes): Method renamed to Emit and make
6128         non-static.
6129         (GlobalAttributeSection): New class for special handling of global
6130         attributes (assembly, module).
6131         (AttributeSection.Emit): New method.
6132
6133         * class.cs: Implemented Attributable abstract methods.
6134         (MethodCore.LabelParameters): Moved to Parameter class.
6135         (Accessor): Is back simple class.
6136         (PropertyMethod): Implemented Attributable abstract class.
6137         (DelegateMethod): Implemented Attributable abstract class.
6138         (Event): New constructor for disctintion between normal Event
6139         and Event with accessors.
6140
6141         * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
6142
6143         * codegen.cs, const.cs, decl.cs, delegate.cs:
6144         (CommonAssemblyModulClass): Implemented Attributable abstract class
6145         and simplified.
6146
6147         * enum.cs: Implement IAttributeSupport interface.
6148         (EnumMember): New class for emum members. Implemented Attributable
6149         abstract class
6150
6151         * parameter.cs:
6152         (ParameterBase): Is abstract.
6153         (ReturnParameter): New class for easier [return:] attribute handling.
6154
6155         * typemanager.cs: Removed builder_to_attr.
6156
6157 2004-05-11  Raja R Harinath  <rharinath@novell.com>
6158
6159         Fix bug #57151.
6160         * attribute.cs (Attribute.GetPositionalValue): New function.
6161         * class.cs (TypeContainer.VerifyMembers): New function.
6162         (TypeContainer.Emit): Use it.
6163         (ClassOrStruct): New base class for Class and Struct.
6164         (ClassOrStruct.ApplyAttributeBuilder): New function.  Note if 
6165         StructLayout(LayoutKind.Explicit) was ascribed to the struct or
6166         class.
6167         (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
6168         then each non-static field should have a FieldOffset attribute.
6169         Otherwise, none of the fields should have a FieldOffset attribute.
6170         * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout 
6171         and FieldOffset attributes.
6172         * typemanager.cs (TypeManager.struct_layout_attribute_type)
6173         (TypeManager.field_offset_attribute_type): New core types.
6174         (TypeManager.InitCoreTypes): Initialize them.
6175
6176 2004-05-11  Michal Moskal  <malekith@pld-linux.org>
6177
6178         * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
6179         Return correct type.
6180         From bug #58270.
6181
6182 2004-05-09  Miguel de Icaza  <miguel@ximian.com>
6183
6184         * expression.cs (Binary.DoNumericPromotions): 0 long constant can
6185         be implicitly converted to ulong.
6186         
6187         * expression.cs: The logic for allowing operator &, | and ^ worked
6188         was wrong, it worked before because we did not report an error in
6189         an else branch.  Fixes 57895.
6190
6191         * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
6192         allow volatile fields to be reference types.
6193
6194 2004-05-07  Miguel de Icaza  <miguel@ximian.com>
6195
6196         * driver.cs: Add support for /debug-
6197
6198 2004-05-07  Raja R Harinath  <rharinath@novell.com>
6199
6200         * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType): 
6201         Add a 'complain' parameter to silence errors.
6202         (Attribute.Resolve): Update to changes.  Put in sanity check to catch
6203         silently overlooked type-resolutions.
6204         (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
6205         to reflect changes.
6206         (Attributes.Search): New function.
6207         (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
6208         (Attributes.GetAttributeFullName): Remove hack.
6209         * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes): 
6210         Update to reflect changes.
6211         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
6212         Use Attributes.Search instead of nested loops.
6213
6214 2004-05-07  Marek Safar  <marek.safar@seznam.cz>
6215
6216         * decl.cs:
6217         (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
6218         (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
6219         (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
6220
6221         * report.cs: (Report.Warning): Renamed to Warning_T because of
6222         parameter collision.
6223
6224 2004-05-05  Raja R Harinath  <rharinath@novell.com>
6225
6226         * expression.cs (MemberAccess.ResolveMemberAccess):
6227         Exit with non-zero status after Report.Error.
6228         * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
6229         Likewise.
6230         * typemanager.cs (TypeManager.CoreLookupType): Likewise.
6231
6232 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
6233
6234         * support.cs: Don't hang when the file is empty.
6235
6236 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
6237
6238         * support.cs: In SeekableStreamReader, compute the preamble size of the
6239           underlying stream. Position changes should take into account that initial
6240           count of bytes.
6241
6242 2004-05-03  Todd Berman  <tberman@sevenl.net>
6243
6244         * driver.cs: remove unused GetSysVersion function.
6245
6246 2004-05-03  Todd Berman  <tberman@sevenl.net>
6247
6248         * driver.cs: Remove the hack from saturday, as well as the hack
6249         from jackson (LoadAssemblyFromGac), also adds the CWD to the
6250         link_paths to get that bit proper.
6251
6252 2004-05-01  Todd Berman  <tberman@sevenl.net>
6253
6254         * driver.cs: Try a LoadFrom before a Load, this checks the current
6255         path. This is currently a bug in mono that is be fixed, however, this
6256         provides a workaround for now. This will be removed when the bug
6257         is fixed.
6258
6259 2004-05-01  Sebastien Pouliot  <sebastien@ximian.com>
6260
6261         * CryptoConvert.cs: Updated to latest version. Fix issue with 
6262         incomplete key pairs (#57941).
6263
6264 2004-05-01  Todd Berman  <tberman@sevenl.net>
6265
6266         * driver.cs: Remove '.' from path_chars, now System.* loads properly
6267         from the GAC
6268
6269 2004-04-30  Jackson Harper  <jackson@ximian.com>
6270
6271         * codegen.cs: Open keys readonly.
6272         
6273 2004-04-30  Gonzalo Paniagua Javier <gonzalo@ximian.com>
6274
6275         * typemanager.cs: don't report cyclic struct layout when a struct
6276         contains 2 or more fields of the same type. Failed for Pango.AttrShape
6277         which has 2 Pango.Rectangle fields.
6278
6279 2004-04-29 Ben Maurer  <bmaurer@users.sourceforge.net>
6280
6281         * expression.cs: Handle IntPtr comparisons with IL code
6282         rather than a method call.
6283
6284 2004-04-29  Martin Baulig  <martin@ximian.com>
6285
6286         * ecore.cs (PropertyExpr.FindAccessor): New private method.  Walk
6287         the list of PropertyInfo's in class hierarchy and find the
6288         accessor.  Fixes #56013.
6289
6290 2004-04-29  Martin Baulig  <martin@ximian.com>
6291
6292         * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
6293
6294 2004-04-29  Martin Baulig  <martin@ximian.com>
6295
6296         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
6297
6298         * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
6299
6300 2004-04-29  Martin Baulig  <martin@ximian.com>
6301
6302         * class.cs (ConstructorInitializer.Resolve): Check whether the
6303         parent .ctor is accessible.  Fixes #52146.
6304
6305 2004-04-29  Martin Baulig  <martin@ximian.com>
6306
6307         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
6308
6309         * statement.cs (Using.EmitLocalVariableDecls): Use
6310         TypeManager.idisposable_type, not typeof (IDisposable).
6311         (Foreach.EmitCollectionForeach): Added support for valuetypes.
6312
6313 2004-04-29  Martin Baulig  <martin@ximian.com>
6314
6315         * class.cs (Event.Define): Don't emit the field and don't set
6316         RTSpecialName and SpecialName for events on interfaces.  Fixes
6317         #57703. 
6318
6319 2004-04-29  Raja R Harinath  <rharinath@novell.com>
6320
6321         Refactor Attribute.ApplyAttributes.
6322         * attribute.cs (Attributable): New base class for objects that can
6323         have Attributes applied on them.
6324         (Attribute): Make AttributeUsage fields public.
6325         (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
6326         (Attribute.IsInternalCall): New property.
6327         (Attribute.UsageAttr): Convert to a public read-only property.
6328         (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
6329         (Attribute.ResolveType, Attribute.Resolve)
6330         (Attribute.ScanForIndexerName): Update to reflect changes.
6331         (Attribute.CheckAttributeTarget): Re-format.
6332         (Attribute.ApplyAttributes): Refactor, to various
6333         Attributable.ApplyAttributeBuilder methods.
6334         * decl.cs (MemberCore): Make Attributable.
6335         * class.cs (Accessor): Make Attributable.
6336         (MethodData.ApplyAttributes): Use proper attribute types, not
6337         attribute names.
6338         (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
6339         (TypeContainer.ApplyAttributeBuilder)
6340         (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
6341         (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)   
6342         (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
6343         (Operator.ApplyAttributeBuilder): New factored-out methods.
6344         * const.cs (Const.ApplyAttributeBuilder): Likewise.
6345         * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
6346         * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
6347         * parameter.cs (ParameterBase): New Attributable base class
6348         that can also represent Return types.
6349         (Parameter): Update to the changes.
6350
6351 2004-04-29  Jackson Harper  <jackson@ximian.com>
6352
6353         * driver.cs: Prefer the corlib system version when looking for
6354         assemblies in the GAC. This is still a hack, but its a better hack
6355         now.
6356         
6357 2004-04-29  Marek Safar  <marek.safar@seznam.cz>
6358
6359         * decl.cs, enum.cs: Improved error 3005 reporting.
6360   
6361         * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
6362         (related_symbols): New private member for list of symbols
6363         related to reported error/warning.
6364         
6365         * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
6366
6367 2004-04-29  Martin Baulig  <martin@ximian.com>
6368
6369         * ecore.cs (Expression.Constantify): If we're an enum and
6370         TypeManager.TypeToCoreType() doesn't give us another type, use
6371         t.UnderlyingSystemType.  Fixes #56178.  
6372
6373 2004-04-29  Martin Baulig  <martin@ximian.com>
6374
6375         * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
6376         interfaces and for each interface, only add members directly
6377         declared in that interface.  Fixes #53255.
6378
6379 2004-04-28  Martin Baulig  <martin@ximian.com>
6380
6381         * expression.cs (ConditionalLogicalOperator): Use a temporary
6382         variable for `left' to avoid that we evaluate it more than once;
6383         bug #52588.
6384
6385 2004-04-28  Martin Baulig  <martin@ximian.com>
6386
6387         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
6388         `void[]' (CS1547).
6389
6390 2004-04-28  Martin Baulig  <martin@ximian.com>
6391
6392         * statement.cs (LocalInfo.Resolve): Check whether the type is not
6393         void (CS1547).
6394
6395         * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
6396         whether the type is not void (CS1547).
6397
6398 2004-04-28  Martin Baulig  <martin@ximian.com>
6399
6400         * expression.cs (Unary.DoResolveLValue): Override this and report
6401         CS0131 for anything but Operator.Indirection.
6402
6403 2004-04-28  Martin Baulig  <martin@ximian.com>
6404
6405         Committing a patch from Ben Maurer; see bug #50820.
6406
6407         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
6408         check for classes.
6409
6410         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
6411         classes.        
6412
6413 2004-04-28  Martin Baulig  <martin@ximian.com>
6414
6415         Committing a patch from Ben Maurer; see bug #50820.
6416
6417         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
6418         check for classes.
6419
6420         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
6421         classes.        
6422
6423 2004-04-28  Martin Baulig  <martin@ximian.com>
6424
6425         * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
6426         (Block.AddLabel): Call DoLookupLabel() to only search in the
6427         current block.
6428
6429 2004-04-28  Martin Baulig  <martin@ximian.com>
6430
6431         * cfold.cs (ConstantFold.BinaryFold): Added special support for
6432         comparing StringConstants and NullLiterals in Equality and Inequality.
6433
6434 2004-04-28  Jackson Harper  <jackson@ximian.com>
6435
6436         * driver.cs: Attempt to load referenced assemblies from the
6437         GAC. This is the quick and dirty version of this method that
6438         doesnt take into account versions and just takes the first
6439         canidate found. Will be good enough for now as we will not have more
6440         then one version installed into the GAC until I update this method.
6441
6442 2004-04-28  Martin Baulig  <martin@ximian.com>
6443
6444         * typemanager.cs (TypeManager.CheckStructCycles): New public
6445         static method to check for cycles in the struct layout.
6446
6447         * rootcontext.cs (RootContext.PopulateTypes): Call
6448         TypeManager.CheckStructCycles() for each TypeContainer.
6449         [Note: We only need to visit each type once.]
6450
6451 2004-04-28  Martin Baulig  <martin@ximian.com>
6452
6453         * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
6454
6455         * const.cs (Const.LookupConstantValue): Return a `bool' signalling
6456         success and added `out object value'.  Use a `bool resolved' field
6457         to check whether we've already been called rather than
6458         `ConstantValue != null' since this breaks for NullLiterals.
6459
6460 2004-04-28  Raja R Harinath  <rharinath@novell.com>
6461
6462         * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
6463         setting of this flag, since the 'set' method may be non-public.
6464
6465 2004-04-28  Raja R Harinath  <rharinath@novell.com>
6466
6467         * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
6468         check on current_vector.Block.
6469
6470 2004-04-27  Martin Baulig  <martin@ximian.com>
6471
6472         * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
6473         a field initializer.  Fixes #56459.
6474
6475 2004-04-27  Martin Baulig  <martin@ximian.com>
6476
6477         * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
6478         we're not attempting to use an indexer.  Fixes #52154.
6479
6480 2004-04-27  Martin Baulig  <martin@ximian.com>
6481
6482         * statement.cs (Return): Don't create a return label if we don't
6483         need it; reverts my change from January 20th.  Thanks to Ben
6484         Maurer for this.
6485
6486 2004-04-27  Martin Baulig  <martin@ximian.com>
6487
6488         According to the spec, `goto' can only leave a nested scope, but
6489         never enter it.
6490
6491         * statement.cs (Block.LookupLabel): Only lookup in the current
6492         block, don't recurse into parent or child blocks.
6493         (Block.AddLabel): Check in parent and child blocks, report
6494         CS0140/CS0158 if we find a duplicate.
6495         (Block): Removed this indexer for label lookups.
6496         (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
6497         this already does the error reporting for us.
6498
6499         * flowanalysis.cs
6500         (FlowBranching.UsageVector.Block): New public variable; may be null.
6501         (FlowBranching.CreateSibling): Added `Block' argument.
6502         (FlowBranching.LookupLabel): New public virtual method.  Lookup a
6503         label for the target of a `goto' and check whether we're not
6504         leaving a `finally'.
6505
6506 2004-04-27  Martin Baulig  <martin@ximian.com>
6507
6508         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
6509         a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
6510         just for returns).
6511
6512 2004-04-27  Martin Baulig  <martin@ximian.com>
6513
6514         * statement.cs (Block.AddLabel): Also check for implicit blocks
6515         and added a CS0158 check.
6516
6517 2004-04-27  Martin Baulig  <martin@ximian.com>
6518
6519         * flowanalysis.cs (FlowBranchingLoop): New class.
6520         (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
6521         UsageVector's instead of an ArrayList.
6522         (FlowBranching.Label): Likewise.
6523         (FlowBranching.UsageVector.MergeBreakOrigins): New method.
6524         (FlowBranching.AddBreakVector): New method.
6525
6526 2004-04-27  Miguel de Icaza  <miguel@ximian.com>
6527
6528         * attribute.cs: Small regression fix: only convert the type if we
6529         the type is different, fixes System.Drawing build.
6530
6531 2004-04-27  Martin Baulig  <martin@ximian.com>
6532
6533         * attribute.cs (Attribute.Resolve): If we have a constant value
6534         for a named field or property, implicity convert it to the correct
6535         type.
6536
6537 2004-04-27  Raja R Harinath  <rharinath@novell.com>
6538
6539         * statement.cs (Block.Block): Implicit blocks share
6540         'child_variable_names' fields with parent blocks.
6541         (Block.AddChildVariableNames): Remove.
6542         (Block.AddVariable): Mark variable as "used by a child block" in
6543         every surrounding block.
6544         * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
6545         been used in a child block, complain about violation of "Invariant
6546         meaning in blocks" rule.
6547         * cs-parser.jay (declare_local_variables): Don't use
6548         AddChildVariableNames.
6549         (foreach_statement): Don't create an implicit block: 'foreach'
6550         introduces a scope.
6551
6552 2004-04-23  Miguel de Icaza  <miguel@ximian.com>
6553
6554         * convert.cs (ImplicitNumericConversion): 0 is also positive when
6555         converting from 0L to ulong.  Fixes 57522.
6556
6557 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
6558
6559         * decl.cs (FindMemberToOverride): Fix wrong warning for case when
6560         derived class hides via 'new' keyword field from base class (test-242.cs).
6561         TODO: Handle this in the more general way.
6562         
6563         * class.cs (CheckBase): Ditto.
6564
6565 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
6566
6567         * decl.cs (caching_flags): New member for storing cached values
6568         as bit flags.
6569         (MemberCore.Flags): New enum where bit flags for caching_flags
6570         are defined.
6571         (MemberCore.cls_compliance): Moved to caching_flags.
6572         (DeclSpace.Created): Moved to caching_flags.
6573
6574         * class.cs: Use caching_flags instead of DeclSpace.Created
6575         
6576 2004-04-21  Miguel de Icaza  <miguel@ximian.com>
6577
6578         * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
6579         if we are only a derived class, not a nested class.
6580
6581         * typemanager.cs: Same as above, but do this at the MemberLookup
6582         level (used by field and methods, properties are handled in
6583         PropertyExpr).   Allow for the qualified access if we are a nested
6584         method. 
6585
6586 2004-04-21  Marek Safar  <marek.safar@seznam.cz>
6587
6588         * class.cs: Refactoring.
6589         (IMethodData): New inteface; Holds links to parent members
6590         to avoid member duplication (reduced memory allocation).
6591         (Method): Implemented IMethodData interface.
6592         (PropertyBase): New inner classes for get/set methods.
6593         (PropertyBase.PropertyMethod): Implemented IMethodData interface
6594         (Event): New inner classes for add/remove methods.
6595         (Event.DelegateMethod): Implemented IMethodData interface.
6596
6597         * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
6598         EmitContext (related to class.cs refactoring).
6599
6600 2004-04-21  Raja R Harinath  <rharinath@novell.com>
6601
6602         * delegate.cs (Delegate.VerifyApplicability): If the number of
6603         arguments are the same as the number of parameters, first try to
6604         verify applicability ignoring  any 'params' modifier on the last
6605         parameter.
6606         Fixes #56442.
6607
6608 2004-04-08  Martin Baulig  <martin@ximian.com>
6609
6610         Merged latest changes into gmcs.  Please keep this comment in
6611         here, it makes it easier for me to see what changed in MCS since
6612         the last time I merged.
6613
6614 2004-04-16  Raja R Harinath  <rharinath@novell.com>
6615
6616         * class.cs (TypeContainer.AddIndexer): Use
6617         'ExplicitInterfaceName' to determine if interface name was
6618         explicitly specified.  'InterfaceType' is not initialized at this time.
6619         (TypeContainer.DefineIndexers): Remove use of temporary list.  The
6620         Indexers array is already in the required order.  Initialize
6621         'IndexerName' only if there are normal indexers.
6622         (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
6623         (TypeContainer.Emit): Emit DefaultMember attribute only if
6624         IndexerName is initialized.
6625         Fixes #56300.
6626
6627 2004-04-15  Benjamin Jemlich  <pcgod@gmx.net>
6628
6629         * enum.cs (Enum.DefineType): Don't allow char as type for enum.
6630         Fixes #57007
6631
6632 2004-04-15  Raja R Harinath  <rharinath@novell.com>
6633
6634         * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
6635         attributes.
6636         Fix for #56456.
6637
6638         * attribute.cs (Attribute.Resolve): Check for duplicate named
6639         attributes.
6640         Fix for #56463.
6641
6642 2004-04-15  Miguel de Icaza  <miguel@ximian.com>
6643
6644         * iterators.cs (MarkYield): track whether we are in an exception,
6645         and generate code accordingly.  Use a temporary value to store the
6646         result for our state.
6647
6648         I had ignored a bit the interaction of try/catch with iterators
6649         since their behavior was not entirely obvious, but now it is
6650         possible to verify that our behavior is the same as MS .NET 2.0
6651
6652         Fixes 54814
6653
6654 2004-04-14  Miguel de Icaza  <miguel@ximian.com>
6655
6656         * iterators.cs: Avoid creating temporaries if there is no work to
6657         do. 
6658
6659         * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
6660         Enumerations, use TypeManager.EnumToUnderlying and call
6661         recursively. 
6662
6663         Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
6664         bug #57013
6665
6666         (This.Emit): Use EmitContext.EmitThis to emit our
6667         instance variable.
6668
6669         (This.EmitAssign): Ditto.
6670
6671         * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
6672         codepaths, we will move all the functionality into
6673         Mono.CSharp.This 
6674
6675         (FieldExpr.EmitAssign): Ditto.
6676
6677         This fixes several hidden bugs that I uncovered while doing a code
6678         review of this today.
6679
6680         * codegen.cs (EmitThis): reworked so the semantics are more clear
6681         and also support value types "this" instances.
6682
6683         * iterators.cs: Changed so that for iterators in value types, we
6684         do not pass the value type as a parameter.  
6685
6686         Initialization of the enumerator helpers is now done in the caller
6687         instead of passing the parameters to the constructors and having
6688         the constructor set the fields.
6689
6690         The fields have now `assembly' visibility instead of private.
6691
6692 2004-04-11  Miguel de Icaza  <miguel@ximian.com>
6693
6694         * expression.cs (Argument.Resolve): Check if fields passed as ref
6695         or out are contained in a MarshalByRefObject.
6696
6697         * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
6698         another compiler type.
6699
6700 2004-04-06 Ben Maurer  <bmaurer@users.sourceforge.net>
6701
6702         * class.cs (Indexer.Define): use the new name checking method.
6703         Also, return false on an error.
6704         * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
6705         (is_identifier_[start/part]_character): make static.
6706
6707 2004-04-10  Miguel de Icaza  <miguel@ximian.com>
6708
6709         * expression.cs (Binary.ResolveOperator): Do no append strings
6710         twice: since we can be invoked more than once (array evaluation)
6711         on the same concatenation, take care of this here.  Based on a fix
6712         from Ben (bug #56454)
6713
6714 2004-04-08  Sebastien Pouliot  <sebastien@ximian.com>
6715
6716         * codegen.cs: Fix another case where CS1548 must be reported (when 
6717         delay-sign isn't specified and no private is available #56564). Fix
6718         loading the ECMA "key" to delay-sign an assembly. Report a CS1548 
6719         error when MCS is used on the MS runtime and we need to delay-sign 
6720         (which seems unsupported by AssemblyBuilder - see #56621).
6721
6722 2004-04-08  Marek Safar  <marek.safar@seznam.cz>
6723
6724         * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
6725         (TypeManager.ComputeNamespaces): Faster implementation for
6726         Microsoft runtime.
6727
6728         * compiler.csproj: Updated AssemblyName to mcs.
6729
6730 2004-05-11  Jackson Harper  <jackson@ximian.com>
6731
6732         * Makefile: Preserve MONO_PATH
6733         
6734 2004-05-11  Jackson Harper  <jackson@ximian.com>
6735
6736         * Makefile: Use mono and mcs to build gmcs
6737         
6738 2004-05-03  Miguel de Icaza  <miguel@ximian.com>
6739
6740         * codegen.cs: Add patch from Robert Shade
6741         <rshade@dvsconsulting.com>, use FileAccess.Read on the keyfile, to
6742         sync with mcs.
6743
6744 2004-05-02  Sebastien Pouliot  <sebastien@ximian.com>
6745
6746         * CryptoConvert.cs: Updated to latest version. Fix issue with 
6747         incomplete key pairs (#57941).
6748
6749 2004-04-08  Sebastien Pouliot  <sebastien@ximian.com>
6750
6751         * codegen.cs: Fix another case where CS1548 must be reported (when 
6752         delay-sign isn't specified and no private is available #56564). Fix
6753         loading the ECMA "key" to delay-sign an assembly. Report a CS1548 
6754         error when MCS is used on the MS runtime and we need to delay-sign 
6755         (which seems unsupported by AssemblyBuilder - see #56621).
6756
6757 2004-04-29  Jackson Harper  <jackson@ximian.com>
6758
6759         * Makefile: Set MONO_PATH to use the bootstrap corlib
6760         * driver.cs: Check the GAC for referenced assemblies.
6761                 
6762 2004-04-29  Martin Baulig  <martin@ximian.com>
6763
6764         * Makefile (gmcs.exe): Set MONO_PATH to use `../class/lib/net_2_0'.
6765
6766 2004-04-07  Martin Baulig  <martin@ximian.com>
6767
6768         * expression.cs (Binary.ResolveOperator): Added special case for
6769         Equality/Inequality between a type parameter and a null literal.
6770
6771 2004-04-07  Martin Baulig  <martin@ximian.com>
6772
6773         * convert.cs: Check null literal -> type parameter conversions.
6774
6775 2004-04-07  Martin Baulig  <martin@ximian.com>
6776
6777         * generic.cs (ConstructedType.CheckConstraints): Enforce the
6778         `class' and `struct' constraints.
6779
6780 2004-04-07  Martin Baulig  <martin@ximian.com>
6781
6782         * generic.cs (SpecialConstraint): New public enum.
6783         (Constraints.Resolve): Added support for the `class' and `struct'
6784         constraints.
6785
6786         * cs-parser.jay (type_parameter_constraint): Added support for the
6787         `class' and `struct' constraints.
6788
6789 2004-04-07  Martin Baulig  <martin@ximian.com>
6790
6791         * support.cs (GenericConstraints): Replaced `Types' by
6792         `ClassConstraint' and `InterfaceConstraints'; added
6793         `HasClassConstraint'.   
6794
6795 2004-04-07  Martin Baulig  <martin@ximian.com>
6796
6797         * generic.cs
6798         (Constraints.InterfaceConstraints): New public property.
6799         (Constraints.Types): Make this property public
6800         (TypeParameter): Implement IMemberContainer.
6801         (TypeParameter.Define): Take a `GenericTypeParameterBuilder'
6802         instead of a TypeBuilder/MethodBuilder; pass the interface
6803         constraints to TypeManager.AddTypeParameter().
6804         (TypeParameter.DefineType): Just take an EmitContext and no
6805         TypeBuilder/MethodBuilder.  Use the new public API.
6806
6807         * typemanager.cs (TypeManager.AddTypeParameter): Added
6808         `TypeExpr[]' argument; add the interfaces to the
6809         `builder_to_ifaces' hash.
6810         (TypeManager.LookupMemberContainer): For
6811         GenericTypeParameterBuilders, get the TypeParameter from the
6812         `builder_to_type_param'.
6813         (TypeManager.FindMembers): For GenericTypeParameterBuilders, get
6814         the TypeParameter and call FindMembers on it.
6815
6816 2004-04-07  Martin Baulig  <martin@ximian.com>
6817
6818         * class.cs
6819         (MethodCore.GenericMethod): Moved this field here from Method.
6820         (MethodCore.IsDuplicateImplementation): Take the number of type
6821         parameters into account if we're a generic method.
6822
6823         * expression.cs (Invocation.InferTypeArguments): Don't return true
6824         if `arguments' is null; we still need to check whether we actually
6825         don't need to infer anything in this case.
6826         (MemberAccess): Merged the functionality from GenericMemberAccess
6827         into this class.
6828
6829         * generic.cs (GenericMemberAccess): Removed.
6830
6831 2004-04-05  Martin Baulig  <martin@ximian.com>
6832
6833         * decl.cs (MemberCore): For generic classes, interfaces and
6834         structs, `Name' now includes the number of type parameters
6835         ("Stack!1.Node!1").
6836         (DeclSpace.FindType): Removed the `num_type_args' argument; we now
6837         encode the number of type arguments in the type name.
6838
6839         * expression.cs (Expression.MemberLookup): Removed the
6840         `num_type_args' argument; we now encode the number of type
6841         arguments in the type name.
6842
6843         * ecore.cs (SimpleName): Encode the number of type arguments in
6844         the type name itself.
6845
6846         * generic.cs (ConstructedType): Likewise.
6847
6848         * tree.cs (Tree.RecordDecl): Take a `string' instead of a
6849         `MemberName'; we now include the number of type parameters in the
6850         type name.
6851
6852         * typemanager.cs (TypeManager.CheckGeneric): Removed.
6853         (TypeManager.MemberLookup): Removed the
6854         `num_type_args' argument; we now encode the number of type
6855         arguments in the type name.     
6856
6857 2004-04-03  Martin Baulig  <martin@ximian.com>
6858
6859         * decl.cs (MemberCore.ctor): Take a MemberName instead of a sting.
6860         (MemberCore.MemberName): Moved here from MemberBase.
6861         (DeclSpace.SetParameterInfo): Just take the constraints as an
6862         ArrayList; we already have the type parameters in our
6863         `MemberName'; also do the CS0080 reporting here.
6864
6865         * cs-parser.jay (struct_declaration): Use `member_name' instead of
6866         `IDENTIFIER opt_type_parameter_list'; when constructing our
6867         `MemberName', it'll already include our type parameters.
6868         (class_declaration, interface_declaration): Likewise.
6869         (delegate_declaration): Likewise.
6870         (MakeName): Take a MemberName and return a MemberName.
6871         The following two changes are required to avoid shift/reduce conflicts:
6872         (member_name): Don't include a TypeName anymore; ie. this is now
6873         just 'IDENTIFIER opt_type_parameter_list'.
6874         (property_declaration, event_declaration): Use a
6875         `namespace_or_type_name' instead of a `member_name'.            
6876
6877 2004-04-03  Martin Baulig  <martin@ximian.com>
6878
6879         * decl.cs (MemberName): Renamed to `TypeName' and created a new
6880         `MemberName' class.
6881         (TypeName): Formerly known as MemberName.
6882
6883         * namespace.cs (NamespaceEntry.UsingAlias): Take a `TypeName'
6884         instead of a `MemberName'.
6885
6886         * cs-parser.jay (namespace_or_type_name): Create a TypeName.
6887         (member_name): New rule; create a MemberName.
6888
6889 2004-04-02  Martin Baulig  <martin@ximian.com>
6890
6891         * namespace.cs (NamespaceEntry.VerifyUsing): Added error checking
6892         (CS0305 and CS0308).
6893
6894 2004-04-02  Martin Baulig  <martin@ximian.com>
6895
6896         * generic.cs (GenericMemberAccess.ResolveAsTypeStep): Added
6897         support for nested types.
6898
6899 2004-04-02  Martin Baulig  <martin@ximian.com>
6900
6901         * ecore.cs (IAlias): New public interface.
6902         (TypeExpr, TypeExpression): Implement IAlias.
6903         (TypeAliasExpression): New public class.
6904
6905         * namespace.cs (Namespace): Implement IAlias.
6906         (Namespace.Lookup): Return an IAlias instead on an object.
6907         (Namespace.DefineName): Take an IAlias instead of an object.
6908         (NamespaceEntry.AliasEntry.Resolve): Return an IAlias instead of
6909         an object.
6910         (NamespaceEntry.UsingAlias): Take a Membername instead of an
6911         Expression.
6912         (NamespaceEntry.LookupAlias): Return an IAlias instead on an
6913         object.
6914         (NamespaceEntry.Lookup): Likewise.
6915
6916         * rootcontext.cs (RootContext.LookupType): Return a TypeExpr
6917         instead of a Type.      
6918
6919         * decl.cs (DeclSpace): Implement IAlias.
6920         (DeclSpace.LookupAlias): Return an IAlias instead of a string.
6921
6922         * generic.cs (ConstructedType): Improved error checking.
6923
6924 2004-04-02  Martin Baulig  <martin@ximian.com>
6925
6926         * convert.cs: Added type parameter conversions.
6927
6928         * ecore.cs
6929         (UnboxCast.Emit): Emit an `unbox.any' for type params.
6930         (ClassCast.Emit): If the source type is a type parameter, box it.
6931         If the target type is a type parameter, emit an `unbox.any'
6932         instead of a `classcast'.1      
6933
6934 2004-04-01  Martin Baulig  <martin@ximian.com>
6935
6936         * cs-tokenizer.cs (parse_less_than): Allow Token.DOT.
6937
6938 2004-04-01  Martin Baulig  <martin@ximian.com>
6939
6940         * generic.cs (ConstructedType.CheckConstraints): Use
6941         Convert.ImplicitStandardConversionExists(); user-defined implicit
6942         conversions are not allowed according to the spec.
6943
6944 2004-03-30  Martin Baulig  <martin@ximian.com>
6945
6946         * expression.cs (New): Added support for type parameters.
6947
6948         * typemanager.cs
6949         (TypeManager.activator_type): New public static field.
6950         (TypeManager.activator_create_instance): Likewise.
6951
6952 2004-03-30  Martin Baulig  <martin@ximian.com>
6953
6954         * typemanager.cs (TypeManager.HasConstructorConstraint): New
6955         public method.
6956
6957 2004-03-30  Martin Baulig  <martin@ximian.com>
6958
6959         * generic.cs (ConstructedType.CheckConstraints): Actually follow
6960         the spec here: the argument type must be convertible to the
6961         constraints.
6962
6963 2004-03-30  Martin Baulig  <martin@ximian.com>
6964
6965         * generic.cs
6966         (TypeParameter.Define, TypeParameter.DefineMethod): Call
6967         TypeManager.AddTypeParameter().
6968         (ConstructedType.CheckConstraints): Re-enable this and actually
6969         check whether we have a constructor constraint.
6970
6971         * typemanager.cs
6972         (TypeManager.builder_to_type_param): New static field.
6973         (TypeManager.AddTypeParameter): New static method.
6974         (TypeManager.LookupTypeParameter): New public method.
6975
6976 2004-03-30  Martin Baulig  <martin@ximian.com>
6977
6978         * generic.cs (TypeParameter.DefineType): Return a boolean and use
6979         the new API to actually define the constructor constraint.
6980
6981         * typemanager.cs
6982         (TypeManager.new_constraint_attr_type): New static field.
6983         (TypeManager.InitCoreTypes): Initialize it.
6984
6985 2004-03-30  Martin Baulig  <martin@ximian.com>
6986
6987         * generic.cs (Constraints): Completed error checking, use correct
6988         error numbers.
6989
6990 2004-03-29  Martin Baulig  <martin@ximian.com>
6991
6992         * delegate.cs (Delegate.VerifyMethod): Infer type arguments.
6993
6994         * expression.cs (Invocation.InferTypeArguments): Added overloaded
6995         public version which takes a `ParameterData pd' instead of an
6996         `ArrayList args'.
6997
6998 2004-03-29  Martin Baulig  <martin@ximian.com>
6999
7000         * typemanager.cs (TypeManager.IsGenericMethod): Take a MethodBase,
7001         not a MethodInfo.       
7002
7003 2004-03-29  Martin Baulig  <martin@ximian.com>
7004
7005         * expression.cs (Argument.ResolveMethodGroup): If we're a
7006         ConstructedType, call GetMemberAccess() on it.  
7007
7008 2004-03-29  Martin Baulig  <martin@ximian.com>
7009
7010         * class.cs (MethodBase.CheckGenericOverride): New abstract method.
7011         (MethodCore.CheckGenericOverride): When overriding a generic
7012         method, check whether the constraints match.
7013
7014         * support.cs (GenericConstraints): New public interface.
7015         (ParameterData.GenericConstraints): New public method.
7016
7017         * parameter.cs (Parameter.Resolve): Check whether we're a generic
7018         method parameter and compute our constraints if appropriate.
7019         (Parameter.GenericConstraints): New public property.
7020
7021         * generic.cs (Constraints): Implement GenericConstraints.
7022
7023 2004-03-29  Martin Baulig  <martin@ximian.com>
7024
7025         * decl.cs (MemberCache.FindMemberToOverride): Use
7026         `paramTypes [j].Equals (cmpAttrs [j])' instead of `=='.
7027
7028 2004-03-29  Martin Baulig  <martin@ximian.com>
7029
7030         * generic.cs (GenericMethod.Define): Resolve our type parameters.
7031
7032 2004-03-29  Martin Baulig  <martin@ximian.com>
7033
7034         * cs-parser.jay: Report CS0080 instead of -200 ("Constraints are
7035         not allowed on non-generic declarations").
7036
7037 2004-03-29  Martin Baulig  <martin@ximian.com>
7038
7039         * expression.cs (Invocation.InferTypeArguments): Added overloaded
7040         public version of this method.
7041
7042         * class.cs (MethodCore.IsDuplicateImplementation): Use
7043         Invocation.InferTypeArguments() to check this.
7044
7045 2004-03-29  Martin Baulig  <martin@ximian.com>
7046
7047         * convert.cs: Use TypeManager.IsDelegateType() instead of
7048         comparing types correctly.
7049
7050 2004-03-29  Martin Baulig  <martin@ximian.com>
7051
7052         * convert.cs: Use TypeManager.IsSubclassOf() instead of comparing
7053         types directly to make it work for generic instances.
7054
7055         * typemanager.cs (TypeManager.IsSubclassOf): New static method.
7056
7057 2004-03-29  Martin Baulig  <martin@ximian.com>
7058
7059         * typemanager.cs (TypeManager.MayBecomeEqualGenericTypes): Added
7060         support for arrays.     
7061
7062 2004-03-24  Martin Baulig  <martin@ximian.com>
7063
7064         * decl.cs (DeclSpace.FindType): Also use
7065         TypeManager.CheckGeneric() for types from the using clauses.
7066
7067 2004-03-23  Martin Baulig  <martin@ximian.com>
7068
7069         * expression.cs (Invocation.OverloadResolve): Added `bool
7070         may_fail' argument and use it instead of the Location.IsNull() hack.
7071
7072 2004-03-23  Martin Baulig  <martin@ximian.com>
7073
7074         * expression.cs (Invocation.InferType): Use correct type inference
7075         rules here.     
7076
7077 2004-03-23  Martin Baulig  <martin@ximian.com>
7078
7079         * ecore.cs (MethodGroupExpr.Name): Use
7080         TypeManager.CSharpSignature() instead of just the name.
7081
7082         * expression.cs (Invocation.OverloadResolve): Provide better error
7083         reporting.
7084         (Invocation.DoResolve): OverloadResolve() never returns null
7085         without reporting an error, so removed the error -6 reporting here.
7086
7087 2004-03-23  Martin Baulig  <martin@ximian.com>
7088
7089         * typemanager.cs (TypeManager.GetMethodFlags): Fixed the FIXME for
7090         generic methods.
7091
7092         * cs-parser.jay (delegate_declaration): Support generic delegates.
7093
7094         * delegate.cs: Support generic delegates.
7095
7096 2004-03-22  Martin Baulig  <martin@ximian.com>
7097
7098         * expression.cs (Invocation.InferParamsTypeArguments): New static
7099         method; does type inference for params arguments.
7100
7101 2004-03-21  Martin Baulig  <martin@ximian.com>
7102
7103         * typemanager.cs (TypeManager.IsGenericMethod): New public static
7104         method; checks whether a method is a generic method.    
7105
7106         * expression.cs (Invocation.InferTypeArguments): New static method;
7107         infer type arguments for generic method invocation.
7108
7109         * ecore.cs (MethodGroupExpr.HasTypeArguments): New public
7110         property; we set this to true if we're resolving a generic method
7111         invocation and the user specified type arguments, ie. we're not
7112         doing type inference.
7113
7114 2004-03-20  Martin Baulig  <martin@ximian.com>
7115
7116         * class.cs (MethodData.DeclaringType): New public property.
7117         (MethodData.Define): Set DeclaringType here.
7118         (Operator.Define): Use OperatorMethod.MethodData.DeclaringType
7119         instead of OperatorMethodBuilder.DeclaringType.
7120
7121 2004-03-20  Martin Baulig  <martin@ximian.com>
7122
7123         * cs-tokenizer.cs (xtoken): Return a special
7124         Token.DEFAULT_OPEN_PARENS for "`default' followed by open parens".
7125
7126         * cs-parser.jay (default_value_expression): Switch to the new
7127         syntax (14.5.13).
7128
7129 2004-03-19  Martin Baulig  <martin@ximian.com>
7130
7131         * decl.cs (MemberName): New class.  We use this to "construct"
7132         namespace_or_type_name's.
7133
7134         * generics.cs (TypeArguments.GetDeclarations): New public method;
7135         returns the type arguments as a string[] and reports a CS0081 if
7136         one of them is not an identifier.
7137
7138         * class.cs (MemberBase): The .ctor now takes the name as a
7139         MemberName instead of a string.
7140         (MemberBase.ExplicitInterfaceName): Changed type from string to
7141         Expression.
7142         (MemberBase.DoDefine): If we're an explicit implementation, the
7143         InterfaceType may be a generic instance.
7144
7145         * cs-parser.jay (namespace_or_type_name): Return a MemberName.
7146         (namespace_name): Call MemberName.GetName () to transform the
7147         MemberName into a string and ensure we don't have any type
7148         arguments.
7149         (type_name): Call MemberName.GetTypeExpression() to transfrom the
7150         MemberName into an expression.
7151         (method_header): Use namespace_or_type_name instead of member_name.     
7152
7153 2004-04-07  Miguel de Icaza  <miguel@ximian.com>
7154
7155         * rootcontext.cs: Add new types to the boot resolution.
7156
7157         * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
7158         MulticastDelegate is not allowed.
7159
7160         * typemanager.cs: Add new types to lookup: System.TypedReference
7161         and ArgIterator.
7162
7163         * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
7164         check for TypedReference or ArgIterator, they are not allowed. 
7165
7166         * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
7167         makes us properly catch 1510 in some conditions (see bug 56016 for
7168         details). 
7169
7170 2004-04-06  Bernie Solomon  <bernard@ugsolutions.com>
7171
7172         * CryptoConvert.cs: update from corlib version
7173         with endian fixes.
7174
7175 2004-04-05  Miguel de Icaza  <miguel@ximian.com>
7176
7177         * class.cs (Indexer.Define): Check indexername declaration
7178
7179 2004-04-05  Marek Safar  <marek.safar@seznam.cz>
7180
7181         * attribute.cs (IsClsCompliant): Fixed problem with handling
7182         all three states (compliant, not-compliant, undetected).
7183
7184 2004-03-30  Marek Safar  <marek.safar@seznam.cz>
7185
7186         * attribute.cs (Attribute): Location is now public.
7187         (Resolve): Store resolved arguments (pos_values) in attribute class.
7188         Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
7189         (GetClsCompliantAttributeValue): New method that gets
7190         CLSCompliantAttribute value.
7191         (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
7192         if exists else null.
7193         (AttributeTester): New class for CLS-Compliant verification routines.
7194
7195         * class.cs (Emit): Add CLS-Compliant verification.
7196         (Method.GetSignatureForError): Implemented.
7197         (Constructor.GetSignatureForError): Implemented
7198         (Constructor.HasCompliantArgs): Returns if constructor has
7199         CLS-Compliant arguments.
7200         (Constructor.Emit): Override.
7201         (Construcor.IsIdentifierClsCompliant): New method; For constructors
7202         is needed to test only parameters.
7203         (FieldBase.GetSignatureForError): Implemented.
7204         (TypeContainer): New member for storing base interfaces.
7205         (TypeContainer.FindMembers): Search in base interfaces too.
7206
7207         * codegen.cs (GetClsComplianceAttribute): New method that gets
7208         assembly or module CLSCompliantAttribute value.
7209         (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
7210         for assembly.
7211         (ModuleClass.Emit): Add error 3012 test.
7212
7213         * const.cs (Emit): Override and call base for CLS-Compliant tests.
7214
7215         * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
7216         state for all decl types.
7217         (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
7218         if CLS-Compliant tests are required.
7219         (IsClsCompliaceRequired): New method. Analyze whether code
7220         must be CLS-Compliant.
7221         (IsExposedFromAssembly): New method. Returns true when MemberCore
7222         is exposed from assembly.
7223         (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
7224         value or gets cached value.
7225         (HasClsCompliantAttribute): New method. Returns true if MemberCore
7226         is explicitly marked with CLSCompliantAttribute.
7227         (IsIdentifierClsCompliant): New abstract method. This method is
7228         used to testing error 3005.
7229         (IsIdentifierAndParamClsCompliant): New method. Common helper method
7230         for identifier and parameters CLS-Compliant testing.
7231         (VerifyClsCompliance): New method. The main virtual method for
7232         CLS-Compliant verifications.
7233         (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
7234         null. I don't know why is null (too many public members !).
7235         (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
7236         and get value of first CLSCompliantAttribute that found.
7237
7238         * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
7239         (VerifyClsCompliance): Override and add extra tests.
7240
7241         * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
7242         clscheck- disable CLS-Compliant verification event if assembly is has
7243         CLSCompliantAttribute(true).
7244
7245         * enum.cs (Emit): Override and call base for CLS-Compliant tests.
7246         ApllyAttribute is now called in emit section as in the other cases.
7247         Possible future Emit integration.
7248         (IsIdentifierClsCompliant): New override.
7249         (VerifyClsCompliance): New override.
7250         (GetEnumeratorName): Returns full enum name.
7251
7252         * parameter.cs (GetSignatureForError): Implemented.
7253
7254         * report.cs (WarningData): New struct for Warning message information.
7255         (LocationOfPreviousError): New method.
7256         (Warning): New method. Reports warning based on the warning table.
7257         (Error_T): New method. Reports error based on the error table.
7258
7259         * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
7260         verifications are done here.
7261
7262         * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
7263
7264         * typemanager.cs (cls_compliant_attribute_type): New member thath holds
7265         CLSCompliantAttribute.
7266         (all_imported_types): New member holds all imported types from other
7267         assemblies.
7268         (LoadAllImportedTypes): New method fills static table with exported types
7269         from all referenced assemblies.
7270         (Modules): New property returns all assembly modules.
7271
7272 2004-03-30  Miguel de Icaza  <miguel@ximian.com>
7273
7274         * cs-parser.jay: Add a rule to catch wrong event syntax instead of
7275         throwing a parser error.
7276
7277         * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
7278         which removes the hardcoded get_/set_ prefixes for properties, as
7279         IL allows for the properties to be named something else.  
7280
7281         Bug #56013
7282
7283         * expression.cs: Do not override operand before we know if it is
7284         non-null.  Fix 56207
7285
7286 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
7287
7288         * typemanager.cs: support for pinned variables.
7289
7290 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
7291
7292         * decl.cs, typemanager.cs: Avoid using an arraylist
7293         as a buffer if there is only one result set.
7294
7295 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
7296
7297         * expression.cs: Make sure you cant call a static method
7298         with an instance expression, bug #56174.
7299
7300 2004-03-29  Miguel de Icaza  <miguel@ximian.com>
7301
7302         * class.cs (IsDuplicateImplementation): Improve error reporting to
7303         flag 663 (method only differs in parameter modifier).
7304
7305         * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
7306         in preprocessor directives.
7307
7308         * location.cs (LookupFile): Allow for the empty path.
7309
7310         * attribute.cs (DefinePInvokeMethod): Fix 56148;  I would like a
7311         better approach for some of that patch, but its failing with the
7312         CharSet enumeration.  For now try/catch will do.
7313
7314         * typemanager.cs: Do not crash if a struct does not have fields.
7315         Fixes 56150.
7316
7317 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
7318
7319         * expression.cs: cs0213, cant fix a fixed expression.
7320         fixes 50231.
7321
7322 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
7323
7324         * cs-parser.jay: detect invalid embeded statements gracefully.
7325         bug #51113.
7326
7327 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
7328
7329         * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
7330         As a regex:
7331         s/
7332         the invocation type may not be a subclass of the tye of the item/
7333         The type of the item must be a subclass of the invocation item.
7334         /g
7335
7336         Fixes bug #50820.
7337
7338 2004-03-25  Sebastien Pouliot  <sebastien@ximian.com>
7339
7340         * attribute.cs: Added methods to get a string and a bool from an
7341         attribute. Required to information from AssemblyKeyFileAttribute,
7342         AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
7343         * codegen.cs: Modified AssemblyName creation to include support for
7344         strongnames. Catch additional exceptions to report them as CS1548.
7345         * compiler.csproj: Updated include CryptoConvert.cs.
7346         * compiler.csproj.user: Removed file - user specific configuration.
7347         * CryptoConvert.cs: New. A COPY of the class CryptoConvert from 
7348         Mono.Security assembly. The original class is maintained and tested in
7349         /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
7350         * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
7351         like CSC 8.0 (C# v2) supports.
7352         * Makefile: Added CryptoConvert.cs to mcs sources.
7353         * rootcontext.cs: Added new options for strongnames.
7354
7355 2004-03-24 Ben Maurer  <bmaurer@users.sourceforge.net>
7356
7357         * driver.cs: For --expect-error, report error code `2'
7358         if the program compiled with no errors, error code `1' if
7359         it compiled with an error other than the one expected.
7360
7361 2004-03-24  Sebastien Pouliot  <sebastien@ximian.com>
7362
7363         * compiler.csproj: Updated for Visual Studio .NET 2003.
7364         * compiler.csproj.user: Updated for Visual Studio .NET 2003.
7365         * compiler.sln: Updated for Visual Studio .NET 2003.
7366
7367 2004-03-24  Ravi Pratap M  <ravi@ximian.com>
7368
7369         * expression.cs: Fix bug #47234. We basically need to apply the
7370         rule that we prefer the conversion of null to a reference type
7371         when faced with a conversion to 'object' (csc behaviour).
7372
7373 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
7374
7375         * statement.cs: Shorter form for foreach, eliminates
7376         a local variable. r=Martin.
7377
7378 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
7379
7380         * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
7381         checks if we can use brtrue/brfalse to test for 0.
7382         * expression.cs: use the above in the test for using brtrue/brfalse.
7383         cleanup code a bit.
7384
7385 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
7386
7387         * expression.cs: Rewrite string concat stuff. Benefits:
7388
7389         - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
7390         - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
7391         rather than a concat chain.
7392
7393         * typemanager.cs: Add lookups for more concat overloads.
7394
7395 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
7396
7397         * expression.cs: Emit shorter il code for array init.
7398
7399         newarr
7400         dup
7401         // set 1
7402
7403         // set 2
7404
7405         newarr
7406         stloc.x
7407
7408         ldloc.x
7409         // set 1
7410
7411         ldloc.x
7412         // set 2
7413
7414 2004-03-22 Ben Maurer  <bmaurer@users.sourceforge.net>
7415
7416         * statement.cs: Before, two switch blocks would be merged if the
7417         total size of the blocks (end_item - begin_item + 1) was less than
7418         two times the combined sizes of the blocks.
7419
7420         Now, it will only merge if after the merge at least half of the
7421         slots are filled.
7422
7423         fixes 55885.
7424
7425 2004-03-20  Atsushi Enomoto  <atsushi@ximian.com>
7426
7427         * class.cs : csc build fix for GetMethods(). See bug #52503.
7428
7429 2004-03-20 Ben Maurer  <bmaurer@users.sourceforge.net>
7430
7431         * expression.cs: Make sure fp comparisons work with NaN.
7432         This fixes bug #54303. Mig approved this patch a long
7433         time ago, but we were not able to test b/c the runtime
7434         had a related bug.
7435
7436 2004-03-19  Miguel de Icaza  <miguel@ximian.com>
7437
7438         * ecore.cs (TypExpr.GetHashCode): implement this overload. 
7439
7440 2004-03-19  Martin Baulig  <martin@ximian.com>
7441
7442         * class.cs (MemberCore.IsDuplicateImplementation): Check whether
7443         two overloads may unify for some type parameter substitutions and
7444         report a CS0408 if appropriate.
7445
7446 2004-03-19  Martin Baulig  <martin@ximian.com>
7447
7448         * class.cs (MemberCore.IsDuplicateImplementation): Report the
7449         error here and not in our caller.
7450
7451 2004-03-19  Martin Baulig  <martin@ximian.com>
7452
7453         * interface.cs: Completely killed this file.
7454         (Interface): We're now a TypeContainer and live in class.cs.
7455
7456         * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
7457         argument; we're now also called for interfaces.
7458         (TypeContainer.DefineMembers): Allow this method being called
7459         multiple times.
7460         (TypeContainer.GetMethods): New public method; formerly known as
7461         Interface.GetMethod().  This is used by PendingImplementation.
7462         (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
7463         it's now private and non-static.
7464         (Interface): Moved this here; it's now implemented similar to
7465         Class and Struct.
7466         (Method, Property, Event, Indexer): Added `bool is_interface'
7467         argument to their .ctor's.
7468         (MemberBase.IsInterface): New public field.
7469
7470         * cs-parser.jay: Create normal Method, Property, Event, Indexer
7471         instances instead of InterfaceMethod, InterfaceProperty, etc.
7472         (opt_interface_base): Removed; we now use `opt_class_base' instead.
7473         (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
7474
7475 2004-03-19  Martin Baulig  <martin@ximian.com>
7476
7477         * class.cs (MethodCore.IsDuplicateImplementation): New private
7478         method which does the CS0111 checking.
7479         (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
7480         Use IsDuplicateImplementation().
7481
7482 2004-03-17 Ben Maurer  <bmaurer@users.sourceforge.net>
7483
7484         * decl.cs (FindMemberToOverride): New method to find the correct
7485         method or property to override in the base class.
7486         * class.cs
7487             - Make Method/Property use the above method to find the
7488               version in the base class.
7489             - Remove the InheritableMemberSignatureCompare as it is now
7490               dead code.
7491
7492         This patch makes large code bases much faster to compile, as it is
7493         O(n) rather than O(n^2) to do this validation.
7494
7495         Also, it fixes bug 52458 which is that nested classes are not
7496         taken into account when finding the base class member.
7497
7498         Reviewed/Approved by Martin.
7499
7500 2004-03-17  Martin Baulig  <martin@ximian.com>
7501
7502         * expression.cs (MemberAccess.DoResolve): Take the parent's number
7503         of type arguments into account; use the `real_num_type_args'
7504         approach like in DoResolveAsTypeStep().
7505
7506         * generic.cs (GenericMemberAccess.DoResolve): Make this work for
7507         nested types.
7508
7509 2004-03-17  Marek Safar  <marek.safar@seznam.cz>
7510
7511         * interface.cs: In all interface classes removed redundant
7512         member initialization.
7513
7514 2004-03-16  Martin Baulig  <martin@ximian.com>
7515
7516         * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
7517
7518 2004-03-15  Miguel de Icaza  <miguel@ximian.com>
7519
7520         * decl.cs (DefineTypeAndParents): New helper method to define a
7521         type's containers before the type itself is defined;  This is a
7522         bug exposed by the recent changes to Windows.Forms when an
7523         implemented interface was defined inside a class that had not been
7524         built yet.   
7525
7526         * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
7527
7528         (Check): Loop correctly to report errors modifiers
7529         (UNSAFE was not in the loop, since it was the same as TOP).
7530
7531         * interface.cs: Every interface member now takes a ModFlags,
7532         instead of a "is_new" bool, which we set on the base MemberCore. 
7533
7534         Every place where we called "UnsafeOk" in the interface, now we
7535         call the proper member (InterfaceMethod.UnsafeOK) instead to get
7536         the unsafe settings from the member declaration instead of the
7537         container interface. 
7538
7539         * cs-parser.jay (opt_new): Allow unsafe here per the spec. 
7540
7541         * pending.cs (TypeAndMethods): Add `get_indexer_name' and
7542         `set_indexer_name' to the pending bits (one per type).
7543
7544         We fixed a bug today that was picking the wrong method to
7545         override, since for properties the existing InterfaceMethod code
7546         basically ignored the method name.  Now we make sure that the
7547         method name is one of the valid indexer names.
7548
7549 2004-03-14  Gustavo Giráldez  <gustavo.giraldez@gmx.net>
7550  
7551         * support.cs (SeekableStreamReader): Keep track of stream byte
7552         positions and don't mix them with character offsets to the buffer.
7553
7554         Patch from Gustavo Giráldez
7555
7556 2004-03-15  Marek Safar  <marek.safar@seznam.cz>
7557
7558         * interface.cs (InterfaceSetGetBase): Removed double member
7559         initialization, base class does it as well.
7560
7561 2004-03-13  Martin Baulig  <martin@ximian.com>
7562
7563         * class.cs: Reverted Miguel's latest commit; it makes mcs crash
7564         when compiling corlib.
7565
7566 2004-03-13  Miguel de Icaza  <miguel@ximian.com>
7567
7568         * convert.cs (ExplicitConversion): We were reporting an error on
7569         certain conversions (object_type source to a value type, when the
7570         expression was `null') before we had a chance to pass it through
7571         the user defined conversions.
7572
7573         * driver.cs: Replace / and \ in resource specifications to dots.
7574         Fixes 50752
7575
7576         * class.cs: Add check for duplicate operators.  Fixes 52477
7577
7578 2004-03-11  Miguel de Icaza  <miguel@ximian.com>
7579
7580         * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
7581         that are in the middle of the statements, not only at the end.
7582         Fixes #54987
7583
7584         * class.cs (TypeContainer.AddField): No longer set the
7585         `HaveStaticConstructor' flag, now we call it
7586         `UserDefineStaticConstructor' to diferentiate the slightly
7587         semantic difference.
7588
7589         The situation is that we were not adding BeforeFieldInit (from
7590         Modifiers.TypeAttr) to classes that could have it.
7591         BeforeFieldInit should be set to classes that have no static
7592         constructor. 
7593
7594         See:
7595
7596         http://www.yoda.arachsys.com/csharp/beforefieldinit.html
7597
7598         And most importantly Zoltan's comment:
7599
7600         http://bugzilla.ximian.com/show_bug.cgi?id=44229
7601
7602         "I think beforefieldinit means 'it's ok to initialize the type sometime 
7603          before its static fields are used', i.e. initialization does not need
7604          to be triggered by the first access to the type. Setting this flag
7605          helps the JIT to compile better code, since it can run the static
7606          constructor at JIT time, and does not need to generate code to call it
7607          (possibly lots of times) at runtime. Unfortunately, mcs does not set
7608          this flag for lots of classes like String. 
7609          
7610          csc sets this flag if the type does not have an explicit static 
7611          constructor. The reasoning seems to be that if there are only static
7612          initalizers for a type, and no static constructor, then the programmer
7613          does not care when this initialization happens, so beforefieldinit
7614          can be used.
7615          
7616          This bug prevents the AOT compiler from being usable, since it 
7617          generates so many calls to mono_runtime_class_init that the AOT code
7618          is much slower than the JITted code. The JITted code is faster, 
7619          because it does not generate these calls if the vtable is type is
7620          already initialized, which is true in the majority of cases. But the
7621          AOT compiler can't do this."
7622
7623 2004-03-10  Miguel de Icaza  <miguel@ximian.com>
7624
7625         * class.cs (MethodData.Emit): Refactor the code so symbolic
7626         information is generated for destructors;  For some reasons we
7627         were taking a code path that did not generate symbolic information
7628         before. 
7629
7630 2004-03-11 Ben Maurer  <bmaurer@users.sourceforge.net>
7631
7632         * class.cs: Create a Constructor.CheckBase method that
7633         takes care of all validation type code. The method
7634         contains some code that was moved from Define.
7635
7636         It also includes new code that checks for duplicate ctors.
7637         This fixes bug #55148.
7638
7639 2004-03-09  Joshua Tauberer <tauberer@for.net>
7640
7641         * expression.cs (ArrayCreation): Fix: More than 6 nulls in
7642         a { ... }-style array creation invokes EmitStaticInitializers
7643         which is not good for reference-type arrays.  String, decimal
7644         and now null constants (NullCast) are not counted toward
7645         static initializers.
7646
7647 2004-03-05  Martin Baulig  <martin@ximian.com>
7648
7649         * location.cs (SourceFile.HasLineDirective): New public field;
7650         specifies whether the file contains or is referenced by a "#line"
7651         directive.
7652         (Location.DefineSymbolDocuments): Ignore source files which
7653         either contain or are referenced by a "#line" directive.        
7654
7655 2004-02-29  Ben Maurer <bmaurer@users.sourceforge.net>
7656
7657         * class.cs (Method.CheckBase): Avoid using FindMembers, we have
7658         direct access to our parent, so check the method inline there.
7659
7660 2004-02-27 Ben Maurer  <bmaurer@users.sourceforge.net>
7661
7662         * expression.cs (Invocation.EmitCall): Miguel's last commit
7663         caused a regression. If you had:
7664
7665             T t = null;
7666             t.Foo ();
7667
7668         In Foo the implict this would be null.
7669
7670 2004-02-27  Miguel de Icaza  <miguel@ximian.com>
7671
7672         * expression.cs (Invocation.EmitCall): If the method is not
7673         virtual, do not emit a CallVirt to it, use Call.
7674
7675         * typemanager.cs (GetFullNameSignature): Improve the method to
7676         cope with ".ctor" and replace it with the type name.
7677
7678         * class.cs (ConstructorInitializer.Resolve): Now the method takes
7679         as an argument the ConstructorBuilder where it is being defined,
7680         to catch the recursive constructor invocations.
7681
7682 2004-03-16  Martin Baulig  <martin@ximian.com>
7683
7684         * expression.cs (MemberAccess.DoResolve): If `expr' resolved to a
7685         ConstructedType, call ResolveType() on it to get the type rather
7686         than just using `expr.Type'.
7687
7688 2004-03-16  Martin Baulig  <martin@ximian.com>
7689
7690         * generics.cs (ConstructedType.GetMemberAccess): Take the
7691         EmitContext instead on the TypeExpr and use
7692         ec.TypeContainer.CurrentType/ec.ContainerType.
7693
7694 2004-03-16  Martin Baulig  <martin@ximian.com>
7695
7696         * ecore.cs (SimpleName.DoResolveAsTypeStep): Lookup type
7697         parameters before aliases.
7698
7699 2004-03-16  Martin Baulig  <martin@ximian.com>
7700
7701         * typemanager.cs (TypeManager.MayBecomeEqualGenericInstances):
7702         New oublic function; checks whether two generic instances may become
7703         equal under some instantiations (26.3.1).
7704
7705         * class.cs (TypeContainer.Define): Call
7706         TypeManager.MayBecomeEqualGenericInstances() and report CS0695 on
7707         error.
7708
7709 2004-03-16  Martin Baulig  <martin@ximian.com>
7710
7711         * class.cs (TypeContainer.GetClassBases): Moved
7712         Error_TypeParameterAsBase() here and also check whether the base
7713         class is not an attribute.
7714
7715 2004-03-16  Martin Baulig  <martin@ximian.com>
7716
7717         * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
7718
7719 2004-03-16  Martin Baulig  <martin@ximian.com>
7720
7721         * class.cs (Error_TypeParameterAsBase): Use correct error number
7722         here (CS0689).  
7723
7724 2004-03-16  Martin Baulig  <martin@ximian.com>
7725
7726         * decl.cs (DeclSpace.ResolveTypeExpr): Added more error checking
7727         for generics.
7728
7729         * generics.cs (ConstructedType.DoResolveAsTypeStep): Added better
7730         error reporting.
7731
7732 2004-03-15  Martin Baulig  <martin@ximian.com>
7733
7734         * typemanager.cs (TypeManager.GetFullName): New public method.
7735         (TypeManager.MemberLookup): Added `int_num_type_arguments'
7736         argument; only return members with the correct number of type
7737         arguments.
7738         (TypeManager.CheckGeneric): Allow -1 to bypass the check.
7739         (TypeManager.FilterWithClosure): Call CheckGeneric() to check
7740         whether the number of type arguments matches.
7741
7742         * generic.cs (GenericMemberAccess.ResolveAsTypeStep): Allow `expr'
7743         not being a ConstructedType; we can now do "typeof (Foo.Bar<U>)".
7744
7745         * expression.cs (MemberAccess): Added public `NumTypeArguments'
7746         field; it's set by the protected .ctor when we're actually a
7747         GenericMemberAccess.
7748         (MemberAccess.ResolveAsTypeStep): Compute the total number of type
7749         arguments and pass it to MemberLookupFinal ().
7750
7751         * ecore.cs (Expression.MemberLookup): Added `int
7752         num_type_arguments' argument; only return members with the correct
7753         number of type arguments.
7754         (Expression.MemberLookupFailed): Check whether the MemberLookup
7755         failed because we did not have the correct number of type
7756         arguments; report CS0305 in this case.
7757
7758         * decl.cs (DeclSpace.ResolveTypeExpr): Don't report an error if
7759         `e.ResolveAsTypeTerminal()' already did so.
7760
7761 2004-03-15  Martin Baulig  <martin@ximian.com>
7762
7763         * ecore.cs (Expression.ResolveLValue): Allow e.type being null if
7764         we're a ConstructedType; in this case, the caller must report an
7765         error (for instance CS0131).
7766
7767         * generic.cs (TypeArguments): Added Location argument to the .ctor.
7768         (TypeArguments.Resolve): Actually report errors here.
7769
7770 2004-03-15  Miguel de Icaza  <miguel@ximian.com>
7771
7772         * pending.cs (TypeAndMethods): Add `get_indexer_name' and
7773         `set_indexer_name' to the pending bits (one per type).
7774
7775         We fixed a bug today that was picking the wrong method to
7776         override, since for properties the existing InterfaceMethod code
7777         basically ignored the method name.  Now we make sure that the
7778         method name is one of the valid indexer names.
7779
7780 2004-03-15  Martin Baulig  <martin@ximian.com>
7781
7782         * typemanager.cs (TypeManager.IndexerPropertyName): Added support
7783         for generic instances.
7784
7785 2004-03-13  Martin Baulig  <martin@ximian.com>
7786
7787         * class.cs (TypeContainer.DefineType): Call
7788         TypeManager.AddUserType() immediately after creating the
7789         TypeBuilder; pass all type parameters when creating the
7790         CurrentType.
7791
7792         * decl.cs (DeclSpace.FindNestedType): New public method.
7793         (DeclSpace.FindType): Added `int num_type_args' argument; only
7794         return types with the correct number of type parameters.
7795         (DeclSpace.CountTypeParams): New public property.
7796
7797         * ecore.cs (SimpleName.ctor): Added overloaded version which takes
7798         the number of type parameters; defaults to zero.
7799
7800         * generic.cs (TypeArguments.Count): New public property.
7801         (ConstructedType.DoResolveAsTypeStep): First call
7802         ds.FindNestedType() to find out whether we're nested in the
7803         current generic type; in this case, we inherit all type parameters
7804         from the current class.
7805
7806         * rootcontext.cs (RootContext.NamespaceLookup): Added `int
7807         num_type_args' argument.
7808         (RootContext.LookupType): Added overloaded version which takes the
7809         number of type arguments; only return types with the correct
7810         number of type arguments.
7811
7812         * typemanager.cs (TypeManager.CheckGeneric): New public function;
7813         checks whether `Type t' has `int num_type_args'.
7814
7815 2004-03-13  Martin Baulig  <martin@ximian.com>
7816
7817         * generic.cs (GenericMethod.DefineType): New method; calls
7818         DefineType() on all the type parameters.
7819
7820         * class.cs (MethodData.ctor): Added `GenericMethod generic' argument.
7821         (MethodData.Define): If we're a generic method, call
7822         GenericMethod.DefineType() to define the type parameters.       
7823
7824 2004-03-10  Martin Baulig  <martin@ximian.com>
7825
7826         * pending.cs (Pending.InterfaceMethod): Use TypeManager.IsEqual()
7827         instead of IsAssignableFrom.    
7828
7829 2004-03-10  Martin Baulig  <martin@ximian.com>
7830
7831         * ecore.cs (FieldExpr.ctor): Use TypeManager.TypeToCoreType().
7832
7833         * support.cs (ParameterData.HasArrayParameter): New property.
7834         (ReflectionParameters.ctor): Take a MethodBase instead of a
7835         ParameterInfo[].  If we have any type parameters, get the generic
7836         method definition and ask it whether we have variable arguments.
7837
7838 2004-02-26  Miguel de Icaza  <miguel@ximian.com>
7839
7840         * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
7841         routines to check if a type is an enumerable/enumerator allow
7842         classes that implement the IEnumerable or IEnumerator interfaces.
7843
7844         * class.cs (Property, Operator): Implement IIteratorContainer, and
7845         implement SetYields.
7846
7847         (Property.Define): Do the block swapping for get_methods in the
7848         context of iterators.   We need to check if Properties also
7849         include indexers or not.
7850
7851         (Operator): Assign the Block before invoking the
7852         OperatorMethod.Define, so we can trigger the Iterator code
7853         replacement. 
7854
7855         * cs-parser.jay (SimpleIteratorContainer): new helper class.  Both
7856         Property and Operator classes are not created when we parse the
7857         declarator but until we have the block completed, so we use a
7858         singleton SimpleIteratorContainer.Simple to flag whether the
7859         SetYields has been invoked.
7860
7861         We propagate this setting then to the Property or the Operator to
7862         allow the `yield' to function.
7863
7864 2004-02-25  Marek Safar  <marek.safar@seznam.cz>
7865
7866         * codegen.cs: Implemented attribute support for modules.
7867         New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
7868         Assembly/Module functionality.
7869
7870         * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
7871         interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
7872         Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
7873
7874 2004-02-16  Marek Safar  <marek.safar@seznam.cz>
7875
7876         * interface.cs (FindMembers): The operation is performed on all base
7877         interfaces and not only on the first. It is required for future CLS Compliance patch.
7878
7879 2004-02-12 Ben Maurer  <bmaurer@users.sourceforge.net>
7880
7881         * statement.cs, codegen.cs:
7882         This patch deals with patterns such as:
7883
7884         public class List : IEnumerable {
7885
7886                 public MyEnumerator GetEnumerator () {
7887                         return new MyEnumerator(this);
7888                 }
7889
7890                 IEnumerator IEnumerable.GetEnumerator () {
7891                         ...
7892                 }
7893                 
7894                 public struct MyEnumerator : IEnumerator {
7895                         ...
7896                 }
7897         }
7898
7899         Before, there were a few things we did wrong:
7900         1) we would emit callvirt on a struct, which is illegal
7901         2) we emited ldarg when we needed to emit ldarga
7902         3) we would mistakenly call the interface methods on an enumerator
7903         type that derived from IEnumerator and was in another assembly. For example:
7904
7905         public class MyEnumerator : IEnumerator
7906
7907         Would have the interface methods called, even if there were public impls of the
7908         method. In a struct, this lead to invalid IL code.
7909
7910 2004-02-11  Marek Safar  <marek.safar@seznam.cz>
7911
7912         * const.cs: Const is now derived from FieldBase. Method EmitConstant name
7913           renamed to Emit.
7914
7915         * delegate.cs (Define): Fixed crash when delegate type is undefined.
7916
7917 2004-02-11  Miguel de Icaza  <miguel@ximian.com>
7918
7919         * cs-parser.jay: Fix small regression: we were not testing V2
7920         compiler features correctly.
7921
7922         * interface.cs: If the emit context is null, then create one
7923
7924 2004-02-09  Marek Safar  <marek.safar@seznam.cz>
7925
7926         * decl.cs (GetSignatureForError): New virtual method to get full name
7927           for error messages.
7928
7929         * attribute.cs (IAttributeSupport): New interface for attribute setting.
7930           Now it is possible to rewrite ApplyAttributes method to be less if/else.
7931
7932         * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
7933           Duplicated members and code in these classes has been removed.
7934           Better encapsulation in these classes.
7935
7936 2004-02-07  Miguel de Icaza  <miguel@ximian.com>
7937
7938         * assign.cs (Assign.DoResolve): When dealing with compound
7939         assignments, there is a new rule in ECMA C# 2.4 (might have been
7940         there before, but it is documented here) that states that in:
7941
7942         a op= b;
7943
7944         If b is of type int, and the `op' is a shift-operator, then the
7945         above is evaluated as:
7946
7947         a = (int) a op b 
7948
7949         * expression.cs (Binary.ResolveOperator): Instead of testing for
7950         int/uint/long/ulong, try to implicitly convert to any of those
7951         types and use that in pointer arithmetic.
7952
7953         * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
7954         method to print information for from the type, not from the
7955         null-method we were given.
7956
7957 2004-02-01  Duncan Mak  <duncan@ximian.com>
7958
7959         * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
7960         parsing for cmd, fixes bug #53694.
7961
7962 2004-02-04  Marek Safar  <marek.safar@seznam.cz>
7963
7964         * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
7965         in the member name duplication tests. Property and operator name duplication
7966         was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
7967
7968 2004-02-03  Marek Safar  <marek.safar@seznam.cz>
7969
7970         * interface.cs (PopulateMethod): Fixed crash when interface method
7971         returns not existing type (error test cs0246-3.cs).
7972
7973 2004-02-02  Ravi Pratap M <ravi@ximian.com>
7974
7975         * cs-parser.jay (interface_accessors): Re-write actions to also
7976         store attributes attached to get and set methods. Fix spelling
7977         while at it.
7978
7979         (inteface_property_declaration): Modify accordingly.
7980
7981         (InterfaceAccessorInfo): New helper class to store information to pass
7982         around between rules that use interface_accessors.
7983
7984         * interface.cs (Emit): Apply attributes on the get and set
7985         accessors of properties and indexers too.
7986
7987         * attribute.cs (ApplyAttributes): Modify accordingly to use the
7988         right MethodBuilder when applying attributes to the get and set accessors.
7989
7990 2004-01-31  Miguel de Icaza  <miguel@ximian.com>
7991
7992         * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
7993
7994 2004-01-26  Miguel de Icaza  <miguel@ximian.com>
7995
7996         * cs-tokenizer.cs: Handle #line hidden from PDC bits.
7997
7998 2004-01-25  Miguel de Icaza  <miguel@ximian.com>
7999
8000         * cs-parser.jay: Remove YIELD token, instead use the new grammar
8001         changes that treat `yield' specially when present before `break'
8002         or `return' tokens.
8003
8004         * cs-tokenizer.cs: yield is no longer a keyword.
8005
8006 2004-01-23  Marek Safar  <marek.safar@seznam.cz>
8007
8008         * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
8009         setting for default constructors.
8010         For default constructors are almost every time set wrong Modifier. The
8011         generated IL code has been alright. But inside mcs this values was
8012         wrong and this was reason why several of my CLS Compliance tests
8013         failed.
8014
8015 2004-02-27  Martin Baulig  <martin@ximian.com>
8016
8017         * generics.cs (ConstructedType.ResolveType): Make the nested type
8018         stuff actually work.
8019
8020 2004-02-25  Martin Baulig  <martin@ximian.com>
8021
8022         * decl.cs (DeclSpace.CurrentTypeParameters): New protected
8023         property; returns the type parameters just from the current type,
8024         ie. with the ones from outer classes.
8025         (DeclSpace.LookupGeneric): First search in the current class, then
8026         in outer classes.
8027         (DeclSpace.initialize_type_params): When hiding a type parameter
8028         from an outer class, put it into the `type_param_list' anyways.
8029
8030         * expression.cs (MemberAccess.expr): Made this field protected.
8031
8032         * class.cs (TypeContainer.Define): The `CurrentType' just contains
8033         the type parameters from the current class.
8034
8035         * generic.cs (ConstructedType.ResolveType): Support nested generic
8036         types by taking the type parameters which we inherit from outer
8037         classes into account.
8038         (GenericMemberAccess.ResolveAsTypeStep): Override this and added
8039         support for nested generic types.
8040
8041 2004-02-23  Martin Baulig  <martin@ximian.com>
8042
8043         * decl.cs (DeclSpace.IsGeneric): Make this a property instead of a
8044         field and check whether we're nested inside a generic type.
8045         (DeclSpace.ResolveType): If we're resolving to a generic type
8046         definition, create a ConstructedType and return its resolved type.
8047         (DeclSpace.initialize_type_params): New private method;
8048         initializes the `type_param_list' field from the type parameters
8049         from this and all enclosing classes.
8050         (DeclSpace.TypeParameters): Call initialize_type_params() unless
8051         we're already initialized.
8052
8053 2004-02-23  Martin Baulig  <martin@ximian.com>
8054
8055         * class.cs (Method.Define): Create the generic method before
8056         calling DoDefine().
8057         (Memberbase.DoDefine): Added DeclSpace argument (in addition to
8058         the TypeContainer one); we use this for generic methods.
8059
8060         * decl.cs (CheckAccessLevel): If we're a GenericMethod, use our
8061         parent's TypeBuilder.
8062
8063 2004-02-18  Martin Baulig  <martin@ximian.com>
8064
8065         * ecore.cs (FieldExpr.DoResolveLValue): Use TypeManager.IsEqual()
8066         to check for equality.
8067
8068 2004-02-05  Martin Baulig  <martin@ximian.com>
8069
8070         * ecore.cs (FieldExpr.DoResolveLValue): If we have an
8071         `ec.TypeContainer.CurrentType', use it instead of
8072         `ec.ContainerType' to check whether we're in the type's ctor.
8073
8074 2004-01-29  Martin Baulig  <martin@ximian.com>
8075
8076         * expression.cs (Invocation.DoResolve): If we're a
8077         `ConstructedType', then we're actually a generic method, so
8078         rewrite the expr as a GenericMemberAccess.
8079
8080         * cs-parser.jay (member_name): Don't use `namespace_or_type_name'
8081         here; manually parse it into a string.
8082
8083 2004-01-28  Martin Baulig  <martin@ximian.com>
8084
8085         * typemanager.cs (TypeManager.IsEqual): New static method.
8086         (TypeManager.FilterWithClosure): Call TypeManager.IsEqual() to
8087         check for equality instead of using `=='.
8088
8089 2004-01-26  Martin Baulig  <martin@ximian.com>
8090
8091         * decl.cs (DeclSpace.CurrentType): New public field.
8092
8093         * expression.cs (This.ResolveBase): If we have an
8094         `ec.TypeContainer.CurrentType', use it instead of
8095         `ec.ContainerType'.
8096
8097         * class.cs (TypeContainer.DefineType): If we're a generic type,
8098         create the `CurrentType' (unresolved).
8099         (TypeContainer.GenericType): New private field.
8100         (TypeContainer.DefineMembers): If we have a `CurrentType', resolve
8101         it and store it in `GenericType' before creating the MemberCache.
8102         (TypeContainer.GetMembers): If we have a `GenericType', call
8103         TypeManager.FindMembers() on it.
8104
8105         * interface.cs (Interface.GenericType): New private field.
8106         (Interface.DefineType): If we're a generic type, create the
8107         `CurrentType' (unresolved).
8108         (Interface.DefineMembers): If we have a `CurrentType', resolve it
8109         and store it in `GenericType' before creating the MemberCache.
8110         (Interface.GetMembers): If we have a `GenericType', call
8111         TypeManager.FindMembers() on it.
8112
8113 2004-01-22  Martin Baulig  <martin@ximian.com>
8114
8115         * cs-parser.jay (namespace_or_type_name): Return an Expression,
8116         not a QualifiedIdentifier.  This is what `type_name_expression'
8117         was previously doing.
8118         (type_name_expression): Removed; the code is now in
8119         `namespace_or_type_name'.
8120         (qualified_identifier): Removed, use `namespace_or_type_name'
8121         instead.
8122         (QualifiedIdentifier): Removed this class.      
8123
8124 2004-01-22  Martin Baulig  <martin@ximian.com>
8125
8126         * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
8127         not a string as alias name.
8128
8129 2004-01-21  Miguel de Icaza  <miguel@ximian.com>
8130
8131         * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
8132         #52730 bug, and instead compute correctly the need to use a
8133         temporary variable when requesting an address based on the
8134         static/instace modified of the field and the constructor.
8135  
8136 2004-01-21  Martin Baulig  <martin@ximian.com>
8137
8138         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
8139         class and namespace before looking up aliases.  Fixes #52517.
8140
8141 2004-01-21  Martin Baulig  <martin@ximian.com>
8142
8143         * flowanalysis.cs (UsageVector.Merge): Allow variables being
8144         assinged in a 'try'; fixes exception4.cs.
8145
8146 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
8147         * class.cs : Implemented parameter-less constructor for TypeContainer
8148
8149         * decl.cs: Attributes are now stored here. New property OptAttributes
8150
8151         * delegate.cs, enum.cs, interface.cs: Removed attribute member.
8152
8153         * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
8154
8155 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
8156
8157         * typemanager.cs (CSharpSignature): Now reports also inner class name.
8158           (CSharpSignature): New method for indexer and property signature.
8159
8160 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
8161
8162         * pending.cs (IsVirtualFilter): Faster implementation.
8163
8164 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
8165
8166         * typemanager.cs: Avoid inclusion of same assembly more than once.
8167
8168 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
8169
8170         * cs-parser.jay: Fixed problem where the last assembly attribute
8171           has been applied also to following declaration (class, struct, etc.)
8172           
8173 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
8174
8175         * class.cs: Added error CS0538, CS0539 reporting.
8176         Fixed crash on Microsoft runtime when field type is void.
8177
8178         * cs-parser.jay: Added error CS0537 reporting.
8179
8180         * pending.cs: Added error CS0535 reporting.
8181         Improved error report for errors CS0536, CS0534.
8182
8183 2004-01-20  Miguel de Icaza  <miguel@ximian.com>
8184
8185         Merge a few bits from the Anonymous Method MCS tree.
8186
8187         * statement.cs (ToplevelBlock): New class for toplevel methods,
8188         will hold anonymous methods, lifted variables.
8189
8190         * cs-parser.jay: Create toplevel blocks for delegates and for
8191         regular blocks of code. 
8192
8193 2004-01-20  Martin Baulig  <martin@ximian.com>
8194
8195         * codegen.cs (EmitContext): Removed `InTry', `InCatch',
8196         `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
8197         and `NeedExplicitReturn'; added `IsLastStatement'.
8198         (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
8199         have a `ReturnLabel' or we're not unreachable.
8200
8201         * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
8202         child's reachability; don't just override ours with it.  Fixes
8203         #58058 (lluis's example).
8204         (FlowBranching): Added public InTryOrCatch(), InCatch(),
8205         InFinally(), InLoop(), InSwitch() and
8206         BreakCrossesTryCatchBoundary() methods.
8207
8208         * statement.cs (Return): Do all error checking in Resolve().
8209         Unless we are the last statement in a top-level block, always
8210         create a return label and jump to it.
8211         (Break, Continue): Do all error checking in Resolve(); also make
8212         sure we aren't leaving a `finally'.
8213         (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
8214         statement in a top-level block.
8215         (Block.Flags): Added `IsDestructor'.
8216         (Block.IsDestructor): New public property.
8217
8218 2004-01-20  Martin Baulig  <martin@ximian.com>
8219
8220         * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
8221
8222 2004-01-20  Martin Baulig  <martin@ximian.com>
8223
8224         * statement.cs (Statement.ResolveUnreachable): New public method.
8225         (If, While): Do the dead-code elimination in Resolve(), not in Emit().
8226         (Block.Resolve): Resolve unreachable statements.
8227
8228 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
8229
8230         * expression.cs: We need to fix the case where we do
8231         not have a temp variable here.
8232
8233         * assign.cs: Only expression compound assignments need
8234         temporary variables.
8235
8236 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
8237
8238         * flowanalysis.cs: Reduce memory allocation in a few ways:
8239           - A block with no variables should not allocate a bit
8240             vector for itself.
8241           - A method with no out parameters does not need any tracking
8242             for assignment of the parameters, so we need not allocate
8243             any data for it.
8244           - The arrays:
8245                 public readonly Type[] VariableTypes;
8246                 public readonly string[] VariableNames;
8247             Are redundant. The data is already stored in the variable
8248             map, so we need not allocate another array for it.
8249           - We need to add alot of checks for if (params | locals) == null
8250             due to the first two changes.
8251
8252 2004-01-18  Miguel de Icaza  <miguel@ximian.com>
8253
8254         * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
8255         implement IMemoryLocation, we store a copy on a local variable and
8256         take the address of it.  Patch from Benjamin Jemlich
8257
8258         * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
8259         to use a special "type_name_expression" rule which reduces the
8260         number of "QualifiedIdentifier" classes created, and instead
8261         directly creates MemberAccess expressions.
8262
8263 2004-01-17  Miguel de Icaza  <miguel@ximian.com>
8264
8265         * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
8266         that fixes #52853.  Null literal assignment to ValueType
8267
8268         * class.cs (MethodData.Emit): Instead of checking the name of the
8269         method to determine if its a destructor, create a new derived
8270         class from Method called Destructor, and test for that.  
8271
8272         * cs-parser.jay: Create a Destructor object instead of a Method.  
8273
8274         Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
8275
8276         Fixes: 52933
8277
8278 2004-01-16  Miguel de Icaza  <miguel@ximian.com>
8279
8280         * expression.cs (Binary.ResolveOperator): Perform an implicit
8281         conversion from MethodGroups to their delegate types on the
8282         Addition operation.
8283
8284         * delegate.cs: Introduce a new class DelegateCreation that is the
8285         base class for `NewDelegate' and `ImplicitDelegateCreation',
8286         factor some code in here.
8287
8288         * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
8289         conversion from MethodGroups to compatible delegate types. 
8290
8291         * ecore.cs (Expression.Resolve): Do not flag error 654
8292         (Methodgroupd needs parenthesis) if running on the V2 compiler, as
8293         we allow conversions from MethodGroups to delegate types now.
8294
8295         * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
8296         assignments in v2 either.
8297
8298 2004-01-10  Miguel de Icaza  <miguel@ximian.com>
8299
8300         * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
8301         static read-only fields in ctors.
8302
8303         Applied patch from Benjamin Jemlich 
8304
8305         * expression.cs (UnaryMutator): Avoid leaking local variables. 
8306
8307 2004-01-09  Miguel de Icaza  <miguel@ximian.com>
8308
8309         * cs-tokenizer.cs (IsCastToken): Allow the various native types
8310         here to return true, as they can be used like this:
8311
8312                 (XXX) int.MEMBER ()
8313
8314         Fixed 49836 and all the other dups
8315
8316 2004-01-09  Zoltan Varga  <vargaz@freemail.hu>
8317
8318         * driver.cs: Implement /win32res and /win32icon.
8319
8320 2004-01-08  Miguel de Icaza  <miguel@ximian.com>
8321
8322         * cs-parser.jay: Add a rule to improve error handling for the
8323         common mistake of placing modifiers after the type.
8324
8325 2004-01-07  Miguel de Icaza  <miguel@ximian.com>
8326
8327         * cs-parser.jay (interface_event_declaration): Catch
8328         initialization of events on interfaces, and report cs0068
8329
8330         * cs-parser.jay (interface_event_declaration): Catch
8331         initialization of events. 
8332
8333         * ecore.cs: Better report missing constructors.
8334
8335         * expression.cs (Binary.ResolveOperator): My previous bug fix had
8336         the error reporting done in the wrong place.  Fix.
8337
8338         * expression.cs (Binary.ResolveOperator): Catch the 
8339         operator + (E x, E y) error earlier, and later allow for implicit
8340         conversions in operator +/- (E e, U x) from U to the underlying
8341         type of E.
8342
8343         * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
8344         52596, if the container class is abstract, the default constructor
8345         is protected otherwise its public (before, we were always public).
8346
8347         * statement.cs (Fixed.Resolve): Catch a couple more errors in the
8348         fixed statement.
8349
8350         (Using.EmitLocalVariableDecls): Applied patch from Benjamin
8351         Jemlich that fixes bug #52597, MCS was generating invalid code for
8352         idisposable structs.   Thanks to Ben for following up with this
8353         bug as well.
8354
8355 2004-01-06  Miguel de Icaza  <miguel@ximian.com>
8356
8357         * driver.cs: Allow assemblies without code to be generated, fixes
8358         52230.
8359
8360 2004-01-07  Nick Drochak <ndrochak@gol.com>
8361
8362         * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
8363
8364 2004-01-05  Miguel de Icaza  <miguel@ximian.com>
8365
8366         * cs-parser.jay: Add rules to improve error reporting if fields or
8367         methods are declared at the namespace level (error 116)
8368
8369         * Add rules to catch event add/remove
8370
8371 2004-01-04  David Sheldon <dave-mono@earth.li>
8372
8373   * expression.cs: Added matching ")" to error message for 
8374   CS0077
8375
8376 2004-01-03 Todd Berman <tberman@gentoo.org>
8377
8378         * ecore.cs, attribute.cs:
8379         Applying fix from #52429.
8380
8381 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
8382
8383         * ecore.cs, expression.cs, statement.cs:
8384         Total rewrite of how we handle branching. We
8385         now handle complex boolean expressions with fewer
8386         jumps. As well if (x == 0) no longer emits a ceq.
8387
8388         if (x is Foo) is much faster now, because we generate
8389         better code.
8390
8391         Overall, we get a pretty big improvement on our benchmark
8392         tests. The code we generate is smaller and more readable.
8393
8394         I did a full two-stage bootstrap. The patch was reviewed
8395         by Martin and Miguel.
8396
8397 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
8398
8399         * cs-parser.jay: Make primary_expression not take a QI.
8400         we dont need this because the member_access rule covers
8401         us here. So we replace the rule with just IDENTIFIER.
8402
8403         This has two good effects. First, we remove a s/r conflict.
8404         Second, we allocate many fewer QualifiedIdentifier objects.
8405
8406 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
8407
8408         * attribute.cs: Handle MarshalAs attributes as pseudo, and
8409         set the correct information via SRE. This prevents
8410         hanging on the MS runtime. Fixes #29374.
8411
8412 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
8413
8414         * convert.cs: correctly handle conversions to value types
8415         from Enum and ValueType as unboxing conversions.
8416
8417         Fixes bug #52569. Patch by Benjamin Jemlich.
8418
8419 2004-01-02  Ravi Pratap  <ravi@ximian.com>
8420
8421         * expression.cs (BetterConversion): Prefer int -> uint
8422         over int -> ulong (csc's behaviour). This fixed bug #52046.
8423
8424 2004-01-02 Ben Maurer  <bmaurer@users.sourceforge.net>
8425
8426         * decl.cs (MemberCache.FindMembers): now returns a
8427         MemberInfo [].
8428
8429         * typemanager.cs: In general, go with with ^^.
8430         (CopyNewMethods): take an IList.
8431         (RealMemberLookup): Only allocate an arraylist
8432         if we copy from two sets of methods.
8433
8434         This change basically does two things:
8435         1) Fewer array lists allocated due to CopyNewMethods.
8436         2) the explicit cast in MemberList costed ALOT.
8437
8438 2004-01-02  Zoltan Varga  <vargaz@freemail.hu>
8439
8440         * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
8441         a hashtable to avoid needless string allocations when an identifier is
8442         used more than once (the common case).
8443
8444 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
8445
8446         * pending.cs: MS's TypeBuilder.GetInterfaces ()
8447         is broken, it will not return anything. So, we
8448         have to use the information we have in mcs to
8449         do the task.
8450
8451         * typemanager.cs: Add a cache for GetInterfaces,
8452         since this will now be used more often (due to ^^)
8453
8454         (GetExplicitInterfaces) New method that gets the
8455         declared, not effective, interfaces on a type
8456         builder (eg, if you have interface IFoo, interface
8457         IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
8458         { IBar }.
8459
8460         This patch makes MCS able to bootstrap itself on
8461         Windows again.
8462
8463 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
8464
8465         * expression.cs: Remove the Nop's that Miguel put
8466         in by mistake.
8467
8468 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
8469
8470         * report.cs, codegen.cs: Give the real stack trace to
8471         the error when an exception is thrown.
8472
8473 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
8474
8475         * decl.cs: only allocate hashtables for ifaces if 
8476         it is an iface!
8477
8478 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
8479
8480         * expression.cs: fix the error from cs0121-2.cs
8481         (a parent interface has two child interfaces that
8482         have a function with the same name and 0 params
8483         and the function is called through the parent).
8484
8485 2003-12-30 Ben Maurer  <bmaurer@users.sourceforge.net>
8486
8487         * class.cs, rootcontext.cs, typmanager.cs: do not
8488         leak pointers.
8489
8490 2003-12-28 Ben Maurer  <bmaurer@users.sourceforge.net>
8491
8492         * codegen.cs: remove stack for the ec flow branching.
8493         It is already a linked list, so no need.
8494
8495 2003-12-27 Ben Maurer  <bmaurer@users.sourceforge.net>
8496
8497         * Makefile: Allow custom profiler here.
8498
8499 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
8500
8501         * typemanager.cs (LookupType):
8502           - Use a static char [], because split takes
8503             a param array for args, so it was allocating
8504             every time.
8505           - Do not store true in a hashtable, it boxes.
8506
8507 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
8508
8509         * flowanalysis.cs: bytify common enums.
8510
8511 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
8512
8513         * modifiers.cs: Add a new set of flags for the
8514         flags allowed on explicit interface impls.
8515         * cs-parser.jay: catch the use of modifiers in
8516         interfaces correctly.
8517         * class.cs: catch private void IFoo.Blah ().
8518
8519         All related to bug #50572.
8520
8521 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
8522
8523         * decl.cs: Rewrite the consistant accessability checking.
8524         Accessability is not linear, it must be implemented in
8525         a tableish way. Fixes #49704.
8526
8527 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
8528
8529         * expression.cs: Handle negation in a checked context.
8530         We must use subtraction from zero. Fixes #38674.
8531
8532 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
8533
8534         * class.cs: Ignore static void main in DLLs.
8535         * rootcontext.cs: Handle the target type here,
8536         since we are have to access it from class.cs
8537         * driver.cs: account for the above.
8538
8539 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
8540
8541         * report.cs: Give line numbers and files if available.
8542
8543 2003-12-20  Zoltan Varga  <vargaz@freemail.hu>
8544
8545         * driver.cs: Implement /addmodule.
8546
8547         * typemanager.cs:  Change 'modules' field so it now contains Modules not
8548         ModuleBuilders.
8549
8550 2003-12-20  Martin Baulig  <martin@ximian.com>
8551
8552         * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
8553         (FieldBase.IsAssigned): Removed this field.
8554         (FieldBase.SetAssigned): New public method.
8555         (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
8556
8557 2003-12-20  Martin Baulig  <martin@ximian.com>
8558
8559         * expression.cs (LocalVariableReference.DoResolve): Don't set
8560         `vi.Used' if we're called from DoResolveLValue().
8561
8562         * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
8563         returns the usage vector it just merged into the current one -
8564         pass this one to UsageWarning().
8565         (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
8566         of the `EmitContext', don't call this recursively on our children.
8567
8568 2003-12-19  Zoltan Varga  <vargaz@freemail.hu>
8569
8570         * driver.cs: Implement /target:module.
8571
8572 2003-12-18  Zoltan Varga  <vargaz@freemail.hu>
8573
8574         * support.cs (CharArrayHashtable): New helper class.
8575
8576         * cs-tokenizer.cs: Store keywords in a hashtable indexed by 
8577         char arrays, not strings, so we can avoid creating a string in
8578         consume_identifier if the identifier is a keyword.
8579
8580 2003-12-16  Martin Baulig  <martin@ximian.com>
8581
8582         * statement.cs (LocalInfo.Assigned): Removed this property.
8583         (LocalInfo.Flags): Removed `Assigned'.
8584         (LocalInfo.IsAssigned): New public method; takes the EmitContext
8585         and uses flow analysis.
8586         (Block.UsageWarning): Made this method private.
8587         (Block.Resolve): Call UsageWarning() if appropriate.
8588
8589         * expression.cs (LocalVariableReference.DoResolve): Always set
8590         LocalInfo.Used here.
8591
8592 2003-12-13  Martin Baulig  <martin@ximian.com>
8593
8594         * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
8595         any value here; we're now using flow analysis to figure out
8596         whether a statement/block returns a value.
8597
8598 2003-12-13  Martin Baulig  <martin@ximian.com>
8599
8600         * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
8601         working again.
8602         (FlowBranching.MergeFinally): Don't call
8603         `branching.CheckOutParameters()' here, this is called in
8604         MergeTopBlock().
8605         (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
8606         when adding the `finally' vector.       
8607
8608 2003-12-13  Martin Baulig  <martin@ximian.com>
8609
8610         * flowanalysis.cs
8611         (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
8612         actually work and also fix #48962.
8613
8614 2003-12-12 Ben Maurer  <bmaurer@users.sourceforge.net>
8615
8616         * decl.cs: Do not check System.Object for nested types,
8617         since we know it does not have any. Big bang for buck:
8618
8619         BEFORE:
8620            Run 1:   8.35 seconds
8621            Run 2:   8.32 seconds
8622            corlib:  17.99 seconds
8623         AFTER:
8624            Run 1:   8.17 seconds
8625            Run 2:   8.17 seconds
8626            corlib:  17.39 seconds
8627
8628 2003-12-11 Ben Maurer  <bmaurer@users.sourceforge.net>
8629
8630         * class.cs (FindMembers): Allocate arraylists on demand. Most of the
8631         time we are returning 0 members, so we save alot here.
8632
8633 2003-12-11  Martin Baulig  <martin@ximian.com>
8634
8635         * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
8636         `MergeChild()', also just take the `FlowBranching' as argument;
8637         call Merge() on it and return the result.
8638         (FlowBranching.Merge): We don't need to do anything if we just
8639         have one sibling.
8640
8641 2003-12-11  Martin Baulig  <martin@ximian.com>
8642
8643         * flowanalysis.cs: Use a list of `UsageVector's instead of storing
8644         them in an `ArrayList' to reduce memory usage.  Thanks to Ben
8645         Maurer for this idea.
8646
8647 2003-12-11  Martin Baulig  <martin@ximian.com>
8648
8649         * flowanalysis.cs (MergeResult): This class is now gone; we now
8650         use the `UsageVector' for this.  The reason for this is that if a
8651         branching just has one sibling, we don't need to "merge" them at
8652         all - that's the next step to do.
8653         (FlowBranching.Merge): We now return a `UsageVector' instead of a
8654         `MergeResult'.
8655
8656 2003-12-11  Martin Baulig  <martin@ximian.com>
8657
8658         Reworked flow analyis and made it more precise and bug-free.  The
8659         most important change is that we're now using a special `Reachability'
8660         class instead of having "magic" meanings of `FlowReturns'.  I'll
8661         do some more cleanups and optimizations and also add some more
8662         documentation this week.
8663
8664         * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
8665         largely reworked this class.
8666         (FlowReturns): Removed `Unreachable' and `Exception'; we now use
8667         the new `Reachability' class instead of having "magic" values here.
8668         (FlowBranching): We're now using an instance of `Reachability'
8669         instead of having separate `Returns', `Breaks' etc. fields.
8670
8671         * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
8672         based on flow analysis; ignore the return value of block.Emit ().
8673
8674 2003-12-10  Zoltan Varga  <vargaz@freemail.hu>
8675
8676         * driver.cs typemanager.cs: Find the mono extensions to corlib even
8677         if they are private.
8678
8679 2003-12-09  Martin Baulig  <martin@ximian.com>
8680
8681         * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
8682         call them directly on the UsageVector.
8683
8684 2003-12-09  Martin Baulig  <martin@ximian.com>
8685
8686         * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
8687         Changed return type from `FlowReturns' to `Reachability'.
8688
8689 2003-12-09  Martin Baulig  <martin@ximian.com>
8690
8691         * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
8692         (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
8693         `Reachable' fields with a single `Reachability' one.
8694
8695 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
8696
8697         * class.cs (FindMembers): Remove foreach's.
8698
8699         Bootstrap times:
8700
8701         BEFORE
8702                 Run 1:   8.74 seconds
8703                 Run 2:   8.71 seconds
8704
8705         AFTER
8706                 Run 1:   8.64 seconds
8707                 Run 2:   8.58 seconds
8708
8709
8710 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
8711
8712         * cs-parser.jay:
8713         * gen-treedump.cs:
8714         * statement.cs:
8715         This patch does a few things:
8716                 1. EmptyStatement is now a singleton, so it is never reallocated.
8717                 2. All blah is EmptyStatement constructs have been changed to
8718                    blah == EmptyStatement.Value, which is much faster and valid
8719                    now that EmptyStatement is a singleton.
8720                 3. When resolving a block, rather than allocating a new array for
8721                    the non-empty statements, empty statements are replaced with
8722                    EmptyStatement.Value
8723                 4. Some recursive functions have been made non-recursive.
8724         Mainly the performance impact is from (3), however (1) and (2) are needed for
8725         this to work. (4) does not make a big difference in normal situations, however
8726         it makes the profile look saner.
8727
8728         Bootstrap times:
8729
8730         BEFORE
8731         9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
8732         9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
8733         Total memory allocated: 56397 KB
8734
8735         AFTER
8736         9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
8737         8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
8738         Total memory allocated: 55666 KB
8739
8740 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
8741
8742         * support.cs: Rewrite DoubleHash to use its own impl. Is faster
8743         than the hashtable in a hashtable version
8744
8745         * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
8746         we always end up concating a string. This results in a huge perf
8747         loss, because many strings have to be tracked by the GC. In this
8748         patch, we first use a hashtable that works with two keys, so that
8749         the strings do not need to be concat'ed.
8750
8751         Bootstrap times:
8752         BEFORE
8753                 Run 1:   8.74 seconds
8754                 Run 2:   8.71 seconds
8755
8756         AFTER
8757                 Run 1:   8.65 seconds
8758                 Run 2:   8.56 seconds
8759
8760 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
8761
8762         * Makefile: Add a new target `do-time' that does a quick and simple
8763         profile, leaving easy to parse output.
8764
8765 2003-12-08  Zoltan Varga  <vargaz@freemail.hu>
8766
8767         * codegen.cs (Init): Create the dynamic assembly with 
8768         AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
8769
8770 2003-12-02 Ben Maurer  <bmaurer@users.sourceforge.net>
8771
8772         * support.cs: Make the PtrHashtable use only one
8773         instance of its comparer.
8774
8775 2003-11-30  Zoltan Varga  <vargaz@freemail.hu>
8776
8777         * typemanager.cs: Fix lookup of GetNamespaces.
8778
8779 2003-11-29  Miguel de Icaza  <miguel@ximian.com>
8780
8781         * expression.cs: Removed redundant line.
8782
8783         * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
8784         ArrayLists, use for loops with bounds.  
8785
8786         * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
8787         arraylist.
8788
8789         * expression.cs (Invocation.OverloadResolve): Avoid foreach on
8790         arraylists, use for loop with bounds.
8791
8792         The above three changes give us a 0.071 second performance
8793         improvement out of 3.294 seconds down to 3.223.  On my machine
8794         the above changes reduced the memory usage by 1,387 KB during
8795         compiler bootstrap.
8796
8797         * cs-parser.jay (QualifiedIdentifier): New class used to represent
8798         QualifiedIdentifiers.  Before we created a new string through
8799         concatenation, and mostly later on, the result would be
8800         manipulated by DecomposeQI through string manipulation.
8801
8802         This reduced the compiler memory usage for bootstrapping from
8803         59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
8804         compile times in 0.05 seconds.
8805
8806 2003-11-28  Dick Porter  <dick@ximian.com>
8807
8808         * support.cs: Do string compares with the Invariant culture.
8809
8810         * rootcontext.cs: 
8811         * gen-treedump.cs: 
8812         * expression.cs: 
8813         * driver.cs: 
8814         * decl.cs: 
8815         * codegen.cs: 
8816         * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
8817         the comparison is done with the Invariant culture.
8818
8819 2003-11-27  Miguel de Icaza  <miguel@ximian.com>
8820
8821         * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
8822         GetEnumerator method.
8823
8824         (ProbeCollectionType): Iterate starting at the most specific type
8825         upwards looking for a GetEnumerator
8826
8827         * expression.cs: Shift count can be up to 31 for int/uint and 63
8828         for long/ulong.
8829
8830 2003-11-26  Miguel de Icaza  <miguel@ximian.com>
8831
8832         * statement.cs (Block.LookupLabel): Also look for the label on the
8833         children blocks.  Use a hash table to keep track of visited
8834         nodes. 
8835
8836         * cfold.cs (IntConstant to UIntConstant mapping): Only return if
8837         we actually did transform the other operand, otherwise fall back
8838         to the common codepath that casts to long.
8839
8840         * cs-tokenizer.cs: Use the same code pattern as the int case.
8841         Maybe I should do the parsing myself, and avoid depending on the
8842         Parse routines to get this done.
8843
8844 2003-11-25  Miguel de Icaza  <miguel@ximian.com>
8845
8846         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
8847         which fixes bug 51347.  This time test it.
8848
8849         * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
8850         attributes for example can not tell the difference between these.
8851         The difference was only a syntax feature of the language. 
8852
8853         * attribute.cs: Apply attributes to delegates.
8854
8855         * delegate.cs: Call the apply attributes method.
8856
8857 2003-11-24  Miguel de Icaza  <miguel@ximian.com>
8858
8859         * convert.cs (TryImplicitIntConversion): One line bug fix: we were
8860         comparing 0 vs Byte.MinValue, not the value
8861
8862         (ImplicitConversionRequired): When reporting a conversion error,
8863         use error 31 to print out the constant error instead of the
8864         simpler 29.
8865
8866         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
8867         which fixes bug 51347.
8868
8869 2003-11-22  Miguel de Icaza  <miguel@ximian.com>
8870
8871         * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen) 
8872         which fixes the -warnaserror command line option.
8873
8874 2003-11-21  Miguel de Icaza  <miguel@ximian.com>
8875
8876         * cfold.cs (DoNumericPromotions): During constant folding of
8877         additions on UIntConstant, special case intconstants with
8878         IntConstants like we do on the expression binary operator. 
8879
8880 2003-11-12  Miguel de Icaza  <miguel@ximian.com>
8881
8882         * convert.cs (ImplicitReferenceConversion): We were missing a case
8883         (System.Enum are not value types or class types, so we need to
8884         classify them separatedly).
8885
8886         * driver.cs: We do not support error 2007.
8887
8888 2003-11-12 Jackson Harper <jackson@ximian.com>
8889
8890         * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
8891         system directory. Also use the full file name so users can
8892         libraries names mscorlib-o-tron.dll in a non system dir.
8893         
8894 2004-01-04  David Sheldon <dave-mono@earth.li>
8895
8896         * expression.cs: Added matching ")" to error message for CS0077.
8897
8898 2003-12-19  Martin Baulig  <martin@ximian.com>
8899
8900         * typemanager.cs (TypeManager.IsEqualGenericType): New public
8901         static method; see documentation in the method.
8902         (TypeManager.IsSubclassOrNestedChild): Allow IsEqualGenericType().
8903
8904         * convert.cs (Convert.ImplicitReferenceConversion,
8905         Convert.ImplicitReferenceConversionExists): Add support for
8906         generic type declarations; see gen-36.cs.
8907
8908 2003-12-19  Martin Baulig  <martin@ximian.com>
8909
8910         * pending.cs (Pending.InterfaceMethod): Use
8911         `Type.IsAssignableFrom()' instead of `=='.
8912
8913 2003-12-18  Martin Baulig  <martin@ximian.com>
8914
8915         * decl.cs (DeclSpace.AsAccessible): Check for array, pointer and
8916         byref types first.
8917
8918         * convert.cs (Convert.ImplicitStandardConversionExists): Use
8919         `expr_type.Equals (target_type)' instead of `=='.
8920
8921 2003-12-08  Martin Baulig  <martin@ximian.com>
8922
8923         * generics.cs (Constraints.Types): Removed.
8924         (Constraints.Resolve): Just resolve everything to TypeExpr's, not
8925         to Type's.
8926         (Constraints.ResolveTypes): New public method; resolves the
8927         TypeExpr's to Type's.
8928         (TypeParameter.Define): TypeBuilder.DefineGenericParameter() no
8929         longer takes the constraints.
8930         (TypeParameter.DefineMethod): Likewise.
8931         (TypeParameter.DefineType): New public method.  Calls
8932         `TypeBuilder/MethodBuilder.SetGenericParameterConstraints()' to set
8933         the constraints.
8934
8935 2003-12-08  Martin Baulig  <martin@ximian.com>
8936
8937         * convert.cs (Convert.ImplicitConversionStandard): Use
8938         `expr_type.Equals (target_type)' instead of `=='.
8939
8940 2003-12-08  Martin Baulig  <martin@ximian.com>
8941
8942         * typemanager.cs (TypeManager.GetReferenceType): Call
8943         `Type.MakeByRefType ()'.
8944
8945 2003-12-08  Martin Baulig  <martin@ximian.com>
8946
8947         * cs-parser.jay, cs-tokenizer.cs: `where' is not a keyword, it
8948         just has some special meaning in some situations.  For instance,
8949         it is allowed to use `where' as the name of a variable etc.
8950
8951 2003-12-04  Martin Baulig  <martin@ximian.com>
8952
8953         * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
8954         `Type.MakeArrayType()' for array types.
8955
8956 2003-11-18  Miguel de Icaza  <miguel@ximian.com>
8957
8958         * expression.cs (Invocation.VerifyArgumentsCompat): Remove
8959         debugging message.
8960
8961         (SizeOf.DoResolve): assign the `type_queried' field.  This gets
8962         corlib to compile.
8963
8964 2003-11-16  Martin Baulig  <martin@ximian.com>
8965
8966         * codegen.cs (EmitContext.IsGeneric): Removed.
8967
8968         * ecore.cs (SimpleName.ResolveAsTypeStep): Always call
8969         ResolveGeneric() on the DeclSpace.
8970
8971 2003-11-16  Martin Baulig  <martin@ximian.com>
8972
8973         * generic.cs (TypeArguments.Resolve):
8974         `Expression.ResolveAsTypeTerminal()' returns a TypeExpr; call
8975         `ResolveType()' on it to get the Type.
8976
8977 2003-11-15  Martin Baulig  <martin@ximian.com>
8978
8979         * generic.cs (ConstructedType.GetInterfaces): Override this.
8980
8981 2003-11-14  Martin Baulig  <martin@ximian.com>
8982
8983         * interface.cs (Interface.DefineType): Define all type parameters
8984         before adding the interfaces we inherit.
8985
8986 2003-11-11  Martin Baulig  <martin@ximian.com>
8987
8988         * generic.cs (ConstructedType.ResolveType): Always call
8989         `gt.BindGenericParameters (atypes)'; also if `args.HasTypeArguments'.
8990
8991 2003-11-10  Martin Baulig  <martin@ximian.com>
8992
8993         * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
8994         (TypeManager.InitCoreTypes): Initialize them here, but instead of
8995         calling `ResolveType()' on them, directly assign their `Type'.
8996
8997 2003-11-08  Martin Baulig  <martin@ximian.com>
8998
8999         * generic.cs (ConstructedType): Override `IsClass' etc.
9000
9001 2003-11-08  Martin Baulig  <martin@ximian.com>
9002
9003         * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
9004         return value and the `out parent' parameter.
9005         (TypeContainer.DefineType): Moved the CS0644 check into
9006         GetClassBases().  Don't pass the interface types to the
9007         `builder.DefineType()'/`builder.DefineNestedType()', but resolve
9008         them later and then call `TypeBuilder.AddInterfaceImplementation()'.
9009
9010         * ecore.cs (TypeExpr.IsAttribute): New property.
9011         (TypeExpr.GetInterfaces): New method.
9012
9013         * interface.cs (Interface.GetInterfaceTypeByName): Return a
9014         TypeExpr instead of a Type.
9015         (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
9016         (Interface.DefineType): Don't pass the interface types to the
9017         `builder.Definetype()'/`builder.DefineNestedType()', but resolve
9018         them later and then call `TypeBulider.AddInterfaceImplementation()'.
9019
9020         * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
9021         instead of a `Type[]'.
9022         (TypeManager.RegisterBuilder): Likewise.
9023         (TypeManager.AddUserInterface): Likewise.
9024         (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
9025         `Type[]' and also return a `TypeExpr[]'.
9026         (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
9027
9028 2003-11-08  Martin Baulig  <martin@ximian.com>
9029
9030         * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
9031         Expression.     
9032
9033 2003-11-08  Martin Baulig  <martin@ximian.com>
9034
9035         * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
9036         TypeManager.ResolveExpressionTypes().
9037
9038         * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
9039         instead of an Expression.
9040         (TypeExpr): This is now an abstract base class for `TypeExpression'.
9041         (TypeExpression): New public class; formerly known as `TypeExpr'.
9042
9043         * expression.cs (ComposedCast): Derive from TypeExpr.
9044
9045         * typemanager.cs (TypeManager.system_*_expr): These are now
9046         TypExpr's instead of Expression's.
9047         (TypeManager.ResolveExpressionTypes): New public static function;
9048         called from DeclSpace.GetTypeResolveEmitContext() to resolve all
9049         of them.        
9050
9051 2003-11-06  Miguel de Icaza  <miguel@ximian.com>
9052
9053         * expression.cs (New.DoResolve): Do not dereference value that
9054         might be a null return.
9055
9056         * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
9057         sure that the constant value has the right type.  Fixes an
9058         unreported bug, similar to 50425.
9059
9060         * const.cs (Const.LookupConstantValue): Call
9061         ImplicitStandardConversionExists before doing a conversion to
9062         avoid havng the TypeManager.ChangeType do conversions.
9063
9064         Reduced the number of casts used
9065
9066         (Const.ChangeType): New routine to enable reuse of the constant
9067         type changing code from statement.
9068
9069         * typemanager.cs (ChangeType): Move common initialization to
9070         static global variables.
9071
9072         Fixes #50425.
9073
9074         * convert.cs (ImplicitReferenceConversion): Somehow we allowed
9075         every value type to go through, even if it was void.  Fix that. 
9076
9077         * cs-tokenizer.cs: Use is_identifier_start_character on the start
9078         character of the define, and the is_identifier_part_character for
9079         the rest of the string.
9080
9081 2003-11-05  Miguel de Icaza  <miguel@ximian.com>
9082
9083         * expression.cs (UnaryMutator.EmitCode): When I updated
9084         LocalVariableReference.DoResolve, I overdid it, and dropped an
9085         optimization done on local variable references.
9086
9087 2003-11-04  Miguel de Icaza  <miguel@ximian.com>
9088
9089         * ecore.cs: Convert the return from Ldlen into an int.
9090
9091 2003-10-20  Miguel de Icaza  <miguel@ximian.com>
9092
9093         * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
9094         the accessibility, this is a special case for toplevel non-public
9095         classes (internal for instance).
9096
9097 2003-10-20  Nick Drochak <ndrochak@gol.com>
9098
9099         * ecore.cs: Fix typo and build.  Needed another right paren.
9100
9101 2003-10-19  Miguel de Icaza  <miguel@ximian.com>
9102
9103         * ecore.cs: Applied fix from Ben Maurer.   We were handling in the
9104         `internal' case regular and protected, but not allowing protected
9105         to be evaluated later.  Bug 49840
9106
9107 2003-10-15  Miguel de Icaza  <miguel@ximian.com>
9108
9109         * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
9110         to kb.Nlast, and not the kb.nFirst to isolate the switch
9111         statement.
9112
9113         Extract the underlying type, so enumerations of long/ulong are
9114         treated like long/ulong.
9115
9116 2003-10-14  Miguel de Icaza  <miguel@ximian.com>
9117
9118         * expression.cs (New): Overload the meaning of RequestedType to
9119         track the possible creation of the NewDelegate type, since
9120         DoResolve is invoked more than once for new constructors on field
9121         initialization.
9122
9123         See bugs: #48800 and #37014
9124
9125         * cs-parser.jay (declare_local_constants): Take an arraylist
9126         instead of a single constant.
9127
9128         (local_constant_declaration): It should take a
9129         constant_declarators, not a constant_declarator.  Fixes 49487
9130
9131         * convert.cs: Fix error report.
9132
9133 2003-10-13 Jackson Harper <jackson@ximian.com>
9134
9135         * typemanager.cs (TypeToCoreType): Add float and double this fixes
9136         bug #49611
9137         
9138 2003-11-03  Martin Baulig  <martin@ximian.com>
9139
9140         * expression.cs (ArrayAccess.GetStoreOpcode): Added
9141         `out bool has_type_arg'; if set, we need to pass the type to
9142         ig.Emit().
9143         (ArrayAccess.GetStoreOpcode, ArrayAccess.EmitLoadOpcode): Use
9144         Stelem_Any/Ldelem_Any for generic parameters.   
9145
9146 2003-11-02  Martin Baulig  <martin@ximian.com>
9147
9148         * expression.cs (Invocation.EmitCall): Use
9149         `TypeManager.IsValueType()' to check whether it's a value type.
9150         Don't set `struct_call' when calling a method on a type parameter.
9151
9152 2003-11-02  Martin Baulig  <martin@ximian.com>
9153
9154         * generics.cs (ConstructedType.Resolve): Renamed to ResolveType()
9155         and removed the TypeBuilder argument.
9156
9157         * typemanager.cs (TypeManager.IsValueType): Return
9158         `t.IsGenericParameter || t.IsValueType'.
9159
9160 2003-10-25  Martin Baulig  <martin@ximian.com>
9161
9162         * decl.cs (DeclSpace.ResolveType): If we're a ConstructedType,
9163         call ConstructedType.Resolve() on it.
9164
9165         * generic.cs (ConstructedType.Resolve): Set `type' on success.
9166
9167 2003-10-25  Martin Baulig  <martin@ximian.com>
9168
9169         * class.cs (TypeContainer.GetClassBases): Changed
9170         `out Type parent' into `out TypeExpr parent'.  Moved CS0644 and
9171         CS8214 reporting here.
9172         (TypeContainer.DefineType): GetClassBases() gives us a `TypeExpr'
9173         instead of a `Type' for our parent.  In case of a recursive
9174         declaration (see tests/gen-23.cs for an example), our parent is a
9175         ConstructedType and it doesn't have its type set.  So, first
9176         create our own TypeBuilder, then call constructed.Resolve() to get
9177         the parent's type and finally TypeBuilder.SetParent() it.
9178
9179         * ecore.cs (TypeExpr.Name): New public virtual property.
9180
9181         * generic.cs
9182         (ConstructedType): We're now a TypeExpr and not just an Expression.
9183         (ConstructedType.ResolveAsTypeStep): Don't resolve our type
9184         arguments here; this is done later.
9185         (ConstructedType.Resolve): New public method to resolve the type
9186         arguments and bind them.
9187
9188 2003-10-21  Martin Baulig  <martin@ximian.com>
9189
9190         * convert.cs: Use `TypeManager.IsValueType' instead of
9191         'type.IsValueType' everywhere.
9192
9193         * typemanager.cs (TypeManager.IsValueType): Return true for type
9194         parameters.  The reason for this is that we need to box a type
9195         parameter when converting it to a reference type.
9196
9197         * cs-parser.jay: Added support for default value expressions.
9198
9199         * generics.cs (DefaultValueExpression): New public class.       
9200
9201 2003-10-17  Martin Baulig  <martin@ximian.com>
9202
9203         * generic.cs (Constraints.Resolve): Take a DecpSpace instead of a
9204         TypeContainer so we can also use this for Interfaces.
9205         (TypeParameter.Resolve): Likewise.
9206
9207         * interface.cs (Interface.DefineType): Added support for generic
9208         interfaces.
9209
9210         * cs-parser.jay: Added support for generic structs and interfaces.
9211
9212 2003-10-17  Martin Baulig  <martin@ximian.com>
9213
9214         * generic.cs (GenericMemberAccess.DoResolve): We can now actually
9215         call generic methods :-)
9216
9217 2003-10-16  Martin Baulig  <martin@ximian.com>
9218
9219         * cs-parser.jay (namespace_or_type_name): Only create a
9220         GenericMemberAccess if we actually have type arguments.
9221
9222 2003-10-13  Martin Baulig  <martin@ximian.com>
9223
9224         * class.cs (Method.Define): If we're a generic method, call
9225         TypeBuilder.DefineGenericMethod () before resolving
9226         the parameters.
9227         (MethodData): Added .ctor which takes an additional MethodBuilder
9228         argument; this is used for generic methods.
9229         (MethodData.Define): Call `builder.SetGenericMethodSignature()' if
9230         we already have a MethodBuilder.
9231
9232 2003-10-10  Martin Baulig  <martin@ximian.com>
9233
9234         * class.cs (Method): Added .ctor which takes a `GenericMethod'
9235         instead of a `DeclSpace'.  This is used for generic methods.
9236
9237         * cs-parser.jay (method_header): Added support for generic
9238         methods; create a `GenericMethod' instance and pass it to the
9239         `Method's .ctor; it'll be used as the `DeclSpace' to lookup
9240         parameters and locals.
9241
9242         * decl.cs (DeclSpace.SetParameterInfo): Removed Location argument
9243         since we already have the location.  Check whether we're a generic
9244         type declaration or a generic method and create the correct type
9245         parameter.
9246
9247         * generic.cs (TypeParameter.DefineMethod): New public method.
9248         (GenericMethod): New public class; derives from DeclSpace and is
9249         used for generic methods.       
9250
9251 2003-10-09  Martin Baulig  <martin@ximian.com>
9252
9253         * class.cs (MethodCore): Added additional `DeclSpace ds' argument
9254         to the .ctor.
9255         (MethodCore.DoDefineParameters): Removed the TypeContainer
9256         argument; use the DeclSpace which was passed to the .ctor instead.
9257         (MethodCore.CheckParameter): Take a DeclSpace instead of a
9258         TypeContainer; we only need a DeclSpace here.
9259
9260 2003-10-09  Martin Baulig  <martin@ximian.com>
9261
9262         * class.cs (MethodData): Added additional `DeclSpace ds' argument
9263         to the .ctor.
9264         (MethodData.Define, MethodData.Emit): Pass the `ds' to the
9265         EmitContext's .ctor.    
9266
9267 2003-10-09  Martin Baulig  <martin@ximian.com>
9268
9269         * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
9270         (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
9271         AsAccessible(), moved them as well.
9272
9273         * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
9274
9275 2003-10-07  Miguel de Icaza  <miguel@ximian.com>
9276
9277         * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
9278         generation for >=, as spotted by Paolo, bug 48679.  
9279         Patch from David Waite.
9280
9281         * cs-tokenizer.cs: Add handling for #pragma.
9282
9283         * cs-parser.jay: Allow for both yield and yield return in the
9284         syntax.  The anti-cobolization of C# fight will go on!
9285
9286         * class.cs (TypeBuilder.DefineType): Catch error condition here
9287         (Parent.DefineType erroring out and returning null).
9288
9289         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
9290         coping with enumerations variables, we were mistakenly processing
9291         them as a regular value type instead of built-in types.  Fixes the
9292         bug #48063
9293
9294         * typemanager.cs (IsBuiltinOrEnum): New method.
9295
9296 2003-09-30  Miguel de Icaza  <miguel@ximian.com>
9297
9298         * cs-parser.jay: Upgrade: yield now needs the return clause.
9299
9300 2003-10-08  Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
9301
9302         * cs-parser.jay : Renamed yyName to yyNames related to jay.
9303
9304 2003-09-29  Martin Baulig  <martin@ximian.com>
9305
9306         * typemanager.cs (TypeManager.GetMethodFlags): Added support for
9307         inflated generic methods.
9308
9309         * generics.cs (ConstructedType): Distinguish between open and
9310         closed constructed types; correctly resolve the arguments.
9311
9312 2003-09-22  Martin Baulig  <martin@ximian.com>
9313
9314         * generic.cs (ConstructedType.ResolveAsTypeCheck): Check whether
9315         all type arguments meet their constraints.
9316
9317 2003-09-19  Martin Baulig  <martin@ximian.com>
9318
9319         * decl.cs (MemberCache.SetupCacheForInterface): Take a
9320         `MemberCache parent' argument.  Normally, an interface doesn't
9321         have a parent type except System.Object, but we use this in gmcs
9322         for generic type parameters.
9323
9324 2003-09-18  Martin Baulig  <martin@ximian.com>
9325
9326         * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
9327         on `type.IsInterface'; don't check whether the type has a parent
9328         to determine whether it's an interface.
9329
9330 2003-09-17  Martin Baulig  <martin@ximian.com>
9331
9332         * generic.cs (ConstructedType.ToString): Always use `name' as the
9333         type name.
9334
9335 2003-09-15  Martin Baulig  <martin@ximian.com>
9336
9337         * cs-parser.jay: Fix grammar wrt. type_parameter_constraints.
9338
9339         * generic.cs (Constraints.Resolve): New public method; this is
9340         called to resolve the constraint types and to check whether all
9341         the constraints are correct.
9342         (Constraints.Types): New public property.
9343         (TypeParameter.Resolve): New public method; resolves all the
9344         type's constraints.
9345
9346         * class.cs (TypeContainer.DefineType): Call
9347         TypeParameter.Resolve() before actually defining the type.
9348
9349 2003-09-15  Martin Baulig  <martin@ximian.com>
9350
9351         * class.cs (TypeContainer.DefineType): Added an error flag to
9352         avoid reporting duplicate CS0146's ("class definition is
9353         circular.").
9354
9355         * driver.cs (Driver.MainDriver): Abort if
9356         RootContext.ResolveTree() reported any errors.
9357
9358 2003-09-07  Martin Baulig  <martin@ximian.com>
9359
9360         * report.cs (Error, Warning): Added overloaded versions which take
9361         a `params object[] args' and call String.Format().
9362
9363 2003-09-07  Martin Baulig  <martin@ximian.com>
9364
9365         * decl.cs (DeclSpace..ctor): Don't call
9366         NamespaceEntry.DefineName() here; do it in RecordDecl() which is
9367         called from Tree.RecordDecl().  Fixes the CS0101 reporting.
9368         (DeclSpace.RecordDecl): New method.
9369
9370         * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
9371
9372 2003-09-02  Ravi Pratap  <ravi@ximian.com>
9373
9374         * attribute.cs (CheckAttributeTarget): Ensure that we allow return
9375         value attributes to be applied to ParameterBuilders.
9376
9377         * class.cs (MethodCore.LabelParameters): Make static and more
9378         generic so that it can be used from other places - like interface
9379         methods, for instance.
9380
9381         * interface.cs (Interface.Emit): Call LabelParameters before
9382         emitting attributes on the InterfaceMethod.
9383
9384 2003-09-07  Martin Baulig  <martin@ximian.com>
9385
9386         * generic.cs (ConstructedType.ResolveAsTypeStep): Report a CS8217
9387         if the number of type parameters doesn't match.
9388
9389 2003-09-04  Martin Baulig  <martin@ximian.com>
9390
9391         * expression.cs (ComposedCast.ResolveAsTypeStep): Added support
9392         for arrays of generic type params (ie. `!0[]').
9393
9394 2003-09-04  Martin Baulig  <martin@ximian.com>
9395
9396         * class.cs (TypeContainer.AsAccessible): Ignore generic parameters
9397         for the moment.
9398
9399 2003-09-04  Martin Baulig  <martin@ximian.com>
9400
9401         * decl.cs (DeclSpace.LookupGeneric): New method.
9402         (DeclSpace.CheckAccessLevel): Ignore generic parameters for the
9403         moment.
9404
9405         * generic.cs (TypeParameterExpr): Take a TypeParameter as
9406         argument, not just a string.
9407         (TypeParameter.Define): New public method; this is called to
9408         actually define the generic parameter; after this, you can use the
9409         new `Type' property to get the type.
9410
9411 2003-09-04  Martin Baulig  <martin@ximian.com>
9412
9413         * decl.cs (DeclSpace.SetParameterInfo): The `constraints' argument
9414         is now an ArrayList; initialize the result of the `TypeParameters'
9415         property here.
9416         (DeclSpace.GetGenericData): Removed.
9417         (DeclSpace.LookupGeneric): Temporarily removed; we need to
9418         implement this in a different way.
9419         (DeclSpace.GetTypeParameters): Removed; there's now a
9420         `TypeParameters' property.
9421         (DeclSpace.TypeParameters): New public property.
9422
9423         * generic.cs (Constraints): Make this class public.
9424         (TypeParameter): New public class.
9425
9426 2003-09-04  Martin Baulig  <martin@ximian.com>
9427
9428         * decl.cs (DeclSpace.GetTypeParameters): New method to return the
9429         generic parameters.
9430
9431         * class.cs (TypeContainer.DefineType): Call
9432         TypeBuilder.DefineGenericParameter () on all generic parameters if
9433         this is a generic type.
9434
9435 2003-08-28  Martin Baulig  <martin@ximian.com>
9436
9437         * sample-stack.il: Compile this with ilasm: "ilasm /dll
9438         sample-stack.il".
9439
9440         * sample-hello.cs: Compile this with gmcs: "gmcs
9441         /r:sample-stack.dll sample-hello.cs".
9442
9443 2003-08-28  Martin Baulig  <martin@ximian.com>
9444
9445         * generic.cs (ConstructedType.ResolveAsTypeStep): Actually bind
9446         the parameters to the generic type.
9447
9448 2003-08-28  Martin Baulig  <martin@ximian.com>
9449
9450         * cs-tokenizer.cs (parse_less_than): Also allow all builtin types.
9451
9452 2003-08-28  Martin Baulig  <martin@ximian.com>
9453
9454         * cs-parser.jay (opt_type_argument_list): Use
9455         `OP_GENERICS_LT type_arguments OP_GENERICS_GT'.
9456         (primary_expression): Replace `qualified_identifier' with `type_name'.
9457         (type_parameter_list): Use `OP_GENERICS_LT type_parameters OP_GENERICS_GT'.
9458
9459         * cs-tokenizer.cs (is_punct): When reading a `<', invoke a custom
9460         parser to check whether it is syntactically a type parameter list;
9461         return OP_GENERICS_LT/OP_GENERICS_GT instead of OP_LT/OP_GT in
9462         this case.
9463
9464 2003-08-26  Martin Baulig  <martin@ximian.com>
9465
9466         * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
9467         resolving aliases; fixes #47927.
9468
9469 2003-08-26  Martin Baulig  <martin@ximian.com>
9470
9471         * statement.cs (Using.DoResolve): This is internally emitting a
9472         try/finally clause, so we need to set ec.NeedExplicitReturn if we
9473         do not always return.  Fixes #47681.
9474
9475 2003-08-26  Martin Baulig  <martin@ximian.com>
9476
9477         * decl.cs (MemberCore): Moved WarningNotHiding(),
9478         Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
9479         into MemberBase.
9480         (AdditionResult): Make this nested in DeclSpace.
9481         (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
9482         argument; call NamespaceEntry.Define() unless we're nested in a
9483         class or struct.
9484
9485         * namespace.cs (Namespace.DefineName): New public function.  This
9486         is called from DeclSpace's .ctor to add 
9487         (Namespace.Lookup): Include DeclSpaces in the lookup.
9488
9489         * class.cs (Operator): Derive from MemberBase, not MemberCore.
9490
9491         * const.cs (Const): Derive from MemberBase, not MemberCore.     
9492
9493 2003-08-25  Martin Baulig  <martin@ximian.com>
9494
9495         * convert.cs (Convert.ExplicitReferenceConversion): When
9496         converting from an interface type to a class, unbox if the target
9497         type is a struct type.  Fixes #47822.
9498
9499 2003-08-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9500
9501         * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
9502         #47854.
9503
9504 2003-08-22  Martin Baulig  <martin@ximian.com>
9505
9506         * class.cs (TypeManager.DefineType): When defining a nested type,
9507         call DefineType() on our parent; fixes #47801.
9508
9509 2003-08-22  Martin Baulig  <martin@ximian.com>
9510
9511         * class.cs (MethodData.Define): While checking if a method is an
9512         interface implementation, improve the test a bit more to fix #47654.
9513
9514 2003-08-22  Martin Baulig  <martin@ximian.com>
9515
9516         * expression.cs (Probe.DoResolve): Check whether `expr' resolved
9517         correctly; fixes #47722.
9518
9519 2003-08-22  Martin Baulig  <martin@ximian.com>
9520
9521         * expression.cs (UnaryMutator.ResolveVariable): If the target is a
9522         LocalVariableReference, ensure it's not read-only.  Fixes #47536.
9523
9524         * statement.cs (Fixed.DoResolve): Make all variables read-only. 
9525
9526 2003-08-22  Martin Baulig  <martin@ximian.com>
9527
9528         * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
9529         can only be assigned in static constructors.  Fixes #47161.
9530
9531 2003-08-22  Martin Baulig  <martin@ximian.com>
9532
9533         Rewrote and improved the flow analysis code.
9534
9535         * flowbranching.cs (FlowBranching): Make this class abstract.
9536         (FlowBranching.CreateBranching): New static function to create a
9537         new flow branching.
9538         (FlowBranchingBlock, FlowBranchingException): New classes.
9539         (FlowBranching.UsageVector.Type): New public readonly field.
9540         (FlowBranching.UsageVector.Breaks): Removed the setter.
9541         (FlowBranching.UsageVector.Returns): Removed the setter.
9542         (FlowBranching.UsageVector): Added Break(), Return(),
9543         NeverReachable() and Throw() methods to modify the reachability.
9544         (FlowBranching.UsageVector.MergeChildren): Removed, this is now
9545         done by FlowBranching.Merge().
9546         (FlowBranching.UsageVector.MergeChild): New method; merges the
9547         merge result into the current vector.
9548         (FlowBranching.Merge): New abstract method to merge a branching.
9549
9550 2003-08-12  Martin Baulig  <martin@ximian.com>
9551
9552         * expression.cs (Indirection.CacheTemporaries): Create the
9553         LocalTemporary with the pointer type, not its element type.
9554
9555 2003-08-10  Miguel de Icaza  <miguel@ximian.com>
9556
9557         * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
9558         token was a keyword or not.
9559
9560         Add `error' options where an IDENTIFIER was expected;  Provide
9561         CheckToken and CheckIdentifierToken convenience error reporting
9562         functions. 
9563
9564         Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
9565
9566         * decl.cs: Rename `NamespaceEntry Namespace' public field into
9567         NameSpaceEntry NameSpaceEntry.
9568
9569         (LookupInterfaceOrClass): Avoid creating a full qualified name
9570         from namespace and name: avoid doing lookups when we know the
9571         namespace is non-existant.   Use new Tree.LookupByNamespace which
9572         looks up DeclSpaces based on their namespace, name pair.
9573
9574         * driver.cs: Provide a new `parser verbose' to display the
9575         exception thrown during parsing.  This is turned off by default
9576         now, so the output of a failure from mcs is more graceful.
9577
9578         * namespace.cs: Track all the namespaces defined in a hashtable
9579         for quick lookup.
9580
9581         (IsNamespace): New method
9582
9583 2003-08-09  Miguel de Icaza  <miguel@ximian.com>
9584
9585         * namespace.cs: Remove redundant call;  Avoid using MakeFQN when
9586         we know that we need to concatenate (full typename can never be
9587         null). 
9588
9589         * class.cs: ditto.
9590
9591         * statement.cs: Use a bitfield;  Do not initialize to null things
9592         which are done by the constructor by default.
9593
9594         * cs-parser.jay: bug fix, parameter was 4, not 3.
9595
9596         * expression.cs: Just use the property;
9597
9598         * statement.cs: No need for GetVariableInfo method.
9599
9600 2003-08-08  Martin Baulig  <martin@ximian.com>
9601
9602         * flowanalysis.cs (FlowReturns): This is now nested in the
9603         `FlowBranching' class.
9604         (MyBitVector): Moved this here from statement.cs.
9605         (FlowBranching.SiblingType): New enum type.
9606         (FlowBranching.CreateSibling): Added `SiblingType' argument.
9607
9608 2003-08-07  Martin Baulig  <martin@ximian.com>
9609
9610         * flowanalysis.cs (FlowBranchingType): This is now nested in the
9611         `FlowBranching' class and called `BranchingType'.
9612
9613 2003-08-07  Martin Baulig  <martin@ximian.com>
9614
9615         * flowanalysis.cs: Moved all the control flow analysis code into
9616         its own file.
9617
9618 2003-08-07  Martin Baulig  <martin@ximian.com>
9619
9620         * assign.cs (Assign.DoResolve): `target' must either be an
9621         IAssignMethod or an EventAccess; report a CS0131 otherwise.  Fixes
9622         #37319.
9623
9624 2003-08-07  Miguel de Icaza  <miguel@ximian.com>
9625
9626         * expression.cs (BinaryMethod): This kind of expression is created by the
9627         Binary class if it determines that the operator has to be handled
9628         by a method.
9629
9630         (BinaryDelegate): This kind of expression is created if we are
9631         dealing with a + or - operator on delegates.
9632
9633         (Binary): remove method, argumetns, and DelegateOperator: when
9634         dealing with methods, 
9635
9636         * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
9637
9638         * statement.cs (Block): use bitfields for the three extra booleans
9639         we had in use.   Remove unused topblock parameter.
9640
9641         * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
9642
9643         * assign.cs: Drop extra unneeded tests.
9644
9645 2003-08-06  Miguel de Icaza  <miguel@ximian.com>
9646
9647         * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
9648
9649         * statement.cs (Foreach): Use VariableStorage instead of
9650         LocalBuilders.   
9651
9652         * codegen.cs (VariableStorage): New class used by clients that
9653         require a variable stored: locals or fields for variables that
9654         need to live across yield.
9655
9656         Maybe provide a convenience api for EmitThis+EmitLoad?
9657
9658         (GetTemporaryLocal, FreeTemporaryLocal): Recycle
9659         these bad boys.
9660
9661 2003-08-05  Miguel de Icaza  <miguel@ximian.com>
9662
9663         * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
9664         RemapParameterLValue): New methods that are used to turn a
9665         precomputed FieldInfo into an expression like this:
9666
9667                 instance.FieldInfo
9668
9669         The idea is to use this instead of making LocalVariableReference
9670         have more than one meaning.
9671
9672         * cs-parser.jay: Add error production to BASE.
9673
9674         * ecore.cs: Deal with TypeManager.GetField returning null, which
9675         is now a valid return value.
9676
9677         (FieldExprNoAddress): New expression for Fields whose address can
9678         not be taken.
9679
9680         * expression.cs (LocalVariableReference): During the resolve
9681         phases, create new expressions if we are in a remapping context.
9682         Remove code that dealt with remapping here.
9683
9684         (ParameterReference): same.
9685
9686         (ProxyInstance): New expression, like the `This' expression, but
9687         it is born fully resolved.  We know what we are doing, so remove
9688         the errors that are targeted to user-provided uses of `this'.
9689
9690         * statement.cs (Foreach): our variable is now stored as an
9691         Expression;  During resolution, follow the protocol, dont just
9692         assume it will return this.
9693
9694 2003-08-06  Martin Baulig  <martin@ximian.com>
9695
9696         * support.cs (SeekableStreamReader.cs): New public class.
9697
9698         * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
9699         SeekableStreamReader instead of the normal StreamReader.
9700
9701 2003-08-04  Martin Baulig  <martin@ximian.com>
9702
9703         * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
9704         CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
9705         deambiguate casts and delegate invocations.
9706         (parenthesized_expression): Use the new tokens to ensure this is
9707         not a cast of method invocation.
9708
9709         * cs-tokenizer.cs (is_punct): Return one of the new special tokens
9710         when reading a `)' and Deambiguate_CloseParens () was previously
9711         called.
9712
9713         * expression.cs (ParenthesizedExpression): New class.  This is
9714         just used for the CS0075 test.
9715         (Binary.DoResolve): Check for CS0075.   
9716
9717 2003-07-29  Ravi Pratap  <ravi@ximian.com>
9718
9719         * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
9720         Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
9721         reference comparison.
9722
9723         (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
9724         examine the ReturnType for equality - this is necessary in the
9725         cases of implicit and explicit operators whose signature also
9726         includes the return type.
9727
9728 2003-07-26  Miguel de Icaza  <miguel@ximian.com>
9729
9730         * namespace.cs: Cache the result of the namespace computation,
9731         instead of computing it every time.
9732
9733 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
9734
9735         * decl.cs: Use a global arraylist that we reuse over invocations
9736         to avoid excesive memory consumption.  Reduces memory usage on an
9737         mcs compile by one meg (45 average).
9738
9739         * typemanager.cs (LookupTypeReflection): In .NET pointers are
9740         private, work around that.
9741
9742 2003-07-23  Miguel de Icaza  <miguel@ximian.com>
9743
9744         * literal.cs (IntLiteral): Define Zero and One static literals. 
9745
9746         * cs-parser.jay (integer_literal): use static literals to reduce
9747         memory usage for the most used literals (0, 1 and -1).  211kb
9748         reduced in memory usage.
9749
9750         Replace all calls to `new ArrayList' with `new
9751         ArrayList(4)' which is a good average number for most allocations,
9752         and also requires only 16 bytes of memory for its buffer by
9753         default. 
9754
9755         This reduced MCS memory usage in seven megabytes for the RSS after
9756         bootstrapping.
9757
9758 2003-07-28  Ravi Pratap  <ravi@ximian.com>
9759
9760         * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
9761         handle params methods the correct way by forming only one
9762         applicable set with params and normal methods in them. Earlier we
9763         were looking at params methods only if we found no normal methods
9764         which was not the correct thing to do.
9765
9766         (Invocation.BetterFunction): Take separate arguments indicating
9767         when candidate and the best method are params methods in their
9768         expanded form.
9769
9770         This fixes bugs #43367 and #46199.
9771
9772         * attribute.cs: Documentation updates.
9773
9774         (CheckAttribute): Rename to CheckAttributeTarget.
9775         (GetValidPlaces): Rename to GetValidTargets.
9776
9777         * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
9778         bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
9779
9780         Fixes bug #44468.
9781
9782 2003-07-28  Miguel de Icaza  <miguel@ximian.com>
9783
9784         * codegen.cs: Compute IsGeneric correctly.
9785
9786         * cs-parser.jay: Introduce OP_GENERIC_LT for the grammar ambiguity
9787         resolution. 
9788
9789         Bring back (temporarily) OP_LEFT_SHIFT, OP_RIGHT_SHIFT,
9790         OP_SHIFT_RIGHT_ASSIGN, OP_SHIFT_LEFT_ASSIGN.  There were too many
9791         regressions, and I was chasing more bugs than I required.
9792
9793         * interface.cs: Use expressions for base type names (like classes
9794         and structs have been doing for a while now), and resolve that.
9795         This patch should probably go into head as well.
9796
9797         This makes it one less user of FindType.
9798
9799 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
9800
9801         This compiler can not self host currently.  Need to fix that.
9802         
9803         * Makefile: compile to `gmcs.exe'
9804
9805         * driver.cs: Turn on v2 by default on gmcs.
9806
9807         * generic.cs (ConstructedType): Does no longer take a container
9808         type argument;  That will be taken care of later.
9809
9810         (ConstructedType.DoResolve, ConstructedType.ResolveAsTypeStep):
9811         Use SimpleName to resolve for now, so we can continue the work on
9812         the parser, until we get Type.GetType that understands generics.
9813
9814         (ConstructedType.ToString): Implement
9815
9816         (TypeArguments.Resolve): Resolve the child expressions as types. 
9817         
9818         * cs-parser.jay: Rename interface_constraints to
9819         type_parameter_constraints
9820
9821         (namespace_or_type_name): Only use constructed types for the basic
9822         construction, we will deal with identifier<...> later.
9823
9824         (type/type_name): No longer call DecomposeQI, as
9825         namespace_or_type_name is always decoded now.
9826         
9827 2003-07-22  Ravi Pratap  <ravi@ximian.com>
9828
9829         * expression.cs (Invocation.OverloadResolve): Follow the spec more
9830         closely: we eliminate methods in base types when we have an
9831         applicable method in a top-level type.
9832
9833         Please see section 14.5.5.1 for an exact description of what goes
9834         on. 
9835
9836         This fixes bug #45127 and a host of other related to corlib compilation.
9837
9838         * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
9839         array is the method corresponding to the top-level type (this is
9840         because of the changes made to icall.c) so we change this
9841         accordingly.
9842
9843         (MethodGroupExpr.Name): This too.
9844
9845         * typemanager.cs (GetElementType): New method which does the right
9846         thing when compiling corlib. 
9847
9848         * everywhere: Make use of the above in the relevant places.
9849
9850 2003-07-22  Martin Baulig  <martin@ximian.com>
9851
9852         * cs-parser.jay (invocation_expression): Moved
9853         `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
9854         `cast_expression', but create a InvocationOrCast which later
9855         resolves to either an Invocation or a Cast.
9856
9857         * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
9858         method; call this before EmitStatement() to make sure that this
9859         expression can be used as a statement.
9860
9861         * expression.cs (InvocationOrCast): New class; resolves to either
9862         an Invocation or a Cast.
9863
9864         * statement.cs (StatementExpression): Call ResolveStatement() on
9865         the ExpressionStatement before emitting it.
9866
9867 2003-07-21  Martin Baulig  <martin@ximian.com>
9868
9869         * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
9870         `ref' and `out' attributes match; fixes #46220.
9871         (MemberAccess.ResolveMemberAccess): You can't reference a type
9872         through an expression; fixes #33180.
9873         (Indexers.GetIndexersForType): Don't return the indexers from
9874         interfaces the class implements; fixes #46502.
9875
9876 2003-07-21  Martin Baulig  <martin@ximian.com>
9877
9878         * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
9879         CS0661 checks; fixes bug #30442.
9880
9881 2003-07-21  Martin Baulig  <martin@ximian.com>
9882
9883         * decl.cs (AdditionResult): Added `Error'.
9884
9885         * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
9886
9887         * typemanager.cs (TypeManager.ChangeType): Catch exceptions; makes
9888         cs0031.cs actually work.
9889
9890  2003-07-20  Miguel de Icaza  <miguel@ximian.com>
9891  
9892         * cs-parser.jay (namespace_name): do not use
9893         namespace_or_type_name, use qualified_identifier, because
9894         namespace_or_type_name will soon return a composed expression
9895         instead of a string.
9896  
9897         (namespace_or_type_name): Instead of returning a string, now this
9898         production returns an expression.
9899  
9900         * codegen.cs (EmitContext): Setup IsGeneric property based on
9901         whether our DeclSpace is generic, our the method is generic.
9902  
9903         * modifier.cs (Modifiers.METHOD_GENERIC): New definition, use if
9904         the method is generic.
9905  
9906         * cs-parser.jay (type_arguments, opt_type_argument_list,
9907         type_parameters, type_parameter_list, opt_type_parameter_list,
9908         type_parameter,, opt_type_parameter_constraints_clauses,
9909         type_parameter_constraints_clauses,
9910         type_parameter_constraint_clause, type_parameter_constraint,
9911         interface_constraints): Add new production
9912  
9913         * decl.cs (DeclSpace): IsGeneric, flag to track whether this
9914         DeclSpace is generic or not.
9915  
9916         (DeclSpace.SetParameterInfo): New routine, used to set the
9917         parameter info for a type.
9918  
9919         (DeclSpace.LookupGeneric): Lookups a name, and if it is a generic,
9920         returns a GenericTypeExpr
9921  
9922         * ecore.cs (SimpleName.ResolveAsTypeStep): If our container is
9923         generic, lookup the generic argument.
9924  
9925         * attribute.cs: Do not allow TypeParameterExpressions in
9926         Attributes.
9927  
9928         * class.cs: Do not allow the Main method to be defined in a
9929         Generic container.
9930  
9931         * expression.cs (SizeOf): Do not allow generic types to be used as
9932         arguments to sizeof.
9933  
9934         * typemanager.cs (IsGeneric): Wrapper for Reflection when we have
9935         it: whether a type is generic or not.  Only works for types we are
9936         currently building for now.
9937         
9938 2003-07-20  Martin Baulig  <martin@ximian.com>
9939
9940         * namespace.cs: Fixed that bug which caused a crash when compiling
9941         the debugger's GUI.
9942
9943 2003-07-20  Miguel de Icaza  <miguel@ximian.com>
9944
9945         * typemanager.cs (LookupTypeReflection): Never expose types which
9946         are NotPublic, NestedPrivate, NestedAssembly, or
9947         NestedFamANDAssem.  We used to return these, and later do a check
9948         that would report a meaningful error, but the problem is that we
9949         would not get the real match, if there was a name override.
9950
9951 2003-07-18  Miguel de Icaza  <miguel@ximian.com>
9952
9953         * namespace.cs (Namespace, Name): Do not compute the namespace
9954         name dynamically, compute it in the constructor.  This reduced
9955         memory usage by 1697 KB.
9956
9957         * driver.cs: Use --pause to pause at the end.
9958
9959 2003-07-17  Peter Williams  <peter@newton.cx>
9960
9961         * Makefile: Change the name of the test target so that it doesn't
9962         conflict with the recursive test target.
9963
9964 2003-07-17  Miguel de Icaza  <miguel@ximian.com>
9965
9966         * expression.cs (LocalVariableReference.Emit, EmitAssign,
9967         AddressOf): Do not use EmitThis, that was wrong, use the actual
9968         this pointer.
9969
9970 2003-07-15  Miguel de Icaza  <miguel@ximian.com>
9971
9972         * class.cs (MethodData.Define): While checking if a method is an
9973         interface implementation, improve the test: If we are not public
9974         (use new test here: use the computed MethodAttributes directly,
9975         instead of the parsed modifier flags) check if the `implementing'
9976         method comes from an interface or not.
9977
9978         * pending.cs (VerifyPendingMethods): Slightly better error
9979         message.
9980
9981         * makefile: add test target that does the mcs bootstrap.
9982
9983 2003-07-16  Ravi Pratap  <ravi@ximian.com>
9984
9985         * interface.cs (Define): Do nothing here since there are no
9986         members to populate etc. Move the attribute emission out of here
9987         since this was just totally the wrong place to put it. Attribute
9988         application happens during the 'Emit' phase, not in the 'Define'
9989         phase.
9990
9991         (Emit): Add this method and move the attribute emission here
9992
9993         * rootcontext.cs (EmitCode): Call the Emit method on interface
9994         types too.
9995
9996 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
9997
9998         * expression.cs (OverloadResolve): Report error only if Location
9999         is not 'Null' which means that there was a probe going on.
10000
10001 2003-07-14  Martin Baulig  <martin@ximian.com>
10002
10003         * expression.cs (ConditionalLogicalOperator): New public class to
10004         implement user defined conditional logical operators.
10005         This is section 14.11.2 in the spec and bug #40505.
10006
10007 2003-07-14  Martin Baulig  <martin@ximian.com>
10008
10009         * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
10010
10011 2003-07-14  Martin Baulig  <martin@ximian.com>
10012
10013         * codegen.cs (EmitContext.InFixedInitializer): New public field.
10014
10015         * ecore.cs (IVariable.VerifyFixed): New interface method.
10016
10017         * expression.cs (Unary.ResolveOperator): When resolving the `&'
10018         operator, check whether the variable is actually fixed.  Fixes bug
10019         #36055.  Set a variable definitely assigned when taking its
10020         address as required by the spec.
10021
10022         * statement.cs (LocalInfo.IsFixed): New field.
10023         (LocalInfo.MakePinned): Set `IsFixed' to true.
10024
10025 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
10026
10027         * attribute.cs (Attribute.Resolve): While doing a Member lookup
10028         for .ctors, ensure that we only ask for members declared in the
10029         attribute type (BindingFlags.DeclaredOnly).
10030
10031         Fixes bug #43632.
10032
10033         * expression.cs (Error_WrongNumArguments): Report error 1501
10034         correctly the way CSC does.
10035
10036 2003-07-13  Martin Baulig  <martin@ximian.com>
10037
10038         * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
10039         lookup on the fully qualified name, to make things like "X.X" work
10040         where "X.X" is a fully qualified type name, but we also have a
10041         namespace "X" in the using list.  Fixes #41975.
10042
10043 2003-07-13  Martin Baulig  <martin@ximian.com>
10044
10045         * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
10046         function. If we're a CompoundAssign, we need to create an embedded
10047         CompoundAssign, not an embedded Assign.
10048         (Assign.DoResolve): Make this work for embedded CompoundAssign's.
10049         Fixes #45854.
10050
10051 2003-07-13  Martin Baulig  <martin@ximian.com>
10052
10053         * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
10054         work to fix bug #46088.
10055
10056 2003-07-13  Ravi Pratap <ravi@ximian.com>
10057
10058         * class.cs (Operator.Emit): Do not emit attributes here - it is
10059         taken care of by the Method class that we delegate too. This takes
10060         care of bug #45876.
10061
10062 2003-07-10  Martin Baulig  <martin@ximian.com>
10063
10064         * expression.cs (TypeOfVoid): New class.
10065         (TypeOf): Report a CS0673 if it's System.Void.  Fixes #42264.
10066
10067 2003-07-10  Martin Baulig  <martin@ximian.com>
10068
10069         * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
10070         bug #35957.
10071
10072 2003-07-10  Martin Baulig  <martin@ximian.com>
10073
10074         * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
10075         not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
10076
10077         * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
10078
10079         * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
10080
10081 2003-07-10  Martin Baulig  <martin@ximian.com>
10082
10083         * expression.cs (ArrayCreation): Don't use a byte blob for arrays
10084         of decimal.  Fixes #42850.
10085
10086         NOTE: I also fixed the created byte blob, but this doesn't work on
10087         the MS runtime and csc never produces any byte blobs for decimal
10088         arrays.
10089
10090 2003-07-10  Martin Baulig  <martin@ximian.com>
10091
10092         * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
10093         structs; fixes #32068.
10094         (Block.AddChildVariableNames): Fixed #44302.
10095
10096 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10097
10098         * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
10099
10100 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
10101
10102         * attribute.cs: And this test is onger needed.
10103
10104 2003-07-08  Martin Baulig  <martin@ximian.com>
10105
10106         * rootcontext.cs (RootContext.NamespaceLookup): Ignore
10107         inaccessible types.  Fixes #36313.
10108
10109         * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
10110
10111         * namespace.cs (NamespaceEntry): Create implicit entries for all
10112         namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
10113         implicit entries for N1.N2 and N1.
10114
10115 2003-07-08  Martin Baulig  <martin@ximian.com>
10116
10117         Rewrote the handling of namespaces to fix a lot of the issues
10118         wrt. `using' aliases etc.
10119
10120         * namespace.cs (Namespace): Splitted this class into a
10121         per-assembly `Namespace' and a per-file `NamespaceEntry'.
10122
10123         * typemanager.cs (TypeManager.IsNamespace): Removed.
10124         (TypeManager.ComputeNamespaces): Only compute namespaces from
10125         loaded assemblies here, not the namespaces from the assembly we're
10126         currently compiling.
10127
10128 2003-07-08  Martin Baulig  <martin@ximian.com>
10129
10130         * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
10131
10132 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
10133
10134         * typemanager.cs: Reverted patch from Gonzalo, my previous patch
10135         already fixed it.  
10136
10137         I thought about the memory savings here, but LookupTypeReflection
10138         is used under already very constrained scenarios.  Compiling
10139         corlib or mcs only exposes one hit, so it would not really reduce
10140         any memory consumption.
10141
10142 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10143
10144         * typemanager.cs: fixes bug #45889 by only adding public types from
10145         other assemblies to the list of known types.
10146
10147 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
10148
10149         * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
10150         on the type we resolved.
10151
10152 2003-07-05  Martin Baulig  <martin@ximian.com>
10153
10154         * pending.cs (PendingImplementation.ParentImplements): Don't
10155         create the proxy if the parent is abstract.
10156
10157         * class.cs (TypeContainer.DefineIndexers): Process explicit
10158         interface implementations first.  Fixes #37714.
10159
10160 2003-07-04  Miguel de Icaza  <miguel@ximian.com>
10161
10162         * expression.cs (MemberAccess.ResolveMemberAccess): Events are
10163         defined recursively;  but since we modify the input parameters
10164         (left is set to `this' temporarily), we reset this value if the
10165         left_is_explicit is false, which gives the original semantics to
10166         the code.  
10167
10168         * literal.cs (NullPointer): new class used to represent a null
10169         literal in a pointer context.
10170
10171         * convert.cs (Convert.ImplicitReferenceConversion): Is the target
10172         type is a pointer, use a NullPointer object instead of a
10173         NullLiteral.   Closes 43687
10174
10175         (ExplicitConversion): Convert pointer values using
10176         the conv opcode to the proper type.
10177
10178         * ecore.cs (New): change ValueTypeVariable property into a method,
10179         that returns whether the valuetype is suitable for being used.
10180
10181         * expression.cs (Binary.DoNumericPromotions): Only return if we
10182         the int constant was a valid uint, and we can return both left and
10183         right as uints.  If not, we continue processing, to trigger the
10184         type conversion.  This fixes 39018.
10185
10186         * statement.cs (Block.EmitMeta): During constant resolution, set
10187         the CurrentBlock property on the emitcontext, so that we resolve
10188         constants propertly.
10189
10190 2003-07-02  Martin Baulig  <martin@ximian.com>
10191
10192         * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
10193         (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
10194
10195         * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
10196         than emitting it here.
10197
10198         * statement.cs: Fixed some more flow analysis bugs.
10199
10200 2003-07-02  Martin Baulig  <martin@ximian.com>
10201
10202         * class.cs (MethodData.Define): When implementing interface
10203         methods, set Final unless we're Virtual.
10204
10205         * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
10206         check work for interface methods.
10207
10208 2003-07-01  Martin Baulig  <martin@ximian.com>
10209
10210         * ecore.cs (EmitContext.This): Replaced this property with a
10211         GetThis() method which takes a Location argument.  This ensures
10212         that we get the correct error location for a CS0188.
10213
10214 2003-07-01  Miguel de Icaza  <miguel@ximian.com>
10215
10216         * ecore.cs: (Convert.ConvertIntLiteral): Add test for
10217         ImplicitStandardConversion.
10218
10219         * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
10220
10221 2003-07-01  Zoltan Varga  <vargaz@freemail.hu>
10222
10223         * expression.cs (ResolveOperator): Fix Concat (string, string, string)
10224         optimization.
10225
10226 2003-06-30  Miguel de Icaza  <miguel@ximian.com>
10227
10228         * class.cs (Constructor.Define): Turn off initlocals for unsafe
10229         constructors.
10230
10231         (MethodData.Define): Turn off initlocals for unsafe methods.
10232
10233 2003-06-29  Miguel de Icaza  <miguel@ximian.com>
10234
10235         * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
10236         complete;  Fixes #37521.
10237
10238         * delegate.cs: Use Modifiers.TypeAttr to compute the
10239         TypeAttributes, instead of rolling our own.  This makes the flags
10240         correct for the delegates.
10241
10242 2003-06-28  Miguel de Icaza  <miguel@ximian.com>
10243
10244         * class.cs (Constructor.Define): Set the private flag for static
10245         constructors as well.
10246
10247         * cs-parser.jay (statement_expression): Set the return value to
10248         null, to avoid a crash when we catch an error.
10249
10250 2003-06-24  Miguel de Icaza  <miguel@ximian.com>
10251
10252         * cs-parser.jay: Applied patch from Jackson that adds support for
10253         extern and unsafe modifiers to destructor declarations.
10254
10255         * expression.cs: Report error 21 if the user is trying to index a
10256         System.Array.
10257
10258         * driver.cs: Add an error message, suggested by the bug report.
10259
10260         * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
10261         if we do not have a ": this ()" constructor initializer.  Fixes 45149
10262
10263 2003-06-14  Miguel de Icaza  <miguel@ximian.com>
10264
10265         * namespace.cs: Add some information to reduce FAQs.
10266
10267 2003-06-13  Miguel de Icaza  <miguel@ximian.com>
10268
10269         * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
10270         underlying enumeration types.  Fixes #43915.
10271
10272         * expression.cs: Treat ushort/short as legal values to be used in
10273         bitwise operations.
10274
10275 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
10276
10277         * delegate.cs: transfer custom attributes for paramenters from
10278         the delegate declaration to Invoke and BeginInvoke.
10279
10280 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
10281
10282         * attribute.cs: handle custom marshalers and emit marshal info
10283         for fields, too.
10284
10285 2003-05-28  Hector E. Gomez Morales  <hgomez_36@flashmail.com>
10286
10287         * makefile.gnu: Added anonymous.cs to the compiler sources.
10288
10289 2003-05-28  Miguel de Icaza  <miguel@ximian.com>
10290
10291         * iterators.cs: Change the name of the proxy class to include two
10292         underscores.
10293
10294         * cs-parser.jay: Update grammar to include anonymous methods.
10295
10296         * anonymous.cs: new file.
10297
10298 2003-05-27  Miguel de Icaza  <miguel@ximian.com>
10299
10300         * class.cs (Field.Define): Add missing test for pointers and
10301         safety. 
10302
10303 2003-05-27  Ravi Pratap  <ravi@ximian.com>
10304
10305         * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
10306         we use the stobj opcode.
10307
10308         (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
10309         since it wasn't the correct fix. 
10310
10311         It still is puzzling that we are required to use stobj for IntPtr
10312         which seems to be a ValueType.
10313
10314 2003-05-26  Miguel de Icaza  <miguel@ximian.com>
10315
10316         * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
10317         during regular simple name resolution.   Now, the trick is that
10318         instead of returning for processing the simplename, we do a
10319         TypeManager.LookupType (ie, a rooted lookup as opposed to a
10320         contextual lookup type).   If a match is found, return that, if
10321         not, return for further composition.
10322
10323         This fixes long-standing 30485.
10324
10325         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
10326         using the address to initialize an object, do an Stobj instead of
10327         using the regular Stelem.
10328
10329         (IndexerAccess.Emit, IndexerAccess.EmitAssign):
10330         Pass `is_base_indexer' to Invocation.EmitCall instead of false.
10331         Because if we are a BaseIndexerAccess that value will be true.
10332         Fixes 43643.
10333
10334         * statement.cs (GotoCase.Resolve): Return after reporting an
10335         error, do not attempt to continue. 
10336
10337         * expression.cs (PointerArithmetic.Emit): If our operand is a
10338         long, convert our constants to match the operand before
10339         multiplying.  Convert to I type before adding.   Fixes 43670.
10340
10341 2003-05-14  Ravi Pratap  <ravi@ximian.com>
10342
10343         * enum.cs (ImplicitConversionExists) : Rename to
10344         ImplicitEnumConversionExists to remove ambiguity. 
10345
10346         * ecore.cs (NullCast): New type of cast expression class which
10347         basically is very similar to EmptyCast with the difference being
10348         it still is a constant since it is used only to cast a null to
10349         something else
10350         (eg. (string) null)
10351
10352         * convert.cs (ImplicitReferenceConversion): When casting a null
10353         literal, we return a NullCast.
10354
10355         * literal.cs (NullLiteralTyped): Remove - I don't see why this
10356         should be around anymore.
10357
10358         The renaming (reported was slightly wrong). Corrections:
10359
10360         ConvertImplicitStandard -> ImplicitConversionStandard
10361         ConvertExplicitStandard -> ExplicitConversionStandard
10362
10363         * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
10364         before passing them in !
10365
10366         * convert.cs (ImplicitConversionStandard): When comparing for
10367         equal expr and target types, ensure that expr is not a
10368         NullLiteral.
10369
10370         In general, we must not be checking (expr_type ==
10371         target_type) in the top level conversion methods
10372         (ImplicitConversion, ExplicitConversion etc). This checking is
10373         done in the methods that they delegate to.
10374
10375 2003-05-20  Miguel de Icaza  <miguel@ximian.com>
10376
10377         * convert.cs: Move Error_CannotConvertType,
10378         ImplicitReferenceConversion, ImplicitReferenceConversionExists,
10379         ImplicitNumericConversion, ImplicitConversionExists,
10380         ImplicitUserConversionExists, StandardConversionExists,
10381         FindMostEncompassedType, FindMostSpecificSource,
10382         FindMostSpecificTarget, ImplicitUserConversion,
10383         ExplicitUserConversion, GetConversionOperators,
10384         UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
10385         TryImplicitIntConversion, Error_CannotConvertImplicit,
10386         ConvertImplicitRequired, ConvertNumericExplicit,
10387         ExplicitReferenceConversionExists, ConvertReferenceExplicit,
10388         ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
10389         its own file.
10390
10391         Perform the following renames:
10392
10393         StandardConversionExists -> ImplicitStandardConversionExists
10394         ConvertImplicit -> ImplicitConversion
10395         ConvertImplicitStandard -> ImplicitStandardConversion
10396         TryImplicitIntConversion -> ImplicitIntConversion
10397         ConvertImplicitRequired -> ImplicitConversionRequired
10398         ConvertNumericExplicit -> ExplicitNumericConversion
10399         ConvertReferenceExplicit -> ExplicitReferenceConversion
10400         ConvertExplicit -> ExplicitConversion
10401         ConvertExplicitStandard -> ExplicitStandardConversion
10402
10403 2003-05-19  Martin Baulig  <martin@ximian.com>
10404
10405         * statement.cs (TypeInfo.StructInfo): Made this type protected.
10406         (TypeInfo): Added support for structs having structs as fields.
10407
10408         * ecore.cs (FieldExpr): Implement IVariable.
10409         (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
10410         VariableInfo for the field.
10411
10412 2003-05-18  Martin Baulig  <martin@ximian.com>
10413
10414         * expression.cs (This.DoResolve): Report a CS0027 if we're
10415         emitting a field initializer.
10416
10417 2003-05-18  Martin Baulig  <martin@ximian.com>
10418
10419         * expression.cs (This.ResolveBase): New public function.
10420         (This.DoResolve): Check for CS0188.
10421
10422         * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
10423         This.Resolve().
10424
10425         * ecore.cs (MethodGroupExpr.DoResolve): Set the
10426         `instance_expression' to null if we don't have any non-static
10427         methods.
10428
10429 2003-05-18  Martin Baulig  <martin@ximian.com>
10430
10431         Reworked the way how local variables and parameters are handled by
10432         the flow analysis code.
10433
10434         * statement.cs (TypeInfo, VariableMap): New public classes.
10435         (VariableInfo): New public class.  This is now responsible for
10436         checking whether a variable has been assigned.  It is used for
10437         parameters and local variables.
10438         (Block.EmitMeta): Take the InternalParameters as argument; compute
10439         the layout of the flow vectors here.
10440         (Block.LocalMap, Block.ParameterMap): New public properties.
10441         (FlowBranching): The .ctor doesn't get the InternalParameters
10442         anymore since Block.EmitMeta() now computes the layout of the flow
10443         vector.
10444         (MyStructInfo): This class is now known as `StructInfo' and nested
10445         in `TypeInfo'; we don't access this directly anymore.
10446
10447         * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
10448         property and removed IsAssigned(), IsFieldAssigned(),
10449         SetAssigned() and SetFieldAssigned(); we now call them on the
10450         VariableInfo so we don't need to duplicate this code everywhere.
10451
10452         * expression.cs (ParameterReference): Added `Block block' argument
10453         to the .ctor.
10454         (LocalVariableReference, ParameterReference, This): The new
10455         VariableInfo class is now responsible for all the definite
10456         assignment stuff.
10457
10458         * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
10459         IsParameterAssigned, SetParameterAssigned): Removed.
10460
10461 2003-05-18  Martin Baulig  <martin@ximian.com>
10462
10463         * typemanager.cs (InitCoreTypes): Try calling
10464         SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
10465         the 3-args-version.  Corlib now also needs our `void_type'.
10466         (GetMethod): Added overloaded version which takes an optional
10467         `bool report_errors' to allow lookups of optional methods.
10468
10469 2003-05-12  Martin Baulig  <martin@ximian.com>
10470
10471         * statement.cs (VariableInfo): Renamed to LocalInfo since it's
10472         only used for locals and not for parameters.
10473
10474 2003-05-12  Miguel de Icaza  <miguel@ximian.com>
10475
10476         * support.cs (InternalParameters.ParameterType): Return the
10477         ExternalType of the parameter.
10478
10479         * parameter.cs (Parameter.ExternalType): drop the two arguments,
10480         they were unused.
10481
10482 2003-05-11  Miguel de Icaza  <miguel@ximian.com>
10483
10484         * class.cs (MethodData.Define): Do not set the `newslot' on
10485         interface members, if they are also flagged as "override".
10486
10487         * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
10488         better code for ++i and i++.  This only works for static fields
10489         and local variables.
10490
10491         * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
10492         want to pull the DeclSpace out of the builder_to_declspace instead
10493         of the TypeBuilder (like in TypeContainer.FindMembers).
10494
10495         * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
10496         instead of LookupTypeContainer.  Fixes the crash on .NET for
10497         looking up interface members.
10498
10499         * const.cs: Create our own emit context during the Definition
10500         stage, so that constants are evaluated in the proper context, when
10501         a recursive definition happens.
10502
10503 2003-05-11  Martin Baulig  <martin@ximian.com>
10504
10505         * statement.cs (Block.CreateSwitchBlock): New method.  Creates a
10506         new block for a switch section.
10507         (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
10508         the adding/lookup in the switch block.  Fixes #39828.
10509
10510 2003-05-09  Miguel de Icaza  <miguel@ximian.com>
10511
10512         * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
10513         functionality: I needed to convert the data after I had performed
10514         the add/sub operation into the operands type size.
10515
10516         * ecore.cs (ImplicitReferenceConversion): When boxing an interface
10517         pass the type for the box operation, otherwise the resulting
10518         object would have been of type object.
10519
10520         (BoxedCast): Add constructor to specify the type to box as.
10521
10522 2003-05-07  Miguel de Icaza  <miguel@ximian.com>
10523
10524         * iterators.cs: I was reusing the `count' variable inadvertently,
10525         take steps to not allow this to happen.
10526
10527 2003-05-06  Miguel de Icaza  <miguel@ximian.com>
10528
10529         * attribute.cs (Attribute.Resolve): Params attributes are encoded
10530         by creating an array at the point where the params starts and
10531         putting all those arguments there, then adjusting the size of the
10532         array.
10533
10534 2003-05-05  Miguel de Icaza  <miguel@ximian.com>
10535
10536         * expression.cs (New.AddressOf): Implement interface
10537         IMemoryLocation.  This is used when the `new' operator is used in
10538         the context of an invocation to a method on a value type.
10539
10540         See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
10541         example. 
10542
10543         * namespace.cs: Also check the using aliases here.
10544
10545         * driver.cs: Move the test for using validity after the types have
10546         been entered, so we do a single pass that also includes the using
10547         aliases. 
10548
10549         * statement.cs (Try.Resolve): Avoid crashing if there is a failure
10550         in the regular case.   CreateSiblingForFinally is doing extra
10551         error checking.
10552
10553         * attribute.cs (GetAttributeArgumentExpression): Store the result
10554         on an out value, and use the return value to indicate failure
10555         instead of using null (which is a valid return for Constant.GetValue).
10556
10557         * statement.cs: Perform the analysis flow for the increment
10558         portion after the statement, because this will be the real flow of
10559         execution.  Fixes #42385
10560
10561         * codegen.cs (EmitContext.EmitArgument,
10562         EmitContext.EmitStoreArgument): New helper functions when the
10563         RemapToProxy flag is set.
10564
10565         * expression.cs (ParameterReference.EmitLdarg): Expose this useful
10566         function.
10567
10568         Add support for remapping parameters. 
10569
10570         * iterators.cs: Propagate parameter values;  Store parameter
10571         values in the proxy classes.
10572
10573 2003-05-04  Miguel de Icaza  <miguel@ximian.com>
10574
10575         * ecore.cs (FieldExpr): Fix an obvious bug.  static fields do not
10576         need a proxy reference;  I do not know what I was thinking
10577
10578         * cs-parser.jay (constructor_initializer): catch another error,
10579         and display nice message.
10580
10581         (field_declaration): catch void field declaration
10582         to flag a better error. 
10583
10584         * class.cs (MemberBase.CheckBase): Report an error instead of a
10585         warning if a new protected member is declared in a struct. 
10586         (Field.Define): catch the error of readonly/volatile.
10587
10588         * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
10589
10590         (FieldExpr.AddressOf): ditto.  Catch error where the address of a
10591         volatile variable is taken
10592
10593 2003-05-02  Miguel de Icaza  <miguel@ximian.com>
10594
10595         * statement.cs (Fixed.Resolve): Report an error if we are not in
10596         an unsafe context.
10597
10598 2003-05-01  Miguel de Icaza  <miguel@ximian.com>
10599
10600         * typemanager.cs: reuse the code that handles type clashes for
10601         delegates and enumerations.
10602
10603         * class.cs (Report28): Always report.
10604
10605         * expression.cs (EncodeAsAttribute): Allow nulls here.
10606
10607 2003-04-28  Miguel de Icaza  <miguel@ximian.com>
10608
10609         * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
10610         the functionality for testing whether an expression is valid for
10611         an attribute here.  Also handle the case of arrays of elements
10612         being stored. 
10613
10614         * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
10615         encoding a linear array into an array of objects that are suitable
10616         to be passed to an CustomAttributeBuilder.
10617
10618         * delegate.cs: Check unsafe types being used outside of an Unsafe context.
10619
10620         * ecore.cs: (FieldExpr): Handle field remapping here.
10621
10622         * iteratators.cs: Pass the instance variable (if the method is an
10623         instance method) to the constructors, so we can access the field
10624         variables on the class.
10625
10626         TODO: Test this with structs.  I think the THIS variable on
10627         structs might have to be a pointer, and not a refenrece
10628
10629 2003-04-27  Miguel de Icaza  <miguel@ximian.com>
10630
10631         * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
10632         local variables to fields in a proxy class.
10633
10634         * iterators.cs (PopulateProxy): Rename our internal fields to
10635         <XXX>.  
10636         Create a <THIS> field if we are an instance method, so we can
10637         reference our parent container variables.
10638         (MapVariable): Called back from the EmitContext code to enter a
10639         new variable to field mapping into the proxy class (we just create
10640         a FieldBuilder).
10641
10642         * expression.cs
10643         (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
10644         for using the remapped locals to fields.
10645
10646         I placed the code here, because that gives the same semantics to
10647         local variables, and only changes the Emit code.
10648
10649         * statement.cs (Fixed.Resolve): it is not allowed to have fixed
10650         statements inside iterators.
10651         (VariableInfo): Add a FieldBuilder for the cases when we are
10652         remapping local variables to fields in a proxy class
10653
10654         * ecore.cs (SimpleNameResolve): Avoid testing two times for
10655         current_block != null.
10656
10657         * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
10658         not cope with strings, as it has been moved to the
10659         TableSwitchEmit.  Fixed bug in switch generation.
10660
10661         * expression.cs (New.DoResolve): Provide more context for the user
10662         when reporting an error.
10663
10664         * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
10665         pointers. 
10666
10667         * expression.cs (MemberAccess.DoResolve): When we get a type back,
10668         check the permissions for it.  Note than in a type-resolution
10669         context the check was already present in DeclSpace.ResolveType,
10670         but was missing from the MemberAccess.
10671
10672         (ArrayCreation.CheckIndices): warn if the user has
10673         more nested levels of expressions, but there are no more
10674         dimensions specified.  Avoids crash on bug 41906.
10675
10676 2003-04-26  Miguel de Icaza  <miguel@ximian.com>
10677
10678         * statement.cs (Block): replace Implicit bool, for a generic
10679         flags.   
10680         New flag: `Unchecked'.  This is used during the EmitMeta phase
10681         (which is out-of-line with the regular Resolve/Emit process for a
10682         statement, as this is done ahead of time, but still gets a chance
10683         to call constant resolve).
10684
10685         (Block.Flags): new enum for adding a new flag.
10686
10687         (Block.EmitMeta): track the state of unchecked.
10688
10689         (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
10690         to enable constant resolution to work there as well.
10691
10692 2003-04-22  Miguel de Icaza  <miguel@ximian.com>
10693
10694         * typemanager.cs (ienumerable_type): Also look up
10695         System.Collections.IEnumerable. 
10696
10697 2003-04-21  Miguel de Icaza  <miguel@ximian.com>
10698
10699         TODO: Test more than one conditional per method.
10700
10701         * class.cs (Indexer.Define): Report the location where the user is
10702         referencing the unsupported feature.
10703
10704         (MethodData): Overload the use of `conditionals' to
10705         minimize the creation of needless ArrayLists.   This saves roughly
10706         212kb on my machine.
10707
10708         (Method): Implement the new IIteratorContainer interface.
10709         (Method.SetYields): Implement the method by setting the ModFlags
10710         to contain METHOD_YIELDS.
10711
10712         * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
10713         which just got set to null.
10714
10715         * iterators.cs: New file.
10716
10717         (Yield, YieldBreak): New statements.
10718
10719         * statement.cs (Return.Resolve): Flag an error if we are used in
10720         an iterator method.
10721
10722         * codegen.cs (InIterator): New flag set if the code is being
10723         compiled in an iterator method.
10724
10725         * modifiers.cs: New flag METHOD_YIELDS.  This modifier is an
10726         internal modifier, and we just use it to avoid adding extra
10727         fields, as this is seldom used.  
10728
10729         * cs-parser.jay: Add yield_statement (yield and yield break).
10730
10731         * driver.cs: New flag -v2 to turn on version 2 features. 
10732
10733         * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
10734         hashtable when v2 is enabled.
10735
10736 2003-04-20  Miguel de Icaza  <miguel@ximian.com>
10737
10738         * typemanager.cs (TypeManager.NamespaceClash): Use to check if
10739         there is already a namespace defined with this name.
10740
10741         (TypeManager.InitCoreTypes): Remove the temporary workaround, as
10742         people upgraded their corlibs.
10743
10744         (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
10745         always use fully qualified types, no need to use the compiler
10746         front end.
10747
10748         (TypeManager.IsNamespace): Use binarysearch.
10749
10750         * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
10751         AddDelegate): I did not quite use the new IsValid API properly: I
10752         have to pass the short-name and the fullname.  I was passing only
10753         the basename instead of the fullname sometimes. 
10754
10755         (TypeContainer.DefineType): call NamespaceClash.
10756
10757         * interface.cs (Interface.DefineType): use NamespaceClash before
10758         defining the type.
10759
10760         * delegate.cs (Delegate.DefineType): use NamespaceClash before
10761         defining the type.
10762
10763         * enum.cs: (Enum.DefineType): use NamespaceClash before
10764         defining the type.
10765
10766         * typemanager.cs (: 3-line patch that gives us some tasty 11%
10767         speed increase.  First, use the negative_hits cache when we get a
10768         negative.  Second, add the type with its full original name
10769         instead of the new . and + encoded name (reflection uses + to
10770         separate type from a nested type).  Use LookupTypeReflection
10771         directly which bypasses the type->name hashtable (that we already
10772         know does not contain the type.
10773
10774         * decl.cs (DeclSpace.ResolveTypeExpr): track the
10775         location/container type. 
10776
10777         * driver.cs: When passing utf8, use directly the UTF8Encoding.
10778
10779 2003-04-19  Miguel de Icaza  <miguel@ximian.com>
10780
10781         * decl.cs (ResolveTypeExpr): Mirror check acess here too.
10782
10783         * delegate.cs (NewDelegate.Resolve): Test whether an instance
10784         method is being referenced in the method group from a static
10785         context, and report error 120 if so.
10786
10787         * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
10788         Error118. 
10789
10790         * typemanager.cs: Add intermediate namespaces (if a namespace A.B
10791         is created, we create the A namespace).
10792
10793         * cs-parser.jay: A namespace also introduces a DeclarationFound.
10794         Fixes #41591
10795
10796 2003-04-18  Miguel de Icaza  <miguel@ximian.com>
10797
10798         * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
10799         invocation to ModuleBuilder.GetType with the same values will
10800         return a new type instance, so we need to cache its return
10801         values. 
10802
10803         * expression.cs (Binary.ResolveOperator): Only allow the compare
10804         operators on enums if they are of the same type.
10805
10806         * ecore.cs (Expression.ImplicitReferenceConversion): handle target
10807         types of ValueType on their own case.  Before we were giving them
10808         the same treatment as objects.
10809
10810         * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
10811         fullname.  Short name is used to compare against container name.
10812         Fullname is used to check against defined namespace names.
10813
10814         * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
10815         AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
10816
10817         (Method.CheckBase): Call parent.
10818         (MemberBase.CheckBase): Check for protected members on sealed
10819         classes.
10820         (PropertyBase.CheckBase): Call parent.
10821         (Field.Define): Call parent.
10822
10823         * report.cs: Negative error codes are now mapped to 8000 - code,
10824         so that the display is render more nicely.
10825
10826         * typemanager.cs: Do not use try/catch, instead report a regular
10827         error. 
10828
10829         (GetPointerType, GetReferenceType): These methods provide
10830         mechanisms to obtain the T* and T& from a T.  We had the code
10831         previously scattered around the code base, and it also used
10832         TypeManager.LookupType that would go through plenty of caches.
10833         This one goes directly to the type source.
10834
10835         In some places we did the Type.GetType followed by
10836         ModuleBuilder.GetType, but not in others, so this unifies the
10837         processing as well.
10838
10839         * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
10840         statements now that we have namespace information.
10841
10842         * typemanager.cs (IsNamespace): New method, returns whether the
10843         string presented is a namespace or not.
10844
10845         (ComputeNamespaces): New public entry point, computes the list of
10846         available namespaces, using the GetNamespaces API call in Mono, or
10847         the slower version in MS.NET.   
10848
10849         Now before we start the semantic analysis phase, we have a
10850         complete list of namespaces including everything that the user has
10851         provided.
10852
10853         Deleted old code to cache namespaces in .nsc files.
10854
10855 2003-04-17  Miguel de Icaza  <miguel@ximian.com>
10856
10857         * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
10858         class/struct location definition Location for the implicit
10859         constructor location.
10860
10861         (Operator.Define): Use the location of the operator for the
10862         implicit Method definition.
10863
10864         (Constructor.Emit): use the constructor location for the implicit
10865         base initializer constructor.
10866
10867         * ecore.cs: Remove ITypeExpression.  This interface is now gone,
10868         and the Expression class now contains two new methods:
10869
10870         ResolveAsTypeStep and ResolveAsTypeTerminal.  This is used to
10871         isolate type lookup from the rest of the resolution process.
10872
10873         Since we use Expressions to hold type definitions due to the way
10874         we parse the input we have historically overloaded Resolve to
10875         perform the Type lookups if a special flag is passed.  Now this is
10876         eliminated and two methods take their place. 
10877
10878         The differences in the two methods between xStep and xTerminal is
10879         that xStep is involved in our current lookup system that uses
10880         SimpleNames to compose a name, while xTerminal is used just to
10881         catch the case where the simplename lookup failed.
10882
10883 2003-04-16  Miguel de Icaza  <miguel@ximian.com>
10884
10885         * expression.cs (ResolveMemberAccess): Remove redundant code.
10886         TypeExpr expressions are always born fully resolved.
10887
10888         * interface.cs (PopulateMethod): Do not lookup the types twice.
10889         We were doing it once during SemanticAnalysis and once during
10890         PopulateMethod.
10891
10892         * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
10893         in local variable type definitions, were being returned as a
10894         SimpleName (we decomposed everything into a string), that is
10895         because primary_expression was being used instead of a type in the
10896         grammar (reduce/reduce conflicts).
10897
10898         The part that was wrong is that we converted the expression into a
10899         string (an oversimplification in one hand, compounded with primary
10900         expressions doing string concatenation).
10901
10902         So things like:
10903
10904         A.B.C [] x;
10905
10906         Would return "A.B.C[]" as a SimpleName.  This stopped things like
10907         using clauses from working on this particular context.  And a type
10908         was being matched directly against "A.B.C[]".
10909
10910         We now use the correct approach, and allow for ComposedCast to be
10911         part of the unary expression.  So the "A.B.C []" become a composed
10912         cast of "A.B.C" (as a nested group of MemberAccess with a
10913         SimpleName at the end) plus the rank composition "[]". 
10914
10915         Also fixes 35567
10916
10917 2003-04-10  Miguel de Icaza  <miguel@ximian.com>
10918
10919         * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
10920         for the access level checking.
10921
10922         * class.cs: Cosmetic changes.  Renamed `TypeContainer parent' to
10923         `TypeContainer container', because I kept getting confused when I
10924         was debugging this code.
10925
10926         * expression.cs (Indexers): Instead of tracking getters/setters,
10927         we now track them in parallel.  We create one arraylist less, but
10928         most importantly it is possible now for the LValue code to find a
10929         matching get for a set.
10930
10931         (IndexerAccess.DoResolveLValue): Update the code.
10932         GetIndexersForType has been modified already to extract all the
10933         indexers from a type.  The code assumed it did not.
10934
10935         Also make the code set the correct return type for the indexer.
10936         This was fixed a long time ago for properties, but was missing for
10937         indexers.  It used to be void_type.
10938
10939         (Binary.Emit): Test first for doubles instead of
10940         floats, as they are more common.
10941
10942         (Binary.EmitBranchable): Use the .un version of the branch opcodes
10943         when dealing with floats and the <=, >= operators.  This fixes bug
10944         #39314 
10945
10946         * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
10947         to load the array value by emitting a load on the foreach variable
10948         type.  This was incorrect.  
10949
10950         We now emit the code to load an element using the the array
10951         variable type, and then we emit the conversion operator.
10952
10953         Fixed #40176
10954
10955 2003-04-10  Zoltan Varga  <vargaz@freemail.hu>
10956
10957         * attribute.cs: Avoid allocation of ArrayLists in the common case.
10958
10959 2003-04-09  Miguel de Icaza  <miguel@ximian.com>
10960
10961         * class.cs (MethodSignature.InheritableMemberSignatureCompare):
10962         test for protection before we test for signatures. 
10963
10964         (MethodSignature.ToString): implement.
10965
10966         * expression.cs (Unary.TryReduceNegative): Add missing minus sign
10967         to the case where we reduced into a LongConstant.
10968
10969         * decl.cs (CheckAccessLevel): If the type is an array, we can not
10970         depend on whether the information is acurrate, because the
10971         Microsoft runtime will always claim that the array type is public,
10972         regardless of the real state.
10973
10974         If the type is a pointer, another problem happens: the type is
10975         reported as non-public in Microsoft.  
10976
10977         In both cases we have to call CheckAccessLevel recursively with
10978         the underlying type as the argument to be tested.
10979
10980 2003-04-08  Miguel de Icaza  <miguel@ximian.com>
10981
10982         * assign.cs (Assign.Emit): If we are dealing with a compound
10983         assignment expression, we should use the code path that stores the
10984         intermediate result in a temporary value.  This fixes #40903.
10985
10986         *expression.cs (Indirection.ToString): Provide ToString method for
10987         debugging. 
10988
10989 2003-04-08  Zoltan Varga  <vargaz@freemail.hu>
10990
10991         * class.cs: Null out fields holding references to Block objects so
10992         they can be garbage collected.
10993
10994         * expression.cs (OverloadResolve): Remove unused local.
10995
10996 2003-04-07  Martin Baulig  <martin@ximian.com>
10997
10998         * codegen.cs (EmitContext.CurrentFile): New public field.
10999         (EmitContext.Mark): Use the CurrentFile to check whether the
11000         location is in the correct file.
11001         (EmitContext.EmitTopBlock): Initialize CurrentFile here.
11002
11003 2003-04-07  Martin Baulig  <martin@ximian.com>
11004
11005         * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
11006
11007         * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
11008         location.  [FIXME: The location argument which gets passed to this
11009         method is sometimes wrong!]
11010
11011 2003-04-07  Nick Drochak <ndrochak@gol.com>
11012
11013         * codegen.cs: Be more verbose when we can't find the symbol writer dll.
11014
11015 2003-04-07  Miguel de Icaza  <miguel@ximian.com>
11016
11017         * expression.cs (Indirection.EmitAssign): We were using the
11018         temporary, but returning immediately instead of continuing the
11019         EmitAssing flow.
11020
11021 2003-04-06  Martin Baulig  <martin@ximian.com>
11022
11023         * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
11024         if it's a nested child, but also deriving from the outer class.
11025         See test 190.cs.
11026
11027         * typemanager.cs (IsNestedChildOf): Make this work if it's a
11028         nested child, but also deriving from the outer class.  See
11029         test-190.cs.
11030         (FilterWithClosure): We may access private members of the outer
11031         class if we're a nested child and deriving from the outer class.
11032         (RealMemberLookup): Only set `closure_private_ok' if the
11033         `original_bf' contained BindingFlags.NonPublic.
11034
11035 2003-04-05  Martin Baulig  <martin@ximian.com>
11036
11037         * expression.cs (SizeOf.DoResolve): Use ResolveTypeExpr, so we can
11038         probe if its a type parameter, and if so, flag an error.
11039
11040         * decl.cs: Move here the SetParameterInfo code from class.cs.
11041         Handle IsGeneric here.
11042
11043         Handle a variety of errors in the parameter info definition.
11044
11045         * ecore.cs (SimpleName.DoResolveType): Handle look ups for generic
11046         type parameters here.
11047
11048         * cs-parser.jay (class_declaration): report errors for parameters
11049         here as well.
11050
11051 2003-01-21  Miguel de Icaza  <miguel@ximian.com>
11052
11053         * generic.cs: New file, contains support code for generics.
11054
11055         * cs-parser.jay: Remove OP_SHIFT_LEFT, OP_SHIFT_RIGHT,
11056         OP_SHIFT_LEFT_ASSIGN, OP_SHIFT_RIGHT_ASSIGN.
11057
11058         Update parser for the above removals.
11059
11060         * cs-tokenizer.cs: Do not handle <<= or >>= specially.  This is
11061         now taken care of in the parser.
11062
11063 2003-04-02  Miguel de Icaza  <miguel@ximian.com>
11064
11065         * class.cs (Event.Define): Do not allow abstract events to have
11066         initializers. 
11067
11068 2003-04-01  Miguel de Icaza  <miguel@ximian.com>
11069
11070         * cs-parser.jay: Add error productions for ADD/REMOVE missing a
11071         block in event declarations.
11072
11073         * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
11074         value type, get its address.
11075
11076         * expression.cs (Is.Emit): For action `LeaveOnStack' we were
11077         leaving a class on the stack instead of a boolean value (int
11078         0/1).  Change the code so we compare against null, and then the
11079         result against zero.
11080
11081         * class.cs (TypeContainer.GetClassBases): We were checking for the
11082         parent class being sealed too late.
11083
11084         * expression.cs (Binary.Emit): For <= and >= when dealing with
11085         floating point values, use cgt.un and clt.un instead of cgt and
11086         clt alone.
11087
11088 2003-04-01  Zoltan Varga  <vargaz@freemail.hu>
11089
11090         * statement.cs: Apply the same optimization as MS: skip the 
11091         GetEnumerator returning an IEnumerator, and use the one returning a 
11092         CharEnumerator instead. This allows us to avoid the try-finally block 
11093         and the boxing.
11094
11095 2003-03-31  Gaurav Vaish <gvaish_mono@lycos.com>
11096
11097         * cs-parser.jay: Attributes cannot be applied to
11098                          namespaces. Fixes #40473
11099
11100 2003-03-31  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11101
11102         * class.cs:
11103         (Add*): check if the name is valid using the full name for constants,
11104         fields, properties and events.
11105
11106 2003-03-28  Miguel de Icaza  <miguel@ximian.com>
11107
11108         * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
11109         char constants to be part of the enumeration.
11110
11111         * expression.cs (Conditional.DoResolve): Add support for operator
11112         true. Implements the missing functionality from 14.12
11113
11114         * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
11115         operator true/false as required by the spec.
11116
11117         * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
11118         implicit conversion to boolean.
11119
11120         * statement.cs (Statement.ResolveBoolean): A boolean expression is
11121         also one where the type implements `operator true'. 
11122
11123         * ecore.cs (Expression.GetOperatorTrue): New helper routine to
11124         get an expression that will invoke operator true based on an
11125         expression.  
11126
11127         (GetConversionOperators): Removed the hack that called op_True
11128         here.  
11129
11130         (Expression.ResolveBoolean): Move this from Statement.
11131
11132 2003-03-17  Miguel de Icaza  <miguel@ximian.com>
11133
11134         * ecore.cs (FieldExpr): do not allow initialization of initonly
11135         fields on derived classes
11136
11137 2003-03-13  Martin Baulig  <martin@ximian.com>
11138
11139         * statement.cs (Block.Emit): Call ig.BeginScope() and
11140         ig.EndScope() when compiling with debugging info; call
11141         LocalBuilder.SetLocalSymInfo _after_ opening the scope.
11142
11143 2003-03-08  Miguel de Icaza  <miguel@ximian.com>
11144
11145         * expression.cs (Indexers): Do not construct immediately, allow
11146         for new members to be appended as we go.  Fixes 38143
11147
11148 2003-03-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11149
11150         * expression.cs: save/restore context when resolving an unchecked
11151         expression.
11152
11153 2003-03-05  Miguel de Icaza  <miguel@ximian.com>
11154
11155         * cfold.cs: Catch division by zero in modulus operator during
11156         constant folding.
11157
11158 2003-03-03  Miguel de Icaza  <miguel@ximian.com>
11159
11160         * interface.cs (Interface.DefineMembers): Avoid defining members
11161         twice. 
11162
11163 2003-02-27  Miguel de Icaza  <miguel@ximian.com>
11164
11165         * driver.cs: handle the +/- options for -noconfig
11166
11167         * statement.cs (Unckeched.Resolve): Also track the state of
11168         unchecked in the Resolve phase.
11169
11170 2003-02-27  Martin Baulig  <martin@ximian.com>
11171
11172         * ecore.cs (Expression.MemberLookup): Don't create a
11173         MethodGroupExpr for something which is not a method.  Fixes #38291.
11174
11175 2003-02-25  Miguel de Icaza  <miguel@ximian.com>
11176
11177         * class.cs (MemberBase.CheckParameters): Also check that the type
11178         is unmanaged if it is a pointer.
11179
11180         * expression.cs (SizeOf.Resolve): Add location information.
11181
11182         * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
11183         a managed type is declared.
11184
11185         * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
11186         parameter modifiers as well.  Fixes bug 38606
11187
11188         * class.cs: Very sad.  Am backing out the speed up changes
11189         introduced by the ArrayList -> Array in the TypeContainer, as they
11190         were not actually that much faster, and introduced a bug (no error
11191         reports on duplicated methods).
11192
11193         * assign.cs (CompoundAssign.DoLResolve): Resolve the original
11194         source first, this will guarantee that we have a valid expression
11195         before calling in lower levels functions that will require a
11196         resolved object.  Then use this original_source in the
11197         target.ResolveLValue instead of the original source that was
11198         passed to us.
11199
11200         Another change.  Use target.Resolve instead of LValueResolve.
11201         Although we are resolving for LValues, we will let the Assign code
11202         take care of that (it will be called again from Resolve).  This
11203         basically allows code like this:
11204
11205         class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
11206         class Y { void A (X x) { x [0] += o; }
11207
11208         The problem was that the indexer was trying to resolve for
11209         set_Item (idx, object o) and never finding one.  The real set_Item
11210         was set_Item (idx, X).  By delaying the process we get the right
11211         semantics. 
11212
11213         Fixes bug 36505
11214
11215 2003-02-23  Martin Baulig  <martin@ximian.com>
11216
11217         * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
11218         while calling DoEmit ().
11219
11220         * codegen.cs (EmitContext.Mark): Don't mark locations in other
11221         source files; if you use the #line directive inside a method, the
11222         compiler stops emitting line numbers for the debugger until it
11223         reaches the end of the method or another #line directive which
11224         restores the original file.
11225
11226 2003-02-23  Martin Baulig  <martin@ximian.com>
11227
11228         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
11229
11230 2003-02-23  Martin Baulig  <martin@ximian.com>
11231
11232         * statement.cs (Block.AddChildVariableNames): We need to call this
11233         recursively, not just for our immediate children.
11234
11235 2003-02-23  Martin Baulig  <martin@ximian.com>
11236
11237         * class.cs (Event.Define): Always make the field private, like csc does.
11238
11239         * typemanager.cs (TypeManager.RealMemberLookup): Make events
11240         actually work, fixes bug #37521.
11241
11242 2003-02-23  Miguel de Icaza  <miguel@ximian.com>
11243
11244         * delegate.cs: When creating the various temporary "Parameters"
11245         classes, make sure that we call the ComputeAndDefineParameterTypes
11246         on those new parameters (just like we do with the formal ones), to
11247         allow them to be resolved in the context of the DeclSpace.
11248
11249         This fixes the bug that Dick observed in Bugzilla #38530.
11250
11251 2003-02-22  Miguel de Icaza  <miguel@ximian.com>
11252
11253         * expression.cs (ResolveMemberAccess): When resolving a constant,
11254         do not attempt to pull a constant if the value was not able to
11255         generate a valid constant.
11256
11257         * const.cs (LookupConstantValue): Do not report more errors than required.
11258
11259 2003-02-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11260
11261         * expression.cs: fixes bug #38328.
11262
11263 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
11264
11265         * class.cs: Changed all the various members that can be part of a
11266         class from being an ArrayList to be an Array of the right type.
11267         During the DefineType type_list, interface_list, delegate_list and
11268         enum_list are turned into types, interfaces, delegates and enums
11269         arrays.  
11270
11271         And during the member population, indexer_list, event_list,
11272         constant_list, field_list, instance_constructor_list, method_list,
11273         operator_list and property_list are turned into their real arrays.
11274
11275         Although we could probably perform this operation earlier, for
11276         good error reporting we need to keep the lists and remove the
11277         lists for longer than required.
11278
11279         This optimization was triggered by Paolo profiling the compiler
11280         speed on the output of `gen-sample-program.pl' perl script. 
11281
11282         * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
11283         not crash in methods like MemberLookupFailed that use this field.  
11284
11285         This problem arises when the compiler fails to resolve a type
11286         during interface type definition for example.
11287
11288 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
11289
11290         * expression.cs (Indexers.GetIndexersForType): Interfaces do not
11291         inherit from System.Object, so we have to stop at null, not only
11292         when reaching System.Object.
11293
11294 2003-02-17  Miguel de Icaza  <miguel@ximian.com>
11295
11296         * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
11297         DeclaredOnly because the parent indexer might have had a different
11298         name, but did not loop until the top of the hierarchy was reached.
11299
11300         The problem this one fixes is 35492: when a class implemented an
11301         indexer from an interface, we were getting the interface method
11302         (which was abstract) and we were flagging an error (can not invoke
11303         abstract method).
11304
11305         This also keeps bug 33089 functioning, and test-148 functioning.
11306
11307         * typemanager.cs (IsSpecialMethod): The correct way of figuring
11308         out if a method is special is to see if it is declared in a
11309         property or event, or whether it is one of the predefined operator
11310         names.   This should fix correctly #36804.
11311
11312 2003-02-15  Miguel de Icaza  <miguel@ximian.com>
11313
11314         The goal here is to remove the dependency on EmptyCast.Peel ().
11315         Killing it completely.
11316
11317         The problem is that currently in a number of places where
11318         constants are expected, we have to "probe" for an EmptyCast, and
11319         Peel, which is not the correct thing to do, as this will be
11320         repetitive and will likely lead to errors. 
11321
11322         The idea is to remove any EmptyCasts that are used in casts that
11323         can be reduced to constants, so we only have to cope with
11324         constants. 
11325
11326         This bug hunt was triggered by Bug 37363 and the desire to remove
11327         the duplicate pattern where we were "peeling" emptycasts to check
11328         whether they were constants.  Now constants will always be
11329         constants.
11330
11331         * ecore.cs: Use an enumconstant here instead of wrapping with
11332         EmptyCast.  
11333
11334         * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
11335         throwing me off.  By handling this we can get rid of a few hacks.
11336
11337         * statement.cs (Switch): Removed Peel() code.
11338
11339 2003-02-14  Miguel de Icaza  <miguel@ximian.com>
11340
11341         * class.cs: Location information for error 508
11342
11343         * expression.cs (New.DoResolve): Add a guard against double
11344         resolution of an expression.  
11345
11346         The New DoResolve might be called twice when initializing field
11347         expressions (see EmitFieldInitializers, the call to
11348         GetInitializerExpression will perform a resolve on the expression,
11349         and later the assign will trigger another resolution
11350
11351         This leads to bugs (#37014)
11352
11353         * delegate.cs: The signature for EndInvoke should contain any ref
11354         or out parameters as well.  We were not doing this in the past. 
11355
11356         * class.cs (Field.Define): Do not overwrite the type definition
11357         inside the `volatile' group.  Turns out that volatile enumerations
11358         were changing the type here to perform a validity test, which
11359         broke conversions. 
11360
11361 2003-02-12  Miguel de Icaza  <miguel@ximian.com>
11362
11363         * ecore.cs (FieldExpr.AddressOf): In the particular case of This
11364         and structs, we do not want to load the instance variable
11365
11366         (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
11367         enum_type has to be handled like an object reference (implicit
11368         conversions exists from this to object), but the regular IsClass
11369         and IsValueType tests will never return true for this one.
11370
11371         Also we use TypeManager.IsValueType instead of type.IsValueType,
11372         just for consistency with the rest of the code (this is only
11373         needed if we ever use the construct exposed by test-180.cs inside
11374         corlib, which we dont today).
11375
11376 2003-02-12  Zoltan Varga  <vargaz@freemail.hu>
11377
11378         * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
11379         just InternalCall.
11380
11381 2003-02-09  Martin Baulig  <martin@ximian.com>
11382
11383         * namespace.cs (Namespace..ctor): Added SourceFile argument.
11384         (Namespace.DefineNamespaces): New static public method; this is
11385         called when we're compiling with debugging to add all namespaces
11386         to the symbol file.
11387
11388         * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
11389         pass it to the Namespace's .ctor.
11390
11391         * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
11392         and MethodBase arguments; pass the namespace ID to the symwriter;
11393         pass the MethodBase instead of the token to the symwriter.
11394         (SymbolWriter.DefineNamespace): New method to add a namespace to
11395         the symbol file.
11396
11397 2003-02-09  Martin Baulig  <martin@ximian.com>
11398
11399         * symbolwriter.cs: New file.  This is a wrapper around
11400         ISymbolWriter with a cleaner API.  We'll dynamically Invoke()
11401         methods here in near future.
11402
11403 2003-02-09  Martin Baulig  <martin@ximian.com>
11404
11405         * codegen.cs (EmitContext.Mark): Just pass the arguments to
11406         ILGenerator.MarkSequencePoint() which are actually used by the
11407         symbol writer.
11408
11409 2003-02-09  Martin Baulig  <martin@ximian.com>
11410
11411         * location.cs (SourceFile): New public sealed class.  This
11412         contains the name and an index which is used in the location's token.
11413         (Location): Reserve an appropriate number of bits in the token for
11414         the source file instead of walking over that list, this gives us a
11415         really huge performance improvement when compiling with debugging.
11416
11417         * driver.cs (Driver.parse, Driver.tokenize_file): Take a
11418         `SourceFile' argument instead of a string.
11419         (Driver.ProcessFile): Add all the files via Location.AddFile(),
11420         but don't parse/tokenize here, we need to generate the list of all
11421         source files before we do that.
11422         (Driver.ProcessFiles): New static function.  Parses/tokenizes all
11423         the files.
11424
11425         * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
11426         instead of a string.
11427
11428         * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
11429         of a string.
11430
11431 2003-02-09  Martin Baulig  <martin@ximian.com>
11432
11433         * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
11434         filename on `#line default'.
11435
11436 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
11437
11438         * statement.cs: don't clear the pinned var when the fixed statement
11439         returns from the method (fixes bug#37752).
11440
11441 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
11442
11443         * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban) 
11444         to IsValueType.
11445
11446 2003-02-07  Martin Baulig  <martin@ximian.com>
11447
11448         * driver.cs: Removed the `--debug-args' command line argument.
11449
11450         * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
11451         automatically by the AsssemblyBuilder.
11452         (CodeGen.InitializeSymbolWriter): We don't need to call any
11453         initialization function on the symbol writer anymore.  This method
11454         doesn't take any arguments.
11455
11456 2003-02-03  Miguel de Icaza  <miguel@ximian.com>
11457
11458         * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
11459         from referenced assemblies as well.
11460
11461 2003-02-02  Martin Baulig  <martin@ximian.com>
11462
11463         * class.cs (MethodData.Emit): Generate debugging info for external methods.
11464
11465 2003-02-02  Martin Baulig  <martin@ximian.com>
11466
11467         * class.cs (Constructor.Emit): Open the symbol writer before
11468         emitting the constructor initializer.
11469         (ConstructorInitializer.Emit): Call ec.Mark() to allow
11470         single-stepping through constructor initializers.
11471
11472 2003-01-30  Miguel de Icaza  <miguel@ximian.com>
11473
11474         * class.cs: Handle error 549: do not allow virtual methods in
11475         sealed classes. 
11476
11477 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
11478
11479         * decl.cs: Check access levels when resolving types
11480
11481 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
11482
11483         * statement.cs: Add parameters and locals set in catch blocks that might 
11484         return to set vector
11485
11486 2003-01-29  Miguel de Icaza  <miguel@ximian.com>
11487
11488         * class.cs (Operator): Set the SpecialName flags for operators.
11489
11490         * expression.cs (Invocation.DoResolve): Only block calls to
11491         accessors and operators on SpecialName methods.
11492
11493         (Cast.TryReduce): Handle conversions from char constants.
11494
11495
11496 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
11497
11498         * statement.cs: small memory and time optimization in FlowBranching.
11499
11500 2003-01-28  Pedro Mart  <yoros@wanadoo.es>
11501
11502         * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
11503         problem that the last fix but in the other sid (Set).
11504
11505         * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
11506         access when there is no indexer in the hierarchy.
11507
11508 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
11509
11510         * class.cs: Combine some if statements.
11511
11512 2003-01-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11513
11514         * driver.cs: fixed bug #37187.
11515
11516 2003-01-27  Pedro Martinez Juliá  <yoros@wanadoo.es>
11517
11518         * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
11519         any indexer, it's needed to build a list with all the indexers in the
11520         hierarchy (AllGetters), else we have problems. Fixes #35653.
11521
11522 2003-01-23  Miguel de Icaza  <miguel@ximian.com>
11523
11524         * class.cs (MethodData.Define): It is wrong for an interface
11525         implementation to be static in both cases: explicit and implicit.
11526         We were only handling this in one case.
11527
11528         Improve the if situation there to not have negations.
11529
11530         * class.cs (Field.Define): Turns out that we do not need to check
11531         the unsafe bit on field definition, only on usage.  Remove the test.
11532
11533 2003-01-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11534
11535         * driver.cs: use assembly.Location instead of Codebase (the latest
11536         patch made mcs fail when using MS assemblies).
11537
11538 2003-01-21  Tim Haynes <thaynes@openlinksw.com>
11539
11540         * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
11541         get the path to *corlib.dll.
11542
11543 2003-01-21  Nick Drochak <ndrochak@gol.com>
11544
11545         * cs-tokenizer.cs:
11546         * pending.cs:
11547         * typemanager.cs: Remove compiler warnings
11548
11549 2003-01-20  Duncan Mak  <duncan@ximian.com>
11550
11551         * AssemblyInfo.cs: Bump the version number to 0.19.
11552
11553 2003-01-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11554
11555         * cs-tokenizer.cs: little fixes to line numbering when #line is used.
11556
11557 2003-01-18  Zoltan Varga  <vargaz@freemail.hu>
11558
11559         * class.cs (Constructor::Emit): Emit debugging info for constructors.
11560
11561 2003-01-17  Miguel de Icaza  <miguel@ximian.com>
11562
11563         * cs-parser.jay: Small fix: we were not comparing the constructor
11564         name correctly.   Thanks to Zoltan for the initial pointer.
11565
11566 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
11567
11568         * cs-tokenizer.cs: Set file name when specified with #line
11569
11570 2003-01-15  Miguel de Icaza  <miguel@ximian.com>
11571
11572         * cs-parser.jay: Only perform the constructor checks here if we
11573         are named like the class;  This will help provider a better
11574         error.  The constructor path is taken when a type definition is
11575         not found, but most likely the user forgot to add the type, so
11576         report that rather than the constructor error.
11577
11578 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
11579
11580         * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
11581         allocations.
11582
11583 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
11584
11585         * cs-parser.jay: Add cleanup call.
11586
11587 2003-01-13  Duncan Mak  <duncan@ximian.com>
11588
11589         * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
11590         consistent with other methods.
11591
11592 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
11593
11594         * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
11595
11596 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
11597
11598         * attribute.cs: only set GuidAttr to true when we have a
11599         GuidAttribute.
11600
11601 2003-01-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11602
11603         * ecore.cs:
11604         * expression.cs:
11605         * typemanager.cs: fixes to allow mcs compile corlib with the new
11606         Type.IsSubclassOf fix.
11607
11608 2003-01-08  Miguel de Icaza  <miguel@ximian.com>
11609
11610         * expression.cs (LocalVariableReference.DoResolve): Classify a
11611         constant as a value, not as a variable.   Also, set the type for
11612         the variable.
11613
11614         * cs-parser.jay (fixed_statement): take a type instead of a
11615         pointer_type, so we can produce a better error message later.
11616
11617         * statement.cs (Fixed.Resolve): Flag types that are not pointers
11618         as an error.  
11619
11620         (For.DoEmit): Make inifinite loops have a
11621         non-conditional branch back.
11622
11623         (Fixed.DoEmit): First populate the pinned variables, then emit the
11624         statement, then clear the variables.  Before I was emitting the
11625         code once for each fixed piece.
11626
11627
11628 2003-01-08  Martin Baulig  <martin@ximian.com>
11629
11630         * statement.cs (FlowBranching.MergeChild): A break in a
11631         SWITCH_SECTION does not leave a loop.  Fixes #36155.
11632
11633 2003-01-08  Martin Baulig  <martin@ximian.com>
11634
11635         * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
11636         lives in the same number space than `param_map'.  Fixes #36154.
11637
11638 2003-01-07  Miguel de Icaza  <miguel@ximian.com>
11639
11640         * cs-parser.jay (constructor_declaration): Set the
11641         Constructor.ModFlags before probing for it.  This makes the
11642         compiler report 514, 515 and 132 (the code was there, but got
11643         broken). 
11644
11645         * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
11646         (GotoDefault.Resolve): Set `Returns' to ALWAYS.
11647         (GotoCase.Resolve): Set `Returns' to ALWAYS.
11648
11649 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
11650
11651         * enum.cs: create the enum static fields using the enum type.
11652
11653 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
11654
11655         * class.cs: don't try to create the ParamBuilder for the return
11656         type if it's not needed (and handle it breaking for the ms runtime
11657         anyway).
11658
11659 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
11660
11661         * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
11662
11663 2002-12-29  Miguel de Icaza  <miguel@ximian.com>
11664
11665         * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
11666         the command.   This showed up while compiling the JANET source
11667         code, which used \r as its only newline separator.
11668
11669 2002-12-28  Miguel de Icaza  <miguel@ximian.com>
11670
11671         * class.cs (Method.Define): If we are an operator (because it
11672         reuses our code), then set the SpecialName and HideBySig.  #36128
11673
11674 2002-12-22  Miguel de Icaza  <miguel@ximian.com>
11675
11676         * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
11677         exception, report error 120 `object reference required'.
11678
11679         * driver.cs: Add --pause option, used during to measure the size
11680         of the process as it goes with --timestamp.
11681
11682         * expression.cs (Invocation.DoResolve): Do not allow methods with
11683         SpecialName to be invoked.
11684
11685 2002-12-21  Miguel de Icaza  <miguel@ximian.com>
11686
11687         * cs-tokenizer.cs: Small fix to the parser: compute the ascii
11688         number before adding it.
11689
11690 2002-12-21  Ravi Pratap  <ravi@ximian.com>
11691
11692         * ecore.cs (StandardImplicitConversion): When in an unsafe
11693         context, we allow conversion between void * to any other pointer
11694         type. This fixes bug #35973.
11695
11696 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
11697
11698         * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
11699         is not thrown when extensionless outputs are used 
11700
11701 2002-12-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11702
11703         * rootcontext.cs: fixed compilation of corlib.
11704
11705 2002-12-19  Miguel de Icaza  <miguel@ximian.com>
11706
11707         * attribute.cs (Attributes.Contains): Add new method.
11708
11709         * class.cs (MethodCore.LabelParameters): if the parameter is an
11710         `out' parameter, check that no attribute `[In]' has been passed.
11711
11712         * enum.cs: Handle the `value__' name in an enumeration.
11713
11714 2002-12-14  Jaroslaw Kowalski <jarek@atm.com.pl>
11715
11716         * decl.cs: Added special case to allow overrides on "protected
11717         internal" methods
11718
11719 2002-12-18  Ravi Pratap  <ravi@ximian.com>
11720
11721         * attribute.cs (Attributes.AddAttributeSection): Rename to this
11722         since it makes much more sense.
11723
11724         (Attributes.ctor): Don't require a Location parameter.
11725
11726         * rootcontext.cs (AddGlobalAttributeSection): Rename again.
11727
11728         * attribute.cs (ApplyAttributes): Remove extra Location parameters
11729         since we already have that information per attribute.
11730
11731         * everywhere : make appropriate changes.
11732
11733         * class.cs (LabelParameters): Write the code which actually
11734         applies attributes to the return type. We can't do this on the MS
11735         .NET runtime so we flag a warning in the case an exception is
11736         thrown.
11737
11738 2002-12-18  Miguel de Icaza  <miguel@ximian.com>
11739
11740         * const.cs: Handle implicit null conversions here too.
11741
11742 2002-12-17  Ravi Pratap  <ravi@ximian.com>
11743
11744         * class.cs (MethodCore.LabelParameters): Remove the extra
11745         Type [] parameter since it is completely unnecessary. Instead
11746         pass in the method's attributes so that we can extract
11747         the "return" attribute.
11748
11749 2002-12-17  Miguel de Icaza  <miguel@ximian.com>
11750
11751         * cs-parser.jay (parse): Use Report.Error to flag errors instead
11752         of ignoring it and letting the compile continue.
11753
11754         * typemanager.cs (ChangeType): use an extra argument to return an
11755         error condition instead of throwing an exception.
11756
11757 2002-12-15  Miguel de Icaza  <miguel@ximian.com>
11758
11759         * expression.cs (Unary.TryReduce): mimic the code for the regular
11760         code path.  Perform an implicit cast in the cases where we can
11761         implicitly convert to one of the integral types, and then reduce
11762         based on that constant.   This fixes bug #35483.
11763
11764 2002-12-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11765
11766         * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
11767
11768 2002-12-13  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11769
11770         * namespace.cs: fixed bug #35489.
11771
11772 2002-12-12  Miguel de Icaza  <miguel@ximian.com>
11773
11774         * class.cs: Remove some dead code.
11775
11776         * cs-parser.jay: Estimate the number of methods needed
11777         (RootContext.MethodCount);
11778
11779         * cs-tokenizer.cs: Use char arrays for parsing identifiers and
11780         numbers instead of StringBuilders.
11781
11782         * support.cs (PtrHashtable): Add constructor with initial size;
11783         We can now reduce reallocations of the method table.
11784
11785 2002-12-10  Ravi Pratap  <ravi@ximian.com>
11786
11787         * attribute.cs (ApplyAttributes): Keep track of the emitted
11788         attributes on a per-target basis. This fixes bug #35413.
11789
11790 2002-12-10  Miguel de Icaza  <miguel@ximian.com>
11791
11792         * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
11793         default to the Windows 1252 encoding.
11794
11795         (UnixParseOption): Support version, thanks to Alp for the missing
11796         pointer. 
11797
11798         * AssemblyInfo.cs: Add nice assembly information.
11799
11800         * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
11801         (bug 35169).
11802
11803         * cs-parser.jay: Allow a trailing comma before the close bracked
11804         in the attribute_section production.
11805
11806         * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
11807         address of the instance was being taken, I will take this out,
11808         because we take the address of the object immediately here.
11809
11810 2002-12-09  Ravi Pratap  <ravi@ximian.com>
11811
11812         * typemanager.cs (AreMultipleAllowed): Take care of the most
11813         obvious case where attribute type is not in the current assembly -
11814         stupid me ;-)
11815
11816 2002-12-08  Miguel de Icaza  <miguel@ximian.com>
11817
11818         * ecore.cs (SimpleName.DoResolve): First perform lookups on using
11819         definitions, instead of doing that afterwards.  
11820
11821         Also we use a nice little hack, depending on the constructor, we
11822         know if we are a "composed" name or a simple name.  Hence, we
11823         avoid the IndexOf test, and we avoid 
11824
11825         * codegen.cs: Add code to assist in a bug reporter to track down
11826         the source of a compiler crash. 
11827
11828 2002-12-07  Ravi Pratap  <ravi@ximian.com>
11829
11830         * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
11831         types have been emitted for a given element and flag an error
11832         if something which does not have AllowMultiple set is used more
11833         than once.
11834
11835         * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
11836         attribute types and their corresponding AllowMultiple properties
11837
11838         (AreMultipleAllowed): Check the property for a given type.
11839
11840         * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
11841         property in the case we have a TypeContainer.
11842
11843         (Attributes.AddAttribute): Detect duplicates and just skip on
11844         adding them. This trivial fix catches a pretty gross error in our
11845         attribute emission - global attributes were being emitted twice!
11846
11847         Bugzilla bug #33187 is now fixed.
11848
11849 2002-12-06  Miguel de Icaza  <miguel@ximian.com>
11850
11851         * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
11852         instead of pp_and).
11853
11854         * expression.cs (Binary.ResolveOperator): I can only use the
11855         Concat (string, string, string) and Concat (string, string,
11856         string, string) if the child is actually a concatenation of
11857         strings. 
11858
11859 2002-12-04  Miguel de Icaza  <miguel@ximian.com>
11860
11861         * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
11862         context where we need a 2-character lookahead.
11863
11864         * pending.cs (PendingImplementation): Rework so we can keep track
11865         of interface types all the time, and flag those which were
11866         implemented by parents as optional.
11867
11868 2002-12-03  Miguel de Icaza  <miguel@ximian.com>
11869
11870         * expression.cs (Binary.ResolveOperator): Use
11871         String.Concat(string,string,string) or
11872         String.Concat(string,string,string,string) when possible. 
11873
11874         * typemanager: More helper methods.
11875
11876
11877 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
11878
11879         * pending.cs: remove the bogus return from GetMissingInterfaces()
11880         (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
11881
11882 2002-12-02  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11883
11884         * namespace.cs: avoid duplicated 'using xxx' being added to
11885         using_clauses. This prevents mcs from issuing and 'ambiguous type' error
11886         when we get more than one 'using' statement for the same namespace.
11887         Report a CS0105 warning for it.
11888
11889 2002-11-30  Miguel de Icaza  <miguel@ximian.com>
11890
11891         * cs-tokenizer.cs (consume_identifier): use read directly, instead
11892         of calling getChar/putback, uses internal knowledge of it.    
11893
11894         (xtoken): Reorder tokenizer so most common patterns are checked
11895         first.  This reduces the compilation time in another 5% (from 8.11s
11896         average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
11897
11898         The parsing time is 22% of the compilation in mcs, and from that
11899         64% is spent on the tokenization process.  
11900
11901         I tried using a binary search for keywords, but this is slower
11902         than the hashtable.  Another option would be to do a couple of
11903         things:
11904
11905                 * Not use a StringBuilder, instead use an array of chars,
11906                   with a set value.  Notice that this way we could catch
11907                   the 645 error without having to do it *afterwards*.
11908
11909                 * We could write a hand-parser to avoid the hashtable
11910                   compares altogether.
11911
11912         The identifier consumption process takes 37% of the tokenization
11913         time.  Another 15% is spent on is_number.  56% of the time spent
11914         on is_number is spent on Int64.Parse:
11915
11916                 * We could probably choose based on the string length to
11917                   use Int32.Parse or Int64.Parse and avoid all the 64-bit
11918                   computations. 
11919
11920         Another 3% is spend on wrapping `xtoken' in the `token' function.
11921
11922         Handle 0xa0 as whitespace (#34752)
11923
11924 2002-11-26  Miguel de Icaza  <miguel@ximian.com>
11925
11926         * typemanager.cs (IsCLRType): New routine to tell whether a type
11927         is one of the builtin types.  
11928
11929         Maybe it needs to use TypeCodes to be faster.  Maybe we could use
11930         typecode in more places instead of doing pointer comparissions.
11931         We could leverage some knowledge about the way the typecodes are
11932         laid out.
11933
11934         New code to cache namespaces in assemblies, it is currently not
11935         invoked, to be used soon.
11936
11937         * decl.cs (DeclSpace.MakeFQN): Simple optimization.
11938
11939         * expression.cs (Binary.ResolveOperator): specially handle
11940         strings, and do not perform user-defined operator overloading for
11941         built-in types.
11942
11943 2002-11-24  Miguel de Icaza  <miguel@ximian.com>
11944
11945         * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
11946         internalcall as it is a pretty simple operation;  Avoid whenever
11947         possible to call Char.IsLetter.
11948
11949         (consume_identifier): Cut by half the number of
11950         hashtable calls by merging the is_keyword and GetKeyword behavior.
11951
11952         Do not short-circuit, because if we do, we
11953         report errors (ie, #if false && true would produce an invalid
11954         directive error);
11955
11956
11957 2002-11-24  Martin Baulig  <martin@ximian.com>
11958
11959         * expression.cs (Cast.TryReduce): If we're in checked syntax,
11960         check constant ranges and report a CS0221.  Fixes #33186.
11961
11962 2002-11-24  Martin Baulig  <martin@ximian.com>
11963
11964         * cs-parser.jay: Make this work for uninitialized variable
11965         declarations in the `for' initializer.  Fixes #32416.
11966
11967 2002-11-24  Martin Baulig  <martin@ximian.com>
11968
11969         * ecore.cs (Expression.ConvertExplicit): Make casting from/to
11970         System.Enum actually work.  Fixes bug #32269, added verify-6.cs.
11971
11972 2002-11-24  Martin Baulig  <martin@ximian.com>
11973
11974         * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
11975         argument; if true, we also check for user-defined conversions.
11976         This is only needed if both arguments are of a user-defined type.
11977         Fixes #30443, added test-175.cs.
11978         (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
11979
11980         * ecore.cs (Expression.ImplicitUserConversionExists): New method.
11981
11982 2002-11-24  Martin Baulig  <martin@ximian.com>
11983
11984         * expression.cs (ArrayAccess.GetStoreOpcode): New public static
11985         function to get the store opcode.
11986         (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
11987         only emit the Ldelema if the store opcode is Stobj.  You must run
11988         both test-34 and test-167 to test this.  Fixes #34529.
11989
11990 2002-11-23  Martin Baulig  <martin@ximian.com>
11991
11992         * ecore.cs (Expression.MemberLookup): Added additional
11993         `qualifier_type' argument which is used when we're being called
11994         from MemberAccess.DoResolve() and null if we're called from a
11995         SimpleName lookup.
11996         (Expression.MemberLookupFailed): New method to report errors; this
11997         does the CS1540 check and reports the correct error message.
11998
11999         * typemanager.cs (MemberLookup): Added additional `qualifier_type'
12000         argument for the CS1540 check and redone the way how we're dealing
12001         with private members.  See the comment in the source code for details.
12002         (FilterWithClosure): Reverted this back to revision 1.197; renamed
12003         `closure_start_type' to `closure_qualifier_type' and check whether
12004         it's not null.  It was not this filter being broken, it was just
12005         being called with the wrong arguments.
12006
12007         * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
12008         and pass it the correct `qualifier_type'; this also does the error
12009         handling for us.
12010
12011 2002-11-22  Miguel de Icaza  <miguel@ximian.com>
12012
12013         * expression.cs (Invocation.EmitParams): If the we are dealing
12014         with a non-built-in value type, load its address as well.
12015
12016         (ArrayCreation): Use a a pretty constant instead
12017         of the hardcoded value 2.   Use 6 instead of 2 for the number of
12018         static initializers.  
12019
12020         (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
12021         because they are not really value types, just glorified integers. 
12022
12023         * driver.cs: Do not append .exe, the CSC compiler does not do it.
12024
12025         * ecore.cs: Remove redundant code for enumerations, make them use
12026         the same code path as everything else, fixes the casting issue
12027         with enumerations in Windows.Forms.
12028
12029         * attribute.cs: Do only cast to string if it is a string, the
12030         validation happens later.
12031
12032         * typemanager.cs: Temproary hack to avoid a bootstrap issue until
12033         people upgrade their corlibs.
12034
12035         * ecore.cs: Oops, enumerations were not following the entire code path
12036
12037 2002-11-21  Miguel de Icaza  <miguel@ximian.com>
12038
12039         * typemanager.cs (FilterWithClosure): Commented out the test for
12040         1540 in typemanager.cs, as it has problems when accessing
12041         protected methods from a parent class (see test-174.cs). 
12042
12043         * attribute.cs (Attribute.ValidateGuid): new method.
12044         (Attribute.Resolve): Use above.
12045
12046 2002-11-19  Miguel de Icaza  <miguel@ximian.com>
12047
12048         * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
12049
12050         * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
12051         handling for enumerations, as we only needed the TypeContainer
12052         functionality to begin with (this is required for the fix below to
12053         work for enums that reference constants in a container class for
12054         example). 
12055
12056         * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
12057
12058         * enum.cs (Enum.Define): Use `this' instead of parent, so we have
12059         a valid TypeBuilder to perform lookups on.o
12060
12061         * class.cs (InheritableMemberSignatureCompare): Use true in the
12062         call to GetGetMethod and GetSetMethod, because we are comparing
12063         the signature, and we need to get the methods *even* if they are
12064         private. 
12065
12066         (PropertyBase.CheckBase): ditto.
12067
12068         * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
12069         GotoCase.Resolve): Use Peel on EmpytCasts.
12070
12071         * ecore.cs (EmptyCast): drop child, add Peel method.
12072
12073 2002-11-17  Martin Baulig  <martin@ximian.com>
12074
12075         * ecore.cs (EmptyCast.Child): New public property.
12076
12077         * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
12078         label resolved to an EmptyCast.  Fixes #34162.
12079         (GotoCase.Resolve): Likewise.
12080         (Block.EmitMeta): Likewise.
12081
12082 2002-11-17  Martin Baulig  <martin@ximian.com>
12083
12084         * expression.cs (Invocation.BetterConversion): Prefer int over
12085         uint; short over ushort; long over ulong for integer literals.
12086         Use ImplicitConversionExists instead of StandardConversionExists
12087         since we also need to check for user-defined implicit conversions.
12088         Fixes #34165.  Added test-173.cs.
12089
12090 2002-11-16  Martin Baulig  <martin@ximian.com>
12091
12092         * expression.cs (Binary.EmitBranchable): Eliminate comparisions
12093         with the `true' and `false' literals.  Fixes #33151.
12094
12095 2002-11-16  Martin Baulig  <martin@ximian.com>
12096
12097         * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
12098         October 22nd; don't do the cs1540 check for static members.
12099
12100         * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
12101         now using our own filter here and doing the cs1540 check again.
12102
12103 2002-11-16  Martin Baulig  <martin@ximian.com>
12104
12105         * support.cs (InternalParameters): Don't crash if we don't have
12106         any fixed parameters.  Fixes #33532.
12107
12108 2002-11-16  Martin Baulig  <martin@ximian.com>
12109
12110         * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
12111         when looking up static methods to make this work on Windows.
12112         Fixes #33773.
12113
12114 2002-11-16  Martin Baulig  <martin@ximian.com>
12115
12116         * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
12117         a setter rather than using PropertyInfo.CanWrite.
12118
12119 2002-11-15  Nick Drochak  <ndrochak@gol.com>
12120
12121         * class.cs: Allow acces to block member by subclasses. Fixes build
12122         breaker.
12123
12124 2002-11-14  Martin Baulig  <martin@ximian.com>
12125
12126         * class.cs (Constructor.Emit): Added the extern/block check.
12127         Fixes bug #33678.
12128
12129 2002-11-14  Martin Baulig  <martin@ximian.com>
12130
12131         * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
12132         iteration while looking for indexers, this is needed because the
12133         indexer may have a different name in our base classes.  Fixed the
12134         error reporting (no indexers at all, not get accessor, no
12135         overloaded match).  Fixes bug #33089.
12136         (IndexerAccess.DoResolveLValue): Likewise.
12137
12138 2002-11-14  Martin Baulig  <martin@ximian.com>
12139
12140         * class.cs (PropertyBase.CheckBase): Make this work for multiple
12141         indexers.  Fixes the first part of bug #33089.
12142         (MethodSignature.InheritableMemberSignatureCompare): Added support
12143         for properties.
12144
12145 2002-11-13  Ravi Pratap  <ravi@ximian.com>
12146
12147         * attribute.cs (Attribute.Resolve): Catch the
12148         NullReferenceException and report it since it isn't supposed to
12149         happen. 
12150
12151 2002-11-12  Miguel de Icaza  <miguel@ximian.com>
12152
12153         * expression.cs (Binary.EmitBranchable): Also handle the cases for
12154         LogicalOr and LogicalAnd that can benefit from recursively
12155         handling EmitBranchable.  The code now should be nice for Paolo.
12156
12157 2002-11-08  Miguel de Icaza  <miguel@ximian.com>
12158
12159         * typemanager.cs (LookupType): Added a negative-hit hashtable for
12160         the Type lookups, as we perform quite a number of lookups on
12161         non-Types.  This can be removed once we can deterministically tell
12162         whether we have a type or a namespace in advance.
12163
12164         But this might require special hacks from our corlib.
12165
12166         * TODO: updated.
12167
12168         * ecore.cs (TryImplicitIntConversion): Handle conversions to float
12169         and double which avoids a conversion from an integer to a double.
12170
12171         * expression.cs: tiny optimization, avoid calling IsConstant,
12172         because it effectively performs the lookup twice.
12173
12174 2002-11-06  Miguel de Icaza  <miguel@ximian.com>
12175
12176         But a bogus return here to keep the semantics of the old code
12177         until the Mono runtime is fixed.
12178
12179         * pending.cs (GetMissingInterfaces): New method used to remove all
12180         the interfaces that are already implemented by our parent
12181         classes from the list of pending methods. 
12182
12183         * interface.cs: Add checks for calls after ResolveTypeExpr.
12184
12185 2002-11-05  Miguel de Icaza  <miguel@ximian.com>
12186
12187         * class.cs (Class.Emit): Report warning 67: event not used if the
12188         warning level is beyond 3.
12189
12190         * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
12191         being a NullLiteral.
12192
12193         * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
12194         specifiers. 
12195
12196         * class.cs (TypeContainer.GetClassBases): Cover a missing code
12197         path that might fail if a type can not be resolved.
12198
12199         * expression.cs (Binary.Emit): Emit unsigned versions of the
12200         operators. 
12201
12202         * driver.cs: use error 5.
12203
12204 2002-11-02  Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
12205
12206         * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
12207
12208 2002-11-01  Miguel de Icaza  <miguel@ximian.com>
12209
12210         * cs-parser.jay (switch_section): A beautiful patch from Martin
12211         Baulig that fixed 33094.
12212
12213 2002-10-31  Miguel de Icaza  <miguel@ximian.com>
12214
12215         * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
12216         Check whether the base is abstract and report an error if so.
12217
12218         * expression.cs (IndexerAccess.DoResolveLValue,
12219         IndexerAccess.DoResolve): ditto. 
12220
12221         (Invocation.DoResolve): ditto.
12222
12223         (Invocation.FullMethodDesc): Improve the report string.
12224
12225         * statement.cs (Block): Eliminate IsVariableDefined as it is
12226         basically just a wrapper for GetVariableInfo.
12227
12228         * ecore.cs (SimpleName): Use new 
12229
12230         * support.cs (ReflectionParamter.ParameterType): We unwrap the
12231         type, as we return the actual parameter ref/unref state on a
12232         different call.
12233
12234 2002-10-30  Miguel de Icaza  <miguel@ximian.com>
12235
12236         * support.cs: Return proper flags REF/OUT fixing the previous
12237         commit.  
12238
12239         * expression.cs: Reverted last patch, that was wrong.  Is_ref is
12240         not used to mean `ref' but `ref or out' in ParameterReference
12241
12242         * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
12243         full type signature instead of calling TypeManger.CSharpName
12244         ourselves. 
12245
12246         * support.cs (InternalParameters.ParameterDesc): Do not compare
12247         directly to the modflags, because REF/OUT will actually be bitsets
12248         if set. 
12249
12250         * delegate.cs (VerifyMethod): Check also the modifiers.
12251
12252         * cs-tokenizer.cs: Fix bug where floating point values with an
12253         exponent where a sign was missing was ignored.
12254
12255         * driver.cs: Allow multiple assemblies to be specified in a single
12256         /r: argument
12257
12258 2002-10-28  Miguel de Icaza  <miguel@ximian.com>
12259
12260         * cs-parser.jay: Ugly.  We had to add a multiplicative_expression,
12261         because identifiers after a parenthesis would end up in this kind
12262         of production, and we needed to desamiguate it for having casts
12263         like:
12264
12265                 (UserDefinedType *) xxx
12266
12267 2002-10-24  Miguel de Icaza  <miguel@ximian.com>
12268
12269         * typemanager.cs (RealMemberLookup): when we deal with a subclass,
12270         we should set on the Bindingflags.NonPublic, but not turn on
12271         private_ok.  private_ok controls whether a Private member is
12272         returned (this is chekced on the filter routine), while the
12273         BindingFlags.NonPublic just controls whether private/protected
12274         will be allowed.   This fixes the problem part of the problem of
12275         private properties being allowed to be used in derived classes.
12276
12277         * expression.cs (BaseAccess): Provide an DoResolveLValue method,
12278         so we can call the children DoResolveLValue method (this will
12279         properly signal errors on lvalue assignments to base properties)
12280
12281         * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
12282         getter are null, and we have a property info, we know that this
12283         happened because the lookup failed, so we report an error 122 for
12284         protection level violation.
12285
12286         We also silently return if setter and getter are null in the
12287         resolve functions, this condition only happens if we have flagged
12288         the error before.  This is the other half of the problem. 
12289
12290         (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
12291         not have accessibility information, that is why we were returning
12292         true in the filter function in typemanager.cs.
12293
12294         To properly report 122 (property is inaccessible because of its
12295         protection level) correctly, we report this error in ResolveAccess
12296         by failing if both the setter and the getter are lacking (ie, the
12297         lookup failed). 
12298
12299         DoResolve and DoLResolve have been modified to check for both
12300         setter/getter being null and returning silently, the reason being
12301         that I did not want to put the knowledge about this error in upper
12302         layers, like:
12303
12304         int old = Report.Errors;
12305         x = new PropertyExpr (...);
12306         if (old != Report.Errors)
12307                 return null;
12308         else
12309                 return x;
12310
12311         So the property expr is returned, but it is invalid, so the error
12312         will be flagged during the resolve process. 
12313
12314         * class.cs: Remove InheritablePropertySignatureCompare from the
12315         class, as we no longer depend on the property signature to compute
12316         whether it is possible to implement a method or not.
12317
12318         The reason is that calling PropertyInfo.GetGetMethod will return
12319         null (in .NET, in Mono it works, and we should change this), in
12320         cases where the Get Method does not exist in that particular
12321         class.
12322
12323         So this code:
12324
12325         class X { public virtual int A { get { return 1; } } }
12326         class Y : X { }
12327         class Z : Y { public override int A { get { return 2; } } }
12328
12329         Would fail in Z because the parent (Y) would not have the property
12330         defined.  So we avoid this completely now (because the alternative
12331         fix was ugly and slow), and we now depend exclusively on the
12332         method names.
12333
12334         (PropertyBase.CheckBase): Use a method-base mechanism to find our
12335         reference method, instead of using the property.
12336
12337         * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
12338         routines are gone now.
12339
12340         * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
12341         names, they were incorrectly named.
12342
12343         * cs-tokenizer.cs: Return are more gentle token on failure. 
12344
12345         * pending.cs (PendingImplementation.InterfaceMethod): This routine
12346         had an out-of-sync index variable, which caused it to remove from
12347         the list of pending methods the wrong method sometimes.
12348
12349 2002-10-22  Miguel de Icaza  <miguel@ximian.com>
12350
12351         * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
12352         CanWrite, because those refer to this particular instance of the
12353         property, and do not take into account the fact that we can
12354         override single members of a property.
12355
12356         Constructor requires an EmitContext.  The resolution process does
12357         not happen here, but we need to compute the accessors before,
12358         because the resolution does not always happen for properties.
12359
12360         * typemanager.cs (RealMemberLookup): Set private_ok if we are a
12361         subclass, before we did not update this flag, but we did update
12362         bindingflags. 
12363
12364         (GetAccessors): Drop this routine, as it did not work in the
12365         presence of partially overwritten set/get methods. 
12366
12367         Notice that this broke the cs1540 detection, but that will require
12368         more thinking. 
12369
12370 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12371
12372         * class.cs:
12373         * codegen.cs:
12374         * driver.cs: issue a warning instead of an error if we don't support
12375         debugging for the platform. Also ignore a couple of errors that may
12376         arise when trying to write the symbols. Undo my previous patch.
12377
12378 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12379
12380         * driver.cs: ignore /debug switch except for Unix platforms.
12381
12382 2002-10-23  Nick Drochak  <ndrochak@gol.com>
12383
12384         * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
12385
12386 2002-10-21  Miguel de Icaza  <miguel@ximian.com>
12387
12388         * driver.cs: Do not make mcs-debug conditional, so we do not break
12389         builds that use it.
12390
12391         * statement.cs (UsageVector.MergeChildren): I would like Martin to
12392         review this patch.  But basically after all the children variables
12393         have been merged, the value of "Breaks" was not being set to
12394         new_breaks for Switch blocks.  I think that it should be set after
12395         it has executed.  Currently I set this to the value of new_breaks,
12396         but only if new_breaks is FlowReturn.ALWAYS, which is a bit
12397         conservative, but I do not understand this code very well.
12398
12399         I did not break anything in the build, so that is good ;-)
12400
12401         * cs-tokenizer.cs: Also allow \r in comments as a line separator.
12402
12403 2002-10-20  Mark Crichton  <crichton@gimp.org>
12404
12405         * cfold.cs: Fixed compile blocker.  Really fixed it this time.
12406
12407 2002-10-20  Nick Drochak  <ndrochak@gol.com>
12408
12409         * cfold.cs: Fixed compile blocker.
12410
12411 2002-10-20  Miguel de Icaza  <miguel@ximian.com>
12412
12413         * driver.cs: I was chekcing the key, not the file.
12414
12415 2002-10-19  Ravi Pratap  <ravi@ximian.com>
12416
12417         * ecore.cs (UserDefinedConversion): Get rid of the bogus error
12418         message that we were generating - we just need to silently return
12419         a null.
12420
12421 2002-10-19  Miguel de Icaza  <miguel@ximian.com>
12422
12423         * class.cs (Event.Define): Change my previous commit, as this
12424         breaks the debugger.  This is a temporary hack, as it seems like
12425         the compiler is generating events incorrectly to begin with.
12426
12427         * expression.cs (Binary.ResolveOperator): Added support for 
12428         "U operator - (E x, E y)"
12429
12430         * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
12431         y)".
12432
12433         * ecore.cs (FieldExpr.AddressOf): We had a special code path for
12434         init-only variables, but this path did not take into account that
12435         there might be also instance readonly variables.  Correct this
12436         problem. 
12437
12438         This fixes bug 32253
12439
12440         * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
12441         delegates as well.
12442
12443         * driver.cs: Change the extension for modules to `netmodule'
12444
12445         * cs-parser.jay: Improved slightly the location tracking for
12446         the debugger symbols.
12447
12448         * class.cs (Event.Define): Use Modifiers.FieldAttr on the
12449         modifiers that were specified instead of the hardcoded value
12450         (FamAndAssem).  This was basically ignoring the static modifier,
12451         and others.  Fixes 32429.
12452
12453         * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
12454         fixed a bug in the process (32476)
12455
12456         * expression.cs (ArrayAccess.EmitAssign): Patch from
12457         hwang_rob@yahoo.ca that fixes bug 31834.3
12458
12459 2002-10-18  Miguel de Icaza  <miguel@ximian.com>
12460
12461         * driver.cs: Make the module extension .netmodule.
12462
12463 2002-10-16  Miguel de Icaza  <miguel@ximian.com>
12464
12465         * driver.cs: Report an error if the resource file is not found
12466         instead of crashing.
12467
12468         * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
12469         false, like Emit does.
12470
12471 2002-10-16  Nick Drochak  <ndrochak@gol.com>
12472
12473         * typemanager.cs: Remove unused private member.  Also reported mcs
12474         bug to report this as a warning like csc.
12475
12476 2002-10-15  Martin Baulig  <martin@gnome.org>
12477
12478         * statement.cs (Statement.Emit): Made this a virtual method; emits
12479         the line number info and calls DoEmit().
12480         (Statement.DoEmit): New protected abstract method, formerly knows
12481         as Statement.Emit().
12482
12483         * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
12484
12485 2002-10-11  Miguel de Icaza  <miguel@ximian.com>
12486
12487         * class.cs: Following the comment from 2002-09-26 to AddMethod, I
12488         have fixed a remaining problem: not every AddXXXX was adding a
12489         fully qualified name.  
12490
12491         Now everyone registers a fully qualified name in the DeclSpace as
12492         being defined instead of the partial name.  
12493
12494         Downsides: we are slower than we need to be due to the excess
12495         copies and the names being registered this way.  
12496
12497         The reason for this is that we currently depend (on the corlib
12498         bootstrap for instance) that types are fully qualified, because
12499         we dump all the types in the namespace, and we should really have
12500         types inserted into the proper namespace, so we can only store the
12501         basenames in the defined_names array.
12502
12503 2002-10-10  Martin Baulig  <martin@gnome.org>
12504
12505         * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
12506         from bug #31834, see the bug report for a testcase which is
12507         miscompiled.
12508
12509 2002-10-10  Martin Baulig  <martin@gnome.org>
12510
12511         * codegen.cs (EmitContext.Breaks): Removed, we're now using the
12512         flow analysis code for this.
12513
12514         * statement.cs (Do, While, For): Tell the flow analysis code about
12515         infinite loops.
12516         (FlowBranching.UsageVector): Added support for infinite loops.
12517         (Block.Resolve): Moved the dead code elimination here and use flow
12518         analysis to do it.
12519
12520 2002-10-09  Miguel de Icaza  <miguel@ximian.com>
12521
12522         * class.cs (Field.Define): Catch cycles on struct type
12523         definitions. 
12524
12525         * typemanager.cs (IsUnmanagedtype): Do not recursively check
12526         fields if the fields are static.  We only need to check instance
12527         fields. 
12528
12529         * expression.cs (As.DoResolve): Test for reference type.
12530
12531         * statement.cs (Using.ResolveExpression): Use
12532         ConvertImplicitRequired, not ConvertImplicit which reports an
12533         error on failture
12534         (Using.ResolveLocalVariableDecls): ditto.
12535
12536         * expression.cs (Binary.ResolveOperator): Report errors in a few
12537         places where we had to.
12538
12539         * typemanager.cs (IsUnmanagedtype): Finish implementation.
12540
12541 2002-10-08  Miguel de Icaza  <miguel@ximian.com>
12542
12543         * expression.cs: Use StoreFromPtr instead of extracting the type
12544         and then trying to use Stelem.  Patch is from hwang_rob@yahoo.ca
12545
12546         * ecore.cs (ImplicitReferenceConversion): It is possible to assign
12547         an enumeration value to a System.Enum, but System.Enum is not a
12548         value type, but an class type, so we need to box.
12549
12550         (Expression.ConvertExplicit): One codepath could return
12551         errors but not flag them.  Fix this.  Fixes #31853
12552
12553         * parameter.cs (Resolve): Do not allow void as a parameter type.
12554
12555 2002-10-06  Martin Baulig  <martin@gnome.org>
12556
12557         * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
12558         if it's a class type and not a struct.  Fixes #31815.
12559
12560 2002-10-06  Martin Baulig  <martin@gnome.org>
12561
12562         * statement.cs: Reworked the flow analysis code a bit to make it
12563         usable for dead code elimination.
12564
12565 2002-10-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12566
12567         * cs-parser.jay: allow empty source files. Fixes bug #31781.
12568
12569 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
12570
12571         * expression.cs (ComposedCast.DoResolveType): A quick workaround
12572         to fix the test 165, will investigate deeper.
12573
12574 2002-10-04  Martin Baulig  <martin@gnome.org>
12575
12576         * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
12577         finally blocks actually work.
12578         (Try.Resolve): We don't need to create a sibling for `finally' if
12579         there is no finally block.
12580
12581 2002-10-04  Martin Baulig  <martin@gnome.org>
12582
12583         * class.cs (Constructor.Define): The default accessibility for a
12584         non-default constructor is private, not public.
12585
12586 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
12587
12588         * class.cs (Constructor): Make AllowedModifiers public, add
12589         EXTERN.
12590
12591         * cs-parser.jay: Perform the modifiers test here, as the
12592         constructor for the Constructor class usually receives a zero
12593         because of the way we create it (first we create, later we
12594         customize, and we were never checking the modifiers).
12595
12596         * typemanager.cs (Typemanager.LookupTypeDirect): This new function
12597         is a version of LookupTypeReflection that includes the type-name
12598         cache.  This can be used as a fast path for functions that know
12599         the fully qualified name and are only calling into *.GetType() to
12600         obtain a composed type.
12601
12602         This is also used by TypeManager.LookupType during its type
12603         composition.
12604
12605         (LookupType): We now also track the real type name, as sometimes
12606         we can get a quey for the real type name from things like
12607         ComposedCast.  This fixes bug 31422.
12608
12609         * expression.cs (ComposedCast.Resolve): Since we are obtaining a
12610         complete type fullname, it does not have to go through the type
12611         resolution system to obtain the composed version of the type (for
12612         obtaining arrays or pointers).
12613
12614         (Conditional.Emit): Use the EmitBoolExpression to
12615         generate nicer code, as requested by Paolo.
12616
12617         (ArrayCreation.CheckIndices): Use the patch from
12618         hwang_rob@yahoo.ca to validate the array initializers. 
12619
12620 2002-10-03  Miguel de Icaza  <miguel@ximian.com>
12621
12622         * class.cs (ConstructorInitializer.Emit): simplify code by using
12623         Invocation.EmitCall, and at the same time, fix the bugs in calling
12624         parent constructors that took variable arguments. 
12625
12626         * ecore.cs (Expression.ConvertNumericExplicit,
12627         Expression.ImplicitNumericConversion): Remove the code that
12628         manually wrapped decimal (InternalTypeConstructor call is now gone
12629         as well).
12630
12631         * expression.cs (Cast.TryReduce): Also handle decimal types when
12632         trying to perform a constant fold on the type.
12633
12634         * typemanager.cs (IsUnmanagedtype): Partially implemented.
12635
12636         * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
12637         that only turned off an error report, and did nothing else. 
12638
12639 2002-10-02  Miguel de Icaza  <miguel@ximian.com>
12640
12641         * driver.cs: Handle and ignore /fullpaths
12642
12643 2002-10-01  Miguel de Icaza  <miguel@ximian.com>
12644
12645         * expression.cs (Binary.ResolveOperator): Catch the case where
12646         DoNumericPromotions returns true, 
12647
12648         (Binary.DoNumericPromotions): Simplify the code, and the tests.
12649
12650 2002-09-27  Miguel de Icaza  <miguel@ximian.com>
12651
12652         * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
12653         report error 70.
12654
12655 2002-09-26  Miguel de Icaza  <miguel@ximian.com>
12656
12657         * ecore.cs (ConvertNumericExplicit): It is not enough that the
12658         conversion exists, but it is also required that the conversion be
12659         performed.  This manifested in "(Type64Enum) 2".  
12660
12661         * class.cs (TypeManager.AddMethod): The fix is not to change
12662         AddEnum, because that one was using a fully qualified name (every
12663         DeclSpace derivative does), but to change the AddMethod routine
12664         that was using an un-namespaced name.  This now correctly reports
12665         the duplicated name.
12666
12667         Revert patch until I can properly fix it.  The issue
12668         is that we have a shared Type space across all namespaces
12669         currently, which is wrong.
12670
12671         Options include making the Namespace a DeclSpace, and merge
12672         current_namespace/current_container in the parser.
12673
12674 2002-09-25  Miguel de Icaza  <miguel@ximian.com>
12675
12676         * cs-parser.jay: Improve error reporting when we get a different
12677         kind of expression in local_variable_type and
12678         local_variable_pointer_type. 
12679
12680         Propagate this to avoid missleading errors being reported.
12681
12682         * ecore.cs (ImplicitReferenceConversion): treat
12683         TypeManager.value_type as a target just like object_type.   As
12684         code like this:
12685
12686         ValueType v = 1;
12687
12688         Is valid, and needs to result in the int 1 being boxed before it
12689         is assigned to the value type v.
12690
12691         * class.cs (TypeContainer.AddEnum): Use the basename, not the name
12692         to validate the enumeration name.
12693
12694         * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
12695         EmitDynamicInitializers for the criteria to use Ldelema.  Thanks
12696         to hwang_rob@yahoo.ca for finding the bug and providing a patch.
12697
12698         * ecore.cs (TryImplicitIntConversion): When doing an
12699         implicit-enumeration-conversion, check if the type is 64-bits and
12700         perform a conversion before passing to EnumConstant.
12701
12702 2002-09-23  Miguel de Icaza  <miguel@ximian.com>
12703
12704         * decl.cs (Error_AmbiguousTypeReference); New routine used to
12705         report ambiguous type references.  Unlike the MS version, we
12706         report what the ambiguity is.   Innovation at work ;-)
12707
12708         (DeclSpace.FindType): Require a location argument to
12709         display when we display an ambiguous error.
12710
12711         * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
12712
12713         * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
12714
12715         * expression.cs (EmitDynamicInitializers): Apply patch from
12716         hwang_rob@yahoo.ca that fixes the order in which we emit our
12717         initializers. 
12718
12719 2002-09-21  Martin Baulig  <martin@gnome.org>
12720
12721         * delegate.cs (Delegate.VerifyApplicability): Make this work if the
12722         delegate takes no arguments.
12723
12724 2002-09-20  Miguel de Icaza  <miguel@ximian.com>
12725
12726         * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
12727         from integers.
12728
12729         * expression.cs: Extract the underlying type.
12730
12731         * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
12732
12733         * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
12734
12735 2002-09-19  Miguel de Icaza  <miguel@ximian.com>
12736
12737         * class.cs (TypeContainer.DefineType): We can not use the nice
12738         PackingSize with the size set to 1 DefineType method, because it
12739         will not allow us to define the interfaces that the struct
12740         implements.
12741
12742         This completes the fixing of bug 27287
12743
12744         * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
12745         means also structs.  This fixes part of the problem. 
12746         (Expresion.ImplicitReferenceConversionExists): ditto.
12747
12748         * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
12749         error if there were no errors reported during the type lookup
12750         process, to avoid duplicates or redundant errors.  Without this
12751         you would get an ambiguous errors plus a type not found.  We have
12752         beaten the user enough with the first error.  
12753
12754         (DeclSparce.FindType): Emit a warning if we have an ambiguous
12755         reference. 
12756
12757         * ecore.cs (SimpleName.DoResolveType): If an error is emitted
12758         during the resolution process, stop the lookup, this avoids
12759         repeated error reports (same error twice).
12760
12761         * rootcontext.cs: Emit a warning if we have an ambiguous reference.
12762
12763         * typemanager.cs (LookupType): Redo the type lookup code to match
12764         the needs of System.Reflection.  
12765
12766         The issue is that System.Reflection requires references to nested
12767         types to begin with a "+" sign instead of a dot.  So toplevel
12768         types look like: "NameSpace.TopLevelClass", and nested ones look
12769         like "Namespace.TopLevelClass+Nested", with arbitrary nesting
12770         levels. 
12771
12772 2002-09-19  Martin Baulig  <martin@gnome.org>
12773
12774         * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
12775         says that a method always returns or always throws an exception,
12776         don't report the CS0161.
12777
12778         * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
12779         set `Returns = new_returns'.
12780
12781 2002-09-19  Martin Baulig  <martin@gnome.org>
12782
12783         * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
12784         to an enum constant, check for a CS0176.
12785
12786 2002-09-18  Miguel de Icaza  <miguel@ximian.com>
12787
12788         * class.cs (TypeContainer.CheckPairedOperators): Now we check
12789         for operators that must be in pairs and report errors.
12790
12791         * ecore.cs (SimpleName.DoResolveType): During the initial type
12792         resolution process, when we define types recursively, we must
12793         check first for types in our current scope before we perform
12794         lookups in the enclosing scopes.
12795
12796         * expression.cs (MakeByteBlob): Handle Decimal blobs.
12797
12798         (Invocation.VerifyArgumentsCompat): Call
12799         TypeManager.TypeToCoreType on the parameter_type.GetElementType.
12800         I thought we were supposed to always call this, but there are a
12801         few places in the code where we dont do it.
12802
12803 2002-09-17  Miguel de Icaza  <miguel@ximian.com>
12804
12805         * driver.cs: Add support in -linkres and -resource to specify the
12806         name of the identifier.
12807
12808 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
12809
12810         * ecore.cs (StandardConversionExists): Sync with the conversion
12811         code: allow anything-* to void* conversions.
12812
12813         (FindMostSpecificSource): Use an Expression argument
12814         instead of a Type, because we might be handed over a Literal which
12815         gets a few more implicit conversions that plain types do not.  So
12816         this information was being lost.
12817
12818         Also, we drop the temporary type-holder expression when not
12819         required.
12820
12821 2002-09-17  Martin Baulig  <martin@gnome.org>
12822
12823         * class.cs (PropertyBase.CheckBase): Don't check the base class if
12824         this is an explicit interface implementation.
12825
12826 2002-09-17  Martin Baulig  <martin@gnome.org>
12827
12828         * class.cs (PropertyBase.CheckBase): Make this work for indexers with
12829         different `IndexerName' attributes.
12830
12831         * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
12832         (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
12833         virtual CommonResolve().
12834
12835 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
12836
12837         * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
12838         and convert that to the UnderlyingType.
12839
12840         * statement.cs (Foreach.Resolve): Indexers are just like variables
12841         or PropertyAccesses.
12842
12843         * cs-tokenizer.cs (consume_string): Track line numbers and columns
12844         inside quoted strings, we were not doing this before.
12845
12846 2002-09-16  Martin Baulig  <martin@gnome.org>
12847
12848         * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
12849         resolve it.  This is needed for the definite assignment check of the
12850         instance expression, fixes bug #29846.
12851         (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
12852
12853 2002-09-16  Nick Drochak  <ndrochak@gol.com>
12854
12855         * parameter.cs: Fix compile error.  Cannot reference static member
12856         from an instance object.  Is this an mcs bug?
12857
12858 2002-09-14  Martin Baulig  <martin@gnome.org>
12859
12860         * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
12861         multiple times.  Fixes bug #30295, added test-166.cs.
12862
12863 2002-09-14  Martin Baulig  <martin@gnome.org>
12864
12865         * statement.cs (Block.Emit): Don't emit unreachable code.
12866         (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
12867         `break' statements.
12868         (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
12869
12870 2002-09-14  Martin Baulig  <martin@gnome.org>
12871
12872         * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
12873         is set.
12874
12875 2002-09-14  Martin Baulig  <martin@gnome.org>
12876
12877         * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
12878         if `type == parent' since in this case `type.IsSubclassOf (parent)' will
12879         be false on the ms runtime.
12880
12881 2002-09-13  Martin Baulig  <martin@gnome.org>
12882
12883         * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
12884         the CS0038 error message.
12885
12886 2002-09-12  Miguel de Icaza  <miguel@ximian.com>
12887
12888         * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
12889         constant inside, return it.
12890
12891 2002-09-12  Martin Baulig  <martin@gnome.org>
12892
12893         * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
12894         implicit conversion can be done between enum types.
12895
12896         * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
12897         check whether an implicit conversion to the current enum's UnderlyingType
12898         exists and report an error if not.
12899
12900         * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
12901         without debugging support.
12902
12903         * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
12904         Fixes bug #30235.  Thanks to Ricardo Fernández Pascual.
12905
12906 2002-09-12  Martin Baulig  <martin@gnome.org>
12907
12908         * typemanager.cs (TypeManager.IsNestedChildOf): New method.
12909
12910         * ecore.cs (IMemberExpr.DeclaringType): New property.
12911         (SimpleName.SimpleNameResolve): Check whether we're accessing a
12912         nonstatic member of an outer type (CS0038).
12913
12914 2002-09-11  Miguel de Icaza  <miguel@ximian.com>
12915
12916         * driver.cs: Activate the using-error detector at warning level
12917         4 (at least for MS-compatible APIs).
12918
12919         * namespace.cs (VerifyUsing): Small buglett fix.
12920
12921         * pending.cs (PendingImplementation): pass the container pointer. 
12922
12923         * interface.cs (GetMethods): Allow for recursive definition.  Long
12924         term, I would like to move every type to support recursive
12925         definitions, not the current ordering mechanism that we have right
12926         now.
12927
12928         The situation is this: Attributes are handled before interfaces,
12929         so we can apply attributes to interfaces.  But some attributes
12930         implement interfaces, we will now handle the simple cases
12931         (recursive definitions will just get an error).  
12932
12933         * parameter.cs: Only invalidate types at the end if we fail to
12934         lookup all types.  
12935
12936 2002-09-09  Martin Baulig  <martin@gnome.org>
12937
12938         * ecore.cs (PropertyExpr.Emit): Also check for
12939         TypeManager.system_int_array_get_length so this'll also work when
12940         compiling corlib.  Fixes #30003.
12941
12942 2002-09-09  Martin Baulig  <martin@gnome.org>
12943
12944         * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
12945         and throw an exception if we can't get the type's size.  Fixed #30040,
12946         added test-165.cs.
12947
12948 2002-09-09  Martin Baulig  <martin@gnome.org>
12949
12950         * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
12951
12952         * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
12953         context.  Fixes bug #30027.
12954
12955         * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
12956         virtual functions.  Fixes bug #30043, added test-164.cs.
12957
12958 2002-09-08  Ravi Pratap  <ravi@ximian.com>
12959
12960         * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
12961
12962 2002-09-08  Nick Drochak  <ndrochak@gol.com>
12963
12964         * driver.cs: Use an object to get the windows codepage since it's not a
12965         static property.
12966
12967 2002-09-08  Miguel de Icaza  <miguel@ximian.com>
12968
12969         * statement.cs (For.Emit): for infinite loops (test == null)
12970         return whether there is a break inside, not always "true".
12971
12972         * namespace.cs (UsingEntry): New struct to hold the name of the
12973         using definition, the location where it is defined, and whether it
12974         has been used in a successful type lookup.
12975
12976         * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
12977         strings.
12978
12979         * decl.cs: ditto.
12980
12981 2002-09-06  Ravi Pratap  <ravi@ximian.com>
12982
12983         * attribute.cs : Fix incorrect code which relied on catching
12984         a NullReferenceException to detect a null being passed in
12985         where an object was expected.
12986
12987 2002-09-06  Miguel de Icaza  <miguel@ximian.com>
12988
12989         * statement.cs (Try): flag the catch variable as assigned
12990
12991         * expression.cs (Cast): Simplified by using ResolveType instead of
12992         manually resolving.
12993
12994         * statement.cs (Catch): Fix bug by using ResolveType.
12995
12996 2002-09-06  Ravi Pratap  <ravi@ximian.com>
12997
12998         * expression.cs (BetterConversion): Special case for when we have
12999         a NullLiteral as the argument and we have to choose between string
13000         and object types - we choose string the way csc does.
13001
13002         * attribute.cs (Attribute.Resolve): Catch the
13003         NullReferenceException and report error #182 since the Mono
13004         runtime no more has the bug and having this exception raised means
13005         we tried to select a constructor which takes an object and is
13006         passed a null.
13007
13008 2002-09-05  Ravi Pratap  <ravi@ximian.com>
13009
13010         * expression.cs (Invocation.OverloadResolve): Flag a nicer error
13011         message (1502, 1503) when we can't locate a method after overload
13012         resolution. This is much more informative and closes the bug
13013         Miguel reported.
13014
13015         * interface.cs (PopulateMethod): Return if there are no argument
13016         types. Fixes a NullReferenceException bug.
13017
13018         * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
13019         expressions too. Previously we were checking only in one place for
13020         positional arguments leaving out named arguments.
13021
13022         * ecore.cs (ImplicitNumericConversion): Conversion from underlying
13023         type to the enum type is not allowed. Remove code corresponding to
13024         that.
13025
13026         (ConvertNumericExplicit): Allow explicit conversions from
13027         the underlying type to enum type. This precisely follows the spec
13028         and closes a bug filed by Gonzalo.
13029
13030 2002-09-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13031
13032         * compiler.csproj:
13033         * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
13034
13035 2002-09-03  Miguel de Icaza  <miguel@ximian.com>
13036
13037         * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
13038         it was important that we stored the right value after the
13039         reduction in `converted'.
13040
13041 2002-09-04  Martin Baulig  <martin@gnome.org>
13042
13043         * location.cs (Location.SymbolDocument): Use full pathnames for the
13044         source files.
13045
13046 2002-08-30  Miguel de Icaza  <miguel@ximian.com>
13047
13048         * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
13049         of the expression resolve mechanism, because that will catch the
13050         SimpleName error failures.
13051
13052         (Conditional): If we can not resolve the
13053         expression, return, do not crash.
13054
13055 2002-08-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13056
13057         * cs-tokenizer.cs:
13058         (location): display token name instead of its number.
13059
13060 2002-08-28  Martin Baulig  <martin@gnome.org>
13061
13062         * expression.cs (Binary.ResolveOperator): Don't silently return
13063         but return an error if an operator cannot be applied between two
13064         enum types.
13065
13066 2002-08-28  Martin Baulig  <martin@gnome.org>
13067
13068         * class.cs (Constructor.Define): Set the permission attributes
13069         correctly instead of making all constructors public.
13070
13071 2002-08-28  Martin Baulig  <martin@gnome.org>
13072
13073         * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
13074         for private members before reporting a CS0103; if we find anything,
13075         it's a CS0122.
13076
13077 2002-08-28  Martin Baulig  <martin@gnome.org>
13078
13079         * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
13080         to check whether `closure_start_type == closure_invocation_type',
13081         we also need to check whether `m.DeclaringType == closure_invocation_type'
13082         before bypassing the permission checks.  We might be accessing
13083         protected/private members from the base class.
13084         (TypeManager.RealMemberLookup): Only set private_ok if private
13085         members were requested via BindingFlags.NonPublic.
13086
13087         * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
13088
13089         * expression.cs (MemberAccess.ResolveMemberAccess): Set
13090         MethodGroupExpr.IsExplicitImpl if appropriate.
13091         (Invocation.DoResolve): Don't report the CS0120 for explicit
13092         interface implementations.
13093
13094 2002-08-27  Martin Baulig  <martin@gnome.org>
13095
13096         * expression.cs (Invocation.DoResolve): If this is a static
13097         method and we don't have an InstanceExpression, we must report
13098         a CS0120.
13099
13100 2002-08-25  Martin Baulig  <martin@gnome.org>
13101
13102         * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
13103         `==' between a valuetype and an object.
13104
13105 2002-08-25  Miguel de Icaza  <miguel@ximian.com>
13106
13107         * ecore.cs (TypeExpr): Provide a ToString method.
13108
13109 2002-08-24  Martin Baulig  <martin@gnome.org>
13110
13111         * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
13112         now called proggie.dbg and it's a binary file.
13113
13114 2002-08-23  Martin Baulig  <martin@gnome.org>
13115
13116         * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
13117
13118 2002-08-23  Martin Baulig  <martin@gnome.org>
13119
13120         * struct.cs (MyStructInfo.ctor): Make this work with empty
13121         structs; it's not allowed to use foreach() on null.
13122
13123 2002-08-23  Martin Baulig  <martin@gnome.org>
13124
13125         * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
13126         writer the full pathname of the generated assembly.
13127
13128 2002-08-23  Martin Baulig  <martin@gnome.org>
13129
13130         * statements.cs (FlowBranching.UsageVector.MergeChildren):
13131         A `finally' block never returns or breaks; improved handling of
13132         unreachable code.
13133
13134 2002-08-23  Martin Baulig  <martin@gnome.org>
13135
13136         * statement.cs (Throw.Resolve): Allow `throw null'.
13137
13138 2002-08-23  Martin Baulig  <martin@gnome.org>
13139
13140         * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
13141         EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
13142         `ee.EventInfo.DeclaringType == ec.ContainerType'.  The
13143         MemberLookup would return a wrong event if this is an explicit
13144         interface implementation and the class has an event with the same
13145         name.
13146
13147 2002-08-23  Martin Baulig  <martin@gnome.org>
13148
13149         * statement.cs (Block.AddChildVariableNames): New public method.
13150         (Block.AddChildVariableName): Likewise.
13151         (Block.IsVariableNameUsedInChildBlock): Likewise.
13152         (Block.AddVariable): Check whether a variable name has already
13153         been used in a child block.
13154
13155         * cs-parser.jay (declare_local_variables): Mark all variable names
13156         from the current block as being used in a child block in the
13157         implicit block.
13158
13159 2002-08-23  Martin Baulig  <martin@gnome.org>
13160
13161         * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
13162         find the symbol writer.
13163
13164         * driver.cs: csc also allows the arguments to /define being
13165         separated by commas, not only by semicolons.
13166
13167 2002-08-23  Martin Baulig  <martin@gnome.org>
13168
13169         * interface.cs (Interface.GetMembers): Added static check for events.
13170
13171 2002-08-15  Martin Baulig  <martin@gnome.org>
13172
13173         * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
13174         call, use ec.ContainerType.BaseType as queried_type and invocation_type.
13175
13176         * ecore.cs (Expression.MemberLookup): Added documentation and explained
13177         why the MethodData.EmitDestructor() change was necessary.
13178
13179 2002-08-20  Martin Baulig  <martin@gnome.org>
13180
13181         * class.cs (TypeContainer.FindMembers): Added static check for events.
13182
13183         * decl.cs (MemberCache.AddMembers): Handle events like normal members.
13184
13185         * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
13186         use Type.GetEvents(), not Type.FindMembers().
13187
13188 2002-08-20  Martin Baulig  <martin@gnome.org>
13189
13190         * decl.cs (MemberCache): Added a special method cache which will
13191         be used for method-only searched.  This ensures that a method
13192         search will return a MethodInfo with the correct ReflectedType for
13193         inherited methods.      
13194
13195 2002-08-20  Martin Baulig  <martin@gnome.org>
13196
13197         * decl.cs (DeclSpace.FindMembers): Made this public.
13198
13199 2002-08-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13200
13201         * delegate.cs: fixed build on windows.
13202         [FIXME:  Filed as bug #29150: MCS must report these errors.]
13203
13204 2002-08-19  Ravi Pratap  <ravi@ximian.com>
13205
13206         * ecore.cs (StandardConversionExists): Return a false
13207         if we are trying to convert the void type to anything else
13208         since that is not allowed.
13209
13210         * delegate.cs (DelegateInvocation.DoResolve): Ensure that
13211         we flag error 70 in the event an event is trying to be accessed
13212         directly from outside the declaring type.
13213
13214 2002-08-20  Martin Baulig  <martin@gnome.org>
13215
13216         * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
13217         MemberCache from typemanager.cs to decl.cs.
13218
13219 2002-08-19  Martin Baulig  <martin@gnome.org>
13220
13221         * class.cs (TypeContainer): Implement IMemberContainer.
13222         (TypeContainer.DefineMembers): Create the MemberCache.
13223         (TypeContainer.FindMembers): Do better BindingFlags checking; only
13224         return public members if BindingFlags.Public was given, check
13225         whether members are static.
13226
13227 2002-08-16  Martin Baulig  <martin@gnome.org>
13228
13229         * decl.cs (DeclSpace.Define): Splitted this in Define and
13230         DefineMembers.  DefineMembers is called first and initializes the
13231         MemberCache.
13232
13233         * rootcontext.cs (RootContext.DefineMembers): New function.  Calls
13234         DefineMembers() on all our DeclSpaces.
13235
13236         * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
13237         but call DefineMembers() on all nested interfaces.  We call their
13238         Define() in our new Define() function.
13239
13240         * interface.cs (Interface): Implement IMemberContainer.
13241         (Interface.Define): Moved all code except the attribute stuf to
13242         DefineMembers().
13243         (Interface.DefineMembers): Initialize the member cache.
13244
13245         * typemanager.cs (IMemberFinder): Removed this interface, we don't
13246         need this anymore since we can use MemberCache.FindMembers directly.
13247
13248 2002-08-19  Martin Baulig  <martin@gnome.org>
13249
13250         * typemanager.cs (MemberCache): When creating the cache for an
13251         interface type, add all inherited members.
13252         (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
13253         to `out bool used_cache' and documented it.
13254         (TypeManager.MemberLookup): If we already used the cache in the first
13255         iteration, we don't need to do the interfaces check.
13256
13257 2002-08-19  Martin Baulig  <martin@gnome.org>
13258
13259         * decl.cs (DeclSpace.FindMembers): New abstract method.  Moved this
13260         here from IMemberFinder and don't implement this interface anymore.
13261         (DeclSpace.MemberCache): Moved here from IMemberFinder.
13262
13263         * typemanager.cs (IMemberFinder): This interface is now only used by
13264         classes which actually support the member cache.
13265         (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
13266         since we only put DeclSpaces into this Hashtable.
13267         (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
13268         a dynamic type and TypeHandle.GetTypeHandle() otherwise.
13269
13270 2002-08-16  Martin Baulig  <martin@gnome.org>
13271
13272         * typemanager.cs (ICachingMemberFinder): Removed.
13273         (IMemberFinder.MemberCache): New property.
13274         (TypeManager.FindMembers): Merged this with RealFindMembers().
13275         This function will never be called from TypeManager.MemberLookup()
13276         so we can't use the cache here, just the IMemberFinder.
13277         (TypeManager.MemberLookup_FindMembers): Check whether the
13278         IMemberFinder has a MemberCache and call the cache's FindMembers
13279         function.
13280         (MemberCache): Rewrote larger parts of this yet another time and
13281         cleaned it up a bit.
13282
13283 2002-08-15  Miguel de Icaza  <miguel@ximian.com>
13284
13285         * driver.cs (LoadArgs): Support quoting.
13286
13287         (Usage): Show the CSC-like command line arguments.
13288
13289         Improved a few error messages.
13290
13291 2002-08-15  Martin Baulig  <martin@gnome.org>
13292
13293         * typemanager.cs (IMemberContainer.Type): New property.
13294         (IMemberContainer.IsInterface): New property.
13295
13296         The following changes are conditional to BROKEN_RUNTIME, which is
13297         defined at the top of the file.
13298
13299         * typemanager.cs (MemberCache.MemberCache): Don't add the base
13300         class'es members, but add all members from TypeHandle.ObjectType
13301         if we're an interface.
13302         (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
13303         is the current type.
13304         (MemberCache.CacheEntry.Container): Removed this field.
13305         (TypeHandle.GetMembers): Include inherited members.
13306
13307 2002-08-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13308
13309         * typemanager.cs: fixed compilation and added a comment on a field that
13310         is never used.
13311
13312 2002-08-15  Martin Baulig  <martin@gnome.org>
13313
13314         * class.cs (ConstructorInitializer.Resolve): In the
13315         Expression.MemberLookup call, use the queried_type as
13316         invocation_type.
13317
13318         * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
13319         declared' attribute, it's always true.
13320         (IMemberContainer.Parent, IMemberContainer.Name): New properties.
13321         (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
13322         temporary wrapper for FindMembers which tells MemberLookup whether
13323         members from the base classes are included in the return value.
13324         This will go away soon.
13325         (TypeManager.MemberLookup): Use this temporary hack here; once the
13326         new MemberCache is completed, we don't need to do the DeclaredOnly
13327         looping here anymore since the MemberCache will take care of this.
13328         (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
13329         (MemberCache): When creating the MemberCache for a class, get
13330         members from the current class and all its base classes.
13331         (MemberCache.CacheEntry.Container): New field.  This is a
13332         temporary hack until the Mono runtime is fixed to distinguish
13333         between ReflectedType and DeclaringType.  It allows us to use MCS
13334         with both the MS runtime and the unfixed Mono runtime without
13335         problems and without accecting performance.
13336         (MemberCache.SearchMembers): The DeclaredOnly looping from
13337         TypeManager.MemberLookup is now done here.      
13338
13339 2002-08-14  Martin Baulig  <martin@gnome.org>
13340
13341         * statement.cs (MyStructInfo.MyStructInfo): Don't call
13342         Type.GetFields on dynamic types but get the fields from the
13343         corresponding TypeContainer.
13344         (MyStructInfo.GetStructInfo): Added check for enum types.
13345
13346         * typemanager.cs (MemberList.IsSynchronized): Implemented.
13347         (MemberList.SyncRoot): Implemented.
13348         (TypeManager.FilterWithClosure): No need to check permissions if
13349         closure_start_type == closure_invocation_type, don't crash if
13350         closure_invocation_type is null.
13351
13352 2002-08-13  Martin Baulig  <martin@gnome.org>
13353
13354         Rewrote TypeContainer.FindMembers to use a member cache.  This
13355         gives us a speed increase of about 35% for the self-hosting MCS
13356         build and of about 15-20% for the class libs (both on GNU/Linux).
13357
13358         * report.cs (Timer): New class to get enhanced profiling.  This
13359         whole class is "TIMER" conditional since it remarkably slows down
13360         compilation speed.
13361
13362         * class.cs (MemberList): New class.  This is an IList wrapper
13363         which we're now using instead of passing MemberInfo[]'s around to
13364         avoid copying this array unnecessarily.
13365         (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
13366         (ICachingMemberFinder, IMemberContainer): New interface.
13367         (TypeManager.FilterWithClosure): If `criteria' is null, the name
13368         has already been checked, otherwise use it for the name comparision.
13369         (TypeManager.FindMembers): Renamed to RealMemberFinder and
13370         provided wrapper which tries to use ICachingMemberFinder.FindMembers
13371         if possible.  Returns a MemberList, not a MemberInfo [].
13372         (TypeHandle): New class, implements IMemberContainer.  We create
13373         one instance of this class per type, it contains a MemberCache
13374         which is used to do the member lookups.
13375         (MemberCache): New class.  Each instance of this class contains
13376         all members of a type and a name-based hash table.
13377         (MemberCache.FindMembers): This is our new member lookup
13378         function.  First, it looks up all members of the requested name in
13379         the hash table.  Then, it walks this list and sorts out all
13380         applicable members and returns them.
13381
13382 2002-08-13  Martin Baulig  <martin@gnome.org>
13383
13384         In addition to a nice code cleanup, this gives us a performance
13385         increase of about 1.4% on GNU/Linux - not much, but it's already
13386         half a second for the self-hosting MCS compilation.
13387
13388         * typemanager.cs (IMemberFinder): New interface.  It is used by
13389         TypeManager.FindMembers to call FindMembers on a TypeContainer,
13390         Enum, Delegate or Interface.
13391         (TypeManager.finder_to_member_finder): New PtrHashtable.
13392         (TypeManager.finder_to_container): Removed.
13393         (TypeManager.finder_to_delegate): Removed.
13394         (TypeManager.finder_to_interface): Removed.
13395         (TypeManager.finder_to_enum): Removed.
13396
13397         * interface.cs (Interface): Implement IMemberFinder.
13398
13399         * delegate.cs (Delegate): Implement IMemberFinder.
13400
13401         * enum.cs (Enum): Implement IMemberFinder.
13402
13403         * class.cs (TypeContainer): Implement IMemberFinder.
13404
13405 2002-08-12  Martin Baulig  <martin@gnome.org>
13406
13407         * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
13408
13409 2002-08-12  Martin Baulig  <martin@gnome.org>
13410
13411         * ecore.cs (ITypeExpression): New interface for expressions which
13412         resolve to a type.
13413         (TypeExpression): Renamed to TypeLookupExpression.
13414         (Expression.DoResolve): If we're doing a types-only lookup, the
13415         expression must implement the ITypeExpression interface and we
13416         call DoResolveType() on it.
13417         (SimpleName): Implement the new ITypeExpression interface.
13418         (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
13419         hack, the situation that we're only looking up types can't happen
13420         anymore when this method is called.  Moved the type lookup code to
13421         DoResolveType() and call it.
13422         (SimpleName.DoResolveType): This ITypeExpression interface method
13423         is now doing the types-only lookup.
13424         (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
13425         (ResolveFlags): Added MaskExprClass.
13426
13427         * expression.cs (MemberAccess): Implement the ITypeExpression
13428         interface.
13429         (MemberAccess.DoResolve): Added support for a types-only lookup
13430         when we're called via ITypeExpression.DoResolveType().
13431         (ComposedCast): Implement the ITypeExpression interface.
13432
13433         * codegen.cs (EmitContext.OnlyLookupTypes): Removed.  Call
13434         Expression.Resolve() with ResolveFlags.Type instead.
13435
13436 2002-08-12  Martin Baulig  <martin@gnome.org>
13437
13438         * interface.cs (Interface.Define): Apply attributes.
13439
13440         * attribute.cs (Attribute.ApplyAttributes): Added support for
13441         interface attributes.
13442
13443 2002-08-11  Martin Baulig  <martin@gnome.org>
13444
13445         * statement.cs (Block.Emit): Only check the "this" variable if we
13446         do not always throw an exception.
13447
13448         * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
13449         whether the property has a set accessor.
13450
13451 2002-08-11  Martin Baulig  <martin@gnome.org>
13452
13453         Added control flow analysis support for structs.
13454
13455         * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
13456         with control flow analysis turned off.
13457         (IVariable): New interface.
13458         (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
13459         returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
13460         (FieldExpr.DoResolve): Resolve the instance expression with flow
13461         analysis turned off and do the definite assignment check after the
13462         resolving when we know what the expression will resolve to.
13463
13464         * expression.cs (LocalVariableReference, ParameterReference):
13465         Implement the new IVariable interface, only call the flow analysis
13466         code if ec.DoFlowAnalysis is true.
13467         (This): Added constructor which takes a Block argument.  Implement
13468         the new IVariable interface.
13469         (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
13470         DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
13471         This does the definite assignment checks for struct members.
13472
13473         * class.cs (Constructor.Emit): If this is a non-static `struct'
13474         constructor which doesn't have any initializer, call
13475         Block.AddThisVariable() to tell the flow analysis code that all
13476         struct elements must be initialized before control returns from
13477         the constructor.
13478
13479         * statement.cs (MyStructInfo): New public class.
13480         (UsageVector.this [VariableInfo vi]): Added `int field_idx'
13481         argument to this indexer.  If non-zero, check an individual struct
13482         member, not the whole struct.
13483         (FlowBranching.CheckOutParameters): Check struct members.
13484         (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
13485         overloaded versions of these methods which take an additional
13486         `int field_idx' argument to check struct members.
13487         (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
13488         overloaded versions of these methods which take an additional
13489         `string field_name' argument to check struct member.s
13490         (VariableInfo): Implement the IVariable interface.
13491         (VariableInfo.StructInfo): New public property.  Returns the
13492         MyStructInfo instance of the variable if it's a struct or null.
13493         (Block.AddThisVariable): New public method.  This is called from
13494         Constructor.Emit() for non-static `struct' constructor which do
13495         not have any initializer.  It creates a special variable for the
13496         "this" instance variable which will be checked by the flow
13497         analysis code to ensure that all of the struct's fields are
13498         initialized before control returns from the constructor.
13499         (UsageVector): Added support for struct members.  If a
13500         variable/parameter is a struct with N members, we reserve a slot
13501         in the usage vector for each member.  A struct is considered fully
13502         initialized if either the struct itself (slot 0) or all its
13503         members are initialized.
13504
13505 2002-08-08  Martin Baulig  <martin@gnome.org>
13506
13507         * driver.cs (Driver.MainDriver): Only report an error CS5001
13508         if there were no compilation errors.
13509
13510         * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
13511         `UnsafeContext' property to determine whether the parent is in
13512         unsafe context rather than checking the parent's ModFlags:
13513         classes nested in an unsafe class are unsafe as well.
13514
13515 2002-08-08  Martin Baulig  <martin@gnome.org>
13516
13517         * statement.cs (UsageVector.MergeChildren): Distinguish between
13518         `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
13519         we return.  Added test17() and test18() to test-154.cs.
13520
13521 2002-08-08  Martin Baulig  <martin@gnome.org>
13522
13523         * typemanager.cs (TypeManager.FilterWithClosure): If we have
13524         Family access, make sure the invoking type isn't a subclass of the
13525         queried type (that'd be a CS1540).
13526
13527         * ecore.cs (Expression.MemberLookup): Added overloaded version of
13528         this method which takes an additional `Type invocation_type'.
13529
13530         * expression.cs (BaseAccess.DoResolve): Use the base type as
13531         invocation and query type.
13532         (MemberAccess.DoResolve): If the lookup failed and we're about to
13533         report a CS0122, try a lookup with the ec.ContainerType - if this
13534         succeeds, we must report a CS1540.
13535
13536 2002-08-08  Martin Baulig  <martin@gnome.org>
13537
13538         * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
13539         (MethodGroupExpr): Implement the IMemberExpr interface.
13540
13541         * expression (MemberAccess.ResolveMemberAccess): No need to have
13542         any special code for MethodGroupExprs anymore, they're now
13543         IMemberExprs.   
13544
13545 2002-08-08  Martin Baulig  <martin@gnome.org>
13546
13547         * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
13548         Family, FamANDAssem and FamORAssem permissions.
13549         (TypeManager.IsSubclassOrNestedChildOf): New public method.
13550
13551 2002-08-08  Martin Baulig  <martin@gnome.org>
13552
13553         * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
13554         (UsageVector.MergeChildren): `break' breaks unless we're in a switch
13555         or loop block.
13556
13557 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
13558
13559         * driver.cs: implemented /resource option to embed managed resources.
13560
13561 2002-08-07  Martin Baulig  <martin@gnome.org>
13562
13563         * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
13564         (FieldBase.HasFieldInitializer): New public property.
13565         (FieldBase.GetInitializerExpression): New public method.  Resolves and
13566         returns the field initializer and makes sure it is only resolved once.
13567         (TypeContainer.EmitFieldInitializers): Call
13568         FieldBase.GetInitializerExpression to get the initializer, this ensures
13569         that it isn't resolved multiple times.
13570
13571         * codegen.cs (EmitContext): Added `bool IsFieldInitialier'.  This tells
13572         the resolving process (SimpleName/MemberLookup) that we're currently
13573         emitting a field initializer (which must not access any instance members,
13574         this is an error CS0236).
13575
13576         * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
13577         argument, if the `IsFieldInitializer' flag is set, we must report and
13578         error CS0236 and not an error CS0120.   
13579
13580 2002-08-07  Martin Baulig  <martin@gnome.org>
13581
13582         * ecore.cs (IMemberExpr): New public interface.
13583         (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
13584         (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
13585         if the expression is an IMemberExpr.
13586
13587         * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
13588         to be null, implicitly default to `this' if we're non-static in
13589         this case.  Simplified the code a lot by using the new IMemberExpr
13590         interface.  Also fixed bug #28176 here.
13591
13592 2002-08-06  Martin Baulig  <martin@gnome.org>
13593
13594         * cs-parser.jay (SimpleLookup): Removed.  We need to create
13595         ParameterReferences during semantic analysis so that we can do a
13596         type-only search when resolving Cast, TypeOf and SizeOf.
13597         (block): Pass the `current_local_parameters' to the Block's
13598         constructor.
13599
13600         * class.cs (ConstructorInitializer): Added `Parameters parameters'
13601         argument to the constructor.
13602         (ConstructorInitializer.Resolve): Create a temporary implicit
13603         block with the parameters.
13604
13605         * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
13606         references here if we aren't doing a type-only search.
13607
13608         * statement.cs (Block): Added constructor which takes a
13609         `Parameters parameters' argument.
13610         (Block.Parameters): New public property.
13611
13612         * support.cs (InternalParameters.Parameters): Renamed `parameters'
13613         to `Parameters' and made it public readonly.
13614
13615 2002-08-06  Martin Baulig  <martin@gnome.org>
13616
13617         * ecore.cs (Expression.Warning): Made this public as well.
13618
13619         * report.cs (Report.Debug): Print the contents of collections.
13620
13621 2002-08-06  Martin Baulig  <martin@gnome.org>
13622
13623         * ecore.cs (Expression.ResolveFlags): New [Flags] enum.  This is
13624         used to tell Resolve() which kinds of expressions it may return.
13625         (Expression.Resolve): Added overloaded version of this method which
13626         takes a `ResolveFlags flags' argument.  This can be used to tell
13627         Resolve() which kinds of expressions it may return.  Reports a
13628         CS0118 on error.
13629         (Expression.ResolveWithSimpleName): Removed, use Resolve() with
13630         ResolveFlags.SimpleName.
13631         (Expression.Error118): Added overloaded version of this method which
13632         takes a `ResolveFlags flags' argument.  It uses the flags to determine
13633         which kinds of expressions are allowed.
13634
13635         * expression.cs (Argument.ResolveMethodGroup): New public method.
13636         Resolves an argument, but allows a MethodGroup to be returned.
13637         This is used when invoking a delegate.
13638
13639         * TODO: Updated a bit.
13640
13641 2002-08-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13642
13643         Fixed compilation with csc.
13644
13645         * ecore.cs: Expression.Error made public. Is this correct? Should
13646         Warning be made public too?
13647
13648         * expression.cs: use ea.Location instead of ea.loc.
13649         [FIXME:  Filed as bug #28607: MCS must report these errors.]
13650
13651 2002-08-06  Martin Baulig  <martin@gnome.org>
13652
13653         * ecore.cs (Expression.loc): Moved the location here instead of
13654         duplicating it in all derived classes.
13655         (Expression.Location): New public property.
13656         (Expression.Error, Expression.Warning): Made them non-static and
13657         removed the location argument.
13658         (Expression.Warning): Added overloaded version which takes an
13659         `int level' argument.
13660         (Expression.Error118): Make this non-static and removed the
13661         expression and location arguments.
13662         (TypeExpr): Added location argument to the constructor.
13663
13664         * expression.cs (StaticCallExpr): Added location argument to
13665         the constructor.
13666         (Indirection, PointerArithmetic): Likewise.
13667         (CheckedExpr, UnCheckedExpr): Likewise.
13668         (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
13669         (StringPtr): Likewise.
13670
13671
13672 2002-08-05  Martin Baulig  <martin@gnome.org>
13673
13674         * expression.cs (BaseAccess.DoResolve): Actually report errors.
13675
13676         * assign.cs (Assign.DoResolve): Check whether the source
13677         expression is a value or variable.
13678
13679         * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
13680         while resolving the corresponding blocks.
13681
13682         * interface.cs (Interface.GetInterfaceTypeByName): Actually report
13683         an error, don't silently return null.
13684
13685         * statement.cs (Block.AddVariable): Do the error reporting here
13686         and distinguish between CS0128 and CS0136.
13687         (Block.DoResolve): Report all unused labels (warning CS0164).
13688         (LabeledStatement): Pass the location to the constructor.
13689         (LabeledStatement.HasBeenReferenced): New property.
13690         (LabeledStatement.Resolve): Set it to true here.
13691
13692         * statement.cs (Return.Emit): Return success even after reporting
13693         a type mismatch error (CS0126 or CS0127), this is what csc does and
13694         it avoids confusing the users with any consecutive errors.
13695
13696 2002-08-05  Martin Baulig  <martin@gnome.org>
13697
13698         * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
13699
13700         * const.cs (Const.LookupConstantValue): Catch circular definitions.
13701
13702         * expression.cs (MemberAccess.DoResolve): Silently return if an
13703         error has already been reported.
13704
13705         * ecore.cs (Expression.MemberLookupFinal): Silently return if an
13706         error has already been reported.
13707
13708 2002-08-05  Martin Baulig  <martin@gnome.org>
13709
13710         * statement.cs (UsageVector): Only initialize the `parameters'
13711         vector if we actually have any "out" parameters.
13712
13713 2002-08-05  Martin Baulig  <martin@gnome.org>
13714
13715         * expression.cs (Binary.ResolveOperator): When combining delegates,
13716         they must have the same type.
13717
13718 2002-08-05  Martin Baulig  <martin@gnome.org>
13719
13720         * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
13721         PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
13722         work with the ms runtime and we also don't need it: if we're a
13723         PropertyBuilder and not in the `indexer_arguments' hash, then we
13724         are a property and not an indexer.
13725
13726         * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
13727         Type.IsPointer and Type.IsByRef instead of Type.HasElementType
13728         since the latter one doesn't work with the ms runtime.
13729
13730 2002-08-03  Martin Baulig  <martin@gnome.org>
13731
13732         Fixed bugs #27998 and #22735.
13733
13734         * class.cs (Method.IsOperator): New public field.
13735         (Method.CheckBase): Report CS0111 if there's already a method
13736         with the same parameters in the current class.  Report CS0508 when
13737         attempting to change the return type of an inherited method.
13738         (MethodData.Emit): Report CS0179 if a method doesn't have a body
13739         and it's not marked abstract or extern.
13740         (PropertyBase): New abstract base class for Property and Indexer.
13741         (PropertyBase.CheckBase): Moved here from Property and made it work
13742         for indexers.
13743         (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
13744         the same so we can reuse it there.
13745         (Property, Indexer): Derive from PropertyBase.
13746         (MethodSignature.inheritable_property_signature_filter): New delegate
13747         to find properties and indexers.
13748
13749         * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
13750         argument and improved error reporting.
13751
13752         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
13753         EmptyReadOnlyParameters and made it a property.
13754
13755         * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
13756         version of this method which takes a `PropertyInfo indexer'.
13757         (TypeManager.RegisterIndexer): New method.
13758
13759         * class.cs: Added myself as author of this file :-)
13760
13761 2002-08-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13762
13763         * class.cs: fixed compilation on windoze.
13764
13765 2002-08-03  Martin Baulig  <martin@gnome.org>
13766
13767         * interface.cs (Interface.GetInterfaceBases): Check whether all
13768         base interfaces are at least as accessible than the current one.
13769
13770         * class.cs (TypeContainer.GetClassBases): Check whether base types
13771         are at least as accessible than the current type.
13772         (TypeContainer.AsAccessible): Implemented and made non-static.
13773         (MemberBase.CheckParameters): Report errors if the accessibility
13774         checks fail.
13775
13776         * delegate.cs (Delegate.Delegate): The default visibility is
13777         internal for top-level types and private for nested types.
13778         (Delegate.Define): Report errors if the accessibility checks fail.
13779
13780         * enum.cs (Enum.Enum): The default visibility is internal for
13781         top-level types and private for nested types.
13782         (Enum.DefineType): Compute the correct visibility.
13783
13784         * modifiers.cs (Modifiers.TypeAttr): Added a version of this
13785         function which takes a `bool is_toplevel' instead of a TypeContainer.
13786
13787         * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
13788         builtin type.
13789
13790 2002-08-02  Martin Baulig  <martin@gnome.org>
13791
13792         * expression.cs (LocalVariableReferenc): Added constructor which
13793         takes additional `VariableInfo vi' and `bool is_readonly' arguments.
13794         (LocalVariableReference.IsReadOnly): New property.
13795         (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
13796         variable is readonly, use our own readonly flag to do this; you can
13797         use the new constructor to get a writable reference to a read-only
13798         variable.
13799
13800         * cs-parser.jay (foreach_statement, using_statement): Get a writable
13801         reference to the local variable.
13802
13803 2002-08-01  Miguel de Icaza  <miguel@ximian.com>
13804
13805         * rootcontext.cs (ResolveCore): Also include System.Exception
13806
13807         * statement.cs (Block.Emit): Do not emit the dead-code warnings if
13808         we reach an EmptyStatement.
13809
13810         (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
13811         is also fine.
13812
13813         * expression.cs (Binary.ResolveOperator): Check error result in
13814         two places.
13815
13816         use brtrue/brfalse directly and avoid compares to null.
13817
13818 2002-08-02  Martin Baulig  <martin@gnome.org>
13819
13820         * class.cs (TypeContainer.Define): Define all nested interfaces here.
13821         Fixes bug #28407, added test-155.cs.
13822
13823 2002-08-01  Martin Baulig  <martin@gnome.org>
13824
13825         * class.cs (Event.EmitDefaultMethod): Make this work with static
13826         events.  Fixes #28311, added verify-3.cs.
13827
13828 2002-08-01  Martin Baulig  <martin@gnome.org>
13829
13830         * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
13831         `is_disposable' fields.
13832         (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
13833         `hm.is_disposable' if we're using the collection pattern.
13834         (Foreach.EmitCollectionForeach): Use the correct type for the
13835         enumerator's local variable, only emit the try/finally block if
13836         necessary (fixes #27713).
13837
13838 2002-08-01  Martin Baulig  <martin@gnome.org>
13839
13840         * ecore.cs (Expression.report118): Renamed to Error118 and made
13841         it public static.
13842
13843         * statement.cs (Throw.Resolve): Check whether the expression is of
13844         the correct type (CS0118) and whether the type derives from
13845         System.Exception (CS0155).
13846         (Catch.Resolve): New method.  Do the type lookup here and check
13847         whether it derives from System.Exception (CS0155).
13848         (Catch.CatchType, Catch.IsGeneral): New public properties.
13849
13850         * typemanager.cs (TypeManager.exception_type): Added.
13851
13852 2002-07-31  Miguel de Icaza  <miguel@ximian.com>
13853
13854         * driver.cs: Updated About function.
13855
13856 2002-07-31  Martin Baulig  <martin@gnome.org>
13857
13858         Implemented Control Flow Analysis.
13859
13860         * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
13861         (EmitContext.CurrentBranching): Added.
13862         (EmitContext.StartFlowBranching): Added.
13863         (EmitContext.EndFlowBranching): Added.
13864         (EmitContext.KillFlowBranching): Added.
13865         (EmitContext.IsVariableAssigned): Added.
13866         (EmitContext.SetVariableAssigned): Added.
13867         (EmitContext.IsParameterAssigned): Added.
13868         (EmitContext.SetParameterAssigned): Added.
13869         (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
13870         Added control flow analysis stuff here.
13871
13872         * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
13873         resolve the expression as lvalue.
13874         (LocalVariableReference.DoResolve): Check whether the variable has
13875         already been assigned.
13876         (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
13877         the parameter as assigned here.
13878         (ParameterReference.DoResolve): Check whether the parameter has already
13879         been assigned.
13880         (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
13881         expression as lvalue.
13882
13883         * statement.cs (FlowBranching): New class for the flow analysis code.
13884         (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
13885         (LabeledStatement.IsDefined): New public property.
13886         (LabeledStatement.AddUsageVector): New public method to tell flow
13887         analyis that the label may be reached via a forward jump.
13888         (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
13889         flow analysis.
13890         (VariableInfo.Number): New public field.  This is used by flow analysis
13891         to number all locals of a block.
13892         (Block.CountVariables): New public property.  This is the number of
13893         local variables in this block (including the locals from all parent
13894         blocks).
13895         (Block.EmitMeta): Number all the variables.
13896
13897         * statement.cs: Added flow analysis support to all classes.
13898
13899 2002-07-31  Martin Baulig  <martin@gnome.org>
13900
13901         * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
13902         To get debugging messages, compile mcs with /define:MCS_DEBUG and
13903         then use this argument.
13904
13905         * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
13906
13907         * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
13908         use this to specify /define options.
13909
13910 2002-07-29  Martin Baulig  <martin@gnome.org>
13911
13912         * statement.cs (Fixed): Moved all code that does variable lookups
13913         and resolvings from Emit to Resolve.
13914
13915         * statement.cs (For): Moved all code that does variable lookups
13916         and resolvings from Emit to Resolve.
13917
13918         * statement.cs (Using): Moved all code that does variable lookups
13919         and resolvings from Emit to Resolve.
13920
13921 2002-07-29  Martin Baulig  <martin@gnome.org>
13922
13923         * attribute.cs (Attribute.Resolve): Explicitly catch a
13924         System.NullReferenceException when creating the
13925         CustromAttributeBuilder and report a different warning message.
13926
13927 2002-07-29  Martin Baulig  <martin@gnome.org>
13928
13929         * support.cs (ParameterData.ParameterName): Added method to
13930         get the name of a parameter.
13931
13932         * typemanager.cs (TypeManager.IsValueType): New public method.
13933
13934 2002-07-29  Martin Baulig  <martin@gnome.org>
13935
13936         * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'.  This
13937         is a flag which specifies that it's either ref or out.
13938         (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
13939         the out parameter to `out Parameter.Modifier mod', also set the
13940         Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
13941
13942         * support.cs (InternalParameters.ParameterModifier): Distinguish
13943         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
13944         Parameter.Modifier.ISBYREF flag if it's either ref or out.
13945
13946         * expression.cs (Argument.GetParameterModifier): Distinguish
13947         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
13948         Parameter.Modifier.ISBYREF flag if it's either ref or out.
13949
13950 2002-07-29  Martin Baulig  <martin@gnome.org>
13951
13952         * expression.cs (ParameterReference.ParameterReference): Added
13953         `Location loc' argument to the constructor.
13954
13955         * cs-parser.jay: Pass location to ParameterReference.
13956
13957 2002-07-28  Miguel de Icaza  <miguel@ximian.com>
13958
13959         * statement.cs (Try): Initialize the location.
13960
13961         * cs-parser.jay: pass location to Try.
13962
13963         * expression.cs (Unary.Reduce): Change the prototype to return
13964         whether a constant fold could be performed or not.  The result is
13965         returned in an out parameters.  In the case of Indirection and
13966         AddressOf, we want to perform the full tests.
13967
13968 2002-07-26  Miguel de Icaza  <miguel@ximian.com>
13969
13970         * statement.cs (Statement.Emit): Flag dead code.
13971
13972 2002-07-27  Andrew Birkett  <andy@nobugs.org>
13973
13974         * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
13975
13976 2002-07-27  Martin Baulig  <martin@gnome.org>
13977
13978         * class.cs (MethodData.Define): Put back call to
13979         TypeManager.AddMethod(), accidentally commented this out.
13980
13981         * report.cs (Debug): New public method to print debugging information,
13982         this is `[Conditional ("DEBUG")]'.
13983
13984 2002-07-26  Martin Baulig  <martin@gnome.org>
13985
13986         * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
13987         (switch_statement): Push the current_block to the switch_stack and
13988         pop it again when we're done with the switch.
13989         (switch_section): The new block is a child of the current_block.
13990         Fixes bug #24007, added test-152.cs.
13991
13992 2002-07-27  Martin Baulig  <martin@gnome.org>
13993
13994         * expression.cs (Invocation.EmitArguments): When calling a varargs
13995         function with only its fixed arguments, we need to pass an empty
13996         array.
13997
13998 2002-07-27  Martin Baulig  <martin@gnome.org>
13999
14000         Mono 0.13 has been released.
14001
14002 2002-07-25  Miguel de Icaza  <miguel@ximian.com>
14003
14004         * driver.cs: Rename --resource to --linkres, because that is what
14005         we do currently, we dont support --resource yet.
14006
14007         * cs-tokenizer.cs: Fix test for reporting endif mismatches.
14008
14009 2002-07-25  Martin Baulig  <martin@gnome.org>
14010
14011         * class.cs (MethodData): New public class.  This is a `method builder'
14012         class for a method or one accessor of a Property/Indexer/Event.
14013         (MethodData.GetMethodFlags): Moved here from MemberBase.
14014         (MethodData.ApplyAttributes): Likewise.
14015         (MethodData.ApplyObsoleteAttribute): Likewise.
14016         (MethodData.ApplyConditionalAttribute): Likewise.
14017         (MethodData.ApplyDllImportAttribute): Likewise.
14018         (MethodData.CheckAbstractAndExternal): Likewise.
14019         (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
14020         (MethodData.Emit): Formerly known as Method.Emit().
14021         (MemberBase): Moved everything which was specific to a single
14022         accessor/method to MethodData.
14023         (Method): Create a new MethodData and call Define() and Emit() on it.
14024         (Property, Indexer, Event): Create a new MethodData objects for each
14025         accessor and call Define() and Emit() on them.
14026
14027 2002-07-25  Martin Baulig  <martin@gnome.org>
14028
14029         Made MethodCore derive from MemberBase to reuse the code from there.
14030         MemberBase now also checks for attributes.
14031
14032         * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
14033         (MemberBase.GetMethodFlags): Moved here from class Method and marked
14034         as virtual.
14035         (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
14036         `CallingConventions cc' and `Attributes opt_attrs' arguments.
14037         (MemberBase.ApplyAttributes): New virtual method; applies the
14038         attributes to a method or accessor.
14039         (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
14040         (MemberBase.ApplyConditionalAttribute): Likewise.
14041         (MemberBase.ApplyDllImportAttribute): Likewise.
14042         (MemberBase.CheckAbstractAndExternal): Likewise.
14043         (MethodCore.ParameterTypes): This is now a property instead of a
14044         method, it's initialized from DoDefineParameters().
14045         (MethodCore.ParameterInfo): Removed the set accessor.
14046         (MethodCore.DoDefineParameters): New protected virtual method to
14047         initialize ParameterTypes and ParameterInfo.
14048         (Method.GetReturnType): We can now simply return the MemberType.
14049         (Method.GetMethodFlags): Override the MemberBase version and add
14050         the conditional flags.
14051         (Method.CheckBase): Moved some code from Define() here, call
14052         DoDefineParameters() here.
14053         (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
14054         here to avoid some larger code duplication.
14055         (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
14056         ensure that abstract and external accessors don't declare a body.
14057
14058         * attribute.cs (Attribute.GetValidPieces): Make this actually work:
14059         `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
14060         lookup in the attribute's parent classes, so we need to abort as soon
14061         as we found the first match.
14062         (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
14063         the attribute has no arguments.
14064
14065         * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
14066         of a Method.
14067
14068 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14069
14070         * cs-parser.jay: reverted previous patch.
14071
14072 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14073
14074         * cs-parser.jay: fixed bug #22119.
14075
14076 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14077
14078         * attribute.cs: fixed compilation. The error was:
14079         "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must 
14080         be assigned to before control leaves the current method."
14081         [FIXME:  Filed as bug #28186: MCS must report this error.]
14082
14083 2002-07-25  Martin Baulig  <martin@gnome.org>
14084
14085         * attribute.cs (Attribute.Conditional_GetConditionName): New static
14086         method to pull the condition name ouf of a Conditional attribute.
14087         (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
14088         the obsolete message and error flag out of an Obsolete attribute.
14089
14090         * class.cs (Method.GetMethodFlags): New public method to get the
14091         TypeManager.MethodFlags for this method.
14092         (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
14093         private methods.
14094         (Method.Define): Get and apply the Obsolete and Conditional attributes;
14095         if we're overriding a virtual function, set the new private variable
14096         `parent_method'; call the new TypeManager.AddMethod().
14097
14098         * typemanager.cs (TypeManager.AddMethod): New static method.  Stores
14099         the MethodBuilder and the Method in a PtrHashtable.
14100         (TypeManager.builder_to_method): Added for this purpose.
14101         (TypeManager.MethodFlags): Added IsObsoleteError.
14102         (TypeManager.GetMethodFlags): Added `Location loc' argument.  Lookup
14103         Obsolete and Conditional arguments in MethodBuilders.  If we discover
14104         an Obsolete attribute, emit an appropriate warning 618 / error 619 with
14105         the message from the attribute.
14106
14107 2002-07-24  Martin Baulig  <martin@gnome.org>
14108
14109         * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
14110         preprocessor directives, ensure that the argument to #define/#undef is
14111         exactly one identifier and that it's actually an identifier.
14112
14113         Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
14114         did not work ....
14115
14116 2002-07-24  Martin Baulig  <martin@gnome.org>
14117
14118         * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
14119         initialize it to TypeManager.object_type in the constructor.
14120         (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
14121         of the `hm.get_current' method if we're using the collection pattern.
14122         (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
14123         for the explicit conversion to make it work when we're using the collection
14124         pattern and the `Current' property has a different return type than `object'.
14125         Fixes #27713.
14126
14127 2002-07-24  Martin Baulig  <martin@gnome.org>
14128
14129         * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
14130         does not match, but don't report any errors.  This method is called in
14131         order for all methods in a MethodGroupExpr until a matching method is
14132         found, so we don't want to bail out if the first method doesn't match.
14133         (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
14134         matches, report the 123.  Fixes #28070.
14135
14136 2002-07-24  Martin Baulig  <martin@gnome.org>
14137
14138         * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
14139         TypeManager.TypeToCoreType() to the top of the method so the
14140         following equality checks will work.  Fixes #28107.
14141
14142 2002-07-24  Martin Baulig  <martin@gnome.org>
14143
14144         * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
14145         operand is of type uint, and the other operand is of type sbyte,
14146         short or int, the operands are converted to type long." -
14147         Actually do what this comment already told us.  Fixes bug #28106,
14148         added test-150.cs.
14149
14150 2002-07-24  Martin Baulig  <martin@gnome.org>
14151
14152         * class.cs (MethodBase): New abstract class.  This is now a base
14153         class for Property, Indexer and Event to avoid some code duplication
14154         in their Define() and DefineMethods() methods.
14155         (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
14156         generic methods for Define() and DefineMethods().
14157         (FieldBase): Derive from MemberBase, not MemberCore.
14158         (Property): Derive from MemberBase, not MemberCore.
14159         (Property.DefineMethod): Moved all the code from this method to the
14160         new MethodBase.DefineAccessor(), just call it with appropriate
14161         argumetnts.
14162         (Property.Define): Call the new Property.DoDefine(), this does some
14163         sanity checks and we don't need to duplicate the code everywhere.
14164         (Event): Derive from MemberBase, not MemberCore.
14165         (Event.Define): Use the new MethodBase.DefineAccessor() to define the
14166         accessors, this will also make them work with interface events.
14167         (Indexer): Derive from MemberBase, not MemberCore.
14168         (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
14169         (Indexer.Define): Use the new MethodBase functions.
14170
14171         * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
14172         argument to the constructor.
14173         (Interface.FindMembers): Added support for interface events.
14174         (Interface.PopluateEvent): Implemented.
14175
14176         Added test-149.cs for this.  This also fixes bugs #26067 and #24256.
14177
14178 2002-07-22  Miguel de Icaza  <miguel@ximian.com>
14179
14180         * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
14181         but this is required to check for a method name being the same as
14182         the containing class.  
14183
14184         Handle this now.
14185
14186 2002-07-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14187
14188         * interface.cs: initialize variable.
14189
14190 2002-07-23  Martin Baulig  <martin@gnome.org>
14191
14192         Implemented the IndexerName attribute in interfaces.
14193
14194         * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
14195         name if this is an explicit interface implementation.
14196         (Indexer.InterfaceIndexerName): New public variable.  If we're
14197         implementing an interface indexer, this is the IndexerName in that
14198         interface.  Otherwise, it's the IndexerName.
14199         (Indexer.DefineMethod): If we're implementing interface indexer,
14200         set InterfaceIndexerName.  Use the new Pending.IsInterfaceIndexer
14201         and Pending.ImplementIndexer methods.
14202         (Indexer.Define): Also define the PropertyBuilder if we're
14203         implementing an interface indexer and this is neither an explicit
14204         interface implementation nor do the IndexerName match the one in
14205         the interface.
14206
14207         * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
14208         If a method is defined here, then we always need to create a proxy
14209         for it.  This is used when implementing interface indexers.
14210         (Pending.IsInterfaceIndexer): New public method.
14211         (Pending.ImplementIndexer): New public method.
14212         (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
14213         This is used when implementing interface indexers to define a proxy
14214         if necessary.
14215         (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
14216         define a proxy if necessary.
14217
14218         * interface.cs (Interface.IndexerName): New public variable.
14219         (Interface.PopulateIndexer): Set the IndexerName.
14220         (Interface.DefineIndexers): New private method.  Populate all the
14221         indexers and make sure their IndexerNames match.
14222
14223         * typemanager.cs (IndexerPropertyName): Added support for interface
14224         indexers.
14225
14226 2002-07-22  Martin Baulig  <martin@gnome.org>
14227
14228         * codegen.cs (EmitContext.HasReturnLabel): New public variable.
14229         (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
14230         ret if HasReturnLabel.
14231         (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
14232         variables.
14233
14234         * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
14235         and set the ec.LoopBeginTryCatchLevel.
14236         (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
14237         (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
14238         the current ec.TryCatchLevel, the branch goes out of an exception
14239         block.  In this case, we need to use Leave and not Br.
14240
14241 2002-07-22  Martin Baulig  <martin@gnome.org>
14242
14243         * statement.cs (Try.Emit): Emit an explicit ret after the end of the
14244         block unless the block does not always return or it is contained in
14245         another try { ... } catch { ... } block.  Fixes bug #26506.
14246         Added verify-1.cs to the test suite.
14247
14248 2002-07-22  Martin Baulig  <martin@gnome.org>
14249
14250         * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
14251         then we do not always return.  Fixes bug #24985.
14252
14253 2002-07-22  Martin Baulig  <martin@gnome.org>
14254
14255         * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
14256         lookup on a per-class level; ie. walk up the class hierarchy until we
14257         found at least one applicable method, then choose the best among them.
14258         Fixes bug #24463 and test-29.cs.
14259
14260 2002-07-22  Martin Baulig  <martin@gnome.org>
14261
14262         * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
14263         return types of the methods.  The return type is not part of the
14264         signature and we must not check it to make the `new' modifier work.
14265         Fixes bug #27999, also added test-147.cs.
14266         (TypeManager.TypeToCoreType): Added TypeManager.type_type.
14267
14268         * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
14269         on the method's return type.
14270
14271 2002-07-21  Martin Baulig  <martin@gnome.org>
14272
14273         * assign.cs: Make this work if the rightmost source is a constant and
14274         we need to do an implicit type conversion.  Also adding a few more tests
14275         to test-38.cs which should have caught this.
14276
14277         * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
14278         target in the makefile for this.  The makefile.gnu is primarily intended
14279         for end-users who don't want to debug the compiler.
14280
14281 2002-07-21  Martin Baulig  <martin@gnome.org>
14282
14283         * assign.cs: Improved the Assign class so it can now handle embedded
14284         assignments (X = Y = Z = something).  As a side-effect this'll now also
14285         consume less local variables.  test-38.cs now passes with MCS, added
14286         a few new test cases to that test.
14287
14288 2002-07-20  Martin Baulig  <martin@gnome.org>
14289
14290         * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
14291         instructions.  Fixes bug #27977, also added test-146.cs.
14292
14293 2002-07-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14294
14295         * cs-tokenizer.cs: fixed getHex ().
14296
14297 2002-07-19  Martin Baulig  <martin@gnome.org>
14298
14299         * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
14300         not Type.GetType() to lookup the array type.  This is needed when
14301         we're constructing an array of a user-defined type.
14302         (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
14303         single-dimensional arrays, but also for single-dimensial arrays of
14304         type decimal.
14305
14306 2002-07-19  Martin Baulig  <martin@gnome.org>
14307
14308         * expression.cs (New.DoEmit): Create a new LocalTemporary each time
14309         this function is called, it's not allowed to share LocalBuilders
14310         among ILGenerators.
14311
14312 2002-07-19  Martin Baulig  <martin@gnome.org>
14313
14314         * expression.cs (Argument.Resolve): Report an error 118 when trying
14315         to pass a type as argument.
14316
14317 2002-07-18  Martin Baulig  <martin@gnome.org>
14318
14319         * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
14320         Conv_R_Un for the signed `long' type.
14321
14322 2002-07-15  Miguel de Icaza  <miguel@ximian.com>
14323
14324         * expression.cs (MemberAccess.DoResolve): Do not reuse the field
14325         `expr' for the temporary result, as that will fail if we do
14326         multiple resolves on the same expression.
14327
14328 2002-07-05  Miguel de Icaza  <miguel@ximian.com>
14329
14330         * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
14331         ec.TypeContainer for looking up aliases. 
14332
14333         * class.cs (TypeContainer): Remove LookupAlias from here.
14334
14335         * decl.cs (DeclSpace); Move here.
14336
14337 2002-07-01  Miguel de Icaza  <miguel@ximian.com>
14338
14339         * class.cs (FindMembers): Only call filter if the constructor
14340         bulider is not null.
14341
14342         Also handle delegates in `NestedTypes' now.  Now we will perform
14343         type lookups using the standard resolution process.  This also
14344         fixes a bug.
14345
14346         * decl.cs (DeclSpace.ResolveType): New type resolution routine.
14347         This uses Expressions (the limited kind that can be parsed by the
14348         tree) instead of strings.
14349
14350         * expression.cs (ComposedCast.ToString): Implement, used to flag
14351         errors since now we have to render expressions.
14352
14353         (ArrayCreation): Kill FormElementType.  Use ComposedCasts in
14354         FormArrayType. 
14355
14356         * ecore.cs (SimpleName.ToString): ditto.
14357
14358         * cs-parser.jay: Instead of using strings to assemble types, use
14359         Expressions to assemble the type (using SimpleName, ComposedCast,
14360         MemberAccess).  This should fix the type lookups in declarations,
14361         because we were using a different code path for this.
14362
14363         * statement.cs (Block.Resolve): Continue processing statements
14364         even when there is an error.
14365
14366 2002-07-17  Miguel de Icaza  <miguel@ximian.com>
14367
14368         * class.cs (Event.Define): Also remove the `remove' method from
14369         the list of pending items.
14370
14371         * expression.cs (ParameterReference): Use ldarg.N (0..3) to
14372         generate more compact code. 
14373
14374 2002-07-17  Martin Baulig  <martin@gnome.org>
14375
14376         * const.cs (Const.LookupConstantValue): Add support for constant
14377         `unchecked' and `checked' expressions.
14378         Also adding test case test-140.cs for this.
14379
14380 2002-07-17  Martin Baulig  <martin@gnome.org>
14381
14382         * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
14383         check whether mi.ReturnType implements the IEnumerator interface; the
14384         `==' and the IsAssignableFrom() will fail in this situation.
14385
14386 2002-07-16  Ravi Pratap  <ravi@ximian.com>
14387
14388         * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix 
14389         here too.
14390
14391 2002-07-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14392
14393         * expression.cs: fixed bug #27811.
14394
14395 2002-07-14  Miguel de Icaza  <miguel@ximian.com>
14396
14397         * expression.cs (ParameterReference.AddressOf): Patch from Paolo
14398         Molaro: when we are a ref, the value already contains a pointer
14399         value, do not take the address of it.
14400
14401 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
14402         * removed mb-parser.jay and mb-tokenizer.cs
14403
14404 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
14405
14406         * expression.cs: check against the building corlib void type.
14407
14408 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
14409
14410         * ecore.cs: fix for valuetype static readonly fields: when 
14411         initializing them, we need their address, not the address of a copy.
14412
14413 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
14414
14415         * typemanager.cs: register also enum_type in corlib.
14416
14417 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
14418
14419         * class.cs: allow calling this (but not base) initializers in structs.
14420
14421 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
14422
14423         * ecore.cs: make sure we compare against the building base types
14424         in GetTypeSize ().
14425
14426 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
14427
14428         * typemanager.cs: fix TypeToCoreType() to handle void and object
14429         (corlib gets no more typerefs after this change).
14430
14431 2002-07-12  Miguel de Icaza  <miguel@ximian.com>
14432
14433         * expression.cs (ArrayCreation.EmitArrayArguments): use
14434         Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
14435
14436         (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
14437         Conv_Ovf_I_Un for the array arguments.  Even if C# allows longs as
14438         array indexes, the runtime actually forbids them.
14439
14440         * ecore.cs (ExpressionToArrayArgument): Move the conversion code
14441         for array arguments here.
14442
14443         * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
14444         instead of the default for ValueTypes.
14445
14446         (New.DoEmit): Use IsValueType instead of
14447         IsSubclassOf (value_type)
14448         (New.DoResolve): ditto.
14449         (Invocation.EmitCall): ditto.
14450
14451         * assign.cs (Assign): ditto.
14452
14453         * statement.cs (Unsafe): Ok, so I got the semantics wrong.
14454         Statements *are* currently doing part of their resolution during
14455         Emit.  
14456
14457         Expressions do always resolve during resolve, but statements are
14458         only required to propagate resolution to their children.
14459
14460 2002-07-11  Miguel de Icaza  <miguel@ximian.com>
14461
14462         * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
14463
14464         (LoadAssembly): Do not add the dll if it is already specified
14465
14466         (MainDriver): Add the System directory to the link path at the end,
14467         after all the other -L arguments. 
14468
14469         * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
14470         wrong opcode for loading bytes and bools (ldelem.i1 instead of
14471         ldelem.u1) and using the opposite for sbytes.
14472
14473         This fixes Digger, and we can finally run it.
14474
14475         * driver.cs (UnixParseOption): Move the option parsing here.  
14476         (CSCParseOption): Implement CSC-like parsing of options.
14477
14478         We now support both modes of operation, the old Unix way, and the
14479         new CSC-like way.  This should help those who wanted to make cross
14480         platform makefiles.
14481
14482         The only thing broken is that /r:, /reference: and /lib: are not
14483         implemented, because I want to make those have the same semantics
14484         as the CSC compiler has, and kill once and for all the confussion
14485         around this.   Will be doing this tomorrow.
14486
14487         * statement.cs (Unsafe.Resolve): The state is checked during
14488         resolve, not emit, so we have to set the flags for IsUnsfe here.
14489
14490 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
14491
14492         * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
14493         not catch the Error_ObjectRefRequired in SimpleName (as it is
14494         possible to have a class/instance variable name that later gets
14495         deambiguated), we have to check this here.      
14496
14497 2002-07-10  Ravi Pratap  <ravi@ximian.com>
14498
14499         * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
14500         make static and put into Expression.
14501
14502         (Event.Define): Register the private field of the event with the 
14503         TypeManager so that GetFieldFromEvent can get at it.
14504
14505         (TypeManager.RegisterPrivateFieldOfEvent): Implement to
14506         keep track of the private field associated with an event which
14507         has no accessors.
14508
14509         (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
14510         private field.
14511
14512         * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
14513
14514 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
14515
14516         * expression.cs (Binary.EmitBranchable): this routine emits the
14517         Binary expression in a branchable context.  This basically means:
14518         we need to branch somewhere, not just get the value on the stack.
14519
14520         This works together with Statement.EmitBoolExpression.
14521
14522         * statement.cs (Statement.EmitBoolExpression): Use
14523         EmitBranchable. 
14524
14525 2002-07-09  Miguel de Icaza  <miguel@ximian.com>
14526
14527         * statement.cs (For): Reduce the number of jumps in loops.
14528
14529         (For): Implement loop inversion for the For statement.
14530
14531         (Break): We can be breaking out of a Try/Catch controlled section
14532         (foreach might have an implicit try/catch clause), so we need to
14533         use Leave instead of Br.
14534
14535         * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
14536         now).  If the instace expression supports IMemoryLocation, we use
14537         the AddressOf method from the IMemoryLocation to extract the
14538         address instead of emitting the instance.
14539
14540         This showed up with `This', as we were emitting the instance
14541         always (Emit) instead of the Address of This.  Particularly
14542         interesting when This is a value type, as we dont want the Emit
14543         effect (which was to load the object).
14544
14545 2002-07-08  Miguel de Icaza  <miguel@ximian.com>
14546
14547         * attribute.cs: Pass the entry point to the DefinePInvokeMethod
14548
14549         * statement.cs (Checked): Set the CheckedState during the resolve
14550         process too, as the ConvCast operations track the checked state on
14551         the resolve process, and not emit.
14552
14553         * cs-parser.jay (namespace_member_declaration): Flag that we have
14554         found a declaration when we do.  This is used to flag error 1529
14555
14556         * driver.cs: Report ok when we display the help only.
14557
14558 2002-07-06  Andrew Birkett  <adb@tardis.ed.ac.uk>
14559
14560         * cs-tokenizer.cs (xtoken): Improve handling of string literals.
14561
14562 2002-07-04  Miguel de Icaza  <miguel@ximian.com>
14563
14564         * cs-tokenizer.cs (define): We also have to track locally the
14565         defines.  AllDefines is just used for the Conditional Attribute,
14566         but we also need the local defines for the current source code. 
14567
14568 2002-07-03  Miguel de Icaza  <miguel@ximian.com>
14569
14570         * statement.cs (While, For, Do): These loops can exit through a
14571         Break statement, use this information to tell whether the
14572         statement is the last piece of code.
14573
14574         (Break): Flag that we break.
14575
14576         * codegen.cs (EmitContexts): New `Breaks' state variable.
14577
14578 2002-07-03  Martin Baulig  <martin@gnome.org>
14579
14580         * class.cs (TypeContainer.MethodModifiersValid): Allow override
14581         modifiers in method declarations in structs.  Otherwise, you won't
14582         be able to override things like Object.Equals().
14583
14584 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
14585
14586         * class.cs (Method, Property, Indexer): Do not allow the public
14587         modifier to be used in explicit interface implementations.
14588
14589         (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
14590         override modifiers in method declarations in structs
14591
14592 2002-07-02   Andrew Birkett <adb@tardis.ed.ac.uk>
14593
14594         * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
14595         integer or real overflow, report an error
14596
14597 2002-07-02  Martin Baulig  <martin@gnome.org>
14598
14599         * typemanager.cs (TypeManager.InitCoreTypes): When compiling
14600         corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
14601         to tell the runtime about our newly created System.Object and
14602         System.ValueType types.
14603
14604 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
14605
14606         * expression.cs (This): Use Stobj/Ldobj when we are a member of a
14607         struct instead of Ldarg/Starg.
14608
14609 2002-07-02  Martin Baulig  <martin@gnome.org>
14610
14611         * expression.cs (Indirection.Indirection): Call
14612         TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
14613
14614 2002-07-02  Martin Baulig  <martin@gnome.org>
14615
14616         * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
14617         ValueType, call TypeManager.TypeToCoreType() on it.
14618         (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
14619         the OpCodes.Newarr argument.
14620
14621 2002-07-02  Martin Baulig  <martin@gnome.org>
14622
14623         * expression.cs (Invocation.EmitCall): When compiling corlib,
14624         replace all calls to the system's System.Array type to calls to
14625         the newly created one.
14626
14627         * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
14628         System.Array methods.
14629         (TypeManager.InitCoreTypes): When compiling corlib, get the methods
14630         from the system's System.Array type which must be replaced.
14631
14632 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
14633
14634         * typemanager.cs: load unverifiable_code_ctor so we can build
14635         corlib using the correct type. Avoid using GetTypeCode() with
14636         TypeBuilders.
14637         * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
14638         TypeManager.object_type to allow building corlib.
14639
14640 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
14641
14642         * ecore.cs: handle System.Enum separately in LoadFromPtr().
14643
14644 2002-07-01  Martin Baulig  <martin@gnome.org>
14645
14646         * class.cs: Make the last change actually work, we need to check
14647         whether `ifaces != null' to avoid a crash.
14648
14649 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
14650
14651         * class.cs: when we build structs without fields that implement
14652         interfaces, we need to add the interfaces separately, since there is
14653         no API to both set the size and add the interfaces at type creation
14654         time.
14655
14656 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
14657
14658         * expression.cs: the dimension arguments to the array constructors
14659         need to be converted if they are a long.
14660
14661 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
14662
14663         * class.cs: don't emit ldarg.0 if there is no parent constructor
14664         (fixes showstopper for corlib).
14665
14666 2002-06-29  Martin Baulig  <martin@gnome.org>
14667
14668         MCS now compiles corlib on GNU/Linux :-)
14669
14670         * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
14671         ie. check for MethodImplOptions.InternalCall.
14672
14673         * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
14674         and TypeManager.attribute_type are null, so we must explicitly check
14675         whether parent is not null to find out whether it's an attribute type.
14676         (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
14677         and SetBuilder, not only if the property is neither abstract nor external.
14678         This is necessary to set the MethodImplOptions on the accessor methods.
14679         (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
14680         SetBuilder, see Property.Emit().
14681
14682         * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
14683         populate "System.Object", "System.ValueType" and "System.Attribute" since
14684         they've already been populated from BootCorlib_PopulateCoreTypes().
14685
14686 2002-06-29  Martin Baulig  <martin@gnome.org>
14687
14688         * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
14689         is the NullLiteral, we also need to make sure that target_type is not
14690         an enum type.   
14691
14692 2002-06-29  Martin Baulig  <martin@gnome.org>
14693
14694         * rootcontext.cs (RootContext.ResolveCore): We must initialize
14695         `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
14696         before calling BootstrapCorlib_ResolveDelegate ().
14697
14698 2002-06-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14699
14700         * statement.cs: fixed build-breaker. All tests passed ok.
14701
14702 2002-06-27  Martin Baulig  <martin@gnome.org>
14703
14704         * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
14705         for System.Decimal when compiling corlib.
14706
14707 2002-06-27  Martin Baulig  <martin@gnome.org>
14708
14709         * statement.cs (Switch.TableSwitchEmit): Make this work with empty
14710         switch blocks which contain nothing but a default clause.
14711
14712 2002-06-26  Andrew  <adb@tardis.ed.ac.uk>
14713
14714        * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
14715
14716 2002-06-27  Martin Baulig  <martin@gnome.org>
14717
14718         * ecore.cs (PropertyExpr.PropertyExpr): Call
14719         TypeManager.TypeToCoreType() on the `pi.PropertyType'.
14720
14721         * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
14722         is already a TypeBuilder.
14723
14724 2002-06-27  Martin Baulig  <martin@gnome.org>
14725
14726         * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
14727         `target_type == TypeManager.array_type', not IsAssignableFrom() in
14728         the "from an array-type to System.Array" case.  This makes it work
14729         when compiling corlib.
14730
14731 2002-06-27  Martin Baulig  <martin@gnome.org>
14732
14733         * ecore.cs (Expression.SimpleNameResolve): If the expression is a
14734         non-static PropertyExpr, set its InstanceExpression.  This makes
14735         the `ICollection.Count' property work in System/Array.cs.
14736
14737 2002-06-25  Andrew Birkett  <adb@tardis.ed.ac.uk>
14738
14739         * driver.cs: Made error handling more consistent.  Errors now
14740         tracked by Report class, so many methods which used to return int
14741         now return void.  Main() now prints success/failure and 
14742         errors/warnings message.
14743
14744         Renamed '--probe' compiler argument to '--expect-error'.  Removed
14745         the magic number return values (123 and 124).  Now, if the
14746         expected error occurs, the compiler exits with success (exit value
14747         0).  If the compilation completes without seeing that particular
14748         error, the compiler exits with failure (exit value 1).  The
14749         makefile in mcs/errors has been changed to handle the new behaviour.
14750
14751         * report.cs: Made 'expected error' number a property and renamed
14752         it from 'Probe' to 'ExpectedError'.
14753
14754         * genericparser.cs: Removed error handling support, since it is
14755         now all done by Report class.
14756
14757         * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
14758         class, so parse() no longer returns an int.
14759
14760         * namespace.cs: Use Report.Error instead of GenericParser.error
14761
14762 2002-06-22  Miguel de Icaza  <miguel@ximian.com>
14763
14764         * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
14765         TypeContainer.AddOperator): At the front of the list put the
14766         explicit implementations, so they get resolved/defined first. 
14767
14768 2002-06-21  Miguel de Icaza  <miguel@ximian.com>
14769
14770         * class.cs (TypeContainer.VerifyImplements): Verifies that a given
14771         interface type is implemented by this TypeContainer.  Used during
14772         explicit interface implementation.
14773
14774         (Property.Define, Indexer.Define, Method.Define): Validate that
14775         the given interface in the explicit implementation is one of the
14776         base classes for the containing type.
14777
14778         Also if we are explicitly implementing an interface, but there is
14779         no match in the pending implementation table, report an error.
14780
14781         (Property.Define): Only define the property if we are
14782         not explicitly implementing a property from an interface.  Use the
14783         correct name also for those properties (the same CSC uses,
14784         although that is really not needed).
14785
14786         (Property.Emit): Do not emit attributes for explicitly implemented
14787         properties, as there is no TypeBuilder.
14788
14789         (Indexer.Emit): ditto.
14790
14791         Hiding then means that we do not really *implement* a pending
14792         implementation, which makes code fail.
14793
14794 2002-06-22  Martin Baulig  <martin@gnome.org>
14795
14796         * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
14797         the return value of Object.GetType().  [FIXME: we need to do this whenever
14798         we get a type back from the reflection library].
14799
14800 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
14801
14802         * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
14803
14804 2002-06-20  Miguel de Icaza  <miguel@ximian.com>
14805
14806         * attribute.cs: Return null if we can not look up the type.
14807
14808         * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
14809         the interface types found.
14810
14811         * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
14812         interface types found.
14813
14814         * typemanager.cs (GetInterfaces): Make this routine returns alll
14815         the interfaces and work around the lame differences between
14816         System.Type and System.Reflection.Emit.TypeBuilder in the results
14817         result for GetInterfaces.
14818
14819         (ExpandInterfaces): Given an array of interface types, expand and
14820         eliminate repeated ocurrences of an interface.  This expands in
14821         context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
14822         be IA, IB, IC.
14823
14824 2002-06-21  Martin Baulig  <martin@gnome.org>
14825
14826         * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
14827         on System.Enum.
14828
14829 2002-06-21  Martin Baulig  <martin@gnome.org>
14830
14831         * typemanager.cs (TypeManager.TypeToCoreType): New function.  When compiling corlib
14832         and called with one of the core types, return the corresponding typebuilder for
14833         that type.
14834
14835         * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
14836         element type.
14837
14838 2002-06-21  Martin Baulig  <martin@gnome.org>
14839
14840         * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
14841         `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
14842         (Expression.ConvertReferenceExplicit): Likewise.
14843
14844         * expression.cs (ElementAccess.DoResolve): Likewise.
14845         (ElementAccess.DoResolveLValue): Likewise.
14846
14847 2002-06-10  Martin Baulig  <martin@gnome.org>
14848
14849         * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
14850         add the "value" parameter to the parameter list.
14851
14852         * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
14853         to our caller.
14854
14855 2002-06-19  Miguel de Icaza  <miguel@ximian.com>
14856
14857         * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
14858         the argument to an int, uint, long or ulong, per the spec.  Also
14859         catch negative constants in array creation.
14860
14861 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
14862
14863         * class.cs: do not allow the same interface to appear twice in
14864         the definition list.
14865
14866 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
14867
14868         * ecore.cs: don't use ldlen with System.Array.
14869
14870 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
14871
14872         * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
14873
14874 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
14875
14876         * modifiers.cs: produce correct field attributes for protected
14877         internal. Easy fix so miguel can work on ther harder stuff:-)
14878
14879 2002-06-18  Miguel de Icaza  <miguel@ximian.com>
14880
14881         * pending.cs: New file.  Move the code from class.cs here.
14882         Support clearning the pending flag for all methods (when not doing
14883         explicit interface implementation).
14884
14885 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
14886
14887         * rootcontext.cs: added a couple more types needed to bootstrap.
14888
14889 2002-06-17  Miguel de Icaza  <miguel@ximian.com>
14890
14891         * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
14892         constructor in the type, instead of any constructor in the type
14893         hierarchy.  Thanks to Paolo for finding this bug (it showed up as
14894         a bug in the Mono runtime when applying the params attribute). 
14895
14896 2002-06-16  Rafael Teixeira  <rafaelteixeirabr@hotmail.com>
14897         * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
14898
14899 2002-06-14  Rachel Hestilow  <hestilow@ximian.com>
14900
14901         * expression.cs (Unary.ResolveOperator): Use TypeManager
14902         to resolve the type.
14903
14904 2002-06-13  Ravi Pratap  <ravi@ximian.com>
14905
14906         * cs-parser.jay (enum_member_declaration): Pass in the attributes
14907         attached.
14908
14909         * enum.cs (AddEnumMember): Add support to store the attributes associated 
14910         with each member too.
14911
14912         * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
14913         field builders too - this takes care of the enum member case.
14914
14915 2002-06-10  Rachel Hestilow  <hestilow@ximian.com>
14916
14917         * typemanager.cs (TypeManager.VerifyUnManaged): Allow
14918         address-of operator on both value types and pointers.
14919
14920 2002-06-10  Martin Baulig  <martin@gnome.org>
14921
14922         * interface.cs (Interface.PopulateIndexer): Add the indexer's
14923         PropertyBuilder to the `property_builders' list.
14924
14925         * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
14926         (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
14927         `lookup_type' and all its interfaces.  Unfortunately, Type.FindMembers() won't
14928         find any indexers which are inherited from an interface.
14929
14930 2002-06-09  Martin Baulig  <martin@gnome.org>
14931
14932         * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
14933         the same type as the constant if necessary.  There's also a test-130.cs
14934         for this.
14935
14936         * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
14937
14938         * typemanager.cs (TypeManager.ChangeType): Previously known as
14939         Enum.ChangeEnumType().
14940
14941 2002-06-09  Martin Baulig  <martin@gnome.org>
14942
14943         * expression.cs (Cast.TryReduce): Added support for consts.
14944
14945 2002-06-08  Ravi Pratap  <ravi@ximian.com>
14946
14947         * class.cs (Accessor): Hold attributes information so we can pass
14948         it along.
14949
14950         * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
14951         Modify to pass in attributes attached to the methods.
14952
14953         (add_accessor_declaration, remove_accessor_declaration): Ditto.
14954
14955         * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
14956         to handle the Accessor kind :-)
14957
14958         * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
14959
14960 2002-06-08  Martin Baulig  <martin@gnome.org>
14961
14962         * expression.cs (Unary.TryReduceNegative): Added support for
14963         ULongConstants.
14964
14965 2002-06-08  Martin Baulig  <martin@gnome.org>
14966
14967         * enum.cs (Enum.LookupEnumValue): Don't report an error if the
14968         name can't be found in the `defined_names' - the caller will do a
14969         MemberLookup in this case and thus find methods in System.Enum
14970         such as Enum.IsDefined().
14971
14972 2002-06-08  Martin Baulig  <martin@gnome.org>
14973
14974         * enum.cs (Enum.ChangeEnumType): This is a custom version of
14975         Convert.ChangeType() which works with TypeBuilder created types.
14976         (Enum.LookupEnumValue, Enum.Define): Use it here.
14977
14978         * class.cs (TypeContainer.RegisterRequiredImplementations): Added
14979         `TypeBuilder.BaseType != null' check.
14980         (TypeContainer.FindMembers): Only lookup parent members if we
14981         actually have a parent.
14982         (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
14983         (ConstructorInitializer.Resolve): Likewise.
14984
14985         * interface.cs (Interface.FindMembers): Added
14986         `TypeBuilder.BaseType != null' check.
14987
14988         * rootcontext.cs (RootContext.ResolveCore): Added
14989         "System.Runtime.CompilerServices.IndexerNameAttribute" to
14990         classes_second_stage.
14991
14992         * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
14993         debug_type and trace_type when compiling with --nostdlib.       
14994
14995 2002-06-07  Martin Baulig  <martin@gnome.org>
14996
14997         * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
14998         (AddField): Set it to true when adding a non-static field.
14999         (DefineType): Use `have_nonstatic_fields' to find out whether we
15000         have non-static fields, not `Fields != null'.
15001
15002 2002-06-02  Miguel de Icaza  <miguel@ximian.com>
15003
15004         * ecore.cs (SimpleNameResolve): Removed simple bug (we were
15005         dereferencing a null on the static-field code path)
15006
15007 2002-05-30  Martin Baulig  <martin@gnome.org>
15008
15009         * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
15010         to take command line arguments.  Use reflection to call the new
15011         custom `Initialize' function on the symbol writer and pass it the
15012         command line arguments.
15013
15014         * driver.cs (--debug-args): New command line argument to pass command
15015         line arguments to the symbol writer.
15016
15017 2002-05-28  Miguel de Icaza  <miguel@ximian.com>
15018
15019         * assign.cs (DoResolve): Forgot to do the implicit conversion to
15020         the target type for indexers and properties.  Thanks to Joe for
15021         catching this.
15022
15023 2002-05-27  Miguel de Icaza  <miguel@ximian.com>
15024
15025         * typemanager.cs (MethodFlags): returns the method flags
15026         (Obsolete/ShouldIgnore) that control warning emission and whether
15027         the invocation should be made, or ignored. 
15028
15029         * expression.cs (Invocation.Emit): Remove previous hack, we should
15030         not do this on matching a base type, we should do this based on an attribute
15031
15032         Only emit calls to System.Diagnostics.Debug and
15033         System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
15034         on the command line.
15035
15036         * rootcontext.cs: Global settings for tracing and debugging.
15037
15038         * cs-tokenizer.cs (define): New utility function to track
15039         defines.   Set the global settings for TRACE and DEBUG if found.
15040
15041 2002-05-25  Ravi Pratap  <ravi@ximian.com>
15042
15043         * interface.cs (Populate*): Pass in the TypeContainer as well as
15044         the DeclSpace as parameters so that we can create EmitContexts and
15045         then use that to apply attributes etc.
15046
15047         (PopulateMethod, PopulateEvent, PopulateProperty)
15048         (PopulateIndexer): Apply attributes everywhere.
15049
15050         * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
15051         etc.
15052
15053         (ApplyAttributes): Update accordingly.
15054
15055         We now apply interface attributes for all members too.
15056
15057 2002-05-26  Miguel de Icaza  <miguel@ximian.com>
15058
15059         * class.cs (Indexer.Define); Correctly check if we are explicit
15060         implementation (instead of checking the Name for a ".", we
15061         directly look up if the InterfaceType was specified).
15062
15063         Delay the creation of the PropertyBuilder.
15064
15065         Only create the PropertyBuilder if we are not an explicit
15066         interface implementation.   This means that explicit interface
15067         implementation members do not participate in regular function
15068         lookups, and hence fixes another major ambiguity problem in
15069         overload resolution (that was the visible effect).
15070
15071         (DefineMethod): Return whether we are doing an interface
15072         implementation. 
15073
15074         * typemanager.cs: Temporary hack until we get attributes in
15075         interfaces (Ravi is working on that) and we get IndexerName
15076         support in interfaces.
15077
15078         * interface.cs: Register the indexers as properties.
15079
15080         * attribute.cs (Attribute.Resolve): Catch the error, and emit a
15081         warning, I have verified that this is a bug in the .NET runtime
15082         (JavaScript suffers of the same problem).
15083
15084         * typemanager.cs (MemberLookup): When looking up members for
15085         interfaces, the parent of an interface is the implicit
15086         System.Object (so we succeed in searches of Object methods in an
15087         interface method invocation.  Example:  IEnumerable x;  x.ToString
15088         ()) 
15089
15090 2002-05-25  Miguel de Icaza  <miguel@ximian.com>
15091
15092         * class.cs (Event): Events should also register if they do
15093         implement the methods that an interface requires.
15094
15095         * typemanager.cs (MemberLookup); use the new GetInterfaces
15096         method. 
15097
15098         (GetInterfaces): The code used to lookup interfaces for a type is
15099         used in more than one place, factor it here. 
15100
15101         * driver.cs: Track the errors at the bottom of the file, we kept
15102         on going.
15103
15104         * delegate.cs (NewDelegate.Emit): We have to emit a null as the
15105         instance if the method we are calling is static!
15106
15107 2002-05-24  Miguel de Icaza  <miguel@ximian.com>
15108
15109         * attribute.cs (ApplyAttributes): Make this function filter out
15110         the IndexerName attribute (as that attribute in reality is never
15111         applied) and return the string constant for the IndexerName
15112         attribute. 
15113
15114         * class.cs (TypeContainer.Emit): Validate that all the indexers
15115         have the same IndexerName attribute, and if so, set the
15116         DefaultName attribute on the class. 
15117
15118         * typemanager.cs: The return value might contain other stuff (not
15119         only methods).  For instance, consider a method with an "Item"
15120         property and an Item method.
15121
15122         * class.cs: If there is a problem with the parameter types,
15123         return. 
15124
15125 2002-05-24  Ravi Pratap  <ravi@ximian.com>
15126
15127         * ecore.cs (ImplicitConversionExists): Wrapper function which also
15128         looks at user defined conversion after making a call to 
15129         StandardConversionExists - we need this for overload resolution.
15130
15131         * expression.cs : Update accordingly the various method calls.
15132
15133         This fixes 2 bugs filed against implicit user defined conversions 
15134
15135 2002-05-22  Miguel de Icaza  <miguel@ximian.com>
15136
15137         * statement.cs: Track the result of the assignment.
15138
15139 2002-05-21  Miguel de Icaza  <miguel@ximian.com>
15140
15141         * expression.cs (MemberAccess): Improved error reporting for
15142         inaccessible members.
15143
15144 2002-05-22  Martin Baulig  <martin@gnome.org>
15145
15146         * makefile (mcs-mono2.exe): New target.  This is mcs compiled with
15147         itself with debugging support.
15148
15149 2002-05-22  Martin Baulig  <martin@gnome.org>
15150
15151         * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
15152         Removed, this isn't needed anymore.
15153
15154 2002-05-20  Martin Baulig  <martin@gnome.org>
15155
15156         * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
15157         be underlying type for an enum.
15158
15159 2002-05-20  Miguel de Icaza  <miguel@ximian.com>
15160
15161         * typemanager.cs (InitEnumUnderlyingTypes): New helper function
15162         that splits out the loading of just the core types.
15163
15164         * rootcontext.cs (ResolveCore): Split the struct resolution in
15165         two, so we can load the enumeration underlying types before any
15166         enums are used.
15167
15168         * expression.cs (Is): Bandaid until we fix properly Switch (see
15169         bug #24985 for details).
15170
15171         * typemanager.cs (ImplementsInterface): The hashtable will contain
15172         a null if there are no interfaces implemented.
15173
15174 2002-05-18  Miguel de Icaza  <miguel@ximian.com>
15175
15176         * cs-parser.jay (indexer_declarator): It is fine to have array
15177         parameters
15178
15179 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
15180
15181         * typemanager.cs: (RegisterBuilder): New function used to register
15182         TypeBuilders that implement interfaces.  Since
15183         TypeBuilder.GetInterfaces (as usual) does not work with lame
15184         Reflection.Emit. 
15185         (AddUserType): register interfaces.
15186
15187         (ImplementsInterface): Use the builder_to_ifaces hash if we are
15188         dealing with TypeBuilder.  Also, arrays are showing up as
15189         SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
15190         methods can not be invoked on them!
15191
15192         * ecore.cs (ExplicitReferenceConversionExists): Made public.
15193         (ImplicitReferenceConversionExists): Split out from
15194         StandardConversionExists. 
15195
15196         * expression.cs (As): We were only implementing one of the three
15197         cases for the as operator.  We now implement them all.
15198         (Is): Implement the various other cases for Is as well.
15199
15200         * typemanager.cs (CACHE): New define used to control if we want or
15201         not the FindMembers cache.  Seems to have a negative impact on
15202         performance currently
15203
15204         (MemberLookup): Nested types have full acess to
15205         enclosing type members
15206
15207         Remove code that coped with instance/static returns for events, we
15208         now catch this in RealFindMembers.
15209
15210         (RealFindMembers): only perform static lookup if the instance
15211         lookup did not return a type or an event.  
15212
15213 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
15214
15215         * assign.cs (CompoundAssign): We pass more semantic information
15216         now to Compound Assignments than we did before: now we have all
15217         the information at hand, and now we resolve the target *before* we
15218         do the expression expansion, which allows the "CacheValue" method
15219         to have the effect we intended (before, a [x] += 1 would generate
15220         two differen ArrayAccess expressions from the ElementAccess,
15221         during the resolution process).
15222
15223         (CompoundAssign.DoResolve): Resolve target and original_source here.
15224
15225 2002-05-16  Miguel de Icaza  <miguel@ximian.com>
15226
15227         * expression.cs (ArrayAccess): dropped debugging information. 
15228
15229         * typemanager.cs: Small bug fix: I was always returning i_members,
15230         instead of one of i_members or s_members (depending on which had
15231         the content).
15232
15233         * assign.cs (IAssignMethod.CacheTemporaries): New method.  This
15234         method is invoked before any code generation takes place, and it
15235         is a mechanism to inform that the expression will be invoked more
15236         than once, and that the method should use temporary values to
15237         avoid having side effects
15238
15239         (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
15240
15241         * ecore.cs (Expression.CacheTemporaries): Provide empty default
15242         implementation.
15243
15244         * expression.cs (Indirection, ArrayAccess): Add support for
15245         CacheTemporaries in these two bad boys. 
15246
15247         * ecore.cs (LoadFromPtr): figure out on our own if we need to use
15248         ldobj or ldind_ref.  
15249         (StoreFromPtr): Handle stobj as well.
15250
15251         * expression.cs (UnaryMutator): Share more code.
15252
15253         * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
15254         down: I was not tracking the Filter function as well, which
15255         was affecting the results of the cache.
15256
15257 2002-05-15  Miguel de Icaza  <miguel@ximian.com>
15258
15259         * attribute.cs: Remove the hack to handle the CharSet property on
15260         StructLayouts. 
15261
15262 2002-05-14  Miguel de Icaza  <miguel@ximian.com>
15263
15264         * attribute.cs (DoResolve): More uglyness, we now only try to
15265         resolve the attribute partially, to extract the CharSet
15266         information (only if we are a StructLayout attribute).  Otherwise 
15267
15268         (GetExtraTypeInfo): Add some code to conditionally kill in the
15269         future this.   I am more and more convinced that the .NET
15270         framework has special code to handle the attribute setting on
15271         certain elements.
15272
15273         * expression.cs (IsParamsMethodApplicable): Revert my previous
15274         foreach change here, it was wrong.
15275
15276 2002-05-13  Miguel de Icaza  <miguel@ximian.com>
15277
15278         * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
15279         (pp_expr): do not abort on unknown input, just return.
15280         (eval): abort if there are pending chars.
15281
15282         * attribute.cs (Attribute.Resolve): Positional parameters are
15283         optional.  Deal with that case.
15284
15285         * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
15286         the Ansi/Unicode/Auto information for the type.
15287
15288         (TypeContainer.DefineType): instantiate the EmitContext here, as
15289         we will be using it during the type definition (to resolve
15290         attributes) and during the emit phase.
15291
15292         * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
15293         to pull type information out of the attributes
15294
15295         (Attribute.Resolve): track the constructor builder, and allow for
15296         multiple invocations (structs and classes will use this).
15297
15298         * ecore.cs (MemberLookupFinal): new version with all the
15299         parameters customizable.
15300
15301         * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
15302         constructors.  Return if the result value is null (as the error
15303         would have been flagged already by MemberLookupFinal)
15304
15305         Do not allow instances of abstract classes or interfaces to be
15306         created.
15307
15308         * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
15309         We have to compare the assembly property here when dealing with
15310         FamANDAssem and Assembly access modifiers, because we might be
15311         creating an assembly from *modules* (that means that we are not
15312         getting TypeBuilders for types defined in other modules that are
15313         part of this assembly).
15314
15315         (Method.Emit): If the method is marked abstract and has a body,
15316         emit an error. 
15317
15318         (TypeContainer.DefineMembers): If both the defined member and the
15319         parent name match are methods, then do not emit any warnings: let
15320         the Method.Define routine take care of flagging warnings.  But if
15321         there is a mismatch (method overrides something else, or method is
15322         overriwritten by something, then emit warning).
15323
15324         (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
15325         set to null, this means `do not check for the return type on the
15326         signature'. 
15327
15328         (Method.Define): set the return type for the method signature to
15329         null, so that we get methods with the same name and parameters and
15330         different return types.  This is used to flag warning 114 (you are
15331         hiding a method, and you probably want to use the new/override
15332         keywords instead).
15333
15334         * typemanager.cs (MemberLookup): Implemented proper access
15335         control, closing a long standing set of bug reports.  The problem
15336         was that the Framework only has two bits: Public and NonPublic,
15337         and NonPublic includes private and protected methods, but we need
15338         to enforce the FamANDAssem, FamOrAssem and Family. 
15339
15340 2002-05-11  Miguel de Icaza  <miguel@ximian.com>
15341
15342         * statement.cs (GotoCase): Return true: Ammounts to giving up
15343         knowledge on whether we return or not, and letting the other case
15344         be responsible for it.
15345
15346 2002-05-10  Miguel de Icaza  <miguel@ximian.com>
15347
15348         * driver.cs: Do not load directories for each file processed, only
15349         do it if there is a pattern.
15350
15351         * ecore.cs: Report readonly assigns here as well, as we might have
15352         been resolved only by MemberAccess.
15353
15354         (SimpleName.SimpleNameResolve): Also be useful for LValue
15355         resolution.   We need this to propagate assign to local readonly variables
15356
15357         * typemanager.cs: Use a ptrhashtable for the criteria, because we
15358         do not want to reuse potential criteria memory.
15359
15360         * class.cs (MyEventBuilder): Set reflected_type;
15361
15362         * ecore.cs (Constantify): Added support for constifying bools.
15363
15364         (RootContext.LookupType): Added a cache for values looked up in
15365         the declaration space.
15366
15367         * typemanager.cs (FindMembers): Now is a front-end to
15368         RealFindMembers, and provides a two-level hashtable-based cache to
15369         the request.  
15370
15371         15% performance improvement: from 22.5 to 19.2 seconds.
15372
15373         * expression.cs (IsParamsMethodApplicable): use foreach.
15374         (Invocation.DoResolve): ditto.
15375         (New.DoResolve): ditto.
15376         (ArrayCreation.DoResolve): ditto.
15377
15378         * ecore.cs (FindMostEncompassingType): use foreach.
15379
15380         * delegate.cs (NewDelegate.DoResolve): Use foreach
15381
15382         * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
15383         (RemoveMethods): use foreach.
15384
15385         * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
15386         nested foreach statements instead of for, and also break out of
15387         the inner loop once a match is found.
15388
15389         (Invocation.OverloadResolve): Use foreach, simplify the code. 
15390
15391 2002-05-08  Miguel de Icaza  <miguel@ximian.com>
15392
15393         * cfold.cs (BinaryFold): During an enumeration evaluation context,
15394         we actually unwrap the expression to allow for extra information
15395         to be extracted. 
15396
15397         * expression.cs: Use Shr_Un on unsigned operations. 
15398
15399 2002-05-08  Ravi Pratap  <ravi@ximian.com>
15400
15401         * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of 
15402         applicable operators was not being considered correctly. This closes
15403         the bug Miguel reported.
15404
15405 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
15406
15407         * attribute.cs: check that the type derives from System.Attribute
15408         and report the correct error in that case (moved the duplicate code to
15409         its own method, too).
15410
15411 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
15412
15413         * attribute.cs: lookup attribute type name as the spec says: first the
15414         bare attribute name and then name + "Attribute" (nant compiles with
15415         mcs after this fix).
15416
15417 2002-05-07  Miguel de Icaza  <miguel@ximian.com>
15418
15419         * expression.cs (Unary.TryReduceNegative): Ah!  Tricky!  Tricky!
15420         Because of the way we parse things, we should try to see if a
15421         UIntConstant can fit in an integer.
15422
15423 2002-05-07  Ravi Pratap  <ravi@ximian.com>
15424
15425         * ecore.cs (GetConversionOperators): Do not pick up op_True operators
15426         when we are in an explicit context.
15427
15428         (ConvertReferenceExplicit): When converting from Iface type S to Class
15429         T make sure the rules are implemented as an OR.
15430
15431         * parameter.cs (ParameterType): Make it a property for now although the
15432         purpose really isn't anything immediate.
15433
15434         * expression.cs (Is*Applicable): Do better checking on the parameter type
15435         of a ref/out parameter. The ones from the system assemblies are already 
15436         marked with the correct type so we don't need to do any correction.
15437
15438         * ecore.cs (StandardConversionExists): Conversion from Interface types to 
15439         the object type is standard too so include that.
15440
15441 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
15442
15443         * ecore.cs (StandardConversionExists): Augment with missing code:
15444         deal with IntConstant, LongConstants and Enumerations.
15445
15446         * assign.cs: Report the error, instead of failing silently
15447
15448         * rootcontext.cs (AddGlobalAttributes): Track attributes on the
15449         typecontainer that they are declared, because the
15450         typecontainer/namespace will have the list of using clauses that
15451         need to be applied.
15452
15453         Assembly Attributes were escaping the normal registration
15454         mechanism. 
15455
15456         (EmitCode): Apply attributes within an EmitContext that represents
15457         the container they were declared on.
15458
15459         * cs-parser.jay: Track bases for structs.  How did I get this wrong?
15460
15461 2002-05-06  Ravi Pratap  <ravi@ximian.com>
15462
15463         * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
15464         Revamp completely - make much cleaner as we now operate only
15465         on a set of Types.
15466
15467         (FindMostSpecificSource, FindMostSpecificTarget): New methods
15468         to implement the logic detailed in the spec more correctly.
15469
15470         (UserDefinedConversion): Update accordingly.
15471
15472 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
15473
15474         * statement.cs: Return flow analysis information up.
15475
15476         * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
15477         and the default.
15478
15479         (token): Do not consume an extra character before calling
15480         decimal_digits.
15481
15482 2002-05-06  Piers Haken <piersh@friskit.com>
15483
15484         * cs-parser.jay: add 'override' attribute to System.Object.Finalize
15485
15486 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
15487
15488         * class.cs (Constructor.Emit): Set the IsStatic flag in the
15489         EmitContext during the instance constructor initializer
15490         resolution, to stop access to instance variables.
15491
15492         This is mandated by the spec, last paragraph of the `constructor
15493         initializers' section. 
15494
15495 2002-05-05  Miguel de Icaza  <miguel@ximian.com>
15496
15497         * cs-parser.jay, class.cs (Accessor): new class used to represent
15498         an accessor (get or set).  In the past we used `null' to represent
15499         a missing accessor.  But this is ambiguous because there was no
15500         way to tell in abstract indexers/properties if one of them was
15501         specified.
15502
15503         Now there is a way of addressing that.
15504
15505         * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
15506         instead of FindMembers.
15507
15508         * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
15509         the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
15510
15511         * attribute.cs: Treat indexers and properties as the same in terms
15512         of applying attributes
15513
15514         * ecore.cs (FindMostEncompassedType): Use statically initialized
15515         EmptyExpressions()s like we do elsewhere to avoid creating useless
15516         objects (and we take this out of the tight loop).
15517
15518         (GetConversionOperators): Move the code to extract the actual
15519         operators to a separate routine to clean things up.
15520
15521 2002-05-04  Miguel de Icaza  <miguel@ximian.com>
15522
15523         * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
15524         events are always registered FieldBuilders.
15525
15526         * class.cs (FieldBase): New class shared by Fields 
15527
15528         * delegate.cs: If we are a toplevel delegate, use our full name.
15529         If we are a nested delegate, then only use our tail name.
15530
15531 2002-05-02  Ravi Pratap  <ravi@ximian.com>
15532
15533         * expression.cs (IsApplicable): Ensure that we add the "&" to
15534         ref/out types before comparing it with the type of the argument.
15535
15536         (IsParamsMethodApplicable): Ditto.
15537
15538         (Argument.Type): Use TypeManager.LookupType instead of Type.GetType - 
15539         silly me ;-)
15540
15541         * delegate.cs : Handle the case when we have more than one applicable
15542         method. Flag an error only when we finish checking all.
15543
15544 2002-05-02  Miguel de Icaza  <miguel@ximian.com>
15545
15546         * expression.cs: Add support for boolean static initializers.
15547
15548 2002-05-01  Miguel de Icaza  <miguel@ximian.com>
15549
15550         * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
15551
15552         * parameter.cs (ComputeParameterTypes,
15553         ComputeAndDefineParameterTypes): Better error handling: now we
15554         clear the `types' cache if we fail during any of the type lookups.
15555         We also return the status code correctly to our caller
15556
15557         * delegate.cs: If we fail to define a delegate, abort the extra
15558         steps. 
15559
15560         * expression.cs (Binary.ResolveOperator): for
15561         operator==(object,object) and operator !=(object, object) we also
15562         have to verify that there is an implicit conversion from one to
15563         the other.
15564
15565         (ArrayAccess.DoResolve): Array Access can operate on
15566         non-variables. 
15567
15568 2002-04-30  Miguel de Icaza  <miguel@ximian.com>
15569
15570         * assign.cs (CompoundAssign): A new class used as a "flag" that
15571         the assignment actually is happening as part of a compound
15572         assignment operator.
15573
15574         During compound assignment, a few new rules exist to enable things
15575         like:
15576
15577         byte b |= 1 + 2
15578
15579         From the spec:
15580
15581         x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
15582         to the type of x) if y is implicitly convertible to the type of x,
15583         and the operator is a builtin operator and the return type of the
15584         operator is explicitly convertible to the type of x. 
15585
15586         * rootcontext.cs: Reset warning level to 2.  4 catches various
15587         "interesting" features in mcs, we must clean this up at some
15588         point, but currently am trying to kill other bugs ;-)
15589
15590         * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
15591         in container classes as well.  
15592
15593         * expression.cs (Binary.ResolveOperator): Handle string case
15594         before anything else (as operator overloading does emit an error
15595         before doing anything else).
15596
15597         This code could go away when we move to a table driven model, but
15598         i could not come up with a good plan last night.
15599
15600 2002-04-30  Lawrence Pit <loz@cable.a2000.nl>
15601
15602         * typemanager.cs (CSharpName): reimplementation using regex.
15603         * class.cs: added null check for fields in Emit
15604         * rootcontext.cs: set warninglevel to 4
15605
15606 2002-04-29  Miguel de Icaza  <miguel@ximian.com>
15607
15608         * typemanager.cs (CSharpName): reimplemented with Lupus
15609         suggestion.
15610
15611 2002-04-28  Miguel de Icaza  <miguel@ximian.com>
15612
15613         * statement.cs (If): correclty implement Resolve, because we were
15614         not catching sem errors in there.  The same process is needed
15615         everywhere else. 
15616         (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
15617
15618
15619         (Statement.Warning_DeadCodeFound): Factorize code.
15620         (While): Report dead code here too.
15621
15622         (Statement): Added Resolve virtual method to allow
15623         for resolution split from the emit code.
15624
15625 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
15626
15627         * statement.cs (EmitBoolExpression): No longer try to resolve the
15628         expression here.    
15629         (MakeBoolean): New utility function that resolve, implicitly
15630         converts to boolean and tags the expression. 
15631
15632
15633         (If, Do): Implement dead code elimination.
15634         (While): Implement loop inversion
15635
15636         (Do, While, For, If): Resolve the expression prior to calling our
15637         code generation.
15638
15639 2002-04-22  Lawrence Pit <loz@cable.a2000.nl>
15640
15641         * class.cs:
15642           - added method Report28 (warning: program has more than one entry point)
15643           - added method IsEntryPoint, implements paragraph 10.1 of the spec
15644           - modified method Method.Define, the part at the end of the method
15645
15646         * rootcontext.cs: added static public Location EntryPointLocation;
15647           
15648         * ../errors/cs0028.cs : Add test case for the above warning.              
15649
15650         * typemanager.cs:
15651           - modified method CSharpName to allow arrays of primitive type to
15652             be printed nicely (e.g. instead of System.Int32[][] it now prints
15653             int[][])
15654           - added method CSharpSignature: returns the signature of a method
15655             in string format to be used in reporting errors, warnings, etc.
15656
15657         * support.cs: InternalParameters.ParameterDesc variable tmp initialized
15658         with String.Empty.
15659
15660 2002-04-26  Ravi Pratap  <ravi@ximian.com>
15661
15662         * delegate.cs (Define): Fix extremely silly bug where I was
15663         setting the type of the 'object' parameter of the BeginInvoke
15664         method to System.IAsyncResult instead of System.Object ;-)
15665
15666 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
15667
15668         * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
15669         here. 
15670
15671         (Constructor.Emit): return if we fail to initialize the
15672         constructor.  Another door closed!  
15673
15674         * expression.cs (New.DoResolve): Improve error message (from -6 to
15675         1501).  Use DeclaredOnly lookup to find the exact constructor.
15676
15677         * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
15678         loop.  This is useful.
15679
15680         * cs-parser.jay: Adjust the default parameters so that destructors
15681         have the proper signature.
15682
15683 2002-04-26  Martin Baulig  <martin@gnome.org>
15684
15685         * driver.cs (LoadAssembly): If `assembly' contains any characters
15686         which are only valid in path names and not in assembly names
15687         (currently slash, backslash and point), use Assembly.LoadFrom ()
15688         instead of Assembly.Load () on the `assembly' (before iteration
15689         over the link_paths).
15690
15691 2002-04-26  Martin Baulig  <martin@gnome.org>
15692
15693         * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
15694
15695 2002-04-25  Miguel de Icaza  <miguel@ximian.com>
15696
15697         * class.cs (Property): use the new typemanager.MemberLookup
15698
15699         (TypeContainer.MemberLookup): Implement using the
15700         TypeManager.MemberLookup now. 
15701
15702         * typemanager.cs: Make MemberLookup a function of the TypeManager,
15703         and return MemberInfos, so that these can be used without an
15704         EmitContext (what we had before).
15705
15706 2002-04-24  Miguel de Icaza  <miguel@ximian.com>
15707
15708         * expression.cs: Fix the case where the argument to params if the
15709         type of the params.  I omitted handling this before.   Fixed
15710
15711 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
15712
15713         * driver.cs: Call BootCorlib_PopulateCoreType
15714
15715         * class.cs (Property.CheckBase): Check for properties only, not
15716         for all members. 
15717
15718         * interface.cs: Temporary hack: try/catch around the
15719         CustomAttributeBuilder, because I am getting an exception that I
15720         do not understand.
15721
15722         * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
15723         types whose definitions are required to be there (attributes are
15724         defined before standard types).
15725
15726         Compute definitions as we boot the various types, as they are used
15727         immediately (value_type class will need object_type, but if we do
15728         not initialize object_type, we will pass a null, which will let
15729         the runtime pick the System.Object from the existing corlib, which
15730         is not what we want).
15731
15732 2002-04-22  Patrik Torstensson <totte@labs2.com>
15733
15734         * cs-tokenizer.cs: fixed a number of trim() issues.
15735
15736 2002-04-22  Ravi Pratap  <ravi@ximian.com>
15737
15738         * expression.cs (Argument.Type): Ensure that we return the correct
15739         type when we have out or ref parameters [in which case we 
15740         append a "&"].
15741
15742 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
15743
15744         * class.cs (Property, Indexer): Allow extern modifier in there. 
15745
15746         * typemanager.cs (InitBaseTypes): Initializes object_type and
15747         value_type, since those will be used early on during the bootstrap
15748         process to compile corlib.
15749
15750         (InitCoreTypes): Move code from here to InitBaseTypes.
15751
15752 2002-04-21  Miguel de Icaza  <miguel@ximian.com>
15753
15754         * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
15755         single-dimension arrays as using the ldlen opcode.  
15756
15757         Daniel Lewis discovered this optimization.  
15758
15759         * typemanager.cs: Add signature for System.Array::get_Length
15760
15761 2002-04-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15762
15763         * statement.cs: report the error when the foreach does not apply to an
15764         array nor a collection.
15765
15766 2002-04-19  Miguel de Icaza  <miguel@ximian.com>
15767
15768         * expression.cs: Add implicit conversions to the operator ~.
15769
15770         * constant.cs (DecimalConstant.Emit): Emit decimal value.
15771
15772         * typemanager.cs: Locate the decimal constructor.
15773
15774 2002-04-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15775
15776         * attribute.cs: use the new property of TypeOf.
15777         * expression.cs: added 'get' property around typearg.
15778
15779         These changes fix a build breaker reported by NickD. Is this the
15780         correct way to fix?  If not, please, revert my changes and make it
15781         work :-).
15782
15783 2002-04-17  Miguel de Icaza  <miguel@ximian.com>
15784
15785         * attribute.cs: Add support for typeof in attribute invocations.
15786         I am not sure that this is right though.
15787
15788 2002-04-14  Duncan Mak  <duncan@ximian.com>
15789
15790         * cfold.cs (BinaryFold): Catch DivideByZeroException in the
15791         Binary.Operator.Division case.
15792
15793 2002-04-13  Ravi Pratap  <ravi@ximian.com>
15794
15795         * class.cs (DefineType): Ensure that we do a proper check on
15796         attribute types and also register it with the TypeManager.
15797
15798         (TypeContainer.Targets): The default for attribute types is
15799         AttributeTargets.All.
15800
15801         * attribute.cs (ApplyAttributes): Registering the attribute type
15802         is done elsewhere, not when we discover we have a Usage attribute.
15803
15804 2002-04-12  Ravi Pratap  <ravi@ximian.com>
15805
15806         * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
15807         and get rid of is_delegate parameter.
15808
15809         * everywhere : update.
15810
15811 2002-04-12  Ravi Pratap  <ravi@ximian.com>
15812
15813         * cs-parser.jay (compilation_unit): Revamp completely to use
15814         some new ideas that I got from Rhys' grammar to solve the problems
15815         with assembly level attributes.
15816
15817         (outer_declaration): New grammar production.
15818
15819         (attribute_sections): Add.
15820
15821         (opt_attributes): Base on attribute_sections
15822
15823         (namespace_declaration): Allow opt_attributes to tackle the case
15824         when we have assembly level attributes - we are clever in this
15825         regard now ;-)
15826
15827         * attribute.cs (ApplyAttributes): Do not worry about assembly 
15828         attributes in the non-global context.
15829
15830         * rootcontext.cs (AddGlobalAttributes): Go back to using this
15831         instead of SetGlobalAttributes.
15832
15833         * class.cs, rootcontext.cs : Ensure we define and generate 
15834         attribute types before anything else.
15835
15836         * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
15837         and flag the new error -20 for the case when the attribute type
15838         does not have valid targets specified. csc does not catch this.
15839
15840         * ../errors/errors.txt : update for error # -20
15841
15842 2002-04-11  Ravi Pratap  <ravi@ximian.com>
15843
15844         * support.cs (InternalParameters.ParameterModifier): Do some null
15845         checking and return sane values.
15846
15847         * class.cs (Method.Define): If we are a PInvoke method, ensure
15848         that we are static and extern. Report error # 601
15849
15850         * ../errors/cs0601.cs : Add test case for the above error.
15851
15852 2002-04-07  Ravi Pratap  <ravi@ximian.com>
15853
15854         * rootcontext.cs (attribute_types): We need to keep type of
15855         all attribute types separately and emit code for them first.
15856
15857         (RegisterAttribute) : Implement.
15858
15859         * class.cs (DefineType): Check if the current Type is a custom
15860         attribute type and register it accordingly.
15861
15862         * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
15863         adding the first attribute twice and rename to
15864
15865         (SetGlobalAttributes): this.
15866
15867         * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
15868         lookups.
15869
15870         * attribute.cs (ApplyAttributes): Take an additional argument telling us
15871         if we are processing global arguments. Hmm, I am unsure of this.
15872
15873 2002-04-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15874
15875         * expression.cs: added static array of strings to avoid calling
15876         Enum.ToString () for Operator in Binary. Significant recover of
15877         performance.
15878
15879 2002-04-10  Miguel de Icaza  <miguel@ximian.com>
15880
15881         * class.cs (FindMembers): Allow the Builders of the various
15882         members to be null.  If they are skip them.  This only happens
15883         during the PInvoke declaration.
15884
15885 2002-04-09  Miguel de Icaza  <miguel@ximian.com>
15886
15887         * parameter.cs (Parameters.ComputeParameterTypes): Flag the
15888         failure, so we do not keep going afterwards.
15889
15890         * expression.cs: (Invocation.OverloadResolve): I believe Ravi
15891         wanted to pass `false' as the `is_delegate' argument.  If this is
15892         the case, why not use delegate_type == null to mean `is_delegate =
15893         false' and anything else as is_delegate = true.
15894
15895 Tue Apr  9 05:40:12  2002 Piers Haken <piersh@friskit.com>
15896
15897         * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
15898         code for the section, not the beginning of the tests.
15899
15900 2002-04-08  Miguel de Icaza  <miguel@ximian.com>
15901
15902         * cfold.cs: Handle operator + (Enum x, Underlying x) 
15903
15904         * expression.cs (Binary): same.  Warn about errors where we have
15905         Enum/Enum in operator + as well.
15906
15907 Mon Apr  8 06:29:03  2002 Piers Haken <piersh@friskit.com>
15908
15909         * statement.cs:
15910                 - added support for switch(bool)
15911                 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
15912                 - add TableSwitchEmit() to handle table-based switch statements
15913
15914 2002-04-05  Ravi Pratap  <ravi@ximian.com>
15915
15916         * expression.cs (Invocation.OverloadResolve): Factor out code which
15917         does parameter compatibility checking with arguments so that we can 
15918         re-use the code even from Delegate.VerifyApplicability
15919
15920         (VerifyArgumentsCompat): Move above code here.
15921
15922         * delegate.cs (VerifyApplicability): Get rid of duplicate code
15923         and instead make a call to the above method.
15924
15925 2002-03-31  Ravi Pratap  <ravi@ximian.com>
15926
15927         * typemanager.cs (attribute_type): Corresponds to System.Attribute.
15928         We use it to keep track of classes which are attribute types.
15929
15930 2002-04-02  Miguel de Icaza  <miguel@ximian.com>
15931
15932         * delegate.cs (Delegate.Define): Correctly define the types in the
15933         presence of fixed and array parameters.
15934
15935         * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
15936         doing FindMembers.
15937
15938         * ecore.cs (Expression.MemberLookup): Reset binding flags to not
15939         include NonPublic after the first iteration.
15940
15941         * class.cs (Indexer.CheckBase): Only check if both parents are
15942         non-null. 
15943
15944         * cs-parser.jay (accessor_body): If empty, set to null.
15945
15946         * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
15947         same code path here to resolve constants names that we did have in
15948         MemberAccess.DoResolve.  There is too much code duplicated here.
15949
15950 2002-04-01  Miguel de Icaza  <miguel@ximian.com>
15951
15952         * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
15953
15954         * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
15955         to MakeUnionSet.
15956
15957         * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
15958         tokens, numbers and strings.
15959
15960         * ecore.cs (MethodGroupExpr): Make Emit warn about missing
15961         parenthesis.
15962
15963         * delegate.cs: Use ComputeAndDefineParameterTypes for both the
15964         asyncronous parameters and the regular parameters.  
15965
15966         * codegen.cs (CodeGen.Init): Use the constructor that allows us to
15967         specify the target directory.
15968
15969         * expression.cs: (This.DoResolve): Simplify
15970         (As.Emit): Optimize, do not generate IsInst if the expression is
15971         always of the given type.
15972
15973         (Is.DoResolve): Bug fix, we were reporting both always/never for
15974         the is expression.
15975
15976         * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
15977         creating too many unnecessary arrays.
15978
15979 2002-03-31  Miguel de Icaza  <miguel@ximian.com>
15980
15981         * class.cs (EmitFieldInitializer): Use Assign expression to assign
15982         fields instead of rolling our own initializer.   Takes care of all
15983         implicit conversions, and drops unnecessary static checks/argument.
15984
15985 2002-03-31  Dick Porter  <dick@ximian.com>
15986
15987         * driver.cs: use the GetDirectories() return values properly, and
15988         use "/" as path separator.
15989
15990 2002-03-30  Miguel de Icaza  <miguel@ximian.com>
15991
15992         * expression.cs (Unary): Optimize - - expr into expr.
15993         (Binary): Optimize a + (-b) into a -b.
15994
15995         * codegen.cs (CodeGen): Made all methods static.
15996
15997 2002-03-29  Miguel de Icaza  <miguel@ximian.com>
15998
15999         * rootcontext.cs: 
16000
16001         * decl.cs: Rename `definition' into `TypeBuilder' and drop the
16002         TypeBuilder property.
16003
16004         * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
16005         instead. 
16006
16007         * tree.cs: Removed the various RecordXXXX, and replaced with a
16008         single RecordDecl.  Removed all the accessor methods, and just
16009         left a single access point Type 
16010
16011         * enum.cs: Rename DefineEnum to DefineType.
16012
16013         * decl.cs: New abstract method `DefineType' used to unify the
16014         Defines for Enumerations, Interfaces, TypeContainers and
16015         Delegates.
16016
16017         (FindType): Moved LookupInterfaceOrClass here.  Moved the
16018         LookupBaseClasses method that used to live in class.cs and
16019         interface.cs here, and renamed to FindType.
16020
16021         * delegate.cs: Implement DefineType.  Take advantage of the
16022         refactored pattern for locating the parent builder without taking
16023         the parent_builder argument (which we know does not work if we are
16024         nested, and triggering a toplevel definition).
16025
16026 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
16027
16028         * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
16029         accessibility of a member has changed during override and report
16030         an error if so.
16031
16032         * class.cs (Method.Define, Property.Define): Only complain on
16033         overrides if the method is private, any other accessibility is
16034         fine (and since we just checked the permission is the same, we are
16035         good to go).
16036
16037         * cs-tokenizer.cs: only line, region, endregion, if, endif, else
16038         and elif are processed always.  The other pre-processing
16039         directives are only processed if we are "taking" the path
16040
16041 2002-03-29  Martin Baulig  <martin@gnome.org>
16042
16043         * class.cs (Method.Emit): Only emit symbolic debugging info if the
16044         current location is not Null.
16045
16046         * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
16047         a separate method so we can profile it.
16048
16049         * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
16050         `span.Seconds' are just seconds, but no minutes or hours.
16051         (MainDriver): Profile the CodeGen.SaveSymbols calls.
16052
16053 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
16054
16055         * class.cs (Method.Define), (Property.Define), (Indexer.Define):
16056         Remove the gratuitous set of Final:
16057
16058                                 // If an interface implementation, then we can set Final.
16059                                 if (((flags & MethodAttributes.Abstract) == 0) &&
16060                                     implementing.DeclaringType.IsInterface)
16061                                         flags |= MethodAttributes.Final;
16062
16063         I do not know what I was smoking when I used that.
16064
16065
16066         * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
16067         step into fixing the name resolution issues for delegates and
16068         unifying the toplevel name resolution.
16069
16070 2002-03-28  Martin Baulig  <martin@gnome.org>
16071
16072         * class.cs (Method.Emit): If we have a symbol writer, call its
16073         OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
16074         tell it about the current method.
16075
16076         * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
16077         writer that we're going to emit the first byte of IL code for a new
16078         statement (a new source line).
16079         (EmitContext.EmitTopBlock): If we have a symbol writer, call
16080         EmitContext.Mark() before emitting any code.
16081
16082         * location.cs (SymbolDocument): Return null when we're Null.
16083
16084         * statement.cs (Statement): Moved the `Location loc' variable here.
16085         (Statement.EmitBoolExpression): If we have a symbol writer, call
16086         ec.Mark() before emitting any code to tell it that we're at the
16087         beginning of a new statement.
16088         (StatementExpression): Added `Location' argument to the constructor.
16089         (Block): Added public readonly variable `StartLocation' and public
16090         variable `EndLocation'.  The latter is to be set using SetEndLocation().
16091         (Block): Added constructor which takes a start and end location.
16092         (Block.SetEndLocation): New method. This sets the end location.
16093         (Block.EmitMeta): If we have a symbol writer, tell it the names of the
16094         local variables we create.
16095         (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
16096         each statement and do also mark the begin and end of the block.
16097
16098         * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
16099         tell it the current lexer.Location, use Location.Null for the end of the
16100         block.
16101         (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
16102         current block, set its end location using SetEndLocation().
16103         (statement_expression): StatementExpression constructor now takes the
16104         lexer.Location as additional argument.
16105         (for_statement, declare_local_variables): Likewise.
16106         (declare_local_variables): When creating a new implicit block, use the
16107         new Block constructor and pass it the lexer.Location.
16108
16109 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
16110
16111         * ecore.cs (Expression.MemberLookup): On interfaces, lookup
16112         members also on the parent interfaces recursively.
16113
16114 2002-03-27  Miguel de Icaza  <miguel@ximian.com>
16115
16116         * report.cs: Use new formats, since Gonzalo finished the missing
16117         bits. 
16118
16119         * expression.cs (Binary.ResolveOperator): added missing operator|
16120         operator& and operator^ for bool/bool.
16121
16122         * cs-parser.jay: CheckDef now takes a Location argument that is
16123         used to report errors more precisly (instead of reporting the end
16124         of a definition, we try to track something which is a lot closer
16125         to the source of the problem).
16126
16127         * cs-tokenizer.cs: Track global token use, so we can properly flag
16128         the use of #define/#undef after the first token has been seen.
16129
16130         Also, rename the reportXXXX to Error_DescriptiveName
16131
16132         * decl.cs (DeclSpace.IsTopLevel): Move property here from
16133         TypeContainer, so that Enum and Interface can use this too.
16134
16135         * class.cs (TypeContainer.LookupInterfaceOrClass,
16136         GetInterfaceOrClass, GetClassBases, DefineType): Drop the
16137         `builder' argument.  Typically this was used to pass the parent
16138         builder (a ModuleBuilder or a TypeBuilder from whoever triggered
16139         the definition).  
16140
16141         The problem is that a nested class could trigger the definition of
16142         a toplevel class, and the builder would be obviously wrong in that
16143         case. 
16144
16145         So we drop this argument, and we compute dynamically the
16146         TypeBuilder/ModuleBuilder (the correct information was available
16147         to us anyways from DeclSpace.Parent)
16148
16149         * interface.cs (Interface.DefineInterface): Drop builder
16150         parameter cleanup like class.cs
16151
16152         * enum.cs (Enum.DefineEnum): Drop builder parameter.  Clean up
16153         like class.cs
16154
16155         * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
16156         values. 
16157
16158         (Try.Emit): Propagate the returns value from the statement.
16159
16160         (Return.Emit): Even if we are leavning 
16161
16162         * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
16163
16164         * modifiers.cs: Fix the computation of MethodAttributes flags.
16165
16166 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
16167
16168         * driver.cs: allow compilation of files that start with '/'.
16169         Add a default case when checking the argument of --target.
16170
16171 2002-03-25  Miguel de Icaza  <miguel@ximian.com>
16172
16173         * interface.cs: Implement the same search algorithm for types in
16174         the interface code.
16175
16176         * delegate.cs: Do not allow multiple definition.
16177
16178         * Recovered ChangeLog that got accidentally amputated
16179
16180         * interface.cs (Interface.DefineInterface): Prevent from double definitions.
16181
16182         * rootcontext.cs: Load manually enum to allow core classes to
16183         contain enumerations.
16184
16185         * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
16186         Update to new static methods in TypeManager.
16187
16188         * typemanager.cs (GetMethod, GetConstructor): Use our
16189         implementation of FindMembers to find the members, since during
16190         corlib compilation, the types are TypeBuilders and GetMethod and
16191         GetConstructor do not work.
16192
16193         Make all methods in TypeManager static.
16194
16195         (InitCodeHelpers): Split the functionality from
16196         the InitCodeTypes function.
16197
16198         * driver.cs: Call InitCodeHelpers after we have populated the
16199         types. 
16200
16201         * cs-parser.jay (delegate_declaration): we did not used to compute
16202         the delegate name correctly for void delegates.
16203
16204 2002-03-24  Miguel de Icaza  <miguel@ximian.com>
16205
16206         * rootcontext.cs (RootContext): Init the interface_resolve_order
16207         and type_container_resolve_order always.
16208
16209         (ResolveCore, BootstrapCorlib_ResolveClass,
16210         BootstrapCorlib_ResolveStruct): New functions to bootstrap the
16211         compiler when compiling with --nostdlib
16212
16213         * class.cs (TypeContainer.DefineType): Check that our parent is
16214         not null.  This test is most important when we are bootstraping
16215         the core types.
16216
16217         * codegen.cs: Split out the symbol writing code.
16218
16219 2002-03-25  Martin Baulig  <martin@gnome.org>
16220
16221         * driver.cs (-g): Made -g an alias for --debug.
16222
16223 2002-03-24  Martin Baulig  <martin@gnome.org>
16224
16225         * codegen.cs (SymbolWriter): New public variable. Returns the
16226         current symbol writer.
16227         (CodeGen): Added `bool want_debugging_support' argument to the
16228          constructor. If true, tell the ModuleBuild that we want debugging
16229         support and ask it for the ISymbolWriter.
16230         (Save): If we have a symbol writer, call it's Close() method after
16231         saving the assembly.
16232
16233         * driver.c (--debug): New command line argument to create a
16234         debugger information file.
16235
16236         * location.cs (SymbolDocument): New public property. Returns an
16237         ISymbolDocumentWriter object for the current source file or null
16238         if we don't have a symbol writer.
16239
16240 2002-03-21  Miguel de Icaza  <miguel@ximian.com>
16241
16242         * driver.cs (LoadAssembly): Correctly return when all the paths
16243         have been tried and not before.
16244
16245         * statement.cs (Switch.Emit): return the actual coverage for this
16246         statement (returns/not-returns)
16247
16248         (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
16249         switch of the statement if we are the last switch section.  That
16250         kills two problems: try/catch problems (we used to emit an empty
16251         nop at the end) and switch statements where all branches would
16252         return. 
16253
16254 2002-03-19  Miguel de Icaza  <miguel@ximian.com>
16255
16256         * driver.cs: Add default assemblies (the equivalent to the
16257         Microsoft CSC.RSP file)
16258
16259         * cs-tokenizer.cs: When updating `cols and setting it to zero,
16260         also update tokens_seen and set it to false.
16261
16262         * driver.cs: Implement --recurse for Mike.
16263
16264         * driver.cs (SplitPathAndPattern): Small bug fix, I was not
16265         correctly splitting out the paths.
16266
16267 2002-03-18  Miguel de Icaza  <miguel@ximian.com>
16268
16269         * interface.cs (Interface.PopulateProperty): Instead of using
16270         `parent' as the declaration space for the set parameters, use
16271         `this' 
16272
16273         * support.cs (InternalParameters): InternalParameters constructor
16274         takes a DeclSpace instead of a TypeContainer.
16275
16276         * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
16277         types are being initialized, load the address of it before calling
16278         the function.  
16279
16280         (New): Provide a mechanism to disable the generation of local
16281         value type temporaries when the caller will be providing us with
16282         an address to store it.
16283
16284         (ArrayCreation.EmitDynamicInitializers): Use it.
16285
16286 2002-03-17  Miguel de Icaza  <miguel@ximian.com>
16287
16288         * expression.cs (Invocation.EmitArguments): Only probe for array
16289         property if there is more than one argument.  Sorry about that.
16290
16291         * class.cs (Invocation.EmitArguments): Fix to emit arguments for
16292         empty param arrays.
16293
16294         * class.cs (Method.LabelParameters): Fix incorrect code path that
16295         prevented the `ParamArrayAttribute' from being applied to the
16296         params attribute.
16297
16298 2002-03-16  Miguel de Icaza  <miguel@ximian.com>
16299
16300         * support.cs (ReflectionParameters): Correctly compute whether the
16301         last argument is a params array.  Fixes the problem with
16302         string.Split ('a')
16303
16304         * typemanager.cs: Make the assemblies array always be non-null
16305         (empty, but non-null)
16306
16307         * tree.cs (RecordDecl): New function that abstracts the recording
16308         of names.  This reports error 101, and provides a pointer to the
16309         previous declaration.  Fixes a crash in the compiler.
16310
16311         * cs-parser.jay (constructor_declaration): Update to new grammar,
16312         and provide a constructor_body that can be empty.
16313
16314 2002-03-15  Miguel de Icaza  <miguel@ximian.com>
16315
16316         * driver.cs: Add support for --resources.
16317
16318         * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
16319         Make all types for the various array helper methods be integer.
16320
16321         * ecore.cs (Expression.ConvertNumericExplicit): Pass the
16322         CheckState to ConvCast.
16323
16324         (ConvCast): Now it takes a `checked' state argument, to avoid
16325         depending on the emit context for the conversion, and just using
16326         the resolve time setting.
16327
16328         * expression.cs (ArrayCreation.EmitArrayArguments): New function,
16329         instead of Invocation.EmitArguments.  We do not emit the original
16330         arguments, instead we emit those which have been converted to
16331         unsigned int expressions.
16332
16333         * statement.cs (Block.EmitMeta): Drop tracking of indexes.
16334
16335         * codegen.cs: ditto.
16336
16337         * expression.cs (LocalVariableReference): Drop the use of the
16338         Store function that depended on the variable index.
16339
16340         * statement.cs (VariableInfo): Drop the `Idx' property from this
16341         class, as this is not taking into account the indexes for
16342         temporaries tat we generate during the execution, getting the
16343         indexes wrong.
16344
16345         * class.cs: First emit class initializers, then call the parent
16346         constructor. 
16347
16348         * expression.cs (Binary): Fix opcode emision.
16349         (UnaryMutator.EmitCode): Support checked code generation
16350
16351         * ecore.cs (MemberLookup): TypeManager.FindMembers will return
16352         matches for events for both the Static and Instance scans,
16353         pointing to the same element.   Fix that.
16354
16355 2002-03-14  Miguel de Icaza  <miguel@ximian.com>
16356
16357         * rootcontext.cs (ResolveTree): Always set the
16358         interface_resolve_order, because nested interfaces will be calling
16359         into us.
16360
16361         * class.cs (GetInterfaceOrClass): Track the same resolution
16362         process used by TypeManager.LookupType.  This fixes the nested
16363         type lookups in class declarations (separate path from
16364         LookupType). 
16365
16366         (TypeContainer.DefineType): Also define nested interfaces.
16367         (TypeContainer.RegisterOrder): New public function used to
16368         register the order in which child interfaces need to be closed.
16369
16370         Nested interfaces need to be closed after their parents have been
16371         created. 
16372
16373         * interface.cs (InterfaceAttr): Put all the logic for computing
16374         the interface attribute here. 
16375
16376         (DefineInterface): Register our interface order with the
16377         RootContext or with the TypeContainer depending on the case.
16378
16379 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
16380
16381         * cs-parser.jay: rework foreach statement to work with the new
16382         changes to the policy on SimpleNames.
16383
16384         * report.cs: support Stacktrace on warnings as well.
16385
16386         * makefile: drop --unsafe and /unsafe from the compile.
16387
16388 2002-03-13  Ravi Pratap  <ravi@ximian.com>
16389
16390         * ecore.cs (StandardConversionExists): Modify to take an Expression
16391         as the first parameter. Ensure we do null -> reference type conversion
16392         checking.
16393
16394         * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
16395         temporary Expression objects.
16396
16397 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
16398
16399         * interface.cs: workaround bug in method overloading resolution
16400         (there is already a bugzilla bug for it).
16401
16402 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
16403
16404         We could also solve this problem by having a separate path for
16405         performing type lookups, instead of DoResolve, we could have a
16406         ResolveType entry point, and only participating pieces of the
16407         production (simplename, deref, array) would implement this. 
16408
16409         * codegen.cs (EmitContext): New field OnlyLookupTypes used to
16410         signal SimpleName to only resolve type names and not attempt to
16411         resolve anything else.
16412
16413         * expression.cs (Cast): Set the flag.
16414
16415         * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
16416
16417         * class.cs: Only report 108 if there is no `new' modifier.
16418
16419         * cs-parser.jay: rework foreach statement to work with the new
16420         changes to the policy on SimpleNames.
16421         
16422         * report.cs: support Stacktrace on warnings as well.
16423
16424         * makefile: drop --unsafe and /unsafe from the compile.
16425
16426 2002-03-11  Miguel de Icaza  <miguel@ximian.com>
16427
16428         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
16429         lookups here, instead of doing that at parse time.  This means
16430         that our grammar will not introduce `LocalVariableReferences' as
16431         expressions at this point.  That solves the problem of code like
16432         this:
16433
16434         class X {
16435            static void Main ()
16436            { int X = 1;
16437             { X x = null }}}
16438
16439         This is only half the fix.  The full fix requires parameters to
16440         also be handled in this way.
16441
16442         * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
16443         makes the use more obvious of the DeclSpace.  The
16444         ec.TypeContainer.TypeBuilder is now only used to pull the
16445         TypeBuilder for it.
16446
16447         My theory is that I can get rid of the TypeBuilder completely from
16448         the EmitContext, and have typecasts where it is used (from
16449         DeclSpace to where it matters).  
16450
16451         The only pending problem is that the code that implements Aliases
16452         is on TypeContainer, and probably should go in DeclSpace.
16453
16454         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
16455         lookups here, instead of doing that at parse time.  This means
16456         that our grammar will not introduce `LocalVariableReferences' as
16457         expressions at this point.  That solves the problem of code like
16458         this:
16459
16460         class X {
16461            static void Main ()
16462            { int X = 1;
16463             { X x = null }}}
16464
16465         This is only half the fix.  The full fix requires parameters to
16466         also be handled in this way.
16467
16468         * class.cs (Property.DefineMethod): When implementing an interface
16469         method, set newslot, when implementing an abstract method, do not
16470         set the flag (before we tried never setting it, or always setting
16471         it, which is the difference).
16472         (Indexer.DefineMethod): same.
16473         (Method.DefineMethod): same.
16474
16475         * ecore.cs: Only set the status used flag if we get back a Field.
16476
16477         * attribute.cs: Temporary hack, so Paolo can keep working.
16478
16479 2002-03-08  Ravi Pratap  <ravi@ximian.com>
16480
16481         * attribute.cs (Attribute.UnmanagedType): This is to keep track of
16482         the unmanaged type in the case we have a MarshalAs attribute.
16483
16484         (Resolve): Handle the case when we are parsing the special MarshalAs
16485         attribute [we need to store the unmanaged type to use later]
16486
16487         * typemanager.cs (marshal_as_attr_type): Built in type for the 
16488         MarshalAs Attribute.
16489
16490         * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute 
16491         on parameters and accordingly set the marshalling info.
16492
16493 2002-03-09  Miguel de Icaza  <miguel@ximian.com>
16494
16495         * class.cs: Optimizing slightly by removing redundant code after
16496         we switched to the `NoTypes' return value.
16497         (Property.DefineMethod): use NoTypes here too.
16498
16499         This fixes the bug I introduced in my last batch of changes.
16500
16501 2002-03-05  Ravi Pratap  <ravi@ximian.com>
16502
16503         * tree.cs (RecordEnum): Add. We now keep track of enums too.
16504
16505         * class.cs (LookupInterfaceOrClass): Check against the list of recorded
16506         Enums since those are types too. 
16507
16508         * cs-parser.jay (enum_declaration): Record enums as we parse them.
16509
16510         * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined 
16511         thanks to a call during the lookup process.
16512
16513 2002-03-07  Miguel de Icaza  <miguel@ximian.com>
16514
16515         * statement.cs (Foreach): Lots of work to accomodate a particular
16516         kind of foreach statement that I had not kept in mind.  It is
16517         possible to have foreachs on classes that provide a GetEnumerator
16518         method that return objects that implement the "pattern" for using
16519         a foreach, there is no need to support GetEnumerator
16520         specifically. 
16521
16522         This is needed to compile nant.
16523
16524         * decl.cs: Only report 114 if the member is not `Finalize' and if
16525         the warning level is at least 2.
16526
16527         * class.cs: Moved the compare function from Method to
16528         MethodSignature. 
16529
16530         (MethodSignature.InheritableMemberSignatureCompare): Add new
16531         filter function that is used to extract inheritable methods from a
16532         class. 
16533
16534         (Method.Define): Use the new `inheritable_method_signature_filter'
16535         delegate
16536
16537         * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
16538         command. 
16539
16540 2002-03-06  Miguel de Icaza  <miguel@ximian.com>
16541
16542         * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
16543
16544         * cs-parser.jay: Add opt_semicolon to the interface declaration.
16545
16546         * expression.cs: Pass location information to
16547         ConvertImplicitStandard. 
16548
16549         * class.cs: Added debugging code to track return values from
16550         interfaces. 
16551
16552 2002-03-05  Miguel de Icaza  <miguel@ximian.com>
16553
16554         * expression.cs (Is.DoResolve): If either side of the `is' is an
16555         interface, do not flag the warning.
16556
16557         * ecore.cs (ImplicitReferenceConversion): We need a separate test
16558         for interfaces
16559
16560         * report.cs: Allow for --fatal to be used with --probe.
16561
16562         * typemanager.cs (NoTypes): Move the definition for the empty Type
16563         array here. 
16564
16565         * class.cs (TypeContainer.FindMembers): Also look for methods defined by
16566         properties. 
16567         (TypeContainer.DefineProxy): New function used to proxy to parent
16568         implementations when implementing interfaces.
16569         (TypeContainer.ParentImplements): used to lookup if our parent
16570         implements a public function that is required by an interface.
16571         (TypeContainer.VerifyPendingMethods): Hook this up.
16572
16573         * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
16574         `modules' and `assemblies' arraylists into arrays.  We only grow
16575         these are the very early start up of the program, so this improves
16576         the speedof LookupType (nicely measured).
16577
16578         * expression.cs (MakeByteBlob): Replaced unsafe code with
16579         BitConverter, as suggested by Paolo.
16580
16581         * cfold.cs (ConstantFold.Binary): Special case: perform constant
16582         folding of string concatenation, but if either side is a string,
16583         and the other is not, then return null, and let the runtime use
16584         the concatenation on the string plus the object (using
16585         `Object.ToString'). 
16586
16587 2002-03-04  Miguel de Icaza  <miguel@ximian.com>
16588
16589         Constant Folding has been implemented now.
16590
16591         * expression.cs (Unary.Reduce): Do not throw an exception, catch
16592         the error instead on types that are not supported in one's
16593         complement. 
16594
16595         * constant.cs (Constant and all children): New set of functions to
16596         perform implict and explicit conversions.
16597
16598         * ecore.cs (EnumConstant): Implement the new functions to perform
16599         conversion by proxying to the child expression.
16600
16601         * codegen.cs: (ConstantCheckState): Constant evaluation has its
16602         own separate setting that can not be turned off from the command
16603         line using --unchecked or --checked and is only controlled using
16604         the checked/unchecked statements and expressions.  This setting is
16605         used by the constant folder to flag errors.
16606
16607         * expression.cs (CheckedExpr, UncheckedExpr): Set the
16608         ConstantCheckState as well.   
16609
16610         During Resolve, they also have to flag the state, because the
16611         constant folder runs completely in the Resolve phase.
16612
16613         * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
16614         well.
16615
16616 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
16617
16618         * cfold.cs: New file, this file contains the constant folder.
16619
16620         * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
16621         argument to track whether we are using the resulting address to
16622         load or store a value and provide better error messages. 
16623
16624         (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
16625         new AddressOf arguments.
16626
16627         * statement.cs (Foreach.EmitCollectionForeach): Update
16628
16629         * expression.cs (Argument.Emit): Call AddressOf with proper
16630         arguments to track usage.
16631
16632         (New.DoEmit): Call AddressOf with new arguments.
16633
16634         (Unary.Emit): Adjust AddressOf call.
16635
16636 2002-03-01  Ravi Pratap  <ravi@ximian.com>
16637
16638         * cs-parser.jay (member_access): Change the case for pre-defined types
16639         to use a MemberAccess instead of a SimpleName. Thanks to Felix again for 
16640         this suggestion.
16641
16642         * class.cs (Operator::Emit): If we are abstract or extern, we don't have
16643         a method body.
16644
16645         * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
16646         essentially like methods and apply attributes like MethodImplOptions to them too.
16647
16648         * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
16649         not being null.
16650
16651         * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
16652         DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
16653         is the DeclSpace.
16654
16655         * Update code everywhere accordingly.
16656
16657         * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
16658
16659         * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
16660
16661 2002-02-28  Ravi Pratap  <ravi@ximian.com>
16662
16663         * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
16664         try performing lookups against those instead of jumping straight into using
16665         the 'using' clauses.
16666
16667         (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
16668
16669         (LookupType): Perform lookups in implicit parents too.
16670
16671         * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
16672         sequence as RootContext.LookupType. 
16673
16674         * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries 
16675         the various cases of namespace lookups into this method.
16676
16677 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
16678
16679         * cs-parser.jay: Add support for [Attribute ()] (empty arguments
16680         in positional arguments)
16681
16682         * class.cs (Operator): Update the AllowedModifiers to contain
16683         extern. 
16684
16685         * cs-parser.jay: Update operator declaration to allow for the
16686         operator body to be empty.
16687
16688         * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
16689         values. 
16690
16691 2002-02-27  Miguel de Icaza  <miguel@ximian.com>
16692
16693         * class.cs (Method.Emit): Label parameters.
16694
16695         * driver.cs: Return 1 or 0 as the program exit code.
16696
16697 2002-02-26  Miguel de Icaza  <miguel@ximian.com>
16698
16699         * expression.cs: Special case the `null' object when trying to
16700         auto-compute the type, as anything can be explicitly converted to
16701         that. 
16702
16703         * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
16704         spotting this Paolo.
16705
16706         (Expression.ImplicitNumericConversion): Perform comparissions of
16707         the type using the underlying type in the case of an enumeration
16708         rather than using the enumeration type for the compare.
16709
16710         Cope with the underlying == type case, which is not possible to
16711         catch before. 
16712
16713         (Expression.ConvertNumericExplicit): Perform comparissions of
16714         the type using the underlying type in the case of an enumeration
16715         rather than using the enumeration type for the compare.
16716
16717         * driver.cs: If the user does not supply an extension, assume .exe
16718
16719         * cs-parser.jay (if_statement): Rewrote so that we can track the
16720         location for the if statement.
16721
16722         * expression.cs (Binary.ConstantFold): Only concat strings when
16723         the operation is "+", not everything ;-)
16724
16725         * statement.cs (Statement.EmitBoolExpression): Take a location
16726         argument. 
16727         (If, While, Do): Track location.
16728
16729         * expression.cs (Binary.ResolveOperator): In the object + string
16730         case, I was missing a call to ConvertImplicit
16731
16732 2002-02-25  Ravi Pratap  <ravi@ximian.com>
16733
16734         * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
16735         Location arguments. Ensure we use RootContext.LookupType to do our work
16736         and not try to do a direct Type.GetType and ModuleBuilder.GetType
16737
16738         * interface.cs (PopulateMethod): Handle the type of the parameter being
16739         null gracefully.
16740
16741         * expression.cs (Invocation.BetterFunction): Handle the case when we 
16742         have a params method with no fixed arguments and a call is made with no
16743         arguments.
16744
16745 2002-02-25  Miguel de Icaza  <miguel@ximian.com>
16746
16747         * cs-tokenizer.cs: Add support for the quote-escape-sequence in
16748         the verbatim-string-literal
16749
16750         * support.cs (InternalParameters.ParameterModifier): handle null
16751         fixed parameters.
16752         (InternalParameters.ParameterType): ditto.
16753
16754         * parameter.cs (VerifyArgs): Also check if the fixed parameter is
16755         duplicating the name of the variable parameter.
16756         (GetParameterByName): Fix bug where we were not looking up array
16757         paramters if they were the only present (thanks Paolo!).
16758         (GetParameterInfo): We only have an empty set of types if both
16759         fixed and array are set to null.
16760         (GetParameterInfo-idx): Handle FixedParameter == null
16761
16762         * cs-parser.jay: Handle the case where there is no catch
16763         statements (missing null test).
16764
16765 2002-02-22  Miguel de Icaza  <miguel@ximian.com>
16766
16767         * driver.cs (MainDriver): Be conservative on our command line
16768         handling.
16769
16770         Catch DirectoryNotFoundException when calling GetFiles.
16771
16772         (SplitPathAndPattern): Used to split the input specification into
16773         a path and a pattern that we can feed to Directory.GetFiles.
16774
16775 2002-02-21  Miguel de Icaza  <miguel@ximian.com>
16776
16777         * statement.cs (Fixed): Implement the last case of the Fixed
16778         statement (string handling).
16779
16780         * expression.cs (StringPtr): New class used to return a char * to
16781         a string;  Used by the Fixed statement.
16782
16783         * typemanager.cs: Add char_ptr_type.  Add get_OffsetToStringData method.
16784
16785         * expression.cs (Binary.ResolveOperator): Remove redundant
16786         MemberLookup pn parent type.
16787         Optimize union call, we do not need a union if the types are the same.
16788         (Unary.ResolveOperator): REmove redundant MemberLookup on parent
16789         type.
16790
16791         Specialize the use of MemberLookup everywhere, instead of using
16792         the default settings. 
16793
16794         (StackAlloc): Implement stackalloc keyword.
16795
16796         * cs-parser.jay: Add rule to parse stackalloc.
16797
16798         * driver.cs: Handle /h, /help, /?
16799
16800         * expression.cs (MakeByteBlob): Removed the hacks we had in place
16801         before we supported unsafe code.
16802
16803         * makefile: add --unsafe to the self compilation of mcs.
16804
16805 2002-02-20  Miguel de Icaza  <miguel@ximian.com>
16806
16807         * expression.cs (PointerArithmetic): New class that is used to
16808         perform pointer arithmetic.
16809         (Binary.Resolve): Handle pointer arithmetic
16810         Handle pointer comparission.
16811         (ArrayPtr): Utility expression class that is used to take the
16812         address of an array.
16813
16814         (ElementAccess): Implement array access for pointers
16815
16816         * statement.cs (Fixed): Implement fixed statement for arrays, we
16817         are missing one more case before we are done.
16818
16819         * expression.cs (Indirection): Implement EmitAssign and set the
16820         ExprClass to Variable.  This allows pointer dereferences to be
16821         treated as variables, and to have values assigned to them.
16822
16823         * ecore.cs (Expression.StoreFromPtr): New utility function to
16824         store values dereferencing.
16825
16826 2002-02-20  Ravi Pratap  <ravi@ximian.com>
16827
16828         * expression.cs (Binary.ResolveOperator): Ensure that we are
16829         not trying to operate on a void type - this fixes the reported
16830         bug.
16831
16832         * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
16833         the parent implementation is sealed.
16834
16835         * ../errors/cs0239.cs : Add.
16836
16837         * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
16838
16839         * typemanager.cs (unverifiable_code_type): Corresponds to 
16840         System.Security.UnverifiableCodeAttribute. We need to emit this for modules
16841         which have unsafe code in them.
16842
16843         * rootcontext.cs (EmitCode): Emit the above attribute when we are in an 
16844         unsafe context.
16845
16846 2002-02-19  Miguel de Icaza  <miguel@ximian.com>
16847
16848         * cs-tokenizer.cs: Add support for @"litreal strings"
16849
16850         Make tokenizer accept pre-processor directives
16851         on any column (remove the old C-like limitation). 
16852
16853         * rootcontext.cs (EmitCode): Emit any global attributes.
16854         (AddGlobalAttributes): Used to keep track of assembly attributes. 
16855
16856         * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
16857
16858         * cs-parser.jay: Add support for global attributes.  
16859
16860 2002-02-17  Miguel de Icaza  <miguel@ximian.com>
16861
16862         * expression.cs (Indirection): New helper class.  Unary will
16863         create Indirection classes to be able to implement the
16864         IMemoryLocation interface on it.
16865
16866 2002-02-16  Miguel de Icaza  <miguel@ximian.com>
16867
16868         * cs-parser.jay (fixed_statement): reference the right statement.
16869
16870         * statement.cs (Fixed.Emit): Finish implementing the fixed
16871         statement for the &x case.
16872
16873 2002-02-14  Miguel de Icaza  <miguel@ximian.com>
16874
16875         * class.cs (Property.Define, Method.Define): Remove newslot when
16876         `implementing'.  
16877
16878         * modifiers.cs: My use of NewSlot when `Abstract' was set was
16879         wrong.  NewSlot should only be used if the `new' keyword is present.
16880
16881         * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
16882         locating our system dir.  Sorry about this.
16883
16884 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
16885
16886         * driver.cs (GetSystemDir): Compute correctly the location of our
16887         system assemblies.  I was using the compiler directory instead of
16888         the library directory.
16889
16890 2002-02-13  Ravi Pratap  <ravi@ximian.com>
16891
16892         * expression.cs (BetterFunction): Put back in what Miguel commented out
16893         since it is the correct fix. The problem is elsewhere ;-)
16894
16895         (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
16896         parameters of the parms method are themselves compatible or not !
16897
16898         (StandardConversionExists): Fix very dangerous bug where we were forgetting
16899         to check that a class implements an interface before saying that an implicit
16900         conversion was allowed. Use ImplementsInterface to do the checking.
16901
16902 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
16903
16904         * class.cs (Method.Define): Track whether we are an explicit
16905         implementation or not.  And only call DefineMethodOverride if we
16906         are an explicit implementation.
16907
16908         (Property.DefineMethod): Ditto.
16909
16910 2002-02-11  Ravi Pratap  <ravi@ximian.com>
16911
16912         * expression.cs (BetterFunction): Catch hideous bug which was
16913          preventing us from detecting ambiguous calls due to implicit casts i.e
16914         cs0121.
16915
16916 2002-01-29  Miguel de Icaza  <miguel@ximian.com>
16917
16918         * support.cs (Pair): Remove un-needed method.  I figured why I was
16919         getting the error in cs-parser.jay, the variable in a foreach loop
16920         is readonly, and the compiler does not really treat this as a variable.
16921
16922         * cs-parser.jay (fixed_statement): Fix grammar.  Use ASSIGN
16923         instead of EQUALS in grammar.  
16924
16925         * typemanager.cs (VerifyUnmanaged): Report correct error (208)
16926
16927         * expression.cs (Unary.DoResolve): Check whether the argument is
16928         managed or not.
16929
16930 2002-01-28  Miguel de Icaza  <miguel@ximian.com>
16931
16932         * support.cs: Api for Pair to set a value.  Despite the fact that
16933         the variables are public the MS C# compiler refuses to compile
16934         code that accesses the field if the variable is part of a foreach
16935         statement. 
16936
16937         * statement.cs (Fixed): Begin implementation of the fixed
16938         statement.
16939
16940         (Block.AddVariable): Return the VariableInfo on success and null
16941         on failure instead of true/false. 
16942
16943         * cs-parser.jay (foreach): Catch errors on variables already
16944         defined (we were ignoring this value before) and properly unwind
16945         the block hierarchy
16946
16947         (fixed_statement): grammar for the fixed statement.
16948
16949 2002-01-25  Miguel de Icaza  <miguel@ximian.com>
16950
16951         * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
16952         pointer types to be incretemented.
16953
16954         (SizeOf): Implement.
16955
16956         * cs-parser.jay (pointer_member_access): Implement
16957         expr->IDENTIFIER production.
16958
16959         * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
16960         MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
16961         on safe contexts.
16962
16963         (Unary): Implement indirection.
16964
16965         * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
16966         use in non-unsafe context).
16967
16968         (SimpleName.DoResolve): Check for pointers in field access on safe
16969         contexts. 
16970
16971         (Expression.LoadFromPtr): Factor the load-indirect code in this
16972         function.  This was duplicated in UnboxCast and ParameterReference
16973
16974 2002-01-24  Miguel de Icaza  <miguel@ximian.com>
16975
16976         * expression.cs (ComposedCast): report an error if a pointer cast
16977         is used in a safe region.
16978
16979         * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
16980         pointer type casts in unsafe context.
16981
16982         * codegen.cs (EmitContext): Set up IsUnsafe.
16983
16984         * cs-parser.jay (non_expression_type): Add productions for pointer
16985         casts. 
16986
16987         * expression.cs (Invocation.EmitCall): Remove chunk of buggy
16988         code.  We should not use force into static mode if the method is
16989         not virtual.  Fixes bug in MIS
16990
16991         * statement.cs (Do.Emit, While.Emit, For.Emit,
16992         Statement.EmitBoolExpression): Add support to Do and While to
16993         propagate infinite loop as `I do return' semantics.
16994
16995         Improve the For case to also test for boolean constants.
16996
16997         * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
16998         to the list of attributes we can add.
16999
17000         Remove `EmitContext' argument.
17001
17002         * class.cs (Method.Define): Apply parameter attributes.
17003         (Constructor.Define): Apply parameter attributes.
17004         (MethodCore.LabelParameters): Move here the core of labeling
17005         parameters. 
17006
17007         * support.cs (ReflectionParameters.ParameterModifier,
17008         InternalParameters.ParameterModifier): Use IsByRef on the type and
17009         only return the OUT bit for these parameters instead of in/out/ref
17010         flags.
17011
17012         This is because I miss-understood things.  The ParameterInfo.IsIn
17013         and IsOut represent whether the parameter has the [In] and [Out]
17014         attributes set.  
17015
17016 2002-01-22  Miguel de Icaza  <miguel@ximian.com>
17017
17018         * ecore.cs (FieldExpr.Emit): Release temporaries.
17019
17020         * assign.cs (LocalTemporary.Release): new function.
17021
17022         * codegen.cs (EmitContext.GetTemporaryStorage,
17023         EmitContext.FreeTemporaryStorage): Rework the way we deal with
17024         temporary storage.  Now we can "put back" localbuilders when we
17025         are done with them
17026
17027 2002-01-21  Miguel de Icaza  <miguel@ximian.com>
17028
17029         * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
17030         need to make a copy of the variable to generate verifiable code.
17031
17032 2002-01-19  Miguel de Icaza  <miguel@ximian.com>
17033
17034         * driver.cs: Compute dynamically the system directory.
17035
17036         * ecore.cs (CopyNewMethods): reworked, exposed, made public.
17037         Slower, but more generally useful.  Used by the abstract
17038         registering implementation. 
17039
17040         * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
17041         the rules for the special rule on Type/instances.  First check if
17042         we have the same name, and if so, try that special static path
17043         rather than the instance path.
17044
17045 2002-01-18  Miguel de Icaza  <miguel@ximian.com>
17046
17047         * cs-parser.jay: Emit 642 (warning: possible empty statement) for
17048         for, while and if.
17049
17050         * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
17051         Enum, ValueType, Delegate or Array for non-corlib compiles.
17052
17053         * cs-tokenizer.cs: Catch long identifiers (645)
17054
17055         * typemanager.cs (IndexerPropetyName): Ravi never tested this
17056         piece of code.
17057
17058         * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
17059         fix, we were returning too early, so we were not registering
17060         pending methods from abstract classes.
17061
17062         Do not register pending methods if the class is abstract.
17063
17064         * expression.cs (Conditional.DoResolve): Report circular implicit
17065         conversions when we neecd to compute it for conditional
17066         expressions. 
17067
17068         (Is.DoResolve): If the expression is always of the provided type,
17069         flag warning 183.  If the expression can not ever be of the
17070         provided type flag warning 184.
17071
17072         * class.cs: Catch 169 as well.
17073
17074         * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
17075         read. 
17076
17077 2002-01-18  Nick Drochak  <ndrochak@gol.com>
17078
17079         * makefile: remove path to beta2 csc.exe.  path to csc.exe must be in PATH instead.
17080
17081 2002-01-17  Miguel de Icaza  <miguel@ximian.com>
17082
17083         * interface.cs: (PopulateMethod): Check for pointers being defined
17084         only if the unsafe context is active.
17085         (PopulateProperty): ditto.
17086         (PopulateIndexer): ditto.
17087
17088         * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
17089         specified.  If pointers are present, make sure that they are
17090         present in an unsafe context.
17091         (Constructor, Constructor.Define): ditto.
17092         (Field, Field.Define): ditto.
17093         (Property, Property.Define): ditto.
17094         (Event, Event.Define): ditto.
17095
17096         * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
17097         hashtable if there are classes or structs defined.
17098
17099         * expression.cs (LocalVariableReference.DoResolve): Simplify this
17100         code, as the constant resolution moved.
17101
17102         * statement.cs (Block.EmitMeta): Resolve all constants as we emit
17103         the metadata, so we can flag error 133. 
17104
17105         * decl.cs (MemberCore.UnsafeOK): New function to test that a
17106         pointer is being declared in an unsafe context.
17107
17108 2002-01-16  Miguel de Icaza  <miguel@ximian.com>
17109
17110         * modifiers.cs (Modifiers.Check): Require a Location argument.
17111         Report error 227 for Unsafe use.
17112
17113         * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
17114
17115         * statement.cs (For.Emit): If the test is null, then report that
17116         we do `return', as we wont reach anything afterwards.
17117
17118         (Switch.SwitchGoverningType): Track the expression that matched
17119         the conversion.
17120
17121         * driver.cs: Allow negative numbers as an error code to flag.
17122
17123         * cs-parser.jay: Handle 1551.
17124
17125         * namespace.cs: Add 1537 checking (repeated using alias namespaces).
17126
17127 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
17128
17129         * cs-parser.jay: Report 1518 (type declaration can only contain
17130         class, struct, interface, enum or delegate)
17131
17132         (switch_label): Report 1523 (keywords `case' or `default' must
17133         preced code)
17134
17135         (opt_switch_sections): Report 1522 (empty switch)
17136
17137         * driver.cs: Report 1515 (response file specified multiple times)
17138         Report 1516 (Source file specified multiple times).
17139
17140         * expression.cs (Argument.Resolve): Signal 1510
17141
17142         (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
17143         access not allowed in static code)
17144
17145 2002-01-11  Ravi Pratap  <ravi@ximian.com>
17146
17147         * typemanager.cs (IsPointerType): Utility method which we are going
17148         to need a lot.
17149
17150         * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
17151         the object type, so we take care of that.
17152
17153         * expression.cs (FullMethodDesc): Also include the return type in descriptions.
17154
17155         * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
17156         added to non-params parameters :-)
17157
17158         * typemanager.cs (CSharpName): Include 'void' type too. 
17159
17160         (void_ptr_type): Include in the set of core types.
17161
17162         * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of 
17163         duplicating code.
17164
17165         (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have 
17166         an unsafe context.
17167
17168         * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had 
17169         completely forgotten about it.
17170
17171 2002-01-10  Ravi Pratap  <ravi@ximian.com>
17172
17173         * cs-parser.jay (pointer_type): Add. This begins our implementation
17174         of parsing rules for unsafe code.
17175
17176         (unsafe_statement): Implement.
17177
17178         (embedded_statement): Modify to include the above.
17179
17180         * statement.cs (Unsafe): Implement new class for unsafe blocks.
17181
17182         * codegen.cs (EmitContext.InUnsafe): Add. This determines
17183         if the current context is an unsafe one.
17184
17185         * cs-parser.jay (local_variable_pointer_type): Since local variable types
17186         are handled differently, we need separate rules for them.
17187
17188         (local_variable_declaration): Update to use local_variable_pointer_type
17189         to allow variable declarations of unmanaged pointer types.
17190
17191         * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
17192         in unsafe contexts.
17193
17194         * ../errors/cs0214.cs : Add.
17195
17196 2002-01-16  Nick Drochak  <ndrochak@gol.com>
17197
17198         * makefile: remove 'response' file when cleaning.
17199
17200 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
17201
17202         * cs-parser.jay: Report 1524.
17203
17204 2002-01-14  Miguel de Icaza  <miguel@ximian.com>
17205
17206         * typemanager.cs (RegisterMethod): drop checking if we have
17207         registered this from here
17208
17209 2002-01-12  Miguel de Icaza  <miguel@ximian.com>
17210
17211         * class.cs (Method.EmitDestructor): Implement calling our base
17212         destructor. 
17213
17214         * statement.cs (Try.Emit): Fix to reset the InFinally to the old
17215         value of InFinally.
17216
17217         * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
17218         this routine and will wrap the call in a try/catch block.  Deal
17219         with the case.
17220
17221 2002-01-11  Miguel de Icaza  <miguel@ximian.com>
17222
17223         * ecore.cs (Expression.MemberLookup): instead of taking a
17224         parameter `same_type' that was used to tell whether we could
17225         access private members we compute our containing type from the
17226         EmitContext.
17227
17228         (FieldExpr): Added partial support for volatile fields.  This does
17229         not work for volatile fields exposed from assemblies, as I can not
17230         figure out how to extract the modreq from it.
17231
17232         Updated all the source files to use this.
17233
17234         * codegen.cs (EmitContext): Compute ContainerType ahead of time,
17235         because it is referenced by MemberLookup very often. 
17236
17237 2002-01-09  Ravi Pratap  <ravi@ximian.com>
17238
17239         * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
17240         TypeBuilder.GetCustomAttributes to retrieve what we need.
17241
17242         Get rid of redundant default_member_attr_type as this is the same as
17243         default_member_type which already exists.
17244
17245         * interface.cs, attribute.cs : Update accordingly.
17246
17247 2002-01-08  Miguel de Icaza  <miguel@ximian.com>
17248
17249         * typemanager.cs: Enable IndexerPropertyName again.  It does not
17250         work for TYpeBuilders though.  Ravi, can you please fix this?
17251
17252         * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
17253
17254         * expression.cs (Argument.Emit): Handle the case of ref objects
17255         being passed to ref functions;  
17256
17257         (ParameterReference.EmitLoad): Loads the content of the pointer
17258         without dereferencing.
17259
17260 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
17261
17262         * cs-tokenizer.cs: Implemented the pre-processing expressions.
17263
17264 2002-01-08  Ravi Pratap  <ravi@ximian.com>
17265
17266         * class.cs (Indexer.DefineMethod): Incorporate the interface
17267         type in the name of the method if we are doing explicit interface
17268         implementation.
17269
17270         * expression.cs (ConversionExists): Remove as it is completely obsolete.
17271
17272         (BetterConversion): Fix extremely trivial bug where we were referring to
17273         ConversionExists instead of StandardConversionExists ! Hooray, things are fine
17274         again !
17275
17276         * ../errors/bug16.cs : Add although we have fixed it.
17277
17278 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
17279
17280         * expression.cs (BaseIndexer): Begin implementation.
17281
17282         * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
17283
17284         * cs-parser.jay (indexer_declarator): Use qualified_identifier
17285         production directly to remove a shift/reduce, and implement
17286         explicit interface implementation.
17287
17288         * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
17289         after a floating point suffix.
17290
17291         * expression.cs (DoNumericPromotions): Improved the conversion for
17292         uint/uint.  If we have a constant, we avoid doing a typecast to a
17293         larger type.
17294
17295         * class.cs (Indexer): Implement explicit interface implementation
17296         for indexers.
17297
17298 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
17299
17300         * class.cs: make the default instance constructor public and hidebysig.
17301
17302 2001-01-03  Ravi Pratap  <ravi@ximian.com>
17303
17304         * interface.cs (EmitDefaultMemberAttr): Make this helper method static
17305         so we can call it from elsewhere.
17306
17307         * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
17308         we emit it internally if the class has a defined indexer; otherwise the user
17309         emits it by decorating the class definition with the DefaultMemberAttribute.
17310
17311         * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
17312         attribute is not used on a type which defines an indexer.
17313
17314         * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
17315         character when we skip whitespace.
17316
17317         * ../errors/cs0646.cs : Add.
17318
17319 2002-01-03  Miguel de Icaza  <miguel@ximian.com>
17320
17321         * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
17322         again. 
17323
17324         * makefile: Add practical target `mcs3.exe' which builds the third
17325         generation compiler. 
17326
17327         * expression.cs (New): Fix structures constructor calling.
17328
17329         * class.cs (Property, Method, Indexer): Emit Final flag on the
17330         method if we are an interface implementation and we are not
17331         abstract. 
17332
17333         * ecore.cs (PropertyExpr): New public field `IsBase', tells
17334         whether this property is referencing a `base' method.
17335
17336         * expression.cs (Invocation.EmitCall): take an extra argument:
17337         is_base, this is used to determine whether the `call' or
17338         `callvirt' opcode should be used.
17339
17340
17341         * delegate.cs: update EmitCall.
17342
17343         * class.cs (Method.Define): Set NewSlot for the cases where we are
17344         not implementing an interface method.
17345
17346         (Property.Define): ditto.
17347
17348 2002-01-02  Miguel de Icaza  <miguel@ximian.com>
17349
17350         * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
17351         'r'.  Allows mcs to parse itself fully.
17352
17353 2002-01-02  Ravi Pratap  <ravi@ximian.com>
17354
17355         * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
17356         of the number of initializers that require the InitializeArray method.
17357
17358         (CheckIndices): Store the Expression in all cases - not the plain value. Also
17359         update the above field where necessary.
17360
17361         (MakeByteBlob): Update accordingly.
17362
17363         (DoEmit): Call EmitStaticInitializers only if the number of initializers is 
17364         greater than 2.
17365
17366         (EmitDynamicInitializers): Update in accordance with the new optimization.
17367
17368         (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
17369         same OpCode applies.
17370
17371         * cs-parser.jay : Fix some glaring errors I introduced.
17372
17373 2002-01-01  Ravi Pratap  <ravi@ximian.com> 
17374
17375         * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
17376         so that we can check for name clashes there too.
17377
17378         * typemanager.cs (default_member_attr_type): The attribute that we need to emit
17379         for interface indexers.
17380
17381         * interfaces.cs (Define): Emit the default member attribute.
17382
17383         * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
17384         variable was being referred to while setting the value ;-)
17385
17386 2002-01-01  Miguel de Icaza  <miguel@ximian.com>
17387
17388         * expression.cs (MakeByteBlob): Optimize: we do not need to fill
17389         byte-by-byte information when we know the data is zero.
17390
17391         Make the block always a multiple of 4, because
17392         DefineInitializedData has a bug.
17393
17394         * assign.cs: Fix, we should assign from the temporary, not from
17395         the source. 
17396
17397         * expression.cs (MakeByteBlob): Fix my incorrect code.
17398
17399 2001-12-31  Miguel de Icaza  <miguel@ximian.com>
17400
17401         * typemanager.cs (EnumToUnderlying): This function is used to get
17402         the underlying type from an enumeration, because it does not
17403         always work. 
17404
17405         * constant.cs: Use the I4_S form for values between -128 and 127.
17406
17407         * statement.cs (Block.LookupLabel): Looks up a label.
17408         (Block): Drop support for labeled blocks.
17409
17410         (LabeledStatement): New kind of statement that represents a label
17411         only.
17412
17413         (Goto): Finally implement this bad boy.
17414
17415         * cs-parser.jay: Update to reflect new mechanism to implement
17416         labels.
17417
17418 2001-12-30  Miguel de Icaza  <miguel@ximian.com>
17419
17420         * codegen.cs (EmitContext.This): a codegen property that keeps the
17421         a single instance of this instead of creating many different this
17422         instances. 
17423
17424         * delegate.cs (Delegate.DoResolve): Update to use the property;
17425
17426         * ecore.cs (SimpleName.SimpleNameResolve): Ditto
17427
17428         * expression.cs (BaseAccess.DoResolve): Ditto.
17429
17430 2001-12-29  Ravi Pratap  <ravi@ximian.com>
17431
17432         * typemanager.cs (methodimpl_attr_type): Add to hold the type
17433         corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
17434
17435         (InitCoreTypes): Update accordingly.
17436
17437         * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
17438         so we can quickly store the state.
17439
17440         (ApplyAttributes): Set the correct implementation flags
17441         for InternalCall methods.
17442
17443 2001-12-29  Miguel de Icaza  <miguel@ximian.com>
17444
17445         * expression.cs (EmitCall): if a method is not virtual, then do
17446         not use callvirt on it.
17447
17448         (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
17449         user defined stuff) requires the use of stobj, which takes an
17450         address on the stack instead of an array and an index.  So emit
17451         the Ldelema operation for it.
17452
17453         (EmitStoreOpcode): Use stobj for valuetypes.
17454
17455         (UnaryMutator.EmitCode): Use the right 1 value depending on
17456         whether we are dealing with int64/uint64, float or doubles.
17457
17458         * class.cs (TypeContainer.AddConstructor): Fix the logic to define
17459         constructors that I implemented last night.
17460
17461         (Constructor.IsDefault): Fix to work properly for static
17462         constructors.
17463
17464         * cs-parser.jay (CheckDef): report method signature errors.
17465         Update error number 103 to be 132.
17466
17467         * decl.cs: New AdditionResult enumeration value: MethodExists.
17468         Although we do this check for methods later on in the semantic
17469         analysis, catching repeated default constructors is so easy that
17470         we catch these here. 
17471
17472         * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
17473         promotions code.
17474
17475         (ParameterReference.EmitAssign, Emit): handle
17476         bools as bytes.
17477
17478         (ArrayAccess.EmitLoadOpcode): Handle bool type here.
17479         (ArrayAccess.EmitStoreOpcode): ditto.
17480
17481         * cs-tokenizer.cs (is_punct): Eliminated empty computation.
17482
17483         * expression.cs (MakeByteBlob): Complete all the missing types
17484         (uint, short, ushort, byte, sbyte)
17485
17486         * class.cs: Only init instance field initializers on instance
17487         constructors. 
17488
17489         Rename `constructors' to instance_constructors. 
17490
17491         (TypeContainer.AddConstructor): Only add constructors to the list
17492         if it is not static.
17493
17494         Make sure that we handle default_static_constructor independently
17495         everywhere where we handle instance_constructors
17496
17497 2001-12-28  Miguel de Icaza  <miguel@ximian.com>
17498
17499         * class.cs: Do not lookup or create a base initializer for a
17500         static constructor.
17501
17502         (ConstructorInitializer.Resolve): use the proper type to lookup
17503         for constructors.
17504
17505         * cs-parser.jay: Report error 1585 (modifiers between type and name).
17506
17507         * enum.cs, interface.cs: Remove CloseType, this is taken care by
17508         in DeclSpace. 
17509
17510         * decl.cs: CloseType is now an virtual method, the default
17511         implementation just closes this type.
17512
17513 2001-12-28  Ravi Pratap  <ravi@ximian.com>
17514
17515         * attribute.cs (DefinePInvokeMethod): Set the implementation flags
17516         to PreserveSig by default. Also emit HideBySig on such methods.
17517
17518         Basically, set the defaults to standard values.
17519
17520         * expression.cs (Invocation.BetterFunction): We need to make sure that for each
17521         argument, if candidate is better, it can't be worse than the best !
17522
17523         (Invocation): Re-write bits to differentiate between methods being
17524         applicable in their expanded form and their normal form - for params
17525         methods of course.
17526
17527         Get rid of use_standard everywhere as only standard conversions are allowed
17528         in overload resolution. 
17529
17530         More spec conformance.
17531
17532 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
17533
17534         * driver.cs: Add --timestamp, to see where the compiler spends
17535         most of its time.
17536
17537         * ecore.cs (SimpleName.DoResolve): Do not create an implicit
17538         `this' in static code.
17539
17540         (SimpleName.DoResolve): Implement in terms of a helper function
17541         that allows static-references to be passed upstream to
17542         MemberAccess.
17543
17544         (Expression.ResolveWithSimpleName): Resolve specially simple
17545         names when called by MemberAccess to implement the special
17546         semantics. 
17547
17548         (Expression.ImplicitReferenceConversion): Handle conversions from
17549         Null to reference types before others, as Null's type is
17550         System.Object. 
17551
17552         * expression.cs (Invocation.EmitCall): Handle the special case of
17553         calling methods declared on a reference type from a ValueType
17554         (Base classes System.Object and System.Enum)
17555
17556         (MemberAccess.Resolve): Only perform lookups on Enumerations if
17557         the left hand side is a TypeExpr, not on every enumeration. 
17558
17559         (Binary.Resolve): If types are reference types, then do a cast to
17560         object on operators != and == of both arguments.
17561
17562         * typemanager.cs (FindMembers): Extract instance and static
17563         members if requested.
17564
17565         * interface.cs (PopulateProperty): Use void_type instead of null
17566         as the return type for the setter method.
17567
17568         (PopulateIndexer): ditto.
17569
17570 2001-12-27  Ravi Pratap  <ravi@ximian.com>
17571
17572         * support.cs (ReflectionParameters): Fix minor bug where we
17573         were examining the wrong parameter for the ParamArray attribute.
17574
17575         Cope with requests for the type of the parameter at position
17576         greater than the params parameter's. We now return the element
17577         type of the params array as that makes more sense.
17578
17579         * expression.cs (Invocation.IsParamsMethodApplicable): Update 
17580         accordingly as we no longer have to extract the element type
17581         ourselves.
17582
17583         (Invocation.OverloadResolve): Update.
17584
17585 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
17586
17587         * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
17588         against IEnumerator, test whether the return value is a descendant
17589         of the IEnumerator interface.
17590
17591         * class.cs (Indexer.Define): Use an auxiliary method to implement
17592         the other bits of the method definition.  Begin support for
17593         explicit interface implementation.
17594
17595         (Property.DefineMethod): Use TypeManager.void_type instead of null
17596         for an empty return value.
17597
17598 2001-12-26  Miguel de Icaza  <miguel@ximian.com>
17599
17600         * expression.cs (MemberAccess.ResolveMemberAccess): if we are
17601         dealing with a FieldExpr which is composed of a FieldBuilder, in
17602         the code path we did extract the constant, but we should have
17603         obtained the underlying value to be able to cast it (otherwise we
17604         end up in an infinite loop, this is what Ravi was running into).
17605
17606         (ArrayCreation.UpdateIndices): Arrays might be empty.
17607
17608         (MemberAccess.ResolveMemberAccess): Add support for section
17609         14.5.4.1 that deals with the special case of E.I when E is a type
17610         and something else, that I can be a reference to a static member.
17611
17612         (ArrayCreation.MakeByteBlob): It is not an error to not be able to
17613         handle a particular array type to create byte blobs, it is just
17614         something we dont generate byteblobs for.
17615
17616         * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
17617         arguments. 
17618
17619         * location.cs (Push): remove the key from the hashtable that we
17620         are about to add.   This happens for empty files.
17621
17622         * driver.cs: Dispose files after we have parsed them.
17623
17624         (tokenize): new function that only runs the tokenizer on its
17625         input, for speed testing.
17626
17627 2001-12-26  Ravi Pratap  <ravi@ximian.com>
17628
17629         * class.cs (Event.Define): Define the private field only if there
17630         are no accessors defined.
17631
17632         * expression.cs (ResolveMemberAccess): If there is no associated
17633         field with the event, that means we have an event defined with its
17634         own accessors and we should flag error cs0070 since transforming
17635         ourselves into a field is not valid in that case.
17636
17637         * ecore.cs (SimpleName.DoResolve): Same as above.
17638
17639         * attribute.cs (DefinePInvokeMethod): Set the default calling convention
17640         and charset to sane values.
17641
17642 2001-12-25  Ravi Pratap  <ravi@ximian.com>
17643
17644         * assign.cs (DoResolve): Perform check on events only if they 
17645         are being accessed outside the declaring type.
17646
17647         * cs-parser.jay (event_declarations): Update rules to correctly
17648         set the type of the implicit parameter etc.
17649
17650         (add_accessor, remove_accessor): Set current local parameters.
17651
17652         * expression.cs (Binary): For delegate addition and subtraction,
17653         cast the return value from the method into the appropriate delegate
17654         type.
17655
17656 2001-12-24  Ravi Pratap  <ravi@ximian.com>
17657
17658         * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
17659         of these as the workaround is unnecessary.
17660
17661         * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
17662         delegate data - none of that is needed at all.
17663
17664         Re-write bits to extract the instance expression and the delegate method
17665         correctly.
17666
17667         * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator 
17668         on delegates too.
17669
17670         * attribute.cs (ApplyAttributes): New method to take care of common tasks
17671         of attaching attributes instead of duplicating code everywhere.
17672
17673         * everywhere : Update code to do attribute emission using the above method.
17674
17675 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
17676
17677         * expression.cs (IsParamsMethodApplicable): if there are not
17678         parameters, return immediately.
17679
17680         * ecore.cs: The 0 literal can be implicity converted to an enum
17681         type. 
17682
17683         (SimpleName.DoResolve): First lookup the type, then lookup the
17684         members. 
17685
17686         (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
17687         want to get its address.  If the InstanceExpression is not
17688         addressable, store the result in a temporary variable, then get
17689         the address of it.
17690
17691         * codegen.cs: Only display 219 errors on warning level or above. 
17692
17693         * expression.cs (ArrayAccess): Make it implement the
17694         IMemoryLocation interface.
17695
17696         (Binary.DoResolve): handle the operator == (object a, object b)
17697         and operator != (object a, object b) without incurring into a
17698         BoxedCast (because 5 != o should never be performed).
17699
17700         Handle binary enumerator operators.
17701
17702         (EmitLoadOpcode): Use Ldelema if the object we are loading is a
17703         value type, otherwise use Ldelem_ref.
17704
17705         Use precomputed names;
17706
17707         (AddressOf): Implement address of
17708
17709         * cs-parser.jay (labeled_statement): Fix recursive block
17710         addition by reworking the production.
17711
17712         * expression.cs (New.DoEmit): New has a special case:
17713                 
17714                  If we are dealing with a ValueType, we have a few
17715                  situations to deal with:
17716                 
17717                     * The target of New is a ValueType variable, that is
17718                       easy, we just pass this as the variable reference
17719                 
17720                     * The target of New is being passed as an argument,
17721                       to a boxing operation or a function that takes a
17722                       ValueType.
17723                 
17724                       In this case, we need to create a temporary variable
17725                       that is the argument of New.
17726
17727
17728 2001-12-23  Ravi Pratap  <ravi@ximian.com>
17729
17730         * rootcontext.cs (LookupType): Check that current_type is not null before
17731         going about looking at nested types.
17732
17733         * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
17734         not implement the IAssignMethod interface any more.
17735
17736         * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
17737         where we tranform them into FieldExprs if they are being resolved from within
17738         the declaring type.
17739
17740         * ecore.cs (SimpleName.DoResolve): Do the same here.
17741
17742         * assign.cs (DoResolve, Emit): Clean up code considerably. 
17743
17744         * ../errors/bug10.cs : Add.
17745
17746         * ../errors/cs0070.cs : Add.
17747
17748         * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
17749
17750         * assign.cs : Get rid of EventIsLocal everywhere.
17751
17752 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
17753
17754         * ecore.cs (ConvertIntLiteral): finished the implementation.
17755
17756         * statement.cs (SwitchLabel): Convert the value we are using as a
17757         key before looking up the table.
17758
17759 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
17760
17761         * codegen.cs (EmitTopBlock): Require a Location argument now.
17762
17763         * cs-parser.jay (constructor_declarator): We need to setup
17764         current_local_parameters before we parse the
17765         opt_constructor_initializer, to allow the variables to be bound
17766         to the constructor arguments.
17767
17768         * rootcontext.cs (LookupType): First lookup nested classes in our
17769         class and our parents before we go looking outside our class.
17770
17771         * expression.cs (ConstantFold): Extract/debox the values at the
17772         beginnning. 
17773
17774         * rootcontext.cs (EmitCode): Resolve the constants first before we
17775         resolve the types.  This is not really needed, but it helps debugging.
17776
17777         * statement.cs: report location.
17778
17779         * cs-parser.jay: pass location to throw statement.
17780
17781         * driver.cs: Small bug fix.
17782
17783         * report.cs: Updated format to be 4-zero filled digits.
17784
17785 2001-12-22  Ravi Pratap  <ravi@ximian.com>
17786
17787         * expression.cs (CheckIndices): Fix minor bug where the wrong
17788         variable was being referred to ;-)
17789
17790         (DoEmit): Do not call EmitStaticInitializers when the 
17791         underlying type is System.Object.
17792
17793 2001-12-21  Ravi Pratap  <ravi@ximian.com>
17794
17795         * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
17796         and do the usual workaround for SRE.
17797
17798         * class.cs (MyEventBuilder.EventType): New member to get at the type
17799         of the event, quickly.
17800
17801         * expression.cs (Binary.ResolveOperator): Handle delegate addition.
17802
17803         * assign.cs (Assign.DoResolve): Handle the case when the target
17804         is an EventExpr and perform the necessary checks.
17805
17806         * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
17807         interface.
17808
17809         (SimpleName.MemberStaticCheck): Include check for EventExpr.
17810
17811         (EventExpr): Set the type in the constructor itself since we 
17812         are meant to be born fully resolved.
17813
17814         (EventExpr.Define): Revert code I wrote earlier.
17815                 
17816         * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
17817         instance expression is null. The instance expression is a This in that case
17818         or a null, depending on whether it is a static method or not.
17819
17820         Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
17821         refers to more than one method.
17822
17823         * assign.cs (DoResolve): Check whether the event belongs to the same Type container
17824         and accordingly flag errors.
17825
17826 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
17827
17828         * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
17829
17830 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
17831
17832         * location.cs (ToString): Provide useful rutine.
17833
17834 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
17835
17836         * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
17837         objects, return the actual integral boxed.
17838
17839         * statement.cs (SwitchLabel): define an ILLabel for each
17840         SwitchLabel. 
17841
17842         (Switch.CheckSwitch): If the value is a Literal, extract
17843         the underlying literal.
17844
17845         Also in the unused hashtable we had, add the SwitchLabel so we can
17846         quickly look this value up.
17847
17848         * constant.cs: Implement a bunch of new constants.  Rewrite
17849         Literal based on this.  Made changes everywhere to adapt to this.
17850
17851         * expression.cs (Expression.MakeByteBlob): Optimize routine by
17852         dereferencing array only once, and also copes with enumrations.
17853
17854         bytes are two bytes wide, not one.
17855
17856         (Cast): Perform constant conversions.
17857
17858         * ecore.cs (TryImplicitIntConversion): Return literals instead of
17859         wrappers to the literals here.
17860
17861         * expression.cs (DoNumericPromotions): long literals can converted
17862         to ulong implicity (this is taken care of elsewhere, but I was
17863         missing this spot).
17864
17865         * ecore.cs (Expression.Literalize): Make the return type Literal,
17866         to improve type checking.
17867
17868         * rootcontext.cs: Lookup for nested classes in our class hierarchy.
17869
17870 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
17871
17872         * literal.cs: Revert code from ravi that checked the bounds.  The
17873         bounds are sane by the definition of the type itself. 
17874
17875         * typemanager.cs: Fix implementation of ImplementsInterface.  We
17876         need to actually look up in our parent hierarchy for interfaces
17877         implemented. 
17878
17879         * const.cs: Use the underlying type for enumerations
17880
17881         * delegate.cs: Compute the basename for the delegate creation,
17882         that should fix the delegate test case, and restore the correct
17883         Type Lookup semantics in rootcontext
17884
17885         * rootcontext.cs: Revert Ravi's last patch.  The correct way of
17886         referencing a nested type with the Reflection API is using the "+"
17887         sign. 
17888
17889         * cs-parser.jay: Do not require EOF token at the end.
17890
17891 2001-12-20  Ravi Pratap  <ravi@ximian.com>
17892
17893         * rootcontext.cs (LookupType): Concatenate type names with
17894         a '.' instead of a '+' The test suite passes again.
17895
17896         * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
17897         field of the enumeration.
17898
17899         * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
17900         the case when the member is an EventExpr.
17901
17902         * ecore.cs (EventExpr.InstanceExpression): Every event which is not
17903         static has an associated instance expression.
17904
17905         * typemanager.cs (RegisterEvent): The usual workaround, now for events.
17906
17907         (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
17908
17909         * class.cs (Event.Define): Register event and perform appropriate checks
17910         for error #111.
17911
17912         We define the Add and Remove methods even if the use provides none because
17913         in that case, we provide default implementations ourselves.
17914
17915         Define a private field of the type of the event. This is done by the CSC compiler
17916         and we should be doing it too ;-)
17917
17918         * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
17919         More methods we use in code we generate.
17920
17921         (multicast_delegate_type, delegate_type): Two separate types since the distinction
17922         is important.
17923
17924         (InitCoreTypes): Update accordingly for the above.
17925
17926         * class.cs (Event.Emit): Generate code for default accessors that we provide
17927
17928         (EmitDefaultMethod): Do the job in the above.
17929
17930         * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the 
17931         appropriate place.
17932
17933 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
17934
17935         * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
17936         builders even if we were missing one.
17937
17938         * interface.cs, class.cs, enum.cs: When calling DefineNestedType
17939         pass the Basename as our class name instead of the Name.  The
17940         basename will be correctly composed for us.
17941
17942         * parameter.cs (Paramters): Now takes a Location argument.
17943
17944         * decl.cs (DeclSpace.LookupType): Removed convenience function and
17945         make all the code call directly LookupType in RootContext and take
17946         this chance to pass the Location information everywhere.
17947
17948         * Everywhere: pass Location information.
17949
17950 2001-12-19  Miguel de Icaza  <miguel@ximian.com>
17951
17952         * class.cs (Constructor.Define): Updated way of detecting the
17953         length of the parameters.
17954
17955         (TypeContainer.DefineType): Use basename as the type name for
17956         nested types.
17957
17958         (TypeContainer.Define): Do not recursively define types here, as
17959         definition is taken care in order by the RootContext.
17960
17961         * tree.cs: Keep track of namespaces in a per-file basis.
17962
17963         * parameter.cs (Parameter.ComputeSignature): Update to use
17964         DeclSpace. 
17965
17966         (Parameters.GetSignature): ditto.
17967
17968         * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
17969         instead of a TypeContainer.
17970
17971         (Interface.SemanticAnalysis): Use `this' instead of our parent to
17972         resolve names.  Because we need to be resolve in our context, not
17973         our parents.
17974
17975         * driver.cs: Implement response files.
17976
17977         * class.cs (TypeContainer.DefineType): If we are defined, do not
17978         redefine ourselves.
17979
17980         (Event.Emit): Emit the code for add/remove handlers.
17981         (Event.Define): Save the MethodBuilders for add/remove.
17982
17983         * typemanager.cs: Use pair here too.
17984
17985         * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
17986         DictionaryEntry requires the first argument to be non-null.  
17987
17988         (enum_declaration): Compute full name for registering the
17989         enumeration.
17990
17991         (delegate_declaration): Instead of using
17992         formal_parameter_list, use opt_formal_parameter_list as the list
17993         can be empty.
17994
17995         * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
17996         (EventParsing): New property that controls whether `add' and
17997         `remove' are returned as tokens or identifiers (for events);
17998
17999 2001-12-19  Ravi Pratap  <ravi@ximian.com>
18000
18001         * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
18002         use MyEventBuilder only and let it wrap the real builder for us.
18003
18004         (MyEventBuilder): Revamp constructor etc.
18005
18006         Implement all operations that we perform on EventBuilder in precisely the same
18007         way here too.
18008
18009         (FindMembers): Update to use the EventBuilder member.
18010
18011         (Event.Emit): Update accordingly.
18012
18013 2001-12-18  Ravi Pratap  <ravi@ximian.com>
18014
18015         * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
18016         by calling the appropriate methods.
18017
18018         (GetCustomAttributes): Make stubs as they cannot possibly do anything
18019         useful.
18020
18021         (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
18022
18023 2001-12-17  Ravi Pratap  <ravi@ximian.com>
18024
18025         * delegate.cs (Delegate.Populate): Check that the return type
18026         and various parameters types are indeed accessible.
18027
18028         * class.cs (Constructor.Define): Same here.
18029
18030         (Field.Define): Ditto.
18031
18032         (Event.Define): Ditto.
18033
18034         (Operator.Define): Check that the underlying Method defined itself
18035         correctly - so it's MethodBuilder should not be null.
18036
18037         * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
18038         expression happens to be null.
18039
18040         * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
18041         members but as of now we don't seem to be able to do anything really useful with it.
18042
18043         (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
18044         not the EventBuilder.
18045
18046 2001-12-18  Miguel de Icaza  <miguel@ximian.com>
18047
18048         * cs-tokenizer.cs: Add support for defines.
18049         Add support for #if, #elif, #else, #endif
18050
18051         (eval_var): evaluates a variable.
18052         (eval): stubbed for evaluating functions.
18053
18054         * cs-parser.jay: Pass the defines information
18055
18056         * driver.cs: Add --define command line option.
18057
18058         * decl.cs: Move MemberCore here.
18059
18060         Make it the base class for DeclSpace.  This allows us to catch and
18061         report 108 and 109 for everything now.
18062
18063         * class.cs (TypeContainer.Define): Extract all the members
18064         before populating and emit the warning 108 (new keyword required
18065         to override) instead of having each member implement this.
18066
18067         (MemberCore.Define): New abstract method, we will be using this in
18068         the warning reporting engine in Populate.
18069
18070         (Operator.Define): Adjust to new MemberCore protocol. 
18071
18072         * const.cs (Const): This does not derive from Expression, it is a
18073         temporary object we use to create fields, it is a MemberCore. 
18074
18075         * class.cs (Method.Define): Allow the entry point to be in a
18076         specific class.
18077
18078         * driver.cs: Rewrite the argument handler to clean it up a bit.
18079
18080         * rootcontext.cs: Made it just an auxiliary namespace feature by
18081         making everything static.
18082
18083         * driver.cs: Adapt code to use RootContext type name instead of
18084         instance variable.
18085
18086         * delegate.cs: Remove RootContext argument.
18087
18088         * class.cs: (Struct, TypeContainer, Class): Remove RootContext
18089         argument. 
18090
18091         * class.cs (Event.Define): The lookup can fail.
18092
18093         * cs-tokenizer.cs: Begin implementation of pre-procesor. 
18094
18095         * expression.cs: Resolve the this instance before invoking the code.
18096
18097 2001-12-17  Miguel de Icaza  <miguel@ximian.com>
18098
18099         * cs-parser.jay: Add a production in element_access that allows
18100         the thing to become a "type" reference.  This way we can parse
18101         things like "(string [])" as a type.
18102
18103         Note that this still does not handle the more complex rules of
18104         casts. 
18105
18106
18107         * delegate.cs (Delegate.Populate): Register the delegage constructor builder here. 
18108
18109         * ecore.cs: (CopyNewMethods): new utility function used to
18110         assemble the list of methods from running FindMembers.
18111
18112         (MemberLookup): Rework FindMembers so that 
18113
18114 2001-12-16  Miguel de Icaza  <miguel@ximian.com>
18115
18116         * class.cs (TypeContainer): Remove Delegates who fail to be
18117         defined.
18118
18119         * delegate.cs (Populate): Verify that we dont get null return
18120         values.   TODO: Check for AsAccessible.
18121
18122         * cs-parser.jay: Use basename to emit error 574 (destructor should
18123         have the same name as container class), not the full name.
18124
18125         * cs-tokenizer.cs (adjust_int): Fit the integer in the best
18126         possible representation.  
18127
18128         Also implements integer type suffixes U and L.
18129
18130 2001-12-15  Miguel de Icaza  <miguel@ximian.com>
18131
18132         * expression.cs (ArrayCreation.DoResolve): We need to do the
18133         argument resolution *always*.
18134
18135         * decl.cs: Make this hold the namespace.  Hold the root context as
18136         well.
18137         (LookupType): Move here.
18138
18139         * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
18140
18141         * location.cs (Row, Name): Fixed the code, it was always returning
18142         references to the first file.
18143
18144         * interface.cs: Register properties defined through interfaces.
18145
18146         * driver.cs: Add support for globbing on the command line
18147
18148         * class.cs (Field): Make it derive from MemberCore as well.
18149         (Event): ditto.
18150
18151 2001-12-15  Ravi Pratap  <ravi@ximian.com>
18152
18153         * class.cs (Event::Define): Check that the type of the event is a delegate
18154         type else flag error #66.
18155
18156         Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
18157         same.
18158
18159         * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
18160         values of EntryPoint, CharSet etc etc.
18161
18162         Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
18163
18164         * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
18165         be null and we should ignore this. I am not sure if this is really clean. Apparently,
18166         there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
18167         which needs this to do its work.
18168
18169         * ../errors/cs0066.cs : Add.
18170
18171 2001-12-14  Miguel de Icaza  <miguel@ximian.com>
18172
18173         * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
18174         helper functions.
18175
18176         * class.cs: (MethodSignature.MethodSignature): Removed hack that
18177         clears out the parameters field.
18178         (MemberSignatureCompare): Cleanup
18179
18180         (MemberCore): New base class used to share code between MethodCore
18181         and Property.
18182
18183         (RegisterRequiredImplementations) BindingFlags.Public requires
18184         either BindingFlags.Instace or Static.  Use instance here.
18185
18186         (Property): Refactored code to cope better with the full spec.
18187
18188         * parameter.cs (GetParameterInfo): Return an empty array instead
18189         of null on error.
18190
18191         * class.cs (Property): Abstract or extern properties have no bodies.
18192
18193         * parameter.cs (GetParameterInfo): return a zero-sized array.
18194
18195         * class.cs (TypeContainer.MethodModifiersValid): Move all the
18196         method modifier validation to the typecontainer so we can reuse
18197         this on properties.
18198
18199         (MethodCore.ParameterTypes): return an empty sized array of types.
18200
18201         (Property.Define): Test property modifier validity.
18202
18203         Add tests for sealed/override too.
18204
18205         (Method.Emit): abstract or extern methods have no bodies.
18206
18207 2001-12-14  Ravi Pratap  <ravi@ximian.com>
18208
18209         * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
18210         thing.
18211
18212         (Method::Define, ::Emit): Modify accordingly.
18213
18214         * expression.cs (Invocation::OverloadResolve): Handle error # 121.
18215
18216         (ArrayCreation::MakeByteBlob): Handle floats and doubles.
18217
18218         * makefile: Pass in /unsafe.
18219
18220 2001-12-13  Miguel de Icaza  <miguel@ximian.com>
18221
18222         * class.cs (MakeKey): Kill routine.
18223
18224         * class.cs (TypeContainer.Define): Correctly define explicit
18225         method implementations (they require the full interface name plus
18226         the method name).
18227
18228         * typemanager.cs: Deply the PtrHashtable here and stop using the
18229         lame keys.  Things work so much better.
18230
18231         This of course broke everyone who depended on `RegisterMethod' to
18232         do the `test for existance' test.  This has to be done elsewhere.
18233
18234         * support.cs (PtrHashtable): A hashtable that avoid comparing with
18235         the object stupid Equals method (because, that like fails all over
18236         the place).  We still do not use it.
18237
18238         * class.cs (TypeContainer.SetRequiredInterface,
18239         TypeContainer.RequireMethods): Killed these two routines and moved
18240         all the functionality to RegisterRequiredImplementations.
18241
18242         (TypeContainer.RegisterRequiredImplementations): This routine now
18243         registers all the implementations required in an array for the
18244         interfaces and abstract methods.  We use an array of structures
18245         which can be computed ahead of time to reduce memory usage and we
18246         also assume that lookups are cheap as most classes will not
18247         implement too many interfaces.
18248
18249         We also avoid creating too many MethodSignatures.
18250
18251         (TypeContainer.IsInterfaceMethod): Update and optionally does not
18252         clear the "pending" bit if we find that there are problems with
18253         the declaration.
18254
18255         (TypeContainer.VerifyPendingMethods): Update to report errors of
18256         methods that look like implementations but are not.
18257
18258         (TypeContainer.Define): Add support for explicit interface method
18259         implementation. 
18260
18261 2001-12-12  Miguel de Icaza  <miguel@ximian.com>
18262
18263         * typemanager.cs: Keep track of the parameters here instead of
18264         being a feature of the TypeContainer.
18265
18266         * class.cs: Drop the registration of parameters here, as
18267         InterfaceMethods are also interface declarations.
18268
18269         * delegate.cs: Register methods with the TypeManager not only with
18270         the TypeContainer.  This code was buggy.
18271
18272         * interface.cs: Full registation here.
18273
18274 2001-12-11  Miguel de Icaza  <miguel@ximian.com>
18275
18276         * expression.cs: Remove reducer for binary expressions, it can not
18277         be done this way.
18278
18279         * const.cs: Put here the code that used to go into constant.cs
18280
18281         * constant.cs: Put here the code for constants, this is a new base
18282         class for Literals.
18283
18284         * literal.cs: Make Literal derive from Constant.
18285
18286 2001-12-09  Miguel de Icaza  <miguel@ximian.com>
18287
18288         * statement.cs (Return.Emit): Report error 157 if the user
18289         attempts to return from a finally block.
18290
18291         (Return.Emit): Instead of emitting a return, jump to the end of
18292         the function.
18293
18294         * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
18295         LocalBuilder to store the result of the function.  ReturnLabel is
18296         the target where we jump.
18297
18298
18299 2001-12-09  Radek Doulik  <rodo@ximian.com>
18300
18301         * cs-parser.jay: remember alias in current namespace
18302
18303         * ecore.cs (SimpleName::DoResolve): use aliases for types or
18304         namespaces
18305
18306         * class.cs (LookupAlias): lookup alias in my_namespace
18307
18308         * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
18309         aliases hashtable
18310         (LookupAlias): lookup alias in this and if needed in parent
18311         namespaces
18312
18313 2001-12-08  Miguel de Icaza  <miguel@ximian.com>
18314
18315         * support.cs: 
18316
18317         * rootcontext.cs: (ModuleBuilder) Made static, first step into
18318         making things static.  I need this to avoid passing the
18319         TypeContainer when calling ParameterType.
18320
18321         * support.cs (InternalParameters.ParameterType): Remove ugly hack
18322         that did string manipulation to compute the type and then call
18323         GetType.  Use Parameter.ParameterType instead.
18324
18325         * cs-tokenizer.cs: Consume the suffix for floating values.
18326
18327         * expression.cs (ParameterReference): figure out whether this is a
18328         reference parameter or not.  Kill an extra variable by computing
18329         the arg_idx during emission.
18330
18331         * parameter.cs (Parameters.GetParameterInfo): New overloaded
18332         function that returns whether a parameter is an out/ref value or not.
18333
18334         (Parameter.ParameterType): The type of the parameter (base,
18335         without ref/out applied).
18336
18337         (Parameter.Resolve): Perform resolution here.
18338         (Parameter.ExternalType): The full type (with ref/out applied).
18339
18340         * statement.cs (Using.Emit, Using.EmitExpression): Implement
18341         support for expressions on the using statement.
18342
18343 2001-12-07  Miguel de Icaza  <miguel@ximian.com>
18344
18345         * statement.cs (Using.EmitLocalVariableDecls): Split the
18346         localvariable handling of the using statement.
18347
18348         (Block.EmitMeta): Keep track of variable count across blocks.  We
18349         were reusing slots on separate branches of blocks.
18350
18351         (Try.Emit): Emit the general code block, we were not emitting it. 
18352
18353         Check the type of the declaration to be an IDisposable or
18354         something that can be implicity converted to it. 
18355
18356         Emit conversions if required.
18357
18358         * ecore.cs (EmptyExpression): New utility class.
18359         (Expression.ImplicitConversionExists): New utility function.
18360
18361 2001-12-06  Miguel de Icaza  <miguel@ximian.com>
18362
18363         * statement.cs (Using): Implement.
18364
18365         * expression.cs (LocalVariableReference): Support read only variables.
18366
18367         * statement.cs: Remove the explicit emit for the Leave opcode.
18368         (VariableInfo): Add a readonly field.
18369
18370 2001-12-05  Miguel de Icaza  <miguel@ximian.com>
18371
18372         * ecore.cs (ConvCast): new class used to encapsulate the various
18373         explicit integer conversions that works in both checked and
18374         unchecked contexts.
18375
18376         (Expression.ConvertNumericExplicit): Use new ConvCast class to
18377         properly generate the overflow opcodes.
18378
18379 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
18380
18381         * statement.cs: The correct type for the EmptyExpression is the
18382         element_type, not the variable type.  Ravi pointed this out.
18383
18384 2001-12-04  Ravi Pratap  <ravi@ximian.com>
18385
18386         * class.cs (Method::Define): Handle PInvoke methods specially
18387         by using DefinePInvokeMethod instead of the usual one.
18388
18389         * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
18390         above to do the task of extracting information and defining the method.
18391
18392 2001-12-04  Ravi Pratap  <ravi@ximian.com>
18393
18394         * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
18395         of the condition for string type.
18396
18397         (Emit): Move that here. 
18398
18399         (ArrayCreation::CheckIndices): Keep string literals in their expression
18400         form.
18401
18402         (EmitDynamicInitializers): Handle strings appropriately.
18403
18404 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
18405
18406         * codegen.cs (EmitContext): Replace multiple variables with a
18407         single pointer to the current Switch statement.
18408
18409         * statement.cs (GotoDefault, Switch): Adjust to cleaned up
18410         EmitContext.
18411
18412 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
18413
18414         * statement.cs 
18415
18416         * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
18417         default'.
18418
18419         (Foreach.Emit): Foreach on arrays was not setting
18420         up the loop variables (for break/continue).
18421
18422         (GotoCase): Semi-implented.
18423
18424 2001-12-03  Ravi Pratap  <ravi@ximian.com>
18425
18426         * attribute.cs (CheckAttribute): Handle system attributes by using
18427         Attribute.GetAttributes to examine information we need.
18428
18429         (GetValidPlaces): Same here.
18430
18431         * class.cs (Method::Define): Catch invalid use of extern and abstract together.
18432
18433         * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
18434
18435         * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
18436
18437         (Method::Define): Set appropriate flags if we have a DllImport attribute.
18438
18439         (Method::Emit): Handle the case when we are a PInvoke method.
18440
18441 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
18442
18443         * expression.cs: Use ResolveWithSimpleName on compound names.
18444
18445 2001-12-02  Ravi Pratap  <ravi@ximian.com>
18446
18447         * constant.cs (EmitConstant): Make sure we resolve the associated expression
18448         before trying to reduce it.
18449
18450         * typemanager.cs (RegisterConstant, LookupConstant): Implement.
18451
18452         * constant.cs (LookupConstantValue): Implement.
18453
18454         (EmitConstant): Use the above in emitting the constant.
18455
18456         * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
18457         that are user-defined by doing a LookupConstantValue on them.
18458
18459         (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
18460         too, like above.
18461
18462 2001-11-29  Miguel de Icaza  <miguel@ximian.com>
18463
18464         * expression.cs (BaseAccess, BaseIndexer): Also split this out.
18465
18466         (BaseAccess.DoResolve): Implement.
18467
18468         (MemberAccess.DoResolve): Split this routine into a
18469         ResolveMemberAccess routine that can be used independently
18470
18471 2001-11-28  Miguel de Icaza  <miguel@ximian.com>
18472
18473         * expression.cs (Probe, Is, As): Split Probe in two classes Is and
18474         As that share bits of the implementation.  Is returns a boolean,
18475         while As returns the Type that is being probed.
18476
18477 2001-12-01  Ravi Pratap  <ravi@ximian.com>
18478
18479         * enum.cs (LookupEnumValue): Re-write various bits, return an object value
18480         instead of a Literal - much easier.
18481
18482         (EnumInTransit): Remove - utterly useless :-)
18483
18484         (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
18485
18486         * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
18487
18488         * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
18489         chain when we have no associated expression.
18490
18491 2001-11-30  Ravi Pratap  <ravi@ximian.com>
18492
18493         * constant.cs (Define): Use Location while reporting the errror.
18494
18495         Also emit a warning when 'new' is used and there is no inherited
18496         member to hide.
18497
18498         * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being 
18499         populated.
18500
18501         (LookupEnumValue): Implement to lookup an enum member's value and define it
18502         if necessary.
18503
18504         (Populate): Re-write accordingly to use the above routine.
18505
18506 2001-11-27  Miguel de Icaza  <miguel@ximian.com>
18507
18508         * expression.cs (This): Fix prototype for DoResolveLValue to
18509         override the base class DoResolveLValue.
18510
18511         * cs-parser.cs: Report errors cs574 and cs575 (destructor
18512         declarations) 
18513
18514         * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
18515         (we need to load the address of the field here).  This fixes
18516         test-22. 
18517
18518         (FieldExpr.DoResolveLValue): Call the DoResolve
18519         function to initialize the Instance expression.
18520
18521         * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
18522         correctly the GetEnumerator operation on a value type.
18523
18524         * cs-parser.jay: Add more simple parsing error catches.
18525
18526         * statement.cs (Switch): Add support for string switches.
18527         Handle null specially.
18528
18529         * literal.cs (NullLiteral): Make NullLiteral objects singletons. 
18530
18531 2001-11-28  Ravi Pratap  <ravi@ximian.com>
18532
18533         * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
18534
18535         (declare_local_constant): New helper function.
18536
18537         * statement.cs (AddConstant): Keep a separate record of constants
18538
18539         (IsConstant): Implement to determine if a variable is a constant.
18540
18541         (GetConstantExpression): Implement.
18542
18543         * expression.cs (LocalVariableReference): Handle the case when it is a constant.
18544
18545         * statement.cs (IsVariableDefined): Re-write.
18546
18547 2001-11-27  Ravi Pratap  <ravi@ximian.com>
18548
18549         * class.cs (TypeContainer::FindMembers): Look for constants
18550         in the case when we are looking for MemberTypes.Field
18551
18552         * expression.cs (MemberAccess::DoResolve): Check that in the
18553         case we are a FieldExpr and a Literal, we are not being accessed
18554         by an instance reference.
18555
18556         * cs-parser.jay (local_constant_declaration): Implement.
18557
18558         (declaration_statement): Implement for constant declarations.
18559
18560 2001-11-26  Miguel de Icaza  <miguel@ximian.com>
18561
18562         * statement.cs (Switch): Catch double defaults.
18563
18564         (Switch): More work on the switch() statement
18565         implementation.  It works for integral values now, need to finish
18566         string support.
18567
18568
18569 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
18570
18571         * ecore.cs (Expression.ConvertIntLiteral): New function to convert
18572         integer literals into other integer literals.  To be used by
18573         switch. 
18574
18575 2001-11-24  Ravi Pratap  <ravi@ximian.com>
18576
18577         * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
18578         some memory.
18579
18580         (EmitDynamicInitializers): Cope with the above since we extract data
18581         directly from ArrayData now.
18582
18583         (ExpectInitializers): Keep track of whether initializers are mandatory
18584         or not.
18585
18586         (Bounds): Make it a hashtable to prevent the same dimension being 
18587         recorded for every element in that dimension.
18588
18589         (EmitDynamicInitializers): Fix bug which prevented the Set array method
18590         from being found.
18591
18592         Also fix bug which was causing the indices to be emitted in the reverse
18593         order.
18594
18595 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
18596
18597         * expression.cs (ArrayCreation): Implement the bits that Ravi left
18598         unfinished.  They do not work, because the underlying code is
18599         sloppy.
18600
18601 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
18602
18603         * cs-parser.jay: Remove bogus fixme.
18604
18605         * statement.cs (Switch, SwitchSection, SwithLabel): Started work
18606         on Switch statement.
18607
18608 2001-11-23  Ravi Pratap  <ravi@ximian.com>
18609
18610         * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
18611         the same. 
18612
18613         * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
18614         parameter. Apparently, any expression is allowed. 
18615
18616         (ValidateInitializers): Update accordingly.
18617
18618         (CheckIndices): Fix some tricky bugs thanks to recursion.
18619
18620         * delegate.cs (NewDelegate::DoResolve): Re-write large portions as 
18621         I was being completely brain-dead.
18622
18623         (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
18624         and re-write acordingly.
18625
18626         (DelegateInvocation): Re-write accordingly.
18627
18628         * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
18629
18630         (MakeByteBlob): Handle types more correctly.
18631
18632         * expression.cs (ArrayCreation:Emit): Write preliminary code to do
18633         initialization from expressions but it is incomplete because I am a complete
18634         Dodo :-|
18635
18636 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
18637
18638         * statement.cs (If.Emit): Fix a bug that generated incorrect code
18639         on If.  Basically, we have to return `true' (ie, we do return to
18640         our caller) only if both branches of the if return.
18641
18642         * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
18643         short-circuit operators, handle them as short circuit operators. 
18644
18645         (Cast.DoResolve): Resolve type.
18646         (Cast.Cast): Take an expression as the target type.
18647
18648         * cs-parser.jay (cast_expression): Remove old hack that only
18649         allowed a limited set of types to be handled.  Now we take a
18650         unary_expression and we resolve to a type during semantic
18651         analysis.
18652
18653         Use the grammar productions from Rhys to handle casts (this is
18654         not complete like Rhys syntax yet, we fail to handle that corner
18655         case that C# has regarding (-x), but we will get there.
18656
18657 2001-11-22  Ravi Pratap  <ravi@ximian.com>
18658
18659         * class.cs (EmitFieldInitializer): Take care of the case when we have a
18660         field which is an array type.
18661
18662         * cs-parser.jay (declare_local_variables): Support array initialization too.
18663
18664         * typemanager.cs (MakeKey): Implement.
18665
18666         (everywhere): Use the above appropriately.
18667
18668         * cs-parser.jay (for_statement): Update for array initialization while
18669         declaring variables.
18670
18671         * ecore.cs : The error message was correct, it's the variable's names that
18672         were misleading ;-) Make the code more readable.
18673
18674         (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
18675         the correct type etc.
18676
18677         (ConvertExplicit): Handle Enum types by examining the underlying type.
18678
18679 2001-11-21  Ravi Pratap  <ravi@ximian.com>
18680
18681         * parameter.cs (GetCallingConvention): Always return
18682         CallingConventions.Standard for now.
18683
18684 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
18685
18686         * expression.cs (Binary.ResolveOperator): Update the values of `l'
18687         and `r' after calling DoNumericPromotions.
18688
18689         * ecore.cs: Fix error message (the types were in the wrong order).
18690
18691         * statement.cs (Foreach.ProbeCollectionType): Need to pass
18692         BindingFlags.Instance as well 
18693
18694         * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
18695         implicit int literal conversion in an empty cast so that we
18696         propagate the right type upstream.
18697
18698         (UnboxCast): new class used to unbox value types.
18699         (Expression.ConvertExplicit): Add explicit type conversions done
18700         by unboxing.
18701
18702         (Expression.ImplicitNumericConversion): Oops, forgot to test for
18703         the target type before applying the implicit LongLiterals to ULong
18704         literal cast.
18705
18706 2001-11-21  Miguel de Icaza  <miguel@ximian.com>
18707
18708         * cs-parser.jay (for_statement): Reworked the way For works: now
18709         we declare manually any variables that are introduced in
18710         for_initializer to solve the problem of having out-of-band code
18711         emition (that is what got for broken).
18712
18713         (declaration_statement): Perform the actual variable declaration
18714         that used to be done in local_variable_declaration here.
18715
18716         (local_variable_declaration): Do not declare anything, just pass
18717         the information on a DictionaryEntry
18718
18719 2001-11-20  Ravi Pratap  <ravi@ximian.com>
18720
18721         * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
18722         re-write of the logic to now make it recursive.
18723
18724         (UpdateIndices): Re-write accordingly.
18725
18726         Store element data in a separate ArrayData list in the above methods.
18727
18728         (MakeByteBlob): Implement to dump the array data into a byte array.
18729
18730 2001-11-19  Ravi Pratap  <ravi@ximian.com>
18731
18732         * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
18733         into CheckIndices.
18734
18735         * constant.cs (Define): Implement.
18736
18737         (EmitConstant): Re-write fully.
18738
18739         Pass in location info.
18740
18741         * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
18742         respectively.
18743
18744         * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
18745         DictionaryEntry since we need location info too.
18746
18747         (constant_declaration): Update accordingly.
18748
18749         * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
18750         code into another method : UpdateIndices.
18751
18752 2001-11-18  Ravi Pratap  <ravi@ximian.com>
18753
18754         * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
18755         some type checking etc.
18756
18757 2001-11-17  Ravi Pratap  <ravi@ximian.com>
18758
18759         * expression.cs (ArrayCreation::ValidateInitializers): Implement
18760         bits to provide dimension info if the user skips doing that.
18761
18762         Update second constructor to store the rank correctly.
18763
18764 2001-11-16  Ravi Pratap  <ravi@ximian.com>
18765
18766         * expression.cs (ArrayCreation::ValidateInitializers): Poke around
18767         and try to implement.
18768
18769         * ../errors/cs0150.cs : Add.
18770
18771         * ../errors/cs0178.cs : Add.
18772
18773 2001-11-16  Miguel de Icaza  <miguel@ximian.com>
18774
18775         * statement.cs: Implement foreach on multi-dimensional arrays. 
18776
18777         * parameter.cs (Parameters.GetParameterByName): Also lookup the
18778         name of the params argument.
18779
18780         * expression.cs: Use EmitStoreOpcode to get the right opcode while
18781         initializing the array.
18782
18783         (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
18784         we can use this elsewhere.
18785
18786         * statement.cs: Finish implementation of foreach for single
18787         dimension arrays.
18788
18789         * cs-parser.jay: Use an out-of-band stack to pass information
18790         around, I wonder why I need this.
18791
18792         foreach_block: Make the new foreach_block the current_block.
18793
18794         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
18795         function used to return a static Parameters structure.  Used for
18796         empty parameters, as those are created very frequently.
18797
18798         * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
18799
18800 2001-11-15  Ravi Pratap  <ravi@ximian.com>
18801
18802         * interface.cs : Default modifier is private, not public. The
18803         make verify test passes again.
18804
18805 2001-11-15  Ravi Pratap  <ravi@ximian.com>
18806
18807         * support.cs (ReflectionParameters): Fix logic to determine
18808         whether the last parameter is a params one. Test 9 passes again.
18809
18810         * delegate.cs (Populate): Register the builders we define with
18811         RegisterParameterForBuilder. Test 19 passes again.
18812
18813         * cs-parser.jay (property_declaration): Reference $6 instead
18814         of $$ to get at the location.
18815
18816         (indexer_declaration): Similar stuff.
18817
18818         (attribute): Ditto.
18819
18820         * class.cs (Property): Register parameters for the Get and Set methods
18821         if they exist. Test 23 passes again.
18822
18823         * expression.cs (ArrayCreation::Emit): Pass null for the method in the
18824         call to EmitArguments as we are sure there aren't any params arguments. 
18825         Test 32 passes again.
18826
18827         * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
18828         IndexOutOfRangeException. 
18829
18830         * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
18831         Test 33 now passes again.
18832
18833 2001-11-15  Miguel de Icaza  <miguel@ximian.com>
18834
18835         * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
18836         broke a bunch of things.  Will have to come up with a better way
18837         of tracking locations.
18838
18839         * statement.cs: Implemented foreach for single dimension arrays.
18840
18841 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
18842
18843         * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
18844         an error.  This removes the lookup from the critical path.
18845
18846         * cs-parser.jay: Removed use of temporary_loc, which is completely
18847         broken. 
18848
18849 2001-11-14  Miguel de Icaza  <miguel@ximian.com>
18850
18851         * support.cs (ReflectionParameters.ParameterModifier): Report
18852         whether the argument is a PARAMS argument or not.
18853
18854         * class.cs: Set the attribute `ParamArrayAttribute' on the
18855         parameter argument.
18856
18857         * typemanager.cs: Define param_array_type (ParamArrayAttribute)
18858         and cons_param_array_attribute (ConstructorInfo for
18859         ParamArrayAttribute)., 
18860
18861         * codegen.cs: Emit the return using the `Return' statement, that
18862         way we can report the error correctly for missing return values. 
18863
18864         * class.cs (Method.Emit): Clean up.
18865
18866         * expression.cs (Argument.Resolve): Take another argument: the
18867         location where this argument is used.  Notice that this is not
18868         part of the "Argument" class as to reduce the size of the
18869         structure (we know the approximate location anyways).
18870
18871         Test if the argument is a variable-reference, if not, then
18872         complain with a 206.
18873
18874         (Argument.Emit): Emit addresses of variables.
18875
18876         (Argument.FullDesc): Simplify.
18877
18878         (Invocation.DoResolve): Update for Argument.Resolve.
18879
18880         (ElementAccess.DoResolve): ditto.
18881
18882         * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
18883         method should be virtual, as this method is always virtual.
18884
18885         (NewDelegate.DoResolve): Update for Argument.Resolve.
18886
18887         * class.cs (ConstructorInitializer.DoResolve): ditto.
18888
18889         * attribute.cs (Attribute.Resolve): ditto.
18890
18891 2001-11-13  Miguel de Icaza  <miguel@ximian.com>
18892
18893         * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
18894
18895         * expression.cs (ParameterReference): Drop IStackStorage and implement
18896         IAssignMethod instead. 
18897
18898         (LocalVariableReference): ditto.
18899
18900         * ecore.cs (FieldExpr): Drop IStackStorage and implement
18901         IAssignMethod instead. 
18902
18903 2001-11-13  Miguel de Icaza <miguel@ximian.com>
18904
18905         * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
18906         enumerations that are used in heavily used structures derive from
18907         byte in a laughable and pathetic attempt to reduce memory usage.
18908         This is the kind of pre-optimzations that you should not do at
18909         home without adult supervision.
18910
18911         * expression.cs (UnaryMutator): New class, used to handle ++ and
18912         -- separatedly from the other unary operators.  Cleans up the
18913         code, and kills the ExpressionStatement dependency in Unary.
18914
18915         (Unary): Removed `method' and `Arguments' from this class, making
18916         it smaller, and moving it all to SimpleCall, so I can reuse this
18917         code in other locations and avoid creating a lot of transient data
18918         strucutres when not required.
18919
18920         * cs-parser.jay: Adjust for new changes.
18921
18922 2001-11-11  Miguel de Icaza  <miguel@ximian.com>
18923
18924         * enum.cs (Enum.Populate): If there is a failure during
18925         definition, return
18926
18927         * cs-parser.jay (opt_enum_base): we used to catch type errors
18928         here, but this is really incorrect.  The type error should be
18929         catched during semantic analysis.
18930
18931 2001-12-11  Ravi Pratap  <ravi@ximian.com>
18932
18933         * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
18934         current_local_parameters as expected since I, in my stupidity, had forgotten
18935         to do this :-)
18936
18937         * attribute.cs (GetValidPlaces): Fix stupid bug.
18938
18939         * class.cs (Method::Emit): Perform check on applicability of attributes.
18940
18941         (Constructor::Emit): Ditto.
18942
18943         (Field::Emit): Ditto.
18944
18945         (Field.Location): Store location information.
18946
18947         (Property, Event, Indexer, Operator): Ditto.
18948
18949         * cs-parser.jay (field_declaration): Pass in location for each field.
18950
18951         * ../errors/cs0592.cs : Add.
18952
18953 2001-11-12  Ravi Pratap  <ravi@ximian.com>
18954
18955         * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
18956
18957         (InitCoreTypes): Update accordingly.
18958
18959         (RegisterAttrType, LookupAttr): Implement.
18960
18961         * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
18962         info about the same.
18963
18964         (Resolve): Update to populate the above as necessary.
18965
18966         (Error592): Helper.
18967
18968         (GetValidPlaces): Helper to the above.
18969
18970         (CheckAttribute): Implement to perform validity of attributes on declarative elements.
18971
18972         * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
18973
18974 2001-11-12  Ravi Pratap  <ravi@ximian.com>
18975
18976         * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
18977
18978         * ../errors/cs0617.cs : Add.
18979
18980 2001-11-11  Ravi Pratap  <ravi@ximian.com>
18981
18982         * enum.cs (Emit): Rename to Populate to be more consistent with what
18983         we expect it to do and when exactly it is called.
18984
18985         * class.cs, rootcontext.cs : Update accordingly.
18986
18987         * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
18988         FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
18989
18990         * enum.cs (Populate): Register fields with TypeManager.RegisterField.
18991
18992         * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
18993         of a fieldinfo using the above, when dealing with a FieldBuilder.
18994
18995 2001-11-10  Ravi Pratap  <ravi@ximian.com>
18996
18997         * ../errors/cs0031.cs : Add.
18998
18999         * ../errors/cs1008.cs : Add.
19000
19001         * ../errrors/cs0543.cs : Add.
19002
19003         * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
19004         enum type.
19005
19006         (FindMembers): Implement.
19007
19008         * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
19009         enums and delegates too.
19010
19011         (enum_types): Rename to builder_to_enum.
19012
19013         (delegate_types): Rename to builder_to_delegate.
19014
19015         * delegate.cs (FindMembers): Implement.
19016
19017 2001-11-09  Ravi Pratap  <ravi@ximian.com>
19018
19019         * typemanager.cs (IsEnumType): Implement.
19020
19021         * enum.cs (Emit): Re-write parts to account for the underlying type
19022         better and perform checking etc.
19023
19024         (GetNextDefaultValue): Helper to ensure we don't overshoot max value
19025         of the underlying type.
19026
19027         * literal.cs (GetValue methods everywhere): Perform bounds checking and return
19028         value
19029
19030         * enum.cs (error31): Helper to report error #31.
19031
19032         * cs-parser.jay (enum_declaration): Store location of each member too.
19033
19034         * enum.cs (member_to_location): New hashtable. 
19035
19036         (AddEnumMember): Update location hashtable.
19037
19038         (Emit): Use the location of each member while reporting errors.
19039
19040 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
19041
19042         * cs-parser.jay: A for_initializer if is a
19043         local_variable_declaration really ammount to have an implicit
19044         block with the variable declaration and no initializer for for.
19045
19046         * statement.cs (For.Emit): Cope with null initializers.
19047
19048         This fixes the infinite loop on for initializers.
19049
19050 2001-11-08  Miguel de Icaza  <miguel@ximian.com>
19051
19052         * enum.cs: More cleanup.
19053
19054         * ecore.cs: Remove dead code.
19055
19056         * class.cs (Property.Emit): More simplification.
19057         (Event.Emit): ditto.
19058
19059         Reworked to have less levels of indentation.
19060
19061 2001-11-08  Ravi Pratap  <ravi@ximian.com>
19062
19063         * class.cs (Property): Emit attributes.
19064
19065         (Field): Ditto.
19066
19067         (Event): Ditto.
19068
19069         (Indexer): Ditto.
19070
19071         (Operator): Ditto.
19072
19073         * enum.cs (Emit): Ditto.
19074
19075         * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
19076         Enums too.
19077
19078         * class.cs (Field, Event, etc.): Move attribute generation into the
19079         Emit method everywhere.
19080
19081         * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
19082         we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
19083         as we had no way of defining nested enums !
19084
19085         * rootcontext.cs : Adjust code accordingly.
19086
19087         * typemanager.cs (AddEnumType): To keep track of enum types separately.
19088
19089 2001-11-07  Ravi Pratap  <ravi@ximian.com>
19090
19091         * expression.cs (EvalConstantExpression): Move into ecore.cs
19092
19093         * enum.cs (Enum): Rename some members and make them public and readonly
19094         according to our convention.
19095
19096         * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
19097         nothing else.
19098
19099         * enum.cs (Enum::Define): Use the above instead of TypeAttr.
19100
19101         (Enum::Emit): Write a simple version for now which doesn't try to compute
19102         expressions. I shall modify this to be more robust in just a while.
19103
19104         * class.cs (TypeContainer::Emit): Make sure we include Enums too.
19105
19106         (TypeContainer::CloseType): Create the Enum types too.
19107
19108         * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
19109
19110         * expression.cs (EvalConstantExpression): Get rid of completely.
19111
19112         * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
19113         user-defined values and other cases.
19114
19115         (IsValidEnumLiteral): Helper function.
19116
19117         * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing 
19118         out there in the case we had a literal FieldExpr.
19119
19120         (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
19121
19122         (Literalize): Revamp a bit to take two arguments.
19123
19124         (EnumLiteral): New class which derives from Literal to wrap enum literals.
19125
19126 2001-11-06  Ravi Pratap  <ravi@ximian.com>
19127
19128         * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
19129
19130         * expression.cs (ArrayCreation::ValidateInitializers): Implement.
19131
19132         (Resolve): Use the above to ensure we have proper initializers.
19133
19134 2001-11-05  Ravi Pratap  <ravi@ximian.com>
19135
19136         * expression.cs (Expression::EvalConstantExpression): New method to 
19137         evaluate constant expressions.
19138
19139         * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
19140
19141 2001-11-07  Miguel de Icaza  <miguel@ximian.com>
19142
19143         * expression.cs (ArrayCreation.Emit): Some bits to initialize data
19144         in an array.
19145
19146         (Binary.ResolveOperator): Handle operator != (object a, object b)
19147         and operator == (object a, object b);
19148
19149         (Binary.DoNumericPromotions): Indicate whether the numeric
19150         promotion was possible.
19151
19152         (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
19153         Implement.  
19154
19155         Made the ArrayAccess implement interface IAssignMethod instead of
19156         IStackStore as the order in which arguments are passed reflects
19157         this.
19158
19159         * assign.cs: Instead of using expr.ExprClass to select the way of
19160         assinging, probe for the IStackStore/IAssignMethod interfaces.
19161
19162         * typemanager.cs: Load InitializeArray definition.
19163
19164         * rootcontext.cs (RootContext.MakeStaticData): Used to define
19165         static data that can be used to initialize arrays. 
19166
19167 2001-11-05  Miguel de Icaza  <miguel@ximian.com>
19168
19169         * expression.cs: Handle operator== and operator!= for booleans.
19170
19171         (Conditioal.Reduce): Implement reducer for the ?: operator.
19172
19173         (Conditional.Resolve): Implement dead code elimination.
19174
19175         (Binary.Resolve): Catch string literals and return a new
19176         concatenated string.
19177
19178         (Unary.Reduce): Implement reduction of unary expressions.
19179
19180         * ecore.cs: Split out the expression core handling here.
19181
19182         (Expression.Reduce): New method used to perform constant folding
19183         and CSE.  This is needed to support constant-expressions. 
19184
19185         * statement.cs (Statement.EmitBoolExpression): Pass true and false
19186         targets, and optimize for !x.
19187
19188 2001-11-04  Ravi Pratap  <ravi@ximian.com>
19189
19190         * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
19191         of an attribute gives us a CustomAttributeBuilder which we use accordingly to
19192         set custom atttributes.
19193
19194         * literal.cs (Literal::GetValue): New abstract method to return the actual
19195         value of the literal, cast as an object.
19196
19197         (*Literal): Implement GetValue method.
19198
19199         * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
19200         expressions to the arraylist but objects of type Argument.
19201
19202         * class.cs (TypeContainer::Emit): Emit our attributes too.
19203
19204         (Method::Emit, Constructor::Emit): Ditto.
19205
19206         * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
19207         to be ignoring earlier.
19208
19209 2001-11-03  Ravi Pratap  <ravi@ximian.com>
19210
19211         * attribute.cs (AttributeSection::Define): Implement to do the business
19212         of constructing a CustomAttributeBuilder.
19213
19214         (Attribute): New trivial class. Increases readability of code.  
19215
19216         * cs-parser.jay : Update accordingly.
19217
19218         (positional_argument_list, named_argument_list, named_argument): New rules
19219
19220         (attribute_arguments): Use the above so that we are more correct.
19221
19222 2001-11-02  Ravi Pratap  <ravi@ximian.com>
19223
19224         * expression.cs (Invocation::IsParamsMethodApplicable): Implement
19225         to perform all checks for a method with a params parameter.
19226
19227         (Invocation::OverloadResolve): Update to use the above method and therefore
19228         cope correctly with params method invocations.
19229
19230         * support.cs (InternalParameters::ParameterDesc): Provide a desc for 
19231         params too.
19232
19233         * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
19234         constructors in our parent too because we can't afford to miss out on 
19235         protected ones ;-)
19236
19237         * attribute.cs (AttributeSection): New name for the class Attribute
19238
19239         Other trivial changes to improve readability.
19240
19241         * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
19242         use the new class names.
19243
19244 2001-11-01  Ravi Pratap  <ravi@ximian.com>
19245
19246         * class.cs (Method::Define): Complete definition for params types too
19247
19248         (Indexer::Define): Ditto.
19249
19250         * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
19251         Cope everywhere with a request for info about the array parameter.
19252
19253 2001-11-01  Ravi Pratap  <ravi@ximian.com>
19254
19255         * tree.cs (RecordNamespace): Fix up to check for the correct key.
19256
19257         * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in 
19258         local_variable_type to extract the string corresponding to the type.
19259
19260         (local_variable_type): Fixup the action to use the new helper method.
19261
19262         * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to 
19263         go.
19264
19265         * expression.cs : Clean out code which uses the above.
19266
19267 2001-10-31  Ravi Pratap  <ravi@ximian.com>
19268
19269         * typemanager.cs (RegisterMethod): Check if we already have an existing key
19270         and bale out if necessary by returning a false.
19271
19272         (RegisterProperty): Ditto.
19273
19274         * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
19275         and print out appropriate error messages.
19276
19277         * interface.cs (everywhere): Ditto.
19278
19279         * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
19280         location to constructor.
19281
19282         * class.cs (Property, Event, Indexer): Update accordingly.
19283
19284         * ../errors/cs111.cs : Added.
19285
19286         * expression.cs (Invocation::IsApplicable): New static method to determine applicability
19287         of a method, as laid down by the spec.
19288
19289         (Invocation::OverloadResolve): Use the above method.
19290
19291 2001-10-31  Ravi Pratap  <ravi@ximian.com>
19292
19293         * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
19294         now take a TypeContainer and a Parameters object.
19295
19296         (ParameterData): Modify return type of ParameterModifier method to be 
19297         Parameter.Modifier and not a string.
19298
19299         (ReflectionParameters, InternalParameters): Update accordingly.
19300
19301         * expression.cs (Argument::GetParameterModifier): Same here.
19302
19303         * support.cs (InternalParameters::ParameterType): Find a better way of determining
19304         if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
19305         symbol in it at all so maybe this is only for now.
19306
19307 2001-10-30  Ravi Pratap  <ravi@ximian.com>
19308
19309         * support.cs (InternalParameters): Constructor now takes an extra argument 
19310         which is the actual Parameters class.
19311
19312         (ParameterDesc): Update to provide info on ref/out modifiers.
19313
19314         * class.cs (everywhere): Update call to InternalParameters to pass in
19315         the second argument too.
19316
19317         * support.cs (ParameterData): Add ParameterModifier, which is a method 
19318         to return the modifier info [ref/out etc]
19319
19320         (InternalParameters, ReflectionParameters): Implement the above.
19321
19322         * expression.cs (Argument::ParameterModifier): Similar function to return
19323         info about the argument's modifiers.
19324
19325         (Invocation::OverloadResolve): Update to take into account matching modifiers 
19326         too.
19327
19328         * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
19329         a new SetFormalParameters object which we pass to InternalParameters.
19330
19331 2001-10-30  Ravi Pratap  <ravi@ximian.com>
19332
19333         * expression.cs (NewArray): Merge into the ArrayCreation class.
19334
19335 2001-10-29  Ravi Pratap  <ravi@ximian.com>
19336
19337         * expression.cs (NewArray): Merge classes NewBuiltinArray and 
19338         NewUserdefinedArray into one as there wasn't much of a use in having
19339         two separate ones.
19340
19341         * expression.cs (Argument): Change field's name to ArgType from Type.
19342
19343         (Type): New readonly property which returns the proper type, taking into 
19344         account ref/out modifiers.
19345
19346         (everywhere): Adjust code accordingly for the above.
19347
19348         * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
19349         whether we are emitting for a ref or out parameter.
19350
19351         * expression.cs (Argument::Emit): Use the above field to set the state.
19352
19353         (LocalVariableReference::Emit): Update to honour the flag and emit the
19354         right stuff.
19355
19356         * parameter.cs (Attributes): Set the correct flags for ref parameters.
19357
19358         * expression.cs (Argument::FullDesc): New function to provide a full desc.
19359
19360         * support.cs (ParameterData): Add method ParameterDesc to the interface.
19361
19362         (ReflectionParameters, InternalParameters): Implement the above method.
19363
19364         * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
19365         reporting errors.
19366
19367         (Invocation::FullMethodDesc): Ditto. 
19368
19369 2001-10-29  Miguel de Icaza  <miguel@ximian.com>
19370
19371         * cs-parser.jay: Add extra production for the second form of array
19372         creation. 
19373
19374         * expression.cs (ArrayCreation): Update to reflect the above
19375         change. 
19376
19377         * Small changes to prepare for Array initialization.
19378
19379 2001-10-28  Miguel de Icaza  <miguel@ximian.com>
19380
19381         * typemanager.cs (ImplementsInterface): interface might be null;
19382         Deal with this problem;
19383
19384         Also, we do store negative hits on the cache (null values), so use
19385         this instead of calling t.GetInterfaces on the type everytime.
19386
19387 2001-10-28  Ravi Pratap  <ravi@ximian.com>
19388
19389         * typemanager.cs (IsBuiltinType): New method to help determine the same.
19390
19391         * expression.cs (New::DoResolve): Get rid of array creation code and instead
19392         split functionality out into different classes.
19393
19394         (New::FormArrayType): Move into NewBuiltinArray.
19395
19396         (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
19397         quite useless.
19398
19399         (NewBuiltinArray): New class to handle creation of built-in arrays.
19400
19401         (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
19402         account creation of one-dimensional arrays.
19403
19404         (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
19405
19406         (NewUserdefinedArray::DoResolve): Implement.
19407
19408         * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
19409
19410         * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
19411         we maintain inside the TypeManager. This is necessary to perform lookups on the
19412         module builder.
19413
19414         (LookupType): Update to perform GetType on the module builders too.     
19415
19416         * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
19417
19418         * exprssion.cs (NewUserdefinedArray::Emit): Implement.
19419
19420 2001-10-23  Ravi Pratap  <ravi@ximian.com>
19421
19422         * expression.cs (New::DoResolve): Implement guts of array creation.
19423
19424         (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
19425
19426 2001-10-27  Miguel de Icaza  <miguel@ximian.com>
19427
19428         * expression.cs: Fix bug I introduced lsat night that broke
19429         Delegates. 
19430
19431         (Expression.Resolve): Report a 246 error (can not resolve name)
19432         if we find a SimpleName in the stream.
19433
19434         (Expression.ResolveLValue): Ditto.
19435
19436         (Expression.ResolveWithSimpleName): This function is a variant of
19437         ResolveName, this one allows SimpleNames to be returned without a
19438         warning.  The only consumer of SimpleNames is MemberAccess
19439
19440 2001-10-26  Miguel de Icaza  <miguel@ximian.com>
19441
19442         * expression.cs (Invocation::DoResolve): Catch SimpleNames that
19443         might arrive here.  I have my doubts that this is correct.
19444
19445         * statement.cs (Lock): Implement lock statement.
19446
19447         * cs-parser.jay: Small fixes to support `lock' and `using'
19448
19449         * cs-tokenizer.cs: Remove extra space
19450
19451         * driver.cs: New flag --checked, allows to turn on integer math
19452         checking. 
19453
19454         * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
19455         Threading.Monitor.Exit 
19456
19457 2001-10-23  Miguel de Icaza  <miguel@ximian.com>
19458
19459         * expression.cs (IndexerAccess::DoResolveLValue): Set the
19460         Expression Class to be IndexerAccess.
19461
19462         Notice that Indexer::DoResolve sets the eclass to Value.
19463
19464 2001-10-22  Miguel de Icaza  <miguel@ximian.com>
19465
19466         * class.cs (TypeContainer::Emit): Emit code for indexers.
19467
19468         * assign.cs (IAssignMethod): New interface implemented by Indexers
19469         and Properties for handling assignment.
19470
19471         (Assign::Emit): Simplify and reuse code. 
19472
19473         * expression.cs (IndexerAccess, PropertyExpr): Implement
19474         IAssignMethod, clean up old code. 
19475
19476 2001-10-22  Ravi Pratap  <ravi@ximian.com>
19477
19478         * typemanager.cs (ImplementsInterface): New method to determine if a type
19479         implements a given interface. Provides a nice cache too.
19480
19481         * expression.cs (ImplicitReferenceConversion): Update checks to use the above
19482         method.
19483
19484         (ConvertReferenceExplicit): Ditto.
19485
19486         * delegate.cs (Delegate::Populate): Update to define the parameters on the 
19487         various methods, with correct names etc.
19488
19489         * class.cs (Operator::OpType): New members Operator.UnaryPlus and 
19490         Operator.UnaryNegation.
19491
19492         * cs-parser.jay (operator_declarator): Be a little clever in the case where
19493         we have a unary plus or minus operator.
19494
19495         * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and 
19496         UnaryMinus.
19497
19498         * everywhere : update accordingly.
19499
19500         * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
19501         respectively.
19502
19503         * class.cs (Method::Define): For the case where we are implementing a method
19504         inherited from an interface, we need to set the MethodAttributes.Final flag too. 
19505         Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
19506
19507 2001-10-21  Ravi Pratap  <ravi@ximian.com>
19508
19509         * interface.cs (FindMembers): Implement to work around S.R.E
19510         lameness.
19511
19512         * typemanager.cs (IsInterfaceType): Implement.
19513
19514         (FindMembers): Update to handle interface types too.
19515
19516         * expression.cs (ImplicitReferenceConversion): Re-write bits which
19517         use IsAssignableFrom as that is not correct - it doesn't work.
19518
19519         * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
19520         and accordingly override EmitStatement.
19521
19522         * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
19523         using the correct logic :-)
19524
19525 2001-10-19  Ravi Pratap  <ravi@ximian.com>
19526
19527         * ../errors/cs-11.cs : Add to demonstrate error -11 
19528
19529 2001-10-17  Miguel de Icaza  <miguel@ximian.com>
19530
19531         * assign.cs (Assign::Resolve): Resolve right hand side first, and
19532         then pass this as a hint to ResolveLValue.
19533
19534         * expression.cs (FieldExpr): Add Location information
19535
19536         (FieldExpr::LValueResolve): Report assignment to readonly
19537         variable. 
19538
19539         (Expression::ExprClassFromMemberInfo): Pass location information.
19540
19541         (Expression::ResolveLValue): Add new method that resolves an
19542         LValue. 
19543
19544         (Expression::DoResolveLValue): Default invocation calls
19545         DoResolve. 
19546
19547         (Indexers): New class used to keep track of indexers in a given
19548         Type. 
19549
19550         (IStackStore): Renamed from LValue, as it did not really describe
19551         what this did.  Also ResolveLValue is gone from this interface and
19552         now is part of Expression.
19553
19554         (ElementAccess): Depending on the element access type
19555
19556         * typemanager.cs: Add `indexer_name_type' as a Core type
19557         (System.Runtime.CompilerServices.IndexerNameAttribute)
19558
19559         * statement.cs (Goto): Take a location.
19560
19561 2001-10-18  Ravi Pratap  <ravi@ximian.com>
19562
19563         * delegate.cs (Delegate::VerifyDelegate): New method to verify
19564         if two delegates are compatible.
19565
19566         (NewDelegate::DoResolve): Update to take care of the case when
19567         we instantiate a delegate from another delegate.
19568
19569         * typemanager.cs (FindMembers): Don't even try to look up members
19570         of Delegate types for now.
19571
19572 2001-10-18  Ravi Pratap  <ravi@ximian.com>
19573
19574         * delegate.cs (NewDelegate): New class to take care of delegate
19575         instantiation.
19576
19577         * expression.cs (New): Split the delegate related code out into 
19578         the NewDelegate class.
19579
19580         * delegate.cs (DelegateInvocation): New class to handle delegate 
19581         invocation.
19582
19583         * expression.cs (Invocation): Split out delegate related code into
19584         the DelegateInvocation class.
19585
19586 2001-10-17  Ravi Pratap  <ravi@ximian.com>
19587
19588         * expression.cs (New::DoResolve): Implement delegate creation fully
19589         and according to the spec.
19590
19591         (New::DoEmit): Update to handle delegates differently.
19592
19593         (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
19594         because of which we were printing out arguments in reverse order !
19595
19596         * delegate.cs (VerifyMethod): Implement to check if the given method
19597         matches the delegate.
19598
19599         (FullDelegateDesc): Implement.
19600
19601         (VerifyApplicability): Implement.
19602
19603         * expression.cs (Invocation::DoResolve): Update to accordingly handle
19604         delegate invocations too.
19605
19606         (Invocation::Emit): Ditto.
19607
19608         * ../errors/cs1593.cs : Added.
19609
19610         * ../errors/cs1594.cs : Added.
19611
19612         * delegate.cs (InstanceExpression, TargetMethod): New properties.
19613
19614 2001-10-16  Ravi Pratap  <ravi@ximian.com>
19615
19616         * typemanager.cs (intptr_type): Core type for System.IntPtr
19617
19618         (InitCoreTypes): Update for the same.
19619
19620         (iasyncresult_type, asynccallback_type): Ditto.
19621
19622         * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
19623         correct.
19624
19625         * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
19626         too.
19627
19628         * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
19629         the builders for the 4 members of a delegate type :-)
19630
19631         (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
19632         type.
19633
19634         * expression.cs (New::DoResolve): Implement guts for delegate creation.
19635
19636         * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
19637
19638 2001-10-15  Miguel de Icaza  <miguel@ximian.com>
19639
19640         * statement.cs (Break::Emit): Implement.   
19641         (Continue::Emit): Implement.
19642
19643         (For::Emit): Track old being/end loops;  Set Begin loop, ack end loop
19644         (While::Emit): Track old being/end loops;  Set Begin loop, ack end loop
19645         (Do::Emit): Track old being/end loops;  Set Begin loop, ack end loop
19646         (Foreach::Emit): Track old being/end loops;  Set Begin loop, ack
19647         end loop
19648
19649         * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
19650         properties that track the label for the current loop (begin of the
19651         loop and end of the loop).
19652
19653 2001-10-15  Ravi Pratap  <ravi@ximian.com>
19654
19655         * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
19656         use of emitting anything at all.
19657
19658         * class.cs, rootcontext.cs : Get rid of calls to the same.
19659
19660         * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
19661
19662         (Populate): Define the constructor correctly and set the implementation
19663         attributes.
19664
19665         * typemanager.cs (delegate_types): New hashtable to hold delegates that
19666         have been defined.
19667
19668         (AddDelegateType): Implement.
19669
19670         (IsDelegateType): Implement helper method.
19671
19672         * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
19673
19674         * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
19675         and accordingly handle it.
19676
19677         * delegate.cs (Populate): Take TypeContainer argument.
19678         Implement bits to define the Invoke method. However, I still haven't figured out
19679         how to take care of the native int bit :-(
19680
19681         * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-) 
19682         Qualify the name of the delegate, not its return type !
19683
19684         * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
19685         conversion.
19686
19687         (StandardConversionExists): Checking for array types turns out to be recursive.
19688
19689         (ConvertReferenceExplicit): Implement array conversion.
19690
19691         (ExplicitReferenceConversionExists): New method to determine precisely that :-)
19692
19693 2001-10-12  Ravi Pratap  <ravi@ximian.com>
19694
19695         * cs-parser.jay (delegate_declaration): Store the fully qualified
19696         name as it is a type declaration.
19697
19698         * delegate.cs (ReturnType, Name): Rename members to these. Make them 
19699         readonly.
19700
19701         (DefineDelegate): Renamed from Define. Does the same thing essentially,
19702         as TypeContainer::DefineType.
19703
19704         (Populate): Method in which all the definition of the various methods (Invoke)
19705         etc is done.
19706
19707         (Emit): Emit any code, if necessary. I am not sure about this really, but let's
19708         see.
19709
19710         (CloseDelegate): Finally creates the delegate.
19711
19712         * class.cs (TypeContainer::DefineType): Update to define delegates.
19713         (Populate, Emit and CloseType): Do the same thing here too.
19714
19715         * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
19716         delegates in all these operations.
19717
19718 2001-10-14  Miguel de Icaza  <miguel@ximian.com>
19719
19720         * expression.cs: LocalTemporary: a new expression used to
19721         reference a temporary that has been created.
19722
19723         * assign.cs: Handle PropertyAccess back here, so that we can
19724         provide the proper semantic access to properties.
19725
19726         * expression.cs (Expression::ConvertReferenceExplicit): Implement
19727         a few more explicit conversions. 
19728
19729         * modifiers.cs: `NEW' modifier maps to HideBySig.
19730
19731         * expression.cs (PropertyExpr): Make this into an
19732         ExpressionStatement, and support the EmitStatement code path. 
19733
19734         Perform get/set error checking, clean up the interface.
19735
19736         * assign.cs: recognize PropertyExprs as targets, and if so, turn
19737         them into toplevel access objects.
19738
19739 2001-10-12  Miguel de Icaza  <miguel@ximian.com>
19740
19741         * expression.cs: PropertyExpr::PropertyExpr: use work around the
19742         SRE.
19743
19744         * typemanager.cs: Keep track here of our PropertyBuilders again to
19745         work around lameness in SRE.
19746
19747 2001-10-11  Miguel de Icaza  <miguel@ximian.com>
19748
19749         * expression.cs (LValue::LValueResolve): New method in the
19750         interface, used to perform a second resolution pass for LValues. 
19751
19752         (This::DoResolve): Catch the use of this in static methods.
19753
19754         (This::LValueResolve): Implement.
19755
19756         (This::Store): Remove warning, assigning to `this' in structures
19757         is 
19758
19759         (Invocation::Emit): Deal with invocation of
19760         methods on value types.  We need to pass the address to structure
19761         methods rather than the object itself.  (The equivalent code to
19762         emit "this" for structures leaves the entire structure on the
19763         stack instead of a pointer to it). 
19764
19765         (ParameterReference::DoResolve): Compute the real index for the
19766         argument based on whether the method takes or not a `this' pointer
19767         (ie, the method is static).
19768
19769         * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
19770         value types returned from functions when we need to invoke a
19771         method on the sturcture.
19772
19773
19774 2001-10-11  Ravi Pratap  <ravi@ximian.com>
19775
19776         * class.cs (TypeContainer::DefineType): Method to actually do the business of
19777         defining the type in the Modulebuilder or Typebuilder. This is to take
19778         care of nested types which need to be defined on the TypeBuilder using
19779         DefineNestedMethod.
19780
19781         (TypeContainer::GetClassBases): Implement. Essentially the code from the 
19782         methods in RootContext, only ported to be part of TypeContainer.
19783
19784         (TypeContainer::GetInterfaceOrClass): Ditto.
19785
19786         (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
19787
19788         * interface.cs (Interface::DefineInterface): New method. Does exactly
19789         what RootContext.CreateInterface did earlier, only it takes care of nested types 
19790         too.
19791
19792         (Interface::GetInterfaces): Move from RootContext here and port.
19793
19794         (Interface::GetInterfaceByName): Same here.
19795
19796         * rootcontext.cs (ResolveTree): Re-write.
19797
19798         (PopulateTypes): Re-write.
19799
19800         * class.cs (TypeContainer::Populate): Populate nested types too.
19801         (TypeContainer::Emit): Emit nested members too.
19802
19803         * typemanager.cs (AddUserType): Do not make use of the FullName property,
19804         instead just use the name argument passed in as it is already fully
19805         qualified.
19806
19807         (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
19808         to TypeContainer mapping to see if a type is user-defined.
19809
19810         * class.cs (TypeContainer::CloseType): Implement. 
19811
19812         (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
19813         the default constructor.
19814
19815         (TypeContainer::Populate): Fix minor bug which led to creating default constructors
19816         twice.
19817
19818         (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
19819
19820         * interface.cs (CloseType): Create the type here.
19821
19822         * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
19823         the hierarchy.
19824
19825         Remove all the methods which are now in TypeContainer.
19826
19827 2001-10-10  Ravi Pratap  <ravi@ximian.com>
19828
19829         * delegate.cs (Define): Re-write bits to define the delegate
19830         correctly.
19831
19832 2001-10-10  Miguel de Icaza  <miguel@ximian.com>
19833
19834         * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
19835
19836         * expression.cs (ImplicitReferenceConversion): handle null as well
19837         as a source to convert to any reference type.
19838
19839         * statement.cs (Return): Perform any implicit conversions to
19840         expected return type.  
19841
19842         Validate use of return statement.  
19843
19844         * codegen.cs (EmitContext): Pass the expected return type here.
19845
19846         * class.cs (Method, Constructor, Property): Pass expected return
19847         type to EmitContext.
19848
19849 2001-10-09  Miguel de Icaza  <miguel@ximian.com>
19850
19851         * expression.cs: Make DoResolve take an EmitContext instead of a
19852         TypeContainer.
19853
19854         Replaced `l' and `location' for `loc', for consistency.
19855
19856         (Error, Warning): Remove unneeded Tc argument.
19857
19858         * assign.cs, literal.cs, constant.cs: Update to new calling
19859         convention. 
19860
19861         * codegen.cs: EmitContext now contains a flag indicating whether
19862         code is being generated in a static method or not.
19863
19864         * cs-parser.jay: DecomposeQI, new function that replaces the old
19865         QualifiedIdentifier.  Now we always decompose the assembled
19866         strings from qualified_identifier productions into a group of
19867         memberaccesses.
19868
19869 2001-10-08  Miguel de Icaza  <miguel@ximian.com>
19870
19871         * rootcontext.cs: Deal with field-less struct types correctly now
19872         by passing the size option to Define Type.
19873
19874         * class.cs: Removed hack that created one static field. 
19875
19876 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
19877
19878         * statement.cs: Moved most of the code generation here. 
19879
19880 2001-10-09  Ravi Pratap  <ravi@ximian.com>
19881
19882         * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
19883         seem very right.
19884
19885         (ElementAccess): Remove useless bits for now - keep checks as the spec
19886         says.
19887
19888 2001-10-08  Ravi Pratap  <ravi@ximian.com>
19889
19890         * expression.cs (ElementAccess::DoResolve): Remove my crap code
19891         and start performing checks according to the spec.
19892
19893 2001-10-07  Ravi Pratap  <ravi@ximian.com>
19894
19895         * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
19896         rank_specifiers instead.
19897
19898         (rank_specifiers): Change the order in which the rank specifiers are stored
19899
19900         (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
19901
19902         * expression.cs (ElementAccess): Implement the LValue interface too.
19903
19904 2001-10-06  Ravi Pratap  <ravi@ximian.com>
19905
19906         * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
19907         except that user defined conversions are not included.
19908
19909         (UserDefinedConversion): Update to use the ConvertExplicitStandard to 
19910         perform the conversion of the return type, if necessary.
19911
19912         (New::DoResolve): Check whether we are creating an array or an object
19913         and accordingly do the needful.
19914
19915         (New::Emit): Same here.
19916
19917         (New::DoResolve): Implement guts of array creation.
19918
19919         (New::FormLookupType): Helper function.
19920
19921 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
19922
19923         * codegen.cs: Removed most of the code generation here, and move the
19924         corresponding code generation bits to the statement classes. 
19925
19926         Added support for try/catch/finalize and throw.
19927
19928         * cs-parser.jay: Added support for try/catch/finalize.
19929
19930         * class.cs: Catch static methods having the flags override,
19931         virtual or abstract.
19932
19933         * expression.cs (UserCast): This user cast was not really doing
19934         what it was supposed to do.  Which is to be born in fully resolved
19935         state.  Parts of the resolution were being performed at Emit time! 
19936
19937         Fixed this code.
19938
19939 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
19940
19941         * expression.cs: Implicity convert the result from UserCast.
19942
19943 2001-10-05  Ravi Pratap  <ravi@ximian.com>
19944
19945         * expression.cs (Expression::FindMostEncompassingType): Fix bug which
19946         prevented it from working correctly. 
19947
19948         (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
19949         merely ConvertImplicit.
19950
19951 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
19952
19953         * typemanager.cs: Make the LookupTypeContainer function static,
19954         and not per-instance.  
19955
19956         * class.cs: Make static FindMembers (the one that takes a Type
19957         argument). 
19958
19959         * codegen.cs: Add EmitForeach here.
19960
19961         * cs-parser.jay: Make foreach a toplevel object instead of the
19962         inline expansion, as we need to perform semantic analysis on it. 
19963
19964 2001-10-05  Ravi Pratap  <ravi@ximian.com>
19965
19966         * expression.cs (Expression::ImplicitUserConversion): Rename to
19967         UserDefinedConversion.
19968
19969         (Expression::UserDefinedConversion): Take an extra argument specifying 
19970         whether we look for explicit user conversions too.
19971
19972         (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
19973
19974         (UserDefinedConversion): Incorporate support for user defined explicit conversions.
19975
19976         (ExplicitUserConversion): Make it a call to UserDefinedConversion
19977         with the appropriate arguments.
19978
19979         * cs-parser.jay (cast_expression): Record location too.
19980
19981         * expression.cs (Cast): Record location info.
19982
19983         (Expression::ConvertExplicit): Take location argument.
19984
19985         (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
19986         to determine if we are doing explicit conversions.
19987
19988         (UserCast::Emit): Update accordingly.
19989
19990         (Expression::ConvertExplicit): Report an error if everything fails.
19991
19992         * ../errors/cs0030.cs : Add.
19993
19994 2001-10-04  Miguel de Icaza  <miguel@ximian.com>
19995
19996         * modifiers.cs: If the ABSTRACT keyword is present, also set the
19997         virtual and newslot bits. 
19998
19999         * class.cs (TypeContainer::RegisterRequiredImplementations):
20000         Record methods we need.
20001
20002         (TypeContainer::MakeKey): Helper function to make keys for
20003         MethodBases, since the Methodbase key is useless.
20004
20005         (TypeContainer::Populate): Call RegisterRequiredImplementations
20006         before defining the methods.   
20007
20008         Create a mapping for method_builders_to_methods ahead of time
20009         instead of inside a tight loop.
20010
20011         (::RequireMethods):  Accept an object as the data to set into the
20012         hashtable so we can report interface vs abstract method mismatch.
20013
20014 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
20015
20016         * report.cs: Make all of it static.
20017
20018         * rootcontext.cs: Drop object_type and value_type computations, as
20019         we have those in the TypeManager anyways.
20020
20021         Drop report instance variable too, now it is a global.
20022
20023         * driver.cs: Use try/catch on command line handling.
20024
20025         Add --probe option to debug the error reporting system with a test
20026         suite. 
20027
20028         * report.cs: Add support for exiting program when a probe
20029         condition is reached.
20030
20031 2001-10-03  Ravi Pratap  <ravi@ximian.com>
20032
20033         * expression.cs (Binary::DoNumericPromotions): Fix the case when
20034         we do a forcible conversion regardless of type, to check if 
20035         ForceConversion returns a null.
20036
20037         (Binary::error19): Use location to report error.
20038
20039         (Unary::error23): Use location here too.
20040
20041         * ../errors/cs0019.cs : Check in.
20042
20043         * ../errors/cs0023.cs : Check in.
20044
20045         * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
20046         case of a non-null MethodInfo object with a length of 0 !
20047
20048         (Binary::ResolveOperator): Flag error if overload resolution fails to find
20049         an applicable member - according to the spec :-)
20050         Also fix logic to find members in base types.
20051
20052         (Unary::ResolveOperator): Same here.
20053
20054         (Unary::report23): Change name to error23 and make first argument a TypeContainer
20055         as I was getting thoroughly confused between this and error19 :-)
20056
20057         * expression.cs (Expression::ImplicitUserConversion): Re-write fully
20058         (::FindMostEncompassedType): Implement.
20059         (::FindMostEncompassingType): Implement.
20060         (::StandardConversionExists): Implement.
20061
20062         (UserImplicitCast): Re-vamp. We now need info about most specific
20063         source and target types so that we can do the necessary conversions.
20064
20065         (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
20066         mathematical union with no duplicates.
20067
20068 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
20069
20070         * rootcontext.cs (RootContext::PopulateTypes): Populate containers
20071         in order from base classes to child classes, so that we can in
20072         child classes look up in our parent for method names and
20073         attributes (required for handling abstract, virtual, new, override
20074         constructs: we need to instrospect our base class, and if we dont
20075         populate the classes in order, the introspection might be
20076         incorrect.  For example, a method could query its parent before
20077         the parent has any methods and would determine that the parent has
20078         no abstract methods (while it could have had them)).
20079
20080         (RootContext::CreateType): Record the order in which we define the
20081         classes.
20082
20083 2001-10-02  Miguel de Icaza  <miguel@ximian.com>
20084
20085         * class.cs (TypeContainer::Populate): Also method definitions can
20086         fail now, keep track of this.
20087
20088         (TypeContainer::FindMembers): Implement support for
20089         DeclaredOnly/noDeclaredOnly flag.
20090
20091         (Constructor::Emit) Return the ConstructorBuilder.
20092
20093         (Method::Emit) Return the MethodBuilder. 
20094         Check for abstract or virtual methods to be public.
20095
20096         * rootcontext.cs (RootContext::CreateType): Register all the
20097         abstract methods required for the class to be complete and the
20098         interface methods that must be implemented. 
20099
20100         * cs-parser.jay: Report error 501 (method requires body if it is
20101         not marked abstract or extern).
20102
20103         * expression.cs (TypeOf::Emit): Implement.
20104
20105         * typemanager.cs: runtime_handle_type, new global type.
20106
20107         * class.cs (Property::Emit): Generate code for properties.
20108
20109 2001-10-02  Ravi Pratap  <ravi@ximian.com>
20110
20111         * expression.cs (Unary::ResolveOperator): Find operators on base type
20112         too - we now conform exactly to the spec.
20113
20114         (Binary::ResolveOperator): Same here.
20115
20116         * class.cs (Operator::Define): Fix minor quirk in the tests.
20117
20118         * ../errors/cs0215.cs : Added.
20119
20120         * ../errors/cs0556.cs : Added.
20121
20122         * ../errors/cs0555.cs : Added.
20123
20124 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
20125
20126         * cs-tokenizer.cs: Reimplemented Location to be a struct with a
20127         single integer which is really efficient
20128
20129 2001-10-01  Ravi Pratap  <ravi@ximian.com>
20130
20131         *  expression.cs (Expression::ImplicitUserConversion): Use location
20132         even in the case when we are examining True operators.
20133  
20134         * class.cs (Operator::Define): Perform extensive checks to conform
20135         with the rules for operator overloading in the spec.
20136
20137         * expression.cs (Expression::ImplicitReferenceConversion): Implement
20138         some of the other conversions mentioned in the spec.
20139
20140         * typemanager.cs (array_type): New static member for the System.Array built-in
20141         type.
20142
20143         (cloneable_interface): For System.ICloneable interface.
20144
20145         * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
20146         we start resolving the tree and populating types.
20147
20148         * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
20149  
20150 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
20151
20152         * expression.cs (Expression::ExprClassFromMemberInfo,
20153         Expression::Literalize): Create literal expressions from
20154         FieldInfos which are literals.
20155
20156         (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
20157         type casts, because they were wrong.  The test suite in tests
20158         caught these ones.
20159
20160         (ImplicitNumericConversion): ushort to ulong requires a widening
20161         cast. 
20162
20163         Int32 constant to long requires widening cast as well.
20164
20165         * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
20166         for integers because the type on the stack is not i4.
20167
20168 2001-09-30  Miguel de Icaza  <miguel@ximian.com>
20169
20170         * expression.cs (report118): require location argument. 
20171
20172         * parameter.cs: Do not dereference potential null value.
20173
20174         * class.cs: Catch methods that lack the `new' keyword when
20175         overriding a name.  Report warnings when `new' is used without
20176         anything being there to override.
20177
20178         * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
20179
20180         * class.cs: Only add constructor to hashtable if it is non-null
20181         (as now constructors can fail on define).
20182
20183         (TypeManager, Class, Struct): Take location arguments.
20184
20185         Catch field instance initialization in structs as errors.
20186
20187         accepting_filter: a new filter for FindMembers that is static so
20188         that we dont create an instance per invocation.
20189
20190         (Constructor::Define): Catch errors where a struct constructor is
20191         parameterless 
20192
20193         * cs-parser.jay: Pass location information for various new
20194         constructs. 
20195
20196         * delegate.cs (Delegate): take a location argument.
20197
20198         * driver.cs: Do not call EmitCode if there were problesm in the
20199         Definition of the types, as many Builders wont be there. 
20200
20201         * decl.cs (Decl::Decl): Require a location argument.
20202
20203         * cs-tokenizer.cs: Handle properly hex constants that can not fit
20204         into integers, and find the most appropiate integer for it.
20205
20206         * literal.cs: Implement ULongLiteral.
20207
20208         * rootcontext.cs: Provide better information about the location of
20209         failure when CreateType fails.
20210
20211 2001-09-29  Miguel de Icaza  <miguel@ximian.com>
20212
20213         * rootcontext.cs (RootContext::PopulateTypes): Populates structs
20214         as well.
20215
20216         * expression.cs (Binary::CheckShiftArguments): Add missing type
20217         computation.
20218         (Binary::ResolveOperator): Add type to the logical and and logical
20219         or, Bitwise And/Or and Exclusive Or code paths, it was missing
20220         before.
20221
20222         (Binary::DoNumericPromotions): In the case where either argument
20223         is ulong (and most signed types combined with ulong cause an
20224         error) perform implicit integer constant conversions as well.
20225
20226 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
20227
20228         * expression.cs (UserImplicitCast): Method should always be
20229         non-null. 
20230         (Invocation::BetterConversion): Simplified test for IntLiteral.
20231
20232         (Expression::ImplicitNumericConversion): Split this routine out.
20233         Put the code that performs implicit constant integer conversions
20234         here. 
20235
20236         (Expression::Resolve): Become a wrapper around DoResolve so we can
20237         check eclass and type being set after resolve.
20238
20239         (Invocation::Badness): Remove this dead function
20240
20241         (Binary::ResolveOperator): Do not compute the expensive argumnets
20242         unless we have a union for it.
20243
20244         (Probe::Emit): Is needs to do an isinst and then
20245         compare against null.
20246
20247         (::CanConvert): Added Location argument.  If the Location argument
20248         is null (Location.Null), then we do not report errors.  This is
20249         used by the `probe' mechanism of the Explicit conversion.  We do
20250         not want to generate an error for something that the user
20251         explicitly requested to be casted.  But the pipeline for an
20252         explicit cast first tests for potential implicit casts.
20253
20254         So for now, if the Location is null, it means `Probe only' to
20255         avoid adding another argument.   Might have to revise this
20256         strategy later.
20257
20258         (ClassCast): New class used to type cast objects into arbitrary
20259         classes (used in Explicit Reference Conversions).
20260
20261         Implement `as' as well.
20262
20263         Reverted all the patches from Ravi below: they were broken:
20264
20265                 * The use of `level' as a mechanism to stop recursive
20266                   invocations is wrong.  That was there just to catch the
20267                   bug with a strack trace but not as a way of addressing
20268                   the problem.
20269
20270                   To fix the problem we have to *understand* what is going
20271                   on and the interactions and come up with a plan, not
20272                   just get things going.
20273
20274                 * The use of the type conversion cache that I proposed
20275                   last night had an open topic: How does this work across
20276                   protection domains.  A user defined conversion might not
20277                   be public in the location where we are applying the
20278                   conversion, a different conversion might be selected
20279                   (ie, private A->B (better) but public B->A (worse),
20280                   inside A, A->B applies, but outside it, B->A will
20281                   apply).
20282
20283                 * On top of that (ie, even if the above is solved),
20284                   conversions in a cache need to be abstract.  Ie, `To
20285                   convert from an Int to a Short use an OpcodeCast', not
20286                   `To convert from an Int to a Short use the OpcodeCast on
20287                   the variable 5' (which is what this patch was doing).
20288
20289 2001-09-28  Ravi Pratap  <ravi@ximian.com>
20290
20291         * expression.cs (Invocation::ConversionExists): Re-write to use
20292         the conversion cache
20293
20294         (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
20295         cache all conversions done, not just user-defined ones.
20296
20297         (Invocation::BetterConversion): The real culprit. Use ConversionExists
20298         to determine if a conversion exists instead of acutually trying to 
20299         perform the conversion. It's faster too.
20300
20301         (Expression::ConvertExplicit): Modify to use ConversionExists to check
20302         and only then attempt the implicit conversion.
20303
20304 2001-09-28  Ravi Pratap  <ravi@ximian.com>
20305
20306         * expression.cs (ConvertImplicit): Use a cache for conversions
20307         already found. Check level of recursion and bail out if necessary.
20308
20309 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
20310
20311         * typemanager.cs (string_concat_string_string, string_concat_object_object):
20312         Export standard methods that we expect for string operations.
20313
20314         * statement.cs (Block::UsageWarning): Track usage of variables and
20315         report the errors for not used variables.
20316
20317         * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
20318         operator. 
20319
20320 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
20321
20322         * codegen.cs: remove unnneded code 
20323
20324         * expression.cs: Removed BuiltinTypeAccess class
20325
20326         Fix the order in which implicit conversions are
20327         done.  
20328
20329         The previous fixed dropped support for boxed conversions (adding a
20330         test to the test suite now)
20331
20332         (UserImplicitCast::CanConvert): Remove test for source being null,
20333         that code is broken.  We should not feed a null to begin with, if
20334         we do, then we should track the bug where the problem originates
20335         and not try to cover it up here.
20336
20337         Return a resolved expression of type UserImplicitCast on success
20338         rather than true/false.  Ravi: this is what I was talking about,
20339         the pattern is to use a static method as a "constructor" for
20340         objects. 
20341
20342         Also, do not create arguments until the very last minute,
20343         otherwise we always create the arguments even for lookups that
20344         will never be performed. 
20345
20346         (UserImplicitCast::Resolve): Eliminate, objects of type
20347         UserImplicitCast are born in a fully resolved state. 
20348
20349         * typemanager.cs (InitCoreTypes): Init also value_type
20350         (System.ValueType). 
20351
20352         * expression.cs (Cast::Resolve): First resolve the child expression.
20353
20354         (LValue): Add new method AddressOf to be used by
20355         the `&' operator.  
20356
20357         Change the argument of Store to take an EmitContext instead of an
20358         ILGenerator, because things like FieldExpr need to be able to call
20359         their children expression to generate the instance code. 
20360
20361         (Expression::Error, Expression::Warning): Sugar functions for
20362         reporting errors.
20363
20364         (Expression::MemberLookup): Accept a TypeContainer instead of a
20365         Report as the first argument.
20366
20367         (Expression::ResolvePrimary): Killed.  I still want to improve
20368         this as currently the code is just not right.
20369
20370         (Expression::ResolveMemberAccess): Simplify, but it is still
20371         wrong. 
20372
20373         (Unary::Resolve): Catch errors in AddressOf operators.
20374
20375         (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
20376         index to a byte for the short-version, or the compiler will choose
20377         the wrong Emit call, which generates the wrong data.
20378
20379         (ParameterReference::Emit, ::Store): same.
20380
20381         (FieldExpr::AddressOf): Implement.
20382
20383         * typemanager.cs: TypeManager: made public variable instead of
20384         property.
20385
20386         * driver.cs: document --fatal.
20387
20388         * report.cs (ErrorMessage, WarningMessage): new names for the old
20389         Error and Warning classes.
20390
20391         * cs-parser.jay (member_access): Turn built-in access to types
20392         into a normal simplename
20393
20394 2001-09-27  Ravi Pratap  <ravi@ximian.com>
20395
20396         * expression.cs (Invocation::BetterConversion): Fix to cope
20397         with q being null, since this was introducing a bug.
20398
20399         * expression.cs (ConvertImplicit): Do built-in conversions first.
20400
20401 2001-09-27  Ravi Pratap  <ravi@ximian.com>
20402
20403         * expression.cs (UserImplicitCast::Resolve): Fix bug.
20404
20405 2001-09-27  Ravi Pratap  <ravi@ximian.com>
20406
20407         * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
20408         I had introduced long ago (what's new ?).
20409
20410         * expression.cs (UserImplicitCast::CanConvert): Static method to do 
20411         the work of all the checking. 
20412         (ConvertImplicit): Call CanConvert and only then create object if necessary.
20413         (UserImplicitCast::CanConvert, ::Resolve): Re-write.
20414
20415         (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
20416         that is the right way. 
20417
20418         (Invocation::MakeUnionSet): Convenience function to make unions of sets for 
20419         overloading resolution. Use everywhere instead of cutting and pasting code.
20420
20421         (Binary::ResolveOperator): Use MakeUnionSet.
20422
20423         (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when 
20424         we have to convert to bool types. Not complete yet.
20425
20426 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
20427
20428         * typemanager.cs (TypeManager::CSharpName): support ushort.
20429
20430         * expression.cs (Expression::TryImplicitIntConversion): Attempts
20431         to provide an expression that performsn an implicit constant int
20432         conversion (section 6.1.6).
20433         (Expression::ConvertImplicitRequired): Reworked to include
20434         implicit constant expression conversions.
20435
20436         (Expression::ConvertNumericExplicit): Finished.
20437
20438         (Invocation::Emit): If InstanceExpression is null, then it means
20439         that we perform a call on this.
20440
20441 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
20442
20443         * expression.cs (Unary::Emit): Remove some dead code.
20444         (Probe): Implement Resolve and Emit for `is'.
20445         (Expression::ConvertImplicitRequired): Attempt to do constant
20446         expression conversions here.  Maybe should be moved to
20447         ConvertImplicit, but I am not sure.
20448         (Expression::ImplicitLongConstantConversionPossible,
20449         Expression::ImplicitIntConstantConversionPossible): New functions
20450         that tell whether is it possible to apply an implicit constant
20451         expression conversion.
20452
20453         (ConvertNumericExplicit): Started work on explicit numeric
20454         conversions.
20455
20456         * cs-parser.jay: Update operator constants.
20457
20458         * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
20459         (Parameters::GetSignature): Hook up VerifyArgs here.
20460         (Parameters::VerifyArgs): Verifies that no two arguments have the
20461         same name. 
20462
20463         * class.cs (Operator): Update the operator names to reflect the
20464         ones that the spec expects (as we are just stringizing the
20465         operator names).
20466
20467         * expression.cs (Unary::ResolveOperator): Fix bug: Use
20468         MethodInfo's ReturnType instead of LookupMethodByBuilder as the
20469         previous usage did only work for our methods.
20470         (Expression::ConvertImplicit): Handle decimal implicit numeric
20471         conversions as well.
20472         (Expression::InternalTypeConstructor): Used to invoke constructors
20473         on internal types for default promotions.
20474
20475         (Unary::Emit): Implement special handling for the pre/post
20476         increment/decrement for overloaded operators, as they need to have
20477         the same semantics as the other operators.
20478
20479         (Binary::ResolveOperator): ditto.
20480         (Invocation::ConversionExists): ditto.
20481         (UserImplicitCast::Resolve): ditto.
20482
20483 2001-09-26  Ravi Pratap  <ravi@ximian.com>
20484
20485         * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
20486         operator, return after emitting body. Regression tests pass again !
20487
20488         * expression.cs (ConvertImplicit): Take TypeContainer as first argument
20489         (Unary::ForceConversion, Binary::ForceConversion): Ditto.
20490         (Invocation::OverloadResolve): Ditto.
20491         (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
20492
20493         * everywhere : update calls to the above methods accordingly.
20494
20495 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
20496
20497         * assign.cs (Assign): Make it inherit from ExpressionStatement.
20498
20499         * expression.cs (ExpressionStatement): New base class used for
20500         expressions that can appear in statements, so that we can provide
20501         an alternate path to generate expression that do not leave a value
20502         on the stack.
20503
20504         (Expression::Emit, and all the derivatives): We no longer return
20505         whether a value is left on the stack or not.  Every expression
20506         after being emitted leaves a single value on the stack.
20507
20508         * codegen.cs (EmitContext::EmitStatementExpression): Use the
20509         facilties of ExpressionStatement if possible.
20510
20511         * cs-parser.jay: Update statement_expression.
20512
20513 2001-09-25  Miguel de Icaza  <miguel@ximian.com>
20514
20515         * driver.cs: Change the wording of message
20516
20517 2001-09-25  Ravi Pratap  <ravi@ximian.com>
20518
20519         * expression.cs (Binary::ResolveOperator): Had forgottten to set 
20520         the type of the expression to the return type of the method if
20521         we have an overloaded operator match ! The regression tests pass again !
20522         (Unary::ResolveOperator): Ditto.
20523
20524         * expression.cs (Invocation::ConversionExists): Correct the member lookup
20525         to find "op_Implicit", not "implicit" ;-)
20526         (UserImplicitCast): New class to take care of user-defined implicit conversions.
20527         (ConvertImplicit, ForceConversion): Take TypeContainer argument
20528
20529         * everywhere : Correct calls to the above accordingly.
20530
20531         * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
20532         (ConvertImplicit): Do user-defined conversion if it exists.
20533
20534 2001-09-24  Miguel de Icaza  <miguel@ximian.com>
20535
20536         * assign.cs: track location.
20537         (Resolve): Use implicit conversions on assignment.
20538
20539         * literal.cs: Oops.  Not good, Emit of short access values should
20540         pass (Bytes) or the wrong argument will be selected.
20541
20542         * expression.cs (Unary::Emit): Emit code for -expr.
20543
20544         (Unary::ResolveOperator): Handle `Substract' for non-constants
20545         (substract from zero from the non-constants).
20546         Deal with Doubles as well. 
20547
20548         (Expression::ConvertImplicitRequired): New routine that reports an
20549         error if no implicit conversion exists. 
20550
20551         (Invocation::OverloadResolve): Store the converted implicit
20552         expressions if we make them
20553
20554 2001-09-24  Ravi Pratap  <ravi@ximian.com>
20555
20556         * class.cs (ConstructorInitializer): Take a Location argument.
20557         (ConstructorBaseInitializer): Same here.
20558         (ConstructorThisInitializer): Same here.
20559
20560         * cs-parser.jay : Update all calls accordingly.
20561
20562         * expression.cs (Unary, Binary, New): Take location argument.
20563         Update accordingly everywhere.
20564
20565         * cs-parser.jay : Update all calls to the above to take a location
20566         argument.
20567
20568         * class.cs : Ditto.
20569
20570 2001-09-24  Ravi Pratap  <ravi@ximian.com>
20571
20572         * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
20573         (Invocation::BetterConversion): Same here
20574         (Invocation::ConversionExists): Ditto.
20575
20576         (Invocation::ConversionExists): Implement.
20577
20578 2001-09-22  Ravi Pratap  <ravi@ximian.com>
20579
20580         * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
20581         Also take an additional TypeContainer argument.
20582
20583         * All over : Pass in TypeContainer as argument to OverloadResolve.
20584
20585         * typemanager.cs (CSharpName): Update to check for the string type and return
20586         that too.
20587
20588         * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
20589         a given method.
20590
20591 2001-09-21  Ravi Pratap  <ravi@ximian.com>
20592
20593         * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
20594         (Invocation::BetterFunction): Implement.
20595         (Invocation::BetterConversion): Implement.
20596         (Invocation::ConversionExists): Skeleton, no implementation yet.
20597
20598         Okay, things work fine !
20599
20600 2001-09-21  Miguel de Icaza  <miguel@ximian.com>
20601
20602         * typemanager.cs: declare and load enum_type, delegate_type and
20603         void_type. 
20604
20605         * expression.cs (Expression::Emit): Now emit returns a value that
20606         tells whether a value is left on the stack or not.  This strategy
20607         might be reveted tomorrow with a mechanism that would address
20608         multiple assignments.
20609         (Expression::report118): Utility routine to report mismatches on
20610         the ExprClass.
20611
20612         (Unary::Report23): Report impossible type/operator combination
20613         utility function.
20614
20615         (Unary::IsIncrementableNumber): Whether the type can be
20616         incremented or decremented with add.
20617         (Unary::ResolveOperator): Also allow enumerations to be bitwise
20618         complemented. 
20619         (Unary::ResolveOperator): Implement ++, !, ~,
20620
20621         (Invocation::Emit): Deal with new Emit convetion.
20622
20623         * All Expression derivatives: Updated their Emit method to return
20624         whether they leave values on the stack or not.
20625
20626         * codegen.cs (CodeGen::EmitStatement): Pop values left on the
20627         stack for expressions that are statements. 
20628
20629 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
20630
20631         * expression.cs (LValue): New interface.  Must be implemented by
20632         LValue objects.
20633         (LocalVariableReference, ParameterReference, FieldExpr): Implement
20634         LValue interface.
20635
20636         * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
20637         interface for generating code, simplifies the code.
20638
20639 2001-09-20  Ravi Pratap  <ravi@ximian.com>
20640
20641         * expression.cs (everywhere): Comment out return statements in ::Resolve
20642         methods to avoid the warnings.
20643
20644 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
20645
20646         * driver.cs (parse): Report error 2001 if we can not open the
20647         source file.
20648
20649         * expression.cs (SimpleName::ResolveSimpleName): Error if we can
20650         not resolve it.
20651
20652         * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
20653         object. 
20654
20655         * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
20656         otherwise nested blocks end up with the same index.
20657
20658         * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
20659
20660         * expression.cs:  Instead of having FIXMEs in the Resolve
20661         functions, throw exceptions so it is obvious that we are facing a
20662         bug. 
20663
20664         * cs-parser.jay (invocation_expression): Pass Location information.
20665
20666         * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
20667         Use a basename for those routines because .NET does not like paths
20668         on them. 
20669
20670         * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
20671         already defined.
20672
20673 2001-09-19  Miguel de Icaza  <miguel@ximian.com>
20674
20675         * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
20676         are loading the correct data types (throws an exception if not).
20677         (TypeManager::InitCoreTypes): Use CoreLookupType
20678
20679         * expression.cs (Unary::ResolveOperator): return the child
20680         expression for expressions which are just +expr.
20681         (Unary::ResolveOperator): Return negative literals for -LITERAL
20682         expressions (otherwise they are Unary {Literal}).
20683         (Invocation::Badness): Take into account `Implicit constant
20684         expression conversions'.
20685
20686         * literal.cs (LongLiteral): Implement long literal class.
20687         (IntLiteral): export the `Value' of the intliteral. 
20688
20689 2001-09-19  Ravi Pratap  <ravi@ximian.com>
20690
20691         * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
20692
20693         * class.cs (Operator::Define): Change the methodname prefix to 'op_' 
20694         instead of 'Operator'
20695
20696         * expression.cs (Binary::ResolveOperator): Update accordingly.
20697         (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
20698         and 'Minus'
20699
20700         * cs-parser.jay (unary_expression): Update to use the new names.
20701
20702         * gen-treedump.cs (GetUnary): Same here.
20703
20704         * expression.cs (Unary::Resolve): Implement.
20705         (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded 
20706         operators are found instead of making noise ;-)
20707         (Unary::ResolveOperator): New method to do precisely the same thing which
20708         Binary::ResolveOperator does for Binary expressions.
20709         (Unary.method, .Arguments): Add.
20710         (Unary::OperName): Implement.   
20711         (Unary::ForceConversion): Copy and Paste !
20712
20713         * class.cs (Operator::Define): Fix a small bug for the case when we have 
20714         a unary operator.
20715
20716         * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
20717         for the inbuilt operators. Only overloading works for now ;-)
20718
20719 2001-09-18  Miguel de Icaza  <miguel@ximian.com>
20720
20721         * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
20722         UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
20723
20724         * expression.cs (This::Emit): Implement. 
20725         (This::Resolve): Implement.
20726         (TypeOf:Resolve): Implement.
20727         (Expression::ResolveSimpleName): Add an implicit this to instance
20728         field references. 
20729         (MemberAccess::Resolve): Deal with Parameters and Fields. 
20730         Bind instance variable to Field expressions.
20731         (FieldExpr::Instance): New field used to track the expression that
20732         represents the object instance.
20733         (FieldExpr::Resolve): Track potential errors from MemberLookup not
20734         binding 
20735         (FieldExpr::Emit): Implement.
20736
20737         * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
20738         the last instruction contains a return opcode to avoid generating
20739         the last `ret' instruction (this generates correct code, and it is
20740         nice to pass the peverify output).
20741
20742         * class.cs (TypeContainer::EmitFieldInitializers): Implement field
20743         initializer for static and instance variables.
20744         (Constructor::Emit): Allow initializer to be null in the case of
20745         static constructors.  Only emit initializer for instance
20746         constructors. 
20747
20748         (TypeContainer::FindMembers): Return a null array if there are no
20749         matches.
20750
20751         Also fix the code for the MemberTypes.Method branch, as it was not
20752         scanning that for operators (or tried to access null variables before).
20753
20754         * assign.cs (Assign::Emit): Handle instance and static fields. 
20755
20756         * TODO: Updated.
20757
20758         * driver.cs: Stop compilation if there are parse errors.
20759
20760         * cs-parser.jay (constructor_declaration): Provide default base
20761         initializer for non-static constructors.
20762         (constructor_declarator): Do not provide a default base
20763         initializers if none was specified.
20764         Catch the fact that constructors should not have parameters.
20765
20766         * class.cs: Do not emit parent class initializers for static
20767         constructors, that should be flagged as an error.
20768
20769 2001-09-18  Ravi Pratap  <ravi@ximian.com>
20770
20771         * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
20772         Move back code into TypeContainer::Populate.
20773
20774 2001-09-18  Ravi Pratap  <ravi@ximian.com>
20775
20776         * class.cs (TypeContainer::AddConstructor): Fix the check to
20777         compare against Name, not Basename. 
20778         (Operator::OpType): Change Plus and Minus to Add and Subtract.
20779
20780         * cs-parser.jay : Update accordingly.
20781
20782         * class.cs (TypeContainer::FindMembers): For the case where we are searching
20783         for methods, don't forget to look into the operators too.
20784         (RegisterMethodBuilder): Helper method to take care of this for
20785         methods, constructors and operators.
20786         (Operator::Define): Completely revamp.
20787         (Operator.OperatorMethod, MethodName): New fields.
20788         (TypeContainer::Populate): Move the registering of builders into
20789         RegisterMethodBuilder.
20790         (Operator::Emit): Re-write.
20791
20792         * expression.cs (Binary::Emit): Comment out code path to emit method
20793         invocation stuff for the case when we have a user defined operator. I am
20794         just not able to get it right !
20795
20796 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
20797
20798         * expression.cs (Expression::OverloadResolve): Drop TypeContainer
20799         argument. 
20800
20801         (Expression::MemberLookup): Provide a version that allows to
20802         specify the MemberTypes and BindingFlags. 
20803
20804         * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
20805         so it was not fetching variable information from outer blocks.
20806
20807         * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
20808         Beforefieldinit as it was buggy.
20809
20810         * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
20811         that Ravi put here.  
20812
20813         * class.cs (Constructor::Emit): Only emit if block is not null.
20814         (TypeContainer::EmitDefaultConstructor): Removed routine, now we
20815         deal with this by semantically definining it as if the user had
20816         done it.
20817
20818         (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
20819         constructors as we now "emit" them at a higher level.
20820
20821         (TypeContainer::DefineDefaultConstructor): Used to define the
20822         default constructors if none was provided.
20823
20824         (ConstructorInitializer): Add methods Resolve and Emit. 
20825
20826         * expression.cs: Cast to ConstructorInfo instead of MethodInfo
20827
20828 2001-09-17  Ravi Pratap  <ravi@ximian.com>
20829
20830         * class.cs (TypeContainer::EmitDefaultConstructor): Register
20831         the default constructor builder with our hashtable for methodbuilders
20832         to methodcores.
20833
20834         * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
20835         and argument_count is 0 in which case we have a match.
20836         (Binary::ResolveOperator): More null checking and miscellaneous coding
20837         style cleanup.
20838
20839 2001-09-17  Ravi Pratap  <ravi@ximian.com>
20840
20841         * rootcontext.cs (IsNameSpace): Compare against null.
20842
20843         * everywhere : Correct spelling to 'Greater' and to 'Subtract'
20844
20845         * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
20846         and Unary::Operator.
20847
20848         * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
20849         accordingly.
20850
20851         * expression.cs (Binary::method): New member to hold the MethodBase for the case when
20852         we have overloaded operators.
20853         (Binary::ResolveOperator): Implement the part which does the operator overload
20854         resolution.
20855
20856         * class.cs (Operator::Emit): Implement.
20857         (TypeContainer::Emit): Emit the operators we have too.
20858
20859         * expression.cs (Binary::Emit): Update to emit the appropriate code for
20860         the case when we have a user-defined operator.
20861
20862 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
20863
20864         * rootcontext.cs: Fix bug: tree.Namespaces might be null.
20865
20866 2001-09-16  Ravi Pratap  <ravi@ximian.com>
20867
20868         * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
20869         (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
20870         (Constructor::Emit): Implement.
20871         (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
20872         if we have no work to do. 
20873         (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's 
20874         Emit method.
20875
20876         * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
20877         (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
20878
20879         * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
20880         of parent.parent.
20881
20882 2001-09-15  Ravi Pratap  <ravi@ximian.com>
20883
20884         * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
20885         in the source.
20886         (Tree::RecordNamespace): Method to do what the name says ;-)
20887         (Tree::Namespaces): Property to get at the namespaces hashtable.
20888
20889         * cs-parser.jay (namespace_declaration): Call RecordNamespace to 
20890         keep track.
20891
20892         * rootcontext.cs (IsNamespace): Fixed it :-)
20893
20894 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
20895
20896         * class.cs (TypeContainer::FindMembers): Add support for
20897         constructors. 
20898         (MethodCore): New class that encapsulates both the shared aspects
20899         of a Constructor and a Method.  
20900         (Method, Constructor): Factored pieces into MethodCore.
20901
20902         * driver.cs: Added --fatal which makes errors throw exceptions.
20903         Load System assembly as well as part of the standard library.
20904
20905         * report.cs: Allow throwing exceptions on errors for debugging.
20906
20907         * modifiers.cs: Do not use `parent', instead use the real type
20908         container to evaluate permission settings.
20909
20910         * class.cs: Put Ravi's patch back in.  He is right, and we will
20911         have to cope with the
20912
20913 2001-09-14  Ravi Pratap  <ravi@ximian.com>
20914
20915         * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
20916         FamORAssem, not FamANDAssem.
20917
20918 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
20919
20920         * driver.cs: Added --parse option that only parses its input files
20921         and terminates.
20922
20923         * class.cs: Reverted last change from Ravi to IsTopLevel.  That is
20924         incorrect.  IsTopLevel is not used to tell whether an object is
20925         root_types or not (that can be achieved by testing this ==
20926         root_types).  But to see if this is a top-level *class* (not
20927         necessarly our "toplevel" container). 
20928
20929 2001-09-14  Ravi Pratap  <ravi@ximian.com>
20930
20931         * enum.cs (Enum::Define): Modify to call the Lookup method on the
20932         parent instead of a direct call to GetType.
20933
20934 2001-09-14  Ravi Pratap  <ravi@ximian.com>
20935
20936         * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
20937         Modifiers.TypeAttr. This should just be a call to that method.
20938
20939         * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
20940         object so that we can determine if we are top-level or not.
20941
20942         * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the 
20943         TypeContainer too.
20944
20945         * enum.cs (Enum::Define): Ditto.
20946
20947         * modifiers.cs (FieldAttr): Re-write.
20948
20949         * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
20950         (TypeContainer::HaveStaticConstructor): New property to provide access
20951         to precisely that info.
20952
20953         * modifiers.cs (MethodAttr): Re-write.
20954         (EventAttr): Remove altogether as there seems to be no ostensible use for it.
20955
20956         * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
20957         of top-level types as claimed.
20958
20959 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
20960
20961         * expression.cs (MemberLookup): Fruitless attempt to lookup
20962         constructors.  Maybe I need to emit default constructors?  That
20963         might be it (currently .NET emits this for me automatically).
20964         (Invocation::OverloadResolve): Cope with Arguments == null.
20965         (Invocation::EmitArguments): new function, shared by the new
20966         constructor and us.
20967         (Invocation::Emit): Handle static and instance methods.  Emit
20968         proper call instruction for virtual or non-virtual invocations.
20969         (New::Emit): Implement.
20970         (New::Resolve): Implement.
20971         (MemberAccess:Resolve): Implement.
20972         (MethodGroupExpr::InstanceExpression): used conforming to the spec
20973         to track instances.
20974         (FieldExpr::Resolve): Set type.
20975
20976         * support.cs: Handle empty arguments.
20977                 
20978         * cs-parser.jay (CompositeLookup, QualifierIdentifier,
20979         SimpleLookup): Auxiliary routines to help parse a qualifier
20980         identifier.  
20981
20982         Update qualifier_identifier rule.
20983
20984         * codegen.cs: Removed debugging messages.
20985
20986         * class.cs: Make this a global thing, this acts just as a "key" to
20987         objects that we might have around.
20988
20989         (Populate): Only initialize method_builders_to_methods once.
20990
20991         * expression.cs (PropertyExpr): Initialize type from the
20992         PropertyType. 
20993
20994         * codegen.cs (EmitContext::EmitBoolExpression): Use propper
20995         Resolve pattern.  Attempt to implicitly convert value to boolean.
20996         Emit code.
20997
20998         * expression.cs: Set the type for the int32/int32 argument case.
20999         (Binary::ResolveOperator): Set the return type to boolean for
21000         comparission operators
21001
21002         * typemanager.cs: Remove debugging print code.
21003
21004         (Invocation::Resolve): resolve type.
21005
21006         * class.cs: Allocate a MemberInfo of the correct size, as the code
21007         elsewhere depends on the test to reflect the correct contents.
21008
21009         (Method::) Keep track of parameters, due to System.Reflection holes
21010
21011         (TypeContainer::Populate): Keep track of MethodBuilders to Method
21012         mapping here.
21013
21014         (TypeContainer::FindMembers): Use ArrayList and then copy an array
21015         of the exact size and return that.
21016
21017         (Class::LookupMethodByBuilder): New function that maps
21018         MethodBuilders to its methods.  Required to locate the information
21019         on methods because System.Reflection bit us again.
21020
21021         * support.cs: New file, contains an interface ParameterData and
21022         two implementations: ReflectionParameters and InternalParameters
21023         used to access Parameter information.  We will need to grow this
21024         as required.
21025
21026         * expression.cs (Invocation::GetParameterData): implement a cache
21027         and a wrapper around the ParameterData creation for methods. 
21028         (Invocation::OverloadResolve): Use new code.
21029
21030 2001-09-13  Ravi Pratap  <ravi@ximian.com>
21031
21032         * class.cs (TypeContainer::EmitField): Remove and move into 
21033         (Field::Define): here and modify accordingly.
21034         (Field.FieldBuilder): New member.
21035         (TypeContainer::Populate): Update accordingly.
21036         (TypeContainer::FindMembers): Implement.
21037
21038 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
21039
21040         * statement.cs: (VariableInfo::VariableType): New field to be
21041         initialized with the full type once it is resolved. 
21042
21043 2001-09-12  Miguel de Icaza  <miguel@ximian.com>
21044
21045         * parameter.cs (GetParameterInfo): Use a type cache to compute
21046         things only once, and to reuse this information
21047
21048         * expression.cs (LocalVariableReference::Emit): Implement.
21049         (OpcodeCast::Emit): fix.
21050
21051         (ParameterReference::Resolve): Implement.
21052         (ParameterReference::Emit): Implement.
21053
21054         * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
21055         that are expressions need to stay as Expressions.
21056
21057         * typemanager.cs (CSharpName): Returns the C# name of a type if
21058         possible. 
21059
21060         * expression.cs (Expression::ConvertImplicit): New function that
21061         implements implicit type conversions.
21062
21063         (Expression::ImplicitReferenceConversion): Implements implicit
21064         reference conversions.
21065
21066         (EmptyCast): New type for transparent casts.
21067
21068         (OpcodeCast): New type for casts of types that are performed with
21069         a sequence of bytecodes.
21070
21071         (BoxedCast): New type used for casting value types into reference
21072         types.  Emits a box opcode.
21073
21074         (Binary::DoNumericPromotions): Implements numeric promotions of
21075         and computation of the Binary::Type.
21076
21077         (Binary::EmitBranchable): Optimization.
21078
21079         (Binary::Emit): Implement code emission for expressions.
21080
21081         * typemanager.cs (TypeManager): Added two new core types: sbyte
21082         and byte.
21083
21084 2001-09-12  Ravi Pratap  <ravi@ximian.com>
21085
21086         * class.cs (TypeContainer::FindMembers): Method which does exactly
21087         what Type.FindMembers does, only we don't have to use reflection. No
21088         implementation yet.
21089
21090         * typemanager.cs (typecontainers): New hashtable to hold the corresponding
21091         typecontainer objects as we need to get at them.
21092         (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
21093
21094         * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
21095         typecontainer object.
21096
21097         * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
21098         of just a Report object.
21099
21100 2001-09-11  Ravi Pratap  <ravi@ximian.com>
21101
21102         * class.cs (Event::Define): Go back to using the prefixes "add_" and
21103         "remove_"
21104         (TypeContainer::Populate): Now define the delegates of the type too.
21105         (TypeContainer.Delegates): Property to access the list of delegates defined
21106         in the type.
21107
21108         * delegates.cs (Delegate::Define): Implement partially.
21109
21110         * modifiers.cs (TypeAttr): Handle more flags.
21111
21112 2001-09-11  Ravi Pratap  <ravi@ximian.com>
21113
21114         * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
21115         and not <=
21116         (Operator::Define): Re-write logic to get types by using the LookupType method
21117         instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
21118         (Indexer::Define): Ditto.
21119         (Event::Define): Ditto.
21120         (Property::Define): Ditto.
21121
21122 2001-09-10  Ravi Pratap  <ravi@ximian.com>
21123
21124         * class.cs (TypeContainer::Populate): Now define operators too. 
21125         (TypeContainer.Operators): New property to access the list of operators
21126         in a type.
21127         (Operator.OperatorMethodBuilder): New member to hold the method builder
21128         for the operator we are defining.
21129         (Operator::Define): Implement.
21130
21131 2001-09-10  Ravi Pratap  <ravi@ximian.com>
21132
21133         * class.cs (Event::Define): Make the prefixes of the accessor methods
21134         addOn_ and removeOn_ 
21135
21136         * genericparser.cs (GenericParser::error): Overloaded method to handle the case
21137         of the location being passed in too. Ideally, this should go later since all
21138         error reporting should be done through the Report object.
21139
21140         * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
21141         (Populate): Iterate thru the indexers we have and define them too.
21142         (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
21143         for the get and set accessors.
21144         (Indexer::Define): Implement.
21145
21146 2001-09-09  Miguel de Icaza  <miguel@ximian.com>
21147
21148         * expression.cs (Binary::Resolve): Beginning of it.  I scratched
21149         my previous implementation, did not work.
21150
21151         * typemanager.cs: Add a couple of missing types (the longs).
21152
21153         * literal.cs: Use TypeManager.bool_type instead of getting it.
21154
21155         * expression.cs (EventExpr): New kind of expressions.
21156         (Expressio::ExprClassFromMemberInfo): finish
21157
21158 2001-09-08  Miguel de Icaza  <miguel@ximian.com>
21159
21160         * assign.cs: Emit stores to static fields differently.
21161
21162 2001-09-08  Ravi Pratap  <ravi@ximian.com>
21163
21164         * Merge in changes and adjust code to tackle conflicts. Backed out my
21165         code in Assign::Resolve ;-) 
21166
21167 2001-09-08  Ravi Pratap  <ravi@ximian.com>
21168
21169         * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
21170         instead Report.Error and also pass in the location.
21171         (CSharpParser::Lexer): New readonly property to return the reference
21172         to the Tokenizer object.
21173         (declare_local_variables): Use Report.Error with location instead of plain 
21174         old error.
21175         (CheckDef): Ditto.
21176
21177         * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
21178         (Operator.CheckBinaryOperator): Ditto.
21179
21180         * cs-parser.jay (operator_declarator): Update accordingly.
21181
21182         * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
21183         (CheckBinaryOperator): Same here.
21184
21185         * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
21186         on the name without any prefixes of namespace names etc. This is because we
21187         already might have something already fully qualified like 
21188         'System.Console.WriteLine'
21189
21190         * assign.cs (Resolve): Begin implementation. Stuck ;-)
21191
21192 2001-09-07  Ravi Pratap  <ravi@ximian.com>
21193
21194         * cs-tokenizer.cs (location): Return a string which also contains
21195         the file name.
21196
21197         * expression.cs (ElementAccess): New class for expressions of the
21198         type 'element access.'
21199         (BaseAccess): New class for expressions of the type 'base access.'
21200         (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
21201         respectively.
21202
21203         * cs-parser.jay (element_access): Implement action.
21204         (base_access): Implement actions.
21205         (checked_expression, unchecked_expression): Implement.
21206
21207         * cs-parser.jay (local_variable_type): Correct and implement.
21208         (type_suffixes, type_suffix_list, type_suffix): Implement actions.
21209
21210         * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
21211
21212         * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
21213         name and the specifiers.
21214
21215         * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
21216
21217         * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of 
21218         making them all public ;-)
21219
21220         * cs-parser.jay (error): Remove entirely as we have an implementation in the base
21221         class anyways.
21222
21223 2001-09-07  Miguel de Icaza  <miguel@ximian.com>
21224
21225         * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
21226         PropertyExprs.
21227         (FieldExpr, PropertyExprs): New resolved expressions.
21228         (SimpleName::MemberStaticCheck): Perform static checks for access
21229         to non-static fields on static methods. Maybe this should be
21230         generalized for MemberAccesses. 
21231         (SimpleName::ResolveSimpleName): More work on simple name
21232         resolution. 
21233
21234         * cs-parser.jay (primary_expression/qualified_identifier): track
21235         the parameter index.
21236
21237         * codegen.cs (CodeGen::Save): Catch save exception, report error.
21238         (EmitContext::EmitBoolExpression): Chain to expression generation
21239         instead of temporary hack.
21240         (::EmitStatementExpression): Put generic expression code generation.
21241
21242         * assign.cs (Assign::Emit): Implement variable assignments to
21243         local variables, parameters and fields.
21244
21245 2001-09-06  Miguel de Icaza  <miguel@ximian.com>
21246
21247         * statement.cs (Block::GetVariableInfo): New method, returns the
21248         VariableInfo for a variable name in a block.
21249         (Block::GetVariableType): Implement in terms of GetVariableInfo
21250
21251         * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
21252         DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
21253
21254 2001-09-06  Ravi Pratap  <ravi@ximian.com>
21255
21256         * cs-parser.jay (operator_declaration): Continue on my quest : update
21257         to take attributes argument.
21258         (event_declaration): Ditto.
21259         (enum_declaration): Ditto.
21260         (indexer_declaration): Ditto.
21261
21262         * class.cs (Operator::Operator): Update constructor accordingly.
21263         (Event::Event): Ditto.
21264
21265         * delegate.cs (Delegate::Delegate): Same here.
21266
21267         * enum.cs (Enum::Enum): Same here.
21268
21269 2001-09-05  Ravi Pratap  <ravi@ximian.com>
21270
21271         * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
21272
21273         * ../tests/cs0658.cs : New file to demonstrate error 0658.
21274
21275         * attribute.cs (Attributes): New class to encapsulate all attributes which were
21276         being passed around as an arraylist.
21277         (Attributes::AddAttribute): Method to add attribute sections.
21278
21279         * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
21280         (struct_declaration): Update accordingly.
21281         (constant_declaration): Update.
21282         (field_declaration): Update.
21283         (method_header): Update.
21284         (fixed_parameter): Update.
21285         (parameter_array): Ditto.
21286         (property_declaration): Ditto.
21287         (destructor_declaration): Ditto.
21288
21289         * class.cs (Struct::Struct): Update constructors accordingly.
21290         (Class::Class): Ditto.
21291         (Field::Field): Ditto.
21292         (Method::Method): Ditto.
21293         (Property::Property): Ditto.
21294         (TypeContainer::OptAttribute): update property's return type.
21295
21296         * interface.cs (Interface.opt_attributes): New member.
21297         (Interface::Interface): Update to take the extra Attributes argument.
21298
21299         * parameter.cs (Parameter::Parameter): Ditto.
21300
21301         * constant.cs (Constant::Constant): Ditto.
21302
21303         * interface.cs (InterfaceMemberBase): New OptAttributes field.
21304         (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take 
21305         the attributes as a parameter.
21306         (InterfaceProperty): Update constructor call.
21307         (InterfaceEvent): Ditto.
21308         (InterfaceMethod): Ditto.
21309         (InterfaceIndexer): Ditto.
21310
21311         * cs-parser.jay (interface_indexer_declaration): Update call to constructor to 
21312         pass the attributes too.
21313         (interface_event_declaration): Ditto.
21314         (interface_property_declaration): Ditto.
21315         (interface_method_declaration): Ditto.
21316         (interface_declaration): Ditto.
21317
21318 2001-09-05  Miguel de Icaza  <miguel@ximian.com>
21319
21320         * class.cs (Method::Define): Track the "static Main" definition to
21321         create an entry point. 
21322
21323         * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
21324         EntryPoint if we find it. 
21325
21326         * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
21327         (EmitContext::ig): Make this variable public.
21328
21329         * driver.cs: Make the default output file be the first file name
21330         with the .exe extension.  
21331
21332         Detect empty compilations
21333
21334         Handle various kinds of output targets.  Handle --target and
21335         rename -t to --dumper.
21336
21337         * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
21338         methods inherited from Expression return now an Expression.  This
21339         will is used during the tree rewriting as we resolve them during
21340         semantic analysis.
21341
21342         (Expression::MemberLookup): Implements the MemberLookup (7.3) from
21343         the spec.  Missing entirely is the information about
21344         accessability of elements of it.
21345
21346         (Expression::ExprClassFromMemberInfo): New constructor for
21347         Expressions that creates a fully initialized Expression based on
21348         a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
21349         a Type.
21350
21351         (Invocation::Resolve): Begin implementing resolution of invocations.
21352
21353         * literal.cs (StringLiteral):  Implement Emit.
21354
21355 2001-09-05  Ravi Pratap  <ravi@ximian.com>
21356
21357         * cs-parser.jay (error): Add new modifier because we are hiding an inherited
21358         member.
21359
21360 2001-09-04  Ravi Pratap  <ravi@ximian.com>
21361
21362         * cs-parser.jay (attribute_arguments): Implement actions.
21363         (attribute): Fix bug in production. Implement action.
21364         (attribute_list): Implement.
21365         (attribute_target): Implement.
21366         (attribute_target_specifier, opt_target_specifier): Implement
21367         (CheckAttributeTarget): New method to check if the attribute target
21368         is valid.
21369         (attribute_section): Implement.
21370         (opt_attributes): Implement.
21371
21372         * attribute.cs : New file to handle attributes.
21373         (Attribute): Class to hold attribute info.
21374
21375         * cs-parser.jay (opt_attribute_target_specifier): Remove production
21376         (attribute_section): Modify production to use 2 different rules to 
21377         achieve the same thing. 1 s/r conflict down !
21378         Clean out commented, useless, non-reducing dimension_separator rules.
21379
21380         * class.cs (TypeContainer.attributes): New member to hold list
21381         of attributes for a type.
21382         (Struct::Struct): Modify to take one more argument, the attribute list.
21383         (Class::Class): Ditto.
21384         (Field::Field): Ditto.
21385         (Method::Method): Ditto.
21386         (Property::Property): Ditto.
21387
21388         * cs-parser.jay (struct_declaration): Update constructor call to
21389         pass in the attributes too.
21390         (class_declaration): Ditto.
21391         (constant_declaration): Ditto.
21392         (field_declaration): Ditto.
21393         (method_header): Ditto.
21394         (fixed_parameter): Ditto.
21395         (parameter_array): Ditto.
21396         (property_declaration): Ditto.
21397
21398         * constant.cs (Constant::Constant): Update constructor similarly.
21399         Use System.Collections.
21400
21401         * parameter.cs (Parameter::Parameter): Update as above.
21402
21403 2001-09-02  Ravi Pratap  <ravi@ximian.com>
21404
21405         * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
21406         (TypeContainer.delegates): New member to hold list of delegates.
21407
21408         * cs-parser.jay (delegate_declaration): Implement the action correctly 
21409         this time as I seem to be on crack ;-)
21410
21411 2001-09-02  Miguel de Icaza  <miguel@ximian.com>
21412
21413         * rootcontext.cs (RootContext::IsNamespace): new function, used to
21414         tell whether an identifier represents a namespace.
21415
21416         * expression.cs (NamespaceExpr): A namespace expression, used only
21417         temporarly during expression resolution.
21418         (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
21419         utility functions to resolve names on expressions.
21420
21421 2001-09-01  Miguel de Icaza  <miguel@ximian.com>
21422
21423         * codegen.cs: Add hook for StatementExpressions. 
21424
21425         * class.cs: Fix inverted test for static flag in methods.
21426
21427 2001-09-02  Ravi Pratap  <ravi@ximian.com>
21428
21429         * class.cs (Operator::CheckUnaryOperator): Correct error number used
21430         to make it coincide with MS' number.
21431         (Operator::CheckBinaryOperator): Ditto.
21432
21433         * ../errors/errors.txt : Remove error numbers added earlier.
21434
21435         * ../errors/cs1019.cs : Test case for error # 1019
21436
21437         * ../errros/cs1020.cs : Test case for error # 1020
21438
21439         * cs-parser.jay : Clean out commented cruft.
21440         (dimension_separators, dimension_separator): Comment out. Ostensibly not
21441         used anywhere - non-reducing rule.
21442         (namespace_declarations): Non-reducing rule - comment out.
21443
21444         * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
21445         with TypeContainer::AddEnum.
21446
21447         * delegate.cs : New file for delegate handling classes.
21448         (Delegate): Class for declaring delegates.
21449
21450         * makefile : Update.
21451
21452         * cs-parser.jay (delegate_declaration): Implement.
21453
21454 2001-09-01  Ravi Pratap  <ravi@che.iitm.ac.in>
21455
21456         * class.cs (Event::Define): Implement.
21457         (Event.EventBuilder): New member.
21458
21459         * class.cs (TypeContainer::Populate): Update to define all enums and events
21460         we have.
21461         (Events): New property for the events arraylist we hold. Shouldn't we move to using
21462         readonly fields for all these cases ?
21463
21464 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
21465
21466         * class.cs (Property): Revamp to use the convention of making fields readonly.
21467         Accordingly modify code elsewhere.
21468
21469         * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
21470         the Define method of the Property class.
21471
21472         * class.cs : Clean up applied patch and update references to variables etc. Fix 
21473         trivial bug.
21474         (TypeContainer::Populate): Update to define all the properties we have. Also
21475         define all enumerations.
21476
21477         * enum.cs (Define): Implement.
21478
21479 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
21480
21481         * cs-parser.jay (overloadable_operator): The semantic value is an
21482         enum of the Operator class.
21483         (operator_declarator): Implement actions.
21484         (operator_declaration): Implement.
21485
21486         * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
21487         validity of definitions.
21488         (Operator::CheckBinaryOperator): Static method to check for binary operators
21489         (TypeContainer::AddOperator): New method to add an operator to a type.
21490
21491         * cs-parser.jay (indexer_declaration): Added line to actually call the
21492         AddIndexer method so it gets added ;-)
21493
21494         * ../errors/errors.txt : Update to include new error numbers. Are these numbers 
21495         already taken care of by the MS compiler ?  
21496
21497 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
21498
21499         * class.cs (Operator): New class for operator declarations.
21500         (Operator::OpType): Enum for the various operators.
21501
21502 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
21503
21504         * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
21505         ostensibly handle this in semantic analysis.
21506
21507         * cs-parser.jay (general_catch_clause): Comment out
21508         (specific_catch_clauses, specific_catch_clause): Ditto.
21509         (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
21510         (catch_args, opt_catch_args): New productions.
21511         (catch_clause): Rewrite to use the new productions above
21512         (catch_clauses): Modify accordingly.
21513         (opt_catch_clauses): New production to use in try_statement
21514         (try_statement): Revamp. Basically, we get rid of one unnecessary rule
21515         and re-write the code in the actions to extract the specific and
21516         general catch clauses by being a little smart ;-)
21517
21518         * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
21519         Hooray, try and catch statements parse fine !
21520
21521 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
21522
21523         * statement.cs (Block::GetVariableType): Fix logic to extract the type
21524         string from the hashtable of variables.
21525
21526         * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
21527         I end up making that mistake ;-)
21528         (catch_clauses): Fixed gross error which made Key and Value of the 
21529         DictionaryEntry the same : $1 !!
21530
21531 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
21532
21533         * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
21534
21535         * cs-parser.jay (event_declaration): Correct to remove the semicolon
21536         when the add and remove accessors are specified. 
21537
21538 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
21539
21540         * cs-parser.jay (IndexerDeclaration): New helper class to hold
21541         information about indexer_declarator.
21542         (indexer_declarator): Implement actions.
21543         (parsing_indexer): New local boolean used to keep track of whether
21544         we are parsing indexers or properties. This is necessary because 
21545         implicit_parameters come into picture even for the get accessor in the 
21546         case of an indexer.
21547         (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
21548
21549         * class.cs (Indexer): New class for indexer declarations.
21550         (TypeContainer::AddIndexer): New method to add an indexer to a type.
21551         (TypeContainer::indexers): New member to hold list of indexers for the
21552         type.
21553
21554 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
21555
21556         * cs-parser.jay (add_accessor_declaration): Implement action.
21557         (remove_accessor_declaration): Implement action.
21558         (event_accessors_declaration): Implement
21559         (variable_declarators): swap statements for first rule - trivial.
21560
21561         * class.cs (Event): New class to hold information about event
21562         declarations.
21563         (TypeContainer::AddEvent): New method to add an event to a type
21564         (TypeContainer::events): New member to hold list of events.
21565
21566         * cs-parser.jay (event_declaration): Implement actions.
21567
21568 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
21569
21570         * cs-parser.jay (dim_separators): Implement. Make it a string
21571         concatenating all the commas together, just as they appear.
21572         (opt_dim_separators): Modify accordingly
21573         (rank_specifiers): Update accordingly. Basically do the same
21574         thing - instead, collect the brackets here.
21575         (opt_rank_sepcifiers): Modify accordingly.
21576         (array_type): Modify to actually return the complete type string
21577         instead of ignoring the rank_specifiers.
21578         (expression_list): Implement to collect the expressions
21579         (variable_initializer): Implement. We make it a list of expressions
21580         essentially so that we can handle the array_initializer case neatly too.
21581         (variable_initializer_list): Implement.
21582         (array_initializer): Make it a list of variable_initializers
21583         (opt_array_initializer): Modify accordingly.
21584
21585         * expression.cs (New::NType): Add enumeration to help us
21586         keep track of whether we have an object/delegate creation
21587         or an array creation.
21588         (New:NewType, New::Rank, New::Indices, New::Initializers): New
21589         members to hold data about array creation.
21590         (New:New): Modify to update NewType
21591         (New:New): New Overloaded contructor for the array creation
21592         case.
21593
21594         * cs-parser.jay (array_creation_expression): Implement to call
21595         the overloaded New constructor.
21596
21597 2001-08-26  Ravi Pratap  <ravi@che.iitm.ac.in>
21598
21599         * class.cs (TypeContainer::Constructors): Return member
21600         constructors instead of returning null.
21601
21602 2001-08-26  Miguel de Icaza  <miguel@ximian.com>
21603
21604         * typemanager.cs (InitCoreTypes): Initialize the various core
21605         types after we have populated the type manager with the user
21606         defined types (this distinction will be important later while
21607         compiling corlib.dll)
21608
21609         * expression.cs, literal.cs, assign.cs, constant.cs: Started work
21610         on Expression Classification.  Now all expressions have a method
21611         `Resolve' and a method `Emit'.
21612
21613         * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
21614         generation from working.     Also add some temporary debugging
21615         code. 
21616
21617 2001-08-24  Miguel de Icaza  <miguel@ximian.com>
21618
21619         * codegen.cs: Lots of code generation pieces.  This is only the
21620         beginning, will continue tomorrow with more touches of polish.  We
21621         handle the fundamentals of if, while, do, for, return.  Others are
21622         trickier and I need to start working on invocations soon.
21623
21624         * gen-treedump.cs: Bug fix, use s.Increment here instead of
21625         s.InitStatement. 
21626
21627         * codegen.cs (EmitContext): New struct, used during code
21628         emission to keep a context.   Most of the code generation will be
21629         here. 
21630
21631         * cs-parser.jay: Add embedded blocks to the list of statements of
21632         this block.  So code generation proceeds in a top down fashion.
21633
21634 2001-08-23  Miguel de Icaza  <miguel@ximian.com>
21635
21636         * statement.cs: Add support for multiple child blocks.
21637
21638 2001-08-22  Miguel de Icaza  <miguel@ximian.com>
21639
21640         * codegen.cs (EmitCode): New function, will emit the code for a
21641         Block of code given a TypeContainer and its ILGenerator. 
21642
21643         * statement.cs (Block): Standard public readonly optimization.
21644         (Block::Block constructors): Link children. 
21645         (Block::Child): Child Linker.
21646         (Block::EmitVariables): Emits IL variable declarations.
21647
21648         * class.cs: Drop support for MethodGroups here, delay until
21649         Semantic Analysis.
21650         (Method::): Applied the same simplification that I did before, and
21651         move from Properties to public readonly fields.
21652         (Method::ParameterTypes): Returns the parameter types for the
21653         function, and implements a cache that will be useful later when I
21654         do error checking and the semantic analysis on the methods is
21655         performed.
21656         (Constructor::GetCallingConvention): Renamed from CallingConvetion
21657         and made a method, optional argument tells whether this is a class
21658         or a structure to apply the `has-this' bit.
21659         (Method::GetCallingConvention): Implement, returns the calling
21660         convention. 
21661         (Method::Define): Defines the type, a second pass is performed
21662         later to populate the methods.
21663
21664         (Constructor::ParameterTypes): implement a cache similar to the
21665         one on Method::ParameterTypes, useful later when we do semantic
21666         analysis. 
21667
21668         (TypeContainer::EmitMethod):  New method.  Emits methods.
21669
21670         * expression.cs: Removed MethodGroup class from here.
21671
21672         * parameter.cs (Parameters::GetCallingConvention): new method.
21673
21674 2001-08-21  Miguel de Icaza  <miguel@ximian.com>
21675
21676         * class.cs (TypeContainer::Populate): Drop RootContext from the
21677         argument. 
21678
21679         (Constructor::CallingConvention): Returns the calling convention.
21680         (Constructor::ParameterTypes): Returns the constructor parameter
21681         types. 
21682
21683         (TypeContainer::AddConstructor): Keep track of default constructor
21684         and the default static constructor.
21685
21686         (Constructor::) Another class that starts using `public readonly'
21687         instead of properties. 
21688
21689         (Constructor::IsDefault): Whether this is a default constructor. 
21690
21691         (Field::) use readonly public fields instead of properties also.
21692
21693         (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
21694         track of static constructors;  If none is used, turn on
21695         BeforeFieldInit in the TypeAttributes. 
21696
21697         * cs-parser.jay (opt_argument_list): now the return can be null
21698         for the cases where there are no arguments. 
21699
21700         (constructor_declarator): If there is no implicit `base' or
21701         `this', then invoke the default parent constructor. 
21702
21703         * modifiers.cs (MethodAttr): New static function maps a set of
21704         modifiers flags into a MethodAttributes enum
21705         (FieldAttr): renamed from `Map'.  So now we have FieldAttr,
21706         MethodAttr, TypeAttr to represent the various mappings where the
21707         modifiers are used.
21708         (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'  
21709
21710 2001-08-19  Miguel de Icaza  <miguel@ximian.com>
21711
21712         * parameter.cs (GetParameterInfo): Fix bug where there would be no
21713         method arguments.
21714
21715         * interface.cs (PopulateIndexer): Implemented the code generator
21716         for interface indexers.
21717
21718 2001-08-17  Miguel de Icaza  <miguel@ximian.com>
21719
21720         * interface.cs (InterfaceMemberBase): Now we track the new status
21721         here.  
21722
21723         (PopulateProperty): Implement property population.  Woohoo!  Got
21724         Methods and Properties going today. 
21725
21726         Removed all the properties for interfaces, and replaced them with
21727         `public readonly' fields. 
21728
21729 2001-08-16  Miguel de Icaza  <miguel@ximian.com>
21730
21731         * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
21732         initialize their hashtables/arraylists only when they are needed
21733         instead of doing this always.
21734
21735         * parameter.cs: Handle refs and out parameters.
21736
21737         * cs-parser.jay: Use an ArrayList to construct the arguments
21738         instead of the ParameterCollection, and then cast that to a
21739         Parameter[] array.
21740
21741         * parameter.cs: Drop the use of ParameterCollection and use
21742         instead arrays of Parameters.
21743
21744         (GetParameterInfo): Use the Type, not the Name when resolving
21745         types. 
21746
21747 2001-08-13  Miguel de Icaza  <miguel@ximian.com>
21748
21749         * parameter.cs: Eliminate the properties Name, Type and ModFlags,
21750         and instead use public readonly fields.
21751
21752         * class.cs: Put back walking code for type containers.
21753
21754 2001-08-11  Miguel de Icaza  <miguel@ximian.com>
21755
21756         * class.cs (MakeConstant): Code to define constants.
21757
21758         * rootcontext.cs (LookupType): New function.  Used to locate types 
21759
21760
21761 2001-08-08  Miguel de Icaza  <miguel@ximian.com>
21762
21763         * rootcontext.cs: OH MY!  My trick works!   It is amazing how nice
21764         this System.Reflection code is.  Kudos to Microsoft
21765
21766         * typemanager.cs: Implement a type cache and avoid loading all
21767         types at boot time.  Wrap in LookupType the internals.  This made
21768         the compiler so much faster.  Wow.  I rule!
21769
21770         * driver.cs: Make sure we always load mscorlib first (for
21771         debugging purposes, nothing really important).
21772
21773         * Renamespaced things that were on `CSC' to `CIR'.  Maybe I should
21774         have moved to `CSC' rather than `CIR'.  Oh man!  The confussion!  
21775
21776         * rootcontext.cs: Lookup types on their namespace;  Lookup types
21777         on namespaces that have been imported using the `using' keyword.
21778
21779         * class.cs (TypeContainer::TypeAttr): Virtualize.
21780         (Class::TypeAttr): Return attributes suitable for this bad boy.
21781         (Struct::TypeAttr): ditto.
21782         Handle nested classes.
21783         (TypeContainer::) Remove all the type visiting code, it is now
21784         replaced with the rootcontext.cs code
21785
21786         * rootcontext.cs (GetClassBases): Added support for structs. 
21787
21788 2001-08-06  Miguel de Icaza  <miguel@ximian.com>
21789
21790         * interface.cs, statement.cs, class.cs, parameter.cs,
21791         rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
21792         Drop use of TypeRefs, and use strings instead.
21793
21794 2001-08-04  Miguel de Icaza  <miguel@ximian.com>
21795
21796         * rootcontext.cs: 
21797
21798         * class.cs (Struct::Struct): set the SEALED flags after
21799         checking the modifiers.
21800         (TypeContainer::TypeAttr): new property, returns the
21801         TypeAttributes for a class.  
21802
21803         * cs-parser.jay (type_list): Oops, list production was creating a
21804         new list of base types.
21805
21806         * rootcontext.cs (StdLib): New property.
21807         (GetInterfaceTypeByName): returns an interface by type name, and
21808         encapsulates error handling here.
21809         (GetInterfaces): simplified.
21810         (ResolveTree): Encapsulated all the tree resolution here.
21811         (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
21812         types. 
21813
21814         * driver.cs: Add support for --nostdlib, to avoid loading the
21815         default assemblies.
21816         (Main): Do not put tree resolution here. 
21817
21818         * rootcontext.cs: Beginning of the class resolution.
21819
21820 2001-08-03  Miguel de Icaza  <miguel@ximian.com>
21821
21822         * rootcontext.cs: Provide better error reporting. 
21823
21824         * cs-parser.jay (interface_base): set our $$ to be interfaces.
21825
21826         * rootcontext.cs (CreateInterface): Handle the case where there
21827         are no parent interfaces.
21828
21829         (CloseTypes): Routine to flush types at the end.
21830         (CreateInterface): Track types.
21831         (GetInterfaces): Returns an array of Types from the list of
21832         defined interfaces.
21833
21834         * typemanager.c (AddUserType): Mechanism to track user types (puts
21835         the type on the global type hash, and allows us to close it at the
21836         end). 
21837
21838 2001-08-02  Miguel de Icaza  <miguel@ximian.com>
21839
21840         * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
21841         RecordInterface instead.
21842
21843         * cs-parser.jay: Updated to reflect changes above.
21844
21845         * decl.cs (Definition): Keep track of the TypeBuilder type that
21846         represents this type here.  Not sure we will use it in the long
21847         run, but wont hurt for now.
21848
21849         * driver.cs: Smaller changes to accomodate the new code.
21850
21851         Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
21852         when done. 
21853
21854         * rootcontext.cs (CreateInterface):  New method, used to create
21855         the System.TypeBuilder type for interfaces.
21856         (ResolveInterfaces): new entry point to resolve the interface
21857         hierarchy. 
21858         (CodeGen): Property, used to keep track of the code generator.
21859
21860 2001-07-26  Miguel de Icaza  <miguel@ximian.com>
21861
21862         * cs-parser.jay: Add a second production for delegate_declaration
21863         with `VOID'.
21864
21865         (enum_body): Put an opt_comma here instead of putting it on
21866         enum_body or enum_member_declarations so we can handle trailing
21867         commas on enumeration members.  Gets rid of a shift/reduce.
21868
21869         (type_list): Need a COMMA in the middle.
21870
21871         (indexer_declaration): Tell tokenizer to recognize get/set
21872
21873         * Remove old targets.
21874
21875         * Re-add the parser target.
21876
21877 2001-07-13  Simon Cozens <simon@simon-cozens.org>
21878
21879         * cs-parser.jay: Add precendence rules for a number of operators
21880         ot reduce the number of shift/reduce conflicts in the grammar.
21881
21882 2001-07-17  Miguel de Icaza  <miguel@ximian.com>
21883
21884         * tree.cs: moved IGenerator interface and renamed it to ITreeDump
21885         and put it here.
21886
21887         Get rid of old crufty code.
21888
21889         * rootcontext.cs: Use this to keep track of the parsed
21890         representation and the defined types available to the program. 
21891
21892         * gen-treedump.cs: adjust for new convention.
21893
21894         * type.cs: Split out the type manager, and the assembly builder
21895         from here. 
21896
21897         * typemanager.cs: the type manager will live here now.
21898
21899         * cil-codegen.cs: And the code generator here. 
21900
21901 2001-07-14  Sean MacIsaac  <macisaac@ximian.com>
21902
21903         * makefile: Fixed up for easy making.
21904
21905 2001-07-13  Simon Cozens <simon@simon-cozens.org>
21906
21907         * cs-parser.jay (rank_specifier): Remove a conflict by reordering
21908         the 
21909
21910         (unary_expression): Expand pre_increment_expression and
21911         post_decrement_expression to reduce a shift/reduce.
21912
21913 2001-07-11  Simon Cozens
21914
21915         * cs-tokenizer.cs: Hex numbers should begin with a 0.
21916
21917         Improve allow_keyword_as_indent name.
21918
21919 2001-06-19  Miguel de Icaza  <miguel@ximian.com>
21920
21921         * Adjustments for Beta2. 
21922
21923 2001-06-13  Miguel de Icaza  <miguel@ximian.com>
21924
21925         * decl.cs: Added `Define' abstract method.
21926         (InTransit): new property, used to catch recursive definitions. 
21927
21928         * interface.cs: Implement `Define'. 
21929
21930         * modifiers.cs: Map Modifiers.constants to
21931         System.Reflection.TypeAttribute flags.
21932
21933         * class.cs: Keep track of types and user-defined types.
21934         (BuilderInit): New method for creating an assembly
21935         (ResolveType): New function to launch the resolution process, only
21936         used by interfaces for now.
21937
21938         * cs-parser.jay: Keep track of Classes, Structs and Interfaces
21939         that are inserted into the name space. 
21940
21941 2001-06-08  Miguel de Icaza  <miguel@ximian.com>
21942
21943         * ARGH.  I have screwed up my tree so many times due to the use of
21944         rsync rather than using CVS.  Going to fix this at once. 
21945
21946         * driver.cs: Objetify driver.  Load assemblies, use assemblies to
21947         load types.
21948
21949 2001-06-07  Miguel de Icaza  <miguel@ximian.com>
21950
21951         * Experiment successful: Use System.Type rather that our own
21952         version of Type.  
21953
21954 2001-05-25  Miguel de Icaza  <miguel@ximian.com>
21955
21956         * cs-parser.jay: Removed nsAliases from here.
21957
21958         Use new namespaces, handle `using XXX;' 
21959
21960         * namespace.cs: Reimplemented namespace handling, use a recursive
21961         definition of the class.  Now we can keep track of using clauses
21962         and catch invalid using clauses.
21963
21964 2001-05-24  Miguel de Icaza  <miguel@ximian.com>
21965
21966         * gen-treedump.cs: Adapted for all the renaming.
21967
21968         * expression.cs (Expression): this class now has a Type property
21969         which returns an expression Type.
21970
21971         (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
21972         `Type', as this has a different meaning now in the base
21973
21974 2001-05-22  Miguel de Icaza  <miguel@ximian.com>
21975
21976         * interface.cs, class.cs: Removed from all the sources the
21977         references to signature computation, as we can not do method
21978         signature computation during the parsing time, as we are not
21979         trying to solve at that point distinguishing:
21980
21981         class X {
21982                 void a (Blah x) {}
21983                 void a (NS.Blah x) {}
21984         }
21985
21986         Which depending on the context might be valid or not, as we do not
21987         know if Blah is the same thing as NS.Blah at that point.
21988
21989         * Redid everything so the code uses TypeRefs now instead of
21990         Types.  TypeRefs are just temporary type placeholders, that need
21991         to be resolved.  They initially have a pointer to a string and the
21992         current scope in which they are used.  This is used later by the
21993         compiler to resolve the reference to an actual Type. 
21994
21995         * DeclSpace is no longer a CIR.Type, and neither are
21996         TypeContainers (Class and Struct) nor Interfaces nor Enums.  They
21997         are all DeclSpaces, but no Types. 
21998
21999         * type.cs (TypeRefManager): This implements the TypeRef manager,
22000         which keeps track of all the types that need to be resolved after
22001         the parsing has finished. 
22002
22003 2001-05-13  Miguel de Icaza  <miguel@ximian.com>
22004
22005         * ARGH.  We are going to have to store `foreach' as a class rather
22006         than resolving it, as we need to verify error 1579 after name
22007         resolution.   *OR* we could keep a flag that says `This request to
22008         IEnumerator comes from a foreach statement' which we can then use
22009         to generate the error.
22010
22011 2001-05-10  Miguel de Icaza  <miguel@ximian.com>
22012
22013         * class.cs (TypeContainer.AddMethod): we now add methods to the
22014         MethodGroup instead of the method hashtable.  
22015
22016         * expression.cs: Add MethodGroup abstraction, which gets us one
22017         step closer to the specification in the way we handle method
22018         declarations.  
22019
22020         * cs-parser.jay (primary_expression): qualified_identifier now
22021         tried to match up an identifier to a local variable reference or
22022         to a parameter reference.
22023
22024         current_local_parameters is now a parser global variable that
22025         points to the current parameters for the block, used during name
22026         lookup.
22027
22028         (property_declaration): Now creates an implicit `value' argument to
22029         the set accessor.
22030
22031 2001-05-09  Miguel de Icaza  <miguel@ximian.com>
22032
22033         * parameter.cs: Do not use `param' arguments as part of the
22034         signature, per the spec.
22035
22036 2001-05-08  Miguel de Icaza  <miguel@ximian.com>
22037
22038         * decl.cs: Base class for classes, structs and interfaces.  This
22039         is the "Declaration Space" 
22040
22041         * cs-parser.jay: Use CheckDef for checking declaration errors
22042         instead of having one on each function.
22043
22044         * class.cs: Factor out some code for handling error handling in
22045         accordance to the "Declarations" section in the "Basic Concepts"
22046         chapter in the ECMA C# spec.
22047
22048         * interface.cs: Make all interface member classes derive from
22049         InterfaceMemberBase.
22050
22051 2001-05-07  Miguel de Icaza  <miguel@ximian.com>
22052
22053         * Many things: all interfaces are parsed and generated in
22054         gen-treedump.  Support for member variables, constructors,
22055         destructors, properties, constants is there.
22056
22057         Beginning of the IL backend, but very little done, just there for
22058         testing purposes. 
22059
22060 2001-04-29  Miguel de Icaza  <miguel@ximian.com>
22061
22062         * cs-parser.jay: Fix labeled statement.
22063
22064         * cs-tokenizer.cs (escape): Escape " and ' always.
22065         ref_line, ref_name: keep track of the line/filename as instructed
22066         by #line by the compiler.
22067         Parse #line.
22068
22069 2001-04-27  Miguel de Icaza  <miguel@ximian.com>
22070
22071         * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
22072         to match the values in System.CodeDOM.
22073
22074         Divid renamed to Divide.
22075
22076         * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
22077         statements. 
22078         (Statements.set): remove.
22079
22080         * System.CodeDOM/CodeCatchClause.cs: always have a valid
22081         statements. 
22082
22083         * System.CodeDOM/CodeIfStatement.cs: trueStatements and
22084         falseStatements always have valid values. 
22085
22086         * cs-parser.jay: Use System.CodeDOM now.
22087