2007-04-23 Marek Safar <marek.safar@gmail.com>
[mono.git] / mcs / mcs / ChangeLog
1 2007-04-23  Marek Safar  <marek.safar@gmail.com>
2
3         A fix for bug #81414
4         * delegate.cs: Better fix, moved ApplyAttributes from Define to Emit.
5
6 2007-04-22  Miguel de Icaza  <miguel@novell.com>
7
8         * cs-tokenizer.cs: Change various identifiers here from the
9         camelCasing to the recommended Linux-like style for instance
10         variables from the Coding Guidelines. 
11
12 2007-04-19  Martin Baulig  <martin@ximian.com>
13
14         * convert.cs
15         (Convert.ImplicitReferenceConversionCore): Allow conversions from
16         System.Enum to System.ValueType.
17
18 2007-04-13  Martin Baulig  <martin@ximian.com>
19
20         Rewrote implicit reference conversions.  We need to distinguish
21         between implicit reference conversions (13.1.4) and implicit
22         boxing conversions (13.1.5).
23
24         According to the spec, there's an an implicit conversion
25         "From a one-dimensional array-type S[] to IList<T> and base
26         interfaces of this interface, provided there is an implicit
27         reference conversion from S to T."  Note that this does not
28         include boxing conversions.
29
30         * convert.cs
31         (Convert.ImplicitTypeParameterBoxingConversion): New method.
32         (Convert.ImplicitReferenceConversion): Split into
33         ImplicitReferenceConversionCore() and
34         ImplicitBoxingConversionExist().
35         (Convert.ImplicitReferenceConversionExists): Use the new
36         ImplicitReferenceConversionCore() and ImplicitBoxingConversionExists().
37
38 2007-04-12  Martin Baulig  <martin@ximian.com>
39
40         * convert.cs (Convert.ImplicitReferenceConversion): Move the
41         `TypeManager.null_type' checks up to the top of the method.
42
43 2007-04-11  Marek Safar  <marek.safar@gmail.com>
44
45         A fix for bug #81350
46         * class.cs, decl.cs, ecore.cs, namespace.cs: The optimization for private
47         extension methods.
48
49 2007-04-11  Martin Baulig  <martin@ximian.com>
50
51         * statement.cs (Foreach.CollectionForeach.ProbeCollectionType):
52         Use `TypeManager.GetInterfaces(t)' rather than `t.GetInterfaces()'
53         to make this work for generic classes; fixes #79561.
54
55 2007-04-11  Martin Baulig  <martin@ximian.com>
56
57         * expression.cs (As): Add support for nullable types; fixes #79371.
58
59 2007-04-11  Martin Baulig  <martin@ximian.com>
60
61         * doc.cs (DocUtil.GetSignatureForDoc): Don't crash if
62         `type.FullName' is null; fixes #80243.
63
64 2007-04-11  Martin Baulig  <martin@ximian.com>
65
66         * expression.cs (Invocation.IsApplicable): Don't modify the method
67         if type inference succeeded, but the method was not applicable.
68         Fixes #81250.
69
70 2007-04-10  Marek Safar  <marek.safar@gmail.com>
71
72         A fix for bug #81324
73         * namespace.cs (Namespace.LookupExtensionMethod): Always inspect both
74         internal and external namespaces containers.
75
76 2007-04-10  Martin Baulig  <martin@ximian.com>
77
78         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Use
79         TypeManager.DropGenericMethodArguments() so we also call
80         IMethodData.SetMemberIsUsed() for generic methods.  Fixes #80357.
81
82 2007-04-10  Martin Baulig  <martin@ximian.com>
83
84         * iterators.cs (Iterator.CreateIterator): Don't crash if
85         `method.ReturnType' is null.  This happens if something went wrong
86         while resolving that typ (we already reported an error in this case).
87
88 2007-04-10  Martin Baulig  <martin@ximian.com>
89
90         * expression.cs (New.DoResolve): Don't call CheckComImport() on
91         generic interfaces; report the CS0144 directly.
92
93 2007-04-10  Martin Baulig  <martin@ximian.com>
94
95         * ecore.cs (MemberExpr.ResolveMemberExpr): If `left' is a
96         `TypeExpr', call ResolveAsTypeTerminal() on it; fixes #81180.
97
98 2007-04-10  Martin Baulig  <martin@ximian.com>
99
100         * expression.cs (New.DoEmitTypeParameter): Fix #81109.
101
102 2007-04-09  Raja R Harinath  <rharinath@novell.com>
103
104         A better fix
105         * flowanalysis.cs (UsageVector.MergeChild): Handle child.Block == null.
106         * statement.cs: Use KillFlowBranching only in ResolveUnreachable.
107
108         Fix #81338
109         * statement.cs (For.Resolve): If resolution fails, use
110         KillFlowBranching.
111
112 2007-04-08  Marek Safar  <marek.safar@gmail.com>
113
114         * anonymous.cs (MakeName): Make faster and zero-based.
115         (VerifyExplicitParameterCompatibility): Back to mode where generic
116         parameter is ignored.
117         (AnonymousMethodMethod.Emit): Decorate method as compiler generated.
118
119         * class.cs (EmitType): Method can emit another new method.
120
121         * cs-tokenizer.cs (IsLinqEnabled): Fixes static cctor race.
122
123         * driver.cs: Updated.
124
125         * lambda.cs: Reuse predefined empty parameters.
126
127         * parameter.cs: Updated
128
129         * support.cs: Implemented InflateTypes.
130
131         * typemanager.cs (GetFullName): Don't use FullName as it can be null.
132         (InitSystemCore): Introduced to isolate 3.0 dependencies.
133
134 2007-04-03  Martin Baulig  <martin@ximian.com>
135
136         Fix #80632.
137
138         * statement.cs (Foreach.CollectionForeach.TryType): Use a custom
139         version of TypeManager.IsOverride() which also works with generic
140         types.  
141
142 2007-04-03  Martin Baulig  <martin@ximian.com>
143
144         Fix #81044.
145
146         * convert.cs
147         (Convert.ExplicitReferenceConversion): We need to cast when
148         converting from IList<T> to S[].
149
150 2007-04-01  Marek Safar  <marek.safar@gmail.com>
151
152         * decl.cs (FindExtensionMethods): Consider all candidates with same name
153         at this level.
154         
155         * expression.cs (MemberAccess.DoResolve): Cache resolved expression.
156
157 2007-03-31  Marek Safar  <marek.safar@gmail.com>
158
159         * anonymous.cs (AnonymousMethodExpression.Compatible): Handles both
160         argument and return type inferring.
161
162         * codegen.cs (InferReturnType): Flag whether return can be inferred.
163         (ReturnType): Turned to property.
164
165         * statement.cs (Return): Implemented return type inferring.
166
167         * support.cs (ReflectionParameters): Use local types if possible.
168
169 2007-03-30  Raja R Harinath  <rharinath@novell.com>
170
171         * flowanalysis.cs (FlowBranching.Reachability): Remove.
172         (FlowBranching.UsageVector): Update to changes.
173
174         Prepare to kill 'Reachability'
175         * flowanalysis.cs (UsageVector): Remove 'Reachability' from
176         argument of constructor.
177
178 2007-03-29  Raja R Harinath  <rharinath@novell.com>
179
180         Prepare to kill 'Reachability'
181         * flowanalysis.cs (UsageVector.is_unreachable): New.
182         (UsageVector): Update to maintain 'is_unreachable' in parallel to
183         'reachability', and verify they're consistent.
184
185         Fix #81121
186         * expression.cs (New.EmitStatement): Handle type parameters here too.
187
188 2007-03-29  Martin Baulig  <martin@ximian.com>
189
190         Fix #79148.
191
192         * anonymous.cs
193         (ScopeInfo.ctor): Use `Modifiers.PUBLIC' if we're a nested
194         CompilerGeneratedClass.
195         (ScopeInfo.EmitScopeInstance): Make this protected.
196         (CapturedVariable.EmitInstance): Use `Ldarg_0' if
197         `ec.CurrentAnonymousMethod.Scope == Scope'.
198
199         * statement.cs (Block.ScopeInfo): Make this a property.
200
201 2007-03-27  Raja R Harinath  <harinath@gmail.com>
202
203         Prepare to kill 'Reachability'
204         * flowanalysis.cs (FlowBranching.Reachability): Make class private.
205         (FlowBranching.UsageVector.Reachability): Remove property.
206         (FlowBranching.UsageVector.IsUnreachable): New property.
207         (FlowBranching.UsageVector.ResetBarrier): New.
208         (FlowBranching.UsageVector, FlowBranchingLabeled): Update to changes.
209         * codegen.cs, statement.cs: Update to changes.
210
211 2007-03-27  Martin Baulig  <martin@ximian.com>
212
213         Fix #81209.
214
215         * decl.cs
216         (DeclSpace.LookupNestedTypeInHierarchy): Correctly handle nested
217         generic types.
218
219 2007-03-26  Raja R Harinath  <rharinath@novell.com>
220
221         * flowanalysis.cs (FlowBranching.Reachability): Use a boolean
222         instead of TriState.  Remove all mention of TriState.
223
224         * flowanalysis.cs (FlowBranching.Reachability): Prepare to be
225         replaced by a boolean.  Add boolean 'is_unreachable' field, check
226         and maintain invariants.
227
228 2007-03-25  Marek Safar  <marek.safar@gmail.com>
229
230         * anonymous.cs: Restored checks disabled for uninflated anonymous methods.
231
232 2007-03-25  Marek Safar  <marek.safar@gmail.com>
233
234         * expression.cs: Stop using obsolete 2.0 opcodes.
235
236 2007-03-25  Marek Safar  <marek.safar@gmail.com>
237
238         * enum.cs (EnumMember.Define): Fixed regression and slowdown caused by
239         one of the latests Martin's fixes.
240
241 2007-03-23  Miguel de Icaza  <miguel@novell.com>
242
243         * expression.cs: On BigEndian systems, swap the bytes, temporary
244         solution until we get a new bitconverter class.
245
246 2007-03-23  Martin Baulig  <martin@ximian.com>
247
248         Fix #81158.
249
250         * decl.cs (MemberCache.AddMembers): Add generic methods both as
251         "Method" and "Method`1".  Normally, a cache lookup is done on the
252         "Method" form (ie. without the generic arity), but this one makes
253         lookups on the full form work as well.
254
255 2007-03-22  Raja R Harinath  <rharinath@novell.com>
256
257         * flowanalysis.cs (Reachability): Reorganize slightly, and remove
258         unused properties.
259
260 2007-03-20  Bill Holmes  <billholmes54@gmail.com>
261         * class.cs: 
262         Added 2 MemberCoreArrayList objects, ordered_explicit_member_list and
263         ordered_member_list, to TypeBuilder to store members to be defined
264         in the order they were parsed in.
265         - ordered_explicit_member_list contains all properties indexers
266           and methods that are defined as explicit implementation of an
267           interface or base class.
268         - ordered_member_list contains all properties indexers and methods
269           that are not defined as explicit implementation of an interface
270           or base class.
271
272         Removed MethodArrayList and IndexerArrayList from TypeBuilder.  The 
273         functionality in these removed classes has been replaced with 
274         ComputeIndexerName, EmitIndexerName, HasEqualss, HasGetHashCode, and 
275         CheckEqualsAndGetHashCode members defined and called in the TypeBuilderClass.
276
277         Adding CheckForDuplications to PropertyBase.PropertyMethod and calls
278         to CheckForDuplications inside GetMethod and SetMethod Define Method
279         to handle method property and indexer name conflicts.
280
281         Fixes #79434
282
283         All code is contributed under the MIT/X11 license.
284
285 2007-03-20  Martin Baulig  <martin@ximian.com>
286
287         * class.cs (TypeContainer.Interfaces): Removed; they're now
288         included in `TypeContainer.Types'.
289
290 2007-03-20  Martin Baulig  <martin@ximian.com>
291
292         Fix #77963, #80314 and #81019.  Added gtest-317, ..., gtest-320.
293
294         * class.cs (TypeContainer.CreateType): New public method.  This is
295         now called before DefineType() to create the TypeBuilders.
296         (TypeContainer.DefineType): Don't create the TypeBuilder here; it
297         has already been created by CreateType().
298         (TypeContainer.DefineTypeBuilder): Renamed into CreateTypeBuilder();
299         don't resolve our base classes here; this has been moved into
300         DefineBaseTypes().  We're now called from CreateType().
301         (TypeContainer.DefineBaseTypes): New private method; resolve our
302         base classes here.  We're now called from DefineType().
303
304         * rootcontext.cs
305         (RootContext.ResolveTree): Call TypeContainer.CreateType() on all
306         our types first to create all the TypeBuilders.  After that, call
307         TypeContainer.DefineType() on all the types which'll resolve their
308         base classes and setup the resolve order.
309
310 2007-03-20  Martin Baulig  <martin@ximian.com>
311
312         * class.cs (TypeContainer.Enums): Removed; they're now included in
313         `TypeContainer.Types'.  
314
315 2007-03-20  Martin Baulig  <martin@ximian.com>
316
317         * class.cs
318         (TypeContainer.DefineType): Don't call ResolveMembers() here.
319         (TypeContainer.DoResolveMembers): Call DefineType() on our
320         `compiler_generated' classes; moved here from DefineNestedTypes().
321
322         * rootcontext.cs
323         (RootContext.ResolveTree): Call ResolveMembers() on all
324         TypeContainer's in the `type_container_resolve_order'.
325
326 2007-03-19  Marek Safar  <marek.safar@gmail.com>
327
328         * class.cs: Use corlib to handle InternalMethodImplAttribute.
329
330 2007-03-17  Marek Safar  <marek.safar@gmail.com>
331
332         * class.cs (EventFieldAccessor.EmitMethod): Don't override existing
333         implementation flags.
334
335 2007-03-17  Marek Safar  <marek.safar@gmail.com>
336
337         * class.cs: More optimizations for type parameters.
338
339 2007-03-15  Marek Safar  <marek.safar@gmail.com>
340
341         * anonymous.cs (AnomymousMethod): Can be now hosted in generic container.
342
343         * ecore.cs, parameter.cs: More common code for both corlibs.
344
345         * typemanager.cs (IsGenericMethod): Simplified.
346
347 2007-03-15  Raja R Harinath  <rharinath@novell.com>
348
349         * flowanalysis.cs (FlowBranching.Reachability): Remove handling of
350         'returns'.
351         * statement.cs, iterators.cs, lambda.cs: Update to changes.
352
353         * statement.cs (Lock.Resolve): Invoke 'ec.NeedReturnLabel'
354         unconditionally.  Simplify explanation.
355         (Try.Resolve, Using.Resolve): Likewise.
356
357 2007-03-15  Martin Baulig  <martin@ximian.com>
358
359         Fix #80731.
360
361         * decl.cs (DeclSpace): If we're a partial class, use our
362         `PartialContainer's `TypeParameters' and `CurrentTypeParameters'.
363
364 2007-03-15  Raja R Harinath  <rharinath@novell.com>
365
366         * flowanalysis.cs (FlowBranching.Reachability): Remove handling of
367         'throws'.
368         (FlowBranching.UsageVector): Update to changes.
369         (FlowBranching.MergeSiblings): Likewise.
370         * statement.cs: Likewise.
371
372 2007-03-15  Martin Baulig  <martin@ximian.com>
373
374         Fix #79302.
375
376         * decl.cs
377         (MemberCache): Added a special .ctor for type parameters.
378
379         * typemanager.cs
380         (TypeManager.MemberLookup_FindMembers): `TypeParameter' now has a
381         `MemberCache'.  
382
383 2007-03-09  Martin Baulig  <martin@ximian.com>
384
385         * enum.cs (Enum): Make this a TypeContainer.
386         (EnumMember): Derive from `Const'.
387
388         * const.cs
389         (Const.DoResolveValue): New protected virtual method; move most of
390         the functionality of ResolveValue() here so we can override it in
391         `EnumMember'.
392         (Const.CreateConstantReference): Make this virtual.
393
394         * class.cs (Kind): Add `Kind.Enum'.
395         (TypeContainer.Emit): Don't emit the enums here; they're already
396         in the `RootContext.typecontainer_resolve_order'.
397
398         * rootcontext.cs (RootContext.EmitCode): Don't emit the enums
399         here; they're already in the `typecontainer_resolve_order'.
400
401         * ecore.cs (EnumConstant.ConvertImplicitly): Add
402         TypeManager.DropGenericTypeArguments().
403
404         * typemanager.cs
405         (TypeManager.CSharpEnumValue): Add DropGenericTypeArguments().
406         (TypeManager.IsEnumType): Likewise.
407         (TypeManager.EnumToUnderlying): Likewise.
408         (TypeManager.IsEqual): Add support for enums.
409
410 2007-03-12  Raja R Harinath  <rharinath@novell.com>
411
412         * typemanager.cs (InitCoreTypes) [NET_2_0]: Allow
413         DefaultParameterValueAttribute to be undefined, say if System.dll
414         is not referenced.
415
416 2007-03-11  Marek Safar  <marek.safar@gmail.com>
417
418         * ecore.cs, parameter.cs, typemanager.cs: Another gmcs fix to work with
419         any mscorlib.
420
421 2007-03-10  Marek Safar  <marek.safar@gmail.com>
422
423         * class.cs, parameter.cs: Unified parameters verification.
424
425 2007-03-08  Martin Baulig  <martin@ximian.com>
426
427         * cs-parser.jay (constructor_header): Pass the location to the
428         newly created TopLevelBlock.
429
430 2007-03-07  Martin Baulig  <martin@ximian.com>
431
432         * statement.cs (Block.Resolve): Don't crash on error; bug #80715.
433
434 2007-03-06  Miguel de Icaza  <miguel@novell.com>
435
436         * convert.cs (ExplicitReferenceConversionExists): Sync this method
437         with the changes from David, fixes the build.
438
439 2007-03-05  David Mitchell  <dmitchell@logos.com>
440
441         * convert.cs: Implement From System.Collecitons.Generic.IList<T>
442         and its base interfaces to a one-dimensional array type S[],
443         provided there is an implicit or explicit reference conversion
444         from S to T.
445
446 2007-03-03  Marek Safar  <marek.safar@gmail.com>
447
448         * cs-tokenizer.cs: Implemented basic linq grammar.
449
450         * driver.cs: Set linq lang version on demand.
451
452 2007-02-26  Marek Safar  <marek.safar@gmail.com>
453
454         * cs-parser.jay, expression.cs: Compile empty __arglist correctly.
455
456 2007-02-25  Marek Safar  <marek.safar@gmail.com>
457
458         * attribute.cs: Replaced DefinePInvoke in favor of S.R.E implementation
459         (Fixes #80455)
460
461         * class.cs (InterfaceMemberBase): Share common `extern' modifier checks
462         here.
463         Check property and event extern attributes.
464
465         * codegen.cs (ModuleClass): HasDefaultCharSet when module defined global
466         charset.
467
468 2007-02-24  Marek Safar  <marek.safar@gmail.com>
469
470         A fix for bug #80407
471         * ecore.cs: Don't report ambiguity error when methods have same parent.
472
473 2007-02-23  Marek Safar  <marek.safar@gmail.com>
474
475         A fix for bug #80878
476         * class.cs, cs-parser.jay: Event property can host anonymous methods.
477
478 2007-02-22  Marek Safar  <marek.safar@gmail.com>
479
480         * attribute.cs: Enable ExtensionAttribute presence test.
481
482 2007-02-22  Marek Safar  <marek.safar@gmail.com>
483
484         * class.cs: Warn about missing GetHashCode only when Equals is override.
485
486         * decl.cs: Check accessibility of type arguments.
487
488         * typemanager.cs: Correctly report nullable array.
489
490 2007-02-20  Marek Safar  <marek.safar@gmail.com>
491
492         * class.cs, report.cs: Capture more details when things go wrong.
493
494 2007-02-20  Marek Safar  <marek.safar@gmail.com>
495
496         A fix for bug #80650
497         * cs-parser.jay: Anonymous container starts at constructor declaration
498         and not at block beginning because it has to be usable in constructor
499         initializer.
500
501         * statement.cs: Use context location and not block one for error reporting.
502
503 2007-02-18  Marek Safar  <marek.safar@gmail.com>
504
505         A fix for bug #78712
506         * class.cs.cs, decl.cs, ecore.cs: LookupAnyGeneric inspects nested types
507         too.
508
509 2007-02-18  Marek Safar  <marek.safar@gmail.com>
510
511         A fix for bug #80493 by Atsushi Enomoto
512         * cs-parser.jay: Ignore invalid attribute target.
513
514 2007-02-18  Marek Safar  <marek.safar@gmail.com>
515  
516         * cs-tokenizer.cs: Ignore '\0' as white space character.
517
518 2007-02-17  Miguel de Icaza  <miguel@novell.com>
519
520         * cs-parser.jay: Add support for lambda expressions to the mcs
521         compiler as well.
522
523         * lambda.cs: Only clone when we are probing, not on the final call
524         (Compatible is the final call). 
525
526         * statement.cs (CloneContext): Introduce class to provide block
527         remapping during clone.
528
529         All statements Clone themselves now.
530
531         (Clone): special handling for blocks, when we clone a block, we
532         register the block inside this routine, as children of the block
533         might trigger a lookup. 
534         
535         * expression.cs: Add support for CloneContext in all expressions. 
536         
537 2007-02-17  Marek Safar  <marek.safar@gmail.com>
538  
539         A fix for bug #80493
540         * statement.cs: Report ambiguous warning when interfaces are not related.
541
542 2007-02-15  Marek Safar  <marek.safar@gmail.com>
543
544         C# 3.0 extension methods.
545
546         * attribute.cs (Error_MisusedExtensionAttribute): Extension attribute
547         cannot be used directly.
548
549         * class.cs (Class.Emit): Emit extension attribute if any class method
550         is extension method.
551         (Method.Define): Add basic extension method validation conditions.
552         (Method.Emit): Emit extension attribute for method.
553
554         * codegen.cs (AssemblyClass): Emit extension attribute if at least one
555         extension method exists. Currently we follow same approach as Microsoft
556         does, emit even if a method or a class are private but this can change
557         later.
558
559         * cs-parser.jay: Add handling of `this' keyword in method parameters
560         context.
561
562         * decl.cs (DeclSpace.IsStaticClass): New property.
563         (MemberCache.FindExtensionMethods): Looks for extension methods with
564         defined name and extension type.
565
566         * doc.cs: Updated after OverloadResolve changes.
567
568         * driver.cs: Add new soft reference to System.Core.dll.
569
570         * ecore.cs (MethodLookup): Can return only MethodGroupExpr.
571         (ExtensionMethodGroupExpr): Represents group of extension methods.
572
573         * expression.cs (Invocation): Moved methods BetterConversion, MoreSpecific,
574         BetterFunction, IsOverride, IsAncestralType, OverloadResolve
575         to MethodGroupExpr and made non-static for easier customization.
576         (Invocation.DoResolve): Add extension method lookup when no standard
577         method was found.
578         (MemberAccess.DoResolve): Try extension methods if no member exists.
579
580         * modifiers.cs: Add METHOD_EXTENSION modifier.
581
582         * namespace.cs (RegisterExtensionMethodClass): Register class namespace
583         as well as candidate extension type.
584         (ComputeNamespaces): When assembly constains extension methods registers
585         them.
586         (Namespace.RegisterExternalExtensionMethodClass): Register type for later
587         extension method lookup.
588         (Namespace.LookupExtensionMethod): Looks for extension method in this
589         namespace.
590         (NamespaceEntry.LookupExtensionMethod): Does extension methods lookup to
591         find a method which matches name and extensionType.
592
593         * parameter.cs (Parameter): Add This modifer.
594         (HasExtensionMethodModifier): New property.
595         (Resolve): Add extension parameter check.
596         (ModFlags): turned to property to exclude this modifier as it is not real
597         parameter modifier.
598         (Parameters): Implemented ExtensionMethodType and HasExtensionMethodType.
599
600         * support.cs (ParameterData): Add ExtensionMethodType.
601         (ReflectionParameters): Implemented ExtensionMethodType interface property.
602
603         * typemanager.cs: Add type and ctor extension attribute type.
604
605 2007-02-15  Miguel de Icaza  <miguel@novell.com>
606
607         * report.cs (DisableErrors, EnableErrors): used to prevent error
608         output when we are "trying" to compile various methods with
609         different types. 
610
611         * ecore.cs (Expression): Add Clone method that calls the virtual
612         CloneTo method.  The current CloneTo method in Expression throws
613         an exception so we can track down all the places where this must
614         be implemented (not using abstract, because that would be a lot of
615         up-front-work before we can start testing the implementation
616         idea). 
617
618         Important: we only need Clone capabilities for expressions created
619         by the parser, as the expressions we will be cloning are
620         expressions in the pre-resolved state.   This vastly simplifies
621         the work required. 
622         
623         (SimpleName): Add CloneTo that does nothing.
624         (EmptyCast): Add CloneTo.
625         
626         * expression.cs (Binary): Implement CloneTo.
627         (Invocation.IsApplicable): Store the current ec in
628         EmitContext.TempEc and restore it on return.  This is used so we
629         do not have to sprinkle hundres of methods with an extra
630         EmitContext, we know that the only user is the lambda expression
631         ImplicitConversionExists code. 
632         
633         (Argument): Add Cloning capabilities.
634         (LocalVariableReference, ParenthesizedExpression, Unary, Probe,
635         Cast, Conditional, ArrayCreation, InvocationOrCast, Invocation,
636         ArglistAccess, ArgList, TypeOf, SizeOf, CheckedExpr,
637         UnCheckedExpr, ElementAccess, BaseAccess, BaseIndexerAccess,
638         IndexerAccess): Add Clone capability.
639
640         (LocalVariableReference, This): TODO: needs cloned Block mapping.
641
642         (Argument): Add cloning capability.
643
644         * assign.cs (Assign): Implement CloneTo.
645
646         * anonymous.cs (ImplicitStandardConversionExists): Make virtual.
647         
648         * lambda.cs (ImplicitStandardConversionExists): Implement lambda
649         version by calling Convert with the EmitContext (that we are
650         currently storing in ec, this is not great, but will do for now,
651         to avoid passing EmitContext parameters to hundreds of functions
652         that do not need them now).
653
654         (SetExpression): Remove, it is not needed.
655         
656         (ContextualReturn): Implement CloneTo.
657
658         * statement.cs (Statement): Implement cloning infrastructure,
659         similar to expressions.
660
661         (Block): Partial implementation of Clone for statements.
662
663         (Return): Implement clone.
664         
665         * constant.cs (Constant.CloneTo): New method, does nothing.
666
667         * codegen.cs (TempEc): Add a static EmitContext as a temporary
668         solution, until we decide how to exactly do this.  
669         
670 2007-02-14  Marek Safar  <marek.safar@gmail.com>
671  
672         A fix for bug #80493
673         * class.cs (FindOutBaseMethod): When the base accessor does not exist and
674         a property is override we need to use second accessor.
675
676 2007-02-13  Marek Safar  <marek.safar@gmail.com>
677  
678         A fix for bug #80418
679         * attribute.cs, class.cs: Use correct calling conventions for pinvoke
680         methods.
681
682 2007-02-13  Marek Safar  <marek.safar@gmail.com>
683
684         Another fix for bug #80749
685         * pending.cs: Abstract class has priority over interfaces.
686
687 2007-02-13  Marek Safar  <marek.safar@gmail.com>
688
689         Another fix for bug #80749
690         * pending.cs: Abstract class has priority over interfaces.
691
692 2007-02-13  Marek Safar  <marek.safar@gmail.com>
693
694         Another fix for bug #80749
695         * pending.cs: Abstract class has priority over interfaces.
696
697 2007-02-13  Marek Safar  <marek.safar@gmail.com>
698
699         Another fix for bug #80749
700         * pending.cs: Abstract class has priority over interfaces.
701
702 2007-02-13  Marek Safar  <marek.safar@gmail.com>
703
704         * class.cs Better error message.
705
706         * driver.cs: Add shorter versions of -optimize option.
707
708 2007-02-13  Martin Baulig  <martin@ximian.com>
709
710         * class.cs (Constructor.Emit): Check the return value of
711         ec.ResolveTopBlock() and return on error.
712
713 2007-02-13  Raja R Harinath  <rharinath@novell.com>
714
715         * ecore.cs (Error_InvalidExpressionStatement): Add a comma to error
716         message to fix error message regression.
717
718 2007-02-12  Marek Safar  <marek.safar@gmail.com>
719
720         * delegate.cs: Delegate creation expression cannot be of Nullable type.
721
722 2007-02-12  Marek Safar  <marek.safar@gmail.com>
723
724         A fix for bug #80749
725         * assign.cs (FieldInitializer): FieldInitializer has to keep track of
726         its parent container.
727
728         * class.cs (DefineFieldInitializers): Each initializer can has different
729         resolve context.
730
731         * const.cs: Updated.
732
733 2007-02-11  Miguel de Icaza  <miguel@novell.com>
734
735         * lambda.cs (LambdaExpression.Compatible): Remove some early code,
736         now all the heavy lifting to check that embedded statements or
737         expressions have the right form is done in the ContextualReturn.
738
739         (ContextualReturn): New class.  
740
741         * ecore.cs (Error_InvalidExpressionStatement): Make a helper
742         method that can be invoked to report 201, so we do not replicate
743         this everywhere.
744
745         * cs-parser.jay: Reuse Error_InvalidExpressionStatement.
746         
747         * cs-tokenizer.cs (xtoken): Correctly compute the column, it was
748         treating tabs as spaces. 
749
750 2007-02-09  Marek Safar  <marek.safar@gmail.com>
751
752         A fix for bug #80315 by martin.voelkle@gmail.com (Martin Voelkle)
753         * assign.cs: Use full implicit conversion for right side check.
754
755 2007-02-09  Marek Safar  <marek.safar@gmail.com>
756
757         * statement.cs (Switch): Switch over boolean type is not standardized.
758
759 2007-02-08  Marek Safar  <marek.safar@gmail.com>
760
761         A fix for bug #80755
762         * decl.cs (FindBaseEvent): Don't use method cache for events.
763
764 2007-02-07  Marek Safar  <marek.safar@gmail.com>
765
766         * cs-parser.jay: Better syntax error handling.
767
768         * ecore.cs, enum.cs, statement.cs, typemanager.cs: Print enum member name
769         instead of underlying type value.
770
771 2007-02-06  Marek Safar  <marek.safar@gmail.com>
772
773         * driver.cs: Check define identifier before is registered.
774
775         * namespace.cs: Use existing error message.
776
777         * report.cs: New warning.
778
779 2007-02-06  Marek Safar  <marek.safar@gmail.com>
780
781         A fix for bug #80742
782         * expression.cs: Delegate Invoke method can be called directly.
783
784 2007-02-06  Marek Safar  <marek.safar@gmail.com>
785
786         A fix for bug #80676
787         * class.cs (IsEntryPoint): The Main method can have params modifier.
788
789 2007-02-04  Miguel de Icaza  <miguel@novell.com>
790
791         * parameter.cs (Parameter, Parameters): Add Clone method.
792
793         * anonymous.cs (Compatible): Turn method into virtual method, so
794         LambdaExpression can implement a different behavior.
795
796         (CompatibleChecks, VerifyExplicitParameterCompatibility): Factor
797         out the basic checking here, so it can be used by
798         LambdaExpressions.
799         
800         * lambda.cs: Introduce "Compatible" function that will do the
801         heavy lifting.
802
803 2007-02-02  Marek Safar  <marek.safar@gmail.com>
804
805         * attribute.cs: Unified one error message.
806
807         * class.cs (Class): Use type attributes and not properties to test static
808         class.
809         (IsEntryPoint): Don's pass local variable.
810
811         * convert.cs: Removed duplicate check.
812
813         * decl.cs, doc.cs, ecore.cs (LookupType): Renamed to LookupNamespaceOrType.
814
815         * driver.cs: Don't crash when soft reference does not exist.
816
817         * namespace.cs (EnsureNamespace): Renamed to RegisterNamespace.
818         (UsingEntry): Removed redundant allocation.
819
820         * parameter.cs: Add fast path for type parameters.
821
822         * support.cs: Don't allocate attribute when it's not used.
823
824 2007-01-30  Miguel de Icaza  <miguel@novell.com>
825
826         * anonymous.cs
827         (AnonymousMethodExpression.ImplicitStandardConversionExists): turn
828         this into a virtual method, so we can override it in LambdaExpression.
829
830         * driver.cs: Improve diagnostics in case of failure. 
831
832         * cs-tokenizer.cs: Instead of trying to parse a type and a name,
833         write a function that is slightly more complex and that parses:
834
835         type identifier [, type identifier]* )
836
837         The old function would return incorrectly a OPEN_PARENS_LAMBDA for
838         this expression:
839
840                 (canEmpty ? i >= 0 : i > 0)
841
842 2007-01-30  Raja R Harinath  <rharinath@novell.com>
843
844         * cs-tokenizer.cs (parse_namespace_or_typename): Don't throw an
845         exception on possibly valid code.
846
847 2007-01-29  Raja R Harinath  <rharinath@novell.com>
848
849         * cs-tokenizer.cs (is_punct) ['<']: Update to changes in
850         Push/PopPosition.
851         (parse_opt_type_arguments): Remove.  It's almost the same as
852         parse_less_than.
853         (parse_namespace_or_typename): Use parse_less_than.
854
855 2007-01-28  Miguel de Icaza  <miguel@novell.com>
856
857         * cs-tokenizer.cs: Typo fix, its not GMCS_SOURCES but GMCS_SOURCE,
858         this bug took a few hours to find, because the state saved and
859         restored by PushPosition and PopPosition was ignoring the state of
860         parse_generic_less_than.
861
862         I can also now remove the handling of OP_LT and OP_GT, this solves
863         the big mistery.
864         
865         * cs-tokenizer.cs: store the location for the ARROW token, we use
866         that in the parser.
867
868         (PushPosition, PopPosition): save/restore also `current_token',
869         restore `parse_generic_less_than' (was missing).
870
871         (parse_opt_type_arguments): use parse_type, not
872         parse_namespace_or_typename to parse types.
873
874         * lambda.cs: Empty new file, will eventually have the lambda
875         expression implementation.
876
877         * lambda.test: used to test the internal tokenizer. 
878
879         * report.cs (FeatureIsNotISO1): Rename from
880         FeatureIsNotStandardized, because it was about the language level
881         (1 vs 2) it was not about standarization.
882
883         (FeatureRequiresLINQ): New.
884
885         * support.cs (SeekableStreamReader): Only require that the reader
886         is a TextReader, not a StreamReader, so we can plug StringReader. 
887
888         * cs-tokenizer.cs (parse_type_and_parameter): Returns true if at a
889         given position in the input stream the following tokens can be
890         parsed as a type followed by an identifier.
891
892         (is_punct): after a '(' if parse_type_and_parameter returns true,
893         then return a special token OPEN_PARENS_LAMBDA which is used to
894         avoid reduce/reduce errors in the grammar for the
895         lambda_expression rules.
896
897         (parse_type): implement a type parser inside the
898         tokenizer, the parser only returns true or false depending on
899         whether the input at a given position can be parsed as a type.
900
901         (peek_token): new method used during type parsing.
902
903 2007-01-28  Raja R Harinath  <rharinath@novell.com>
904
905         Fix #80531
906         * anonymous.cs (ScopeInfo.InflateParameters): New.
907         (AnonymousContainer.Resolve): Use it to redirect types of
908         delegate parameters.
909
910 2007-01-27  Raja R Harinath  <rharinath@novell.com>
911
912         Fix #80530
913         * expression.cs (Error_InvalidArguments): Don't use two different
914         messages for CS1503.  Use ExtraInformation and
915         SymbolRelatedToPreviousError instead.
916
917         Fix #80358
918         * decl.cs (DeclSpace.initialize_type_params): Don't access
919         'type_params' of a partial class directly.
920
921 2007-01-26  Miguel de Icaza  <miguel@novell.com>
922
923         * constant.cs: Removed a handful of out-of-range checks that were
924         not necessary. 
925
926 2007-01-25  Marek Safar  <marek.safar@gmail.com>
927
928         * expression.cs (CheckUselessComparison): Add additional check for char
929         constants.
930
931         * namespace.cs: Fixed typo.
932
933 2007-01-23  Miguel de Icaza  <miguel@novell.com>
934
935         * constant.cs: Bloat removal, CheckRange and CheckUnsigned are
936         gone, instead we inline the test, preventing the needless casts to
937         longs, ulongs and doubles for the parameters, avoiding calls to
938         methods that overchecked stuff, and instead inlined things
939         nicely. 
940
941 2007-01-20  Marek Safar  <marek.safar@gmail.com>
942
943         * cs-parser.jay: Better parameter error handling.
944
945 2007-01-17  Marek Safar  <marek.safar@gmail.com>
946
947         A fix for bug #80368, #80522
948         * expression.cs (ArrayCreation.only_constant_initializers): Indicates
949         whether array initializer contains constants only.
950         (ArrayCreation.Emit): Use better formula to decide when
951         are array initializers for static initialization.
952         (ArrayCreation.EmitDynamicInitializers): When the array is small enough we
953         have to emit even constants otherwise they are pre-initialized.
954
955 2007-01-17  Bill Holmes  <bill.holmes@ansys.com>
956             Raja R Harinath  <rharinath@novell.com>
957
958         Fix emit order of 'get' vs. 'set'.
959         * support.cs (Accessors): New.
960         * cs-parser.jay (accessor_declarations): Use it instead of 'Pair'.
961         Note the order in which accessors are declared in the source.
962         * class.cs (PropertyBase.DefineGet, PropertyBase.DefineSet): New.
963         Refactored from Property.Define and Indexer.Define.
964         (PropertyBase.DefineAccessors): New helper that calls the above in
965         appropriate order as noted by the parser.
966         (Property.Define, Indexer.Define): Update to changes.
967         (PropertyBase.SetMethod.PropertyInfo): Don't return a null.
968
969 2007-01-17  Raja R Harinath  <rharinath@novell.com>
970
971         Fix cs0029-6.cs and gcs0029-2.cs (regression)
972         * ecore.cs (EmptyConstantCast.ConvertImplicitly): Check that
973         there's an implicit conversion from the current type to the target
974         type before converting the underlying constant.
975
976 2007-01-16  Marek Safar  <marek.safar@gmail.com>
977
978         * const.cs (ResolveValue): Updated after constant conversion was made more
979         generic.
980
981         * constant.cs (GetAttributableValue): constant to object conversion is
982         used for attributes only.
983         (IntConstant.ConvertImplicitly): Moved from convert to be used in all
984         constant conversions.
985         (LongConstant.ConvertImplicitly): Ditto.
986
987         * convert.cs (ImplicitNumericConversion): Extracted constant bussiness.
988         (ImplicitConversionStandard): Handle constant conversion as extra step.
989         It solves the issue when constant conversion was called indirectly like
990         inside array initializer and constant folding was skipped.
991
992         * literal.cs (NullLiteral.ConvertImplicitly): Fixed an issue exposed by
993         this change.
994
995         * statement.cs(ImplicitConversionStandard): Updated after constant
996         conversion was made more generic.
997
998 2007-01-16  Sergey P. Kondratyev <se@unicom.tomica.ru>
999
1000         * expression.cs (As.DoResolve): Use GenericConstraints instead of
1001         Constraints, solves the problem where the compiler incorrectly
1002         reported that a type parameter was not constrained to a class (Bug
1003         80518)
1004
1005 2007-01-14  Marek Habersack  <grendello@gmail.com>
1006
1007         * doc-bootstrap.cs: Fix a compilation problem in the bootstrap phase.
1008
1009 2007-01-14  Marek Safar  <marek.safar@gmail.com>
1010
1011         A fix for bug #80368
1012         * assign.cs (FieldInitializer): New class implements field
1013         initializer statement.
1014
1015         * attribute.cs: Update after FieldMember rename.
1016
1017         * class.cs (PropertyBasedMember): New common class for property based
1018         types.
1019         (InterfaceMemberBase): New base class for all members which can be used as
1020         an interface members.
1021         (MethodCore): Moved really common code to InterfaceMemberBase.
1022         (Method.Define): Equal and GetHasCode detection is relevant for methods
1023         only.
1024         (MethodData.Define): Don't assume that public event implements an
1025         interface automatically.
1026         (MethodData.DefineMethodBuilder): Issue an error even if only extern
1027         modifier is used.
1028         (MemberBase): Moved all interface speficic code to InterfaceMemberBase.
1029         (FieldMember): Merged with FieldBase.
1030         (EventProperty.AEventPropertyAccessor): New specialization to check whether
1031         event extern modifier can be used.
1032         (EventField.EventFieldAccessor): Moved event field specific code here.
1033         (Event.AllowedModifiers): Even event can be extern.
1034         (Event.FindOutBaseMethod): New override specific to events.
1035         (Indexer.parameters): Reintroduce parameters because base class holds
1036         only properties common data.
1037         (Indexer.CheckForDuplications): Indexers are threated as methods so we
1038         need do extra parameters check.
1039
1040         * const.cs: Update after FieldMember rename.
1041
1042         * decl.cs (MemberCache.FindBaseEvent): New method.
1043
1044         * doc.cs (GetMethodDocCommentName): Accept parameters as extra argument
1045         to reflect that indexer is now derived from PropertyBased.
1046
1047         * ecore.cs (GetMemberType): Made public.
1048         (EventExpr.ResolveMemberAccess): Use right event cache and checks for
1049         obsolete event.
1050
1051         * flowanalysis.cs, statement.cs: Update after FieldMember rename.
1052         
1053         * typemanager.cs (CSharpSignature): Correctly print event accessors.
1054         (RegisterEvent): Removed.
1055         (RegisterPrivateFieldOfEvent): Renamed to RegisterEventField.
1056         (GetPrivateFieldOfEvent): Renamed to GetEventField.
1057
1058 2007-01-11  Raja R Harinath  <rharinath@novell.com>
1059
1060         Fix #80249
1061         * statement.cs (CollectionForeach.TryType): Prefer generic
1062         GetEnumerator over non-generic variant.  Fix code to follow comments.
1063
1064 2007-01-09  Raja R Harinath  <rharinath@novell.com>
1065
1066         Fix #80446
1067         * support.cs (ReflectionParameter): Don't use an invalid index on
1068         the generic parameter data.
1069
1070 2007-01-08  Miguel de Icaza  <miguel@novell.com>
1071
1072         * driver.cs: Just add a tiny bit of infrastructure.
1073
1074 2007-01-02  Marek Safar  <marek.safar@gmail.com>
1075
1076         * class.cs (VerifyMembers): Fixed an crash reported on mono mailing list
1077         where field type is struct from current assembly.
1078         
1079         * ecore.cs (EnumConstant.AsString): Report an enum member name whenever
1080         it is possible.
1081
1082 2007-01-02  Marek Safar  <marek.safar@gmail.com>
1083
1084         A fix for bug #80381
1085         * attribute.cs (AttributeTester.RegisterNonObsoleteType): Registers
1086         the core types.
1087
1088         * namespace.cs (GlobalRootNamespace.LookupTypeReflection): Better error
1089         messages.
1090         (Namespace.LookupType): Always use core types from corlib when speficied.
1091
1092         * report.cs: A new warning.
1093
1094         * rootcontext.cs (BootstrapCorlib_ResolveInterface,
1095         BootstrapCorlib_ResolveClass): Register type as non-obsolete type.
1096         (ResolveCore): Add missing System.Runtime.InteropServices._Attribute.
1097
1098         * typemanager.cs (CoreLookupType): Register type as non-obsolete type.
1099         (InitCoreTypes): Set expression type of object_type and value_type
1100         immediately after lookup.
1101
1102 2007-01-01  Miguel de Icaza  <miguel@novell.com>
1103
1104         * cs-tokenizer.cs: Accept Pc class characters (Connector
1105         Punctuation) as valid identifiers.  Fixes #78259
1106
1107         * expression.cs (Invocation.DoResolve): Moved the check for the
1108         use of `this' for doing method calls to the Invocation resolution
1109         step, after overload resolution has taken place instead of doing
1110         the check at the low-level `This.DoResolve' level.
1111
1112         The `This.DoResolve' happens before overload resolution, so it has
1113         no way of knowing if the method that will be called will be
1114         instace or static, triggering an erroneous report for cs0188 (Bug
1115         78113).
1116
1117         We now do the check for instance method invocations after we know
1118         what method will be called.
1119
1120         (This.CheckThisUsage): Move the actual use of this structure
1121         checking into its own method and expose it. 
1122
1123         * Everywhere that called Error_ValueCannotBeConverted: pass a new
1124         EmitContext.
1125
1126         Exceptions: Null.ConvertImplicitly,
1127         Constant.ImplicitConversionRequired as there are too many call
1128         sites for passing the ec. 
1129
1130         * ecore.cs (Expression.Error_ValueCannotBeConverted): Take an
1131         EmitContext, if the value is null, then we do not try to provide
1132         the extra information from the error (If a userdefined conversion
1133         exists, as UserDefinedConversion requires a non null-EmitContext).
1134
1135         Fixes: #80347
1136
1137 2006-12-30  Raja R Harinath  <rharinath@novell.com>
1138
1139         * flowanalysis.cs (MyBitVector): Document some invariants.
1140         (MyBitVector.Or, MyBitVector.And): Reimplement the optimizations
1141         introduced below, and add a couple of others, 
1142
1143 2006-12-30  Marek Safar  <marek.safar@gmail.com>
1144
1145         * attribute.cs (GetMethodObsoleteAttribute): Uses new
1146         GetPropertyFromAccessor and GetEventFromAccessor.
1147         
1148         * class.cs (MethodCore.CheckBase): A new warning when obsolete member
1149         overrides non-obsolete one.
1150         (Indexer.Define): Error message has been moved to the parser.
1151
1152         * cs-parser.jay: Better syntax errors handling.
1153
1154         * delegate.cs (NewDelegate.DoResolve): Issue less confusing error message
1155         when an invocation has no arguments.
1156
1157         * ecore.cs: Removed not used caching.
1158
1159         * expression.cs (IsSpecialMethodInvocation): Reuses TypeManager
1160         implementation.
1161
1162         * report.cs: Add a new warning.
1163
1164         * support.cs (ReflectionParameters): Implements Equals, GetHashCode.
1165
1166         * typemanager.cs (enumeration_type): Removed.
1167         (CSharpSignature): Reuses IsSpecialMethod.
1168         (IsEqual): Hack for MS BCL.
1169         (GetPropertyFromAccessor): New method.
1170         (GetEventFromAccessor): New method.
1171         (IsSpecialMethod): Fixed to handle more cases.
1172
1173 2006-12-30  Marek Safar  <marek.safar@gmail.com>
1174
1175         * cs-tokenizer.cs (PreProcessDefinition, handle_preprocessing_directive):
1176         Made white spaces array static.
1177
1178         * ecore.cs (RemoveGenericArity): Optimized.
1179
1180         * flowanalysis.cs (MyBitVector.Or, MyBitVector.And): Optimized (up to
1181         10 times faster).
1182         (MyBitVector.initialize_vector): Simplified.
1183
1184 2006-12-22  Miguel de Icaza  <miguel@novell.com>
1185
1186         * ecore.cs: Am not entirely happy with this hack, but it seems to
1187         address the issue in 80257 (a small test case for
1188         CreativeDocs.NET). 
1189
1190         I set the MethodGroupExpr.Type to an internal compiler type
1191         (itself in this case) to force the resolution to take place.   Why
1192         it does not take place with a null is beyond me.
1193
1194 2006-12-20  Marek Safar  <marek.safar@gmail.com>
1195
1196         A fix for bug #80288
1197         * expression.cs (ResolveOperator): Consider user defined conversion for
1198         logical and operator too.
1199         (EmitBranchable): Optimization for logical and when full constant folding
1200         could not be applied but one operand is constant.
1201
1202 2006-12-19  Marek Safar  <marek.safar@gmail.com>
1203
1204         * class.cs (GetClassBases): Write 5 times every day, will never use
1205         FullName for error reporting.
1206
1207         * decl.cs (AsAccessible, CheckAccessLevel): Always unpack arrays first.
1208
1209 2006-12-19  Martin Baulig  <martin@ximian.com>
1210
1211         * statement.cs (LocalInfo.EmitSymbolInfo): New public method; emit
1212         the symbol file info here.
1213
1214 2006-12-18  Marek Safar  <marek.safar@gmail.com>
1215
1216         * cs-tokenizer.cs (handle_preprocessing_directive): When previous section
1217         of `elseif' is taking then following sections are not taking.
1218         Fixes an issue reported on mono mailing list.
1219
1220 2006-12-18  Marek Safar  <marek.safar@gmail.com>
1221
1222         A fix for bug #80300
1223         * cs-tokenizer.cs (PreProcessDefinition): Do no define/undefine when
1224         a caller is not taking.
1225
1226 2006-12-18  Raja R Harinath  <rharinath@novell.com>
1227
1228         * anonymous.cs: Change several TypeContainer declarations to DeclSpace.
1229         (CompilerGeneratedClass): Use parent.PartialContainer unconditionally.
1230         (RootScopeInfo, AnonymousMethodMethod): Update to changes.
1231         * iterator.cs: Change several TypeContainer declarations to DeclSpace.
1232         * class.cs: Update to changes.
1233
1234 2006-12-17  Marek Safar  <marek.safar@gmail.com>
1235
1236         A fix for bug #79934
1237         * anonymous.cs (CompilerGeneratedClass): Register class in a shared
1238         partial container.
1239
1240         * class.cs (ResolveMembers): Register an iterator in current container and
1241         not in shared one.
1242
1243 2006-12-16  Raja R Harinath  <rharinath@novell.com>
1244
1245         Fix test-543.cs
1246         * expression.cs (VerifyArgumentsCompat): Allow zero arguments to
1247         satisfy a params annotated parameter.
1248
1249 2006-12-16  Marek Safar  <marek.safar@gmail.com>
1250
1251         A fix for bug #77014
1252         * expression.cs (Invocation.BetterFunction): Fixed to cope with dynamic
1253         paramters correctly and not rely on hacks in Parameters class.
1254         (Invocation.IsParamsMethodApplicable): Changed to accept params parameter
1255         at any possition.
1256         (Invocation.VerifyArgumentsCompat): Ditto.
1257         (Invocation.EmitArguments): Changed to correctly emit params arguments at
1258         any possition.
1259
1260         * parameter.cs (HasParams): Don't assume that params is the last one.
1261
1262         * support.cs (ReflectionParameters.ctor): Look for params attribute
1263         correctly.
1264         (ReflectionParameters.ParameterType): Removed hack when we returned last
1265         parameter for out of range parameters.
1266         (ParameterName, ParameterModifier): Ditto.
1267
1268 2006-12-14  Marek Safar  <marek.safar@gmail.com>
1269
1270         A fix for bug #79987
1271         * decl.cs (DeclSpace.VerifyClsCompliance): External names cache is null
1272         when assembly is not CLS compliant but type is. I have no idea why is this
1273         allowed.
1274
1275         * typemanager.cs (Reset): Invalidate AllClsTopLevelTypes cache.
1276
1277 2006-12-13  Miguel de Icaza  <miguel@novell.com>
1278
1279         * class.cs (ConstructorInitializer.Resolve): Allow for ":this()"
1280         in struct constructors, they are basically no-ops.
1281
1282 2006-12-12  Marek Safar  <marek.safar@gmail.com>
1283
1284         * cs-tokenizer.cs (Position): Save preprocessor status too.
1285
1286 2006-12-12  Marek Safar  <marek.safar@gmail.com>
1287
1288         A fix for bug #77794
1289         * cs-tokenizer.cs (consume_identifier): Check for correct partial context.
1290
1291 2006-12-12  Marek Safar  <marek.safar@gmail.com>
1292
1293         * cs-tokenizer.cs (get_cmd_arg): Support CR as the line terminator.
1294         Fixes #69299.
1295         (pp_expr): Report error for an invalid expression.
1296         (handle_preprocessing_directive): Simplified; add more error checking.
1297
1298 2006-12-11  Marek Safar  <marek.safar@gmail.com>
1299
1300         A fix for bug #74939
1301         * cs-tokenizer.cs (is_punct): We cannot simply disable preprocessor
1302         directives handling.
1303
1304 2006-12-10  Marek Safar  <marek.safar@gmail.com>
1305
1306         A fix for bugs #80093, and #75984
1307         * cs-tokenizer.cs (handle_preprocessing_directive): Fixed #if/#else/#endif
1308         logic, it seems to me as it worked before "by coincidence".
1309         (xtoken): Simplified to use reworked handle_preprocessing_directive.
1310         (cleanup): Enabled endif check.
1311
1312 2006-12-09  Marek Safar  <marek.safar@gmail.com>
1313
1314         A fix for bug #80162
1315         * statement.cs (CollectionForeach.TryType): Generics and non-generics
1316         enumerators are never ambiguous.
1317
1318 2006-12-08  Raja R Harinath  <rharinath@novell.com>
1319
1320         Fix #80060
1321         * cs-tokenizer.cs (parse_less_than): Recognize double-colons too.
1322
1323 2006-12-06  Marek Safar  <marek.safar@gmail.com>
1324
1325         A fix for bug #80144
1326         * class.cs (EventProperty.Define): Explicit implementation means
1327         that an even is used.
1328
1329 2006-12-06  Marek Safar  <marek.safar@gmail.com>
1330
1331         Fixes the operators implementation (part II)
1332
1333         * cfold.cs (DoConstantNumericPromotions): Renamed to
1334         DoBinaryNumericPromotions and simplified.
1335         (BinaryFold): Couple of conversion fixes; simplified.
1336
1337         * constant.cs, ecore.cs, literal.cs
1338         (ToType): Renamed to ConvertImplicitly.
1339         (Reduce): Renamed to ConvertExplicitly.
1340
1341         * class.cs, convert.cs: Updated.
1342
1343         * expression.cs: TryReduce doesn't throw an exception.
1344
1345 2006-12-01  Marek Safar  <marek.safar@gmail.com>
1346
1347         A fix for bug #80108
1348         * ecore.cs (EventExpr.EmitAddOrRemove): Don't crash when right side is not
1349         compatible.
1350
1351 2006-11-30  Marek Safar  <marek.safar@gmail.com>
1352
1353         Fixes unary operators implementation (part I)
1354         Also fixes #80026
1355
1356         * cfold.cs (Error_CompileTimeOverflow): Made internal
1357
1358         * const.cs (IConstant): Changed to use reference to constant and
1359         not constant itself.
1360         Updated IConstant implementations.
1361
1362         * constant.cs (CreateConstant): New factory method.
1363         Updated IConstant implementation.
1364
1365         * convert.cs (ImplicitStandardConversionExists): Uses compiler Equals.
1366
1367         * ecore.cs: Updated to use CreateConstantReference.
1368
1369         * enum.cs: Reflects IConstant changes.
1370
1371         * expression.cs (Unary): Reimplemented +,-,~ to conform C# standard.
1372
1373         * literal.cs (NullConstant): Change to be independently usable.
1374
1375 2006-11-29  Martin Baulig  <martin@ximian.com>
1376
1377         * class.cs (Constructor.Emit): Correctly handle anonymous methods;
1378         we need to emit the scope initializer before calling the base .ctor.
1379
1380         * anonymous.cs: Merged back from the new anonymous methods branch.
1381         (AnonymousMethodHost): Renamed to `RootScopeInfo'.
1382
1383         * expression.cs (ParameterReference.DoResolveBase): Create a
1384         "normal" ScopeInfo when capturing parameters rather than using the
1385         root scope; this makes things work with anonymous methods having
1386         parameters.
1387
1388         * statement.cs
1389         (ToplevelBlock.AnonymousMethodHost): Renamed into `RootScope'.
1390
1391 2006-11-22  Marek Safar  <marek.safar@gmail.com>
1392
1393         A fix for bug #79987
1394         * class.cs (VerifyClsCompliance): Move redundant CLS compliance attribute
1395         check to a base class.
1396         * decl.cs (VerifyClsCompliance): Warn that CLS compliance cannot be tested
1397         only when assembly has missing attribute.
1398         * report.cs: Update.
1399
1400 2006-11-21  Marek Safar  <marek.safar@gmail.com>
1401
1402         * cs-tokenizer.cs: Merged with gmcs version.
1403
1404 2006-11-20  Marek Safar  <marek.safar@gmail.com>
1405
1406         * cs-tokenizer.cs,
1407         * cs-parser.jay: Better error message when partial keyword is misplaced.
1408
1409 2006-11-19  Gert Driesen  <drieseng@users.sourceforge.net>
1410
1411         A fix for bug #79810
1412         report.cs: CS1058 only applies to 2.0 profile (gmcs).
1413         codegen.cs: on 2.0 profile, non-exception throwables are wrapped in
1414         a RuntimeWrappedException by default.
1415
1416 2006-11-18  Marek Safar  <marek.safar@gmail.com>
1417
1418         A fix for bug #79843
1419         * delegate.cs (Delegate.VerifyMethod): Fixed covariance and contravariance
1420         implementation.
1421         (DelegateCreation.Error_NoMatchingMethodForDelegate): Ditto.
1422
1423 2006-11-18  Marek Safar  <marek.safar@gmail.com>
1424
1425         * driver.cs, namespace.cs: Uses faster IndexOf version.
1426
1427 2006-11-17  Marek Safar  <marek.safar@gmail.com>
1428
1429         A fix for bug #79941
1430         * class.cs (MemberCore.IsDuplicateImplementation): Add more tricks for
1431         operators.
1432         (Operator.Define): Implicit/Explicit operator of same type is duplicate
1433         even if internal name is different.
1434         * convert.cs (GetConversionOperator): Replaced EmitContext with parentType.
1435         (UserDefinedConversion): Simplified as the operators cannot be internal.
1436         * ecore.cs (Error_ValueCannotBeConverted): Take account of user
1437         conversions.
1438         (MethodLookup): Replaced EmitContext with parentType.
1439         * expression.cs: Updated.
1440
1441 2006-11-09  Raja R Harinath  <rharinath@novell.com>
1442
1443         * driver.cs (BadAssembly): Handle all the ugliness of
1444         DefineDynamicAssembly.
1445
1446 2006-11-08  Raja R Harinath  <rharinath@novell.com>
1447
1448         Address parts of #58244 -- most of what's left is in the runtime
1449         * driver.cs (LoadAssembly): Simplify slightly.  Add CS0009 and
1450         CS1509 error checks, and handle them for all assembly loads, not
1451         just the first invocation.
1452         (LoadModule): Likewise.  Move handling of 'adder_method' ...
1453         * codegen.cs (AssemblyClass.AddModule): ... here.
1454
1455 2006-11-02  Marek Safar  <marek.safar@gmail.com>
1456
1457         * statement.cs.cs (CollectionForeach.TryType): Issue a error when
1458         IEnumerable<T> is ambiguous.
1459
1460 2006-10-31  Marek Safar  <marek.safar@gmail.com>
1461
1462         A fix for bug #67689
1463         * statement.cs.cs (CollectionForeach.TryType): Issue a warning when
1464         GetEnumerator is ambiguous.
1465
1466         * report.cs: Add new warning.
1467
1468 2006-10-29  Marek Safar  <marek.safar@gmail.com>
1469
1470         A fix for bug #78602
1471         ecore.cs (PropertyExpr.InstanceResolve): The qualifier for access
1472         to protected member can be nested type.
1473
1474 2006-10-28  Marek Safar  <marek.safar@gmail.com>
1475
1476         A fix for bug #78965
1477         ecore.cs (PropertyExpr.InstanceResolve): The qualifier for access
1478         to protected member must derive from current type.
1479
1480 2006-10-27  Marek Safar  <marek.safar@gmail.com>
1481
1482         assign.cs: Reuses error method.
1483
1484         ecore.cs (Expression.Error_ValueCannotBeConverted): Report a value
1485         instead of type for constants.
1486         (Expression.Error_ValueAssignment): Common error method.
1487
1488         * expression.cs (UnaryMutator.ResolveOperator): Value cannot be used
1489         for any assignment.
1490
1491 2006-10-27  Marek Safar  <marek.safar@gmail.com>
1492
1493         A fix for bug #79081
1494         * expression.cs (MemberAccess.DoResolve): Check nested type
1495         accessibility.
1496
1497 2006-10-27  Atsushi Enomoto  <atsushi@ximian.com>
1498
1499         * doc.cs : nested delegates were not handled. Fixed bug #79754.
1500
1501 2006-10-26  Marek Safar  <marek.safar@gmail.com>
1502
1503         A fix for bug #76591
1504         * cs-tokenizer.cs (IsCastToken): Enable a cast of anonymous method.
1505
1506 2006-10-26  Marek Safar  <marek.safar@gmail.com>
1507
1508         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Don't allow to have
1509         type forwarder of the same type multiple times.
1510
1511 2006-10-26  Raja R Harinath  <rharinath@novell.com>
1512
1513         Fix #78820
1514         * ecore.cs (PropertyExpr.InstanceResolve): Always resolve the
1515         instance as an rvalue, even when we later resolve as an lvalue.
1516
1517 2006-10-25  Martin Baulig  <martin@ximian.com>
1518
1519         * anonymous.cs: Fix #79673.
1520
1521 2006-10-24  Marek Safar  <marek.safar@seznam.cz>
1522
1523         A fix for bug #79666
1524         expression.cs (ArrayCreation.GetAttributableValue): An initializer can be
1525         ignored when is optimized (= default value) as its value is already set.
1526
1527 2006-10-23  Marek Safar  <marek.safar@seznam.cz>
1528
1529         A fix for bug #79724
1530         * report.cs (SymbolRelatedToPreviousError): Uses DeclSpace instead of
1531         TypeContainer for type lookup.
1532
1533 2006-10-23  Marek Safar  <marek.safar@seznam.cz>
1534
1535         A fix for bug #79231
1536         * ecore.cs (ResolveAsBaseTerminal): Removed redundant error test.
1537         * expression.cs (OverloadResolve): Always convert type name for
1538         an error message.
1539         (ResolveNamespaceOrType): Don't confuse a nested type with any 
1540         other member.
1541
1542 2006-10-18  Martin Baulig <martin@ximian.com>
1543
1544         * anonymous.cs: Propagate the IsStatic state, fixes the crasher in banshee.
1545
1546 2006-10-17  Miguel de Icaza  <miguel@novell.com>
1547
1548         * convert.cs: Fix typo, fixes the test-535.cs, we were casting to
1549         an int32, but requesting an int64 from the conversion
1550
1551 2006-10-12  Martin Baulig  <martin@ximian.com>
1552
1553         * anonymous.cs
1554         (AnonymousContainer.Resolve): Inflate the `ReturnType'.  Fixes #79592.
1555         
1556 2006-10-12  Martin Baulig  <martin@ximian.com>
1557
1558         * statement.cs
1559         (Using.EmitLocalVariableDeclFinally): Small fix for iterators.
1560
1561 2006-10-11  Miguel de Icaza  <miguel@novell.com>
1562
1563         * convert.cs: Remove broken code: I was doing the "Existance"
1564         tests for Implicit conversions.
1565
1566 2006-10-10  Miguel de Icaza  <miguel@novell.com>
1567
1568         * convert.cs: Added one missing case in
1569         ImplicitStandardConversionExists uint64 to intptr.
1570
1571         Fixes #59800
1572         
1573         * typemanager.cs (uintptr_type): another core known type.   
1574
1575         * ecore.cs (OperatorCast): routine used to do cast operations that
1576         depend on op_Explicit.  We could change some of the Decimal
1577         conversions to use this.
1578
1579         This one has a probe mechanism that checks both types for an op_
1580         which it coudl be used to eliminate two classes: CastToDecimal
1581         and CastFromDecimal.
1582
1583         * convert.cs: Implement the conversions documented in #59800
1584         
1585 2006-10-10  Martin Baulig  <martin@ximian.com>
1586
1587         * iterators.cs (Iterator.Resolve): Call RootScope.ResolveType()
1588         before RootScope.ResolveMembers().
1589
1590         * anonymous.cs (ScopeInfo.CapturedScope.ctor): Use the child's
1591         `CurrentType' if appropriate.
1592
1593 2006-10-09  Marek Safar  <marek.safar@seznam.cz>
1594
1595         A fix for bug #78568
1596         * cs-tokenizer.cs (Deambiguate_CloseParens): Expression cannot be cast
1597         when contains binary operators.
1598         * cs-parser.jay: Updated.
1599
1600 2006-10-09  Martin Baulig  <martin@ximian.com>
1601
1602         * delegate.cs
1603         (Delegate.DefineType): Don't call TypeParameter.Resolve() here;
1604         moved that into Define() and also do the other type parameter
1605         checks there.  Fixes #79094.  Added gtest-292.cs.
1606
1607         * expression.cs
1608         (ArrayCreation.EmitDynamicInitializers): Use `etype.IsValueType'
1609         since that doesn't include type parameters; don't use `Ldelema'
1610         for type parameters.  Fixes #78980.  Added gtest-293.cs.
1611
1612 2006-10-08  Marek Safar  <marek.safar@seznam.cz>
1613
1614         A fix for #77796
1615         * convert.cs (ExplicitReferenceConversion): Only enum to enum value
1616         conversion is allowed.
1617
1618 2006-10-06  Marek Safar  <marek.safar@seznam.cz>
1619
1620         * ecore.cs (Expression.MemberLookup): Don't register any symbol for
1621         error reporting when no error occurs.
1622
1623 2006-10-06  Marek Safar  <marek.safar@seznam.cz>
1624
1625         * cfold.cs (ConstantFold.BinaryFold): Report an error when the conversion
1626         does not exist.
1627
1628 2006-10-06  Raja R Harinath  <rharinath@novell.com>
1629
1630         Fix #79584
1631         * class.cs (DefineTypeBuilder): Check circular dependencies before
1632         setting the parent of the TypeBuilder.
1633         (CheckRecursiveDefinition): Don't use 'BaseType', since
1634         it may not be valid until after DefineTypeBuilder.  Use
1635         'base_type' instead.
1636
1637 2006-10-04  Martin Baulig  <martin@ximian.com>
1638
1639         Merged the Anonymous Methods patch.
1640
1641         * anonymous.cs, iterators.cs: The new anonymous methods code.
1642
1643         * statement.cs (Variable): New public abstract class.
1644         (LocalInfo.Variable): New public property.
1645         (LocalInfo.ResolveVariable): New public method.
1646         (Block.Flags): Add `IsIterator'.
1647         (Block.AddVariable): Improved the CS0136 check.
1648         (Block.AnonymousChildren): New public property.
1649         (Block.AddAnonymousChild): New public method.
1650         (ToplevelBlock): Update to use the new anonymous method framework.
1651         (ToplevelBlock.ctor): `container' is now a `Block' and not a
1652         `ToplevelBlock'; this is required to correctly implement the
1653         CS0136 check.
1654         (Fixed, Using): Use `TemporaryVariable' instead of directly
1655         creating the `LocalBuilder'.
1656
1657         * parameter.cs (Parameter.ResolveVariable): New public method.
1658         (Parameters.ResolveVariable): Likewise.
1659
1660         * ecore.cs (TemporaryVariable): Use the new `Variable' framework.
1661
1662         * class.cs (TypeContainer): Replaced the `iterators' list and
1663         corresponding methods with a list of `CompilerGeneratedClass'es.
1664         (TypeContainer.ResolveMembers): New public method.
1665         (Method): `IIteratorContainer' has been replaced by
1666         `IAnonymousHost'.
1667
1668         * expression.cs (VariableReference): New public abstract base
1669         class for `LocalVariableReference', `ParameterReference' and
1670         `This'.
1671
1672         * codegen.cs (EmitContext): Removed `capture_context',
1673         `HaveCaptureInfo', `EmitScopeInitFromBlock()' and `Capture*()'.
1674         (EmitContext.EmitThis): Removed.
1675
1676         * cs-parser.jay: Replace `iterator_container' with
1677         `anonymous_host'.       
1678
1679 2006-10-04  Martin Baulig  <martin@ximian.com>
1680
1681         * generic.cs (GenericMethod): Don't make this abstract.
1682         (Constraints.Clone): Added dummy implementation.
1683
1684 2006-10-04  Raja R Harinath  <harinath@gmail.com>
1685
1686         Fix #79577
1687         * namespace.cs (LookForAnyGenericType): Avoid nullref on
1688         'declspaces'.  Avoid allocating arrays willy-nilly.
1689
1690         Fix #79553
1691         * cfold.cs (BinaryFold): Move boolean Equality and Inequality
1692         cases out of the switch.
1693
1694 2006-09-28  Marek Safar  <marek.safar@seznam.cz>
1695
1696         * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Better error
1697         message when non-generic type is used with the type arguments.
1698         * expression.cs: Updated.
1699
1700 2006-09-28  Raja R Harinath  <rharinath@novell.com>
1701
1702         Fix #79013
1703         * convert.cs (Convert.ImplicitStandardConversionExists): Avoid infloop.
1704         * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
1705         Change semantics slightly.  Don't insist on having only one
1706         temporary EmptyExpression -- just throttle the creation of new ones.
1707
1708         Fix #79451
1709         * ecore.cs (Expression.MemberLookup): Enable CS0229 errors for
1710         non-interfaces too.  If no methods are found, don't try to create
1711         a MethodGroupExpr.
1712
1713 2006-09-28  Marek Safar  <marek.safar@seznam.cz>
1714
1715         * ecore.cs (ResolveAsTypeStep): Print better error when type can be
1716         generic type.
1717
1718         * namespace.cs (Namespace.LookForAnyGenericType): New method to help
1719         us produce better error message.
1720
1721 2006-09-27  Marek Safar  <marek.safar@seznam.cz>
1722
1723         * expression.cs (Binary.ResolveOperator): Warn about a side effect
1724         of the `|' operator.
1725
1726         * report.cs: A new warning added.
1727
1728 2006-09-27  Martin Baulig  <martin@ximian.com>
1729
1730         * generic.cs (GenericMethod): Don't make this abstract.
1731
1732 2006-09-27  Martin Baulig  <martin@ximian.com>
1733
1734         * report.cs
1735         (InternalErrorException): Added overloaded ctor taking a params array.
1736
1737 2006-09-26  Marek Safar  <marek.safar@seznam.cz>
1738
1739         * class.cs, codegen.cs, const.cs, cs-tokenizer.cs, driver.cs, ecore.cs:
1740         Fixed the cases when same error was reported twice.
1741
1742         * report.cs (SymbolRelatedToPreviousError): Simplified as all our messages
1743         now report symbol information.
1744
1745 2006-09-25  Martin Baulig  <martin@ximian.com>
1746
1747         * class.cs: Completely unified with the gmcs version.
1748
1749 2006-09-25  Martin Baulig  <martin@ximian.com>
1750
1751         * typemanager.cs (TypeManager.IsNullableType): New public function.
1752         (TypeManager.IsNullableTypeOf): Likewise.
1753         (TypeManager.IsNullableValueType): Likewise.
1754
1755         * class.cs (MethodCore): Added the `GenericMethod' argument from
1756         gmcs and also unified all classes derived from `MethodCore' with gmcs.
1757
1758 2006-09-24  Raja R Harinath  <harinath@gmail.com>
1759
1760         * convert.cs: Unify with gmcs version.
1761
1762 2006-09-24  Marek Safar  <marek.safar@seznam.cz>
1763
1764         * decl.cs (DeclSpace.VerifyClsCompliance): When type has type parameters
1765         verify them as well.
1766
1767         * report.cs: New warning.
1768
1769 2006-09-24  Marek Safar  <marek.safar@seznam.cz>
1770
1771         * anonymous.cs (AnonymousMethod.Compatible): Cannot generate arguments
1772         for anonymous block with out argument.
1773
1774 2006-09-24  Marek Safar  <marek.safar@seznam.cz>
1775
1776         * class.cs (ClassOrStruct.VerifyMembers): Fixed to report correctly
1777         not used private events only.
1778
1779 2006-09-23  Marek Safar  <marek.safar@seznam.cz>
1780
1781         * cfold.cs (BinaryFold): On the guest to unify empty constant cast.
1782
1783         * const.cs (Const.Define): Check for constant type.
1784         (Const.IsConstantTypeValid): Looks for valid constant types.
1785
1786         * convert.cs (ImplicitReferenceConversion): NullCast to EmptyConstantCast.
1787
1788         * ecore.cs (EmptyConstantCast): New common class for all constant based
1789         EmptyCast(s).
1790
1791         * expression.cs (Is.DoResolve): Handle null constant especially.
1792         (New.DoResolve): Check for new void().
1793         (MemberAccess.DoResolve): Cope with all kind of nulls.
1794
1795         * literal.cs (NullConstant): Uses EmptyConstantCast.
1796         (NullDefault): Based on EmptyConstantCast.
1797         (NullLiteral): Uses EmptyConstantCast.
1798
1799         * statement.cs (Block.ResolveMeta): Check for constant type.
1800
1801 2006-09-22  Martin Baulig  <martin@ximian.com>
1802
1803         * delegate.cs, attribute.cs: Merged with the gmcs versions.
1804
1805 2006-09-22  Raja R Harinath  <rharinath@novell.com>
1806
1807         * literal.cs (NullDefault): The type of default(IFoo) is 'IFoo',
1808         not the null type.
1809
1810         Fix part of #79451
1811         * typemanager.cs (Closure.Filter): Consider PrivateScope attributes.
1812         * decl.cs (DeclSpace.FindMemberToOverride): Likewise.  Reorganize
1813         code slightly.
1814
1815 2006-09-22  Martin Baulig  <martin@ximian.com>
1816
1817         * ecore.cs: Merged with the gmcs version.
1818
1819         * generic.cs (ConstructedType): New dummy class.
1820         (TypeArguments): Don't make this abstract.
1821
1822         * typemanager.cs
1823         (TypeManager.IsGenericTypeDefinition): New method.
1824         (TypeManager.GetGenericFieldDefinition): Moved here from gmcs.
1825
1826 2006-09-22  Raja R Harinath  <rharinath@novell.com>
1827
1828         * expression.cs (ComposedCast): Check for arrays of TypedReference
1829         before creating the type, not after.
1830
1831 2006-09-21  Marek Safar  <marek.safar@seznam.cz>
1832
1833         * cfold.cs, const.cs, enum.cs, statement.cs: Updated
1834         after ToType change.
1835
1836         * constant.cs (Constant.ImplicitConversionRequired): Designed to used
1837         when constant must be implicitly convertible.
1838
1839         * convert.cs (ImplicitReferenceConversion): Reuse ToType.
1840
1841         * ecore.cs (NullCast): Derives from NullConstant.
1842
1843         * expression.cs (Is.DoResolve): Removed useless variables.
1844         (Conditional.DoResolve): Quick hack for `Foo () ? null : null'.
1845         (New.Constantify): Add enum support.
1846         (MemberAccess.DoResolve): Add warning when accessing null constant or
1847         variable.
1848
1849         * generic.cs (GenericConstraints.IsReferenceType): Another dummy
1850         property.
1851
1852         * literal.cs (NullConstant): New abstract class with common
1853         functionality for all null specializations.
1854         (NullDefault): Represents default(X) when result can be
1855         reduced to null.
1856         (NullLiteral): Updated.
1857
1858         * report.cs: Add new warning.
1859
1860 2006-09-21  Martin Baulig  <martin@ximian.com>
1861
1862         * generic.cs (GenericTypeParameterBuilder): Removed this ugly hack.
1863
1864 2006-09-21  Martin Baulig  <martin@ximian.com>
1865
1866         * generic.cs (GenericConstraints): New dummy class.
1867         (Constraints): Likewise.
1868         (TypeParameter): Likewise.
1869         (TypeParameterName): Likewise.
1870         (GenericMethod): Likewise.
1871
1872         * typemanager.cs (TypeManager.GetGenericArguments): New method.
1873
1874         * decl.cs: Merged with the gmcs version.
1875
1876 2006-09-21  Raja R Harinath  <rharinath@novell.com>
1877
1878         * generic.cs (TypeParameter): Implement IMemberContainer.
1879         (GenericTypeParameterBuilder): New.  An abominable repugnant hack.
1880
1881         * rootcontext.cs: Unify with gmcs version.
1882
1883         * report.cs: Unify with gmcs version.
1884         * typemanager.cs (AddTypeParameter, LookupTypeParameter): Move
1885         from gmcs/generics.cs.
1886         * generics.cs (TypeParameter): New dummy class.
1887
1888         * support.cs: Unify with gmcs version.
1889
1890 2006-09-20  Raja R Harinath  <rharinath@novell.com>
1891
1892         * ecore.cs (MethodGroupExpr.ResolveGeneric): New dummy method.
1893         * expression.cs (MemberAccess, BaseAccess): Remove GMCS_SOURCE #ifdef.
1894
1895         * decl.cs (MemberName): Unify with gmcs, except for GetTypeExpression.
1896         * generic.cs (TypeArguments): New dummy class to help avoid #ifdefs.
1897         * mcs.exe.sources: Add generic.cs.
1898
1899         * codegen.cs: Unify with gmcs version.
1900
1901         * codegen.cs (IResolveContent.GenericDeclContainer): Copy from gmcs.
1902         (EmitContext): Add GenericDeclContainer implementation.
1903         * decl.cs (MemberCore, DeclSpace): Likewise.
1904         * namespace.cs: Remove #ifdef GMCS_SOURCE.
1905
1906         * namespace.cs (GetTypeInAssembly): Remove #ifdef GMCS_SOURCE.
1907         MCS TypeManager has a corresponding dummy method.
1908
1909 2006-09-19  Martin Baulig  <martin@ximian.com>
1910
1911         * expression.cs: Completely merged with the gmcs version.
1912
1913 2006-09-19  Martin Baulig  <martin@ximian.com>
1914
1915         * expression.cs (Invocation): Merged with the gmcs version.
1916         (ArrayAccess.GetStoreOpcode): Likewise.
1917
1918 2006-09-19  Martin Baulig  <martin@ximian.com>
1919
1920         * typemanager.cs
1921         (TypeManager.IsGenericMethod): Moved here from ../gmcs/generic.cs.
1922         (TypeManager.IsGenericMethodDefinition): Likewise.
1923
1924 2006-09-19  Martin Baulig  <martin@ximian.com>
1925
1926         * typemanager.cs
1927         (TypeManager.IsEqual): Moved the gmcs implementation here.
1928         (TypeManager.DropGenericTypeArguments): Likewise.
1929         (TypeManager.DropGenericMethodArguments): Likewise.
1930         (TypeManager.GetTypeArguments): Moved here from gmcs.
1931         (TypeManager.HasGenericArguments): Likewise.
1932
1933 2006-09-19  Martin Baulig  <martin@ximian.com>
1934
1935         * expression.cs (Binary): Merged with the gmcs version.
1936
1937 2006-09-19  Martin Baulig  <martin@ximian.com>
1938
1939         * expression.cs (Probe, As, Is): Merged with the gmcs version.
1940
1941 2006-09-19  Martin Baulig  <martin@ximian.com>
1942
1943         * typemanager.cs: Merged with the gmcs version.
1944
1945 2006-09-16  Raja R Harinath  <rharinath@novell.com>
1946
1947         * AssemblyInfo.cs [GMCS_SOURCE]: Unify with gmcs source.
1948         * driver.cs: Likewise.
1949
1950 2006-09-16  Marek Safar  <marek.safar@seznam.cz>
1951
1952         A fix for #79401
1953         * class.cs (MethodCore.VerifyClsCompliance): Do check for abstract members
1954         only if parent type is class.
1955         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Fixed missing cache
1956         update.
1957
1958 2006-09-15  Marek Safar  <marek.safar@seznam.cz>
1959
1960         * cs-parser.jay,
1961         * expression.cs(MemberAccess.DoResolve): Don't crash when not allowed
1962         keywords are used.
1963         * typemanager.cs(CSharpName): Converts NullType to null.
1964
1965 2006-09-15  Martin Baulig  <martin@ximian.com>
1966
1967         * typemanager.cs
1968         (TypeManager.GetMethodName): Added mcs implementation.
1969         (TypeManager.IsEqual): Likewise.
1970
1971         * ecore.cs
1972         (SimpleName.RemoveGenericArity): Added dummy implementation.
1973
1974         * pending.cs: Merged with the gmcs version.     
1975
1976 2006-09-15  Martin Baulig  <martin@ximian.com>
1977
1978         * statement.cs: Merge with the gmcs version.
1979
1980 2006-09-15  Martin Baulig  <martin@ximian.com>
1981
1982         * statement.cs (Switch): Merge with the gmcs implementation
1983         (without nullables), which is newer.
1984
1985 2006-09-15  Martin Baulig  <martin@ximian.com>
1986
1987         * statement.cs (Block.Variables): Make this public.
1988         (ToplevelBlock.Parameters): Make this a property.
1989         (Throw.Resolve): Use `TypeManager.IsSubclassOf ()'.
1990
1991 2006-09-15  Martin Baulig  <martin@ximian.com>
1992
1993         * namespace.cs: Merge with the gmcs version.
1994
1995 2006-09-15  Martin Baulig  <martin@ximian.com>
1996
1997         * decl.cs (MemberName): Minor code cleanups.
1998
1999 2006-09-15  Martin Baulig  <martin@ximian.com>
2000
2001         * parameter.cs: Merge with the gmcs version.
2002
2003 2006-09-15  Martin Baulig  <martin@ximian.com>
2004
2005         * enum.cs: Merge with the gmcs version: 3005 is a warning in gmcs
2006         and an error in mcs.
2007
2008 2006-09-15  Martin Baulig  <martin@ximian.com>
2009
2010         * flowanalysis.cs: Merged from GMCS; added the generics code into
2011         a `GMCS_SOURCE' conditional so we can share this file.
2012
2013 2006-09-08  Martin Baulig  <martin@ximian.com>
2014
2015         * typemanager.cs (TypeManager.interlocked_type): New public field.
2016         (TypeManager.int_interlocked_compare-exchange): New public field.
2017         (TypeManager.InitEnumUnderlyingTypes): Also initialize the
2018         enumerator types here and call InitGenericCoreTypes().
2019         (TypeManager.InitCoreTypes): Call InitEnumeratorTypes() right
2020         after calling InitEnumUnderlyingTypes().
2021
2022         * rootcontext.cs
2023         (RootContext.ResolveCore): Added `System.Threading.Interlocked' to
2024         `classes_second_stage'. 
2025
2026 2006-09-14  Marek Safar  <marek.safar@seznam.cz>
2027
2028         * assign.cs, ecore.cs, expression.cs: Share error message text.
2029         * class.cs (FieldMember.Define): Check for varible of static type.
2030         * driver.cs (LoadAssembly): Uses error output for errors.
2031         * statement.cs: Updated.
2032
2033 2006-09-08  Marek Safar  <marek.safar@seznam.cz>
2034
2035         * expression.cs (Error_OperatorCannotBeApplied): Report type instead of
2036         type instance.
2037
2038 2006-09-07  Martin Baulig  <martin@ximian.com>
2039
2040         * driver.cs
2041         (MainDriver): Revert r62663 from Marek; see #70506 for details.
2042
2043 2006-08-29  Miguel de Icaza  <miguel@novell.com>
2044
2045         * cs-parser.jay: Turn 1522 into a warning, instead of an error #79210
2046         
2047 2006-08-17  Miguel de Icaza  <miguel@novell.com>
2048
2049         * cs-tokenizer.cs: Apply patch from Atsushi Enomoto that fixes
2050         #52019 and #79064, the use of the \uXXXX sequence in source code
2051         to represent unicode characters.
2052
2053 2006-08-15  Marek Safar  <marek.safar@seznam.cz>
2054
2055         * expression.cs (SizeOf.DoResolve): Check for void type. Fixed enum types
2056         support.
2057         * class.cs, ecore.cs, statement.cs: Merged to one error message.
2058
2059 2006-08-13  Miguel de Icaza  <miguel@novell.com>
2060
2061         * assign.cs: Catch attempts to assign to a method groups in += and
2062         report as 1656
2063
2064 2006-08-13  Marek Safar  <marek.safar@seznam.cz>
2065
2066         A fix for #79056
2067         * cs-parser.jay: Don't destroy current array type by typeof of array's.
2068
2069 2006-08-12  Marek Safar  <marek.safar@seznam.cz>
2070
2071         * class.cs (Method.Define): Issue a warning when generic method looks like
2072         an entry point.
2073         * decl.cs (MemberCore.GetSignatureForError): Print member type arguments
2074         as well.
2075
2076 2006-08-09  Marek Safar  <marek.safar@seznam.cz>
2077  
2078         * anonymous.cs(AnonymousDelegate.Emit): Uses Constructor filter when
2079         looking for ctor.
2080         * decl.cs (MemberCache.FindMembers): When container is interface we need to
2081         search all base interfaces as a member can be ambiguous.
2082         * delegate.cs (Delegate.FindMembers): Fixed to return valid data for
2083         Constructor member type filter. 
2084         (Delegate.ResolveConstructorMethod) Uses Constructor filter.
2085         * ecore.cs: (Expression.MemberLookup): Implemented ambiguity error/warning
2086         reporting for returned memberinfos.
2087         * report.cs: Updated.
2088         * typemanager.cs (TypeManager.LookupBaseInterfacesCache): Uses TypeManager
2089         version to work on all runtimes.
2090         (TypeManager.RealMemberLookup): Removed members filtering.
2091
2092 2006-08-08  Raja R Harinath  <rharinath@novell.com>
2093
2094         * ecore.cs (FieldExpr.EmitAssign): Release temporary.
2095         (PropertyExpr.EmitAssign): Likewise.
2096         * expression.cs (Indirection.EmitAssign): Likewise.
2097         (LocalVariableReference.EmitAssign): Likewise.
2098         (ParameterReference.EmitAssign): Likewise.
2099         (Invocation.EmitArguments): Likewise.
2100         (ArrayAccess.EmitAssign): Likewise.
2101         (IndexerAccess.EmitAssign): Likewise.
2102         (This.EmitAssign): Likewise.
2103         (ConditionalLogicalOperator.Emit): Likewise.
2104
2105         Fix #79026
2106         * codegen.cs (EmitContext.GetTemporaryLocal): Simplify.  Use Stack
2107         instead of ArrayList.  If the hashtable has a LocalBuilder, don't
2108         leave it in after returning it.
2109         (EmitContext.FreeTemporaryLocal): Simplify.  Update to changes.
2110
2111 2006-08-06  Marek Safar  <marek.safar@seznam.cz>
2112
2113         * expresssion.cs (IndexerAccess.DoResolve): Fixed to report correct error
2114         message.
2115
2116 2006-08-03  Raja R Harinath  <rharinath@novell.com>
2117
2118         Fix cs0146-3.cs and cs0146-4.cs.
2119         * class.cs (TypeManager.CheckRecursiveDefinition): Check that
2120         enclosing types don't depend on the current type.
2121
2122 2006-08-02  Raja R Harinath  <rharinath@novell.com>
2123
2124         Fix #77963
2125         * class.cs (TypeContainer.DoDefineMembers): Use
2126         FindBaseMemberWithSameName on Parent, since we're interested in
2127         whether we hide inherited members or not.
2128         (FindBaseMemberWithSameName): Make slightly more robust.
2129
2130         Fix the non-generic testcase from #77396
2131         * decl.cs (DeclSpace.DeclContainer): Remove override.
2132
2133         * namespace.cs (NamespaceEntry.Doppelganger): Create slave
2134         declspaces for doppelgangers too.
2135         (UsingEntry): Implement IResolveContext.
2136         (UsingEntry.Resolve): Don't set ToplevelTypes.Namespace.  Use
2137         'this' as the resolve context.
2138         (LocalAliasEntry): Likewise.
2139
2140         Implement parts of #77403
2141         * roottypes.cs (RootDeclSpace): New.  Used to represent the
2142         toplevel declaration space.  Each namespace declaration introduces
2143         a "partial" root declaretion space.
2144         * namespace.cs (NamespaceEntry.SlaveDeclSpace): New.
2145         (NamespaceEntry.ctor): Create a SlaveDeclSpace if necessary.
2146         * cs-parser.jay (CSharpParser.ctor): Initialize 'current_class'
2147         from 'current_namespace.SlaveDeclSpace'.
2148         (namespace_declaration): Likewise.
2149         * class.cs (TypeContainer.ctor): Remove parent==ToplevelTypes
2150         check.  It can't happen now.
2151         * decl.cs (DeclSpace.LookupType): Likewise.
2152         * driver.cs (MainDriver): Sanity check.
2153
2154 2006-08-01  Raja R Harinath  <rharinath@novell.com>
2155
2156         * decl.cs (DeclSpace.FindNestedType): Remove.
2157         (DeclSpace.LookupNestedTypeINHierarchy): Use PartialContainer and
2158         LookupTypeContainer to get the container of the nested type.
2159         * class.cs (TypeContainer.FindNestedType): Make non-override.
2160
2161 2006-07-31  Raja R Harinath  <rharinath@novell.com>
2162
2163         * decl.cs (DeclSpace.PartialContainer): Move field from ...
2164         * class.cs (TypeContainer.PartialContainer): ... here.
2165         (TypeContainer.AddBasesForPart): New helper.
2166         (MemberBase.ParentContainer): Remove.  Use Parent.PartialContainer
2167         instead.
2168         * cs-parser.jay (current_class): Convert to DeclSpace.
2169         (struct_declaration, interface_declaration, class_declaration):
2170         Use AddBasesForPart instead of .Bases directly.
2171         * const.cs, iterators.cs: Update to changes.
2172
2173 2006-07-28  Raja R Harinath  <rharinath@novell.com>
2174
2175         * class.cs (TypeContainer.AddMemberType): Rename from
2176         AddToTypeContainer.
2177         (TypeContainer.AddMember): Rename from AddToMemberContainer.
2178         (AddTypeContainer): New.  Combine AddClassOrStruct and
2179         AddInterface.
2180         (AddPartial): Update.  Add 'is_partial' argument.
2181         * roottypes.cs: Update to changes.
2182         * cs-parser.jay (push_current_class): New helper for handling
2183         current_container and current_class.
2184         (struct_declaration, interface_declaration, class_declaration):
2185         Use it.
2186
2187 2006-07-26  Raja R Harinath  <rharinath@novell.com>
2188
2189         * roottypes.cs: Rename from tree.cs.
2190
2191         Rename RootContext.Tree.Types to RootContext.ToplevelTypes.
2192         * tree.cs (Tree, ITreeDump): Remove types.
2193         * rootcontext.cs (tree, Tree): Remove fields.
2194         (root, ToplevelTypes): New.
2195         * *.cs: Update to rename.
2196
2197         * tree.cs (Tree.RecordDecl): Remove.
2198         (RootTypes.AddToTypeContainer): Record the toplevel type in its
2199         namespace here.
2200         * class.cs, cs-parser.jay: Remove mention of RecordDecl.
2201
2202 2006-07-23  Raja R Harinath  <harinath@gmail.com>
2203
2204         * codegen.cs (EmitContext.Flags): Move InCatch, InFinally,
2205         DoFlowAnalysis and OmitStructFlowAnalysis here.
2206         (ec.With): Rename from WithUnsafe and generalize.
2207         (ec.WithCheckState): Remove.  All users can be handled by 'With'.
2208         (ec.WithFlowAnalyis): New.
2209         * ecore.cs, expression.cs, statement.cs: Update.
2210
2211 2006-07-22  Raja R Harinath  <harinath@gmail.com>
2212
2213         * statement.cs (Block.ResolveMeta): Simplify slightly.
2214
2215         * codegen.cs (EmitContext.Flags): New enum.  Used to represent the
2216         multiple boolean fields.  Convert InUnsafe, constant_check_state,
2217         check_state to flags.
2218         (CheckState, ConstantCheckState): Update.
2219         (InUnsafe): New read-only property.
2220         (FlagsHandle): Rename from CheckStateHandle and convert to handle
2221         arbitrary flags.
2222         (WithUnsafe): New helper similar to WithCheckState.
2223         * statement.cs (Block.ResolveMeta): Use WithUnsafe.
2224         (Unsafe.Resolve, Unsafe.DoEmit): Likewise.
2225
2226 2006-07-21  Raja R Harinath  <rharinath@novell.com>
2227
2228         Make comparisons use the same IL irrespective of whether they're
2229         in a 'checked' or 'unchecked' context: one of the issues in #78899
2230         * codegen.cs (EmitContext.CheckState): Make read-only property.
2231         (EmitContext.ConstantCheckState): Likewise.
2232         (EmitContext.CheckStateHandle, EmitContext.WithCheckState): New
2233         helper that implement a save/restore stack for CheckState
2234         values.  This is the only way to change check-state.
2235         * ecore.cs (Expression.ExpressionToArrayArgument): Use WithCheckState.
2236         * expression.cs (CheckedExpr.DoResolve, CheckedExpr.Emit): Likewise.
2237         (CheckedExpr.EmitBranchable): New forwarding method.
2238         (UnCheckedExpr): Likewise.
2239         * statement.cs (Block.ResolveMeta): Use WithCheckState.
2240         (Unchecked.Resolve, Unchecked.DoEmit): Likewise.
2241         (Checked.Resolve, checked.DoEmit): Likewise.
2242
2243 2006-07-20  Miguel de Icaza  <miguel@novell.com>
2244
2245         * anonymous.cs: Cache the resolved anonymous delegate, and return
2246         this so that the ResolveTopBlock is only triggered once, not
2247         twice.
2248
2249         Currently we trigger ResolvetopBlock twice due to a first pass of
2250         argument check compatibility, and a second pass that does the
2251         actual resolution.   
2252         
2253 2006-07-15  Marek Safar  <marek.safar@seznam.cz>
2254
2255         * annonymous.cs (AnonymousMethod.CreateScopeType): Fixed nested type
2256         modifiers.
2257         * rootcontext.cs (Reset): Add helper_classes.
2258
2259 2006-07-15  Marek Safar  <marek.safar@seznam.cz>
2260
2261         A fix for #78860
2262         * statement.cs (Switch.SimpleSwitchEmit): Handle case null at any position
2263         correctly.
2264
2265 2006-07-13  Miguel de Icaza  <miguel@novell.com>
2266
2267         * statement.cs (Lock): Handle expressions of type
2268         TypeManager.null_type specially.  Fixes #78770
2269
2270 2006-07-08  Marek Safar  <marek.safar@seznam.cz>
2271
2272         * expression.cs (Binary.ResolveOperator): Don't crash when null is assigned
2273         to an event.
2274
2275 2006-07-08  Marek Safar  <marek.safar@seznam.cz>
2276
2277         * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Fixed to look
2278         for accessors as well.
2279         * ecore.cs (EventExpr): Add AccessorTable.
2280
2281 2006-07-01  Marek Safar  <marek.safar@seznam.cz>
2282
2283         A fix for #78738
2284         * attribute.cs, class.cs, ecore.cs : Add missing location of related symbol
2285         for CS0122 where appropriate.
2286         * typemanager.cs (IsNestedChildOf): Type can be null in the case of top
2287         level attributes.
2288         (Filter): Assembly can be null in the case of top level attributes.
2289
2290 2006-06-25  Marek Safar  <marek.safar@seznam.cz>
2291
2292         A fix for #78690
2293
2294         * ecore.cs (Expression.MemberLookupFailed): Don't crash when failed lookup
2295         is done at global level.
2296
2297 2006-06-24  Marek Safar  <marek.safar@seznam.cz>
2298
2299         A fix for #77002, Implemented TypeForwarder support.
2300
2301         * attribute.cs (Attribute.GetArgumentType): Reads type argument.
2302         * expression.cs (TypeOf.TypeArgument): Exposes typeof type.
2303         * typemanager.cs (): Add type_forwarder_attr_type.
2304
2305 2006-06-24  Marek Safar  <marek.safar@seznam.cz>
2306
2307         * report.cs: Add CS0469 warning.
2308
2309 2006-06-21  Martin Baulig  <martin@ximian.com>
2310
2311         * codegen.cs (CodeGen.Save): Moved the symbol file generation into
2312         the `try'-block, so we also report CS0016 etc. there.
2313
2314 2006-06-21  Martin Baulig  <martin@ximian.com>
2315
2316         * delegate.cs
2317         (Delegate.VerifyMethod): Allow `params' methods; fixes #78678.
2318
2319 2006-06-21  Martin Baulig  <martin@ximian.com>
2320
2321         * expression.cs (Unary.ResolveOperator): In `Operator.AddressOf',
2322         also report CS1686 for parameters.
2323
2324 2006-06-21  Martin Baulig  <martin@ximian.com>
2325
2326         * statement.cs (GotoCase.Resolve): Report a warning (CS0469)
2327         instead of an error if the value is not implicitly convertible to
2328         the switch types; fixes #77964.
2329
2330 2006-06-21  Raja R Harinath  <rharinath@novell.com>
2331
2332         Fix #78673
2333         * class.cs (FieldBase.ResolveInitializer): Stop resolution if
2334         FieldBuilder is null.
2335
2336         Fix #78662
2337         * expression.cs (Binary.CheckShiftArguments): Don't overwrite original
2338         'left' and 'right' before error-checking.
2339
2340 2006-06-16  Juraj Skripsky  <js@hotfeet.ch>
2341
2342         * ecore.cs (SimpleName.Error_ObjectRefRequired): Do not truncate the name.
2343         Fixed bug #78601.
2344         (MemberExpr.EmitInstance): Use GetSignatureForError () to get full name.
2345         (FieldExpr.DoResolve): likewise.
2346         (PropertyExpr.InstanceResolve): likewise.
2347         (EventExpr.InstanceResolve): likewise. 
2348
2349 2006-06-04  Marek Safar  <marek.safar@seznam.cz>
2350
2351         * parameter.cs (Parameter.ApplyAttributeBuilder): More DefaultValue
2352         attribute applicable tests for attribute argument.
2353
2354 2006-06-02  Raja R Harinath  <rharinath@novell.com>
2355
2356         Fix #78079
2357         * expression.cs (Binary.DoNumericPromotions): Remove and rewrite.
2358         (Binary.OverloadResolve_PredefinedIntegral): New.
2359         (Binary.OverloadResolve_PredefinedFloating): New.
2360         (Binary.OverloadResolve_PredefinedString): New.
2361         (Binary.ResolveOperator): Use those instead of DoNumericPromotions.
2362         Follow the standard more closely, and treat numeric promotions in
2363         terms of overload resolution.
2364         (Binary.CheckShiftArguments): Simplify.
2365
2366 2006-06-01  Raja R Harinath  <rharinath@novell.com>
2367
2368         * flowanalysis.cs (MyBitVector): Simplify representation.
2369         (MyBitVector.Clone): Avoid allocating BitArray.
2370         (MyBitVector.operator&): Rename from MyBitVector.And and make symmetric.
2371         (MyBitVector.operator|): Likewise, with MyBitVector.Or.
2372         (*): Update.  Change all references to MyBitVector.And and
2373         MyBitVector.Or to &= and |=.
2374
2375 2006-05-29  Raja R Harinath  <rharinath@novell.com>
2376
2377         Fix cs0231-[34].cs.
2378         * cs-parser.jay (formal_parameter_list): Extend the pattern below
2379         to param arguments too.
2380
2381 2006-05-26  Miguel de Icaza  <miguel@novell.com>
2382
2383         * cs-parser.jay: Catch another parsing form for arglist being
2384         followed by other arguments.  Fixes #78313.
2385
2386 2006-05-24  Raja R Harinath  <rharinath@novell.com>
2387
2388         * flowanalysis.cs (FlowBranchingToplevel.AddReturnOrigin): Move
2389         checking of out parameters to ...
2390         (FlowBranchingToplevel.Merge): ... here.
2391         (FlowBranchingException.AddBreakOrigin): If 'finally_vector' is
2392         set, propagate the origin upward, and only complain if there was
2393         no other error.
2394         (FlowBranchingException.AddContinueOrigin): Likewise.
2395         (FlowBranchingException.AddReturnOrigin): Likewise.
2396         (FlowBranchingException.AddGotoOrigin): Likewise.       
2397
2398 2006-05-23  Raja R Harinath  <rharinath@novell.com>
2399
2400         * flowanalysis.cs (UsageVector.MergeOrigins): If an origin is
2401         unreachable, skip it.
2402         (FlowBranchingException.Merge): Always propagate jumps, even if
2403         the finally block renders subsequent code unreachable.
2404
2405 2006-05-18  Raja R Harinath  <rharinath@novell.com>
2406
2407         Fix #77601
2408         * statement.cs (Goto.Resolve): Move responsibility for resolving
2409         'goto' to FlowBranching.AddGotoOrigin.
2410         (Goto.SetResolvedTarget): New.  Callback to set the
2411         LabeledStatement that's the target of the goto.
2412         (Goto.DoEmit): Use Leave instead of Br when crossing an
2413         unwind-protect boundary.
2414         * flowanalysis.cs (FlowBranching.AddGotoOrigin): Rename from
2415         LookupLabel and adjust to new semantics.
2416         (FlowBranchingToplevel.AddGotoOrigin): Likewise.
2417         (FlowBranchingBlock.AddGotoOrigin): Likewise. Use
2418         Goto.SetResolvedTarget to update target.
2419         (FlowBranchingLabeled.AddGotoOrigin): Likewise.
2420         (FlowBranchingException.AddGotoOrigin): Rewrite to be similar to
2421         AddBreakOrigin & co.  Delay propagation until ...
2422         (FlowBranchingException.Merge): ... this.
2423
2424         * statement.cs (Block.Resolve): Always depend on flow-branching to
2425         determine unreachability.  Kill workaround that originally emitted
2426         only one statement after an "unreachable" label (see infloop in
2427         test-515.cs).
2428
2429         Fix #77869, #76148, #77755, #75255 and a host of other bugs.
2430         This is still "wrong", but anything better would probably need a
2431         multi-pass algorithm.
2432         * flowanalysis.cs (FlowBranchingLabeled): Salt away a copy of the
2433         usage vector.  Force current usage vector to be reachable, to
2434         optimistically signify backward jumps.
2435         (FlowBranchingLabeled.LookupLabel): Note if a backward jump is
2436         detected.
2437         (FlowBranchingLabeled.Merge): New.  If no backward jump was
2438         detected, return the original salted-away usage vector instead,
2439         updated with appropriate changes.  Print unreachable warning if
2440         necessary.
2441         * statement.cs (Block.Resolve): Don't print unreachable warning on
2442         a labeled statement.
2443
2444 2006-05-17  Gert Driesen  <drieseng@users.sourceforge.net>
2445
2446         * driver.cs: Pass filename without path to AssemblyBuilder's 
2447         AddResourceFile. Fixes bug #78407.
2448
2449 2006-05-17  Raja R Harinath  <rharinath@novell.com>
2450
2451         * statement.cs (LabeledStatement.Resolve): Move merging of origins ...
2452         * flowanalysis.cs (FlowBranchingLabeled): ... here.
2453         (FlowBranching.MergeChild): Overwrite
2454         reachability information from Labeled branchings too.
2455
2456 2006-05-16  Raja R Harinath  <rharinath@novell.com>
2457
2458         * statement.cs (Goto.Resolve): Merge jump origins here ...
2459         * flowanalysis.cs (FlowBranching.Label): ... rather than here.
2460
2461         * flowanalysis.cs (FlowBranching.LookupLabel): Move CS0159 check ...
2462         (FlowBranchingToplevel.LookupLabel): ... here.  Add CS1632 check.
2463         (FlowBranchingGoto.LookupLabel): New.  Handle back jumps.
2464         (FlowBranchingBlock.LookupLabel): Call LabeledStatement.AddReference
2465         here, ...
2466         * statement.cs (Goto.Resolve): ... not here.
2467         (Goto.Emit): Remove CS1632 check.
2468
2469 2006-05-14  Marek Safar  <marek.safar@seznam.cz>
2470
2471         * ecore.cs (Expression.ResolveAsTypeTerminal): Fixed type in the obsolete
2472         error message.
2473
2474 2006-05-11  Raja R Harinath  <rharinath@novell.com>
2475
2476         * flowanalysis.cs (UsageVector.MergeJumpOrigins): Kill.
2477         (FlowBranchingBlock.Label): Use UsageVector.MergeOrigins.
2478         (FlowBranchingException.Label): Likewise.
2479
2480         * flowanalysis.cs (MyBitVector.SetAll): New.  Sets all bits to the
2481         given value.
2482         (MyBitVector.Or): Use it to avoid losing information (Count).
2483         (FlowBranching.MergeOrigins): Likewise.
2484
2485         * flowanalysis.cs (UsageVector.IsDirty): Remove.
2486         (UsageVector.Parameters, UsageVector.ParameterVector): Likewise.
2487         (UsageVector.Locals, UsageVector.LocalVector): Likewise.
2488         (UsageVector.ToString): Simplify.
2489         (UsageVector.MergeSiblings): Move here from ...
2490         (FlowBranching.Merge): ... here.
2491         (FlowBranchingToplevel.CheckOutParameters): Take an UsageVector,
2492         not a MyBitVector.
2493
2494 2006-05-10  Raja R Harinath  <rharinath@novell.com>
2495
2496         * flowanalysis.cs (UsageVector.MergeOrigins): Simplify, now that a
2497         null bitvector is treated as all-true.
2498
2499         * flowanalysis.cs (MyBitVector.And, MyBitVector.Or): Make lazier.
2500         (MyBitVector): Rationalize invariants.  'vector != null' implies
2501         that we have our own copy of the bitvector.  Otherwise,
2502         'InheritsFrom == null' implies all inherited bits are true.
2503
2504 2006-05-09  Marek Safar  <marek.safar@seznam.cz>
2505
2506         * statement.cs (LocalInfo): Add IsConstant.
2507         (LocalInfo.DeclareLocal): Moved from EmitMeta and changed to don't emit
2508         local variable for constants.
2509
2510 2006-05-09  Raja R Harinath  <rharinath@novell.com>
2511
2512         * flowanalysis.cs (MyBitVector.Empty): New.
2513         (MyBitVector): Don't allow InheritedFrom to be null.
2514         (MyBitVector.And, MyBitVector.Or): Treat 'null' as all-ones.
2515         (UsageVector, FlowBranching): Update to changes.
2516
2517         * flowanalysis.cs (FlowBranching.InTryWithCatch): Don't terminate
2518         recursion.  The 'Parent == null' condition isn't sufficient for
2519         anonymous methods.
2520         (FlowBranching.AddBreakOrigin): Likewise.
2521         (FlowBranching.AddContinueOrigin): Likewise.
2522         (FlowBranching.AddReturnOrigin): Likewise.
2523         (FlowBranching.StealFinallyClauses): Likewise.
2524         (FlowBranching.MergeTopBlock): Move to FlowBranchingToplevel.
2525         (FlowBranching.CheckOutParameters): Likewise.
2526         (FlowBranchingToplevel): Terminate all the above recursions here.
2527         (FlowBranchingToplevel.End): Rename from MergeTopBlock.
2528         * codegen.cs (EmitContext.ResolveTopBlock): Update to changes.
2529
2530         * flowanalysis.cs (BranchingType.Toplevel): New.  Represents a
2531         toplevel block.
2532         (FlowBranchingToplevel): New.  Empty for now.
2533         (FlowBranching.MergeTopBlock): Update.
2534         * codegen.cs (EmitContext.ResolveTopBlock): Create a Toplevel
2535         branching for the anonymous delegate.
2536         (EmitContext.StartFlowBranching): Add ToplevelBlock variant.
2537
2538         * flowanalysis.cs (UsageVector.MergeOrigins): Reorganize.
2539         (UsageVector.MergeJumpOrigins): Don't ignore current reachability
2540         information at the start of the merge.  Reorganize.
2541
2542 2006-05-07  Marek Safar  <marek.safar@seznam.cz>
2543
2544         * class.cs (MethodData.Define): Method cannot implement interface accessor.
2545
2546 2006-05-07  Marek Safar  <marek.safar@seznam.cz>
2547
2548         * expression.cs (QualifiedAliasMember.ResolveAsTypeStep): Pass location
2549         to newly introduced ctor.
2550
2551         * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Moved an error
2552         message to one place.
2553         (GlobalRootNamespace.Error_NamespaceDoesNotExist): Custom message for
2554         global namespace.
2555
2556 2006-05-07  Marek Safar  <marek.safar@seznam.cz>
2557
2558         * const.cs (Const.Error_ExpressionMustBeConstant): Better error message.
2559
2560         * ecore.cs (Expression.ResolveAsConstant): Updated.
2561
2562         * statement.cs (ResolveMeta): Updated.
2563
2564 2006-05-06  Marek Safar  <marek.safar@seznam.cz>
2565
2566         * cs-parser.jay: __arglist cannot be used in initializer.
2567
2568 2006-05-06  Marek Safar  <marek.safar@seznam.cz>
2569
2570         A fix for #77879
2571         * namespace.cs (LocalAliasEntry.DoResolve): Don't allow to access nested
2572         private types.
2573
2574 2006-05-05  Raja R Harinath  <rharinath@novell.com>
2575
2576         * statement.cs (EmptyStatement.ResolveUnreachable): Override.
2577         (LabeledStatement): Add 'name' parameter.
2578         (LabeledStatement.Name, LabeledStatement.JumpOrigins): New.
2579         (Block.AddLabel): Update to changes.
2580         * cs-parser.jay (labeled_statement): Likewise.
2581
2582         * flowanalysis.cs (BranchingType.Labeled): New.
2583         (UsageVector.MergeOrigins): Remove unused 'branching' argument.
2584         (FlowBranchingLabeled): New.  Does nothing for now, but will
2585         eventually handle 'goto' flows.
2586         * codegen.cs (StartFlowBranching): Add new LabeledStatement variant.
2587         * statement.cs (LabeledStatement.Resolve): Create a FlowBranching
2588         that's terminated ...
2589         (Block.Resolve): ... here.
2590
2591         * flowanalysis.cs (UsageVector.MergeFinally): Remove.
2592         (UsageVector.MergeFinallyOrigins): Likewise.
2593         (FlowBranching.InTryOrCatch): Likewise.
2594         (FlowBranching.AddFinallyVector): Likewise.
2595         (FlowBranchingException): Update to changes.
2596
2597         Fix #78290
2598         * statement.cs (Return.Resolve): Move error checking to ...
2599         * flowbranching.cs (FlowBranching.AddReturnOrigin): ... this.
2600         (FlowBranchingException): Handle return origins like break and
2601         continue origins.
2602         (FlowBranching.UsageVector.CheckOutParameters): Remove.
2603
2604 2006-05-04  Marek Safar  <marek.safar@seznam.cz>
2605
2606         A fix for #76122
2607         * class.cs (TypeContainer.FindMembers): Includes event method in the methods
2608         filter.
2609
2610 2006-05-04  Marek Safar  <marek.safar@seznam.cz>
2611
2612         A fix for #77543
2613         * class.cs (MethodData.Define): Do public accessor check only when method
2614         implements an interface.
2615
2616 2006-05-04  Raja R Harinath  <rharinath@novell.com>
2617
2618         Remove special handling of 'break'
2619         * flowanalysis.cs (Reachability): Remove all mention of 'breaks'.
2620         (Reachability.Meet): Simplify.  Remove 'do_breaks' argument.
2621         (UsageVector.Break): Remove.
2622         (FlowBranching.Merge): Use 'Reachable.IsUnreachable' to determine
2623         reachability.
2624         (FlowBranchingBreakable.Merge): Don't ResetBreaks.
2625
2626         * statement.cs (Break.Resolve): Call UsageVector.Goto (), not
2627         UsageVector.Breaks ().  Don't set NeedsReturnLabel.
2628
2629 2006-05-03  Marek Safar  <marek.safar@seznam.cz>
2630
2631         A fix for #75726
2632         * pending.cs (PendingImplementation.BaseImplements): A found member cannot
2633         be the interface member.
2634
2635 2006-05-03  Marek Safar  <marek.safar@seznam.cz>
2636
2637         A fix for #60069
2638         * constant.cs (LongConstant.EmitLong): Fixed to catch also negative values
2639         for emitting small (int) values.
2640
2641 2006-05-03  Raja R Harinath  <rharinath@novell.com>
2642
2643         Fix #59427
2644         * flowanalysis.cs (FlowBranchingException.Merge): Ensure
2645         control-flow passes through the 'finally' after merging-in all the
2646         control-flows from 'try' and the 'catch' clauses.
2647
2648         * flowanalysis.cs (FlowBranching.IsLoop): Remove.
2649         (FlowBranching.IsTryOrCatch): Remove 'is_return' parameter.  It's
2650         always true at the only non-recursive entry point.
2651         (FlowBranching.CreateBranching) [BranchingType.Loop]: Return a
2652         FlowBranchingBreakable.
2653         (FlowBranchingLoop): Remove.
2654         * statement.cs (Return.DoResolve): Update to changes.
2655
2656         Fix #76471, #76665
2657         * flowanalysis.cs (FlowBranching.BranchingType.Embedded): New.
2658         (FlowBranching.CreateBranching): Handle it: create a
2659         FlowBranchingContinuable.
2660         (FlowBranching.BreakCrossesExceptionBoundary): Remove.
2661         (FlowBranching.AddContinueOrigin): Similar to AddBreakOrigin,
2662         except that it handles the 'continue' command.
2663         (FlowBranching.UsageVector.MergeOrigins): Rename from
2664         MergeBreakOrigins.
2665         (FlowBranchingContinuable): Similar to FlowBranchingBreakable,
2666         except that it overrides AddContinueOrigin.
2667         (FlowBranchingException): Override AddContinueOrigin, similar to
2668         AddBreakOrigin.
2669         * statement.cs (While.Resolve, Foreach.ArrayForeach.Resolve):
2670         Create a new branching around the embedded statement.
2671         (Do.Resolve, For.Resolve): Likewise.  Do reachability analysis for
2672         control flow after the embedded statement.
2673         (Continue.Resolve): Move all error checking to AddContinueOrigin.
2674
2675         * flowanalysis.cs (FlowBranching.IsSwitch): Remove.
2676         (FlowBranching.CreateBranching) [BranchingType.Switch]: Create a
2677         FlowBranchingBreakable.
2678         (FlowBranchingSwitch): Remove.
2679
2680         Fix test-503.cs
2681         * statement.cs (Break.Resolve): Simplify.  Move responsibility for
2682         error reporting to ...
2683         * flowanalysis.cs (FlowBranching.AddBreakOrigin) ... this.
2684         Rename from 'AddBreakVector'.  Add new location argument.  Return
2685         a bool indicating whether the 'break' crosses an unwind-protect.
2686         (FlowBranchingException.AddBreakOrigin): Add.
2687         (FlowBranchingException.Merge): Propagate 'break's to surrounding
2688         flowbranching after updating with the effects of the 'finally'
2689         clause.
2690         (FlowBranchingBreakable): New common base class for
2691         FlowBranchingLoop and FlowBranchingSwitch.
2692
2693         * statement.cs (Foreach.ArrayForeach.Resolve): Set barrier after
2694         embedded statement.
2695         (Foreach.CollectionForeach.Resolve): Remove extraneous flowbranching.
2696
2697 2006-05-02  Raja R Harinath  <rharinath@novell.com>
2698
2699         * statement.cs (Do.Resolve): If the loop is infinite, set the
2700         barrier.
2701         (While.Resolve, For.Resolve): Set a barrier after the embedded
2702         statement.  There's no direct control flow that goes from the end
2703         of the embedded statement to the end of the loop.
2704         * flowanalysis.cs (FlowBranching.Infinite): Remove.
2705         (FlowBranchingLoop.Merge): Don't look at 'Infinite'.  The changes
2706         above ensure that the reachability is correctly computed.
2707
2708         * flowanalysis.cs (Reachability.ResetBarrier): Remove.
2709         (UsageVector.MergeBreakOrigins): If the current path is
2710         unreachable, treat it as if all parameters/locals are initialized.
2711         (FlowBranchingLoop.Merge): Don't clear any barriers.  Handle
2712         infinite loops before merging-in break origins.
2713
2714         * flowanalysis.cs (Reachability.Meet): Simplify code handling 'returns'.
2715         (Reachability.Reachable): Split part into ...
2716         (Reachability.Unreachable): ... this.  Simplify.
2717         (Reachability.IsUnreachable): Use 'Unreachable' instead.
2718
2719         * flowanalysis.cs (Reachability.SetReturnsSometimes): Remove.
2720         (Reachability.SetThrowsSometimes): Likewise.
2721         (FlowBranchingBlock.MergeTopBlock): Don't compare against
2722         TriState.Always, use corresponding property.
2723         * statement.cs (Lock.Resolve, Try.Resolve, Using.Resolve): Likewise.
2724         (Block.Resolve): Likewise.  Remove some redundant checks.
2725
2726 2006-05-02  Raja R Harinath  <harinath@gmail.com>
2727
2728         * flowanalysis.cs (UsageVector.Throw): Set barrier too.
2729         (Reachability.Meet): Don't bother checking AlwaysThrows --
2730         barrier is always set.
2731         (FlowBranchingBlock.Merge): Likewise.
2732
2733 2006-05-01  Raja R Harinath  <harinath@gmail.com>
2734
2735         * codegen.cs (EmitContext.ResolveTopBlock): Remove redundant
2736         checks for unreachable.
2737
2738 2006-05-01  Marek Safar  <marek.safar@seznam.cz>
2739
2740         A fix for #77980
2741         * flowanalysis.cs (UsageVector.IsAssigned): Add flag to ignore short path.
2742
2743         * statement.cs (Block.UsageWarning): Uses newly introduced flag to detect
2744         whether field is really assigned.
2745
2746 2006-04-30  Raja R Harinath  <harinath@gmail.com>
2747
2748         * flowanalysis.cs (Reachability): Make 4-argument constructor
2749         private.
2750         (Reachability.Meet): Rename from 'And'.  Remove static variant.
2751         (Reachability.Always): Rename from the highly misleading
2752         'Reachability.Never'.
2753         (FlowBranching.Merge): Update to changes.  Mark an impossible
2754         situation with a 'throw'.
2755         (*): Update to changes.
2756
2757 2006-04-29  Raja R Harinath  <harinath@gmail.com>
2758
2759         * flowanalysis.cs (TriState): Rename from FlowBranching.FlowReturns.
2760         Remove 'Undefined'.
2761         (FlowBranching.TriState_Meet): Rename from AndFlowReturns. Simplify.
2762         (FlowBranching.TriState_Max): Rename from OrFlowReturns. Simplify.
2763         (*): Update to changes.
2764         * statement.cs: Update to changes.
2765
2766 2006-04-28  Marek Safar  <marek.safar@seznam.cz>
2767
2768         A fix for #78049
2769         *class.cs (Method.FindOutBaseMethod): Base method cannot be property method.
2770
2771 2006-04-28  Raja R Harinath  <harinath@gmail.com>
2772
2773         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't create a
2774         dummy UsageVector.
2775
2776         * flowanalysis.cs (UsageVector.MergeChild): Change FlowBranching
2777         argument to two arguments: an usage-vector and a bool.  Move call
2778         to FlowBranching.Merge () ...
2779         (FlowBranching.MergeChild, FlowBranching.MergeTopBlock): ... here.
2780
2781         * flowanalysis.cs (UsageVector.MergeChild): Move special-case
2782         handling of loop and switch reachability to ...
2783         (FlowBranchingLoop.Merge, FlowBranchingSwitch.Merge): ... these.
2784
2785 2006-04-27  Raja R Harinath  <harinath@gmail.com>
2786
2787         * flowanalysis.cs (FlowBranching.InLoop): Move special-case
2788         handling to FlowBranchingLoop.InLoop.
2789         (FlowBranching.InSwitch): Likewise, to FlowBranchingSwitch.
2790
2791 2006-04-26  Marek Safar  <marek.safar@seznam.cz>
2792
2793         A fix for #78115
2794         * anonymous.cs (AnonymousMethod.DoResolve): Moved the check whether
2795         anonymous method is allowed from AnonymousContainer here.
2796
2797         * attribute.cs, codegen.cs (EmitContext): Add IsAnonymousMethodAllowed.
2798
2799 2006-04-24  Raja R Harinath  <rharinath@novell.com>
2800
2801         Fix #78156
2802         * flowanalysis.cs (MyBitVector.Or): Add null check on argument.
2803
2804 2006-04-23  Marek Safar  <marek.safar@seznam.cz>
2805
2806         A fix for #49011.
2807         * constant.cs (FloatConstant.Reduce): Add range checking for checked context.
2808         (DoubleConstant.Reduce): Ditto.
2809
2810 2006-04-23  Raja R Harinath  <rharinath@novell.com>
2811
2812         * expression.cs (LocalVariableReference.DoResolveBase): Simplify.
2813         Remove 'lvalue_right_side' argument.  Move parts to ...
2814         (LocalVariableReference.ResolveLocalInfo, LocalVariable.DoResolve)
2815         (LocalVariable.DoResolveLValue): ... these.
2816
2817 2006-04-21  Raja R Harinath  <rharinath@novell.com>
2818
2819         Fix cs1655.cs
2820         * codegen.cs (EmitContext.InRefOutArgumentResolving): Remove.
2821         * expression.cs (EmptyExpression.LValueMemberOutAccess): New.
2822         (LocalVariableReference.DoResolveBase): Use it to implement new
2823         CS1655 check.
2824         (IndexerAccess.DoResolveLValue): Handle LValueMemberOutAccess.
2825         (Argument.Resolve): Simplify.  Move CS1510 check ...
2826         * ecore.cs (Expression.ResolveLValue): ... here.
2827         (UnboxCast.DoResolveLValue): Handle LValueMemberOutAccess.
2828         (PropertyExpr.DoResolveLValue): Likewise.
2829         (FieldExpr.Report_AssignToReadonly): Likewise.
2830         (FieldExpr.DoResolve): Add 'out_access' argument.  Use
2831         LValueMemberAccess or LValueMemberOutAccess on instance depending
2832         on it.
2833         (FieldExpr.DoResolveLValue): Pass 'out_access' argument to
2834         DoResolve as appropriate.
2835
2836 2006-04-20  Raja R Harinath  <rharinath@novell.com>
2837
2838         Fix #75800
2839         * expression.cs (Invocation.VerifyArgumentsCompat): Don't try
2840         implicit conversions on 'out' and 'ref' arguments.
2841
2842         * expression.cs (Invocation.VerifyArgumentsCompat): Reorganize to
2843         improve clarity.  Remove dead code.
2844
2845         Fix #66031
2846         * statement.cs (Block.UsageWarning): Allow VariableInfo to be null.
2847         (Catch.Resolve): Resolve VarBlock if it exists.
2848
2849 2006-04-19  Miguel de Icaza  <miguel@novell.com>
2850
2851         * statement.cs (Foreach.EmitFinally): Do not emit the enumerator
2852         twice, this was some residual code, the enumerator was emitted
2853         properly in the two branche of if later.
2854
2855 2006-04-19  Raja R Harinath  <rharinath@novell.com>
2856
2857         * expression.cs (Cast.ResolveLValue): Remove.  The result of a
2858         cast is never an lvalue.
2859         (Cast.DoResolve, Cast.ResolveRest): Combine.
2860         (Argument.Emit): Simplify slightly.  Move 'Expr is
2861         IMemoryLocation' check ...
2862         (Argument.Resolve): ... here.
2863         (Argument.Error_LValueRequired): Remove.  Inline into only user.
2864
2865         Simplifications.  Fix cs0191-2.cs
2866         * ecore.cs (FieldExpr.DoResolve): Move handling of CS0192, CS0198,
2867         CS1649 and CS1651 to ...
2868         (FieldExpr.Report_AssignToReadonly): ... this.  Simplify by moving
2869         the actual selection of the error code and message to a lookup
2870         table.  Add a dummy return value to simplify callsites.
2871         (FieldExpr.ResolveLValue): Don't allow a constructor to write to
2872         readonly fields of other instances of the same type.  Move CS0197
2873         warning from ...
2874         * expression.cs (Argument.Resolve): ... here.  Simplify code.
2875         Ensure that ec.InRefOutArgumentResolving is only set during LValue
2876         resolution of an out or ref argument.  The code simplification
2877         above uses this invariant.
2878
2879 2006-04-18  Raja R Harinath  <rharinath@novell.com>
2880
2881         Possibly fix #77752.  Fix cs1690-[4-7].cs.
2882         * ecore.cs (Expression.CheckMarshalByRefAccess): Renamed from
2883         CheckMarshallByRefAccess.  Drop parameter.
2884         (FieldExpr.CheckMarshalByRefAccess): Update.  Change CS1690 to a
2885         warning.
2886         (FieldExpr.DoResolve): Call CheckMarshalByRefAccess on
2887         InstanceExpression.
2888         * report.cs (AllWarnings): Add CS1690.
2889         * expression.cs (Argument.Resolve): Use EmptyExpression.OutAccess
2890         for ref access too.
2891         (LocalVariableReference.DoResolveBase): Update.
2892
2893 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
2894
2895         * class.cs (MethodOrOperator): Moved common parts from method class.
2896         detect obsolete attributes.
2897         (Method.Define): Simplified as it reuses code from base.
2898         (Constructor.ValidAttributeTargets): Fixed issue found during
2899         refactoring.
2900         (Destructor.ValidAttributeTargets): Fixed issue found during
2901         refactoring.
2902         (Operator): Finished refactoring set off by #78020. Operator class is now
2903         ordinary method class.
2904
2905         * anonymous.cs: Updated.
2906
2907         * decl.cs (DeclSpace): Add IsGeneric
2908
2909 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
2910
2911         * class.cs (Constructor.Emit): Don't emit the attributes twice.
2912
2913 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
2914
2915         * class.cs (Operator.Emit): Extracted code from MethodData to correctly
2916         detect obsolete attributes.
2917         (Method.CreateEmitContext): Moved to MethodOrOperator.
2918
2919 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
2920
2921         A fix for #78048.
2922         * class.cs (TypeContainer.MemberCoreArrayList.DefineContainerMembers): Throw
2923         customized exception to make crash detection easier.
2924         (MethodOrOperator): Started to work on new base class for methods and
2925         operators.
2926         (Method): Derives from MethodOrOperator.
2927         (Constructor.Emit): Emits its own attributes.
2928         (AbstractPropertyEventMethod.Emit): Ditto.
2929         (Operator): Derives from MethodOrOperator, will refactor fully in extra
2930         patch.
2931         (Operator.Emit): It's temporary more tricky than should be.
2932         
2933         * doc.cs (GetMethodDocCommentName): Updated after operator changes.
2934
2935         * report.cs (InternalErrorException): Add ctor with inner exception.
2936
2937 2006-04-08  Marek Safar  <marek.safar@seznam.cz>
2938
2939         A fix for #76744.
2940         * ecore.cs (SimpleName.ResolveAsTypeStep): Report better error when type is
2941         only not visible.
2942
2943 2006-04-07  Marek Safar  <marek.safar@seznam.cz>
2944
2945         A fix for #77916.
2946         * expression.cs (ArrayCreation.GetAttributableValue): Creates correctly typed
2947         array.
2948
2949 2006-04-06  Marek Safar  <marek.safar@seznam.cz>
2950
2951         * class.cs (Class.ApplyAttributeBuilder): Report an error when ComImport
2952         attribute is present and Guid not.
2953         (Interface.ApplyAttributeBuilder): Ditto.
2954
2955         * attribute.cs: Add error message.
2956
2957 2006-04-06  Marek Safar  <marek.safar@seznam.cz>
2958
2959         A fix for #78020.
2960
2961         * attribute.cs (Attribute.AttachTo): The attribute can have multiple
2962         sources (it's composite) so hold them in extra array as they are used in
2963         Emit phase only. It worked in the previous versions by mistake.
2964         (Attribute.Emit): Emit attribute for more owners when exist.
2965
2966         * codegen.cs, class.cs: Updated to don't re-attach attribute twice as now
2967         it has now different behaviour.
2968
2969 2006-04-04  Marek Safar  <marek.safar@seznam.cz>
2970
2971         * constant.cs (Constant.IsDefaultInitializer): New method.
2972
2973         * class.cs: Updated.
2974
2975         * expression.cs (ArrayCreation.CheckIndices): Add an optimization to don't
2976         re-initialize default values. It saves KBs almost for every assembly.
2977         Thanks Zoltan for the idea.
2978         (ArrayCreation.ResolveInitializers): Renamed from ValidateInitializers.
2979         (ArrayCreation.DoResolve): Resolve only once.
2980         (ArrayCreation.Emit): Emit static initializer only when it is faster.
2981         (ArrayCreation.GetAttributableValue): Cope with optimized values.
2982
2983 2006-04-03  Zoltan Varga  <vargaz@gmail.com>
2984
2985         * report.cs (Warning, Error): Add 0-, 1-, and 2- argument specializations.
2986         From #77961.
2987
2988 2006-04-01  Marek Safar  <marek.safar@seznam.cz>
2989
2990         * assign.cs (Assign.DoResolve): Assignment to same variable can occur
2991         in an embedded statement too.
2992
2993 2006-04-01  Raja R Harinath  <rharinath@novell.com>
2994
2995         Fix #77958
2996         * statement.cs (Switch.EmitObjectInteger) [ulong]: Remove bad cast.
2997
2998 2006-04-01  Marek Safar  <marek.safar@seznam.cz>
2999
3000         A fix for #77966.
3001
3002         * class.cs (TypeContainer.AddPartial): Don't report an error when modifier
3003         was not specified.
3004
3005         * modifiers.cs: Add DEFAULT_ACCESS_MODIFER.
3006
3007 2006-03-31  Marek Safar  <marek.safar@seznam.cz>
3008
3009         * assign.cs (LocalTemporary): Don't require ILGenerator in the resolve
3010         phase.
3011
3012         * anonymous.cs, assign.cs, ecore.cs, expression.cs: Updated after
3013         LocalTemporary change.
3014
3015         * class.cs (ClassOrStruct.DefineDefaultConstructor): Moved from
3016         TypeContainer.
3017         (ClassOrStruct.DefineFieldInitializers): Implemented static field
3018         initializers optimization.
3019         (ClassOrStruct.TypeAttr): Moved from modifiers.
3020         (Constructor.CheckBase): Don't crash when static ctor has parameters.
3021         (FieldBase.ResolveInitializer): Resolves initializer.
3022         (FieldBase.HasDefaultInitializer): New property.
3023
3024         * cs-parser.jay: Removed message.
3025
3026         * expression.cs (CompilerGeneratedThis): New specialization.
3027
3028         * modifiers.cs (TypeAttr): Moved to ClassOrStruct.TypeAttr
3029
3030 2006-03-28  Marek Safar  <marek.safar@seznam.cz>
3031
3032         * cs-parser.jay, cs-tokenizer.cs: On demand Stack allocation.
3033
3034 2006-03-27  Marek Safar  <marek.safar@seznam.cz>
3035
3036         * ecore.cs (Expression.ResolveAsConstant): Clean up, enum constants should
3037         be now EnumConstants only.
3038
3039 2006-03-27  Marek Safar  <marek.safar@seznam.cz>
3040
3041         * attribute.cs, driver.cs: Reset more caches.
3042
3043 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
3044
3045         * cs-tokenizer.cs (adjust_real): Uses float.Parse for float literals.
3046
3047 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
3048
3049         * constant.cs (Constant.Reduce): Replaced EmitContext with single bool
3050         for easier reuse. Updated all overrides.
3051         (IntegralConstant): New base class for all integral constants.
3052         (IntegralConstant.Error_ValueCannotBeConverted): When assigned value if out
3053         of the constant range, report custom error.
3054         (UIntConstant.Reduce): Fixed uint conversion.
3055
3056         * ecore.cs, literal.cs: Reduce updates.
3057
3058 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
3059
3060         A fix for #75813.
3061
3062         * class.cs (Constructor.Define): Removed extra if for default ctors.
3063         A patch from Atsushi Enomoto.
3064
3065 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
3066
3067         * attribute.cs (Attribute.ResolveConstructor): Conversion was moved to
3068         GetAttributableValue.
3069
3070         * constant.cs (Constant.GetAttributableValue): Does implicit conversion
3071         when required.
3072
3073         * convert.cs (ImplicitConversionRequired): Error message moved to
3074         DoubleLiteral.
3075
3076         * ecore.cs (Expression.GetAttributableValue): Add type parameter for
3077         automatic implicit conversion of an output value.
3078         (EnumConstant.GetAttributableValue): Don't reduce the enum constants.
3079
3080         * expression.cs (ArrayCreation.GetAttributableValue): Add element type
3081         conversion.
3082         (TypeOf.GetAttributableValue): Add extra handling for object type.
3083
3084         * literal.cs (DoubleLiteral.Error_ValueCannotBeConverted): Doubles can have
3085         special error message.
3086
3087 2006-03-25  Marek Safar  <marek.safar@seznam.cz>
3088
3089         * class.cs (Constructor.Emit): Don't crash when struct ctor is
3090         InternalCall.
3091         (Constructor.ApplyAttributeBuilder): Transform MethodImplAttribute to be
3092         compatible with MS runtime.
3093
3094 2006-03-23  Marek Safar  <marek.safar@seznam.cz>
3095
3096         * attribute.cs (Attribute.ResolveConstructor): Check for an invalid
3097         attribute arguments here.
3098
3099         * class.cs (Indexer.Define): The check was moved to attribute class.
3100
3101 2006-03-22  Marek Safar  <marek.safar@seznam.cz>
3102
3103         * assign.cs, class.cs, codegen.cs, convert.cs, decl.cs, ecore.cs,
3104         expression.cs, typemanager.cs: Minor changes from gmcs to make merging
3105         easier.
3106
3107 2006-03-22  Raja R Harinath  <rharinath@novell.com>
3108
3109         Support ParameterDefaultValueAttribute in gmcs.  Also applied to
3110         mcs to keep code differences small.
3111         * attribute.cs (Attribute.GetParameterDefaultValue): New.
3112         * typemanager.cs (parameter_default_value_attribute_type): New.
3113         * parameter.cs (Parameter.ApplyAttributeBuilder): Use them.  Add
3114         CS1908 check.
3115
3116 2006-03-21  Marek Safar  <marek.safar@seznam.cz>
3117
3118         * expression.cs (StringConcat.Append): Reverted back to no warning state.
3119
3120 2006-03-21  Marek Safar  <marek.safar@seznam.cz>
3121
3122         * const.cs (Error_ConstantCanBeInitializedWithNullOnly): Share a message.
3123
3124         * statement.cs (Block.ResolveMeta): Look for wrong object constants in
3125         the blocks too.
3126
3127 2006-03-21  Atsushi Enomoto  <atsushi@ximian.com>
3128
3129         * doc-bootstrap.cs : fix build.
3130
3131 2006-03-20  Marek Safar  <marek.safar@seznam.cz>
3132
3133         * expression.cs (StringConcat.Append): Issue a warning when empty string
3134         is going to append.
3135
3136 2006-03-20  Marek Safar  <marek.safar@seznam.cz>
3137
3138         * assign.cs (CompoundAssign.ResolveSource): Removed.
3139
3140         * attribute.cs (ResolvePossibleAttributeType): Updated after MemberAccess
3141         clean up.
3142
3143         * class.cs (TypeContainer.FindMethods): Removed.
3144         (TypeContainer.CheckMemberUsage): Made static.
3145
3146         * codegen.cs (GetAssemblyName): Uses Length for empty string test.
3147
3148         * constant.cs (CheckRange): Removed unused type argument.
3149         (CheckUnsigned): Removed unused type argument.
3150
3151         * cs-parser.jay: Updated after MemberAccess clean up.
3152         Uses Length for empty string test.
3153
3154         * cs-tokenizer.cs: Uses Length for empty string test.
3155         (IsCastToken): Made static.
3156         (is_hex): Made static.
3157         (real_type_suffix): Made static.
3158
3159         * decl.cs (SetupCache): Made static.
3160         (OnGenerateDocComment): Removed unused ds argument.
3161
3162         * delegate.cs (VerifyDelegate): Removed unused argument.
3163
3164         * doc.cs: Uses Length for empty string test.
3165
3166         * driver.cs: Uses Length for empty string test.
3167
3168         * enum.cs (IsValidEnumType): Made static
3169
3170         * expression.cs (EnumLiftUp): Removed unused argument.
3171         (ResolveMethodGroup): Ditto.
3172         (BetterConversion): Ditto.
3173         (GetVarargsTypes): Ditto.
3174         (UpdateIndices): Ditto.
3175         (ValidateInitializers): Ditto.
3176         (MemberAccess.ctor): Ditto.
3177         (GetIndexersForType): Ditto.
3178
3179         * flowanalysis.cs: (MergeFinally): Removed unused argument.
3180
3181         * iterators.cs: Updated after MemberAccess clean up.
3182
3183         * location.cs: Uses Length for empty string test.
3184
3185         * namespace.cs: Uses Length for empty string test.
3186
3187          * report.cs (CheckWarningCode): Made static.
3188
3189         * statement.cs (LabeledStatement): Removed unused argument.
3190
3191         * typemanager.cs (FilterNone): Removed.
3192
3193 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
3194
3195         * codegen.cs (EmitContext.TestObsoleteMethodUsage): Removed as it become
3196         obsolete.
3197
3198         * class.cs: Updated.
3199
3200 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
3201
3202         * cs-parser.jay.cs: __arglist is not allowed for delegates.
3203
3204 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
3205
3206         A fix for #77822.
3207
3208         * expression.cs (VerifyArgumentsCompat): Reverted to double error
3209         reporting, it's more tricky than I thought.
3210
3211 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
3212
3213         A fix for #77816.
3214
3215         * anonymous.cs.cs (AnonymousMethod): Add host to allow access to 
3216         host container.
3217         (AnonymousMethod.ImplicitStandardConversionExists): New method.
3218         (AnonymousMethod.Compatible): Moved parameter resolving to DoResolve.
3219         Add more error reporting; Fixed issue with params.
3220
3221         * convert.cs (ImplicitStandardConversionExists): Returned conversion check.
3222
3223         * cs-parser.jay: AnonymousMethod requires host container.
3224
3225         * delegate.cs (NewDelegate.DoResolve): Updated after Compatible changes.
3226
3227 2006-03-18  Raja R Harinath  <harinath@gmail.com>
3228
3229         * class.cs: Change 'TypeContainer ds' constructor argument to
3230         'DeclSpace parent'.  Some classes were missed below due to
3231         different naming convention.
3232
3233         * class.cs (MemberCore.Parent): Delete.  This makes the
3234         ParentContainer changes below enforceable by the compiler.
3235
3236         Treat pointers to enclosing declaration space as 'DeclSpace', not
3237         'TypeContainer'.
3238         * class.cs, const.cs, delegate.cs, enum.cs, iterator.cs: Change
3239         'TypeContainer parent' constructor argument to 'DeclSpace parent'.
3240
3241         * statement.cs (LocalInfo..ctor): Use DeclSpace argument instead
3242         of TypeContainer.
3243         (Block.AddThisVariable): Likewise.
3244         * class.cs (MethodData.Define, MethodData.Emit): Likewise.
3245         (AbstractPropertyEventMethod.Emit): Likewise.
3246         (AbstractPropertyEventMethod.EmitMethod): Likewise.
3247         (GetMethod.Define, SetMethod.Define): Likewise.
3248         (PropertyMethod.Define, DelegateMethod.Define): Likewise.
3249         (DelegateMethod.EmitMethod): Likewise.
3250
3251         Fix regression test-partial-13.cs.
3252         Rationalize use of PartialContainer.  Ensure that the partial
3253         class semantics can be tied to type-correctness, i.e., any
3254         violation will cause a compile error.
3255         * class.cs, const.cs: Access all fields that belong to class
3256         TypeContainer via ParentContainer.  Arguments of EmitContexts and
3257         Resolve()-like functions still use 'Parent'.
3258
3259         * class.cs (SourceMethod): Use DeclSpace, not TypeContainer.
3260         (*.CreateEmitContext): Change TypeContainer argument to DeclSpace.
3261         (PropertyMethod.CheckModifiers): Remove unused argument.
3262         * codegen.cs (EmitContext..ctor): Change TypeContainer argument to
3263         DeclSpace.
3264
3265 2006-03-17  Raja R Harinath  <harinath@gmail.com>
3266
3267         Make semantics of PartialContainer simpler.
3268         * decl.cs (DeclSpace.IsPartial): Remove.
3269         * class.cs (TypeContainer.IsPartial): Likewise.
3270         (TypeContainer..ctor): Set PartialContainer to point to self.
3271         (TypeContainer.GetClsCompliantAttributeValue): Don't use IsPartial.
3272         (TypeContainer.FindNestedType): Likewise.
3273         (MemberCore.ParentContainer): Simplify.  Remove deprecation.
3274
3275 2006-03-17  Marek Safar  <marek.safar@seznam.cz>
3276
3277         * typemanager.cs.cs (GetInterfaces): Don't recreate 0-sized arrays.
3278
3279 2006-03-15  Marek Safar  <marek.safar@seznam.cz>
3280
3281         * class.cs (FieldMember.Emit): ParentContainer is real parent for partial
3282         classes.
3283
3284 2006-03-15  Marek Safar  <marek.safar@seznam.cz>
3285
3286         * class.cs (Operator.Define): An error for base conversion was not
3287         reported correctly.
3288
3289 2006-03-14  Atsushi Enomoto  <atsushi@ximian.com>
3290
3291         * iterator.cs : yield break is allowed in try statement which has
3292           catch clauses. Fixed bug #77767.
3293
3294 2006-03-13  Marek Safar  <marek.safar@seznam.cz>
3295
3296         A fix for #77593, #77574.
3297
3298         * class.cs (MethodCore.CheckBase): Another if for operator.
3299
3300 2006-03-09  Marek Safar  <marek.safar@seznam.cz>
3301
3302         * anonymous.cs (AnonymousMethod.Compatible): Don't crash when parameters
3303         were not resolved
3304
3305         * delegate.cs (Delegate.GetInvokeMethod): Use emitcontext free MemberLookup.
3306         (DelegateCreation.ImplicitStandardConversionExists): New method for just
3307         conversion test.
3308         
3309         *ecore.cs (Expression.MemberLookup): Don't ask for emitcontext when it's
3310         not needed.
3311
3312         * assign.cs, constant.cs, convert.cs, delegate.cs, expression.cs:
3313         Updated after another emitcontext usage was clean up. It should help us to
3314         synchronize with gmcs easier.
3315
3316 2006-03-04  Marek Safar  <marek.safar@seznam.cz>
3317
3318         A fix for #77353.
3319
3320         * class.cs (SetMethod.DefineParameters): Uses new parameters type ctor.
3321         (Event.Define): ditto
3322         (SetIndexerMethod.DefineParameters): Uses Parameters.MergeGenerated.
3323
3324         * delegate.cs (Delegate.Define): Uses Parameters.MergeGenerated.
3325         Removed redundant code and set NewSlot for Invoke method too.
3326
3327         * parameter.cs (Parameters.ctor): Add custom, type ctor.
3328         (Parameters.MergeGenerated): New method. Use this method when you merge
3329         compiler generated argument with user arguments.
3330
3331 2006-03-03  Marek Safar  <marek.safar@seznam.cz>
3332
3333         * attribute.cs (ResolveAsTypeTerminal): Removed.
3334
3335         * ecore.cs (Expression.ResolveAsTypeTerminal): Make virtual to allow
3336         specialization for predefined types; 30% speed up.
3337         Finally placed obsolete check to right place.
3338         (Expression.ResolveType): Removed.
3339
3340         * enum.cs, expression.cs, parameter.cs, statement.cs, typemanager.cs:
3341         Updated after ResolveType was removed.
3342
3343         * expression.cs (Cast.ctor): Check void cast.
3344         (Binary.ResolveAsTypeTerminal): Is never type.
3345         (Conditional.ResolveAsTypeTerminal): Is never type.
3346
3347         * rootcontext.cs (ResolveCore): Set base type to simplify some code later.
3348
3349 2006-03-01  Raja R Harinath  <rharinath@novell.com>
3350
3351         Fix #77679.
3352         * expression.cs (ParameterReference.DoResolveBase): Change return
3353         type to bool.
3354         (ParameterReference.DoResolve, ParameterReference.DoResolveLValue):
3355         Update.
3356
3357         Fix #77628.
3358         * ecore.cs (PropertyExpr.InstanceResolve): Fix CS1540 check.
3359
3360         Fix #77642.
3361         * typemanager.cs (GetFullNameSignature): Don't nullref on
3362         protected accessors.
3363
3364 2006-02-27  Marek Safar  <marek.safar@seznam.cz>
3365
3366         * attribute.cs (Attribute.PosArguments, Attribute.NamedArguments): Use
3367         these two separated members to simplify the code.
3368         (Attribute.Resolve): Refactored to use new fields and methods.
3369         (Attribute.ResolveConstructor): Extracted from ResolveArguments and
3370         implemented obsolete attribute checking.
3371         (Attribute.ResolveNamedArguments): Extracted from ResolveArguments and
3372         implemented obsolete checking again. It look line never ending quest ;-)
3373         (GlobalAttribute.ResolveConstructor): Need to override as the rest.
3374
3375         * cfold.cs (BinaryFold): TryReduce throws an exception to indicate error.
3376
3377         * constanct.cs (TryReduce): Throws OverflowException to indicate error.
3378
3379         *class.cs (Property.Define): Add RegisterProperty call.
3380
3381         * cs-parser.jay: Replaced ArrayList with fixed array for attribute
3382         argument groups (only 2).
3383
3384         * ecore.cs (Expression.GetAttributableValue): New virtual method used for
3385         encoding expression to arguments.
3386         (Expression.ExprClassToResolveFlags): Just turned to property.
3387
3388         * expression.cs (ArrayCreation.ValidateInitializers): Slightly optimized.
3389         (ArrayCreation.GetAttributableValue): Renamed from EncodeAsAttribute and
3390         optimized as well as implemented support for zero-length attributes.
3391
3392         * typemanager.cs (TypeManager.RegisterProperty, TypeManager.GetProperty):
3393         Add caching of PropertyInfo's.
3394
3395 2006-02-25  Marek Safar  <marek.safar@seznam.cz>
3396
3397         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Don't report
3398         error multiple times.
3399
3400 2006-02-25  Marek Safar  <marek.safar@seznam.cz>
3401
3402         New partial class implementation.
3403         A fix for #77027, #77029, #77403
3404
3405         * attribute.cs (Attributable): Made attributes protected.
3406
3407         * class.cs (TypeContainer): Add PartialContainer and partial_parts as
3408         the replacements of ClassPart and PartialContainer.
3409         (TypeContainer.AddClassOrStruct): Call RecordDecl here.
3410         (TypeContainer.AddInterface): Ditto.
3411         (TypeContainer.AddPartial): The main method for partial classes. It checks
3412         for errors and merges ModFlags and attributes. At the end class is added to
3413         partial_parts list.
3414         (TYpeContainer.DefineDefaultConstructor): Checks whether default ctor is
3415         required here.
3416         (TypeContainer.GetClsCompliantAttributeValue): Cope with partial class too.
3417         (TypeContainer.GetNormalPartialBases): Resolves base classes and interfaces
3418         from the rest of partial classes.
3419         (TypeContainer.GetClassBases): Simplified.
3420         (TypeContainer.DefineTypeBuilder): New method, mostly extracted from
3421         DefineType.
3422         (TypeContainer.DefineDefaultConstructor): Is used by derived classes.
3423         (TypeContainer.HasExplicitLayout): Uses Flags now.
3424         (PartialContainer): Removed.
3425         (ClassOrStruct.AddToContainer): Moved enclosing member name check here.
3426         (StaticClass): Was merged with Class.
3427         (Class.GetClassBases): class and static class bases are verified here.
3428         (Class.TypeAttr): Added static attributes when class is static.
3429         (Struct.RegisterFieldForInitialization): Moved from TypeContainer.
3430         (MemberBase): In some cases we need to call parent container for partial
3431         class. It should be eliminated but it's not easy now.
3432
3433         * cs-parser.jay: Replaced all PartialContainer with AddPartial.
3434
3435         * decls.cs (MemberCore.DocComment): Introduced new property as is used by
3436         partial classed to accumulate class comments.
3437         (MemberCore.GetClsCompliantAttributeValue): Moved from TypeContainer.
3438
3439         * doc.cs (GenerateTypeDocComment): Partial classes clean up.
3440
3441         * driver.cs (MainDriver): Tree.GetDecl was removed.
3442
3443         * modifiers.cs (Modifiers): Add partial modifier.
3444
3445         * tree.cs (Tree.decl): Removed.
3446         (RootTypes): Started to use this class more often for root types
3447         specializations.
3448
3449 2006-02-22  Marek Safar  <marek.safar@seznam.cz>
3450
3451         A fix for #77615
3452
3453         * attribute.cs (AttributeTester.GetCoClassAttribute): Don't crash when
3454         external interface does not have an attribute.
3455
3456 2006-02-22  Marek Safar  <marek.safar@seznam.cz>
3457
3458         Another prerequisites for new partial classs implementation.
3459         
3460         * attribute.cs (Attribute.Equal): Implemented.
3461         (Attribute.Emit): Changed as attributes can be applied more than twice.
3462         (Attributes.Emit): Check for duplicate attributes here.
3463
3464         * class.cs, decl.cs, delegate.cs, doc.cs, enum.cs: Don't pass DeclSpace
3465         as a parameter, clean-up.
3466
3467 2006-02-11  Marek Safar  <marek.safar@seznam.cz>
3468
3469         A fix for #77485
3470
3471         * class.cs (TypeContainer.DefineType): Cannot use ResolveType because it
3472         contains obsolete attribute check which can in some cases look for base
3473         type of current class which is not initialized yet.
3474         (TypeContainer.BaseType): Replacement of ptype.
3475
3476         * decl.cs (MemberCore.CheckObsoleteType): Reuse existing code.
3477
3478 2006-02-11  Marek Safar  <marek.safar@seznam.cz>
3479
3480         First of prerequisites for new partial classs implemention.
3481         
3482         * attribute.cs (Attributable): Extended by ResolveContext;
3483         Attributes finally have correct context for resolving in all cases.
3484         (AttachTo): Attribute owner is assigned here.
3485
3486         * codegen.cs (IResolveContext): Introduce new interface to hold
3487         all information needed in resolving phase.
3488         (EmitContext): Implements IResolveContext; more clean-up needed here.
3489         
3490         * decl.cs (MemberCore): Implemented IResolveContext.
3491
3492         * anonymous.cs, attribute.cs, class.cs, codegen.cs, const.cs,
3493         decl.cs, ecore.cs, enum.cs, expression.cs, iterators.cs, namespace.cs,
3494         parameter.cs, statement.cs, tree.cs, typemanager.cs:
3495         Refactored to use new IResolveContext instead of EmitContext; cleanup
3496
3497 2006-02-06  Miguel de Icaza  <miguel@novell.com>
3498
3499         * codegen.cs (EmitScopeInitFromBlock): check here the
3500         capture_context, there is no need to make two calls to the
3501         EmitContext. 
3502
3503         * anonymous.cs: Add some debugging messages that might help me
3504         track other instances of this problem in the future (the
3505         regression of test 467).
3506
3507         * cs-parser.jay: track the variable block, as we need to initalize
3508         any captured variables declared in this block for the "catch"
3509         portion of the "Try" statement.
3510
3511         * statement.cs (Try.Emit): If the "Catch" has a VarBlock, emit any
3512         scope initialization for captured variables. 
3513
3514         Also, move the emit for the variables after the block location has
3515         been marked.
3516
3517 2006-02-06  Marek Safar  <marek.safar@seznam.cz>
3518
3519         * ecore.cs (PropertyExpr.FindAccessors): Just made flags const.
3520
3521 2006-02-02  Miguel de Icaza  <miguel@novell.com>
3522
3523         * anonymous.cs (CaptureContext.EmitInitScope): I was wrong in the
3524         commit yesterday, the initialization for the roots is necessary.
3525         What is not necessary is the scope activation.
3526
3527 2006-02-02  Raja R Harinath  <rharinath@novell.com>
3528
3529         * ecore.cs (PropertyExpr.DoResolveLValue): Add CS0206 check.
3530         * expression.cs (IndexerAccess.DoResolveLValue): Add CS1612 and
3531         CS0206 checks.
3532         (Argument.Resolve): Remove CS0206 checks.
3533
3534 2006-02-01  Miguel de Icaza  <miguel@novell.com>
3535
3536         * anonymous.cs (CaptureContext.EmitInitScope): Do not emit the
3537         scopes for all the roots, the scopes will now be emitted when the
3538         Blocks are entered.   [This change was wrong, fixed on 2006-02-02]
3539
3540         (CaptureContext.EmitScopeInitFromBlock): Simply emit the ScopeInfo
3541         code.  This reduces a lot of existing cruft.
3542         
3543         * statement.cs (Block.Emit): Call EmitScopeInitFromBlock here, so
3544         that the ScopeInfo is generated as we enter the scope, not at the
3545         time of use, which is what we used to do before.
3546
3547         * codegen.cs (EmitScopeInitFromBlock): New routine, this is called
3548         every time a Block is about to be emitted if we have a
3549         CaptureContext. 
3550
3551 2006-02-01  Raja R Harinath  <rharinath@novell.com>
3552
3553         * typemanager.cs (NoTypes, NoTypeExprs): Remove.
3554         (Reset): Update.
3555         * *.cs: Use Type.EmptyTypes instead of TypeManager.NoTypes.
3556
3557         * typemanager.cs (cons_param_array_attribute): Make private.
3558         (Reset): Set it to null.
3559         (InitCoreHelpers): Don't initialize it.
3560         (ConsParamArrayAttribute): New.  Initialize it as needed.
3561         * parameter.cs (ParamsParameter.ApplyAttribute): Update to change.
3562
3563 2006-01-31  Miguel de Icaza  <miguel@novell.com>
3564
3565         * expression.cs: There might be errors reported during the
3566         selection of applicable methods.  If there are errors, do not
3567         continue execution as it will lead the compiler to crash.
3568
3569 2006-01-30  Miguel de Icaza  <miguel@novell.com>
3570
3571         * expression.cs: Member access is not allowed on anonymous
3572         methods.  Fixes #77402.
3573
3574 2006-01-30  Raja R Harinath  <rharinath@novell.com>
3575
3576         Fix #77401
3577         * cs-parser.jay (VariableDeclaration): Don't set
3578         current_array_type to null.
3579         (field_declaration, event_declaration, declaration_statement):
3580         Set it to null here.
3581
3582 2006-01-28  Raja R Harinath  <harinath@gmail.com>
3583
3584         * typemanager.cs (GenericParameterPosition): New.
3585         * doc.cs: Use it.
3586
3587 2006-01-28  Atsushi Enomoto  <atsushi@ximian.com>
3588
3589         * doc.cs : To process "include" elements, first we should create
3590           another list than XmlNodeList, because it could result in node
3591           removal, which could result in that the XmlNodeList gives up
3592           yielding next node.
3593
3594           (Also made code identical to gmcs again.)
3595
3596 2006-01-25  Miguel de Icaza  <miguel@novell.com>
3597
3598         * ecore.cs: Introduce an error report that we were not catching
3599         before, if not silent, we must report the error.  Gonzalo ran into
3600         it.
3601
3602 2006-01-23  Miguel de Icaza  <miguel@novell.com>
3603
3604         A fix for bug: #76957
3605         
3606         * iterators.cs (MoveNextMethod.CreateMethodHost): call
3607         ComputeMethodHost before creating the method, this is a new
3608         requirement. 
3609
3610         * anonymous.cs (AnonymousContainer): Now we track all the scopes
3611         that this method references (RegisterScope).  The actual scope
3612         where the method is hosted is computed with the ComputeMethodHost
3613         before we create the method.
3614
3615         Moved the Deepest routine here.
3616
3617         (AnonymousContainer.ComputeMethodHost): New routine used to
3618         compute the proper ScopeInfo that will host the anonymous method.
3619
3620         (ScopeInfo): Deal with multiple roots.  The problem was that we
3621         did not have a unique root where all ScopeInfos could be hanged
3622         from.   Remove `topmost' ScopeInfo, and instead keep an arraylist
3623         of roots.  
3624
3625         Remove AdjustMethodScope which is now computed at the end.  Remove
3626         LinkScope which did a partial link, instead link all ScopeInfos
3627         before code generation from the new "LinkScopes" routine. 
3628
3629         Simplify all the Add* routines as they no longer need to maintain
3630         the tree, they just need to record that they are using variables
3631         from a ScopeInfo.
3632
3633         (IsAncestor, GetAncestorScopes, GetParentScope, LinkScope): New
3634         routines to produce the forest of ScopeInfo trees.
3635
3636         * class.cs (TypeContainer.AppendMethod): This is just like
3637         AddMethod, but ensures that an interface implementation method
3638         (IEnumerable.XXX) is not inserted at the beginning of the queue of
3639         methods, but at the end.
3640
3641         We use this functionality to ensure that the generated MoveNext
3642         method in the iterator class is resolved/emitted before the
3643         enumerator methods created.   
3644
3645         This is required because the MoveNext method computes the right
3646         ScopeInfo for the method.  And the other methods will eventually
3647         need to resolve and fetch information computed from the anonymous
3648         method. 
3649
3650 2006-01-21  Raja R Harinath  <harinath@gmail.com>
3651             Carlos Alberto Cortez  <calberto.cortez@gmail.com>
3652
3653         Fix rest of #76995.
3654         * namespace.cs (NamespaceEntry.UsingExternalAliases): Don't add to
3655         the 'aliases' hash.
3656         (NamespaceEntry.LookupAlias): Lookup 'extern_aliases' hash too.
3657         (NamespaceEntry.VerifyUsing): Resolve external aliases too.
3658
3659 2006-01-18  Raja R Harinath  <rharinath@novell.com>
3660
3661         Fix #76656, cs0231-2.cs.
3662         * cs-parser.jay (formal_parameter_list): Make error case catch
3663         more issues.
3664         (parenthesized_expression_0): Add CS1026 check.
3665         (invocation_expression): Remove unused { $$ = lexer.Location }.
3666
3667 2006-01-17  Raja R Harinath  <rharinath@novell.com>
3668
3669         Fix #76824.
3670         * cs-parser.jay (statement_expression): Don't list out the
3671         individual statement-expressions.  Convert syntax error into
3672         CS0201 check.
3673
3674 2006-01-16  Raja R Harinath  <rharinath@novell.com>
3675
3676         Fix #76874.
3677         * ecore.cs (MemberAccess.CheckIntermediateModification): Remove.
3678         (UnboxCast.DoResolveLValue): New.  Move CS0445 check from
3679         CheckIntermediateModification.
3680         (FieldExpr.DoResolve): Add new two-argument version that
3681         allows us to resolve the InstanceExpression as an lvalue.
3682         The one-argument variant is now just a wrapper.
3683         (FieldExpr.DoResolveLValue): Use two-argument DoResolve.
3684         Resolve the lhs as an lvalue if the it has a value type.
3685         (FieldExpr.AssignToReadonly): Move CS1648 and CS1650 checks
3686         from Assign.DoResolve.
3687         (PropertyExpr.InstanceResolve): Allow InstanceExpression to be
3688         resolved as an lvalue.
3689         (PropertyExpr.DoResolve): Update.
3690         (PropertyExpr.DoResolveLValue): Resolve the lhs as an lvalue if it
3691         has a value type.  Move CS1612 check here from
3692         CheckIntermediateModification.
3693         * assign.cs (Assign.DoResolve): Remove CS1648 and CS1650 checks.
3694         * expression.cs (EmptyExpression.OutAccess): New.  Used as the
3695         'right_side' of a ResolveLValue on an 'out' argument.
3696         (EmptyExpression.LValueMemberAccess): New.  Used as the
3697         'right_side' of a propagated ResolveLValue on a value type.
3698         (LocalVariableReference.DoResolveBase): Recognize
3699         EmptyExpression.OutAccess and EmptyExpression.LValueMemberAccess.
3700         Add CS1654 check.
3701         (Argument.Resolve): Use EmptyExpression.OutAccess rather than
3702         EmptyExpression.Null.
3703
3704 2006-01-16  Atsushi Enomoto  <atsushi@ximian.com>
3705
3706         * typemanager.cs : added IsGenericParameter(). In mcs it always
3707           return false.
3708         * doc.cs : for generic parameters, use GenericParameterPosition,
3709           not FullName.
3710
3711 2006-01-12  Ben Maurer  <bmaurer@andrew.cmu.edu>
3712
3713         * expression.cs: Fix Console.WriteLine ((this = x).foo);
3714
3715 2006-01-12  Miguel de Icaza  <miguel@novell.com>
3716
3717         This fixes the problem where we used ldfld instead of ldflda to
3718         load the "THIS" pointer on captured parameters, when THIS is a
3719         value type.  See bug #77205.
3720         
3721         * iterators.cs (CapturedThisReference.Emit): Pass false to
3722         EmitThis (we do not need the address).
3723
3724         * codegen.cs (EmitThis): it needs to know whether we need the
3725         address of `this' or not.  This is used by value types.  
3726
3727         * expression.cs (This.AddressOf): Pass true to the EmitThis call,
3728         every other call passes false.
3729
3730 2006-01-12  Raja R Harinath  <rharinath@novell.com>
3731
3732         Fix #77221.
3733         * typemanager.cs (TryGetBaseDefinition): Rename from the mis-named
3734         GetOverride.
3735         * expression.cs (Invocation.OverloadResolve): Update.
3736         (Invocation.DoResolve): Avoid double resolution of invocation.
3737
3738 2006-01-11  Raja R Harinath  <rharinath@novell.com>
3739
3740         Fix #77180.
3741         * expression.cs (Unary.Emit): When in /checked+ mode, don't emit
3742         unary negation of floating point types as 0-expr; negation cannot
3743         overflow in floating point types.
3744
3745         Fix #77204.
3746         * expression.cs (MemberAccess.DoResolve): Disallow the use of '.'
3747         on operands of 'void' type.
3748
3749         Fix #77200.
3750         * cfold.cs (BinaryFold): Implement folding of BinaryOr, BinaryAnd
3751         and ExclusiveOr for boolean constants too.
3752
3753 2006-01-09  Raja R Harinath  <rharinath@novell.com>
3754
3755         Fix #75636.
3756         * expression.cs (Invocation.OverloadResolve): Replace reflected
3757         override methods with their base virtual methods, rather than
3758         skipping over them.
3759         * typemanager.cs (TypeManager.GetOverride): New.
3760
3761 2006-01-05  Jb Evain  <jbevain@gmail.com>
3762
3763         * class.cs (Property.Define, Indexer.Define): do not tag the
3764         properties as SpecialName | RTSpecialName.
3765
3766 2006-01-04  Miguel de Icaza  <miguel@novell.com>
3767
3768         * class.cs (MethodCore.IsDuplicateImplementation): This method was
3769         doing a low-level comparission of parameter types.  It was lacking
3770         a check for __argslist. 
3771
3772 2005-12-30  Miguel de Icaza  <miguel@novell.com>
3773
3774         * expression.cs (ParameterReference.DoResolveBase): Allow
3775         reference parameters if they are local to this block. 
3776
3777         This allows the ref and out parameters of a delegate to be used in
3778         an anonymous method, for example:
3779
3780         delegate void set (out int x);
3781
3782         set s = delegate (out int x){
3783                 x = 0;
3784         };
3785
3786         This is used by functionality introduced late in the C# language.
3787         
3788         * anonymous.cs (AnonymousMethod.Compatible): Allow anonymous
3789         method that take ref and out parameters. 
3790
3791         Fixes #77119 which was a late change in the spec.
3792
3793 2005-12-23  Miguel de Icaza  <miguel@novell.com>
3794
3795         * anonymous.cs (ScopeInfo.LinkScope): Do not link the scope to its
3796         parent if its the same scope.  Fixes #77060.
3797
3798 2005-12-21  Miguel de Icaza  <miguel@novell.com>
3799
3800         * driver.cs: Report the case of no source files and no -out:
3801         argument provided.
3802
3803 2005-12-20  Raja R Harinath  <rharinath@novell.com>
3804
3805         Fix #77035.
3806         * expression.cs (ComposedCast.GetSignatureForError): Define.
3807
3808 2005-12-18 Carlos Alberto Cortez <calberto.cortez@gmail.com>
3809
3810         Fix #76995
3811
3812         * namespace.cs (NamespaceEntry): Add extern_aliases as a
3813         ListDictionary, to contain the ExternAliasEntry entries (in
3814         addition to the NamespaceEntry.aliases hashtable). This field is
3815         shared between the original entry and its doppelganger (bodyless 
3816         copy of it).
3817         (NamespaceEntry.UsingExternalAlias): Add the extern alias entry to
3818         extern_aliases field.
3819         (NamespaceEntry.Lookup): Move the IsImplicit check after the
3820         lookup in extern_aliases.
3821
3822 2005-12-16  Raja R Harinath  <rharinath@novell.com>
3823
3824         Fix #77006.
3825         * class.cs (TypeContainer.Mark_HasEquals): New.
3826         (TypeContainer.Mark_HasGetHashCode): New.
3827         (ClassPart): Override them.
3828         (MethodCore.CheckBase): Use them instead of referring to Parent.Methods.
3829
3830         Fix #77008.
3831         * enum.cs (EnumMember.EnumMember): Pass the parent_enum as the
3832         'parent' argument to the base constructor.
3833
3834         Remove all mention of TypeContainer from decl.cs.
3835         * decl.cs (MemberCore.Parent): Change into a DeclSpace.
3836         (MemberCore.MemberCore): Change type of 'parent' argument to DeclSpace.
3837         (DeclSpace.DeclSpace): Likewise.
3838         (DeclSpace.DefineMembers): Remove unused argument.
3839         * cs-parser.jay (pop_current_class): Update to changes.  Simplify
3840         debugging check -- we don't care if the debug code throws an
3841         InvalidCastException instead of an InternalErrorException.
3842         * class.cs (TypeContainer.DefineMembers): Update to changes.
3843         (TypeContainer.DoDefineMembers): Likewise.
3844         (TypeContainer.GetMethods): Likewise.
3845         (PropertyMember.Define): Likewise.
3846         (MemberBase.Parent): New property that forwards to
3847         MemberCore.Parent, but ensures that we get a TypeContainer.
3848         * rootcontext.cs (RootContext.PopulateCoreType): Update to changes.
3849         (RootContext.PopulateTypes): Likewise.  Remove special case code
3850         for !RootContext.StdLib: DefineMembers is idempotent.
3851
3852 2005-12-14  Miguel de Icaza  <miguel@novell.com>
3853
3854         * convert.cs (ExplicitConversionCore): Check the return value from
3855         ExplicitConversionCore which can return null on failure.  Fixes #76914
3856
3857 2005-12-13  Marek Safar  <marek.safar@seznam.cz>
3858
3859         * class.cs (Method.ApplyAttributeBuilder): Test out modifier properly.
3860
3861 2005-12-11  Atsushi Enomoto  <atsushi@ximian.com>
3862
3863         * doc.cs : The search for referenced namespace was insufficient to
3864           get global one as it used to do. Fixed bug #76965.
3865
3866 2005-12-10  Atsushi Enomoto  <atsushi@ximian.com>
3867
3868         * doc.cs : check name in cref in the last phase that whether it is
3869           namespace or not.
3870
3871 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
3872
3873         * cs-tokenizer.cs : reverted the latest change: it somehow broke
3874           Mono.C5.
3875
3876 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
3877
3878         * doc.cs : so it turned out that we cannot skip override check for 
3879           interface members. Fixed bug #76954.
3880
3881 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
3882
3883         * cs-tokenizer.cs : fixed bug #75984:
3884           - #warning and #error should not be handled when the source line
3885             is disabled.
3886           - #line is not checked strictly when the source line is disabled.
3887           - #define and #undef is on the other hand checked strictly at any
3888             state.
3889
3890 2005-12-08  Atsushi Enomoto  <atsushi@ximian.com>
3891
3892         * cs-tokenizer.cs : missing Location (actually, filename) in one of
3893           CS1027 report.
3894
3895 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
3896
3897         * attribute.cs (GlobalAttribute.ctor): Pass NamespaceEntry only.
3898
3899         * class.cs (EmitFieldInitializers): Simplified and fixed to work with
3900         event initializers.
3901         (FieldBase.EmitInitializer): Moved from TypeContainer and simplified.
3902         (FieldBase.Initializer): Initializer is now optional.
3903         (EventField.Define): Only event field can have initializer.
3904
3905         * codegen.cs (EmitContext): DeclSpace is not readonly (small hack).
3906
3907         * const.cs (Const): Reuse initializer.
3908
3909         * cs-parser.jay: Updated after FieldBase changes.
3910         Added current_array_type to simplify array initializers.
3911
3912         * ecore.cs (NullCast.IsDefaultValue): Implemented.
3913
3914         * expression.cs, iterators.cs: Updated.
3915
3916         * namespace.cs (NamespaceEntry): Made UsingFound private.
3917
3918 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
3919
3920         * parameterCollection.cs: Obsolete, removed.
3921         * parser.cs: Obsolete, removed.
3922
3923 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
3924
3925         Fix #76849.
3926         * class.cs (Constructor.Emit): Set obsolete checking for whole context.
3927
3928         * enum.cs (Enum.Define): Set obsolete context here.
3929
3930 2005-12-05  Atsushi Enomoto  <atsushi@ximian.com>
3931
3932         * doc.cs :
3933           - FindDocumentedMember() now expects 1) paramList as null
3934             when "we don't have to check the number of parameters" and
3935             2) Type.EmptyTypes when "there is no arguments".
3936           - Introduced FoundMember struct to hold the exact type which was
3937             used to find the documented member (the above change broke
3938             test-xml-044; it might be better just to use DeclaringType than
3939             what MS does, like this change does, but it depends on usage.)
3940
3941 2005-12-05  Atsushi Enomoto  <atsushi@ximian.com>
3942
3943         * doc.cs : documented member might be from DeclaringType for nested
3944           types. Fixed bug #76782.
3945
3946 2005-12-03  Ben Maurer  <bmaurer@ximian.com>
3947
3948         * anonymous.cs: Have the param code handle leaving copies on the
3949         stack etc. Allows anonymous params to take part in the assignment
3950         code (++, +=, etc). Fixes bug #76550
3951
3952         * expression.cs: Handle the prepare_for_load/leave_copy by passing
3953         it down to the anon code.
3954
3955         * iterators.cs: Use dummy var here
3956
3957         * codegen.cs: Handle new vars
3958
3959 2005-12-01  Marek Safar  <marek.safar@seznam.cz>
3960
3961         Fix #76849.
3962         * class.cs (MethodData.Define): Set proper Obsolete context.
3963
3964         * ecore.cs (FieldExpr.ResolveMemberAccess): Don't check [Obsolete] in
3965         obsolete context.
3966         (FieldExpr.DoResolve): Ditto.
3967
3968 2005-12-01  Marek Safar  <marek.safar@seznam.cz>
3969
3970         Fix #76849.
3971         * class.cs (MethodCore.DoDefineParameters): Test [Obsolete] only when
3972         parent is not obsolete.
3973
3974 2005-12-01  Atsushi Enomoto  <atsushi@ximian.com>
3975
3976         * doc.cs : (FindDocumentedMember) find parameterless members first
3977           and get CS0419 in the early stage. Fixed first case of bug #76727.
3978
3979 2005-11-30  Marek Safar  <marek.safar@seznam.cz>
3980
3981         Fix #76859.
3982         * ecore.cs (Expression.ResolveAsConstant): Report constant error only when
3983         no error was reported.
3984
3985         *expression.cs (Binary.DoResolve): left can be null.
3986
3987 2005-11-22  Marek Safar  <marek.safar@seznam.cz>
3988
3989         Fix #76783.
3990         * class.cs (MethodData.Emit): Parameters should be labeled first.
3991
3992 2005-11-21  Marek Safar  <marek.safar@seznam.cz>
3993
3994         Fix #76761.
3995         * parameter.cs (Parameter.ApplyAttributeBuilder): Fixed `ref' detection.
3996
3997 2005-11-18  Marek Safar  <marek.safar@seznam.cz>
3998
3999         * attribute.cs (AreParametersCompliant): Moved to Parameter.
4000
4001         * class.cs (MethodCore): Parameter clean up.
4002         (IMethodData): Added ParameterInfo.
4003         (MethodData): Parameter clean up.
4004         (Indexer.Define): Parameter clean up.
4005
4006         * anonymous.cs,
4007         * codegen.cs,
4008         * cs-parser.jay,
4009         * decl.cs,
4010         * doc.cs,
4011         * ecore.cs,
4012         * flowanalysis.cs,
4013         * iterators.cs,
4014         * pending.cs,
4015         * statement.cs,
4016         * typemanager.cs: Parameter clean up.
4017
4018         * delegate.cs (Define): Get rid of duplicated code.
4019
4020         * expression.cs (ParameterReference): Removed useless parameters
4021         and simplified.
4022         (Invocation): Ditto.
4023
4024         * parameter.cs (ParamsParameter): New class, params specialization.
4025         (ArglistParameter): Attemp to separate arglist.
4026         (Parameter): Refactored to be reusable and faster.
4027         (Parameter.Modifier): Made understandable.
4028         (Parameters): Changed to be used as a class for `this' assembly
4029         parameters. Refactored to use new specialized classes.
4030
4031         * support.cs (ParameterData): Added Types property.
4032         (InternalParameters): Deleted.
4033
4034 2005-08-20  Martin Baulig  <martin@ximian.com>
4035
4036         Merging this patch from GMCS to fix #75867.
4037
4038         * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
4039         scope if we don't already have it.
4040
4041 2005-11-17  Martin Baulig  <martin@ximian.com>
4042
4043         * anonymous.cs
4044         (CaptureContext.EmitMethodHostInstance): Use `Ldarg_0' if we
4045         inherit the scope from our parent.  Fixes #76653.
4046
4047 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
4048
4049         * doc.cs : the previous patch does not actually fix the bug.
4050           PropertyInfo override check is now implemented and really fixed it.
4051         * expression.cs : Invocation.IsAncestralType() is used from doc.cs.
4052
4053 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
4054
4055         * doc.cs : apply "override filter" also to properties.
4056           Fixed bug #76730.
4057
4058 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
4059
4060         * doc.cs : renamed FindMembers() to FindMethodBase(). For interfaces,
4061           no need to check overrides. For classes, omit those results from 
4062           interfaces since they must exist in the class. Fixed bug #76726.
4063
4064 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
4065
4066         * typemanager.cs : (GetFullNameSignature) differentiate indexers
4067           with different parameters. Fixed the second problem in #76685.
4068
4069 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
4070
4071         * doc.cs : (FindDocumentedMember) pass invocation_type as well (to
4072           get expected 'protected' access in CheckValidFamilyAccess()).
4073           Fixed bug #76692.
4074
4075 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
4076
4077         * doc.cs : (GenerateTypeDocComment) Fields could be FixedField.
4078           Fixed bug #76705.  CS1569 was incorrectly commented out.
4079
4080 2005-11-14  Atsushi Enomoto  <atsushi@ximian.com>
4081
4082         * doc.cs : use Invocation.IsOverride() to do real override check.
4083         * expression.cs : made Invocation.IsOverride() internal.
4084
4085 2005-11-14  Atsushi Enomoto  <atsushi@ximian.com>
4086
4087         * doc.cs : use TypeManager.FindMembers() instead of (possible)
4088           TypeBuilder.FindMembers() and filter overriden base members out.
4089           Fixed bug #76990.
4090
4091 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
4092
4093         * doc.cs : ref/out parameters are represented as '@' (instead of
4094           '&' in type FullName). Fixed bug #76630 (additionally crefs).
4095
4096 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
4097
4098         * doc.cs : when there was no '.' in cref to methods in doc comment,
4099           then parameters were missing in the output. Fixed bug #76691.
4100
4101 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
4102
4103         * driver.cs : don't output docs when there is an error.
4104           Fixed bug #76693.
4105
4106 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
4107
4108         * doc.cs :
4109           Now it should detect indexers. Fixed primary concern in bug #76685.
4110           Fixed CS0419 message to not show the identical member signature in
4111           the message.
4112
4113 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
4114
4115         * doc.cs : (FindDocumentedMember) use TypeManager.MemberLookup()
4116           instead of Type.FindMembers() since it does not handle events.
4117           Fixed bug #71604.
4118
4119 2005-11-12  Gert Driesen  <drieseng@users.sourceforge.net>
4120
4121         * codegen.cs: Fixed typo (speficied -> specified).
4122
4123 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
4124
4125         Fix #76369.
4126         * doc.cs (FindDocumentedTypeNonArray): Don't resolve again.
4127
4128 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
4129
4130         * attribute.cs: Changed error message.
4131
4132         * cs-tokenizer.cs: One more check.
4133
4134 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
4135
4136         * statement.cs (Block.Resolve): Ignore empty statement.
4137
4138 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
4139
4140         * report.cs: Made error/warning methods more strict to avoid
4141         their misuse.
4142
4143         * anonymous.cs, attribute.cs, class.cs, codegen.cs, constant.cs,
4144         convert.cs, cs-parser.jay, cs-tokenizer.cs, decl.cs, delegate.cs,
4145         doc.cs, driver.cs, ecore.cs, expression.cs, location.cs,
4146         namespace.cs, parameter.cs, statement.cs, typemanager.cs: Updated.
4147
4148 2005-11-08  Marek Safar  <marek.safar@seznam.cz>
4149
4150         * attribute.cs (Attribute.GetCoClassAttributeValue): New method.
4151         (AttributeTester.GetCoClassAttribute): Get CoClassAttribute.
4152
4153         * class.cs (TypeContainer.IsComImport): New property.
4154         (Constructor.Define): Create proper ctor for ComImport types.
4155
4156         * expression.cs (New.CheckComImport): Fixed.
4157
4158 2005-11-07  Miguel de Icaza  <miguel@novell.com>
4159
4160         * anonymous.cs (CaptureContext.AddParameterToContext): The fact
4161         that a parameter has been captured does not mean that we do not
4162         have to do the rest of the processing.  This fixes the second part
4163         of #76592.  If there was another anonymous method capturing
4164         values in the past, the Scope would never be set for the second
4165         method that captured the same parameter.
4166
4167         (CaptureContext.EmitAssignParameter): When `leave_copy' is passed,
4168         properly manipulate the stack.   Second part of fix for #76592.
4169
4170         * expression.cs (New): Add support for invoking "new" on
4171         interfaces that have been flagged with the ComImport attribute and
4172         the CoClass.  Fixes #76637 
4173
4174         * statement.cs (Try.DoEmit): When a variable is captured, do not
4175         try to emit the vi.LocalBuilder variable as it has been captured.
4176         Create a temporary variable and store the results on the
4177         FieldBuilder.  Fixes #76642
4178
4179 2005-11-07  Marek Safar  <marek.safar@seznam.cz>
4180
4181         * class.cs (CheckPairedOperators): Made compilable with csc 2.0.
4182
4183         * ecore.cs (InstanceResolve): Fixed CS1540 detection.
4184
4185         * expression.cs (Binary.DoResolve): Added && optimalization.
4186     
4187         * typemanager.cs (AddUserType): Removed useless argument.
4188
4189 2005-11-04  Marek Safar  <marek.safar@seznam.cz>
4190
4191         * statement.cs (Block.variables): Uses ListDictionary.
4192
4193 2005-11-03  Marek Safar  <marek.safar@seznam.cz>
4194
4195         Fix #75969.
4196         * class.cs (PartialContainer.EmitType): Customized to emit
4197         security attributes.
4198         (ClassPart.ApplyAttributeBuilder): Transform security attribute
4199         for partial classes.
4200
4201 2005-11-03  Marek Safar  <marek.safar@seznam.cz>
4202
4203         Fix #76599.
4204         * expression.cs (ElementAccess.DoResolveLValue): Fixed buffer
4205         access has to be fixed.
4206         
4207         * typemanager.cs (IsUnmanagedType): Wrong common field type.
4208
4209 2005-11-01  Marek Safar  <marek.safar@seznam.cz>
4210
4211         Fix #76590.
4212         * ecore.cs (NullCast.Reduce): Implemented.
4213
4214         * expression.cs (ArrayCreation.CheckIndices): Correcly check
4215         constant type.
4216         
4217         * statement.cs (SwitchLabel.ResolveAndReduce): Catch null
4218         properly.
4219         (Foreach.Resolve): Catch null properly.
4220
4221 2005-10-29  Marek Safar  <marek.safar@seznam.cz>
4222  
4223         * cs-tokenizer.cs: Warning text fix.
4224
4225         * driver.cs: AllWarningNumbers exposed on public interface.
4226
4227         * report.cs (): Reviewed warning numbers.
4228         (IsValidWarning): Use binary search.
4229
4230 2005-10-29  Marek Safar  <marek.safar@seznam.cz>
4231  
4232         * driver.cs: Implemeted resource visibility.
4233         (Resources): New class for code sharing between /res: and
4234         /linkres:
4235  
4236 2005-10-28  Marek Safar  <marek.safar@seznam.cz>
4237
4238         Fix #76568.
4239         * cfold.cs (ConstantFold.BinaryFold): Implemented null cast
4240         folding.
4241         
4242         * convert (Convert.ImplicitReferenceConversion): NullCast holds
4243         contants only.
4244         
4245         * ecore.cs (NullCast): Child is contant only.
4246         
4247         * literal.cs (NullLiteral.Reduce): null can be converted to any
4248         reference type.
4249
4250 2005-10-28  Kornél Pál  <kornelpal@hotmail.com>
4251
4252         * driver.cs: Use Encoding.Default as default code page instead
4253           of ISO-28591.
4254
4255 2005-10-27  Raja R Harinath  <rharinath@novell.com>
4256
4257         Fix #76085.
4258         * expression.cs (Invocation.Error_InvalidArguments): Handle
4259         __arglist parameters.
4260         (Invocation.VerifyArgumentsCompat): Likewise.
4261         * support.cs (ReflectionParameters.GetSignatureForError): Print
4262         __arglist parameters.
4263         (InternalParamters.GetSignatureForError): Likewise.
4264         * parameter.cs (Parameters.GetSignatureForError): Likewise.
4265
4266 2005-10-26  Marek Safar  <marek.safar@seznam.cz>
4267
4268         * attribute.cs (GetPropertyValue): Made public.
4269
4270         * codegen.cs (AssemblyClass): ResolveClsCompliance renamed to
4271         Resolve.
4272         Add new property WrapNonExceptionThrows to handle 2.0 assembly
4273         attribute.
4274         (AssemblyClass.Emit): Emit RuntimeCompatibilityAttribute when it
4275         is not defined.
4276         
4277         * driver.cs: Reflect method name change.
4278         
4279         * statement.cs (Try.Resolve): Warn when try has both general
4280         exception handlers.
4281         
4282         * typemanager.cs: runtime_compatibility_attr_type new predefined
4283         type.
4284
4285 2005-10-26  Raja R Harinath  <harinath@gmail.com>
4286
4287         Fix #76419.
4288         * pending.cs (InterfaceMethod): Allow tm.args [i] to be null --
4289         treat it as an empty parameter list.
4290
4291 2005-10-26  Raja R Harinath  <rharinath@novell.com>
4292
4293         Fix #76271.     
4294         * ecore.cs (SimpleName.DoSimpleNameResolve): Make fall-back 
4295         ResolveAsTypeStep silent.
4296         * statement.cs (Block.AddConstant): Mark block as used.
4297         (Block.ResolveMeta): Avoid piling on error messages
4298         if a constant initializer resolution fails.
4299
4300 2005-10-25  Raja R Harinath  <rharinath@novell.com>
4301
4302         * namespace.cs (RootNamespace.VerifyUsingForAll, Namespace.VerifyUsing):
4303         Remove.
4304         (NamespaceEntry.VerifyAllUsing): New.
4305         (NamespaceEntry.AliasEntry.Resolve): New.  Handles common error
4306         behaviour.  Delegates actual resolution of alias to ...
4307         (NamespaceEntry.DoResolve): ... this.  Renamed from Resolve.
4308         (NamespaceEntry.LocalAliasEntry, NamespaceEntry.ExternAliasEntry):
4309         Update.
4310         * driver.cs (Driver.MainDriver): Update.
4311         
4312         * namespace.cs (NamespaceEntry.DefineNamespace): Remove.
4313         (NamespaceEntry.SymbolFileID): Make into a on-demand computed
4314         property.
4315         (Namespace.DefineNamespaces, RootNamespace.DefineNamespacesForAll):
4316         Remove.
4317         * symbolwriter.cs (SymbolWriter.Initialize): Don't call
4318         RootNamespace.DefineNamespacesForAll.
4319
4320 2005-10-24  Raja R Harinath  <harinath@gmail.com>
4321
4322         * typemanager.cs (assemblies, external_aliases, modules)
4323         (AddAssembly, AddExternAlias, AddModule GetAssemblies, Modules)
4324         (ComputeNamespaces, GetRootNamespace): Remove extra staging
4325         overhead.  Move resposibility ...
4326         * namespace.cs (GlobalRootNamespace): ... here.  Update to changes.
4327         * driver.cs, attribute.cs, codegen.cs: Update to changes.
4328
4329 2005-10-23  Raja R Harinath  <harinath@gmail.com>
4330
4331         * namespace.cs (RootNamespace.all_namespaces): Renamed from
4332         cached_namespaces.  Improve usage.
4333         (RootNamespace.Reset, RootNamespace.RegisterNamespace)
4334         (RootNamespace.VerifyUsingForAll, RootNamespace.DefineNamespacesForAll):
4335         Move from GlobalRootNamespace and simplify.
4336         (RootNamespace.Global): Make instance variable.
4337         (RootNamespace.RootNamespace): Add "alias name" parameter.
4338         (GlobalRootNamespace): Simplify drastically.
4339         (Namespace.Lookup): Don't use GetNamespace.
4340         * typemanager.cs (GetRootNamespace): Rename from
4341         ComputeNamespaceForAlias.
4342         (NamespaceClash): Use Global.IsNamespace instead of GetNamespace.
4343
4344 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
4345
4346         * anonymous.cs (AnonymousContainer): Don't crash when container
4347         doesn't exist.
4348
4349 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
4350
4351         * expression.cs (Binary.DoResolve): Warn when comparing same
4352         values.
4353
4354 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
4355
4356         Fix #76486.
4357         * expression.cs (Binary.DoResolve): It looks like there are no
4358         convetsion rules in enum context.
4359
4360 2005-10-19  Carlos Alberto Cortez <calberto.cortez@gmail.com>
4361
4362         Add support for extern alias qualifiers.
4363         * typemanager.cs: Move some LookupTypeReflection code
4364         to namespace.cs, to have cleaner code. Added some methods
4365         to help us keep track of the extern aliased references.
4366         * driver.cs: Add suport for extern alias assemblies on command
4367         line and check for their warnings/errors. Also keep track of the
4368         extern aliased assemblies.
4369         * namespace.cs: Move the global functionality of Namespace
4370         to GlobalRootNamespace/RootNamespace. Now the global namespace
4371         is GlobalRootNamespace.Globa. Also the code moved from 
4372         typemanager.cs lives in GlobalRootNames.cs/RootNamespace.cs. 
4373         Finally added LocalAliasEntry (AliasEntry before) and
4374         ExternAliasEntry, to handle alias statements.
4375         * cs-parser.jay: Add support in the grammar for extern alias
4376         statement.
4377         * doc.cs, delegate.cs, expression.cs ecore.cs, symbolwriter.cs: 
4378         Update callings to Namespace (now in GlobalRootNamespace).
4379
4380 2005-10-18  Raja R Harinath  <rharinath@novell.com>
4381
4382         Fix #76371.
4383         * class.cs (TypeContainer.DefineType): Move updating of
4384         topological sort earlier in the code.
4385         * decl.cs (DeclSpace.ResolveBaseTypeExpr): Don't use TypeBuilder.
4386
4387 2005-10-18  Marek Safar  <marek.safar@seznam.cz>
4388
4389         Fix #76273.
4390         * cfold.cs (BinaryFold): Reduce constant in enum conversion.
4391         
4392         * constant.cs (Constant.TryReduce): Moved from Cast class.
4393         (Reduce): Made little bit more OO and fixed missing conversions.
4394         
4395         * ecore.cs (Reduce): Implemented.
4396         (Binary.EnumLiftUp): New method to upgrade values to enum values.
4397         
4398         * literal.cs (Reduce): Implemented.
4399         
4400         * class.cs: Reverted Miguel's wrong commit.
4401
4402 2005-10-14  Miguel de Icaza  <miguel@novell.com>
4403
4404         * ecore.cs (GetMemberType): Report the correct mapping for the MemberCore
4405
4406 2005-10-14  Atsushi Enomoto  <atsushi@ximian.com>
4407
4408         * cs-parser.jay, expression.cs : CS0214 was missing error location
4409           for constants. Fixed bug #76404.
4410
4411 2005-10-11  Marek Safar  <marek.safar@seznam.cz>
4412
4413         Fix #76370.
4414         * convert.cs (ExplicitConversionCore): Fixed object->enum
4415         conversion.
4416
4417 2005-10-10  Raja R Harinath  <rharinath@novell.com>
4418
4419         * ecore.cs (PropertyExpr.Emit): Use Invocation.EmitCall to emit
4420         InstanceExpression.
4421         (PropertyExpr.EmitCall): Likewise.
4422         * expression.cs (Invocation.EmitArguments): Handle case where
4423         arguments == null.
4424         (Invocation.EmitCall): Avoid allocating temporary variable if
4425         there are no arguments.
4426
4427 2005-10-07  Raja R Harinath  <rharinath@novell.com>
4428
4429         Fix #76323.
4430         * convert.cs (ImplicitConversionStandard): Move conversion of
4431         void* to arbitrary pointer types ...
4432         (ExplicitConversionStandard): .. here.
4433         * ecore.cs (Expression.Error_ValueCannotBeConverted): Fix CS0266
4434         error to always print typenames.
4435
4436 2005-10-07  Raja R Harinath  <rharinath@novell.com>
4437
4438         * convert.cs (GetConversionOperator): Rename from
4439         GetConversionOperators.  Move operator selection code from ...
4440         (UserDefinedConversion): ... here.
4441
4442 2005-10-06  Marek Safar  <marek.safar@seznam.cz>
4443
4444         * convert.cs (ExplicitConversionCore): Removed duplicate enum
4445         conversion.
4446
4447 2005-10-05  Marek Safar  <marek.safar@seznam.cz>
4448
4449         * assign.cs (Assign.DoResolve): Error method changed.
4450
4451         * cfold.cs (DoConstantNumericPromotions): Error method changed.
4452         
4453         * const.cs (ResolveValue): Reset in_transit immediately.
4454         
4455         * constant.cs: Error method changed.
4456         
4457         * convert.cs: Removed useless location parameter.
4458         (ExplicitNumericConversion): Don't do double enum check.
4459         (ExplicitConversionCore): Renamed from ExplicitConversion.
4460         (ExplicitUnsafe): Extracted from ExplicitConversion.
4461         (ExplicitConversion): Uses for error reporting.
4462         
4463         * ecore.cs (Error_ValueCannotBeConverted): More logic for more
4464         error messages.
4465         (ResolveBoolean): Uses common error method.
4466         (CastToDecimal): Get rid of ec.
4467         (CastFromDecimal): Optimized.
4468         (ConvCast): Get rid of ec.
4469         
4470         * enum.cs (ResolveValue): Reset in_transit immediately.
4471         (Emit): Return after first error.
4472         
4473         * expression.cs: Convert changes.
4474         
4475         * literal.cs: Error method changed.
4476         
4477         * statement.cs: Error method changed.
4478
4479 2005-10-03  Raja R Harinath  <rharinath@novell.com>
4480
4481         * support.cs (SeekableStreamReader.Position): Don't error out when
4482         the requested position is just beyond the end of the current
4483         buffered data.
4484
4485 2005-09-28  Raja R Harinath  <rharinath@novell.com>
4486
4487         * support.cs (SeekableStreamReader): Simplify drastically.  Don't
4488         try to keep in sync with the byte count of the underlying Stream.
4489         However, this limits us to a window size of 2048 characters: i.e.,
4490         the maximum lookahead of our lexer/parser can be 2048 characters.
4491
4492 2005-09-28  Marek Safar  <marek.safar@seznam.cz>
4493
4494         Fix #76255.
4495         * driver.cs: Fix compilation files with full root path.
4496
4497 2005-09-25  Miguel de Icaza  <miguel@novell.com>
4498
4499         * report.cs (SymbolRelatedToPreviousError): Format the output so
4500         it does not use an open parenthesis that is never closed. 
4501
4502         * driver.cs: Follow coding guidelines
4503
4504 2005-09-27  Marek Safar  <marek.safar@seznam.cz>
4505
4506         Fix #72930.
4507         * const.cs (Const.ResolveValue): Check for assigning non-null
4508         value to reference type.
4509
4510 2005-09-27  Marek Safar  <marek.safar@seznam.cz>
4511
4512         * anonymous.cs: Implemented ExprClassName.
4513         
4514         * assign.cs (Assign.DoResolve): Don't chrash when type is not
4515         delegate.
4516         
4517         * attribute.cs (ResolveArguments): Enabled MethodImplOptions
4518         check.
4519         
4520         * class.cs (StaticClass.DefineContainerMembers): Report protected
4521         members as error.
4522         
4523         * codegen.cs: if(ed) PRODUCTION.
4524         
4525         * convert.cs (Error_CannotImplicitConversion): Better error
4526         distinction.
4527         
4528         * cs-parser.jay: More error checks.
4529         
4530         * cs-tokenizer.cs (consume_identifier): Fixed Miguel's revert.
4531         
4532         * driver.cs (CSCParseOption): Enabled wrong option check.
4533         
4534         * ecore.cs (Expression.ExprClassName): Turned to property.
4535         (MemberExpr.CheckIntermediateModification): For checking boxed
4536         value types     modification.
4537         
4538         * statement.cs (Fixed.Resolve): Expression type must be
4539         convertible to fixed type.
4540         (CollectionForeach.GetEnumeratorFilter,TryType):
4541         Small refactoring for easier error checking.
4542
4543 2005-09-26  Marek Safar  <marek.safar@seznam.cz>
4544
4545         * attribute.cs (Attribute.Resolve): Check Obsolete attribute for
4546         attributes.
4547         
4548         * class.cs (GeneratedBaseInitializer): New class for customization
4549         compiler generated initializers.
4550         (MemberBase.DoDefine): Check Obsolete attribute here.
4551         (FieldMember.DoDefine): Ditto.
4552         
4553         * const.cs (ExternalConstant.CreateDecimal): Builder for decimal
4554         constants.
4555         
4556         * decl.cs (MemberCore.EmitContext): Returns valid current ec.
4557         (MemberCore.GetObsoleteAttribute): Removed argument.
4558         (MemberCore.CheckObsoleteness): Obsolete attributes are hierarchic.
4559         (MemberCore.CheckObsoleteType): New helper.
4560         
4561         * delegate.cs,
4562         * enum.cs,
4563         * statement.cs: Updates after MemberCore changes.
4564         
4565         * ecore.cs (TypeExpr.ResolveType): Check type obsoleteness here.
4566         (FieldExpr.ResolveMemberAccess): Fixed decimal constants checks.
4567         
4568         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't check
4569         obsolete attribute for compiler construct.
4570         (As.DoResolve): Cache result.
4571         
4572         * iterators.cs (Define_Constructor): Use GeneratedBaseInitializer.
4573
4574 2005-09-26  Raja R Harinath  <rharinath@novell.com>
4575
4576         Fix #76133.
4577         * expression.cs (This.VerifyFixed): In a value type T, the type of
4578         'this' is T&, iow, 'this' is either an out or ref parameter.  In a
4579         value type R, 'this' is treated as a value parameter.
4580
4581 2005-09-22  Miguel de Icaza  <miguel@novell.com>
4582
4583         * statement.cs (Lock): Use the TemporaryVariable class instead of
4584         manually using local variables as those do not work when variables
4585         are captured.
4586
4587         * ecore.cs: Moved the TemporaryVariable class from being a nested
4588         class inside Foreach to be a public class that can be employed in
4589         other places. 
4590
4591 2005-09-19  Marek Safar  <marek.safar@seznam.cz>
4592
4593         * cs-parser.jay: interface_accessors replaced by
4594         accessor_declarations.
4595
4596         * ecore.cs, literal.cs, statement.cs: NullLiteral holds null
4597         location.
4598         
4599         * statement.cs (GotoCase.Resolve): Convert null constant to
4600         null case.
4601         (SwitchLabel.ResolveAndReduce): Ditto.
4602         (SwitchLabel.NullStringCase): Custom null stamp.
4603         (Switch.SimpleSwitchEmit): Fix from NullLiteral to NullStringCase.
4604         
4605         typemanager.cs (CSharpSignature): Don't skip first argument
4606         for full names.
4607
4608 2005-09-18  Miguel de Icaza  <miguel@novell.com>
4609
4610         * driver.cs: Set InEmacs based on the environment variable EMACS. 
4611
4612         * location.cs (InEmacs): in this mode, do not report column
4613         location as it confuses Emacs.
4614
4615 2005-09-16  Marek Safar  <marek.safar@seznam.cz>
4616
4617         * cfold.cs, constant.cs, convert.cs, ecore.cs,
4618         expression.cs, iterators.cs, literal.cs: Store constants and
4619         literals location.
4620         
4621         * class.cs (MemberBase.ShortName): Pass location.
4622         
4623         * cs-parser.jay: Some location fixes.
4624         
4625         * ecore.cs (Expression.Location): Made virtual.
4626
4627 2005-09-05  Miguel de Icaza  <miguel@novell.com>
4628
4629         * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
4630         if the underlying types are the same, otherwise we need to produce
4631         code that will do the proper cast.
4632
4633         This was exposed by Marek's constant rewrite which produced
4634         invalid code for the call site:
4635
4636         enum X : long { a }
4637         void Method (X v) {}
4638
4639         Method ((X) 5)
4640
4641         This fixes test-49.cs
4642
4643 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
4644
4645         * attribute.cs : (Attribute.IsValidArgumentType): array of string/
4646           Type/Object should be allowed as well. Fixed bug #75968.
4647
4648 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
4649
4650         * expression.cs : (Binary.DoResolve): when one is enum constant and
4651           another is constant 0, then return enum one *as enum type*.
4652           Fixed bug 74846.
4653
4654 2005-09-02  Raja R Harinath  <rharinath@novell.com>
4655
4656         * attribute.cs (GetMarshal): Work even if "DefineCustom" is
4657         internal.
4658
4659         Fix #75941.
4660         * ecore.cs (SimpleNameResolve.DoSimpleNameResolve): Disable
4661         flow-branching for LocalVariableReferences in case we were invoked
4662         from a MemberAccess.
4663         * expression.cs (LocalVariableReference.VerifyAssigned): New.
4664         Carved out of ...
4665         (LocalVariableReference.DoResolveBase): ... this.
4666         (MemberAccess.Resolve): Do the check that was disabled during
4667         SimpleNameResolve.
4668
4669 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
4670
4671         * class.cs :
4672           (PartialContainer.Create): check abstract/sealed/static strictly
4673           but abstract/sealed can exist only at one side. Fixed bug #75883.
4674
4675 2005-09-01  Kornél Pál  <kornelpal@hotmail.com>
4676
4677         Fix #75945.
4678         * attribute.cs (Attribute.GetMarshal): If ArraySubType is not
4679         specified, don't default to UnmanagedType.I4.
4680
4681 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
4682
4683         * expression.cs : conditional operator should check possibly
4684           incorrect assign expression. Fixed bug #75946.
4685
4686 2005-08-31  Atsushi Enomoto  <atsushi@ximian.com>
4687
4688         * cs-tokenizer.cs, cs-parser.jay, driver.cs, support.cs :
4689           Reverting the change. gmcs is much complex than mcs on this matter.
4690
4691 2005-08-31  Atsushi Enomoto  <atsushi@ximian.com>
4692
4693         * cs-tokenizer.cs : To read another token ahead of the actual 
4694           consumption, use new SavedToken and cache token instead of moving
4695           back the stream with SeekableStreamReader (it seemed problematic).
4696         * cs-parser.jay,
4697           driver.cs : Thus use StreamReader directly.
4698         * support.cs : Thus removed SeekableStreamReader.
4699
4700 2005-08-30  Raja R Harinath  <rharinath@novell.com>
4701
4702         Fix #75934.
4703         * anonymous.cs (ScopeInfo.MakeFieldName): New helper.
4704         (ScopeInfo.EmitScopeType): Use it to construct field names from
4705         names of captured locals.
4706
4707         Fix #75929.
4708         * ecore.cs (BoxedCast.BoxedCast) [1-argument variant]: Remove.
4709         * convert.cs (ImplicitReferenceConversion, TryImplicitIntConversion):
4710         Pass 'target_type' to BoxedCast.  Don't default to 'object'.
4711         (ExplicitConversion): Remove enum cases already handled by
4712         implicit conversion.  Move implicit conversion check to the beginning.
4713         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Update.
4714         * expression.cs (ArrayCreation.EmitDynamicInitializers):
4715         Don't treat System.Enum as a struct.
4716
4717 2005-08-30  Jb Evain  <jbevain@gmail.com>
4718
4719         * attribute.cs: handles as expression in parameters.
4720
4721 2005-08-30  Raja R Harinath  <rharinath@novell.com>
4722
4723         Fix #75802.
4724         * class.cs (TypeContainer.VerifyClsName): Don't use a
4725         PartialContainer when verifying CLS compliance.
4726         (AbstractPropertyEventMethod): Set Parent here, ...
4727         (PropertyMethod): ... not here.
4728
4729 2005-08-30  Atsushi Enomoto  <atsushi@ximian.com>
4730
4731         * attribute.cs : escaped attribute name should not be allowed to be
4732           resolved (e.g. @class as classAttribute). Fixed bug #75930.
4733
4734 2005-08-29  Raja R Harinath  <rharinath@novell.com>
4735
4736         Fix #75927.
4737         * convert.cs (ImplicitStandardConversionExists): Allow zero also
4738         when converting a long constant to unsigned long.
4739         * expression.cs (Invocation.OverloadResolve): Add sanity check to
4740         detect where IsApplicable and VerifyArgumentsCompat disagree.
4741
4742 2005-08-29  Raja R Harinath  <rharinath@novell.com>
4743         and Carlos Alberto Cortez  <carlos@unixmexico.org>
4744
4745         Fix #75848.
4746         * class.cs (TypeContainer.CanElideInitializer): New helper.
4747         (TypeContainer.EmitFieldInitializers): Use it to determine if we
4748         can safely emitting the initializer of a field.
4749
4750 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
4751
4752         * statement.cs : (Continue.Resolve()) Unlike break, continue is not
4753           allowed inside a switch (without loop). Fixed bug #75433.
4754
4755 2005-08-26  Kornél Pál  <kornelpal@hotmail.com>
4756
4757         * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
4758         * mcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
4759
4760 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
4761
4762         * driver.cs : kinda reverting the default encoding changes (not exact 
4763           revert since I noticed that "codepage:reset" might not work fine).
4764
4765 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
4766
4767         * class.cs : (AbstractPropertyEventMethod) SetupName() now takes
4768           Location. Now getter and setter store location correctly.
4769           (errors/cs0111-12.cs now reports the expected location.)
4770
4771 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
4772
4773         * driver.cs : Use default encoding on the environment.
4774           Removed (now that) extra parameter for SeekableStreamReader.
4775         * support.cs : (SeekableStreamReader) third .ctor() argument for
4776           StreamReader is not required (always true). preamble size could
4777           be acquired in simpler and safe way.
4778
4779 2005-08-24  Atsushi Enomoto  <atsushi@ximian.com>
4780
4781         * cs-parser.jay: report CS0642 at warning level 3
4782           and report CS0642 for an if else statement also
4783           fixes bug #74745. Patch by John Luke (and a bit
4784           modified by me).
4785           Removed extra CS0642 warning check for "while",
4786           "for" and "fixed".
4787         * statement.cs: In Block.Resolve(), CS0642 check
4788           is reimplemented to check a sequence of an empty
4789           statement and a block.
4790
4791           Both fix bug #66777.
4792
4793 2005-08-24  Marek Safar  <marek.safar@seznam.cz>
4794
4795         * attribute.cs (GetMethodObsoleteAttribute): Disabled obsolete properties
4796         detection until I fix it.
4797         
4798         * cs-tokenizer.cs: Changed error message.
4799         
4800         * cs-parser.jay: Fixed 2 error locations.
4801         
4802         * ecore.cs (Error_TypeDoesNotContainDefinition): Share error message.
4803         (PropertyExpr.Error_PropertyNotFound): First attempt to detect non C#
4804         properties.
4805         
4806         * enum.cs (GetSignatureForError): Fixed.
4807         
4808         * expression.cs (Invocation.IsSpecialMethodInvocation): Improved special
4809         method detection.
4810         
4811         * class.cs,
4812         * typemanager.cs (RegisterProperty): Removed.
4813         
4814         * statement.cs (CheckInvariantMeaningInBlock): Changed error message.
4815
4816 2005-08-24  Raja R Harinath  <rharinath@novell.com>
4817
4818         Fix #75874.
4819         * expression.cs (ArrayAccess.EmitLoadOpcode): Emit ldelem.i for pointers.
4820         (ArrayAccess.GetStoreOpcode): Return stelem.i for pointers.
4821
4822 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
4823
4824         * expression.cs : tiny fix is required for not warning positive ulong.
4825           See test-441.cs.
4826
4827 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
4828
4829         * expression.cs : add CS0652 check for constant and integral
4830           expression. Fixed bug #53974.
4831
4832 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
4833
4834         * expression.cs : in DoNumericPromotions(), check if there is implicit
4835           conversion overload for string (to check CS0034). Fixed bug #52492.
4836
4837 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
4838
4839         * cs-tokenizer.cs : Check newline in char constant. Fixed bug #75245.
4840
4841 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
4842
4843         * ecore.cs : report location when it is *not* Null.
4844
4845 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
4846
4847         * codegen.cs,
4848           ecore.cs,
4849           flowanalysis.cs,
4850           expression.cs:
4851           Added OmitStructFlowAnalysis to EmitContext to handle CS0165 check
4852           correctly. Fixed bug #75721.
4853
4854 2005-08-23  Raja R Harinath  <rharinath@novell.com>
4855
4856         * support.cs (SeekableStreamReader.Position): Avoid an expensive
4857         loop that performs 'min (pos, char_count)'.
4858
4859         Fix #75862.
4860         * expression.cs (Unary.ResolveOperator): Don't discard implicit
4861         converted value in Operator.OnesComplement.
4862
4863 2005-08-22  Ben Maurer  <bmaurer@ximian.com>
4864
4865         * anonymous.cs: If the anon method is pulled into a helper class,
4866         it needs to be `internal' not `private'. Fixes runtime behavior on
4867         msft. bug #75704
4868
4869 2005-08-20  Martin Baulig  <martin@ximian.com>
4870
4871         * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
4872         scope if we don't already have it.
4873
4874         * expression.cs (Invocation.EmitCall): Use `ec.EmitThis ()' rather
4875         than `ig.Emit (OpCodes.Ldarg_0)' to make it work inside iterators;
4876         fixes #75867.
4877
4878 2005-08-17  Marek Safar  <marek.safar@seznam.cz>
4879
4880         Fix #75803
4881         * decl.cs (DeclSpace.VerifyClsCompliance): Skip when collision object
4882         is a partial class.
4883
4884 2005-08-16  Marek Safar  <marek.safar@seznam.cz>
4885
4886         The big constants rewrite
4887         Fix #75746, #75685 and more
4888         As a side effect saved 1MB for MWF ;-)
4889         
4890         * attribute.cs (GetAttributeArgumentExpression): Use ToType, GetTypedValue.
4891         (GetMarshal, GetMethodImplOptions, GetLayoutKindValue): Values are not
4892         enum based for corlib compilation.
4893         
4894         * cfold.cs (BinaryFold): Convert operand for enum additions. Fixed enum
4895         subtractions.
4896         
4897         * class.cs (FixedField.Define): Use ResolveAsConstant.
4898         
4899         * const.cs (IConstant): Interface constants and enums.
4900         (Const.ResolveValue): New method for constant resolvning.
4901         (ExternalConstant): Constants from imported assemblies.
4902         
4903         * constant.cs (Constant.GetTypedValue): Used to get constant with forced
4904         conversion; like enums.
4905         (Constant.ToType): Converts this constant to different type.
4906         (Constant.Increment): Adds 1.
4907         
4908         * convert.cs (ImplicitConversionRequired): Simplified.
4909         
4910         * cs-parser.jay: Create EnumMember directly.
4911         
4912         * decl.cs (MemberCore.CheckObsoleteness): Checks for ObsoleteAttribute presence.
4913         
4914         * doc.cs (GenerateEnumDocComment): Removed.
4915         
4916         * ecore.cs (Expression.ResolveAsConstant): New constant specific method.
4917         (ConvertIntLiteral): Removed.
4918         (FieldExpr.ResolveMemberAccess): Refactored to remove constant specific if(s).
4919         
4920         * enum.cs (EnumMember): Implement IConstant.
4921         (Enum.IsValidEnumConstant): Removed.
4922         (Enum.GetNextDefaultValue): Removed.
4923         (Enum.FindMembers): Updated.
4924         (Enum.GenerateDocComment): Iterate enum members.
4925         
4926         * expression.cs (Cast.TryReduce): Handle enums correctly.
4927         (New.Constantify): Made public.
4928         (MemberAccess.DoResolve): Removed contant specific if(s).
4929         
4930         * literal.cs (NullLiteral): Implement new abstract methods.
4931         
4932         * statement.cs (GotoCase.Resolve): Use new constant methods.
4933         (SwitchLabel.ResolveAndReduce): Use new constant methods.
4934         
4935         * typemanager.cs (LookupEnum): Removed.
4936         (IsEnumType): Fixed to work with corlib.
4937         (RegisterConstant): Removed.
4938         (LookupConstant): Removed.
4939         (GetConstant): Changed to work with IConstant.
4940
4941 2005-08-04  Atsushi Enomoto  <atsushi@ximian.com>
4942
4943         * location.cs : Fixed overflown (>255) column number.
4944
4945 2005-08-03  Raja R Harinath  <rharinath@novell.com>
4946
4947         First cut of the qualified-alias-member feature.
4948         * cs-tokenizer.cs (Tokenizer.is_punct): Recognize the double-colon
4949         token.
4950         * cs-parser.jay (DOUBLE_COLON): New token.
4951         (namespace_or_type_name): Add rule for recognizing
4952         qualified-alias-members.
4953         (primary_expression): Likewise.
4954         (element_access): Allow QualifiedAliasMember as a possible
4955         type-bearing expression.
4956         (local_variable_type, local_variable_pointer_type): Likewise.
4957         * namespace.cs (NamespaceEntry.LookupAlias): New.  Looks up
4958         aliases in the current and enclosing namespace declarations.
4959         (NamespaceEntry.UsingAlias): Add CS0440 warning.
4960         * decl.cs (MemberName.is_double_colon): New.
4961         (MemberName.MemberName): Add new constructor for alias-member.
4962         (MemberName.GetTypeExpression): Generate QualifiedAliasMember too.
4963         * expression.cs (QualifiedAliasMember): New expression type.
4964
4965 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
4966
4967         * location.cs : it borked when no argument was specified.
4968
4969 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
4970
4971         * location.cs : tiny ToString() format fix.
4972
4973 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
4974
4975         * statement.cs : oops, it was missing.
4976
4977 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
4978
4979         A set of fixes for precise line/column location.
4980
4981         * location.cs :
4982           "token" field now holds a file/line "delta", a line number offset 
4983           from the segment, and a column number. See also:
4984           http://lists.ximian.com/pipermail/mono-devel-list/2004-
4985           December/009508.html
4986           Removed static IsNull. Use instance IsNull property instead.
4987         * cs-tokenizer.cs :
4988           For some tokens it stores Location. For Identifier it stores
4989           LocatedToken which is a pair of string name and location.
4990           Column numbers are adjusted only at getChar().
4991         * report.cs :
4992           Use Location.ToString() for reporting (it now contains column).
4993         * cs-parser.jay :
4994           Largely modified to use LocatedToken instead of
4995           string (IDENTIFIER), and to acquire Location from some tokens.
4996         * namespace.cs, decl.cs, ecore.cs, class.cs, delegate.cs,
4997           iterators.cs, const.cs, anonymous.cs, tree.cs, enum.cs,
4998           codegen.cs :
4999           Now MemberName holds Location. DeclSpace.ctor() receives Location
5000           as a parameter. Removed extra parameters to all derived classes.
5001           Replaced Location.IsNull() with instance property.
5002         * assign.cs, expression.cs :
5003           Added .ctor() overload that omits Location.
5004         * attribute.cs :
5005           Added "nameEscaped" flag that indicates the identifier was escaped
5006           in the source file. This fixes bug #57047.
5007
5008 2005-08-02  Marek Safar  <marek.safar@seznam.cz>
5009
5010         * attribute.cs (AttributeTester.GetImportedIgnoreCaseClsType):
5011         New method, looking for lo-case imported cls type.
5012
5013         * decl.cs (DeclSpace.VerifyClsCompliance): Check CS3005 for types
5014         here.
5015
5016         * driver.cs: Removed VerifyTopLevelNameClsCompliance usage.
5017
5018         * enum (Enum.VerifyClsCompliance): Hardcode non-compliant types.
5019
5020         * typemanager.cs (TypeManager.AllClsTopLevelTypes): Renamed from
5021         all_imported_types.
5022         (TypeManager.LoadAllImportedTypes): Lo-case imported types.
5023
5024         Optimized to save 3.5 MB for SWF compilation.
5025
5026 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
5027
5028         * class.cs (AddToTypeContainer): Use inheritance insted of if(s).
5029         (PartialContainer.Create): Moved logic AddToContainer.
5030         (PartialContainer.MarkForDuplicationCheck): Shares name.
5031         
5032         * decl.cs (DeclSpace.AddToContainer): Check name collisions at one
5033         place.
5034         
5035         * namespace.cs (Namespace.AddDeclSpace): Lazy declspaces
5036         initialization.
5037         (Namespace.GetSignatureForError): New method.
5038         
5039         * tree.cs (Tree.RecordDecl): Moved to AddToContainer.
5040         (RootTypes.AddToTypeContainer): se inheritance insted of if(s).
5041
5042 2005-08-01  Raja R Harinath  <rharinath@novell.com>
5043
5044         Fix #75669.
5045         * ecore.cs (Expression.MemberLookupFailed): Use queried_type for
5046         member lookup rather than qualifier_type, since qualifier_type can
5047         be null.
5048
5049 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
5050
5051         * enum.cs (Enum.VerifyClsName): Fixed to allow not CLSCompliant
5052         enum member.
5053
5054 2005-07-31  Miguel de Icaza  <miguel@novell.com>
5055
5056         * statement.cs: Copy the local exception into the exception
5057         captured local.  Fixes 75674
5058
5059 2005-07-31  Raja R Harinath  <harinath@gmail.com>
5060
5061         Fix #75658.
5062         * expression.cs (Invocation.OverloadResolve): Don't report error
5063         CS1501 if error CS1502 has been reported.
5064         (New.DoResolve): Delegate CS1501 reporting to
5065         Invocation.OverloadResolve.
5066
5067         Fix #75656.
5068         * statement.cs (Block.CheckInvariantMeaningInBlock): Verify
5069         invariant-meaning-in-block property in an enclosing block if
5070         necessary.
5071
5072 2005-07-29  Marek Safar  <marek.safar@seznam.cz>
5073
5074         * statement.cs (SwitchLabel.ResolveAndReduce): Refactored.
5075         (SwitchLabel.Erorr_AlreadyOccurs): Share error message.
5076         (Switch.CheckSwitch): Just save 50kb for SWF.
5077
5078 2005-07-27  Martin Baulig  <martin@ximian.com>
5079
5080         * anonymous.cs (CaptureContext.AddField): Added
5081         `AnonymousContainer am' argument; compute its toplevel scope if
5082         it's not already computed.  Fixes #75649.
5083
5084 2005-07-26  Raja R Harinath  <rharinath@novell.com>
5085
5086         Fix #75628.
5087         * class.cs (Constructor.Emit): Reset block to null if the block
5088         resolve fails.
5089
5090 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
5091
5092         * class.cs (TypeContainer.VerifyMembers): Be compatible in warning 169.
5093
5094 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
5095
5096         * class.cs (MethodData.Define): Check whether accessor implementing
5097         interface is public.
5098
5099         * driver.cs (Driver.parse): Try to be smart and check for `MZ' header.
5100
5101 2005-07-22  Marek Safar  <marek.safar@seznam.cz>
5102
5103         Fix #57245
5104         * namespace.cs (LookupType): Moved same type check to...
5105         
5106         * typemanager.cs (LookupTypeReflection): Don't allow to import more types
5107         with the same name.
5108
5109 2005-07-21  Raja R Harinath  <rharinath@novell.com>
5110
5111         * namespace.cs (NamespaceLookupType): Avoid a string allocation when we
5112         already found a typebuilder.
5113         * class.cs (MethodCore.IsDuplicateImplementation): Compare
5114         MemberNames, not strings.
5115
5116         * const.cs (Error_ExpressionMustBeConst): 
5117         Rename from Error_EpressionMustBeConst.
5118         * const.cs, class.cs, statement.cd: Update.
5119
5120 2005-07-21  Marek Safar  <marek.safar@seznam.cz>
5121
5122         Fix #65573
5123
5124         * const.cs (Const.LookupConstantValue): Report missing contant expression
5125         everytime.
5126         (Error_EpressionMustBeConstant): Only one error method.
5127
5128         * class.cs, statement.c: Updated.
5129
5130 2005-07-20  Raja R Harinath  <rharinath@novell.com>
5131
5132         * statement.cs (Block.Flags): Add back HasVarargs.
5133         (Block.flags): Make protected.
5134         (ToplevelBlock.HasVarargs): Convert to a property that updates flags.
5135
5136         * typemanager.cs (types, typecontainers, user_types): Remove.
5137         (UserTypes, TypeContainers): Likewise.
5138         (HandleDuplicate, AddDelegateType, AddEnumType): Likewise.
5139         (CleanUp, Reset): Update.
5140         (AddUserType): Combine variants.  Now, only updates builder_to_declspace.
5141         (GetNestedType): Use Type.GetNestedType.
5142         (CoreLookupType): Take two arguments, the namespace and the
5143         basename of the type.  Update to use the Namespace.Lookup
5144         mechanism.
5145         (InitEnumUnderlyingTypes, InitCoreTypes): Update.
5146         (RealMemberLookup): Use IsNestedChildOf instead of playing with
5147         string concatenation and substring matches.
5148         * class.cs, enum.cs, delegate.cs: Update to changes.
5149
5150 2005-07-20  Marek Safar  <marek.safar@seznam.cz>
5151
5152         * constant.cs (Constant.Error_ConstantValueCannotBeConverted): Moved from
5153         Expression and made virtual.
5154
5155         * convert.cs (ImplicitReferenceConversionExists): Skip for value types.
5156         (ImplicitStandardConversionExists): Fixed `byte' typo ?
5157
5158         * ecore.cs (Expression.Error_ConstantValueCannotBeConverted): Moved.
5159
5160         * literal.cs (NullLiteral.Error_ConstantValueCannotBeConverted): Customize
5161         error message.
5162
5163         * convert.cs, ecore.cs, enum.cs: Reflect Error_ConstantValueCannotBeConverted
5164         change.
5165
5166 2005-07-18  Marek Safar  <marek.safar@seznam.cz>
5167
5168         Fix #57707
5169         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Check whether
5170         AssemblyCultureAttribute is not used on executable.
5171
5172         * rootcontext.cs,
5173         * typemanager.cs: Add System.Reflection.AssemblyCultureAttribute.
5174
5175 2005-07-16  Raja R Harinath  <rharinath@novell.com>
5176
5177         Fix #60638.
5178         * expression.cs (Binary.Warning_UnintendeReferenceComparison):
5179         New.  Reports CS0252/CS0253.
5180         Mostly taken from preliminary patch by Duncak Mak.
5181         (Binary.DoResolveOperator): Store results of operator lookup.
5182         Use them to detect if we need to warn about unintended reference
5183         comparisons.
5184
5185 2005-07-15  Raja R Harinath  <rharinath@novell.com>
5186
5187         Fix #72969.
5188         * namespace.cs (Namespace.Lookup): Add back location parameter.
5189         (Namespace.LookupType): Add CS0436 report.  Add location parameter.
5190         * delegate.cs, ecore.cs, expression.cs: Update to changes.
5191
5192         * codegen.cs (EmitContext.DeclSpace): Make readonly.
5193         * namespace.cs (Namespace.Lookup): Carve out type lookup into ...
5194         (Namespace.LookupType): ... this.
5195         (NamespaceEntry.GetUsingTable): Allocate only one zero-sized array
5196         of namespaces.
5197         * typemanager.cs (LookupTypeReflection): Remove buggy code that
5198         purported to handle pointers.
5199         (char_ptr_type, void_ptr_type): Use GetPointerType rather than
5200         CoreLookupType.
5201
5202 2005-07-15  Marek Safar  <marek.safar@seznam.cz>
5203
5204         * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
5205         type as namespace.
5206
5207 2005-07-15  Raja R Harinath  <rharinath@novell.com>
5208
5209         * namespace.cs (Namespace.Lookup): Drop location parameter.
5210         (NamespaceEntry.LookupAlias): Remove.  Merge into ...
5211         (NamespaceEntry.Lookup): ... this.
5212         (NamespaceEntry.Error_AmbiguousTypeReference):
5213         Move here from DeclSpace.
5214         (NamespaceEntry.LookupNamespaceOrType): Move support for dotted
5215         names ...
5216         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): ... here.
5217         * decl.cs (DeclSpace.ErrorAmbiguousTypeReference):
5218         Move to NamespaceEntry.
5219         * delegate.cs, expression.cs: Update to changes.
5220
5221 2005-07-14  Marek Safar  <marek.safar@seznam.cz>
5222
5223         * attribute.cs (Attribute.ResolveAttributeType): Renamed from
5224         CheckAttributeType and refactored.
5225         (Attribute.ResolvePossibleAttributeType): Changed to reuse
5226         ResolveAsTypeTerminal error handling.
5227         (ResolveAsTypeTerminal): Introduced because of global attributes extra
5228         handling.
5229         (GetSignatureForError): Print errors in same way.
5230
5231         * class.cs,
5232         * codegen.cs: Reflect attribute GetSignatureForError change.
5233
5234         * ecore.cs,
5235         * expression.cs: Add silent parameter to ResolveAsTypeStep.
5236
5237         * namespace.cs (UsingEntry): Refactored to make fields private.
5238
5239         * assign.cs,
5240         statement.cs: Error_UnexpectedKind has extra parameter.
5241
5242 2005-07-14  Raja R Harinath  <rharinath@novell.com>
5243
5244         * ecore.cs (IAlias): Remove.
5245         * decl.cs (DeclSpace): Don't derive from IAlias.  Remove members
5246         that implement the interface.
5247         * namespace.cs (Namespace): Likewise.
5248         (Namespace.declspaces): Renamed from 'defined_names'.
5249         (Namespace.AddDeclSpace): Renamed from 'DefineName'.  Take a
5250         DeclSpace instead of an IAlias.
5251         * tree.cs (Tree.AddDecl): Update.
5252
5253 2005-07-12  Raja R Harinath  <rharinath@novell.com>
5254
5255         * statement.cs (Block.Flags); Remove HasVarargs.
5256         (Block.HasVarargs): Move to ToplevelBlock.
5257         (Block.ThisVariable, Block.AddThisVariable): Likewise.
5258         (Block.Variables): Make protected.  Initialize variable hashtable
5259         if necessary.
5260         (Block.AddVariable): Update.
5261         (Block.Resolve): Update to changes.
5262         (ToplevelBlock.HasVarargs): New boolean.
5263         (ToplevelBlock.ThisVariable): Move here from Block.
5264         (ToplevelBlock.AddThisVariable): Likewise.
5265         (ToplevelBlock.IsThisAssigned): New.  Forwards call to this_variable.
5266         * expression.cs (This.ResolveBase): Update to changes.
5267         (ArglistAccess.DoResolve): Likewise.
5268
5269 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
5270
5271         Fix #75321
5272         * ecore.cs, class.cs: Use SetAssigned instead of direct access.
5273
5274         * class.cs (TypeContainer.VerifyMembers): Distinguish between
5275         not used and not used & assigned.
5276         (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
5277
5278 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
5279
5280         Fix #75053
5281         * expression.cs (Is.DoResolve): null is never provided type.
5282
5283 2005-07-08  Marek Safar  <marek.safar@seznam.cz>
5284
5285         Fix #52496
5286         * cs-parser.jay: Less strict event error rule to catch more errors.
5287
5288 2005-07-08  Martin Baulig  <martin@ximian.com>
5289
5290         Fix test-iter-10.cs - distinguish whether we `yield' in a property
5291         gettter (allowed) or setter (not allowed).
5292
5293         * class.cs (Accessor): Implement IIteratorContainer.
5294         (Accessor.Yields): New public field.
5295         (PropertyBase.PropertyMethod.Define): Handle iterators on a
5296         per-accessor basis.
5297
5298         * cs-parser.jay
5299         (get_accessor_declaration, set_accessor_declaration): Set the
5300         `yields' flag on the accessor, not the property.
5301         (property_declaration): Do the iterators check on a per-accessor
5302         basis and not for the whole property.
5303
5304 2005-07-08  Martin Baulig  <martin@ximian.com>
5305
5306         * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
5307         handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
5308
5309 2005-07-07  Marek Safar  <marek.safar@seznam.cz>
5310
5311         Fix #74975
5312         * attribute.cs (orig_sec_assembly): Holds original version of assembly.
5313         (ExtractSecurityPermissionSet): Cope with self referencing security
5314         attributes properly.
5315
5316         * driver.cs (SetOutputFile): Made public property OutputFile.
5317
5318 2005-07-07  Raja R Harinath  <rharinath@novell.com>
5319
5320         Fix #75486.
5321         * class.cs (TypeContainer.first_nonstatic_field): Rename from
5322         has_nonstatic_fields.  Make into a FieldBase pointer.
5323         (TypeContainer.AddField): Add CS0282 check.
5324         (TypeContainer.EmitType): Update.
5325
5326 2005-07-06  Miguel de Icaza  <miguel@novell.com>
5327
5328         * cs-tokenizer.cs (consume_identifier): Do not create strings to
5329         compare if they start with __.
5330
5331 2005-07-06  Raja R Harinath  <rharinath@novell.com>
5332
5333         * statement.cs (Switch.SwitchGoverningType): Only look at
5334         UserCasts that don't need implicit standard conversions to one of
5335         the allowed switch types (Fixes test-322.cs).
5336         (LocalInfo.Resolve): Re-enable sanity-test.
5337
5338 2005-07-06  Marek Safar  <marek.safar@seznam.cz>
5339
5340         * cs-tokenizer.cs (consume_identifier): Detect double undescores
5341         
5342         * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
5343         
5344         * expression.cs (Invocation.DoResolve): Report error CS0245 here.
5345
5346 2005-07-06  Raja R Harinath  <rharinath@novell.com>
5347
5348         Fix #75472.
5349         * ecore.cs (SimpleName.GetSignatureForError): Add.
5350         * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
5351         (MemberAccess.GetSignatureForError): Add.
5352
5353 2005-07-05  Marek Safar  <marek.safar@seznam.cz>
5354  
5355         The big error and warning messages review.
5356         
5357         * anonymous.cs,
5358         * assign.cs,
5359         * attribute.cs,
5360         * class.cs,
5361         * codegen.cs,
5362         * convert.cs,
5363         * cs-parser.jay,
5364         * cs-tokenizer.cs,
5365         * decl.cs,
5366         * delegate.cs,
5367         * doc.cs,
5368         * driver.cs,
5369         * ecore.cs,
5370         * enum.cs,
5371         * expression.cs,
5372         * flowanalysis.cs,
5373         * iterators.cs,
5374         * literal.cs,
5375         * location.cs,
5376         * modifiers.cs,
5377         * namespace.cs,
5378         * parameter.cs,
5379         * pending.cs,
5380         * report.cs,
5381         * rootcontext.cs,
5382         * statement.cs,
5383         * support.cs,
5384         * tree.cs,
5385         * typemanager.cs: Updated.
5386         
5387         * class.cs: (MethodCore.SetYields): Moved here to share.
5388         (PropertyMethod.Define): Moved iterator setup here.
5389         
5390         * iterators.cs: Add orig_method to have full access to parent
5391         container.
5392
5393 2005-07-05  Raja R Harinath  <rharinath@novell.com>
5394
5395         Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
5396         * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
5397         (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
5398         variable of struct type.
5399         * expression.cs (Unary.ResolveOperator): Update to change.
5400         (Indirection.VerifyFixed): Likewise.
5401         (LocalVariableReference.VerifyFixed): A local variable is always fixed.
5402         (ParameterReference.VerifyFixed): Value parameters are fixed.
5403         (This.VerifyFixed): Treat 'this' as a value parameter.
5404         * statement.cs (LocalInfo.IsFixed): Remove.
5405
5406 2005-07-01  Martin Baulig  <martin@ximian.com>
5407
5408         * iterators.cs (Iterator.CapturedThisReference.Emit): Use
5409         `ec.EmitThis ()' to get the correct scope.
5410
5411 2005-07-01  Martin Baulig  <martin@ximian.com>
5412
5413         * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
5414         instance is a ParameterReference; fixes #75299.
5415
5416 2005-07-01  Martin Baulig  <martin@ximian.com>
5417
5418         Reverted Marek's latest patch (r46725):
5419         - it contains structural changes which are neither mentioned in
5420           the ChangeLog nor explained anywhere; for example the additional
5421           argument of EmitContext's and Iterator's .ctor's and the
5422           TypeContainer.DefineMembers() change.
5423         - structural changes like this should go in in seperate patches
5424           and not be hidden in a huge patch which just seems to affect
5425           warnings and errors.
5426           a big and hard to understand patch.
5427         - it breaks iterators and causes regressions, for instance in
5428           test-iter-03.cs.      
5429
5430 2005-06-30  Raja R Harinath  <rharinath@novell.com>
5431
5432         Fix #75412.
5433         * expression.cs (Indexers.map): Remove.
5434         (Indexers.Append): Filter out inaccessible setters and getters.
5435         (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
5436
5437         Fix #75283.
5438         * ecore.cs (MemberExpr.EmitInstance): New.  Add CS0120 check.
5439         Refactored from ...
5440         (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
5441         (FieldExpr.Emit, PropertyExpr.Emit): Update.
5442         (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
5443         * expression.cs (Invocation.EmitCall): Add CS0120 check.
5444
5445 2005-06-30  Marek Safar  <marek.safar@seznam.cz>
5446
5447         Fix #75322
5448         * class.cs (FieldBase.GetInitializerExpression): One more field
5449         for backup.
5450
5451 2005-06-28  Miguel de Icaza  <miguel@novell.com>
5452
5453         * pending.cs: Do not define a proxy if the base method is virtual,
5454         it will be picked up by the runtime (bug 75270).
5455
5456 2005-06-08  Martin Baulig  <martin@ximian.com>
5457
5458         The big Iterators rewrite :-)
5459
5460         * iterators.cs: Rewrite this to use the anonymous methods framework.
5461
5462         * rootcontext.cs (RootContext.DefineTypes): Define Delegates
5463         before the TypeContainers; see 2test-21.cs.
5464
5465         * class.cs
5466         (TypeContainer.DefineType): Don't create a new EmitContext if we
5467         already have one (this only happens if we're an Iterator).
5468         (TypeContainer.Define): Also call Define() on all our iterators.
5469         (Method.CreateEmitContext): Added support for iterators.
5470
5471         * anonymous.cs
5472         (AnonymousContainer): New abstract base class for `AnonymousMethod'.
5473         (AnonymousContainer.CreateMethodHost): Moved here from
5474         AnonymousMethod and made abstract.
5475         (AnonymousContainer.CreateScopeType): New abstract method.
5476         (AnonymousContainer.IsIterator): New public property.
5477         (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
5478         get the ScopeTypeBuilder rather than manually defining it here. 
5479         (ScopeInfo.EmitScopeInstance): New public method; correctly handle
5480         iterators here.
5481
5482         * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
5483         before RootContext.DefineTypes().
5484
5485         * codegen.cs (EmitContext.RemapToProxy): Removed.
5486         (EmitContext.CurrentAnonymousMethod): Changed type from
5487         AnonymousMethod -> AnonymousContainer.
5488         (EmitContext.ResolveTopBlock): Protect from being called twice.
5489         (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
5490         (EmitContext.EmitThis): Removed the iterators hacks; use the
5491         anonymous methods framework for that.
5492
5493         * statement.cs
5494         (ToplevelBlock.Container): Make this a property, not a field.
5495         (ToplevelBlock.ReParent): New public method; move the
5496         ToplevelBlock into a new container.
5497         (Foreach.TemporaryVariable): Simplify.
5498
5499 2005-06-05  Martin Baulig  <martin@ximian.com>
5500
5501         * statement.cs (LocalInfo.CompilerGenerated): New flag.
5502         (Block.AddTemporaryVariable): New public method; creates a new
5503         `LocalInfo' for a temporary variable.
5504         (Block.EmitMeta): Create the LocalBuilders for all the temporary
5505         variables here.
5506         (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
5507         non-iterator variables.
5508
5509 2005-06-05  Martin Baulig  <martin@ximian.com>
5510
5511         * statement.cs (Foreach.TemporaryVariable): Create the
5512         LocalBuilder in the Emit phase and not in Resolve since in some
5513         situations, we don't have an ILGenerator during Resolve; see
5514         2test-19.cs for an example.
5515
5516 2005-06-04  Martin Baulig  <martin@ximian.com>
5517
5518         **** Merged r45395 from GCS ****
5519
5520         The big Foreach rewrite - Part II.
5521
5522         * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
5523         with `PropertyInfo ienumerator_getcurrent'.
5524
5525         * codegen.cs (VariableStorage): Removed.
5526
5527         * statement.cs
5528         (Foreach): Derive from Statement, not ExceptionStatement.
5529         (Foreach.CollectionForeach): New nested class.  Moved all the code
5530         dealing with collection foreach here.
5531         (Foreach.ForeachHelperMethods): Removed.
5532         (Foreach.TemporaryVariable): Implement IMemoryLocation.
5533
5534 2005-05-23  Martin Baulig  <martin@ximian.com>
5535
5536         * statement.cs (Try.DoResolve): Don't create a `finally' if we
5537         don't need to.  Fix #75014.
5538
5539 2005-05-20  Martin Baulig  <martin@ximian.com>
5540
5541         Merged r44808 from GMCS.
5542
5543         * class.cs (TypeContainer.CircularDepException): Removed.
5544         (TypeContainer.DefineType): Removed the `InTransit' stuff.
5545         (TypeContainer.CheckRecursiveDefinition): Check for circular class
5546         (CS0146) and interface (CS0529) dependencies here.
5547
5548 2005-06-21  Raja R Harinath  <rharinath@novell.com>
5549
5550         * expression.cs (Invocation.EmitCall): Fix initialization
5551         'this_call' to reflect current behaviour.  Fix indentation.
5552
5553         * convert.cs (FindMostEncompassedType): Add two trivial special
5554         cases (number_of_types == 0 || number_of_types == 1).
5555         (FindMostEncompasingType): Likewise.
5556
5557 2005-06-17  Raja R Harinath  <rharinath@novell.com>
5558
5559         Some cleanups preparing for the fix of #75283.
5560         * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
5561         error testing.
5562         (EventExpr.InstanceResolve): Likewise.
5563         (EventExpr.DoResolve): Remove redundant checks.
5564
5565 2005-06-10  Duncan Mak  <duncan@novell.com>
5566
5567         * cs-tokenizer.cs (process_directives): New flag for controlling
5568         the processing of preprocessor directives.
5569         (x_token): After seeing a '#', return Token.NONE instead of going
5570         to handle_preprocessing_directive() when not processing
5571         directives. This avoids unnecessary processing during the token peek in
5572         is_punct().
5573
5574         This fixes #74939.
5575
5576         * cs-tokenizer.cs (handle_preprocessing_directive, xtoken): Use
5577         the existing error reporting methods instead of Report.Error.
5578
5579         * convert.cs (priv_fmt_expr): Remove. It's not needed anymore
5580         after Raja's rewrite.
5581
5582 2005-06-08  Miguel de Icaza  <miguel@novell.com>
5583
5584         * class.cs: Small fix.
5585
5586 2005-06-08  Raja R Harinath  <rharinath@novell.com>
5587
5588         Fix #75160.
5589         * class.cs (GetPartialBases): Fix return value check of
5590         part.GetClassBases.
5591
5592 2005-06-07  Raja R Harinath  <rharinath@novell.com>
5593
5594         Ensure that partial classes are registered in their enclosing
5595         namespace.  Initial part of fix of #75160.
5596         * tree.cs (Tree.RecordDecl): Add new namespace argument.
5597         Register declspace with namespace here, not in
5598         DeclSpace.RecordDecl.
5599         * cs-parser.jay: Pass namespace to RecordDecl.
5600         * class.cs (PartialContainer.Create): Likewise.
5601         (ClassPart.DefineType): New sanity-check.  Throws an exception if
5602         called.
5603         * decl.cs (Declspace.RecordDecl): Remove.
5604         * namespace.cs (NamespaceEntry.DefineName): Remove.
5605
5606 2005-06-06  Marek Safar  <marek.safar@seznam.cz>
5607
5608         * rootcontext.cs: Reset TargetExt as well.
5609
5610 2005-06-03  Raja R Harinath  <rharinath@novell.com>
5611
5612         * ecore.cs (Expression.Resolve): Emit CS0654 error when
5613         -langversion:ISO-1.
5614
5615 2005-06-02  Raja R Harinath  <rharinath@novell.com>
5616
5617         Fix #75080, cs0119.cs.
5618         * ecore.cs (Expression.ExprClassToResolveFlags): New.  Broken out
5619         of ...
5620         (Expression.Resolve): ... this.  Use it.  Remove bogus code
5621         allowing ExprClass.Type and ExprClass.Namespace for
5622         ResolveFlags.VariableOrValue.
5623         (Expression.Resolve) [1-argument variant]: Change default resolve
5624         flags based on language version.
5625         (Expression.Error_UnexpectedKind): Use a simple string array
5626         rather than an ArrayList.
5627         * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
5628         not ExprClass.Type.
5629         (TypeOfVoid.DoResolve): Likewise.
5630         (MemberAccess.DoResolve) [3-argument variant]: Make private.  Drop
5631         flags argument -- it always has the same value.
5632
5633 2005-05-31  Raja R Harinath  <rharinath@novell.com>
5634
5635         Fix #75081.
5636         * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
5637         Use it in the error message.
5638         * assign.cs, expression.cs, statement.cs: Update.
5639
5640 2005-05-30  Raja R Harinath  <rharinath@novell.com>
5641
5642         Fix #75088.
5643         * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
5644         the "almostMatchedMember" case too.
5645         * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
5646         that failed the accessibility checks to 'almost_match'.
5647
5648 2005-05-27  Vladimir Vukicevic  <vladimir@pobox.com>
5649
5650         * attribute.cs: Use internal MethodBuilder methods to set
5651         ExactSpelling and SetLastError on PInvoke methods, instead
5652         of passing them via charset.  Fixes #75060.
5653
5654 2005-05-27  Raja R Harinath  <rharinath@novell.com>
5655
5656         * parameter.cs (Parameter): Remove TODO comment.
5657         (Parameter.DefineParameter): Remove Location parameter.
5658         (Parameters.LabelParameters): Likewise.
5659         * class.cs (Constructor.Emit): Update to change.
5660         (MethodData.Emit): Likewise.
5661         * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.  
5662         * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
5663
5664 2005-05-27  Atsushi Enomoto  <atsushi@ximian.com>
5665
5666         * parameter.cs,
5667           Removed Parameters.Location and added Parameter.Location instead.
5668           Removed Location parameter from Emit() and GetSignature().
5669         * anonymous.cs,
5670           class.cs,
5671           cs-parser.jay,
5672           delegate.cs,
5673           iterators.cs,
5674           statement.cs :
5675           Modified all related calls.
5676
5677 2005-05-26  Raja R Harinath  <rharinath@novell.com>
5678
5679         Improve user-defined conversion handling.
5680         * convert.cs (GetConversionOperators): Rewrite.  Return only the
5681         applicable operators.
5682         (AddConversionOperators): New.  Helper for GetConversionOperators.
5683         (FindMostEncompassedType, FindMostEncompassingType): Verify that
5684         there is only one most encompassed/encompassing type.
5685         (FindMostSpecificSource, FindMostSpecificTarget): Remove
5686         "applicable operator" handling.
5687         (UserConversion): Move cache here from GetConversionOperators.
5688         Directly cache the chosen operator, rather than the whole
5689         MethodGroup.
5690         (ExplicitNumericConversion): Fix buggy implementation of Decimal
5691         case.  Allow conversion of decimal to sbyte and byte too.
5692         * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
5693         New static methods.  Used to avoid allocating EmptyExpressions in
5694         convert.cs.
5695
5696 2005-05-24  Duncan Mak  <duncan@novell.com>
5697
5698         * ecore.cs (CastFromDecimal): New class for casting a decimal to
5699         another class, used in Convert.ExplicitNumericConversion.
5700         (CastToDecimal): New class, similar to above, but casts to
5701         System.Decimal, used in Convert.ImplicitNumericConversion and also
5702         in explicit convesion from double/float to decimal.
5703
5704         * convert.cs (ImplicitNumericConversion): Handle implicit
5705         conversions to System.Decimal.
5706         (ExplicitNumericConversion): handle explicit conversions to
5707         System.Decimal.
5708
5709         This fixes #68711.
5710         
5711 2005-05-20  Miguel de Icaza  <miguel@novell.com>
5712
5713         * typemanager.cs (EnumToUnderlying): Do not throw if we do not
5714         know the type at this stage, just break through.   Fixes #75008 
5715
5716 2005-05-19  Martin Baulig  <martin@ximian.com>
5717
5718         * delegate.cs
5719         (ImplicitDelegateCreation.Check): Added `bool check_only' argument
5720         to disable error reporting.
5721
5722         * convert.cs (Convert.ImplicitStandardConversionExists): Use it
5723         here since we don't want to report an error; see the new test-336.cs.
5724
5725 2005-05-19  Raja R Harinath  <rharinath@novell.com>
5726
5727         * statement.cs (ToplevelBlock.GetParameterReference)
5728         (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
5729         Move here from class Block.
5730         * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
5731         * expression.cs (ParameterReference.DoResolveBase): Likewise.
5732
5733 2005-05-18  Martin Baulig  <martin@ximian.com>
5734
5735         Fix #74978.
5736
5737         * flowanalysis.cs
5738         (FlowBranching.Reachability): Add non-static public And() and Or()
5739         methods.
5740         (FlowBranchingSwitch): New class; do the `break_origins' thing
5741         like in FlowBranchingLoop.
5742         (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
5743         reachability, not just locals and parameters.
5744         (FlowBranching.MergeChild): Remove some of the hacks for loop and
5745         switch; MergeBreakOrigins() now takes care of that.
5746
5747 2005-05-18  Martin Baulig  <martin@ximian.com>
5748
5749         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
5750         a loop and may leave it, reset the barrier; fixes #74974.
5751
5752 2005-05-17  Marek Safar  <marek.safar@seznam.cz>
5753         
5754         * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
5755         is back.
5756         
5757         * cs-parser.jay: Catch more lexical errors.
5758         
5759         * report.cs: Add one more Error method.
5760         
5761         * rootcontext.cs,
5762         * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
5763
5764 2005-05-17  Martin Baulig  <martin@ximian.com>
5765
5766         * expression.cs (Argument.Resolve): Turn on flow analysis; fix
5767         #70970. 
5768
5769 2005-05-16  Raja R Harinath  <rharinath@novell.com>
5770
5771         Fix test-382.cs.  Emit values of decimal constants.
5772         * class.cs (TypeContainer.RegisterFieldForInitialization): New.
5773         Carved out of ...
5774         (TypeContainer.AddField): ... this.
5775         (TypeContainer.EmitFieldInitializers): Allow the list of fields
5776         with initializers to include 'Const's.
5777         (ClassPart.RegisterFieldForInitialization): Forward to
5778         PartialContainer.
5779         * const.cs (Const.Const): Pass initializer to base class.
5780         (Const.Define): In case of decimal constants, register them for
5781         initialization in a static constructor.
5782
5783 2005-05-14  Martin Baulig  <martin@ximian.com>
5784
5785         * statement.cs (Block.Resolve): Correctly handle unreachable code;
5786         do not call ResolveUnreachable() on unreachable statements in
5787         here, see the comment in the source code.
5788
5789 2005-05-13  Raja R Harinath  <rharinath@novell.com>
5790
5791         Fix #74934.
5792         * expression.cs (BinaryResolveOperator): If one of the operands of
5793         an equality comparison is 'null' and the other is a pointer type,
5794         convert the null to a NullPointer.
5795         * convert.cs (ImplicitReferenceConversion): If the expression is a
5796         NullLiteral and the target type is a pointer type, return a
5797         NullPointer instead.
5798         (ImplicitConversionStandard): Likewise.
5799
5800 2005-05-13  Marek Safar  <marek.safar@seznam.cz>
5801         
5802         * cs-parser.jay: Set readonly context based on special constructs.
5803         
5804         * expression.cs (LocalVariableReference.DoResolveBase): Improved
5805         readonly variable error handling.
5806         
5807         * rootcontext.cs (EmitCode): Don't verify members when error
5808         occurred.
5809         
5810         * statement.cs (LocalInfo): Add reaodnly context information.
5811         (SetReadOnlyContext, GetReadOnlyContext): New methods.
5812
5813 2005-05-13  Raja R Harinath  <rharinath@novell.com>
5814
5815         * statement.cs (Block.Resolve): Revert change below.  Modify fix
5816         for #74041 to initialize 'resolved' to false only for explicit
5817         blocks.  Fixes #74873.
5818
5819 2005-05-12  Raja R Harinath  <harinath@gmail.com>
5820
5821         Fix #74920.
5822         * typemanager.cs (unmanaged_enclosing_types): New.
5823         (IsUnmanagedType): Avoid infloops by using
5824         'unmanaged_enclosing_types' to talk with recursive invocations.
5825
5826 2005-05-13  Martin Baulig  <martin@ximian.com>
5827
5828         * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
5829         instance variable, not a local.  Fix #74873.
5830         (Block.ResolveUnreachable): Set it to true here.
5831
5832 2005-05-11  Duncan Mak  <duncan@novell.com>
5833
5834         * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
5835         continuing to process for 'arg'.
5836         (handle_preprocessing_directive): Check the argument of the #endif
5837         directive and report error CS1025 if there are any trailing
5838         characters.
5839
5840         According to the C# spec, having even whitespace after the #endif
5841         directive is illegal; however, because we call arg.TrimEnd ()
5842         beforehand, we have the same behavior as csc, allowing whitespace
5843         after the directive.
5844
5845         Fixes #74892.
5846
5847 2005-05-11  Marek Safar  <marek.safar@seznam.cz>
5848
5849         Fix #74863.
5850         
5851         * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
5852         (Constructor.GetObsoleteAttribute): Implemented correctly.
5853
5854 2005-05-10  Martin Baulig  <martin@ximian.com>
5855
5856         * support.cs (ReflectionParameters.ParameterModifier): Use
5857         `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
5858         and `ParameterAttributes.In'.  Fixes #74884.
5859
5860 2005-05-10  Marek Safar  <marek.safar@seznam.cz>
5861
5862         * class.cs (Method.Define): Catch attempt for Finalizer declaration.
5863         
5864         * expression.cs (Argument.GetParameterModifier): Turned to property.
5865         (Invocation.Error_InvalidArguments): Add more descriptive errors.
5866         
5867         * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
5868         its C# equivalent.
5869         
5870 2005-05-09  Raja R Harinath  <rharinath@novell.com>
5871
5872         Fix #74852.
5873         * decl.cs (MemberCache.AddMethods): Register override methods,
5874         rather than non-override methods.
5875         * typemanager.cs (RegisterOverride): New.
5876         (IsOverride): Update.
5877
5878 2005-05-09  Marek Safar  <marek.safar@seznam.cz>
5879
5880         Fix #73105.
5881         
5882         * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
5883         recursive declaration.
5884         
5885         * statement.cs (Block.ResolveMeta): Report any error in resolving.
5886         
5887 2005-05-06  Marek Safar  <marek.safar@seznam.cz>
5888
5889         * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
5890         
5891         * expression.cs (Binary.DoResolve): (x && 0) is always 0.
5892
5893 2005-05-05  Raja R Harinath  <rharinath@novell.com>
5894
5895         Fix #74797.
5896         * decl.cs (DeclSpace.FamilyAccessible): 
5897         Use TypeManager.IsNestedFamilyAccessible.
5898
5899         Fix reopened #64812.
5900         * typemanager.cs (Closure.Filter): Introduce checks for 'protected
5901         internal'.
5902
5903 2005-05-04  Raja R Harinath  <rharinath@novell.com>
5904             Abin Thomas  <projectmonokochi@rediffmail.com>
5905             Anoob V E  <projectmonokochi@rediffmail.com>
5906             Harilal P R  <projectmonokochi@rediffmail.com>
5907
5908         Fix #64812.
5909         * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
5910         allow access to all static members.
5911
5912 2005-05-04  Martin Baulig  <martin@ximian.com>
5913
5914         * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
5915
5916 2005-05-04  Martin Baulig  <martin@ximian.com>
5917
5918         Fix #74655.
5919
5920         * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
5921         section at the end; make things work if `default' is not the last
5922         section.        
5923
5924 2005-05-04  Martin Baulig  <martin@ximian.com>
5925
5926         Fix #70400.
5927
5928         * statement.cs (Switch): Replaced the `got_default' field with a
5929         `default_section' one.
5930         (Switch.CheckSwitch): Set `default_section' here.
5931         (Switch.Resolve): If we're a constant switch and the constant is
5932         not found, use the default section.
5933
5934 2005-05-03  Martin Baulig  <martin@ximian.com>
5935
5936         * expression.cs (ArrayAccess.EmitGetLength): New public method.
5937
5938         * statement.cs (Foreach.ArrayForeach): New nested class.
5939         (Foreach.TemporaryVariable): New nested class.
5940         (Foreach.EmitArrayForeach): Removed; this is now in the new
5941         ArrayForeach class.
5942
5943 2005-05-03  Raja R Harinath  <rharinath@novell.com>
5944
5945         * pending.cs (BaseImplements): Move the #74773 fix here.  This is
5946         more conservative.
5947         (VerifyPendingMethods): Revert change below.
5948
5949         * typemanager.cs (IsOverride, RegisterNonOverride): New.
5950         * decl.cs (MemberCache.AddMethod): Register "non-override" methods
5951         that used to trigger warning -28.  Remove warning -28.
5952         * expression.cs (Invocation.OverloadResolve): Use
5953         TypeManager.IsOverride to distinguish override methods.
5954
5955         Fix #74773.
5956         * pending.cs (VerifyPendingMethods): If a base type implements the
5957         requested interface, don't bother checking individual methods of
5958         the base type.  As a side-effect, this prevents the creation of
5959         unnecessary proxies.
5960
5961 2005-05-02  Martin Baulig  <martin@ximian.com>
5962
5963         Fix #70182.
5964
5965         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
5966         Also `And' the locals if the old vector is null.
5967         (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
5968         null; in this case we basically reset all the variables.        
5969
5970 2005-05-02  Martin Baulig  <martin@ximian.com>
5971
5972         Fix #74529.
5973
5974         * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
5975         Added `FlowBranching branching' argument; always `and' the
5976         variables instead of `or'ing them unless we're an infinite loop.
5977
5978         * statement.cs (While.Resolve): Create a new sibling unless we're
5979         infinite.       
5980
5981 2005-05-02  Martin Baulig  <martin@ximian.com>
5982
5983         Fix #70140.
5984
5985         * class.cs (ConstructorInitializer.Resolve): Added `Block block'
5986         arguments; use it instead of creating a new TopLevelBlock.
5987         (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
5988         our ConstructorInitializer.
5989
5990         * statement.cs
5991         (TopLevelBlock.TopLevelBranching): New public property.
5992         (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
5993         and create our `TopLevelBranching'.
5994
5995         * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
5996         anonymous method host, use `block.TopLevelBranching' rather than
5997         creating a new branching.
5998
5999 2005-04-20  Miguel de Icaza  <miguel@novell.com>
6000
6001         * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
6002         a ScopeInfo, if any of the current children is a child of the new
6003         entry, move those children there.
6004
6005 2005-04-30  Martin Baulig  <martin@ximian.com>
6006
6007         * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
6008         at the beginning of a SwitchSection.  Fix #73335.
6009
6010 2005-04-27  Marek Safar  <marek.safar@seznam.cz>
6011
6012         Fix #74378
6013         * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
6014         
6015         * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
6016         (FieldExpr.DoResolve): Obsolete members are ignored for field
6017         initializers.
6018         
6019 2005-04-26  Marek Safar  <marek.safar@seznam.cz>
6020
6021         * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
6022         of arrays detection.
6023
6024         * class.cs (Interface.VerifyClsCompliance): Add base interfaces
6025         verification.
6026         (Field.VerifyClsCompliance): Volatile fields are not compliant.
6027
6028         * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
6029         arrays report.
6030
6031 2005-04-25  Ben Maurer  <bmaurer@ximian.com>
6032
6033         * cs-parser.jay: Use the prefered version of -unsafe in error
6034         message.
6035
6036 2005-04-22  Marek Safar  <marek.safar@seznam.cz>
6037
6038         * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
6039         circumstances.
6040
6041 2005-04-20  John Luke  <john.luke@gmail.com>
6042
6043         * driver.cs: fix typo in error message, --outout to --output
6044
6045 2005-04-20  Marek Safar  <marek.safar@seznam.cz>
6046
6047         * codegen.cs (InRefOutArgumentResolving): New field.
6048         
6049         * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
6050         fields outside contructor.
6051         
6052         * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
6053         
6054 2005-04-19  Miguel de Icaza  <miguel@novell.com>
6055
6056         * anonymous.cs (CaptureContext.EmitParameterInstance): The
6057         parameter code was not completed ever, so it was not as up-to-date
6058         as local variables.  Must finish it.
6059
6060         The bug fix was to compare the Toplevel of the block, not the
6061         current block.  Thanks for Ben for pointing this out. 
6062
6063 2005-04-19  Raja R Harinath  <rharinath@novell.com>
6064
6065         * decl.cs (AddMethods): Use the declaring type of the problem
6066         method to determine if we want to squash a warning.
6067
6068 2005-04-19  Marek Safar  <marek.safar@seznam.cz>
6069
6070         * attribute.cs: Removed debug output.
6071
6072         * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
6073         
6074         * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
6075         Report.Stderr.
6076         
6077 2005-04-18  Raja R Harinath  <rharinath@novell.com>
6078
6079         Fix #74481.
6080         * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
6081         (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
6082         all null comparisons against reference types.
6083
6084 2005-04-18  Marek Safar  <marek.safar@seznam.cz>
6085
6086         Fix# 74565
6087         * class.cs (TypeContainer.CircularDepException) New nested
6088         exception class.
6089         (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
6090         (TypeContainer.DefineType): Removed error, reset InTransit before
6091         exit.
6092         (Class.DefineType): Throw exception when is in Transit.
6093         Catch exception and report error.
6094         (Struct.DefineType): Throw exception when is in Transit.
6095         Catch exception and report error.
6096         (Interface.DefineType): Throw exception when is in Transit.
6097         Catch exception and report error.
6098
6099         * codegen.cs: Add InCatch,InFinally to EmitContext to easily
6100         handle nested exception handlers.
6101
6102         * flowanalysis.cs (InTryWithCatch): New method, search for try with
6103         a catch.
6104
6105         * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
6106         InFinally and InCatch storage.
6107
6108         * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
6109         (Catch.Resolve): Set and Restore ec.InCatch.
6110         (Try.Resolve): Set and Restore ec.InFinally.
6111         (Try.HasCatch): True when try has catch.
6112
6113 2005-04-17  Atsushi Enomoto  <atsushi@ximian.com>
6114
6115         * doc.cs : In some cases FilterName returns MonoEvent and MonoField
6116           for the same event member, so exclude such cases from warning 419.
6117           Fixed bug #74633.
6118
6119 2005-04-16  Miguel de Icaza  <miguel@novell.com>
6120
6121         * expression.cs (Binary.ResolveOperator): Apply patch from John
6122         Luke to fix bug 59864: operators &, | and ^ on enumerations
6123         require that the same enum type on both sides.
6124
6125         * driver.cs: Add warnings to old flag usage, this is to assist
6126         people who produce Makefiles and hope that the Makefiles will be
6127         used on Windows.
6128
6129         * class.cs (TypeContainer.EmitType): Moved the definition of the
6130         special $PRIVATE$ field from the resolve phase to the Emit phase.
6131         During resolve we do not know if we are a struct with
6132         HasExplicitLayout, we know this only after the attributes for the
6133         type are emitted.
6134
6135         Set the FieldOffset to zero on the dummy field that we create for
6136         the class.   Fixes 74590.
6137
6138 2005-04-16  Raja R Harinath  <rharinath@novell.com>
6139
6140         Fix #73834.
6141         * ecore.cs (PropertyExpr.resolved): New.
6142         (DoResolve): Use it to handle a case of double resolution here.
6143         Handle a case of identical-name-and-type-name.
6144         * expression.cs (ArrayCreation.CheckIndices): Avoid double
6145         resolution by storing the results of expression resolution back
6146         into the "probes" array.
6147
6148 2005-04-15  Raja R Harinath  <rharinath@novell.com>
6149
6150         Fix cs0208-7.cs and cs0208-8.cs.
6151         * typemanager.cs (IsUnmanagedType): Arrays are not allowed
6152         (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0).  Improve
6153         error reporting to point out the reason a struct is not unmanaged.
6154
6155 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
6156
6157         * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and 
6158           just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
6159
6160 2005-04-13  Raja R Harinath  <rharinath@novell.com>
6161
6162         Fix #74528.
6163         * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
6164         IdenticalNameAndTypeName here.
6165         (EventExpr.InstanceResolve): Likewise.
6166
6167 2005-04-13  Marek Safar  <marek.safar@seznam.cz>
6168
6169         C# 2.0 DefaultCharSetAttribute implementation
6170         
6171         * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
6172         which allows us to set GlobalNamespace for every resolve.
6173         (Attribute.ResolveArguments): Cut from Resolve.
6174         (Attribute.GetCharSetValue): Returns CharSet named argument.
6175         (Attribute.DefinePInvokeMethod): Gets default charset from
6176         module settings.
6177         (GlobalAttribute.ResolveAsTypeStep): Override.
6178         (GlobalAttribute.ResolveArguments): Override.
6179         
6180         * class.cs (TypeAttr): Is protected.
6181         
6182         * codegen.cs (ModuleClass.DefaultCharSet): New member.
6183         (ModuleClass.DefaultCharSetType): New memeber.
6184         (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
6185         
6186         * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
6187         charset from module.
6188         
6189         * delegate.cs (TypeAttr): Override.
6190         (Delegate.DefineType): Use this TypeAttr.
6191         
6192         * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
6193         at very early stage (before types are defined) to resolve model
6194         module attributes. It will probably not work with corlib but it
6195         should be ok.
6196         
6197         * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
6198         charset from module.
6199         
6200         * typemanager.cs (default_charset_type): New type.
6201
6202 2005-04-13  Raja R Harinath  <rharinath@novell.com>
6203
6204         * decl.cs (MemberCache.AddMethods): Don't warn if
6205         System.Object.Finalize has buggy MethodAttributes.
6206
6207         * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
6208         removed below.
6209
6210 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
6211
6212         * doc.cs : detect ambiguous reference to overloaded members.
6213           Fixed bug #71603. MS 1.1 csc does not detect it.
6214
6215 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
6216
6217         * doc.cs : delegates must not be referenced with parameters.
6218           Fixed bug #71605.
6219
6220 2005-04-12  Miguel de Icaza  <miguel@novell.com>
6221
6222         * typemanager.cs (IsUnmanagedType): Arrays are allowed.
6223
6224 2005-04-10  Miguel de Icaza  <miguel@novell.com>
6225
6226         * driver.cs (MainDriver): Stop processing if the CLS stage found
6227         errors. 
6228
6229         (CompilerCallableEntryPoint.InvokeCompiler): Always
6230         reset after execution;   Take a TextWriter argument for the
6231         output.
6232
6233         * report.cs: Use the error stream instead of hardcoding stderr. 
6234
6235 2005-04-09  Miguel de Icaza  <miguel@novell.com>
6236
6237         * class.cs: Reduce code paths to test, too small of an
6238         optimization to make it worth the extra testing.  Always perform
6239         it. 
6240
6241 2005-04-08  Raja R Harinath  <rharinath@novell.com>
6242
6243         Fix #74510.
6244         * class.cs (OperatorArrayList.CheckPairedOperators): Skip
6245         operators that had errors reported on them.
6246
6247 2005-04-08  Marek Safar  <marek.safar@seznam.cz>
6248
6249         * attribute.cs (Attribute.IsValidArgumentType): Test valid named
6250         argument types.
6251         (Attribute.Resolve): Add named argument type checking.
6252         
6253         * class.cs (FixedField.Define): Use IsPrimitiveType
6254         
6255         * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
6256         
6257         * iterators.cs (Iterator.DefineIterator): Add check for arglist and
6258         unsafe parameter types.
6259         
6260         * statement.cs (Using.ResolveExpression): Add better error description.
6261         
6262         * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
6263         
6264 2005-04-08  Raja R Harinath  <rharinath@novell.com>
6265
6266         Fix #74484.
6267         * attribute.cs (Attribute.GetAttributeUsage): Resolve
6268         AttributeUsageAttribute in the emitcontext of the attribute class,
6269         not in the emitcontext of the attributable entity it was attached to.
6270         * cs-parser.jay: Use 'current_class', not 'current_container',
6271         when creating a GlobalAttribute.
6272
6273 2005-04-08  Alp Toker  <alp@atoker.com>
6274
6275         * pending.cs: The fix to #58413 failed to compile methods implementing
6276         interfaces with/without params modifiers and vice versa, even though
6277         params modifiers aren't part of the signature. Make the modifier check
6278         less strict as in csc.
6279
6280 2005-04-07  Abin Thomas  <projectmonokochi@rediffmail.com>
6281             Anoob V E  <projectmonokochi@rediffmail.com>
6282             Harilal P R  <projectmonokochi@rediffmail.com>
6283
6284         Fix #58413.
6285         * pending.cs (TypeAndMethods.mods): New.  Store the parameter
6286         modifiers of pending methods.
6287         (PendingImplementation.PendingImplementation): Initialize it.
6288         Add Parameter.Modifier [][] mods and initialize it with ParameterData.
6289         (PendingImplementation.InterFaceMethod): Repalce Type[] argument
6290         with ParameterData.  Add check for modifiers.
6291         * class.cs (MethodData.Define): Update to changes.
6292
6293 2005-04-07  Raja R Harinath  <rharinath@novell.com>
6294
6295         * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
6296
6297 2005-04-07  Marek Safar  <marek.safar@seznam.cz>
6298
6299         * class.cs (PropertyMethod.Define): Check private accessor in abstract
6300         property.
6301         
6302         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
6303         
6304         * rootcontext.cs,
6305         * typemanager.cs: Registered RequiredAttributeAttribute.
6306         
6307 2005-04-06  Marek Safar  <marek.safar@seznam.cz>
6308
6309         * class.cs (VerifyMembers): Doesn't need EmitContext argument.
6310         Warning CS0169 is back at level 3.
6311         (IMethodData.SetMemberIsUsed): New method.
6312         
6313         * decl.cs (IsUsed): New value; moved from FieldBase.Status
6314         (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
6315         
6316         * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
6317
6318         * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
6319         contants.
6320         (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
6321         is used.
6322         
6323         * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
6324         is used.
6325         
6326         * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
6327         to avoid the problems with nested types.
6328
6329 2005-04-05  Abin Thomas  <projectmonokochi@rediffmail.com>
6330             Anoob V.E  <projectmonokochi@rediffmail.com>
6331             Harilal P.R  <projectmonokochi@rediffmail.com>
6332             Raja R Harinath  <rharinath@novell.com>
6333
6334         Fix #73820.
6335         * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
6336         attribute.
6337         * typemanager (GetConstructor): Make public.
6338
6339 2005-04-05  John Luke  <john.luke@gmail.com>
6340             Raja R Harinath  <rharinath@novell.com>
6341
6342         Fix #62232.
6343         * typemanager.cs (IsUnmanagedType): Check non-public fields of a
6344         struct too.  Return false quicker in a few cases.
6345         (VerifyUnManaged): Use it.
6346
6347 2005-04-05  Raja R Harinath  <rharinath@novell.com>
6348
6349         Fix #74041.
6350         * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
6351         not 'unreachable_seen'.
6352
6353 2005-04-04  Marek Safar  <marek.safar@seznam.cz>
6354
6355         * attribute.cs (Attribute.GetValue): Removed unused.
6356         
6357         * codegen.cs (CodeGen.TrimExt): Removed unused.
6358         
6359         * cs-parser.jay (output): Removed unused.
6360         
6361         * cs-tokenizer.cs (hex_digits): Removed unused.
6362         
6363         * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
6364         
6365         * expression.cs (Indirection.LoadExprValue): Removed unused.
6366         (ArrayCreation.ExpressionToArrayArgument): Removed unused.
6367         
6368         * iterators.cs (Iterator.param_types): Removed unused.
6369         
6370         * statement.cs (Goto.block): Removed unused.
6371         (ToplevelBlock.did): Removed unused.
6372         (Switch.ResolveConstantSwitch): Removed unused.
6373
6374 2005-04-01  Ben Maurer  <bmaurer@ximian.com>
6375
6376         * rootcontext.cs: Allow mcs to bootstrap with the compilation
6377         resetting thingy.
6378
6379 2005-04-01  Raja R Harinath  <rharinath@novell.com>
6380
6381         Fix #74232 and cs0208-3.cs.
6382         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
6383         * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
6384         unmanaged type.  Don't use FieldBuilders when 't' is a
6385         TypeBuilder.  Use ModFlags and MemberType fields.
6386         * class.cs (MemberBase.member_type): Rename from MemberType.
6387         (MemberBase.MemberType): New property.  Determines member_type on
6388         demand.
6389         (MemberBase.DoDefine): Don't initialize MemberType here.
6390         (FieldMember.Define): Likewise.
6391
6392 2005-04-01  Marek Safar  <marek.safar@seznam.cz>
6393
6394         Fix #74241
6395         * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
6396         Attributes are emitted there.
6397         
6398 2005-04-01  Raja R Harinath  <rharinath@novell.com>
6399
6400         * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
6401         keyword in 'partial enum' too.
6402         * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
6403         is not allowed).
6404         Report from Kamil Skalski <nazgul@omega.pl>.
6405
6406         Fix #74309.
6407         * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
6408         have partial containers too.
6409
6410         * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
6411         in block' checks to Block.CheckInvariantMeaningInBlock.
6412         * statement.cs (Block.GetKnownVariableInfo): Make private.
6413         (Block.IsVariableUsedInChildBlock): Remove.
6414         (Block.IsVariableUsedInBlock): Likewise.
6415         (Block.CheckInvariantMeaningInBlock): New.  Show location of
6416         conflicting declaration.
6417         (Block.AddVariable): Make error messages less long-winded and more
6418         specific.  Show location of conflicting declaration.
6419         * parameter.cs (Parameters.Location): New readonly property.
6420
6421 2005-03-31  Raja R Harinath  <rharinath@novell.com>
6422
6423         Clean up semantics of invoking ResolveMemberAccess.
6424         * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
6425         can have an instance, ensure that we pass in a non-TypeExpression
6426         to ResolveMemberAccess.  Tighten up IdenticalNameAndTypeName checks.
6427         (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
6428         argument.  Update to changes and simplify.
6429         (FieldExpr.Emitinstance): Remove CS0120 check.
6430         (PropertyExpr.EmitInstance): Likewise.
6431         * expression.cs (Argument.Resolve): Likewise.
6432         (Invocation.DoResolve): Update to changes in semantics of
6433         InstanceExpression.
6434
6435 2005-03-31  Marek Safar  <marek.safar@seznam.cz>
6436
6437         Fix #74241
6438         * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
6439         customization.
6440         
6441         * decl.cs (MemberCache.AddMethods): Fix infinite loop.
6442
6443 2005-03-31  Raja R Harinath  <rharinath@novell.com>
6444
6445         Fix difference in behaviour with commandline invocation.
6446         * driver.cs (Driver.Reset): New.
6447         (CompilerCallableEntryPoint): Call it.
6448
6449         * statement.cs (If.Resolve): Avoid spurious "uninitialized
6450         variable" warnings if the boolean expression failed to resolve.
6451
6452 2005-03-30  Sebastien Pouliot  <sebastien@ximian.com>
6453
6454         * attribute.cs: Fix the union of several permissions when some of them
6455         are unrestricted (so the result isn't an unrestricted permission set).
6456         Fix #74036.
6457
6458 2005-03-30  Raja R Harinath  <rharinath@novell.com>
6459
6460         * ecore.cs (MemberExpr): New class.  Convert from interface
6461         IMemberExpr.
6462         (MemberExpr.ResolveMemberAccess): Refactor and move here from
6463         MemberAccess.ResolveMemberAccess.  Tighten up pre-conditions and
6464         error checks.
6465         (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
6466         (MethodGroupExpr.IsExplicitImpl): Remove.
6467         (Expression.GetFieldFromEvent): Remove.
6468         (SimpleName.MemberStaticCheck): Remove.
6469         (SimpleName.DoSimpleNameResolve): Update to changes.
6470         * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
6471         (MemberAccess.IdenticalNameAndTypeName): Remove.
6472         (MemberAccess.error176): Move to MemberExpr.
6473         (MemberAccess.DoResolve): Update to changes.
6474         (BaseAccess.DoResolve): Likewise.
6475
6476 2005-03-30  Marek Safar  <marek.safar@seznam.cz>
6477
6478         C# 2.0 Conditional attribute class implementation
6479         
6480         * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
6481         Analyzes class whether it has attribute which has ConditionalAttribute
6482         and its condition is not defined.
6483         
6484         * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
6485         (Class.IsExcluded): New method. Search for at least one defined
6486         condition in ConditionalAttribute of attribute class.
6487
6488 2005-03-30  Raja R Harinath  <rharinath@novell.com>
6489
6490         * ecore.cs (PropertyExpr): Derive from Expression, not
6491         ExpressionStatement.
6492         (PropertyExpr.EmitStatement): Remove.
6493
6494 2005-03-29  Raja R Harinath  <rharinath@novell.com>
6495
6496         Fix #74060.
6497         * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
6498         internal field "value__" of an enum be private.  The examples for
6499         "value__" that I found on MSDN all used FieldAttributes.Private.
6500
6501         * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
6502         Don't mention IL method attribute names.
6503
6504         Fix #47991.  Remove a TODO.
6505         * statement.cs (Block.Toplevel): Make into a field.
6506         (Block.Parameters): Move into ToplevelBlock.
6507         (Block.known_variables): Rename from child_variable_names.
6508         (Block.Block): Remove variants that take Parameters.  Initialize
6509         'Toplevel' with the immediately surrounding toplevel block.
6510         (Block.AddKnownVariable): Rename from AddChildVariableName.  Add a
6511         LocalInfo parameter.
6512         (Block.GetKnownVariableInfo): New.
6513         (Block.IsVariableNameUsedInChildBlock): Update.
6514         (Block.IsVariableNameUsedInBlock): New.  Checks if a name is used in
6515         the block, even though it may not be in scope.
6516         (Block.AddVariable): Remove Parameters parameter.  Use
6517         Toplevel.Parameters instead.
6518         (Block.AddConstant): Remove Parameters parameter.
6519         (Block.GetParameterReference): Update to use Toplevel.Parameters.
6520         (Block.IsParamaterReference): Likewise.
6521         (Block.IsLocalParameter): Likewise.  Simplify a lot.
6522         (ToplevelBlock.Parameters): New.  Moved from Block.
6523         (ToplevelBlock.ToplevelBlock): Update to changes.  Always
6524         initialize Parameters to a non-null value.
6525         * cs-parser.jay: Update to changes.
6526         * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
6527         simple names that mean different things in the same block.  Use
6528         Block.IsVariableNameUsedInBlock.
6529
6530 2005-03-28  Raja R Harinath  <rharinath@novell.com>
6531
6532         * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
6533         (TypeHandle.TypeHandle): Use LookupMemberCache rather than
6534         GetTypeHandle.  It is possible for a reflected type to derive from
6535         a TypeBuilder (e.g., int[] derives from the TypeBuilder
6536         System.Array during mscorlib compilation).
6537         * decl.cs (MemberCache.MemberCache): If the base cache doesn't
6538         contain a method_hash, don't create one either.  Don't create a
6539         deep copy of the base cache's method_hash.
6540         (MemberCache.SetupCache): Rename back from DeepCopy.
6541         (MemberCache.AddMethods): Rewrite, now that method_hash isn't
6542         already initialized.  If we see an override function, add its
6543         underlying base virtual function to the member_hash too.
6544
6545         * enum.cs (Enum.LookupEnumValue): Remove debugging code.
6546
6547 2005-03-26  Raja R Harinath  <harinath@acm.org>
6548
6549         Fix #73038.
6550         * assign.cs (Assign.DoResolve): When the RHS of an assignment
6551         fails to resolve, ensure that the LHS is still resolved as an
6552         lvalue.
6553
6554 2005-03-25  Raja R Harinath  <harinath@acm.org>
6555
6556         * enum.cs (Enum.DefineType): Set ec.InEnumContext and
6557         ec.ContainerType.
6558         (Enum.current_ec): Remove.
6559         (Enum.LookupEnumValue): Remove EmitContext argument.
6560         Just uses the one created during DefineType.
6561         (Enum.FindMembers): Update.
6562         * expression.cs (MemberAccess.DoResolve): Update.
6563
6564 2005-03-22  Marek Safar  <marek.safar@seznam.cz>
6565
6566         * assign.cs (Assign.DoResolve): Check for CS1717 when
6567         source and target are same (uses Equals).
6568
6569         * expression.cs (LocalVariableReference, ParameterReference,
6570         This): Implemented Equals, GetHashCode.
6571
6572         * statement.cs (Block.GetParameterReference): Removed useless
6573         local variable.
6574
6575 2005-03-22  Raja R Harinath  <rharinath@novell.com>
6576
6577         Fix cs0128.cs
6578         * statement.cs (Block.AddVariable): Ensure that we skip implicit
6579         blocks before deciding whether the error is cs0136 or cs0128.
6580
6581         * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
6582         (using_alias_directive, using_namespace_directive): Pass
6583         MemberName, not an expression to Namespace.UsingAlias and
6584         Namespace.Using.
6585         (MakeName): Use the MemberName of the namespace.
6586         * namespace.cs (Namespace.MemberName): New.
6587         (UsingEntry.UsingEntry): Take a MemberName, not an expression.
6588         (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
6589         Likewise.
6590         * decl.cs (MemberName.Name): Make readonly.
6591         (MemberName.FromDotted): New "constructor".
6592         (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
6593         (MemberCore.Name): Compute from MemberName on demand.
6594         (MemberCore.SetMemberName): Provide a way to change the
6595         MemberName.
6596         (MemberCore.AddToContainer): Don't take a fullname parameter.
6597         * class.cs (TypeContainer.AddToMemberContainer): Don't add the
6598         fully qualified name of the container to the member name.
6599         (TypeContainer.AddToTypeContainer): Use a fully qualified name
6600         only if the type is a member of the root container.
6601         (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
6602         MemberName.Left rather than searching for an embedded ".".
6603         (PartialContainer.CreatePart): Update to changes in RootContext.
6604         (MemberBase.ShortName): Turn into a property.  Use
6605         MemberCore.SetMemberName.
6606         (MemberBase.ExplicitInterfaceName): Remove.
6607         (MemberBase.UpdateMemberName): Remove.
6608         (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
6609         (PropertyBase.SetMemberName): New override.
6610         * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
6611         (Tree.GetDecl): New.
6612         (Tree.AllDecls): Rename from Decls.
6613         * attribute.cs, enum.cs, report.cs: Update to changes.
6614         * driver.cs (MainDriver): Use MemberName.FromDotted on
6615         RootContext.MainClass.
6616
6617 2005-03-21  Marek Safar  <marek.safar@seznam.cz>
6618
6619         * class.cs (FixedField.Define): Check for CS1664 and more sanity
6620         checks.
6621
6622         * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
6623
6624 2005-03-18  Marek Safar  <marek.safar@seznam.cz>
6625
6626         * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
6627         property accessor modifiers.
6628
6629         * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
6630         fixed buffer attribute (CS1716).
6631         (PropertyMethod.HasCustomAccessModifier): When property accessor
6632         has custom modifier.
6633
6634         * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
6635         modifiers.
6636         (PropertyExpr.DoResolveLValue): Add CS0272.
6637
6638 2005-03-17  Miguel de Icaza  <miguel@novell.com>
6639
6640         * convert.cs: When converting to a pointer, use the proper Conv.U
6641         or Conv.I depending on the source data type.
6642
6643         * cs-tokenizer.cs: Make the size for large decimal constants,
6644         fixes #72957.
6645
6646 2005-03-17  Martin Baulig  <martin@ximian.com>
6647
6648         * anonymous.cs (AnonymousMethod.method_modifiers): Change default
6649         from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'.  Fixes #73260.
6650
6651 2005-03-17  Martin Baulig  <martin@ximian.com>
6652
6653         * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
6654         to bool so we can return an error condition.
6655         (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
6656         returned an error.
6657
6658 2005-03-16  Zoltan Varga  <vargaz@freemail.hu>
6659
6660         * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
6661         attributes.
6662
6663 2005-03-16  Raja R Harinath  <rharinath@novell.com>
6664
6665         Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
6666         Refactor to avoid traversing the list of assemblies, and to avoid
6667         string concatenation.
6668         * typemanager.cs (guid_attr_type): Remove.
6669         (negative_hits, pointers, references): Remove hashes.
6670         (type_hash): New.
6671         (GetConstructedType): New.  Uses type_hash to handle constructed
6672         types (arrays, references, pointers).
6673         (GetReferenceType, GetPointerType): Use it.
6674         (GetNestedType): New.  Uses type_hash to handle nested types of
6675         reflected types.
6676         (LookupType, LookupTypeDirect): Remove.
6677         (CoreLookupType): Inline parts of old LookupTypeDirect code.  Use
6678         'types' hash and LookupTypeReflection directly.
6679         (params_string, params_object): Use GetConstructedType.
6680         * namespace.cs (Namespace.cached_types): New.  Cache of reflected
6681         top-level types.
6682         (Namespace.Lookup): Use cached_types.
6683         (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
6684         provided by old TypeManager.LookupType.
6685         * rootcontext.cs (MakeFQN): Remove.
6686         * decl.cs (DeclSpace.MakeFQN): Likewise.
6687         (DeclSpace.LookupType): Use TypeManager.GetNestedType.
6688         * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
6689         TypeManager.GetConstructedType.
6690         * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
6691
6692 2005-03-15  Marek Safar  <marek.safar@seznam.cz>
6693
6694         * class.cs (MethodCore.CheckBase): Report CS1715 for properties and
6695         indexers.
6696
6697         * cs-parser.jay: Reports CS1527 for any namespace element.
6698
6699         * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
6700         Added CS0407.
6701
6702         * expression.cs (ParameterReference.IsAssigned): Changed error to
6703         CS0269.
6704         (Error_WrongNumArguments): Moved CS0245 detection here.
6705
6706         * statement.cs (Return.Resolve): Add CS1622 report.
6707
6708 2005-03-11  Marek Safar  <marek.safar@seznam.cz>
6709
6710         * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
6711
6712 2005-03-11  Zoltan Varga  <vargaz@freemail.hu>
6713
6714         * attribute.cs expression.cs: Get rid of some allocations.
6715
6716 2004-03-11  Atsushi Enomoto  <atsushi@ximian.com>
6717
6718         * doc.cs : just eliminate the latest change.
6719
6720 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
6721
6722         * doc.cs : commented out the latest change. It breaks xml-030.cs
6723
6724 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
6725
6726         * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
6727           fail. So invoke CreateType() in FindDocumentedType().
6728
6729 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
6730
6731         * cs-tokenizer.cs : added IsKeyword().
6732         * doc.cs : Detect keyword incorrectly used as identifier.
6733           Allow identifiers prefixed by @.
6734
6735 2005-03-10  Marek Safar  <marek.safar@seznam.cz>
6736
6737         * attributes.cs (Attributes.Emit): Continue after CheckTargets.
6738         It caused exception in namespace resolving (again!).
6739         
6740         * class.cs (Class.ctor): Removed exit.
6741         (PropertyMethod.ctor): ditto.
6742         
6743         * codegen.cs (Codegen.Reset): Reset static data.
6744         (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
6745         
6746         * cs-tokenizer.cs (Cleanup): Removed.
6747         
6748         * driver.cs (GetSystemDir): Rewrote to one line command.
6749         It caused problem with unloaded dynamic modules.
6750         (UnixParseOption): Removed Exit.
6751         (CompilerCallableEntryPoint.InvokeCompiler): Make static.
6752         (CompilerCallableEntryPoint.Reset): Reset suitable static data.
6753         Now can be mcs used as library.
6754         
6755         * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
6756         empty location.
6757         
6758         * location.cs (Reset): Reset static data.
6759         
6760         * namespace.cs (Reset): Reset static data.
6761         
6762         * report.cs (Report.Reset): Reset static data.
6763         
6764         * rootcontext.cs (RootContext.Reset): Reset static data.
6765         
6766         * tree.cs (RootTypes.ctor): Use Location.Null
6767         
6768         * typemanager.cs (TypeManager.Reset): Reset static data.
6769         (CoreLookupType): Removed Exit.
6770         (TypeHandle.Reset): Reset static data.
6771         
6772 2005-03-10  Raja R Harinath  <rharinath@novell.com>
6773
6774         Fix #73516.
6775         * typemanager.cs (ComputeNamespaces): Import namespaces from
6776         referenced modules too.
6777
6778 2005-03-09  Raja R Harinath  <rharinath@novell.com>
6779
6780         * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
6781         than '.'.
6782
6783 2005-03-09  Raja R Harinath  <rharinath@novell.com>
6784
6785         * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
6786         enclosing DeclSpace.  This ensures that a name-lookup populates
6787         more caches and there are fewer 'TypeExpression's.  Carve out
6788         nested type lookup into ...
6789         (LookupNestedTypeInHierarchy): ... this.
6790
6791 2005-03-09  Raja R Harinath  <rharinath@novell.com>
6792
6793         Clean up a few partial-class semantics.  
6794         Fixes test-357.cs and cs1618-2.cs.
6795         * cs-parser.jay (struct_declaration): Use 'current_class' as
6796         parent of newly-created struct.  Remove call to Register ().
6797         Use 'pop_current_class' to complete handing the current struct.
6798         (interface_declaration): Likewise.
6799         (class_declaration): Likewise.
6800         (enum_declaration): Use 'current_class' as parent of newly created
6801         enum.
6802         (delegate_declaration): Likewise.
6803         (pop_current_class): New function.  This is used to handle closing
6804         up the 'current_class' and 'current_container', and pointing them
6805         to the enclosing class/container.
6806         (CSharpParser): Initialize 'current_class' too.
6807         * decl.cs (MemberCore): Add check for invariant: a partial
6808         container is not a parsed entity, and thus does not enclose any
6809         parsed members.
6810         (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
6811         (DeclSpace.BaseTypeExpr): Use it.
6812         (DeclSpace.LookupType): Add check for invariant.
6813         * class.cs (TypeContainer): Add check for invariant: a nested
6814         class should have the same NamespaceEntry as its enclosing class.
6815         (TypeContainer.EmitFieldInitializers): Make virtual.
6816         (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
6817         MemberCore.
6818         (TypeContainer.Register): Remove.
6819         (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
6820         null.  Use TypeResolveEmitContext for resolving base types and
6821         interfaces.  Move initialization of Parts.TypeBuilder here from
6822         ...
6823         (TypeContainer.DefineNestedTypes): ... here.
6824         (PartialContainer): Take a Namespace not a NamespaceEntry.
6825         (PartialContainer.Create): Don't use Register.  Call the
6826         appropriate Add... function directly.
6827         (ClassPart): Take both the PartialContainer and the enclosing
6828         class as constructor arguments.
6829         (ClassPart.EmitFieldInitializers): Override.
6830         (ClassPart.PartFindNestedTypes): Remove.
6831         (FieldBase.GetInitializerExpression): Resolve the initializer
6832         expression in the emit context of the enclosing class.
6833         * tree.cs (RootTypes): Remove Register ().
6834         
6835 2005-03-08  Marek Safar  <marek.safar@seznam.cz>
6836
6837         * cs-parser.jay: Removed CS0134.
6838         
6839         * driver.cs: Removed CS1901.
6840         
6841         * expression.cs (SizeOf.DoResolve): Don't report CS0233
6842         for predefined types.
6843
6844 2005-03-07  Duncan Mak  <duncan@novell.com>
6845
6846         * codegen.cs (Save):  Catch UnauthorizedAccessException as
6847         well. Fixes bug #73454.
6848
6849 2005-03-07  Marek Safar  <marek.safar@seznam.cz>
6850
6851         * cs-tokenizer.cs (xtoken): Add CS1035.
6852         
6853         * class.cs (MethodData.Define): Add CS0683.
6854         (FieldMember.ctor): Add CS0681.
6855
6856 2005-03-07  Raja R Harinath  <rharinath@novell.com>
6857
6858         * ecore.cs (SimpleName.DoResolve): Rename from
6859         SimpleName.DoResolveAllowStatic.
6860         (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
6861         Pass 'intermediate' flag to MemberStaticCheck.
6862         (SimpleName.MemberStaticCheck): Skip "static check" only in case
6863         of "intermediate" lookups via MemberAccess.
6864         (SimpleName.IdenticalNameAndTypeName): New.  Carved out of ...
6865         * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
6866
6867 2005-03-07  Raja R Harinath  <rharinath@novell.com>
6868
6869         Fix #73394.
6870         * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
6871         slipped in because of variable names that are identical to a
6872         builtin type's BCL equivalent ('string String;', 'int Int32;').
6873         (PropertyExpr.EmitInstance): Likewise.
6874
6875 2005-03-04  Marek Safar  <marek.safar@seznam.cz>
6876
6877         * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
6878         
6879         * report.cs (warning_ignore_table): Made public.
6880
6881 2005-03-04  Raja R Harinath  <rharinath@novell.com>
6882
6883         Fix #73282.
6884         * class.cs (MethodData.Emit): Pass 'container' to
6885         container.GetObsoleteAttribute instead of 'container.Parent'.
6886
6887 2005-03-03  Marek Safar  <marek.safar@seznam.cz>
6888
6889         * cs-parser.jay: Add 1534 error test.
6890
6891         * iterators.cs (Yield.CheckContext): Add error 1629.
6892         (Iterator.ctor): Save unsafe modifier.
6893         (MoveNextMethod.DoEmit): Restore unsafe context.
6894
6895         * namespace.cs (UsingAlias): Better error message.
6896
6897 2005-03-03  Dan Winship  <danw@novell.com>
6898
6899         * convert.cs (Error_CannotImplicitConversion): fix two bugs in
6900         the warning message [#73219]
6901
6902 2005-03-03  Raja R Harinath  <rharinath@novell.com>
6903
6904         Fix compile with MCS 1.0.0.0.
6905         * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
6906         w_restore to not depend on string constant folding.
6907
6908 2005-03-03  Raja R Harinath  <rharinath@novell.com>
6909
6910         * decl.cs (DeclSpace.LookupType): Remove 'silent' argument.  Move
6911         CS0246 check to users who passed 'silent = false'.
6912         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
6913         check.
6914         (SimpleName.SimpleNameResolve): Update.
6915         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
6916         (MemberAccess.IdenticalNameAndTypeName): Update.
6917         * doc.cs (FindDocumentedTypeNonArray): Update.
6918
6919 2005-03-03  Raja R Harinath  <rharinath@novell.com>     
6920
6921         * codegen.cs (EmitContext): Remove ResolvingTypeTree.
6922         * parameters.cs (ComputeAndDefineParameters): Remove.
6923         * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
6924         * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
6925         Use GetParameterInfo.
6926
6927 2005-03-02  Marek Safar  <marek.safar@seznam.cz>
6928
6929         * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
6930
6931 2005-03-02  Raja R Harinath  <rharinath@novell.com>
6932
6933         Unify DeclSpace.LookupType and DeclSpace.FindType.
6934         * decl.cs (DeclSpace.FindNestedType): New virtual function.  This
6935         is in charge of defining nested types on demand.
6936         (DeclSpace.LookupType): Use it when the current_type is a
6937         TypeBuilder.  Use LookupTypeDirect for reflected types.
6938         (DeclSpace.FindType): Remove.
6939         (DeclSpace.LookupInterfaceOrClass): Likewise.
6940         (DeclSpace.DefineTypeAndParents): Likewise.
6941         * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
6942         DeclSpace.LookupType.
6943         * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
6944         * typemanager.cs (LookupType): Simplify.
6945         (AddUserType): Remove type from negative_hits.
6946         * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
6947         * class.cs (TypeContainer.FindMembers): Move handling of nested
6948         types ...
6949         (TypeContainer.FindMembers_NestedTypes): ... here.
6950         (TypeContainer.FindNestedType): Implement override.
6951         (ClassPart.FindNestedType): Delegate to PartialContainer.
6952         (ClassPart.PartFindNestedType): Looks up the nested types of the
6953         part alone.
6954
6955 2005-03-02  Martin Baulig  <martin@ximian.com>
6956
6957         * class.cs (TypeContainer.DoDefineMembers): We also need a default
6958         static constructor in static classes.
6959
6960 2005-03-01  Zoltan Varga  <vargaz@freemail.hu>
6961
6962         * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
6963         sizeParamIndex is not specified.
6964
6965 2005-03-01  Marek Safar  <marek.safar@seznam.cz>
6966
6967         Fix #73117
6968         * report.cs (WarningMessage.IsEnabled): Missing null check.
6969
6970 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
6971
6972         * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
6973         in the fields and not in the properties.
6974
6975 2005-02-28  Zoltan Varga  <vargaz@freemail.hu>
6976
6977         * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex 
6978         fields as well.
6979
6980 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
6981
6982         * attribute.cs: Small refactoring (improved robustness).
6983         (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
6984         (ValidateGuid): Removed.
6985         (Resolve): Removed referenced to above mentioned.
6986         (GetAttributeUsage): Made private and changed to work without
6987         class assistance.
6988         (GetIndexerAttributeValue): Don't crash.
6989         (GetConditionalAttributeValue): Ditto.
6990         (GetClsCompliantAttributeValue): Ditto.
6991         (ExtractSecurityPermissionSet): All attributes exceptions are
6992         error 648.
6993         (GetPropertyValue): New helper.
6994         (GetMethodImplOptions): New method.
6995         (DefinePInvokeMethod): Reuse common code. Implemented handling of
6996         some missing properties.
6997         
6998         * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
6999         (Method.ApplyAttributeBuilder): Updated.
7000         
7001         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
7002         exception.
7003
7004 2005-02-28  Raja R Harinath  <rharinath@novell.com>
7005
7006         Fix #73052.
7007         * report.cs (Report.SymbolRelatedToPreviousError): Handle
7008         non-simple types (array, pointer, reference).
7009
7010 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
7011
7012         * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
7013
7014         * class.cs (MethodCore.IsDuplicateImplementation): Special error
7015         for operators.
7016         (Method.CheckBase): Catch wrong destructor here.
7017         (MethodData.Define): Add errors 550, 668.
7018
7019         * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
7020
7021         * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
7022
7023         * pending.cs (VerifyPendingMethods): Add error 551.
7024
7025         * typemanager.cs (CSharpName): Next error report helper.
7026
7027 2005-02-25  Marek Safar  <marek.safar@seznam.cz>
7028
7029         * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
7030         attributes. Removed useless attribute double check.
7031         It saves almost 2MBs for corlib.
7032
7033 2005-02-25  Raja R Harinath  <rharinath@novell.com>
7034
7035         Fix #72924.
7036         * statement.cs (ExpressionStatement.Resolve): Make robust to being
7037         called twice in case of error.
7038
7039 2005-02-23  Chris Toshok  <toshok@ximian.com>
7040
7041         Fix compiler portions of #72827.
7042         * statement.cs (Block.Emit): call Begin/EndScope on the
7043         EmitContext instead of the ILGenerator.
7044
7045         * codegen.cs (EmitContext.BeginScope): new method, call
7046         ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
7047         we have one.)
7048         (EmitContext.BeginScope): same, but EndScope and CloseScope
7049
7050         * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
7051         offset and call the superclass's OpenScope(int) with it.
7052         (SymbolWriter.CloseScope): get the current il
7053         offset and call superclass's CloseScope(int) with it.
7054
7055 2005-02-23  Marek Safar  <marek.safar@seznam.cz>
7056
7057         * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
7058         CS1677 for out and ref as well.
7059
7060         * class.cs (Method.Define): Add error CS1599 detection.
7061         
7062         * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
7063         
7064         * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
7065         
7066         * delegate.cs (Delegate.Define): Add error CS1599 detection.
7067         
7068         * support.cs.cs (ModifierDesc): New helper method.
7069
7070 2005-02-23  Raja R Harinath  <rharinath@novell.com>
7071             Abin Thomas  <projectmonokochi@rediffmail.com>
7072             Anoob V E  <projectmonokochi@rediffmail.com>
7073             Harilal P R  <projectmonokochi@rediffmail.com>
7074
7075         Fix #57851, #72718.
7076         * class.cs (ConstructorBuilder.Resolve): Make sure that the second
7077         MemberLookup (used for error reporting) actually returns a result.
7078         Fix error report number (122, not 112).
7079
7080 2005-02-22  Abin Thomas  <projectmonokochi@rediffmail.com>
7081             Anoob V E  <projectmonokochi@rediffmail.com>
7082             Harilal P R  <projectmonokochi@rediffmail.com>
7083
7084         Fix #71134.
7085         * pending.cs (PendingImplementation.GetAbstractMethods):
7086         Find NonPublic members too.
7087
7088 2005-02-22  Marek Safar  <marek.safar@seznam.cz>
7089
7090         * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
7091         Fixed error 217.
7092         
7093         * class.cs (MethodCore.CheckMethodAgainstBase):
7094         Add error 239 report.
7095
7096 2005-02-21  Raja R Harinath  <rharinath@novell.com>
7097
7098         Fix #68955.
7099         * expression.cs (Invocation.IsApplicable): Make public.
7100         (Invocation.IsParamsMethodApplicable): Likewise.
7101         * delegate.cs (Delegate.VerifyApplicability): Don't use
7102         Invocation.VerifyArgumentCompat for parameter applicability
7103         testing.  Use Invocation.IsApplicable and
7104         Invocation.IsParamsMethodApplicable.
7105
7106 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
7107
7108         * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
7109         
7110         * class.cs (Operator.Define): Add error 217 report.
7111         
7112 2005-02-21  Raja R Harinath  <rharinath@novell.com>
7113
7114         * namespace.cs (UsingEntry.Resolve): Undo change below.
7115
7116 2005-02-21  Raja R Harinath  <rharinath@novell.com>
7117
7118         Fix #72756.
7119         * ecore.cs (Expression.MemberLookupFailed): Add argument to
7120         disable the error message when the extended MemberLookup also
7121         fails.
7122         (Expression.MemberLookupFinal): Update.
7123         (SimpleName.DoSimpleNameResolve): Update.
7124         * expression.cs (MemberAccess.ResolveNamespaceOrType):
7125         Don't use MemberLookupFinal.
7126         (New.DoResolve): Update.
7127         (BaseAccess.CommonResolve): Update.
7128
7129 2005-02-21  Raja R Harinath  <rharinath@novell.com>
7130
7131         Fix #72732.
7132         * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
7133         occured previously, don't resolve again.
7134
7135 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
7136
7137         Fix #69949
7138         * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
7139         argument. Call ResolveAttributeUsage for unresolved.
7140         when types doesn't match ctor arguments.
7141         
7142         * class.cs (DoDefineMembers.TypeContainer): Removed safety check
7143         for nested attribute classes.
7144         (Class.attribute_usage): Removed.
7145         (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
7146         for attribute class.
7147         
7148         * ecore.cs (IsAttribute): Removed.
7149         
7150         * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
7151         
7152         * rootcontext.cs (RegisterAttribute): Removed, attributes are
7153         now normal types.
7154         (attribute_types): Removed.
7155         (EmitCode): Global attributes are emited as the latest.
7156
7157 2005-02-18  Marek Safar  <marek.safar@seznam.cz>
7158
7159         * class.cs (EmitFieldInitializers): Don't emit field initializer
7160         for default values when optimilization is on.
7161         
7162         * constant.cs (Constant.IsDefaultValue): New property.
7163         
7164         * driver.cs: Add /optimize handling.
7165         
7166         * constant.cs,
7167         * ecore.cs,
7168         * literal.cs: Implement new IsDefaultValue property.
7169         
7170         * rootcontext.cs (Optimize): New field, holds /optimize option.
7171
7172 2005-02-18  Raja R Harinath  <rharinath@novell.com>
7173
7174         Fix crasher in re-opened #72347.
7175         * namespace.cs (Namespace.Lookup): Return null if
7176         DeclSpace.DefineType returns null.
7177
7178         Fix #72678.
7179         * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
7180
7181 2005-02-18  Raja R Harinath  <rharinath@novell.com>
7182
7183         Fix remainder of #63202.  Change semantics of DoResolveLValue: it
7184         now returns null if it cannot resolve to an lvalue.
7185         * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
7186         (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
7187         returned null.  Remove check for SimpleName.
7188         (EventExpr.DoResolveLValue): New.
7189         * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
7190         * expression.cs (Argument.Error_LValueRequired): New.  Move CS1510
7191         error from ...
7192         (Argument.Resolve): ... here.  Use it.  Use DoResolveLValue to
7193         avoid CS0131 error.
7194         (Unary.ResolveOperator): Move CS0211 check ...
7195         (Unary.DoResolve): ... here.  Use DoResolveLValue to avoid
7196         CS0131 error.
7197         (Unary.DoResolveLValue): Simplify.
7198         (AddressOf.DoResolveLValue): New.
7199         (ArrayAccess.DoResolveLValue): New.
7200
7201 2005-02-16  Marek Safar  <marek.safar@seznam.cz>
7202
7203         * attribute.cs (Attribute.Resolve): Add arguments casting for
7204         when types doesn't match ctor arguments.
7205
7206 2005-02-16  Raja R Harinath  <rharinath@novell.com>
7207
7208         Fix parts of #63202.
7209         * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
7210         lookup of operator in base type.  Ensure that all checks happen
7211         when the operator resolves to an "op_..." method.
7212
7213 2005-02-15  Raja R Harinath  <rharinath@novell.com>
7214
7215         Fix #71992.
7216         * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
7217         'ignore_cs0104' parameter.  Pass it to ...
7218         (NamespaceEntry.Lookup): ... this.
7219         * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
7220         * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
7221         (TypeLookupExpression.DoResolveAsTypeStep): Update.
7222         * expression.cs (MemberAccess.IdenticalNameAndTypeName):
7223         Update.  Request that cs0104 errors be ignored.
7224         (ComposedCast.ResolveAsTypeStep): Update.
7225
7226 2005-02-14  Raja R Harinath  <rharinath@novell.com>
7227
7228         Fix #59209.
7229         * expression.cs (Invocation.BetterFunction): Remove support for
7230         comparing virtual functions and their overrides.
7231         (Invocation.IsOverride): New.
7232         (Invocation.OverloadResolve): Don't consider 'override' functions
7233         during candidate selection.  Store them in a lookaside list.
7234         If the selected method is a 'virtual' function, use the list to
7235         find any overrides that are closer to the LHS type.
7236
7237 2005-02-14  Marek Safar  <marek.safar@seznam.cz>
7238
7239         * expression.cs (New.DoResolve): Add complex core type reduction.
7240         (New.Constantify): Converts complex core type syntax like 'new int ()'
7241         to simple constant.
7242         
7243 2005-02-14  Raja R Harinath  <rharinath@novell.com>
7244
7245         * decl.cs (EntryType.EntryType): New constructor to create an
7246         updated copy of a cache entry.
7247         (MemberCache.AddMethods): Use it.
7248         (MemberCache.ClearDeclaredOnly): Remove.
7249         (MemberCache.MemberCache): Update.
7250
7251 2005-02-11  Miguel de Icaza  <miguel@novell.com>
7252
7253         * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
7254         variable.  This one is represents the actual low-level declaration
7255         of the method, as opposed to the semantic level `IsStatic'.   
7256
7257         An anonymous method which is hosted into a static method might be
7258         actually an instance method.  IsStatic would reflect the
7259         container, while MethodIsStatic represents the actual code
7260         generated.
7261
7262         * expression.cs (ParameterReference): Use the new MethodIsStatic
7263         instead of IsStatic.
7264
7265         * anonymous.cs (AnonymousMethod.Compatible): Pass the
7266         Modifiers.STATIC to the Anonymous' Method EmitContext if static is
7267         set on the current EmitContext. 
7268
7269         * expression.cs (Cast): Overload DoResolveLValue so we can pass
7270         resolve our casted expression as an LValue.  This triggers the
7271         proper LValue processing that is later required by Assign.
7272
7273         This fixes 72347.
7274
7275         * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
7276
7277 2005-02-11  Marek Safar  <marek.safar@seznam.cz>
7278
7279         C# 2.0 Fixed buffer implementation
7280
7281         * anonymous.cs: Update after RegisterHelperClass renaming.
7282
7283         * attribute.cs (AttributeTester.fixed_buffer_cache):
7284         Cache of external fixed buffers.
7285         (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
7286         implementation if field is fixed buffer else null.
7287
7288         * class.cs
7289         (TypeContainer.AddField): Accept FieldMember instead of Field.
7290         (FieldBase.IsFieldClsCompliant): Extracted code from
7291         VerifyClsCompliance descendant customization.
7292         (FixedField): New class handles fixed buffer fields.
7293         (FixedFieldExternal): Keeps information about imported fixed
7294         buffer.
7295         (IFixedField): Make access to internal or external fixed buffer
7296         same.
7297
7298         * cs-parser.jay: Add fixed buffer parsing.
7299
7300         * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
7301         buffer.
7302
7303         * expression.cs (Indirection): Extended implementation to accept
7304         fixed buffer field.
7305         (PointerArithmetic.Emit): Get element from fixed buffer as well.
7306         (ElementAccess.MakePointerAccess): Get type as parameter.
7307         (DoResolve): Add fixed buffer field expression conversion.
7308         (DoResolveLValue): Ditto.
7309         (FixedBufferPtr): New class. Moved most of original ArrayPtr.
7310         (ArrayPtr): Derives from FixedBufferPtr.
7311         (ArrayPtr.Emit): Add extra emit for array elements.
7312
7313         * flowanalysis.cs.cs (StructInfo): Use FieldMember.
7314
7315         * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
7316         for compiler generated types.
7317         (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
7318
7319         * statement.cs (Fixed): Refactored to be easier add fixed buffer
7320         and consume less memory.
7321         (Fixed.Resolve): Add fixed buffer case.
7322
7323         * typemanager.cs (compiler_generated_attr_ctor,
7324         fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
7325         (HasElementType): Add our own implementation to work on every
7326         runtime.
7327
7328 2005-02-11  Miguel de Icaza  <miguel@novell.com>
7329
7330         * anonymous.cs (CaptureContext): Track whether `this' has been
7331         referenced.   
7332
7333         * expression.cs (This.ResolveBase): Call CaptureThis.  Before we
7334         only captured `this' if it was implicitly done (instance
7335         methods/variables were used). 
7336
7337         * codegen.cs (EmitContext.CaptureThis): New method to flag that
7338         `this' must be captured.
7339
7340 2005-01-30  Miguel de Icaza  <miguel@novell.com>
7341  
7342         * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
7343         is null it means that there has been no need to capture anything,
7344         so we just create a sibling.
7345
7346         Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
7347
7348         Just a partial fix.  The other half is fairly elusive.
7349         
7350 2005-02-10  Raja R Harinath  <rharinath@novell.com>
7351
7352         Fix #52586, cs0121-4.cs.
7353         * decl.cs (MemberCache.DeepCopy): Rename from SetupCache.  Take
7354         and return a hashtable.
7355         (MemberCache.ClearDeclaredOnly): New.
7356         (MemberCache.MemberCache): Update to change.  Make a deep copy of
7357         the method_hash of a base type too.
7358         (MemberCache.AddMethods): Adapt to having a deep copy of the base
7359         type methods.  Overwrite entries with the same MethodHandle so
7360         that the ReflectedType is correct.  The process leaves in base
7361         virtual functions and their overrides as distinct entries.
7362         (CacheEntry): Now a class instead of a struct.  It shouldn't alter
7363         matters since it was boxed in a ArrayList before.
7364         (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
7365         modifier.
7366         * expression.cs (Invocation.BetterFunction): Simplify.  Handle the
7367         case of a virtual function and its override (choose the overload
7368         as better).
7369         (Invocation.OverloadResolve): Avoid 'override' members during
7370         'applicable_type' calculation.
7371
7372 2005-02-09  Raja R Harinath  <rharinath@novell.com>
7373
7374         Combine two near-redundant caches.
7375         * typemanager.cs (method_params): Rename from method_internal_params.
7376         (TypeManager.GetParameterData): New.  Replace
7377         Invocation.GetParameterData.
7378         (TypeManager.LookupParametersByBuilder): Remove.
7379         * expression.cs (Invocation.method_parameter_cache): Remove.
7380         (Invocation.GetParameterData): Remove.
7381         Update to changes.
7382         * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
7383         Update to changes.
7384
7385 2005-02-08  Raja R Harinath  <rharinath@novell.com>
7386
7387         Fix #72015.
7388         * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
7389         TypeManager.multicast_delegate_type is null, resolve it by looking
7390         up "System.MulticastDelegate".
7391         * rootcontext.cs (RootContext.ResolveCore): Simplify.
7392
7393 2005-02-07  Abin Thomas (NOSIP)  <projectmonokochi@rediffmail.com>
7394             Anoob V.E (NOSIP)  <projectmonokochi@rediffmail.com>
7395             Harilal P.R (NOSIP)  <projectmonokochi@rediffmail.com>
7396
7397         Fix cs0164.cs.
7398         * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
7399         (LabeledStatement.AddReference): New.  Set 'referenced'.
7400         (Goto.Resolve): Use it.
7401
7402 2005-02-05  John Luke  <john.luke@gmail.com>
7403
7404         * driver.cs: remove duplicate -doc line in Usage ()
7405
7406 2005-02-04  Raja R Harinath  <rharinath@novell.com>
7407
7408         * location.cs (Location.AddFile): Fix CS2002 error report.
7409
7410 2005-02-02  Martin Baulig  <martin@ximian.com>
7411
7412         * delegate.cs (Delegate.DefineType): Report an internal error if
7413         TypeManager.multicast_delegate_type is null.  See bug #72015 for
7414         details.        
7415
7416 2005-02-02  Raja R Harinath  <rharinath@novell.com>
7417
7418         Fix a crasher in a variant of #31984.
7419         * const.cs (Constant.CheckBase): New override that defers the
7420         new-or-override check in case the base type hasn't been populated
7421         yet.
7422         (Constant.Define): Ensure the new-or-override check is performed.
7423
7424 2005-02-01  Duncan Mak  <duncan@ximian.com>
7425
7426         * const.cs (LookupConstantValue): Check that `ce' is not null
7427         before calling GetValue ().
7428
7429 2005-02-01  Raja R Harinath  <rharinath@novell.com>
7430
7431         Fix test-334.cs (#69519).
7432         * cs-parser.jay (using_alias_directive): Pass in an expression to
7433         NamespaceEntry.UsingAlias.
7434         (using_namespace_directive): Pass in an expression to
7435         NamespaceEntry.Using.
7436         (namespace_name): Don't flatten to a string.
7437         * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
7438         (NamespaceEntry.AliasEntry.Resolve): Lookup using
7439         ResolveAsTypeStep.
7440         (NamespaceEntry.UsingEntry): Likewise.
7441         (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
7442         changes.
7443         (NamespaceEntry.LookupForUsing): Remove.
7444         (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
7445         names.
7446         (NamespaceEntry.Lookup): Remove support for dotted names.
7447
7448 2005-02-01  Raja R Harinath  <rharinath@novell.com>
7449
7450         * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
7451         split into two.
7452         (NamespaceEntry.ImplicitParent): Compute on demand.
7453         (NamespaceEntry.Doppelganger): New implicit namespace-entry that
7454         parallels the current.
7455         (NamespaceEntry.LookupForUsing): Use it.
7456         (NamespaceEntry.Lookup): If the current namespace-entry is
7457         implicit, don't search aliases and using tables.
7458
7459 2005-02-01  Raja R Harinath  <rharinath@novell.com>
7460
7461         Fix #31984.
7462         * class.cs (TypeContainer.DoDefineMembers): Don't initialize
7463         BaseCache here.
7464         (TypeContainer.BaseCache): Compute on demand.
7465         (TypeContainer.FindMembers): Define constants and types if they're
7466         not already created.
7467         (FieldMember.Define): Move resetting of ec.InUnsafe before error
7468         check.
7469         * const.cs (Constant.Define): Make idempotent.
7470
7471 2005-01-29  Miguel de Icaza  <miguel@novell.com>
7472
7473         * pending.cs: Produce better code (no nops produced by using Ldarg
7474         + value).
7475         
7476         * pending.cs (PendingImplementation.DefineProxy): It was not `arg
7477         i - 1' it should be arg + 1.
7478
7479         Fixes bug #71819.
7480
7481 2005-01-28  Raja R Harinath  <rharinath@novell.com>
7482
7483         * attribute.cs (Attribute.CheckAttributeType): Make private
7484         non-virtual.
7485         (Attribute.ResolveType): Make virtual.
7486         (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
7487         handling of RootContext.Tree.Types.
7488
7489 2005-01-27  Raja R Harinath  <rharinath@novell.com>
7490
7491         Update attribute-handling to use the SimpleName/MemberAccess
7492         mechanisms.
7493         * cs-parser.jay (attribute): Pass in an expression to the
7494         constructors of Attribute and GlobalAttribute.
7495         * attribute.cs (Attribute): Take an expression for the name.
7496         (Attribute.ResolvePossibleAttributeTypes): New.  Resolves the
7497         passed in attribute name expression.
7498         (Attribute.CheckAttributeType): Use it.
7499         * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
7500         * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
7501         (MemberAccess.ResolveNamespaceOrType): ... here.  Add 'silent'
7502         argument to prevent error messages if the lookup fails.
7503
7504 2005-01-27  Marek Safar  <marek.safar@seznam.cz>
7505
7506         * expression.cs (Indirection): Implemented IVariable interface
7507         to support indirection in AddressOf operator.
7508         (PointerArithmetic.Emit): Add optimalization for case where
7509         result can be precomputed.
7510
7511 2005-01-26  Martin Baulig  <martin@ximian.com>
7512
7513         * class.cs (TypeContainer.AttributeTargets): Return the correct
7514         AttributeTargets depending on our `Kind' instead of throwing an
7515         exception; fixes #71632.
7516
7517 2005-01-26  Marek Safar  <marek.safar@seznam.cz>
7518
7519         Fix #71257
7520         * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
7521         constant members.
7522
7523 2005-01-25  Raja R Harinath  <rharinath@novell.com>
7524
7525         Fix #71602.
7526         * expression.cs (MemberAccess.DoResolve): Don't complain with
7527         cs0572 when the LHS of a member access has identical name and type
7528         name.
7529
7530 2005-01-25  Marek Safar  <marek.safar@seznam.cz>
7531
7532         Fix #71651, #71675
7533         * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
7534         CreatePermission.
7535         Create custom PermissionSet only for PermissionSetAttribute.
7536
7537 2005-01-24  Marek Safar  <marek.safar@seznam.cz>
7538
7539         Fix #71649
7540         * class.cs (StaticClass.DefineContainerMembers): Enable enums and
7541         delegates in static class.
7542
7543 2005-01-24  Martin Baulig  <martin@ximian.com>
7544
7545         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
7546         merging an implicit block, just use its reachability.
7547
7548         * statement.cs (Block.Resolve): Make the unreachable code check
7549         work wrt. implicit blocks; see test-337 from #63842.
7550
7551 2005-01-21  Alp Toker  <alp@atoker.com>
7552  
7553         * cs-parser.jay: destructor_declaration's container is PartialContainer
7554         not Class when partial types are used, so use Kind prop instead of
7555         'is'.
7556         
7557 2005-01-22  Miguel de Icaza  <miguel@ximian.com>
7558
7559         * cs-parser.jay: Improve error reporting when an interface
7560         declares new types.
7561
7562 2005-01-20  Dick Porter  <dick@ximian.com>
7563
7564         * support.cs: SeekableStreamReader fix from Sandor Dobos
7565         (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
7566         chars are read.  Fixes bug 70369.
7567
7568 2005-01-20  Raja R Harinath  <rharinath@novell.com>
7569
7570         * cs-parser.jay (catch_clause): Simplify current_block handling
7571         somewhat.
7572
7573 2005-01-17  Miguel de Icaza  <miguel@ximian.com>
7574
7575         * convert.cs (ImplicitStandardConversionExists): Synchronize the
7576         code with ImplicitStandardConversion to handle the implicit
7577         conversion of method groups into valid delegate invocations. 
7578
7579         The problem is that in parameter handling we were using this code
7580         path.  Fixes bug #64698
7581
7582 2005-01-19  Raja R Harinath  <rharinath@novell.com>
7583
7584         * cs-parser.jay: Fix several infelicities.
7585         - Avoid assigning to the parser value stack.  Code like 
7586           '$3 = null' is unclean.  Synthesize a value for the code block
7587           instead. 
7588         - Avoid using oob_stack for storing location information.  Use ...
7589         (_mark_): ... this.  New (empty) rule.  Saves the current location
7590         in $$.
7591         (foreach_statement): Avoid using oob_stack for current_block
7592         handling.  Use technique used in for_statement and
7593         using_statement.  Synthesize a value for the code block to store
7594         additional intermediate information.
7595
7596 2005-01-13  Miguel de Icaza  <miguel@ximian.com>
7597
7598         * ecore.cs (IsAccessorAccessible): Accessibility to private fields
7599         of a different type is only allowed to private fields of a
7600         containing type, not on fields of a base class.
7601
7602         See test-174.cs and error cs0122-9.cs
7603
7604 2005-01-13  Raja R Harinath  <rharinath@novell.com>
7605
7606         Fix test-335.cs (bug #58126).
7607         * cs-parser.jay (argument): Split out non-expression parts of the
7608         rule into 'non_simple_argument'.
7609         (invocation_expression): Support parenthesized invocations with
7610         multiple arguments, and with single non-simple arguments.
7611
7612 2005-01-13  Raja R Harinath  <rharinath@novell.com>
7613
7614         * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
7615         places.
7616
7617 2005-01-12  Raja R Harinath  <rharinath@novell.com>
7618
7619         Fix cs0038-1.cs, cs1640-6.cs.
7620         * ecore.cs (Expression.Resolve): Remove special-case for
7621         SimpleName in error-handling.
7622         (Expression.almostMatchedMembers): Relax access permission to
7623         protected.
7624         (Expression.MemberLookupFailed): Handle duplicates in
7625         almostMatchedMembers list.
7626         (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
7627         * expression.cs (New.DoResolve): Report CS1540 for more cases.
7628         * typemanager.cs (GetFullNameSignature): Use the MethodBase
7629         overload if the passed in MemberInfo is a MethodBase.
7630
7631 2005-01-12  Marek Safar  <marek.safar@seznam.cz>
7632
7633         Fix #70749
7634         * attribute.cs (ExtractSecurityPermissionSet): Don't report error
7635         for non-CAS & merge permission sets properly.
7636
7637 2005-01-11  Raja R Harinath  <rharinath@novell.com>
7638
7639         Improve standard-compliance of simple name and member access 
7640         resolution.  Fixes bugs #52697, #57200, #67520, #69519.
7641         * ecore.cs (FullNamedExpression): New abstract base class 
7642         for Namespaces and TypeExpressions.
7643         (ResolveFlags.SimpleName): Remove.
7644         (SimpleName): Remove support for dotted names.
7645         (SimpleName.ResolveAsTypeStep): Simplify.  Now just a wrapper to 
7646         DeclSpace.FindType and DeclSpace.LookupType.
7647         (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
7648         (Expression.ExprClassName): Make member function.
7649         * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
7650         a namespace.  Remove creation of dotted "SimpleName"s.
7651         (MemberAccess.DoResolve): Likewise.
7652         * decl.cs (DeclSpace.Cache): Make private.
7653         (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
7654         (DeclSpace.FindType): Update.
7655         (DeclSpace.LookupType): Move here from RootContext.  Return a 
7656         FullNamedExpression.
7657         * namespace.cs (Namespace): Derive from FullNamedExpression
7658         so that it can be part of expression resolution.
7659         (Namespace.Lookup): Return an FullNamedExpression.
7660         (NamespaceEntry.LookupAlias): Lookup aliases only in current
7661         namespace.
7662         * rootcontext.cs (NamespaceLookup): Remove.
7663         (LookupType): Move to DeclSpace.
7664         * attribute.cs (CheckAttributeType): Update.
7665         * doc.cs (FindDocumentedType): Remove allowAlias argument.
7666         (FindDocumentedTypeNonArray): Likewise.
7667
7668 2005-01-11  Raja R Harinath  <rharinath@novell.com>
7669
7670         Fix cs0509.cs, cs1632.cs.
7671         * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
7672         is the same as IsInterface.
7673         (TypeContainer.GetClassBases): Likewise.
7674         * statement.cs (LabeledStatement.ig): New field.
7675         (LabeledStatement.LabelTarget): Save ILGenerator which created the
7676         label.
7677         (LabeledStatement.DoEmit): Check that the label was created with
7678         the same ILGenerator.
7679
7680 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
7681
7682         Fix #71058
7683         * attribute.cs (GetMethodObsoleteAttribute): Need to transform
7684         accessors to its properties.
7685
7686         * ecore.cs (PropertyExpr): Add AccessorTable to help track back
7687         from accessors to property.
7688         
7689 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
7690
7691         Fix #70722
7692         * class.cs (MethodCore.CheckBase): Test base method obsoleteness
7693         only for overrides.
7694         
7695 2005-01-08  Miguel de Icaza  <miguel@ximian.com>
7696
7697         * attribute.cs: Check for null and empty strings.  
7698
7699         I have lost another battle to Paolo.
7700
7701 2005-01-07  Marek Safar  <marek.safar@seznam.cz>
7702
7703         Fix #70942
7704         * class.cs (PropertyMethod): Set Parent field in ctors.
7705         (SetMethod.InternalParameters): Add unsafe switch hack.
7706         Override MarkForDuplicationCheck where it is appropriate.
7707
7708         * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
7709         It says whether container allows members with the same name.
7710         Base default is no.
7711         (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
7712         Removed is_method parameter.
7713
7714 2005-01-06  Duncan Mak  <duncan@ximian.com>
7715
7716         * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
7717         because the previous change led to incorrect reporting of CS1032
7718         ("Cannot define/undefine preprocessor symbols after first token in
7719         file"). Instead of using `tokens_seen' as the only flag that
7720         triggers CS1040, introduce `comments_seen'. This new flag is used
7721         to signify having seen comments on the current line, so it is
7722         unset after a newline.
7723
7724 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
7725
7726         * doc.cs : When searching for a type, find nested type too.
7727           This fixes bug #71040.
7728
7729 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
7730
7731         * doc.cs :
7732           - Warn missing member comment on those classes which also does not
7733             have doc comments. Fixed bug #71041.
7734           - Don't warn missing doc comment on default constructor.
7735             Fixed bug #71042.
7736
7737 2005-01-06  Duncan Mak  <duncan@ximian.com>
7738
7739         * cs-tokenizer.cs (xtoken): After handling traditional C-style
7740         comments, set `tokens_seen' to true. This allows us to detect
7741         misplaced preprocessor directives (i.e. not at the beginning of
7742         the a line, nor after whitespaces). In that case, report error
7743         CS1040. This fixes bug #56460.
7744
7745         * cs-parser.jay (interface_member_declaration): Add checks for
7746         IsExplicitImpl, and report CS0541 error if an interface member is
7747         defined as an explicit interface declaration.
7748
7749 2005-01-06  Marek Safar  <marek.safar@seznam.cz>
7750
7751         Fix #70817
7752         * class.cs (PropertyMethod): Set Parent field in ctors.
7753         (SetMethod.InternalParameters): Add unsafe switch hack.
7754         
7755         * decl.cs (MemberCore.Parent): Cannot be readonly.
7756
7757 2005-01-06  Raja R Harinath  <rharinath@novell.com>
7758
7759         * decl.cs (DeclSpace.ResolveType): Remove.
7760         (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
7761         Merge in code from ...
7762         (DeclSpace.GetTypeResolvingEmitContext): ... here.  Remove.
7763         * class.cs, enum.cs: Update to changes.
7764
7765 2005-01-06  Miguel de Icaza  <miguel@ximian.com>
7766
7767         * anonymous.cs: Ensure that we init the scope of our parent if it
7768         has not been initialized yet.
7769
7770 2004-12-30  Duncan Mak  <duncan@ximian.com>
7771
7772         * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
7773         if field.FieldBuilder is null. Fixes #70758.
7774
7775         * convert.cs: Fixed some typos and updated some of the comments.
7776         (ImplicitStandardConversionExists):
7777         (TryImplicitIntConversion): If `target_type' is an interface and
7778         the type of `ic' implements this interface, return true or a new
7779         BoxedCast instead of null. This fixes #70468.
7780
7781 2004-12-29  Duncan Mak  <duncan@ximian.com>
7782
7783         * expression.cs (Argument.Emit): Check that Expr is
7784         IMemoryLocation before casting to it, and report CS1510 otherwise.
7785
7786         This fixes #70402.
7787
7788 2004-12-21  Ben Maurer  <bmaurer@ximian.com>
7789
7790         * statement.cs (Block.ThisVariable): remove the recursion here, to
7791         make the --profile more sane.
7792
7793 2004-12-17  Carlos Cortez <calberto.cortez@gmail.com>
7794
7795         * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
7796         assembly, by JB Evain.
7797
7798 2004-12-17  Raja R Harinath  <rharinath@novell.com>
7799
7800         * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs, 
7801           rootcontext.cs, typemanager.cs: Make nomenclature consistent.
7802         "parent" refers to enclosing type/class.  "base" refers to superclass.
7803
7804 2004-12-17  Raja R Harinath  <rharinath@novell.com>
7805
7806         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
7807         Ensure that we only have GlobalAttributes.
7808         * attribute.cs (Attribute.Emit): Make non-virtual.
7809         (GlobalAttribute.Emit): Remove.
7810         (Attribute.Resolve): Make virtual.
7811         (GlobalAttribute.Resolve): New.  Set Rootcontext.Tree.Types.NamespaceEntry.
7812         (Attribute.GetConditionalAttributeValue): Take an EmitContext as
7813         the argument. Don't create one.
7814         (Attribute.GetObsoleteAttribute): Likewise.
7815         (Attribute.GetClsCompliantAttributeValue): Likewise.
7816         * class.cs, decl.cs: Update to changes.
7817
7818 2004-12-17  Marek Safar  <marek.safar@seznam.cz>
7819
7820         * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
7821         
7822         * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
7823         
7824         * statement.cs (Foreach.Resolve): Add error 186 report.
7825
7826 2004-12-16  Marek Safar  <marek.safar@seznam.cz>
7827
7828         * expression.cs (Conditional.DoResolve): Add warning 429.
7829         
7830         * statement.cs (If.Resolve): Add warning 665.
7831
7832 2004-12-16  Raja R Harinath  <rharinath@novell.com>
7833
7834         New invariant: RootContext.Tree.Types.NamespaceEntry == null
7835         except when in the parser, and in GlobalAttribute.
7836         * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
7837         * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
7838         RootContext.Tree.Types.NamespaceEntry once work is done.
7839         (GlobalAttribute.Emit): New.  Wrapper for Attribute.Emit, but sets
7840         and resets RootContext.Tree.Types.NamespaceEntry.
7841
7842 2004-12-15  Marek Safar  <marek.safar@seznam.cz>
7843
7844         * cs-parser.jay: Don't create a block for every variable.
7845
7846 2004-12-14  Miguel de Icaza  <miguel@ximian.com>
7847
7848         * location.cs: Provide extra information.
7849
7850         * statement.cs: The instance is not `ldarg_0.THIS' when accessing
7851         variables from the captured environment, it is the ldarg_0.
7852
7853 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
7854
7855         * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
7856         find a conclusion.
7857         
7858         * class.cs: Changed warning level for 169 to avoid developer
7859         displeasure from warning flooding. It will be changed back when they
7860         fix most of current BCL warnings.
7861         
7862         * RootContext.cs: Pushed default WarningLevel to 3.
7863         
7864         * statement.cs: Removed unused variable.
7865
7866 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
7867
7868         * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
7869         (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
7870         Add error 502 report.
7871         (StaticClass.DefineType): Add error 441 report.
7872         (Class.AllowedModifiersProp): New virtual property as temporary
7873         extension to AllowedModifiers.
7874         (Class.DefineType): Add error 418 report. Moved ModFlags check here
7875         to share implementation with StaticClass and don't call virtual
7876         methods from ctor.
7877         
7878         * driver.cs (MainDriver): Add error 1558 test.
7879
7880         * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
7881         report. Moved error 36 test here.
7882
7883         * statement.cs (Throw.Resolve): Add error 724 report.
7884
7885         * typemanager.cs: Add out_attribute_type core type.
7886         
7887 2004-12-13  Marek Safar  <marek.safar@seznam.cz>
7888
7889         * class.cs (TypeContainer.VerifyClsCompliance): Add error
7890         3018 report.
7891         (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
7892
7893         * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
7894         3017 report.
7895         
7896         * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
7897
7898         * parameter.cs (ReturnParameter.ApplyAttributeBuilder): 
7899         Add error 3023 report.
7900         (Parameter.ApplyAttributeBuilder): Add error 3022 report.
7901
7902         * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
7903         implementation.
7904
7905 2004-12-12  John Luke  <john.luke@gmail.com>
7906
7907         * driver.cs (AddArgs): take -- into account when
7908         adding arguments, fixes bug 65710 
7909
7910 2004-12-12  Martin Baulig  <martin@ximian.com>
7911
7912         * expression.cs (Unary.TryReduceNegative): Added support for
7913         SByteConstant and ByteConstant.
7914         (Unary.Reduce): Check error values from TryReduceNegative().
7915
7916 2004-12-10  Marek Safar  <marek.safar@seznam.cz>
7917
7918         * attributes.cs (Attribute.Resolve): Avoid multiple error report
7919         and report exception as error 182.
7920
7921 2004-12-10  Raja R Harinath  <rharinath@novell.com>
7922
7923         * driver.cs (Main): Fix message when there are warnings.
7924
7925 2004-12-09  Miguel de Icaza  <miguel@ximian.com>
7926
7927         * delegate.cs: Fixed my fix from yesterday, sorry about that.
7928
7929 2004-12-09  Marek Safar  <marek.safar@seznam.cz>
7930
7931         * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs: 
7932         Reduced number of warnings.
7933         
7934         * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
7935
7936 2004-12-08  Miguel de Icaza  <miguel@ximian.com>
7937
7938         * driver.cs: Removed message.
7939
7940         * delegate.cs: Fix bug introduced in 1.1.x: 70219.
7941
7942 2004-12-08    <vargaz@freemail.hu>
7943
7944         * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
7945
7946 2004-12-08  Martin Baulig  <martin@ximian.com>
7947
7948         * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
7949         instead of a CS3002 for properties and indexer.
7950
7951 2004-12-08  Martin Baulig  <martin@ximian.com>
7952
7953         * decl.cs (MemberName.ToString): Make this work again.
7954
7955 2004-12-08  Marek Safar  <marek.safar@seznam.cz>
7956
7957         * attribute.cs (Resolve): Add error 591 detection.
7958
7959         * class.cs (FieldMember.Define): Add error 1547 detection.
7960         (Indexer.Define): Add error 620 detection.
7961         (Operator.Define): Add error 590 detection.
7962
7963         * ecore.cs: Missing argument for error 79.
7964
7965         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
7966         detection.
7967
7968 2004-12-07  Marek Safar  <marek.safar@seznam.cz>
7969
7970         Fix #70106
7971         * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
7972         only.
7973
7974 2004-12-07  Atsushi Enomoto  <atsushi@ximian.com>
7975
7976         * cs-parser.jay : handle doc comments on implicit/explicit operators.
7977           Some operator comments were suppressed.
7978         * doc.cs : Implicit/explicit operator name in doc comments are like
7979           "op_Explicit(type)~returnType", so added suffix handling.
7980
7981 2004-12-07  Martin Baulig  <martin@ximian.com>
7982
7983         * decl.cs
7984         (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
7985         (MemberCore.GetClsCompliantAttributeValue): Likewise.
7986         (DeclSpace.ec): New protected field; store the EmitContext here.
7987         (DeclSpace.EmitContext): New public property; moved here from
7988         `TypeContainer'.
7989         (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
7990         EmitContext.
7991
7992         * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
7993         (Enum.Emit): Don't create a new EmitContext.
7994
7995         * delegate.cs (Delegate.DefineType): Always create the
7996         EmitContext.
7997
7998         * iterators.cs (Iterators.DefineIterator): Create a new
7999         EmitContext and store it in `ec'.
8000
8001 2004-08-24  Martin Baulig  <martin@ximian.com>
8002
8003         * typemanager.cs
8004         (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
8005         this for accessibility checks.
8006         (TypeManager.IsSubclassOrNestedChildOf): Renamed to
8007         IsNestedFamilyAccessible.
8008         (TypeManager.IsSubclassOf): New method, do what the name actually
8009         says.   
8010
8011 2004-12-06  Raja R Harinath  <rharinath@novell.com>
8012
8013         Fix crash on cs0657-17.cs.
8014         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
8015         Use RootContext.Tree.Types, not 'new RootTypes ()'.
8016         * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
8017         the case where the NamespaceEntry gets overwritten.
8018
8019 2004-12-06  Marek Safar  <marek.safar@seznam.cz>
8020
8021         Fixed #69195, #56821
8022         * ecore.cs (ResolveBoolean): Tiny refactoring.
8023
8024         * expression.cs (Binary.DoResolve): Add warning 429 and skipping
8025         of right expression resolving when left is false constant and
8026         operator is LogicalAnd OR true constant and operator is LogicalOr.
8027
8028         * statement.cs (ResolveUnreachable): Always reports warning.
8029
8030 2004-12-05  Miguel de Icaza  <miguel@ximian.com>
8031
8032         * class.cs: Distinguish between 1721 and 1722 (just a little help
8033         for the programmer).
8034
8035 2004-12-03  Miguel de Icaza  <miguel@ximian.com>
8036
8037         * delegate.cs: Only allow this on new versions of the language. 
8038
8039 2004-12-02  Duncan Mak  <duncan@ximian.com>
8040
8041         * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
8042         Expression class.
8043         (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
8044         here as a static method. Take an additional bool out parameter
8045         `must_do_cs1540_check' for signaling to InstanceResolve.
8046         (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
8047         member field from PropertyExpr class and made it an argument of
8048         the method instead.
8049         (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
8050         check for MarshalByRefObject, and report CS0122 instead of CS1540.
8051         (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
8052         and `remove_accessor' as well as InstanceResolve: report CS0122
8053         where applicable.
8054
8055         Fixes #70129.
8056
8057 2004-12-03  Raja R Harinath  <rharinath@novell.com>
8058
8059         Fix test-327.cs, test-328.cs, and put in early infrastructure
8060         for eventually fixing #52697.
8061         * namespace.cs (NamespaceEntry.LookupForUsing): New method.
8062         (NamespaceEntry.LookupNamespaceOrType): New method, refactored
8063         from other methods.
8064         (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
8065         (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
8066         (VerifyUsing, error246): Update.
8067         * rootcontext.cs (RootContext.NamespaceLookup): Just use
8068         'NamespaceEntry.LookupNamespaceOrType'.
8069
8070 2004-12-03  Martin Baulig  <martin@ximian.com>
8071
8072         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
8073         method as our child, call AnonymousMethod.Compatible() on it.
8074
8075 2004-12-03  Raja R Harinath  <rharinath@novell.com>
8076
8077         Disable XML documentation support in 'basic' profile.
8078         * decl.cs, class.cs [BOOTSTRAP_WITH_OLDLIB]: Don't import System.Xml.
8079         Redirect XmlElement to System.Object.
8080         * driver.cs, enum.cs, rootcontext.cs: Don't reference System.Xml.
8081         * doc.cs [BOOTSTRAP_WITH_OLDLIB]: Disable compile.
8082         * mcs.exe.sources: Add doc-bootstrap.cs.
8083         * doc-bootstrap.cs: New file.  Contains empty stub implementation
8084         of doc.cs.
8085
8086 2004-12-03  Atsushi Enomoto  <atsushi@ximian.com>
8087
8088         * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
8089           comments are allowed.
8090
8091 2004-12-03  Carlos Alberto Cortez <calberto.cortez@gmail.com>
8092
8093         * delegate.cs: Add checks for subtypes in paramaters and return values
8094         in VerifyMethod () to add support for Covariance/Contravariance
8095         in delegates.
8096         
8097 2004-12-02  Miguel de Icaza  <miguel@ximian.com>
8098
8099         * report.cs: Remove extra closing parenthesis.
8100
8101         * convert.cs (Error_CannotImplicitConversion): If the name of the
8102         types are the same, provide some extra information.
8103
8104         * class.cs (FieldBase): Use an unused bit field from the field to
8105         encode the `has_offset' property from the FieldMember.  This saves
8106         a couple of Ks on bootstrap compilation.
8107
8108         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
8109         method as our child, return the AnonymousMethod resolved
8110         expression.
8111
8112         * expression.cs (New.DoResolve): Allow return values from
8113         NewDelegate to also include AnonymousMethods.
8114
8115         Fixes #70150.
8116
8117 2004-12-02  Marek Safar  <marek.safar@seznam.cz>
8118
8119         Fix bug #70102
8120         * attribute.cs (Resolve): Improved implementation of params
8121         attribute arguments.
8122
8123         * support.cs (ParameterData): Add HasParams to be faster.
8124
8125 2004-12-02  Atsushi Enomoto  <atsushi@ximian.com>
8126
8127         all things are for /doc support:
8128
8129         * doc.cs: new file that supports XML documentation generation.
8130         * mcs.exe.sources: added doc.cs.
8131         * driver.cs:
8132           Handle /doc command line option.
8133           Report error 2006 instead of 5 for missing file name for /doc.
8134           Generate XML documentation when required, after type resolution.
8135         * cs-tokenizer.cs:
8136           Added support for picking up documentation (/// and /** ... */),
8137           including a new XmlCommentState enumeration.
8138         * cs-parser.jay:
8139           Added lines to fill Documentation element for field, constant,
8140           property, indexer, method, constructor, destructor, operator, event
8141           and class, struct, interface, delegate, enum.
8142           Added lines to warn incorrect comment.
8143         * rootcontext.cs :
8144           Added Documentation field (passed only when /doc was specified).
8145         * decl.cs:
8146           Added DocComment, DocCommentHeader, GenerateDocComment() and
8147           OnGenerateDocComment() and some supporting private members for
8148           /doc feature to MemberCore.
8149         * class.cs:
8150           Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
8151         * delegate.cs:
8152           Added overriden DocCommentHeader.
8153         * enum.cs:
8154           Added overriden DocCommentHeader and GenerateDocComment().
8155
8156 2004-12-01  Miguel de Icaza  <miguel@ximian.com>
8157
8158         * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
8159         unwrapping the enumeration values, chain to
8160         DoConstantNumericPromotions again, so we can promote things to the
8161         fundamental types (takes care of enums that are bytes, sbytes).
8162
8163         Fixes bug #62054.
8164
8165 2004-12-01  Raja R Harinath  <rharinath@novell.com>
8166
8167         * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
8168         Fix long-standing bug in type-lookup.  Use FindType instead of
8169         LookupType when ec.ResolvingTypeTree.
8170         (Attribute.ResolveType, Attribute.Resolve)
8171         (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
8172         Update to changes.
8173         (Attributes.Search): Remove internal version.  Update.
8174         (Attributes.SearchMulti): Update.
8175         (Attributes.GetClsCompliantAttribute): Remove.
8176         (Attributes.GetIndexerNameAttribute): Remove.
8177         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
8178         (DeclSpace.GetClsCompliantAttributeValue): Likewise.
8179         * class.cs (Indexer.Define): Likewise.
8180
8181 2004-12-01  Marek Safar  <marek.safar@seznam.cz>
8182
8183         Fix bug #68790
8184         * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
8185         MarshallByReference members access.
8186
8187         * expression.cs: Use CheckMarshallByRefAccess;
8188         Better error CS0197 message.
8189
8190         * report.cs: Print whole related error message.
8191
8192 2004-11-30  Raja R Harinath  <rharinath@novell.com>
8193
8194         * Makefile (mcs.exe) [PROFILE=default]: Keep a copy of mcs.exe in
8195         the current directory to help debugging.
8196
8197 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
8198
8199         * class (GetClassBases): Better error 60 report.
8200         (EventProperty): Disabled warning 67 detection.
8201
8202 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
8203
8204         Fix bug #60324
8205         * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
8206
8207         * constant.cs (DecimalConstant.Emit): Don't use int ctor for
8208         precise values.
8209
8210 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
8211
8212         Fix bug #49488
8213         * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
8214
8215         * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
8216
8217 2004-11-26  Miguel de Icaza  <miguel@ximian.com>
8218
8219         * attribute.cs (Attribute.Resolve): Refine error reporting and
8220         report a cs0117 if the identifier does not exist, to distinguish
8221         from 0617 which is a miss-use of the actual identifier.
8222
8223         * ecore.cs (EventExpr.Emit): Refine error report and distinguish
8224         between cs0070 and cs0079.
8225
8226         * class.cs (MemberBase.DoDefine): When reporting a wrong
8227         accessibility level, we use MethodCore to compare instead of
8228         Method (this was a regression in some refactoring effort).
8229
8230         So now we correctly report cs0056 again.
8231
8232         * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
8233         testing the target_type (which was known to be object_type) and
8234         not the source type (which is anonymous_method).
8235
8236         Fixed reporting of error cs1660.
8237
8238         * expression.cs (UserCast.Source): Expose the underlying cast.
8239
8240         * statement.cs (Switch.SwitchGoverningType): Sort the list of
8241         allowed types to find a match to int32 first (most common).
8242
8243         In addition, it ignores any ImplicitUserConversions that did an
8244         internal implicit conversion (as the switch statement allows only
8245         one integral conversion to exist).
8246
8247         * class.cs (PartialContainer.Create): rename `name' to
8248         `member_name' for clarity.  Then replace the string calls with a
8249         call to MemberName.GetPartialName, as now using
8250         MemberName.ToString is an error (this is due to the side effects
8251         it had, that were fixed in the past).
8252
8253         This will restore the error reporting on a number of partial class
8254         errors that were missusing this (and getting an exception as a
8255         results, which is now just a plain textual warning, because
8256         yyparse debug output would crash otherwise).
8257
8258 2004-11-26  Raja R Harinath  <rharinath@novell.com>
8259
8260         * Makefile (PROGRAM_INSTALL_DIR): Remove.
8261
8262 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
8263
8264         * rootcontext.cs (LookupType): Make sure to cache lookups that
8265         don't give us a negative result. This saves about 5% of corlib
8266         compilation time.
8267
8268 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
8269
8270         * report.cs (AbstractMessage.Print): messages are sent to stderr
8271
8272         * class.cs (TypeContainer.GetClassBases): It is an error to have a
8273         non-interface in the list of interfaces (at this point, either
8274         parent was properly set, or a base class is being listed in the
8275         interfaces section).
8276
8277         This flags error 1722, and resolves the crash from bug 69259.
8278
8279 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
8280
8281         * statement.cs (Using.EmitExpressionFinally): make this work right
8282         for valuetypes. Fixes 69926.
8283
8284 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
8285
8286         * const.cs (Const.ChangeType): Cope with the "0 literal can be
8287         converted to an enum" here, before we try to change the underlying
8288         type.  This code exists, but it is a different code path than the
8289         one used while encoding constants.
8290
8291         * convert.cs (ImplicitReferenceConversionExists): A surprisingly
8292         old bug: when converting from the null literal to a pointer,
8293         return an EmptyCast, not the NullLiteral.
8294
8295         This fixes #69921, the recent null_type changes probably made this
8296         bug more prominent.
8297
8298         (ImplicitReferenceConversionExists): In addition, resynchronized
8299         the code here, so it matches the same code in
8300         ImplicitReferenceConversionExists for the `from any class-type S
8301         to any interface-type T'.
8302         
8303
8304 2004-11-25  Marek Safar  <marek.safar@seznam.cz>
8305
8306         * cfold.cs (BinaryFold): Add addition for DecimalConstant.
8307
8308 2004-11-24  Miguel de Icaza  <miguel@ximian.com>
8309
8310         * cs-parser.jay: Use verbosity accordingly. 
8311
8312 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
8313
8314         * expression.cs (Unary.ResolveOperator): Do not report warning;
8315         AddressOf reads from variable.
8316         
8317         (LocalVariableReferences.DoResolveBase): Improved my previous fix.
8318
8319 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
8320
8321         Fix bug #69462
8322
8323         * attribute.cs (Attributable): Removed CheckTargets.
8324         (Attributes.Emit): Explicit attribute targets are tested here.
8325
8326         * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
8327         not enabled for interfaces.
8328
8329         * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
8330         (GetAssemblyName): Ouch next bug there.
8331
8332 2004-11-23  Carlos Alberto Cortez <calberto.cortez@gmail.com>
8333
8334         * expression.cs: Error 275 added.
8335         
8336 2004-11-23  Marek Safar  <marek.safar@seznam.cz>
8337
8338         Fix bug #69177 (Implemented decimal constant support)
8339
8340         * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
8341         (BinaryFold): Add DecimalConstant.
8342
8343         * const.cs (Define): Decimal constant 
8344         (is not constant.
8345         (ChangeType): Add decimal type handling.
8346         (LookupConstantValue): Don't set value for decimal type but
8347         emit DecimalConstantAttribute. Needed for constant optimization.
8348
8349         * constant.cs (ToDecimal): New method.
8350         (ConvertToDecimal): New method.
8351         (IntConstant): Implemented ConvertToDecimal.
8352         (DecimalConstant.Emit): Emit optimized version for decimals in
8353         int range.
8354
8355         * expression.cs (ResolveOperator): Changed order of constant
8356         reduction to work correctly with native types which have
8357         overloaded operators.
8358         (ResolveMemberAccess): Extract constant value from attribute
8359         for decimal type.
8360
8361         * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
8362
8363         * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
8364         void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
8365         (ChangeType): Decimal is special.
8366         (TypeToCoreType): Add decimal type.
8367
8368 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
8369
8370         * convert.cs (ImplicitConversionRequired): Add error cs0642 for
8371         decimal types.
8372
8373 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
8374
8375         * class.cs (EventField.ApplyAttributeBuilder): Fix error
8376         test cs1667-5.cs.
8377
8378 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
8379
8380         * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
8381
8382         * pending.cs (PendingImplementation): Grab only interfaces.
8383
8384 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
8385
8386         * statement.cs (ForeachHelperMethods): Add location member and
8387         error 202 detection.
8388
8389 2004-11-19  Raja R Harinath  <rharinath@novell.com>
8390
8391         * Makefile (EXTRA_DISTFILES): Remove mcs.exe.config.  It's
8392         automatically handled by executable.make.
8393         (PROGRAM): Make profile-specific.
8394
8395 2004-11-18  Marek Safar  <marek.safar@seznam.cz>
8396
8397         * expression.cs (DoResolveBase): Fixed wrong warning for out
8398         variables.
8399
8400 2004-11-18  Martin Baulig  <martin@ximian.com>
8401
8402         Merged latest changes into gmcs.  Please keep this comment in
8403         here, it makes it easier for me to see what changed in MCS since
8404         the last time I merged.
8405
8406 2004-11-17  Raja R Harinath  <rharinath@novell.com>
8407
8408         * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
8409         (TypeHandle.GetMemberCache): New.
8410         (TypeHandle.TypeHandle): Update.
8411         (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
8412         (TypeManager.LookupParentInterfacesCache):
8413         Rename from LookupInterfaceCache.  Optimize slightly.
8414         (TypeManager.MemberLookup_FindMembers): Update.
8415         * decl.cs (MemberCache.MemberCache): Set Container to null in the
8416         multi-type variant.
8417         (AddCacheContents): Rename from AddHashtable.
8418         * class.cs (TypeContainer.parent_container): Remove.
8419         (TypeContainer.VerifyClsCompliance): Don't use parent_container.
8420         (TypeContainer.DoDefineMembers): Don't initialize it.
8421         Update to name changes.
8422         
8423 2004-11-17  Miguel de Icaza  <miguel@ximian.com>
8424
8425         * class.cs (MethodCore.CheckAccessModifiers): New helper routine
8426         that factors the code to check access modifiers on override.  
8427
8428         (PropertyBase): Use the code here.
8429
8430         Patch from Lluis S'anchez, fixes bug #69361.
8431
8432 2004-11-15  Miguel de Icaza  <miguel@ximian.com>
8433
8434         * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
8435         routine that is used to report the use of a captured variable
8436         whose address has been taken.
8437
8438         There are two checks: one when variables are being captured and
8439         the other check is when the address of a variable is taken. 
8440         
8441         (because an anonymous methods might be resolved before *or* after
8442         the address has been taken) and 
8443
8444         * expression.cs (Conditional.DoResolve): Remove the special
8445         casing that Martin added to trueExpr and falseExpr being both
8446         NullLiteral.  We get the right behavior now just by introducing
8447         the null_type into the compiler. 
8448
8449         * convert.cs (ExplicitConversion): Change the code to use
8450         null_type instead of testing `expr is NullLiteral'.
8451         (ImplicitConversionStandard): use null_type too.
8452         (ImplicitReferenceConversionExists): use null_type too.
8453         (ImplicitReferenceConversion): use null_type too.
8454
8455         * literal.cs: The type of `NullLiteral' is now null_type instead
8456         of object_type. 
8457         (Resolve): Set the type here.
8458
8459         * typemanager.cs: Introduce null_type.
8460
8461 2004-11-17  Martin Baulig  <martin@ximian.com>
8462
8463         * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
8464         direction, like FindMembers() does.  Fixes #69546, testcase is in
8465         test-315.cs.    
8466
8467 2004-11-16  Martin Baulig  <martin@ximian.com>
8468
8469         This is based on a patch from Marek Safar, see bug #69082.
8470         Fixes bugs #63705 and #67130.
8471
8472         * typemanager.cs (TypeManager.LookupInterfaceCache): New public
8473         method; create a MemberCache for an interface type and cache the
8474         result.
8475
8476         * decl.cs (IMemberContainer.ParentContainer): Removed.
8477         (IMemberContainer.ParentCache): New property.
8478         (MemberCache.SetupCacheForInterface): Removed.
8479         (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
8480         to create a cache for an interface's "parent".
8481
8482         * class.cs (TypeContainer.DoDefineMembers): Setup cache for
8483         interfaces too.
8484
8485 2004-11-16  Martin Baulig  <martin@ximian.com>
8486
8487         Merged back from gmcs; these changes already went into gmcs a
8488         couple of weeks ago.
8489
8490         * typemanager.cs
8491         (TypeManager.AddUserType): Removed the `ifaces' argument.
8492         (TypeManager.RegisterBuilder): Take a `Type []' instead of a
8493         `TypeExpr []'.
8494         (TypeManager.AddUserInterface): Removed.
8495         (TypeManager.ExpandInterfaces): Return a `Type []' instead of a
8496         `TypeExpr []'.
8497         (TypeManager.GetInterfaces): Likewise.
8498         (TypeManager.GetExplicitInterfaces): Likewise.
8499
8500         * ecore.cs (TypeExpr.GetInterfaces): Removed.
8501
8502         * class.cs (TypeContainer.base_class_type): Replaced with `ptype'.
8503         (TypeContainer.base_inteface_types): Replaced with `ifaces'.
8504
8505 2004-11-14  Ben Maurer  <bmaurer@ximian.com>
8506
8507         * statement.cs: Avoid adding bools to a hashtable.
8508
8509 2004-11-07  Miguel de Icaza  <miguel@ximian.com>
8510
8511         * expression.cs (Invocation.OverloadResolve): Flag error if we are
8512         calling an unsafe method from a safe location.
8513
8514 2004-11-06  Marek Safar  <marek.safar@seznam.cz>
8515
8516         Fix #69167
8517         * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
8518
8519 2004-11-06  Miguel de Icaza  <miguel@ximian.com>
8520
8521         * namespace.cs (VerifyUsing): use GetPartialName instead of
8522         ToString. 
8523
8524 2004-11-05  Miguel de Icaza  <miguel@ximian.com>
8525
8526         * statement.cs (Return.Resolve): Fix regression in typo: if
8527         `in_exc', we have to request a NeedReturnLabel, this was a typo
8528         introduced in the anonymous method check-in.  Fixes #69131.
8529
8530         * Indexers were using the ShortName when defining themselves,
8531         causing a regression in the compiler bootstrap when applying the
8532         patch from 2004-11-02 (first part), now they use their full name
8533         and the bug is gone.
8534
8535 2004-11-04  Zoltan Varga  <vargaz@freemail.hu>
8536
8537         * driver.cs: Strip the path from the names of embedded resources. Fixes
8538         #68519.
8539
8540 2004-11-04  Raja R Harinath  <rharinath@novell.com>
8541
8542         Fix error message regression: cs0104-2.cs.
8543         * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
8544         (AliasEntry.Resolve): Update.
8545         * rootcontext.cs (RootContext.NamespaceLookup): Update.  Remove
8546         'silent' flag.
8547         (RootContext.LookupType): Update.
8548
8549 2004-11-03  Carlos Alberto Cortez <carlos@unixmexico.org>
8550
8551         * cs-parser.jay: Add support for handling accessor modifiers
8552         * class: Add support port accessor modifiers and error checking,
8553         define PropertyMethod.Define as virtual (not abstract anymore)
8554         * ecore.cs: Add checking for proeprties access with access modifiers
8555         * iterators.cs: Modify Accessor constructor call based in the modified
8556         constructor
8557 2004-11-02  Ben Maurer  <bmaurer@ximian.com>
8558
8559         * expression.cs (StringConcat): Handle being called twice,
8560         as when we have a concat in a field init with more than two
8561         ctors in the class
8562
8563 2004-11-02  Miguel de Icaza  <miguel@ximian.com>
8564
8565         * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
8566         special case explicit implementations, we should always produce
8567         the .property or .event declaration.
8568         
8569         * decl.cs (MemberName): Renamed GetFullName to GetPartialName
8570         since it will not return correct data if people use this
8571         unresolved in the presence of using statements (see test-313).
8572
8573         * class.cs (MethodData.Define): If we are an explicit interface
8574         implementation, set the method name to the full name of the
8575         interface plus the name of the method.  
8576
8577         Notice that using the method.MethodName.GetFullName() does not
8578         work, as it will only contain the name as declared on the source
8579         file (it can be a shorthand in the presence of using statements)
8580         and not the fully qualifed type name, for example:
8581
8582         using System;
8583
8584         class D : ICloneable {
8585                 object ICloneable.Clone ()  {
8586                 }
8587         }
8588
8589         Would produce a method called `ICloneable.Clone' instead of
8590         `System.ICloneable.Clone'.
8591
8592         * namespace.cs (Alias.Resolve): Use GetPartialName.
8593         
8594 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
8595
8596         * cs-parser.jay: Add error 1055 report.
8597
8598 2004-11-01  Miguel de Icaza  <miguel@ximian.com>
8599
8600         * assign.cs (Assign.DoResolve): Only do the transform of
8601         assignment into a New if the types are compatible, if not, fall
8602         through and let the implicit code deal with the errors and with
8603         the necessary conversions. 
8604
8605 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
8606
8607         * cs-parser.jay: Add error 1031 report.
8608
8609         * cs-tokenizer.cs: Add location for error 1038.
8610
8611 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
8612
8613         * cs-parser.jay: Add error 1016 report.
8614
8615 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
8616
8617         * cs-parser.jay: Add errors 1575,1611 report.
8618
8619 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
8620
8621         * cs-parser.jay: Add error 1001 report.
8622
8623 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
8624
8625         Fix #68850
8626         * attribute.cs (GetMarshal): Add method argument for
8627         caller identification.
8628
8629         * class.cs, codegen.cs, enum.cs, parameter.cs: Added
8630         agument for GetMarshal and RuntimeMissingSupport.
8631
8632 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
8633
8634         * attribute.cs (ExtractSecurityPermissionSet): Removed
8635         TypeManager.code_access_permission_type.
8636
8637         * typemanager.cs: Removed TypeManager.code_access_permission_type.
8638
8639 2004-10-27  Miguel de Icaza  <miguel@ximian.com>
8640
8641         * expression.cs (LocalVariableReference.DoResolveLValue): Check
8642         for obsolete use of a variable here.   Fixes regression on errors
8643         cs0619-25 and cs0619-26.
8644
8645 2004-10-27  Marek Safar  <marek.safar@seznam.cz>
8646
8647         Fix #62358, implemented security attribute encoding.
8648
8649         * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
8650         Tests permitted SecurityAction for assembly or other types.
8651         (Assembly.ExtractSecurityPermissionSet): New method. Transforms
8652         data from SecurityPermissionAttribute to PermisionSet class.
8653
8654         * class.cs (ApplyAttributeBuilder): Added special handling
8655         for System.Security.Permissions.SecurityAttribute based types.
8656
8657         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
8658         special handling for System.Security.Permissions.SecurityAttribute
8659         based types.
8660
8661         * enum.cs (ApplyAttributeBuilder): Added special handling
8662         for System.Security.Permissions.SecurityAttribute based types.
8663
8664         * parameter.cs (ApplyAttributeBuilder): Added special handling
8665         for System.Security.Permissions.SecurityAttribute based types.
8666
8667         * rootcontext.cs: Next 2 core types.
8668
8669         * typemanager.cs (TypeManager.security_permission_attr_type):
8670         Built in type for the SecurityPermission Attribute.
8671         (code_access_permission_type): Build in type.
8672
8673 2004-10-17  Miguel de Icaza  <miguel@ximian.com>
8674
8675         * expression.cs (LocalVariableReference.DoResolveBase, Emit):
8676         Remove the tests for `ec.RemapToProxy' from here, and encapsulate
8677         all of this information into
8678         EmitContext.EmitCapturedVariableInstance.
8679         
8680         * codegen.cs (EmitCapturedVariableInstance): move here the
8681         funcionality of emitting an ldarg.0 in the presence of a
8682         remapping.   This centralizes the instance emit code.
8683
8684         (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
8685         then emit a load of this: it means that we have reached the
8686         topmost ScopeInfo: the one that contains the pointer to the
8687         instance of the class hosting the anonymous method.
8688
8689         * anonymous.cs (AddField, HaveCapturedFields): Propagate field
8690         captures to the topmost CaptureContext.
8691
8692 2004-10-12  Miguel de Icaza  <miguel@ximian.com>
8693
8694         * expression.cs (LocalVariableReference): Move the knowledge about
8695         the iterators into codegen's EmitCapturedVariableInstance.
8696
8697 2004-10-11  Miguel de Icaza  <miguel@ximian.com>
8698
8699         * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
8700         all code paths return a value from an anonymous method (it is the
8701         same as the 161 error, but for anonymous methods).
8702
8703 2004-10-08  Miguel de Icaza  <miguel@ximian.com>
8704
8705         The introduction of anonymous methods in the compiler changed
8706         various ways of doing things in the compiler.  The most
8707         significant one is the hard split between the resolution phase
8708         and the emission phases of the compiler.
8709
8710         For instance, routines that referenced local variables no
8711         longer can safely create temporary variables during the
8712         resolution phase: they must do so from the emission phase,
8713         since the variable might have been "captured", hence access to
8714         it can not be done with the local-variable operations from the runtime.
8715         
8716         * statement.cs 
8717
8718         (Block.Flags): New flag `IsTopLevel' to indicate that this block
8719         is a toplevel block.
8720
8721         (ToplevelBlock): A new kind of Block, these are the blocks that
8722         are created by the parser for all toplevel method bodies.  These
8723         include methods, accessors and anonymous methods.
8724
8725         These contain some extra information not found in regular blocks:
8726         A pointer to an optional CaptureContext (for tracking captured
8727         local variables and parameters).  A pointer to the parent
8728         ToplevelBlock.
8729         
8730         (Return.Resolve): Catch missmatches when returning a value from an
8731         anonymous method (error 1662).
8732         Invoke NeedReturnLabel from the Resolve phase instead of the emit
8733         phase.
8734
8735         (Break.Resolve): ditto.
8736
8737         (SwitchLabel): instead of defining the labels during the
8738         resolution phase, we now turned the public ILLabel and ILLabelCode
8739         labels into methods called GetILLabelCode() and GetILLabel() that
8740         only define the label during the Emit phase.
8741
8742         (GotoCase): Track the SwitchLabel instead of the computed label
8743         (its contained therein).  Emit the code by using
8744         SwitchLabel.GetILLabelCode ().
8745
8746         (LocalInfo.Flags.Captured): A new flag has been introduce to track
8747         whether the Local has been captured or not.
8748
8749         (LocalInfo.IsCaptured): New property, used to tell whether the
8750         local has been captured.
8751         
8752         * anonymous.cs: Vastly updated to contain the anonymous method
8753         support.
8754
8755         The main classes here are: CaptureContext which tracks any
8756         captured information for a toplevel block and ScopeInfo used to
8757         track the activation frames for various local variables.   
8758
8759         Each toplevel block has an optional capture context associated
8760         with it.  When a method contains an anonymous method both the
8761         toplevel method and the anonymous method will create a capture
8762         context.   When variables or parameters are captured, they are
8763         recorded on the CaptureContext that owns them, for example:
8764
8765         void Demo () {
8766              int a;
8767              MyDelegate d = delegate {
8768                  a = 1;
8769              }
8770         }
8771
8772         Here `a' will be recorded as captured on the toplevel
8773         CapturedContext, the inner captured context will not have anything
8774         (it will only have data if local variables or parameters from it
8775         are captured in a nested anonymous method.
8776
8777         The ScopeInfo is used to track the activation frames for local
8778         variables, for example:
8779
8780         for (int i = 0; i < 10; i++)
8781                 for (int j = 0; j < 10; j++){
8782                    MyDelegate d = delegate {
8783                         call (i, j);
8784                    }
8785                 }
8786
8787         At runtime this captures a single captured variable `i', but it
8788         captures 10 different versions of the variable `j'.  The variable
8789         `i' will be recorded on the toplevel ScopeInfo, while `j' will be
8790         recorded on a child.  
8791
8792         The toplevel ScopeInfo will also track information like the `this'
8793         pointer if instance variables were referenced (this is necessary
8794         as the anonymous method lives inside a nested class in the host
8795         type of the method). 
8796
8797         (AnonymousMethod): Expanded to track the Toplevel, implement
8798         `AnonymousMethod.Compatible' to tell whether an anonymous method
8799         can be converted to a target delegate type. 
8800
8801         The routine now also produces the anonymous method content
8802
8803         (AnonymousDelegate): A helper class that derives from
8804         DelegateCreation, this is used to generate the code necessary to
8805         produce the delegate for the anonymous method that was created. 
8806
8807         * assign.cs: API adjustments for new changes in
8808         Convert.ImplicitStandardConversionExists.
8809
8810         * class.cs: Adjustments to cope with the fact that now toplevel
8811         blocks are of type `ToplevelBlock'. 
8812
8813         * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
8814         insteda of standard blocks.
8815
8816         Flag errors if params arguments are passed to anonymous methods.
8817
8818         * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
8819         `CurrentAnonymousMethod' which points to the current Anonymous
8820         Method.  The variable points to the AnonymousMethod class that
8821         holds the code being compiled.  It is set in the new EmitContext
8822         created for the anonymous method.
8823
8824         (EmitContext.Phase): Introduce a variable and an enumeration to
8825         assist in enforcing some rules about when and where we are allowed
8826         to invoke certain methods (EmitContext.NeedsReturnLabel is the
8827         only one that enfonces this right now).
8828
8829         (EmitContext.HaveCaptureInfo): new helper method that returns
8830         whether we have a CapturedContext initialized.
8831
8832         (EmitContext.CaptureVariable): New method used to register that a
8833         LocalInfo must be flagged for capturing. 
8834
8835         (EmitContext.CapturedParameter): New method used to register that a
8836         parameters must be flagged for capturing. 
8837         
8838         (EmitContext.CapturedField): New method used to register that a
8839         field must be flagged for capturing. 
8840
8841         (EmitContext.HaveCapturedVariables,
8842         EmitContext.HaveCapturedFields): Return whether there are captured
8843         variables or fields. 
8844
8845         (EmitContext.EmitMethodHostInstance): This is used to emit the
8846         instance for the anonymous method.  The instance might be null
8847         (static methods), this (for anonymous methods that capture nothing
8848         and happen to live side-by-side with the current method body) or a
8849         more complicated expression if the method has a CaptureContext.
8850
8851         (EmitContext.EmitTopBlock): Routine that drives the emission of
8852         code: it will first resolve the top block, then emit any metadata
8853         and then emit the code.  The split is done so that we can extract
8854         any anonymous methods and flag any captured variables/parameters.
8855         
8856         (EmitContext.ResolveTopBlock): Triggers the resolution phase,
8857         during this phase, the ILGenerator should not be used as labels
8858         and local variables declared here might not be accessible to any
8859         code that is part of an anonymous method.  
8860
8861         Exceptions to this include the temporary variables that are
8862         created by some statements internally for holding temporary
8863         variables. 
8864         
8865         (EmitContext.EmitMeta): New routine, in charge of emitting all the
8866         metadata for a cb
8867
8868         (EmitContext.TemporaryReturn): This method is typically called
8869         from the Emit phase, and its the only place where we allow the
8870         ReturnLabel to be defined other than the EmitMeta.  The reason is
8871         that otherwise we would have to duplicate a lot of logic in the
8872         Resolve phases of various methods that today is on the Emit
8873         phase. 
8874
8875         (EmitContext.NeedReturnLabel): This no longer creates the label,
8876         as the ILGenerator is not valid during the resolve phase.
8877
8878         (EmitContext.EmitThis): Extended the knowledge in this class to
8879         work in anonymous methods in addition to iterators. 
8880
8881         (EmitContext.EmitCapturedVariableInstance): This emits whatever
8882         code is necessary on the stack to access the instance to a local
8883         variable (the variable will be accessed as a field).
8884
8885         (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
8886         EmitContext.EmitAddressOfParameter): Routines to support
8887         parameters (not completed at this point). 
8888         
8889         Removals: Removed RemapLocal and RemapLocalLValue.  We probably
8890         will also remove the parameters.
8891
8892         * convert.cs (Convert): Define a `ConstantEC' which points to a
8893         null.  This is just to prefity some code that uses
8894         ImplicitStandardConversion code and do not have an EmitContext
8895         handy.
8896
8897         The idea is to flag explicitly that at that point in time, it is
8898         known that the conversion will not trigger the delegate checking
8899         code in implicit conversions (which requires a valid
8900         EmitContext). 
8901
8902         Everywhere: pass new EmitContext parameter since
8903         ImplicitStandardConversionExists now requires it to check for
8904         anonymous method conversions. 
8905
8906         (Convert.ImplicitStandardConversionExists): If the type of an
8907         expression is the anonymous_method_type, and the type is a
8908         delegate, we invoke the AnonymousMethod.Compatible method to check
8909         whether an implicit conversion is possible. 
8910
8911         (Convert.ImplicitConversionStandard): Only do implicit method
8912         group conversions if the language level is not ISO_1.
8913
8914         * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
8915         MethodInfo for the Invoke method.  used by Delegate and
8916         AnonymousDelegate.
8917
8918         * expression.cs (Binary.DoNumericPromotions): only allow anonymous
8919         method conversions if the target type is a delegate.
8920
8921         Removed extra debugging nops.
8922
8923         (LocalVariableReference): Turn the `local_info' into a public
8924         field. 
8925
8926         Add `prepared' field, the same hack used for FieldExprs to cope
8927         with composed assignments, as Local variables do not necessarily
8928         operate purely on the stack as they used to: they can be captured
8929         fields. 
8930
8931         Add `temp' for a temporary result, like fields.
8932
8933         Refactor DoResolve and DoResolveLValue into DoResolveBase.
8934
8935         It now copes with Local variables that are captured and emits the
8936         proper instance variable to load it from a field in the captured
8937         case. 
8938
8939         (ParameterReference.DoResolveBase): During the resolve phase,
8940         capture parameters if we are in an anonymous method.
8941
8942         (ParameterReference.Emit, ParameterReference.AddressOf): If in an
8943         anonymous method, use the EmitContext helper routines to emit the
8944         parameter reference.
8945
8946         * iterators.cs: Set RemapToProxy to true/false during the
8947         EmitDispose class.
8948
8949         * parameters.cs (GetParameterByName): New helper method. 
8950
8951         * typemanager.cs (anonymous_method_type) a new type that
8952         represents an anonyous method.  This is always an internal type,
8953         used as a fencepost to test against the anonymous-methodness of an
8954         expression. 
8955         
8956 2004-10-20  Marek Safar  <marek.safar@seznam.cz>
8957
8958         * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
8959         561 report.
8960         (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
8961
8962 2004-10-18  Martin Baulig  <martin@ximian.com>
8963
8964         * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
8965         `Type' directly, but call ResolveType() on it.
8966         (Catch.Resolve): Likewise.
8967         (Foreach.Resolve): Likewise.
8968
8969 2004-10-18  Martin Baulig  <martin@ximian.com>
8970
8971         * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
8972         `Type' directly, but call ResolveType() on it.
8973         (Probe.DoResolve): Likewise.
8974         (ArrayCreation.LookupType): Likewise.
8975         (TypeOf.DoResolve): Likewise.
8976         (SizeOf.DoResolve): Likewise.
8977
8978 2004-10-18  Martin Baulig  <martin@ximian.com>
8979
8980         * expression.cs (Invocation.BetterFunction): Put back
8981         TypeManager.TypeToCoreType().
8982
8983 2004-10-18  Raja R Harinath  <rharinath@novell.com>
8984
8985         * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
8986         the ResolveType.
8987
8988 2004-10-18  Martin Baulig  <martin@ximian.com>
8989
8990         * parameter.cs (Parameter.Resolve):  Don't access the TypeExpr's
8991         `Type' directly, but call ResolveType() on it.
8992
8993 2004-10-18  Martin Baulig  <martin@ximian.com>
8994
8995         * class.cs (FieldMember.Define): Don't access the TypeExpr's
8996         `Type' directly, but call ResolveType() on it.
8997         (MemberBase.DoDefine): Likewise.
8998
8999         * expression.cs (New.DoResolve): Don't access the TypeExpr's
9000         `Type' directly, but call ResolveType() on it.
9001         (ComposedCast.DoResolveAsTypeStep): Likewise.
9002
9003         * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
9004         `Type' directly, but call ResolveType() on it.
9005
9006 2004-10-17  John Luke  <john.luke@gmail.com>
9007
9008         * class.cs (Operator.GetSignatureForError): use CSharpName
9009
9010         * parameter.cs (Parameter.GetSignatureForError): Returns
9011         correct name even if was not defined.
9012
9013 2004-10-13  Raja R Harinath  <rharinath@novell.com>
9014
9015         Fix #65816.
9016         * class.cs (TypeContainer.EmitContext): New property.
9017         (DefineNestedTypes): Create an emitcontext for each part.
9018         (MethodCore.DoDefineParameters): Use container's emitcontext.
9019         Pass type array to InternalParameters.
9020         (MemberBase.DoDefine): Use container's emitcontext.
9021         (FieldMember.Define): Likewise.
9022         (Event.Define): Likewise.
9023         (SetMethod.GetParameterInfo): Change argument to EmitContext.
9024         Pass type array to InternalParameters.
9025         (SetIndexerMethod.GetParameterInfo): Likewise.
9026         (SetMethod.Define): Pass emitcontext to GetParameterInfo.
9027         * delegate.cs (Define): Pass emitcontext to
9028         ComputeAndDefineParameterTypes and GetParameterInfo.  Pass type
9029         array to InternalParameters.
9030         * expression.cs (ParameterReference.DoResolveBase): Pass
9031         emitcontext to GetParameterInfo.
9032         (ComposedCast.DoResolveAsTypeStep): Remove check on
9033         ec.ResolvingTypeTree.
9034         * parameter.cs (Parameter.Resolve): Change argument to
9035         EmitContext.  Use ResolveAsTypeTerminal.
9036         (Parameter.GetSignature): Change argument to EmitContext.
9037         (Parameters.ComputeSignature): Likewise.
9038         (Parameters.ComputeParameterTypes): Likewise.
9039         (Parameters.GetParameterInfo): Likewise.
9040         (Parameters.ComputeAndDefineParameterTypes): Likewise.
9041         Re-use ComputeParameterTypes.  Set ec.ResolvingTypeTree.
9042         * support.cs (InternalParameters..ctor): Remove variant that takes
9043         a DeclSpace.
9044         * typemanager.cs (system_intptr_expr): New.
9045         (InitExpressionTypes): Initialize it.
9046
9047 2004-10-12  Chris Toshok  <toshok@ximian.com>
9048
9049         * cs-parser.jay: fix location for try_statement and catch_clause.
9050
9051 2004-10-11  Martin Baulig  <martin@ximian.com>
9052
9053         * report.cs: Don't make --fatal abort on warnings, we have
9054         -warnaserror for that.
9055
9056 2004-10-07  Raja R Harinath  <rharinath@novell.com>
9057
9058         More DeclSpace.ResolveType avoidance.
9059         * decl.cs (MemberCore.InUnsafe): New property.
9060         * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal 
9061         with newly created EmitContext.
9062         (FieldMember.Define): Likewise.
9063         * delegate.cs (Delegate.Define): Likewise.
9064         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
9065         only if normal name-lookup fails.
9066         (TypeExpr.DoResolve): Enable error-checking.
9067         * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
9068         (SizeOf.DoResolve): Likewise.
9069         (ComposedCast.DoResolveAsTypeStep): Likewise.
9070         (StackAlloc.DoResolve): Likewise.
9071         * statement.cs (Block.Flags): Add new flag 'Unsafe'.
9072         (Block.Unsafe): New property.
9073         (Block.EmitMeta): Set ec.InUnsafe as appropriate.
9074         (Unsafe): Set 'unsafe' flag of contained block.
9075         (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
9076         (Fixed.Resolve): Likewise.
9077         (Catch.Resolve): Likewise.
9078         (Using.ResolveLocalVariableDecls): Likewise.
9079         (Foreach.Resolve): Likewise.
9080
9081 2004-10-05  John Luke <john.luke@gmail.com>
9082
9083         * cs-parser.jay: add location to error CS0175
9084
9085 2004-10-04  Miguel de Icaza  <miguel@ximian.com>
9086
9087         * ecore.cs (Expression.Constantity): Add support for turning null
9088         into a constant.
9089
9090         * const.cs (Const.Define): Allow constants to be reference types
9091         as long as the value is Null.
9092
9093 2004-10-04  Juraj Skripsky  <js@hotfeet.ch>
9094
9095         * namespace.cs (NamespaceEntry.Using): No matter which warning
9096         level is set, check if this namespace name has already been added.
9097
9098 2004-10-03 Ben Maurer  <bmaurer@ximian.com>
9099
9100         * expression.cs: reftype [!=]= null should always use br[true,false].
9101         # 67410
9102
9103 2004-10-03  Marek Safar  <marek.safar@seznam.cz>
9104
9105         Fix #67108
9106         * attribute.cs: Enum conversion moved to 
9107         GetAttributeArgumentExpression to be applied to the all
9108         expressions.
9109
9110 2004-10-01  Raja R Harinath  <rharinath@novell.com>
9111
9112         Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
9113         * class.c (TypeContainer.DefineType): Flag error if
9114         base types aren't accessible due to access permissions.
9115         * decl.cs (DeclSpace.ResolveType): Move logic to
9116         Expression.ResolveAsTypeTerminal.
9117         (DeclSpace.ResolveTypeExpr): Thin layer over
9118         Expression.ResolveAsTypeTerminal.
9119         (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
9120         Refactor code into NestedAccess.  Use it.
9121         (DeclSpace.NestedAccess): New.
9122         * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
9123         argument to silence errors.  Check access permissions.
9124         (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
9125         * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
9126         (Cast.DoResolve): Likewise.
9127         (New.DoResolve): Likewise.
9128         (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
9129         (TypeOf.DoResolve): Likewise.
9130
9131         * expression.cs (Invocation.BetterConversion): Return the Type of
9132         the better conversion.  Implement section 14.4.2.3 more faithfully.
9133         (Invocation.BetterFunction): Make boolean.  Make correspondence to
9134         section 14.4.2.2 explicit.
9135         (Invocation.OverloadResolve): Update.
9136         (Invocation): Remove is_base field.
9137         (Invocation.DoResolve): Don't use is_base.  Use mg.IsBase.
9138         (Invocation.Emit): Likewise.
9139
9140 2004-09-27  Raja R Harinath  <rharinath@novell.com>
9141
9142         * README: Update to changes.
9143
9144 2004-09-24  Marek Safar  <marek.safar@seznam.cz>
9145
9146         * cs-parser.jay: Reverted 642 warning fix.
9147
9148 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
9149
9150         Fix bug #66615
9151         * decl.cs (FindMemberWithSameName): Indexer can have more than
9152         1 argument.
9153
9154 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
9155
9156         * expression.cs (LocalVariableReference.DoResolveLValue):
9157         Do not report warning 219 for out values.
9158         (EmptyExpression.Null): New member to avoid extra allocations.
9159
9160 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
9161
9162         * cs-parser.jay: Fix wrong warning 642 report.
9163
9164         * cs-tokenizer.cs (CheckNextToken): New helper;
9165         Inspect next character if is same as expected.
9166
9167 2004-09-23  Martin Baulig  <martin@ximian.com>
9168
9169         * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
9170         (Convert.ImplicitReferenceConversionExists): Likewise.
9171
9172 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
9173
9174         * class.cs (Operator.Define): Add error 448 and 559 report.
9175
9176 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
9177
9178         * class.cs (MemberBase.IsTypePermitted): New protected
9179         method for checking error CS0610.
9180
9181 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
9182
9183         * class.cs (TypeContainer.HasExplicitLayout): New property
9184         Returns whether container has StructLayout attribute set Explicit.
9185         (FieldMember): New abstract class for consts and fields.
9186         (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
9187         (Field): Reuse FieldMember.
9188
9189         * const.cs (Const): Reuse FieldMember.
9190
9191         * rootcontext.cs: EmitConstants call moved to class.
9192
9193 2004-09-22  Martin Baulig  <martin@ximian.com>
9194
9195         Thanks to Peter Sestoft for this bug report.
9196
9197         * expression.cs (Conditional): If both the `trueExpr' and the
9198         `falseExpr' is a NullLiteral, return a NullLiteral.
9199
9200 2004-09-22  Martin Baulig  <martin@ximian.com>
9201
9202         * statement.cs (Foreach.EmitCollectionForeach): If we're in an
9203         iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
9204         for the "get_Current" call.
9205
9206 2004-09-22  Martin Baulig  <martin@ximian.com>
9207
9208         Marek and me just fixed one of our oldest bugs: #28562 :-)
9209
9210         * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
9211
9212         * attribute.cs (Attribute.GetAttributeArgumentExpression): If
9213         we're an EnumConstant, just return that.
9214         (Attribute.Resolve): GetAttributeArgumentExpression() may give us
9215         an EnumConstant.  In this case, we need to use GetValueAsEnumType()
9216         to get the value which'll actually be written into the attribute.
9217         However, we have to use GetValue() to access the attribute's value
9218         in the compiler.        
9219
9220 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
9221
9222         * constant.cs (Constant.IsNegative): New abstract property
9223         IsNegative.
9224
9225         * expression.cs (ArrayAccess.DoResolve): Add warning 251.
9226         (StackAlloc.DoResolve): Reused IsNegative.
9227
9228 2004-09-21  Martin Baulig  <martin@ximian.com>
9229
9230         * codegen.cs (VariableStorage): Don't store the ILGenerator here;
9231         if we're used in an iterator, we may be called from different
9232         methods.
9233
9234         * statement.cs (Foreach.EmitFinally): Only emit an `Endfinally' if
9235         we actually have an exception block.
9236
9237 2004-09-20  John Luke <jluke@cfl.rr.com>
9238
9239         * class.cs, cs-parser.jay: Improve the error report for 1520:
9240         report the actual line where the error happens, not where the
9241         class was declared.
9242
9243         * assign.cs, delegate.cs, ecore.cs, expression.cs, statement.cs:
9244         Pass location information that was available elsewhere.
9245
9246 2004-09-19  Sebastien Pouliot  <sebastien@ximian.com>
9247
9248         * codegen.cs: Fix bug #56621. It is now possible to use MCS on the MS
9249         runtime to delay sign assemblies.
9250
9251 2004-09-19  Miguel de Icaza  <miguel@ximian.com>
9252
9253         * cs-parser.jay: Do not report the stack trace, this is barely
9254         used nowadays.
9255
9256 2004-08-22  John Luke  <john.luke@gmail.com>
9257  
9258         * driver.cs : check that a resource id is not already used
9259         before adding it, report CS1508 if it is, bug #63637
9260
9261 2004-09-19  Miguel de Icaza  <miguel@ximian.com>
9262
9263         * ecore.cs: Removed dead code.
9264
9265 2004-09-18  Marek Safar  <marek.safar@seznam.cz>
9266
9267         * class.cs: Do not report warning CS0067 on the interfaces.
9268
9269 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
9270
9271         * cs-parser.jay: Add error 504 report.
9272
9273 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
9274
9275         * rootcontext.cs: WarningLevel is 4 by default now.
9276
9277         * statement.cs (Fixed.Resolve): Do not null
9278         VariableInfo.
9279
9280 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
9281
9282         Fixed bug #55780
9283         * ecore.cs (PropertyExpr.FindAccessors): Do not perform
9284         deep search when property is not virtual.
9285         (PropertyExpr.ResolveAccessors): Make one call for both
9286         accessors.
9287
9288 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
9289
9290         Fixed bug #65766
9291         * statement.cs: Error 152 report constains also location.
9292
9293 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
9294
9295         Fixed bug #65766
9296         * const.cs: Explicitly set constant as static.
9297
9298 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
9299
9300         Fixed bug #64226
9301         * cs-parser.jay: Add error 1017 report.
9302
9303 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
9304
9305         Fixed bug #59980, #64224
9306         * expression.cs (Invocation.DoResolve): Fixed error CS0571 test.
9307
9308         * typemanager.cs (IsSpecialMethod): Simplified
9309
9310 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
9311
9312         * decl.cs (MemberCore.Emit): Resuscitated VerifyObsoleteAttribute
9313         condition with better params.
9314
9315 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
9316
9317         Fixed bug #65238
9318         * attribute.cs (Resolve): Property has to have both
9319         accessors.
9320
9321 2004-09-14  Martin Baulig  <martin@ximian.com>
9322
9323         * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
9324
9325 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
9326
9327         Fixed bug #61902
9328         * codegen.cs (TestObsoleteMethodUsage): Trace when method is
9329         called and is obsolete then this member suppress message
9330         when call is inside next [Obsolete] method or type.
9331
9332         * expression.cs: Use TestObsoleteMethodUsage member.
9333
9334 2004-09-14  Martin Baulig  <martin@ximian.com>
9335
9336         * cs-parser.jay: Sync a bit with the GMCS version.
9337
9338 2004-09-14  Martin Baulig  <martin@ximian.com>
9339
9340         * cs-parser.jay (CSharpParser): Don't derive from GenericsParser.
9341         (CSharpParser.yacc_verbose_flag): New public field.
9342
9343         * genericparser.cs: Removed.
9344
9345 2004-09-14  Raja R Harinath  <rharinath@novell.com>
9346
9347         * cs-parser.jay (event_declaration): Re-enable cs0071 error.
9348
9349 2004-09-13  Marek Safar  <marek.safar@seznam.cz>
9350
9351         * class.cs (MethodCore.CheckBase): Fix bug #65757.
9352
9353 2004-09-10  Martin Baulig  <martin@ximian.com>
9354
9355         Backported my MemberName changes from GMCS into MCS.
9356
9357         - we are now using a special `MemberName' class instead of using
9358         strings; in GMCS, the `MemberName' also contains the type
9359         arguments.
9360
9361         - changed the grammar rules a bit:
9362           * the old `member_name' is now a `namespace_or_type_name':
9363             The rule is that we use `namespace_or_type_name' everywhere
9364             where we expect either a "member name" (GetEnumerator) or a
9365             "member name" with an explicit interface name
9366             (IEnumerable.GetEnumerator).
9367             In GMCS, the explicit interface name may include type arguments
9368             (IEnumerable<T>.GetEnumerator).
9369           * we use `member_name' instead of just `IDENTIFIER' for
9370             "member names":
9371             The rule is that we use `member_name' wherever a member may
9372             have type parameters in GMCS.       
9373
9374         * decl.cs (MemberName): New public class.
9375         (MemberCore.MemberName): New public readonly field.
9376         (MemberCore.ctor): Take a `MemberName' argument, not a string.
9377         (DeclSpace): Likewise.
9378
9379         * delegate.cs (Delegate.ctor): Take a MemberName, not a string.
9380         * enum.cs (Enum.ctor): Likewise.
9381
9382         * namespace.cs (AliasEntry.Alias): Changed type from Expression to
9383         MemberName.     
9384         (AliasEntry.ctor): Take a MemberName, not an Expression.
9385         (AliasEntry.UsingAlias): Likewise.
9386
9387         * class.cs (TypeContainer.ctor): Take a MemberName, not a string.
9388         (IMethodData.MemberName): Changed type from string to MemberName.
9389         (MemberBase.ExplicitInterfaceName): Likewise.
9390         (AbstractPropertyEventMethod.SetupName): Make this private.
9391         (AbstractPropertyEventMethod.ctor): Added `string prefix'
9392         argument; compute the member name here.
9393         (AbstractPropertyEventMethod.UpdateName): Recompute the name based
9394         on the `member.MemberName' and the `prefix'.
9395
9396         * cs-parser.jay (attribute_name): Use `namespace_or_type_name',
9397         not `type_name'.
9398         (struct_declaration): Use `member_name' instead of `IDENTIFIER';
9399         thus, we get a `MemberName' instead of a `string'.  These
9400         declarations may have type parameters in GMCS.
9401         (interface_method_declaration, delegate_declaration): Likewise.
9402         (class_declaration, interface_declaration): Likewise.
9403         (method_header): Use `namespace_or_type_name' instead of
9404         `member_name'.  We may be an explicit interface implementation.
9405         (property_declaration, event_declaration): Likewise.
9406         (member_name): This is now just an `IDENTIFIER', not a
9407         `namespace_or_type_name'.
9408         (type_name, interface_type): Removed.
9409         (namespace_or_type_name): Return a MemberName, not an Expression.
9410         (primary_expression): Use `member_name' instead of `IDENTIFIER';
9411         call GetTypeExpression() on the MemberName to get an expression.
9412         (IndexerDeclaration.interface_type): Changed type from string to
9413         MemberName.
9414         (MakeName): Operate on MemberName's instead of string's.
9415
9416 2004-09-13  Raja R Harinath  <rharinath@novell.com>
9417
9418         Fix bug #55770.
9419         * namespace.cs (AliasEntry.Resolve): Implement section 16.3.1.
9420         (NamespaceEntry.Lookup): Add new argument to flag if we want the
9421         lookup to avoid symbols introduced by 'using'.
9422         * rootcontext.cs (NamespaceLookup): Update.
9423
9424 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
9425
9426         * class.cs (TypeContainer.DoDefineMembers): Do not call
9427         DefineDefaultConstructor for static classes.
9428
9429 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
9430
9431         * attribute.cs (Attribute.Resolve): Add error 653 report.
9432
9433         * class.cs (Class.ApplyAttributeBuilder): Add error 641
9434         report.
9435         (Method.ApplyAttributeBuilder): Add error 685 report.
9436         (Operator.Define): Add error 564 report.
9437
9438         * cs-tokenizer.cs (handle_hex): Add error 1013 report.
9439
9440         * expression.cs (Invocation.DoResolve): Add error
9441         245 and 250 report.
9442
9443         * parameter.cs (Parameter.ApplyAttributeBuilder): Add
9444         error 674 report.
9445
9446 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
9447
9448         * class.cs (ConstructorInitializer.Resolve):
9449         Wrong error number (515->516).
9450
9451 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
9452
9453         * class.cs (Indexer.Define): Add error 631 report.
9454
9455 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
9456
9457         * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
9458
9459 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
9460
9461         * expression.cs (Probe.DoResolve): Add error CS0241 report.
9462
9463 2004-09-10  Marek Safar  <marek.safar@seznam.cz>
9464
9465         * cs-parser.jay: Added error CS0241 report.
9466
9467 2004-09-10  Raja R Harinath  <rharinath@novell.com>
9468
9469         * cs-parser.jay (fixed_statement): Introduce a scope for the
9470         declaration in the 'fixed' statement.
9471
9472 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
9473
9474         * cs-parser.jay: Added CS0230 error report.
9475
9476 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
9477
9478         * cs-parser.jay: Added errors CS0231 and CS0257 report.
9479
9480 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
9481
9482         * expression.cs (Argument.Resolve): Added error CS0192 and
9483         CS0199 report.
9484
9485 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
9486
9487         C# 2.0 #pragma warning feature
9488
9489         * cs-tokenizer.cs (PreProcessPragma): New method; 
9490         Handles #pragma directive.
9491
9492         * report.cs (WarningRegions): New class; Support
9493         class for #pragma warning directive. It tests whether
9494         warning is enabled for a given line.
9495
9496 2004-09-08  Miguel de Icaza  <miguel@ximian.com>
9497
9498         * const.cs: Add more descriptive error report, tahnks to
9499         Sebastien. 
9500
9501 2004-09-08  Marek Safar  <marek.safar@seznam.cz>
9502
9503         * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
9504
9505 2004-09-07  Miguel de Icaza  <miguel@ximian.com>
9506
9507         * expression.cs: Apply patch from Ben: Remove dead code from
9508         ArrayCreation, and remove the TurnintoConstant call in const.cs,
9509         as that code just threw an exception anwyays.
9510
9511         * const.cs: Remove the call to the turnintoconstant, for details
9512         see bug: #63144
9513         
9514         * literal.cs: The type of the null-literal is the null type;  So
9515         we use a placeholder type (literal.cs:System.Null, defined here)
9516         for it.
9517
9518         * expression.cs (Conditional.DoResolve): Remove some old code that
9519         is no longer needed, conversions have been fixed.
9520
9521         (ArrayCreationExpression.DoResolve): Return false if we fail to
9522         resolve the inner expression.
9523
9524 2004-09-07  Raja R Harinath  <rharinath@novell.com>
9525
9526         Fix test-290.cs.
9527         * cs-parser.jay (delegate_declaration): Record a delegate
9528         declaration as a type declaration.
9529         Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
9530
9531 2004-09-06  Miguel de Icaza  <miguel@ximian.com>
9532
9533         * parameter.cs: Do not crash if the type can not be resolved. 
9534
9535         * expression.cs: Report errors with unsafe pointers, fixes #64896
9536
9537 2004-09-06 Ben Maurer  <bmaurer@users.sourceforge.net>
9538
9539         * expression.cs: Pointer arith always needs to do a conv.i
9540         if the operand is a long. fix 65320
9541
9542 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
9543
9544         Fixed cs0619-37.cs, cs0619-38.cs
9545
9546         * enum.cs (GetObsoleteAttribute): Removed.
9547
9548         * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
9549         on Enum member is double staged. The first is tested member
9550         and then enum.
9551
9552 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
9553
9554         Fixed #56986, #63631, #65231
9555
9556         * class.cs: (TypeContainer.AddToMemberContainer): New method,
9557         adds member to name container.
9558         (TypeContainer.AddToTypeContainer): New method, adds type to
9559         name container.
9560         (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
9561         AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
9562         AddOperator): Simplified by reusing AddToMemberContainer.
9563         (TypeContainer.UserDefinedStaticConstructor): Changed to property
9564         instead of field.
9565         (Method.CheckForDuplications): Fixed implementation to test all
9566         possibilities.
9567         (MemberBase): Detection whether member is explicit interface
9568         implementation is now in constructor.
9569         (MemberBase.UpdateMemberName): Handles IndexerName.
9570         (Accessor): Changed to keep also location information.
9571         (AbstractPropertyEventMethod): Is derived from MemberCore.
9572         (AbstractPropertyEventMethod.IsDummy): Says whether accessor
9573         will be emited or not.
9574         (PropertyBase.AreAccessorsDuplicateImplementation):
9575         Tests whether accessors are not in collision with some method.
9576         (Operator): Is derived from MethodCore to simplify common
9577         operations.
9578
9579         * decl.cs (Flags.TestMethodDuplication): Test for duplication
9580         must be performed.
9581         (DeclSpace.AddToContainer): Adds the member to defined_names
9582         table. It tests for duplications and enclosing name conflicts.
9583
9584         * enum.cs (EnumMember): Clean up to reuse the base structures
9585
9586 2004-09-03  Martin Baulig  <martin@ximian.com>
9587
9588         * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
9589         into TypeContainer, to make partial classes work again.
9590
9591 2004-09-03  Martin Baulig  <martin@ximian.com>
9592
9593         * rootcontext.cs (RootContext.V2): Removed.
9594
9595 2004-03-23  Martin Baulig  <martin@ximian.com>
9596
9597         * expression.cs (Invocation.OverloadResolve): Added `bool
9598         may_fail' argument and use it instead of the Location.IsNull() hack.
9599
9600 2004-09-03  Martin Baulig  <martin@ximian.com>
9601
9602         Merged latest changes into gmcs.  Please keep this comment in
9603         here, it makes it easier for me to see what changed in MCS since
9604         the last time I merged.
9605
9606 2004-09-03  Raja R Harinath  <rharinath@novell.com>
9607
9608         Fix #61128.
9609         * expression.cs (BetterConversion): Don't allow either conversion 
9610         to be null.  Remove redundant implicit conversion test when 'q ==
9611         null' -- when this function is invoked, we already know that the
9612         implicit conversion exists.
9613         (BetterFunction): Assume that 'best' is non-null.  Remove
9614         redundant reimplementation of IsApplicable when 'best' is null.
9615         (IsParamsMethodApplicable, IsApplicable): Add new parameter for
9616         number of arguments.
9617         (IsAncestralType): Extract from OverloadResolve.
9618         (OverloadResolve): Make robust to the MethodGroupExpr being
9619         unsorted.  Implement all the logic of Section 14.5.5.1, and
9620         support overloading of methods from multiple applicable types.
9621         Clean up logic somewhat.  Don't pass null methods to BetterFunction.
9622
9623         * report.cs (SymbolRelatedToPreviousError): Cleanup output.
9624         (RealError, Warning): Append type of report to related symbol.
9625
9626 2004-09-03  Marek Safar  <marek.safar@seznam.cz>
9627
9628         * enum.cs: Fixed CLS-Compliance checks for enum members.
9629         Error tests cs3008-8.cs, cs3014-8.cs
9630
9631 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
9632
9633         Fixed bug #62342, #63102
9634         * class.cs: ImplementIndexer uses member.IsExplicitImpl
9635         like ImplementMethod.
9636
9637 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
9638
9639         * attribute.cs (Attribute.GetAttributeArgumentExpression):
9640         Fixed bug #65170.
9641
9642 2004-09-02  Martin Baulig  <martin@ximian.com>
9643
9644         * statement.cs (Using.EmitLocalVariableDeclFinally): Use
9645         TypeManager.GetArgumentTypes() rather than calling GetParameters()
9646         on the MethodBase.
9647
9648 2004-09-01  Marek Safar  <marek.safar@seznam.cz>
9649
9650         C# 2.0 Static classes implemented
9651
9652         * class.cs (TypeContainer): instance_constructors,
9653         initialized_fields, initialized_static_fields,
9654         default_constructor, base_inteface_types are protected to be
9655         accessible from StaticClass.
9656         (TypeContainer.DefineDefaultConstructor): New virtual method
9657         for custom default constructor generating
9658         (StaticClass): New class to handle "Static classes" feature.
9659
9660         * cs-parser.jay: Handle static keyword on class like instance
9661         of StaticClass.
9662
9663         * driver.cs: Added "/langversion" command line switch with two
9664         options (iso-1, default).
9665
9666 2004-08-31  Marek Safar  <marek.safar@seznam.cz>
9667
9668         * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
9669
9670 2004-08-31  Miguel de Icaza  <miguel@ximian.com>
9671
9672         * delegate.cs: Style.
9673
9674 2004-08-31 Ben Maurer  <bmaurer@users.sourceforge.net>
9675
9676         * delegate.cs: Add seperate instance expr field for miguel.
9677
9678 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
9679
9680         * PointerArithmetic (Resolve): make sure we are not doing
9681         pointer arith on void*. Also, make sure we are resolved
9682         by not setting eclass until resolve.
9683
9684         All callers: Make sure that PointerArithmetic gets resolved.
9685
9686 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
9687
9688         * ArrayCreation (LookupType): If the type does not resolve 
9689         to an array, give an error.
9690
9691 2004-08-27  Marek Safar  <marek.safar@seznam.cz>
9692
9693         * statement.cs (Try.Resolve): Fixed bug #64222
9694
9695 2004-08-27  Martin Baulig  <martin@ximian.com>
9696
9697         * class.cs
9698         (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
9699         crash here.     
9700
9701 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
9702
9703         * ecore.cs (Constantify): Get underlying type via
9704         System.Enum.GetUnderlyingType to avoid StackOverflow on the
9705         Windows in special cases.
9706
9707 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
9708
9709         * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
9710         for obtaining also private methods.
9711         (GetRemoveMethod): Used GetRemoveMethod (true)
9712         for obtaining also private methods.
9713
9714 2004-08-24  Martin Baulig  <martin@ximian.com>
9715
9716         * class.cs (Method.Define): Set MethodAttributes.SpecialName and
9717         MethodAttributes.HideBySig for operators.
9718
9719 2004-08-23  Martin Baulig  <martin@ximian.com>
9720
9721         Back to the old error reporting system :-)
9722
9723         * report.cs (Message): Removed.
9724         (Report.MessageData, ErrorData, WarningData): Removed.
9725         (Report.Error, Warning): Back to the old system.
9726
9727 2004-08-23  Martin Baulig  <martin@ximian.com>
9728
9729         * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
9730
9731         * class.cs (TypeContainer.ParentContainer): New public virtual
9732         method; replaces the explicit interface implementation.
9733         (ClassPart.ParentContainer): Override.
9734
9735 2004-08-23  Martin Baulig  <martin@ximian.com>
9736
9737         * statement.cs (Switch): Added support for constant switches; see
9738         #59428 or test-285.cs.
9739
9740 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
9741
9742         Fixed bug #62740.
9743         * statement.cs (GetEnumeratorFilter): Removed useless
9744         logic because C# specs is strict. GetEnumerator must be
9745         public.
9746
9747 2004-08-22  Martin Baulig  <martin@ximian.com>
9748
9749         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
9750         a switch and may break, reset the barrier.  Fixes #59867.
9751
9752 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
9753
9754         CLS-Compliance speed up (~5% for corlib)
9755
9756         * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
9757         New method. Tests container for CLS-Compliant names
9758
9759         * class.cs (TypeContainer.VerifyClsName): New method.
9760         Checks whether container name is CLS Compliant.
9761         (Constructor): Implements IMethodData.
9762
9763         * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
9764         low-case table for CLS Compliance test.
9765         (MemberCache.VerifyClsParameterConflict): New method.
9766         Checks method parameters for CS3006 error.
9767
9768         * enum.cs (EnumMember): Is derived from MemberCore.
9769         (Enum.VerifyClsName): Optimized for better performance.
9770
9771 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
9772
9773         * report.cs: Renamed Error_T to Error and changed all
9774         references.
9775
9776 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
9777
9778         * class.cs (TypeContainer.IndexerArrayList): New inner class
9779         container for indexers.
9780         (TypeContainer.DefaultIndexerName): New constant for default
9781         indexer name. Replaced all "Item" with this constant.
9782         (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
9783
9784         * typemanager.cs (TypeManager.default_member_ctor): Cache here
9785         DefaultMemberAttribute constructor.
9786
9787 2004-08-05  Martin Baulig  <martin@ximian.com>
9788
9789         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
9790         Fix bug #59429.
9791
9792 2004-08-05  Marek Safar  <marek.safar@seznam.cz>
9793
9794         * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
9795         multi platforms problem.
9796
9797         * compiler.csproj: Included shared files.
9798
9799 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
9800
9801         Fix bug 60333, 55971 in the more general way
9802         * attribute.cs (Attribute.GetAttributeArgumentExpression):
9803         Added arg_type argument for constant conversion.
9804         (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
9805
9806 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
9807
9808         Fix bug #59760
9809         * class.cs (TypeContainer ): New inner classes MethodArrayList, 
9810         OperatorArrayList, MethodCoreArrayList for typecontainer
9811         containers. Changed class member types to these new types.
9812         (MethodArrayList.DefineMembers): Added test for CS0659.
9813
9814 2004-08-04  Miguel de Icaza  <miguel@ximian.com>
9815
9816         * cfold.cs: Synchronize the folding with the code in expression.cs
9817         Binary.DoNumericPromotions for uint operands.
9818
9819         * attribute.cs: Revert patch from Raja, it introduced a regression
9820         while building Blam-1.2.1 (hard to isolate a test case).
9821
9822 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
9823
9824         Fix for #55382
9825         * class.cs:
9826         (TypeContainer.Define): Renamed to DefineContainerMembers because of
9827         name collision.
9828         (MethodCore.parent_method): New member. The method we're overriding
9829         if this is an override method.
9830         (MethodCore.CheckBase): Moved from Method class and made common.
9831         (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
9832         private.
9833         (MethodCore.CheckForDuplications): New abstract method. For custom
9834         member duplication search in a container
9835         (MethodCore.FindOutParentMethod): New abstract method. Gets parent
9836         method and its return type.
9837         (Event.conflict_symbol): New member. Symbol with same name in the
9838         parent class.
9839
9840         * decl.cs:
9841         (MemberCache.FindMemberWithSameName): New method. The method
9842         is looking for conflict with inherited symbols.
9843
9844 2004-08-04  Martin Baulig  <martin@ximian.com>
9845
9846         * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
9847
9848         * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
9849
9850 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
9851
9852         * report.cs (Message): New enum for better error, warning reference in
9853         the code.
9854         (MessageData): New inner abstract class. It generally handles printing of
9855         error and warning messages.
9856         Removed unused Error, Warning, Message methods.
9857
9858 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
9859
9860         Fix for cs0592-8.cs test
9861         * attribute.cs
9862         (Attributable.ValidAttributeTargets): Made public.
9863         (Attribute.ExplicitTarget): New member for explicit target value.
9864         (Attribute.CheckTargets): Now we translate explicit attribute
9865         target to Target here.
9866
9867 2004-08-03  Ben Maurer  <bmaurer@ximian.com>
9868
9869         * ecore.cs (MethodGroupExpr): new IsBase property.
9870
9871         * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
9872
9873         * delegate.cs (DelegateCreation): store a MethodGroupExpr
9874         rather than an instance expr.
9875
9876         (DelegateCreation.Emit): Use the method group rather than
9877         the instance expression. Also, if you have base.Foo as the
9878         method for a delegate, make sure to emit ldftn, not ldftnvirt.
9879
9880         (ResolveMethodGroupExpr): Use the MethodGroupExpr. 
9881
9882         (NewDelegate.DoResolve): Only check for the existance of Invoke
9883         if the method is going to be needed. Use MethodGroupExpr.
9884
9885         (NewDelegate.Emit): Remove, DelegateCreation implements this.   
9886
9887         * expression.cs: For pointer arith., make sure to use
9888         the size of the type, not the size of the pointer to
9889         the type.
9890
9891 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
9892
9893         Fix for #60722
9894         * class.cs (Class): Added error CS0502 test.
9895
9896 2004-08-03  John Luke  <jluke@cfl.rr.com>
9897             Raja R Harinath  <rharinath@novell.com>
9898
9899         Fix for #60997.
9900         * attribute.cs (Attribute.complained_before): New flag.
9901         (Attribute.ResolveType, Attribute.Resolve),
9902         (Attribute.DefinePInvokeMethod): Set it.
9903         (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
9904         
9905 2004-08-03  Martin Baulig  <martin@ximian.com>
9906
9907         * expression.cs (Binary.ResolveOperator): Don't abort if we can't
9908         use a user-defined operator; we still need to do numeric
9909         promotions in case one argument is a builtin type and the other
9910         one has an implicit conversion to that type.  Fixes #62322.
9911
9912 2004-08-02  Martin Baulig  <martin@ximian.com>
9913
9914         * statement.cs (LocalInfo.Flags): Added `IsThis'.
9915         (LocalInfo.IsThis): New public property.
9916         (Block.EmitMeta): Don't create a LocalBuilder for `this'.
9917
9918 2004-08-01  Martin Baulig  <martin@ximian.com>
9919
9920         * class.cs (TypeContainer.GetClassBases): Don't set the default
9921         here since we may get called from GetPartialBases().
9922         (TypeContainer.DefineType): If GetClassBases() didn't return a
9923         parent, use the default one.
9924
9925 2004-07-30  Duncan Mak  <duncan@ximian.com>
9926
9927         * Makefile (mcs2.exe, mcs3.exe): add $(EXTRA_SOURCES).
9928
9929 2004-07-30  Martin Baulig  <martin@ximian.com>
9930
9931         * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
9932
9933         * class.cs (SourceMethod): New public class, derive from the
9934         symbol writer's ISourceMethod.
9935         (Method): Use the new symbol writer API.
9936
9937         * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
9938         as argument and use the new symbol writer.
9939
9940         * location.cs
9941         (SourceFile): Implement the symbol writer's ISourceFile.
9942         (Location.SymbolDocument): Removed.
9943         (Location.SourceFile): New public property.
9944
9945         * symbolwriter.cs: Use the new symbol writer API.
9946
9947 2004-07-30  Raja R Harinath  <rharinath@novell.com>
9948
9949         * Makefile (install-local): Remove.  Functionality moved to
9950         executable.make.
9951
9952 2004-07-28  Lluis Sanchez Gual  <lluis@novell.com>
9953
9954         * Makefile: Install mcs.exe.config file together with mcs.exe.
9955         * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
9956         correct runtime version.
9957         
9958 2004-07-25  Martin Baulig  <martin@ximian.com>
9959
9960         * class.cs
9961         (TypeContainer.RegisterOrder): Removed, this was unused.
9962         (TypeContainer, interface_order): Removed.
9963         (TypeContainer.AddClass, AddStruct, AddInterface): Take a
9964         TypeContainer as argument since we can also be called with a
9965         `PartialContainer' for a partial class/struct/interface.
9966         (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
9967         of checking whether we're an `Interface' - we could be a
9968         `PartialContainer'.
9969         (PartialContainer.Register): Override; call
9970         AddClass()/AddStruct()/AddInterface() on our parent.
9971
9972         * cs-parser.jay (interface_member_declaration): Add things to the
9973         `current_container', not the `current_class'.
9974
9975         * rootcontext.cs (RegisterOrder): The overloaded version which
9976         takes an `Interface' was unused, removed.
9977
9978         * typemanager.cs (TypeManager.LookupInterface): Return a
9979         `TypeContainer', not an `Interface'.
9980         (TypeManager.IsInterfaceType): The `builder_to_declspace' may
9981         contain a `PartialContainer' for an interface, so check it's
9982         `Kind' to figure out what it is.
9983
9984 2004-07-25  Martin Baulig  <martin@ximian.com>
9985
9986         * class.cs (Class.DefaultTypeAttributes): New public constant.
9987         (Struct.DefaultTypeAttributes): Likewise.
9988         (Interface.DefaultTypeAttributes): Likewise.
9989         (PartialContainer.TypeAttr): Override this and add the
9990         DefaultTypeAttributes.
9991
9992 2004-07-25  Martin Baulig  <martin@ximian.com>
9993
9994         * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
9995         we can just use the `Parent' field instead.
9996
9997 2004-07-25  Martin Baulig  <martin@ximian.com>
9998
9999         * class.cs (TypeContainer.Emit): Renamed to EmitType().
10000
10001 2004-07-25  Martin Baulig  <martin@ximian.com>
10002
10003         * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
10004         our parts before defining any methods.
10005         (TypeContainer.VerifyImplements): Make this virtual.
10006         (ClassPart.VerifyImplements): Override and call VerifyImplements()
10007         on our PartialContainer.
10008
10009 2004-07-25  Martin Baulig  <martin@ximian.com>
10010
10011         * iterators.cs (Iterator.Define): Renamed to DefineIterator().
10012
10013         * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
10014         argument, we can just use the `Parent' field instead.
10015
10016         * class.cs
10017         (MemberBase.CheckBase): Removed the `TypeContainer' argument.   
10018         (MemberBase.DoDefine): Likewise.
10019
10020 2004-07-24  Martin Baulig  <martin@ximian.com>
10021
10022         * decl.cs (MemberCore.Parent): New public field.
10023         (DeclSpace.Parent): Moved to MemberCore.
10024
10025         * class.cs (MethodCore.ds): Removed; use `Parent' instead.
10026         (MemberBase.ctor): Added TypeContainer argument, pass it to our
10027         parent's .ctor.
10028         (FieldBase, Field, Operator): Likewise.
10029         (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
10030         (EventField, Event): Likewise.
10031
10032 2004-07-23  Martin Baulig  <martin@ximian.com>
10033
10034         * class.cs (PartialContainer): New public class.
10035         (ClassPart): New public class.
10036         (TypeContainer): Added support for partial classes.
10037         (TypeContainer.GetClassBases): Splitted some of the functionality
10038         out into GetNormalBases() and GetPartialBases().
10039
10040         * cs-tokenizer.cs (Token.PARTIAL): New token.
10041         (Tokenizer.consume_identifier): Added some hacks to recognize
10042         `partial', but only if it's immediately followed by `class',
10043         `struct' or `interface'.
10044
10045         * cs-parser.jay: Added support for partial clases.
10046
10047 2004-07-23  Martin Baulig  <martin@ximian.com>
10048
10049         * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
10050         a `DeclSpace' and also made it readonly.
10051         (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
10052         (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
10053         (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
10054
10055         * cs-parser.jay: Pass the `current_class', not the
10056         `current_container' (at the moment, this is still the same thing)
10057         to a new Method, Property, Event, Indexer or Constructor.
10058
10059 2004-07-23  Martin Baulig  <martin@ximian.com>
10060
10061         * cs-parser.jay (CSharpParser): Added a new `current_class' field
10062         and removed the `current_interface' one.
10063         (struct_declaration, class_declaration, interface_declaration):
10064         Set `current_class' to the newly created class/struct/interface;
10065         set their `Bases' and call Register() before parsing their body.
10066
10067 2004-07-23  Martin Baulig  <martin@ximian.com>
10068
10069         * class.cs (Kind): New public enum.
10070         (TypeContainer): Made this class abstract.
10071         (TypeContainer.Kind): New public readonly field.
10072         (TypeContainer.CheckDef): New public method; moved here from
10073         cs-parser.jay.
10074         (TypeContainer.Register): New public abstract method.
10075         (TypeContainer.GetPendingImplementations): New public abstract
10076         method.
10077         (TypeContainer.GetClassBases): Removed the `is_class' and
10078         `is_iface' parameters.
10079         (TypeContainer.DefineNestedTypes): Formerly known as
10080         DoDefineType().
10081         (ClassOrStruct): Made this class abstract.
10082
10083         * tree.cs (RootTypes): New public type. 
10084
10085 2004-07-20  Martin Baulig  <martin@ximian.com>
10086
10087         * tree.cs (Tree.RecordNamespace): Removed.
10088         (Tree.Namespaces): Removed.
10089
10090         * rootcontext.cs (RootContext.IsNamespace): Removed.
10091
10092         * cs-parser.jay (namespace_declaration): Just create a new
10093         NamespaceEntry here.
10094
10095 2004-07-20  Martin Baulig  <martin@ximian.com>
10096
10097         * statement.cs (ExceptionStatement): New abstract class.  This is
10098         now used as a base class for everyone who's using `finally'.
10099         (Using.ResolveLocalVariableDecls): Actually ResolveLValue() all
10100         our local variables before using them.
10101
10102         * flowanalysis.cs (FlowBranching.StealFinallyClauses): New public
10103         virtual method.  This is used by Yield.Resolve() to "steal" an
10104         outer block's `finally' clauses.
10105         (FlowBranchingException): The .ctor now takes an ExceptionStatement
10106         argument.
10107
10108         * codegen.cs (EmitContext.StartFlowBranching): Added overloaded
10109         version which takes an ExceptionStatement.  This version must be
10110         used to create exception branchings.
10111
10112         * iterator.cs
10113         (Yield.Resolve): "Steal" all `finally' clauses from containing blocks.
10114         (Iterator.EmitMoveNext): Added exception support; protect the
10115         block with a `fault' clause, properly handle 'finally' clauses.
10116         (Iterator.EmitDispose): Run all the `finally' clauses here.
10117
10118 2004-07-20  Martin Baulig  <martin@ximian.com>
10119
10120         * iterator.cs: This is the first of a set of changes in the
10121         iterator code.  Match the spec more closely: if we're an
10122         IEnumerable, then GetEnumerator() must be called.  The first time
10123         GetEnumerator() is called, it returns the current instance; all
10124         subsequent invocations (if any) must create a copy.
10125
10126 2004-07-19  Miguel de Icaza  <miguel@ximian.com>
10127
10128         * expression.cs: Resolve the constant expression before returning
10129         it. 
10130
10131 2004-07-19  Martin Baulig  <martin@ximian.com>
10132
10133         * iterators.cs (Iterator.MapVariable): Don't define fields twice.
10134         (Iterator.MoveNextMethod.DoEmit): Use `TypeManager.int32_type' as
10135         the return type of the new EmitContext.
10136
10137 2004-07-18  Martin Baulig  <martin@ximian.com>
10138
10139         * class.cs (Property.Define): Fix iterators.
10140
10141         * iterators.cs (Iterator.Define): Moved the
10142         `container.AddInterator (this)' call here from the .ctor; only do
10143         it if we resolved successfully.
10144
10145 2004-07-17  Miguel de Icaza  <miguel@ximian.com>
10146
10147         * cs-tokenizer.cs (handle_preprocessing_directive): Do not return
10148         `true' for preprocessing directives that we parse.  The return
10149         value indicates whether we should return to regular tokenizing or
10150         not, not whether it was parsed successfully.
10151
10152         In the past if we were in: #if false ... #line #endif, we would
10153         resume parsing after `#line'.  See bug 61604.
10154
10155         * typemanager.cs: Removed an old hack from Gonzalo to get corlib
10156         building: IsEnumType should return true only for enums, not for
10157         enums or System.Enum itself.  This fixes #61593.
10158
10159         Likely what happened is that corlib was wrong: mcs depended on
10160         this bug in some places.  The bug got fixed, we had to add the
10161         hack, which caused bug 61593.
10162
10163         * expression.cs (ArrayAccess.GetStoreOpCode): Remove an old hack
10164         that was a workaround for the older conditions.
10165
10166 2004-07-16  Ben Maurer  <bmaurer@ximian.com>
10167
10168         * assign.cs: IAssignMethod has a new interface, as documented
10169         inline. All assignment code now uses this new api.
10170
10171         * ecore.cs, expression.cs: All classes which implement
10172         IAssignMethod now use the new interface.
10173
10174         * expression.cs (Invocation): add a hack to EmitCall so that
10175         IndexerAccess can be the target of a compound assignment without
10176         evaluating its arguments twice.
10177
10178         * statement.cs: Handle changes in Invocation api.
10179
10180 2004-07-16  Martin Baulig  <martin@ximian.com>
10181
10182         * iterators.cs: Rewrote this.  We're now using one single Proxy
10183         class for both the IEnumerable and the IEnumerator interface and
10184         `Iterator' derives from Class so we can use the high-level API.
10185
10186         * class.cs (TypeContainer.AddIterator): New method.
10187         (TypeContainer.DoDefineType): New protected virtual method, which
10188         is called from DefineType().
10189         (TypeContainer.DoDefineMembers): Call DefineType() and
10190         DefineMembers() on all our iterators.
10191         (TypeContainer.Emit): Call Emit() on all our iterators.
10192         (TypeContainer.CloseType): Call CloseType() on all our iterators.
10193
10194         * codegen.cs (EmitContext.CurrentIterator): New public field.
10195
10196 2004-07-15  Martin Baulig  <martin@ximian.com>
10197
10198         * typemanager.cs
10199         (TypeManager.not_supported_exception_type): New type.   
10200
10201 2004-07-14  Martin Baulig  <martin@ximian.com>
10202
10203         * iterators.cs: Use real error numbers.
10204
10205 2004-07-14  Martin Baulig  <martin@ximian.com>
10206
10207         * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
10208         requires this to be a System.Collection.IEnumerable and not a
10209         class implementing that interface.
10210         (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.      
10211
10212 2004-07-13  Marek Safar  <marek.safar@seznam.cz>
10213
10214         * class.cs: Fixed previous fix, it broke some error tests.
10215
10216 2004-07-12  Martin Baulig  <martin@ximian.com>
10217
10218         * enum.cs (Enum.Define): Call Emit() to emit the attributes.
10219         Fixes #61293.
10220
10221 2004-07-09  Miguel de Icaza  <miguel@ximian.com>
10222
10223         * assign.cs (LocalTemporary): Add new argument: is_address,If
10224         `is_address' is true, then the value that we store is the address
10225         to the real value, and not the value itself.
10226         
10227         * ecore.cs (PropertyExpr): use the new local temporary
10228         stuff to allow us to handle X.Y += z (where X is a struct)
10229
10230 2004-07-08  Martin Baulig  <martin@ximian.com>
10231
10232         * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
10233         not always return, just like we're doing in Using.Resolve().
10234
10235 2004-07-07  Miguel de Icaza  <miguel@ximian.com>
10236
10237         * cs-parser.jay (fixed_statement): flag this as Pinned.
10238
10239 2004-07-06  Miguel de Icaza  <miguel@ximian.com>
10240
10241         * typemanager.cs (TypeManager): Removed MakePinned method, this
10242         mechanism is replaced with the .NET 2.x compatible mechanism of
10243         calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
10244
10245         * statement.cs (LocalInfo): Remove MakePinned, add Pinned property 
10246         Rename `Fixed' to `Pinned' as a flag, to distinguish from the
10247         `IsFixed' property which has a different meaning.
10248
10249 2004-07-02  Raja R Harinath  <rharinath@novell.com>
10250
10251         * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
10252         visible from inside a nested class, not just the names of the
10253         immediately enclosing class.
10254         Fix for bug #60730.
10255
10256 2004-06-24  Raja R Harinath  <rharinath@novell.com>
10257
10258         * expression.cs (BetterConversion): Remove buggy special-case
10259         handling of "implicit constant expression conversions".  At this
10260         point, we already know that the conversion is possible -- we're
10261         only checking to see which is better.
10262
10263 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
10264
10265         * cs-parser.jay: Added error CS0210 test.
10266
10267 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
10268
10269         * cs-parser.jay: Added error CS0134 test.
10270
10271 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
10272
10273         Fix bug #52507
10274         * cs-parser.jay: Added error CS0145 test.
10275
10276 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
10277
10278         * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
10279
10280 2004-06-23  Ben Maurer  <bmaurer@ximian.com>
10281         
10282         * expression.cs (StackAlloc.Resolve): The argument may not
10283         be a constant; deal with this case.
10284         
10285 2004-06-23  Marek Safar  <marek.safar@seznam.cz>
10286
10287         * attribute.cs (IndexerName_GetIndexerName): Renamed to
10288         GetIndexerAttributeValue.
10289         (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
10290
10291         * class.cs (Indexer.Define): Added error tests for CS0415,
10292         CS0609.
10293
10294 2004-06-23  Miguel de Icaza  <miguel@ximian.com>
10295
10296         * attribute.cs (Attribute.Resolve): Keep field code in sync with
10297         property code.
10298
10299 2004-06-23  Martin Baulig  <martin@ximian.com>
10300
10301         * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
10302         neither return nor throw, reset the barrier as well.  Fixes #60457.
10303
10304 2004-06-22  Atsushi Enomoto  <atsushi@ximian.com>
10305
10306         * class.cs : EventAttributes is now set to None by default.
10307           This fixes bug #60459.
10308
10309 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
10310
10311         Fix bug #60219
10312         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
10313         Don't throw exception but return null (it's sufficient now).
10314
10315 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
10316
10317         * typemanager.cs (GetArgumentTypes): Faster implementation.
10318
10319 2004-06-18  Martin Baulig  <martin@ximian.com>
10320
10321         * attribute.cs (Attribute.Resolve): Check whether we're an
10322         EmptyCast which a Constant child.  Fixes #60333.
10323
10324 2004-06-17  Ben Maurer  <bmaurer@ximian.com>
10325
10326         * statement.cs (EmitCollectionForeach): Account for the fact that
10327         not all valuetypes are in areas which we can take the address of.
10328         For these variables, we store to a temporary variable. Also, make
10329         sure that we dont emit a `callvirt' on a valuetype method.
10330
10331 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
10332
10333         * expression.cs (StackAlloc.DoReSolve): Added test for
10334         negative parameter (CS0247).
10335
10336 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
10337
10338         Fix bug #59792
10339         * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
10340
10341 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
10342
10343         Fix bug #59781
10344         * expression.cs: (Binary.DoNumericPromotions): Added conversion for
10345         ulong.
10346
10347 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
10348
10349         Fix bug #58254 & cs1555.cs, cs1556.cs
10350         * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
10351
10352 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
10353
10354         * cs-parser.jay: Added error CS1669 test for indexers.
10355
10356 2004-06-11  Martin Baulig  <martin@ximian.com>
10357
10358         * expression.cs (Invocation.IsParamsMethodApplicable): We need to
10359         call this twice: for params and varargs methods.
10360
10361 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
10362
10363         * class.cs:
10364         (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
10365
10366 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
10367
10368         * attribute.cs (Attribute.GetValidTargets): Made public.
10369
10370         * class.cs: 
10371         (AbstractPropertyEventMethod): New class for better code sharing.
10372         (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
10373         CS1667 report.
10374         (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
10375
10376 2004-06-11  Raja R Harinath  <rharinath@novell.com>
10377
10378         Fix bug #59477.
10379         * ecore.cs (ResolveFlags): Add new 'Intermediate' flag to tell
10380         that the call to Resolve is part of a MemberAccess.
10381         (Expression.Resolve): Use it for SimpleName resolution.
10382         (SimpleName.SimpleNameResolve, SimpleName.DoResolveAllowStatic):
10383         Add 'intermediate' boolean argument.
10384         (SimpleName.DoSimpleNameResolve): Likewise.  Use it to disable an
10385         error message when the SimpleName can be resolved ambiguously
10386         between an expression and a type.
10387         * expression.cs (MemberAccess.IdenticalNameAndTypeName): Make
10388         public.
10389         (MemberAccess.Resolve): Pass 'Intermediate' flag to the Resolve()
10390         call on the left-side.
10391
10392 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
10393
10394         * class.cs:
10395         (MethodCore.VerifyClsCompliance): Added test for error CS3000.
10396
10397 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
10398
10399         * attribute.cs (Attribute.Emit): Fixed error CS0579 reporting.
10400
10401 2004-06-11  Martin Baulig  <martin@ximian.com>
10402
10403         * expression.cs (Invocation.EmitCall): Use OpCodes.Callvirt for
10404         varargs methods if applicable.
10405
10406 2004-06-11  Martin Baulig  <martin@ximian.com>
10407
10408         * expression.cs (Invocation.EmitCall): Don't use
10409         `method.CallingConvention == CallingConventions.VarArgs' since the
10410         method could also have `CallingConventions.HasThis'.
10411
10412 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
10413
10414         * class.cs (Event.GetSignatureForError): Implemented.
10415         Fixed crash in error test cs3010.cs
10416
10417 2004-06-10  Miguel de Icaza  <miguel@ximian.com>
10418
10419         * cs-tokenizer.cs: Change the way we track __arglist to be
10420         consistent with the other keywords.
10421
10422 2004-06-09  Miguel de Icaza  <miguel@ximian.com>
10423
10424         * codegen.cs: FAQ avoider: turn 1577 into a warning for now until
10425         tomorrow.
10426
10427 2004-06-09  Sebastien Pouliot  <sebastien@ximian.com>
10428
10429         * codegen.cs: Check that all referenced assemblies have a strongname
10430         before strongnaming the compiled assembly. If not report error CS1577.
10431         Fix bug #56563. Patch by Jackson Harper.
10432         * typemanager.cs: Added a method to return all referenced assemblies.
10433         Fix bug #56563. Patch by Jackson Harper.
10434
10435 2004-06-08  Marek Safar  <marek.safar@seznam.cz>
10436
10437         * class.cs:
10438         (Method.ApplyAttributeBuilder): Moved and added conditional
10439         attribute error tests (CS0577, CS0578, CS0243, CS0582, CS0629).
10440
10441         * delegate.cs:
10442         (DelegateCreation.ResolveMethodGroupExpr): Added error CS1618 test.
10443
10444 2004-06-08  Marek Safar  <marek.safar@seznam.cz>
10445
10446         Fixed #59640
10447         * class.cs: (EventField.attribute_targets): Changed default target.
10448
10449 2004-06-08  Martin Baulig  <martin@ximian.com>
10450
10451         * expression.cs (Invocation.EmitCall): Enable varargs methods.
10452
10453 2004-06-08  Martin Baulig  <martin@ximian.com>
10454
10455         * rootcontext.cs (ResolveCore): Added "System.RuntimeArgumentHandle".
10456
10457 2004-06-07  Martin Baulig  <martin@ximian.com>
10458
10459         Added support for varargs methods.
10460
10461         * cs-tokenizer.cs (Token.ARGLIST): New token for the `__arglist'
10462         keyword.
10463
10464         * cs-parser.jay: Added support for `__arglist'.
10465
10466         * decl.cs (MemberCache.AddMethods): Don't ignore varargs methods.
10467
10468         * expression.cs (Argument.AType): Added `ArgList'.
10469         (Invocation): Added support for varargs methods.
10470         (ArglistAccess): New public class.
10471         (Arglist): New public class.
10472
10473         * parameter.cs (Parameter.Modifier): Added `ARGLIST'.
10474
10475         * statement.cs (Block.Flags): Added `HasVarargs'.  We set this on
10476         a method's top-level block if the method has varargs.
10477
10478         * support.cs (ReflectionParameters, InternalParameters): Added
10479         support for varargs methods.    
10480
10481 2004-06-07  Miguel de Icaza  <miguel@ximian.com>
10482
10483         * class.cs: Provide location in indexer error report.
10484
10485         * driver.cs: Use standard names.
10486
10487         * namespace.cs: Catch the use of using after a namespace has been
10488         declared also on using aliases.
10489
10490 2004-06-03  Raja R Harinath  <rharinath@novell.com>
10491
10492         Bug #50820.
10493         * typemanager.cs (closure_private_ok, closure_invocation_type)
10494         (closure_qualifier_type, closure_invocation_assembly)
10495         (FilterWithClosure): Move to ...
10496         (Closure): New internal nested class.
10497         (Closure.CheckValidFamilyAccess): Split out from Closure.Filter.
10498         (MemberLookup, RealMemberLookup): Add new almost_match parameter.
10499         * ecore.cs (almostMatchedMembers): New variable to help report CS1540.
10500         (MemberLookup, MemberLookupFailed): Use it.
10501         * expression.cs (New.DoResolve): Treat the lookup for the
10502         constructor as being qualified by the 'new'ed type.
10503         (Indexers.GetIndexersForTypeOrInterface): Update.
10504
10505 2004-06-03  Marek Safar  <marek.safar@seznam.cz>
10506
10507         * attribute.cs
10508         (GetConditionalAttributeValue): New method. Returns
10509         condition of ConditionalAttribute.
10510         (SearchMulti): New method.  Returns all attributes of type 't'.
10511         Use it when attribute is AllowMultiple = true.
10512         (IsConditionalMethodExcluded): New method.
10513
10514         * class.cs
10515         (Method.IsExcluded): Implemented. Returns true if method has conditional
10516         attribute and the conditions is not defined (method is excluded).
10517         (IMethodData): Extended interface for ConditionalAttribute support.
10518         (PropertyMethod.IsExcluded): Implemented.
10519
10520         * decl.cs
10521         (MemberCore.Flags): Excluded_Undetected, Excluded new caching flags.
10522
10523         * expression.cs
10524         (Invocation.IsMethodExcluded): Checks the ConditionalAttribute
10525         on the method.
10526
10527 2004-06-02 Ben Maurer  <bmaurer@users.sourceforge.net>
10528
10529         * expression.cs (ArrayCreationExpression): Make this just an
10530         `expression'. It can't be a statement, so the code here was
10531         dead.
10532
10533 2004-06-02  Marek Safar  <marek.safar@seznam.cz>
10534
10535         Fixed #59072
10536         * typemanager.cs (GetFullNameSignature): New method for
10537         MethodBase types.
10538
10539 2004-06-02  Marek Safar  <marek.safar@seznam.cz>
10540
10541         Fixed #56452
10542         * class.cs (MemberBase.GetSignatureForError): New virtual method.
10543         Use this method when MethodBuilder is null.
10544         (MethodData.DefineMethodBuilder): Encapsulated code to the new method.
10545         Added test for error CS0626 (MONO reports error for this situation).
10546         (IMethodData.GetSignatureForError): Extended interface.
10547
10548 2004-06-01  Marek Safar  <marek.safar@seznam.cz>
10549
10550         * attribute.cs
10551         (AttributeTester.GetObsoleteAttribute): Returns instance of
10552         ObsoleteAttribute when type is obsolete.
10553
10554         * class.cs
10555         (TypeContainer.VerifyObsoleteAttribute): Override.
10556         (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
10557         (MethodCode.VerifyObsoleteAttribute): Override.
10558         (MemberBase.VerifyObsoleteAttribute): Override.
10559
10560         * decl.cs
10561         (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
10562         and report proper error.
10563
10564         *delegate.cs
10565         Delegate.VerifyObsoleteAttribute): Override.
10566
10567         * ecore.cs
10568         (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
10569         and report proper error.
10570         (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
10571
10572         * enum.cs
10573         (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
10574         and enum member.
10575
10576         * expression.cs
10577         (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
10578         New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
10579         Added test for ObsoleteAttribute.
10580
10581         * statement.cs
10582         (Catch): Derived from Statement.
10583
10584 2004-06-01  Marek Safar  <marek.safar@seznam.cz>
10585  
10586         Fixed bug #59071 & cs0160.cs
10587  
10588         * statement.cs (Try.Resolve): Check here whether order of catch
10589         clauses matches their dependencies.
10590
10591 2004-05-31  Miguel de Icaza  <miguel@ximian.com>
10592
10593         * Reverted patch to namespace.cs (Use lookuptypedirect).  This
10594         caused a regression: #59343.  Referencing nested classes from an
10595         assembly stopped working.
10596
10597 2004-05-31  Martin Baulig  <martin@ximian.com>
10598
10599         MCS is now frozen for beta 2.
10600
10601 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
10602
10603         * convert.cs: add a trivial cache for overload operator resolution.
10604
10605 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
10606
10607         * decl.cs: If possible, use lookuptypedirect here. We can only do
10608         this if there is no `.' after the namespace. Avoids using
10609         LookupType, which does lots of slow processing.
10610         (FindNestedType) New method, does what it says :-).
10611         * namespace.cs: use LookupTypeDirect.
10612         * rootcontext.cs: use membercache, if possible.
10613         * typemanager.cs (LookupTypeDirect): Cache negative hits too.
10614
10615 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
10616
10617         * expression.cs:
10618         According to the spec, 
10619
10620         In a member access of the form E.I, if E is a single identifier,
10621         and if the meaning of E as a simple-name (§7.5.2) is a constant,
10622         field, property, localvariable, or parameter with the same type as
10623         the meaning of E as a type-name (§3.8), then both possible
10624         meanings of E are permitted.
10625
10626         We did not check that E as a simple-name had the same type as E as
10627         a type name.
10628
10629         This trivial check gives us 5-7% on bootstrap time.
10630
10631 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
10632
10633         * expression.cs (Invocation.OverloadResolve): Avoid the
10634         use of hashtables and boxing here by allocating on demand.
10635
10636 2004-05-30  Martin Baulig  <martin@ximian.com>
10637
10638         * rootcontext.cs (RootContext.LookupType): Don't cache things if
10639         we're doing a silent lookup.  Don't try to lookup nested types in
10640         TypeManager.object_type (thanks to Ben Maurer).
10641
10642 2004-05-30  Martin Baulig  <martin@ximian.com>
10643
10644         Committing a patch from Ben Maurer.
10645
10646         * rootcontext.cs (RootContext.LookupType): Cache negative results.
10647
10648 2004-05-29  Martin Baulig  <martin@ximian.com>
10649
10650         * class.cs (IMethodData.ShouldIgnore): New method.
10651
10652         * typemanager.cs (TypeManager.MethodFlags): Don't take a
10653         `Location' argument, we don't need it anywhere.  Use
10654         `IMethodData.ShouldIgnore ()' instead of
10655         `MethodData.GetMethodFlags ()'.
10656         (TypeManager.AddMethod): Removed.
10657         (TypeManager.AddMethod2): Renamed to AddMethod.
10658
10659 2004-05-29  Martin Baulig  <martin@ximian.com>
10660
10661         Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
10662
10663         * convert.cs (Convert.ImplicitReferenceConversion): If we're
10664         converting from a class type S to an interface type and we already
10665         have an object on the stack, don't box it again.  Fixes #52578.
10666
10667 2004-05-29  Martin Baulig  <martin@ximian.com>
10668
10669         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
10670         Added support for `params' parameters.  Fixes #59267.
10671
10672 2004-05-29  Martin Baulig  <martin@ximian.com>
10673
10674         * literal.cs (NullPointer): Provide a private .ctor which sets
10675         `type' to TypeManager.object_type.  Fixes #59048.
10676
10677 2004-05-29  Martin Baulig  <martin@ximian.com>
10678
10679         * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
10680         EventExpr, set `ee.InstanceExpression = left'.  Fixes #59188.
10681
10682         * ecore.cs (EventExpr.instance_expr): Make the field private.
10683
10684 2004-05-26  Marek Safar  <marek.safar@seznam.cz>
10685
10686         Fixed bug #50080 & cs0214-2.cs
10687         * expression.cs (Cast.DoResolve): Check unsafe context here.
10688         
10689         * statement.cs (Resolve.DoResolve): Likewise.
10690
10691 2004-05-26  Martin Baulig  <martin@ximian.com>
10692
10693         * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
10694
10695         * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
10696         (RootContext.LookupType): Pass down the `silent' flag.
10697
10698 2004-05-25  Martin Baulig  <martin@ximian.com>
10699
10700         * expression.cs
10701         (MethodGroupExpr.IdenticalTypeName): New public property.
10702         (Invocation.DoResolve): Don't report a CS0176 if the "instance"
10703         expression actually refers to a type.
10704
10705 2004-05-25  Martin Baulig  <martin@ximian.com>
10706
10707         * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
10708         for #56176 and made it actually work.
10709
10710 2004-05-25  Martin Baulig  <martin@ximian.com>
10711
10712         * ecore.cs (Expression.CacheTemporaries): Make this virtual.
10713         (FieldExpr, PropertyExpr): Override and implement
10714         CacheTemporaries.  Fixes #52279.
10715
10716 2004-05-25  Miguel de Icaza  <miguel@ximian.com>
10717
10718         * location.cs: In the new compiler listing a file twice is a
10719         warning, not an error.
10720
10721 2004-05-24  Martin Baulig  <martin@ximian.com>
10722
10723         * enum.cs (Enum.DefineType): For the `BaseType' to be a
10724         TypeLookupExpression; otherwise, report a CS1008.  Fixes #58571.
10725
10726 2004-05-24  Martin Baulig  <martin@ximian.com>
10727
10728         * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
10729         walking the `using' list.  Fixes #53921.
10730
10731 2004-05-24  Martin Baulig  <martin@ximian.com>
10732
10733         * const.cs (Const.LookupConstantValue): Added support for
10734         EmptyCast's; fixes #55251.
10735
10736 2004-05-24  Martin Baulig  <martin@ximian.com>
10737
10738         * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
10739         DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
10740         which does the CS0135 check.  The reason is that we first need to
10741         check whether the variable actually exists.
10742
10743 2004-05-24  Martin Baulig  <martin@ximian.com>
10744
10745         * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
10746         than RootContext.LookupType() to find the explicit interface
10747         type.  Fixes #58584.
10748
10749 2004-05-24  Raja R Harinath  <rharinath@novell.com>
10750
10751         * Makefile: Simplify.  Use executable.make.
10752         * mcs.exe.sources: New file.  List of sources of mcs.exe.
10753
10754 2004-05-24  Anders Carlsson  <andersca@gnome.org>
10755
10756         * decl.cs:
10757         * enum.cs:
10758         Use the invariant culture when doing String.Compare for CLS case
10759         sensitivity.
10760         
10761 2004-05-23  Martin Baulig  <martin@ximian.com>
10762
10763         * decl.cs (DeclSpace.FindType): Only check the `using' list if we
10764         don't have any dots.  Fixes #52622, added cs0246-8.cs.
10765
10766         * namespace.cs (NamespaceEntry.Lookup): Likewise.
10767         
10768 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
10769
10770         * class.cs (MemberBase.Define): Reuse MemberType member for 
10771         resolved type. Other methods can use it too.
10772
10773 2004-05-23  Martin Baulig  <martin@ximian.com>
10774
10775         * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
10776         the variable also exists in the current block (otherwise, we need
10777         to report a CS0103).  Fixes #58670.
10778
10779 2004-05-23  Martin Baulig  <martin@ximian.com>
10780
10781         * flowanalysis.cs (Reachability.Reachable): Compute this
10782         on-the-fly rather than storing it as a field.
10783
10784 2004-05-23  Martin Baulig  <martin@ximian.com>
10785
10786         * flowanalysis.cs (Reachability.And): Manually compute the
10787         resulting `barrier' from the reachability.      
10788        
10789 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
10790
10791         Fix bug #57835
10792         * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
10793         instance of ObsoleteAttribute when symbol is obsolete.
10794
10795         * class.cs
10796         (IMethodData): Extended interface for ObsoleteAttribute support.
10797
10798 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
10799
10800         * attribute.cs: Fix bug #55970
10801
10802 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
10803
10804         Fix bug #52705
10805         * attribute.cs
10806         (GetObsoleteAttribute): New method. Creates the instance of
10807         ObsoleteAttribute.
10808         (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
10809         ObsoleteAttribute when member is obsolete.
10810         (AttributeTester.Report_ObsoleteMessage): Common method for
10811         Obsolete error/warning reporting.
10812
10813         * class.cs
10814         (TypeContainer.base_classs_type): New member for storing parent type.
10815
10816         * decl.cs
10817         (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
10818         for this MemberCore.
10819
10820 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
10821
10822         * attribute.cs, const.cs: Fix bug #58590
10823
10824 2004-05-21  Martin Baulig  <martin@ximian.com>
10825
10826         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
10827         out parameters if the end of the method is unreachable.  Fixes
10828         #58098. 
10829
10830 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
10831
10832         * codegen.cs, cs-parser.jay: Removed SetAttributes method.
10833         Hari was right, why extra method.
10834
10835 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
10836
10837         * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
10838
10839 2004-05-20  Martin Baulig  <martin@ximian.com>
10840
10841         Merged this back from gmcs to keep the differences to a minumum.
10842
10843         * attribute.cs (Attribute.CheckAttributeType): Take an EmitContext
10844         instead of a Declspace.
10845         (Attribute.ResolveType): Likewise.
10846         (Attributes.Search): Likewise.
10847         (Attributes.Contains): Likewise.
10848         (Attributes.GetClsCompliantAttribute): Likewise.
10849
10850         * class.cs (TypeContainer.VerifyMembers): Added EmitContext
10851         argument.
10852         (MethodData.ApplyAttributes): Take an EmitContext instead of a
10853         DeclSpace.
10854
10855 2004-05-19  Marek Safar  <marek.safar@seznam.cz>
10856
10857         Fix bug #58688 (MCS does not report error when the same attribute
10858         is assigned twice)
10859
10860         * attribute.cs (Attribute.Emit): Distinction between null and default.
10861
10862 2004-05-19  Raja R Harinath  <rharinath@novell.com>
10863
10864         * cs-parser.jay (attribute): Create a GlobalAttribute for the case
10865         of a top-level attribute without an attribute target.
10866         * attribute.cs (Attribute.Error_AttributeConstructorMismatch): 
10867         Make non-static.
10868         (Attribute.Conditional_GetConditionName), 
10869         (Attribute.Obsolete_GetObsoleteMessage): Update.
10870         (Attribute.IndexerName_GetIndexerName): New.  Attribute-specific
10871         part of ScanForIndexerName.
10872         (Attribute.CanIgnoreInvalidAttribute): New function.
10873         (Attribute.ScanForIndexerName): Move to ...
10874         (Attributes.ScanForIndexerName): ... here.
10875         (Attributes.Attrs): Rename from now-misnamed AttributeSections.
10876         (Attributes.Search): New internal variant that can choose not to
10877         complain if types aren't resolved.  The original signature now
10878         complains.
10879         (Attributes.GetClsCompliantAttribute): Use internal variant, with
10880         complaints suppressed.
10881         (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
10882         only if it not useful.
10883         (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
10884         top-level for attributes that are shared between the assembly
10885         and a top-level class.
10886         * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
10887         * class.cs: Update to reflect changes.
10888         (DefineIndexers): Fuse loops.
10889         * codegen.cs (GetAssemblyName): Update to reflect changes.  Accept
10890         a couple more variants of attribute names.
10891
10892 2004-05-18  Marek Safar  <marek.safar@seznam.cz>
10893
10894         Fix bug #52585 (Implemented explicit attribute declaration)
10895
10896         * attribute.cs:
10897         (Attributable.ValidAttributeTargets): New abstract method. It gets
10898         list of valid attribute targets for explicit target declaration.
10899         (Attribute.Target): It holds target itself.
10900         (AttributeSection): Removed.
10901         (Attribute.CheckTargets): New method. It checks whether attribute
10902         target is valid for the current element.
10903
10904         * class.cs:
10905         (EventProperty): New class. For events that are declared like
10906         property (with add and remove accessors).
10907         (EventField): New class. For events that are declared like field.
10908         class.cs
10909
10910         * cs-parser.jay: Implemented explicit attribute target declaration.
10911
10912         * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:        
10913         Override ValidAttributeTargets.
10914
10915         * parameter.cs:
10916         (ReturnParameter): Class for applying custom attributes on 
10917         the return type.
10918         (ParameterAtribute): New class. Class for applying custom
10919         attributes on the parameter type.
10920
10921 2004-05-17  Miguel de Icaza  <miguel@ximian.com>
10922
10923         * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
10924         definitions. 
10925
10926         (Method): Allow UNSAFE here.
10927
10928         * modifiers.cs: Support unsafe reporting.
10929
10930 2004-05-17  Marek Safar  <marek.safar@seznam.cz>
10931
10932         * decl.cs: Fix bug #58478.
10933
10934 2004-05-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10935
10936         * statement.cs: When checking for unreachable code on an EmptyStatement,
10937         set the location. Fixes bug #58488.
10938
10939 2004-05-13  Miguel de Icaza  <miguel@ximian.com>
10940
10941         * driver.cs: Add -pkg handling.
10942
10943         From Gonzalo: UseShelLExecute=false
10944
10945 2004-05-12  Marek Safar  <marek.safar@seznam.cz>
10946
10947         * attribute.cs:
10948         (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
10949         for attribute.
10950         (Attribute.IsClsCompliaceRequired): Moved to base for better
10951         accesibility.
10952         (Attribute.UsageAttribute): New property for AttributeUsageAttribute
10953         when attribute is AttributeUsageAttribute.
10954         (Attribute.GetValidTargets): Simplified.
10955         (Attribute.GetAttributeUsage): New method returns AttributeUsage
10956         attribute for this type.
10957         (Attribute.ApplyAttributes): Method renamed to Emit and make
10958         non-static.
10959         (GlobalAttributeSection): New class for special handling of global
10960         attributes (assembly, module).
10961         (AttributeSection.Emit): New method.
10962
10963         * class.cs: Implemented Attributable abstract methods.
10964         (MethodCore.LabelParameters): Moved to Parameter class.
10965         (Accessor): Is back simple class.
10966         (PropertyMethod): Implemented Attributable abstract class.
10967         (DelegateMethod): Implemented Attributable abstract class.
10968         (Event): New constructor for disctintion between normal Event
10969         and Event with accessors.
10970
10971         * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
10972
10973         * codegen.cs, const.cs, decl.cs, delegate.cs:
10974         (CommonAssemblyModulClass): Implemented Attributable abstract class
10975         and simplified.
10976
10977         * enum.cs: Implement IAttributeSupport interface.
10978         (EnumMember): New class for emum members. Implemented Attributable
10979         abstract class
10980
10981         * parameter.cs:
10982         (ParameterBase): Is abstract.
10983         (ReturnParameter): New class for easier [return:] attribute handling.
10984
10985         * typemanager.cs: Removed builder_to_attr.
10986
10987 2004-05-11  Raja R Harinath  <rharinath@novell.com>
10988
10989         Fix bug #57151.
10990         * attribute.cs (Attribute.GetPositionalValue): New function.
10991         * class.cs (TypeContainer.VerifyMembers): New function.
10992         (TypeContainer.Emit): Use it.
10993         (ClassOrStruct): New base class for Class and Struct.
10994         (ClassOrStruct.ApplyAttributeBuilder): New function.  Note if 
10995         StructLayout(LayoutKind.Explicit) was ascribed to the struct or
10996         class.
10997         (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
10998         then each non-static field should have a FieldOffset attribute.
10999         Otherwise, none of the fields should have a FieldOffset attribute.
11000         * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout 
11001         and FieldOffset attributes.
11002         * typemanager.cs (TypeManager.struct_layout_attribute_type)
11003         (TypeManager.field_offset_attribute_type): New core types.
11004         (TypeManager.InitCoreTypes): Initialize them.
11005
11006 2004-05-11  Michal Moskal  <malekith@pld-linux.org>
11007
11008         * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
11009         Return correct type.
11010         From bug #58270.
11011
11012 2004-05-09  Miguel de Icaza  <miguel@ximian.com>
11013
11014         * expression.cs (Binary.DoNumericPromotions): 0 long constant can
11015         be implicitly converted to ulong.
11016         
11017         * expression.cs: The logic for allowing operator &, | and ^ worked
11018         was wrong, it worked before because we did not report an error in
11019         an else branch.  Fixes 57895.
11020
11021         * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
11022         allow volatile fields to be reference types.
11023
11024 2004-05-07  Miguel de Icaza  <miguel@ximian.com>
11025
11026         * driver.cs: Add support for /debug-
11027
11028 2004-05-07  Raja R Harinath  <rharinath@novell.com>
11029
11030         * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType): 
11031         Add a 'complain' parameter to silence errors.
11032         (Attribute.Resolve): Update to changes.  Put in sanity check to catch
11033         silently overlooked type-resolutions.
11034         (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
11035         to reflect changes.
11036         (Attributes.Search): New function.
11037         (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
11038         (Attributes.GetAttributeFullName): Remove hack.
11039         * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes): 
11040         Update to reflect changes.
11041         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
11042         Use Attributes.Search instead of nested loops.
11043
11044 2004-05-07  Marek Safar  <marek.safar@seznam.cz>
11045
11046         * decl.cs:
11047         (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
11048         (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
11049         (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
11050
11051         * report.cs: (Report.Warning): Renamed to Warning_T because of
11052         parameter collision.
11053
11054 2004-05-05  Raja R Harinath  <rharinath@novell.com>
11055
11056         * expression.cs (MemberAccess.ResolveMemberAccess):
11057         Exit with non-zero status after Report.Error.
11058         * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
11059         Likewise.
11060         * typemanager.cs (TypeManager.CoreLookupType): Likewise.
11061
11062 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
11063
11064         * support.cs: Don't hang when the file is empty.
11065
11066 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
11067
11068         * support.cs: In SeekableStreamReader, compute the preamble size of the
11069           underlying stream. Position changes should take into account that initial
11070           count of bytes.
11071
11072 2004-05-03  Todd Berman  <tberman@sevenl.net>
11073
11074         * driver.cs: remove unused GetSysVersion function.
11075
11076 2004-05-03  Todd Berman  <tberman@sevenl.net>
11077
11078         * driver.cs: Remove the hack from saturday, as well as the hack
11079         from jackson (LoadAssemblyFromGac), also adds the CWD to the
11080         link_paths to get that bit proper.
11081
11082 2004-05-01  Todd Berman  <tberman@sevenl.net>
11083
11084         * driver.cs: Try a LoadFrom before a Load, this checks the current
11085         path. This is currently a bug in mono that is be fixed, however, this
11086         provides a workaround for now. This will be removed when the bug
11087         is fixed.
11088
11089 2004-05-01  Sebastien Pouliot  <sebastien@ximian.com>
11090
11091         * CryptoConvert.cs: Updated to latest version. Fix issue with 
11092         incomplete key pairs (#57941).
11093
11094 2004-05-01  Todd Berman  <tberman@sevenl.net>
11095
11096         * driver.cs: Remove '.' from path_chars, now System.* loads properly
11097         from the GAC
11098
11099 2004-04-30  Jackson Harper  <jackson@ximian.com>
11100
11101         * codegen.cs: Open keys readonly.
11102         
11103 2004-04-30  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11104
11105         * typemanager.cs: don't report cyclic struct layout when a struct
11106         contains 2 or more fields of the same type. Failed for Pango.AttrShape
11107         which has 2 Pango.Rectangle fields.
11108
11109 2004-04-29 Ben Maurer  <bmaurer@users.sourceforge.net>
11110
11111         * expression.cs: Handle IntPtr comparisons with IL code
11112         rather than a method call.
11113
11114 2004-04-29  Martin Baulig  <martin@ximian.com>
11115
11116         * ecore.cs (PropertyExpr.FindAccessor): New private method.  Walk
11117         the list of PropertyInfo's in class hierarchy and find the
11118         accessor.  Fixes #56013.
11119
11120 2004-04-29  Martin Baulig  <martin@ximian.com>
11121
11122         * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
11123
11124 2004-04-29  Martin Baulig  <martin@ximian.com>
11125
11126         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
11127
11128         * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
11129
11130 2004-04-29  Martin Baulig  <martin@ximian.com>
11131
11132         * class.cs (ConstructorInitializer.Resolve): Check whether the
11133         parent .ctor is accessible.  Fixes #52146.
11134
11135 2004-04-29  Martin Baulig  <martin@ximian.com>
11136
11137         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
11138
11139         * statement.cs (Using.EmitLocalVariableDecls): Use
11140         TypeManager.idisposable_type, not typeof (IDisposable).
11141         (Foreach.EmitCollectionForeach): Added support for valuetypes.
11142
11143 2004-04-29  Martin Baulig  <martin@ximian.com>
11144
11145         * class.cs (Event.Define): Don't emit the field and don't set
11146         RTSpecialName and SpecialName for events on interfaces.  Fixes
11147         #57703. 
11148
11149 2004-04-29  Raja R Harinath  <rharinath@novell.com>
11150
11151         Refactor Attribute.ApplyAttributes.
11152         * attribute.cs (Attributable): New base class for objects that can
11153         have Attributes applied on them.
11154         (Attribute): Make AttributeUsage fields public.
11155         (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
11156         (Attribute.IsInternalCall): New property.
11157         (Attribute.UsageAttr): Convert to a public read-only property.
11158         (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
11159         (Attribute.ResolveType, Attribute.Resolve)
11160         (Attribute.ScanForIndexerName): Update to reflect changes.
11161         (Attribute.CheckAttributeTarget): Re-format.
11162         (Attribute.ApplyAttributes): Refactor, to various
11163         Attributable.ApplyAttributeBuilder methods.
11164         * decl.cs (MemberCore): Make Attributable.
11165         * class.cs (Accessor): Make Attributable.
11166         (MethodData.ApplyAttributes): Use proper attribute types, not
11167         attribute names.
11168         (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
11169         (TypeContainer.ApplyAttributeBuilder)
11170         (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
11171         (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)   
11172         (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
11173         (Operator.ApplyAttributeBuilder): New factored-out methods.
11174         * const.cs (Const.ApplyAttributeBuilder): Likewise.
11175         * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
11176         * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
11177         * parameter.cs (ParameterBase): New Attributable base class
11178         that can also represent Return types.
11179         (Parameter): Update to the changes.
11180
11181 2004-04-29  Jackson Harper  <jackson@ximian.com>
11182
11183         * driver.cs: Prefer the corlib system version when looking for
11184         assemblies in the GAC. This is still a hack, but its a better hack
11185         now.
11186         
11187 2004-04-29  Marek Safar  <marek.safar@seznam.cz>
11188
11189         * decl.cs, enum.cs: Improved error 3005 reporting.
11190   
11191         * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
11192         (related_symbols): New private member for list of symbols
11193         related to reported error/warning.
11194         
11195         * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
11196
11197 2004-04-29  Martin Baulig  <martin@ximian.com>
11198
11199         * ecore.cs (Expression.Constantify): If we're an enum and
11200         TypeManager.TypeToCoreType() doesn't give us another type, use
11201         t.UnderlyingSystemType.  Fixes #56178.  
11202
11203 2004-04-29  Martin Baulig  <martin@ximian.com>
11204
11205         * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
11206         interfaces and for each interface, only add members directly
11207         declared in that interface.  Fixes #53255.
11208
11209 2004-04-28  Martin Baulig  <martin@ximian.com>
11210
11211         * expression.cs (ConditionalLogicalOperator): Use a temporary
11212         variable for `left' to avoid that we evaluate it more than once;
11213         bug #52588.
11214
11215 2004-04-28  Martin Baulig  <martin@ximian.com>
11216
11217         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
11218         `void[]' (CS1547).
11219
11220 2004-04-28  Martin Baulig  <martin@ximian.com>
11221
11222         * statement.cs (LocalInfo.Resolve): Check whether the type is not
11223         void (CS1547).
11224
11225         * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
11226         whether the type is not void (CS1547).
11227
11228 2004-04-28  Martin Baulig  <martin@ximian.com>
11229
11230         * expression.cs (Unary.DoResolveLValue): Override this and report
11231         CS0131 for anything but Operator.Indirection.
11232
11233 2004-04-28  Martin Baulig  <martin@ximian.com>
11234
11235         Committing a patch from Ben Maurer; see bug #50820.
11236
11237         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
11238         check for classes.
11239
11240         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
11241         classes.        
11242
11243 2004-04-28  Martin Baulig  <martin@ximian.com>
11244
11245         Committing a patch from Ben Maurer; see bug #50820.
11246
11247         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
11248         check for classes.
11249
11250         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
11251         classes.        
11252
11253 2004-04-28  Martin Baulig  <martin@ximian.com>
11254
11255         * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
11256         (Block.AddLabel): Call DoLookupLabel() to only search in the
11257         current block.
11258
11259 2004-04-28  Martin Baulig  <martin@ximian.com>
11260
11261         * cfold.cs (ConstantFold.BinaryFold): Added special support for
11262         comparing StringConstants and NullLiterals in Equality and Inequality.
11263
11264 2004-04-28  Jackson Harper  <jackson@ximian.com>
11265
11266         * driver.cs: Attempt to load referenced assemblies from the
11267         GAC. This is the quick and dirty version of this method that
11268         doesnt take into account versions and just takes the first
11269         canidate found. Will be good enough for now as we will not have more
11270         then one version installed into the GAC until I update this method.
11271
11272 2004-04-28  Martin Baulig  <martin@ximian.com>
11273
11274         * typemanager.cs (TypeManager.CheckStructCycles): New public
11275         static method to check for cycles in the struct layout.
11276
11277         * rootcontext.cs (RootContext.PopulateTypes): Call
11278         TypeManager.CheckStructCycles() for each TypeContainer.
11279         [Note: We only need to visit each type once.]
11280
11281 2004-04-28  Martin Baulig  <martin@ximian.com>
11282
11283         * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
11284
11285         * const.cs (Const.LookupConstantValue): Return a `bool' signalling
11286         success and added `out object value'.  Use a `bool resolved' field
11287         to check whether we've already been called rather than
11288         `ConstantValue != null' since this breaks for NullLiterals.
11289
11290 2004-04-28  Raja R Harinath  <rharinath@novell.com>
11291
11292         * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
11293         setting of this flag, since the 'set' method may be non-public.
11294
11295 2004-04-28  Raja R Harinath  <rharinath@novell.com>
11296
11297         * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
11298         check on current_vector.Block.
11299
11300 2004-04-27  Martin Baulig  <martin@ximian.com>
11301
11302         * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
11303         a field initializer.  Fixes #56459.
11304
11305 2004-04-27  Martin Baulig  <martin@ximian.com>
11306
11307         * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
11308         we're not attempting to use an indexer.  Fixes #52154.
11309
11310 2004-04-27  Martin Baulig  <martin@ximian.com>
11311
11312         * statement.cs (Return): Don't create a return label if we don't
11313         need it; reverts my change from January 20th.  Thanks to Ben
11314         Maurer for this.
11315
11316 2004-04-27  Martin Baulig  <martin@ximian.com>
11317
11318         According to the spec, `goto' can only leave a nested scope, but
11319         never enter it.
11320
11321         * statement.cs (Block.LookupLabel): Only lookup in the current
11322         block, don't recurse into parent or child blocks.
11323         (Block.AddLabel): Check in parent and child blocks, report
11324         CS0140/CS0158 if we find a duplicate.
11325         (Block): Removed this indexer for label lookups.
11326         (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
11327         this already does the error reporting for us.
11328
11329         * flowanalysis.cs
11330         (FlowBranching.UsageVector.Block): New public variable; may be null.
11331         (FlowBranching.CreateSibling): Added `Block' argument.
11332         (FlowBranching.LookupLabel): New public virtual method.  Lookup a
11333         label for the target of a `goto' and check whether we're not
11334         leaving a `finally'.
11335
11336 2004-04-27  Martin Baulig  <martin@ximian.com>
11337
11338         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
11339         a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
11340         just for returns).
11341
11342 2004-04-27  Martin Baulig  <martin@ximian.com>
11343
11344         * statement.cs (Block.AddLabel): Also check for implicit blocks
11345         and added a CS0158 check.
11346
11347 2004-04-27  Martin Baulig  <martin@ximian.com>
11348
11349         * flowanalysis.cs (FlowBranchingLoop): New class.
11350         (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
11351         UsageVector's instead of an ArrayList.
11352         (FlowBranching.Label): Likewise.
11353         (FlowBranching.UsageVector.MergeBreakOrigins): New method.
11354         (FlowBranching.AddBreakVector): New method.
11355
11356 2004-04-27  Miguel de Icaza  <miguel@ximian.com>
11357
11358         * attribute.cs: Small regression fix: only convert the type if we
11359         the type is different, fixes System.Drawing build.
11360
11361 2004-04-27  Martin Baulig  <martin@ximian.com>
11362
11363         * attribute.cs (Attribute.Resolve): If we have a constant value
11364         for a named field or property, implicity convert it to the correct
11365         type.
11366
11367 2004-04-27  Raja R Harinath  <rharinath@novell.com>
11368
11369         * statement.cs (Block.Block): Implicit blocks share
11370         'child_variable_names' fields with parent blocks.
11371         (Block.AddChildVariableNames): Remove.
11372         (Block.AddVariable): Mark variable as "used by a child block" in
11373         every surrounding block.
11374         * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
11375         been used in a child block, complain about violation of "Invariant
11376         meaning in blocks" rule.
11377         * cs-parser.jay (declare_local_variables): Don't use
11378         AddChildVariableNames.
11379         (foreach_statement): Don't create an implicit block: 'foreach'
11380         introduces a scope.
11381
11382 2004-04-23  Miguel de Icaza  <miguel@ximian.com>
11383
11384         * convert.cs (ImplicitNumericConversion): 0 is also positive when
11385         converting from 0L to ulong.  Fixes 57522.
11386
11387 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
11388
11389         * decl.cs (FindMemberToOverride): Fix wrong warning for case when
11390         derived class hides via 'new' keyword field from base class (test-242.cs).
11391         TODO: Handle this in the more general way.
11392         
11393         * class.cs (CheckBase): Ditto.
11394
11395 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
11396
11397         * decl.cs (caching_flags): New member for storing cached values
11398         as bit flags.
11399         (MemberCore.Flags): New enum where bit flags for caching_flags
11400         are defined.
11401         (MemberCore.cls_compliance): Moved to caching_flags.
11402         (DeclSpace.Created): Moved to caching_flags.
11403
11404         * class.cs: Use caching_flags instead of DeclSpace.Created
11405         
11406 2004-04-21  Miguel de Icaza  <miguel@ximian.com>
11407
11408         * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
11409         if we are only a derived class, not a nested class.
11410
11411         * typemanager.cs: Same as above, but do this at the MemberLookup
11412         level (used by field and methods, properties are handled in
11413         PropertyExpr).   Allow for the qualified access if we are a nested
11414         method. 
11415
11416 2004-04-21  Marek Safar  <marek.safar@seznam.cz>
11417
11418         * class.cs: Refactoring.
11419         (IMethodData): New inteface; Holds links to parent members
11420         to avoid member duplication (reduced memory allocation).
11421         (Method): Implemented IMethodData interface.
11422         (PropertyBase): New inner classes for get/set methods.
11423         (PropertyBase.PropertyMethod): Implemented IMethodData interface
11424         (Event): New inner classes for add/remove methods.
11425         (Event.DelegateMethod): Implemented IMethodData interface.
11426
11427         * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
11428         EmitContext (related to class.cs refactoring).
11429
11430 2004-04-21  Raja R Harinath  <rharinath@novell.com>
11431
11432         * delegate.cs (Delegate.VerifyApplicability): If the number of
11433         arguments are the same as the number of parameters, first try to
11434         verify applicability ignoring  any 'params' modifier on the last
11435         parameter.
11436         Fixes #56442.
11437
11438 2004-04-16  Raja R Harinath  <rharinath@novell.com>
11439
11440         * class.cs (TypeContainer.AddIndexer): Use
11441         'ExplicitInterfaceName' to determine if interface name was
11442         explicitly specified.  'InterfaceType' is not initialized at this time.
11443         (TypeContainer.DefineIndexers): Remove use of temporary list.  The
11444         Indexers array is already in the required order.  Initialize
11445         'IndexerName' only if there are normal indexers.
11446         (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
11447         (TypeContainer.Emit): Emit DefaultMember attribute only if
11448         IndexerName is initialized.
11449         Fixes #56300.
11450
11451 2004-04-15  Benjamin Jemlich  <pcgod@gmx.net>
11452
11453         * enum.cs (Enum.DefineType): Don't allow char as type for enum.
11454         Fixes #57007
11455
11456 2004-04-15  Raja R Harinath  <rharinath@novell.com>
11457
11458         * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
11459         attributes.
11460         Fix for #56456.
11461
11462         * attribute.cs (Attribute.Resolve): Check for duplicate named
11463         attributes.
11464         Fix for #56463.
11465
11466 2004-04-15  Miguel de Icaza  <miguel@ximian.com>
11467
11468         * iterators.cs (MarkYield): track whether we are in an exception,
11469         and generate code accordingly.  Use a temporary value to store the
11470         result for our state.
11471
11472         I had ignored a bit the interaction of try/catch with iterators
11473         since their behavior was not entirely obvious, but now it is
11474         possible to verify that our behavior is the same as MS .NET 2.0
11475
11476         Fixes 54814
11477
11478 2004-04-14  Miguel de Icaza  <miguel@ximian.com>
11479
11480         * iterators.cs: Avoid creating temporaries if there is no work to
11481         do. 
11482
11483         * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
11484         Enumerations, use TypeManager.EnumToUnderlying and call
11485         recursively. 
11486
11487         Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
11488         bug #57013
11489
11490         (This.Emit): Use EmitContext.EmitThis to emit our
11491         instance variable.
11492
11493         (This.EmitAssign): Ditto.
11494
11495         * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
11496         codepaths, we will move all the functionality into
11497         Mono.CSharp.This 
11498
11499         (FieldExpr.EmitAssign): Ditto.
11500
11501         This fixes several hidden bugs that I uncovered while doing a code
11502         review of this today.
11503
11504         * codegen.cs (EmitThis): reworked so the semantics are more clear
11505         and also support value types "this" instances.
11506
11507         * iterators.cs: Changed so that for iterators in value types, we
11508         do not pass the value type as a parameter.  
11509
11510         Initialization of the enumerator helpers is now done in the caller
11511         instead of passing the parameters to the constructors and having
11512         the constructor set the fields.
11513
11514         The fields have now `assembly' visibility instead of private.
11515
11516 2004-04-11  Miguel de Icaza  <miguel@ximian.com>
11517
11518         * expression.cs (Argument.Resolve): Check if fields passed as ref
11519         or out are contained in a MarshalByRefObject.
11520
11521         * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
11522         another compiler type.
11523
11524 2004-04-06 Ben Maurer  <bmaurer@users.sourceforge.net>
11525
11526         * class.cs (Indexer.Define): use the new name checking method.
11527         Also, return false on an error.
11528         * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
11529         (is_identifier_[start/part]_character): make static.
11530
11531 2004-04-10  Miguel de Icaza  <miguel@ximian.com>
11532
11533         * expression.cs (Binary.ResolveOperator): Do no append strings
11534         twice: since we can be invoked more than once (array evaluation)
11535         on the same concatenation, take care of this here.  Based on a fix
11536         from Ben (bug #56454)
11537
11538 2004-04-08  Sebastien Pouliot  <sebastien@ximian.com>
11539
11540         * codegen.cs: Fix another case where CS1548 must be reported (when 
11541         delay-sign isn't specified and no private is available #56564). Fix
11542         loading the ECMA "key" to delay-sign an assembly. Report a CS1548 
11543         error when MCS is used on the MS runtime and we need to delay-sign 
11544         (which seems unsupported by AssemblyBuilder - see #56621).
11545
11546 2004-04-08  Marek Safar  <marek.safar@seznam.cz>
11547
11548         * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
11549         (TypeManager.ComputeNamespaces): Faster implementation for
11550         Microsoft runtime.
11551
11552         * compiler.csproj: Updated AssemblyName to mcs.
11553
11554 2004-04-07  Miguel de Icaza  <miguel@ximian.com>
11555
11556         * rootcontext.cs: Add new types to the boot resolution.
11557
11558         * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
11559         MulticastDelegate is not allowed.
11560
11561         * typemanager.cs: Add new types to lookup: System.TypedReference
11562         and ArgIterator.
11563
11564         * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
11565         check for TypedReference or ArgIterator, they are not allowed. 
11566
11567         * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
11568         makes us properly catch 1510 in some conditions (see bug 56016 for
11569         details). 
11570
11571 2004-04-06  Bernie Solomon  <bernard@ugsolutions.com>
11572
11573         * CryptoConvert.cs: update from corlib version
11574         with endian fixes.
11575
11576 2004-04-05  Miguel de Icaza  <miguel@ximian.com>
11577
11578         * class.cs (Indexer.Define): Check indexername declaration
11579
11580 2004-04-05  Marek Safar  <marek.safar@seznam.cz>
11581
11582         * attribute.cs (IsClsCompliant): Fixed problem with handling
11583         all three states (compliant, not-compliant, undetected).
11584
11585 2004-03-30  Marek Safar  <marek.safar@seznam.cz>
11586
11587         * attribute.cs (Attribute): Location is now public.
11588         (Resolve): Store resolved arguments (pos_values) in attribute class.
11589         Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
11590         (GetClsCompliantAttributeValue): New method that gets
11591         CLSCompliantAttribute value.
11592         (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
11593         if exists else null.
11594         (AttributeTester): New class for CLS-Compliant verification routines.
11595
11596         * class.cs (Emit): Add CLS-Compliant verification.
11597         (Method.GetSignatureForError): Implemented.
11598         (Constructor.GetSignatureForError): Implemented
11599         (Constructor.HasCompliantArgs): Returns if constructor has
11600         CLS-Compliant arguments.
11601         (Constructor.Emit): Override.
11602         (Construcor.IsIdentifierClsCompliant): New method; For constructors
11603         is needed to test only parameters.
11604         (FieldBase.GetSignatureForError): Implemented.
11605         (TypeContainer): New member for storing base interfaces.
11606         (TypeContainer.FindMembers): Search in base interfaces too.
11607
11608         * codegen.cs (GetClsComplianceAttribute): New method that gets
11609         assembly or module CLSCompliantAttribute value.
11610         (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
11611         for assembly.
11612         (ModuleClass.Emit): Add error 3012 test.
11613
11614         * const.cs (Emit): Override and call base for CLS-Compliant tests.
11615
11616         * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
11617         state for all decl types.
11618         (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
11619         if CLS-Compliant tests are required.
11620         (IsClsCompliaceRequired): New method. Analyze whether code
11621         must be CLS-Compliant.
11622         (IsExposedFromAssembly): New method. Returns true when MemberCore
11623         is exposed from assembly.
11624         (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
11625         value or gets cached value.
11626         (HasClsCompliantAttribute): New method. Returns true if MemberCore
11627         is explicitly marked with CLSCompliantAttribute.
11628         (IsIdentifierClsCompliant): New abstract method. This method is
11629         used to testing error 3005.
11630         (IsIdentifierAndParamClsCompliant): New method. Common helper method
11631         for identifier and parameters CLS-Compliant testing.
11632         (VerifyClsCompliance): New method. The main virtual method for
11633         CLS-Compliant verifications.
11634         (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
11635         null. I don't know why is null (too many public members !).
11636         (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
11637         and get value of first CLSCompliantAttribute that found.
11638
11639         * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
11640         (VerifyClsCompliance): Override and add extra tests.
11641
11642         * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
11643         clscheck- disable CLS-Compliant verification event if assembly is has
11644         CLSCompliantAttribute(true).
11645
11646         * enum.cs (Emit): Override and call base for CLS-Compliant tests.
11647         ApllyAttribute is now called in emit section as in the other cases.
11648         Possible future Emit integration.
11649         (IsIdentifierClsCompliant): New override.
11650         (VerifyClsCompliance): New override.
11651         (GetEnumeratorName): Returns full enum name.
11652
11653         * parameter.cs (GetSignatureForError): Implemented.
11654
11655         * report.cs (WarningData): New struct for Warning message information.
11656         (LocationOfPreviousError): New method.
11657         (Warning): New method. Reports warning based on the warning table.
11658         (Error_T): New method. Reports error based on the error table.
11659
11660         * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
11661         verifications are done here.
11662
11663         * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
11664
11665         * typemanager.cs (cls_compliant_attribute_type): New member thath holds
11666         CLSCompliantAttribute.
11667         (all_imported_types): New member holds all imported types from other
11668         assemblies.
11669         (LoadAllImportedTypes): New method fills static table with exported types
11670         from all referenced assemblies.
11671         (Modules): New property returns all assembly modules.
11672
11673 2004-03-30  Miguel de Icaza  <miguel@ximian.com>
11674
11675         * cs-parser.jay: Add a rule to catch wrong event syntax instead of
11676         throwing a parser error.
11677
11678         * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
11679         which removes the hardcoded get_/set_ prefixes for properties, as
11680         IL allows for the properties to be named something else.  
11681
11682         Bug #56013
11683
11684         * expression.cs: Do not override operand before we know if it is
11685         non-null.  Fix 56207
11686
11687 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
11688
11689         * typemanager.cs: support for pinned variables.
11690
11691 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
11692
11693         * decl.cs, typemanager.cs: Avoid using an arraylist
11694         as a buffer if there is only one result set.
11695
11696 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
11697
11698         * expression.cs: Make sure you cant call a static method
11699         with an instance expression, bug #56174.
11700
11701 2004-03-29  Miguel de Icaza  <miguel@ximian.com>
11702
11703         * class.cs (IsDuplicateImplementation): Improve error reporting to
11704         flag 663 (method only differs in parameter modifier).
11705
11706         * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
11707         in preprocessor directives.
11708
11709         * location.cs (LookupFile): Allow for the empty path.
11710
11711         * attribute.cs (DefinePInvokeMethod): Fix 56148;  I would like a
11712         better approach for some of that patch, but its failing with the
11713         CharSet enumeration.  For now try/catch will do.
11714
11715         * typemanager.cs: Do not crash if a struct does not have fields.
11716         Fixes 56150.
11717
11718 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
11719
11720         * expression.cs: cs0213, cant fix a fixed expression.
11721         fixes 50231.
11722
11723 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
11724
11725         * cs-parser.jay: detect invalid embeded statements gracefully.
11726         bug #51113.
11727
11728 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
11729
11730         * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
11731         As a regex:
11732         s/
11733         the invocation type may not be a subclass of the tye of the item/
11734         The type of the item must be a subclass of the invocation item.
11735         /g
11736
11737         Fixes bug #50820.
11738
11739 2004-03-25  Sebastien Pouliot  <sebastien@ximian.com>
11740
11741         * attribute.cs: Added methods to get a string and a bool from an
11742         attribute. Required to information from AssemblyKeyFileAttribute,
11743         AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
11744         * codegen.cs: Modified AssemblyName creation to include support for
11745         strongnames. Catch additional exceptions to report them as CS1548.
11746         * compiler.csproj: Updated include CryptoConvert.cs.
11747         * compiler.csproj.user: Removed file - user specific configuration.
11748         * CryptoConvert.cs: New. A COPY of the class CryptoConvert from 
11749         Mono.Security assembly. The original class is maintained and tested in
11750         /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
11751         * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
11752         like CSC 8.0 (C# v2) supports.
11753         * Makefile: Added CryptoConvert.cs to mcs sources.
11754         * rootcontext.cs: Added new options for strongnames.
11755
11756 2004-03-24 Ben Maurer  <bmaurer@users.sourceforge.net>
11757
11758         * driver.cs: For --expect-error, report error code `2'
11759         if the program compiled with no errors, error code `1' if
11760         it compiled with an error other than the one expected.
11761
11762 2004-03-24  Sebastien Pouliot  <sebastien@ximian.com>
11763
11764         * compiler.csproj: Updated for Visual Studio .NET 2003.
11765         * compiler.csproj.user: Updated for Visual Studio .NET 2003.
11766         * compiler.sln: Updated for Visual Studio .NET 2003.
11767
11768 2004-03-24  Ravi Pratap M  <ravi@ximian.com>
11769
11770         * expression.cs: Fix bug #47234. We basically need to apply the
11771         rule that we prefer the conversion of null to a reference type
11772         when faced with a conversion to 'object' (csc behaviour).
11773
11774 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
11775
11776         * statement.cs: Shorter form for foreach, eliminates
11777         a local variable. r=Martin.
11778
11779 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
11780
11781         * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
11782         checks if we can use brtrue/brfalse to test for 0.
11783         * expression.cs: use the above in the test for using brtrue/brfalse.
11784         cleanup code a bit.
11785
11786 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
11787
11788         * expression.cs: Rewrite string concat stuff. Benefits:
11789
11790         - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
11791         - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
11792         rather than a concat chain.
11793
11794         * typemanager.cs: Add lookups for more concat overloads.
11795
11796 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
11797
11798         * expression.cs: Emit shorter il code for array init.
11799
11800         newarr
11801         dup
11802         // set 1
11803
11804         // set 2
11805
11806         newarr
11807         stloc.x
11808
11809         ldloc.x
11810         // set 1
11811
11812         ldloc.x
11813         // set 2
11814
11815 2004-03-22 Ben Maurer  <bmaurer@users.sourceforge.net>
11816
11817         * statement.cs: Before, two switch blocks would be merged if the
11818         total size of the blocks (end_item - begin_item + 1) was less than
11819         two times the combined sizes of the blocks.
11820
11821         Now, it will only merge if after the merge at least half of the
11822         slots are filled.
11823
11824         fixes 55885.
11825
11826 2004-03-20  Atsushi Enomoto  <atsushi@ximian.com>
11827
11828         * class.cs : csc build fix for GetMethods(). See bug #52503.
11829
11830 2004-03-20 Ben Maurer  <bmaurer@users.sourceforge.net>
11831
11832         * expression.cs: Make sure fp comparisons work with NaN.
11833         This fixes bug #54303. Mig approved this patch a long
11834         time ago, but we were not able to test b/c the runtime
11835         had a related bug.
11836
11837 2004-03-19  Miguel de Icaza  <miguel@ximian.com>
11838
11839         * ecore.cs (TypExpr.GetHashCode): implement this overload. 
11840
11841 2004-03-19  Martin Baulig  <martin@ximian.com>
11842
11843         * class.cs (MemberCore.IsDuplicateImplementation): Report the
11844         error here and not in our caller.
11845
11846 2004-03-19  Martin Baulig  <martin@ximian.com>
11847
11848         * interface.cs: Completely killed this file.
11849         (Interface): We're now a TypeContainer and live in class.cs.
11850
11851         * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
11852         argument; we're now also called for interfaces.
11853         (TypeContainer.DefineMembers): Allow this method being called
11854         multiple times.
11855         (TypeContainer.GetMethods): New public method; formerly known as
11856         Interface.GetMethod().  This is used by PendingImplementation.
11857         (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
11858         it's now private and non-static.
11859         (Interface): Moved this here; it's now implemented similar to
11860         Class and Struct.
11861         (Method, Property, Event, Indexer): Added `bool is_interface'
11862         argument to their .ctor's.
11863         (MemberBase.IsInterface): New public field.
11864
11865         * cs-parser.jay: Create normal Method, Property, Event, Indexer
11866         instances instead of InterfaceMethod, InterfaceProperty, etc.
11867         (opt_interface_base): Removed; we now use `opt_class_base' instead.
11868         (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
11869
11870 2004-03-19  Martin Baulig  <martin@ximian.com>
11871
11872         * class.cs (MethodCore.IsDuplicateImplementation): New private
11873         method which does the CS0111 checking.
11874         (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
11875         Use IsDuplicateImplementation().
11876
11877 2004-03-17 Ben Maurer  <bmaurer@users.sourceforge.net>
11878
11879         * decl.cs (FindMemberToOverride): New method to find the correct
11880         method or property to override in the base class.
11881         * class.cs
11882             - Make Method/Property use the above method to find the
11883               version in the base class.
11884             - Remove the InheritableMemberSignatureCompare as it is now
11885               dead code.
11886
11887         This patch makes large code bases much faster to compile, as it is
11888         O(n) rather than O(n^2) to do this validation.
11889
11890         Also, it fixes bug 52458 which is that nested classes are not
11891         taken into account when finding the base class member.
11892
11893         Reviewed/Approved by Martin.
11894
11895 2004-03-17  Marek Safar  <marek.safar@seznam.cz>
11896
11897         * interface.cs: In all interface classes removed redundant
11898         member initialization.
11899
11900 2004-03-16  Martin Baulig  <martin@ximian.com>
11901
11902         * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
11903
11904 2004-03-15  Miguel de Icaza  <miguel@ximian.com>
11905
11906         * decl.cs (DefineTypeAndParents): New helper method to define a
11907         type's containers before the type itself is defined;  This is a
11908         bug exposed by the recent changes to Windows.Forms when an
11909         implemented interface was defined inside a class that had not been
11910         built yet.   
11911
11912         * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
11913
11914         (Check): Loop correctly to report errors modifiers
11915         (UNSAFE was not in the loop, since it was the same as TOP).
11916
11917         * interface.cs: Every interface member now takes a ModFlags,
11918         instead of a "is_new" bool, which we set on the base MemberCore. 
11919
11920         Every place where we called "UnsafeOk" in the interface, now we
11921         call the proper member (InterfaceMethod.UnsafeOK) instead to get
11922         the unsafe settings from the member declaration instead of the
11923         container interface. 
11924
11925         * cs-parser.jay (opt_new): Allow unsafe here per the spec. 
11926
11927         * pending.cs (TypeAndMethods): Add `get_indexer_name' and
11928         `set_indexer_name' to the pending bits (one per type).
11929
11930         We fixed a bug today that was picking the wrong method to
11931         override, since for properties the existing InterfaceMethod code
11932         basically ignored the method name.  Now we make sure that the
11933         method name is one of the valid indexer names.
11934
11935 2004-03-14  Gustavo Giráldez  <gustavo.giraldez@gmx.net>
11936  
11937         * support.cs (SeekableStreamReader): Keep track of stream byte
11938         positions and don't mix them with character offsets to the buffer.
11939
11940         Patch from Gustavo Giráldez
11941
11942 2004-03-15  Marek Safar  <marek.safar@seznam.cz>
11943
11944         * interface.cs (InterfaceSetGetBase): Removed double member
11945         initialization, base class does it as well.
11946
11947 2004-03-13  Martin Baulig  <martin@ximian.com>
11948
11949         * class.cs: Reverted Miguel's latest commit; it makes mcs crash
11950         when compiling corlib.
11951
11952 2004-03-13  Miguel de Icaza  <miguel@ximian.com>
11953
11954         * convert.cs (ExplicitConversion): We were reporting an error on
11955         certain conversions (object_type source to a value type, when the
11956         expression was `null') before we had a chance to pass it through
11957         the user defined conversions.
11958
11959         * driver.cs: Replace / and \ in resource specifications to dots.
11960         Fixes 50752
11961
11962         * class.cs: Add check for duplicate operators.  Fixes 52477
11963
11964 2004-03-11  Miguel de Icaza  <miguel@ximian.com>
11965
11966         * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
11967         that are in the middle of the statements, not only at the end.
11968         Fixes #54987
11969
11970         * class.cs (TypeContainer.AddField): No longer set the
11971         `HaveStaticConstructor' flag, now we call it
11972         `UserDefineStaticConstructor' to diferentiate the slightly
11973         semantic difference.
11974
11975         The situation is that we were not adding BeforeFieldInit (from
11976         Modifiers.TypeAttr) to classes that could have it.
11977         BeforeFieldInit should be set to classes that have no static
11978         constructor. 
11979
11980         See:
11981
11982         http://www.yoda.arachsys.com/csharp/beforefieldinit.html
11983
11984         And most importantly Zoltan's comment:
11985
11986         http://bugzilla.ximian.com/show_bug.cgi?id=44229
11987
11988         "I think beforefieldinit means 'it's ok to initialize the type sometime 
11989          before its static fields are used', i.e. initialization does not need
11990          to be triggered by the first access to the type. Setting this flag
11991          helps the JIT to compile better code, since it can run the static
11992          constructor at JIT time, and does not need to generate code to call it
11993          (possibly lots of times) at runtime. Unfortunately, mcs does not set
11994          this flag for lots of classes like String. 
11995          
11996          csc sets this flag if the type does not have an explicit static 
11997          constructor. The reasoning seems to be that if there are only static
11998          initalizers for a type, and no static constructor, then the programmer
11999          does not care when this initialization happens, so beforefieldinit
12000          can be used.
12001          
12002          This bug prevents the AOT compiler from being usable, since it 
12003          generates so many calls to mono_runtime_class_init that the AOT code
12004          is much slower than the JITted code. The JITted code is faster, 
12005          because it does not generate these calls if the vtable is type is
12006          already initialized, which is true in the majority of cases. But the
12007          AOT compiler can't do this."
12008
12009 2004-03-10  Miguel de Icaza  <miguel@ximian.com>
12010
12011         * class.cs (MethodData.Emit): Refactor the code so symbolic
12012         information is generated for destructors;  For some reasons we
12013         were taking a code path that did not generate symbolic information
12014         before. 
12015
12016 2004-03-11 Ben Maurer  <bmaurer@users.sourceforge.net>
12017
12018         * class.cs: Create a Constructor.CheckBase method that
12019         takes care of all validation type code. The method
12020         contains some code that was moved from Define.
12021
12022         It also includes new code that checks for duplicate ctors.
12023         This fixes bug #55148.
12024
12025 2004-03-09  Joshua Tauberer <tauberer@for.net>
12026
12027         * expression.cs (ArrayCreation): Fix: More than 6 nulls in
12028         a { ... }-style array creation invokes EmitStaticInitializers
12029         which is not good for reference-type arrays.  String, decimal
12030         and now null constants (NullCast) are not counted toward
12031         static initializers.
12032
12033 2004-03-05  Martin Baulig  <martin@ximian.com>
12034
12035         * location.cs (SourceFile.HasLineDirective): New public field;
12036         specifies whether the file contains or is referenced by a "#line"
12037         directive.
12038         (Location.DefineSymbolDocuments): Ignore source files which
12039         either contain or are referenced by a "#line" directive.        
12040
12041 2004-02-29  Ben Maurer <bmaurer@users.sourceforge.net>
12042
12043         * class.cs (Method.CheckBase): Avoid using FindMembers, we have
12044         direct access to our parent, so check the method inline there.
12045
12046 2004-02-27 Ben Maurer  <bmaurer@users.sourceforge.net>
12047
12048         * expression.cs (Invocation.EmitCall): Miguel's last commit
12049         caused a regression. If you had:
12050
12051             T t = null;
12052             t.Foo ();
12053
12054         In Foo the implict this would be null.
12055
12056 2004-02-27  Miguel de Icaza  <miguel@ximian.com>
12057
12058         * expression.cs (Invocation.EmitCall): If the method is not
12059         virtual, do not emit a CallVirt to it, use Call.
12060
12061         * typemanager.cs (GetFullNameSignature): Improve the method to
12062         cope with ".ctor" and replace it with the type name.
12063
12064         * class.cs (ConstructorInitializer.Resolve): Now the method takes
12065         as an argument the ConstructorBuilder where it is being defined,
12066         to catch the recursive constructor invocations.
12067
12068 2004-02-26  Miguel de Icaza  <miguel@ximian.com>
12069
12070         * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
12071         routines to check if a type is an enumerable/enumerator allow
12072         classes that implement the IEnumerable or IEnumerator interfaces.
12073
12074         * class.cs (Property, Operator): Implement IIteratorContainer, and
12075         implement SetYields.
12076
12077         (Property.Define): Do the block swapping for get_methods in the
12078         context of iterators.   We need to check if Properties also
12079         include indexers or not.
12080
12081         (Operator): Assign the Block before invoking the
12082         OperatorMethod.Define, so we can trigger the Iterator code
12083         replacement. 
12084
12085         * cs-parser.jay (SimpleIteratorContainer): new helper class.  Both
12086         Property and Operator classes are not created when we parse the
12087         declarator but until we have the block completed, so we use a
12088         singleton SimpleIteratorContainer.Simple to flag whether the
12089         SetYields has been invoked.
12090
12091         We propagate this setting then to the Property or the Operator to
12092         allow the `yield' to function.
12093
12094 2004-02-25  Marek Safar  <marek.safar@seznam.cz>
12095
12096         * codegen.cs: Implemented attribute support for modules.
12097         New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
12098         Assembly/Module functionality.
12099
12100         * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
12101         interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
12102         Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
12103
12104 2004-02-16  Marek Safar  <marek.safar@seznam.cz>
12105
12106         * interface.cs (FindMembers): The operation is performed on all base
12107         interfaces and not only on the first. It is required for future CLS Compliance patch.
12108
12109 2004-02-12 Ben Maurer  <bmaurer@users.sourceforge.net>
12110
12111         * statement.cs, codegen.cs:
12112         This patch deals with patterns such as:
12113
12114         public class List : IEnumerable {
12115
12116                 public MyEnumerator GetEnumerator () {
12117                         return new MyEnumerator(this);
12118                 }
12119
12120                 IEnumerator IEnumerable.GetEnumerator () {
12121                         ...
12122                 }
12123                 
12124                 public struct MyEnumerator : IEnumerator {
12125                         ...
12126                 }
12127         }
12128
12129         Before, there were a few things we did wrong:
12130         1) we would emit callvirt on a struct, which is illegal
12131         2) we emited ldarg when we needed to emit ldarga
12132         3) we would mistakenly call the interface methods on an enumerator
12133         type that derived from IEnumerator and was in another assembly. For example:
12134
12135         public class MyEnumerator : IEnumerator
12136
12137         Would have the interface methods called, even if there were public impls of the
12138         method. In a struct, this lead to invalid IL code.
12139
12140 2004-02-11  Marek Safar  <marek.safar@seznam.cz>
12141
12142         * const.cs: Const is now derived from FieldBase. Method EmitConstant name
12143           renamed to Emit.
12144
12145         * delegate.cs (Define): Fixed crash when delegate type is undefined.
12146
12147 2004-02-11  Miguel de Icaza  <miguel@ximian.com>
12148
12149         * cs-parser.jay: Fix small regression: we were not testing V2
12150         compiler features correctly.
12151
12152         * interface.cs: If the emit context is null, then create one
12153
12154 2004-02-09  Marek Safar  <marek.safar@seznam.cz>
12155
12156         * decl.cs (GetSignatureForError): New virtual method to get full name
12157           for error messages.
12158
12159         * attribute.cs (IAttributeSupport): New interface for attribute setting.
12160           Now it is possible to rewrite ApplyAttributes method to be less if/else.
12161
12162         * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
12163           Duplicated members and code in these classes has been removed.
12164           Better encapsulation in these classes.
12165
12166 2004-02-07  Miguel de Icaza  <miguel@ximian.com>
12167
12168         * assign.cs (Assign.DoResolve): When dealing with compound
12169         assignments, there is a new rule in ECMA C# 2.4 (might have been
12170         there before, but it is documented here) that states that in:
12171
12172         a op= b;
12173
12174         If b is of type int, and the `op' is a shift-operator, then the
12175         above is evaluated as:
12176
12177         a = (int) a op b 
12178
12179         * expression.cs (Binary.ResolveOperator): Instead of testing for
12180         int/uint/long/ulong, try to implicitly convert to any of those
12181         types and use that in pointer arithmetic.
12182
12183         * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
12184         method to print information for from the type, not from the
12185         null-method we were given.
12186
12187 2004-02-01  Duncan Mak  <duncan@ximian.com>
12188
12189         * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
12190         parsing for cmd, fixes bug #53694.
12191
12192 2004-02-04  Marek Safar  <marek.safar@seznam.cz>
12193
12194         * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
12195         in the member name duplication tests. Property and operator name duplication
12196         was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
12197
12198 2004-02-03  Marek Safar  <marek.safar@seznam.cz>
12199
12200         * interface.cs (PopulateMethod): Fixed crash when interface method
12201         returns not existing type (error test cs0246-3.cs).
12202
12203 2004-02-02  Ravi Pratap M <ravi@ximian.com>
12204
12205         * cs-parser.jay (interface_accessors): Re-write actions to also
12206         store attributes attached to get and set methods. Fix spelling
12207         while at it.
12208
12209         (inteface_property_declaration): Modify accordingly.
12210
12211         (InterfaceAccessorInfo): New helper class to store information to pass
12212         around between rules that use interface_accessors.
12213
12214         * interface.cs (Emit): Apply attributes on the get and set
12215         accessors of properties and indexers too.
12216
12217         * attribute.cs (ApplyAttributes): Modify accordingly to use the
12218         right MethodBuilder when applying attributes to the get and set accessors.
12219
12220 2004-01-31  Miguel de Icaza  <miguel@ximian.com>
12221
12222         * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
12223
12224 2004-01-26  Miguel de Icaza  <miguel@ximian.com>
12225
12226         * cs-tokenizer.cs: Handle #line hidden from PDC bits.
12227
12228 2004-01-25  Miguel de Icaza  <miguel@ximian.com>
12229
12230         * cs-parser.jay: Remove YIELD token, instead use the new grammar
12231         changes that treat `yield' specially when present before `break'
12232         or `return' tokens.
12233
12234         * cs-tokenizer.cs: yield is no longer a keyword.
12235
12236 2004-01-23  Marek Safar  <marek.safar@seznam.cz>
12237
12238         * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
12239         setting for default constructors.
12240         For default constructors are almost every time set wrong Modifier. The
12241         generated IL code has been alright. But inside mcs this values was
12242         wrong and this was reason why several of my CLS Compliance tests
12243         failed.
12244
12245 2004-01-22  Martin Baulig  <martin@ximian.com>
12246
12247         * cs-parser.jay (namespace_or_type_name): Return an Expression,
12248         not a QualifiedIdentifier.  This is what `type_name_expression'
12249         was previously doing.
12250         (type_name_expression): Removed; the code is now in
12251         `namespace_or_type_name'.
12252         (qualified_identifier): Removed, use `namespace_or_type_name'
12253         instead.
12254         (QualifiedIdentifier): Removed this class.      
12255
12256 2004-01-22  Martin Baulig  <martin@ximian.com>
12257
12258         * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
12259         not a string as alias name.
12260
12261 2004-01-21  Miguel de Icaza  <miguel@ximian.com>
12262
12263         * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
12264         #52730 bug, and instead compute correctly the need to use a
12265         temporary variable when requesting an address based on the
12266         static/instace modified of the field and the constructor.
12267  
12268 2004-01-21  Martin Baulig  <martin@ximian.com>
12269
12270         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
12271         class and namespace before looking up aliases.  Fixes #52517.
12272
12273 2004-01-21  Martin Baulig  <martin@ximian.com>
12274
12275         * flowanalysis.cs (UsageVector.Merge): Allow variables being
12276         assinged in a 'try'; fixes exception4.cs.
12277
12278 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
12279         * class.cs : Implemented parameter-less constructor for TypeContainer
12280
12281         * decl.cs: Attributes are now stored here. New property OptAttributes
12282
12283         * delegate.cs, enum.cs, interface.cs: Removed attribute member.
12284
12285         * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
12286
12287 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
12288
12289         * typemanager.cs (CSharpSignature): Now reports also inner class name.
12290           (CSharpSignature): New method for indexer and property signature.
12291
12292 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
12293
12294         * pending.cs (IsVirtualFilter): Faster implementation.
12295
12296 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
12297
12298         * typemanager.cs: Avoid inclusion of same assembly more than once.
12299
12300 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
12301
12302         * cs-parser.jay: Fixed problem where the last assembly attribute
12303           has been applied also to following declaration (class, struct, etc.)
12304           
12305 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
12306
12307         * class.cs: Added error CS0538, CS0539 reporting.
12308         Fixed crash on Microsoft runtime when field type is void.
12309
12310         * cs-parser.jay: Added error CS0537 reporting.
12311
12312         * pending.cs: Added error CS0535 reporting.
12313         Improved error report for errors CS0536, CS0534.
12314
12315 2004-01-20  Miguel de Icaza  <miguel@ximian.com>
12316
12317         Merge a few bits from the Anonymous Method MCS tree.
12318
12319         * statement.cs (ToplevelBlock): New class for toplevel methods,
12320         will hold anonymous methods, lifted variables.
12321
12322         * cs-parser.jay: Create toplevel blocks for delegates and for
12323         regular blocks of code. 
12324
12325 2004-01-20  Martin Baulig  <martin@ximian.com>
12326
12327         * codegen.cs (EmitContext): Removed `InTry', `InCatch',
12328         `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
12329         and `NeedExplicitReturn'; added `IsLastStatement'.
12330         (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
12331         have a `ReturnLabel' or we're not unreachable.
12332
12333         * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
12334         child's reachability; don't just override ours with it.  Fixes
12335         #58058 (lluis's example).
12336         (FlowBranching): Added public InTryOrCatch(), InCatch(),
12337         InFinally(), InLoop(), InSwitch() and
12338         BreakCrossesTryCatchBoundary() methods.
12339
12340         * statement.cs (Return): Do all error checking in Resolve().
12341         Unless we are the last statement in a top-level block, always
12342         create a return label and jump to it.
12343         (Break, Continue): Do all error checking in Resolve(); also make
12344         sure we aren't leaving a `finally'.
12345         (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
12346         statement in a top-level block.
12347         (Block.Flags): Added `IsDestructor'.
12348         (Block.IsDestructor): New public property.
12349
12350 2004-01-20  Martin Baulig  <martin@ximian.com>
12351
12352         * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
12353
12354 2004-01-20  Martin Baulig  <martin@ximian.com>
12355
12356         * statement.cs (Statement.ResolveUnreachable): New public method.
12357         (If, While): Do the dead-code elimination in Resolve(), not in Emit().
12358         (Block.Resolve): Resolve unreachable statements.
12359
12360 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
12361
12362         * expression.cs: We need to fix the case where we do
12363         not have a temp variable here.
12364
12365         * assign.cs: Only expression compound assignments need
12366         temporary variables.
12367
12368 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
12369
12370         * flowanalysis.cs: Reduce memory allocation in a few ways:
12371           - A block with no variables should not allocate a bit
12372             vector for itself.
12373           - A method with no out parameters does not need any tracking
12374             for assignment of the parameters, so we need not allocate
12375             any data for it.
12376           - The arrays:
12377                 public readonly Type[] VariableTypes;
12378                 public readonly string[] VariableNames;
12379             Are redundant. The data is already stored in the variable
12380             map, so we need not allocate another array for it.
12381           - We need to add alot of checks for if (params | locals) == null
12382             due to the first two changes.
12383
12384 2004-01-18  Miguel de Icaza  <miguel@ximian.com>
12385
12386         * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
12387         implement IMemoryLocation, we store a copy on a local variable and
12388         take the address of it.  Patch from Benjamin Jemlich
12389
12390         * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
12391         to use a special "type_name_expression" rule which reduces the
12392         number of "QualifiedIdentifier" classes created, and instead
12393         directly creates MemberAccess expressions.
12394
12395 2004-01-17  Miguel de Icaza  <miguel@ximian.com>
12396
12397         * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
12398         that fixes #52853.  Null literal assignment to ValueType
12399
12400         * class.cs (MethodData.Emit): Instead of checking the name of the
12401         method to determine if its a destructor, create a new derived
12402         class from Method called Destructor, and test for that.  
12403
12404         * cs-parser.jay: Create a Destructor object instead of a Method.  
12405
12406         Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
12407
12408         Fixes: 52933
12409
12410 2004-01-16  Miguel de Icaza  <miguel@ximian.com>
12411
12412         * expression.cs (Binary.ResolveOperator): Perform an implicit
12413         conversion from MethodGroups to their delegate types on the
12414         Addition operation.
12415
12416         * delegate.cs: Introduce a new class DelegateCreation that is the
12417         base class for `NewDelegate' and `ImplicitDelegateCreation',
12418         factor some code in here.
12419
12420         * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
12421         conversion from MethodGroups to compatible delegate types. 
12422
12423         * ecore.cs (Expression.Resolve): Do not flag error 654
12424         (Methodgroupd needs parenthesis) if running on the V2 compiler, as
12425         we allow conversions from MethodGroups to delegate types now.
12426
12427         * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
12428         assignments in v2 either.
12429
12430 2004-01-10  Miguel de Icaza  <miguel@ximian.com>
12431
12432         * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
12433         static read-only fields in ctors.
12434
12435         Applied patch from Benjamin Jemlich 
12436
12437         * expression.cs (UnaryMutator): Avoid leaking local variables. 
12438
12439 2004-01-09  Miguel de Icaza  <miguel@ximian.com>
12440
12441         * cs-tokenizer.cs (IsCastToken): Allow the various native types
12442         here to return true, as they can be used like this:
12443
12444                 (XXX) int.MEMBER ()
12445
12446         Fixed 49836 and all the other dups
12447
12448 2004-01-09  Zoltan Varga  <vargaz@freemail.hu>
12449
12450         * driver.cs: Implement /win32res and /win32icon.
12451
12452 2004-01-08  Miguel de Icaza  <miguel@ximian.com>
12453
12454         * cs-parser.jay: Add a rule to improve error handling for the
12455         common mistake of placing modifiers after the type.
12456
12457 2004-01-07  Miguel de Icaza  <miguel@ximian.com>
12458
12459         * cs-parser.jay (interface_event_declaration): Catch
12460         initialization of events on interfaces, and report cs0068
12461
12462         * cs-parser.jay (interface_event_declaration): Catch
12463         initialization of events. 
12464
12465         * ecore.cs: Better report missing constructors.
12466
12467         * expression.cs (Binary.ResolveOperator): My previous bug fix had
12468         the error reporting done in the wrong place.  Fix.
12469
12470         * expression.cs (Binary.ResolveOperator): Catch the 
12471         operator + (E x, E y) error earlier, and later allow for implicit
12472         conversions in operator +/- (E e, U x) from U to the underlying
12473         type of E.
12474
12475         * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
12476         52596, if the container class is abstract, the default constructor
12477         is protected otherwise its public (before, we were always public).
12478
12479         * statement.cs (Fixed.Resolve): Catch a couple more errors in the
12480         fixed statement.
12481
12482         (Using.EmitLocalVariableDecls): Applied patch from Benjamin
12483         Jemlich that fixes bug #52597, MCS was generating invalid code for
12484         idisposable structs.   Thanks to Ben for following up with this
12485         bug as well.
12486
12487 2004-01-06  Miguel de Icaza  <miguel@ximian.com>
12488
12489         * driver.cs: Allow assemblies without code to be generated, fixes
12490         52230.
12491
12492 2004-01-07  Nick Drochak <ndrochak@gol.com>
12493
12494         * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
12495
12496 2004-01-05  Miguel de Icaza  <miguel@ximian.com>
12497
12498         * cs-parser.jay: Add rules to improve error reporting if fields or
12499         methods are declared at the namespace level (error 116)
12500
12501         * Add rules to catch event add/remove
12502
12503 2004-01-04  David Sheldon <dave-mono@earth.li>
12504
12505   * expression.cs: Added matching ")" to error message for 
12506   CS0077
12507
12508 2004-01-03 Todd Berman <tberman@gentoo.org>
12509
12510         * ecore.cs, attribute.cs:
12511         Applying fix from #52429.
12512
12513 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
12514
12515         * ecore.cs, expression.cs, statement.cs:
12516         Total rewrite of how we handle branching. We
12517         now handle complex boolean expressions with fewer
12518         jumps. As well if (x == 0) no longer emits a ceq.
12519
12520         if (x is Foo) is much faster now, because we generate
12521         better code.
12522
12523         Overall, we get a pretty big improvement on our benchmark
12524         tests. The code we generate is smaller and more readable.
12525
12526         I did a full two-stage bootstrap. The patch was reviewed
12527         by Martin and Miguel.
12528
12529 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
12530
12531         * cs-parser.jay: Make primary_expression not take a QI.
12532         we dont need this because the member_access rule covers
12533         us here. So we replace the rule with just IDENTIFIER.
12534
12535         This has two good effects. First, we remove a s/r conflict.
12536         Second, we allocate many fewer QualifiedIdentifier objects.
12537
12538 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
12539
12540         * attribute.cs: Handle MarshalAs attributes as pseudo, and
12541         set the correct information via SRE. This prevents
12542         hanging on the MS runtime. Fixes #29374.
12543
12544 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
12545
12546         * convert.cs: correctly handle conversions to value types
12547         from Enum and ValueType as unboxing conversions.
12548
12549         Fixes bug #52569. Patch by Benjamin Jemlich.
12550
12551 2004-01-02  Ravi Pratap  <ravi@ximian.com>
12552
12553         * expression.cs (BetterConversion): Prefer int -> uint
12554         over int -> ulong (csc's behaviour). This fixed bug #52046.
12555
12556 2004-01-02 Ben Maurer  <bmaurer@users.sourceforge.net>
12557
12558         * decl.cs (MemberCache.FindMembers): now returns a
12559         MemberInfo [].
12560
12561         * typemanager.cs: In general, go with with ^^.
12562         (CopyNewMethods): take an IList.
12563         (RealMemberLookup): Only allocate an arraylist
12564         if we copy from two sets of methods.
12565
12566         This change basically does two things:
12567         1) Fewer array lists allocated due to CopyNewMethods.
12568         2) the explicit cast in MemberList costed ALOT.
12569
12570 2004-01-02  Zoltan Varga  <vargaz@freemail.hu>
12571
12572         * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
12573         a hashtable to avoid needless string allocations when an identifier is
12574         used more than once (the common case).
12575
12576 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
12577
12578         * pending.cs: MS's TypeBuilder.GetInterfaces ()
12579         is broken, it will not return anything. So, we
12580         have to use the information we have in mcs to
12581         do the task.
12582
12583         * typemanager.cs: Add a cache for GetInterfaces,
12584         since this will now be used more often (due to ^^)
12585
12586         (GetExplicitInterfaces) New method that gets the
12587         declared, not effective, interfaces on a type
12588         builder (eg, if you have interface IFoo, interface
12589         IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
12590         { IBar }.
12591
12592         This patch makes MCS able to bootstrap itself on
12593         Windows again.
12594
12595 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
12596
12597         * expression.cs: Remove the Nop's that Miguel put
12598         in by mistake.
12599
12600 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
12601
12602         * report.cs, codegen.cs: Give the real stack trace to
12603         the error when an exception is thrown.
12604
12605 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
12606
12607         * decl.cs: only allocate hashtables for ifaces if 
12608         it is an iface!
12609
12610 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
12611
12612         * expression.cs: fix the error from cs0121-2.cs
12613         (a parent interface has two child interfaces that
12614         have a function with the same name and 0 params
12615         and the function is called through the parent).
12616
12617 2003-12-30 Ben Maurer  <bmaurer@users.sourceforge.net>
12618
12619         * class.cs, rootcontext.cs, typmanager.cs: do not
12620         leak pointers.
12621
12622 2003-12-28 Ben Maurer  <bmaurer@users.sourceforge.net>
12623
12624         * codegen.cs: remove stack for the ec flow branching.
12625         It is already a linked list, so no need.
12626
12627 2003-12-27 Ben Maurer  <bmaurer@users.sourceforge.net>
12628
12629         * Makefile: Allow custom profiler here.
12630
12631 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
12632
12633         * typemanager.cs (LookupType):
12634           - Use a static char [], because split takes
12635             a param array for args, so it was allocating
12636             every time.
12637           - Do not store true in a hashtable, it boxes.
12638
12639 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
12640
12641         * flowanalysis.cs: bytify common enums.
12642
12643 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
12644
12645         * modifiers.cs: Add a new set of flags for the
12646         flags allowed on explicit interface impls.
12647         * cs-parser.jay: catch the use of modifiers in
12648         interfaces correctly.
12649         * class.cs: catch private void IFoo.Blah ().
12650
12651         All related to bug #50572.
12652
12653 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
12654
12655         * decl.cs: Rewrite the consistant accessability checking.
12656         Accessability is not linear, it must be implemented in
12657         a tableish way. Fixes #49704.
12658
12659 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
12660
12661         * expression.cs: Handle negation in a checked context.
12662         We must use subtraction from zero. Fixes #38674.
12663
12664 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
12665
12666         * class.cs: Ignore static void main in DLLs.
12667         * rootcontext.cs: Handle the target type here,
12668         since we are have to access it from class.cs
12669         * driver.cs: account for the above.
12670
12671 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
12672
12673         * report.cs: Give line numbers and files if available.
12674
12675 2003-12-20  Zoltan Varga  <vargaz@freemail.hu>
12676
12677         * driver.cs: Implement /addmodule.
12678
12679         * typemanager.cs:  Change 'modules' field so it now contains Modules not
12680         ModuleBuilders.
12681
12682 2003-12-20  Martin Baulig  <martin@ximian.com>
12683
12684         * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
12685         (FieldBase.IsAssigned): Removed this field.
12686         (FieldBase.SetAssigned): New public method.
12687         (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
12688
12689 2003-12-20  Martin Baulig  <martin@ximian.com>
12690
12691         * expression.cs (LocalVariableReference.DoResolve): Don't set
12692         `vi.Used' if we're called from DoResolveLValue().
12693
12694         * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
12695         returns the usage vector it just merged into the current one -
12696         pass this one to UsageWarning().
12697         (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
12698         of the `EmitContext', don't call this recursively on our children.
12699
12700 2003-12-19  Zoltan Varga  <vargaz@freemail.hu>
12701
12702         * driver.cs: Implement /target:module.
12703
12704 2003-12-18  Zoltan Varga  <vargaz@freemail.hu>
12705
12706         * support.cs (CharArrayHashtable): New helper class.
12707
12708         * cs-tokenizer.cs: Store keywords in a hashtable indexed by 
12709         char arrays, not strings, so we can avoid creating a string in
12710         consume_identifier if the identifier is a keyword.
12711
12712 2003-12-16  Martin Baulig  <martin@ximian.com>
12713
12714         * statement.cs (LocalInfo.Assigned): Removed this property.
12715         (LocalInfo.Flags): Removed `Assigned'.
12716         (LocalInfo.IsAssigned): New public method; takes the EmitContext
12717         and uses flow analysis.
12718         (Block.UsageWarning): Made this method private.
12719         (Block.Resolve): Call UsageWarning() if appropriate.
12720
12721         * expression.cs (LocalVariableReference.DoResolve): Always set
12722         LocalInfo.Used here.
12723
12724 2003-12-13  Martin Baulig  <martin@ximian.com>
12725
12726         * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
12727         any value here; we're now using flow analysis to figure out
12728         whether a statement/block returns a value.
12729
12730 2003-12-13  Martin Baulig  <martin@ximian.com>
12731
12732         * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
12733         working again.
12734         (FlowBranching.MergeFinally): Don't call
12735         `branching.CheckOutParameters()' here, this is called in
12736         MergeTopBlock().
12737         (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
12738         when adding the `finally' vector.       
12739
12740 2003-12-13  Martin Baulig  <martin@ximian.com>
12741
12742         * flowanalysis.cs
12743         (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
12744         actually work and also fix #48962.
12745
12746 2003-12-12 Ben Maurer  <bmaurer@users.sourceforge.net>
12747
12748         * decl.cs: Do not check System.Object for nested types,
12749         since we know it does not have any. Big bang for buck:
12750
12751         BEFORE:
12752            Run 1:   8.35 seconds
12753            Run 2:   8.32 seconds
12754            corlib:  17.99 seconds
12755         AFTER:
12756            Run 1:   8.17 seconds
12757            Run 2:   8.17 seconds
12758            corlib:  17.39 seconds
12759
12760 2003-12-11 Ben Maurer  <bmaurer@users.sourceforge.net>
12761
12762         * class.cs (FindMembers): Allocate arraylists on demand. Most of the
12763         time we are returning 0 members, so we save alot here.
12764
12765 2003-12-11  Martin Baulig  <martin@ximian.com>
12766
12767         * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
12768         `MergeChild()', also just take the `FlowBranching' as argument;
12769         call Merge() on it and return the result.
12770         (FlowBranching.Merge): We don't need to do anything if we just
12771         have one sibling.
12772
12773 2003-12-11  Martin Baulig  <martin@ximian.com>
12774
12775         * flowanalysis.cs: Use a list of `UsageVector's instead of storing
12776         them in an `ArrayList' to reduce memory usage.  Thanks to Ben
12777         Maurer for this idea.
12778
12779 2003-12-11  Martin Baulig  <martin@ximian.com>
12780
12781         * flowanalysis.cs (MergeResult): This class is now gone; we now
12782         use the `UsageVector' for this.  The reason for this is that if a
12783         branching just has one sibling, we don't need to "merge" them at
12784         all - that's the next step to do.
12785         (FlowBranching.Merge): We now return a `UsageVector' instead of a
12786         `MergeResult'.
12787
12788 2003-12-11  Martin Baulig  <martin@ximian.com>
12789
12790         Reworked flow analyis and made it more precise and bug-free.  The
12791         most important change is that we're now using a special `Reachability'
12792         class instead of having "magic" meanings of `FlowReturns'.  I'll
12793         do some more cleanups and optimizations and also add some more
12794         documentation this week.
12795
12796         * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
12797         largely reworked this class.
12798         (FlowReturns): Removed `Unreachable' and `Exception'; we now use
12799         the new `Reachability' class instead of having "magic" values here.
12800         (FlowBranching): We're now using an instance of `Reachability'
12801         instead of having separate `Returns', `Breaks' etc. fields.
12802
12803         * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
12804         based on flow analysis; ignore the return value of block.Emit ().
12805
12806 2003-12-10  Zoltan Varga  <vargaz@freemail.hu>
12807
12808         * driver.cs typemanager.cs: Find the mono extensions to corlib even
12809         if they are private.
12810
12811 2003-12-09  Martin Baulig  <martin@ximian.com>
12812
12813         * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
12814         call them directly on the UsageVector.
12815
12816 2003-12-09  Martin Baulig  <martin@ximian.com>
12817
12818         * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
12819         Changed return type from `FlowReturns' to `Reachability'.
12820
12821 2003-12-09  Martin Baulig  <martin@ximian.com>
12822
12823         * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
12824         (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
12825         `Reachable' fields with a single `Reachability' one.
12826
12827 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
12828
12829         * class.cs (FindMembers): Remove foreach's.
12830
12831         Bootstrap times:
12832
12833         BEFORE
12834                 Run 1:   8.74 seconds
12835                 Run 2:   8.71 seconds
12836
12837         AFTER
12838                 Run 1:   8.64 seconds
12839                 Run 2:   8.58 seconds
12840
12841
12842 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
12843
12844         * cs-parser.jay:
12845         * gen-treedump.cs:
12846         * statement.cs:
12847         This patch does a few things:
12848                 1. EmptyStatement is now a singleton, so it is never reallocated.
12849                 2. All blah is EmptyStatement constructs have been changed to
12850                    blah == EmptyStatement.Value, which is much faster and valid
12851                    now that EmptyStatement is a singleton.
12852                 3. When resolving a block, rather than allocating a new array for
12853                    the non-empty statements, empty statements are replaced with
12854                    EmptyStatement.Value
12855                 4. Some recursive functions have been made non-recursive.
12856         Mainly the performance impact is from (3), however (1) and (2) are needed for
12857         this to work. (4) does not make a big difference in normal situations, however
12858         it makes the profile look saner.
12859
12860         Bootstrap times:
12861
12862         BEFORE
12863         9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
12864         9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
12865         Total memory allocated: 56397 KB
12866
12867         AFTER
12868         9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
12869         8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
12870         Total memory allocated: 55666 KB
12871
12872 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
12873
12874         * support.cs: Rewrite DoubleHash to use its own impl. Is faster
12875         than the hashtable in a hashtable version
12876
12877         * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
12878         we always end up concating a string. This results in a huge perf
12879         loss, because many strings have to be tracked by the GC. In this
12880         patch, we first use a hashtable that works with two keys, so that
12881         the strings do not need to be concat'ed.
12882
12883         Bootstrap times:
12884         BEFORE
12885                 Run 1:   8.74 seconds
12886                 Run 2:   8.71 seconds
12887
12888         AFTER
12889                 Run 1:   8.65 seconds
12890                 Run 2:   8.56 seconds
12891
12892 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
12893
12894         * Makefile: Add a new target `do-time' that does a quick and simple
12895         profile, leaving easy to parse output.
12896
12897 2003-12-08  Zoltan Varga  <vargaz@freemail.hu>
12898
12899         * codegen.cs (Init): Create the dynamic assembly with 
12900         AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
12901
12902 2003-12-02 Ben Maurer  <bmaurer@users.sourceforge.net>
12903
12904         * support.cs: Make the PtrHashtable use only one
12905         instance of its comparer.
12906
12907 2003-11-30  Zoltan Varga  <vargaz@freemail.hu>
12908
12909         * typemanager.cs: Fix lookup of GetNamespaces.
12910
12911 2003-11-29  Miguel de Icaza  <miguel@ximian.com>
12912
12913         * expression.cs: Removed redundant line.
12914
12915         * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
12916         ArrayLists, use for loops with bounds.  
12917
12918         * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
12919         arraylist.
12920
12921         * expression.cs (Invocation.OverloadResolve): Avoid foreach on
12922         arraylists, use for loop with bounds.
12923
12924         The above three changes give us a 0.071 second performance
12925         improvement out of 3.294 seconds down to 3.223.  On my machine
12926         the above changes reduced the memory usage by 1,387 KB during
12927         compiler bootstrap.
12928
12929         * cs-parser.jay (QualifiedIdentifier): New class used to represent
12930         QualifiedIdentifiers.  Before we created a new string through
12931         concatenation, and mostly later on, the result would be
12932         manipulated by DecomposeQI through string manipulation.
12933
12934         This reduced the compiler memory usage for bootstrapping from
12935         59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
12936         compile times in 0.05 seconds.
12937
12938 2003-11-28  Dick Porter  <dick@ximian.com>
12939
12940         * support.cs: Do string compares with the Invariant culture.
12941
12942         * rootcontext.cs: 
12943         * gen-treedump.cs: 
12944         * expression.cs: 
12945         * driver.cs: 
12946         * decl.cs: 
12947         * codegen.cs: 
12948         * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
12949         the comparison is done with the Invariant culture.
12950
12951 2003-11-27  Miguel de Icaza  <miguel@ximian.com>
12952
12953         * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
12954         GetEnumerator method.
12955
12956         (ProbeCollectionType): Iterate starting at the most specific type
12957         upwards looking for a GetEnumerator
12958
12959         * expression.cs: Shift count can be up to 31 for int/uint and 63
12960         for long/ulong.
12961
12962 2003-11-26  Miguel de Icaza  <miguel@ximian.com>
12963
12964         * statement.cs (Block.LookupLabel): Also look for the label on the
12965         children blocks.  Use a hash table to keep track of visited
12966         nodes. 
12967
12968         * cfold.cs (IntConstant to UIntConstant mapping): Only return if
12969         we actually did transform the other operand, otherwise fall back
12970         to the common codepath that casts to long.
12971
12972         * cs-tokenizer.cs: Use the same code pattern as the int case.
12973         Maybe I should do the parsing myself, and avoid depending on the
12974         Parse routines to get this done.
12975
12976 2003-11-25  Miguel de Icaza  <miguel@ximian.com>
12977
12978         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
12979         which fixes bug 51347.  This time test it.
12980
12981         * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
12982         attributes for example can not tell the difference between these.
12983         The difference was only a syntax feature of the language. 
12984
12985         * attribute.cs: Apply attributes to delegates.
12986
12987         * delegate.cs: Call the apply attributes method.
12988
12989 2003-11-24  Miguel de Icaza  <miguel@ximian.com>
12990
12991         * convert.cs (TryImplicitIntConversion): One line bug fix: we were
12992         comparing 0 vs Byte.MinValue, not the value
12993
12994         (ImplicitConversionRequired): When reporting a conversion error,
12995         use error 31 to print out the constant error instead of the
12996         simpler 29.
12997
12998         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
12999         which fixes bug 51347.
13000
13001 2003-11-22  Miguel de Icaza  <miguel@ximian.com>
13002
13003         * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen) 
13004         which fixes the -warnaserror command line option.
13005
13006 2003-11-21  Miguel de Icaza  <miguel@ximian.com>
13007
13008         * cfold.cs (DoNumericPromotions): During constant folding of
13009         additions on UIntConstant, special case intconstants with
13010         IntConstants like we do on the expression binary operator. 
13011
13012 2003-11-12  Miguel de Icaza  <miguel@ximian.com>
13013
13014         * convert.cs (ImplicitReferenceConversion): We were missing a case
13015         (System.Enum are not value types or class types, so we need to
13016         classify them separatedly).
13017
13018         * driver.cs: We do not support error 2007.
13019
13020 2003-11-12 Jackson Harper <jackson@ximian.com>
13021
13022         * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
13023         system directory. Also use the full file name so users can
13024         libraries names mscorlib-o-tron.dll in a non system dir.
13025
13026 2003-11-10  Martin Baulig  <martin@ximian.com>
13027
13028         * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
13029         (TypeManager.InitCoreTypes): Initialize them here, but instead of
13030         calling `ResolveType()' on them, directly assign their `Type'.
13031
13032 2003-11-08  Martin Baulig  <martin@ximian.com>
13033
13034         * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
13035         return value and the `out parent' parameter.
13036         (TypeContainer.DefineType): Moved the CS0644 check into
13037         GetClassBases().  Don't pass the interface types to the
13038         `builder.DefineType()'/`builder.DefineNestedType()', but resolve
13039         them later and then call `TypeBuilder.AddInterfaceImplementation()'.
13040
13041         * ecore.cs (TypeExpr.IsAttribute): New property.
13042         (TypeExpr.GetInterfaces): New method.
13043
13044         * interface.cs (Interface.GetInterfaceTypeByName): Return a
13045         TypeExpr instead of a Type.
13046         (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
13047         (Interface.DefineType): Don't pass the interface types to the
13048         `builder.Definetype()'/`builder.DefineNestedType()', but resolve
13049         them later and then call `TypeBulider.AddInterfaceImplementation()'.
13050
13051         * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
13052         instead of a `Type[]'.
13053         (TypeManager.RegisterBuilder): Likewise.
13054         (TypeManager.AddUserInterface): Likewise.
13055         (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
13056         `Type[]' and also return a `TypeExpr[]'.
13057         (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
13058
13059 2003-11-08  Martin Baulig  <martin@ximian.com>
13060
13061         * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
13062         Expression.     
13063
13064 2003-11-08  Martin Baulig  <martin@ximian.com>
13065
13066         * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
13067         TypeManager.ResolveExpressionTypes().
13068
13069         * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
13070         instead of an Expression.
13071         (TypeExpr): This is now an abstract base class for `TypeExpression'.
13072         (TypeExpression): New public class; formerly known as `TypeExpr'.
13073
13074         * expression.cs (ComposedCast): Derive from TypeExpr.
13075
13076         * typemanager.cs (TypeManager.system_*_expr): These are now
13077         TypExpr's instead of Expression's.
13078         (TypeManager.ResolveExpressionTypes): New public static function;
13079         called from DeclSpace.GetTypeResolveEmitContext() to resolve all
13080         of them.        
13081
13082 2003-11-06  Miguel de Icaza  <miguel@ximian.com>
13083
13084         * expression.cs (New.DoResolve): Do not dereference value that
13085         might be a null return.
13086
13087         * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
13088         sure that the constant value has the right type.  Fixes an
13089         unreported bug, similar to 50425.
13090
13091         * const.cs (Const.LookupConstantValue): Call
13092         ImplicitStandardConversionExists before doing a conversion to
13093         avoid havng the TypeManager.ChangeType do conversions.
13094
13095         Reduced the number of casts used
13096
13097         (Const.ChangeType): New routine to enable reuse of the constant
13098         type changing code from statement.
13099
13100         * typemanager.cs (ChangeType): Move common initialization to
13101         static global variables.
13102
13103         Fixes #50425.
13104
13105         * convert.cs (ImplicitReferenceConversion): Somehow we allowed
13106         every value type to go through, even if it was void.  Fix that. 
13107
13108         * cs-tokenizer.cs: Use is_identifier_start_character on the start
13109         character of the define, and the is_identifier_part_character for
13110         the rest of the string.
13111
13112 2003-11-05  Miguel de Icaza  <miguel@ximian.com>
13113
13114         * expression.cs (UnaryMutator.EmitCode): When I updated
13115         LocalVariableReference.DoResolve, I overdid it, and dropped an
13116         optimization done on local variable references.
13117
13118 2003-11-04  Miguel de Icaza  <miguel@ximian.com>
13119
13120         * ecore.cs: Convert the return from Ldlen into an int.
13121
13122 2003-10-20  Miguel de Icaza  <miguel@ximian.com>
13123
13124         * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
13125         the accessibility, this is a special case for toplevel non-public
13126         classes (internal for instance).
13127
13128 2003-10-20  Nick Drochak <ndrochak@gol.com>
13129
13130         * ecore.cs: Fix typo and build.  Needed another right paren.
13131
13132 2003-10-19  Miguel de Icaza  <miguel@ximian.com>
13133
13134         * ecore.cs: Applied fix from Ben Maurer.   We were handling in the
13135         `internal' case regular and protected, but not allowing protected
13136         to be evaluated later.  Bug 49840
13137
13138 2003-10-15  Miguel de Icaza  <miguel@ximian.com>
13139
13140         * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
13141         to kb.Nlast, and not the kb.nFirst to isolate the switch
13142         statement.
13143
13144         Extract the underlying type, so enumerations of long/ulong are
13145         treated like long/ulong.
13146
13147 2003-10-14  Miguel de Icaza  <miguel@ximian.com>
13148
13149         * expression.cs (New): Overload the meaning of RequestedType to
13150         track the possible creation of the NewDelegate type, since
13151         DoResolve is invoked more than once for new constructors on field
13152         initialization.
13153
13154         See bugs: #48800 and #37014
13155
13156         * cs-parser.jay (declare_local_constants): Take an arraylist
13157         instead of a single constant.
13158
13159         (local_constant_declaration): It should take a
13160         constant_declarators, not a constant_declarator.  Fixes 49487
13161
13162         * convert.cs: Fix error report.
13163
13164 2003-10-13 Jackson Harper <jackson@ximian.com>
13165
13166         * typemanager.cs (TypeToCoreType): Add float and double this fixes
13167         bug #49611
13168
13169 2003-10-09  Martin Baulig  <martin@ximian.com>
13170
13171         * class.cs (MethodCore): Added additional `DeclSpace ds' argument
13172         to the .ctor.
13173         (MethodCore.DoDefineParameters): Removed the TypeContainer
13174         argument; use the DeclSpace which was passed to the .ctor instead.
13175         (MethodCore.CheckParameter): Take a DeclSpace instead of a
13176         TypeContainer; we only need a DeclSpace here.
13177
13178 2003-10-09  Martin Baulig  <martin@ximian.com>
13179
13180         * class.cs (MethodData): Added additional `DeclSpace ds' argument
13181         to the .ctor.
13182         (MethodData.Define, MethodData.Emit): Pass the `ds' to the
13183         EmitContext's .ctor.    
13184
13185 2003-10-09  Martin Baulig  <martin@ximian.com>
13186
13187         * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
13188         (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
13189         AsAccessible(), moved them as well.
13190
13191         * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
13192
13193 2003-10-08  Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
13194
13195         * cs-parser.jay : Renamed yyName to yyNames related to jay.
13196
13197 2003-10-07  Miguel de Icaza  <miguel@ximian.com>
13198
13199         * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
13200         generation for >=, as spotted by Paolo, bug 48679.  
13201         Patch from David Waite.
13202
13203         * cs-tokenizer.cs: Add handling for #pragma.
13204
13205         * cs-parser.jay: Allow for both yield and yield return in the
13206         syntax.  The anti-cobolization of C# fight will go on!
13207
13208         * class.cs (TypeBuilder.DefineType): Catch error condition here
13209         (Parent.DefineType erroring out and returning null).
13210
13211         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
13212         coping with enumerations variables, we were mistakenly processing
13213         them as a regular value type instead of built-in types.  Fixes the
13214         bug #48063
13215
13216         * typemanager.cs (IsBuiltinOrEnum): New method.
13217
13218 2003-09-30  Miguel de Icaza  <miguel@ximian.com>
13219
13220         * cs-parser.jay: Upgrade: yield now needs the return clause.
13221
13222 2003-09-19  Martin Baulig  <martin@ximian.com>
13223
13224         * decl.cs (MemberCache.SetupCacheForInterface): Take a
13225         `MemberCache parent' argument.  Normally, an interface doesn't
13226         have a parent type except System.Object, but we use this in gmcs
13227         for generic type parameters.
13228
13229 2003-09-18  Martin Baulig  <martin@ximian.com>
13230
13231         * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
13232         on `type.IsInterface'; don't check whether the type has a parent
13233         to determine whether it's an interface.
13234
13235 2003-09-15  Martin Baulig  <martin@ximian.com>
13236
13237         * class.cs (TypeContainer.DefineType): Added an error flag to
13238         avoid reporting duplicate CS0146's ("class definition is
13239         circular.").
13240
13241         * driver.cs (Driver.MainDriver): Abort if
13242         RootContext.ResolveTree() reported any errors.
13243
13244 2003-09-07  Martin Baulig  <martin@ximian.com>
13245
13246         * report.cs (Error, Warning): Added overloaded versions which take
13247         a `params object[] args' and call String.Format().
13248
13249 2003-09-07  Martin Baulig  <martin@ximian.com>
13250
13251         * decl.cs (DeclSpace..ctor): Don't call
13252         NamespaceEntry.DefineName() here; do it in RecordDecl() which is
13253         called from Tree.RecordDecl().  Fixes the CS0101 reporting.
13254         (DeclSpace.RecordDecl): New method.
13255
13256         * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
13257
13258 2003-09-02  Ravi Pratap  <ravi@ximian.com>
13259
13260         * attribute.cs (CheckAttributeTarget): Ensure that we allow return
13261         value attributes to be applied to ParameterBuilders.
13262
13263         * class.cs (MethodCore.LabelParameters): Make static and more
13264         generic so that it can be used from other places - like interface
13265         methods, for instance.
13266
13267         * interface.cs (Interface.Emit): Call LabelParameters before
13268         emitting attributes on the InterfaceMethod.
13269
13270 2003-08-26  Martin Baulig  <martin@ximian.com>
13271
13272         * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
13273         resolving aliases; fixes #47927.
13274
13275 2003-08-26  Martin Baulig  <martin@ximian.com>
13276
13277         * statement.cs (Using.DoResolve): This is internally emitting a
13278         try/finally clause, so we need to set ec.NeedExplicitReturn if we
13279         do not always return.  Fixes #47681.
13280
13281 2003-08-26  Martin Baulig  <martin@ximian.com>
13282
13283         * decl.cs (MemberCore): Moved WarningNotHiding(),
13284         Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
13285         into MemberBase.
13286         (AdditionResult): Make this nested in DeclSpace.
13287         (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
13288         argument; call NamespaceEntry.Define() unless we're nested in a
13289         class or struct.
13290
13291         * namespace.cs (Namespace.DefineName): New public function.  This
13292         is called from DeclSpace's .ctor to add 
13293         (Namespace.Lookup): Include DeclSpaces in the lookup.
13294
13295         * class.cs (Operator): Derive from MemberBase, not MemberCore.
13296
13297         * const.cs (Const): Derive from MemberBase, not MemberCore.     
13298
13299 2003-08-25  Martin Baulig  <martin@ximian.com>
13300
13301         * convert.cs (Convert.ExplicitReferenceConversion): When
13302         converting from an interface type to a class, unbox if the target
13303         type is a struct type.  Fixes #47822.
13304
13305 2003-08-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13306
13307         * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
13308         #47854.
13309
13310 2003-08-22  Martin Baulig  <martin@ximian.com>
13311
13312         * class.cs (TypeManager.DefineType): When defining a nested type,
13313         call DefineType() on our parent; fixes #47801.
13314
13315 2003-08-22  Martin Baulig  <martin@ximian.com>
13316
13317         * class.cs (MethodData.Define): While checking if a method is an
13318         interface implementation, improve the test a bit more to fix #47654.
13319
13320 2003-08-22  Martin Baulig  <martin@ximian.com>
13321
13322         * expression.cs (Probe.DoResolve): Check whether `expr' resolved
13323         correctly; fixes #47722.
13324
13325 2003-08-22  Martin Baulig  <martin@ximian.com>
13326
13327         * expression.cs (UnaryMutator.ResolveVariable): If the target is a
13328         LocalVariableReference, ensure it's not read-only.  Fixes #47536.
13329
13330         * statement.cs (Fixed.DoResolve): Make all variables read-only. 
13331
13332 2003-08-22  Martin Baulig  <martin@ximian.com>
13333
13334         * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
13335         can only be assigned in static constructors.  Fixes #47161.
13336
13337 2003-08-22  Martin Baulig  <martin@ximian.com>
13338
13339         Rewrote and improved the flow analysis code.
13340
13341         * flowbranching.cs (FlowBranching): Make this class abstract.
13342         (FlowBranching.CreateBranching): New static function to create a
13343         new flow branching.
13344         (FlowBranchingBlock, FlowBranchingException): New classes.
13345         (FlowBranching.UsageVector.Type): New public readonly field.
13346         (FlowBranching.UsageVector.Breaks): Removed the setter.
13347         (FlowBranching.UsageVector.Returns): Removed the setter.
13348         (FlowBranching.UsageVector): Added Break(), Return(),
13349         NeverReachable() and Throw() methods to modify the reachability.
13350         (FlowBranching.UsageVector.MergeChildren): Removed, this is now
13351         done by FlowBranching.Merge().
13352         (FlowBranching.UsageVector.MergeChild): New method; merges the
13353         merge result into the current vector.
13354         (FlowBranching.Merge): New abstract method to merge a branching.
13355
13356 2003-08-12  Martin Baulig  <martin@ximian.com>
13357
13358         * expression.cs (Indirection.CacheTemporaries): Create the
13359         LocalTemporary with the pointer type, not its element type.
13360
13361 2003-08-10  Miguel de Icaza  <miguel@ximian.com>
13362
13363         * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
13364         token was a keyword or not.
13365
13366         Add `error' options where an IDENTIFIER was expected;  Provide
13367         CheckToken and CheckIdentifierToken convenience error reporting
13368         functions. 
13369
13370         Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
13371
13372         * decl.cs: Rename `NamespaceEntry Namespace' public field into
13373         NameSpaceEntry NameSpaceEntry.
13374
13375         (LookupInterfaceOrClass): Avoid creating a full qualified name
13376         from namespace and name: avoid doing lookups when we know the
13377         namespace is non-existant.   Use new Tree.LookupByNamespace which
13378         looks up DeclSpaces based on their namespace, name pair.
13379
13380         * driver.cs: Provide a new `parser verbose' to display the
13381         exception thrown during parsing.  This is turned off by default
13382         now, so the output of a failure from mcs is more graceful.
13383
13384         * namespace.cs: Track all the namespaces defined in a hashtable
13385         for quick lookup.
13386
13387         (IsNamespace): New method
13388
13389 2003-08-09  Miguel de Icaza  <miguel@ximian.com>
13390
13391         * namespace.cs: Remove redundant call;  Avoid using MakeFQN when
13392         we know that we need to concatenate (full typename can never be
13393         null). 
13394
13395         * class.cs: ditto.
13396
13397         * statement.cs: Use a bitfield;  Do not initialize to null things
13398         which are done by the constructor by default.
13399
13400         * cs-parser.jay: bug fix, parameter was 4, not 3.
13401
13402         * expression.cs: Just use the property;
13403
13404         * statement.cs: No need for GetVariableInfo method.
13405
13406 2003-08-08  Martin Baulig  <martin@ximian.com>
13407
13408         * flowanalysis.cs (FlowReturns): This is now nested in the
13409         `FlowBranching' class.
13410         (MyBitVector): Moved this here from statement.cs.
13411         (FlowBranching.SiblingType): New enum type.
13412         (FlowBranching.CreateSibling): Added `SiblingType' argument.
13413
13414 2003-08-07  Martin Baulig  <martin@ximian.com>
13415
13416         * flowanalysis.cs (FlowBranchingType): This is now nested in the
13417         `FlowBranching' class and called `BranchingType'.
13418
13419 2003-08-07  Martin Baulig  <martin@ximian.com>
13420
13421         * flowanalysis.cs: Moved all the control flow analysis code into
13422         its own file.
13423
13424 2003-08-07  Martin Baulig  <martin@ximian.com>
13425
13426         * assign.cs (Assign.DoResolve): `target' must either be an
13427         IAssignMethod or an EventAccess; report a CS0131 otherwise.  Fixes
13428         #37319.
13429
13430 2003-08-07  Miguel de Icaza  <miguel@ximian.com>
13431
13432         * expression.cs (BinaryMethod): This kind of expression is created by the
13433         Binary class if it determines that the operator has to be handled
13434         by a method.
13435
13436         (BinaryDelegate): This kind of expression is created if we are
13437         dealing with a + or - operator on delegates.
13438
13439         (Binary): remove method, argumetns, and DelegateOperator: when
13440         dealing with methods, 
13441
13442         * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
13443
13444         * statement.cs (Block): use bitfields for the three extra booleans
13445         we had in use.   Remove unused topblock parameter.
13446
13447         * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
13448
13449         * assign.cs: Drop extra unneeded tests.
13450
13451 2003-08-06  Miguel de Icaza  <miguel@ximian.com>
13452
13453         * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
13454
13455         * statement.cs (Foreach): Use VariableStorage instead of
13456         LocalBuilders.   
13457
13458         * codegen.cs (VariableStorage): New class used by clients that
13459         require a variable stored: locals or fields for variables that
13460         need to live across yield.
13461
13462         Maybe provide a convenience api for EmitThis+EmitLoad?
13463
13464         (GetTemporaryLocal, FreeTemporaryLocal): Recycle
13465         these bad boys.
13466
13467 2003-08-05  Miguel de Icaza  <miguel@ximian.com>
13468
13469         * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
13470         RemapParameterLValue): New methods that are used to turn a
13471         precomputed FieldInfo into an expression like this:
13472
13473                 instance.FieldInfo
13474
13475         The idea is to use this instead of making LocalVariableReference
13476         have more than one meaning.
13477
13478         * cs-parser.jay: Add error production to BASE.
13479
13480         * ecore.cs: Deal with TypeManager.GetField returning null, which
13481         is now a valid return value.
13482
13483         (FieldExprNoAddress): New expression for Fields whose address can
13484         not be taken.
13485
13486         * expression.cs (LocalVariableReference): During the resolve
13487         phases, create new expressions if we are in a remapping context.
13488         Remove code that dealt with remapping here.
13489
13490         (ParameterReference): same.
13491
13492         (ProxyInstance): New expression, like the `This' expression, but
13493         it is born fully resolved.  We know what we are doing, so remove
13494         the errors that are targeted to user-provided uses of `this'.
13495
13496         * statement.cs (Foreach): our variable is now stored as an
13497         Expression;  During resolution, follow the protocol, dont just
13498         assume it will return this.
13499
13500 2003-08-06  Martin Baulig  <martin@ximian.com>
13501
13502         * support.cs (SeekableStreamReader.cs): New public class.
13503
13504         * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
13505         SeekableStreamReader instead of the normal StreamReader.
13506
13507 2003-08-04  Martin Baulig  <martin@ximian.com>
13508
13509         * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
13510         CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
13511         deambiguate casts and delegate invocations.
13512         (parenthesized_expression): Use the new tokens to ensure this is
13513         not a cast of method invocation.
13514
13515         * cs-tokenizer.cs (is_punct): Return one of the new special tokens
13516         when reading a `)' and Deambiguate_CloseParens () was previously
13517         called.
13518
13519         * expression.cs (ParenthesizedExpression): New class.  This is
13520         just used for the CS0075 test.
13521         (Binary.DoResolve): Check for CS0075.   
13522
13523 2003-07-29  Ravi Pratap  <ravi@ximian.com>
13524
13525         * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
13526         Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
13527         reference comparison.
13528
13529         (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
13530         examine the ReturnType for equality - this is necessary in the
13531         cases of implicit and explicit operators whose signature also
13532         includes the return type.
13533
13534 2003-07-26  Miguel de Icaza  <miguel@ximian.com>
13535
13536         * namespace.cs: Cache the result of the namespace computation,
13537         instead of computing it every time.
13538
13539 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
13540
13541         * decl.cs: Use a global arraylist that we reuse over invocations
13542         to avoid excesive memory consumption.  Reduces memory usage on an
13543         mcs compile by one meg (45 average).
13544
13545         * typemanager.cs (LookupTypeReflection): In .NET pointers are
13546         private, work around that.
13547
13548 2003-07-23  Miguel de Icaza  <miguel@ximian.com>
13549
13550         * literal.cs (IntLiteral): Define Zero and One static literals. 
13551
13552         * cs-parser.jay (integer_literal): use static literals to reduce
13553         memory usage for the most used literals (0, 1 and -1).  211kb
13554         reduced in memory usage.
13555
13556         Replace all calls to `new ArrayList' with `new
13557         ArrayList(4)' which is a good average number for most allocations,
13558         and also requires only 16 bytes of memory for its buffer by
13559         default. 
13560
13561         This reduced MCS memory usage in seven megabytes for the RSS after
13562         bootstrapping.
13563
13564 2003-07-28  Ravi Pratap  <ravi@ximian.com>
13565
13566         * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
13567         handle params methods the correct way by forming only one
13568         applicable set with params and normal methods in them. Earlier we
13569         were looking at params methods only if we found no normal methods
13570         which was not the correct thing to do.
13571
13572         (Invocation.BetterFunction): Take separate arguments indicating
13573         when candidate and the best method are params methods in their
13574         expanded form.
13575
13576         This fixes bugs #43367 and #46199.
13577
13578         * attribute.cs: Documentation updates.
13579
13580         (CheckAttribute): Rename to CheckAttributeTarget.
13581         (GetValidPlaces): Rename to GetValidTargets.
13582
13583         * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
13584         bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
13585
13586         Fixes bug #44468.
13587
13588 2003-07-28  Martin Baulig  <martin@ximian.com>
13589
13590         * class.cs (TypeContainer.DefineMembers): Use the base type's full
13591         name when looking up the base class of a nested class.  Fixes #46977.
13592
13593 2003-07-26  Martin Baulig  <martin@ximian.com>
13594
13595         * expression.cs (Indexers.Indexer): New nested struct; contains
13596         getter, setter and the indexer's type.
13597         (Indexers.Properties): This is now an ArrayList of
13598         Indexers.Indexer's.
13599         (IndexerAccess.DoResolveLValue): Correctly set the type if the
13600         indexer doesn't have any getters.
13601
13602         * assign.cs (Assign.DoResolve): Also do the implicit conversions
13603         for embedded property and indexer assignments.
13604
13605 2003-07-26  Martin Baulig  <martin@ximian.com>
13606
13607         * cs-tokenizer.cs (Tokenizer.xtoken): Report a CS1040 if a
13608         preprocessor directive is not the first non-whitespace character
13609         on a line.
13610
13611 2003-07-26  Martin Baulig  <martin@ximian.com>
13612
13613         * namespace.cs (NamespaceEntry.Lookup): New method; rewrote the
13614         namespace parsing, follow the spec more closely.
13615
13616         * rootcontext.cs (RootContext.NamespaceLookup): Use the new
13617         NamespaceEntry.Lookup().
13618
13619 2003-07-25  Martin Baulig  <martin@ximian.com>
13620
13621         * MethodCore.cs (OverridesSomething): New public field; it's set
13622         from TypeContainer.DefineMembers if this method overrides
13623         something (which doesn't need to be a method).  Fix #39462.
13624
13625 2003-07-25  Ravi Pratap  <ravi@ximian.com>
13626
13627         * typemanager.cs (GetMembers): Ensure that the list of members is
13628         reversed. This keeps things in sync.
13629
13630         * attribute.cs (Attribute.CheckAttribute): Break as soon as we
13631         find an AttributeUsage attribute.
13632
13633         * expression.cs (Invocation.OverloadResolve): Perform the check
13634         which disallows Invoke to be directly called on a Delegate.
13635
13636         (Error_InvokeOnDelegate): Report error cs1533.
13637
13638 2003-07-25  Martin Baulig  <martin@ximian.com>
13639
13640         * expression.cs (Indexers.GetIndexersForType): Only look in the
13641         interface hierarchy if the requested type is already an
13642         interface.  Fixes #46788 while keeping #46502 fixed.
13643
13644 2003-07-25  Martin Baulig  <martin@ximian.com>
13645
13646         * class.cs (TypeContainer.DefineMembers): Check whether all
13647         readonly fields have been assigned and report warning CS0649 if
13648         not.
13649
13650         * statement.cs (LocalInfo.IsFixed): Always return true if this is
13651         a valuetype.
13652
13653 2003-07-24  Ravi Pratap  <ravi@ximian.com>
13654
13655         * decl.cs (MemberCache.AddMethods): Reverse the order of the array
13656         returned from GetMethods to make things consistent with the
13657         assumptions MCS makes about ordering of methods.
13658
13659         This should comprehensively fix bug #45127 and it does :-)
13660
13661         * ecore.cs (MethodGroupExpr.DeclaringType): Correct bug - the
13662         ordering is actually reverse.
13663
13664         * Clean up some debug messages I left lying around.
13665
13666         * interface.cs (Populate*): Get rid of code which emits attributes
13667         since the stage in which we emit attributes is the 'Emit' stage,
13668         not the define stage.
13669
13670         (Emit): Move attribute emission for interface members here.
13671
13672 2003-07-22  Ravi Pratap  <ravi@ximian.com>
13673
13674         * expression.cs (Invocation.OverloadResolve): Follow the spec more
13675         closely: we eliminate methods in base types when we have an
13676         applicable method in a top-level type.
13677
13678         Please see section 14.5.5.1 for an exact description of what goes
13679         on. 
13680
13681         This fixes bug #45127 and a host of other related to corlib compilation.
13682
13683         * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
13684         array is the method corresponding to the top-level type (this is
13685         because of the changes made to icall.c) so we change this
13686         accordingly.
13687
13688         (MethodGroupExpr.Name): This too.
13689
13690         * typemanager.cs (GetElementType): New method which does the right
13691         thing when compiling corlib. 
13692
13693         * everywhere: Make use of the above in the relevant places.
13694
13695 2003-07-22  Martin Baulig  <martin@ximian.com>
13696
13697         * cs-parser.jay (invocation_expression): Moved
13698         `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
13699         `cast_expression', but create a InvocationOrCast which later
13700         resolves to either an Invocation or a Cast.
13701
13702         * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
13703         method; call this before EmitStatement() to make sure that this
13704         expression can be used as a statement.
13705
13706         * expression.cs (InvocationOrCast): New class; resolves to either
13707         an Invocation or a Cast.
13708
13709         * statement.cs (StatementExpression): Call ResolveStatement() on
13710         the ExpressionStatement before emitting it.
13711
13712 2003-07-21  Martin Baulig  <martin@ximian.com>
13713
13714         * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
13715         `ref' and `out' attributes match; fixes #46220.
13716         (MemberAccess.ResolveMemberAccess): You can't reference a type
13717         through an expression; fixes #33180.
13718         (Indexers.GetIndexersForType): Don't return the indexers from
13719         interfaces the class implements; fixes #46502.
13720
13721 2003-07-21  Martin Baulig  <martin@ximian.com>
13722
13723         * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
13724         CS0661 checks; fixes bug #30442.
13725
13726 2003-07-21  Martin Baulig  <martin@ximian.com>
13727
13728         * decl.cs (AdditionResult): Added `Error'.
13729
13730         * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
13731
13732         * typemanager.cs (TypeManager.ChangeType): Catch exceptions;
13733         makes cs0031.cs actually work.
13734
13735 2003-07-20  Martin Baulig  <martin@ximian.com>
13736
13737         * namespace.cs: Fixed that bug which caused a crash when compiling
13738         the debugger's GUI.
13739
13740 2003-07-20  Miguel de Icaza  <miguel@ximian.com>
13741
13742         * typemanager.cs (LookupTypeReflection): Never expose types which
13743         are NotPublic, NestedPrivate, NestedAssembly, or
13744         NestedFamANDAssem.  We used to return these, and later do a check
13745         that would report a meaningful error, but the problem is that we
13746         would not get the real match, if there was a name override.
13747
13748 2003-07-18  Miguel de Icaza  <miguel@ximian.com>
13749
13750         * namespace.cs (Namespace, Name): Do not compute the namespace
13751         name dynamically, compute it in the constructor.  This reduced
13752         memory usage by 1697 KB.
13753
13754         * driver.cs: Use --pause to pause at the end.
13755
13756 2003-07-17  Peter Williams  <peter@newton.cx>
13757
13758         * Makefile: Change the name of the test target so that it doesn't
13759         conflict with the recursive test target.
13760
13761 2003-07-17  Miguel de Icaza  <miguel@ximian.com>
13762
13763         * expression.cs (LocalVariableReference.Emit, EmitAssign,
13764         AddressOf): Do not use EmitThis, that was wrong, use the actual
13765         this pointer.
13766
13767 2003-07-15  Miguel de Icaza  <miguel@ximian.com>
13768
13769         * class.cs (MethodData.Define): While checking if a method is an
13770         interface implementation, improve the test: If we are not public
13771         (use new test here: use the computed MethodAttributes directly,
13772         instead of the parsed modifier flags) check if the `implementing'
13773         method comes from an interface or not.
13774
13775         * pending.cs (VerifyPendingMethods): Slightly better error
13776         message.
13777
13778         * makefile: add test target that does the mcs bootstrap.
13779
13780 2003-07-16  Ravi Pratap  <ravi@ximian.com>
13781
13782         * interface.cs (Define): Do nothing here since there are no
13783         members to populate etc. Move the attribute emission out of here
13784         since this was just totally the wrong place to put it. Attribute
13785         application happens during the 'Emit' phase, not in the 'Define'
13786         phase.
13787
13788         (Emit): Add this method and move the attribute emission here
13789
13790         * rootcontext.cs (EmitCode): Call the Emit method on interface
13791         types too.
13792
13793 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
13794
13795         * expression.cs (OverloadResolve): Report error only if Location
13796         is not 'Null' which means that there was a probe going on.
13797
13798 2003-07-14  Martin Baulig  <martin@ximian.com>
13799
13800         * expression.cs (ConditionalLogicalOperator): New public class to
13801         implement user defined conditional logical operators.
13802         This is section 14.11.2 in the spec and bug #40505.
13803
13804 2003-07-14  Martin Baulig  <martin@ximian.com>
13805
13806         * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
13807
13808 2003-07-14  Martin Baulig  <martin@ximian.com>
13809
13810         * codegen.cs (EmitContext.InFixedInitializer): New public field.
13811
13812         * ecore.cs (IVariable.VerifyFixed): New interface method.
13813
13814         * expression.cs (Unary.ResolveOperator): When resolving the `&'
13815         operator, check whether the variable is actually fixed.  Fixes bug
13816         #36055.  Set a variable definitely assigned when taking its
13817         address as required by the spec.
13818
13819         * statement.cs (LocalInfo.IsFixed): New field.
13820         (LocalInfo.MakePinned): Set `IsFixed' to true.
13821
13822 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
13823
13824         * attribute.cs (Attribute.Resolve): While doing a Member lookup
13825         for .ctors, ensure that we only ask for members declared in the
13826         attribute type (BindingFlags.DeclaredOnly).
13827
13828         Fixes bug #43632.
13829
13830         * expression.cs (Error_WrongNumArguments): Report error 1501
13831         correctly the way CSC does.
13832
13833 2003-07-13  Martin Baulig  <martin@ximian.com>
13834
13835         * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
13836         lookup on the fully qualified name, to make things like "X.X" work
13837         where "X.X" is a fully qualified type name, but we also have a
13838         namespace "X" in the using list.  Fixes #41975.
13839
13840 2003-07-13  Martin Baulig  <martin@ximian.com>
13841
13842         * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
13843         function. If we're a CompoundAssign, we need to create an embedded
13844         CompoundAssign, not an embedded Assign.
13845         (Assign.DoResolve): Make this work for embedded CompoundAssign's.
13846         Fixes #45854.
13847
13848 2003-07-13  Martin Baulig  <martin@ximian.com>
13849
13850         * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
13851         work to fix bug #46088.
13852
13853 2003-07-13  Ravi Pratap <ravi@ximian.com>
13854
13855         * class.cs (Operator.Emit): Do not emit attributes here - it is
13856         taken care of by the Method class that we delegate too. This takes
13857         care of bug #45876.
13858
13859 2003-07-10  Martin Baulig  <martin@ximian.com>
13860
13861         * expression.cs (TypeOfVoid): New class.
13862         (TypeOf): Report a CS0673 if it's System.Void.  Fixes #42264.
13863
13864 2003-07-10  Martin Baulig  <martin@ximian.com>
13865
13866         * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
13867         bug #35957.
13868
13869 2003-07-10  Martin Baulig  <martin@ximian.com>
13870
13871         * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
13872         not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
13873
13874         * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
13875
13876         * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
13877
13878 2003-07-10  Martin Baulig  <martin@ximian.com>
13879
13880         * expression.cs (ArrayCreation): Don't use a byte blob for arrays
13881         of decimal.  Fixes #42850.
13882
13883         NOTE: I also fixed the created byte blob, but this doesn't work on
13884         the MS runtime and csc never produces any byte blobs for decimal
13885         arrays.
13886
13887 2003-07-10  Martin Baulig  <martin@ximian.com>
13888
13889         * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
13890         structs; fixes #32068.
13891         (Block.AddChildVariableNames): Fixed #44302.
13892
13893 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13894
13895         * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
13896
13897 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
13898
13899         * attribute.cs: And this test is onger needed.
13900
13901 2003-07-08  Martin Baulig  <martin@ximian.com>
13902
13903         * rootcontext.cs (RootContext.NamespaceLookup): Ignore
13904         inaccessible types.  Fixes #36313.
13905
13906         * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
13907
13908         * namespace.cs (NamespaceEntry): Create implicit entries for all
13909         namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
13910         implicit entries for N1.N2 and N1.
13911
13912 2003-07-08  Martin Baulig  <martin@ximian.com>
13913
13914         Rewrote the handling of namespaces to fix a lot of the issues
13915         wrt. `using' aliases etc.
13916
13917         * namespace.cs (Namespace): Splitted this class into a
13918         per-assembly `Namespace' and a per-file `NamespaceEntry'.
13919
13920         * typemanager.cs (TypeManager.IsNamespace): Removed.
13921         (TypeManager.ComputeNamespaces): Only compute namespaces from
13922         loaded assemblies here, not the namespaces from the assembly we're
13923         currently compiling.
13924
13925 2003-07-08  Martin Baulig  <martin@ximian.com>
13926
13927         * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
13928
13929 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
13930
13931         * typemanager.cs: Reverted patch from Gonzalo, my previous patch
13932         already fixed it.  
13933
13934         I thought about the memory savings here, but LookupTypeReflection
13935         is used under already very constrained scenarios.  Compiling
13936         corlib or mcs only exposes one hit, so it would not really reduce
13937         any memory consumption.
13938
13939 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13940
13941         * typemanager.cs: fixes bug #45889 by only adding public types from
13942         other assemblies to the list of known types.
13943
13944 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
13945
13946         * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
13947         on the type we resolved.
13948
13949 2003-07-05  Martin Baulig  <martin@ximian.com>
13950
13951         * pending.cs (PendingImplementation.ParentImplements): Don't
13952         create the proxy if the parent is abstract.
13953
13954         * class.cs (TypeContainer.DefineIndexers): Process explicit
13955         interface implementations first.  Fixes #37714.
13956
13957 2003-07-04  Miguel de Icaza  <miguel@ximian.com>
13958
13959         * expression.cs (MemberAccess.ResolveMemberAccess): Events are
13960         defined recursively;  but since we modify the input parameters
13961         (left is set to `this' temporarily), we reset this value if the
13962         left_is_explicit is false, which gives the original semantics to
13963         the code.  
13964
13965         * literal.cs (NullPointer): new class used to represent a null
13966         literal in a pointer context.
13967
13968         * convert.cs (Convert.ImplicitReferenceConversion): Is the target
13969         type is a pointer, use a NullPointer object instead of a
13970         NullLiteral.   Closes 43687
13971
13972         (ExplicitConversion): Convert pointer values using
13973         the conv opcode to the proper type.
13974
13975         * ecore.cs (New): change ValueTypeVariable property into a method,
13976         that returns whether the valuetype is suitable for being used.
13977
13978         * expression.cs (Binary.DoNumericPromotions): Only return if we
13979         the int constant was a valid uint, and we can return both left and
13980         right as uints.  If not, we continue processing, to trigger the
13981         type conversion.  This fixes 39018.
13982
13983         * statement.cs (Block.EmitMeta): During constant resolution, set
13984         the CurrentBlock property on the emitcontext, so that we resolve
13985         constants propertly.
13986
13987 2003-07-02  Martin Baulig  <martin@ximian.com>
13988
13989         * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
13990         (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
13991
13992         * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
13993         than emitting it here.
13994
13995         * statement.cs: Fixed some more flow analysis bugs.
13996
13997 2003-07-02  Martin Baulig  <martin@ximian.com>
13998
13999         * class.cs (MethodData.Define): When implementing interface
14000         methods, set Final unless we're Virtual.
14001
14002         * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
14003         check work for interface methods.
14004
14005 2003-07-01  Martin Baulig  <martin@ximian.com>
14006
14007         * ecore.cs (EmitContext.This): Replaced this property with a
14008         GetThis() method which takes a Location argument.  This ensures
14009         that we get the correct error location for a CS0188.
14010
14011 2003-07-01  Miguel de Icaza  <miguel@ximian.com>
14012
14013         * ecore.cs: (Convert.ConvertIntLiteral): Add test for
14014         ImplicitStandardConversion.
14015
14016         * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
14017
14018 2003-07-01  Zoltan Varga  <vargaz@freemail.hu>
14019
14020         * expression.cs (ResolveOperator): Fix Concat (string, string, string)
14021         optimization.
14022
14023 2003-06-30  Miguel de Icaza  <miguel@ximian.com>
14024
14025         * class.cs (Constructor.Define): Turn off initlocals for unsafe
14026         constructors.
14027
14028         (MethodData.Define): Turn off initlocals for unsafe methods.
14029
14030 2003-06-29  Miguel de Icaza  <miguel@ximian.com>
14031
14032         * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
14033         complete;  Fixes #37521.
14034
14035         * delegate.cs: Use Modifiers.TypeAttr to compute the
14036         TypeAttributes, instead of rolling our own.  This makes the flags
14037         correct for the delegates.
14038
14039 2003-06-28  Miguel de Icaza  <miguel@ximian.com>
14040
14041         * class.cs (Constructor.Define): Set the private flag for static
14042         constructors as well.
14043
14044         * cs-parser.jay (statement_expression): Set the return value to
14045         null, to avoid a crash when we catch an error.
14046
14047 2003-06-24  Miguel de Icaza  <miguel@ximian.com>
14048
14049         * cs-parser.jay: Applied patch from Jackson that adds support for
14050         extern and unsafe modifiers to destructor declarations.
14051
14052         * expression.cs: Report error 21 if the user is trying to index a
14053         System.Array.
14054
14055         * driver.cs: Add an error message, suggested by the bug report.
14056
14057         * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
14058         if we do not have a ": this ()" constructor initializer.  Fixes 45149
14059
14060 2003-06-14  Miguel de Icaza  <miguel@ximian.com>
14061
14062         * namespace.cs: Add some information to reduce FAQs.
14063
14064 2003-06-13  Miguel de Icaza  <miguel@ximian.com>
14065
14066         * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
14067         underlying enumeration types.  Fixes #43915.
14068
14069         * expression.cs: Treat ushort/short as legal values to be used in
14070         bitwise operations.
14071
14072 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
14073
14074         * delegate.cs: transfer custom attributes for paramenters from
14075         the delegate declaration to Invoke and BeginInvoke.
14076
14077 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
14078
14079         * attribute.cs: handle custom marshalers and emit marshal info
14080         for fields, too.
14081
14082 2003-05-28  Hector E. Gomez Morales  <hgomez_36@flashmail.com>
14083
14084         * makefile.gnu: Added anonymous.cs to the compiler sources.
14085
14086 2003-05-28  Miguel de Icaza  <miguel@ximian.com>
14087
14088         * iterators.cs: Change the name of the proxy class to include two
14089         underscores.
14090
14091         * cs-parser.jay: Update grammar to include anonymous methods.
14092
14093         * anonymous.cs: new file.
14094
14095 2003-05-27  Miguel de Icaza  <miguel@ximian.com>
14096
14097         * class.cs (Field.Define): Add missing test for pointers and
14098         safety. 
14099
14100 2003-05-27  Ravi Pratap  <ravi@ximian.com>
14101
14102         * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
14103         we use the stobj opcode.
14104
14105         (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
14106         since it wasn't the correct fix. 
14107
14108         It still is puzzling that we are required to use stobj for IntPtr
14109         which seems to be a ValueType.
14110
14111 2003-05-26  Miguel de Icaza  <miguel@ximian.com>
14112
14113         * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
14114         during regular simple name resolution.   Now, the trick is that
14115         instead of returning for processing the simplename, we do a
14116         TypeManager.LookupType (ie, a rooted lookup as opposed to a
14117         contextual lookup type).   If a match is found, return that, if
14118         not, return for further composition.
14119
14120         This fixes long-standing 30485.
14121
14122         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
14123         using the address to initialize an object, do an Stobj instead of
14124         using the regular Stelem.
14125
14126         (IndexerAccess.Emit, IndexerAccess.EmitAssign):
14127         Pass `is_base_indexer' to Invocation.EmitCall instead of false.
14128         Because if we are a BaseIndexerAccess that value will be true.
14129         Fixes 43643.
14130
14131         * statement.cs (GotoCase.Resolve): Return after reporting an
14132         error, do not attempt to continue. 
14133
14134         * expression.cs (PointerArithmetic.Emit): If our operand is a
14135         long, convert our constants to match the operand before
14136         multiplying.  Convert to I type before adding.   Fixes 43670.
14137
14138 2003-05-14  Ravi Pratap  <ravi@ximian.com>
14139
14140         * enum.cs (ImplicitConversionExists) : Rename to
14141         ImplicitEnumConversionExists to remove ambiguity. 
14142
14143         * ecore.cs (NullCast): New type of cast expression class which
14144         basically is very similar to EmptyCast with the difference being
14145         it still is a constant since it is used only to cast a null to
14146         something else
14147         (eg. (string) null)
14148
14149         * convert.cs (ImplicitReferenceConversion): When casting a null
14150         literal, we return a NullCast.
14151
14152         * literal.cs (NullLiteralTyped): Remove - I don't see why this
14153         should be around anymore.
14154
14155         The renaming (reported was slightly wrong). Corrections:
14156
14157         ConvertImplicitStandard -> ImplicitConversionStandard
14158         ConvertExplicitStandard -> ExplicitConversionStandard
14159
14160         * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
14161         before passing them in !
14162
14163         * convert.cs (ImplicitConversionStandard): When comparing for
14164         equal expr and target types, ensure that expr is not a
14165         NullLiteral.
14166
14167         In general, we must not be checking (expr_type ==
14168         target_type) in the top level conversion methods
14169         (ImplicitConversion, ExplicitConversion etc). This checking is
14170         done in the methods that they delegate to.
14171
14172 2003-05-20  Miguel de Icaza  <miguel@ximian.com>
14173
14174         * convert.cs: Move Error_CannotConvertType,
14175         ImplicitReferenceConversion, ImplicitReferenceConversionExists,
14176         ImplicitNumericConversion, ImplicitConversionExists,
14177         ImplicitUserConversionExists, StandardConversionExists,
14178         FindMostEncompassedType, FindMostSpecificSource,
14179         FindMostSpecificTarget, ImplicitUserConversion,
14180         ExplicitUserConversion, GetConversionOperators,
14181         UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
14182         TryImplicitIntConversion, Error_CannotConvertImplicit,
14183         ConvertImplicitRequired, ConvertNumericExplicit,
14184         ExplicitReferenceConversionExists, ConvertReferenceExplicit,
14185         ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
14186         its own file.
14187
14188         Perform the following renames:
14189
14190         StandardConversionExists -> ImplicitStandardConversionExists
14191         ConvertImplicit -> ImplicitConversion
14192         ConvertImplicitStandard -> ImplicitStandardConversion
14193         TryImplicitIntConversion -> ImplicitIntConversion
14194         ConvertImplicitRequired -> ImplicitConversionRequired
14195         ConvertNumericExplicit -> ExplicitNumericConversion
14196         ConvertReferenceExplicit -> ExplicitReferenceConversion
14197         ConvertExplicit -> ExplicitConversion
14198         ConvertExplicitStandard -> ExplicitStandardConversion
14199
14200 2003-05-19  Martin Baulig  <martin@ximian.com>
14201
14202         * statement.cs (TypeInfo.StructInfo): Made this type protected.
14203         (TypeInfo): Added support for structs having structs as fields.
14204
14205         * ecore.cs (FieldExpr): Implement IVariable.
14206         (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
14207         VariableInfo for the field.
14208
14209 2003-05-18  Martin Baulig  <martin@ximian.com>
14210
14211         * expression.cs (This.DoResolve): Report a CS0027 if we're
14212         emitting a field initializer.
14213
14214 2003-05-18  Martin Baulig  <martin@ximian.com>
14215
14216         * expression.cs (This.ResolveBase): New public function.
14217         (This.DoResolve): Check for CS0188.
14218
14219         * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
14220         This.Resolve().
14221
14222         * ecore.cs (MethodGroupExpr.DoResolve): Set the
14223         `instance_expression' to null if we don't have any non-static
14224         methods.
14225
14226 2003-05-18  Martin Baulig  <martin@ximian.com>
14227
14228         Reworked the way how local variables and parameters are handled by
14229         the flow analysis code.
14230
14231         * statement.cs (TypeInfo, VariableMap): New public classes.
14232         (VariableInfo): New public class.  This is now responsible for
14233         checking whether a variable has been assigned.  It is used for
14234         parameters and local variables.
14235         (Block.EmitMeta): Take the InternalParameters as argument; compute
14236         the layout of the flow vectors here.
14237         (Block.LocalMap, Block.ParameterMap): New public properties.
14238         (FlowBranching): The .ctor doesn't get the InternalParameters
14239         anymore since Block.EmitMeta() now computes the layout of the flow
14240         vector.
14241         (MyStructInfo): This class is now known as `StructInfo' and nested
14242         in `TypeInfo'; we don't access this directly anymore.
14243
14244         * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
14245         property and removed IsAssigned(), IsFieldAssigned(),
14246         SetAssigned() and SetFieldAssigned(); we now call them on the
14247         VariableInfo so we don't need to duplicate this code everywhere.
14248
14249         * expression.cs (ParameterReference): Added `Block block' argument
14250         to the .ctor.
14251         (LocalVariableReference, ParameterReference, This): The new
14252         VariableInfo class is now responsible for all the definite
14253         assignment stuff.
14254
14255         * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
14256         IsParameterAssigned, SetParameterAssigned): Removed.
14257
14258 2003-05-18  Martin Baulig  <martin@ximian.com>
14259
14260         * typemanager.cs (InitCoreTypes): Try calling
14261         SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
14262         the 3-args-version.  Corlib now also needs our `void_type'.
14263         (GetMethod): Added overloaded version which takes an optional
14264         `bool report_errors' to allow lookups of optional methods.
14265
14266 2003-05-12  Martin Baulig  <martin@ximian.com>
14267
14268         * statement.cs (VariableInfo): Renamed to LocalInfo since it's
14269         only used for locals and not for parameters.
14270
14271 2003-05-12  Miguel de Icaza  <miguel@ximian.com>
14272
14273         * support.cs (InternalParameters.ParameterType): Return the
14274         ExternalType of the parameter.
14275
14276         * parameter.cs (Parameter.ExternalType): drop the two arguments,
14277         they were unused.
14278
14279 2003-05-11  Miguel de Icaza  <miguel@ximian.com>
14280
14281         * class.cs (MethodData.Define): Do not set the `newslot' on
14282         interface members, if they are also flagged as "override".
14283
14284         * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
14285         better code for ++i and i++.  This only works for static fields
14286         and local variables.
14287
14288         * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
14289         want to pull the DeclSpace out of the builder_to_declspace instead
14290         of the TypeBuilder (like in TypeContainer.FindMembers).
14291
14292         * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
14293         instead of LookupTypeContainer.  Fixes the crash on .NET for
14294         looking up interface members.
14295
14296         * const.cs: Create our own emit context during the Definition
14297         stage, so that constants are evaluated in the proper context, when
14298         a recursive definition happens.
14299
14300 2003-05-11  Martin Baulig  <martin@ximian.com>
14301
14302         * statement.cs (Block.CreateSwitchBlock): New method.  Creates a
14303         new block for a switch section.
14304         (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
14305         the adding/lookup in the switch block.  Fixes #39828.
14306
14307 2003-05-09  Miguel de Icaza  <miguel@ximian.com>
14308
14309         * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
14310         functionality: I needed to convert the data after I had performed
14311         the add/sub operation into the operands type size.
14312
14313         * ecore.cs (ImplicitReferenceConversion): When boxing an interface
14314         pass the type for the box operation, otherwise the resulting
14315         object would have been of type object.
14316
14317         (BoxedCast): Add constructor to specify the type to box as.
14318
14319 2003-05-07  Miguel de Icaza  <miguel@ximian.com>
14320
14321         * iterators.cs: I was reusing the `count' variable inadvertently,
14322         take steps to not allow this to happen.
14323
14324 2003-05-06  Miguel de Icaza  <miguel@ximian.com>
14325
14326         * attribute.cs (Attribute.Resolve): Params attributes are encoded
14327         by creating an array at the point where the params starts and
14328         putting all those arguments there, then adjusting the size of the
14329         array.
14330
14331 2003-05-05  Miguel de Icaza  <miguel@ximian.com>
14332
14333         * expression.cs (New.AddressOf): Implement interface
14334         IMemoryLocation.  This is used when the `new' operator is used in
14335         the context of an invocation to a method on a value type.
14336
14337         See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
14338         example. 
14339
14340         * namespace.cs: Also check the using aliases here.
14341
14342         * driver.cs: Move the test for using validity after the types have
14343         been entered, so we do a single pass that also includes the using
14344         aliases. 
14345
14346         * statement.cs (Try.Resolve): Avoid crashing if there is a failure
14347         in the regular case.   CreateSiblingForFinally is doing extra
14348         error checking.
14349
14350         * attribute.cs (GetAttributeArgumentExpression): Store the result
14351         on an out value, and use the return value to indicate failure
14352         instead of using null (which is a valid return for Constant.GetValue).
14353
14354         * statement.cs: Perform the analysis flow for the increment
14355         portion after the statement, because this will be the real flow of
14356         execution.  Fixes #42385
14357
14358         * codegen.cs (EmitContext.EmitArgument,
14359         EmitContext.EmitStoreArgument): New helper functions when the
14360         RemapToProxy flag is set.
14361
14362         * expression.cs (ParameterReference.EmitLdarg): Expose this useful
14363         function.
14364
14365         Add support for remapping parameters. 
14366
14367         * iterators.cs: Propagate parameter values;  Store parameter
14368         values in the proxy classes.
14369
14370 2003-05-04  Miguel de Icaza  <miguel@ximian.com>
14371
14372         * ecore.cs (FieldExpr): Fix an obvious bug.  static fields do not
14373         need a proxy reference;  I do not know what I was thinking
14374
14375         * cs-parser.jay (constructor_initializer): catch another error,
14376         and display nice message.
14377
14378         (field_declaration): catch void field declaration
14379         to flag a better error. 
14380
14381         * class.cs (MemberBase.CheckBase): Report an error instead of a
14382         warning if a new protected member is declared in a struct. 
14383         (Field.Define): catch the error of readonly/volatile.
14384
14385         * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
14386
14387         (FieldExpr.AddressOf): ditto.  Catch error where the address of a
14388         volatile variable is taken
14389
14390 2003-05-02  Miguel de Icaza  <miguel@ximian.com>
14391
14392         * statement.cs (Fixed.Resolve): Report an error if we are not in
14393         an unsafe context.
14394
14395 2003-05-01  Miguel de Icaza  <miguel@ximian.com>
14396
14397         * typemanager.cs: reuse the code that handles type clashes for
14398         delegates and enumerations.
14399
14400         * class.cs (Report28): Always report.
14401
14402         * expression.cs (EncodeAsAttribute): Allow nulls here.
14403
14404 2003-04-28  Miguel de Icaza  <miguel@ximian.com>
14405
14406         * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
14407         the functionality for testing whether an expression is valid for
14408         an attribute here.  Also handle the case of arrays of elements
14409         being stored. 
14410
14411         * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
14412         encoding a linear array into an array of objects that are suitable
14413         to be passed to an CustomAttributeBuilder.
14414
14415         * delegate.cs: Check unsafe types being used outside of an Unsafe context.
14416
14417         * ecore.cs: (FieldExpr): Handle field remapping here.
14418
14419         * iteratators.cs: Pass the instance variable (if the method is an
14420         instance method) to the constructors, so we can access the field
14421         variables on the class.
14422
14423         TODO: Test this with structs.  I think the THIS variable on
14424         structs might have to be a pointer, and not a refenrece
14425
14426 2003-04-27  Miguel de Icaza  <miguel@ximian.com>
14427
14428         * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
14429         local variables to fields in a proxy class.
14430
14431         * iterators.cs (PopulateProxy): Rename our internal fields to
14432         <XXX>.  
14433         Create a <THIS> field if we are an instance method, so we can
14434         reference our parent container variables.
14435         (MapVariable): Called back from the EmitContext code to enter a
14436         new variable to field mapping into the proxy class (we just create
14437         a FieldBuilder).
14438
14439         * expression.cs
14440         (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
14441         for using the remapped locals to fields.
14442
14443         I placed the code here, because that gives the same semantics to
14444         local variables, and only changes the Emit code.
14445
14446         * statement.cs (Fixed.Resolve): it is not allowed to have fixed
14447         statements inside iterators.
14448         (VariableInfo): Add a FieldBuilder for the cases when we are
14449         remapping local variables to fields in a proxy class
14450
14451         * ecore.cs (SimpleNameResolve): Avoid testing two times for
14452         current_block != null.
14453
14454         * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
14455         not cope with strings, as it has been moved to the
14456         TableSwitchEmit.  Fixed bug in switch generation.
14457
14458         * expression.cs (New.DoResolve): Provide more context for the user
14459         when reporting an error.
14460
14461         * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
14462         pointers. 
14463
14464         * expression.cs (MemberAccess.DoResolve): When we get a type back,
14465         check the permissions for it.  Note than in a type-resolution
14466         context the check was already present in DeclSpace.ResolveType,
14467         but was missing from the MemberAccess.
14468
14469         (ArrayCreation.CheckIndices): warn if the user has
14470         more nested levels of expressions, but there are no more
14471         dimensions specified.  Avoids crash on bug 41906.
14472
14473 2003-04-26  Miguel de Icaza  <miguel@ximian.com>
14474
14475         * statement.cs (Block): replace Implicit bool, for a generic
14476         flags.   
14477         New flag: `Unchecked'.  This is used during the EmitMeta phase
14478         (which is out-of-line with the regular Resolve/Emit process for a
14479         statement, as this is done ahead of time, but still gets a chance
14480         to call constant resolve).
14481
14482         (Block.Flags): new enum for adding a new flag.
14483
14484         (Block.EmitMeta): track the state of unchecked.
14485
14486         (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
14487         to enable constant resolution to work there as well.
14488
14489 2003-04-22  Miguel de Icaza  <miguel@ximian.com>
14490
14491         * typemanager.cs (ienumerable_type): Also look up
14492         System.Collections.IEnumerable. 
14493
14494 2003-04-21  Miguel de Icaza  <miguel@ximian.com>
14495
14496         TODO: Test more than one conditional per method.
14497
14498         * class.cs (Indexer.Define): Report the location where the user is
14499         referencing the unsupported feature.
14500
14501         (MethodData): Overload the use of `conditionals' to
14502         minimize the creation of needless ArrayLists.   This saves roughly
14503         212kb on my machine.
14504
14505         (Method): Implement the new IIteratorContainer interface.
14506         (Method.SetYields): Implement the method by setting the ModFlags
14507         to contain METHOD_YIELDS.
14508
14509         * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
14510         which just got set to null.
14511
14512         * iterators.cs: New file.
14513
14514         (Yield, YieldBreak): New statements.
14515
14516         * statement.cs (Return.Resolve): Flag an error if we are used in
14517         an iterator method.
14518
14519         * codegen.cs (InIterator): New flag set if the code is being
14520         compiled in an iterator method.
14521
14522         * modifiers.cs: New flag METHOD_YIELDS.  This modifier is an
14523         internal modifier, and we just use it to avoid adding extra
14524         fields, as this is seldom used.  
14525
14526         * cs-parser.jay: Add yield_statement (yield and yield break).
14527
14528         * driver.cs: New flag -v2 to turn on version 2 features. 
14529
14530         * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
14531         hashtable when v2 is enabled.
14532
14533 2003-04-20  Miguel de Icaza  <miguel@ximian.com>
14534
14535         * typemanager.cs (TypeManager.NamespaceClash): Use to check if
14536         there is already a namespace defined with this name.
14537
14538         (TypeManager.InitCoreTypes): Remove the temporary workaround, as
14539         people upgraded their corlibs.
14540
14541         (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
14542         always use fully qualified types, no need to use the compiler
14543         front end.
14544
14545         (TypeManager.IsNamespace): Use binarysearch.
14546
14547         * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
14548         AddDelegate): I did not quite use the new IsValid API properly: I
14549         have to pass the short-name and the fullname.  I was passing only
14550         the basename instead of the fullname sometimes. 
14551
14552         (TypeContainer.DefineType): call NamespaceClash.
14553
14554         * interface.cs (Interface.DefineType): use NamespaceClash before
14555         defining the type.
14556
14557         * delegate.cs (Delegate.DefineType): use NamespaceClash before
14558         defining the type.
14559
14560         * enum.cs: (Enum.DefineType): use NamespaceClash before
14561         defining the type.
14562
14563         * typemanager.cs (: 3-line patch that gives us some tasty 11%
14564         speed increase.  First, use the negative_hits cache when we get a
14565         negative.  Second, add the type with its full original name
14566         instead of the new . and + encoded name (reflection uses + to
14567         separate type from a nested type).  Use LookupTypeReflection
14568         directly which bypasses the type->name hashtable (that we already
14569         know does not contain the type.
14570
14571         * decl.cs (DeclSpace.ResolveTypeExpr): track the
14572         location/container type. 
14573
14574         * driver.cs: When passing utf8, use directly the UTF8Encoding.
14575
14576 2003-04-19  Miguel de Icaza  <miguel@ximian.com>
14577
14578         * decl.cs (ResolveTypeExpr): Mirror check acess here too.
14579
14580         * delegate.cs (NewDelegate.Resolve): Test whether an instance
14581         method is being referenced in the method group from a static
14582         context, and report error 120 if so.
14583
14584         * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
14585         Error118. 
14586
14587         * typemanager.cs: Add intermediate namespaces (if a namespace A.B
14588         is created, we create the A namespace).
14589
14590         * cs-parser.jay: A namespace also introduces a DeclarationFound.
14591         Fixes #41591
14592
14593 2003-04-18  Miguel de Icaza  <miguel@ximian.com>
14594
14595         * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
14596         invocation to ModuleBuilder.GetType with the same values will
14597         return a new type instance, so we need to cache its return
14598         values. 
14599
14600         * expression.cs (Binary.ResolveOperator): Only allow the compare
14601         operators on enums if they are of the same type.
14602
14603         * ecore.cs (Expression.ImplicitReferenceConversion): handle target
14604         types of ValueType on their own case.  Before we were giving them
14605         the same treatment as objects.
14606
14607         * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
14608         fullname.  Short name is used to compare against container name.
14609         Fullname is used to check against defined namespace names.
14610
14611         * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
14612         AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
14613
14614         (Method.CheckBase): Call parent.
14615         (MemberBase.CheckBase): Check for protected members on sealed
14616         classes.
14617         (PropertyBase.CheckBase): Call parent.
14618         (Field.Define): Call parent.
14619
14620         * report.cs: Negative error codes are now mapped to 8000 - code,
14621         so that the display is render more nicely.
14622
14623         * typemanager.cs: Do not use try/catch, instead report a regular
14624         error. 
14625
14626         (GetPointerType, GetReferenceType): These methods provide
14627         mechanisms to obtain the T* and T& from a T.  We had the code
14628         previously scattered around the code base, and it also used
14629         TypeManager.LookupType that would go through plenty of caches.
14630         This one goes directly to the type source.
14631
14632         In some places we did the Type.GetType followed by
14633         ModuleBuilder.GetType, but not in others, so this unifies the
14634         processing as well.
14635
14636         * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
14637         statements now that we have namespace information.
14638
14639         * typemanager.cs (IsNamespace): New method, returns whether the
14640         string presented is a namespace or not.
14641
14642         (ComputeNamespaces): New public entry point, computes the list of
14643         available namespaces, using the GetNamespaces API call in Mono, or
14644         the slower version in MS.NET.   
14645
14646         Now before we start the semantic analysis phase, we have a
14647         complete list of namespaces including everything that the user has
14648         provided.
14649
14650         Deleted old code to cache namespaces in .nsc files.
14651
14652 2003-04-17  Miguel de Icaza  <miguel@ximian.com>
14653
14654         * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
14655         class/struct location definition Location for the implicit
14656         constructor location.
14657
14658         (Operator.Define): Use the location of the operator for the
14659         implicit Method definition.
14660
14661         (Constructor.Emit): use the constructor location for the implicit
14662         base initializer constructor.
14663
14664         * ecore.cs: Remove ITypeExpression.  This interface is now gone,
14665         and the Expression class now contains two new methods:
14666
14667         ResolveAsTypeStep and ResolveAsTypeTerminal.  This is used to
14668         isolate type lookup from the rest of the resolution process.
14669
14670         Since we use Expressions to hold type definitions due to the way
14671         we parse the input we have historically overloaded Resolve to
14672         perform the Type lookups if a special flag is passed.  Now this is
14673         eliminated and two methods take their place. 
14674
14675         The differences in the two methods between xStep and xTerminal is
14676         that xStep is involved in our current lookup system that uses
14677         SimpleNames to compose a name, while xTerminal is used just to
14678         catch the case where the simplename lookup failed.
14679
14680 2003-04-16  Miguel de Icaza  <miguel@ximian.com>
14681
14682         * expression.cs (ResolveMemberAccess): Remove redundant code.
14683         TypeExpr expressions are always born fully resolved.
14684
14685         * interface.cs (PopulateMethod): Do not lookup the types twice.
14686         We were doing it once during SemanticAnalysis and once during
14687         PopulateMethod.
14688
14689         * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
14690         in local variable type definitions, were being returned as a
14691         SimpleName (we decomposed everything into a string), that is
14692         because primary_expression was being used instead of a type in the
14693         grammar (reduce/reduce conflicts).
14694
14695         The part that was wrong is that we converted the expression into a
14696         string (an oversimplification in one hand, compounded with primary
14697         expressions doing string concatenation).
14698
14699         So things like:
14700
14701         A.B.C [] x;
14702
14703         Would return "A.B.C[]" as a SimpleName.  This stopped things like
14704         using clauses from working on this particular context.  And a type
14705         was being matched directly against "A.B.C[]".
14706
14707         We now use the correct approach, and allow for ComposedCast to be
14708         part of the unary expression.  So the "A.B.C []" become a composed
14709         cast of "A.B.C" (as a nested group of MemberAccess with a
14710         SimpleName at the end) plus the rank composition "[]". 
14711
14712         Also fixes 35567
14713
14714 2003-04-10  Miguel de Icaza  <miguel@ximian.com>
14715
14716         * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
14717         for the access level checking.
14718
14719         * class.cs: Cosmetic changes.  Renamed `TypeContainer parent' to
14720         `TypeContainer container', because I kept getting confused when I
14721         was debugging this code.
14722
14723         * expression.cs (Indexers): Instead of tracking getters/setters,
14724         we now track them in parallel.  We create one arraylist less, but
14725         most importantly it is possible now for the LValue code to find a
14726         matching get for a set.
14727
14728         (IndexerAccess.DoResolveLValue): Update the code.
14729         GetIndexersForType has been modified already to extract all the
14730         indexers from a type.  The code assumed it did not.
14731
14732         Also make the code set the correct return type for the indexer.
14733         This was fixed a long time ago for properties, but was missing for
14734         indexers.  It used to be void_type.
14735
14736         (Binary.Emit): Test first for doubles instead of
14737         floats, as they are more common.
14738
14739         (Binary.EmitBranchable): Use the .un version of the branch opcodes
14740         when dealing with floats and the <=, >= operators.  This fixes bug
14741         #39314 
14742
14743         * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
14744         to load the array value by emitting a load on the foreach variable
14745         type.  This was incorrect.  
14746
14747         We now emit the code to load an element using the the array
14748         variable type, and then we emit the conversion operator.
14749
14750         Fixed #40176
14751
14752 2003-04-10  Zoltan Varga  <vargaz@freemail.hu>
14753
14754         * attribute.cs: Avoid allocation of ArrayLists in the common case.
14755
14756 2003-04-09  Miguel de Icaza  <miguel@ximian.com>
14757
14758         * class.cs (MethodSignature.InheritableMemberSignatureCompare):
14759         test for protection before we test for signatures. 
14760
14761         (MethodSignature.ToString): implement.
14762
14763         * expression.cs (Unary.TryReduceNegative): Add missing minus sign
14764         to the case where we reduced into a LongConstant.
14765
14766         * decl.cs (CheckAccessLevel): If the type is an array, we can not
14767         depend on whether the information is acurrate, because the
14768         Microsoft runtime will always claim that the array type is public,
14769         regardless of the real state.
14770
14771         If the type is a pointer, another problem happens: the type is
14772         reported as non-public in Microsoft.  
14773
14774         In both cases we have to call CheckAccessLevel recursively with
14775         the underlying type as the argument to be tested.
14776
14777 2003-04-08  Miguel de Icaza  <miguel@ximian.com>
14778
14779         * assign.cs (Assign.Emit): If we are dealing with a compound
14780         assignment expression, we should use the code path that stores the
14781         intermediate result in a temporary value.  This fixes #40903.
14782
14783         *expression.cs (Indirection.ToString): Provide ToString method for
14784         debugging. 
14785
14786 2003-04-08  Zoltan Varga  <vargaz@freemail.hu>
14787
14788         * class.cs: Null out fields holding references to Block objects so
14789         they can be garbage collected.
14790
14791         * expression.cs (OverloadResolve): Remove unused local.
14792
14793 2003-04-07  Martin Baulig  <martin@ximian.com>
14794
14795         * codegen.cs (EmitContext.CurrentFile): New public field.
14796         (EmitContext.Mark): Use the CurrentFile to check whether the
14797         location is in the correct file.
14798         (EmitContext.EmitTopBlock): Initialize CurrentFile here.
14799
14800 2003-04-07  Martin Baulig  <martin@ximian.com>
14801
14802         * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
14803
14804         * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
14805         location.  [FIXME: The location argument which gets passed to this
14806         method is sometimes wrong!]
14807
14808 2003-04-07  Nick Drochak <ndrochak@gol.com>
14809
14810         * codegen.cs: Be more verbose when we can't find the symbol writer dll.
14811
14812 2003-04-07  Miguel de Icaza  <miguel@ximian.com>
14813
14814         * expression.cs (Indirection.EmitAssign): We were using the
14815         temporary, but returning immediately instead of continuing the
14816         EmitAssing flow.
14817
14818 2003-04-06  Martin Baulig  <martin@ximian.com>
14819
14820         * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
14821         if it's a nested child, but also deriving from the outer class.
14822         See test 190.cs.
14823
14824         * typemanager.cs (IsNestedChildOf): Make this work if it's a
14825         nested child, but also deriving from the outer class.  See
14826         test-190.cs.
14827         (FilterWithClosure): We may access private members of the outer
14828         class if we're a nested child and deriving from the outer class.
14829         (RealMemberLookup): Only set `closure_private_ok' if the
14830         `original_bf' contained BindingFlags.NonPublic.
14831
14832 2003-04-05  Martin Baulig  <martin@ximian.com>
14833
14834         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #40670.
14835
14836 2003-04-02  Miguel de Icaza  <miguel@ximian.com>
14837
14838         * class.cs (Event.Define): Do not allow abstract events to have
14839         initializers. 
14840
14841 2003-04-01  Miguel de Icaza  <miguel@ximian.com>
14842
14843         * cs-parser.jay: Add error productions for ADD/REMOVE missing a
14844         block in event declarations.
14845
14846         * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
14847         value type, get its address.
14848
14849         * expression.cs (Is.Emit): For action `LeaveOnStack' we were
14850         leaving a class on the stack instead of a boolean value (int
14851         0/1).  Change the code so we compare against null, and then the
14852         result against zero.
14853
14854         * class.cs (TypeContainer.GetClassBases): We were checking for the
14855         parent class being sealed too late.
14856
14857         * expression.cs (Binary.Emit): For <= and >= when dealing with
14858         floating point values, use cgt.un and clt.un instead of cgt and
14859         clt alone.
14860
14861 2003-04-01  Zoltan Varga  <vargaz@freemail.hu>
14862
14863         * statement.cs: Apply the same optimization as MS: skip the 
14864         GetEnumerator returning an IEnumerator, and use the one returning a 
14865         CharEnumerator instead. This allows us to avoid the try-finally block 
14866         and the boxing.
14867
14868 2003-03-31  Gaurav Vaish <gvaish_mono@lycos.com>
14869
14870         * cs-parser.jay: Attributes cannot be applied to
14871                          namespaces. Fixes #40473
14872
14873 2003-03-31  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14874
14875         * class.cs:
14876         (Add*): check if the name is valid using the full name for constants,
14877         fields, properties and events.
14878
14879 2003-03-28  Miguel de Icaza  <miguel@ximian.com>
14880
14881         * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
14882         char constants to be part of the enumeration.
14883
14884         * expression.cs (Conditional.DoResolve): Add support for operator
14885         true. Implements the missing functionality from 14.12
14886
14887         * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
14888         operator true/false as required by the spec.
14889
14890         * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
14891         implicit conversion to boolean.
14892
14893         * statement.cs (Statement.ResolveBoolean): A boolean expression is
14894         also one where the type implements `operator true'. 
14895
14896         * ecore.cs (Expression.GetOperatorTrue): New helper routine to
14897         get an expression that will invoke operator true based on an
14898         expression.  
14899
14900         (GetConversionOperators): Removed the hack that called op_True
14901         here.  
14902
14903         (Expression.ResolveBoolean): Move this from Statement.
14904
14905 2003-03-17  Miguel de Icaza  <miguel@ximian.com>
14906
14907         * ecore.cs (FieldExpr): do not allow initialization of initonly
14908         fields on derived classes
14909
14910 2003-03-13  Martin Baulig  <martin@ximian.com>
14911
14912         * statement.cs (Block.Emit): Call ig.BeginScope() and
14913         ig.EndScope() when compiling with debugging info; call
14914         LocalBuilder.SetLocalSymInfo _after_ opening the scope.
14915
14916 2003-03-08  Miguel de Icaza  <miguel@ximian.com>
14917
14918         * expression.cs (Indexers): Do not construct immediately, allow
14919         for new members to be appended as we go.  Fixes 38143
14920
14921 2003-03-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14922
14923         * expression.cs: save/restore context when resolving an unchecked
14924         expression.
14925
14926 2003-03-05  Miguel de Icaza  <miguel@ximian.com>
14927
14928         * cfold.cs: Catch division by zero in modulus operator during
14929         constant folding.
14930
14931 2003-03-03  Miguel de Icaza  <miguel@ximian.com>
14932
14933         * interface.cs (Interface.DefineMembers): Avoid defining members
14934         twice. 
14935
14936 2003-02-27  Miguel de Icaza  <miguel@ximian.com>
14937
14938         * driver.cs: handle the +/- options for -noconfig
14939
14940         * statement.cs (Unckeched.Resolve): Also track the state of
14941         unchecked in the Resolve phase.
14942
14943 2003-02-27  Martin Baulig  <martin@ximian.com>
14944
14945         * ecore.cs (Expression.MemberLookup): Don't create a
14946         MethodGroupExpr for something which is not a method.  Fixes #38291.
14947
14948 2003-02-25  Miguel de Icaza  <miguel@ximian.com>
14949
14950         * class.cs (MemberBase.CheckParameters): Also check that the type
14951         is unmanaged if it is a pointer.
14952
14953         * expression.cs (SizeOf.Resolve): Add location information.
14954
14955         * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
14956         a managed type is declared.
14957
14958         * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
14959         parameter modifiers as well.  Fixes bug 38606
14960
14961         * class.cs: Very sad.  Am backing out the speed up changes
14962         introduced by the ArrayList -> Array in the TypeContainer, as they
14963         were not actually that much faster, and introduced a bug (no error
14964         reports on duplicated methods).
14965
14966         * assign.cs (CompoundAssign.DoLResolve): Resolve the original
14967         source first, this will guarantee that we have a valid expression
14968         before calling in lower levels functions that will require a
14969         resolved object.  Then use this original_source in the
14970         target.ResolveLValue instead of the original source that was
14971         passed to us.
14972
14973         Another change.  Use target.Resolve instead of LValueResolve.
14974         Although we are resolving for LValues, we will let the Assign code
14975         take care of that (it will be called again from Resolve).  This
14976         basically allows code like this:
14977
14978         class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
14979         class Y { void A (X x) { x [0] += o; }
14980
14981         The problem was that the indexer was trying to resolve for
14982         set_Item (idx, object o) and never finding one.  The real set_Item
14983         was set_Item (idx, X).  By delaying the process we get the right
14984         semantics. 
14985
14986         Fixes bug 36505
14987
14988 2003-02-23  Martin Baulig  <martin@ximian.com>
14989
14990         * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
14991         while calling DoEmit ().
14992
14993         * codegen.cs (EmitContext.Mark): Don't mark locations in other
14994         source files; if you use the #line directive inside a method, the
14995         compiler stops emitting line numbers for the debugger until it
14996         reaches the end of the method or another #line directive which
14997         restores the original file.
14998
14999 2003-02-23  Martin Baulig  <martin@ximian.com>
15000
15001         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
15002
15003 2003-02-23  Martin Baulig  <martin@ximian.com>
15004
15005         * statement.cs (Block.AddChildVariableNames): We need to call this
15006         recursively, not just for our immediate children.
15007
15008 2003-02-23  Martin Baulig  <martin@ximian.com>
15009
15010         * class.cs (Event.Define): Always make the field private, like csc does.
15011
15012         * typemanager.cs (TypeManager.RealMemberLookup): Make events
15013         actually work, fixes bug #37521.
15014
15015 2003-02-23  Miguel de Icaza  <miguel@ximian.com>
15016
15017         * delegate.cs: When creating the various temporary "Parameters"
15018         classes, make sure that we call the ComputeAndDefineParameterTypes
15019         on those new parameters (just like we do with the formal ones), to
15020         allow them to be resolved in the context of the DeclSpace.
15021
15022         This fixes the bug that Dick observed in Bugzilla #38530.
15023
15024 2003-02-22  Miguel de Icaza  <miguel@ximian.com>
15025
15026         * expression.cs (ResolveMemberAccess): When resolving a constant,
15027         do not attempt to pull a constant if the value was not able to
15028         generate a valid constant.
15029
15030         * const.cs (LookupConstantValue): Do not report more errors than required.
15031
15032 2003-02-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15033
15034         * expression.cs: fixes bug #38328.
15035
15036 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
15037
15038         * class.cs: Changed all the various members that can be part of a
15039         class from being an ArrayList to be an Array of the right type.
15040         During the DefineType type_list, interface_list, delegate_list and
15041         enum_list are turned into types, interfaces, delegates and enums
15042         arrays.  
15043
15044         And during the member population, indexer_list, event_list,
15045         constant_list, field_list, instance_constructor_list, method_list,
15046         operator_list and property_list are turned into their real arrays.
15047
15048         Although we could probably perform this operation earlier, for
15049         good error reporting we need to keep the lists and remove the
15050         lists for longer than required.
15051
15052         This optimization was triggered by Paolo profiling the compiler
15053         speed on the output of `gen-sample-program.pl' perl script. 
15054
15055         * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
15056         not crash in methods like MemberLookupFailed that use this field.  
15057
15058         This problem arises when the compiler fails to resolve a type
15059         during interface type definition for example.
15060
15061 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
15062
15063         * expression.cs (Indexers.GetIndexersForType): Interfaces do not
15064         inherit from System.Object, so we have to stop at null, not only
15065         when reaching System.Object.
15066
15067 2003-02-17  Miguel de Icaza  <miguel@ximian.com>
15068
15069         * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
15070         DeclaredOnly because the parent indexer might have had a different
15071         name, but did not loop until the top of the hierarchy was reached.
15072
15073         The problem this one fixes is 35492: when a class implemented an
15074         indexer from an interface, we were getting the interface method
15075         (which was abstract) and we were flagging an error (can not invoke
15076         abstract method).
15077
15078         This also keeps bug 33089 functioning, and test-148 functioning.
15079
15080         * typemanager.cs (IsSpecialMethod): The correct way of figuring
15081         out if a method is special is to see if it is declared in a
15082         property or event, or whether it is one of the predefined operator
15083         names.   This should fix correctly #36804.
15084
15085 2003-02-15  Miguel de Icaza  <miguel@ximian.com>
15086
15087         The goal here is to remove the dependency on EmptyCast.Peel ().
15088         Killing it completely.
15089
15090         The problem is that currently in a number of places where
15091         constants are expected, we have to "probe" for an EmptyCast, and
15092         Peel, which is not the correct thing to do, as this will be
15093         repetitive and will likely lead to errors. 
15094
15095         The idea is to remove any EmptyCasts that are used in casts that
15096         can be reduced to constants, so we only have to cope with
15097         constants. 
15098
15099         This bug hunt was triggered by Bug 37363 and the desire to remove
15100         the duplicate pattern where we were "peeling" emptycasts to check
15101         whether they were constants.  Now constants will always be
15102         constants.
15103
15104         * ecore.cs: Use an enumconstant here instead of wrapping with
15105         EmptyCast.  
15106
15107         * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
15108         throwing me off.  By handling this we can get rid of a few hacks.
15109
15110         * statement.cs (Switch): Removed Peel() code.
15111
15112 2003-02-14  Miguel de Icaza  <miguel@ximian.com>
15113
15114         * class.cs: Location information for error 508
15115
15116         * expression.cs (New.DoResolve): Add a guard against double
15117         resolution of an expression.  
15118
15119         The New DoResolve might be called twice when initializing field
15120         expressions (see EmitFieldInitializers, the call to
15121         GetInitializerExpression will perform a resolve on the expression,
15122         and later the assign will trigger another resolution
15123
15124         This leads to bugs (#37014)
15125
15126         * delegate.cs: The signature for EndInvoke should contain any ref
15127         or out parameters as well.  We were not doing this in the past. 
15128
15129         * class.cs (Field.Define): Do not overwrite the type definition
15130         inside the `volatile' group.  Turns out that volatile enumerations
15131         were changing the type here to perform a validity test, which
15132         broke conversions. 
15133
15134 2003-02-12  Miguel de Icaza  <miguel@ximian.com>
15135
15136         * ecore.cs (FieldExpr.AddressOf): In the particular case of This
15137         and structs, we do not want to load the instance variable
15138
15139         (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
15140         enum_type has to be handled like an object reference (implicit
15141         conversions exists from this to object), but the regular IsClass
15142         and IsValueType tests will never return true for this one.
15143
15144         Also we use TypeManager.IsValueType instead of type.IsValueType,
15145         just for consistency with the rest of the code (this is only
15146         needed if we ever use the construct exposed by test-180.cs inside
15147         corlib, which we dont today).
15148
15149 2003-02-12  Zoltan Varga  <vargaz@freemail.hu>
15150
15151         * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
15152         just InternalCall.
15153
15154 2003-02-09  Martin Baulig  <martin@ximian.com>
15155
15156         * namespace.cs (Namespace..ctor): Added SourceFile argument.
15157         (Namespace.DefineNamespaces): New static public method; this is
15158         called when we're compiling with debugging to add all namespaces
15159         to the symbol file.
15160
15161         * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
15162         pass it to the Namespace's .ctor.
15163
15164         * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
15165         and MethodBase arguments; pass the namespace ID to the symwriter;
15166         pass the MethodBase instead of the token to the symwriter.
15167         (SymbolWriter.DefineNamespace): New method to add a namespace to
15168         the symbol file.
15169
15170 2003-02-09  Martin Baulig  <martin@ximian.com>
15171
15172         * symbolwriter.cs: New file.  This is a wrapper around
15173         ISymbolWriter with a cleaner API.  We'll dynamically Invoke()
15174         methods here in near future.
15175
15176 2003-02-09  Martin Baulig  <martin@ximian.com>
15177
15178         * codegen.cs (EmitContext.Mark): Just pass the arguments to
15179         ILGenerator.MarkSequencePoint() which are actually used by the
15180         symbol writer.
15181
15182 2003-02-09  Martin Baulig  <martin@ximian.com>
15183
15184         * location.cs (SourceFile): New public sealed class.  This
15185         contains the name and an index which is used in the location's token.
15186         (Location): Reserve an appropriate number of bits in the token for
15187         the source file instead of walking over that list, this gives us a
15188         really huge performance improvement when compiling with debugging.
15189
15190         * driver.cs (Driver.parse, Driver.tokenize_file): Take a
15191         `SourceFile' argument instead of a string.
15192         (Driver.ProcessFile): Add all the files via Location.AddFile(),
15193         but don't parse/tokenize here, we need to generate the list of all
15194         source files before we do that.
15195         (Driver.ProcessFiles): New static function.  Parses/tokenizes all
15196         the files.
15197
15198         * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
15199         instead of a string.
15200
15201         * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
15202         of a string.
15203
15204 2003-02-09  Martin Baulig  <martin@ximian.com>
15205
15206         * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
15207         filename on `#line default'.
15208
15209 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
15210
15211         * statement.cs: don't clear the pinned var when the fixed statement
15212         returns from the method (fixes bug#37752).
15213
15214 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
15215
15216         * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban) 
15217         to IsValueType.
15218
15219 2003-02-07  Martin Baulig  <martin@ximian.com>
15220
15221         * driver.cs: Removed the `--debug-args' command line argument.
15222
15223         * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
15224         automatically by the AsssemblyBuilder.
15225         (CodeGen.InitializeSymbolWriter): We don't need to call any
15226         initialization function on the symbol writer anymore.  This method
15227         doesn't take any arguments.
15228
15229 2003-02-03  Miguel de Icaza  <miguel@ximian.com>
15230
15231         * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
15232         from referenced assemblies as well.
15233
15234 2003-02-02  Martin Baulig  <martin@ximian.com>
15235
15236         * class.cs (MethodData.Emit): Generate debugging info for external methods.
15237
15238 2003-02-02  Martin Baulig  <martin@ximian.com>
15239
15240         * class.cs (Constructor.Emit): Open the symbol writer before
15241         emitting the constructor initializer.
15242         (ConstructorInitializer.Emit): Call ec.Mark() to allow
15243         single-stepping through constructor initializers.
15244
15245 2003-01-30  Miguel de Icaza  <miguel@ximian.com>
15246
15247         * class.cs: Handle error 549: do not allow virtual methods in
15248         sealed classes. 
15249
15250 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
15251
15252         * decl.cs: Check access levels when resolving types
15253
15254 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
15255
15256         * statement.cs: Add parameters and locals set in catch blocks that might 
15257         return to set vector
15258
15259 2003-01-29  Miguel de Icaza  <miguel@ximian.com>
15260
15261         * class.cs (Operator): Set the SpecialName flags for operators.
15262
15263         * expression.cs (Invocation.DoResolve): Only block calls to
15264         accessors and operators on SpecialName methods.
15265
15266         (Cast.TryReduce): Handle conversions from char constants.
15267
15268
15269 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
15270
15271         * statement.cs: small memory and time optimization in FlowBranching.
15272
15273 2003-01-28  Pedro Mart  <yoros@wanadoo.es>
15274
15275         * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
15276         problem that the last fix but in the other sid (Set).
15277
15278         * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
15279         access when there is no indexer in the hierarchy.
15280
15281 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
15282
15283         * class.cs: Combine some if statements.
15284
15285 2003-01-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15286
15287         * driver.cs: fixed bug #37187.
15288
15289 2003-01-27  Pedro Martinez Juliá  <yoros@wanadoo.es>
15290
15291         * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
15292         any indexer, it's needed to build a list with all the indexers in the
15293         hierarchy (AllGetters), else we have problems. Fixes #35653.
15294
15295 2003-01-23  Miguel de Icaza  <miguel@ximian.com>
15296
15297         * class.cs (MethodData.Define): It is wrong for an interface
15298         implementation to be static in both cases: explicit and implicit.
15299         We were only handling this in one case.
15300
15301         Improve the if situation there to not have negations.
15302
15303         * class.cs (Field.Define): Turns out that we do not need to check
15304         the unsafe bit on field definition, only on usage.  Remove the test.
15305
15306 2003-01-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15307
15308         * driver.cs: use assembly.Location instead of Codebase (the latest
15309         patch made mcs fail when using MS assemblies).
15310
15311 2003-01-21  Tim Haynes <thaynes@openlinksw.com>
15312
15313         * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
15314         get the path to *corlib.dll.
15315
15316 2003-01-21  Nick Drochak <ndrochak@gol.com>
15317
15318         * cs-tokenizer.cs:
15319         * pending.cs:
15320         * typemanager.cs: Remove compiler warnings
15321
15322 2003-01-20  Duncan Mak  <duncan@ximian.com>
15323
15324         * AssemblyInfo.cs: Bump the version number to 0.19.
15325
15326 2003-01-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15327
15328         * cs-tokenizer.cs: little fixes to line numbering when #line is used.
15329
15330 2003-01-18  Zoltan Varga  <vargaz@freemail.hu>
15331
15332         * class.cs (Constructor::Emit): Emit debugging info for constructors.
15333
15334 2003-01-17  Miguel de Icaza  <miguel@ximian.com>
15335
15336         * cs-parser.jay: Small fix: we were not comparing the constructor
15337         name correctly.   Thanks to Zoltan for the initial pointer.
15338
15339 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
15340
15341         * cs-tokenizer.cs: Set file name when specified with #line
15342
15343 2003-01-15  Miguel de Icaza  <miguel@ximian.com>
15344
15345         * cs-parser.jay: Only perform the constructor checks here if we
15346         are named like the class;  This will help provider a better
15347         error.  The constructor path is taken when a type definition is
15348         not found, but most likely the user forgot to add the type, so
15349         report that rather than the constructor error.
15350
15351 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
15352
15353         * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
15354         allocations.
15355
15356 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
15357
15358         * cs-parser.jay: Add cleanup call.
15359
15360 2003-01-13  Duncan Mak  <duncan@ximian.com>
15361
15362         * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
15363         consistent with other methods.
15364
15365 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
15366
15367         * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
15368
15369 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
15370
15371         * attribute.cs: only set GuidAttr to true when we have a
15372         GuidAttribute.
15373
15374 2003-01-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15375
15376         * ecore.cs:
15377         * expression.cs:
15378         * typemanager.cs: fixes to allow mcs compile corlib with the new
15379         Type.IsSubclassOf fix.
15380
15381 2003-01-08  Miguel de Icaza  <miguel@ximian.com>
15382
15383         * expression.cs (LocalVariableReference.DoResolve): Classify a
15384         constant as a value, not as a variable.   Also, set the type for
15385         the variable.
15386
15387         * cs-parser.jay (fixed_statement): take a type instead of a
15388         pointer_type, so we can produce a better error message later.
15389
15390         * statement.cs (Fixed.Resolve): Flag types that are not pointers
15391         as an error.  
15392
15393         (For.DoEmit): Make inifinite loops have a
15394         non-conditional branch back.
15395
15396         (Fixed.DoEmit): First populate the pinned variables, then emit the
15397         statement, then clear the variables.  Before I was emitting the
15398         code once for each fixed piece.
15399
15400
15401 2003-01-08  Martin Baulig  <martin@ximian.com>
15402
15403         * statement.cs (FlowBranching.MergeChild): A break in a
15404         SWITCH_SECTION does not leave a loop.  Fixes #36155.
15405
15406 2003-01-08  Martin Baulig  <martin@ximian.com>
15407
15408         * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
15409         lives in the same number space than `param_map'.  Fixes #36154.
15410
15411 2003-01-07  Miguel de Icaza  <miguel@ximian.com>
15412
15413         * cs-parser.jay (constructor_declaration): Set the
15414         Constructor.ModFlags before probing for it.  This makes the
15415         compiler report 514, 515 and 132 (the code was there, but got
15416         broken). 
15417
15418         * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
15419         (GotoDefault.Resolve): Set `Returns' to ALWAYS.
15420         (GotoCase.Resolve): Set `Returns' to ALWAYS.
15421
15422 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
15423
15424         * enum.cs: create the enum static fields using the enum type.
15425
15426 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
15427
15428         * class.cs: don't try to create the ParamBuilder for the return
15429         type if it's not needed (and handle it breaking for the ms runtime
15430         anyway).
15431
15432 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
15433
15434         * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
15435
15436 2002-12-29  Miguel de Icaza  <miguel@ximian.com>
15437
15438         * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
15439         the command.   This showed up while compiling the JANET source
15440         code, which used \r as its only newline separator.
15441
15442 2002-12-28  Miguel de Icaza  <miguel@ximian.com>
15443
15444         * class.cs (Method.Define): If we are an operator (because it
15445         reuses our code), then set the SpecialName and HideBySig.  #36128
15446
15447 2002-12-22  Miguel de Icaza  <miguel@ximian.com>
15448
15449         * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
15450         exception, report error 120 `object reference required'.
15451
15452         * driver.cs: Add --pause option, used during to measure the size
15453         of the process as it goes with --timestamp.
15454
15455         * expression.cs (Invocation.DoResolve): Do not allow methods with
15456         SpecialName to be invoked.
15457
15458 2002-12-21  Miguel de Icaza  <miguel@ximian.com>
15459
15460         * cs-tokenizer.cs: Small fix to the parser: compute the ascii
15461         number before adding it.
15462
15463 2002-12-21  Ravi Pratap  <ravi@ximian.com>
15464
15465         * ecore.cs (StandardImplicitConversion): When in an unsafe
15466         context, we allow conversion between void * to any other pointer
15467         type. This fixes bug #35973.
15468
15469 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
15470
15471         * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
15472         is not thrown when extensionless outputs are used 
15473
15474 2002-12-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15475
15476         * rootcontext.cs: fixed compilation of corlib.
15477
15478 2002-12-19  Miguel de Icaza  <miguel@ximian.com>
15479
15480         * attribute.cs (Attributes.Contains): Add new method.
15481
15482         * class.cs (MethodCore.LabelParameters): if the parameter is an
15483         `out' parameter, check that no attribute `[In]' has been passed.
15484
15485         * enum.cs: Handle the `value__' name in an enumeration.
15486
15487 2002-12-14  Jaroslaw Kowalski <jarek@atm.com.pl>
15488
15489         * decl.cs: Added special case to allow overrides on "protected
15490         internal" methods
15491
15492 2002-12-18  Ravi Pratap  <ravi@ximian.com>
15493
15494         * attribute.cs (Attributes.AddAttributeSection): Rename to this
15495         since it makes much more sense.
15496
15497         (Attributes.ctor): Don't require a Location parameter.
15498
15499         * rootcontext.cs (AddGlobalAttributeSection): Rename again.
15500
15501         * attribute.cs (ApplyAttributes): Remove extra Location parameters
15502         since we already have that information per attribute.
15503
15504         * everywhere : make appropriate changes.
15505
15506         * class.cs (LabelParameters): Write the code which actually
15507         applies attributes to the return type. We can't do this on the MS
15508         .NET runtime so we flag a warning in the case an exception is
15509         thrown.
15510
15511 2002-12-18  Miguel de Icaza  <miguel@ximian.com>
15512
15513         * const.cs: Handle implicit null conversions here too.
15514
15515 2002-12-17  Ravi Pratap  <ravi@ximian.com>
15516
15517         * class.cs (MethodCore.LabelParameters): Remove the extra
15518         Type [] parameter since it is completely unnecessary. Instead
15519         pass in the method's attributes so that we can extract
15520         the "return" attribute.
15521
15522 2002-12-17  Miguel de Icaza  <miguel@ximian.com>
15523
15524         * cs-parser.jay (parse): Use Report.Error to flag errors instead
15525         of ignoring it and letting the compile continue.
15526
15527         * typemanager.cs (ChangeType): use an extra argument to return an
15528         error condition instead of throwing an exception.
15529
15530 2002-12-15  Miguel de Icaza  <miguel@ximian.com>
15531
15532         * expression.cs (Unary.TryReduce): mimic the code for the regular
15533         code path.  Perform an implicit cast in the cases where we can
15534         implicitly convert to one of the integral types, and then reduce
15535         based on that constant.   This fixes bug #35483.
15536
15537 2002-12-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15538
15539         * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
15540
15541 2002-12-13  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15542
15543         * namespace.cs: fixed bug #35489.
15544
15545 2002-12-12  Miguel de Icaza  <miguel@ximian.com>
15546
15547         * class.cs: Remove some dead code.
15548
15549         * cs-parser.jay: Estimate the number of methods needed
15550         (RootContext.MethodCount);
15551
15552         * cs-tokenizer.cs: Use char arrays for parsing identifiers and
15553         numbers instead of StringBuilders.
15554
15555         * support.cs (PtrHashtable): Add constructor with initial size;
15556         We can now reduce reallocations of the method table.
15557
15558 2002-12-10  Ravi Pratap  <ravi@ximian.com>
15559
15560         * attribute.cs (ApplyAttributes): Keep track of the emitted
15561         attributes on a per-target basis. This fixes bug #35413.
15562
15563 2002-12-10  Miguel de Icaza  <miguel@ximian.com>
15564
15565         * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
15566         default to the Windows 1252 encoding.
15567
15568         (UnixParseOption): Support version, thanks to Alp for the missing
15569         pointer. 
15570
15571         * AssemblyInfo.cs: Add nice assembly information.
15572
15573         * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
15574         (bug 35169).
15575
15576         * cs-parser.jay: Allow a trailing comma before the close bracked
15577         in the attribute_section production.
15578
15579         * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
15580         address of the instance was being taken, I will take this out,
15581         because we take the address of the object immediately here.
15582
15583 2002-12-09  Ravi Pratap  <ravi@ximian.com>
15584
15585         * typemanager.cs (AreMultipleAllowed): Take care of the most
15586         obvious case where attribute type is not in the current assembly -
15587         stupid me ;-)
15588
15589 2002-12-08  Miguel de Icaza  <miguel@ximian.com>
15590
15591         * ecore.cs (SimpleName.DoResolve): First perform lookups on using
15592         definitions, instead of doing that afterwards.  
15593
15594         Also we use a nice little hack, depending on the constructor, we
15595         know if we are a "composed" name or a simple name.  Hence, we
15596         avoid the IndexOf test, and we avoid 
15597
15598         * codegen.cs: Add code to assist in a bug reporter to track down
15599         the source of a compiler crash. 
15600
15601 2002-12-07  Ravi Pratap  <ravi@ximian.com>
15602
15603         * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
15604         types have been emitted for a given element and flag an error
15605         if something which does not have AllowMultiple set is used more
15606         than once.
15607
15608         * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
15609         attribute types and their corresponding AllowMultiple properties
15610
15611         (AreMultipleAllowed): Check the property for a given type.
15612
15613         * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
15614         property in the case we have a TypeContainer.
15615
15616         (Attributes.AddAttribute): Detect duplicates and just skip on
15617         adding them. This trivial fix catches a pretty gross error in our
15618         attribute emission - global attributes were being emitted twice!
15619
15620         Bugzilla bug #33187 is now fixed.
15621
15622 2002-12-06  Miguel de Icaza  <miguel@ximian.com>
15623
15624         * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
15625         instead of pp_and).
15626
15627         * expression.cs (Binary.ResolveOperator): I can only use the
15628         Concat (string, string, string) and Concat (string, string,
15629         string, string) if the child is actually a concatenation of
15630         strings. 
15631
15632 2002-12-04  Miguel de Icaza  <miguel@ximian.com>
15633
15634         * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
15635         context where we need a 2-character lookahead.
15636
15637         * pending.cs (PendingImplementation): Rework so we can keep track
15638         of interface types all the time, and flag those which were
15639         implemented by parents as optional.
15640
15641 2002-12-03  Miguel de Icaza  <miguel@ximian.com>
15642
15643         * expression.cs (Binary.ResolveOperator): Use
15644         String.Concat(string,string,string) or
15645         String.Concat(string,string,string,string) when possible. 
15646
15647         * typemanager: More helper methods.
15648
15649
15650 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
15651
15652         * pending.cs: remove the bogus return from GetMissingInterfaces()
15653         (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
15654
15655 2002-12-02  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15656
15657         * namespace.cs: avoid duplicated 'using xxx' being added to
15658         using_clauses. This prevents mcs from issuing and 'ambiguous type' error
15659         when we get more than one 'using' statement for the same namespace.
15660         Report a CS0105 warning for it.
15661
15662 2002-11-30  Miguel de Icaza  <miguel@ximian.com>
15663
15664         * cs-tokenizer.cs (consume_identifier): use read directly, instead
15665         of calling getChar/putback, uses internal knowledge of it.    
15666
15667         (xtoken): Reorder tokenizer so most common patterns are checked
15668         first.  This reduces the compilation time in another 5% (from 8.11s
15669         average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
15670
15671         The parsing time is 22% of the compilation in mcs, and from that
15672         64% is spent on the tokenization process.  
15673
15674         I tried using a binary search for keywords, but this is slower
15675         than the hashtable.  Another option would be to do a couple of
15676         things:
15677
15678                 * Not use a StringBuilder, instead use an array of chars,
15679                   with a set value.  Notice that this way we could catch
15680                   the 645 error without having to do it *afterwards*.
15681
15682                 * We could write a hand-parser to avoid the hashtable
15683                   compares altogether.
15684
15685         The identifier consumption process takes 37% of the tokenization
15686         time.  Another 15% is spent on is_number.  56% of the time spent
15687         on is_number is spent on Int64.Parse:
15688
15689                 * We could probably choose based on the string length to
15690                   use Int32.Parse or Int64.Parse and avoid all the 64-bit
15691                   computations. 
15692
15693         Another 3% is spend on wrapping `xtoken' in the `token' function.
15694
15695         Handle 0xa0 as whitespace (#34752)
15696
15697 2002-11-26  Miguel de Icaza  <miguel@ximian.com>
15698
15699         * typemanager.cs (IsCLRType): New routine to tell whether a type
15700         is one of the builtin types.  
15701
15702         Maybe it needs to use TypeCodes to be faster.  Maybe we could use
15703         typecode in more places instead of doing pointer comparissions.
15704         We could leverage some knowledge about the way the typecodes are
15705         laid out.
15706
15707         New code to cache namespaces in assemblies, it is currently not
15708         invoked, to be used soon.
15709
15710         * decl.cs (DeclSpace.MakeFQN): Simple optimization.
15711
15712         * expression.cs (Binary.ResolveOperator): specially handle
15713         strings, and do not perform user-defined operator overloading for
15714         built-in types.
15715
15716 2002-11-24  Miguel de Icaza  <miguel@ximian.com>
15717
15718         * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
15719         internalcall as it is a pretty simple operation;  Avoid whenever
15720         possible to call Char.IsLetter.
15721
15722         (consume_identifier): Cut by half the number of
15723         hashtable calls by merging the is_keyword and GetKeyword behavior.
15724
15725         Do not short-circuit, because if we do, we
15726         report errors (ie, #if false && true would produce an invalid
15727         directive error);
15728
15729
15730 2002-11-24  Martin Baulig  <martin@ximian.com>
15731
15732         * expression.cs (Cast.TryReduce): If we're in checked syntax,
15733         check constant ranges and report a CS0221.  Fixes #33186.
15734
15735 2002-11-24  Martin Baulig  <martin@ximian.com>
15736
15737         * cs-parser.jay: Make this work for uninitialized variable
15738         declarations in the `for' initializer.  Fixes #32416.
15739
15740 2002-11-24  Martin Baulig  <martin@ximian.com>
15741
15742         * ecore.cs (Expression.ConvertExplicit): Make casting from/to
15743         System.Enum actually work.  Fixes bug #32269, added verify-6.cs.
15744
15745 2002-11-24  Martin Baulig  <martin@ximian.com>
15746
15747         * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
15748         argument; if true, we also check for user-defined conversions.
15749         This is only needed if both arguments are of a user-defined type.
15750         Fixes #30443, added test-175.cs.
15751         (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
15752
15753         * ecore.cs (Expression.ImplicitUserConversionExists): New method.
15754
15755 2002-11-24  Martin Baulig  <martin@ximian.com>
15756
15757         * expression.cs (ArrayAccess.GetStoreOpcode): New public static
15758         function to get the store opcode.
15759         (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
15760         only emit the Ldelema if the store opcode is Stobj.  You must run
15761         both test-34 and test-167 to test this.  Fixes #34529.
15762
15763 2002-11-23  Martin Baulig  <martin@ximian.com>
15764
15765         * ecore.cs (Expression.MemberLookup): Added additional
15766         `qualifier_type' argument which is used when we're being called
15767         from MemberAccess.DoResolve() and null if we're called from a
15768         SimpleName lookup.
15769         (Expression.MemberLookupFailed): New method to report errors; this
15770         does the CS1540 check and reports the correct error message.
15771
15772         * typemanager.cs (MemberLookup): Added additional `qualifier_type'
15773         argument for the CS1540 check and redone the way how we're dealing
15774         with private members.  See the comment in the source code for details.
15775         (FilterWithClosure): Reverted this back to revision 1.197; renamed
15776         `closure_start_type' to `closure_qualifier_type' and check whether
15777         it's not null.  It was not this filter being broken, it was just
15778         being called with the wrong arguments.
15779
15780         * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
15781         and pass it the correct `qualifier_type'; this also does the error
15782         handling for us.
15783
15784 2002-11-22  Miguel de Icaza  <miguel@ximian.com>
15785
15786         * expression.cs (Invocation.EmitParams): If the we are dealing
15787         with a non-built-in value type, load its address as well.
15788
15789         (ArrayCreation): Use a a pretty constant instead
15790         of the hardcoded value 2.   Use 6 instead of 2 for the number of
15791         static initializers.  
15792
15793         (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
15794         because they are not really value types, just glorified integers. 
15795
15796         * driver.cs: Do not append .exe, the CSC compiler does not do it.
15797
15798         * ecore.cs: Remove redundant code for enumerations, make them use
15799         the same code path as everything else, fixes the casting issue
15800         with enumerations in Windows.Forms.
15801
15802         * attribute.cs: Do only cast to string if it is a string, the
15803         validation happens later.
15804
15805         * typemanager.cs: Temproary hack to avoid a bootstrap issue until
15806         people upgrade their corlibs.
15807
15808         * ecore.cs: Oops, enumerations were not following the entire code path
15809
15810 2002-11-21  Miguel de Icaza  <miguel@ximian.com>
15811
15812         * typemanager.cs (FilterWithClosure): Commented out the test for
15813         1540 in typemanager.cs, as it has problems when accessing
15814         protected methods from a parent class (see test-174.cs). 
15815
15816         * attribute.cs (Attribute.ValidateGuid): new method.
15817         (Attribute.Resolve): Use above.
15818
15819 2002-11-19  Miguel de Icaza  <miguel@ximian.com>
15820
15821         * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
15822
15823         * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
15824         handling for enumerations, as we only needed the TypeContainer
15825         functionality to begin with (this is required for the fix below to
15826         work for enums that reference constants in a container class for
15827         example). 
15828
15829         * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
15830
15831         * enum.cs (Enum.Define): Use `this' instead of parent, so we have
15832         a valid TypeBuilder to perform lookups on.o
15833
15834         * class.cs (InheritableMemberSignatureCompare): Use true in the
15835         call to GetGetMethod and GetSetMethod, because we are comparing
15836         the signature, and we need to get the methods *even* if they are
15837         private. 
15838
15839         (PropertyBase.CheckBase): ditto.
15840
15841         * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
15842         GotoCase.Resolve): Use Peel on EmpytCasts.
15843
15844         * ecore.cs (EmptyCast): drop child, add Peel method.
15845
15846 2002-11-17  Martin Baulig  <martin@ximian.com>
15847
15848         * ecore.cs (EmptyCast.Child): New public property.
15849
15850         * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
15851         label resolved to an EmptyCast.  Fixes #34162.
15852         (GotoCase.Resolve): Likewise.
15853         (Block.EmitMeta): Likewise.
15854
15855 2002-11-17  Martin Baulig  <martin@ximian.com>
15856
15857         * expression.cs (Invocation.BetterConversion): Prefer int over
15858         uint; short over ushort; long over ulong for integer literals.
15859         Use ImplicitConversionExists instead of StandardConversionExists
15860         since we also need to check for user-defined implicit conversions.
15861         Fixes #34165.  Added test-173.cs.
15862
15863 2002-11-16  Martin Baulig  <martin@ximian.com>
15864
15865         * expression.cs (Binary.EmitBranchable): Eliminate comparisions
15866         with the `true' and `false' literals.  Fixes #33151.
15867
15868 2002-11-16  Martin Baulig  <martin@ximian.com>
15869
15870         * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
15871         October 22nd; don't do the cs1540 check for static members.
15872
15873         * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
15874         now using our own filter here and doing the cs1540 check again.
15875
15876 2002-11-16  Martin Baulig  <martin@ximian.com>
15877
15878         * support.cs (InternalParameters): Don't crash if we don't have
15879         any fixed parameters.  Fixes #33532.
15880
15881 2002-11-16  Martin Baulig  <martin@ximian.com>
15882
15883         * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
15884         when looking up static methods to make this work on Windows.
15885         Fixes #33773.
15886
15887 2002-11-16  Martin Baulig  <martin@ximian.com>
15888
15889         * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
15890         a setter rather than using PropertyInfo.CanWrite.
15891
15892 2002-11-15  Nick Drochak  <ndrochak@gol.com>
15893
15894         * class.cs: Allow acces to block member by subclasses. Fixes build
15895         breaker.
15896
15897 2002-11-14  Martin Baulig  <martin@ximian.com>
15898
15899         * class.cs (Constructor.Emit): Added the extern/block check.
15900         Fixes bug #33678.
15901
15902 2002-11-14  Martin Baulig  <martin@ximian.com>
15903
15904         * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
15905         iteration while looking for indexers, this is needed because the
15906         indexer may have a different name in our base classes.  Fixed the
15907         error reporting (no indexers at all, not get accessor, no
15908         overloaded match).  Fixes bug #33089.
15909         (IndexerAccess.DoResolveLValue): Likewise.
15910
15911 2002-11-14  Martin Baulig  <martin@ximian.com>
15912
15913         * class.cs (PropertyBase.CheckBase): Make this work for multiple
15914         indexers.  Fixes the first part of bug #33089.
15915         (MethodSignature.InheritableMemberSignatureCompare): Added support
15916         for properties.
15917
15918 2002-11-13  Ravi Pratap  <ravi@ximian.com>
15919
15920         * attribute.cs (Attribute.Resolve): Catch the
15921         NullReferenceException and report it since it isn't supposed to
15922         happen. 
15923
15924 2002-11-12  Miguel de Icaza  <miguel@ximian.com>
15925
15926         * expression.cs (Binary.EmitBranchable): Also handle the cases for
15927         LogicalOr and LogicalAnd that can benefit from recursively
15928         handling EmitBranchable.  The code now should be nice for Paolo.
15929
15930 2002-11-08  Miguel de Icaza  <miguel@ximian.com>
15931
15932         * typemanager.cs (LookupType): Added a negative-hit hashtable for
15933         the Type lookups, as we perform quite a number of lookups on
15934         non-Types.  This can be removed once we can deterministically tell
15935         whether we have a type or a namespace in advance.
15936
15937         But this might require special hacks from our corlib.
15938
15939         * TODO: updated.
15940
15941         * ecore.cs (TryImplicitIntConversion): Handle conversions to float
15942         and double which avoids a conversion from an integer to a double.
15943
15944         * expression.cs: tiny optimization, avoid calling IsConstant,
15945         because it effectively performs the lookup twice.
15946
15947 2002-11-06  Miguel de Icaza  <miguel@ximian.com>
15948
15949         But a bogus return here to keep the semantics of the old code
15950         until the Mono runtime is fixed.
15951
15952         * pending.cs (GetMissingInterfaces): New method used to remove all
15953         the interfaces that are already implemented by our parent
15954         classes from the list of pending methods. 
15955
15956         * interface.cs: Add checks for calls after ResolveTypeExpr.
15957
15958 2002-11-05  Miguel de Icaza  <miguel@ximian.com>
15959
15960         * class.cs (Class.Emit): Report warning 67: event not used if the
15961         warning level is beyond 3.
15962
15963         * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
15964         being a NullLiteral.
15965
15966         * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
15967         specifiers. 
15968
15969         * class.cs (TypeContainer.GetClassBases): Cover a missing code
15970         path that might fail if a type can not be resolved.
15971
15972         * expression.cs (Binary.Emit): Emit unsigned versions of the
15973         operators. 
15974
15975         * driver.cs: use error 5.
15976
15977 2002-11-02  Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
15978
15979         * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
15980
15981 2002-11-01  Miguel de Icaza  <miguel@ximian.com>
15982
15983         * cs-parser.jay (switch_section): A beautiful patch from Martin
15984         Baulig that fixed 33094.
15985
15986 2002-10-31  Miguel de Icaza  <miguel@ximian.com>
15987
15988         * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
15989         Check whether the base is abstract and report an error if so.
15990
15991         * expression.cs (IndexerAccess.DoResolveLValue,
15992         IndexerAccess.DoResolve): ditto. 
15993
15994         (Invocation.DoResolve): ditto.
15995
15996         (Invocation.FullMethodDesc): Improve the report string.
15997
15998         * statement.cs (Block): Eliminate IsVariableDefined as it is
15999         basically just a wrapper for GetVariableInfo.
16000
16001         * ecore.cs (SimpleName): Use new 
16002
16003         * support.cs (ReflectionParamter.ParameterType): We unwrap the
16004         type, as we return the actual parameter ref/unref state on a
16005         different call.
16006
16007 2002-10-30  Miguel de Icaza  <miguel@ximian.com>
16008
16009         * support.cs: Return proper flags REF/OUT fixing the previous
16010         commit.  
16011
16012         * expression.cs: Reverted last patch, that was wrong.  Is_ref is
16013         not used to mean `ref' but `ref or out' in ParameterReference
16014
16015         * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
16016         full type signature instead of calling TypeManger.CSharpName
16017         ourselves. 
16018
16019         * support.cs (InternalParameters.ParameterDesc): Do not compare
16020         directly to the modflags, because REF/OUT will actually be bitsets
16021         if set. 
16022
16023         * delegate.cs (VerifyMethod): Check also the modifiers.
16024
16025         * cs-tokenizer.cs: Fix bug where floating point values with an
16026         exponent where a sign was missing was ignored.
16027
16028         * driver.cs: Allow multiple assemblies to be specified in a single
16029         /r: argument
16030
16031 2002-10-28  Miguel de Icaza  <miguel@ximian.com>
16032
16033         * cs-parser.jay: Ugly.  We had to add a multiplicative_expression,
16034         because identifiers after a parenthesis would end up in this kind
16035         of production, and we needed to desamiguate it for having casts
16036         like:
16037
16038                 (UserDefinedType *) xxx
16039
16040 2002-10-24  Miguel de Icaza  <miguel@ximian.com>
16041
16042         * typemanager.cs (RealMemberLookup): when we deal with a subclass,
16043         we should set on the Bindingflags.NonPublic, but not turn on
16044         private_ok.  private_ok controls whether a Private member is
16045         returned (this is chekced on the filter routine), while the
16046         BindingFlags.NonPublic just controls whether private/protected
16047         will be allowed.   This fixes the problem part of the problem of
16048         private properties being allowed to be used in derived classes.
16049
16050         * expression.cs (BaseAccess): Provide an DoResolveLValue method,
16051         so we can call the children DoResolveLValue method (this will
16052         properly signal errors on lvalue assignments to base properties)
16053
16054         * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
16055         getter are null, and we have a property info, we know that this
16056         happened because the lookup failed, so we report an error 122 for
16057         protection level violation.
16058
16059         We also silently return if setter and getter are null in the
16060         resolve functions, this condition only happens if we have flagged
16061         the error before.  This is the other half of the problem. 
16062
16063         (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
16064         not have accessibility information, that is why we were returning
16065         true in the filter function in typemanager.cs.
16066
16067         To properly report 122 (property is inaccessible because of its
16068         protection level) correctly, we report this error in ResolveAccess
16069         by failing if both the setter and the getter are lacking (ie, the
16070         lookup failed). 
16071
16072         DoResolve and DoLResolve have been modified to check for both
16073         setter/getter being null and returning silently, the reason being
16074         that I did not want to put the knowledge about this error in upper
16075         layers, like:
16076
16077         int old = Report.Errors;
16078         x = new PropertyExpr (...);
16079         if (old != Report.Errors)
16080                 return null;
16081         else
16082                 return x;
16083
16084         So the property expr is returned, but it is invalid, so the error
16085         will be flagged during the resolve process. 
16086
16087         * class.cs: Remove InheritablePropertySignatureCompare from the
16088         class, as we no longer depend on the property signature to compute
16089         whether it is possible to implement a method or not.
16090
16091         The reason is that calling PropertyInfo.GetGetMethod will return
16092         null (in .NET, in Mono it works, and we should change this), in
16093         cases where the Get Method does not exist in that particular
16094         class.
16095
16096         So this code:
16097
16098         class X { public virtual int A { get { return 1; } } }
16099         class Y : X { }
16100         class Z : Y { public override int A { get { return 2; } } }
16101
16102         Would fail in Z because the parent (Y) would not have the property
16103         defined.  So we avoid this completely now (because the alternative
16104         fix was ugly and slow), and we now depend exclusively on the
16105         method names.
16106
16107         (PropertyBase.CheckBase): Use a method-base mechanism to find our
16108         reference method, instead of using the property.
16109
16110         * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
16111         routines are gone now.
16112
16113         * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
16114         names, they were incorrectly named.
16115
16116         * cs-tokenizer.cs: Return are more gentle token on failure. 
16117
16118         * pending.cs (PendingImplementation.InterfaceMethod): This routine
16119         had an out-of-sync index variable, which caused it to remove from
16120         the list of pending methods the wrong method sometimes.
16121
16122 2002-10-22  Miguel de Icaza  <miguel@ximian.com>
16123
16124         * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
16125         CanWrite, because those refer to this particular instance of the
16126         property, and do not take into account the fact that we can
16127         override single members of a property.
16128
16129         Constructor requires an EmitContext.  The resolution process does
16130         not happen here, but we need to compute the accessors before,
16131         because the resolution does not always happen for properties.
16132
16133         * typemanager.cs (RealMemberLookup): Set private_ok if we are a
16134         subclass, before we did not update this flag, but we did update
16135         bindingflags. 
16136
16137         (GetAccessors): Drop this routine, as it did not work in the
16138         presence of partially overwritten set/get methods. 
16139
16140         Notice that this broke the cs1540 detection, but that will require
16141         more thinking. 
16142
16143 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16144
16145         * class.cs:
16146         * codegen.cs:
16147         * driver.cs: issue a warning instead of an error if we don't support
16148         debugging for the platform. Also ignore a couple of errors that may
16149         arise when trying to write the symbols. Undo my previous patch.
16150
16151 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16152
16153         * driver.cs: ignore /debug switch except for Unix platforms.
16154
16155 2002-10-23  Nick Drochak  <ndrochak@gol.com>
16156
16157         * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
16158
16159 2002-10-21  Miguel de Icaza  <miguel@ximian.com>
16160
16161         * driver.cs: Do not make mcs-debug conditional, so we do not break
16162         builds that use it.
16163
16164         * statement.cs (UsageVector.MergeChildren): I would like Martin to
16165         review this patch.  But basically after all the children variables
16166         have been merged, the value of "Breaks" was not being set to
16167         new_breaks for Switch blocks.  I think that it should be set after
16168         it has executed.  Currently I set this to the value of new_breaks,
16169         but only if new_breaks is FlowReturn.ALWAYS, which is a bit
16170         conservative, but I do not understand this code very well.
16171
16172         I did not break anything in the build, so that is good ;-)
16173
16174         * cs-tokenizer.cs: Also allow \r in comments as a line separator.
16175
16176 2002-10-20  Mark Crichton  <crichton@gimp.org>
16177
16178         * cfold.cs: Fixed compile blocker.  Really fixed it this time.
16179
16180 2002-10-20  Nick Drochak  <ndrochak@gol.com>
16181
16182         * cfold.cs: Fixed compile blocker.
16183
16184 2002-10-20  Miguel de Icaza  <miguel@ximian.com>
16185
16186         * driver.cs: I was chekcing the key, not the file.
16187
16188 2002-10-19  Ravi Pratap  <ravi@ximian.com>
16189
16190         * ecore.cs (UserDefinedConversion): Get rid of the bogus error
16191         message that we were generating - we just need to silently return
16192         a null.
16193
16194 2002-10-19  Miguel de Icaza  <miguel@ximian.com>
16195
16196         * class.cs (Event.Define): Change my previous commit, as this
16197         breaks the debugger.  This is a temporary hack, as it seems like
16198         the compiler is generating events incorrectly to begin with.
16199
16200         * expression.cs (Binary.ResolveOperator): Added support for 
16201         "U operator - (E x, E y)"
16202
16203         * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
16204         y)".
16205
16206         * ecore.cs (FieldExpr.AddressOf): We had a special code path for
16207         init-only variables, but this path did not take into account that
16208         there might be also instance readonly variables.  Correct this
16209         problem. 
16210
16211         This fixes bug 32253
16212
16213         * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
16214         delegates as well.
16215
16216         * driver.cs: Change the extension for modules to `netmodule'
16217
16218         * cs-parser.jay: Improved slightly the location tracking for
16219         the debugger symbols.
16220
16221         * class.cs (Event.Define): Use Modifiers.FieldAttr on the
16222         modifiers that were specified instead of the hardcoded value
16223         (FamAndAssem).  This was basically ignoring the static modifier,
16224         and others.  Fixes 32429.
16225
16226         * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
16227         fixed a bug in the process (32476)
16228
16229         * expression.cs (ArrayAccess.EmitAssign): Patch from
16230         hwang_rob@yahoo.ca that fixes bug 31834.3
16231
16232 2002-10-18  Miguel de Icaza  <miguel@ximian.com>
16233
16234         * driver.cs: Make the module extension .netmodule.
16235
16236 2002-10-16  Miguel de Icaza  <miguel@ximian.com>
16237
16238         * driver.cs: Report an error if the resource file is not found
16239         instead of crashing.
16240
16241         * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
16242         false, like Emit does.
16243
16244 2002-10-16  Nick Drochak  <ndrochak@gol.com>
16245
16246         * typemanager.cs: Remove unused private member.  Also reported mcs
16247         bug to report this as a warning like csc.
16248
16249 2002-10-15  Martin Baulig  <martin@gnome.org>
16250
16251         * statement.cs (Statement.Emit): Made this a virtual method; emits
16252         the line number info and calls DoEmit().
16253         (Statement.DoEmit): New protected abstract method, formerly knows
16254         as Statement.Emit().
16255
16256         * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
16257
16258 2002-10-11  Miguel de Icaza  <miguel@ximian.com>
16259
16260         * class.cs: Following the comment from 2002-09-26 to AddMethod, I
16261         have fixed a remaining problem: not every AddXXXX was adding a
16262         fully qualified name.  
16263
16264         Now everyone registers a fully qualified name in the DeclSpace as
16265         being defined instead of the partial name.  
16266
16267         Downsides: we are slower than we need to be due to the excess
16268         copies and the names being registered this way.  
16269
16270         The reason for this is that we currently depend (on the corlib
16271         bootstrap for instance) that types are fully qualified, because
16272         we dump all the types in the namespace, and we should really have
16273         types inserted into the proper namespace, so we can only store the
16274         basenames in the defined_names array.
16275
16276 2002-10-10  Martin Baulig  <martin@gnome.org>
16277
16278         * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
16279         from bug #31834, see the bug report for a testcase which is
16280         miscompiled.
16281
16282 2002-10-10  Martin Baulig  <martin@gnome.org>
16283
16284         * codegen.cs (EmitContext.Breaks): Removed, we're now using the
16285         flow analysis code for this.
16286
16287         * statement.cs (Do, While, For): Tell the flow analysis code about
16288         infinite loops.
16289         (FlowBranching.UsageVector): Added support for infinite loops.
16290         (Block.Resolve): Moved the dead code elimination here and use flow
16291         analysis to do it.
16292
16293 2002-10-09  Miguel de Icaza  <miguel@ximian.com>
16294
16295         * class.cs (Field.Define): Catch cycles on struct type
16296         definitions. 
16297
16298         * typemanager.cs (IsUnmanagedtype): Do not recursively check
16299         fields if the fields are static.  We only need to check instance
16300         fields. 
16301
16302         * expression.cs (As.DoResolve): Test for reference type.
16303
16304         * statement.cs (Using.ResolveExpression): Use
16305         ConvertImplicitRequired, not ConvertImplicit which reports an
16306         error on failture
16307         (Using.ResolveLocalVariableDecls): ditto.
16308
16309         * expression.cs (Binary.ResolveOperator): Report errors in a few
16310         places where we had to.
16311
16312         * typemanager.cs (IsUnmanagedtype): Finish implementation.
16313
16314 2002-10-08  Miguel de Icaza  <miguel@ximian.com>
16315
16316         * expression.cs: Use StoreFromPtr instead of extracting the type
16317         and then trying to use Stelem.  Patch is from hwang_rob@yahoo.ca
16318
16319         * ecore.cs (ImplicitReferenceConversion): It is possible to assign
16320         an enumeration value to a System.Enum, but System.Enum is not a
16321         value type, but an class type, so we need to box.
16322
16323         (Expression.ConvertExplicit): One codepath could return
16324         errors but not flag them.  Fix this.  Fixes #31853
16325
16326         * parameter.cs (Resolve): Do not allow void as a parameter type.
16327
16328 2002-10-06  Martin Baulig  <martin@gnome.org>
16329
16330         * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
16331         if it's a class type and not a struct.  Fixes #31815.
16332
16333 2002-10-06  Martin Baulig  <martin@gnome.org>
16334
16335         * statement.cs: Reworked the flow analysis code a bit to make it
16336         usable for dead code elimination.
16337
16338 2002-10-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16339
16340         * cs-parser.jay: allow empty source files. Fixes bug #31781.
16341
16342 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
16343
16344         * expression.cs (ComposedCast.DoResolveType): A quick workaround
16345         to fix the test 165, will investigate deeper.
16346
16347 2002-10-04  Martin Baulig  <martin@gnome.org>
16348
16349         * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
16350         finally blocks actually work.
16351         (Try.Resolve): We don't need to create a sibling for `finally' if
16352         there is no finally block.
16353
16354 2002-10-04  Martin Baulig  <martin@gnome.org>
16355
16356         * class.cs (Constructor.Define): The default accessibility for a
16357         non-default constructor is private, not public.
16358
16359 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
16360
16361         * class.cs (Constructor): Make AllowedModifiers public, add
16362         EXTERN.
16363
16364         * cs-parser.jay: Perform the modifiers test here, as the
16365         constructor for the Constructor class usually receives a zero
16366         because of the way we create it (first we create, later we
16367         customize, and we were never checking the modifiers).
16368
16369         * typemanager.cs (Typemanager.LookupTypeDirect): This new function
16370         is a version of LookupTypeReflection that includes the type-name
16371         cache.  This can be used as a fast path for functions that know
16372         the fully qualified name and are only calling into *.GetType() to
16373         obtain a composed type.
16374
16375         This is also used by TypeManager.LookupType during its type
16376         composition.
16377
16378         (LookupType): We now also track the real type name, as sometimes
16379         we can get a quey for the real type name from things like
16380         ComposedCast.  This fixes bug 31422.
16381
16382         * expression.cs (ComposedCast.Resolve): Since we are obtaining a
16383         complete type fullname, it does not have to go through the type
16384         resolution system to obtain the composed version of the type (for
16385         obtaining arrays or pointers).
16386
16387         (Conditional.Emit): Use the EmitBoolExpression to
16388         generate nicer code, as requested by Paolo.
16389
16390         (ArrayCreation.CheckIndices): Use the patch from
16391         hwang_rob@yahoo.ca to validate the array initializers. 
16392
16393 2002-10-03  Miguel de Icaza  <miguel@ximian.com>
16394
16395         * class.cs (ConstructorInitializer.Emit): simplify code by using
16396         Invocation.EmitCall, and at the same time, fix the bugs in calling
16397         parent constructors that took variable arguments. 
16398
16399         * ecore.cs (Expression.ConvertNumericExplicit,
16400         Expression.ImplicitNumericConversion): Remove the code that
16401         manually wrapped decimal (InternalTypeConstructor call is now gone
16402         as well).
16403
16404         * expression.cs (Cast.TryReduce): Also handle decimal types when
16405         trying to perform a constant fold on the type.
16406
16407         * typemanager.cs (IsUnmanagedtype): Partially implemented.
16408
16409         * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
16410         that only turned off an error report, and did nothing else. 
16411
16412 2002-10-02  Miguel de Icaza  <miguel@ximian.com>
16413
16414         * driver.cs: Handle and ignore /fullpaths
16415
16416 2002-10-01  Miguel de Icaza  <miguel@ximian.com>
16417
16418         * expression.cs (Binary.ResolveOperator): Catch the case where
16419         DoNumericPromotions returns true, 
16420
16421         (Binary.DoNumericPromotions): Simplify the code, and the tests.
16422
16423 2002-09-27  Miguel de Icaza  <miguel@ximian.com>
16424
16425         * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
16426         report error 70.
16427
16428 2002-09-26  Miguel de Icaza  <miguel@ximian.com>
16429
16430         * ecore.cs (ConvertNumericExplicit): It is not enough that the
16431         conversion exists, but it is also required that the conversion be
16432         performed.  This manifested in "(Type64Enum) 2".  
16433
16434         * class.cs (TypeManager.AddMethod): The fix is not to change
16435         AddEnum, because that one was using a fully qualified name (every
16436         DeclSpace derivative does), but to change the AddMethod routine
16437         that was using an un-namespaced name.  This now correctly reports
16438         the duplicated name.
16439
16440         Revert patch until I can properly fix it.  The issue
16441         is that we have a shared Type space across all namespaces
16442         currently, which is wrong.
16443
16444         Options include making the Namespace a DeclSpace, and merge
16445         current_namespace/current_container in the parser.
16446
16447 2002-09-25  Miguel de Icaza  <miguel@ximian.com>
16448
16449         * cs-parser.jay: Improve error reporting when we get a different
16450         kind of expression in local_variable_type and
16451         local_variable_pointer_type. 
16452
16453         Propagate this to avoid missleading errors being reported.
16454
16455         * ecore.cs (ImplicitReferenceConversion): treat
16456         TypeManager.value_type as a target just like object_type.   As
16457         code like this:
16458
16459         ValueType v = 1;
16460
16461         Is valid, and needs to result in the int 1 being boxed before it
16462         is assigned to the value type v.
16463
16464         * class.cs (TypeContainer.AddEnum): Use the basename, not the name
16465         to validate the enumeration name.
16466
16467         * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
16468         EmitDynamicInitializers for the criteria to use Ldelema.  Thanks
16469         to hwang_rob@yahoo.ca for finding the bug and providing a patch.
16470
16471         * ecore.cs (TryImplicitIntConversion): When doing an
16472         implicit-enumeration-conversion, check if the type is 64-bits and
16473         perform a conversion before passing to EnumConstant.
16474
16475 2002-09-23  Miguel de Icaza  <miguel@ximian.com>
16476
16477         * decl.cs (Error_AmbiguousTypeReference); New routine used to
16478         report ambiguous type references.  Unlike the MS version, we
16479         report what the ambiguity is.   Innovation at work ;-)
16480
16481         (DeclSpace.FindType): Require a location argument to
16482         display when we display an ambiguous error.
16483
16484         * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
16485
16486         * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
16487
16488         * expression.cs (EmitDynamicInitializers): Apply patch from
16489         hwang_rob@yahoo.ca that fixes the order in which we emit our
16490         initializers. 
16491
16492 2002-09-21  Martin Baulig  <martin@gnome.org>
16493
16494         * delegate.cs (Delegate.VerifyApplicability): Make this work if the
16495         delegate takes no arguments.
16496
16497 2002-09-20  Miguel de Icaza  <miguel@ximian.com>
16498
16499         * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
16500         from integers.
16501
16502         * expression.cs: Extract the underlying type.
16503
16504         * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
16505
16506         * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
16507
16508 2002-09-19  Miguel de Icaza  <miguel@ximian.com>
16509
16510         * class.cs (TypeContainer.DefineType): We can not use the nice
16511         PackingSize with the size set to 1 DefineType method, because it
16512         will not allow us to define the interfaces that the struct
16513         implements.
16514
16515         This completes the fixing of bug 27287
16516
16517         * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
16518         means also structs.  This fixes part of the problem. 
16519         (Expresion.ImplicitReferenceConversionExists): ditto.
16520
16521         * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
16522         error if there were no errors reported during the type lookup
16523         process, to avoid duplicates or redundant errors.  Without this
16524         you would get an ambiguous errors plus a type not found.  We have
16525         beaten the user enough with the first error.  
16526
16527         (DeclSparce.FindType): Emit a warning if we have an ambiguous
16528         reference. 
16529
16530         * ecore.cs (SimpleName.DoResolveType): If an error is emitted
16531         during the resolution process, stop the lookup, this avoids
16532         repeated error reports (same error twice).
16533
16534         * rootcontext.cs: Emit a warning if we have an ambiguous reference.
16535
16536         * typemanager.cs (LookupType): Redo the type lookup code to match
16537         the needs of System.Reflection.  
16538
16539         The issue is that System.Reflection requires references to nested
16540         types to begin with a "+" sign instead of a dot.  So toplevel
16541         types look like: "NameSpace.TopLevelClass", and nested ones look
16542         like "Namespace.TopLevelClass+Nested", with arbitrary nesting
16543         levels. 
16544
16545 2002-09-19  Martin Baulig  <martin@gnome.org>
16546
16547         * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
16548         says that a method always returns or always throws an exception,
16549         don't report the CS0161.
16550
16551         * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
16552         set `Returns = new_returns'.
16553
16554 2002-09-19  Martin Baulig  <martin@gnome.org>
16555
16556         * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
16557         to an enum constant, check for a CS0176.
16558
16559 2002-09-18  Miguel de Icaza  <miguel@ximian.com>
16560
16561         * class.cs (TypeContainer.CheckPairedOperators): Now we check
16562         for operators that must be in pairs and report errors.
16563
16564         * ecore.cs (SimpleName.DoResolveType): During the initial type
16565         resolution process, when we define types recursively, we must
16566         check first for types in our current scope before we perform
16567         lookups in the enclosing scopes.
16568
16569         * expression.cs (MakeByteBlob): Handle Decimal blobs.
16570
16571         (Invocation.VerifyArgumentsCompat): Call
16572         TypeManager.TypeToCoreType on the parameter_type.GetElementType.
16573         I thought we were supposed to always call this, but there are a
16574         few places in the code where we dont do it.
16575
16576 2002-09-17  Miguel de Icaza  <miguel@ximian.com>
16577
16578         * driver.cs: Add support in -linkres and -resource to specify the
16579         name of the identifier.
16580
16581 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
16582
16583         * ecore.cs (StandardConversionExists): Sync with the conversion
16584         code: allow anything-* to void* conversions.
16585
16586         (FindMostSpecificSource): Use an Expression argument
16587         instead of a Type, because we might be handed over a Literal which
16588         gets a few more implicit conversions that plain types do not.  So
16589         this information was being lost.
16590
16591         Also, we drop the temporary type-holder expression when not
16592         required.
16593
16594 2002-09-17  Martin Baulig  <martin@gnome.org>
16595
16596         * class.cs (PropertyBase.CheckBase): Don't check the base class if
16597         this is an explicit interface implementation.
16598
16599 2002-09-17  Martin Baulig  <martin@gnome.org>
16600
16601         * class.cs (PropertyBase.CheckBase): Make this work for indexers with
16602         different `IndexerName' attributes.
16603
16604         * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
16605         (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
16606         virtual CommonResolve().
16607
16608 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
16609
16610         * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
16611         and convert that to the UnderlyingType.
16612
16613         * statement.cs (Foreach.Resolve): Indexers are just like variables
16614         or PropertyAccesses.
16615
16616         * cs-tokenizer.cs (consume_string): Track line numbers and columns
16617         inside quoted strings, we were not doing this before.
16618
16619 2002-09-16  Martin Baulig  <martin@gnome.org>
16620
16621         * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
16622         resolve it.  This is needed for the definite assignment check of the
16623         instance expression, fixes bug #29846.
16624         (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
16625
16626 2002-09-16  Nick Drochak  <ndrochak@gol.com>
16627
16628         * parameter.cs: Fix compile error.  Cannot reference static member
16629         from an instance object.  Is this an mcs bug?
16630
16631 2002-09-14  Martin Baulig  <martin@gnome.org>
16632
16633         * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
16634         multiple times.  Fixes bug #30295, added test-166.cs.
16635
16636 2002-09-14  Martin Baulig  <martin@gnome.org>
16637
16638         * statement.cs (Block.Emit): Don't emit unreachable code.
16639         (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
16640         `break' statements.
16641         (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
16642
16643 2002-09-14  Martin Baulig  <martin@gnome.org>
16644
16645         * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
16646         is set.
16647
16648 2002-09-14  Martin Baulig  <martin@gnome.org>
16649
16650         * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
16651         if `type == parent' since in this case `type.IsSubclassOf (parent)' will
16652         be false on the ms runtime.
16653
16654 2002-09-13  Martin Baulig  <martin@gnome.org>
16655
16656         * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
16657         the CS0038 error message.
16658
16659 2002-09-12  Miguel de Icaza  <miguel@ximian.com>
16660
16661         * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
16662         constant inside, return it.
16663
16664 2002-09-12  Martin Baulig  <martin@gnome.org>
16665
16666         * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
16667         implicit conversion can be done between enum types.
16668
16669         * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
16670         check whether an implicit conversion to the current enum's UnderlyingType
16671         exists and report an error if not.
16672
16673         * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
16674         without debugging support.
16675
16676         * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
16677         Fixes bug #30235.  Thanks to Ricardo Fernández Pascual.
16678
16679 2002-09-12  Martin Baulig  <martin@gnome.org>
16680
16681         * typemanager.cs (TypeManager.IsNestedChildOf): New method.
16682
16683         * ecore.cs (IMemberExpr.DeclaringType): New property.
16684         (SimpleName.SimpleNameResolve): Check whether we're accessing a
16685         nonstatic member of an outer type (CS0038).
16686
16687 2002-09-11  Miguel de Icaza  <miguel@ximian.com>
16688
16689         * driver.cs: Activate the using-error detector at warning level
16690         4 (at least for MS-compatible APIs).
16691
16692         * namespace.cs (VerifyUsing): Small buglett fix.
16693
16694         * pending.cs (PendingImplementation): pass the container pointer. 
16695
16696         * interface.cs (GetMethods): Allow for recursive definition.  Long
16697         term, I would like to move every type to support recursive
16698         definitions, not the current ordering mechanism that we have right
16699         now.
16700
16701         The situation is this: Attributes are handled before interfaces,
16702         so we can apply attributes to interfaces.  But some attributes
16703         implement interfaces, we will now handle the simple cases
16704         (recursive definitions will just get an error).  
16705
16706         * parameter.cs: Only invalidate types at the end if we fail to
16707         lookup all types.  
16708
16709 2002-09-09  Martin Baulig  <martin@gnome.org>
16710
16711         * ecore.cs (PropertyExpr.Emit): Also check for
16712         TypeManager.system_int_array_get_length so this'll also work when
16713         compiling corlib.  Fixes #30003.
16714
16715 2002-09-09  Martin Baulig  <martin@gnome.org>
16716
16717         * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
16718         and throw an exception if we can't get the type's size.  Fixed #30040,
16719         added test-165.cs.
16720
16721 2002-09-09  Martin Baulig  <martin@gnome.org>
16722
16723         * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
16724
16725         * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
16726         context.  Fixes bug #30027.
16727
16728         * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
16729         virtual functions.  Fixes bug #30043, added test-164.cs.
16730
16731 2002-09-08  Ravi Pratap  <ravi@ximian.com>
16732
16733         * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
16734
16735 2002-09-08  Nick Drochak  <ndrochak@gol.com>
16736
16737         * driver.cs: Use an object to get the windows codepage since it's not a
16738         static property.
16739
16740 2002-09-08  Miguel de Icaza  <miguel@ximian.com>
16741
16742         * statement.cs (For.Emit): for infinite loops (test == null)
16743         return whether there is a break inside, not always "true".
16744
16745         * namespace.cs (UsingEntry): New struct to hold the name of the
16746         using definition, the location where it is defined, and whether it
16747         has been used in a successful type lookup.
16748
16749         * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
16750         strings.
16751
16752         * decl.cs: ditto.
16753
16754 2002-09-06  Ravi Pratap  <ravi@ximian.com>
16755
16756         * attribute.cs : Fix incorrect code which relied on catching
16757         a NullReferenceException to detect a null being passed in
16758         where an object was expected.
16759
16760 2002-09-06  Miguel de Icaza  <miguel@ximian.com>
16761
16762         * statement.cs (Try): flag the catch variable as assigned
16763
16764         * expression.cs (Cast): Simplified by using ResolveType instead of
16765         manually resolving.
16766
16767         * statement.cs (Catch): Fix bug by using ResolveType.
16768
16769 2002-09-06  Ravi Pratap  <ravi@ximian.com>
16770
16771         * expression.cs (BetterConversion): Special case for when we have
16772         a NullLiteral as the argument and we have to choose between string
16773         and object types - we choose string the way csc does.
16774
16775         * attribute.cs (Attribute.Resolve): Catch the
16776         NullReferenceException and report error #182 since the Mono
16777         runtime no more has the bug and having this exception raised means
16778         we tried to select a constructor which takes an object and is
16779         passed a null.
16780
16781 2002-09-05  Ravi Pratap  <ravi@ximian.com>
16782
16783         * expression.cs (Invocation.OverloadResolve): Flag a nicer error
16784         message (1502, 1503) when we can't locate a method after overload
16785         resolution. This is much more informative and closes the bug
16786         Miguel reported.
16787
16788         * interface.cs (PopulateMethod): Return if there are no argument
16789         types. Fixes a NullReferenceException bug.
16790
16791         * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
16792         expressions too. Previously we were checking only in one place for
16793         positional arguments leaving out named arguments.
16794
16795         * ecore.cs (ImplicitNumericConversion): Conversion from underlying
16796         type to the enum type is not allowed. Remove code corresponding to
16797         that.
16798
16799         (ConvertNumericExplicit): Allow explicit conversions from
16800         the underlying type to enum type. This precisely follows the spec
16801         and closes a bug filed by Gonzalo.
16802
16803 2002-09-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16804
16805         * compiler.csproj:
16806         * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
16807
16808 2002-09-03  Miguel de Icaza  <miguel@ximian.com>
16809
16810         * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
16811         it was important that we stored the right value after the
16812         reduction in `converted'.
16813
16814 2002-09-04  Martin Baulig  <martin@gnome.org>
16815
16816         * location.cs (Location.SymbolDocument): Use full pathnames for the
16817         source files.
16818
16819 2002-08-30  Miguel de Icaza  <miguel@ximian.com>
16820
16821         * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
16822         of the expression resolve mechanism, because that will catch the
16823         SimpleName error failures.
16824
16825         (Conditional): If we can not resolve the
16826         expression, return, do not crash.
16827
16828 2002-08-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16829
16830         * cs-tokenizer.cs:
16831         (location): display token name instead of its number.
16832
16833 2002-08-28  Martin Baulig  <martin@gnome.org>
16834
16835         * expression.cs (Binary.ResolveOperator): Don't silently return
16836         but return an error if an operator cannot be applied between two
16837         enum types.
16838
16839 2002-08-28  Martin Baulig  <martin@gnome.org>
16840
16841         * class.cs (Constructor.Define): Set the permission attributes
16842         correctly instead of making all constructors public.
16843
16844 2002-08-28  Martin Baulig  <martin@gnome.org>
16845
16846         * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
16847         for private members before reporting a CS0103; if we find anything,
16848         it's a CS0122.
16849
16850 2002-08-28  Martin Baulig  <martin@gnome.org>
16851
16852         * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
16853         to check whether `closure_start_type == closure_invocation_type',
16854         we also need to check whether `m.DeclaringType == closure_invocation_type'
16855         before bypassing the permission checks.  We might be accessing
16856         protected/private members from the base class.
16857         (TypeManager.RealMemberLookup): Only set private_ok if private
16858         members were requested via BindingFlags.NonPublic.
16859
16860         * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
16861
16862         * expression.cs (MemberAccess.ResolveMemberAccess): Set
16863         MethodGroupExpr.IsExplicitImpl if appropriate.
16864         (Invocation.DoResolve): Don't report the CS0120 for explicit
16865         interface implementations.
16866
16867 2002-08-27  Martin Baulig  <martin@gnome.org>
16868
16869         * expression.cs (Invocation.DoResolve): If this is a static
16870         method and we don't have an InstanceExpression, we must report
16871         a CS0120.
16872
16873 2002-08-25  Martin Baulig  <martin@gnome.org>
16874
16875         * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
16876         `==' between a valuetype and an object.
16877
16878 2002-08-25  Miguel de Icaza  <miguel@ximian.com>
16879
16880         * ecore.cs (TypeExpr): Provide a ToString method.
16881
16882 2002-08-24  Martin Baulig  <martin@gnome.org>
16883
16884         * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
16885         now called proggie.dbg and it's a binary file.
16886
16887 2002-08-23  Martin Baulig  <martin@gnome.org>
16888
16889         * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
16890
16891 2002-08-23  Martin Baulig  <martin@gnome.org>
16892
16893         * struct.cs (MyStructInfo.ctor): Make this work with empty
16894         structs; it's not allowed to use foreach() on null.
16895
16896 2002-08-23  Martin Baulig  <martin@gnome.org>
16897
16898         * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
16899         writer the full pathname of the generated assembly.
16900
16901 2002-08-23  Martin Baulig  <martin@gnome.org>
16902
16903         * statements.cs (FlowBranching.UsageVector.MergeChildren):
16904         A `finally' block never returns or breaks; improved handling of
16905         unreachable code.
16906
16907 2002-08-23  Martin Baulig  <martin@gnome.org>
16908
16909         * statement.cs (Throw.Resolve): Allow `throw null'.
16910
16911 2002-08-23  Martin Baulig  <martin@gnome.org>
16912
16913         * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
16914         EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
16915         `ee.EventInfo.DeclaringType == ec.ContainerType'.  The
16916         MemberLookup would return a wrong event if this is an explicit
16917         interface implementation and the class has an event with the same
16918         name.
16919
16920 2002-08-23  Martin Baulig  <martin@gnome.org>
16921
16922         * statement.cs (Block.AddChildVariableNames): New public method.
16923         (Block.AddChildVariableName): Likewise.
16924         (Block.IsVariableNameUsedInChildBlock): Likewise.
16925         (Block.AddVariable): Check whether a variable name has already
16926         been used in a child block.
16927
16928         * cs-parser.jay (declare_local_variables): Mark all variable names
16929         from the current block as being used in a child block in the
16930         implicit block.
16931
16932 2002-08-23  Martin Baulig  <martin@gnome.org>
16933
16934         * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
16935         find the symbol writer.
16936
16937         * driver.cs: csc also allows the arguments to /define being
16938         separated by commas, not only by semicolons.
16939
16940 2002-08-23  Martin Baulig  <martin@gnome.org>
16941
16942         * interface.cs (Interface.GetMembers): Added static check for events.
16943
16944 2002-08-15  Martin Baulig  <martin@gnome.org>
16945
16946         * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
16947         call, use ec.ContainerType.BaseType as queried_type and invocation_type.
16948
16949         * ecore.cs (Expression.MemberLookup): Added documentation and explained
16950         why the MethodData.EmitDestructor() change was necessary.
16951
16952 2002-08-20  Martin Baulig  <martin@gnome.org>
16953
16954         * class.cs (TypeContainer.FindMembers): Added static check for events.
16955
16956         * decl.cs (MemberCache.AddMembers): Handle events like normal members.
16957
16958         * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
16959         use Type.GetEvents(), not Type.FindMembers().
16960
16961 2002-08-20  Martin Baulig  <martin@gnome.org>
16962
16963         * decl.cs (MemberCache): Added a special method cache which will
16964         be used for method-only searched.  This ensures that a method
16965         search will return a MethodInfo with the correct ReflectedType for
16966         inherited methods.      
16967
16968 2002-08-20  Martin Baulig  <martin@gnome.org>
16969
16970         * decl.cs (DeclSpace.FindMembers): Made this public.
16971
16972 2002-08-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16973
16974         * delegate.cs: fixed build on windows.
16975         [FIXME:  Filed as bug #29150: MCS must report these errors.]
16976
16977 2002-08-19  Ravi Pratap  <ravi@ximian.com>
16978
16979         * ecore.cs (StandardConversionExists): Return a false
16980         if we are trying to convert the void type to anything else
16981         since that is not allowed.
16982
16983         * delegate.cs (DelegateInvocation.DoResolve): Ensure that
16984         we flag error 70 in the event an event is trying to be accessed
16985         directly from outside the declaring type.
16986
16987 2002-08-20  Martin Baulig  <martin@gnome.org>
16988
16989         * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
16990         MemberCache from typemanager.cs to decl.cs.
16991
16992 2002-08-19  Martin Baulig  <martin@gnome.org>
16993
16994         * class.cs (TypeContainer): Implement IMemberContainer.
16995         (TypeContainer.DefineMembers): Create the MemberCache.
16996         (TypeContainer.FindMembers): Do better BindingFlags checking; only
16997         return public members if BindingFlags.Public was given, check
16998         whether members are static.
16999
17000 2002-08-16  Martin Baulig  <martin@gnome.org>
17001
17002         * decl.cs (DeclSpace.Define): Splitted this in Define and
17003         DefineMembers.  DefineMembers is called first and initializes the
17004         MemberCache.
17005
17006         * rootcontext.cs (RootContext.DefineMembers): New function.  Calls
17007         DefineMembers() on all our DeclSpaces.
17008
17009         * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
17010         but call DefineMembers() on all nested interfaces.  We call their
17011         Define() in our new Define() function.
17012
17013         * interface.cs (Interface): Implement IMemberContainer.
17014         (Interface.Define): Moved all code except the attribute stuf to
17015         DefineMembers().
17016         (Interface.DefineMembers): Initialize the member cache.
17017
17018         * typemanager.cs (IMemberFinder): Removed this interface, we don't
17019         need this anymore since we can use MemberCache.FindMembers directly.
17020
17021 2002-08-19  Martin Baulig  <martin@gnome.org>
17022
17023         * typemanager.cs (MemberCache): When creating the cache for an
17024         interface type, add all inherited members.
17025         (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
17026         to `out bool used_cache' and documented it.
17027         (TypeManager.MemberLookup): If we already used the cache in the first
17028         iteration, we don't need to do the interfaces check.
17029
17030 2002-08-19  Martin Baulig  <martin@gnome.org>
17031
17032         * decl.cs (DeclSpace.FindMembers): New abstract method.  Moved this
17033         here from IMemberFinder and don't implement this interface anymore.
17034         (DeclSpace.MemberCache): Moved here from IMemberFinder.
17035
17036         * typemanager.cs (IMemberFinder): This interface is now only used by
17037         classes which actually support the member cache.
17038         (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
17039         since we only put DeclSpaces into this Hashtable.
17040         (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
17041         a dynamic type and TypeHandle.GetTypeHandle() otherwise.
17042
17043 2002-08-16  Martin Baulig  <martin@gnome.org>
17044
17045         * typemanager.cs (ICachingMemberFinder): Removed.
17046         (IMemberFinder.MemberCache): New property.
17047         (TypeManager.FindMembers): Merged this with RealFindMembers().
17048         This function will never be called from TypeManager.MemberLookup()
17049         so we can't use the cache here, just the IMemberFinder.
17050         (TypeManager.MemberLookup_FindMembers): Check whether the
17051         IMemberFinder has a MemberCache and call the cache's FindMembers
17052         function.
17053         (MemberCache): Rewrote larger parts of this yet another time and
17054         cleaned it up a bit.
17055
17056 2002-08-15  Miguel de Icaza  <miguel@ximian.com>
17057
17058         * driver.cs (LoadArgs): Support quoting.
17059
17060         (Usage): Show the CSC-like command line arguments.
17061
17062         Improved a few error messages.
17063
17064 2002-08-15  Martin Baulig  <martin@gnome.org>
17065
17066         * typemanager.cs (IMemberContainer.Type): New property.
17067         (IMemberContainer.IsInterface): New property.
17068
17069         The following changes are conditional to BROKEN_RUNTIME, which is
17070         defined at the top of the file.
17071
17072         * typemanager.cs (MemberCache.MemberCache): Don't add the base
17073         class'es members, but add all members from TypeHandle.ObjectType
17074         if we're an interface.
17075         (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
17076         is the current type.
17077         (MemberCache.CacheEntry.Container): Removed this field.
17078         (TypeHandle.GetMembers): Include inherited members.
17079
17080 2002-08-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17081
17082         * typemanager.cs: fixed compilation and added a comment on a field that
17083         is never used.
17084
17085 2002-08-15  Martin Baulig  <martin@gnome.org>
17086
17087         * class.cs (ConstructorInitializer.Resolve): In the
17088         Expression.MemberLookup call, use the queried_type as
17089         invocation_type.
17090
17091         * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
17092         declared' attribute, it's always true.
17093         (IMemberContainer.Parent, IMemberContainer.Name): New properties.
17094         (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
17095         temporary wrapper for FindMembers which tells MemberLookup whether
17096         members from the base classes are included in the return value.
17097         This will go away soon.
17098         (TypeManager.MemberLookup): Use this temporary hack here; once the
17099         new MemberCache is completed, we don't need to do the DeclaredOnly
17100         looping here anymore since the MemberCache will take care of this.
17101         (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
17102         (MemberCache): When creating the MemberCache for a class, get
17103         members from the current class and all its base classes.
17104         (MemberCache.CacheEntry.Container): New field.  This is a
17105         temporary hack until the Mono runtime is fixed to distinguish
17106         between ReflectedType and DeclaringType.  It allows us to use MCS
17107         with both the MS runtime and the unfixed Mono runtime without
17108         problems and without accecting performance.
17109         (MemberCache.SearchMembers): The DeclaredOnly looping from
17110         TypeManager.MemberLookup is now done here.      
17111
17112 2002-08-14  Martin Baulig  <martin@gnome.org>
17113
17114         * statement.cs (MyStructInfo.MyStructInfo): Don't call
17115         Type.GetFields on dynamic types but get the fields from the
17116         corresponding TypeContainer.
17117         (MyStructInfo.GetStructInfo): Added check for enum types.
17118
17119         * typemanager.cs (MemberList.IsSynchronized): Implemented.
17120         (MemberList.SyncRoot): Implemented.
17121         (TypeManager.FilterWithClosure): No need to check permissions if
17122         closure_start_type == closure_invocation_type, don't crash if
17123         closure_invocation_type is null.
17124
17125 2002-08-13  Martin Baulig  <martin@gnome.org>
17126
17127         Rewrote TypeContainer.FindMembers to use a member cache.  This
17128         gives us a speed increase of about 35% for the self-hosting MCS
17129         build and of about 15-20% for the class libs (both on GNU/Linux).
17130
17131         * report.cs (Timer): New class to get enhanced profiling.  This
17132         whole class is "TIMER" conditional since it remarkably slows down
17133         compilation speed.
17134
17135         * class.cs (MemberList): New class.  This is an IList wrapper
17136         which we're now using instead of passing MemberInfo[]'s around to
17137         avoid copying this array unnecessarily.
17138         (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
17139         (ICachingMemberFinder, IMemberContainer): New interface.
17140         (TypeManager.FilterWithClosure): If `criteria' is null, the name
17141         has already been checked, otherwise use it for the name comparision.
17142         (TypeManager.FindMembers): Renamed to RealMemberFinder and
17143         provided wrapper which tries to use ICachingMemberFinder.FindMembers
17144         if possible.  Returns a MemberList, not a MemberInfo [].
17145         (TypeHandle): New class, implements IMemberContainer.  We create
17146         one instance of this class per type, it contains a MemberCache
17147         which is used to do the member lookups.
17148         (MemberCache): New class.  Each instance of this class contains
17149         all members of a type and a name-based hash table.
17150         (MemberCache.FindMembers): This is our new member lookup
17151         function.  First, it looks up all members of the requested name in
17152         the hash table.  Then, it walks this list and sorts out all
17153         applicable members and returns them.
17154
17155 2002-08-13  Martin Baulig  <martin@gnome.org>
17156
17157         In addition to a nice code cleanup, this gives us a performance
17158         increase of about 1.4% on GNU/Linux - not much, but it's already
17159         half a second for the self-hosting MCS compilation.
17160
17161         * typemanager.cs (IMemberFinder): New interface.  It is used by
17162         TypeManager.FindMembers to call FindMembers on a TypeContainer,
17163         Enum, Delegate or Interface.
17164         (TypeManager.finder_to_member_finder): New PtrHashtable.
17165         (TypeManager.finder_to_container): Removed.
17166         (TypeManager.finder_to_delegate): Removed.
17167         (TypeManager.finder_to_interface): Removed.
17168         (TypeManager.finder_to_enum): Removed.
17169
17170         * interface.cs (Interface): Implement IMemberFinder.
17171
17172         * delegate.cs (Delegate): Implement IMemberFinder.
17173
17174         * enum.cs (Enum): Implement IMemberFinder.
17175
17176         * class.cs (TypeContainer): Implement IMemberFinder.
17177
17178 2002-08-12  Martin Baulig  <martin@gnome.org>
17179
17180         * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
17181
17182 2002-08-12  Martin Baulig  <martin@gnome.org>
17183
17184         * ecore.cs (ITypeExpression): New interface for expressions which
17185         resolve to a type.
17186         (TypeExpression): Renamed to TypeLookupExpression.
17187         (Expression.DoResolve): If we're doing a types-only lookup, the
17188         expression must implement the ITypeExpression interface and we
17189         call DoResolveType() on it.
17190         (SimpleName): Implement the new ITypeExpression interface.
17191         (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
17192         hack, the situation that we're only looking up types can't happen
17193         anymore when this method is called.  Moved the type lookup code to
17194         DoResolveType() and call it.
17195         (SimpleName.DoResolveType): This ITypeExpression interface method
17196         is now doing the types-only lookup.
17197         (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
17198         (ResolveFlags): Added MaskExprClass.
17199
17200         * expression.cs (MemberAccess): Implement the ITypeExpression
17201         interface.
17202         (MemberAccess.DoResolve): Added support for a types-only lookup
17203         when we're called via ITypeExpression.DoResolveType().
17204         (ComposedCast): Implement the ITypeExpression interface.
17205
17206         * codegen.cs (EmitContext.OnlyLookupTypes): Removed.  Call
17207         Expression.Resolve() with ResolveFlags.Type instead.
17208
17209 2002-08-12  Martin Baulig  <martin@gnome.org>
17210
17211         * interface.cs (Interface.Define): Apply attributes.
17212
17213         * attribute.cs (Attribute.ApplyAttributes): Added support for
17214         interface attributes.
17215
17216 2002-08-11  Martin Baulig  <martin@gnome.org>
17217
17218         * statement.cs (Block.Emit): Only check the "this" variable if we
17219         do not always throw an exception.
17220
17221         * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
17222         whether the property has a set accessor.
17223
17224 2002-08-11  Martin Baulig  <martin@gnome.org>
17225
17226         Added control flow analysis support for structs.
17227
17228         * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
17229         with control flow analysis turned off.
17230         (IVariable): New interface.
17231         (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
17232         returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
17233         (FieldExpr.DoResolve): Resolve the instance expression with flow
17234         analysis turned off and do the definite assignment check after the
17235         resolving when we know what the expression will resolve to.
17236
17237         * expression.cs (LocalVariableReference, ParameterReference):
17238         Implement the new IVariable interface, only call the flow analysis
17239         code if ec.DoFlowAnalysis is true.
17240         (This): Added constructor which takes a Block argument.  Implement
17241         the new IVariable interface.
17242         (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
17243         DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
17244         This does the definite assignment checks for struct members.
17245
17246         * class.cs (Constructor.Emit): If this is a non-static `struct'
17247         constructor which doesn't have any initializer, call
17248         Block.AddThisVariable() to tell the flow analysis code that all
17249         struct elements must be initialized before control returns from
17250         the constructor.
17251
17252         * statement.cs (MyStructInfo): New public class.
17253         (UsageVector.this [VariableInfo vi]): Added `int field_idx'
17254         argument to this indexer.  If non-zero, check an individual struct
17255         member, not the whole struct.
17256         (FlowBranching.CheckOutParameters): Check struct members.
17257         (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
17258         overloaded versions of these methods which take an additional
17259         `int field_idx' argument to check struct members.
17260         (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
17261         overloaded versions of these methods which take an additional
17262         `string field_name' argument to check struct member.s
17263         (VariableInfo): Implement the IVariable interface.
17264         (VariableInfo.StructInfo): New public property.  Returns the
17265         MyStructInfo instance of the variable if it's a struct or null.
17266         (Block.AddThisVariable): New public method.  This is called from
17267         Constructor.Emit() for non-static `struct' constructor which do
17268         not have any initializer.  It creates a special variable for the
17269         "this" instance variable which will be checked by the flow
17270         analysis code to ensure that all of the struct's fields are
17271         initialized before control returns from the constructor.
17272         (UsageVector): Added support for struct members.  If a
17273         variable/parameter is a struct with N members, we reserve a slot
17274         in the usage vector for each member.  A struct is considered fully
17275         initialized if either the struct itself (slot 0) or all its
17276         members are initialized.
17277
17278 2002-08-08  Martin Baulig  <martin@gnome.org>
17279
17280         * driver.cs (Driver.MainDriver): Only report an error CS5001
17281         if there were no compilation errors.
17282
17283         * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
17284         `UnsafeContext' property to determine whether the parent is in
17285         unsafe context rather than checking the parent's ModFlags:
17286         classes nested in an unsafe class are unsafe as well.
17287
17288 2002-08-08  Martin Baulig  <martin@gnome.org>
17289
17290         * statement.cs (UsageVector.MergeChildren): Distinguish between
17291         `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
17292         we return.  Added test17() and test18() to test-154.cs.
17293
17294 2002-08-08  Martin Baulig  <martin@gnome.org>
17295
17296         * typemanager.cs (TypeManager.FilterWithClosure): If we have
17297         Family access, make sure the invoking type isn't a subclass of the
17298         queried type (that'd be a CS1540).
17299
17300         * ecore.cs (Expression.MemberLookup): Added overloaded version of
17301         this method which takes an additional `Type invocation_type'.
17302
17303         * expression.cs (BaseAccess.DoResolve): Use the base type as
17304         invocation and query type.
17305         (MemberAccess.DoResolve): If the lookup failed and we're about to
17306         report a CS0122, try a lookup with the ec.ContainerType - if this
17307         succeeds, we must report a CS1540.
17308
17309 2002-08-08  Martin Baulig  <martin@gnome.org>
17310
17311         * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
17312         (MethodGroupExpr): Implement the IMemberExpr interface.
17313
17314         * expression (MemberAccess.ResolveMemberAccess): No need to have
17315         any special code for MethodGroupExprs anymore, they're now
17316         IMemberExprs.   
17317
17318 2002-08-08  Martin Baulig  <martin@gnome.org>
17319
17320         * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
17321         Family, FamANDAssem and FamORAssem permissions.
17322         (TypeManager.IsSubclassOrNestedChildOf): New public method.
17323
17324 2002-08-08  Martin Baulig  <martin@gnome.org>
17325
17326         * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
17327         (UsageVector.MergeChildren): `break' breaks unless we're in a switch
17328         or loop block.
17329
17330 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
17331
17332         * driver.cs: implemented /resource option to embed managed resources.
17333
17334 2002-08-07  Martin Baulig  <martin@gnome.org>
17335
17336         * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
17337         (FieldBase.HasFieldInitializer): New public property.
17338         (FieldBase.GetInitializerExpression): New public method.  Resolves and
17339         returns the field initializer and makes sure it is only resolved once.
17340         (TypeContainer.EmitFieldInitializers): Call
17341         FieldBase.GetInitializerExpression to get the initializer, this ensures
17342         that it isn't resolved multiple times.
17343
17344         * codegen.cs (EmitContext): Added `bool IsFieldInitialier'.  This tells
17345         the resolving process (SimpleName/MemberLookup) that we're currently
17346         emitting a field initializer (which must not access any instance members,
17347         this is an error CS0236).
17348
17349         * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
17350         argument, if the `IsFieldInitializer' flag is set, we must report and
17351         error CS0236 and not an error CS0120.   
17352
17353 2002-08-07  Martin Baulig  <martin@gnome.org>
17354
17355         * ecore.cs (IMemberExpr): New public interface.
17356         (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
17357         (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
17358         if the expression is an IMemberExpr.
17359
17360         * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
17361         to be null, implicitly default to `this' if we're non-static in
17362         this case.  Simplified the code a lot by using the new IMemberExpr
17363         interface.  Also fixed bug #28176 here.
17364
17365 2002-08-06  Martin Baulig  <martin@gnome.org>
17366
17367         * cs-parser.jay (SimpleLookup): Removed.  We need to create
17368         ParameterReferences during semantic analysis so that we can do a
17369         type-only search when resolving Cast, TypeOf and SizeOf.
17370         (block): Pass the `current_local_parameters' to the Block's
17371         constructor.
17372
17373         * class.cs (ConstructorInitializer): Added `Parameters parameters'
17374         argument to the constructor.
17375         (ConstructorInitializer.Resolve): Create a temporary implicit
17376         block with the parameters.
17377
17378         * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
17379         references here if we aren't doing a type-only search.
17380
17381         * statement.cs (Block): Added constructor which takes a
17382         `Parameters parameters' argument.
17383         (Block.Parameters): New public property.
17384
17385         * support.cs (InternalParameters.Parameters): Renamed `parameters'
17386         to `Parameters' and made it public readonly.
17387
17388 2002-08-06  Martin Baulig  <martin@gnome.org>
17389
17390         * ecore.cs (Expression.Warning): Made this public as well.
17391
17392         * report.cs (Report.Debug): Print the contents of collections.
17393
17394 2002-08-06  Martin Baulig  <martin@gnome.org>
17395
17396         * ecore.cs (Expression.ResolveFlags): New [Flags] enum.  This is
17397         used to tell Resolve() which kinds of expressions it may return.
17398         (Expression.Resolve): Added overloaded version of this method which
17399         takes a `ResolveFlags flags' argument.  This can be used to tell
17400         Resolve() which kinds of expressions it may return.  Reports a
17401         CS0118 on error.
17402         (Expression.ResolveWithSimpleName): Removed, use Resolve() with
17403         ResolveFlags.SimpleName.
17404         (Expression.Error118): Added overloaded version of this method which
17405         takes a `ResolveFlags flags' argument.  It uses the flags to determine
17406         which kinds of expressions are allowed.
17407
17408         * expression.cs (Argument.ResolveMethodGroup): New public method.
17409         Resolves an argument, but allows a MethodGroup to be returned.
17410         This is used when invoking a delegate.
17411
17412         * TODO: Updated a bit.
17413
17414 2002-08-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17415
17416         Fixed compilation with csc.
17417
17418         * ecore.cs: Expression.Error made public. Is this correct? Should
17419         Warning be made public too?
17420
17421         * expression.cs: use ea.Location instead of ea.loc.
17422         [FIXME:  Filed as bug #28607: MCS must report these errors.]
17423
17424 2002-08-06  Martin Baulig  <martin@gnome.org>
17425
17426         * ecore.cs (Expression.loc): Moved the location here instead of
17427         duplicating it in all derived classes.
17428         (Expression.Location): New public property.
17429         (Expression.Error, Expression.Warning): Made them non-static and
17430         removed the location argument.
17431         (Expression.Warning): Added overloaded version which takes an
17432         `int level' argument.
17433         (Expression.Error118): Make this non-static and removed the
17434         expression and location arguments.
17435         (TypeExpr): Added location argument to the constructor.
17436
17437         * expression.cs (StaticCallExpr): Added location argument to
17438         the constructor.
17439         (Indirection, PointerArithmetic): Likewise.
17440         (CheckedExpr, UnCheckedExpr): Likewise.
17441         (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
17442         (StringPtr): Likewise.
17443
17444
17445 2002-08-05  Martin Baulig  <martin@gnome.org>
17446
17447         * expression.cs (BaseAccess.DoResolve): Actually report errors.
17448
17449         * assign.cs (Assign.DoResolve): Check whether the source
17450         expression is a value or variable.
17451
17452         * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
17453         while resolving the corresponding blocks.
17454
17455         * interface.cs (Interface.GetInterfaceTypeByName): Actually report
17456         an error, don't silently return null.
17457
17458         * statement.cs (Block.AddVariable): Do the error reporting here
17459         and distinguish between CS0128 and CS0136.
17460         (Block.DoResolve): Report all unused labels (warning CS0164).
17461         (LabeledStatement): Pass the location to the constructor.
17462         (LabeledStatement.HasBeenReferenced): New property.
17463         (LabeledStatement.Resolve): Set it to true here.
17464
17465         * statement.cs (Return.Emit): Return success even after reporting
17466         a type mismatch error (CS0126 or CS0127), this is what csc does and
17467         it avoids confusing the users with any consecutive errors.
17468
17469 2002-08-05  Martin Baulig  <martin@gnome.org>
17470
17471         * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
17472
17473         * const.cs (Const.LookupConstantValue): Catch circular definitions.
17474
17475         * expression.cs (MemberAccess.DoResolve): Silently return if an
17476         error has already been reported.
17477
17478         * ecore.cs (Expression.MemberLookupFinal): Silently return if an
17479         error has already been reported.
17480
17481 2002-08-05  Martin Baulig  <martin@gnome.org>
17482
17483         * statement.cs (UsageVector): Only initialize the `parameters'
17484         vector if we actually have any "out" parameters.
17485
17486 2002-08-05  Martin Baulig  <martin@gnome.org>
17487
17488         * expression.cs (Binary.ResolveOperator): When combining delegates,
17489         they must have the same type.
17490
17491 2002-08-05  Martin Baulig  <martin@gnome.org>
17492
17493         * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
17494         PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
17495         work with the ms runtime and we also don't need it: if we're a
17496         PropertyBuilder and not in the `indexer_arguments' hash, then we
17497         are a property and not an indexer.
17498
17499         * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
17500         Type.IsPointer and Type.IsByRef instead of Type.HasElementType
17501         since the latter one doesn't work with the ms runtime.
17502
17503 2002-08-03  Martin Baulig  <martin@gnome.org>
17504
17505         Fixed bugs #27998 and #22735.
17506
17507         * class.cs (Method.IsOperator): New public field.
17508         (Method.CheckBase): Report CS0111 if there's already a method
17509         with the same parameters in the current class.  Report CS0508 when
17510         attempting to change the return type of an inherited method.
17511         (MethodData.Emit): Report CS0179 if a method doesn't have a body
17512         and it's not marked abstract or extern.
17513         (PropertyBase): New abstract base class for Property and Indexer.
17514         (PropertyBase.CheckBase): Moved here from Property and made it work
17515         for indexers.
17516         (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
17517         the same so we can reuse it there.
17518         (Property, Indexer): Derive from PropertyBase.
17519         (MethodSignature.inheritable_property_signature_filter): New delegate
17520         to find properties and indexers.
17521
17522         * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
17523         argument and improved error reporting.
17524
17525         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
17526         EmptyReadOnlyParameters and made it a property.
17527
17528         * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
17529         version of this method which takes a `PropertyInfo indexer'.
17530         (TypeManager.RegisterIndexer): New method.
17531
17532         * class.cs: Added myself as author of this file :-)
17533
17534 2002-08-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17535
17536         * class.cs: fixed compilation on windoze.
17537
17538 2002-08-03  Martin Baulig  <martin@gnome.org>
17539
17540         * interface.cs (Interface.GetInterfaceBases): Check whether all
17541         base interfaces are at least as accessible than the current one.
17542
17543         * class.cs (TypeContainer.GetClassBases): Check whether base types
17544         are at least as accessible than the current type.
17545         (TypeContainer.AsAccessible): Implemented and made non-static.
17546         (MemberBase.CheckParameters): Report errors if the accessibility
17547         checks fail.
17548
17549         * delegate.cs (Delegate.Delegate): The default visibility is
17550         internal for top-level types and private for nested types.
17551         (Delegate.Define): Report errors if the accessibility checks fail.
17552
17553         * enum.cs (Enum.Enum): The default visibility is internal for
17554         top-level types and private for nested types.
17555         (Enum.DefineType): Compute the correct visibility.
17556
17557         * modifiers.cs (Modifiers.TypeAttr): Added a version of this
17558         function which takes a `bool is_toplevel' instead of a TypeContainer.
17559
17560         * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
17561         builtin type.
17562
17563 2002-08-02  Martin Baulig  <martin@gnome.org>
17564
17565         * expression.cs (LocalVariableReferenc): Added constructor which
17566         takes additional `VariableInfo vi' and `bool is_readonly' arguments.
17567         (LocalVariableReference.IsReadOnly): New property.
17568         (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
17569         variable is readonly, use our own readonly flag to do this; you can
17570         use the new constructor to get a writable reference to a read-only
17571         variable.
17572
17573         * cs-parser.jay (foreach_statement, using_statement): Get a writable
17574         reference to the local variable.
17575
17576 2002-08-01  Miguel de Icaza  <miguel@ximian.com>
17577
17578         * rootcontext.cs (ResolveCore): Also include System.Exception
17579
17580         * statement.cs (Block.Emit): Do not emit the dead-code warnings if
17581         we reach an EmptyStatement.
17582
17583         (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
17584         is also fine.
17585
17586         * expression.cs (Binary.ResolveOperator): Check error result in
17587         two places.
17588
17589         use brtrue/brfalse directly and avoid compares to null.
17590
17591 2002-08-02  Martin Baulig  <martin@gnome.org>
17592
17593         * class.cs (TypeContainer.Define): Define all nested interfaces here.
17594         Fixes bug #28407, added test-155.cs.
17595
17596 2002-08-01  Martin Baulig  <martin@gnome.org>
17597
17598         * class.cs (Event.EmitDefaultMethod): Make this work with static
17599         events.  Fixes #28311, added verify-3.cs.
17600
17601 2002-08-01  Martin Baulig  <martin@gnome.org>
17602
17603         * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
17604         `is_disposable' fields.
17605         (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
17606         `hm.is_disposable' if we're using the collection pattern.
17607         (Foreach.EmitCollectionForeach): Use the correct type for the
17608         enumerator's local variable, only emit the try/finally block if
17609         necessary (fixes #27713).
17610
17611 2002-08-01  Martin Baulig  <martin@gnome.org>
17612
17613         * ecore.cs (Expression.report118): Renamed to Error118 and made
17614         it public static.
17615
17616         * statement.cs (Throw.Resolve): Check whether the expression is of
17617         the correct type (CS0118) and whether the type derives from
17618         System.Exception (CS0155).
17619         (Catch.Resolve): New method.  Do the type lookup here and check
17620         whether it derives from System.Exception (CS0155).
17621         (Catch.CatchType, Catch.IsGeneral): New public properties.
17622
17623         * typemanager.cs (TypeManager.exception_type): Added.
17624
17625 2002-07-31  Miguel de Icaza  <miguel@ximian.com>
17626
17627         * driver.cs: Updated About function.
17628
17629 2002-07-31  Martin Baulig  <martin@gnome.org>
17630
17631         Implemented Control Flow Analysis.
17632
17633         * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
17634         (EmitContext.CurrentBranching): Added.
17635         (EmitContext.StartFlowBranching): Added.
17636         (EmitContext.EndFlowBranching): Added.
17637         (EmitContext.KillFlowBranching): Added.
17638         (EmitContext.IsVariableAssigned): Added.
17639         (EmitContext.SetVariableAssigned): Added.
17640         (EmitContext.IsParameterAssigned): Added.
17641         (EmitContext.SetParameterAssigned): Added.
17642         (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
17643         Added control flow analysis stuff here.
17644
17645         * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
17646         resolve the expression as lvalue.
17647         (LocalVariableReference.DoResolve): Check whether the variable has
17648         already been assigned.
17649         (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
17650         the parameter as assigned here.
17651         (ParameterReference.DoResolve): Check whether the parameter has already
17652         been assigned.
17653         (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
17654         expression as lvalue.
17655
17656         * statement.cs (FlowBranching): New class for the flow analysis code.
17657         (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
17658         (LabeledStatement.IsDefined): New public property.
17659         (LabeledStatement.AddUsageVector): New public method to tell flow
17660         analyis that the label may be reached via a forward jump.
17661         (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
17662         flow analysis.
17663         (VariableInfo.Number): New public field.  This is used by flow analysis
17664         to number all locals of a block.
17665         (Block.CountVariables): New public property.  This is the number of
17666         local variables in this block (including the locals from all parent
17667         blocks).
17668         (Block.EmitMeta): Number all the variables.
17669
17670         * statement.cs: Added flow analysis support to all classes.
17671
17672 2002-07-31  Martin Baulig  <martin@gnome.org>
17673
17674         * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
17675         To get debugging messages, compile mcs with /define:MCS_DEBUG and
17676         then use this argument.
17677
17678         * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
17679
17680         * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
17681         use this to specify /define options.
17682
17683 2002-07-29  Martin Baulig  <martin@gnome.org>
17684
17685         * statement.cs (Fixed): Moved all code that does variable lookups
17686         and resolvings from Emit to Resolve.
17687
17688         * statement.cs (For): Moved all code that does variable lookups
17689         and resolvings from Emit to Resolve.
17690
17691         * statement.cs (Using): Moved all code that does variable lookups
17692         and resolvings from Emit to Resolve.
17693
17694 2002-07-29  Martin Baulig  <martin@gnome.org>
17695
17696         * attribute.cs (Attribute.Resolve): Explicitly catch a
17697         System.NullReferenceException when creating the
17698         CustromAttributeBuilder and report a different warning message.
17699
17700 2002-07-29  Martin Baulig  <martin@gnome.org>
17701
17702         * support.cs (ParameterData.ParameterName): Added method to
17703         get the name of a parameter.
17704
17705         * typemanager.cs (TypeManager.IsValueType): New public method.
17706
17707 2002-07-29  Martin Baulig  <martin@gnome.org>
17708
17709         * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'.  This
17710         is a flag which specifies that it's either ref or out.
17711         (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
17712         the out parameter to `out Parameter.Modifier mod', also set the
17713         Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
17714
17715         * support.cs (InternalParameters.ParameterModifier): Distinguish
17716         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
17717         Parameter.Modifier.ISBYREF flag if it's either ref or out.
17718
17719         * expression.cs (Argument.GetParameterModifier): Distinguish
17720         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
17721         Parameter.Modifier.ISBYREF flag if it's either ref or out.
17722
17723 2002-07-29  Martin Baulig  <martin@gnome.org>
17724
17725         * expression.cs (ParameterReference.ParameterReference): Added
17726         `Location loc' argument to the constructor.
17727
17728         * cs-parser.jay: Pass location to ParameterReference.
17729
17730 2002-07-28  Miguel de Icaza  <miguel@ximian.com>
17731
17732         * statement.cs (Try): Initialize the location.
17733
17734         * cs-parser.jay: pass location to Try.
17735
17736         * expression.cs (Unary.Reduce): Change the prototype to return
17737         whether a constant fold could be performed or not.  The result is
17738         returned in an out parameters.  In the case of Indirection and
17739         AddressOf, we want to perform the full tests.
17740
17741 2002-07-26  Miguel de Icaza  <miguel@ximian.com>
17742
17743         * statement.cs (Statement.Emit): Flag dead code.
17744
17745 2002-07-27  Andrew Birkett  <andy@nobugs.org>
17746
17747         * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
17748
17749 2002-07-27  Martin Baulig  <martin@gnome.org>
17750
17751         * class.cs (MethodData.Define): Put back call to
17752         TypeManager.AddMethod(), accidentally commented this out.
17753
17754         * report.cs (Debug): New public method to print debugging information,
17755         this is `[Conditional ("DEBUG")]'.
17756
17757 2002-07-26  Martin Baulig  <martin@gnome.org>
17758
17759         * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
17760         (switch_statement): Push the current_block to the switch_stack and
17761         pop it again when we're done with the switch.
17762         (switch_section): The new block is a child of the current_block.
17763         Fixes bug #24007, added test-152.cs.
17764
17765 2002-07-27  Martin Baulig  <martin@gnome.org>
17766
17767         * expression.cs (Invocation.EmitArguments): When calling a varargs
17768         function with only its fixed arguments, we need to pass an empty
17769         array.
17770
17771 2002-07-27  Martin Baulig  <martin@gnome.org>
17772
17773         Mono 0.13 has been released.
17774
17775 2002-07-25  Miguel de Icaza  <miguel@ximian.com>
17776
17777         * driver.cs: Rename --resource to --linkres, because that is what
17778         we do currently, we dont support --resource yet.
17779
17780         * cs-tokenizer.cs: Fix test for reporting endif mismatches.
17781
17782 2002-07-25  Martin Baulig  <martin@gnome.org>
17783
17784         * class.cs (MethodData): New public class.  This is a `method builder'
17785         class for a method or one accessor of a Property/Indexer/Event.
17786         (MethodData.GetMethodFlags): Moved here from MemberBase.
17787         (MethodData.ApplyAttributes): Likewise.
17788         (MethodData.ApplyObsoleteAttribute): Likewise.
17789         (MethodData.ApplyConditionalAttribute): Likewise.
17790         (MethodData.ApplyDllImportAttribute): Likewise.
17791         (MethodData.CheckAbstractAndExternal): Likewise.
17792         (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
17793         (MethodData.Emit): Formerly known as Method.Emit().
17794         (MemberBase): Moved everything which was specific to a single
17795         accessor/method to MethodData.
17796         (Method): Create a new MethodData and call Define() and Emit() on it.
17797         (Property, Indexer, Event): Create a new MethodData objects for each
17798         accessor and call Define() and Emit() on them.
17799
17800 2002-07-25  Martin Baulig  <martin@gnome.org>
17801
17802         Made MethodCore derive from MemberBase to reuse the code from there.
17803         MemberBase now also checks for attributes.
17804
17805         * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
17806         (MemberBase.GetMethodFlags): Moved here from class Method and marked
17807         as virtual.
17808         (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
17809         `CallingConventions cc' and `Attributes opt_attrs' arguments.
17810         (MemberBase.ApplyAttributes): New virtual method; applies the
17811         attributes to a method or accessor.
17812         (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
17813         (MemberBase.ApplyConditionalAttribute): Likewise.
17814         (MemberBase.ApplyDllImportAttribute): Likewise.
17815         (MemberBase.CheckAbstractAndExternal): Likewise.
17816         (MethodCore.ParameterTypes): This is now a property instead of a
17817         method, it's initialized from DoDefineParameters().
17818         (MethodCore.ParameterInfo): Removed the set accessor.
17819         (MethodCore.DoDefineParameters): New protected virtual method to
17820         initialize ParameterTypes and ParameterInfo.
17821         (Method.GetReturnType): We can now simply return the MemberType.
17822         (Method.GetMethodFlags): Override the MemberBase version and add
17823         the conditional flags.
17824         (Method.CheckBase): Moved some code from Define() here, call
17825         DoDefineParameters() here.
17826         (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
17827         here to avoid some larger code duplication.
17828         (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
17829         ensure that abstract and external accessors don't declare a body.
17830
17831         * attribute.cs (Attribute.GetValidPieces): Make this actually work:
17832         `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
17833         lookup in the attribute's parent classes, so we need to abort as soon
17834         as we found the first match.
17835         (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
17836         the attribute has no arguments.
17837
17838         * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
17839         of a Method.
17840
17841 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17842
17843         * cs-parser.jay: reverted previous patch.
17844
17845 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17846
17847         * cs-parser.jay: fixed bug #22119.
17848
17849 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17850
17851         * attribute.cs: fixed compilation. The error was:
17852         "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must 
17853         be assigned to before control leaves the current method."
17854         [FIXME:  Filed as bug #28186: MCS must report this error.]
17855
17856 2002-07-25  Martin Baulig  <martin@gnome.org>
17857
17858         * attribute.cs (Attribute.Conditional_GetConditionName): New static
17859         method to pull the condition name ouf of a Conditional attribute.
17860         (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
17861         the obsolete message and error flag out of an Obsolete attribute.
17862
17863         * class.cs (Method.GetMethodFlags): New public method to get the
17864         TypeManager.MethodFlags for this method.
17865         (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
17866         private methods.
17867         (Method.Define): Get and apply the Obsolete and Conditional attributes;
17868         if we're overriding a virtual function, set the new private variable
17869         `parent_method'; call the new TypeManager.AddMethod().
17870
17871         * typemanager.cs (TypeManager.AddMethod): New static method.  Stores
17872         the MethodBuilder and the Method in a PtrHashtable.
17873         (TypeManager.builder_to_method): Added for this purpose.
17874         (TypeManager.MethodFlags): Added IsObsoleteError.
17875         (TypeManager.GetMethodFlags): Added `Location loc' argument.  Lookup
17876         Obsolete and Conditional arguments in MethodBuilders.  If we discover
17877         an Obsolete attribute, emit an appropriate warning 618 / error 619 with
17878         the message from the attribute.
17879
17880 2002-07-24  Martin Baulig  <martin@gnome.org>
17881
17882         * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
17883         preprocessor directives, ensure that the argument to #define/#undef is
17884         exactly one identifier and that it's actually an identifier.
17885
17886         Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
17887         did not work ....
17888
17889 2002-07-24  Martin Baulig  <martin@gnome.org>
17890
17891         * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
17892         initialize it to TypeManager.object_type in the constructor.
17893         (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
17894         of the `hm.get_current' method if we're using the collection pattern.
17895         (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
17896         for the explicit conversion to make it work when we're using the collection
17897         pattern and the `Current' property has a different return type than `object'.
17898         Fixes #27713.
17899
17900 2002-07-24  Martin Baulig  <martin@gnome.org>
17901
17902         * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
17903         does not match, but don't report any errors.  This method is called in
17904         order for all methods in a MethodGroupExpr until a matching method is
17905         found, so we don't want to bail out if the first method doesn't match.
17906         (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
17907         matches, report the 123.  Fixes #28070.
17908
17909 2002-07-24  Martin Baulig  <martin@gnome.org>
17910
17911         * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
17912         TypeManager.TypeToCoreType() to the top of the method so the
17913         following equality checks will work.  Fixes #28107.
17914
17915 2002-07-24  Martin Baulig  <martin@gnome.org>
17916
17917         * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
17918         operand is of type uint, and the other operand is of type sbyte,
17919         short or int, the operands are converted to type long." -
17920         Actually do what this comment already told us.  Fixes bug #28106,
17921         added test-150.cs.
17922
17923 2002-07-24  Martin Baulig  <martin@gnome.org>
17924
17925         * class.cs (MethodBase): New abstract class.  This is now a base
17926         class for Property, Indexer and Event to avoid some code duplication
17927         in their Define() and DefineMethods() methods.
17928         (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
17929         generic methods for Define() and DefineMethods().
17930         (FieldBase): Derive from MemberBase, not MemberCore.
17931         (Property): Derive from MemberBase, not MemberCore.
17932         (Property.DefineMethod): Moved all the code from this method to the
17933         new MethodBase.DefineAccessor(), just call it with appropriate
17934         argumetnts.
17935         (Property.Define): Call the new Property.DoDefine(), this does some
17936         sanity checks and we don't need to duplicate the code everywhere.
17937         (Event): Derive from MemberBase, not MemberCore.
17938         (Event.Define): Use the new MethodBase.DefineAccessor() to define the
17939         accessors, this will also make them work with interface events.
17940         (Indexer): Derive from MemberBase, not MemberCore.
17941         (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
17942         (Indexer.Define): Use the new MethodBase functions.
17943
17944         * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
17945         argument to the constructor.
17946         (Interface.FindMembers): Added support for interface events.
17947         (Interface.PopluateEvent): Implemented.
17948
17949         Added test-149.cs for this.  This also fixes bugs #26067 and #24256.
17950
17951 2002-07-22  Miguel de Icaza  <miguel@ximian.com>
17952
17953         * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
17954         but this is required to check for a method name being the same as
17955         the containing class.  
17956
17957         Handle this now.
17958
17959 2002-07-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17960
17961         * interface.cs: initialize variable.
17962
17963 2002-07-23  Martin Baulig  <martin@gnome.org>
17964
17965         Implemented the IndexerName attribute in interfaces.
17966
17967         * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
17968         name if this is an explicit interface implementation.
17969         (Indexer.InterfaceIndexerName): New public variable.  If we're
17970         implementing an interface indexer, this is the IndexerName in that
17971         interface.  Otherwise, it's the IndexerName.
17972         (Indexer.DefineMethod): If we're implementing interface indexer,
17973         set InterfaceIndexerName.  Use the new Pending.IsInterfaceIndexer
17974         and Pending.ImplementIndexer methods.
17975         (Indexer.Define): Also define the PropertyBuilder if we're
17976         implementing an interface indexer and this is neither an explicit
17977         interface implementation nor do the IndexerName match the one in
17978         the interface.
17979
17980         * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
17981         If a method is defined here, then we always need to create a proxy
17982         for it.  This is used when implementing interface indexers.
17983         (Pending.IsInterfaceIndexer): New public method.
17984         (Pending.ImplementIndexer): New public method.
17985         (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
17986         This is used when implementing interface indexers to define a proxy
17987         if necessary.
17988         (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
17989         define a proxy if necessary.
17990
17991         * interface.cs (Interface.IndexerName): New public variable.
17992         (Interface.PopulateIndexer): Set the IndexerName.
17993         (Interface.DefineIndexers): New private method.  Populate all the
17994         indexers and make sure their IndexerNames match.
17995
17996         * typemanager.cs (IndexerPropertyName): Added support for interface
17997         indexers.
17998
17999 2002-07-22  Martin Baulig  <martin@gnome.org>
18000
18001         * codegen.cs (EmitContext.HasReturnLabel): New public variable.
18002         (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
18003         ret if HasReturnLabel.
18004         (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
18005         variables.
18006
18007         * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
18008         and set the ec.LoopBeginTryCatchLevel.
18009         (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
18010         (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
18011         the current ec.TryCatchLevel, the branch goes out of an exception
18012         block.  In this case, we need to use Leave and not Br.
18013
18014 2002-07-22  Martin Baulig  <martin@gnome.org>
18015
18016         * statement.cs (Try.Emit): Emit an explicit ret after the end of the
18017         block unless the block does not always return or it is contained in
18018         another try { ... } catch { ... } block.  Fixes bug #26506.
18019         Added verify-1.cs to the test suite.
18020
18021 2002-07-22  Martin Baulig  <martin@gnome.org>
18022
18023         * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
18024         then we do not always return.  Fixes bug #24985.
18025
18026 2002-07-22  Martin Baulig  <martin@gnome.org>
18027
18028         * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
18029         lookup on a per-class level; ie. walk up the class hierarchy until we
18030         found at least one applicable method, then choose the best among them.
18031         Fixes bug #24463 and test-29.cs.
18032
18033 2002-07-22  Martin Baulig  <martin@gnome.org>
18034
18035         * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
18036         return types of the methods.  The return type is not part of the
18037         signature and we must not check it to make the `new' modifier work.
18038         Fixes bug #27999, also added test-147.cs.
18039         (TypeManager.TypeToCoreType): Added TypeManager.type_type.
18040
18041         * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
18042         on the method's return type.
18043
18044 2002-07-21  Martin Baulig  <martin@gnome.org>
18045
18046         * assign.cs: Make this work if the rightmost source is a constant and
18047         we need to do an implicit type conversion.  Also adding a few more tests
18048         to test-38.cs which should have caught this.
18049
18050         * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
18051         target in the makefile for this.  The makefile.gnu is primarily intended
18052         for end-users who don't want to debug the compiler.
18053
18054 2002-07-21  Martin Baulig  <martin@gnome.org>
18055
18056         * assign.cs: Improved the Assign class so it can now handle embedded
18057         assignments (X = Y = Z = something).  As a side-effect this'll now also
18058         consume less local variables.  test-38.cs now passes with MCS, added
18059         a few new test cases to that test.
18060
18061 2002-07-20  Martin Baulig  <martin@gnome.org>
18062
18063         * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
18064         instructions.  Fixes bug #27977, also added test-146.cs.
18065
18066 2002-07-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18067
18068         * cs-tokenizer.cs: fixed getHex ().
18069
18070 2002-07-19  Martin Baulig  <martin@gnome.org>
18071
18072         * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
18073         not Type.GetType() to lookup the array type.  This is needed when
18074         we're constructing an array of a user-defined type.
18075         (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
18076         single-dimensional arrays, but also for single-dimensial arrays of
18077         type decimal.
18078
18079 2002-07-19  Martin Baulig  <martin@gnome.org>
18080
18081         * expression.cs (New.DoEmit): Create a new LocalTemporary each time
18082         this function is called, it's not allowed to share LocalBuilders
18083         among ILGenerators.
18084
18085 2002-07-19  Martin Baulig  <martin@gnome.org>
18086
18087         * expression.cs (Argument.Resolve): Report an error 118 when trying
18088         to pass a type as argument.
18089
18090 2002-07-18  Martin Baulig  <martin@gnome.org>
18091
18092         * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
18093         Conv_R_Un for the signed `long' type.
18094
18095 2002-07-15  Miguel de Icaza  <miguel@ximian.com>
18096
18097         * expression.cs (MemberAccess.DoResolve): Do not reuse the field
18098         `expr' for the temporary result, as that will fail if we do
18099         multiple resolves on the same expression.
18100
18101 2002-07-05  Miguel de Icaza  <miguel@ximian.com>
18102
18103         * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
18104         ec.TypeContainer for looking up aliases. 
18105
18106         * class.cs (TypeContainer): Remove LookupAlias from here.
18107
18108         * decl.cs (DeclSpace); Move here.
18109
18110 2002-07-01  Miguel de Icaza  <miguel@ximian.com>
18111
18112         * class.cs (FindMembers): Only call filter if the constructor
18113         bulider is not null.
18114
18115         Also handle delegates in `NestedTypes' now.  Now we will perform
18116         type lookups using the standard resolution process.  This also
18117         fixes a bug.
18118
18119         * decl.cs (DeclSpace.ResolveType): New type resolution routine.
18120         This uses Expressions (the limited kind that can be parsed by the
18121         tree) instead of strings.
18122
18123         * expression.cs (ComposedCast.ToString): Implement, used to flag
18124         errors since now we have to render expressions.
18125
18126         (ArrayCreation): Kill FormElementType.  Use ComposedCasts in
18127         FormArrayType. 
18128
18129         * ecore.cs (SimpleName.ToString): ditto.
18130
18131         * cs-parser.jay: Instead of using strings to assemble types, use
18132         Expressions to assemble the type (using SimpleName, ComposedCast,
18133         MemberAccess).  This should fix the type lookups in declarations,
18134         because we were using a different code path for this.
18135
18136         * statement.cs (Block.Resolve): Continue processing statements
18137         even when there is an error.
18138
18139 2002-07-17  Miguel de Icaza  <miguel@ximian.com>
18140
18141         * class.cs (Event.Define): Also remove the `remove' method from
18142         the list of pending items.
18143
18144         * expression.cs (ParameterReference): Use ldarg.N (0..3) to
18145         generate more compact code. 
18146
18147 2002-07-17  Martin Baulig  <martin@gnome.org>
18148
18149         * const.cs (Const.LookupConstantValue): Add support for constant
18150         `unchecked' and `checked' expressions.
18151         Also adding test case test-140.cs for this.
18152
18153 2002-07-17  Martin Baulig  <martin@gnome.org>
18154
18155         * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
18156         check whether mi.ReturnType implements the IEnumerator interface; the
18157         `==' and the IsAssignableFrom() will fail in this situation.
18158
18159 2002-07-16  Ravi Pratap  <ravi@ximian.com>
18160
18161         * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix 
18162         here too.
18163
18164 2002-07-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18165
18166         * expression.cs: fixed bug #27811.
18167
18168 2002-07-14  Miguel de Icaza  <miguel@ximian.com>
18169
18170         * expression.cs (ParameterReference.AddressOf): Patch from Paolo
18171         Molaro: when we are a ref, the value already contains a pointer
18172         value, do not take the address of it.
18173
18174 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
18175         * removed mb-parser.jay and mb-tokenizer.cs
18176
18177 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
18178
18179         * expression.cs: check against the building corlib void type.
18180
18181 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
18182
18183         * ecore.cs: fix for valuetype static readonly fields: when 
18184         initializing them, we need their address, not the address of a copy.
18185
18186 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
18187
18188         * typemanager.cs: register also enum_type in corlib.
18189
18190 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
18191
18192         * class.cs: allow calling this (but not base) initializers in structs.
18193
18194 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
18195
18196         * ecore.cs: make sure we compare against the building base types
18197         in GetTypeSize ().
18198
18199 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
18200
18201         * typemanager.cs: fix TypeToCoreType() to handle void and object
18202         (corlib gets no more typerefs after this change).
18203
18204 2002-07-12  Miguel de Icaza  <miguel@ximian.com>
18205
18206         * expression.cs (ArrayCreation.EmitArrayArguments): use
18207         Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
18208
18209         (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
18210         Conv_Ovf_I_Un for the array arguments.  Even if C# allows longs as
18211         array indexes, the runtime actually forbids them.
18212
18213         * ecore.cs (ExpressionToArrayArgument): Move the conversion code
18214         for array arguments here.
18215
18216         * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
18217         instead of the default for ValueTypes.
18218
18219         (New.DoEmit): Use IsValueType instead of
18220         IsSubclassOf (value_type)
18221         (New.DoResolve): ditto.
18222         (Invocation.EmitCall): ditto.
18223
18224         * assign.cs (Assign): ditto.
18225
18226         * statement.cs (Unsafe): Ok, so I got the semantics wrong.
18227         Statements *are* currently doing part of their resolution during
18228         Emit.  
18229
18230         Expressions do always resolve during resolve, but statements are
18231         only required to propagate resolution to their children.
18232
18233 2002-07-11  Miguel de Icaza  <miguel@ximian.com>
18234
18235         * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
18236
18237         (LoadAssembly): Do not add the dll if it is already specified
18238
18239         (MainDriver): Add the System directory to the link path at the end,
18240         after all the other -L arguments. 
18241
18242         * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
18243         wrong opcode for loading bytes and bools (ldelem.i1 instead of
18244         ldelem.u1) and using the opposite for sbytes.
18245
18246         This fixes Digger, and we can finally run it.
18247
18248         * driver.cs (UnixParseOption): Move the option parsing here.  
18249         (CSCParseOption): Implement CSC-like parsing of options.
18250
18251         We now support both modes of operation, the old Unix way, and the
18252         new CSC-like way.  This should help those who wanted to make cross
18253         platform makefiles.
18254
18255         The only thing broken is that /r:, /reference: and /lib: are not
18256         implemented, because I want to make those have the same semantics
18257         as the CSC compiler has, and kill once and for all the confussion
18258         around this.   Will be doing this tomorrow.
18259
18260         * statement.cs (Unsafe.Resolve): The state is checked during
18261         resolve, not emit, so we have to set the flags for IsUnsfe here.
18262
18263 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
18264
18265         * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
18266         not catch the Error_ObjectRefRequired in SimpleName (as it is
18267         possible to have a class/instance variable name that later gets
18268         deambiguated), we have to check this here.      
18269
18270 2002-07-10  Ravi Pratap  <ravi@ximian.com>
18271
18272         * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
18273         make static and put into Expression.
18274
18275         (Event.Define): Register the private field of the event with the 
18276         TypeManager so that GetFieldFromEvent can get at it.
18277
18278         (TypeManager.RegisterPrivateFieldOfEvent): Implement to
18279         keep track of the private field associated with an event which
18280         has no accessors.
18281
18282         (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
18283         private field.
18284
18285         * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
18286
18287 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
18288
18289         * expression.cs (Binary.EmitBranchable): this routine emits the
18290         Binary expression in a branchable context.  This basically means:
18291         we need to branch somewhere, not just get the value on the stack.
18292
18293         This works together with Statement.EmitBoolExpression.
18294
18295         * statement.cs (Statement.EmitBoolExpression): Use
18296         EmitBranchable. 
18297
18298 2002-07-09  Miguel de Icaza  <miguel@ximian.com>
18299
18300         * statement.cs (For): Reduce the number of jumps in loops.
18301
18302         (For): Implement loop inversion for the For statement.
18303
18304         (Break): We can be breaking out of a Try/Catch controlled section
18305         (foreach might have an implicit try/catch clause), so we need to
18306         use Leave instead of Br.
18307
18308         * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
18309         now).  If the instace expression supports IMemoryLocation, we use
18310         the AddressOf method from the IMemoryLocation to extract the
18311         address instead of emitting the instance.
18312
18313         This showed up with `This', as we were emitting the instance
18314         always (Emit) instead of the Address of This.  Particularly
18315         interesting when This is a value type, as we dont want the Emit
18316         effect (which was to load the object).
18317
18318 2002-07-08  Miguel de Icaza  <miguel@ximian.com>
18319
18320         * attribute.cs: Pass the entry point to the DefinePInvokeMethod
18321
18322         * statement.cs (Checked): Set the CheckedState during the resolve
18323         process too, as the ConvCast operations track the checked state on
18324         the resolve process, and not emit.
18325
18326         * cs-parser.jay (namespace_member_declaration): Flag that we have
18327         found a declaration when we do.  This is used to flag error 1529
18328
18329         * driver.cs: Report ok when we display the help only.
18330
18331 2002-07-06  Andrew Birkett  <adb@tardis.ed.ac.uk>
18332
18333         * cs-tokenizer.cs (xtoken): Improve handling of string literals.
18334
18335 2002-07-04  Miguel de Icaza  <miguel@ximian.com>
18336
18337         * cs-tokenizer.cs (define): We also have to track locally the
18338         defines.  AllDefines is just used for the Conditional Attribute,
18339         but we also need the local defines for the current source code. 
18340
18341 2002-07-03  Miguel de Icaza  <miguel@ximian.com>
18342
18343         * statement.cs (While, For, Do): These loops can exit through a
18344         Break statement, use this information to tell whether the
18345         statement is the last piece of code.
18346
18347         (Break): Flag that we break.
18348
18349         * codegen.cs (EmitContexts): New `Breaks' state variable.
18350
18351 2002-07-03  Martin Baulig  <martin@gnome.org>
18352
18353         * class.cs (TypeContainer.MethodModifiersValid): Allow override
18354         modifiers in method declarations in structs.  Otherwise, you won't
18355         be able to override things like Object.Equals().
18356
18357 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
18358
18359         * class.cs (Method, Property, Indexer): Do not allow the public
18360         modifier to be used in explicit interface implementations.
18361
18362         (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
18363         override modifiers in method declarations in structs
18364
18365 2002-07-02   Andrew Birkett <adb@tardis.ed.ac.uk>
18366
18367         * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
18368         integer or real overflow, report an error
18369
18370 2002-07-02  Martin Baulig  <martin@gnome.org>
18371
18372         * typemanager.cs (TypeManager.InitCoreTypes): When compiling
18373         corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
18374         to tell the runtime about our newly created System.Object and
18375         System.ValueType types.
18376
18377 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
18378
18379         * expression.cs (This): Use Stobj/Ldobj when we are a member of a
18380         struct instead of Ldarg/Starg.
18381
18382 2002-07-02  Martin Baulig  <martin@gnome.org>
18383
18384         * expression.cs (Indirection.Indirection): Call
18385         TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
18386
18387 2002-07-02  Martin Baulig  <martin@gnome.org>
18388
18389         * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
18390         ValueType, call TypeManager.TypeToCoreType() on it.
18391         (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
18392         the OpCodes.Newarr argument.
18393
18394 2002-07-02  Martin Baulig  <martin@gnome.org>
18395
18396         * expression.cs (Invocation.EmitCall): When compiling corlib,
18397         replace all calls to the system's System.Array type to calls to
18398         the newly created one.
18399
18400         * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
18401         System.Array methods.
18402         (TypeManager.InitCoreTypes): When compiling corlib, get the methods
18403         from the system's System.Array type which must be replaced.
18404
18405 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
18406
18407         * typemanager.cs: load unverifiable_code_ctor so we can build
18408         corlib using the correct type. Avoid using GetTypeCode() with
18409         TypeBuilders.
18410         * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
18411         TypeManager.object_type to allow building corlib.
18412
18413 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
18414
18415         * ecore.cs: handle System.Enum separately in LoadFromPtr().
18416
18417 2002-07-01  Martin Baulig  <martin@gnome.org>
18418
18419         * class.cs: Make the last change actually work, we need to check
18420         whether `ifaces != null' to avoid a crash.
18421
18422 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
18423
18424         * class.cs: when we build structs without fields that implement
18425         interfaces, we need to add the interfaces separately, since there is
18426         no API to both set the size and add the interfaces at type creation
18427         time.
18428
18429 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
18430
18431         * expression.cs: the dimension arguments to the array constructors
18432         need to be converted if they are a long.
18433
18434 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
18435
18436         * class.cs: don't emit ldarg.0 if there is no parent constructor
18437         (fixes showstopper for corlib).
18438
18439 2002-06-29  Martin Baulig  <martin@gnome.org>
18440
18441         MCS now compiles corlib on GNU/Linux :-)
18442
18443         * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
18444         ie. check for MethodImplOptions.InternalCall.
18445
18446         * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
18447         and TypeManager.attribute_type are null, so we must explicitly check
18448         whether parent is not null to find out whether it's an attribute type.
18449         (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
18450         and SetBuilder, not only if the property is neither abstract nor external.
18451         This is necessary to set the MethodImplOptions on the accessor methods.
18452         (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
18453         SetBuilder, see Property.Emit().
18454
18455         * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
18456         populate "System.Object", "System.ValueType" and "System.Attribute" since
18457         they've already been populated from BootCorlib_PopulateCoreTypes().
18458
18459 2002-06-29  Martin Baulig  <martin@gnome.org>
18460
18461         * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
18462         is the NullLiteral, we also need to make sure that target_type is not
18463         an enum type.   
18464
18465 2002-06-29  Martin Baulig  <martin@gnome.org>
18466
18467         * rootcontext.cs (RootContext.ResolveCore): We must initialize
18468         `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
18469         before calling BootstrapCorlib_ResolveDelegate ().
18470
18471 2002-06-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18472
18473         * statement.cs: fixed build-breaker. All tests passed ok.
18474
18475 2002-06-27  Martin Baulig  <martin@gnome.org>
18476
18477         * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
18478         for System.Decimal when compiling corlib.
18479
18480 2002-06-27  Martin Baulig  <martin@gnome.org>
18481
18482         * statement.cs (Switch.TableSwitchEmit): Make this work with empty
18483         switch blocks which contain nothing but a default clause.
18484
18485 2002-06-26  Andrew  <adb@tardis.ed.ac.uk>
18486
18487        * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
18488
18489 2002-06-27  Martin Baulig  <martin@gnome.org>
18490
18491         * ecore.cs (PropertyExpr.PropertyExpr): Call
18492         TypeManager.TypeToCoreType() on the `pi.PropertyType'.
18493
18494         * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
18495         is already a TypeBuilder.
18496
18497 2002-06-27  Martin Baulig  <martin@gnome.org>
18498
18499         * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
18500         `target_type == TypeManager.array_type', not IsAssignableFrom() in
18501         the "from an array-type to System.Array" case.  This makes it work
18502         when compiling corlib.
18503
18504 2002-06-27  Martin Baulig  <martin@gnome.org>
18505
18506         * ecore.cs (Expression.SimpleNameResolve): If the expression is a
18507         non-static PropertyExpr, set its InstanceExpression.  This makes
18508         the `ICollection.Count' property work in System/Array.cs.
18509
18510 2002-06-25  Andrew Birkett  <adb@tardis.ed.ac.uk>
18511
18512         * driver.cs: Made error handling more consistent.  Errors now
18513         tracked by Report class, so many methods which used to return int
18514         now return void.  Main() now prints success/failure and 
18515         errors/warnings message.
18516
18517         Renamed '--probe' compiler argument to '--expect-error'.  Removed
18518         the magic number return values (123 and 124).  Now, if the
18519         expected error occurs, the compiler exits with success (exit value
18520         0).  If the compilation completes without seeing that particular
18521         error, the compiler exits with failure (exit value 1).  The
18522         makefile in mcs/errors has been changed to handle the new behaviour.
18523
18524         * report.cs: Made 'expected error' number a property and renamed
18525         it from 'Probe' to 'ExpectedError'.
18526
18527         * genericparser.cs: Removed error handling support, since it is
18528         now all done by Report class.
18529
18530         * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
18531         class, so parse() no longer returns an int.
18532
18533         * namespace.cs: Use Report.Error instead of GenericParser.error
18534
18535 2002-06-22  Miguel de Icaza  <miguel@ximian.com>
18536
18537         * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
18538         TypeContainer.AddOperator): At the front of the list put the
18539         explicit implementations, so they get resolved/defined first. 
18540
18541 2002-06-21  Miguel de Icaza  <miguel@ximian.com>
18542
18543         * class.cs (TypeContainer.VerifyImplements): Verifies that a given
18544         interface type is implemented by this TypeContainer.  Used during
18545         explicit interface implementation.
18546
18547         (Property.Define, Indexer.Define, Method.Define): Validate that
18548         the given interface in the explicit implementation is one of the
18549         base classes for the containing type.
18550
18551         Also if we are explicitly implementing an interface, but there is
18552         no match in the pending implementation table, report an error.
18553
18554         (Property.Define): Only define the property if we are
18555         not explicitly implementing a property from an interface.  Use the
18556         correct name also for those properties (the same CSC uses,
18557         although that is really not needed).
18558
18559         (Property.Emit): Do not emit attributes for explicitly implemented
18560         properties, as there is no TypeBuilder.
18561
18562         (Indexer.Emit): ditto.
18563
18564         Hiding then means that we do not really *implement* a pending
18565         implementation, which makes code fail.
18566
18567 2002-06-22  Martin Baulig  <martin@gnome.org>
18568
18569         * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
18570         the return value of Object.GetType().  [FIXME: we need to do this whenever
18571         we get a type back from the reflection library].
18572
18573 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
18574
18575         * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
18576
18577 2002-06-20  Miguel de Icaza  <miguel@ximian.com>
18578
18579         * attribute.cs: Return null if we can not look up the type.
18580
18581         * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
18582         the interface types found.
18583
18584         * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
18585         interface types found.
18586
18587         * typemanager.cs (GetInterfaces): Make this routine returns alll
18588         the interfaces and work around the lame differences between
18589         System.Type and System.Reflection.Emit.TypeBuilder in the results
18590         result for GetInterfaces.
18591
18592         (ExpandInterfaces): Given an array of interface types, expand and
18593         eliminate repeated ocurrences of an interface.  This expands in
18594         context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
18595         be IA, IB, IC.
18596
18597 2002-06-21  Martin Baulig  <martin@gnome.org>
18598
18599         * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
18600         on System.Enum.
18601
18602 2002-06-21  Martin Baulig  <martin@gnome.org>
18603
18604         * typemanager.cs (TypeManager.TypeToCoreType): New function.  When compiling corlib
18605         and called with one of the core types, return the corresponding typebuilder for
18606         that type.
18607
18608         * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
18609         element type.
18610
18611 2002-06-21  Martin Baulig  <martin@gnome.org>
18612
18613         * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
18614         `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
18615         (Expression.ConvertReferenceExplicit): Likewise.
18616
18617         * expression.cs (ElementAccess.DoResolve): Likewise.
18618         (ElementAccess.DoResolveLValue): Likewise.
18619
18620 2002-06-10  Martin Baulig  <martin@gnome.org>
18621
18622         * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
18623         add the "value" parameter to the parameter list.
18624
18625         * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
18626         to our caller.
18627
18628 2002-06-19  Miguel de Icaza  <miguel@ximian.com>
18629
18630         * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
18631         the argument to an int, uint, long or ulong, per the spec.  Also
18632         catch negative constants in array creation.
18633
18634 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
18635
18636         * class.cs: do not allow the same interface to appear twice in
18637         the definition list.
18638
18639 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
18640
18641         * ecore.cs: don't use ldlen with System.Array.
18642
18643 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
18644
18645         * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
18646
18647 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
18648
18649         * modifiers.cs: produce correct field attributes for protected
18650         internal. Easy fix so miguel can work on ther harder stuff:-)
18651
18652 2002-06-18  Miguel de Icaza  <miguel@ximian.com>
18653
18654         * pending.cs: New file.  Move the code from class.cs here.
18655         Support clearning the pending flag for all methods (when not doing
18656         explicit interface implementation).
18657
18658 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
18659
18660         * rootcontext.cs: added a couple more types needed to bootstrap.
18661
18662 2002-06-17  Miguel de Icaza  <miguel@ximian.com>
18663
18664         * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
18665         constructor in the type, instead of any constructor in the type
18666         hierarchy.  Thanks to Paolo for finding this bug (it showed up as
18667         a bug in the Mono runtime when applying the params attribute). 
18668
18669 2002-06-16  Rafael Teixeira  <rafaelteixeirabr@hotmail.com>
18670         * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
18671
18672 2002-06-14  Rachel Hestilow  <hestilow@ximian.com>
18673
18674         * expression.cs (Unary.ResolveOperator): Use TypeManager
18675         to resolve the type.
18676
18677 2002-06-13  Ravi Pratap  <ravi@ximian.com>
18678
18679         * cs-parser.jay (enum_member_declaration): Pass in the attributes
18680         attached.
18681
18682         * enum.cs (AddEnumMember): Add support to store the attributes associated 
18683         with each member too.
18684
18685         * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
18686         field builders too - this takes care of the enum member case.
18687
18688 2002-06-10  Rachel Hestilow  <hestilow@ximian.com>
18689
18690         * typemanager.cs (TypeManager.VerifyUnManaged): Allow
18691         address-of operator on both value types and pointers.
18692
18693 2002-06-10  Martin Baulig  <martin@gnome.org>
18694
18695         * interface.cs (Interface.PopulateIndexer): Add the indexer's
18696         PropertyBuilder to the `property_builders' list.
18697
18698         * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
18699         (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
18700         `lookup_type' and all its interfaces.  Unfortunately, Type.FindMembers() won't
18701         find any indexers which are inherited from an interface.
18702
18703 2002-06-09  Martin Baulig  <martin@gnome.org>
18704
18705         * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
18706         the same type as the constant if necessary.  There's also a test-130.cs
18707         for this.
18708
18709         * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
18710
18711         * typemanager.cs (TypeManager.ChangeType): Previously known as
18712         Enum.ChangeEnumType().
18713
18714 2002-06-09  Martin Baulig  <martin@gnome.org>
18715
18716         * expression.cs (Cast.TryReduce): Added support for consts.
18717
18718 2002-06-08  Ravi Pratap  <ravi@ximian.com>
18719
18720         * class.cs (Accessor): Hold attributes information so we can pass
18721         it along.
18722
18723         * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
18724         Modify to pass in attributes attached to the methods.
18725
18726         (add_accessor_declaration, remove_accessor_declaration): Ditto.
18727
18728         * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
18729         to handle the Accessor kind :-)
18730
18731         * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
18732
18733 2002-06-08  Martin Baulig  <martin@gnome.org>
18734
18735         * expression.cs (Unary.TryReduceNegative): Added support for
18736         ULongConstants.
18737
18738 2002-06-08  Martin Baulig  <martin@gnome.org>
18739
18740         * enum.cs (Enum.LookupEnumValue): Don't report an error if the
18741         name can't be found in the `defined_names' - the caller will do a
18742         MemberLookup in this case and thus find methods in System.Enum
18743         such as Enum.IsDefined().
18744
18745 2002-06-08  Martin Baulig  <martin@gnome.org>
18746
18747         * enum.cs (Enum.ChangeEnumType): This is a custom version of
18748         Convert.ChangeType() which works with TypeBuilder created types.
18749         (Enum.LookupEnumValue, Enum.Define): Use it here.
18750
18751         * class.cs (TypeContainer.RegisterRequiredImplementations): Added
18752         `TypeBuilder.BaseType != null' check.
18753         (TypeContainer.FindMembers): Only lookup parent members if we
18754         actually have a parent.
18755         (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
18756         (ConstructorInitializer.Resolve): Likewise.
18757
18758         * interface.cs (Interface.FindMembers): Added
18759         `TypeBuilder.BaseType != null' check.
18760
18761         * rootcontext.cs (RootContext.ResolveCore): Added
18762         "System.Runtime.CompilerServices.IndexerNameAttribute" to
18763         classes_second_stage.
18764
18765         * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
18766         debug_type and trace_type when compiling with --nostdlib.       
18767
18768 2002-06-07  Martin Baulig  <martin@gnome.org>
18769
18770         * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
18771         (AddField): Set it to true when adding a non-static field.
18772         (DefineType): Use `have_nonstatic_fields' to find out whether we
18773         have non-static fields, not `Fields != null'.
18774
18775 2002-06-02  Miguel de Icaza  <miguel@ximian.com>
18776
18777         * ecore.cs (SimpleNameResolve): Removed simple bug (we were
18778         dereferencing a null on the static-field code path)
18779
18780 2002-05-30  Martin Baulig  <martin@gnome.org>
18781
18782         * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
18783         to take command line arguments.  Use reflection to call the new
18784         custom `Initialize' function on the symbol writer and pass it the
18785         command line arguments.
18786
18787         * driver.cs (--debug-args): New command line argument to pass command
18788         line arguments to the symbol writer.
18789
18790 2002-05-28  Miguel de Icaza  <miguel@ximian.com>
18791
18792         * assign.cs (DoResolve): Forgot to do the implicit conversion to
18793         the target type for indexers and properties.  Thanks to Joe for
18794         catching this.
18795
18796 2002-05-27  Miguel de Icaza  <miguel@ximian.com>
18797
18798         * typemanager.cs (MethodFlags): returns the method flags
18799         (Obsolete/ShouldIgnore) that control warning emission and whether
18800         the invocation should be made, or ignored. 
18801
18802         * expression.cs (Invocation.Emit): Remove previous hack, we should
18803         not do this on matching a base type, we should do this based on an attribute
18804
18805         Only emit calls to System.Diagnostics.Debug and
18806         System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
18807         on the command line.
18808
18809         * rootcontext.cs: Global settings for tracing and debugging.
18810
18811         * cs-tokenizer.cs (define): New utility function to track
18812         defines.   Set the global settings for TRACE and DEBUG if found.
18813
18814 2002-05-25  Ravi Pratap  <ravi@ximian.com>
18815
18816         * interface.cs (Populate*): Pass in the TypeContainer as well as
18817         the DeclSpace as parameters so that we can create EmitContexts and
18818         then use that to apply attributes etc.
18819
18820         (PopulateMethod, PopulateEvent, PopulateProperty)
18821         (PopulateIndexer): Apply attributes everywhere.
18822
18823         * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
18824         etc.
18825
18826         (ApplyAttributes): Update accordingly.
18827
18828         We now apply interface attributes for all members too.
18829
18830 2002-05-26  Miguel de Icaza  <miguel@ximian.com>
18831
18832         * class.cs (Indexer.Define); Correctly check if we are explicit
18833         implementation (instead of checking the Name for a ".", we
18834         directly look up if the InterfaceType was specified).
18835
18836         Delay the creation of the PropertyBuilder.
18837
18838         Only create the PropertyBuilder if we are not an explicit
18839         interface implementation.   This means that explicit interface
18840         implementation members do not participate in regular function
18841         lookups, and hence fixes another major ambiguity problem in
18842         overload resolution (that was the visible effect).
18843
18844         (DefineMethod): Return whether we are doing an interface
18845         implementation. 
18846
18847         * typemanager.cs: Temporary hack until we get attributes in
18848         interfaces (Ravi is working on that) and we get IndexerName
18849         support in interfaces.
18850
18851         * interface.cs: Register the indexers as properties.
18852
18853         * attribute.cs (Attribute.Resolve): Catch the error, and emit a
18854         warning, I have verified that this is a bug in the .NET runtime
18855         (JavaScript suffers of the same problem).
18856
18857         * typemanager.cs (MemberLookup): When looking up members for
18858         interfaces, the parent of an interface is the implicit
18859         System.Object (so we succeed in searches of Object methods in an
18860         interface method invocation.  Example:  IEnumerable x;  x.ToString
18861         ()) 
18862
18863 2002-05-25  Miguel de Icaza  <miguel@ximian.com>
18864
18865         * class.cs (Event): Events should also register if they do
18866         implement the methods that an interface requires.
18867
18868         * typemanager.cs (MemberLookup); use the new GetInterfaces
18869         method. 
18870
18871         (GetInterfaces): The code used to lookup interfaces for a type is
18872         used in more than one place, factor it here. 
18873
18874         * driver.cs: Track the errors at the bottom of the file, we kept
18875         on going.
18876
18877         * delegate.cs (NewDelegate.Emit): We have to emit a null as the
18878         instance if the method we are calling is static!
18879
18880 2002-05-24  Miguel de Icaza  <miguel@ximian.com>
18881
18882         * attribute.cs (ApplyAttributes): Make this function filter out
18883         the IndexerName attribute (as that attribute in reality is never
18884         applied) and return the string constant for the IndexerName
18885         attribute. 
18886
18887         * class.cs (TypeContainer.Emit): Validate that all the indexers
18888         have the same IndexerName attribute, and if so, set the
18889         DefaultName attribute on the class. 
18890
18891         * typemanager.cs: The return value might contain other stuff (not
18892         only methods).  For instance, consider a method with an "Item"
18893         property and an Item method.
18894
18895         * class.cs: If there is a problem with the parameter types,
18896         return. 
18897
18898 2002-05-24  Ravi Pratap  <ravi@ximian.com>
18899
18900         * ecore.cs (ImplicitConversionExists): Wrapper function which also
18901         looks at user defined conversion after making a call to 
18902         StandardConversionExists - we need this for overload resolution.
18903
18904         * expression.cs : Update accordingly the various method calls.
18905
18906         This fixes 2 bugs filed against implicit user defined conversions 
18907
18908 2002-05-22  Miguel de Icaza  <miguel@ximian.com>
18909
18910         * statement.cs: Track the result of the assignment.
18911
18912 2002-05-21  Miguel de Icaza  <miguel@ximian.com>
18913
18914         * expression.cs (MemberAccess): Improved error reporting for
18915         inaccessible members.
18916
18917 2002-05-22  Martin Baulig  <martin@gnome.org>
18918
18919         * makefile (mcs-mono2.exe): New target.  This is mcs compiled with
18920         itself with debugging support.
18921
18922 2002-05-22  Martin Baulig  <martin@gnome.org>
18923
18924         * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
18925         Removed, this isn't needed anymore.
18926
18927 2002-05-20  Martin Baulig  <martin@gnome.org>
18928
18929         * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
18930         be underlying type for an enum.
18931
18932 2002-05-20  Miguel de Icaza  <miguel@ximian.com>
18933
18934         * typemanager.cs (InitEnumUnderlyingTypes): New helper function
18935         that splits out the loading of just the core types.
18936
18937         * rootcontext.cs (ResolveCore): Split the struct resolution in
18938         two, so we can load the enumeration underlying types before any
18939         enums are used.
18940
18941         * expression.cs (Is): Bandaid until we fix properly Switch (see
18942         bug #24985 for details).
18943
18944         * typemanager.cs (ImplementsInterface): The hashtable will contain
18945         a null if there are no interfaces implemented.
18946
18947 2002-05-18  Miguel de Icaza  <miguel@ximian.com>
18948
18949         * cs-parser.jay (indexer_declarator): It is fine to have array
18950         parameters
18951
18952 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
18953
18954         * typemanager.cs: (RegisterBuilder): New function used to register
18955         TypeBuilders that implement interfaces.  Since
18956         TypeBuilder.GetInterfaces (as usual) does not work with lame
18957         Reflection.Emit. 
18958         (AddUserType): register interfaces.
18959
18960         (ImplementsInterface): Use the builder_to_ifaces hash if we are
18961         dealing with TypeBuilder.  Also, arrays are showing up as
18962         SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
18963         methods can not be invoked on them!
18964
18965         * ecore.cs (ExplicitReferenceConversionExists): Made public.
18966         (ImplicitReferenceConversionExists): Split out from
18967         StandardConversionExists. 
18968
18969         * expression.cs (As): We were only implementing one of the three
18970         cases for the as operator.  We now implement them all.
18971         (Is): Implement the various other cases for Is as well.
18972
18973         * typemanager.cs (CACHE): New define used to control if we want or
18974         not the FindMembers cache.  Seems to have a negative impact on
18975         performance currently
18976
18977         (MemberLookup): Nested types have full acess to
18978         enclosing type members
18979
18980         Remove code that coped with instance/static returns for events, we
18981         now catch this in RealFindMembers.
18982
18983         (RealFindMembers): only perform static lookup if the instance
18984         lookup did not return a type or an event.  
18985
18986 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
18987
18988         * assign.cs (CompoundAssign): We pass more semantic information
18989         now to Compound Assignments than we did before: now we have all
18990         the information at hand, and now we resolve the target *before* we
18991         do the expression expansion, which allows the "CacheValue" method
18992         to have the effect we intended (before, a [x] += 1 would generate
18993         two differen ArrayAccess expressions from the ElementAccess,
18994         during the resolution process).
18995
18996         (CompoundAssign.DoResolve): Resolve target and original_source here.
18997
18998 2002-05-16  Miguel de Icaza  <miguel@ximian.com>
18999
19000         * expression.cs (ArrayAccess): dropped debugging information. 
19001
19002         * typemanager.cs: Small bug fix: I was always returning i_members,
19003         instead of one of i_members or s_members (depending on which had
19004         the content).
19005
19006         * assign.cs (IAssignMethod.CacheTemporaries): New method.  This
19007         method is invoked before any code generation takes place, and it
19008         is a mechanism to inform that the expression will be invoked more
19009         than once, and that the method should use temporary values to
19010         avoid having side effects
19011
19012         (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
19013
19014         * ecore.cs (Expression.CacheTemporaries): Provide empty default
19015         implementation.
19016
19017         * expression.cs (Indirection, ArrayAccess): Add support for
19018         CacheTemporaries in these two bad boys. 
19019
19020         * ecore.cs (LoadFromPtr): figure out on our own if we need to use
19021         ldobj or ldind_ref.  
19022         (StoreFromPtr): Handle stobj as well.
19023
19024         * expression.cs (UnaryMutator): Share more code.
19025
19026         * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
19027         down: I was not tracking the Filter function as well, which
19028         was affecting the results of the cache.
19029
19030 2002-05-15  Miguel de Icaza  <miguel@ximian.com>
19031
19032         * attribute.cs: Remove the hack to handle the CharSet property on
19033         StructLayouts. 
19034
19035 2002-05-14  Miguel de Icaza  <miguel@ximian.com>
19036
19037         * attribute.cs (DoResolve): More uglyness, we now only try to
19038         resolve the attribute partially, to extract the CharSet
19039         information (only if we are a StructLayout attribute).  Otherwise 
19040
19041         (GetExtraTypeInfo): Add some code to conditionally kill in the
19042         future this.   I am more and more convinced that the .NET
19043         framework has special code to handle the attribute setting on
19044         certain elements.
19045
19046         * expression.cs (IsParamsMethodApplicable): Revert my previous
19047         foreach change here, it was wrong.
19048
19049 2002-05-13  Miguel de Icaza  <miguel@ximian.com>
19050
19051         * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
19052         (pp_expr): do not abort on unknown input, just return.
19053         (eval): abort if there are pending chars.
19054
19055         * attribute.cs (Attribute.Resolve): Positional parameters are
19056         optional.  Deal with that case.
19057
19058         * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
19059         the Ansi/Unicode/Auto information for the type.
19060
19061         (TypeContainer.DefineType): instantiate the EmitContext here, as
19062         we will be using it during the type definition (to resolve
19063         attributes) and during the emit phase.
19064
19065         * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
19066         to pull type information out of the attributes
19067
19068         (Attribute.Resolve): track the constructor builder, and allow for
19069         multiple invocations (structs and classes will use this).
19070
19071         * ecore.cs (MemberLookupFinal): new version with all the
19072         parameters customizable.
19073
19074         * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
19075         constructors.  Return if the result value is null (as the error
19076         would have been flagged already by MemberLookupFinal)
19077
19078         Do not allow instances of abstract classes or interfaces to be
19079         created.
19080
19081         * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
19082         We have to compare the assembly property here when dealing with
19083         FamANDAssem and Assembly access modifiers, because we might be
19084         creating an assembly from *modules* (that means that we are not
19085         getting TypeBuilders for types defined in other modules that are
19086         part of this assembly).
19087
19088         (Method.Emit): If the method is marked abstract and has a body,
19089         emit an error. 
19090
19091         (TypeContainer.DefineMembers): If both the defined member and the
19092         parent name match are methods, then do not emit any warnings: let
19093         the Method.Define routine take care of flagging warnings.  But if
19094         there is a mismatch (method overrides something else, or method is
19095         overriwritten by something, then emit warning).
19096
19097         (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
19098         set to null, this means `do not check for the return type on the
19099         signature'. 
19100
19101         (Method.Define): set the return type for the method signature to
19102         null, so that we get methods with the same name and parameters and
19103         different return types.  This is used to flag warning 114 (you are
19104         hiding a method, and you probably want to use the new/override
19105         keywords instead).
19106
19107         * typemanager.cs (MemberLookup): Implemented proper access
19108         control, closing a long standing set of bug reports.  The problem
19109         was that the Framework only has two bits: Public and NonPublic,
19110         and NonPublic includes private and protected methods, but we need
19111         to enforce the FamANDAssem, FamOrAssem and Family. 
19112
19113 2002-05-11  Miguel de Icaza  <miguel@ximian.com>
19114
19115         * statement.cs (GotoCase): Return true: Ammounts to giving up
19116         knowledge on whether we return or not, and letting the other case
19117         be responsible for it.
19118
19119 2002-05-10  Miguel de Icaza  <miguel@ximian.com>
19120
19121         * driver.cs: Do not load directories for each file processed, only
19122         do it if there is a pattern.
19123
19124         * ecore.cs: Report readonly assigns here as well, as we might have
19125         been resolved only by MemberAccess.
19126
19127         (SimpleName.SimpleNameResolve): Also be useful for LValue
19128         resolution.   We need this to propagate assign to local readonly variables
19129
19130         * typemanager.cs: Use a ptrhashtable for the criteria, because we
19131         do not want to reuse potential criteria memory.
19132
19133         * class.cs (MyEventBuilder): Set reflected_type;
19134
19135         * ecore.cs (Constantify): Added support for constifying bools.
19136
19137         (RootContext.LookupType): Added a cache for values looked up in
19138         the declaration space.
19139
19140         * typemanager.cs (FindMembers): Now is a front-end to
19141         RealFindMembers, and provides a two-level hashtable-based cache to
19142         the request.  
19143
19144         15% performance improvement: from 22.5 to 19.2 seconds.
19145
19146         * expression.cs (IsParamsMethodApplicable): use foreach.
19147         (Invocation.DoResolve): ditto.
19148         (New.DoResolve): ditto.
19149         (ArrayCreation.DoResolve): ditto.
19150
19151         * ecore.cs (FindMostEncompassingType): use foreach.
19152
19153         * delegate.cs (NewDelegate.DoResolve): Use foreach
19154
19155         * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
19156         (RemoveMethods): use foreach.
19157
19158         * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
19159         nested foreach statements instead of for, and also break out of
19160         the inner loop once a match is found.
19161
19162         (Invocation.OverloadResolve): Use foreach, simplify the code. 
19163
19164 2002-05-08  Miguel de Icaza  <miguel@ximian.com>
19165
19166         * cfold.cs (BinaryFold): During an enumeration evaluation context,
19167         we actually unwrap the expression to allow for extra information
19168         to be extracted. 
19169
19170         * expression.cs: Use Shr_Un on unsigned operations. 
19171
19172 2002-05-08  Ravi Pratap  <ravi@ximian.com>
19173
19174         * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of 
19175         applicable operators was not being considered correctly. This closes
19176         the bug Miguel reported.
19177
19178 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
19179
19180         * attribute.cs: check that the type derives from System.Attribute
19181         and report the correct error in that case (moved the duplicate code to
19182         its own method, too).
19183
19184 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
19185
19186         * attribute.cs: lookup attribute type name as the spec says: first the
19187         bare attribute name and then name + "Attribute" (nant compiles with
19188         mcs after this fix).
19189
19190 2002-05-07  Miguel de Icaza  <miguel@ximian.com>
19191
19192         * expression.cs (Unary.TryReduceNegative): Ah!  Tricky!  Tricky!
19193         Because of the way we parse things, we should try to see if a
19194         UIntConstant can fit in an integer.
19195
19196 2002-05-07  Ravi Pratap  <ravi@ximian.com>
19197
19198         * ecore.cs (GetConversionOperators): Do not pick up op_True operators
19199         when we are in an explicit context.
19200
19201         (ConvertReferenceExplicit): When converting from Iface type S to Class
19202         T make sure the rules are implemented as an OR.
19203
19204         * parameter.cs (ParameterType): Make it a property for now although the
19205         purpose really isn't anything immediate.
19206
19207         * expression.cs (Is*Applicable): Do better checking on the parameter type
19208         of a ref/out parameter. The ones from the system assemblies are already 
19209         marked with the correct type so we don't need to do any correction.
19210
19211         * ecore.cs (StandardConversionExists): Conversion from Interface types to 
19212         the object type is standard too so include that.
19213
19214 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
19215
19216         * ecore.cs (StandardConversionExists): Augment with missing code:
19217         deal with IntConstant, LongConstants and Enumerations.
19218
19219         * assign.cs: Report the error, instead of failing silently
19220
19221         * rootcontext.cs (AddGlobalAttributes): Track attributes on the
19222         typecontainer that they are declared, because the
19223         typecontainer/namespace will have the list of using clauses that
19224         need to be applied.
19225
19226         Assembly Attributes were escaping the normal registration
19227         mechanism. 
19228
19229         (EmitCode): Apply attributes within an EmitContext that represents
19230         the container they were declared on.
19231
19232         * cs-parser.jay: Track bases for structs.  How did I get this wrong?
19233
19234 2002-05-06  Ravi Pratap  <ravi@ximian.com>
19235
19236         * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
19237         Revamp completely - make much cleaner as we now operate only
19238         on a set of Types.
19239
19240         (FindMostSpecificSource, FindMostSpecificTarget): New methods
19241         to implement the logic detailed in the spec more correctly.
19242
19243         (UserDefinedConversion): Update accordingly.
19244
19245 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
19246
19247         * statement.cs: Return flow analysis information up.
19248
19249         * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
19250         and the default.
19251
19252         (token): Do not consume an extra character before calling
19253         decimal_digits.
19254
19255 2002-05-06  Piers Haken <piersh@friskit.com>
19256
19257         * cs-parser.jay: add 'override' attribute to System.Object.Finalize
19258
19259 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
19260
19261         * class.cs (Constructor.Emit): Set the IsStatic flag in the
19262         EmitContext during the instance constructor initializer
19263         resolution, to stop access to instance variables.
19264
19265         This is mandated by the spec, last paragraph of the `constructor
19266         initializers' section. 
19267
19268 2002-05-05  Miguel de Icaza  <miguel@ximian.com>
19269
19270         * cs-parser.jay, class.cs (Accessor): new class used to represent
19271         an accessor (get or set).  In the past we used `null' to represent
19272         a missing accessor.  But this is ambiguous because there was no
19273         way to tell in abstract indexers/properties if one of them was
19274         specified.
19275
19276         Now there is a way of addressing that.
19277
19278         * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
19279         instead of FindMembers.
19280
19281         * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
19282         the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
19283
19284         * attribute.cs: Treat indexers and properties as the same in terms
19285         of applying attributes
19286
19287         * ecore.cs (FindMostEncompassedType): Use statically initialized
19288         EmptyExpressions()s like we do elsewhere to avoid creating useless
19289         objects (and we take this out of the tight loop).
19290
19291         (GetConversionOperators): Move the code to extract the actual
19292         operators to a separate routine to clean things up.
19293
19294 2002-05-04  Miguel de Icaza  <miguel@ximian.com>
19295
19296         * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
19297         events are always registered FieldBuilders.
19298
19299         * class.cs (FieldBase): New class shared by Fields 
19300
19301         * delegate.cs: If we are a toplevel delegate, use our full name.
19302         If we are a nested delegate, then only use our tail name.
19303
19304 2002-05-02  Ravi Pratap  <ravi@ximian.com>
19305
19306         * expression.cs (IsApplicable): Ensure that we add the "&" to
19307         ref/out types before comparing it with the type of the argument.
19308
19309         (IsParamsMethodApplicable): Ditto.
19310
19311         (Argument.Type): Use TypeManager.LookupType instead of Type.GetType - 
19312         silly me ;-)
19313
19314         * delegate.cs : Handle the case when we have more than one applicable
19315         method. Flag an error only when we finish checking all.
19316
19317 2002-05-02  Miguel de Icaza  <miguel@ximian.com>
19318
19319         * expression.cs: Add support for boolean static initializers.
19320
19321 2002-05-01  Miguel de Icaza  <miguel@ximian.com>
19322
19323         * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
19324
19325         * parameter.cs (ComputeParameterTypes,
19326         ComputeAndDefineParameterTypes): Better error handling: now we
19327         clear the `types' cache if we fail during any of the type lookups.
19328         We also return the status code correctly to our caller
19329
19330         * delegate.cs: If we fail to define a delegate, abort the extra
19331         steps. 
19332
19333         * expression.cs (Binary.ResolveOperator): for
19334         operator==(object,object) and operator !=(object, object) we also
19335         have to verify that there is an implicit conversion from one to
19336         the other.
19337
19338         (ArrayAccess.DoResolve): Array Access can operate on
19339         non-variables. 
19340
19341 2002-04-30  Miguel de Icaza  <miguel@ximian.com>
19342
19343         * assign.cs (CompoundAssign): A new class used as a "flag" that
19344         the assignment actually is happening as part of a compound
19345         assignment operator.
19346
19347         During compound assignment, a few new rules exist to enable things
19348         like:
19349
19350         byte b |= 1 + 2
19351
19352         From the spec:
19353
19354         x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
19355         to the type of x) if y is implicitly convertible to the type of x,
19356         and the operator is a builtin operator and the return type of the
19357         operator is explicitly convertible to the type of x. 
19358
19359         * rootcontext.cs: Reset warning level to 2.  4 catches various
19360         "interesting" features in mcs, we must clean this up at some
19361         point, but currently am trying to kill other bugs ;-)
19362
19363         * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
19364         in container classes as well.  
19365
19366         * expression.cs (Binary.ResolveOperator): Handle string case
19367         before anything else (as operator overloading does emit an error
19368         before doing anything else).
19369
19370         This code could go away when we move to a table driven model, but
19371         i could not come up with a good plan last night.
19372
19373 2002-04-30  Lawrence Pit <loz@cable.a2000.nl>
19374
19375         * typemanager.cs (CSharpName): reimplementation using regex.
19376         * class.cs: added null check for fields in Emit
19377         * rootcontext.cs: set warninglevel to 4
19378
19379 2002-04-29  Miguel de Icaza  <miguel@ximian.com>
19380
19381         * typemanager.cs (CSharpName): reimplemented with Lupus
19382         suggestion.
19383
19384 2002-04-28  Miguel de Icaza  <miguel@ximian.com>
19385
19386         * statement.cs (If): correclty implement Resolve, because we were
19387         not catching sem errors in there.  The same process is needed
19388         everywhere else. 
19389         (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
19390
19391
19392         (Statement.Warning_DeadCodeFound): Factorize code.
19393         (While): Report dead code here too.
19394
19395         (Statement): Added Resolve virtual method to allow
19396         for resolution split from the emit code.
19397
19398 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
19399
19400         * statement.cs (EmitBoolExpression): No longer try to resolve the
19401         expression here.    
19402         (MakeBoolean): New utility function that resolve, implicitly
19403         converts to boolean and tags the expression. 
19404
19405
19406         (If, Do): Implement dead code elimination.
19407         (While): Implement loop inversion
19408
19409         (Do, While, For, If): Resolve the expression prior to calling our
19410         code generation.
19411
19412 2002-04-22  Lawrence Pit <loz@cable.a2000.nl>
19413
19414         * class.cs:
19415           - added method Report28 (warning: program has more than one entry point)
19416           - added method IsEntryPoint, implements paragraph 10.1 of the spec
19417           - modified method Method.Define, the part at the end of the method
19418
19419         * rootcontext.cs: added static public Location EntryPointLocation;
19420           
19421         * ../errors/cs0028.cs : Add test case for the above warning.              
19422
19423         * typemanager.cs:
19424           - modified method CSharpName to allow arrays of primitive type to
19425             be printed nicely (e.g. instead of System.Int32[][] it now prints
19426             int[][])
19427           - added method CSharpSignature: returns the signature of a method
19428             in string format to be used in reporting errors, warnings, etc.
19429
19430         * support.cs: InternalParameters.ParameterDesc variable tmp initialized
19431         with String.Empty.
19432
19433 2002-04-26  Ravi Pratap  <ravi@ximian.com>
19434
19435         * delegate.cs (Define): Fix extremely silly bug where I was
19436         setting the type of the 'object' parameter of the BeginInvoke
19437         method to System.IAsyncResult instead of System.Object ;-)
19438
19439 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
19440
19441         * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
19442         here. 
19443
19444         (Constructor.Emit): return if we fail to initialize the
19445         constructor.  Another door closed!  
19446
19447         * expression.cs (New.DoResolve): Improve error message (from -6 to
19448         1501).  Use DeclaredOnly lookup to find the exact constructor.
19449
19450         * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
19451         loop.  This is useful.
19452
19453         * cs-parser.jay: Adjust the default parameters so that destructors
19454         have the proper signature.
19455
19456 2002-04-26  Martin Baulig  <martin@gnome.org>
19457
19458         * driver.cs (LoadAssembly): If `assembly' contains any characters
19459         which are only valid in path names and not in assembly names
19460         (currently slash, backslash and point), use Assembly.LoadFrom ()
19461         instead of Assembly.Load () on the `assembly' (before iteration
19462         over the link_paths).
19463
19464 2002-04-26  Martin Baulig  <martin@gnome.org>
19465
19466         * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
19467
19468 2002-04-25  Miguel de Icaza  <miguel@ximian.com>
19469
19470         * class.cs (Property): use the new typemanager.MemberLookup
19471
19472         (TypeContainer.MemberLookup): Implement using the
19473         TypeManager.MemberLookup now. 
19474
19475         * typemanager.cs: Make MemberLookup a function of the TypeManager,
19476         and return MemberInfos, so that these can be used without an
19477         EmitContext (what we had before).
19478
19479 2002-04-24  Miguel de Icaza  <miguel@ximian.com>
19480
19481         * expression.cs: Fix the case where the argument to params if the
19482         type of the params.  I omitted handling this before.   Fixed
19483
19484 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
19485
19486         * driver.cs: Call BootCorlib_PopulateCoreType
19487
19488         * class.cs (Property.CheckBase): Check for properties only, not
19489         for all members. 
19490
19491         * interface.cs: Temporary hack: try/catch around the
19492         CustomAttributeBuilder, because I am getting an exception that I
19493         do not understand.
19494
19495         * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
19496         types whose definitions are required to be there (attributes are
19497         defined before standard types).
19498
19499         Compute definitions as we boot the various types, as they are used
19500         immediately (value_type class will need object_type, but if we do
19501         not initialize object_type, we will pass a null, which will let
19502         the runtime pick the System.Object from the existing corlib, which
19503         is not what we want).
19504
19505 2002-04-22  Patrik Torstensson <totte@labs2.com>
19506
19507         * cs-tokenizer.cs: fixed a number of trim() issues.
19508
19509 2002-04-22  Ravi Pratap  <ravi@ximian.com>
19510
19511         * expression.cs (Argument.Type): Ensure that we return the correct
19512         type when we have out or ref parameters [in which case we 
19513         append a "&"].
19514
19515 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
19516
19517         * class.cs (Property, Indexer): Allow extern modifier in there. 
19518
19519         * typemanager.cs (InitBaseTypes): Initializes object_type and
19520         value_type, since those will be used early on during the bootstrap
19521         process to compile corlib.
19522
19523         (InitCoreTypes): Move code from here to InitBaseTypes.
19524
19525 2002-04-21  Miguel de Icaza  <miguel@ximian.com>
19526
19527         * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
19528         single-dimension arrays as using the ldlen opcode.  
19529
19530         Daniel Lewis discovered this optimization.  
19531
19532         * typemanager.cs: Add signature for System.Array::get_Length
19533
19534 2002-04-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19535
19536         * statement.cs: report the error when the foreach does not apply to an
19537         array nor a collection.
19538
19539 2002-04-19  Miguel de Icaza  <miguel@ximian.com>
19540
19541         * expression.cs: Add implicit conversions to the operator ~.
19542
19543         * constant.cs (DecimalConstant.Emit): Emit decimal value.
19544
19545         * typemanager.cs: Locate the decimal constructor.
19546
19547 2002-04-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19548
19549         * attribute.cs: use the new property of TypeOf.
19550         * expression.cs: added 'get' property around typearg.
19551
19552         These changes fix a build breaker reported by NickD. Is this the
19553         correct way to fix?  If not, please, revert my changes and make it
19554         work :-).
19555
19556 2002-04-17  Miguel de Icaza  <miguel@ximian.com>
19557
19558         * attribute.cs: Add support for typeof in attribute invocations.
19559         I am not sure that this is right though.
19560
19561 2002-04-14  Duncan Mak  <duncan@ximian.com>
19562
19563         * cfold.cs (BinaryFold): Catch DivideByZeroException in the
19564         Binary.Operator.Division case.
19565
19566 2002-04-13  Ravi Pratap  <ravi@ximian.com>
19567
19568         * class.cs (DefineType): Ensure that we do a proper check on
19569         attribute types and also register it with the TypeManager.
19570
19571         (TypeContainer.Targets): The default for attribute types is
19572         AttributeTargets.All.
19573
19574         * attribute.cs (ApplyAttributes): Registering the attribute type
19575         is done elsewhere, not when we discover we have a Usage attribute.
19576
19577 2002-04-12  Ravi Pratap  <ravi@ximian.com>
19578
19579         * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
19580         and get rid of is_delegate parameter.
19581
19582         * everywhere : update.
19583
19584 2002-04-12  Ravi Pratap  <ravi@ximian.com>
19585
19586         * cs-parser.jay (compilation_unit): Revamp completely to use
19587         some new ideas that I got from Rhys' grammar to solve the problems
19588         with assembly level attributes.
19589
19590         (outer_declaration): New grammar production.
19591
19592         (attribute_sections): Add.
19593
19594         (opt_attributes): Base on attribute_sections
19595
19596         (namespace_declaration): Allow opt_attributes to tackle the case
19597         when we have assembly level attributes - we are clever in this
19598         regard now ;-)
19599
19600         * attribute.cs (ApplyAttributes): Do not worry about assembly 
19601         attributes in the non-global context.
19602
19603         * rootcontext.cs (AddGlobalAttributes): Go back to using this
19604         instead of SetGlobalAttributes.
19605
19606         * class.cs, rootcontext.cs : Ensure we define and generate 
19607         attribute types before anything else.
19608
19609         * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
19610         and flag the new error -20 for the case when the attribute type
19611         does not have valid targets specified. csc does not catch this.
19612
19613         * ../errors/errors.txt : update for error # -20
19614
19615 2002-04-11  Ravi Pratap  <ravi@ximian.com>
19616
19617         * support.cs (InternalParameters.ParameterModifier): Do some null
19618         checking and return sane values.
19619
19620         * class.cs (Method.Define): If we are a PInvoke method, ensure
19621         that we are static and extern. Report error # 601
19622
19623         * ../errors/cs0601.cs : Add test case for the above error.
19624
19625 2002-04-07  Ravi Pratap  <ravi@ximian.com>
19626
19627         * rootcontext.cs (attribute_types): We need to keep type of
19628         all attribute types separately and emit code for them first.
19629
19630         (RegisterAttribute) : Implement.
19631
19632         * class.cs (DefineType): Check if the current Type is a custom
19633         attribute type and register it accordingly.
19634
19635         * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
19636         adding the first attribute twice and rename to
19637
19638         (SetGlobalAttributes): this.
19639
19640         * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
19641         lookups.
19642
19643         * attribute.cs (ApplyAttributes): Take an additional argument telling us
19644         if we are processing global arguments. Hmm, I am unsure of this.
19645
19646 2002-04-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19647
19648         * expression.cs: added static array of strings to avoid calling
19649         Enum.ToString () for Operator in Binary. Significant recover of
19650         performance.
19651
19652 2002-04-10  Miguel de Icaza  <miguel@ximian.com>
19653
19654         * class.cs (FindMembers): Allow the Builders of the various
19655         members to be null.  If they are skip them.  This only happens
19656         during the PInvoke declaration.
19657
19658 2002-04-09  Miguel de Icaza  <miguel@ximian.com>
19659
19660         * parameter.cs (Parameters.ComputeParameterTypes): Flag the
19661         failure, so we do not keep going afterwards.
19662
19663         * expression.cs: (Invocation.OverloadResolve): I believe Ravi
19664         wanted to pass `false' as the `is_delegate' argument.  If this is
19665         the case, why not use delegate_type == null to mean `is_delegate =
19666         false' and anything else as is_delegate = true.
19667
19668 Tue Apr  9 05:40:12  2002 Piers Haken <piersh@friskit.com>
19669
19670         * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
19671         code for the section, not the beginning of the tests.
19672
19673 2002-04-08  Miguel de Icaza  <miguel@ximian.com>
19674
19675         * cfold.cs: Handle operator + (Enum x, Underlying x) 
19676
19677         * expression.cs (Binary): same.  Warn about errors where we have
19678         Enum/Enum in operator + as well.
19679
19680 Mon Apr  8 06:29:03  2002 Piers Haken <piersh@friskit.com>
19681
19682         * statement.cs:
19683                 - added support for switch(bool)
19684                 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
19685                 - add TableSwitchEmit() to handle table-based switch statements
19686
19687 2002-04-05  Ravi Pratap  <ravi@ximian.com>
19688
19689         * expression.cs (Invocation.OverloadResolve): Factor out code which
19690         does parameter compatibility checking with arguments so that we can 
19691         re-use the code even from Delegate.VerifyApplicability
19692
19693         (VerifyArgumentsCompat): Move above code here.
19694
19695         * delegate.cs (VerifyApplicability): Get rid of duplicate code
19696         and instead make a call to the above method.
19697
19698 2002-03-31  Ravi Pratap  <ravi@ximian.com>
19699
19700         * typemanager.cs (attribute_type): Corresponds to System.Attribute.
19701         We use it to keep track of classes which are attribute types.
19702
19703 2002-04-02  Miguel de Icaza  <miguel@ximian.com>
19704
19705         * delegate.cs (Delegate.Define): Correctly define the types in the
19706         presence of fixed and array parameters.
19707
19708         * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
19709         doing FindMembers.
19710
19711         * ecore.cs (Expression.MemberLookup): Reset binding flags to not
19712         include NonPublic after the first iteration.
19713
19714         * class.cs (Indexer.CheckBase): Only check if both parents are
19715         non-null. 
19716
19717         * cs-parser.jay (accessor_body): If empty, set to null.
19718
19719         * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
19720         same code path here to resolve constants names that we did have in
19721         MemberAccess.DoResolve.  There is too much code duplicated here.
19722
19723 2002-04-01  Miguel de Icaza  <miguel@ximian.com>
19724
19725         * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
19726
19727         * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
19728         to MakeUnionSet.
19729
19730         * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
19731         tokens, numbers and strings.
19732
19733         * ecore.cs (MethodGroupExpr): Make Emit warn about missing
19734         parenthesis.
19735
19736         * delegate.cs: Use ComputeAndDefineParameterTypes for both the
19737         asyncronous parameters and the regular parameters.  
19738
19739         * codegen.cs (CodeGen.Init): Use the constructor that allows us to
19740         specify the target directory.
19741
19742         * expression.cs: (This.DoResolve): Simplify
19743         (As.Emit): Optimize, do not generate IsInst if the expression is
19744         always of the given type.
19745
19746         (Is.DoResolve): Bug fix, we were reporting both always/never for
19747         the is expression.
19748
19749         * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
19750         creating too many unnecessary arrays.
19751
19752 2002-03-31  Miguel de Icaza  <miguel@ximian.com>
19753
19754         * class.cs (EmitFieldInitializer): Use Assign expression to assign
19755         fields instead of rolling our own initializer.   Takes care of all
19756         implicit conversions, and drops unnecessary static checks/argument.
19757
19758 2002-03-31  Dick Porter  <dick@ximian.com>
19759
19760         * driver.cs: use the GetDirectories() return values properly, and
19761         use "/" as path separator.
19762
19763 2002-03-30  Miguel de Icaza  <miguel@ximian.com>
19764
19765         * expression.cs (Unary): Optimize - - expr into expr.
19766         (Binary): Optimize a + (-b) into a -b.
19767
19768         * codegen.cs (CodeGen): Made all methods static.
19769
19770 2002-03-29  Miguel de Icaza  <miguel@ximian.com>
19771
19772         * rootcontext.cs: 
19773
19774         * decl.cs: Rename `definition' into `TypeBuilder' and drop the
19775         TypeBuilder property.
19776
19777         * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
19778         instead. 
19779
19780         * tree.cs: Removed the various RecordXXXX, and replaced with a
19781         single RecordDecl.  Removed all the accessor methods, and just
19782         left a single access point Type 
19783
19784         * enum.cs: Rename DefineEnum to DefineType.
19785
19786         * decl.cs: New abstract method `DefineType' used to unify the
19787         Defines for Enumerations, Interfaces, TypeContainers and
19788         Delegates.
19789
19790         (FindType): Moved LookupInterfaceOrClass here.  Moved the
19791         LookupBaseClasses method that used to live in class.cs and
19792         interface.cs here, and renamed to FindType.
19793
19794         * delegate.cs: Implement DefineType.  Take advantage of the
19795         refactored pattern for locating the parent builder without taking
19796         the parent_builder argument (which we know does not work if we are
19797         nested, and triggering a toplevel definition).
19798
19799 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
19800
19801         * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
19802         accessibility of a member has changed during override and report
19803         an error if so.
19804
19805         * class.cs (Method.Define, Property.Define): Only complain on
19806         overrides if the method is private, any other accessibility is
19807         fine (and since we just checked the permission is the same, we are
19808         good to go).
19809
19810         * cs-tokenizer.cs: only line, region, endregion, if, endif, else
19811         and elif are processed always.  The other pre-processing
19812         directives are only processed if we are "taking" the path
19813
19814 2002-03-29  Martin Baulig  <martin@gnome.org>
19815
19816         * class.cs (Method.Emit): Only emit symbolic debugging info if the
19817         current location is not Null.
19818
19819         * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
19820         a separate method so we can profile it.
19821
19822         * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
19823         `span.Seconds' are just seconds, but no minutes or hours.
19824         (MainDriver): Profile the CodeGen.SaveSymbols calls.
19825
19826 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
19827
19828         * class.cs (Method.Define), (Property.Define), (Indexer.Define):
19829         Remove the gratuitous set of Final:
19830
19831                                 // If an interface implementation, then we can set Final.
19832                                 if (((flags & MethodAttributes.Abstract) == 0) &&
19833                                     implementing.DeclaringType.IsInterface)
19834                                         flags |= MethodAttributes.Final;
19835
19836         I do not know what I was smoking when I used that.
19837
19838
19839         * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
19840         step into fixing the name resolution issues for delegates and
19841         unifying the toplevel name resolution.
19842
19843 2002-03-28  Martin Baulig  <martin@gnome.org>
19844
19845         * class.cs (Method.Emit): If we have a symbol writer, call its
19846         OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
19847         tell it about the current method.
19848
19849         * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
19850         writer that we're going to emit the first byte of IL code for a new
19851         statement (a new source line).
19852         (EmitContext.EmitTopBlock): If we have a symbol writer, call
19853         EmitContext.Mark() before emitting any code.
19854
19855         * location.cs (SymbolDocument): Return null when we're Null.
19856
19857         * statement.cs (Statement): Moved the `Location loc' variable here.
19858         (Statement.EmitBoolExpression): If we have a symbol writer, call
19859         ec.Mark() before emitting any code to tell it that we're at the
19860         beginning of a new statement.
19861         (StatementExpression): Added `Location' argument to the constructor.
19862         (Block): Added public readonly variable `StartLocation' and public
19863         variable `EndLocation'.  The latter is to be set using SetEndLocation().
19864         (Block): Added constructor which takes a start and end location.
19865         (Block.SetEndLocation): New method. This sets the end location.
19866         (Block.EmitMeta): If we have a symbol writer, tell it the names of the
19867         local variables we create.
19868         (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
19869         each statement and do also mark the begin and end of the block.
19870
19871         * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
19872         tell it the current lexer.Location, use Location.Null for the end of the
19873         block.
19874         (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
19875         current block, set its end location using SetEndLocation().
19876         (statement_expression): StatementExpression constructor now takes the
19877         lexer.Location as additional argument.
19878         (for_statement, declare_local_variables): Likewise.
19879         (declare_local_variables): When creating a new implicit block, use the
19880         new Block constructor and pass it the lexer.Location.
19881
19882 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
19883
19884         * ecore.cs (Expression.MemberLookup): On interfaces, lookup
19885         members also on the parent interfaces recursively.
19886
19887 2002-03-27  Miguel de Icaza  <miguel@ximian.com>
19888
19889         * report.cs: Use new formats, since Gonzalo finished the missing
19890         bits. 
19891
19892         * expression.cs (Binary.ResolveOperator): added missing operator|
19893         operator& and operator^ for bool/bool.
19894
19895         * cs-parser.jay: CheckDef now takes a Location argument that is
19896         used to report errors more precisly (instead of reporting the end
19897         of a definition, we try to track something which is a lot closer
19898         to the source of the problem).
19899
19900         * cs-tokenizer.cs: Track global token use, so we can properly flag
19901         the use of #define/#undef after the first token has been seen.
19902
19903         Also, rename the reportXXXX to Error_DescriptiveName
19904
19905         * decl.cs (DeclSpace.IsTopLevel): Move property here from
19906         TypeContainer, so that Enum and Interface can use this too.
19907
19908         * class.cs (TypeContainer.LookupInterfaceOrClass,
19909         GetInterfaceOrClass, GetClassBases, DefineType): Drop the
19910         `builder' argument.  Typically this was used to pass the parent
19911         builder (a ModuleBuilder or a TypeBuilder from whoever triggered
19912         the definition).  
19913
19914         The problem is that a nested class could trigger the definition of
19915         a toplevel class, and the builder would be obviously wrong in that
19916         case. 
19917
19918         So we drop this argument, and we compute dynamically the
19919         TypeBuilder/ModuleBuilder (the correct information was available
19920         to us anyways from DeclSpace.Parent)
19921
19922         * interface.cs (Interface.DefineInterface): Drop builder
19923         parameter cleanup like class.cs
19924
19925         * enum.cs (Enum.DefineEnum): Drop builder parameter.  Clean up
19926         like class.cs
19927
19928         * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
19929         values. 
19930
19931         (Try.Emit): Propagate the returns value from the statement.
19932
19933         (Return.Emit): Even if we are leavning 
19934
19935         * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
19936
19937         * modifiers.cs: Fix the computation of MethodAttributes flags.
19938
19939 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
19940
19941         * driver.cs: allow compilation of files that start with '/'.
19942         Add a default case when checking the argument of --target.
19943
19944 2002-03-25  Miguel de Icaza  <miguel@ximian.com>
19945
19946         * interface.cs: Implement the same search algorithm for types in
19947         the interface code.
19948
19949         * delegate.cs: Do not allow multiple definition.
19950
19951         * Recovered ChangeLog that got accidentally amputated
19952
19953         * interface.cs (Interface.DefineInterface): Prevent from double definitions.
19954
19955         * rootcontext.cs: Load manually enum to allow core classes to
19956         contain enumerations.
19957
19958         * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
19959         Update to new static methods in TypeManager.
19960
19961         * typemanager.cs (GetMethod, GetConstructor): Use our
19962         implementation of FindMembers to find the members, since during
19963         corlib compilation, the types are TypeBuilders and GetMethod and
19964         GetConstructor do not work.
19965
19966         Make all methods in TypeManager static.
19967
19968         (InitCodeHelpers): Split the functionality from
19969         the InitCodeTypes function.
19970
19971         * driver.cs: Call InitCodeHelpers after we have populated the
19972         types. 
19973
19974         * cs-parser.jay (delegate_declaration): we did not used to compute
19975         the delegate name correctly for void delegates.
19976
19977 2002-03-24  Miguel de Icaza  <miguel@ximian.com>
19978
19979         * rootcontext.cs (RootContext): Init the interface_resolve_order
19980         and type_container_resolve_order always.
19981
19982         (ResolveCore, BootstrapCorlib_ResolveClass,
19983         BootstrapCorlib_ResolveStruct): New functions to bootstrap the
19984         compiler when compiling with --nostdlib
19985
19986         * class.cs (TypeContainer.DefineType): Check that our parent is
19987         not null.  This test is most important when we are bootstraping
19988         the core types.
19989
19990         * codegen.cs: Split out the symbol writing code.
19991
19992 2002-03-25  Martin Baulig  <martin@gnome.org>
19993
19994         * driver.cs (-g): Made -g an alias for --debug.
19995
19996 2002-03-24  Martin Baulig  <martin@gnome.org>
19997
19998         * codegen.cs (SymbolWriter): New public variable. Returns the
19999         current symbol writer.
20000         (CodeGen): Added `bool want_debugging_support' argument to the
20001          constructor. If true, tell the ModuleBuild that we want debugging
20002         support and ask it for the ISymbolWriter.
20003         (Save): If we have a symbol writer, call it's Close() method after
20004         saving the assembly.
20005
20006         * driver.c (--debug): New command line argument to create a
20007         debugger information file.
20008
20009         * location.cs (SymbolDocument): New public property. Returns an
20010         ISymbolDocumentWriter object for the current source file or null
20011         if we don't have a symbol writer.
20012
20013 2002-03-21  Miguel de Icaza  <miguel@ximian.com>
20014
20015         * driver.cs (LoadAssembly): Correctly return when all the paths
20016         have been tried and not before.
20017
20018         * statement.cs (Switch.Emit): return the actual coverage for this
20019         statement (returns/not-returns)
20020
20021         (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
20022         switch of the statement if we are the last switch section.  That
20023         kills two problems: try/catch problems (we used to emit an empty
20024         nop at the end) and switch statements where all branches would
20025         return. 
20026
20027 2002-03-19  Miguel de Icaza  <miguel@ximian.com>
20028
20029         * driver.cs: Add default assemblies (the equivalent to the
20030         Microsoft CSC.RSP file)
20031
20032         * cs-tokenizer.cs: When updating `cols and setting it to zero,
20033         also update tokens_seen and set it to false.
20034
20035         * driver.cs: Implement --recurse for Mike.
20036
20037         * driver.cs (SplitPathAndPattern): Small bug fix, I was not
20038         correctly splitting out the paths.
20039
20040 2002-03-18  Miguel de Icaza  <miguel@ximian.com>
20041
20042         * interface.cs (Interface.PopulateProperty): Instead of using
20043         `parent' as the declaration space for the set parameters, use
20044         `this' 
20045
20046         * support.cs (InternalParameters): InternalParameters constructor
20047         takes a DeclSpace instead of a TypeContainer.
20048
20049         * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
20050         types are being initialized, load the address of it before calling
20051         the function.  
20052
20053         (New): Provide a mechanism to disable the generation of local
20054         value type temporaries when the caller will be providing us with
20055         an address to store it.
20056
20057         (ArrayCreation.EmitDynamicInitializers): Use it.
20058
20059 2002-03-17  Miguel de Icaza  <miguel@ximian.com>
20060
20061         * expression.cs (Invocation.EmitArguments): Only probe for array
20062         property if there is more than one argument.  Sorry about that.
20063
20064         * class.cs (Invocation.EmitArguments): Fix to emit arguments for
20065         empty param arrays.
20066
20067         * class.cs (Method.LabelParameters): Fix incorrect code path that
20068         prevented the `ParamArrayAttribute' from being applied to the
20069         params attribute.
20070
20071 2002-03-16  Miguel de Icaza  <miguel@ximian.com>
20072
20073         * support.cs (ReflectionParameters): Correctly compute whether the
20074         last argument is a params array.  Fixes the problem with
20075         string.Split ('a')
20076
20077         * typemanager.cs: Make the assemblies array always be non-null
20078         (empty, but non-null)
20079
20080         * tree.cs (RecordDecl): New function that abstracts the recording
20081         of names.  This reports error 101, and provides a pointer to the
20082         previous declaration.  Fixes a crash in the compiler.
20083
20084         * cs-parser.jay (constructor_declaration): Update to new grammar,
20085         and provide a constructor_body that can be empty.
20086
20087 2002-03-15  Miguel de Icaza  <miguel@ximian.com>
20088
20089         * driver.cs: Add support for --resources.
20090
20091         * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
20092         Make all types for the various array helper methods be integer.
20093
20094         * ecore.cs (Expression.ConvertNumericExplicit): Pass the
20095         CheckState to ConvCast.
20096
20097         (ConvCast): Now it takes a `checked' state argument, to avoid
20098         depending on the emit context for the conversion, and just using
20099         the resolve time setting.
20100
20101         * expression.cs (ArrayCreation.EmitArrayArguments): New function,
20102         instead of Invocation.EmitArguments.  We do not emit the original
20103         arguments, instead we emit those which have been converted to
20104         unsigned int expressions.
20105
20106         * statement.cs (Block.EmitMeta): Drop tracking of indexes.
20107
20108         * codegen.cs: ditto.
20109
20110         * expression.cs (LocalVariableReference): Drop the use of the
20111         Store function that depended on the variable index.
20112
20113         * statement.cs (VariableInfo): Drop the `Idx' property from this
20114         class, as this is not taking into account the indexes for
20115         temporaries tat we generate during the execution, getting the
20116         indexes wrong.
20117
20118         * class.cs: First emit class initializers, then call the parent
20119         constructor. 
20120
20121         * expression.cs (Binary): Fix opcode emision.
20122         (UnaryMutator.EmitCode): Support checked code generation
20123
20124         * ecore.cs (MemberLookup): TypeManager.FindMembers will return
20125         matches for events for both the Static and Instance scans,
20126         pointing to the same element.   Fix that.
20127
20128 2002-03-14  Miguel de Icaza  <miguel@ximian.com>
20129
20130         * rootcontext.cs (ResolveTree): Always set the
20131         interface_resolve_order, because nested interfaces will be calling
20132         into us.
20133
20134         * class.cs (GetInterfaceOrClass): Track the same resolution
20135         process used by TypeManager.LookupType.  This fixes the nested
20136         type lookups in class declarations (separate path from
20137         LookupType). 
20138
20139         (TypeContainer.DefineType): Also define nested interfaces.
20140         (TypeContainer.RegisterOrder): New public function used to
20141         register the order in which child interfaces need to be closed.
20142
20143         Nested interfaces need to be closed after their parents have been
20144         created. 
20145
20146         * interface.cs (InterfaceAttr): Put all the logic for computing
20147         the interface attribute here. 
20148
20149         (DefineInterface): Register our interface order with the
20150         RootContext or with the TypeContainer depending on the case.
20151
20152 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
20153
20154         * cs-parser.jay: rework foreach statement to work with the new
20155         changes to the policy on SimpleNames.
20156
20157         * report.cs: support Stacktrace on warnings as well.
20158
20159         * makefile: drop --unsafe and /unsafe from the compile.
20160
20161 2002-03-13  Ravi Pratap  <ravi@ximian.com>
20162
20163         * ecore.cs (StandardConversionExists): Modify to take an Expression
20164         as the first parameter. Ensure we do null -> reference type conversion
20165         checking.
20166
20167         * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
20168         temporary Expression objects.
20169
20170 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
20171
20172         * interface.cs: workaround bug in method overloading resolution
20173         (there is already a bugzilla bug for it).
20174
20175 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
20176
20177         We could also solve this problem by having a separate path for
20178         performing type lookups, instead of DoResolve, we could have a
20179         ResolveType entry point, and only participating pieces of the
20180         production (simplename, deref, array) would implement this. 
20181
20182         * codegen.cs (EmitContext): New field OnlyLookupTypes used to
20183         signal SimpleName to only resolve type names and not attempt to
20184         resolve anything else.
20185
20186         * expression.cs (Cast): Set the flag.
20187
20188         * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
20189
20190         * class.cs: Only report 108 if there is no `new' modifier.
20191
20192         * cs-parser.jay: rework foreach statement to work with the new
20193         changes to the policy on SimpleNames.
20194
20195         * report.cs: support Stacktrace on warnings as well.
20196
20197         * makefile: drop --unsafe and /unsafe from the compile.
20198
20199 2002-03-11  Miguel de Icaza  <miguel@ximian.com>
20200
20201         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
20202         lookups here, instead of doing that at parse time.  This means
20203         that our grammar will not introduce `LocalVariableReferences' as
20204         expressions at this point.  That solves the problem of code like
20205         this:
20206
20207         class X {
20208            static void Main ()
20209            { int X = 1;
20210             { X x = null }}}
20211
20212         This is only half the fix.  The full fix requires parameters to
20213         also be handled in this way.
20214
20215         * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
20216         makes the use more obvious of the DeclSpace.  The
20217         ec.TypeContainer.TypeBuilder is now only used to pull the
20218         TypeBuilder for it.
20219
20220         My theory is that I can get rid of the TypeBuilder completely from
20221         the EmitContext, and have typecasts where it is used (from
20222         DeclSpace to where it matters).  
20223
20224         The only pending problem is that the code that implements Aliases
20225         is on TypeContainer, and probably should go in DeclSpace.
20226
20227         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
20228         lookups here, instead of doing that at parse time.  This means
20229         that our grammar will not introduce `LocalVariableReferences' as
20230         expressions at this point.  That solves the problem of code like
20231         this:
20232
20233         class X {
20234            static void Main ()
20235            { int X = 1;
20236             { X x = null }}}
20237
20238         This is only half the fix.  The full fix requires parameters to
20239         also be handled in this way.
20240
20241         * class.cs (Property.DefineMethod): When implementing an interface
20242         method, set newslot, when implementing an abstract method, do not
20243         set the flag (before we tried never setting it, or always setting
20244         it, which is the difference).
20245         (Indexer.DefineMethod): same.
20246         (Method.DefineMethod): same.
20247
20248         * ecore.cs: Only set the status used flag if we get back a Field.
20249
20250         * attribute.cs: Temporary hack, so Paolo can keep working.
20251
20252 2002-03-08  Ravi Pratap  <ravi@ximian.com>
20253
20254         * attribute.cs (Attribute.UnmanagedType): This is to keep track of
20255         the unmanaged type in the case we have a MarshalAs attribute.
20256
20257         (Resolve): Handle the case when we are parsing the special MarshalAs
20258         attribute [we need to store the unmanaged type to use later]
20259
20260         * typemanager.cs (marshal_as_attr_type): Built in type for the 
20261         MarshalAs Attribute.
20262
20263         * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute 
20264         on parameters and accordingly set the marshalling info.
20265
20266 2002-03-09  Miguel de Icaza  <miguel@ximian.com>
20267
20268         * class.cs: Optimizing slightly by removing redundant code after
20269         we switched to the `NoTypes' return value.
20270         (Property.DefineMethod): use NoTypes here too.
20271
20272         This fixes the bug I introduced in my last batch of changes.
20273
20274 2002-03-05  Ravi Pratap  <ravi@ximian.com>
20275
20276         * tree.cs (RecordEnum): Add. We now keep track of enums too.
20277
20278         * class.cs (LookupInterfaceOrClass): Check against the list of recorded
20279         Enums since those are types too. 
20280
20281         * cs-parser.jay (enum_declaration): Record enums as we parse them.
20282
20283         * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined 
20284         thanks to a call during the lookup process.
20285
20286 2002-03-07  Miguel de Icaza  <miguel@ximian.com>
20287
20288         * statement.cs (Foreach): Lots of work to accomodate a particular
20289         kind of foreach statement that I had not kept in mind.  It is
20290         possible to have foreachs on classes that provide a GetEnumerator
20291         method that return objects that implement the "pattern" for using
20292         a foreach, there is no need to support GetEnumerator
20293         specifically. 
20294
20295         This is needed to compile nant.
20296
20297         * decl.cs: Only report 114 if the member is not `Finalize' and if
20298         the warning level is at least 2.
20299
20300         * class.cs: Moved the compare function from Method to
20301         MethodSignature. 
20302
20303         (MethodSignature.InheritableMemberSignatureCompare): Add new
20304         filter function that is used to extract inheritable methods from a
20305         class. 
20306
20307         (Method.Define): Use the new `inheritable_method_signature_filter'
20308         delegate
20309
20310         * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
20311         command. 
20312
20313 2002-03-06  Miguel de Icaza  <miguel@ximian.com>
20314
20315         * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
20316
20317         * cs-parser.jay: Add opt_semicolon to the interface declaration.
20318
20319         * expression.cs: Pass location information to
20320         ConvertImplicitStandard. 
20321
20322         * class.cs: Added debugging code to track return values from
20323         interfaces. 
20324
20325 2002-03-05  Miguel de Icaza  <miguel@ximian.com>
20326
20327         * expression.cs (Is.DoResolve): If either side of the `is' is an
20328         interface, do not flag the warning.
20329
20330         * ecore.cs (ImplicitReferenceConversion): We need a separate test
20331         for interfaces
20332
20333         * report.cs: Allow for --fatal to be used with --probe.
20334
20335         * typemanager.cs (NoTypes): Move the definition for the empty Type
20336         array here. 
20337
20338         * class.cs (TypeContainer.FindMembers): Also look for methods defined by
20339         properties. 
20340         (TypeContainer.DefineProxy): New function used to proxy to parent
20341         implementations when implementing interfaces.
20342         (TypeContainer.ParentImplements): used to lookup if our parent
20343         implements a public function that is required by an interface.
20344         (TypeContainer.VerifyPendingMethods): Hook this up.
20345
20346         * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
20347         `modules' and `assemblies' arraylists into arrays.  We only grow
20348         these are the very early start up of the program, so this improves
20349         the speedof LookupType (nicely measured).
20350
20351         * expression.cs (MakeByteBlob): Replaced unsafe code with
20352         BitConverter, as suggested by Paolo.
20353
20354         * cfold.cs (ConstantFold.Binary): Special case: perform constant
20355         folding of string concatenation, but if either side is a string,
20356         and the other is not, then return null, and let the runtime use
20357         the concatenation on the string plus the object (using
20358         `Object.ToString'). 
20359
20360 2002-03-04  Miguel de Icaza  <miguel@ximian.com>
20361
20362         Constant Folding has been implemented now.
20363
20364         * expression.cs (Unary.Reduce): Do not throw an exception, catch
20365         the error instead on types that are not supported in one's
20366         complement. 
20367
20368         * constant.cs (Constant and all children): New set of functions to
20369         perform implict and explicit conversions.
20370
20371         * ecore.cs (EnumConstant): Implement the new functions to perform
20372         conversion by proxying to the child expression.
20373
20374         * codegen.cs: (ConstantCheckState): Constant evaluation has its
20375         own separate setting that can not be turned off from the command
20376         line using --unchecked or --checked and is only controlled using
20377         the checked/unchecked statements and expressions.  This setting is
20378         used by the constant folder to flag errors.
20379
20380         * expression.cs (CheckedExpr, UncheckedExpr): Set the
20381         ConstantCheckState as well.   
20382
20383         During Resolve, they also have to flag the state, because the
20384         constant folder runs completely in the Resolve phase.
20385
20386         * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
20387         well.
20388
20389 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
20390
20391         * cfold.cs: New file, this file contains the constant folder.
20392
20393         * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
20394         argument to track whether we are using the resulting address to
20395         load or store a value and provide better error messages. 
20396
20397         (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
20398         new AddressOf arguments.
20399
20400         * statement.cs (Foreach.EmitCollectionForeach): Update
20401
20402         * expression.cs (Argument.Emit): Call AddressOf with proper
20403         arguments to track usage.
20404
20405         (New.DoEmit): Call AddressOf with new arguments.
20406
20407         (Unary.Emit): Adjust AddressOf call.
20408
20409 2002-03-01  Ravi Pratap  <ravi@ximian.com>
20410
20411         * cs-parser.jay (member_access): Change the case for pre-defined types
20412         to use a MemberAccess instead of a SimpleName. Thanks to Felix again for 
20413         this suggestion.
20414
20415         * class.cs (Operator::Emit): If we are abstract or extern, we don't have
20416         a method body.
20417
20418         * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
20419         essentially like methods and apply attributes like MethodImplOptions to them too.
20420
20421         * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
20422         not being null.
20423
20424         * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
20425         DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
20426         is the DeclSpace.
20427
20428         * Update code everywhere accordingly.
20429
20430         * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
20431
20432         * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
20433
20434 2002-02-28  Ravi Pratap  <ravi@ximian.com>
20435
20436         * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
20437         try performing lookups against those instead of jumping straight into using
20438         the 'using' clauses.
20439
20440         (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
20441
20442         (LookupType): Perform lookups in implicit parents too.
20443
20444         * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
20445         sequence as RootContext.LookupType. 
20446
20447         * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries 
20448         the various cases of namespace lookups into this method.
20449
20450 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
20451
20452         * cs-parser.jay: Add support for [Attribute ()] (empty arguments
20453         in positional arguments)
20454
20455         * class.cs (Operator): Update the AllowedModifiers to contain
20456         extern. 
20457
20458         * cs-parser.jay: Update operator declaration to allow for the
20459         operator body to be empty.
20460
20461         * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
20462         values. 
20463
20464 2002-02-27  Miguel de Icaza  <miguel@ximian.com>
20465
20466         * class.cs (Method.Emit): Label parameters.
20467
20468         * driver.cs: Return 1 or 0 as the program exit code.
20469
20470 2002-02-26  Miguel de Icaza  <miguel@ximian.com>
20471
20472         * expression.cs: Special case the `null' object when trying to
20473         auto-compute the type, as anything can be explicitly converted to
20474         that. 
20475
20476         * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
20477         spotting this Paolo.
20478
20479         (Expression.ImplicitNumericConversion): Perform comparissions of
20480         the type using the underlying type in the case of an enumeration
20481         rather than using the enumeration type for the compare.
20482
20483         Cope with the underlying == type case, which is not possible to
20484         catch before. 
20485
20486         (Expression.ConvertNumericExplicit): Perform comparissions of
20487         the type using the underlying type in the case of an enumeration
20488         rather than using the enumeration type for the compare.
20489
20490         * driver.cs: If the user does not supply an extension, assume .exe
20491
20492         * cs-parser.jay (if_statement): Rewrote so that we can track the
20493         location for the if statement.
20494
20495         * expression.cs (Binary.ConstantFold): Only concat strings when
20496         the operation is "+", not everything ;-)
20497
20498         * statement.cs (Statement.EmitBoolExpression): Take a location
20499         argument. 
20500         (If, While, Do): Track location.
20501
20502         * expression.cs (Binary.ResolveOperator): In the object + string
20503         case, I was missing a call to ConvertImplicit
20504
20505 2002-02-25  Ravi Pratap  <ravi@ximian.com>
20506
20507         * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
20508         Location arguments. Ensure we use RootContext.LookupType to do our work
20509         and not try to do a direct Type.GetType and ModuleBuilder.GetType
20510
20511         * interface.cs (PopulateMethod): Handle the type of the parameter being
20512         null gracefully.
20513
20514         * expression.cs (Invocation.BetterFunction): Handle the case when we 
20515         have a params method with no fixed arguments and a call is made with no
20516         arguments.
20517
20518 2002-02-25  Miguel de Icaza  <miguel@ximian.com>
20519
20520         * cs-tokenizer.cs: Add support for the quote-escape-sequence in
20521         the verbatim-string-literal
20522
20523         * support.cs (InternalParameters.ParameterModifier): handle null
20524         fixed parameters.
20525         (InternalParameters.ParameterType): ditto.
20526
20527         * parameter.cs (VerifyArgs): Also check if the fixed parameter is
20528         duplicating the name of the variable parameter.
20529         (GetParameterByName): Fix bug where we were not looking up array
20530         paramters if they were the only present (thanks Paolo!).
20531         (GetParameterInfo): We only have an empty set of types if both
20532         fixed and array are set to null.
20533         (GetParameterInfo-idx): Handle FixedParameter == null
20534
20535         * cs-parser.jay: Handle the case where there is no catch
20536         statements (missing null test).
20537
20538 2002-02-22  Miguel de Icaza  <miguel@ximian.com>
20539
20540         * driver.cs (MainDriver): Be conservative on our command line
20541         handling.
20542
20543         Catch DirectoryNotFoundException when calling GetFiles.
20544
20545         (SplitPathAndPattern): Used to split the input specification into
20546         a path and a pattern that we can feed to Directory.GetFiles.
20547
20548 2002-02-21  Miguel de Icaza  <miguel@ximian.com>
20549
20550         * statement.cs (Fixed): Implement the last case of the Fixed
20551         statement (string handling).
20552
20553         * expression.cs (StringPtr): New class used to return a char * to
20554         a string;  Used by the Fixed statement.
20555
20556         * typemanager.cs: Add char_ptr_type.  Add get_OffsetToStringData method.
20557
20558         * expression.cs (Binary.ResolveOperator): Remove redundant
20559         MemberLookup pn parent type.
20560         Optimize union call, we do not need a union if the types are the same.
20561         (Unary.ResolveOperator): REmove redundant MemberLookup on parent
20562         type.
20563
20564         Specialize the use of MemberLookup everywhere, instead of using
20565         the default settings. 
20566
20567         (StackAlloc): Implement stackalloc keyword.
20568
20569         * cs-parser.jay: Add rule to parse stackalloc.
20570
20571         * driver.cs: Handle /h, /help, /?
20572
20573         * expression.cs (MakeByteBlob): Removed the hacks we had in place
20574         before we supported unsafe code.
20575
20576         * makefile: add --unsafe to the self compilation of mcs.
20577
20578 2002-02-20  Miguel de Icaza  <miguel@ximian.com>
20579
20580         * expression.cs (PointerArithmetic): New class that is used to
20581         perform pointer arithmetic.
20582         (Binary.Resolve): Handle pointer arithmetic
20583         Handle pointer comparission.
20584         (ArrayPtr): Utility expression class that is used to take the
20585         address of an array.
20586
20587         (ElementAccess): Implement array access for pointers
20588
20589         * statement.cs (Fixed): Implement fixed statement for arrays, we
20590         are missing one more case before we are done.
20591
20592         * expression.cs (Indirection): Implement EmitAssign and set the
20593         ExprClass to Variable.  This allows pointer dereferences to be
20594         treated as variables, and to have values assigned to them.
20595
20596         * ecore.cs (Expression.StoreFromPtr): New utility function to
20597         store values dereferencing.
20598
20599 2002-02-20  Ravi Pratap  <ravi@ximian.com>
20600
20601         * expression.cs (Binary.ResolveOperator): Ensure that we are
20602         not trying to operate on a void type - this fixes the reported
20603         bug.
20604
20605         * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
20606         the parent implementation is sealed.
20607
20608         * ../errors/cs0239.cs : Add.
20609
20610         * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
20611
20612         * typemanager.cs (unverifiable_code_type): Corresponds to 
20613         System.Security.UnverifiableCodeAttribute. We need to emit this for modules
20614         which have unsafe code in them.
20615
20616         * rootcontext.cs (EmitCode): Emit the above attribute when we are in an 
20617         unsafe context.
20618
20619 2002-02-19  Miguel de Icaza  <miguel@ximian.com>
20620
20621         * cs-tokenizer.cs: Add support for @"litreal strings"
20622
20623         Make tokenizer accept pre-processor directives
20624         on any column (remove the old C-like limitation). 
20625
20626         * rootcontext.cs (EmitCode): Emit any global attributes.
20627         (AddGlobalAttributes): Used to keep track of assembly attributes. 
20628
20629         * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
20630
20631         * cs-parser.jay: Add support for global attributes.  
20632
20633 2002-02-17  Miguel de Icaza  <miguel@ximian.com>
20634
20635         * expression.cs (Indirection): New helper class.  Unary will
20636         create Indirection classes to be able to implement the
20637         IMemoryLocation interface on it.
20638
20639 2002-02-16  Miguel de Icaza  <miguel@ximian.com>
20640
20641         * cs-parser.jay (fixed_statement): reference the right statement.
20642
20643         * statement.cs (Fixed.Emit): Finish implementing the fixed
20644         statement for the &x case.
20645
20646 2002-02-14  Miguel de Icaza  <miguel@ximian.com>
20647
20648         * class.cs (Property.Define, Method.Define): Remove newslot when
20649         `implementing'.  
20650
20651         * modifiers.cs: My use of NewSlot when `Abstract' was set was
20652         wrong.  NewSlot should only be used if the `new' keyword is present.
20653
20654         * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
20655         locating our system dir.  Sorry about this.
20656
20657 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
20658
20659         * driver.cs (GetSystemDir): Compute correctly the location of our
20660         system assemblies.  I was using the compiler directory instead of
20661         the library directory.
20662
20663 2002-02-13  Ravi Pratap  <ravi@ximian.com>
20664
20665         * expression.cs (BetterFunction): Put back in what Miguel commented out
20666         since it is the correct fix. The problem is elsewhere ;-)
20667
20668         (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
20669         parameters of the parms method are themselves compatible or not !
20670
20671         (StandardConversionExists): Fix very dangerous bug where we were forgetting
20672         to check that a class implements an interface before saying that an implicit
20673         conversion was allowed. Use ImplementsInterface to do the checking.
20674
20675 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
20676
20677         * class.cs (Method.Define): Track whether we are an explicit
20678         implementation or not.  And only call DefineMethodOverride if we
20679         are an explicit implementation.
20680
20681         (Property.DefineMethod): Ditto.
20682
20683 2002-02-11  Ravi Pratap  <ravi@ximian.com>
20684
20685         * expression.cs (BetterFunction): Catch hideous bug which was
20686          preventing us from detecting ambiguous calls due to implicit casts i.e
20687         cs0121.
20688
20689 2002-01-29  Miguel de Icaza  <miguel@ximian.com>
20690
20691         * support.cs (Pair): Remove un-needed method.  I figured why I was
20692         getting the error in cs-parser.jay, the variable in a foreach loop
20693         is readonly, and the compiler does not really treat this as a variable.
20694
20695         * cs-parser.jay (fixed_statement): Fix grammar.  Use ASSIGN
20696         instead of EQUALS in grammar.  
20697
20698         * typemanager.cs (VerifyUnmanaged): Report correct error (208)
20699
20700         * expression.cs (Unary.DoResolve): Check whether the argument is
20701         managed or not.
20702
20703 2002-01-28  Miguel de Icaza  <miguel@ximian.com>
20704
20705         * support.cs: Api for Pair to set a value.  Despite the fact that
20706         the variables are public the MS C# compiler refuses to compile
20707         code that accesses the field if the variable is part of a foreach
20708         statement. 
20709
20710         * statement.cs (Fixed): Begin implementation of the fixed
20711         statement.
20712
20713         (Block.AddVariable): Return the VariableInfo on success and null
20714         on failure instead of true/false. 
20715
20716         * cs-parser.jay (foreach): Catch errors on variables already
20717         defined (we were ignoring this value before) and properly unwind
20718         the block hierarchy
20719
20720         (fixed_statement): grammar for the fixed statement.
20721
20722 2002-01-25  Miguel de Icaza  <miguel@ximian.com>
20723
20724         * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
20725         pointer types to be incretemented.
20726
20727         (SizeOf): Implement.
20728
20729         * cs-parser.jay (pointer_member_access): Implement
20730         expr->IDENTIFIER production.
20731
20732         * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
20733         MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
20734         on safe contexts.
20735
20736         (Unary): Implement indirection.
20737
20738         * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
20739         use in non-unsafe context).
20740
20741         (SimpleName.DoResolve): Check for pointers in field access on safe
20742         contexts. 
20743
20744         (Expression.LoadFromPtr): Factor the load-indirect code in this
20745         function.  This was duplicated in UnboxCast and ParameterReference
20746
20747 2002-01-24  Miguel de Icaza  <miguel@ximian.com>
20748
20749         * expression.cs (ComposedCast): report an error if a pointer cast
20750         is used in a safe region.
20751
20752         * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
20753         pointer type casts in unsafe context.
20754
20755         * codegen.cs (EmitContext): Set up IsUnsafe.
20756
20757         * cs-parser.jay (non_expression_type): Add productions for pointer
20758         casts. 
20759
20760         * expression.cs (Invocation.EmitCall): Remove chunk of buggy
20761         code.  We should not use force into static mode if the method is
20762         not virtual.  Fixes bug in MIS
20763
20764         * statement.cs (Do.Emit, While.Emit, For.Emit,
20765         Statement.EmitBoolExpression): Add support to Do and While to
20766         propagate infinite loop as `I do return' semantics.
20767
20768         Improve the For case to also test for boolean constants.
20769
20770         * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
20771         to the list of attributes we can add.
20772
20773         Remove `EmitContext' argument.
20774
20775         * class.cs (Method.Define): Apply parameter attributes.
20776         (Constructor.Define): Apply parameter attributes.
20777         (MethodCore.LabelParameters): Move here the core of labeling
20778         parameters. 
20779
20780         * support.cs (ReflectionParameters.ParameterModifier,
20781         InternalParameters.ParameterModifier): Use IsByRef on the type and
20782         only return the OUT bit for these parameters instead of in/out/ref
20783         flags.
20784
20785         This is because I miss-understood things.  The ParameterInfo.IsIn
20786         and IsOut represent whether the parameter has the [In] and [Out]
20787         attributes set.  
20788
20789 2002-01-22  Miguel de Icaza  <miguel@ximian.com>
20790
20791         * ecore.cs (FieldExpr.Emit): Release temporaries.
20792
20793         * assign.cs (LocalTemporary.Release): new function.
20794
20795         * codegen.cs (EmitContext.GetTemporaryStorage,
20796         EmitContext.FreeTemporaryStorage): Rework the way we deal with
20797         temporary storage.  Now we can "put back" localbuilders when we
20798         are done with them
20799
20800 2002-01-21  Miguel de Icaza  <miguel@ximian.com>
20801
20802         * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
20803         need to make a copy of the variable to generate verifiable code.
20804
20805 2002-01-19  Miguel de Icaza  <miguel@ximian.com>
20806
20807         * driver.cs: Compute dynamically the system directory.
20808
20809         * ecore.cs (CopyNewMethods): reworked, exposed, made public.
20810         Slower, but more generally useful.  Used by the abstract
20811         registering implementation. 
20812
20813         * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
20814         the rules for the special rule on Type/instances.  First check if
20815         we have the same name, and if so, try that special static path
20816         rather than the instance path.
20817
20818 2002-01-18  Miguel de Icaza  <miguel@ximian.com>
20819
20820         * cs-parser.jay: Emit 642 (warning: possible empty statement) for
20821         for, while and if.
20822
20823         * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
20824         Enum, ValueType, Delegate or Array for non-corlib compiles.
20825
20826         * cs-tokenizer.cs: Catch long identifiers (645)
20827
20828         * typemanager.cs (IndexerPropetyName): Ravi never tested this
20829         piece of code.
20830
20831         * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
20832         fix, we were returning too early, so we were not registering
20833         pending methods from abstract classes.
20834
20835         Do not register pending methods if the class is abstract.
20836
20837         * expression.cs (Conditional.DoResolve): Report circular implicit
20838         conversions when we neecd to compute it for conditional
20839         expressions. 
20840
20841         (Is.DoResolve): If the expression is always of the provided type,
20842         flag warning 183.  If the expression can not ever be of the
20843         provided type flag warning 184.
20844
20845         * class.cs: Catch 169 as well.
20846
20847         * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
20848         read. 
20849
20850 2002-01-18  Nick Drochak  <ndrochak@gol.com>
20851
20852         * makefile: remove path to beta2 csc.exe.  path to csc.exe must be in PATH instead.
20853
20854 2002-01-17  Miguel de Icaza  <miguel@ximian.com>
20855
20856         * interface.cs: (PopulateMethod): Check for pointers being defined
20857         only if the unsafe context is active.
20858         (PopulateProperty): ditto.
20859         (PopulateIndexer): ditto.
20860
20861         * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
20862         specified.  If pointers are present, make sure that they are
20863         present in an unsafe context.
20864         (Constructor, Constructor.Define): ditto.
20865         (Field, Field.Define): ditto.
20866         (Property, Property.Define): ditto.
20867         (Event, Event.Define): ditto.
20868
20869         * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
20870         hashtable if there are classes or structs defined.
20871
20872         * expression.cs (LocalVariableReference.DoResolve): Simplify this
20873         code, as the constant resolution moved.
20874
20875         * statement.cs (Block.EmitMeta): Resolve all constants as we emit
20876         the metadata, so we can flag error 133. 
20877
20878         * decl.cs (MemberCore.UnsafeOK): New function to test that a
20879         pointer is being declared in an unsafe context.
20880
20881 2002-01-16  Miguel de Icaza  <miguel@ximian.com>
20882
20883         * modifiers.cs (Modifiers.Check): Require a Location argument.
20884         Report error 227 for Unsafe use.
20885
20886         * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
20887
20888         * statement.cs (For.Emit): If the test is null, then report that
20889         we do `return', as we wont reach anything afterwards.
20890
20891         (Switch.SwitchGoverningType): Track the expression that matched
20892         the conversion.
20893
20894         * driver.cs: Allow negative numbers as an error code to flag.
20895
20896         * cs-parser.jay: Handle 1551.
20897
20898         * namespace.cs: Add 1537 checking (repeated using alias namespaces).
20899
20900 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
20901
20902         * cs-parser.jay: Report 1518 (type declaration can only contain
20903         class, struct, interface, enum or delegate)
20904
20905         (switch_label): Report 1523 (keywords `case' or `default' must
20906         preced code)
20907
20908         (opt_switch_sections): Report 1522 (empty switch)
20909
20910         * driver.cs: Report 1515 (response file specified multiple times)
20911         Report 1516 (Source file specified multiple times).
20912
20913         * expression.cs (Argument.Resolve): Signal 1510
20914
20915         (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
20916         access not allowed in static code)
20917
20918 2002-01-11  Ravi Pratap  <ravi@ximian.com>
20919
20920         * typemanager.cs (IsPointerType): Utility method which we are going
20921         to need a lot.
20922
20923         * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
20924         the object type, so we take care of that.
20925
20926         * expression.cs (FullMethodDesc): Also include the return type in descriptions.
20927
20928         * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
20929         added to non-params parameters :-)
20930
20931         * typemanager.cs (CSharpName): Include 'void' type too. 
20932
20933         (void_ptr_type): Include in the set of core types.
20934
20935         * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of 
20936         duplicating code.
20937
20938         (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have 
20939         an unsafe context.
20940
20941         * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had 
20942         completely forgotten about it.
20943
20944 2002-01-10  Ravi Pratap  <ravi@ximian.com>
20945
20946         * cs-parser.jay (pointer_type): Add. This begins our implementation
20947         of parsing rules for unsafe code.
20948
20949         (unsafe_statement): Implement.
20950
20951         (embedded_statement): Modify to include the above.
20952
20953         * statement.cs (Unsafe): Implement new class for unsafe blocks.
20954
20955         * codegen.cs (EmitContext.InUnsafe): Add. This determines
20956         if the current context is an unsafe one.
20957
20958         * cs-parser.jay (local_variable_pointer_type): Since local variable types
20959         are handled differently, we need separate rules for them.
20960
20961         (local_variable_declaration): Update to use local_variable_pointer_type
20962         to allow variable declarations of unmanaged pointer types.
20963
20964         * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
20965         in unsafe contexts.
20966
20967         * ../errors/cs0214.cs : Add.
20968
20969 2002-01-16  Nick Drochak  <ndrochak@gol.com>
20970
20971         * makefile: remove 'response' file when cleaning.
20972
20973 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
20974
20975         * cs-parser.jay: Report 1524.
20976
20977 2002-01-14  Miguel de Icaza  <miguel@ximian.com>
20978
20979         * typemanager.cs (RegisterMethod): drop checking if we have
20980         registered this from here
20981
20982 2002-01-12  Miguel de Icaza  <miguel@ximian.com>
20983
20984         * class.cs (Method.EmitDestructor): Implement calling our base
20985         destructor. 
20986
20987         * statement.cs (Try.Emit): Fix to reset the InFinally to the old
20988         value of InFinally.
20989
20990         * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
20991         this routine and will wrap the call in a try/catch block.  Deal
20992         with the case.
20993
20994 2002-01-11  Miguel de Icaza  <miguel@ximian.com>
20995
20996         * ecore.cs (Expression.MemberLookup): instead of taking a
20997         parameter `same_type' that was used to tell whether we could
20998         access private members we compute our containing type from the
20999         EmitContext.
21000
21001         (FieldExpr): Added partial support for volatile fields.  This does
21002         not work for volatile fields exposed from assemblies, as I can not
21003         figure out how to extract the modreq from it.
21004
21005         Updated all the source files to use this.
21006
21007         * codegen.cs (EmitContext): Compute ContainerType ahead of time,
21008         because it is referenced by MemberLookup very often. 
21009
21010 2002-01-09  Ravi Pratap  <ravi@ximian.com>
21011
21012         * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
21013         TypeBuilder.GetCustomAttributes to retrieve what we need.
21014
21015         Get rid of redundant default_member_attr_type as this is the same as
21016         default_member_type which already exists.
21017
21018         * interface.cs, attribute.cs : Update accordingly.
21019
21020 2002-01-08  Miguel de Icaza  <miguel@ximian.com>
21021
21022         * typemanager.cs: Enable IndexerPropertyName again.  It does not
21023         work for TYpeBuilders though.  Ravi, can you please fix this?
21024
21025         * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
21026
21027         * expression.cs (Argument.Emit): Handle the case of ref objects
21028         being passed to ref functions;  
21029
21030         (ParameterReference.EmitLoad): Loads the content of the pointer
21031         without dereferencing.
21032
21033 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
21034
21035         * cs-tokenizer.cs: Implemented the pre-processing expressions.
21036
21037 2002-01-08  Ravi Pratap  <ravi@ximian.com>
21038
21039         * class.cs (Indexer.DefineMethod): Incorporate the interface
21040         type in the name of the method if we are doing explicit interface
21041         implementation.
21042
21043         * expression.cs (ConversionExists): Remove as it is completely obsolete.
21044
21045         (BetterConversion): Fix extremely trivial bug where we were referring to
21046         ConversionExists instead of StandardConversionExists ! Hooray, things are fine
21047         again !
21048
21049         * ../errors/bug16.cs : Add although we have fixed it.
21050
21051 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
21052
21053         * expression.cs (BaseIndexer): Begin implementation.
21054
21055         * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
21056
21057         * cs-parser.jay (indexer_declarator): Use qualified_identifier
21058         production directly to remove a shift/reduce, and implement
21059         explicit interface implementation.
21060
21061         * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
21062         after a floating point suffix.
21063
21064         * expression.cs (DoNumericPromotions): Improved the conversion for
21065         uint/uint.  If we have a constant, we avoid doing a typecast to a
21066         larger type.
21067
21068         * class.cs (Indexer): Implement explicit interface implementation
21069         for indexers.
21070
21071 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
21072
21073         * class.cs: make the default instance constructor public and hidebysig.
21074
21075 2001-01-03  Ravi Pratap  <ravi@ximian.com>
21076
21077         * interface.cs (EmitDefaultMemberAttr): Make this helper method static
21078         so we can call it from elsewhere.
21079
21080         * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
21081         we emit it internally if the class has a defined indexer; otherwise the user
21082         emits it by decorating the class definition with the DefaultMemberAttribute.
21083
21084         * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
21085         attribute is not used on a type which defines an indexer.
21086
21087         * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
21088         character when we skip whitespace.
21089
21090         * ../errors/cs0646.cs : Add.
21091
21092 2002-01-03  Miguel de Icaza  <miguel@ximian.com>
21093
21094         * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
21095         again. 
21096
21097         * makefile: Add practical target `mcs3.exe' which builds the third
21098         generation compiler. 
21099
21100         * expression.cs (New): Fix structures constructor calling.
21101
21102         * class.cs (Property, Method, Indexer): Emit Final flag on the
21103         method if we are an interface implementation and we are not
21104         abstract. 
21105
21106         * ecore.cs (PropertyExpr): New public field `IsBase', tells
21107         whether this property is referencing a `base' method.
21108
21109         * expression.cs (Invocation.EmitCall): take an extra argument:
21110         is_base, this is used to determine whether the `call' or
21111         `callvirt' opcode should be used.
21112
21113
21114         * delegate.cs: update EmitCall.
21115
21116         * class.cs (Method.Define): Set NewSlot for the cases where we are
21117         not implementing an interface method.
21118
21119         (Property.Define): ditto.
21120
21121 2002-01-02  Miguel de Icaza  <miguel@ximian.com>
21122
21123         * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
21124         'r'.  Allows mcs to parse itself fully.
21125
21126 2002-01-02  Ravi Pratap  <ravi@ximian.com>
21127
21128         * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
21129         of the number of initializers that require the InitializeArray method.
21130
21131         (CheckIndices): Store the Expression in all cases - not the plain value. Also
21132         update the above field where necessary.
21133
21134         (MakeByteBlob): Update accordingly.
21135
21136         (DoEmit): Call EmitStaticInitializers only if the number of initializers is 
21137         greater than 2.
21138
21139         (EmitDynamicInitializers): Update in accordance with the new optimization.
21140
21141         (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
21142         same OpCode applies.
21143
21144         * cs-parser.jay : Fix some glaring errors I introduced.
21145
21146 2002-01-01  Ravi Pratap  <ravi@ximian.com> 
21147
21148         * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
21149         so that we can check for name clashes there too.
21150
21151         * typemanager.cs (default_member_attr_type): The attribute that we need to emit
21152         for interface indexers.
21153
21154         * interfaces.cs (Define): Emit the default member attribute.
21155
21156         * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
21157         variable was being referred to while setting the value ;-)
21158
21159 2002-01-01  Miguel de Icaza  <miguel@ximian.com>
21160
21161         * expression.cs (MakeByteBlob): Optimize: we do not need to fill
21162         byte-by-byte information when we know the data is zero.
21163
21164         Make the block always a multiple of 4, because
21165         DefineInitializedData has a bug.
21166
21167         * assign.cs: Fix, we should assign from the temporary, not from
21168         the source. 
21169
21170         * expression.cs (MakeByteBlob): Fix my incorrect code.
21171
21172 2001-12-31  Miguel de Icaza  <miguel@ximian.com>
21173
21174         * typemanager.cs (EnumToUnderlying): This function is used to get
21175         the underlying type from an enumeration, because it does not
21176         always work. 
21177
21178         * constant.cs: Use the I4_S form for values between -128 and 127.
21179
21180         * statement.cs (Block.LookupLabel): Looks up a label.
21181         (Block): Drop support for labeled blocks.
21182
21183         (LabeledStatement): New kind of statement that represents a label
21184         only.
21185
21186         (Goto): Finally implement this bad boy.
21187
21188         * cs-parser.jay: Update to reflect new mechanism to implement
21189         labels.
21190
21191 2001-12-30  Miguel de Icaza  <miguel@ximian.com>
21192
21193         * codegen.cs (EmitContext.This): a codegen property that keeps the
21194         a single instance of this instead of creating many different this
21195         instances. 
21196
21197         * delegate.cs (Delegate.DoResolve): Update to use the property;
21198
21199         * ecore.cs (SimpleName.SimpleNameResolve): Ditto
21200
21201         * expression.cs (BaseAccess.DoResolve): Ditto.
21202
21203 2001-12-29  Ravi Pratap  <ravi@ximian.com>
21204
21205         * typemanager.cs (methodimpl_attr_type): Add to hold the type
21206         corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
21207
21208         (InitCoreTypes): Update accordingly.
21209
21210         * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
21211         so we can quickly store the state.
21212
21213         (ApplyAttributes): Set the correct implementation flags
21214         for InternalCall methods.
21215
21216 2001-12-29  Miguel de Icaza  <miguel@ximian.com>
21217
21218         * expression.cs (EmitCall): if a method is not virtual, then do
21219         not use callvirt on it.
21220
21221         (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
21222         user defined stuff) requires the use of stobj, which takes an
21223         address on the stack instead of an array and an index.  So emit
21224         the Ldelema operation for it.
21225
21226         (EmitStoreOpcode): Use stobj for valuetypes.
21227
21228         (UnaryMutator.EmitCode): Use the right 1 value depending on
21229         whether we are dealing with int64/uint64, float or doubles.
21230
21231         * class.cs (TypeContainer.AddConstructor): Fix the logic to define
21232         constructors that I implemented last night.
21233
21234         (Constructor.IsDefault): Fix to work properly for static
21235         constructors.
21236
21237         * cs-parser.jay (CheckDef): report method signature errors.
21238         Update error number 103 to be 132.
21239
21240         * decl.cs: New AdditionResult enumeration value: MethodExists.
21241         Although we do this check for methods later on in the semantic
21242         analysis, catching repeated default constructors is so easy that
21243         we catch these here. 
21244
21245         * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
21246         promotions code.
21247
21248         (ParameterReference.EmitAssign, Emit): handle
21249         bools as bytes.
21250
21251         (ArrayAccess.EmitLoadOpcode): Handle bool type here.
21252         (ArrayAccess.EmitStoreOpcode): ditto.
21253
21254         * cs-tokenizer.cs (is_punct): Eliminated empty computation.
21255
21256         * expression.cs (MakeByteBlob): Complete all the missing types
21257         (uint, short, ushort, byte, sbyte)
21258
21259         * class.cs: Only init instance field initializers on instance
21260         constructors. 
21261
21262         Rename `constructors' to instance_constructors. 
21263
21264         (TypeContainer.AddConstructor): Only add constructors to the list
21265         if it is not static.
21266
21267         Make sure that we handle default_static_constructor independently
21268         everywhere where we handle instance_constructors
21269
21270 2001-12-28  Miguel de Icaza  <miguel@ximian.com>
21271
21272         * class.cs: Do not lookup or create a base initializer for a
21273         static constructor.
21274
21275         (ConstructorInitializer.Resolve): use the proper type to lookup
21276         for constructors.
21277
21278         * cs-parser.jay: Report error 1585 (modifiers between type and name).
21279
21280         * enum.cs, interface.cs: Remove CloseType, this is taken care by
21281         in DeclSpace. 
21282
21283         * decl.cs: CloseType is now an virtual method, the default
21284         implementation just closes this type.
21285
21286 2001-12-28  Ravi Pratap  <ravi@ximian.com>
21287
21288         * attribute.cs (DefinePInvokeMethod): Set the implementation flags
21289         to PreserveSig by default. Also emit HideBySig on such methods.
21290
21291         Basically, set the defaults to standard values.
21292
21293         * expression.cs (Invocation.BetterFunction): We need to make sure that for each
21294         argument, if candidate is better, it can't be worse than the best !
21295
21296         (Invocation): Re-write bits to differentiate between methods being
21297         applicable in their expanded form and their normal form - for params
21298         methods of course.
21299
21300         Get rid of use_standard everywhere as only standard conversions are allowed
21301         in overload resolution. 
21302
21303         More spec conformance.
21304
21305 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
21306
21307         * driver.cs: Add --timestamp, to see where the compiler spends
21308         most of its time.
21309
21310         * ecore.cs (SimpleName.DoResolve): Do not create an implicit
21311         `this' in static code.
21312
21313         (SimpleName.DoResolve): Implement in terms of a helper function
21314         that allows static-references to be passed upstream to
21315         MemberAccess.
21316
21317         (Expression.ResolveWithSimpleName): Resolve specially simple
21318         names when called by MemberAccess to implement the special
21319         semantics. 
21320
21321         (Expression.ImplicitReferenceConversion): Handle conversions from
21322         Null to reference types before others, as Null's type is
21323         System.Object. 
21324
21325         * expression.cs (Invocation.EmitCall): Handle the special case of
21326         calling methods declared on a reference type from a ValueType
21327         (Base classes System.Object and System.Enum)
21328
21329         (MemberAccess.Resolve): Only perform lookups on Enumerations if
21330         the left hand side is a TypeExpr, not on every enumeration. 
21331
21332         (Binary.Resolve): If types are reference types, then do a cast to
21333         object on operators != and == of both arguments.
21334
21335         * typemanager.cs (FindMembers): Extract instance and static
21336         members if requested.
21337
21338         * interface.cs (PopulateProperty): Use void_type instead of null
21339         as the return type for the setter method.
21340
21341         (PopulateIndexer): ditto.
21342
21343 2001-12-27  Ravi Pratap  <ravi@ximian.com>
21344
21345         * support.cs (ReflectionParameters): Fix minor bug where we
21346         were examining the wrong parameter for the ParamArray attribute.
21347
21348         Cope with requests for the type of the parameter at position
21349         greater than the params parameter's. We now return the element
21350         type of the params array as that makes more sense.
21351
21352         * expression.cs (Invocation.IsParamsMethodApplicable): Update 
21353         accordingly as we no longer have to extract the element type
21354         ourselves.
21355
21356         (Invocation.OverloadResolve): Update.
21357
21358 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
21359
21360         * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
21361         against IEnumerator, test whether the return value is a descendant
21362         of the IEnumerator interface.
21363
21364         * class.cs (Indexer.Define): Use an auxiliary method to implement
21365         the other bits of the method definition.  Begin support for
21366         explicit interface implementation.
21367
21368         (Property.DefineMethod): Use TypeManager.void_type instead of null
21369         for an empty return value.
21370
21371 2001-12-26  Miguel de Icaza  <miguel@ximian.com>
21372
21373         * expression.cs (MemberAccess.ResolveMemberAccess): if we are
21374         dealing with a FieldExpr which is composed of a FieldBuilder, in
21375         the code path we did extract the constant, but we should have
21376         obtained the underlying value to be able to cast it (otherwise we
21377         end up in an infinite loop, this is what Ravi was running into).
21378
21379         (ArrayCreation.UpdateIndices): Arrays might be empty.
21380
21381         (MemberAccess.ResolveMemberAccess): Add support for section
21382         14.5.4.1 that deals with the special case of E.I when E is a type
21383         and something else, that I can be a reference to a static member.
21384
21385         (ArrayCreation.MakeByteBlob): It is not an error to not be able to
21386         handle a particular array type to create byte blobs, it is just
21387         something we dont generate byteblobs for.
21388
21389         * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
21390         arguments. 
21391
21392         * location.cs (Push): remove the key from the hashtable that we
21393         are about to add.   This happens for empty files.
21394
21395         * driver.cs: Dispose files after we have parsed them.
21396
21397         (tokenize): new function that only runs the tokenizer on its
21398         input, for speed testing.
21399
21400 2001-12-26  Ravi Pratap  <ravi@ximian.com>
21401
21402         * class.cs (Event.Define): Define the private field only if there
21403         are no accessors defined.
21404
21405         * expression.cs (ResolveMemberAccess): If there is no associated
21406         field with the event, that means we have an event defined with its
21407         own accessors and we should flag error cs0070 since transforming
21408         ourselves into a field is not valid in that case.
21409
21410         * ecore.cs (SimpleName.DoResolve): Same as above.
21411
21412         * attribute.cs (DefinePInvokeMethod): Set the default calling convention
21413         and charset to sane values.
21414
21415 2001-12-25  Ravi Pratap  <ravi@ximian.com>
21416
21417         * assign.cs (DoResolve): Perform check on events only if they 
21418         are being accessed outside the declaring type.
21419
21420         * cs-parser.jay (event_declarations): Update rules to correctly
21421         set the type of the implicit parameter etc.
21422
21423         (add_accessor, remove_accessor): Set current local parameters.
21424
21425         * expression.cs (Binary): For delegate addition and subtraction,
21426         cast the return value from the method into the appropriate delegate
21427         type.
21428
21429 2001-12-24  Ravi Pratap  <ravi@ximian.com>
21430
21431         * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
21432         of these as the workaround is unnecessary.
21433
21434         * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
21435         delegate data - none of that is needed at all.
21436
21437         Re-write bits to extract the instance expression and the delegate method
21438         correctly.
21439
21440         * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator 
21441         on delegates too.
21442
21443         * attribute.cs (ApplyAttributes): New method to take care of common tasks
21444         of attaching attributes instead of duplicating code everywhere.
21445
21446         * everywhere : Update code to do attribute emission using the above method.
21447
21448 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
21449
21450         * expression.cs (IsParamsMethodApplicable): if there are not
21451         parameters, return immediately.
21452
21453         * ecore.cs: The 0 literal can be implicity converted to an enum
21454         type. 
21455
21456         (SimpleName.DoResolve): First lookup the type, then lookup the
21457         members. 
21458
21459         (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
21460         want to get its address.  If the InstanceExpression is not
21461         addressable, store the result in a temporary variable, then get
21462         the address of it.
21463
21464         * codegen.cs: Only display 219 errors on warning level or above. 
21465
21466         * expression.cs (ArrayAccess): Make it implement the
21467         IMemoryLocation interface.
21468
21469         (Binary.DoResolve): handle the operator == (object a, object b)
21470         and operator != (object a, object b) without incurring into a
21471         BoxedCast (because 5 != o should never be performed).
21472
21473         Handle binary enumerator operators.
21474
21475         (EmitLoadOpcode): Use Ldelema if the object we are loading is a
21476         value type, otherwise use Ldelem_ref.
21477
21478         Use precomputed names;
21479
21480         (AddressOf): Implement address of
21481
21482         * cs-parser.jay (labeled_statement): Fix recursive block
21483         addition by reworking the production.
21484
21485         * expression.cs (New.DoEmit): New has a special case:
21486                 
21487                  If we are dealing with a ValueType, we have a few
21488                  situations to deal with:
21489                 
21490                     * The target of New is a ValueType variable, that is
21491                       easy, we just pass this as the variable reference
21492                 
21493                     * The target of New is being passed as an argument,
21494                       to a boxing operation or a function that takes a
21495                       ValueType.
21496                 
21497                       In this case, we need to create a temporary variable
21498                       that is the argument of New.
21499
21500
21501 2001-12-23  Ravi Pratap  <ravi@ximian.com>
21502
21503         * rootcontext.cs (LookupType): Check that current_type is not null before
21504         going about looking at nested types.
21505
21506         * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
21507         not implement the IAssignMethod interface any more.
21508
21509         * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
21510         where we tranform them into FieldExprs if they are being resolved from within
21511         the declaring type.
21512
21513         * ecore.cs (SimpleName.DoResolve): Do the same here.
21514
21515         * assign.cs (DoResolve, Emit): Clean up code considerably. 
21516
21517         * ../errors/bug10.cs : Add.
21518
21519         * ../errors/cs0070.cs : Add.
21520
21521         * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
21522
21523         * assign.cs : Get rid of EventIsLocal everywhere.
21524
21525 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
21526
21527         * ecore.cs (ConvertIntLiteral): finished the implementation.
21528
21529         * statement.cs (SwitchLabel): Convert the value we are using as a
21530         key before looking up the table.
21531
21532 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
21533
21534         * codegen.cs (EmitTopBlock): Require a Location argument now.
21535
21536         * cs-parser.jay (constructor_declarator): We need to setup
21537         current_local_parameters before we parse the
21538         opt_constructor_initializer, to allow the variables to be bound
21539         to the constructor arguments.
21540
21541         * rootcontext.cs (LookupType): First lookup nested classes in our
21542         class and our parents before we go looking outside our class.
21543
21544         * expression.cs (ConstantFold): Extract/debox the values at the
21545         beginnning. 
21546
21547         * rootcontext.cs (EmitCode): Resolve the constants first before we
21548         resolve the types.  This is not really needed, but it helps debugging.
21549
21550         * statement.cs: report location.
21551
21552         * cs-parser.jay: pass location to throw statement.
21553
21554         * driver.cs: Small bug fix.
21555
21556         * report.cs: Updated format to be 4-zero filled digits.
21557
21558 2001-12-22  Ravi Pratap  <ravi@ximian.com>
21559
21560         * expression.cs (CheckIndices): Fix minor bug where the wrong
21561         variable was being referred to ;-)
21562
21563         (DoEmit): Do not call EmitStaticInitializers when the 
21564         underlying type is System.Object.
21565
21566 2001-12-21  Ravi Pratap  <ravi@ximian.com>
21567
21568         * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
21569         and do the usual workaround for SRE.
21570
21571         * class.cs (MyEventBuilder.EventType): New member to get at the type
21572         of the event, quickly.
21573
21574         * expression.cs (Binary.ResolveOperator): Handle delegate addition.
21575
21576         * assign.cs (Assign.DoResolve): Handle the case when the target
21577         is an EventExpr and perform the necessary checks.
21578
21579         * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
21580         interface.
21581
21582         (SimpleName.MemberStaticCheck): Include check for EventExpr.
21583
21584         (EventExpr): Set the type in the constructor itself since we 
21585         are meant to be born fully resolved.
21586
21587         (EventExpr.Define): Revert code I wrote earlier.
21588                 
21589         * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
21590         instance expression is null. The instance expression is a This in that case
21591         or a null, depending on whether it is a static method or not.
21592
21593         Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
21594         refers to more than one method.
21595
21596         * assign.cs (DoResolve): Check whether the event belongs to the same Type container
21597         and accordingly flag errors.
21598
21599 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
21600
21601         * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
21602
21603 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
21604
21605         * location.cs (ToString): Provide useful rutine.
21606
21607 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
21608
21609         * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
21610         objects, return the actual integral boxed.
21611
21612         * statement.cs (SwitchLabel): define an ILLabel for each
21613         SwitchLabel. 
21614
21615         (Switch.CheckSwitch): If the value is a Literal, extract
21616         the underlying literal.
21617
21618         Also in the unused hashtable we had, add the SwitchLabel so we can
21619         quickly look this value up.
21620
21621         * constant.cs: Implement a bunch of new constants.  Rewrite
21622         Literal based on this.  Made changes everywhere to adapt to this.
21623
21624         * expression.cs (Expression.MakeByteBlob): Optimize routine by
21625         dereferencing array only once, and also copes with enumrations.
21626
21627         bytes are two bytes wide, not one.
21628
21629         (Cast): Perform constant conversions.
21630
21631         * ecore.cs (TryImplicitIntConversion): Return literals instead of
21632         wrappers to the literals here.
21633
21634         * expression.cs (DoNumericPromotions): long literals can converted
21635         to ulong implicity (this is taken care of elsewhere, but I was
21636         missing this spot).
21637
21638         * ecore.cs (Expression.Literalize): Make the return type Literal,
21639         to improve type checking.
21640
21641         * rootcontext.cs: Lookup for nested classes in our class hierarchy.
21642
21643 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
21644
21645         * literal.cs: Revert code from ravi that checked the bounds.  The
21646         bounds are sane by the definition of the type itself. 
21647
21648         * typemanager.cs: Fix implementation of ImplementsInterface.  We
21649         need to actually look up in our parent hierarchy for interfaces
21650         implemented. 
21651
21652         * const.cs: Use the underlying type for enumerations
21653
21654         * delegate.cs: Compute the basename for the delegate creation,
21655         that should fix the delegate test case, and restore the correct
21656         Type Lookup semantics in rootcontext
21657
21658         * rootcontext.cs: Revert Ravi's last patch.  The correct way of
21659         referencing a nested type with the Reflection API is using the "+"
21660         sign. 
21661
21662         * cs-parser.jay: Do not require EOF token at the end.
21663
21664 2001-12-20  Ravi Pratap  <ravi@ximian.com>
21665
21666         * rootcontext.cs (LookupType): Concatenate type names with
21667         a '.' instead of a '+' The test suite passes again.
21668
21669         * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
21670         field of the enumeration.
21671
21672         * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
21673         the case when the member is an EventExpr.
21674
21675         * ecore.cs (EventExpr.InstanceExpression): Every event which is not
21676         static has an associated instance expression.
21677
21678         * typemanager.cs (RegisterEvent): The usual workaround, now for events.
21679
21680         (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
21681
21682         * class.cs (Event.Define): Register event and perform appropriate checks
21683         for error #111.
21684
21685         We define the Add and Remove methods even if the use provides none because
21686         in that case, we provide default implementations ourselves.
21687
21688         Define a private field of the type of the event. This is done by the CSC compiler
21689         and we should be doing it too ;-)
21690
21691         * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
21692         More methods we use in code we generate.
21693
21694         (multicast_delegate_type, delegate_type): Two separate types since the distinction
21695         is important.
21696
21697         (InitCoreTypes): Update accordingly for the above.
21698
21699         * class.cs (Event.Emit): Generate code for default accessors that we provide
21700
21701         (EmitDefaultMethod): Do the job in the above.
21702
21703         * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the 
21704         appropriate place.
21705
21706 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
21707
21708         * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
21709         builders even if we were missing one.
21710
21711         * interface.cs, class.cs, enum.cs: When calling DefineNestedType
21712         pass the Basename as our class name instead of the Name.  The
21713         basename will be correctly composed for us.
21714
21715         * parameter.cs (Paramters): Now takes a Location argument.
21716
21717         * decl.cs (DeclSpace.LookupType): Removed convenience function and
21718         make all the code call directly LookupType in RootContext and take
21719         this chance to pass the Location information everywhere.
21720
21721         * Everywhere: pass Location information.
21722
21723 2001-12-19  Miguel de Icaza  <miguel@ximian.com>
21724
21725         * class.cs (Constructor.Define): Updated way of detecting the
21726         length of the parameters.
21727
21728         (TypeContainer.DefineType): Use basename as the type name for
21729         nested types.
21730
21731         (TypeContainer.Define): Do not recursively define types here, as
21732         definition is taken care in order by the RootContext.
21733
21734         * tree.cs: Keep track of namespaces in a per-file basis.
21735
21736         * parameter.cs (Parameter.ComputeSignature): Update to use
21737         DeclSpace. 
21738
21739         (Parameters.GetSignature): ditto.
21740
21741         * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
21742         instead of a TypeContainer.
21743
21744         (Interface.SemanticAnalysis): Use `this' instead of our parent to
21745         resolve names.  Because we need to be resolve in our context, not
21746         our parents.
21747
21748         * driver.cs: Implement response files.
21749
21750         * class.cs (TypeContainer.DefineType): If we are defined, do not
21751         redefine ourselves.
21752
21753         (Event.Emit): Emit the code for add/remove handlers.
21754         (Event.Define): Save the MethodBuilders for add/remove.
21755
21756         * typemanager.cs: Use pair here too.
21757
21758         * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
21759         DictionaryEntry requires the first argument to be non-null.  
21760
21761         (enum_declaration): Compute full name for registering the
21762         enumeration.
21763
21764         (delegate_declaration): Instead of using
21765         formal_parameter_list, use opt_formal_parameter_list as the list
21766         can be empty.
21767
21768         * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
21769         (EventParsing): New property that controls whether `add' and
21770         `remove' are returned as tokens or identifiers (for events);
21771
21772 2001-12-19  Ravi Pratap  <ravi@ximian.com>
21773
21774         * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
21775         use MyEventBuilder only and let it wrap the real builder for us.
21776
21777         (MyEventBuilder): Revamp constructor etc.
21778
21779         Implement all operations that we perform on EventBuilder in precisely the same
21780         way here too.
21781
21782         (FindMembers): Update to use the EventBuilder member.
21783
21784         (Event.Emit): Update accordingly.
21785
21786 2001-12-18  Ravi Pratap  <ravi@ximian.com>
21787
21788         * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
21789         by calling the appropriate methods.
21790
21791         (GetCustomAttributes): Make stubs as they cannot possibly do anything
21792         useful.
21793
21794         (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
21795
21796 2001-12-17  Ravi Pratap  <ravi@ximian.com>
21797
21798         * delegate.cs (Delegate.Populate): Check that the return type
21799         and various parameters types are indeed accessible.
21800
21801         * class.cs (Constructor.Define): Same here.
21802
21803         (Field.Define): Ditto.
21804
21805         (Event.Define): Ditto.
21806
21807         (Operator.Define): Check that the underlying Method defined itself
21808         correctly - so it's MethodBuilder should not be null.
21809
21810         * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
21811         expression happens to be null.
21812
21813         * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
21814         members but as of now we don't seem to be able to do anything really useful with it.
21815
21816         (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
21817         not the EventBuilder.
21818
21819 2001-12-18  Miguel de Icaza  <miguel@ximian.com>
21820
21821         * cs-tokenizer.cs: Add support for defines.
21822         Add support for #if, #elif, #else, #endif
21823
21824         (eval_var): evaluates a variable.
21825         (eval): stubbed for evaluating functions.
21826
21827         * cs-parser.jay: Pass the defines information
21828
21829         * driver.cs: Add --define command line option.
21830
21831         * decl.cs: Move MemberCore here.
21832
21833         Make it the base class for DeclSpace.  This allows us to catch and
21834         report 108 and 109 for everything now.
21835
21836         * class.cs (TypeContainer.Define): Extract all the members
21837         before populating and emit the warning 108 (new keyword required
21838         to override) instead of having each member implement this.
21839
21840         (MemberCore.Define): New abstract method, we will be using this in
21841         the warning reporting engine in Populate.
21842
21843         (Operator.Define): Adjust to new MemberCore protocol. 
21844
21845         * const.cs (Const): This does not derive from Expression, it is a
21846         temporary object we use to create fields, it is a MemberCore. 
21847
21848         * class.cs (Method.Define): Allow the entry point to be in a
21849         specific class.
21850
21851         * driver.cs: Rewrite the argument handler to clean it up a bit.
21852
21853         * rootcontext.cs: Made it just an auxiliary namespace feature by
21854         making everything static.
21855
21856         * driver.cs: Adapt code to use RootContext type name instead of
21857         instance variable.
21858
21859         * delegate.cs: Remove RootContext argument.
21860
21861         * class.cs: (Struct, TypeContainer, Class): Remove RootContext
21862         argument. 
21863
21864         * class.cs (Event.Define): The lookup can fail.
21865
21866         * cs-tokenizer.cs: Begin implementation of pre-procesor. 
21867
21868         * expression.cs: Resolve the this instance before invoking the code.
21869
21870 2001-12-17  Miguel de Icaza  <miguel@ximian.com>
21871
21872         * cs-parser.jay: Add a production in element_access that allows
21873         the thing to become a "type" reference.  This way we can parse
21874         things like "(string [])" as a type.
21875
21876         Note that this still does not handle the more complex rules of
21877         casts. 
21878
21879
21880         * delegate.cs (Delegate.Populate): Register the delegage constructor builder here. 
21881
21882         * ecore.cs: (CopyNewMethods): new utility function used to
21883         assemble the list of methods from running FindMembers.
21884
21885         (MemberLookup): Rework FindMembers so that 
21886
21887 2001-12-16  Miguel de Icaza  <miguel@ximian.com>
21888
21889         * class.cs (TypeContainer): Remove Delegates who fail to be
21890         defined.
21891
21892         * delegate.cs (Populate): Verify that we dont get null return
21893         values.   TODO: Check for AsAccessible.
21894
21895         * cs-parser.jay: Use basename to emit error 574 (destructor should
21896         have the same name as container class), not the full name.
21897
21898         * cs-tokenizer.cs (adjust_int): Fit the integer in the best
21899         possible representation.  
21900
21901         Also implements integer type suffixes U and L.
21902
21903 2001-12-15  Miguel de Icaza  <miguel@ximian.com>
21904
21905         * expression.cs (ArrayCreation.DoResolve): We need to do the
21906         argument resolution *always*.
21907
21908         * decl.cs: Make this hold the namespace.  Hold the root context as
21909         well.
21910         (LookupType): Move here.
21911
21912         * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
21913
21914         * location.cs (Row, Name): Fixed the code, it was always returning
21915         references to the first file.
21916
21917         * interface.cs: Register properties defined through interfaces.
21918
21919         * driver.cs: Add support for globbing on the command line
21920
21921         * class.cs (Field): Make it derive from MemberCore as well.
21922         (Event): ditto.
21923
21924 2001-12-15  Ravi Pratap  <ravi@ximian.com>
21925
21926         * class.cs (Event::Define): Check that the type of the event is a delegate
21927         type else flag error #66.
21928
21929         Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
21930         same.
21931
21932         * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
21933         values of EntryPoint, CharSet etc etc.
21934
21935         Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
21936
21937         * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
21938         be null and we should ignore this. I am not sure if this is really clean. Apparently,
21939         there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
21940         which needs this to do its work.
21941
21942         * ../errors/cs0066.cs : Add.
21943
21944 2001-12-14  Miguel de Icaza  <miguel@ximian.com>
21945
21946         * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
21947         helper functions.
21948
21949         * class.cs: (MethodSignature.MethodSignature): Removed hack that
21950         clears out the parameters field.
21951         (MemberSignatureCompare): Cleanup
21952
21953         (MemberCore): New base class used to share code between MethodCore
21954         and Property.
21955
21956         (RegisterRequiredImplementations) BindingFlags.Public requires
21957         either BindingFlags.Instace or Static.  Use instance here.
21958
21959         (Property): Refactored code to cope better with the full spec.
21960
21961         * parameter.cs (GetParameterInfo): Return an empty array instead
21962         of null on error.
21963
21964         * class.cs (Property): Abstract or extern properties have no bodies.
21965
21966         * parameter.cs (GetParameterInfo): return a zero-sized array.
21967
21968         * class.cs (TypeContainer.MethodModifiersValid): Move all the
21969         method modifier validation to the typecontainer so we can reuse
21970         this on properties.
21971
21972         (MethodCore.ParameterTypes): return an empty sized array of types.
21973
21974         (Property.Define): Test property modifier validity.
21975
21976         Add tests for sealed/override too.
21977
21978         (Method.Emit): abstract or extern methods have no bodies.
21979
21980 2001-12-14  Ravi Pratap  <ravi@ximian.com>
21981
21982         * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
21983         thing.
21984
21985         (Method::Define, ::Emit): Modify accordingly.
21986
21987         * expression.cs (Invocation::OverloadResolve): Handle error # 121.
21988
21989         (ArrayCreation::MakeByteBlob): Handle floats and doubles.
21990
21991         * makefile: Pass in /unsafe.
21992
21993 2001-12-13  Miguel de Icaza  <miguel@ximian.com>
21994
21995         * class.cs (MakeKey): Kill routine.
21996
21997         * class.cs (TypeContainer.Define): Correctly define explicit
21998         method implementations (they require the full interface name plus
21999         the method name).
22000
22001         * typemanager.cs: Deply the PtrHashtable here and stop using the
22002         lame keys.  Things work so much better.
22003
22004         This of course broke everyone who depended on `RegisterMethod' to
22005         do the `test for existance' test.  This has to be done elsewhere.
22006
22007         * support.cs (PtrHashtable): A hashtable that avoid comparing with
22008         the object stupid Equals method (because, that like fails all over
22009         the place).  We still do not use it.
22010
22011         * class.cs (TypeContainer.SetRequiredInterface,
22012         TypeContainer.RequireMethods): Killed these two routines and moved
22013         all the functionality to RegisterRequiredImplementations.
22014
22015         (TypeContainer.RegisterRequiredImplementations): This routine now
22016         registers all the implementations required in an array for the
22017         interfaces and abstract methods.  We use an array of structures
22018         which can be computed ahead of time to reduce memory usage and we
22019         also assume that lookups are cheap as most classes will not
22020         implement too many interfaces.
22021
22022         We also avoid creating too many MethodSignatures.
22023
22024         (TypeContainer.IsInterfaceMethod): Update and optionally does not
22025         clear the "pending" bit if we find that there are problems with
22026         the declaration.
22027
22028         (TypeContainer.VerifyPendingMethods): Update to report errors of
22029         methods that look like implementations but are not.
22030
22031         (TypeContainer.Define): Add support for explicit interface method
22032         implementation. 
22033
22034 2001-12-12  Miguel de Icaza  <miguel@ximian.com>
22035
22036         * typemanager.cs: Keep track of the parameters here instead of
22037         being a feature of the TypeContainer.
22038
22039         * class.cs: Drop the registration of parameters here, as
22040         InterfaceMethods are also interface declarations.
22041
22042         * delegate.cs: Register methods with the TypeManager not only with
22043         the TypeContainer.  This code was buggy.
22044
22045         * interface.cs: Full registation here.
22046
22047 2001-12-11  Miguel de Icaza  <miguel@ximian.com>
22048
22049         * expression.cs: Remove reducer for binary expressions, it can not
22050         be done this way.
22051
22052         * const.cs: Put here the code that used to go into constant.cs
22053
22054         * constant.cs: Put here the code for constants, this is a new base
22055         class for Literals.
22056
22057         * literal.cs: Make Literal derive from Constant.
22058
22059 2001-12-09  Miguel de Icaza  <miguel@ximian.com>
22060
22061         * statement.cs (Return.Emit): Report error 157 if the user
22062         attempts to return from a finally block.
22063
22064         (Return.Emit): Instead of emitting a return, jump to the end of
22065         the function.
22066
22067         * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
22068         LocalBuilder to store the result of the function.  ReturnLabel is
22069         the target where we jump.
22070
22071
22072 2001-12-09  Radek Doulik  <rodo@ximian.com>
22073
22074         * cs-parser.jay: remember alias in current namespace
22075
22076         * ecore.cs (SimpleName::DoResolve): use aliases for types or
22077         namespaces
22078
22079         * class.cs (LookupAlias): lookup alias in my_namespace
22080
22081         * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
22082         aliases hashtable
22083         (LookupAlias): lookup alias in this and if needed in parent
22084         namespaces
22085
22086 2001-12-08  Miguel de Icaza  <miguel@ximian.com>
22087
22088         * support.cs: 
22089
22090         * rootcontext.cs: (ModuleBuilder) Made static, first step into
22091         making things static.  I need this to avoid passing the
22092         TypeContainer when calling ParameterType.
22093
22094         * support.cs (InternalParameters.ParameterType): Remove ugly hack
22095         that did string manipulation to compute the type and then call
22096         GetType.  Use Parameter.ParameterType instead.
22097
22098         * cs-tokenizer.cs: Consume the suffix for floating values.
22099
22100         * expression.cs (ParameterReference): figure out whether this is a
22101         reference parameter or not.  Kill an extra variable by computing
22102         the arg_idx during emission.
22103
22104         * parameter.cs (Parameters.GetParameterInfo): New overloaded
22105         function that returns whether a parameter is an out/ref value or not.
22106
22107         (Parameter.ParameterType): The type of the parameter (base,
22108         without ref/out applied).
22109
22110         (Parameter.Resolve): Perform resolution here.
22111         (Parameter.ExternalType): The full type (with ref/out applied).
22112
22113         * statement.cs (Using.Emit, Using.EmitExpression): Implement
22114         support for expressions on the using statement.
22115
22116 2001-12-07  Miguel de Icaza  <miguel@ximian.com>
22117
22118         * statement.cs (Using.EmitLocalVariableDecls): Split the
22119         localvariable handling of the using statement.
22120
22121         (Block.EmitMeta): Keep track of variable count across blocks.  We
22122         were reusing slots on separate branches of blocks.
22123
22124         (Try.Emit): Emit the general code block, we were not emitting it. 
22125
22126         Check the type of the declaration to be an IDisposable or
22127         something that can be implicity converted to it. 
22128
22129         Emit conversions if required.
22130
22131         * ecore.cs (EmptyExpression): New utility class.
22132         (Expression.ImplicitConversionExists): New utility function.
22133
22134 2001-12-06  Miguel de Icaza  <miguel@ximian.com>
22135
22136         * statement.cs (Using): Implement.
22137
22138         * expression.cs (LocalVariableReference): Support read only variables.
22139
22140         * statement.cs: Remove the explicit emit for the Leave opcode.
22141         (VariableInfo): Add a readonly field.
22142
22143 2001-12-05  Miguel de Icaza  <miguel@ximian.com>
22144
22145         * ecore.cs (ConvCast): new class used to encapsulate the various
22146         explicit integer conversions that works in both checked and
22147         unchecked contexts.
22148
22149         (Expression.ConvertNumericExplicit): Use new ConvCast class to
22150         properly generate the overflow opcodes.
22151
22152 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
22153
22154         * statement.cs: The correct type for the EmptyExpression is the
22155         element_type, not the variable type.  Ravi pointed this out.
22156
22157 2001-12-04  Ravi Pratap  <ravi@ximian.com>
22158
22159         * class.cs (Method::Define): Handle PInvoke methods specially
22160         by using DefinePInvokeMethod instead of the usual one.
22161
22162         * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
22163         above to do the task of extracting information and defining the method.
22164
22165 2001-12-04  Ravi Pratap  <ravi@ximian.com>
22166
22167         * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
22168         of the condition for string type.
22169
22170         (Emit): Move that here. 
22171
22172         (ArrayCreation::CheckIndices): Keep string literals in their expression
22173         form.
22174
22175         (EmitDynamicInitializers): Handle strings appropriately.
22176
22177 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
22178
22179         * codegen.cs (EmitContext): Replace multiple variables with a
22180         single pointer to the current Switch statement.
22181
22182         * statement.cs (GotoDefault, Switch): Adjust to cleaned up
22183         EmitContext.
22184
22185 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
22186
22187         * statement.cs 
22188
22189         * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
22190         default'.
22191
22192         (Foreach.Emit): Foreach on arrays was not setting
22193         up the loop variables (for break/continue).
22194
22195         (GotoCase): Semi-implented.
22196
22197 2001-12-03  Ravi Pratap  <ravi@ximian.com>
22198
22199         * attribute.cs (CheckAttribute): Handle system attributes by using
22200         Attribute.GetAttributes to examine information we need.
22201
22202         (GetValidPlaces): Same here.
22203
22204         * class.cs (Method::Define): Catch invalid use of extern and abstract together.
22205
22206         * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
22207
22208         * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
22209
22210         (Method::Define): Set appropriate flags if we have a DllImport attribute.
22211
22212         (Method::Emit): Handle the case when we are a PInvoke method.
22213
22214 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
22215
22216         * expression.cs: Use ResolveWithSimpleName on compound names.
22217
22218 2001-12-02  Ravi Pratap  <ravi@ximian.com>
22219
22220         * constant.cs (EmitConstant): Make sure we resolve the associated expression
22221         before trying to reduce it.
22222
22223         * typemanager.cs (RegisterConstant, LookupConstant): Implement.
22224
22225         * constant.cs (LookupConstantValue): Implement.
22226
22227         (EmitConstant): Use the above in emitting the constant.
22228
22229         * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
22230         that are user-defined by doing a LookupConstantValue on them.
22231
22232         (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
22233         too, like above.
22234
22235 2001-11-29  Miguel de Icaza  <miguel@ximian.com>
22236
22237         * expression.cs (BaseAccess, BaseIndexer): Also split this out.
22238
22239         (BaseAccess.DoResolve): Implement.
22240
22241         (MemberAccess.DoResolve): Split this routine into a
22242         ResolveMemberAccess routine that can be used independently
22243
22244 2001-11-28  Miguel de Icaza  <miguel@ximian.com>
22245
22246         * expression.cs (Probe, Is, As): Split Probe in two classes Is and
22247         As that share bits of the implementation.  Is returns a boolean,
22248         while As returns the Type that is being probed.
22249
22250 2001-12-01  Ravi Pratap  <ravi@ximian.com>
22251
22252         * enum.cs (LookupEnumValue): Re-write various bits, return an object value
22253         instead of a Literal - much easier.
22254
22255         (EnumInTransit): Remove - utterly useless :-)
22256
22257         (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
22258
22259         * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
22260
22261         * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
22262         chain when we have no associated expression.
22263
22264 2001-11-30  Ravi Pratap  <ravi@ximian.com>
22265
22266         * constant.cs (Define): Use Location while reporting the errror.
22267
22268         Also emit a warning when 'new' is used and there is no inherited
22269         member to hide.
22270
22271         * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being 
22272         populated.
22273
22274         (LookupEnumValue): Implement to lookup an enum member's value and define it
22275         if necessary.
22276
22277         (Populate): Re-write accordingly to use the above routine.
22278
22279 2001-11-27  Miguel de Icaza  <miguel@ximian.com>
22280
22281         * expression.cs (This): Fix prototype for DoResolveLValue to
22282         override the base class DoResolveLValue.
22283
22284         * cs-parser.cs: Report errors cs574 and cs575 (destructor
22285         declarations) 
22286
22287         * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
22288         (we need to load the address of the field here).  This fixes
22289         test-22. 
22290
22291         (FieldExpr.DoResolveLValue): Call the DoResolve
22292         function to initialize the Instance expression.
22293
22294         * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
22295         correctly the GetEnumerator operation on a value type.
22296
22297         * cs-parser.jay: Add more simple parsing error catches.
22298
22299         * statement.cs (Switch): Add support for string switches.
22300         Handle null specially.
22301
22302         * literal.cs (NullLiteral): Make NullLiteral objects singletons. 
22303
22304 2001-11-28  Ravi Pratap  <ravi@ximian.com>
22305
22306         * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
22307
22308         (declare_local_constant): New helper function.
22309
22310         * statement.cs (AddConstant): Keep a separate record of constants
22311
22312         (IsConstant): Implement to determine if a variable is a constant.
22313
22314         (GetConstantExpression): Implement.
22315
22316         * expression.cs (LocalVariableReference): Handle the case when it is a constant.
22317
22318         * statement.cs (IsVariableDefined): Re-write.
22319
22320 2001-11-27  Ravi Pratap  <ravi@ximian.com>
22321
22322         * class.cs (TypeContainer::FindMembers): Look for constants
22323         in the case when we are looking for MemberTypes.Field
22324
22325         * expression.cs (MemberAccess::DoResolve): Check that in the
22326         case we are a FieldExpr and a Literal, we are not being accessed
22327         by an instance reference.
22328
22329         * cs-parser.jay (local_constant_declaration): Implement.
22330
22331         (declaration_statement): Implement for constant declarations.
22332
22333 2001-11-26  Miguel de Icaza  <miguel@ximian.com>
22334
22335         * statement.cs (Switch): Catch double defaults.
22336
22337         (Switch): More work on the switch() statement
22338         implementation.  It works for integral values now, need to finish
22339         string support.
22340
22341
22342 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
22343
22344         * ecore.cs (Expression.ConvertIntLiteral): New function to convert
22345         integer literals into other integer literals.  To be used by
22346         switch. 
22347
22348 2001-11-24  Ravi Pratap  <ravi@ximian.com>
22349
22350         * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
22351         some memory.
22352
22353         (EmitDynamicInitializers): Cope with the above since we extract data
22354         directly from ArrayData now.
22355
22356         (ExpectInitializers): Keep track of whether initializers are mandatory
22357         or not.
22358
22359         (Bounds): Make it a hashtable to prevent the same dimension being 
22360         recorded for every element in that dimension.
22361
22362         (EmitDynamicInitializers): Fix bug which prevented the Set array method
22363         from being found.
22364
22365         Also fix bug which was causing the indices to be emitted in the reverse
22366         order.
22367
22368 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
22369
22370         * expression.cs (ArrayCreation): Implement the bits that Ravi left
22371         unfinished.  They do not work, because the underlying code is
22372         sloppy.
22373
22374 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
22375
22376         * cs-parser.jay: Remove bogus fixme.
22377
22378         * statement.cs (Switch, SwitchSection, SwithLabel): Started work
22379         on Switch statement.
22380
22381 2001-11-23  Ravi Pratap  <ravi@ximian.com>
22382
22383         * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
22384         the same. 
22385
22386         * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
22387         parameter. Apparently, any expression is allowed. 
22388
22389         (ValidateInitializers): Update accordingly.
22390
22391         (CheckIndices): Fix some tricky bugs thanks to recursion.
22392
22393         * delegate.cs (NewDelegate::DoResolve): Re-write large portions as 
22394         I was being completely brain-dead.
22395
22396         (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
22397         and re-write acordingly.
22398
22399         (DelegateInvocation): Re-write accordingly.
22400
22401         * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
22402
22403         (MakeByteBlob): Handle types more correctly.
22404
22405         * expression.cs (ArrayCreation:Emit): Write preliminary code to do
22406         initialization from expressions but it is incomplete because I am a complete
22407         Dodo :-|
22408
22409 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
22410
22411         * statement.cs (If.Emit): Fix a bug that generated incorrect code
22412         on If.  Basically, we have to return `true' (ie, we do return to
22413         our caller) only if both branches of the if return.
22414
22415         * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
22416         short-circuit operators, handle them as short circuit operators. 
22417
22418         (Cast.DoResolve): Resolve type.
22419         (Cast.Cast): Take an expression as the target type.
22420
22421         * cs-parser.jay (cast_expression): Remove old hack that only
22422         allowed a limited set of types to be handled.  Now we take a
22423         unary_expression and we resolve to a type during semantic
22424         analysis.
22425
22426         Use the grammar productions from Rhys to handle casts (this is
22427         not complete like Rhys syntax yet, we fail to handle that corner
22428         case that C# has regarding (-x), but we will get there.
22429
22430 2001-11-22  Ravi Pratap  <ravi@ximian.com>
22431
22432         * class.cs (EmitFieldInitializer): Take care of the case when we have a
22433         field which is an array type.
22434
22435         * cs-parser.jay (declare_local_variables): Support array initialization too.
22436
22437         * typemanager.cs (MakeKey): Implement.
22438
22439         (everywhere): Use the above appropriately.
22440
22441         * cs-parser.jay (for_statement): Update for array initialization while
22442         declaring variables.
22443
22444         * ecore.cs : The error message was correct, it's the variable's names that
22445         were misleading ;-) Make the code more readable.
22446
22447         (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
22448         the correct type etc.
22449
22450         (ConvertExplicit): Handle Enum types by examining the underlying type.
22451
22452 2001-11-21  Ravi Pratap  <ravi@ximian.com>
22453
22454         * parameter.cs (GetCallingConvention): Always return
22455         CallingConventions.Standard for now.
22456
22457 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
22458
22459         * expression.cs (Binary.ResolveOperator): Update the values of `l'
22460         and `r' after calling DoNumericPromotions.
22461
22462         * ecore.cs: Fix error message (the types were in the wrong order).
22463
22464         * statement.cs (Foreach.ProbeCollectionType): Need to pass
22465         BindingFlags.Instance as well 
22466
22467         * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
22468         implicit int literal conversion in an empty cast so that we
22469         propagate the right type upstream.
22470
22471         (UnboxCast): new class used to unbox value types.
22472         (Expression.ConvertExplicit): Add explicit type conversions done
22473         by unboxing.
22474
22475         (Expression.ImplicitNumericConversion): Oops, forgot to test for
22476         the target type before applying the implicit LongLiterals to ULong
22477         literal cast.
22478
22479 2001-11-21  Miguel de Icaza  <miguel@ximian.com>
22480
22481         * cs-parser.jay (for_statement): Reworked the way For works: now
22482         we declare manually any variables that are introduced in
22483         for_initializer to solve the problem of having out-of-band code
22484         emition (that is what got for broken).
22485
22486         (declaration_statement): Perform the actual variable declaration
22487         that used to be done in local_variable_declaration here.
22488
22489         (local_variable_declaration): Do not declare anything, just pass
22490         the information on a DictionaryEntry
22491
22492 2001-11-20  Ravi Pratap  <ravi@ximian.com>
22493
22494         * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
22495         re-write of the logic to now make it recursive.
22496
22497         (UpdateIndices): Re-write accordingly.
22498
22499         Store element data in a separate ArrayData list in the above methods.
22500
22501         (MakeByteBlob): Implement to dump the array data into a byte array.
22502
22503 2001-11-19  Ravi Pratap  <ravi@ximian.com>
22504
22505         * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
22506         into CheckIndices.
22507
22508         * constant.cs (Define): Implement.
22509
22510         (EmitConstant): Re-write fully.
22511
22512         Pass in location info.
22513
22514         * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
22515         respectively.
22516
22517         * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
22518         DictionaryEntry since we need location info too.
22519
22520         (constant_declaration): Update accordingly.
22521
22522         * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
22523         code into another method : UpdateIndices.
22524
22525 2001-11-18  Ravi Pratap  <ravi@ximian.com>
22526
22527         * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
22528         some type checking etc.
22529
22530 2001-11-17  Ravi Pratap  <ravi@ximian.com>
22531
22532         * expression.cs (ArrayCreation::ValidateInitializers): Implement
22533         bits to provide dimension info if the user skips doing that.
22534
22535         Update second constructor to store the rank correctly.
22536
22537 2001-11-16  Ravi Pratap  <ravi@ximian.com>
22538
22539         * expression.cs (ArrayCreation::ValidateInitializers): Poke around
22540         and try to implement.
22541
22542         * ../errors/cs0150.cs : Add.
22543
22544         * ../errors/cs0178.cs : Add.
22545
22546 2001-11-16  Miguel de Icaza  <miguel@ximian.com>
22547
22548         * statement.cs: Implement foreach on multi-dimensional arrays. 
22549
22550         * parameter.cs (Parameters.GetParameterByName): Also lookup the
22551         name of the params argument.
22552
22553         * expression.cs: Use EmitStoreOpcode to get the right opcode while
22554         initializing the array.
22555
22556         (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
22557         we can use this elsewhere.
22558
22559         * statement.cs: Finish implementation of foreach for single
22560         dimension arrays.
22561
22562         * cs-parser.jay: Use an out-of-band stack to pass information
22563         around, I wonder why I need this.
22564
22565         foreach_block: Make the new foreach_block the current_block.
22566
22567         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
22568         function used to return a static Parameters structure.  Used for
22569         empty parameters, as those are created very frequently.
22570
22571         * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
22572
22573 2001-11-15  Ravi Pratap  <ravi@ximian.com>
22574
22575         * interface.cs : Default modifier is private, not public. The
22576         make verify test passes again.
22577
22578 2001-11-15  Ravi Pratap  <ravi@ximian.com>
22579
22580         * support.cs (ReflectionParameters): Fix logic to determine
22581         whether the last parameter is a params one. Test 9 passes again.
22582
22583         * delegate.cs (Populate): Register the builders we define with
22584         RegisterParameterForBuilder. Test 19 passes again.
22585
22586         * cs-parser.jay (property_declaration): Reference $6 instead
22587         of $$ to get at the location.
22588
22589         (indexer_declaration): Similar stuff.
22590
22591         (attribute): Ditto.
22592
22593         * class.cs (Property): Register parameters for the Get and Set methods
22594         if they exist. Test 23 passes again.
22595
22596         * expression.cs (ArrayCreation::Emit): Pass null for the method in the
22597         call to EmitArguments as we are sure there aren't any params arguments. 
22598         Test 32 passes again.
22599
22600         * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
22601         IndexOutOfRangeException. 
22602
22603         * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
22604         Test 33 now passes again.
22605
22606 2001-11-15  Miguel de Icaza  <miguel@ximian.com>
22607
22608         * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
22609         broke a bunch of things.  Will have to come up with a better way
22610         of tracking locations.
22611
22612         * statement.cs: Implemented foreach for single dimension arrays.
22613
22614 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
22615
22616         * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
22617         an error.  This removes the lookup from the critical path.
22618
22619         * cs-parser.jay: Removed use of temporary_loc, which is completely
22620         broken. 
22621
22622 2001-11-14  Miguel de Icaza  <miguel@ximian.com>
22623
22624         * support.cs (ReflectionParameters.ParameterModifier): Report
22625         whether the argument is a PARAMS argument or not.
22626
22627         * class.cs: Set the attribute `ParamArrayAttribute' on the
22628         parameter argument.
22629
22630         * typemanager.cs: Define param_array_type (ParamArrayAttribute)
22631         and cons_param_array_attribute (ConstructorInfo for
22632         ParamArrayAttribute)., 
22633
22634         * codegen.cs: Emit the return using the `Return' statement, that
22635         way we can report the error correctly for missing return values. 
22636
22637         * class.cs (Method.Emit): Clean up.
22638
22639         * expression.cs (Argument.Resolve): Take another argument: the
22640         location where this argument is used.  Notice that this is not
22641         part of the "Argument" class as to reduce the size of the
22642         structure (we know the approximate location anyways).
22643
22644         Test if the argument is a variable-reference, if not, then
22645         complain with a 206.
22646
22647         (Argument.Emit): Emit addresses of variables.
22648
22649         (Argument.FullDesc): Simplify.
22650
22651         (Invocation.DoResolve): Update for Argument.Resolve.
22652
22653         (ElementAccess.DoResolve): ditto.
22654
22655         * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
22656         method should be virtual, as this method is always virtual.
22657
22658         (NewDelegate.DoResolve): Update for Argument.Resolve.
22659
22660         * class.cs (ConstructorInitializer.DoResolve): ditto.
22661
22662         * attribute.cs (Attribute.Resolve): ditto.
22663
22664 2001-11-13  Miguel de Icaza  <miguel@ximian.com>
22665
22666         * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
22667
22668         * expression.cs (ParameterReference): Drop IStackStorage and implement
22669         IAssignMethod instead. 
22670
22671         (LocalVariableReference): ditto.
22672
22673         * ecore.cs (FieldExpr): Drop IStackStorage and implement
22674         IAssignMethod instead. 
22675
22676 2001-11-13  Miguel de Icaza <miguel@ximian.com>
22677
22678         * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
22679         enumerations that are used in heavily used structures derive from
22680         byte in a laughable and pathetic attempt to reduce memory usage.
22681         This is the kind of pre-optimzations that you should not do at
22682         home without adult supervision.
22683
22684         * expression.cs (UnaryMutator): New class, used to handle ++ and
22685         -- separatedly from the other unary operators.  Cleans up the
22686         code, and kills the ExpressionStatement dependency in Unary.
22687
22688         (Unary): Removed `method' and `Arguments' from this class, making
22689         it smaller, and moving it all to SimpleCall, so I can reuse this
22690         code in other locations and avoid creating a lot of transient data
22691         strucutres when not required.
22692
22693         * cs-parser.jay: Adjust for new changes.
22694
22695 2001-11-11  Miguel de Icaza  <miguel@ximian.com>
22696
22697         * enum.cs (Enum.Populate): If there is a failure during
22698         definition, return
22699
22700         * cs-parser.jay (opt_enum_base): we used to catch type errors
22701         here, but this is really incorrect.  The type error should be
22702         catched during semantic analysis.
22703
22704 2001-12-11  Ravi Pratap  <ravi@ximian.com>
22705
22706         * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
22707         current_local_parameters as expected since I, in my stupidity, had forgotten
22708         to do this :-)
22709
22710         * attribute.cs (GetValidPlaces): Fix stupid bug.
22711
22712         * class.cs (Method::Emit): Perform check on applicability of attributes.
22713
22714         (Constructor::Emit): Ditto.
22715
22716         (Field::Emit): Ditto.
22717
22718         (Field.Location): Store location information.
22719
22720         (Property, Event, Indexer, Operator): Ditto.
22721
22722         * cs-parser.jay (field_declaration): Pass in location for each field.
22723
22724         * ../errors/cs0592.cs : Add.
22725
22726 2001-11-12  Ravi Pratap  <ravi@ximian.com>
22727
22728         * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
22729
22730         (InitCoreTypes): Update accordingly.
22731
22732         (RegisterAttrType, LookupAttr): Implement.
22733
22734         * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
22735         info about the same.
22736
22737         (Resolve): Update to populate the above as necessary.
22738
22739         (Error592): Helper.
22740
22741         (GetValidPlaces): Helper to the above.
22742
22743         (CheckAttribute): Implement to perform validity of attributes on declarative elements.
22744
22745         * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
22746
22747 2001-11-12  Ravi Pratap  <ravi@ximian.com>
22748
22749         * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
22750
22751         * ../errors/cs0617.cs : Add.
22752
22753 2001-11-11  Ravi Pratap  <ravi@ximian.com>
22754
22755         * enum.cs (Emit): Rename to Populate to be more consistent with what
22756         we expect it to do and when exactly it is called.
22757
22758         * class.cs, rootcontext.cs : Update accordingly.
22759
22760         * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
22761         FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
22762
22763         * enum.cs (Populate): Register fields with TypeManager.RegisterField.
22764
22765         * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
22766         of a fieldinfo using the above, when dealing with a FieldBuilder.
22767
22768 2001-11-10  Ravi Pratap  <ravi@ximian.com>
22769
22770         * ../errors/cs0031.cs : Add.
22771
22772         * ../errors/cs1008.cs : Add.
22773
22774         * ../errrors/cs0543.cs : Add.
22775
22776         * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
22777         enum type.
22778
22779         (FindMembers): Implement.
22780
22781         * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
22782         enums and delegates too.
22783
22784         (enum_types): Rename to builder_to_enum.
22785
22786         (delegate_types): Rename to builder_to_delegate.
22787
22788         * delegate.cs (FindMembers): Implement.
22789
22790 2001-11-09  Ravi Pratap  <ravi@ximian.com>
22791
22792         * typemanager.cs (IsEnumType): Implement.
22793
22794         * enum.cs (Emit): Re-write parts to account for the underlying type
22795         better and perform checking etc.
22796
22797         (GetNextDefaultValue): Helper to ensure we don't overshoot max value
22798         of the underlying type.
22799
22800         * literal.cs (GetValue methods everywhere): Perform bounds checking and return
22801         value
22802
22803         * enum.cs (error31): Helper to report error #31.
22804
22805         * cs-parser.jay (enum_declaration): Store location of each member too.
22806
22807         * enum.cs (member_to_location): New hashtable. 
22808
22809         (AddEnumMember): Update location hashtable.
22810
22811         (Emit): Use the location of each member while reporting errors.
22812
22813 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
22814
22815         * cs-parser.jay: A for_initializer if is a
22816         local_variable_declaration really ammount to have an implicit
22817         block with the variable declaration and no initializer for for.
22818
22819         * statement.cs (For.Emit): Cope with null initializers.
22820
22821         This fixes the infinite loop on for initializers.
22822
22823 2001-11-08  Miguel de Icaza  <miguel@ximian.com>
22824
22825         * enum.cs: More cleanup.
22826
22827         * ecore.cs: Remove dead code.
22828
22829         * class.cs (Property.Emit): More simplification.
22830         (Event.Emit): ditto.
22831
22832         Reworked to have less levels of indentation.
22833
22834 2001-11-08  Ravi Pratap  <ravi@ximian.com>
22835
22836         * class.cs (Property): Emit attributes.
22837
22838         (Field): Ditto.
22839
22840         (Event): Ditto.
22841
22842         (Indexer): Ditto.
22843
22844         (Operator): Ditto.
22845
22846         * enum.cs (Emit): Ditto.
22847
22848         * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
22849         Enums too.
22850
22851         * class.cs (Field, Event, etc.): Move attribute generation into the
22852         Emit method everywhere.
22853
22854         * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
22855         we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
22856         as we had no way of defining nested enums !
22857
22858         * rootcontext.cs : Adjust code accordingly.
22859
22860         * typemanager.cs (AddEnumType): To keep track of enum types separately.
22861
22862 2001-11-07  Ravi Pratap  <ravi@ximian.com>
22863
22864         * expression.cs (EvalConstantExpression): Move into ecore.cs
22865
22866         * enum.cs (Enum): Rename some members and make them public and readonly
22867         according to our convention.
22868
22869         * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
22870         nothing else.
22871
22872         * enum.cs (Enum::Define): Use the above instead of TypeAttr.
22873
22874         (Enum::Emit): Write a simple version for now which doesn't try to compute
22875         expressions. I shall modify this to be more robust in just a while.
22876
22877         * class.cs (TypeContainer::Emit): Make sure we include Enums too.
22878
22879         (TypeContainer::CloseType): Create the Enum types too.
22880
22881         * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
22882
22883         * expression.cs (EvalConstantExpression): Get rid of completely.
22884
22885         * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
22886         user-defined values and other cases.
22887
22888         (IsValidEnumLiteral): Helper function.
22889
22890         * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing 
22891         out there in the case we had a literal FieldExpr.
22892
22893         (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
22894
22895         (Literalize): Revamp a bit to take two arguments.
22896
22897         (EnumLiteral): New class which derives from Literal to wrap enum literals.
22898
22899 2001-11-06  Ravi Pratap  <ravi@ximian.com>
22900
22901         * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
22902
22903         * expression.cs (ArrayCreation::ValidateInitializers): Implement.
22904
22905         (Resolve): Use the above to ensure we have proper initializers.
22906
22907 2001-11-05  Ravi Pratap  <ravi@ximian.com>
22908
22909         * expression.cs (Expression::EvalConstantExpression): New method to 
22910         evaluate constant expressions.
22911
22912         * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
22913
22914 2001-11-07  Miguel de Icaza  <miguel@ximian.com>
22915
22916         * expression.cs (ArrayCreation.Emit): Some bits to initialize data
22917         in an array.
22918
22919         (Binary.ResolveOperator): Handle operator != (object a, object b)
22920         and operator == (object a, object b);
22921
22922         (Binary.DoNumericPromotions): Indicate whether the numeric
22923         promotion was possible.
22924
22925         (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
22926         Implement.  
22927
22928         Made the ArrayAccess implement interface IAssignMethod instead of
22929         IStackStore as the order in which arguments are passed reflects
22930         this.
22931
22932         * assign.cs: Instead of using expr.ExprClass to select the way of
22933         assinging, probe for the IStackStore/IAssignMethod interfaces.
22934
22935         * typemanager.cs: Load InitializeArray definition.
22936
22937         * rootcontext.cs (RootContext.MakeStaticData): Used to define
22938         static data that can be used to initialize arrays. 
22939
22940 2001-11-05  Miguel de Icaza  <miguel@ximian.com>
22941
22942         * expression.cs: Handle operator== and operator!= for booleans.
22943
22944         (Conditioal.Reduce): Implement reducer for the ?: operator.
22945
22946         (Conditional.Resolve): Implement dead code elimination.
22947
22948         (Binary.Resolve): Catch string literals and return a new
22949         concatenated string.
22950
22951         (Unary.Reduce): Implement reduction of unary expressions.
22952
22953         * ecore.cs: Split out the expression core handling here.
22954
22955         (Expression.Reduce): New method used to perform constant folding
22956         and CSE.  This is needed to support constant-expressions. 
22957
22958         * statement.cs (Statement.EmitBoolExpression): Pass true and false
22959         targets, and optimize for !x.
22960
22961 2001-11-04  Ravi Pratap  <ravi@ximian.com>
22962
22963         * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
22964         of an attribute gives us a CustomAttributeBuilder which we use accordingly to
22965         set custom atttributes.
22966
22967         * literal.cs (Literal::GetValue): New abstract method to return the actual
22968         value of the literal, cast as an object.
22969
22970         (*Literal): Implement GetValue method.
22971
22972         * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
22973         expressions to the arraylist but objects of type Argument.
22974
22975         * class.cs (TypeContainer::Emit): Emit our attributes too.
22976
22977         (Method::Emit, Constructor::Emit): Ditto.
22978
22979         * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
22980         to be ignoring earlier.
22981
22982 2001-11-03  Ravi Pratap  <ravi@ximian.com>
22983
22984         * attribute.cs (AttributeSection::Define): Implement to do the business
22985         of constructing a CustomAttributeBuilder.
22986
22987         (Attribute): New trivial class. Increases readability of code.  
22988
22989         * cs-parser.jay : Update accordingly.
22990
22991         (positional_argument_list, named_argument_list, named_argument): New rules
22992
22993         (attribute_arguments): Use the above so that we are more correct.
22994
22995 2001-11-02  Ravi Pratap  <ravi@ximian.com>
22996
22997         * expression.cs (Invocation::IsParamsMethodApplicable): Implement
22998         to perform all checks for a method with a params parameter.
22999
23000         (Invocation::OverloadResolve): Update to use the above method and therefore
23001         cope correctly with params method invocations.
23002
23003         * support.cs (InternalParameters::ParameterDesc): Provide a desc for 
23004         params too.
23005
23006         * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
23007         constructors in our parent too because we can't afford to miss out on 
23008         protected ones ;-)
23009
23010         * attribute.cs (AttributeSection): New name for the class Attribute
23011
23012         Other trivial changes to improve readability.
23013
23014         * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
23015         use the new class names.
23016
23017 2001-11-01  Ravi Pratap  <ravi@ximian.com>
23018
23019         * class.cs (Method::Define): Complete definition for params types too
23020
23021         (Indexer::Define): Ditto.
23022
23023         * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
23024         Cope everywhere with a request for info about the array parameter.
23025
23026 2001-11-01  Ravi Pratap  <ravi@ximian.com>
23027
23028         * tree.cs (RecordNamespace): Fix up to check for the correct key.
23029
23030         * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in 
23031         local_variable_type to extract the string corresponding to the type.
23032
23033         (local_variable_type): Fixup the action to use the new helper method.
23034
23035         * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to 
23036         go.
23037
23038         * expression.cs : Clean out code which uses the above.
23039
23040 2001-10-31  Ravi Pratap  <ravi@ximian.com>
23041
23042         * typemanager.cs (RegisterMethod): Check if we already have an existing key
23043         and bale out if necessary by returning a false.
23044
23045         (RegisterProperty): Ditto.
23046
23047         * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
23048         and print out appropriate error messages.
23049
23050         * interface.cs (everywhere): Ditto.
23051
23052         * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
23053         location to constructor.
23054
23055         * class.cs (Property, Event, Indexer): Update accordingly.
23056
23057         * ../errors/cs111.cs : Added.
23058
23059         * expression.cs (Invocation::IsApplicable): New static method to determine applicability
23060         of a method, as laid down by the spec.
23061
23062         (Invocation::OverloadResolve): Use the above method.
23063
23064 2001-10-31  Ravi Pratap  <ravi@ximian.com>
23065
23066         * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
23067         now take a TypeContainer and a Parameters object.
23068
23069         (ParameterData): Modify return type of ParameterModifier method to be 
23070         Parameter.Modifier and not a string.
23071
23072         (ReflectionParameters, InternalParameters): Update accordingly.
23073
23074         * expression.cs (Argument::GetParameterModifier): Same here.
23075
23076         * support.cs (InternalParameters::ParameterType): Find a better way of determining
23077         if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
23078         symbol in it at all so maybe this is only for now.
23079
23080 2001-10-30  Ravi Pratap  <ravi@ximian.com>
23081
23082         * support.cs (InternalParameters): Constructor now takes an extra argument 
23083         which is the actual Parameters class.
23084
23085         (ParameterDesc): Update to provide info on ref/out modifiers.
23086
23087         * class.cs (everywhere): Update call to InternalParameters to pass in
23088         the second argument too.
23089
23090         * support.cs (ParameterData): Add ParameterModifier, which is a method 
23091         to return the modifier info [ref/out etc]
23092
23093         (InternalParameters, ReflectionParameters): Implement the above.
23094
23095         * expression.cs (Argument::ParameterModifier): Similar function to return
23096         info about the argument's modifiers.
23097
23098         (Invocation::OverloadResolve): Update to take into account matching modifiers 
23099         too.
23100
23101         * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
23102         a new SetFormalParameters object which we pass to InternalParameters.
23103
23104 2001-10-30  Ravi Pratap  <ravi@ximian.com>
23105
23106         * expression.cs (NewArray): Merge into the ArrayCreation class.
23107
23108 2001-10-29  Ravi Pratap  <ravi@ximian.com>
23109
23110         * expression.cs (NewArray): Merge classes NewBuiltinArray and 
23111         NewUserdefinedArray into one as there wasn't much of a use in having
23112         two separate ones.
23113
23114         * expression.cs (Argument): Change field's name to ArgType from Type.
23115
23116         (Type): New readonly property which returns the proper type, taking into 
23117         account ref/out modifiers.
23118
23119         (everywhere): Adjust code accordingly for the above.
23120
23121         * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
23122         whether we are emitting for a ref or out parameter.
23123
23124         * expression.cs (Argument::Emit): Use the above field to set the state.
23125
23126         (LocalVariableReference::Emit): Update to honour the flag and emit the
23127         right stuff.
23128
23129         * parameter.cs (Attributes): Set the correct flags for ref parameters.
23130
23131         * expression.cs (Argument::FullDesc): New function to provide a full desc.
23132
23133         * support.cs (ParameterData): Add method ParameterDesc to the interface.
23134
23135         (ReflectionParameters, InternalParameters): Implement the above method.
23136
23137         * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
23138         reporting errors.
23139
23140         (Invocation::FullMethodDesc): Ditto. 
23141
23142 2001-10-29  Miguel de Icaza  <miguel@ximian.com>
23143
23144         * cs-parser.jay: Add extra production for the second form of array
23145         creation. 
23146
23147         * expression.cs (ArrayCreation): Update to reflect the above
23148         change. 
23149
23150         * Small changes to prepare for Array initialization.
23151
23152 2001-10-28  Miguel de Icaza  <miguel@ximian.com>
23153
23154         * typemanager.cs (ImplementsInterface): interface might be null;
23155         Deal with this problem;
23156
23157         Also, we do store negative hits on the cache (null values), so use
23158         this instead of calling t.GetInterfaces on the type everytime.
23159
23160 2001-10-28  Ravi Pratap  <ravi@ximian.com>
23161
23162         * typemanager.cs (IsBuiltinType): New method to help determine the same.
23163
23164         * expression.cs (New::DoResolve): Get rid of array creation code and instead
23165         split functionality out into different classes.
23166
23167         (New::FormArrayType): Move into NewBuiltinArray.
23168
23169         (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
23170         quite useless.
23171
23172         (NewBuiltinArray): New class to handle creation of built-in arrays.
23173
23174         (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
23175         account creation of one-dimensional arrays.
23176
23177         (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
23178
23179         (NewUserdefinedArray::DoResolve): Implement.
23180
23181         * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
23182
23183         * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
23184         we maintain inside the TypeManager. This is necessary to perform lookups on the
23185         module builder.
23186
23187         (LookupType): Update to perform GetType on the module builders too.     
23188
23189         * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
23190
23191         * exprssion.cs (NewUserdefinedArray::Emit): Implement.
23192
23193 2001-10-23  Ravi Pratap  <ravi@ximian.com>
23194
23195         * expression.cs (New::DoResolve): Implement guts of array creation.
23196
23197         (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
23198
23199 2001-10-27  Miguel de Icaza  <miguel@ximian.com>
23200
23201         * expression.cs: Fix bug I introduced lsat night that broke
23202         Delegates. 
23203
23204         (Expression.Resolve): Report a 246 error (can not resolve name)
23205         if we find a SimpleName in the stream.
23206
23207         (Expression.ResolveLValue): Ditto.
23208
23209         (Expression.ResolveWithSimpleName): This function is a variant of
23210         ResolveName, this one allows SimpleNames to be returned without a
23211         warning.  The only consumer of SimpleNames is MemberAccess
23212
23213 2001-10-26  Miguel de Icaza  <miguel@ximian.com>
23214
23215         * expression.cs (Invocation::DoResolve): Catch SimpleNames that
23216         might arrive here.  I have my doubts that this is correct.
23217
23218         * statement.cs (Lock): Implement lock statement.
23219
23220         * cs-parser.jay: Small fixes to support `lock' and `using'
23221
23222         * cs-tokenizer.cs: Remove extra space
23223
23224         * driver.cs: New flag --checked, allows to turn on integer math
23225         checking. 
23226
23227         * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
23228         Threading.Monitor.Exit 
23229
23230 2001-10-23  Miguel de Icaza  <miguel@ximian.com>
23231
23232         * expression.cs (IndexerAccess::DoResolveLValue): Set the
23233         Expression Class to be IndexerAccess.
23234
23235         Notice that Indexer::DoResolve sets the eclass to Value.
23236
23237 2001-10-22  Miguel de Icaza  <miguel@ximian.com>
23238
23239         * class.cs (TypeContainer::Emit): Emit code for indexers.
23240
23241         * assign.cs (IAssignMethod): New interface implemented by Indexers
23242         and Properties for handling assignment.
23243
23244         (Assign::Emit): Simplify and reuse code. 
23245
23246         * expression.cs (IndexerAccess, PropertyExpr): Implement
23247         IAssignMethod, clean up old code. 
23248
23249 2001-10-22  Ravi Pratap  <ravi@ximian.com>
23250
23251         * typemanager.cs (ImplementsInterface): New method to determine if a type
23252         implements a given interface. Provides a nice cache too.
23253
23254         * expression.cs (ImplicitReferenceConversion): Update checks to use the above
23255         method.
23256
23257         (ConvertReferenceExplicit): Ditto.
23258
23259         * delegate.cs (Delegate::Populate): Update to define the parameters on the 
23260         various methods, with correct names etc.
23261
23262         * class.cs (Operator::OpType): New members Operator.UnaryPlus and 
23263         Operator.UnaryNegation.
23264
23265         * cs-parser.jay (operator_declarator): Be a little clever in the case where
23266         we have a unary plus or minus operator.
23267
23268         * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and 
23269         UnaryMinus.
23270
23271         * everywhere : update accordingly.
23272
23273         * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
23274         respectively.
23275
23276         * class.cs (Method::Define): For the case where we are implementing a method
23277         inherited from an interface, we need to set the MethodAttributes.Final flag too. 
23278         Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
23279
23280 2001-10-21  Ravi Pratap  <ravi@ximian.com>
23281
23282         * interface.cs (FindMembers): Implement to work around S.R.E
23283         lameness.
23284
23285         * typemanager.cs (IsInterfaceType): Implement.
23286
23287         (FindMembers): Update to handle interface types too.
23288
23289         * expression.cs (ImplicitReferenceConversion): Re-write bits which
23290         use IsAssignableFrom as that is not correct - it doesn't work.
23291
23292         * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
23293         and accordingly override EmitStatement.
23294
23295         * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
23296         using the correct logic :-)
23297
23298 2001-10-19  Ravi Pratap  <ravi@ximian.com>
23299
23300         * ../errors/cs-11.cs : Add to demonstrate error -11 
23301
23302 2001-10-17  Miguel de Icaza  <miguel@ximian.com>
23303
23304         * assign.cs (Assign::Resolve): Resolve right hand side first, and
23305         then pass this as a hint to ResolveLValue.
23306
23307         * expression.cs (FieldExpr): Add Location information
23308
23309         (FieldExpr::LValueResolve): Report assignment to readonly
23310         variable. 
23311
23312         (Expression::ExprClassFromMemberInfo): Pass location information.
23313
23314         (Expression::ResolveLValue): Add new method that resolves an
23315         LValue. 
23316
23317         (Expression::DoResolveLValue): Default invocation calls
23318         DoResolve. 
23319
23320         (Indexers): New class used to keep track of indexers in a given
23321         Type. 
23322
23323         (IStackStore): Renamed from LValue, as it did not really describe
23324         what this did.  Also ResolveLValue is gone from this interface and
23325         now is part of Expression.
23326
23327         (ElementAccess): Depending on the element access type
23328
23329         * typemanager.cs: Add `indexer_name_type' as a Core type
23330         (System.Runtime.CompilerServices.IndexerNameAttribute)
23331
23332         * statement.cs (Goto): Take a location.
23333
23334 2001-10-18  Ravi Pratap  <ravi@ximian.com>
23335
23336         * delegate.cs (Delegate::VerifyDelegate): New method to verify
23337         if two delegates are compatible.
23338
23339         (NewDelegate::DoResolve): Update to take care of the case when
23340         we instantiate a delegate from another delegate.
23341
23342         * typemanager.cs (FindMembers): Don't even try to look up members
23343         of Delegate types for now.
23344
23345 2001-10-18  Ravi Pratap  <ravi@ximian.com>
23346
23347         * delegate.cs (NewDelegate): New class to take care of delegate
23348         instantiation.
23349
23350         * expression.cs (New): Split the delegate related code out into 
23351         the NewDelegate class.
23352
23353         * delegate.cs (DelegateInvocation): New class to handle delegate 
23354         invocation.
23355
23356         * expression.cs (Invocation): Split out delegate related code into
23357         the DelegateInvocation class.
23358
23359 2001-10-17  Ravi Pratap  <ravi@ximian.com>
23360
23361         * expression.cs (New::DoResolve): Implement delegate creation fully
23362         and according to the spec.
23363
23364         (New::DoEmit): Update to handle delegates differently.
23365
23366         (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
23367         because of which we were printing out arguments in reverse order !
23368
23369         * delegate.cs (VerifyMethod): Implement to check if the given method
23370         matches the delegate.
23371
23372         (FullDelegateDesc): Implement.
23373
23374         (VerifyApplicability): Implement.
23375
23376         * expression.cs (Invocation::DoResolve): Update to accordingly handle
23377         delegate invocations too.
23378
23379         (Invocation::Emit): Ditto.
23380
23381         * ../errors/cs1593.cs : Added.
23382
23383         * ../errors/cs1594.cs : Added.
23384
23385         * delegate.cs (InstanceExpression, TargetMethod): New properties.
23386
23387 2001-10-16  Ravi Pratap  <ravi@ximian.com>
23388
23389         * typemanager.cs (intptr_type): Core type for System.IntPtr
23390
23391         (InitCoreTypes): Update for the same.
23392
23393         (iasyncresult_type, asynccallback_type): Ditto.
23394
23395         * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
23396         correct.
23397
23398         * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
23399         too.
23400
23401         * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
23402         the builders for the 4 members of a delegate type :-)
23403
23404         (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
23405         type.
23406
23407         * expression.cs (New::DoResolve): Implement guts for delegate creation.
23408
23409         * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
23410
23411 2001-10-15  Miguel de Icaza  <miguel@ximian.com>
23412
23413         * statement.cs (Break::Emit): Implement.   
23414         (Continue::Emit): Implement.
23415
23416         (For::Emit): Track old being/end loops;  Set Begin loop, ack end loop
23417         (While::Emit): Track old being/end loops;  Set Begin loop, ack end loop
23418         (Do::Emit): Track old being/end loops;  Set Begin loop, ack end loop
23419         (Foreach::Emit): Track old being/end loops;  Set Begin loop, ack
23420         end loop
23421
23422         * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
23423         properties that track the label for the current loop (begin of the
23424         loop and end of the loop).
23425
23426 2001-10-15  Ravi Pratap  <ravi@ximian.com>
23427
23428         * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
23429         use of emitting anything at all.
23430
23431         * class.cs, rootcontext.cs : Get rid of calls to the same.
23432
23433         * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
23434
23435         (Populate): Define the constructor correctly and set the implementation
23436         attributes.
23437
23438         * typemanager.cs (delegate_types): New hashtable to hold delegates that
23439         have been defined.
23440
23441         (AddDelegateType): Implement.
23442
23443         (IsDelegateType): Implement helper method.
23444
23445         * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
23446
23447         * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
23448         and accordingly handle it.
23449
23450         * delegate.cs (Populate): Take TypeContainer argument.
23451         Implement bits to define the Invoke method. However, I still haven't figured out
23452         how to take care of the native int bit :-(
23453
23454         * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-) 
23455         Qualify the name of the delegate, not its return type !
23456
23457         * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
23458         conversion.
23459
23460         (StandardConversionExists): Checking for array types turns out to be recursive.
23461
23462         (ConvertReferenceExplicit): Implement array conversion.
23463
23464         (ExplicitReferenceConversionExists): New method to determine precisely that :-)
23465
23466 2001-10-12  Ravi Pratap  <ravi@ximian.com>
23467
23468         * cs-parser.jay (delegate_declaration): Store the fully qualified
23469         name as it is a type declaration.
23470
23471         * delegate.cs (ReturnType, Name): Rename members to these. Make them 
23472         readonly.
23473
23474         (DefineDelegate): Renamed from Define. Does the same thing essentially,
23475         as TypeContainer::DefineType.
23476
23477         (Populate): Method in which all the definition of the various methods (Invoke)
23478         etc is done.
23479
23480         (Emit): Emit any code, if necessary. I am not sure about this really, but let's
23481         see.
23482
23483         (CloseDelegate): Finally creates the delegate.
23484
23485         * class.cs (TypeContainer::DefineType): Update to define delegates.
23486         (Populate, Emit and CloseType): Do the same thing here too.
23487
23488         * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
23489         delegates in all these operations.
23490
23491 2001-10-14  Miguel de Icaza  <miguel@ximian.com>
23492
23493         * expression.cs: LocalTemporary: a new expression used to
23494         reference a temporary that has been created.
23495
23496         * assign.cs: Handle PropertyAccess back here, so that we can
23497         provide the proper semantic access to properties.
23498
23499         * expression.cs (Expression::ConvertReferenceExplicit): Implement
23500         a few more explicit conversions. 
23501
23502         * modifiers.cs: `NEW' modifier maps to HideBySig.
23503
23504         * expression.cs (PropertyExpr): Make this into an
23505         ExpressionStatement, and support the EmitStatement code path. 
23506
23507         Perform get/set error checking, clean up the interface.
23508
23509         * assign.cs: recognize PropertyExprs as targets, and if so, turn
23510         them into toplevel access objects.
23511
23512 2001-10-12  Miguel de Icaza  <miguel@ximian.com>
23513
23514         * expression.cs: PropertyExpr::PropertyExpr: use work around the
23515         SRE.
23516
23517         * typemanager.cs: Keep track here of our PropertyBuilders again to
23518         work around lameness in SRE.
23519
23520 2001-10-11  Miguel de Icaza  <miguel@ximian.com>
23521
23522         * expression.cs (LValue::LValueResolve): New method in the
23523         interface, used to perform a second resolution pass for LValues. 
23524
23525         (This::DoResolve): Catch the use of this in static methods.
23526
23527         (This::LValueResolve): Implement.
23528
23529         (This::Store): Remove warning, assigning to `this' in structures
23530         is 
23531
23532         (Invocation::Emit): Deal with invocation of
23533         methods on value types.  We need to pass the address to structure
23534         methods rather than the object itself.  (The equivalent code to
23535         emit "this" for structures leaves the entire structure on the
23536         stack instead of a pointer to it). 
23537
23538         (ParameterReference::DoResolve): Compute the real index for the
23539         argument based on whether the method takes or not a `this' pointer
23540         (ie, the method is static).
23541
23542         * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
23543         value types returned from functions when we need to invoke a
23544         method on the sturcture.
23545
23546
23547 2001-10-11  Ravi Pratap  <ravi@ximian.com>
23548
23549         * class.cs (TypeContainer::DefineType): Method to actually do the business of
23550         defining the type in the Modulebuilder or Typebuilder. This is to take
23551         care of nested types which need to be defined on the TypeBuilder using
23552         DefineNestedMethod.
23553
23554         (TypeContainer::GetClassBases): Implement. Essentially the code from the 
23555         methods in RootContext, only ported to be part of TypeContainer.
23556
23557         (TypeContainer::GetInterfaceOrClass): Ditto.
23558
23559         (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
23560
23561         * interface.cs (Interface::DefineInterface): New method. Does exactly
23562         what RootContext.CreateInterface did earlier, only it takes care of nested types 
23563         too.
23564
23565         (Interface::GetInterfaces): Move from RootContext here and port.
23566
23567         (Interface::GetInterfaceByName): Same here.
23568
23569         * rootcontext.cs (ResolveTree): Re-write.
23570
23571         (PopulateTypes): Re-write.
23572
23573         * class.cs (TypeContainer::Populate): Populate nested types too.
23574         (TypeContainer::Emit): Emit nested members too.
23575
23576         * typemanager.cs (AddUserType): Do not make use of the FullName property,
23577         instead just use the name argument passed in as it is already fully
23578         qualified.
23579
23580         (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
23581         to TypeContainer mapping to see if a type is user-defined.
23582
23583         * class.cs (TypeContainer::CloseType): Implement. 
23584
23585         (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
23586         the default constructor.
23587
23588         (TypeContainer::Populate): Fix minor bug which led to creating default constructors
23589         twice.
23590
23591         (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
23592
23593         * interface.cs (CloseType): Create the type here.
23594
23595         * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
23596         the hierarchy.
23597
23598         Remove all the methods which are now in TypeContainer.
23599
23600 2001-10-10  Ravi Pratap  <ravi@ximian.com>
23601
23602         * delegate.cs (Define): Re-write bits to define the delegate
23603         correctly.
23604
23605 2001-10-10  Miguel de Icaza  <miguel@ximian.com>
23606
23607         * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
23608
23609         * expression.cs (ImplicitReferenceConversion): handle null as well
23610         as a source to convert to any reference type.
23611
23612         * statement.cs (Return): Perform any implicit conversions to
23613         expected return type.  
23614
23615         Validate use of return statement.  
23616
23617         * codegen.cs (EmitContext): Pass the expected return type here.
23618
23619         * class.cs (Method, Constructor, Property): Pass expected return
23620         type to EmitContext.
23621
23622 2001-10-09  Miguel de Icaza  <miguel@ximian.com>
23623
23624         * expression.cs: Make DoResolve take an EmitContext instead of a
23625         TypeContainer.
23626
23627         Replaced `l' and `location' for `loc', for consistency.
23628
23629         (Error, Warning): Remove unneeded Tc argument.
23630
23631         * assign.cs, literal.cs, constant.cs: Update to new calling
23632         convention. 
23633
23634         * codegen.cs: EmitContext now contains a flag indicating whether
23635         code is being generated in a static method or not.
23636
23637         * cs-parser.jay: DecomposeQI, new function that replaces the old
23638         QualifiedIdentifier.  Now we always decompose the assembled
23639         strings from qualified_identifier productions into a group of
23640         memberaccesses.
23641
23642 2001-10-08  Miguel de Icaza  <miguel@ximian.com>
23643
23644         * rootcontext.cs: Deal with field-less struct types correctly now
23645         by passing the size option to Define Type.
23646
23647         * class.cs: Removed hack that created one static field. 
23648
23649 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
23650
23651         * statement.cs: Moved most of the code generation here. 
23652
23653 2001-10-09  Ravi Pratap  <ravi@ximian.com>
23654
23655         * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
23656         seem very right.
23657
23658         (ElementAccess): Remove useless bits for now - keep checks as the spec
23659         says.
23660
23661 2001-10-08  Ravi Pratap  <ravi@ximian.com>
23662
23663         * expression.cs (ElementAccess::DoResolve): Remove my crap code
23664         and start performing checks according to the spec.
23665
23666 2001-10-07  Ravi Pratap  <ravi@ximian.com>
23667
23668         * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
23669         rank_specifiers instead.
23670
23671         (rank_specifiers): Change the order in which the rank specifiers are stored
23672
23673         (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
23674
23675         * expression.cs (ElementAccess): Implement the LValue interface too.
23676
23677 2001-10-06  Ravi Pratap  <ravi@ximian.com>
23678
23679         * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
23680         except that user defined conversions are not included.
23681
23682         (UserDefinedConversion): Update to use the ConvertExplicitStandard to 
23683         perform the conversion of the return type, if necessary.
23684
23685         (New::DoResolve): Check whether we are creating an array or an object
23686         and accordingly do the needful.
23687
23688         (New::Emit): Same here.
23689
23690         (New::DoResolve): Implement guts of array creation.
23691
23692         (New::FormLookupType): Helper function.
23693
23694 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
23695
23696         * codegen.cs: Removed most of the code generation here, and move the
23697         corresponding code generation bits to the statement classes. 
23698
23699         Added support for try/catch/finalize and throw.
23700
23701         * cs-parser.jay: Added support for try/catch/finalize.
23702
23703         * class.cs: Catch static methods having the flags override,
23704         virtual or abstract.
23705
23706         * expression.cs (UserCast): This user cast was not really doing
23707         what it was supposed to do.  Which is to be born in fully resolved
23708         state.  Parts of the resolution were being performed at Emit time! 
23709
23710         Fixed this code.
23711
23712 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
23713
23714         * expression.cs: Implicity convert the result from UserCast.
23715
23716 2001-10-05  Ravi Pratap  <ravi@ximian.com>
23717
23718         * expression.cs (Expression::FindMostEncompassingType): Fix bug which
23719         prevented it from working correctly. 
23720
23721         (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
23722         merely ConvertImplicit.
23723
23724 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
23725
23726         * typemanager.cs: Make the LookupTypeContainer function static,
23727         and not per-instance.  
23728
23729         * class.cs: Make static FindMembers (the one that takes a Type
23730         argument). 
23731
23732         * codegen.cs: Add EmitForeach here.
23733
23734         * cs-parser.jay: Make foreach a toplevel object instead of the
23735         inline expansion, as we need to perform semantic analysis on it. 
23736
23737 2001-10-05  Ravi Pratap  <ravi@ximian.com>
23738
23739         * expression.cs (Expression::ImplicitUserConversion): Rename to
23740         UserDefinedConversion.
23741
23742         (Expression::UserDefinedConversion): Take an extra argument specifying 
23743         whether we look for explicit user conversions too.
23744
23745         (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
23746
23747         (UserDefinedConversion): Incorporate support for user defined explicit conversions.
23748
23749         (ExplicitUserConversion): Make it a call to UserDefinedConversion
23750         with the appropriate arguments.
23751
23752         * cs-parser.jay (cast_expression): Record location too.
23753
23754         * expression.cs (Cast): Record location info.
23755
23756         (Expression::ConvertExplicit): Take location argument.
23757
23758         (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
23759         to determine if we are doing explicit conversions.
23760
23761         (UserCast::Emit): Update accordingly.
23762
23763         (Expression::ConvertExplicit): Report an error if everything fails.
23764
23765         * ../errors/cs0030.cs : Add.
23766
23767 2001-10-04  Miguel de Icaza  <miguel@ximian.com>
23768
23769         * modifiers.cs: If the ABSTRACT keyword is present, also set the
23770         virtual and newslot bits. 
23771
23772         * class.cs (TypeContainer::RegisterRequiredImplementations):
23773         Record methods we need.
23774
23775         (TypeContainer::MakeKey): Helper function to make keys for
23776         MethodBases, since the Methodbase key is useless.
23777
23778         (TypeContainer::Populate): Call RegisterRequiredImplementations
23779         before defining the methods.   
23780
23781         Create a mapping for method_builders_to_methods ahead of time
23782         instead of inside a tight loop.
23783
23784         (::RequireMethods):  Accept an object as the data to set into the
23785         hashtable so we can report interface vs abstract method mismatch.
23786
23787 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
23788
23789         * report.cs: Make all of it static.
23790
23791         * rootcontext.cs: Drop object_type and value_type computations, as
23792         we have those in the TypeManager anyways.
23793
23794         Drop report instance variable too, now it is a global.
23795
23796         * driver.cs: Use try/catch on command line handling.
23797
23798         Add --probe option to debug the error reporting system with a test
23799         suite. 
23800
23801         * report.cs: Add support for exiting program when a probe
23802         condition is reached.
23803
23804 2001-10-03  Ravi Pratap  <ravi@ximian.com>
23805
23806         * expression.cs (Binary::DoNumericPromotions): Fix the case when
23807         we do a forcible conversion regardless of type, to check if 
23808         ForceConversion returns a null.
23809
23810         (Binary::error19): Use location to report error.
23811
23812         (Unary::error23): Use location here too.
23813
23814         * ../errors/cs0019.cs : Check in.
23815
23816         * ../errors/cs0023.cs : Check in.
23817
23818         * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
23819         case of a non-null MethodInfo object with a length of 0 !
23820
23821         (Binary::ResolveOperator): Flag error if overload resolution fails to find
23822         an applicable member - according to the spec :-)
23823         Also fix logic to find members in base types.
23824
23825         (Unary::ResolveOperator): Same here.
23826
23827         (Unary::report23): Change name to error23 and make first argument a TypeContainer
23828         as I was getting thoroughly confused between this and error19 :-)
23829
23830         * expression.cs (Expression::ImplicitUserConversion): Re-write fully
23831         (::FindMostEncompassedType): Implement.
23832         (::FindMostEncompassingType): Implement.
23833         (::StandardConversionExists): Implement.
23834
23835         (UserImplicitCast): Re-vamp. We now need info about most specific
23836         source and target types so that we can do the necessary conversions.
23837
23838         (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
23839         mathematical union with no duplicates.
23840
23841 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
23842
23843         * rootcontext.cs (RootContext::PopulateTypes): Populate containers
23844         in order from base classes to child classes, so that we can in
23845         child classes look up in our parent for method names and
23846         attributes (required for handling abstract, virtual, new, override
23847         constructs: we need to instrospect our base class, and if we dont
23848         populate the classes in order, the introspection might be
23849         incorrect.  For example, a method could query its parent before
23850         the parent has any methods and would determine that the parent has
23851         no abstract methods (while it could have had them)).
23852
23853         (RootContext::CreateType): Record the order in which we define the
23854         classes.
23855
23856 2001-10-02  Miguel de Icaza  <miguel@ximian.com>
23857
23858         * class.cs (TypeContainer::Populate): Also method definitions can
23859         fail now, keep track of this.
23860
23861         (TypeContainer::FindMembers): Implement support for
23862         DeclaredOnly/noDeclaredOnly flag.
23863
23864         (Constructor::Emit) Return the ConstructorBuilder.
23865
23866         (Method::Emit) Return the MethodBuilder. 
23867         Check for abstract or virtual methods to be public.
23868
23869         * rootcontext.cs (RootContext::CreateType): Register all the
23870         abstract methods required for the class to be complete and the
23871         interface methods that must be implemented. 
23872
23873         * cs-parser.jay: Report error 501 (method requires body if it is
23874         not marked abstract or extern).
23875
23876         * expression.cs (TypeOf::Emit): Implement.
23877
23878         * typemanager.cs: runtime_handle_type, new global type.
23879
23880         * class.cs (Property::Emit): Generate code for properties.
23881
23882 2001-10-02  Ravi Pratap  <ravi@ximian.com>
23883
23884         * expression.cs (Unary::ResolveOperator): Find operators on base type
23885         too - we now conform exactly to the spec.
23886
23887         (Binary::ResolveOperator): Same here.
23888
23889         * class.cs (Operator::Define): Fix minor quirk in the tests.
23890
23891         * ../errors/cs0215.cs : Added.
23892
23893         * ../errors/cs0556.cs : Added.
23894
23895         * ../errors/cs0555.cs : Added.
23896
23897 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
23898
23899         * cs-tokenizer.cs: Reimplemented Location to be a struct with a
23900         single integer which is really efficient
23901
23902 2001-10-01  Ravi Pratap  <ravi@ximian.com>
23903
23904         *  expression.cs (Expression::ImplicitUserConversion): Use location
23905         even in the case when we are examining True operators.
23906  
23907         * class.cs (Operator::Define): Perform extensive checks to conform
23908         with the rules for operator overloading in the spec.
23909
23910         * expression.cs (Expression::ImplicitReferenceConversion): Implement
23911         some of the other conversions mentioned in the spec.
23912
23913         * typemanager.cs (array_type): New static member for the System.Array built-in
23914         type.
23915
23916         (cloneable_interface): For System.ICloneable interface.
23917
23918         * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
23919         we start resolving the tree and populating types.
23920
23921         * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
23922  
23923 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
23924
23925         * expression.cs (Expression::ExprClassFromMemberInfo,
23926         Expression::Literalize): Create literal expressions from
23927         FieldInfos which are literals.
23928
23929         (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
23930         type casts, because they were wrong.  The test suite in tests
23931         caught these ones.
23932
23933         (ImplicitNumericConversion): ushort to ulong requires a widening
23934         cast. 
23935
23936         Int32 constant to long requires widening cast as well.
23937
23938         * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
23939         for integers because the type on the stack is not i4.
23940
23941 2001-09-30  Miguel de Icaza  <miguel@ximian.com>
23942
23943         * expression.cs (report118): require location argument. 
23944
23945         * parameter.cs: Do not dereference potential null value.
23946
23947         * class.cs: Catch methods that lack the `new' keyword when
23948         overriding a name.  Report warnings when `new' is used without
23949         anything being there to override.
23950
23951         * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
23952
23953         * class.cs: Only add constructor to hashtable if it is non-null
23954         (as now constructors can fail on define).
23955
23956         (TypeManager, Class, Struct): Take location arguments.
23957
23958         Catch field instance initialization in structs as errors.
23959
23960         accepting_filter: a new filter for FindMembers that is static so
23961         that we dont create an instance per invocation.
23962
23963         (Constructor::Define): Catch errors where a struct constructor is
23964         parameterless 
23965
23966         * cs-parser.jay: Pass location information for various new
23967         constructs. 
23968
23969         * delegate.cs (Delegate): take a location argument.
23970
23971         * driver.cs: Do not call EmitCode if there were problesm in the
23972         Definition of the types, as many Builders wont be there. 
23973
23974         * decl.cs (Decl::Decl): Require a location argument.
23975
23976         * cs-tokenizer.cs: Handle properly hex constants that can not fit
23977         into integers, and find the most appropiate integer for it.
23978
23979         * literal.cs: Implement ULongLiteral.
23980
23981         * rootcontext.cs: Provide better information about the location of
23982         failure when CreateType fails.
23983
23984 2001-09-29  Miguel de Icaza  <miguel@ximian.com>
23985
23986         * rootcontext.cs (RootContext::PopulateTypes): Populates structs
23987         as well.
23988
23989         * expression.cs (Binary::CheckShiftArguments): Add missing type
23990         computation.
23991         (Binary::ResolveOperator): Add type to the logical and and logical
23992         or, Bitwise And/Or and Exclusive Or code paths, it was missing
23993         before.
23994
23995         (Binary::DoNumericPromotions): In the case where either argument
23996         is ulong (and most signed types combined with ulong cause an
23997         error) perform implicit integer constant conversions as well.
23998
23999 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
24000
24001         * expression.cs (UserImplicitCast): Method should always be
24002         non-null. 
24003         (Invocation::BetterConversion): Simplified test for IntLiteral.
24004
24005         (Expression::ImplicitNumericConversion): Split this routine out.
24006         Put the code that performs implicit constant integer conversions
24007         here. 
24008
24009         (Expression::Resolve): Become a wrapper around DoResolve so we can
24010         check eclass and type being set after resolve.
24011
24012         (Invocation::Badness): Remove this dead function
24013
24014         (Binary::ResolveOperator): Do not compute the expensive argumnets
24015         unless we have a union for it.
24016
24017         (Probe::Emit): Is needs to do an isinst and then
24018         compare against null.
24019
24020         (::CanConvert): Added Location argument.  If the Location argument
24021         is null (Location.Null), then we do not report errors.  This is
24022         used by the `probe' mechanism of the Explicit conversion.  We do
24023         not want to generate an error for something that the user
24024         explicitly requested to be casted.  But the pipeline for an
24025         explicit cast first tests for potential implicit casts.
24026
24027         So for now, if the Location is null, it means `Probe only' to
24028         avoid adding another argument.   Might have to revise this
24029         strategy later.
24030
24031         (ClassCast): New class used to type cast objects into arbitrary
24032         classes (used in Explicit Reference Conversions).
24033
24034         Implement `as' as well.
24035
24036         Reverted all the patches from Ravi below: they were broken:
24037
24038                 * The use of `level' as a mechanism to stop recursive
24039                   invocations is wrong.  That was there just to catch the
24040                   bug with a strack trace but not as a way of addressing
24041                   the problem.
24042
24043                   To fix the problem we have to *understand* what is going
24044                   on and the interactions and come up with a plan, not
24045                   just get things going.
24046
24047                 * The use of the type conversion cache that I proposed
24048                   last night had an open topic: How does this work across
24049                   protection domains.  A user defined conversion might not
24050                   be public in the location where we are applying the
24051                   conversion, a different conversion might be selected
24052                   (ie, private A->B (better) but public B->A (worse),
24053                   inside A, A->B applies, but outside it, B->A will
24054                   apply).
24055
24056                 * On top of that (ie, even if the above is solved),
24057                   conversions in a cache need to be abstract.  Ie, `To
24058                   convert from an Int to a Short use an OpcodeCast', not
24059                   `To convert from an Int to a Short use the OpcodeCast on
24060                   the variable 5' (which is what this patch was doing).
24061
24062 2001-09-28  Ravi Pratap  <ravi@ximian.com>
24063
24064         * expression.cs (Invocation::ConversionExists): Re-write to use
24065         the conversion cache
24066
24067         (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
24068         cache all conversions done, not just user-defined ones.
24069
24070         (Invocation::BetterConversion): The real culprit. Use ConversionExists
24071         to determine if a conversion exists instead of acutually trying to 
24072         perform the conversion. It's faster too.
24073
24074         (Expression::ConvertExplicit): Modify to use ConversionExists to check
24075         and only then attempt the implicit conversion.
24076
24077 2001-09-28  Ravi Pratap  <ravi@ximian.com>
24078
24079         * expression.cs (ConvertImplicit): Use a cache for conversions
24080         already found. Check level of recursion and bail out if necessary.
24081
24082 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
24083
24084         * typemanager.cs (string_concat_string_string, string_concat_object_object):
24085         Export standard methods that we expect for string operations.
24086
24087         * statement.cs (Block::UsageWarning): Track usage of variables and
24088         report the errors for not used variables.
24089
24090         * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
24091         operator. 
24092
24093 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
24094
24095         * codegen.cs: remove unnneded code 
24096
24097         * expression.cs: Removed BuiltinTypeAccess class
24098
24099         Fix the order in which implicit conversions are
24100         done.  
24101
24102         The previous fixed dropped support for boxed conversions (adding a
24103         test to the test suite now)
24104
24105         (UserImplicitCast::CanConvert): Remove test for source being null,
24106         that code is broken.  We should not feed a null to begin with, if
24107         we do, then we should track the bug where the problem originates
24108         and not try to cover it up here.
24109
24110         Return a resolved expression of type UserImplicitCast on success
24111         rather than true/false.  Ravi: this is what I was talking about,
24112         the pattern is to use a static method as a "constructor" for
24113         objects. 
24114
24115         Also, do not create arguments until the very last minute,
24116         otherwise we always create the arguments even for lookups that
24117         will never be performed. 
24118
24119         (UserImplicitCast::Resolve): Eliminate, objects of type
24120         UserImplicitCast are born in a fully resolved state. 
24121
24122         * typemanager.cs (InitCoreTypes): Init also value_type
24123         (System.ValueType). 
24124
24125         * expression.cs (Cast::Resolve): First resolve the child expression.
24126
24127         (LValue): Add new method AddressOf to be used by
24128         the `&' operator.  
24129
24130         Change the argument of Store to take an EmitContext instead of an
24131         ILGenerator, because things like FieldExpr need to be able to call
24132         their children expression to generate the instance code. 
24133
24134         (Expression::Error, Expression::Warning): Sugar functions for
24135         reporting errors.
24136
24137         (Expression::MemberLookup): Accept a TypeContainer instead of a
24138         Report as the first argument.
24139
24140         (Expression::ResolvePrimary): Killed.  I still want to improve
24141         this as currently the code is just not right.
24142
24143         (Expression::ResolveMemberAccess): Simplify, but it is still
24144         wrong. 
24145
24146         (Unary::Resolve): Catch errors in AddressOf operators.
24147
24148         (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
24149         index to a byte for the short-version, or the compiler will choose
24150         the wrong Emit call, which generates the wrong data.
24151
24152         (ParameterReference::Emit, ::Store): same.
24153
24154         (FieldExpr::AddressOf): Implement.
24155
24156         * typemanager.cs: TypeManager: made public variable instead of
24157         property.
24158
24159         * driver.cs: document --fatal.
24160
24161         * report.cs (ErrorMessage, WarningMessage): new names for the old
24162         Error and Warning classes.
24163
24164         * cs-parser.jay (member_access): Turn built-in access to types
24165         into a normal simplename
24166
24167 2001-09-27  Ravi Pratap  <ravi@ximian.com>
24168
24169         * expression.cs (Invocation::BetterConversion): Fix to cope
24170         with q being null, since this was introducing a bug.
24171
24172         * expression.cs (ConvertImplicit): Do built-in conversions first.
24173
24174 2001-09-27  Ravi Pratap  <ravi@ximian.com>
24175
24176         * expression.cs (UserImplicitCast::Resolve): Fix bug.
24177
24178 2001-09-27  Ravi Pratap  <ravi@ximian.com>
24179
24180         * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
24181         I had introduced long ago (what's new ?).
24182
24183         * expression.cs (UserImplicitCast::CanConvert): Static method to do 
24184         the work of all the checking. 
24185         (ConvertImplicit): Call CanConvert and only then create object if necessary.
24186         (UserImplicitCast::CanConvert, ::Resolve): Re-write.
24187
24188         (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
24189         that is the right way. 
24190
24191         (Invocation::MakeUnionSet): Convenience function to make unions of sets for 
24192         overloading resolution. Use everywhere instead of cutting and pasting code.
24193
24194         (Binary::ResolveOperator): Use MakeUnionSet.
24195
24196         (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when 
24197         we have to convert to bool types. Not complete yet.
24198
24199 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
24200
24201         * typemanager.cs (TypeManager::CSharpName): support ushort.
24202
24203         * expression.cs (Expression::TryImplicitIntConversion): Attempts
24204         to provide an expression that performsn an implicit constant int
24205         conversion (section 6.1.6).
24206         (Expression::ConvertImplicitRequired): Reworked to include
24207         implicit constant expression conversions.
24208
24209         (Expression::ConvertNumericExplicit): Finished.
24210
24211         (Invocation::Emit): If InstanceExpression is null, then it means
24212         that we perform a call on this.
24213
24214 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
24215
24216         * expression.cs (Unary::Emit): Remove some dead code.
24217         (Probe): Implement Resolve and Emit for `is'.
24218         (Expression::ConvertImplicitRequired): Attempt to do constant
24219         expression conversions here.  Maybe should be moved to
24220         ConvertImplicit, but I am not sure.
24221         (Expression::ImplicitLongConstantConversionPossible,
24222         Expression::ImplicitIntConstantConversionPossible): New functions
24223         that tell whether is it possible to apply an implicit constant
24224         expression conversion.
24225
24226         (ConvertNumericExplicit): Started work on explicit numeric
24227         conversions.
24228
24229         * cs-parser.jay: Update operator constants.
24230
24231         * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
24232         (Parameters::GetSignature): Hook up VerifyArgs here.
24233         (Parameters::VerifyArgs): Verifies that no two arguments have the
24234         same name. 
24235
24236         * class.cs (Operator): Update the operator names to reflect the
24237         ones that the spec expects (as we are just stringizing the
24238         operator names).
24239
24240         * expression.cs (Unary::ResolveOperator): Fix bug: Use
24241         MethodInfo's ReturnType instead of LookupMethodByBuilder as the
24242         previous usage did only work for our methods.
24243         (Expression::ConvertImplicit): Handle decimal implicit numeric
24244         conversions as well.
24245         (Expression::InternalTypeConstructor): Used to invoke constructors
24246         on internal types for default promotions.
24247
24248         (Unary::Emit): Implement special handling for the pre/post
24249         increment/decrement for overloaded operators, as they need to have
24250         the same semantics as the other operators.
24251
24252         (Binary::ResolveOperator): ditto.
24253         (Invocation::ConversionExists): ditto.
24254         (UserImplicitCast::Resolve): ditto.
24255
24256 2001-09-26  Ravi Pratap  <ravi@ximian.com>
24257
24258         * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
24259         operator, return after emitting body. Regression tests pass again !
24260
24261         * expression.cs (ConvertImplicit): Take TypeContainer as first argument
24262         (Unary::ForceConversion, Binary::ForceConversion): Ditto.
24263         (Invocation::OverloadResolve): Ditto.
24264         (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
24265
24266         * everywhere : update calls to the above methods accordingly.
24267
24268 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
24269
24270         * assign.cs (Assign): Make it inherit from ExpressionStatement.
24271
24272         * expression.cs (ExpressionStatement): New base class used for
24273         expressions that can appear in statements, so that we can provide
24274         an alternate path to generate expression that do not leave a value
24275         on the stack.
24276
24277         (Expression::Emit, and all the derivatives): We no longer return
24278         whether a value is left on the stack or not.  Every expression
24279         after being emitted leaves a single value on the stack.
24280
24281         * codegen.cs (EmitContext::EmitStatementExpression): Use the
24282         facilties of ExpressionStatement if possible.
24283
24284         * cs-parser.jay: Update statement_expression.
24285
24286 2001-09-25  Miguel de Icaza  <miguel@ximian.com>
24287
24288         * driver.cs: Change the wording of message
24289
24290 2001-09-25  Ravi Pratap  <ravi@ximian.com>
24291
24292         * expression.cs (Binary::ResolveOperator): Had forgottten to set 
24293         the type of the expression to the return type of the method if
24294         we have an overloaded operator match ! The regression tests pass again !
24295         (Unary::ResolveOperator): Ditto.
24296
24297         * expression.cs (Invocation::ConversionExists): Correct the member lookup
24298         to find "op_Implicit", not "implicit" ;-)
24299         (UserImplicitCast): New class to take care of user-defined implicit conversions.
24300         (ConvertImplicit, ForceConversion): Take TypeContainer argument
24301
24302         * everywhere : Correct calls to the above accordingly.
24303
24304         * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
24305         (ConvertImplicit): Do user-defined conversion if it exists.
24306
24307 2001-09-24  Miguel de Icaza  <miguel@ximian.com>
24308
24309         * assign.cs: track location.
24310         (Resolve): Use implicit conversions on assignment.
24311
24312         * literal.cs: Oops.  Not good, Emit of short access values should
24313         pass (Bytes) or the wrong argument will be selected.
24314
24315         * expression.cs (Unary::Emit): Emit code for -expr.
24316
24317         (Unary::ResolveOperator): Handle `Substract' for non-constants
24318         (substract from zero from the non-constants).
24319         Deal with Doubles as well. 
24320
24321         (Expression::ConvertImplicitRequired): New routine that reports an
24322         error if no implicit conversion exists. 
24323
24324         (Invocation::OverloadResolve): Store the converted implicit
24325         expressions if we make them
24326
24327 2001-09-24  Ravi Pratap  <ravi@ximian.com>
24328
24329         * class.cs (ConstructorInitializer): Take a Location argument.
24330         (ConstructorBaseInitializer): Same here.
24331         (ConstructorThisInitializer): Same here.
24332
24333         * cs-parser.jay : Update all calls accordingly.
24334
24335         * expression.cs (Unary, Binary, New): Take location argument.
24336         Update accordingly everywhere.
24337
24338         * cs-parser.jay : Update all calls to the above to take a location
24339         argument.
24340
24341         * class.cs : Ditto.
24342
24343 2001-09-24  Ravi Pratap  <ravi@ximian.com>
24344
24345         * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
24346         (Invocation::BetterConversion): Same here
24347         (Invocation::ConversionExists): Ditto.
24348
24349         (Invocation::ConversionExists): Implement.
24350
24351 2001-09-22  Ravi Pratap  <ravi@ximian.com>
24352
24353         * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
24354         Also take an additional TypeContainer argument.
24355
24356         * All over : Pass in TypeContainer as argument to OverloadResolve.
24357
24358         * typemanager.cs (CSharpName): Update to check for the string type and return
24359         that too.
24360
24361         * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
24362         a given method.
24363
24364 2001-09-21  Ravi Pratap  <ravi@ximian.com>
24365
24366         * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
24367         (Invocation::BetterFunction): Implement.
24368         (Invocation::BetterConversion): Implement.
24369         (Invocation::ConversionExists): Skeleton, no implementation yet.
24370
24371         Okay, things work fine !
24372
24373 2001-09-21  Miguel de Icaza  <miguel@ximian.com>
24374
24375         * typemanager.cs: declare and load enum_type, delegate_type and
24376         void_type. 
24377
24378         * expression.cs (Expression::Emit): Now emit returns a value that
24379         tells whether a value is left on the stack or not.  This strategy
24380         might be reveted tomorrow with a mechanism that would address
24381         multiple assignments.
24382         (Expression::report118): Utility routine to report mismatches on
24383         the ExprClass.
24384
24385         (Unary::Report23): Report impossible type/operator combination
24386         utility function.
24387
24388         (Unary::IsIncrementableNumber): Whether the type can be
24389         incremented or decremented with add.
24390         (Unary::ResolveOperator): Also allow enumerations to be bitwise
24391         complemented. 
24392         (Unary::ResolveOperator): Implement ++, !, ~,
24393
24394         (Invocation::Emit): Deal with new Emit convetion.
24395
24396         * All Expression derivatives: Updated their Emit method to return
24397         whether they leave values on the stack or not.
24398
24399         * codegen.cs (CodeGen::EmitStatement): Pop values left on the
24400         stack for expressions that are statements. 
24401
24402 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
24403
24404         * expression.cs (LValue): New interface.  Must be implemented by
24405         LValue objects.
24406         (LocalVariableReference, ParameterReference, FieldExpr): Implement
24407         LValue interface.
24408
24409         * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
24410         interface for generating code, simplifies the code.
24411
24412 2001-09-20  Ravi Pratap  <ravi@ximian.com>
24413
24414         * expression.cs (everywhere): Comment out return statements in ::Resolve
24415         methods to avoid the warnings.
24416
24417 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
24418
24419         * driver.cs (parse): Report error 2001 if we can not open the
24420         source file.
24421
24422         * expression.cs (SimpleName::ResolveSimpleName): Error if we can
24423         not resolve it.
24424
24425         * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
24426         object. 
24427
24428         * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
24429         otherwise nested blocks end up with the same index.
24430
24431         * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
24432
24433         * expression.cs:  Instead of having FIXMEs in the Resolve
24434         functions, throw exceptions so it is obvious that we are facing a
24435         bug. 
24436
24437         * cs-parser.jay (invocation_expression): Pass Location information.
24438
24439         * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
24440         Use a basename for those routines because .NET does not like paths
24441         on them. 
24442
24443         * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
24444         already defined.
24445
24446 2001-09-19  Miguel de Icaza  <miguel@ximian.com>
24447
24448         * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
24449         are loading the correct data types (throws an exception if not).
24450         (TypeManager::InitCoreTypes): Use CoreLookupType
24451
24452         * expression.cs (Unary::ResolveOperator): return the child
24453         expression for expressions which are just +expr.
24454         (Unary::ResolveOperator): Return negative literals for -LITERAL
24455         expressions (otherwise they are Unary {Literal}).
24456         (Invocation::Badness): Take into account `Implicit constant
24457         expression conversions'.
24458
24459         * literal.cs (LongLiteral): Implement long literal class.
24460         (IntLiteral): export the `Value' of the intliteral. 
24461
24462 2001-09-19  Ravi Pratap  <ravi@ximian.com>
24463
24464         * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
24465
24466         * class.cs (Operator::Define): Change the methodname prefix to 'op_' 
24467         instead of 'Operator'
24468
24469         * expression.cs (Binary::ResolveOperator): Update accordingly.
24470         (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
24471         and 'Minus'
24472
24473         * cs-parser.jay (unary_expression): Update to use the new names.
24474
24475         * gen-treedump.cs (GetUnary): Same here.
24476
24477         * expression.cs (Unary::Resolve): Implement.
24478         (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded 
24479         operators are found instead of making noise ;-)
24480         (Unary::ResolveOperator): New method to do precisely the same thing which
24481         Binary::ResolveOperator does for Binary expressions.
24482         (Unary.method, .Arguments): Add.
24483         (Unary::OperName): Implement.   
24484         (Unary::ForceConversion): Copy and Paste !
24485
24486         * class.cs (Operator::Define): Fix a small bug for the case when we have 
24487         a unary operator.
24488
24489         * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
24490         for the inbuilt operators. Only overloading works for now ;-)
24491
24492 2001-09-18  Miguel de Icaza  <miguel@ximian.com>
24493
24494         * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
24495         UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
24496
24497         * expression.cs (This::Emit): Implement. 
24498         (This::Resolve): Implement.
24499         (TypeOf:Resolve): Implement.
24500         (Expression::ResolveSimpleName): Add an implicit this to instance
24501         field references. 
24502         (MemberAccess::Resolve): Deal with Parameters and Fields. 
24503         Bind instance variable to Field expressions.
24504         (FieldExpr::Instance): New field used to track the expression that
24505         represents the object instance.
24506         (FieldExpr::Resolve): Track potential errors from MemberLookup not
24507         binding 
24508         (FieldExpr::Emit): Implement.
24509
24510         * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
24511         the last instruction contains a return opcode to avoid generating
24512         the last `ret' instruction (this generates correct code, and it is
24513         nice to pass the peverify output).
24514
24515         * class.cs (TypeContainer::EmitFieldInitializers): Implement field
24516         initializer for static and instance variables.
24517         (Constructor::Emit): Allow initializer to be null in the case of
24518         static constructors.  Only emit initializer for instance
24519         constructors. 
24520
24521         (TypeContainer::FindMembers): Return a null array if there are no
24522         matches.
24523
24524         Also fix the code for the MemberTypes.Method branch, as it was not
24525         scanning that for operators (or tried to access null variables before).
24526
24527         * assign.cs (Assign::Emit): Handle instance and static fields. 
24528
24529         * TODO: Updated.
24530
24531         * driver.cs: Stop compilation if there are parse errors.
24532
24533         * cs-parser.jay (constructor_declaration): Provide default base
24534         initializer for non-static constructors.
24535         (constructor_declarator): Do not provide a default base
24536         initializers if none was specified.
24537         Catch the fact that constructors should not have parameters.
24538
24539         * class.cs: Do not emit parent class initializers for static
24540         constructors, that should be flagged as an error.
24541
24542 2001-09-18  Ravi Pratap  <ravi@ximian.com>
24543
24544         * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
24545         Move back code into TypeContainer::Populate.
24546
24547 2001-09-18  Ravi Pratap  <ravi@ximian.com>
24548
24549         * class.cs (TypeContainer::AddConstructor): Fix the check to
24550         compare against Name, not Basename. 
24551         (Operator::OpType): Change Plus and Minus to Add and Subtract.
24552
24553         * cs-parser.jay : Update accordingly.
24554
24555         * class.cs (TypeContainer::FindMembers): For the case where we are searching
24556         for methods, don't forget to look into the operators too.
24557         (RegisterMethodBuilder): Helper method to take care of this for
24558         methods, constructors and operators.
24559         (Operator::Define): Completely revamp.
24560         (Operator.OperatorMethod, MethodName): New fields.
24561         (TypeContainer::Populate): Move the registering of builders into
24562         RegisterMethodBuilder.
24563         (Operator::Emit): Re-write.
24564
24565         * expression.cs (Binary::Emit): Comment out code path to emit method
24566         invocation stuff for the case when we have a user defined operator. I am
24567         just not able to get it right !
24568
24569 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
24570
24571         * expression.cs (Expression::OverloadResolve): Drop TypeContainer
24572         argument. 
24573
24574         (Expression::MemberLookup): Provide a version that allows to
24575         specify the MemberTypes and BindingFlags. 
24576
24577         * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
24578         so it was not fetching variable information from outer blocks.
24579
24580         * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
24581         Beforefieldinit as it was buggy.
24582
24583         * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
24584         that Ravi put here.  
24585
24586         * class.cs (Constructor::Emit): Only emit if block is not null.
24587         (TypeContainer::EmitDefaultConstructor): Removed routine, now we
24588         deal with this by semantically definining it as if the user had
24589         done it.
24590
24591         (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
24592         constructors as we now "emit" them at a higher level.
24593
24594         (TypeContainer::DefineDefaultConstructor): Used to define the
24595         default constructors if none was provided.
24596
24597         (ConstructorInitializer): Add methods Resolve and Emit. 
24598
24599         * expression.cs: Cast to ConstructorInfo instead of MethodInfo
24600
24601 2001-09-17  Ravi Pratap  <ravi@ximian.com>
24602
24603         * class.cs (TypeContainer::EmitDefaultConstructor): Register
24604         the default constructor builder with our hashtable for methodbuilders
24605         to methodcores.
24606
24607         * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
24608         and argument_count is 0 in which case we have a match.
24609         (Binary::ResolveOperator): More null checking and miscellaneous coding
24610         style cleanup.
24611
24612 2001-09-17  Ravi Pratap  <ravi@ximian.com>
24613
24614         * rootcontext.cs (IsNameSpace): Compare against null.
24615
24616         * everywhere : Correct spelling to 'Greater' and to 'Subtract'
24617
24618         * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
24619         and Unary::Operator.
24620
24621         * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
24622         accordingly.
24623
24624         * expression.cs (Binary::method): New member to hold the MethodBase for the case when
24625         we have overloaded operators.
24626         (Binary::ResolveOperator): Implement the part which does the operator overload
24627         resolution.
24628
24629         * class.cs (Operator::Emit): Implement.
24630         (TypeContainer::Emit): Emit the operators we have too.
24631
24632         * expression.cs (Binary::Emit): Update to emit the appropriate code for
24633         the case when we have a user-defined operator.
24634
24635 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
24636
24637         * rootcontext.cs: Fix bug: tree.Namespaces might be null.
24638
24639 2001-09-16  Ravi Pratap  <ravi@ximian.com>
24640
24641         * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
24642         (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
24643         (Constructor::Emit): Implement.
24644         (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
24645         if we have no work to do. 
24646         (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's 
24647         Emit method.
24648
24649         * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
24650         (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
24651
24652         * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
24653         of parent.parent.
24654
24655 2001-09-15  Ravi Pratap  <ravi@ximian.com>
24656
24657         * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
24658         in the source.
24659         (Tree::RecordNamespace): Method to do what the name says ;-)
24660         (Tree::Namespaces): Property to get at the namespaces hashtable.
24661
24662         * cs-parser.jay (namespace_declaration): Call RecordNamespace to 
24663         keep track.
24664
24665         * rootcontext.cs (IsNamespace): Fixed it :-)
24666
24667 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
24668
24669         * class.cs (TypeContainer::FindMembers): Add support for
24670         constructors. 
24671         (MethodCore): New class that encapsulates both the shared aspects
24672         of a Constructor and a Method.  
24673         (Method, Constructor): Factored pieces into MethodCore.
24674
24675         * driver.cs: Added --fatal which makes errors throw exceptions.
24676         Load System assembly as well as part of the standard library.
24677
24678         * report.cs: Allow throwing exceptions on errors for debugging.
24679
24680         * modifiers.cs: Do not use `parent', instead use the real type
24681         container to evaluate permission settings.
24682
24683         * class.cs: Put Ravi's patch back in.  He is right, and we will
24684         have to cope with the
24685
24686 2001-09-14  Ravi Pratap  <ravi@ximian.com>
24687
24688         * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
24689         FamORAssem, not FamANDAssem.
24690
24691 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
24692
24693         * driver.cs: Added --parse option that only parses its input files
24694         and terminates.
24695
24696         * class.cs: Reverted last change from Ravi to IsTopLevel.  That is
24697         incorrect.  IsTopLevel is not used to tell whether an object is
24698         root_types or not (that can be achieved by testing this ==
24699         root_types).  But to see if this is a top-level *class* (not
24700         necessarly our "toplevel" container). 
24701
24702 2001-09-14  Ravi Pratap  <ravi@ximian.com>
24703
24704         * enum.cs (Enum::Define): Modify to call the Lookup method on the
24705         parent instead of a direct call to GetType.
24706
24707 2001-09-14  Ravi Pratap  <ravi@ximian.com>
24708
24709         * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
24710         Modifiers.TypeAttr. This should just be a call to that method.
24711
24712         * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
24713         object so that we can determine if we are top-level or not.
24714
24715         * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the 
24716         TypeContainer too.
24717
24718         * enum.cs (Enum::Define): Ditto.
24719
24720         * modifiers.cs (FieldAttr): Re-write.
24721
24722         * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
24723         (TypeContainer::HaveStaticConstructor): New property to provide access
24724         to precisely that info.
24725
24726         * modifiers.cs (MethodAttr): Re-write.
24727         (EventAttr): Remove altogether as there seems to be no ostensible use for it.
24728
24729         * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
24730         of top-level types as claimed.
24731
24732 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
24733
24734         * expression.cs (MemberLookup): Fruitless attempt to lookup
24735         constructors.  Maybe I need to emit default constructors?  That
24736         might be it (currently .NET emits this for me automatically).
24737         (Invocation::OverloadResolve): Cope with Arguments == null.
24738         (Invocation::EmitArguments): new function, shared by the new
24739         constructor and us.
24740         (Invocation::Emit): Handle static and instance methods.  Emit
24741         proper call instruction for virtual or non-virtual invocations.
24742         (New::Emit): Implement.
24743         (New::Resolve): Implement.
24744         (MemberAccess:Resolve): Implement.
24745         (MethodGroupExpr::InstanceExpression): used conforming to the spec
24746         to track instances.
24747         (FieldExpr::Resolve): Set type.
24748
24749         * support.cs: Handle empty arguments.
24750                 
24751         * cs-parser.jay (CompositeLookup, QualifierIdentifier,
24752         SimpleLookup): Auxiliary routines to help parse a qualifier
24753         identifier.  
24754
24755         Update qualifier_identifier rule.
24756
24757         * codegen.cs: Removed debugging messages.
24758
24759         * class.cs: Make this a global thing, this acts just as a "key" to
24760         objects that we might have around.
24761
24762         (Populate): Only initialize method_builders_to_methods once.
24763
24764         * expression.cs (PropertyExpr): Initialize type from the
24765         PropertyType. 
24766
24767         * codegen.cs (EmitContext::EmitBoolExpression): Use propper
24768         Resolve pattern.  Attempt to implicitly convert value to boolean.
24769         Emit code.
24770
24771         * expression.cs: Set the type for the int32/int32 argument case.
24772         (Binary::ResolveOperator): Set the return type to boolean for
24773         comparission operators
24774
24775         * typemanager.cs: Remove debugging print code.
24776
24777         (Invocation::Resolve): resolve type.
24778
24779         * class.cs: Allocate a MemberInfo of the correct size, as the code
24780         elsewhere depends on the test to reflect the correct contents.
24781
24782         (Method::) Keep track of parameters, due to System.Reflection holes
24783
24784         (TypeContainer::Populate): Keep track of MethodBuilders to Method
24785         mapping here.
24786
24787         (TypeContainer::FindMembers): Use ArrayList and then copy an array
24788         of the exact size and return that.
24789
24790         (Class::LookupMethodByBuilder): New function that maps
24791         MethodBuilders to its methods.  Required to locate the information
24792         on methods because System.Reflection bit us again.
24793
24794         * support.cs: New file, contains an interface ParameterData and
24795         two implementations: ReflectionParameters and InternalParameters
24796         used to access Parameter information.  We will need to grow this
24797         as required.
24798
24799         * expression.cs (Invocation::GetParameterData): implement a cache
24800         and a wrapper around the ParameterData creation for methods. 
24801         (Invocation::OverloadResolve): Use new code.
24802
24803 2001-09-13  Ravi Pratap  <ravi@ximian.com>
24804
24805         * class.cs (TypeContainer::EmitField): Remove and move into 
24806         (Field::Define): here and modify accordingly.
24807         (Field.FieldBuilder): New member.
24808         (TypeContainer::Populate): Update accordingly.
24809         (TypeContainer::FindMembers): Implement.
24810
24811 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
24812
24813         * statement.cs: (VariableInfo::VariableType): New field to be
24814         initialized with the full type once it is resolved. 
24815
24816 2001-09-12  Miguel de Icaza  <miguel@ximian.com>
24817
24818         * parameter.cs (GetParameterInfo): Use a type cache to compute
24819         things only once, and to reuse this information
24820
24821         * expression.cs (LocalVariableReference::Emit): Implement.
24822         (OpcodeCast::Emit): fix.
24823
24824         (ParameterReference::Resolve): Implement.
24825         (ParameterReference::Emit): Implement.
24826
24827         * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
24828         that are expressions need to stay as Expressions.
24829
24830         * typemanager.cs (CSharpName): Returns the C# name of a type if
24831         possible. 
24832
24833         * expression.cs (Expression::ConvertImplicit): New function that
24834         implements implicit type conversions.
24835
24836         (Expression::ImplicitReferenceConversion): Implements implicit
24837         reference conversions.
24838
24839         (EmptyCast): New type for transparent casts.
24840
24841         (OpcodeCast): New type for casts of types that are performed with
24842         a sequence of bytecodes.
24843
24844         (BoxedCast): New type used for casting value types into reference
24845         types.  Emits a box opcode.
24846
24847         (Binary::DoNumericPromotions): Implements numeric promotions of
24848         and computation of the Binary::Type.
24849
24850         (Binary::EmitBranchable): Optimization.
24851
24852         (Binary::Emit): Implement code emission for expressions.
24853
24854         * typemanager.cs (TypeManager): Added two new core types: sbyte
24855         and byte.
24856
24857 2001-09-12  Ravi Pratap  <ravi@ximian.com>
24858
24859         * class.cs (TypeContainer::FindMembers): Method which does exactly
24860         what Type.FindMembers does, only we don't have to use reflection. No
24861         implementation yet.
24862
24863         * typemanager.cs (typecontainers): New hashtable to hold the corresponding
24864         typecontainer objects as we need to get at them.
24865         (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
24866
24867         * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
24868         typecontainer object.
24869
24870         * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
24871         of just a Report object.
24872
24873 2001-09-11  Ravi Pratap  <ravi@ximian.com>
24874
24875         * class.cs (Event::Define): Go back to using the prefixes "add_" and
24876         "remove_"
24877         (TypeContainer::Populate): Now define the delegates of the type too.
24878         (TypeContainer.Delegates): Property to access the list of delegates defined
24879         in the type.
24880
24881         * delegates.cs (Delegate::Define): Implement partially.
24882
24883         * modifiers.cs (TypeAttr): Handle more flags.
24884
24885 2001-09-11  Ravi Pratap  <ravi@ximian.com>
24886
24887         * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
24888         and not <=
24889         (Operator::Define): Re-write logic to get types by using the LookupType method
24890         instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
24891         (Indexer::Define): Ditto.
24892         (Event::Define): Ditto.
24893         (Property::Define): Ditto.
24894
24895 2001-09-10  Ravi Pratap  <ravi@ximian.com>
24896
24897         * class.cs (TypeContainer::Populate): Now define operators too. 
24898         (TypeContainer.Operators): New property to access the list of operators
24899         in a type.
24900         (Operator.OperatorMethodBuilder): New member to hold the method builder
24901         for the operator we are defining.
24902         (Operator::Define): Implement.
24903
24904 2001-09-10  Ravi Pratap  <ravi@ximian.com>
24905
24906         * class.cs (Event::Define): Make the prefixes of the accessor methods
24907         addOn_ and removeOn_ 
24908
24909         * genericparser.cs (GenericParser::error): Overloaded method to handle the case
24910         of the location being passed in too. Ideally, this should go later since all
24911         error reporting should be done through the Report object.
24912
24913         * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
24914         (Populate): Iterate thru the indexers we have and define them too.
24915         (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
24916         for the get and set accessors.
24917         (Indexer::Define): Implement.
24918
24919 2001-09-09  Miguel de Icaza  <miguel@ximian.com>
24920
24921         * expression.cs (Binary::Resolve): Beginning of it.  I scratched
24922         my previous implementation, did not work.
24923
24924         * typemanager.cs: Add a couple of missing types (the longs).
24925
24926         * literal.cs: Use TypeManager.bool_type instead of getting it.
24927
24928         * expression.cs (EventExpr): New kind of expressions.
24929         (Expressio::ExprClassFromMemberInfo): finish
24930
24931 2001-09-08  Miguel de Icaza  <miguel@ximian.com>
24932
24933         * assign.cs: Emit stores to static fields differently.
24934
24935 2001-09-08  Ravi Pratap  <ravi@ximian.com>
24936
24937         * Merge in changes and adjust code to tackle conflicts. Backed out my
24938         code in Assign::Resolve ;-) 
24939
24940 2001-09-08  Ravi Pratap  <ravi@ximian.com>
24941
24942         * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
24943         instead Report.Error and also pass in the location.
24944         (CSharpParser::Lexer): New readonly property to return the reference
24945         to the Tokenizer object.
24946         (declare_local_variables): Use Report.Error with location instead of plain 
24947         old error.
24948         (CheckDef): Ditto.
24949
24950         * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
24951         (Operator.CheckBinaryOperator): Ditto.
24952
24953         * cs-parser.jay (operator_declarator): Update accordingly.
24954
24955         * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
24956         (CheckBinaryOperator): Same here.
24957
24958         * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
24959         on the name without any prefixes of namespace names etc. This is because we
24960         already might have something already fully qualified like 
24961         'System.Console.WriteLine'
24962
24963         * assign.cs (Resolve): Begin implementation. Stuck ;-)
24964
24965 2001-09-07  Ravi Pratap  <ravi@ximian.com>
24966
24967         * cs-tokenizer.cs (location): Return a string which also contains
24968         the file name.
24969
24970         * expression.cs (ElementAccess): New class for expressions of the
24971         type 'element access.'
24972         (BaseAccess): New class for expressions of the type 'base access.'
24973         (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
24974         respectively.
24975
24976         * cs-parser.jay (element_access): Implement action.
24977         (base_access): Implement actions.
24978         (checked_expression, unchecked_expression): Implement.
24979
24980         * cs-parser.jay (local_variable_type): Correct and implement.
24981         (type_suffixes, type_suffix_list, type_suffix): Implement actions.
24982
24983         * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
24984
24985         * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
24986         name and the specifiers.
24987
24988         * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
24989
24990         * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of 
24991         making them all public ;-)
24992
24993         * cs-parser.jay (error): Remove entirely as we have an implementation in the base
24994         class anyways.
24995
24996 2001-09-07  Miguel de Icaza  <miguel@ximian.com>
24997
24998         * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
24999         PropertyExprs.
25000         (FieldExpr, PropertyExprs): New resolved expressions.
25001         (SimpleName::MemberStaticCheck): Perform static checks for access
25002         to non-static fields on static methods. Maybe this should be
25003         generalized for MemberAccesses. 
25004         (SimpleName::ResolveSimpleName): More work on simple name
25005         resolution. 
25006
25007         * cs-parser.jay (primary_expression/qualified_identifier): track
25008         the parameter index.
25009
25010         * codegen.cs (CodeGen::Save): Catch save exception, report error.
25011         (EmitContext::EmitBoolExpression): Chain to expression generation
25012         instead of temporary hack.
25013         (::EmitStatementExpression): Put generic expression code generation.
25014
25015         * assign.cs (Assign::Emit): Implement variable assignments to
25016         local variables, parameters and fields.
25017
25018 2001-09-06  Miguel de Icaza  <miguel@ximian.com>
25019
25020         * statement.cs (Block::GetVariableInfo): New method, returns the
25021         VariableInfo for a variable name in a block.
25022         (Block::GetVariableType): Implement in terms of GetVariableInfo
25023
25024         * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
25025         DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
25026
25027 2001-09-06  Ravi Pratap  <ravi@ximian.com>
25028
25029         * cs-parser.jay (operator_declaration): Continue on my quest : update
25030         to take attributes argument.
25031         (event_declaration): Ditto.
25032         (enum_declaration): Ditto.
25033         (indexer_declaration): Ditto.
25034
25035         * class.cs (Operator::Operator): Update constructor accordingly.
25036         (Event::Event): Ditto.
25037
25038         * delegate.cs (Delegate::Delegate): Same here.
25039
25040         * enum.cs (Enum::Enum): Same here.
25041
25042 2001-09-05  Ravi Pratap  <ravi@ximian.com>
25043
25044         * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
25045
25046         * ../tests/cs0658.cs : New file to demonstrate error 0658.
25047
25048         * attribute.cs (Attributes): New class to encapsulate all attributes which were
25049         being passed around as an arraylist.
25050         (Attributes::AddAttribute): Method to add attribute sections.
25051
25052         * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
25053         (struct_declaration): Update accordingly.
25054         (constant_declaration): Update.
25055         (field_declaration): Update.
25056         (method_header): Update.
25057         (fixed_parameter): Update.
25058         (parameter_array): Ditto.
25059         (property_declaration): Ditto.
25060         (destructor_declaration): Ditto.
25061
25062         * class.cs (Struct::Struct): Update constructors accordingly.
25063         (Class::Class): Ditto.
25064         (Field::Field): Ditto.
25065         (Method::Method): Ditto.
25066         (Property::Property): Ditto.
25067         (TypeContainer::OptAttribute): update property's return type.
25068
25069         * interface.cs (Interface.opt_attributes): New member.
25070         (Interface::Interface): Update to take the extra Attributes argument.
25071
25072         * parameter.cs (Parameter::Parameter): Ditto.
25073
25074         * constant.cs (Constant::Constant): Ditto.
25075
25076         * interface.cs (InterfaceMemberBase): New OptAttributes field.
25077         (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take 
25078         the attributes as a parameter.
25079         (InterfaceProperty): Update constructor call.
25080         (InterfaceEvent): Ditto.
25081         (InterfaceMethod): Ditto.
25082         (InterfaceIndexer): Ditto.
25083
25084         * cs-parser.jay (interface_indexer_declaration): Update call to constructor to 
25085         pass the attributes too.
25086         (interface_event_declaration): Ditto.
25087         (interface_property_declaration): Ditto.
25088         (interface_method_declaration): Ditto.
25089         (interface_declaration): Ditto.
25090
25091 2001-09-05  Miguel de Icaza  <miguel@ximian.com>
25092
25093         * class.cs (Method::Define): Track the "static Main" definition to
25094         create an entry point. 
25095
25096         * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
25097         EntryPoint if we find it. 
25098
25099         * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
25100         (EmitContext::ig): Make this variable public.
25101
25102         * driver.cs: Make the default output file be the first file name
25103         with the .exe extension.  
25104
25105         Detect empty compilations
25106
25107         Handle various kinds of output targets.  Handle --target and
25108         rename -t to --dumper.
25109
25110         * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
25111         methods inherited from Expression return now an Expression.  This
25112         will is used during the tree rewriting as we resolve them during
25113         semantic analysis.
25114
25115         (Expression::MemberLookup): Implements the MemberLookup (7.3) from
25116         the spec.  Missing entirely is the information about
25117         accessability of elements of it.
25118
25119         (Expression::ExprClassFromMemberInfo): New constructor for
25120         Expressions that creates a fully initialized Expression based on
25121         a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
25122         a Type.
25123
25124         (Invocation::Resolve): Begin implementing resolution of invocations.
25125
25126         * literal.cs (StringLiteral):  Implement Emit.
25127
25128 2001-09-05  Ravi Pratap  <ravi@ximian.com>
25129
25130         * cs-parser.jay (error): Add new modifier because we are hiding an inherited
25131         member.
25132
25133 2001-09-04  Ravi Pratap  <ravi@ximian.com>
25134
25135         * cs-parser.jay (attribute_arguments): Implement actions.
25136         (attribute): Fix bug in production. Implement action.
25137         (attribute_list): Implement.
25138         (attribute_target): Implement.
25139         (attribute_target_specifier, opt_target_specifier): Implement
25140         (CheckAttributeTarget): New method to check if the attribute target
25141         is valid.
25142         (attribute_section): Implement.
25143         (opt_attributes): Implement.
25144
25145         * attribute.cs : New file to handle attributes.
25146         (Attribute): Class to hold attribute info.
25147
25148         * cs-parser.jay (opt_attribute_target_specifier): Remove production
25149         (attribute_section): Modify production to use 2 different rules to 
25150         achieve the same thing. 1 s/r conflict down !
25151         Clean out commented, useless, non-reducing dimension_separator rules.
25152
25153         * class.cs (TypeContainer.attributes): New member to hold list
25154         of attributes for a type.
25155         (Struct::Struct): Modify to take one more argument, the attribute list.
25156         (Class::Class): Ditto.
25157         (Field::Field): Ditto.
25158         (Method::Method): Ditto.
25159         (Property::Property): Ditto.
25160
25161         * cs-parser.jay (struct_declaration): Update constructor call to
25162         pass in the attributes too.
25163         (class_declaration): Ditto.
25164         (constant_declaration): Ditto.
25165         (field_declaration): Ditto.
25166         (method_header): Ditto.
25167         (fixed_parameter): Ditto.
25168         (parameter_array): Ditto.
25169         (property_declaration): Ditto.
25170
25171         * constant.cs (Constant::Constant): Update constructor similarly.
25172         Use System.Collections.
25173
25174         * parameter.cs (Parameter::Parameter): Update as above.
25175
25176 2001-09-02  Ravi Pratap  <ravi@ximian.com>
25177
25178         * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
25179         (TypeContainer.delegates): New member to hold list of delegates.
25180
25181         * cs-parser.jay (delegate_declaration): Implement the action correctly 
25182         this time as I seem to be on crack ;-)
25183
25184 2001-09-02  Miguel de Icaza  <miguel@ximian.com>
25185
25186         * rootcontext.cs (RootContext::IsNamespace): new function, used to
25187         tell whether an identifier represents a namespace.
25188
25189         * expression.cs (NamespaceExpr): A namespace expression, used only
25190         temporarly during expression resolution.
25191         (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
25192         utility functions to resolve names on expressions.
25193
25194 2001-09-01  Miguel de Icaza  <miguel@ximian.com>
25195
25196         * codegen.cs: Add hook for StatementExpressions. 
25197
25198         * class.cs: Fix inverted test for static flag in methods.
25199
25200 2001-09-02  Ravi Pratap  <ravi@ximian.com>
25201
25202         * class.cs (Operator::CheckUnaryOperator): Correct error number used
25203         to make it coincide with MS' number.
25204         (Operator::CheckBinaryOperator): Ditto.
25205
25206         * ../errors/errors.txt : Remove error numbers added earlier.
25207
25208         * ../errors/cs1019.cs : Test case for error # 1019
25209
25210         * ../errros/cs1020.cs : Test case for error # 1020
25211
25212         * cs-parser.jay : Clean out commented cruft.
25213         (dimension_separators, dimension_separator): Comment out. Ostensibly not
25214         used anywhere - non-reducing rule.
25215         (namespace_declarations): Non-reducing rule - comment out.
25216
25217         * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
25218         with TypeContainer::AddEnum.
25219
25220         * delegate.cs : New file for delegate handling classes.
25221         (Delegate): Class for declaring delegates.
25222
25223         * makefile : Update.
25224
25225         * cs-parser.jay (delegate_declaration): Implement.
25226
25227 2001-09-01  Ravi Pratap  <ravi@che.iitm.ac.in>
25228
25229         * class.cs (Event::Define): Implement.
25230         (Event.EventBuilder): New member.
25231
25232         * class.cs (TypeContainer::Populate): Update to define all enums and events
25233         we have.
25234         (Events): New property for the events arraylist we hold. Shouldn't we move to using
25235         readonly fields for all these cases ?
25236
25237 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
25238
25239         * class.cs (Property): Revamp to use the convention of making fields readonly.
25240         Accordingly modify code elsewhere.
25241
25242         * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
25243         the Define method of the Property class.
25244
25245         * class.cs : Clean up applied patch and update references to variables etc. Fix 
25246         trivial bug.
25247         (TypeContainer::Populate): Update to define all the properties we have. Also
25248         define all enumerations.
25249
25250         * enum.cs (Define): Implement.
25251
25252 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
25253
25254         * cs-parser.jay (overloadable_operator): The semantic value is an
25255         enum of the Operator class.
25256         (operator_declarator): Implement actions.
25257         (operator_declaration): Implement.
25258
25259         * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
25260         validity of definitions.
25261         (Operator::CheckBinaryOperator): Static method to check for binary operators
25262         (TypeContainer::AddOperator): New method to add an operator to a type.
25263
25264         * cs-parser.jay (indexer_declaration): Added line to actually call the
25265         AddIndexer method so it gets added ;-)
25266
25267         * ../errors/errors.txt : Update to include new error numbers. Are these numbers 
25268         already taken care of by the MS compiler ?  
25269
25270 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
25271
25272         * class.cs (Operator): New class for operator declarations.
25273         (Operator::OpType): Enum for the various operators.
25274
25275 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
25276
25277         * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
25278         ostensibly handle this in semantic analysis.
25279
25280         * cs-parser.jay (general_catch_clause): Comment out
25281         (specific_catch_clauses, specific_catch_clause): Ditto.
25282         (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
25283         (catch_args, opt_catch_args): New productions.
25284         (catch_clause): Rewrite to use the new productions above
25285         (catch_clauses): Modify accordingly.
25286         (opt_catch_clauses): New production to use in try_statement
25287         (try_statement): Revamp. Basically, we get rid of one unnecessary rule
25288         and re-write the code in the actions to extract the specific and
25289         general catch clauses by being a little smart ;-)
25290
25291         * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
25292         Hooray, try and catch statements parse fine !
25293
25294 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
25295
25296         * statement.cs (Block::GetVariableType): Fix logic to extract the type
25297         string from the hashtable of variables.
25298
25299         * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
25300         I end up making that mistake ;-)
25301         (catch_clauses): Fixed gross error which made Key and Value of the 
25302         DictionaryEntry the same : $1 !!
25303
25304 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
25305
25306         * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
25307
25308         * cs-parser.jay (event_declaration): Correct to remove the semicolon
25309         when the add and remove accessors are specified. 
25310
25311 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
25312
25313         * cs-parser.jay (IndexerDeclaration): New helper class to hold
25314         information about indexer_declarator.
25315         (indexer_declarator): Implement actions.
25316         (parsing_indexer): New local boolean used to keep track of whether
25317         we are parsing indexers or properties. This is necessary because 
25318         implicit_parameters come into picture even for the get accessor in the 
25319         case of an indexer.
25320         (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
25321
25322         * class.cs (Indexer): New class for indexer declarations.
25323         (TypeContainer::AddIndexer): New method to add an indexer to a type.
25324         (TypeContainer::indexers): New member to hold list of indexers for the
25325         type.
25326
25327 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
25328
25329         * cs-parser.jay (add_accessor_declaration): Implement action.
25330         (remove_accessor_declaration): Implement action.
25331         (event_accessors_declaration): Implement
25332         (variable_declarators): swap statements for first rule - trivial.
25333
25334         * class.cs (Event): New class to hold information about event
25335         declarations.
25336         (TypeContainer::AddEvent): New method to add an event to a type
25337         (TypeContainer::events): New member to hold list of events.
25338
25339         * cs-parser.jay (event_declaration): Implement actions.
25340
25341 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
25342
25343         * cs-parser.jay (dim_separators): Implement. Make it a string
25344         concatenating all the commas together, just as they appear.
25345         (opt_dim_separators): Modify accordingly
25346         (rank_specifiers): Update accordingly. Basically do the same
25347         thing - instead, collect the brackets here.
25348         (opt_rank_sepcifiers): Modify accordingly.
25349         (array_type): Modify to actually return the complete type string
25350         instead of ignoring the rank_specifiers.
25351         (expression_list): Implement to collect the expressions
25352         (variable_initializer): Implement. We make it a list of expressions
25353         essentially so that we can handle the array_initializer case neatly too.
25354         (variable_initializer_list): Implement.
25355         (array_initializer): Make it a list of variable_initializers
25356         (opt_array_initializer): Modify accordingly.
25357
25358         * expression.cs (New::NType): Add enumeration to help us
25359         keep track of whether we have an object/delegate creation
25360         or an array creation.
25361         (New:NewType, New::Rank, New::Indices, New::Initializers): New
25362         members to hold data about array creation.
25363         (New:New): Modify to update NewType
25364         (New:New): New Overloaded contructor for the array creation
25365         case.
25366
25367         * cs-parser.jay (array_creation_expression): Implement to call
25368         the overloaded New constructor.
25369
25370 2001-08-26  Ravi Pratap  <ravi@che.iitm.ac.in>
25371
25372         * class.cs (TypeContainer::Constructors): Return member
25373         constructors instead of returning null.
25374
25375 2001-08-26  Miguel de Icaza  <miguel@ximian.com>
25376
25377         * typemanager.cs (InitCoreTypes): Initialize the various core
25378         types after we have populated the type manager with the user
25379         defined types (this distinction will be important later while
25380         compiling corlib.dll)
25381
25382         * expression.cs, literal.cs, assign.cs, constant.cs: Started work
25383         on Expression Classification.  Now all expressions have a method
25384         `Resolve' and a method `Emit'.
25385
25386         * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
25387         generation from working.     Also add some temporary debugging
25388         code. 
25389
25390 2001-08-24  Miguel de Icaza  <miguel@ximian.com>
25391
25392         * codegen.cs: Lots of code generation pieces.  This is only the
25393         beginning, will continue tomorrow with more touches of polish.  We
25394         handle the fundamentals of if, while, do, for, return.  Others are
25395         trickier and I need to start working on invocations soon.
25396
25397         * gen-treedump.cs: Bug fix, use s.Increment here instead of
25398         s.InitStatement. 
25399
25400         * codegen.cs (EmitContext): New struct, used during code
25401         emission to keep a context.   Most of the code generation will be
25402         here. 
25403
25404         * cs-parser.jay: Add embedded blocks to the list of statements of
25405         this block.  So code generation proceeds in a top down fashion.
25406
25407 2001-08-23  Miguel de Icaza  <miguel@ximian.com>
25408
25409         * statement.cs: Add support for multiple child blocks.
25410
25411 2001-08-22  Miguel de Icaza  <miguel@ximian.com>
25412
25413         * codegen.cs (EmitCode): New function, will emit the code for a
25414         Block of code given a TypeContainer and its ILGenerator. 
25415
25416         * statement.cs (Block): Standard public readonly optimization.
25417         (Block::Block constructors): Link children. 
25418         (Block::Child): Child Linker.
25419         (Block::EmitVariables): Emits IL variable declarations.
25420
25421         * class.cs: Drop support for MethodGroups here, delay until
25422         Semantic Analysis.
25423         (Method::): Applied the same simplification that I did before, and
25424         move from Properties to public readonly fields.
25425         (Method::ParameterTypes): Returns the parameter types for the
25426         function, and implements a cache that will be useful later when I
25427         do error checking and the semantic analysis on the methods is
25428         performed.
25429         (Constructor::GetCallingConvention): Renamed from CallingConvetion
25430         and made a method, optional argument tells whether this is a class
25431         or a structure to apply the `has-this' bit.
25432         (Method::GetCallingConvention): Implement, returns the calling
25433         convention. 
25434         (Method::Define): Defines the type, a second pass is performed
25435         later to populate the methods.
25436
25437         (Constructor::ParameterTypes): implement a cache similar to the
25438         one on Method::ParameterTypes, useful later when we do semantic
25439         analysis. 
25440
25441         (TypeContainer::EmitMethod):  New method.  Emits methods.
25442
25443         * expression.cs: Removed MethodGroup class from here.
25444
25445         * parameter.cs (Parameters::GetCallingConvention): new method.
25446
25447 2001-08-21  Miguel de Icaza  <miguel@ximian.com>
25448
25449         * class.cs (TypeContainer::Populate): Drop RootContext from the
25450         argument. 
25451
25452         (Constructor::CallingConvention): Returns the calling convention.
25453         (Constructor::ParameterTypes): Returns the constructor parameter
25454         types. 
25455
25456         (TypeContainer::AddConstructor): Keep track of default constructor
25457         and the default static constructor.
25458
25459         (Constructor::) Another class that starts using `public readonly'
25460         instead of properties. 
25461
25462         (Constructor::IsDefault): Whether this is a default constructor. 
25463
25464         (Field::) use readonly public fields instead of properties also.
25465
25466         (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
25467         track of static constructors;  If none is used, turn on
25468         BeforeFieldInit in the TypeAttributes. 
25469
25470         * cs-parser.jay (opt_argument_list): now the return can be null
25471         for the cases where there are no arguments. 
25472
25473         (constructor_declarator): If there is no implicit `base' or
25474         `this', then invoke the default parent constructor. 
25475
25476         * modifiers.cs (MethodAttr): New static function maps a set of
25477         modifiers flags into a MethodAttributes enum
25478         (FieldAttr): renamed from `Map'.  So now we have FieldAttr,
25479         MethodAttr, TypeAttr to represent the various mappings where the
25480         modifiers are used.
25481         (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'  
25482
25483 2001-08-19  Miguel de Icaza  <miguel@ximian.com>
25484
25485         * parameter.cs (GetParameterInfo): Fix bug where there would be no
25486         method arguments.
25487
25488         * interface.cs (PopulateIndexer): Implemented the code generator
25489         for interface indexers.
25490
25491 2001-08-17  Miguel de Icaza  <miguel@ximian.com>
25492
25493         * interface.cs (InterfaceMemberBase): Now we track the new status
25494         here.  
25495
25496         (PopulateProperty): Implement property population.  Woohoo!  Got
25497         Methods and Properties going today. 
25498
25499         Removed all the properties for interfaces, and replaced them with
25500         `public readonly' fields. 
25501
25502 2001-08-16  Miguel de Icaza  <miguel@ximian.com>
25503
25504         * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
25505         initialize their hashtables/arraylists only when they are needed
25506         instead of doing this always.
25507
25508         * parameter.cs: Handle refs and out parameters.
25509
25510         * cs-parser.jay: Use an ArrayList to construct the arguments
25511         instead of the ParameterCollection, and then cast that to a
25512         Parameter[] array.
25513
25514         * parameter.cs: Drop the use of ParameterCollection and use
25515         instead arrays of Parameters.
25516
25517         (GetParameterInfo): Use the Type, not the Name when resolving
25518         types. 
25519
25520 2001-08-13  Miguel de Icaza  <miguel@ximian.com>
25521
25522         * parameter.cs: Eliminate the properties Name, Type and ModFlags,
25523         and instead use public readonly fields.
25524
25525         * class.cs: Put back walking code for type containers.
25526
25527 2001-08-11  Miguel de Icaza  <miguel@ximian.com>
25528
25529         * class.cs (MakeConstant): Code to define constants.
25530
25531         * rootcontext.cs (LookupType): New function.  Used to locate types 
25532
25533
25534 2001-08-08  Miguel de Icaza  <miguel@ximian.com>
25535
25536         * rootcontext.cs: OH MY!  My trick works!   It is amazing how nice
25537         this System.Reflection code is.  Kudos to Microsoft
25538
25539         * typemanager.cs: Implement a type cache and avoid loading all
25540         types at boot time.  Wrap in LookupType the internals.  This made
25541         the compiler so much faster.  Wow.  I rule!
25542
25543         * driver.cs: Make sure we always load mscorlib first (for
25544         debugging purposes, nothing really important).
25545
25546         * Renamespaced things that were on `CSC' to `CIR'.  Maybe I should
25547         have moved to `CSC' rather than `CIR'.  Oh man!  The confussion!  
25548
25549         * rootcontext.cs: Lookup types on their namespace;  Lookup types
25550         on namespaces that have been imported using the `using' keyword.
25551
25552         * class.cs (TypeContainer::TypeAttr): Virtualize.
25553         (Class::TypeAttr): Return attributes suitable for this bad boy.
25554         (Struct::TypeAttr): ditto.
25555         Handle nested classes.
25556         (TypeContainer::) Remove all the type visiting code, it is now
25557         replaced with the rootcontext.cs code
25558
25559         * rootcontext.cs (GetClassBases): Added support for structs. 
25560
25561 2001-08-06  Miguel de Icaza  <miguel@ximian.com>
25562
25563         * interface.cs, statement.cs, class.cs, parameter.cs,
25564         rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
25565         Drop use of TypeRefs, and use strings instead.
25566
25567 2001-08-04  Miguel de Icaza  <miguel@ximian.com>
25568
25569         * rootcontext.cs: 
25570
25571         * class.cs (Struct::Struct): set the SEALED flags after
25572         checking the modifiers.
25573         (TypeContainer::TypeAttr): new property, returns the
25574         TypeAttributes for a class.  
25575
25576         * cs-parser.jay (type_list): Oops, list production was creating a
25577         new list of base types.
25578
25579         * rootcontext.cs (StdLib): New property.
25580         (GetInterfaceTypeByName): returns an interface by type name, and
25581         encapsulates error handling here.
25582         (GetInterfaces): simplified.
25583         (ResolveTree): Encapsulated all the tree resolution here.
25584         (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
25585         types. 
25586
25587         * driver.cs: Add support for --nostdlib, to avoid loading the
25588         default assemblies.
25589         (Main): Do not put tree resolution here. 
25590
25591         * rootcontext.cs: Beginning of the class resolution.
25592
25593 2001-08-03  Miguel de Icaza  <miguel@ximian.com>
25594
25595         * rootcontext.cs: Provide better error reporting. 
25596
25597         * cs-parser.jay (interface_base): set our $$ to be interfaces.
25598
25599         * rootcontext.cs (CreateInterface): Handle the case where there
25600         are no parent interfaces.
25601
25602         (CloseTypes): Routine to flush types at the end.
25603         (CreateInterface): Track types.
25604         (GetInterfaces): Returns an array of Types from the list of
25605         defined interfaces.
25606
25607         * typemanager.c (AddUserType): Mechanism to track user types (puts
25608         the type on the global type hash, and allows us to close it at the
25609         end). 
25610
25611 2001-08-02  Miguel de Icaza  <miguel@ximian.com>
25612
25613         * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
25614         RecordInterface instead.
25615
25616         * cs-parser.jay: Updated to reflect changes above.
25617
25618         * decl.cs (Definition): Keep track of the TypeBuilder type that
25619         represents this type here.  Not sure we will use it in the long
25620         run, but wont hurt for now.
25621
25622         * driver.cs: Smaller changes to accomodate the new code.
25623
25624         Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
25625         when done. 
25626
25627         * rootcontext.cs (CreateInterface):  New method, used to create
25628         the System.TypeBuilder type for interfaces.
25629         (ResolveInterfaces): new entry point to resolve the interface
25630         hierarchy. 
25631         (CodeGen): Property, used to keep track of the code generator.
25632
25633 2001-07-26  Miguel de Icaza  <miguel@ximian.com>
25634
25635         * cs-parser.jay: Add a second production for delegate_declaration
25636         with `VOID'.
25637
25638         (enum_body): Put an opt_comma here instead of putting it on
25639         enum_body or enum_member_declarations so we can handle trailing
25640         commas on enumeration members.  Gets rid of a shift/reduce.
25641
25642         (type_list): Need a COMMA in the middle.
25643
25644         (indexer_declaration): Tell tokenizer to recognize get/set
25645
25646         * Remove old targets.
25647
25648         * Re-add the parser target.
25649
25650 2001-07-13  Simon Cozens <simon@simon-cozens.org>
25651
25652         * cs-parser.jay: Add precendence rules for a number of operators
25653         ot reduce the number of shift/reduce conflicts in the grammar.
25654
25655 2001-07-17  Miguel de Icaza  <miguel@ximian.com>
25656
25657         * tree.cs: moved IGenerator interface and renamed it to ITreeDump
25658         and put it here.
25659
25660         Get rid of old crufty code.
25661
25662         * rootcontext.cs: Use this to keep track of the parsed
25663         representation and the defined types available to the program. 
25664
25665         * gen-treedump.cs: adjust for new convention.
25666
25667         * type.cs: Split out the type manager, and the assembly builder
25668         from here. 
25669
25670         * typemanager.cs: the type manager will live here now.
25671
25672         * cil-codegen.cs: And the code generator here. 
25673
25674 2001-07-14  Sean MacIsaac  <macisaac@ximian.com>
25675
25676         * makefile: Fixed up for easy making.
25677
25678 2001-07-13  Simon Cozens <simon@simon-cozens.org>
25679
25680         * cs-parser.jay (rank_specifier): Remove a conflict by reordering
25681         the 
25682
25683         (unary_expression): Expand pre_increment_expression and
25684         post_decrement_expression to reduce a shift/reduce.
25685
25686 2001-07-11  Simon Cozens
25687
25688         * cs-tokenizer.cs: Hex numbers should begin with a 0.
25689
25690         Improve allow_keyword_as_indent name.
25691
25692 2001-06-19  Miguel de Icaza  <miguel@ximian.com>
25693
25694         * Adjustments for Beta2. 
25695
25696 2001-06-13  Miguel de Icaza  <miguel@ximian.com>
25697
25698         * decl.cs: Added `Define' abstract method.
25699         (InTransit): new property, used to catch recursive definitions. 
25700
25701         * interface.cs: Implement `Define'. 
25702
25703         * modifiers.cs: Map Modifiers.constants to
25704         System.Reflection.TypeAttribute flags.
25705
25706         * class.cs: Keep track of types and user-defined types.
25707         (BuilderInit): New method for creating an assembly
25708         (ResolveType): New function to launch the resolution process, only
25709         used by interfaces for now.
25710
25711         * cs-parser.jay: Keep track of Classes, Structs and Interfaces
25712         that are inserted into the name space. 
25713
25714 2001-06-08  Miguel de Icaza  <miguel@ximian.com>
25715
25716         * ARGH.  I have screwed up my tree so many times due to the use of
25717         rsync rather than using CVS.  Going to fix this at once. 
25718
25719         * driver.cs: Objetify driver.  Load assemblies, use assemblies to
25720         load types.
25721
25722 2001-06-07  Miguel de Icaza  <miguel@ximian.com>
25723
25724         * Experiment successful: Use System.Type rather that our own
25725         version of Type.  
25726
25727 2001-05-25  Miguel de Icaza  <miguel@ximian.com>
25728
25729         * cs-parser.jay: Removed nsAliases from here.
25730
25731         Use new namespaces, handle `using XXX;' 
25732
25733         * namespace.cs: Reimplemented namespace handling, use a recursive
25734         definition of the class.  Now we can keep track of using clauses
25735         and catch invalid using clauses.
25736
25737 2001-05-24  Miguel de Icaza  <miguel@ximian.com>
25738
25739         * gen-treedump.cs: Adapted for all the renaming.
25740
25741         * expression.cs (Expression): this class now has a Type property
25742         which returns an expression Type.
25743
25744         (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
25745         `Type', as this has a different meaning now in the base
25746
25747 2001-05-22  Miguel de Icaza  <miguel@ximian.com>
25748
25749         * interface.cs, class.cs: Removed from all the sources the
25750         references to signature computation, as we can not do method
25751         signature computation during the parsing time, as we are not
25752         trying to solve at that point distinguishing:
25753
25754         class X {
25755                 void a (Blah x) {}
25756                 void a (NS.Blah x) {}
25757         }
25758
25759         Which depending on the context might be valid or not, as we do not
25760         know if Blah is the same thing as NS.Blah at that point.
25761
25762         * Redid everything so the code uses TypeRefs now instead of
25763         Types.  TypeRefs are just temporary type placeholders, that need
25764         to be resolved.  They initially have a pointer to a string and the
25765         current scope in which they are used.  This is used later by the
25766         compiler to resolve the reference to an actual Type. 
25767
25768         * DeclSpace is no longer a CIR.Type, and neither are
25769         TypeContainers (Class and Struct) nor Interfaces nor Enums.  They
25770         are all DeclSpaces, but no Types. 
25771
25772         * type.cs (TypeRefManager): This implements the TypeRef manager,
25773         which keeps track of all the types that need to be resolved after
25774         the parsing has finished. 
25775
25776 2001-05-13  Miguel de Icaza  <miguel@ximian.com>
25777
25778         * ARGH.  We are going to have to store `foreach' as a class rather
25779         than resolving it, as we need to verify error 1579 after name
25780         resolution.   *OR* we could keep a flag that says `This request to
25781         IEnumerator comes from a foreach statement' which we can then use
25782         to generate the error.
25783
25784 2001-05-10  Miguel de Icaza  <miguel@ximian.com>
25785
25786         * class.cs (TypeContainer.AddMethod): we now add methods to the
25787         MethodGroup instead of the method hashtable.  
25788
25789         * expression.cs: Add MethodGroup abstraction, which gets us one
25790         step closer to the specification in the way we handle method
25791         declarations.  
25792
25793         * cs-parser.jay (primary_expression): qualified_identifier now
25794         tried to match up an identifier to a local variable reference or
25795         to a parameter reference.
25796
25797         current_local_parameters is now a parser global variable that
25798         points to the current parameters for the block, used during name
25799         lookup.
25800
25801         (property_declaration): Now creates an implicit `value' argument to
25802         the set accessor.
25803
25804 2001-05-09  Miguel de Icaza  <miguel@ximian.com>
25805
25806         * parameter.cs: Do not use `param' arguments as part of the
25807         signature, per the spec.
25808
25809 2001-05-08  Miguel de Icaza  <miguel@ximian.com>
25810
25811         * decl.cs: Base class for classes, structs and interfaces.  This
25812         is the "Declaration Space" 
25813
25814         * cs-parser.jay: Use CheckDef for checking declaration errors
25815         instead of having one on each function.
25816
25817         * class.cs: Factor out some code for handling error handling in
25818         accordance to the "Declarations" section in the "Basic Concepts"
25819         chapter in the ECMA C# spec.
25820
25821         * interface.cs: Make all interface member classes derive from
25822         InterfaceMemberBase.
25823
25824 2001-05-07  Miguel de Icaza  <miguel@ximian.com>
25825
25826         * Many things: all interfaces are parsed and generated in
25827         gen-treedump.  Support for member variables, constructors,
25828         destructors, properties, constants is there.
25829
25830         Beginning of the IL backend, but very little done, just there for
25831         testing purposes. 
25832
25833 2001-04-29  Miguel de Icaza  <miguel@ximian.com>
25834
25835         * cs-parser.jay: Fix labeled statement.
25836
25837         * cs-tokenizer.cs (escape): Escape " and ' always.
25838         ref_line, ref_name: keep track of the line/filename as instructed
25839         by #line by the compiler.
25840         Parse #line.
25841
25842 2001-04-27  Miguel de Icaza  <miguel@ximian.com>
25843
25844         * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
25845         to match the values in System.CodeDOM.
25846
25847         Divid renamed to Divide.
25848
25849         * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
25850         statements. 
25851         (Statements.set): remove.
25852
25853         * System.CodeDOM/CodeCatchClause.cs: always have a valid
25854         statements. 
25855
25856         * System.CodeDOM/CodeIfStatement.cs: trueStatements and
25857         falseStatements always have valid values. 
25858
25859         * cs-parser.jay: Use System.CodeDOM now.
25860