2009-02-20 Zoltan Varga <vargaz@gmail.com>
[mcs.git] / mcs / ChangeLog
bloba4b6a63f16dd6559283a872ce585eeb6221de4af
1 2009-02-20  Marek Safar  <marek.safar@gmail.com>
3         A fix for bug #477447
4         * statement.cs: Add reference to correct parent storey when this
5         is accessible from deep children storey (more than 1 level).
7 2009-02-19  Marek Safar  <marek.safar@gmail.com>
9         A fix for bug #475860 by David Mitchell <dmitchell@logos.com>
10         * class.cs: Define base type members before setting up member cache.
12 2009-02-18  Marek Safar  <marek.safar@gmail.com>
14         A fix for bug #477378
15         * nullable.cs, expression.cs, statement.cs: More precise null type
16         sanity checks.
18 2009-02-18  Marek Safar  <marek.safar@gmail.com>
20         A fix for bug #472805
21         * typemanager.cs, namespace.cs: Import only visible extension method
22         types.
24 2009-02-18  Marek Safar  <marek.safar@gmail.com>
26         A fix for bug #476895
27         * attribute.cs: Use correct resolve context for attribute type.
29 2009-02-18  Marek Safar  <marek.safar@gmail.com>
31         A fix for bug #476266
32         * anonymous.cs: Mutate multi-dimensional arrays.
34 2009-02-18  Marek Safar  <marek.safar@gmail.com>
36         A fix for bug #476400
37         * statement.cs, expression.cs: Removed wrong Dispose optimization.
39 2009-02-18  Marek Safar  <marek.safar@gmail.com>
41         A fix for bug #476811
42         * generics.cs: Fixed null-literal check.
44 2009-02-17  Marek Safar  <marek.safar@gmail.com>
46         * typemanager.cs, convert.cs, flowanalysis.cs, driver.cs,
47         expression.cs, ecore.cs, rootcontext.cs, eval.cs, class.cs: More
48         messing with static variables.
50 2009-02-16  Marek Safar  <marek.safar@gmail.com>
52         A fix for bug #475965
53         * generics.cs: Check generic parameter type after extracting from
54         Expression<T>.
56 2009-02-16  Marek Safar  <marek.safar@gmail.com>
58         A fix for bug #475823
59         * convert.cs, expression.cs, literal.cs, ecore.cs, cfold.cs: Add
60         typed-null support.
62 2009-02-14  Marek Safar  <marek.safar@gmail.com>
64         * modifiers.cs, decl.cs, ecore.cs, class.cs, flowanalysis.cs:
65         Simplified event field definition using backing field and not
66         field builder directly.
68         * expression.cs (EmitLdArg): Optimize fast paths.
70 2009-02-13  Marek Safar  <marek.safar@gmail.com>
72         A fix for bug #475327
73         * expression.cs (ArrayCreation): Don't mutate values optimized away.
75 2009-02-13  Marek Safar  <marek.safar@gmail.com>
77         A fix for bug #475342
78         * cs-parser.jay: Using 'super' instead of 'base' to call base
79         constructor crashes compiler.
81 2009-02-13  Marek Safar  <marek.safar@gmail.com>
83         A fix for bug #475354
84         * expression.cs (Constantify): Add nullable types.
85         
86         * const.cs (EmitDecimalConstant): Avoid explicit cast.
88 2009-02-12  Marek Safar  <marek.safar@gmail.com>
90         A fix for bug #475246
91         * expression.cs: More broken flowanalysis hacking needed.
93 2009-02-12  Marek Safar  <marek.safar@gmail.com>
95         * attribute.cs: Compare only ref/out array modifiers. 
97 2009-02-11  Marek Safar  <marek.safar@gmail.com>
99         * statement.cs: Use member cache when looking for foreach members.
101 2009-02-11  Marek Safar  <marek.safar@gmail.com>
103         * expression.cs: Don't expose internal initializer types.
104         
105         * statement.cs: Check also explicit conversions for goto case.
107 2009-02-11  Marek Safar  <marek.safar@gmail.com>
109         * convert.cs, statement.cs: Removed usage of IsAssignableFrom.
111 2009-02-10  Marek Safar  <marek.safar@gmail.com>
113         * *.cs: Replace null-type with NullLiteral where appropriate.
115 2009-02-09  Marek Safar  <marek.safar@gmail.com>
117         * expression.cs: Initializer of reference argument use temporary
118         variable to be verifiable.
119         
120         * parameter.cs: Share EmitLdArg.
122 2009-02-09  Marek Safar  <marek.safar@gmail.com>
124         A fix for bug #473559
125         * class.cs: Fixed: Not reporting error about nested class with the
126         same name.
128 2009-02-06  Scott Peterson  <lunchtimemama@gmail.com>
130         Contributed under the MIT/X11 license.
132         * generic.cs: Added VerifyVariantTypeParameters which performs new
133         variance verification logic. The old logic, based on the spec, was
134         wrong because the spec is full of LIES!
136         * generic-mcs.cs: Stubbed out the VerifyVariantTypeParameters method.
138         *typemanager.cs: Moved variance verification logic to GenericTypeExpr.
140         * class.cs:
141         * ecore.cs: Added calls to the new variance verification logic.
143         * parameter.cs:
144         * delegate.cs: Removed calls to the old variance verification logic.
146 2009-02-06  Marek Safar  <marek.safar@gmail.com>
148         * delegate.cs: Use cached Invoke method directly.
150 2009-02-06  Marek Safar  <marek.safar@gmail.com>
152         * expression.cs: Emit expression tree for hoisted variable access.
154 2009-02-04  Marek Safar  <marek.safar@gmail.com>
156         * namespace.cs: Add better extension class check.
158 2009-02-05  Scott Peterson  <lunchtimemama@gmail.com>
160         * generic.cs: Fixed typeo (TypeParameter.Variacne).
162 2009-02-04  Scott Peterson  <lunchtimemama@gmail.com>
164         This patch adds initial generic variance support to the compiler.
165         It is contributed under the MIT/X11 license.
167         * typemanager.cs: Modified ImplementsInterface to check variance.
168         Added VerifyVariantTypeParameters which checks the specified type to see
169         if it uses a variant type parameter as a type argument (which is not
170         allowed). Added IsVariantOf which determins if the first type is a
171         variant of the second. NOTE: This only supports reference types at
172         the moment to conform with the current level of VM support. When the
173         VM supports value types, this will follow step.
175         * generic.cs: Added the Variance enum. Added a Variance property to
176         TypeParameter and added variance support to definition phase. Added a
177         Variance property to TypeParameterName. Also check to make sure that
178         no variant types appear in generic method parameters.
180         * cs-tokenizer.cs: Modified parse_less_than to tokenize the variance
181         keywords if the langversion supports it.
183         * parameter.cs: Added Parameter.VerifyNoVariantTypeParameters to ensure
184         that variant types are only used in legal positions. Also added
185         ParametersCompiled.VerifyNoVariantTypeParameters to check all of its
186         parameters.
188         * decl.cs: Construct TypeParameter with the variance information.
190         * convert.cs: Checks variance in ImplicitReferenceConversionExists
191         and ImplicitConversionStandard.
193         * rootcontext.cs: Added new "Future" language version.
195         * class.cs: In TypeContainer.DoDefineMembers, ensure that contravariant
196         type parameters are not used as type arguments in interface inheritance.
197         In MemberBase.DoMemberDependentChecks, ensure that contravariant type
198         parameters are not used as method return types. In MemberBase.
199         ResolveMemberType, ensure that variant type parameters are not used
200         as type arguments. Also call VerifyNoVariantTypeParameters on every
201         set of parameters which are resolved.
203         * delegate.cs: Modified Delegate.Define to ensure that variant
204         parameters are not used as type arguments and that a contravariant
205         parameter is not used as the return type. Also call
206         VerifyNoVariantTypeParameters on the delegate parameters.
208         * cs-parser.jay: Modified grammar to support "in" and "out" keywords
209         to specify generic variance.
211         * driver.cs: Added support for LanguageVersion.Future in the form of
212         "-langversion:future".
214         * generic-mcs.cs: Stubbed out new members in generic.cs.
216 2009-02-03  Marek Safar  <marek.safar@gmail.com>
218         * class.cs, generic.cs: Emit type parameter constraints for nested
219         types.
221 2009-02-02  Marek Safar  <marek.safar@gmail.com>
223         A fix for bug #471213
224         * class.cs: Avoid emitting backing field for abstract event fields.
226 2009-02-01  Marek Safar  <marek.safar@gmail.com>
228         A fix for bug #359731
229         * cs-tokenizer.cs, cs-parser.jay: Correctly parse nested query
230         expressions.
232 2009-01-30  Marek Safar  <marek.safar@gmail.com>
234         A fix for bug #470767
235         * statement.cs: Introduced BlockScopeExpression, needed when 
236         expression tree conversion has to emit scope variables.
238 2009-01-29  Marek Safar  <marek.safar@gmail.com>
240         * class.cs: Remove duplicate CallingConvention.
242 2009-01-29  Marek Safar  <marek.safar@gmail.com>
244         *.cs: Rename Parameters to ParametersCompiled and ParametersImported
245         when I finally found the right naming convention.
247 2009-01-29  Marek Safar  <marek.safar@gmail.com>
249         * cs-tokenizer.cs: Put back different open parens optimization.
251 2009-01-28  Marek Safar  <marek.safar@gmail.com>
253         A fix for bug #470227
254         * cs-tokenizer.cs: Remove too agressive parser optimization.
256 2009-01-28  Marek Safar  <marek.safar@gmail.com>
258         A fix for bug #324319
259         * class.cs: Remove too early base type resolve.
261 2009-01-27  Marek Safar  <marek.safar@gmail.com>
263         A fix for bug #324319
264         * ecore.cs: Explicitly type null when assigning to type argument to
265         make pass verifier check.
267 2009-01-27  Marek Safar  <marek.safar@gmail.com>
269         * anonymous.cs: Fixed recent regression when initializing captured 
270         this.
272 2009-01-26  Marek Safar  <marek.safar@gmail.com>
274         A fix for bug #469019
275         * anonymous.cs: Use all parent type parameters when instantiating
276         nested generic storey.
278 2009-01-26  Marek Safar  <marek.safar@gmail.com>
280         * expression.cs: Check for null instance methodgroup expression.
282 2009-01-26  Marek Safar  <marek.safar@gmail.com>
284         A fix for bug #469244
285         * cs-tokenizer.cs, cs-parser.jay: Fixed parsing of nullable type
286         instance inside a conditional expression.
288 2009-01-23  Marek Safar  <marek.safar@gmail.com>
290         * typemanager.cs, generic.cs, parameter.cs, decl.cs, anonymous.cs,
291         expression.cs, report.cs, ecore.cs, attribute.cs: Use common 
292         GetElementType and HasElementType. IsValueType clean up.
294 2009-01-23  Marek Safar  <marek.safar@gmail.com>
296         * nullable.cs: Use common EmitCall.
297         
298         * expression.cs: Emit constraint. for virtual calls only.
300 2009-01-23  Marek Safar  <marek.safar@gmail.com>
302         * typemanager.cs, generic.cs, eval.cs, convert.cs, const.cs, 
303         expression.cs, statement.cs, rootcontext.cs, ecore.cs, class.cs,
304         driver.cs, attribute.cs, enum.cs: Split IsValueType and IsStruct
305         checks.
307 2009-01-22  Jb Evain  <jbevain@novell.com>
309         * anonymous.cs: make anonymous types' ToString implementation
310         match what csc outputs.
312 2009-01-21  Marek Safar  <marek.safar@gmail.com>
314         * typemanager.cs, ecore.cs, iterator.cs: TypeLookupExpression clean
315         up.
317 2009-01-17  Marek Safar  <marek.safar@gmail.com>
319         * convert.cs, ecore.cs: Explicitly casts type arguments to pass
320         verifier checks.
322 2009-01-16  Marek Safar  <marek.safar@gmail.com>
324         * nullable.cs (LiftedBinaryOperator): Check for all possible null
325         expressions.
327 2009-01-15  Marek Safar  <marek.safar@gmail.com>
329         A fix for bug #466634
330         * statement.cs: Add reference for nested storey when only this
331         is captured.
333 2009-01-15  Marek Safar  <marek.safar@gmail.com>
335         A fix for bug #466474
336         * codegen.cs: Emit SecurityPermissionAttribute when -unsafe option
337         was specified.
339 2009-01-15  Marek Safar  <marek.safar@gmail.com>
341         * iterators.cs, anonymous.cs, expression.cs, statement.cs, ecore.cs:
342         Fixed nested stories parent referencing process. Also fixes #463985.
344 2009-01-06  Marek Safar  <marek.safar@gmail.com>
346         * decl.cs, iterators.cs, expression.cs, statement.cs, doc.cs, 
347         class.cs, cs-parser.jay, codegen.cs: Clean up destructor
348         implementation. Also fixes #463108.
350 2009-01-05  Marek Safar  <marek.safar@gmail.com>
352         A fix for bug #416109
353         * decl.cs: Issue correct CLSAttribute warning location.
355 2009-01-05  Marek Safar  <marek.safar@gmail.com>
357         A fix for bug #456775
358         * attribute.cs: Use attribute owner scope when resolving attribute
359         arguments.
361 2009-01-05  Marek Safar  <marek.safar@gmail.com>
363         A fix for bug #457257
364         * decl.cs: Fixed incorrect member declaring type comparison.
366 2009-01-05  Marek Safar  <marek.safar@gmail.com>
368         A fix for bug #460896
369         * driver.cs: Handle /RES resources as embeddable.
371 2009-01-05  Marek Safar  <marek.safar@gmail.com>
373         A fix for bug #462515
374         * ecore.cs: Report inacessible members upwards.
376 2009-01-05  Marek Safar  <marek.safar@gmail.com>
378         A fix for bug #463190, #463192
379         * decl.cs, namespace.cs: Also import internal extension classes.
381 2009-01-04  Marek Safar  <marek.safar@gmail.com>
383         A fix for bug #463415
384         * generic.cs: Use right index for RemoveDependentTypes.
386 2009-01-02  Marek Safar  <marek.safar@gmail.com>
388         A fix for bug #463196
389         * expression.cs: Fixed enum to null comparison.
391 2009-01-02  Marek Safar  <marek.safar@gmail.com>
393         A fix for bug #463121
394         * nullable.cs: Fixed nullable user equality operator comparison.
396 2009-01-02  Marek Safar  <marek.safar@gmail.com>
398         A fix for bug #462950
399         * class.cs, decl.cs: Use full explicit name when defining automatic
400         property backing field.
402 2009-01-02  Marek Safar  <marek.safar@gmail.com>
404         A fix for bug #462592
405         * pending.cs: Emit type arguments for generic proxy method.
407 2008-12-30  Marek Safar  <marek.safar@gmail.com>
409         * expression.cs (As): Mutate all type arguments.
411 2008-12-29  Marek Safar  <marek.safar@gmail.com>
413         A fix for bug #462622
414         * anonymous.cs: Resolve anonymous type GetHashCode in unchecked
415         context.
417 2008-12-29  Marek Safar  <marek.safar@gmail.com>
419         A fix for bug #450782
420         * ecore.cs: Consider more variables of form V.I to be fixed.
422 2008-12-29  Marek Safar  <marek.safar@gmail.com>
424         A fix for bug #460712
425         * typemanager.cs: Core types could be imported.
427 2008-12-28  Marek Safar  <marek.safar@gmail.com>
429         A fix for bugs #460847, #460772, #458049, #457339, #447807
430         * generic.cs, parameter.cs, lambda.cs, linq.cs, anonymous.cs
431         statement.cs, ecore.cs, class.cs, delegate.cs, flowanalysis.cs
432         cs-parser.jay, driver.cs: LINQ implementation upgrade to deal with
433         user lambdas used inside query clauses.
435 2008-12-18  Marek Safar  <marek.safar@gmail.com>
437         A fix for bug #460229
438         * cs-tokenizer.cs: Ignore wrongly placed BOM markers.
440 2008-12-18  Marek Safar  <marek.safar@gmail.com>
442         A fix for bug #459952
443         * decl.cs, namespace.cs: Use common CheckAccessLevel.
445 2008-12-18  Marek Safar  <marek.safar@gmail.com>
447         A fix for bug #459630
448         * convert.cs: Enum to valuetype conversion is not allowed.
450 2008-12-18  Marek Safar  <marek.safar@gmail.com>
452         A fix for bug #457087
453         * generic.cs: Don't crash when constraint comes from type
454         declaration.
456 2008-12-16  Marek Safar  <marek.safar@gmail.com>
458         A fix for bug #459221
459         * anonymous.cs, statement.cs: Delay only captured this
460         initialization.
462 2008-12-12  Marek Safar  <marek.safar@gmail.com>
464         A fix for bug #457489
465         * anonymous.cs, statement.cs: Split anonymous storey instantiation
466         and initialization to capture scope initializers correctly.
468 2008-12-11  Marek Safar  <marek.safar@gmail.com>
470         * generic.cs, parameter.cs, expression.cs, statement.cs, doc.cs:
471         ParameterReference refactoring.
473 2008-12-03  Marek Safar  <marek.safar@gmail.com>
475         * typemanager.cs, namespace.cs, driver.cs: Allow ExtensionAttribute
476         to be imported from any assembly.
478 2008-12-03  Marek Safar  <marek.safar@gmail.com>
480         * parameter.cs, lambda.cs, linq.cs, iterators.cs, anonymous.cs
481         statement.cs, class.cs, cs-parser.jay: Removed duplicate parameters
482         from anonymous method and lambda expression.
484 2008-12-01  Marek Safar  <marek.safar@gmail.com>
486         A fix for bug #448560
487         * expression.cs (As): Box any generic type arguments to be
488         verifiable.
490 2008-11-29  Raja R Harinath  <harinath@hurrynot.org>
492         Add tripwire for implicit conversion bugs
493         * ecore.cs (MethodGroupExpr.Error_ArgumentCountWrong): New helper
494         for CS1501 error.
495         (MethodGroupExpr.OverloadResolve): Add sanity check between
496         IsApplicable and VerifyArgumentsCompat.
497         (VerifyArgumentsCompat): Report CS1501 where appropriate.
499 2008-11-29  Raja R Harinath  <harinath@hurrynot.org>
501         Fix build break in System.Data_test
502         * convert.cs (ImplicitConversionExists): Move NullLiteral
503         conversions ...
504         (ImplicitStandardConversionExists): ... here.
506 2008-11-28  Marek Safar  <marek.safar@gmail.com>
508         * literal.cs: Emit correctly explicit null to nullable cast.
510 2008-11-28  Marek Safar  <marek.safar@gmail.com>
512         * ecore.cs, generics.cs: Fixed crash when type arguments fail to
513         resolve.
515 2008-11-28  Marek Safar  <marek.safar@gmail.com>
517         A fix for bug #449005
518         * convert.cs, nullable.cs: Use only one implicit nullable
519         conversion.
521 2008-11-27  Marek Safar  <marek.safar@gmail.com>
523         * convert.cs, literal.cs: More Convert cleanup is needed.
525 2008-11-27  Marek Safar  <marek.safar@gmail.com>
527         * decl.cs, class.cs: Fixed misleading error message.
529 2008-11-26  Marek Safar  <marek.safar@gmail.com>
531         A fix for bug #449005
532         * nullable.cs (EmitEquality): Disable optimization for user operator
533         operands.
535 2008-11-25  Marek Safar  <marek.safar@gmail.com>
537         A fix for bug #447027
538         * anonymous.cs (HoistedVariable): Cache also outer access to deal
539         with context variables stored as expression instances.
541 2008-11-25  Marek Safar  <marek.safar@gmail.com>
543         A fix for bug #447027
544         * delegate.cs: Fixed delegate VerifyMethod logic.
546 2008-11-24  Marek Safar  <marek.safar@gmail.com>
548         * ecore.cs, delegate.cs: MethodGroup expressions can be applicable
549         but not verifiable.
551 2008-11-21  Marek Safar  <marek.safar@gmail.com>
553         * typemanager.cs, decl.cs, anonymous.cs, class.cs, enum.cs: Rewrote
554         member type resolve to follow normal flow, instead of random
555         property access.
557 2008-11-21  Marek Safar  <marek.safar@gmail.com>
559         * iterators.cs (GetEnumeratorStatement): Re-use already resolved
560         type.
562 2008-11-21  Marek Safar  <marek.safar@gmail.com>
564         * const.cs: Emit decimal array constant as literal.
566 2008-11-20  Marek Safar  <marek.safar@gmail.com>
568         * iterators.cs, ecore.cs: Removed CurrentBlock statement.
570 2008-11-19  Marek Safar  <marek.safar@gmail.com>
572         * eval.cs, location.cs, driver.cs (Location.SourceFiles): Turned
573         into real property (saves 8 MB for corlib compilation).
575 2008-11-19  Marek Safar  <marek.safar@gmail.com>
577         * generic.cs, lambda.cs, linq.cs, iterators.cs, anonymous.cs,
578         nullable.cs, expression.cs, statement.cs, ecore.cs, cs-parser.jay
579         generic-mcs.cs: Small cleanup of TypeArguments.
581 2008-11-18  Marek Safar  <marek.safar@gmail.com>
583         * generic.cs, iterators.cs, anonymous.cs, nullable.cs, ecore.cs,
584         expression.cs, namespace.cs, generic-mcs.cs, class.cs: Small cleanup
585         of ConstructedType expression, renamed to GenericTypeExpr.
587 2008-11-17  Marek Safar  <marek.safar@gmail.com>
589         A fix for bug #445303
590         * location.cs (IsConditionalDefined): Handle undefined global
591         defines.
593 2008-11-17  Marek Safar  <marek.safar@gmail.com>
595         A fix for bug #444678
596         * expression.cs (TryReduceConstant): Always create new constant
597         instance.
599 2008-11-17  Marek Safar  <marek.safar@gmail.com>
601         A fix for bug #444673
602         * ecore.cs: Ignore open generic types when used as generic type
603         instance fields.
605 2008-11-17  Marek Safar  <marek.safar@gmail.com>
607         A fix for bug #445458
608         * expression.cs, cs-parser.jay: Don't crash when an expression
609         statement is null.
611 2008-11-17  Marek Safar  <marek.safar@gmail.com>
613         A fix for bug #445464
614         * expression.cs, cs-parser.jay: Fixed typeof of non-generic type
615         inside unbound type.
617 2008-11-14  Jb Evain  <jbevain@novell.com>
619         * driver.cs: ignore empty -nowarn argument such as
620         the one in -nowarn:12,13,,.
622 2008-11-13  Marek Safar  <marek.safar@gmail.com>
624         A fix for bug #444271
625         * anonymous.cs: Rescan parent storeys when best candidate was
626         undone.
628 2008-11-13  Marek Safar  <marek.safar@gmail.com>
630         * generic.cs, expression.cs, ecore.cs, cs-parser.jay: Removed
631         useless UnboundTypeExpression.
632         
633         * attribute.cs: Do check obsolete attribute on generic types.
635 2008-11-12  Marek Safar  <marek.safar@gmail.com>
637         A fix for bugs #425680, #400139
638         * ecore.cs, expression.cs: Trying to do some almost_matched_members
639         refactoring.
641 2008-11-11  Marek Safar  <marek.safar@gmail.com>
643         A fix for bug #435747
644         * assign.cs, expression.cs: Cleanup New assignment to emit correcly
645         compound value types assignment. Few micro optimizations added.
647 2008-11-10  Marek Safar  <marek.safar@gmail.com>
649         A fix for bug #442610
650         * anonymous.cs (MutateConstructor): More SRE hacking.
652 2008-11-10  Marek Safar  <marek.safar@gmail.com>
654         A fix for bug #442579
655         * ecore.cs: Also initialize expanded form of a method with 1 params
656         parameter.
658 2008-11-06  Marek Safar  <marek.safar@gmail.com>
660         * expression.cs (UnaryMutator): Do early l-side check.
662 2008-11-05  Miguel de Icaza  <miguel@novell.com>
664         * codegen.cs (InitDynamic): also setup Assembly.Name like we do in
665         Init, otherwise we would crash later on when checking for friend
666         assemblies. 
668         * eval.cs: Do not hide errors from invalid calls to LoadAssembly.
669         Otherwise we never get any meaningful information as to what
670         failed. 
672 2008-11-05  Marek Safar  <marek.safar@gmail.com>
674         A fix for bug #436318
675         * driver.cs, report.cs: Add -warnaserror:Wn to command line options.
677 2008-11-05  Miguel de Icaza  <miguel@novell.com>
679         * namespace.cs: Turns out that it was a really bad idea to hide
680         the errors for namespaces not found here in eval mode.    
682         * eval.cs: When we process using clauses, only enter those into
683         the list of valid using clauses after they have been validated.   
685         The above change gives the proper semantics: it does not
686         senselessly report the same errors with broken using statements by
687         never storing them in the first place when they are invalid.
689 2008-11-05  Marek Safar  <marek.safar@gmail.com>
691         A fix for bug #421839
692         * cs-parser.jay: Remove expression from coalesce rule to force lower
693         priority than the assignment operator.
695 2008-11-05  Marek Safar  <marek.safar@gmail.com>
697         A fix for bug #437875
698         * nullable.cs: Compile correctly method group operand used with null
699         coalescing operator.
701 2008-11-04  Marek Safar  <marek.safar@gmail.com>
703         A fix for bug #434589
704         * expression.cs (Binary): Ignore lifted conversions when at least
705         one operand is of reference type.
707 2008-11-04  Marek Safar  <marek.safar@gmail.com>
709         * cs-parser.jay: Better syntax error report.
711 2008-11-03  Marek Safar  <marek.safar@gmail.com>
713         A fix for bug #436792
714         * cs-parser.jay: Use GetLocation to access location.
716 2008-11-03  Marek Safar  <marek.safar@gmail.com>
718         A fix for bug #440774
719         * cs-parser.jay: Also set current_array_type when parsing local
720         variables types.
722 2008-11-03  Marek Safar  <marek.safar@gmail.com>
724         A fix for bug #440785
725         * expression.cs (As): Don't resolve self modifing expression
726         multiple times.
728 2008-11-03  Marek Safar  <marek.safar@gmail.com>
730         A fix for bug #439447
731         * cs-tokenizer.cs: Tokenize surrogates only where allowed.
733 2008-11-03  Marek Safar  <marek.safar@gmail.com>
735         A fix for bug #437571
736         * cs-parser.jay: Fixes internal error for invalid expression
737         statements.
739 2008-10-17  Marek Safar  <marek.safar@gmail.com>
741         * ecore.cs: Resolve correctly ambiguous params delegate methods.
743 2008-10-17  Marek Safar  <marek.safar@gmail.com>
745         * generic.cs, anonymous.cs: Simplified GetDeclarations.
747 2008-10-17  Marek Safar  <marek.safar@gmail.com>
749         * cs-tokenizer.cs: More precise cast parsing.
751 2008-10-16  Martin Baulig  <martin@ximian.com>
753         * anonymous.cs (AnonymousMethodStorey): Put back the
754         `hoisted_locals' hashtable and use it in EmitType().
756 2008-10-15  Marek Safar  <marek.safar@gmail.com>
758         * cs-tokenizer.cs, nullable.cs, expression.cs, statement.cs,
759         cs-parser.jay: Tokenizer optimizations and memory reduction, saves
760         ~5MB for corlib.
762 2008-10-14  Marek Safar  <marek.safar@gmail.com>
764         * cs-tokenizer.cs: Add bool type to the list of valid cast tokens.
766 2008-10-14  Marek Safar  <marek.safar@gmail.com>
768         * statement.cs: Mutate scope initializers.
770 2008-10-14  Marek Safar  <marek.safar@gmail.com>
772         * expression.cs: Use typeless value for This constant.
773         
774         * ecore.cs: Access FieldInfo via GetConstructedFieldInfo.
776 2008-10-14  Marek Safar  <marek.safar@gmail.com>
778         * cs-tokenizer.cs, cs-parser.jay: Unify context sensite keyword
779         tokenizer.
781 2008-10-13  Marek Safar  <marek.safar@gmail.com>
783         * cs-tokenizer.cs: Add missing alias qualifier and dotted generic
784         type to type cast.
786 2008-10-13  Marek Safar  <marek.safar@gmail.com>
788         * cs-tokenizer.cs, expression.cs, cs-parser.jay: Reworked parens
789         parser and tokenizer. Fixes many ambiguities including #433258.
791 2008-10-10  Marek Safar  <marek.safar@gmail.com>
793         * cs-parser.jay: Fixed missing accessor recovery.
795 2008-10-10  Marek Safar  <marek.safar@gmail.com>
797         A fix for bug #433701
798         * expression.cs: Better error message.
800 2008-10-10  Marek Safar  <marek.safar@gmail.com>
802         * cs-parser.jay, expression.cs: Start reporting real parser errors.
803         
804         * Makefile: Disabled unused debug symbols.
806         Also fixes: #320556, #321097, #321656, #321876, #351316
808 2008-10-09  Miguel de Icaza  <miguel@novell.com>
810         * eval.cs: rename "<interactive>" to "{interactive}", to work
811         around a requirement in the compiler that this be a valid
812         filename, and in Windows it is not (433886).
814 2008-10-09  Marek Safar  <marek.safar@gmail.com>
816         * cs-tokenizer.cs, cs-parser.jay: Fixed more subtle parser problems
818 2008-10-08  Marek Safar  <marek.safar@gmail.com>
820         * cs-tokenizer.cs, eval.cs, anonymous.cs, statement.cs, class.cs
821         cs-parser.jay: Generic type declaration and type arguments cleanup.
823 2008-10-05  Marek Safar  <marek.safar@gmail.com>
825         * cs-parser.jay: Allow parsing weird array creation construct.
827 2008-10-05  Marek Safar  <marek.safar@gmail.com>
829         * cs-parser.jay: Conflicts reduction.
831 2008-10-04  Marek Safar  <marek.safar@gmail.com>
833         * cs-parser.jay: Conflicts reduction.
835 2008-10-04  Raja R Harinath  <harinath@hurrynot.org>
837         Fix #398325
838         * flowanalysis.cs (MyBitvector.MakeShared): Rename from 'Shared'
839         property.  Add a 'count' hint about the use of the shared vector.
840         Ensure that we don't leak out dirty bits.
841         (UsageVector.MergeChild): Throw away information about variables
842         in child vectors.
843         Based on patch and analysis by Moritz Kroll <Moritz.Kroll@gmx.de>.
845 2008-10-03  Marek Safar  <marek.safar@gmail.com>
847         A fix for bug #431746
848         * iterators.cs, anonymous.cs: Re-initialize hoisted iterator
849         parameters when iterator is created.
851 2008-10-03  Marek Safar  <marek.safar@gmail.com>
853         A fix for bug #431827
854         * expression.cs: Fixed right based pointer arithmetic operations
855         emit.
857 2008-10-03  Marek Safar  <marek.safar@gmail.com>
859         A fix for bug #353779
860         * assign.cs, expression.cs: Fixed compound assignment conversions.
862 2008-10-02  Marek Safar  <marek.safar@gmail.com>
864         A fix for bug #375262
865         * statement.cs: Refactor ArrayForeach to be usable with string
866         indexer. Optimized single dimentional arrays foreach.
868 2008-10-02  Marek Safar  <marek.safar@gmail.com>
870         A fix for bug #431255
871         * anonymous.cs, expression.cs: Removed broken optimization.
873 2008-10-01  Marek Safar  <marek.safar@gmail.com>
875         * anonymous.cs: Use full type parameters of parent generic
876         containers. Removed unnecessary AddParentStoreyReference call.
878 2008-10-01  Marek Safar  <marek.safar@gmail.com>
880         A fix for bug #324702
881         * class.cs: Use better shorter names for explicit interface member
882         implementations.
884         * ecore.cs, typemanager.cs: Convert only mscorlib predefined names.
886 2008-10-01  Marek Safar  <marek.safar@gmail.com>
887         
888         * expression.cs: Use new interface to check fixed expression.
890 2008-10-01  Marek Safar  <marek.safar@gmail.com>
892         A fix for bug #421101
893         * expression.cs, statement.cs, ecore.cs: Use IFixedExpression
894         interface to check for fixed fixed-buffers.
896 2008-10-01  Marek Safar  <marek.safar@gmail.com>
898         A fix for bug #429264
899         * assign.cs, anonymous.cs, ecore.cs: More type mutators added.
900         
901         * delegate.cs: Removed unnecessary casts.
903 2008-09-30  Marek Safar  <marek.safar@gmail.com>
905         A fix for bug #352151
906         * decl.cs, iterators.cs, anonymous.cs, report.cs, namespace.cs,
907         class.cs: Fixed already defined explicit interface members check.
909 2008-09-29  Rodrigo Kumpera  <rkumpera@novell.com>
911         cs-tokenizer.cs: Fix typo.
913 2008-09-28  Miguel de Icaza  <miguel@novell.com>
915         * eval.cs (InteractiveBase): The quit command now just sets a
916         flag, instead of calling Environment.Exit(), it is milder on
917         embedded hosts. 
919         CompiledMethod is now in Mono.CSharp, not nested inside
920         the Evaluator, it was inconvenient to use.
922 2008-09-27  Miguel de Icaza  <miguel@novell.com>
924         * eval.cs (Evaluator): Introduce Compile method, to allow compiled
925         code to be invoked without having to reparse.
927 2008-09-27  Miguel de Icaza  <miguel@novell.com>
929         * ecore.cs: The recent changes to FieldExpr broke this as well.
930         Fixes LINQ queries in the interactive shell.
932         * Multiple files: indentation fixing for the Mono coding
933         guidelines for the switch statement.
935         * eval.cs: Make the Evaluator API thread safe.
937 2008-09-26  Marek Safar  <marek.safar@gmail.com>
939         * anonymous.cs, statement.cs, class.cs, cs-parser.jay: Simplified
940         constructor parsing.
942 2008-09-26  Marek Safar  <marek.safar@gmail.com>
944         A fix for bug #325326
945         * statement.cs: Check possible mistaken empty statement using
946         explicit blocks only.
948 2008-09-25  Miguel de Icaza  <miguel@novell.com>
950         * eval.cs (LoadAssembly, ReferenceAssembly): Call
951         RootNamespace.ComputeNamespaces to update the internal list of
952         namespaces, this is no longer done for us.
954         (InteractiveBase): Use the Evaluator APIs instead of calling into
955         Driver directly
957 2008-09-25  Marek Safar  <marek.safar@gmail.com>
959         A fix for bug #429264
960         * expression.cs: Missing mutator for access to multidimensional
961         arrays.
963 2008-09-25  Marek Safar  <marek.safar@gmail.com>
965         * class.cs, statement: Emit DebuggerHidden attribute for iterator
966         entry wrapper.
967         
968         * driver.cs: Missing input argument check.
970 2008-09-25  Marek Safar  <marek.safar@gmail.com>
972         * typemanager.cs, generic.cs, eval.cs, decl.cs, anonymous.cs,
973         expression.cs, statement.cs, rootcontext.cs, class.cs, 
974         cs-parser.jay, driver.cs, generic-mcs.cs, enum.cs: Removed obsolete
975         DefineMembers.
977 2008-09-24  Miguel de Icaza  <miguel@novell.com>
979         * ecore.cs (FieldExpr): Only initialize eclass when we return a
980         fully constructed FieldExpr, fixes the regression introduced in
981         the last commit.
982         
983         * ecore.cs, expression.cs: Plug back the eclass initialization as
984         otherwise it regresses `csharp'. 
986 2008-09-24  Marek Safar  <marek.safar@gmail.com>
988         * typemanager.cs, decl.cs, convert.cs, assign.cs, expression.cs,
989         ecore.cs, attribute.cs: Moved obsolete method checks from emit
990         phase to resolve phase. It resolves problems with expression trees
991         and fixes bugs #323796, #325156.
993 2008-09-23  Marek Safar  <marek.safar@gmail.com>
995         * codegen.cs: Report better error when symbol writer is missing.
997 2008-09-23  Marek Safar  <marek.safar@gmail.com>
999         * codegen.cs: Set .NET symbol writer.
1000         
1001         * decl.cs: Guard against null generic arguments.
1002         
1003         * report.cs: Don't report exactly same additional details.
1005 2008-09-22  Marek Safar  <marek.safar@gmail.com>
1007         A fix for bug #324917
1008         * cs-parser.jay: Add missing multidimensional non-expression type
1009         ranks.
1010         
1011 2008-09-22  Marek Safar  <marek.safar@gmail.com>
1013         A fix for bug #428191
1014         * anonymous.cs: Create an outer generic fields also for non-storey
1015         anonymous methods.
1017 2008-09-22  Marek Safar  <marek.safar@gmail.com>
1019         A fix for bug #378294
1020         * class.cs: Make fixed size buffers gmcs feature only.
1022 2008-09-22  Marek Safar  <marek.safar@gmail.com>
1024         A fix for bug #355622, #324993
1025         * assign.cs, const.cs, class.cs: Create new EmitContext for each
1026         field initializer.
1028 2008-09-19  Marek Safar  <marek.safar@gmail.com>
1030         * nullable.cs, expression.cs, namespace.cs, delegate.cs: Duplicate
1031         error reporting.
1033 2008-09-19  Marek Safar  <marek.safar@gmail.com>
1035         A fix for bug #416110
1036         * generic.cs: Struct constraint results in default ctor and
1037         ValueType base type constraint to be set.
1039 2008-09-19  Marek Safar  <marek.safar@gmail.com>
1041         A fix for bug #423791
1042         * generic.cs: Fixed params output type type-inference.
1044 2008-09-19  Marek Safar  <marek.safar@gmail.com>
1046         * cs-parser.jay, expression.cs: Fixed few expression crashes.
1047         
1048 2008-09-19  Marek Safar  <marek.safar@gmail.com>
1050         * cs-tokenizer.cs: Don't break on extra partial modifier.
1052 2008-09-19  Marek Safar  <marek.safar@gmail.com>
1054         A fix for bug #427592
1055         * generic.cs: Use common parameter resolve method.
1057 2008-09-18  Marek Safar  <marek.safar@gmail.com>
1059         A fix for bug #414758
1060         * expression.cs, ecore.cs: Fixed crash when accessing non-static
1061         property.
1063 2008-09-18  Marek Safar  <marek.safar@gmail.com>
1065         * driver.cs, namespace.cs: Read types and namespaces after all
1066         requested assemblies are loaded, fixes issues with System.Core
1067         auto-reference, and #419888.
1069 2008-09-18  Marek Safar  <marek.safar@gmail.com>
1071         A fix for bug #417705
1072         * cs-parser.jay: Fixed as/is operator expression split.
1074 2008-09-18  Marek Safar  <marek.safar@gmail.com>
1076         * const.cs, expression.cs, statement.cs, ecore.cs, cs-parser.jay:
1077         Fixed expression tree representation of empty new expression and
1078         new initializer expression.
1080 2008-09-18  Miguel de Icaza  <miguel@novell.com>
1082         * eval.cs: Remove warning, keep reference to driver around.
1084         * Hide fields that do not need to be public.
1086 2008-09-17  Marek Safar  <marek.safar@gmail.com>
1088         A fix for bug #426385
1089         * expression.cs (ImplicitlyTypedArrayCreation): Use full implicit
1090         conversion for array elements.
1092 2008-09-17  Marek Safar  <marek.safar@gmail.com>
1094         * expression.cs, statement.cs, class.cs, cs-parser.jay: Fixed
1095         void parsing conflicts.
1097 2008-09-15  Marek Safar  <marek.safar@gmail.com>
1099         A fix for bug #425601
1100         * driver.cs, typemanager.cs, namespace.cs: Automatically reference
1101         System.Core only when there is no custom ExtensionAttribute
1102         implementation.
1104 2008-09-15  Miguel de Icaza  <miguel@novell.com>
1106         * namespace.cs: Do not report CS0246 (name
1108 2008-09-12  Marek Safar  <marek.safar@gmail.com>
1110         A fix for bug #425669
1111         * generic.cs: Don't cache generic static anonymous method 
1112         containers.
1114 2008-09-12  Marek Safar  <marek.safar@gmail.com>
1116         * generic.cs, class.cs, delegate.cs: Check recursive inherited
1117         conflicting constraints.
1119 2008-09-12  Raja R Harinath  <harinath@hurrynot.org>
1121         * cs-tokenizer.cs (consume_identifier): Allow partial methods in
1122         mcs too.
1124 2008-09-12  Marek Safar  <marek.safar@gmail.com>
1126         * literal.cs, convert.cs, expression.cs, statement.cs: More null
1127         to null pointer conversion fixes.
1129 2008-09-11  Marek Safar  <marek.safar@gmail.com>
1131         * cs-parser.jay, expression.cs: An implicitly typed local variable
1132         declarator cannot use an array initializer.
1134 2008-09-11  Marek Safar  <marek.safar@gmail.com>
1136         * cs-parser.jay: Reduced number of printed tokens, add sorting.
1138 2008-09-11  Marek Safar  <marek.safar@gmail.com>
1140         * generic.cs (InflatedConstraints): Don't crash when constraints
1141         are different.
1142         
1143         * cs-parser.jay: const_declarator is a block.
1145         * constant.cs: Check for not allowed NaN conversions.
1147 2008-09-10  Miguel de Icaza  <miguel@novell.com>
1149         * driver.cs: Drop --shell argument, the compiler is no longer a
1150         REPL. 
1152         * eval.cs: Move most of the code that deals with evaluation into
1153         this file and document the public API from repl.cs
1155         * repl.cs: Remove from here.
1156         
1157 2008-09-10  Marek Safar  <marek.safar@gmail.com>
1159         A fix for bug #424684
1160         * generic.cs: Generic class constraints must come first.
1162 2008-09-09  Miguel de Icaza  <miguel@novell.com>
1164         * cs-parser.jay: Improve error reporting for syntax errors in
1165         statements and expressions, we now report the expected tokens
1166         instead of reporting the useless "; expected".
1168         Drop the strings from the token declaration, it turns out that
1169         they did not do what I thought they did.  Instead they were adding
1170         two sets of tokens to the tables.
1172 2008-09-09  Marek Safar  <marek.safar@gmail.com>
1174         * typemanager.cs, generic.cs, parameter.cs, expression.cs, class.cs,
1175         delegate.cs: Share special type check.
1177 2008-09-09  Marek Safar  <marek.safar@gmail.com>
1179         A fix for bug #423981
1180         * expression.cs (EmitBranchable): Correctly emit inverted float conditions.
1182 2008-09-09  Marek Safar  <marek.safar@gmail.com>
1184         * ecore.cs (ReducedConstantExpression): Implemented ConvertExplicitly and
1185         ConvertImplicitly.
1187 2008-09-09  Marek Safar  <marek.safar@gmail.com>
1189         A fix for bugs: #324750, #335946
1190         * cs-tokenizer.cs, cs-parser.jay, expression.cs: Use a custom 
1191         lookup rule to determine ?-based tokens.
1193 2008-09-08  Miguel de Icaza  <miguel@novell.com>
1195         * repl.cs (OptionalAssign.EmitStatement): It is possible that some
1196         expressions (like event adding or removing) end up here, so we
1197         need to treat those as statements.
1199         Add LoadAssembly method.
1201 2008-09-04  Miguel de Icaza  <miguel@novell.com>
1203         * repl.cs: Add Time method.
1205 2008-09-05  Marek Safar  <marek.safar@gmail.com>
1207         * cs-tokenizer.cs: Fixed swaped UTF-16 surrogates parsing.
1209 2008-09-05  Miguel de Icaza  <miguel@novell.com>
1211         * repl.cs: Add workaround for old compilers.
1213 2008-09-04  Jb Evain  <jbevain@novell.com>
1215         * repl.cs (PrettyPrint): pretty print everything that
1216         implements IDictionary, as well as IEnumerables. Also,
1217         add a quit helper property.
1219 2008-09-04  Marek Safar  <marek.safar@gmail.com>
1221         * constant.cs: Better error reporting for decimal literals.
1222         
1223         * class.cs, attribute.cs, typemanager.cs: Emit more fixed buffer
1224         field attributes.
1225         
1226 2008-09-04  Marek Safar  <marek.safar@gmail.com>
1227                         Miguel de Icaza  <miguel@novell.com>
1229         A fix for bug #422951
1230         * assign.cs (Assign.DoResolve): Perform the type conversions
1231         checks before we attempt to initialize `New' initializers. 
1233 2008-09-04  Marek Safar  <marek.safar@gmail.com>
1235         A fix for bug #422853
1236         * delegate.cs (DelegateCreation): Add special handling for
1237         EmptyExpression.Null instance expression which is just another
1238         hack for undecided member instance exression.
1240 2008-09-04  Marek Safar  <marek.safar@gmail.com>
1242         * expression.cs, ecore.cs: Emit full expression tree for reduced
1243         binary expressions.
1245 2008-09-04  Marek Safar  <marek.safar@gmail.com>
1247         * expression.cs (This): Guard against multi-resolving.
1248         
1249         * ecore.cs, statement.cs (Throw): Simplified.
1250         
1251         * flowanalysis.cs: Also verify event fields.
1253 2008-09-04  Miguel de Icaza  <miguel@novell.com>
1255         * assign.cs (Assign.DoResolve): Perform the type conversions
1256         checks before we attempt to initialize `New' initializers. 
1258         * repl.cs (PrettyPrint): Add Hashtable prettyprint
1260         * anonymous.cs (AnonymousTypeClass): On EvalMode make the class
1261         public. 
1263         * repl.cs: Update help.
1265 2008-09-03  Miguel de Icaza  <miguel@novell.com>
1267         * driver.cs (ProcessDefaultConfig): Now it encapsulates all the
1268         handling of the default config handling, including the special
1269         treatment of System.Core assembly. 
1271         Fixes the REPL processing for LINQ.
1273 2008-09-03  Marek Safar  <marek.safar@gmail.com>
1275         A fix for bug #422507
1276         * expression.cs (UnboxCast): Add missing child expression mutator.
1278 2008-09-03  Marek Safar  <marek.safar@gmail.com>
1280         * driver.cs: Don't self reference System.Core assembly.
1282 2008-09-03  Marek Safar  <marek.safar@gmail.com>
1284         A fix for bug #422507
1285         * expression.cs (StringConcat): Add missing type mutator.
1287 2008-09-03  Marek Safar  <marek.safar@gmail.com>
1289         * generic.cs (TypeInferenceContext): Follow equality rule for
1290         constructed type lower bound type inference.
1292 2008-09-02  Miguel de Icaza  <miguel@novell.com>
1294         * getline.cs (CmdRefresh): Apply patch from Douglas S. Blank
1295         <dblank@cs.brynmawr.edu> which updates the cursor position on
1296         refresh.
1297         
1298 2008-09-02  Marek Safar  <marek.safar@gmail.com>
1300         A fix for bug #367145
1301         * driver.cs: Fixed import of extension methods when using -noconfig
1302         option.
1304 2008-09-02  Marek Safar  <marek.safar@gmail.com>
1306         * iterator.cs: Don't emit GetEnumerator method twice but call a generic
1307         version from non-generic implementation instead.
1309 2008-09-01  Marek Safar  <marek.safar@gmail.com>
1311         A fix for bug #418908
1312         * class.cs: Use AddScopeStatement for field initializers.
1314 2008-09-01  Marek Safar  <marek.safar@gmail.com>
1316         A fix for bug #415385
1317         * ecore.cs, convert.cs: Do method group conversion for equal group types.
1319 2008-09-01  Marek Safar  <marek.safar@gmail.com>
1321         A fix for bug #421736
1322         * iterators.cs: Don't crash on unreachable iterators.
1324 2008-09-01  Marek Safar  <marek.safar@gmail.com>
1326         A fix for bug #421628
1327         * parameter.cs, attribute.cs: Clone also parameter attributes.
1329 2008-08-30  Miguel de Icaza  <miguel@novell.com>
1331         * namespace.cs (LookupType): In EvalMode, try to replace
1332         the TypeBuilder from our cache with a Type as Reflection.Emit does
1333         not  like to mix code from older assemblies emitted and new
1334         assemblies emitted. 
1336         This sounds like a serious Mono bug that prevents multiple
1337         assemblies to be generated and consumed at the same time.
1339         * cs-parser.jay (push_current_class): Do not make interactive
1340         classes internal or private, make them public as we currently
1341         generate each new class in a new assembly.   
1343 2008-08-29  Miguel de Icaza  <miguel@novell.com>
1345         * decl.cs, roottypes.cs, class.cs:: Add an infrastructure to
1346         remove types that are entered into the global namespace during
1347         parsing so that we can remove them on failure.
1349         * cs-parser.jay: Parsing: we now keep track of types that are
1350         entered into global variables and queue those in case the parsing
1351         or resolution fail.
1353         This happens in a few situations: during partial-input, we invoke
1354         the parser repeatedly for example with the string "class X", this
1355         would cause X to be registed, and we need to remove this
1356         registration so that another parse attempt later with say "class X {"
1357         would actually work.
1359         Additionally, if there is an error in the resolution phase, for
1360         example: "class X : NonExistant {}" th
1361         
1362         * cs-parser.jay: Be more precise with the errors being raised,
1363         instead of flagging all exceptions during parsing to be attributed
1364         to the parsing process, distinguish those from errors happening in
1365         the actions and hint that using -v would produce the actual
1366         exception. 
1368         * repl.cs: Do not load all compiler references on each reset,
1369         doing the partial reset takes care of this.
1370         
1371 2008-08-28  Miguel de Icaza  <miguel@novell.com>
1373         * repl.cs: Add support for loading all the files from
1374         ~/.config/csharp/*cs as startup scripts and ~/.config/csharp/*.dll
1375         as shell libraries.
1377         Introduce a micro-parser that is able to deambiguate on its input
1378         whether we are dealing with a compilation unit (namespace, class,
1379         interface, struct, delegate) declaration or a statement.   This
1380         allows both declarations and statements to be entered. 
1382         Set history size by default to 300 lines.
1384         Instead of distinguishing based on the parser.InteractiveResult,
1385         have only two cases: statements were parsed, or a compilation unit
1386         was.   Always pull the Using statement additions from the
1387         compilation unit parse.
1388         
1389         * cs-tokenizer.cs: Rename tokens to better describe their intent
1390         (EvalStatementParserCharacter and EvalCompilationUnitParserCharacter).
1391         
1392         * rootcontext.cs: Split EvalMode into EvalMode and StatementMode.
1393         EvalMode is used to trigger the lookup of global variables while
1394         StatementMode is used turn variable declarations into static
1395         fields.
1397         * getline.cs: Allow history size to be set.
1398         
1399 2008-08-29  Marek Safar  <marek.safar@gmail.com>
1401         A fix for bug #360755
1402         * ecore.cs (SimpleName): Exclude indexers from simple name resolve.
1404 2008-08-29  Marek Safar  <marek.safar@gmail.com>
1406         * generic.cs, iterators.cs, codegen.cs: Removed unused variable.
1407         
1408         * typemanager.cs, statement.cs, ecore.cs, enum.cs: Don't reconstruct enum
1409         member name, it is too confusing
1410         
1411         * decl.cs, class.cs: Don't report unused fields with attached attribute.
1412         
1413         * rootcontext.cs: Finally default to warning level 4.
1415 2008-08-28  Marek Safar  <marek.safar@gmail.com>
1417         * class.cs (CheckBase): Ignore overloaded operators.
1419 2008-08-28  Marek Safar  <marek.safar@gmail.com>
1421         A fix for bug #420830
1422         * expression.cs, cs-parser.jay: Put back InvocationOrCast expression.
1424 2008-08-28  Marek Safar  <marek.safar@gmail.com>
1426         A fix for bug #420832
1427         * anonymous.cs, iterators.cs: Also clone hoisted this iterator variable.
1429 2008-08-28  Marek Safar  <marek.safar@gmail.com>
1431         A fix for bug #420386
1432         * nullables.cs: Fixed logic of nullable user comparison operators involving
1433         null values.
1435 2008-08-28  Marek Safar  <marek.safar@gmail.com>
1436         
1437         * attribute (IsClsCompliant): Use FALSE value for pointer types.
1439 2008-08-27  Miguel de Icaza  <miguel@novell.com>
1441         * repl.cs: Add support for aborting the running code with C-c. 
1443 2008-08-27  Raja R Harinath  <harinath@hurrynot.org>
1445         * cs-parser.jay (CS1002): Dump 'yyToken' with Report.ExtraInformation.
1447 2008-08-27  Miguel de Icaza  <miguel@novell.com>
1449         * cs-parser.jay (interactive_statement_list): A new set of rules
1450         for hosting statements that uses the "interactive_" prefix.   
1452         * repl.cs: Add support for parsing `using' as a statement or as a
1453         directive.  Deambiguating before passing this to the parser.
1455         We need to distinguish statement_expressions that occur at the
1456         toplevel vs those that occur embedded into expressions.
1458         * getline.cs: Applied patch from Stuart Carnie <stuart.carnie@gmail.com> 
1459         that fixes the cursor key handling, and a history bug.
1460         
1461 2008-08-26  Miguel de Icaza  <miguel@novell.com>
1463         * Makefile: Drop BOOTSTRAP_COMPILER as that was masking the
1464         limitations in Console, instead the 2.0 bootstrap libraries now
1465         include the Console bits.
1467         Also, remove the use of Nullables from getline.cs
1469         ------------
1470         
1471         Interactive support for the C# compiler.   Use gmcs --shell to
1472         enter a read-eval-print loop shell.
1474         Docs: http://www.mono-project.com/CsharpRepl
1475         
1476         * sources: include repl.cs here and getline.cs for gmcs.exe,
1477         everything else is getline.cs impaired.
1479         * Makefile: when bootstrapping pass a special flag
1480         BOOTSTRAP_COMPILER which we use to prevent failures in compilation
1481         as we use NET_2_0 define to pull 2.0 APIs from System.Console.
1482         This distinguishes those two cases.
1484         * repl.cs: Support for a read-eval-print loop.   Will be soon
1485         refactored into eval support and then REPL on top of it.
1487         * ecore.cs: If a simplename lookup fails, before erroring out,
1488         if we are in EvalMode to resolve the name to a declaration in the
1489         Eval-land.    
1491         This means that variable declarations that happened in previous
1492         classes (as repl puts every statement in a separate class) are
1493         made visible in this way.
1495         * cs-parser.jay: UnexpectedEOF, a new flag that is set if we
1496         triggered an error due to the end of file being reached.   This is
1497         used to do multi-line input, and notify the caller that the user
1498         needs to provide more text before a successful parse.
1500         Add new grammar rules after the INTERACTIVE_PARSER token is seen
1501         to drive the evaluation with a custom wrapper. 
1503         * driver.cs: Add support for --shell, and refactor some code to be
1504         reused from repl.cs
1505         
1506         * namespace.cs: Add support for serializing the contents of the
1507         namespaces and reloading them.  
1509         * getline.cs: A managed implementation of ReadLine under
1510         X11/Apache2 license terms.  Easy to embed in other applications as
1511         well.
1513         * namespace.cs: Add some functions to save and restore the
1514         namespace state.
1516         * rootcontext.cs: New public field.
1518         * cs-tokenizer.cs: Add support for one of the possible characters
1519         we introduce into the token stream.  
1521         This patch does not affect the regular tokenization process, the
1522         only performance hit would happen if there is an invalid character
1523         on the input string.
1525         * support.cs: Move isatty helper routine here.
1527         * codegen.cs: Small cleanup, and add a mechanism to initialize the
1528         code generator for in-memory assemblies.
1530 2008-08-26  Marek Safar  <marek.safar@gmail.com>
1532         * generic.cs, ecore.cs, delegate.cs, cs-parser.jay, expression.cs: A type
1533         parameter cannot be always used as a type.
1535 2008-08-21  Marek Safar  <marek.safar@gmail.com>
1537         * convert.cs, expression.cs: Use single ExplicitReferenceConversion routine.
1539 2008-08-21  Marek Safar  <marek.safar@gmail.com>
1541         * convert.cs: Implement explicit array to IList<T> conversion.
1543 2008-08-20  Marek Safar  <marek.safar@gmail.com>
1545         A fix for bug #362740
1546         * cs-tokenizer.cs: Handle UTF-16 surrogates.
1548 2008-08-20  Marek Safar  <marek.safar@gmail.com>
1549         
1550         * generic.cs, support.cs, typemanager.cs, lambda.cs, parameter.cs,
1551         pending.cs, ecore.cs, linq.cs, class.cs, decl.cs, delegate.cs,
1552         flowanalysis.cs, iterators.cs, cs-parser.jay, convert.cs, anonymous.cs,
1553         expression.cs, attribute.cs, statement.cs, doc.cs: Refactored parameters
1554         handling to use just one type of infrastructure and deal with generics
1555         more effectivelly.
1557 2008-07-23  Martin Baulig  <martin@ximian.com>
1559         *** Merged this from trunk revision 108527 ***
1561         * statement.cs
1562         (ExplicitBlock.EmitSymbolInfo): Moved to `ToplevelBlock'.
1563         (ToplevelBlock.EmitSymbolInfo): Tell the symbol writer about the
1564         scope variable.
1566 2008-08-15  Marek Safar  <marek.safar@gmail.com>
1567         
1568         * ecore.cs, linq.cs, const.cs, expression.cs, statement.cs: More robust
1569         error checks.
1571 2008-08-15  Marek Safar  <marek.safar@gmail.com>
1572         
1573         * delegate.cs: Fixed compiler crash when creating delegate using partial
1574         method.
1575         
1576         * typemanager.cs: MulticastDelegate is not a delegate.
1578 2008-08-14  Marek Safar  <marek.safar@gmail.com>
1579         
1580         * expression.cs, ecore.cs, anonymous.cs, class.cs: Fixed missing error
1581         checks.
1583 2008-08-14  Raja R Harinath  <harinath@hurrynot.org>
1585         * cs-parser.jay (type): Allow 'var' in mcs too.
1586         (local_variable_type): Likewise.
1588 2008-08-14  Marek Safar  <marek.safar@gmail.com>
1589         
1590         * driver.cs: Removed broken -noconfig variants.
1592 2008-08-14  Marek Safar  <marek.safar@gmail.com>
1593         
1594         A fix for bug #417078
1595         * expression.cs: Emit correctly left side pointer operators.
1597 2008-08-13  Marek Safar  <marek.safar@gmail.com>
1599         * generic.cs, lambda.cs: Inflate method generic arguments only.
1601 2008-08-12  Marek Safar  <marek.safar@gmail.com>
1603         * class.cs: Fixed struct layout check regression.
1605 2008-08-12  Marek Safar  <marek.safar@gmail.com>
1607         * cs-parser.jay, enum.cs: Simplified enum parsing.
1608         
1609         * decl.cs: Check all type parameters conflicts.
1610         
1611         * expression.cs, statement.cs, attribute.cs: More expression checks.
1613 2008-08-11  Marek Safar  <marek.safar@gmail.com>
1615         * generic.cs: Add type inference types restriction.
1616         
1617         * parameter.cs, class.cs, delegate.cs, iterators.cs, cs-parser.jay,
1618         anonymous.cs, expression.cs: Allocate less accessor parameters.
1620 2008-08-08  Marek Safar  <marek.safar@gmail.com>
1622         * typemanager.cs, ecore.cs: Ambiguous operators can come from different
1623         classes.
1625 2008-08-08  Marek Safar  <marek.safar@gmail.com>
1627         * convert.cs, delegate.cs: Fixed delegate compatibility conversion. 
1629 2008-08-07  Marek Safar  <marek.safar@gmail.com>
1631         * class.cs, decl.cs, iterator.cs, ecore.cs: Refactor base type resolving.
1632         Also fixes #362146 and #381592.
1634 2008-08-07  Marek Safar  <marek.safar@gmail.com>
1636         * ecore.cs: Reduced constant cannot be used as an attribute value.
1637         
1638         * cs-parser.jay: Base expression has to be a type.
1639         
1640         * expression.cs (Conditional): Uses ReducedExpression.
1642 2008-08-06  Marek Safar  <marek.safar@gmail.com>
1644         A fix for bug #376826
1645         * parameter.cs, ecore.cs, anonymous.cs, expression.cs, statement.cs: An
1646         address of hoisted local variable or parameter cannot be taken.
1648 2008-08-05  Marek Safar  <marek.safar@gmail.com>
1650         * ecore.cs, constant.cs, expression.cs, statement.cs: Resolve correctly 
1651         anonymous method inside checked/unchecked expression.
1653 2008-08-05  Marek Safar  <marek.safar@gmail.com>
1655         * typemanager.cs (IsEqual): Guard against null.
1656         
1657         * ecore.cs, class.cs, convert.cs, const.cs, constant.cs, expression.cs,
1658         attribute.cs, enum.cs, statement.cs: Pass EmitContext to constant conversion
1659         routine. Fixed few misleading conversion errors.
1661 2008-08-04  Marek Safar  <marek.safar@gmail.com>
1663         * class.cs: Consider generics when checking cycles in struct layout.
1665 2008-08-04  Raja R Harinath  <harinath@hurrynot.org>
1667         * cs-tokenizer.cs (get_cmd_arg): Simplify.  Don't be too pedantic.
1669 2008-08-04  Marek Safar  <marek.safar@gmail.com>
1671         A fix for bug #414165
1672         * anonymous.cs: Use same anonymous implementation method for all anonymous
1673         method emits.
1675 2008-08-04  Marek Safar  <marek.safar@gmail.com>
1677         * generic.cs, anonymous.cs, statement.cs: Emit inherited anonymous method
1678         constraints.
1680 2008-08-04  Marek Safar  <marek.safar@gmail.com>
1682         * cs-parser.jay: Typeof argument has to be a type expression.
1683         
1684         * namespace.cs: Check alias and namespace definitions collisions.
1685         
1686         * class.cs, pending.cs: Moved explicit interface accessor implementation
1687         check.
1688         
1689         * delegate.cs, expression.cs: Verify special name invocations.
1690         
1691 2008-08-01  Marek Safar  <marek.safar@gmail.com>
1693         * cs-parser.jay: Don't choke on empty generic type arguments.
1694         
1695         * cs-tokenizer.cs: Handle escaped preprocessor directives.
1696         
1697         * expression.cs, ecore.cs: Minor expressions bugs.
1699 2008-08-01  Marek Safar  <marek.safar@gmail.com>
1701         * cs-parser.jay: Removed duplicate interface declaration (fixes 2 conflicts)
1702         and added more error handling.
1703         
1704         * class.cs, iterators.cs, anonymous.cs: Removed useless interface parameter.
1705         
1706         *  modifiers.cs, enum.cs: Fixed.
1708 2008-07-31  Jb Evain  <jbevain@novell.com>
1710         * driver.cs: remove -pkg ability of smcs.
1712 2008-07-30  Marek Safar  <marek.safar@gmail.com>
1714         * statement.cs (Switch): Correctly set empty default target for single
1715         blocks.
1717 2008-07-30  Marek Safar  <marek.safar@gmail.com>
1719         * typemanager.cs, assign.cs, driver.cs, expression.cs, statement.cs: Rewrote
1720         string switch statement implementation to use string dictionary which
1721         significantly (2-8x) improves performance of generated code.
1723 2008-07-29  Marek Safar  <marek.safar@gmail.com>
1725         A fix for bug #412880 by Atsushi Enomoto <atsushi@ximian.com>
1726         * modifiers.cs (GetDescription): Fixed FamANDAssem case.
1727         
1728 2008-07-29  Marek Safar  <marek.safar@gmail.com>
1730         A fix for bug #412595
1731         * typemanager.cs, convert.cs, expression.cs: Some types are never
1732         convertible to each other.
1734 2008-07-29  Marek Safar  <marek.safar@gmail.com>
1736         * nullable.cs (CreateNullConstant): An error messages update.
1738 2008-07-29  Marek Safar  <marek.safar@gmail.com>
1740         A fix for bug #412595
1741         * cfold.cs: Don't cast undefined bool constant.
1743 2008-07-29  Martin Baulig  <martin@ximian.com>
1745         * symbolwriter.cs
1746         (SymbolWriter.Reset): New public static method.
1748         * driver.cs
1749         (CompilerCallableEntryPoint.Reset): Call SymbolWriter.Reset().
1751 2008-07-28  Marek Safar  <marek.safar@gmail.com>
1753         * cs-tokenizer.cs (IsLambdaOpenParens): Optimized using more stop tokens.
1754         
1755         * expression.cs (ElementAccess): Exact size allocation.
1757 2008-07-26  Marek Safar  <marek.safar@gmail.com>
1759         * driver.cs: Replaced outdated UnixParseOption with CSCParseOption.
1761 2008-07-25  Marek Safar  <marek.safar@gmail.com>
1763         * flowanalysis.cs (StructInfo): Fixed detection of dynamic types.
1764         
1765         * class.cs: Removed $PRIVATE$ field hack which caused problems during
1766         flow analysis.
1768 2008-07-25  Marek Safar  <marek.safar@gmail.com>
1770         A fix for bug #412217
1771         * assign.cs: Mutate also assignment type.
1773 2008-07-25  Marek Safar  <marek.safar@gmail.com>
1775         A fix for bug #323644
1776         * typemanager.cs (IsValidProperty): Verify DefaultMemberName when checking
1777         indexers.
1779 2008-07-25  Marek Safar  <marek.safar@gmail.com>
1781         A fix for bug #412134
1782         * expression.cs (ResolveOperatorEnum): Do implicit conversion of
1783         non-enumerable operands when overloading equality or bitwise operators.
1785 2008-07-25  Marek Safar  <marek.safar@gmail.com>
1787         * anonymous.cs: Cache closed generic anonymous method delegates.
1789 2008-07-24  Marek Safar  <marek.safar@gmail.com>
1791         * lambda.cs, linq.cs, class.cs, iterators.cs, cs-parser.jay, assign.cs, 
1792         anonymous.cs, statement.cs: Always emit anonymous method as static method
1793         when is instance free. Use nesting for nested anynomous methods blocks.
1794         
1795 2008-07-23  Marek Safar  <marek.safar@gmail.com>
1797         * anonymous.cs (MutateGenericMethod): Added extra code path for imported
1798         types.
1800 2008-07-23  Marek Safar  <marek.safar@gmail.com>
1802         * expression.cs: Removed MakeSimpleCall.
1804 2008-07-23  Marek Safar  <marek.safar@gmail.com>
1806         A fix for bug #323012
1807         * class.cs, pending.cs: Emit proxy for indexers when they differ in name.
1808         Base method implementing interface has to be public.
1810 2008-07-23  Marek Safar  <marek.safar@gmail.com>
1812         * cs-parser.jay: Don't break on missing argument.
1814 2008-07-22  Marek Safar  <marek.safar@gmail.com>
1816         A fix for bug #320993
1817         * report.cs, parameter.cs, class.cs, decl.cs, delegate.cs, attribute.cs,
1818           enum.cs, codegen.cs: Report CLS compliance errors as warnings.
1820 2008-07-22  Marek Safar  <marek.safar@gmail.com>
1822         A fix for bug #320748
1823         * convert.cs: Implicit user operators cannot convert to interfaces
1825 2008-07-22  Marek Safar  <marek.safar@gmail.com>
1827         A fix for bug #312686
1828         * driver.cs: Ignore empty assembly references.
1830 2008-07-22  Marek Safar  <marek.safar@gmail.com>
1832         A fix for bug #387040
1833         * ecore.cs: Skip constrains check for an explicit implementation.
1835 2008-07-21  Marek Safar  <marek.safar@gmail.com>
1837         A fix for bug #409045
1838         * cs-tokenizer.cs, rootcontext.cs, class.cs, location.cs, delegate.cs,
1839           cs-parser.jay, driver.cs, expression.cs, attribute.cs: Conditional
1840           identifiers are file specific unless passed as input arguments.
1842 2008-07-21  Marek Safar  <marek.safar@gmail.com>
1844          * typemanager.cs, parameter.cs, class.cs, attribute.cs: Use an attribute
1845          to emit UnmanagedMarshal data under 2.0 profile.
1847 2008-07-21  Marek Safar  <marek.safar@gmail.com>
1849         A fix for bug #410369
1850         * parameter.cs: Clone correctly ParamsParameter.
1852 2008-07-21  Marek Safar  <marek.safar@gmail.com>
1854         * expression.cs (Argument): Always report type for type based expressions
1855         errors.
1857 2008-07-18  Marek Safar  <marek.safar@gmail.com>
1859         A fix for bug #410666
1860         * anonymous.cs: Correctly initialize generic storey reference.
1862 2008-07-18  Marek Safar  <marek.safar@gmail.com>
1864         * convert.cs: Don't box same type arguments.
1866 2008-07-18  Marek Safar  <marek.safar@gmail.com>
1868         * ecore.cs, linq.cs, delegate.cs, constant.cs, nullable.cs, expression.cs:
1869         Finished missing generic type mutators.
1871 2008-07-18  Marek Safar  <marek.safar@gmail.com>
1873         * iterators.cs, statement.cs: Finished statements CloneTo.
1875 2008-07-18  Marek Safar  <marek.safar@gmail.com>
1877         * anonymous.cs: ExpressionTreeProxy is of Value type expression.
1878         
1879         * expression.cs: Emit optimized default value expressions in expression tree
1880         array initializer.
1882 2008-07-18  Marek Safar  <marek.safar@gmail.com>
1884         * ecore.cs, cs-parser.jay, statement.cs: Error reporting fixes.
1886 2008-07-17  Marek Safar  <marek.safar@gmail.com>
1888         A fix for bug #367536
1889         * cs-parser.jay: Check static constructor of generic types for an access
1890         modifier.
1892 2008-07-17  Marek Safar  <marek.safar@gmail.com>
1894         A fix for bug #353800
1895         * lambda.cs: Emit ret for contextual statements.
1896         
1897         * codegen.cs: Keep both resolved and unreachable flags, otherwise we end
1898         up emitting redundant ret for all anonymous methods with return.
1900 2008-07-17  Marek Safar  <marek.safar@gmail.com>
1902         A fix for bug #365188
1903         * ecore.cs, anonymous.cs, expression.cs, codegen.cs, statement.cs: Don't
1904         create anonymous method storey in unreachable block.
1906 2008-07-17  Marek Safar  <marek.safar@gmail.com>
1908         * generic.cs, typemanager.cs, cs-tokenizer.cs, parameter.cs, namespace.cs,
1909         class.cs, delegate.cs, flowanalysis.cs, iterators.cs, anonymous.cs,
1910         driver.cs, nullable.cs, expression.cs, attribute.cs, codegen.cs,
1911         statement.cs: Fixed relevant defects found by Gendarme.
1913 2008-07-17  Marek Safar  <marek.safar@gmail.com>
1915         A fix for bug #325291
1916         * modifiers.cs, class.cs, cs-parser.jay, anonymous.cs, codegen.cs, 
1917         statement.cs: Replaced IAnonymousHost with top level block flag.
1919 2008-07-17  Marek Safar  <marek.safar@gmail.com>
1921         * cs-parser.jay: Clean up unused open_parens.
1923 2008-07-17  Marek Safar  <marek.safar@gmail.com>
1925         * ecore.cs: Custom error message for a range variable assignment.
1927 2008-07-16  Marek Safar  <marek.safar@gmail.com>
1929         * constant.cs, typemanager.cs: Emit empty string ("") as string.Empty field
1930         load.
1932 2008-07-16  Marek Safar  <marek.safar@gmail.com>
1934         * literal.cs: Null literal is of object type.
1936 2008-07-16  Marek Safar  <marek.safar@gmail.com>
1938         * nullable.cs (LiftedBinaryOperator): Always lift unwrapped nullable
1939         expression of nullable equality comparison.
1941 2008-07-15  Marek Safar  <marek.safar@gmail.com>
1943         * expression.cs(PointerArithmetic): Removed redundant assignment.
1945 2008-07-15  Marek Safar  <marek.safar@gmail.com>
1947         * decl.cs (GetSignatureForError): Report full namespace name for containers.
1949 2008-07-14  Marek Safar  <marek.safar@gmail.com>
1951         A fix for bug #408361
1952         * anonymous.cs (MutateGenericMethod): Store generic type arguments before
1953         they are replaced by GetMethod.
1955 2008-07-14  Marek Safar  <marek.safar@gmail.com>
1957         A fix for bug #408721 by jeremie.laval@gmail.com
1958         * expression.cs (Indirection): Implemented CloneTo.
1960 2008-07-14  Marek Safar  <marek.safar@gmail.com>
1962         * statement.cs (AssignableSlots): Temporary disabled variable initialization
1963         assert check.
1965 2008-07-14  Marek Safar  <marek.safar@gmail.com>
1967         * report.cs (EnableReporting): Don't reinitialize 0-based values.
1969 2008-07-11  Marek Safar  <marek.safar@gmail.com>
1971         * linq.cs: Reset tranparent parameter counter in probing mode.
1973 2008-07-11  Marek Safar  <marek.safar@gmail.com>
1975         * anonymous.cs: Mutate anonymous method type.
1977 2008-07-11  Marek Safar  <marek.safar@gmail.com>
1979         * ecore.cs, anonymous.cs: Mutate field expressions.
1981 2008-07-10  Marek Safar  <marek.safar@gmail.com>
1983         A fix for bug #369670
1984         * linq.cs, statement.cs: Use explicit block for query expressions variables.
1986 2008-07-10  Marek Safar  <marek.safar@gmail.com>
1988         * report.cs, ecore.cs: Flush recorder only when silent mode is off.
1990 2008-07-10  Raja R Harinath  <harinath@hurrynot.org>
1992         Fix bug #314902
1993         * cs-tokenizer.cs (is_punct): If a generic lookahead is looking
1994         only one '>', and finds a '>>', abort the generic lookahead.
1996 2008-07-10  Marek Safar  <marek.safar@gmail.com>
1998         A fix for bug #319902
1999         * cs-tokenizer.cs: Always look-ahed for `>='  when tokenizing `>'.
2001 2008-07-10  Marek Safar  <marek.safar@gmail.com>
2003         A fix for bug #406371
2004         * statement.cs: Moved EmitSymbolInfo to Block.
2006 2008-07-09  Marek Safar  <marek.safar@gmail.com>
2008         * ecore.cs: Report better error for extension method overload failures.
2010 2008-07-09  Marek Safar  <marek.safar@gmail.com>
2012         * expression.cs (Is): No need to box reference values.
2014 2008-07-09  Marek Safar  <marek.safar@gmail.com>
2016         * class.cs: Use event resolve context when initializing CreateEmitContext.
2018 2008-07-09  Marek Safar  <marek.safar@gmail.com>
2020         A fix for bug #394436
2021         * anonymous.cs, class.cs, expression.cs, lambda.cs: Emit correctly extension
2022         method used inside expression trees. Added more LINQ to expression tree
2023         conversions.
2025 2008-07-08  Marek Safar  <marek.safar@gmail.com>
2027         A fix for bug #378189, #370577
2028         * lambda.cs, ecore.cs: Implemented 3.0 enhancement to better conversion
2029         from expression.
2031 2008-07-08  Marek Safar  <marek.safar@gmail.com>
2033         * anonymous.cs, class.cs, decl.cs: Emit CompilerGenerated attribute
2034         hierarchically.
2036 2008-07-08  Marek Safar  <marek.safar@gmail.com>
2038         A fix for bug #406702
2039         * anonymous.cs: Always park anonymous method in the nearest parent storey.
2041 2008-07-07  Marek Safar  <marek.safar@gmail.com>
2043         A fix for bug #406648
2044         * cs-parser.jay: Report nullable use in mcs for some cases.
2046 2008-07-07  Marek Safar  <marek.safar@gmail.com>
2048         * ecore.cs: Improved argument mismatch error messages.
2050 2008-07-07  Marek Safar  <marek.safar@gmail.com>
2052         * anonymous.cs: Don't cache generic delegates when reference MVAR argument.
2054 2008-07-07  Marek Safar  <marek.safar@gmail.com>
2056         * expression.cs (TypeOf): Mutate type argument.
2058 2008-07-04  Marek Safar  <marek.safar@gmail.com>
2060         * class.cs: Report missing partial modifier for correct type.
2062 2008-07-04  Marek Safar  <marek.safar@gmail.com>
2064         * ecore.cs, expression.cs (VariableReference): Variable property is 
2065         protected.
2067 2008-07-04  Marek Safar  <marek.safar@gmail.com>
2069         * ecore.cs, convert.cs: Made OpcodeCast more memory efficient.
2070         
2071 2008-07-04  Marek Safar  <marek.safar@gmail.com>
2073         * anonymous.cs, class.cs, lambda.cs, iterator.cs: Cache static anonymous
2074         method delegates.
2076 2008-07-04  Marek Safar  <marek.safar@gmail.com>
2078         * anonymous.cs, class.cs, expression.cs, iterator.cs, statement.cs: Reduce
2079         anonymous method storey to an instance method when only "this" is hoisted.
2081 2008-07-03  Marek Safar  <marek.safar@gmail.com>
2083         A fix for bug #321615
2084         * expression.cs: Pointer comparisons use unsigned operator.
2086 2008-07-03  Marek Safar  <marek.safar@gmail.com>
2088         * expression.cs: Fixed native pointer conversions. Also fixes #321615.
2090 2008-07-02  Marek Safar  <marek.safar@gmail.com>
2092         A fix for bug #404905
2093         * class.cs: Always initialize local unsafe variables.
2095 2008-06-30  Marek Safar  <marek.safar@gmail.com>
2097         A fix for bug #396987
2098         * expression.cs (NewInitialize): Clear local temporary variable for next run
2100 2008-06-27  Marek Safar  <marek.safar@gmail.com>
2102         A fix for bug #401020
2103         * ecore.cs: Both types and modifiers have to match for ref and out arguments
2105 2008-06-27  Marek Safar  <marek.safar@gmail.com>
2107         A fix for bug #398319
2108         * cs-parser.jay: Implemented undocumented base access expression inside
2109         anonymous types.
2111 2008-06-26  Marek Safar  <marek.safar@gmail.com>
2113         A fix for bug #404227
2114         * cs-parser.jay: Parse namespace declaration using qualified identifier.
2116 2008-06-26  Marek Safar  <marek.safar@gmail.com>
2118         A fix for bug #404227
2119         * convert.cs: Fixed explicit array to interface cast.
2121 2008-06-26  Marek Safar  <marek.safar@gmail.com>
2123         A fix for bug #403894
2124         * delegate.cs: Mutate DelegateInvocation type.
2126 2008-06-26  Marek Safar  <marek.safar@gmail.com>
2128         A fix for bug #379348
2129         * delegate.cs: Box a load of generic parameters.
2131 2008-06-26  Marek Safar  <marek.safar@gmail.com>
2133         * expression.cs: Add an array creation arguments mutate.
2135 2008-06-26  Marek Safar  <marek.safar@gmail.com>
2137         A fix for bug #386068
2138         * anonymous.cs, expression.cs: Emit correctly hoisted expression tree
2139         parameter.
2141 2008-06-25  Marek Safar  <marek.safar@gmail.com>
2143         * ecore.cs, expression.cs: Fixed broken TypeCast clone, implemented few more
2144         CloneTo.
2146 2008-06-25  Marek Safar  <marek.safar@gmail.com>
2148         A fix for bug #403518
2149         * delegate.cs: Type correctly anonymous method new invocation.
2151 2008-06-24  Marek Safar  <marek.safar@gmail.com>
2153         A fix for bug #394826
2154         * anonymous.cs: Fully qualify members when resolving anonymous type internal
2155         calls.
2157 2008-06-24  Marek Safar  <marek.safar@gmail.com>
2159         A fix for bug #394826
2160         * anonymous.cs, iterators.cs: Construct generic storey only when is really
2161         needed.
2163 2008-06-24  Marek Safar  <marek.safar@gmail.com>
2165         * class.cs: Clone indexer parameters for localized capturing.
2167 2008-06-24  Marek Safar  <marek.safar@gmail.com>
2169         A fix for bug #402379
2170         * expression.cs: Don't crash when an object initializer resolve fails.
2172 2008-06-24  Marek Safar  <marek.safar@gmail.com>
2174         A fix for bug #402888
2175         * expression.cs: Mutate conditional expression.
2177 2008-06-24  Marek Safar  <marek.safar@gmail.com>
2179         A fix for bug #401012
2180         * class.cs: Keep StructLayout in shared container.
2182 2008-06-24  Marek Safar  <marek.safar@gmail.com>
2184         A fix for bug #400438
2185         * decl.cs, class.cs: Only properties can be automatically implemented.
2187 2008-06-24  Marek Safar  <marek.safar@gmail.com>
2189         * statement.cs (ChangeToIterator): Copy also labels.
2191 2008-06-23  Marek Safar  <marek.safar@gmail.com>
2193         * ecore.cs: Pass type argument details to parent extension method.
2195 2008-06-23  Marek Safar  <marek.safar@gmail.com>
2197         A fix for bug #375966
2198         * delegate.cs: Fixed IsTypeCovariant generic type conversions.
2200 2008-06-23  Raja R Harinath  <harinath@hurrynot.org>
2202         * Makefile (bootstrap-libs): Pass NO_DIR_CHECK to sub-make.
2204 2008-06-22  Marek Safar  <marek.safar@gmail.com>
2206         A fix for bug #394347
2207         * anonymous.cs: Cache compatible delegates as compatibility check produces
2208         a new method every time.
2210 2008-06-20  Marek Safar  <marek.safar@gmail.com>
2212         * anonymous.cs: Propagate storey reference for single references.
2214 2008-06-20  Marek Safar  <marek.safar@gmail.com>
2216         A fix for bug #387615
2217         * assign.cs, expression.cs: Correctly clone compound assignment.
2219 2008-06-19  Marek Safar  <marek.safar@gmail.com>
2221         A fix for bug #359611, #359604
2222         * anonymous.cs: Mutate all types of hoisted parameters.
2224 2008-06-19  Marek Safar  <marek.safar@gmail.com>
2226         * typemanager.cs, lambda.cs, parameter.cs, ecore.cs, linq.cs, class.cs
2227         delegate.cs, iterators.cs, cs-parser.jay, assign.cs, anonymous.cs, driver.cs
2228         expression.cs, codegen.cs, statement.cs
2229         
2230         Fixes bugs: #318652, #323223, #234779, #325069, #325476, #332532, #334465,
2231         #345907, #349190, #353276, #355256, #359617, #378542, #384584, #396530
2232         
2233         ** Anonymous methods, lambda expressions rewrite **
2234         
2235         Anonymous expressions are now resolved when an explicit block is resolved 
2236         and they don't require any registration procedure anymore. Further,
2237         anonymous methods are defined when explicit block is emitted which allows
2238         better control of whole process and opens possibilities for more
2239         optimizations as well as alternative to reverse whole process.
2240         
2241         A concept of `MutateHoistedGenericType' was introduced to keep the resolve
2242         process consistent and to correctly emit hoisted generic methods when they
2243         have at least 1 hoisted variable.
2244         
2245 2008-06-17  Martin Baulig  <martin@ximian.com>
2247         * class.cs: Also emit the `[DebuggerHidden]' attribute on the main
2248         iterator method.
2249         (AbstractPropertyEventMethod.IsDebuggerHidden): New protected
2250         virtual property; check it in Emit().
2251         (PropertyMethod.IsDebuggerHidden): Override, check whether we're
2252         an iterator.
2253         (MethodOrOperator.ResolveMethods): Set `DEBUGGER_HIDDEN' if we're
2254         an iterator.
2255         (Indexer.Define): Likewise.
2257 2008-06-17  Marek Safar  <marek.safar@gmail.com>
2259         * convert.cs: Don't use IsInterface on type arguments.
2260         
2261         * delegate.cs: DelegateInvocation uses MethodInfo.
2262         
2263         * parameter.cs: Removed IsTypeParameter.
2264         
2265         * generic-mcs.cs: More missing stuff.
2267 2008-06-16  Martin Baulig  <martin@ximian.com>
2269         * modifiers.cs
2270         (Modifiers.DEBUGGER_HIDDEN): New public const.
2272         * typemanager.cs
2273         (TypeManager.GetDebuggerHiddenAttribute): New public static method.
2275         * class.cs
2276         (MethodOrOperator.Emit): Check `Modifiers.DEBUGGER_HIDDEN'.
2277         (AbstractPropertyEventMethod): Likewise.
2278         (Constructor.Emit): Likewise.
2279         (SourceMethod.SetCompilerGenerated): Removed.
2281         * iterator.cs: Set `Modifiers.DEBUGGER_HIDDEN' everywhere except
2282         on MoveNext().
2284         * anonymous.cs
2285         (RootScopeInfo.DoDefineMembers): Set `Modifiers.DEBUGGER_HIDDEN'
2286         if we're an `IteratorHost'.
2287         (AnonymousMethodMethod..ctor): Don't set
2288         `Modifiers.COMPILER_GENERATED'; csc only sets this on the class,
2289         not on the method.
2291 2008-06-16  Marek Safar  <marek.safar@gmail.com>
2293         * statement.cs: Clean-up foreach statements.
2295 2008-06-12  Marek Safar  <marek.safar@gmail.com>
2297         * class.cs: Stop using public method which should not exist
2298         (MethodBuilder.SetGenericMethodSignature).
2300 2008-06-11  Martin Baulig  <martin@ximian.com>
2302         * location.cs
2303         (Location.LookupFile): Add `CompilationUnit' argument; when given
2304         a relative file name, make it relative to the directory the .cs
2305         file is located in instead of using the current directory.
2307 2008-06-11  Martin Baulig  <martin@ximian.com>
2309         * class.cs
2310         (IMethodData.EmitExtraSymbolInfo): Added `SourceMethod' argument.
2311         (MethodOrOperator.EmitExtraSymbolInfo): Likewise.
2312         (SourceMethod.SetRealMethodName): Moved here from the symbol writer.
2313         (SourceMethod.SetCompilerGenerated): Likewise.
2315 2008-06-11  Marek Safar  <marek.safar@gmail.com>
2317         * codegen.cs, driver: Only write symbol file when it's asked for.
2319 2008-06-11  Marek Safar  <marek.safar@gmail.com>
2321         * codegen.cs: Don't use assembly writer error handling for symbol writer.
2323 2008-06-10  Martin Baulig  <martin@ximian.com>
2325         * symbolwriter.cs: Reflect latest MarkSequencePoint() API changes.
2327 2008-06-09  Marek Safar  <marek.safar@gmail.com>
2329         A fix for bug #316290
2330         * expression.cs: Include decimal operators in predefined table.
2331         
2332         * parameters.cs: More readonlyness.
2334 2008-06-09  Marek Safar  <marek.safar@gmail.com>
2336         A fix for bug #397213
2337         * cs-parser.jay: One more missing current_local_parameters reset.
2339 2008-06-09  Marek Safar  <marek.safar@gmail.com>
2341         A fix for bug #396633
2342         * class.cs: Host backing field in partial container.
2344 2008-06-09  Marek Safar  <marek.safar@gmail.com>
2346         A fix for bug #397068
2347         * expression.cs: Check both operand types when predefined operator is used.
2349 2008-06-05  Martin Baulig  <martin@ximian.com>
2351         Merged the `debugger-kahalo' branch.
2353         * class.cs
2354         (MethodData.Emit): Call SymbolWriter.SetCompilerGenerated() if
2355         we're an iterator method.
2356         (SourceMethod): Reflect latest symbol writer changes;
2357         SymbolWriter.OpenMethod() now takes a `ICompileUnit' argument and
2358         now `start_row' and `end_row'.
2359         (Constructor.Emit): Fix the logic whether to emit symbol information.
2361         * iterator.cs: Call SymbolWriter.SetCompilerGenerated() on all the
2362         generated methods.
2364         * location.cs
2365         (CompilationUnit): New public class; derives from `SourceFile'.
2366         (SourceFileEntry.DefineSymbolInfo): New public method.
2367         (SourceFileEntry.SetChecksum): New public method.
2368         (Location): Encode hidden line numbers by using `column == 255';
2369         the .ctor now accepts `column == -1' to mark a hidden line number.
2370         (Location.Hidden): New public property.
2371         (Location.CheckPoint): Add `CompilationUnit'.
2372         (Location.SourceFiles): Change return type to `CompilationUnit[]'.
2373         (Location.Push): Add `CompilationUnit compile_unit' argument.
2374         (Location.CompilationUnit): New public property.
2376         * statement.cs
2377         (ToplevelBlock.Emit): Add `ec.Mark (EndLocation)'.
2379         * cs-parser.jay: `SourceFile' -> `CompilationUnit'.
2381         * driver.cs: `SourceFile' -> `CompilationUnit'.
2383         * cs-tokenizer.cs: `SourceFile' -> `CompilationUnit'.
2385         * namespace.cs: `SourceFile' -> `CompilationUnit'.
2387         * cs-tokenizer.cs: Add support for `#pragma checksum' and
2388         `#line hidden'.
2390         * symbolwriter.cs
2391         (SymbolWriter.MarkSequencePoint): Take a `Location' and use the
2392         new symbol writer API to also pass the file.
2394 2008-06-05  Marek Safar  <marek.safar@gmail.com>
2396         * statement.cs: Emit catch variable assignment using variable expression.
2397         
2398 2008-06-05  Marek Safar  <marek.safar@gmail.com>
2400         * ecore.cs, expression.cs, statement.cs: Make TemporaryVariable compatible
2401         with other variable types.
2403 2008-06-04  Marek Safar  <marek.safar@gmail.com>
2405         * ecore.cs, expression.cs, statement.cs, typemanager.cs: Removed custom
2406         GetLength method emit, it breaks resolve rules.
2407         
2408 2008-06-02  Atsushi Enomoto  <atsushi@ximian.com>
2409             Marek Safar  <marek.safar@gmail.com>
2410                         
2411         A fix for bug #395542
2412         * cs-parser.jay: The trailing comma is allowed in anonymous type member
2413         declaration.
2414         
2415 2008-06-02  Marek Safar  <marek.safar@gmail.com>
2417         A fix for bug #395287
2418         * class.cs, modifiers.cs: Automatic properties method base modifiers checks.
2420 2008-05-31  Marek Safar  <marek.safar@gmail.com>
2422         A fix for bug #395845
2423         * class.cs, nullable.cs: User unary operator is allowed to have nullable and
2424         non-nullable parameter type.
2425         
2426 2008-05-31  Marek Safar  <marek.safar@gmail.com>
2428         * class.cs: Handle contructor initializer as a statement in top-level block.
2430 2008-05-30  Marek Safar  <marek.safar@gmail.com>
2432         * attribute.cs: Don't mix old and new corlib types when emitting corlib
2433         security attributes.
2435 2008-05-24  Marek Safar  <marek.safar@gmail.com>
2437         * ecore.cs, expression.cs: Small IVariable refactoring.
2439 2008-05-22  Marek Safar  <marek.safar@gmail.com>
2441         * assign.cs (LocalTemporary): Implemented CreateExpressionTree.
2443 2008-05-21  Marek Safar  <marek.safar@gmail.com>
2445         * cs-parser.jay: Removed redundant catch type check.
2447 2008-05-21  Marek Safar  <marek.safar@gmail.com>
2449         A fix for bug #390372
2450         * nullable.cs: Set correct return type.
2452 2008-05-21  Marek Safar  <marek.safar@gmail.com>
2454         A fix for bug #391062
2455         * typemanager.cs: Fixed crash when comparing null types.
2457 2008-05-21  Marek Safar  <marek.safar@gmail.com>
2459         A fix for bug #391871
2460         * cs-parser.jay: Better error handling for invalid catch type.
2462 2008-05-20  Marek Safar  <marek.safar@gmail.com>
2464         A fix for bug #392155
2465         * cs-tokenizer.cs: Fixed casting of byte and decimal expression.
2467 2008-05-15  Marek Safar  <marek.safar@gmail.com>
2469         A fix for bug #390666
2470         * ecore.cs (BetterExpressionConversion): Unwrap each Expression<T>
2471         expressions.
2473 2008-05-15  Marek Safar  <marek.safar@gmail.com>
2475         * class.cs, expression.cs, statement.cs: Removed a hack, setting block flag
2476         in getter.
2478 2008-05-13  Marek Safar  <marek.safar@gmail.com>
2480         A fix for bug #389625
2481         * delegate.cs, generic.cs: Some progress on method group return type
2482         inference.
2484 2008-05-13  Marek Safar  <marek.safar@gmail.com>
2486         A fix for bug #378419
2487         * namespace.cs: Inspect also parent namespaces not only namespace entries.
2489 2008-05-12  Marek Safar  <marek.safar@gmail.com>
2491         * class.cs (Constructor): Added IsCompilerGenerated.
2493 2008-05-12  Marek Safar  <marek.safar@gmail.com>
2495         * expression.cs: Enum binary operators can accept non-enum operand only when
2496         is implicitly convertible to underlying type.
2498 2008-05-12  Marek Safar  <marek.safar@gmail.com>
2500         A fix for bug #389272
2501         * support.cs: Workaround System.InvalidOperationException for enums.
2503 2008-05-12  Marek Safar  <marek.safar@gmail.com>
2505         A fix for bug #389073
2506         * convert.cs: More undocumented explicit IntPtr/UIntPtr conversions.
2508 2008-05-10  Marek Safar  <marek.safar@gmail.com>
2510         * driver.cs: Split Parse.
2511         
2512         * location.cs (LookupFile): Uses string.Empty.
2514 2008-05-07  Marek Safar  <marek.safar@gmail.com>
2516         * expression.cs, parameter.cs: Small ParameterReference clean up.
2518 2008-05-07  Marek Safar  <marek.safar@gmail.com>
2520         * anonymous.cs, codegen.cs, convert.cs, ecore.cs: Removed uber ugly TempEc
2521         hack. Fixes #387502.
2523 2008-05-06  Martin Baulig  <martin@ximian.com>
2525         * class.cs (Constructor.Emit): Fix the logic whether to emit
2526         symbol information.
2528 2008-05-06  Raja R Harinath  <harinath@hurrynot.org>
2530         Fix #385503
2531         * iterators.cs (Iterator.CurrentBlock.DoEmit): Don't emit
2532         InvalidOperationException when the iterator is before the start or
2533         after the end.
2535 2008-05-06  Marek Safar  <marek.safar@gmail.com>
2537         * nullable.cs (NullCoalescingOperator): Result is underlying type of left,
2538         when left is nullable type.
2540 2008-05-06  Marek Safar  <marek.safar@gmail.com>
2542         A fix for bug #386628
2543         * expression.cs (LocalVariableReference): Continue in resolving when
2544         variable is not assigned.
2546 2008-05-05  Marek Safar  <marek.safar@gmail.com>
2548         * nullable.cs, statement.cs (Unwrap): Store non-variable expression in all
2549         nullable operations.
2551 2008-05-04  Marek Safar  <marek.safar@gmail.com>
2553         * nullable.cs, statement.cs (Unwrap): Don't duplicate variable expressions,
2554         it saves many redundant temporary variables for nullable operations.
2556 2008-05-03  Marek Safar  <marek.safar@gmail.com>
2558         * assign.cs: EventAddOrRemove is a statement and cannot have a type.
2559         
2560         * cfold.cs, constant.cs, expression.cs: Share Error_OperatorCannotBeApplied
2561         method.
2562         
2563         * nullable.cs: Constant coalescing operator optimizations.
2565 2008-05-03  Marek Safar  <marek.safar@gmail.com>
2567         * constant.cs: Use unsigned conversion for values which are unsigned only.
2569 2008-05-03  Marek Safar  <marek.safar@gmail.com>
2571         * convert.cs, literal.cs, nullabel.cs, typemanager.cs: Implemeted null 
2572         coalescing operator as it should be.
2574 2008-05-02  Marek Safar  <marek.safar@gmail.com>
2576         A fix for bug #371016
2577         * expression.cs: All predefined delegate operators require implicit method
2578         group conversion.
2579         
2580 2008-05-02  Marek Safar  <marek.safar@gmail.com>
2582         * constant.cs: Emit long constant as uint when fits the range.
2583         
2584         * convert.cs, expression.cs: Fixed few unsafe conversions.
2586 2008-05-02  Marek Safar  <marek.safar@gmail.com>
2588         * convert.cs, literal.cs: Don't wrap implicit reference conversion to object
2590 2008-05-02  Raja R Harinath  <harinath@hurrynot.org>
2592         Fix #385758
2593         * convert.cs (ImplicitNumericConversion): Don't modify the type of
2594         'expr'.
2595         * ecore.cs (EmptyCast.Create): Flatten nested EmptyCasts.
2597 2008-05-01  Marek Safar  <marek.safar@gmail.com>
2599         * constant.cs, literal.cs: IsLiteral property for error reporting.
2600         
2601         * ecore.cs, expression.cs: Implemented Property expression.
2603 2008-05-01  Marek Safar  <marek.safar@gmail.com>
2605         * class.cs, modifiers.cs, flowanalysis.cs: New BACKING_FIELD flag.
2606         
2607         * nullable.cs: Implemented nullable coalescing null operator.
2609         * ecore.cs, expression.cs: Expression trees work.
2611 2008-05-01  Marek Safar  <marek.safar@gmail.com>
2613         * ecore.cs: CreateExpressionTree is finally abstract.
2615         * expression.cs, linq.cs: Updated.
2617 2008-05-01  Marek Safar  <marek.safar@gmail.com>
2619         * expression.cs, ecore.cs: Block base access expression inside expression
2620         tree.
2622 2008-05-01  Marek Safar  <marek.safar@gmail.com>
2624         A fix for bug #385058
2625         * expression.cs: User-defined operator implementations always take
2626         precedence over predefined operator implementations.
2628 2008-04-30  Marek Safar  <marek.safar@gmail.com>
2630         * assign.cs, anonymous.cs, lambda.cs, nullable.cs, ecore.cs, linq.cs,
2631         class.cs, iterators.cs, expression.cs, attribute.cs: Filled a few more
2632         expression tree conversions.
2633         
2634 2008-04-30  Marek Safar  <marek.safar@gmail.com>
2636         * typemanager.cs, ecore.cs, class.cs, expression.cs, doc.cs: Merged all
2637         operators method details to Operator class.
2639 2008-04-30  Marek Safar  <marek.safar@gmail.com>
2641         * anonymous.cs: Pass unsafe flags to anonymous container.
2642         
2643         * ecore.cs, expression.cs, statement.cs: Block unsafe pointer operations
2644         inside expression tree.
2646 2008-04-29  Martin Baulig  <martin@ximian.com>
2648         * cs-tokenizer.cs (Tokenizer.Position): Added `line'.
2649         (Tokenizer.PopPosition): Also restore the `line'.
2651 2008-04-29  Marek Safar  <marek.safar@gmail.com>
2653         * delegate.cs: Implemented Invoke expression.
2655 2008-04-29  Marek Safar  <marek.safar@gmail.com>
2657         * expression.cs: Fixed equality reference comparison regression.
2659 2008-04-29  Marek Safar  <marek.safar@gmail.com>
2661         * ecore.cs: Clean up EmptyCast hack.
2662         
2663         * expression.cs, nullable.cs: Implemented enum binary and unary operations
2664         using correct conversion rules. Also fixes #383993.
2666 2008-04-28  Martin Baulig  <martin@ximian.com>
2668         * class.cs (Constructor.Emit): Don't emit debugging information
2669         for generated default .ctor's.
2671 2008-04-28  Marek Safar  <marek.safar@gmail.com>
2673         * convert.cs: Empty-cast ushort to int conversion.
2675 2008-04-28  Marek Safar  <marek.safar@gmail.com>
2677         A fix for bug #384191
2678         * ecore.cs, expression.cs: Fixed expression cloning.
2680 2008-04-28  Marek Safar  <marek.safar@gmail.com>
2682         * ecore.cs, delegate.cs, assign.cs: Few tweaks for recent changes.
2684 2008-04-28  Raja R Harinath  <harinath@hurrynot.org>
2686         Fix #381559, test-638.cs, test-639.cs
2687         * assign.cs (CompoundAssign.Helper): New wrapper.
2688         (CompoundAssign.DoResolve): Use it to wrap the nested 'target'
2689         access.
2690         * ecore.cs (MethodGroupExpr.VerifyArgumentsCompat) <params arguments>:
2691         Pass unconverted expressions to the params array creation expression.
2692         (FieldExpr.EmitAssign): Don't special-case StringConcat.
2693         (PropertyExpr.EmitAssign): Likewise.
2694         * expression.cs (ArrayCreation.ResolveArrayElement): Keep track of the
2695         element if it is of kind CompoundAssign.Helper.
2696         (ArrayCreation.Emit): If we saw a CompoundAssign.Helper, emit it
2697         first before anything else.
2698         (ArrayAccess.EmitAssign): Don't special-case StringConcat.
2699         (ArrayAccess.LoadArrayAndArguments): Simplify.
2701 2008-04-27  Marek Safar  <marek.safar@gmail.com>
2703         * expression.cs: Fixed cloning of typeof(void).
2705 2008-04-27  Raja R Harinath  <harinath@hurrynot.org>
2707         * assign.cs (Assign.DoResolve): Remove support for EventExprs.
2708         (Assign.Emit): Likewise.  Move it to ...
2709         (CompoundAssign.DoResolve): ... here and ...
2710         (CompoundAssign.Emit): ... here.
2711         (EventAddOrRemove): New helper to handle += and -= on events, and
2712         avoid the use of BinaryDelegates.
2713         * ecore.cs (EventExpr.DoResolveLValue): Emit CS0070 unconditionally.
2714         (EventExpr.EmitAddOrRemove): Improve.
2715         * delegate.cs (DelegateInvocation.DoResolve): Simplify slightly.
2717         * cs-parser.jay (type) <namespace_or_type_name variant>: Don't
2718         create VarExprs for 'foo.bar.var'.
2719         * ecore.cs (VarExpr.InferType): Rename from DoResolveLValue, which
2720         is a highly inappropriate name for its functionality.
2722 2008-04-26  Raja R Harinath  <harinath@hurrynot.org>
2724         Simplify handling of multiple assignments
2725         * assign.cs (Assign): Clear out all 'embedded assign' gunk.  Make
2726         inheritable-only.
2727         (SimpleAssign): New.  Class to be used for normal assignments.
2728         * anonymous.cs, class.cs, cs-parser.jay: Update to changes.
2729         * expression.cs, parameter.cs, statement.cs: Likewise.
2731 2008-04-25  Marek Safar  <marek.safar@gmail.com>
2733         * ecore.cs, expression.cs, nullable.cs: Implemeted enum binary add operation
2734         for incompatible underlying types, more to come, uff.
2736 2008-04-26  Raja R Harinath  <harinath@hurrynot.org>
2738         Fix gtest-388.cs
2739         * expression.cs (VariableReference.EmitAssign) <source is NewInstance>:
2740         Handle 'leave_copy'.
2742 2008-04-25  Marek Safar  <marek.safar@gmail.com>
2744         * expression.cs, nullable.cs: Implemented UnaryPlus expression.
2746 2008-04-24  Raja R Harinath  <harinath@hurrynot.org>
2748         Fix test-636.cs.  Sprinkle a few more 'EmitSideEffect's around
2749         * expression.cs (Unary.TryReduceConstant): Unwrap SideEffectConstant.
2750         * statement.cs (While, Do, For): Allow test to have side effects.
2751         (For.DoEmit): Always emit InitStatement.
2753         Fix test-635.cs
2754         * expression.cs (Binary.DoResolve) <BitwiseAnd with zero constant>:
2755         Always create SideEffectConstant.
2756         (Binary.EnumLiftUp): Don't assume that the enumeration constant is
2757         of type EnumConstant.
2759         * expression.cs (Binary.EmitBranchable) <Equality with constant>:
2760         Handle 'right' being SideEffectConstant of type 'bool'.
2762         * expression.cs (Binary.EmitBranchable) <Equality with constant>:
2763         Use left.EmitBranchable instead of open coding it, so as to
2764         improve optimization opportunities.
2766         * constant.cs (SideEffectConstant.EmitSideEffect): Simplify slightly.
2768         * ecore.cs (Expression.EmitBranchable): Document some non-obvious
2769         assumptions.
2770         (Expression.EmitSideEffect): Document.
2772 2008-04-23  Marek Safar  <marek.safar@gmail.com>
2774         * expression.cs: Implemented NewArrayBounds, TypeIs, and TypeAs expressions.
2776 2008-04-23  Marek Safar  <marek.safar@gmail.com>
2778         * constant.cs, statement.cs: Use EmitSideEffect for constant if statement.
2780 2008-04-23  Marek Safar  <marek.safar@gmail.com>
2782         * ecore.cs, expression.cs, delegate.cs: Implemeted delegate instantiation
2783         conversion to expression tree.
2785 2008-04-23  Marek Safar  <marek.safar@gmail.com>
2787         * ecore.cs: Removed unused expression.
2789 2008-04-22  Marek Safar  <marek.safar@gmail.com>
2791         * expression.cs: Implemented NegateChecked and New expressions.
2793 2008-04-22  Marek Safar  <marek.safar@gmail.com>
2795         * convert.cs, nullable.cs, expression.cs: Implemented Negate expression.
2797 2008-04-22  Raja R Harinath  <harinath@hurrynot.org>
2799         Fix #351102
2800         * anonymous.cs (AnonymousMethodExpression.DoResolve): Mark as
2801         needing final 'ret' instruction.
2803 2008-04-22  Marek Safar  <marek.safar@gmail.com>
2805         * expression.cs: Disabled lifted binary conversion on ISO-1 profiles.
2807 2008-04-21  Marek Safar  <marek.safar@gmail.com>
2809         * expression.cs: Emit ldnull and not null expression as an instance argument
2810          of static method expression calls.
2812 2008-04-21  Marek Safar  <marek.safar@gmail.com>
2814         A fix for bug #378200
2815         * expression.cs: Fixed crash when creating parameterless expression tree
2816         method call.
2818 2008-04-21  Marek Safar  <marek.safar@gmail.com>
2820         A fix for bug #375297
2821         * anonymous.cs: Fixed crash when inferring from null argument anonymous
2822         method.
2824 2008-04-21  Marek Safar  <marek.safar@gmail.com>
2826         A fix for bug #377596
2827         * decl.cs, class.cs: Emit delegate type argument attributes.
2829 2008-04-21  Marek Safar  <marek.safar@gmail.com>
2831         A fix for bug #365314
2832         * generic.cs, ecore.cs: Type parameter declaration cannot be of generic type
2833         
2834 2008-04-21  Marek Safar  <marek.safar@gmail.com>
2836         * cs-parser.jay, expression.cs: ComposedCast can work with type expressions
2837         only.
2839 2008-04-21  Marek Safar  <marek.safar@gmail.com>
2841         * generic.cs (TypeParameter): Removed redundant location.
2843 2008-04-19  Marek Safar  <marek.safar@gmail.com>
2845         * generic.cs, parameter.cs, namespace.cs, ecore.cs, class.cs, decl.cs,
2846         delegate.cs, iterators.cs, cs-parser.jay, const.cs, enum.cs: Use
2847         FullNamedExpression in all declaration type expression, statements will come
2848         later.
2850 2008-04-18  Marek Safar  <marek.safar@gmail.com>
2852         * generic.cs, namespace.cs, ecore.cs, class.cs, decl.cs, generic-mcs.cs,
2853         nullable.cs, expression.cs, enum.cs, doc.cs: Cleaning up type expressions.
2855 2008-04-18  Marek Safar  <marek.safar@gmail.com>
2857         * parameter.cs, delegate.cs, cs-parser.jay, expression.cs: Removed unused
2858         code.
2860 2008-04-17  Marek Safar  <marek.safar@gmail.com>
2862         * decl.cs, class.cs, generic.cs: Verify partial parts type parameters and
2863         constraints.
2865 2008-04-17  Marek Safar  <marek.safar@gmail.com>
2867         * decl.cs, class.cs, cs-parser.jay, ecore.cs, expression.cs: Unify all type
2868         name expressions.
2869         Also fixes #340463.
2871 2008-04-17  Raja R Harinath  <harinath@hurrynot.org>
2873         Hook up 'EmitSideEffect'
2874         * constant.cs (Constant.EmitSideEffect): New.
2875         (SideEffectConstant.Emit): Simplify.  Use EmitSideEffect.
2876         (SideEffectConstant.EmitSideEffect): New.
2877         * ecore.cs (BoxedCast.EmitBranchable): Remove.  We can't use an
2878         unconditional branch in EmitBranchable.
2879         (FieldExpr.EmitBranchable): New.
2880         * expression.cs (Unary.EmitSideEffect): New.
2881         (Binary.EmitSideEffect): New.
2882         (VariableReference.EmitSideEffect): New.  Do nothing.
2884 2008-04-16  Raja R Harinath  <harinath@hurrynot.org>
2886         Introduce 'EmitSideEffect'
2887         * ecore.cs (Expression.EmitSideEffect): New.
2888         (TypeCast): Rename from EmptyCast.
2889         (EmptyCast): New.
2890         (EmptyCast.EmitBranchable, EmptyCast.EmitSideEffect): Implement.
2891         (BoxedCast.EmitBranchable, BoxedCast.EmitSideEffect): Implement.
2892         * convert.cs, nullable.cs: Update to changes.
2894 2008-04-16  Marek Safar  <marek.safar@gmail.com>
2896         * class.cs, cs-parser.jay: Early check for base types expression.
2898 2008-04-16  Marek Safar  <marek.safar@gmail.com>
2900         * decl.cs (MemberName): Declare PrettyName as obsolete.
2902 2008-04-16  Marek Safar  <marek.safar@gmail.com>
2904         * namespace.cs: Use MemberName comparison.
2906 2008-04-16  Raja R Harinath  <harinath@hurrynot.org>
2908         Fix build break
2909         * decl.cs (MemberName.PrettyName): New.  Replaces the misnamed
2910         FullName.
2911         (MemberName.MethodName, MemberName.GetSignatureForError): Improve.
2912         (MemberName.FullyQualifiedName): New.  Provides the functionality
2913         that users assume FullName would have.
2914         * ecore.cs, namespace.cs: Update to changes.
2916         * statement.cs (Using.assign): Make into ExpressionStatement.
2917         (Using.EmitPreTryBody): Simplify.
2919 2008-04-16  Marek Safar  <marek.safar@gmail.com>
2921         * report.cs: ColorFormat is protected.
2922         
2923         * rootcontext.cs: Unused fields clean-up.
2924         
2925         * namespace.cs: Made UsingEntry name private.
2927 2008-04-16  Marek Safar  <marek.safar@gmail.com>
2929         * cs-tokenizer.cs, location.cs: Removed unused field.
2931 2008-04-16  Jan Oravec <jan.oravec@6com.sk>
2932             Raja R Harinath  <harinath@hurrynot.org>
2934         Fix #379822
2935         * constant.cs (SideEffectConstant.value): Rename from 'left'.
2936         (SideEffectConstant.side_effect): Rename from 'right'.
2937         (SideEffectConstant..ctor): Normalize 'side_effect'.
2938         (SideEffectConstant.Emit): Emit 'value', not 'side_effect' as the
2939         value of this constant.
2940         * cfold.cs: Update to changes.
2942 2008-04-15  Marek Safar  <marek.safar@gmail.com>
2944         * cs-paser.jay: Removed unused variable.
2945         
2946         * driver.cs: Made Compile instance method.
2948 2008-04-15  Raja R Harinath  <harinath@hurrynot.org>
2950         * flowanalysis.cs (FlowBranching.MergeChild): Simplify.
2952 2008-04-15  Marek Safar  <marek.safar@gmail.com>
2954         * cs-paser.jay, namespace.cs: Simplified handling of namespace imports. 
2956 2008-04-13  Jb Evain  <jbevain@novell.com>
2958         * namespace.cs: update the System.Core fullname for 2.1
2959         * driver.cs: update the list of required assemblies for 2.1.
2960         Merged from the Moonlight 2 branch.
2962 2008-04-11  Marek Safar  <marek.safar@gmail.com>
2964         * assign.cs, ecore.cs, expression.cs, nullable.cs: More work on nullable
2965         types and user defined operators. User operators arguments has to be checked
2966         for null value before invocation, which also means no operator is called
2967         when any argument is not convertible to unwrapped nullable type.
2968         
2969 2008-04-09  Marek Safar  <marek.safar@gmail.com>
2971         * convert.cs, ecore.cs, expression.cs, nullable.cs: Initial refactoring
2972         of Unary expressions to follow operator overloading rules precisely.
2973         Also fixes #321794, #323794
2974         
2975 2008-04-08  Marek Safar  <marek.safar@gmail.com>
2977         * cs-parser.jay, expression.cs: Don't wrap Indirection expression in Unary
2978         expression.
2979         
2980 2008-04-08  Marek Safar  <marek.safar@gmail.com>
2982         * expression.cs, ecore.cs: Implemented MemberInit expression.
2983         
2984 2008-04-08  Raja R Harinath  <harinath@hurrynot.org>
2986         Fix mono/tests/exception4.cs
2987         * statement.cs (ExceptionStatement, TryCatch): Revert to using
2988         ec.NeedReturnLabel () rather emitting a 'nop'.
2990         * statement.cs (ExceptionStatement.SomeCodeFollows): A hook for a
2991         simple heuristic.
2992         (TryCatch.SomeCodeFollows): Likewise.
2993         * flowanalysis.cs (FlowBranchingException): Call 'SomeCodeFollows'
2994         for 'break', 'continue' and 'return' statements inside a try.
2995         We're fairly sure that the generated IL stream will have more
2996         instructions textually following the try.
2997         (FlowBranchingTryCatch): Likewise.
2999         * statement.cs (Throw.Resolve): Move CS0156 and CS0724 testing ...
3000         * flowanalysis.cs (FlowBranching.CheckRethrow): ... here and to its
3001         overrides.
3003         * statement.cs (CollectionForeach.DisposableWrapper): Make a true
3004         wrapper -- forward everything to CollectionForeach.
3005         (CollectionForeach.NonDisposableWrapper): New.
3006         (CollectionForeach.EmitFinallyBody): Use 'endfinally' instruction
3007         instead of a pop + branch to end.
3009 2008-04-07  Marek Safar  <marek.safar@gmail.com>
3011         A fix for bug #377485
3012         * assign.cs, expression.cs, decl.cs, class.cs, ecore.cs, namespace.cs: 
3013         Propagate location for extension method groups. Report conversion failure at
3014         right place.
3016 2008-04-07  Marek Safar  <marek.safar@gmail.com>
3018         * anonymous.cs, expression.cs, ecore.cs, typemanager.cs: Implemented
3019         ListInit and Field expressions.
3021 2008-04-06  Raja R Harinath  <harinath@hurrynot.org>
3023         * iterators.cs (Iterator.EmitMoveNext): Remove try/fault wrapper.
3024         Since $PC is always -1 inside the body of MoveNext, the fault
3025         handler is a no-op.
3026         * flowanalysis.cs (FlowBranchingException.EmitFinally): Kill.
3027         * statement.cs (ExceptionStatement.emit_finally): Likewise.
3028         (ExceptionStatement.ResolveFinally): Drop 'branching' argument.
3030         The denouement!  Fix #324708
3031         * iterators.cs (Iterator.EmitMoveNext): Reset $PC to -1 on entry.
3032         (Iterator.EmitYieldBreak): We no longer need to reset $PC.
3033         * statement.cs (ExceptionStatement.DoEmit): Actually emit the
3034         'finally' inside the finally clause.
3036         * statement.cs (ExceptionStatement.DoEmit): Emit try/finally block
3037         inside an iterator.  Don't emit the body of the 'finally' inside
3038         the finally clause yet.
3040         Use the ResumableStatement infrastructure for MoveNext ()
3041         * iterators.cs (Iterator.EmitMoveNext_NoResumePoints): New.
3042         (Iterator.EmitMoveNext): Use 'resume_points'.  Get rid of
3043         'old_resume_points'.  Move dispatcher upfront.
3044         (Iterator.MarkYield): Mark the 'resume_point' of a Yield.
3045         * statement.cs (ExceptionStatement.DoEmit): Emit a dispatcher if
3046         in an enumerator.  This encodes the main fix in this patch series
3047         -- we can only jump into the first instruction of a try from the
3048         outside, but we want to emit try/finally regions in iterators and
3049         resume in the middle of them.
3051 2008-04-05  Raja R Harinath  <harinath@hurrynot.org>
3053         * statement.cs (ExceptionStatement.ResolveFinally): Move setting
3054         of NeedReturnLabel here.
3056         Introduce a common point for emitting try/finally to IL
3057         * statement.cs (ExceptionStatement.DoEmit): New.  Combines all the
3058         features of the various subclasses, which are now driven by ...
3059         (ExceptionStatement.EmitPreTryBody): ... this and ...
3060         (ExceptionStatement.EmitTryBody): ... this and the original
3061         EmitFinallyBody.
3062         (TryFinally, Lock, Using, UsingTemporary, DisposableWrapper):
3063         Remove DoEmit and update to follow above protocol.
3065         * statement.cs (ExceptionStatement.EmitForDispose): If all labels
3066         of the dispatcher are the same, skip emitting the 'switch'.
3067         * iterator.cs (Iterator.EmitDispose): Update to changes.
3069         Clean up handling of 'using' statement
3070         * statement.cs (UsingTemporary): New.  Carved out of ...
3071         (Using): ... this.  Simplify drastically.  Handle exactly
3072         one variable.
3073         * cs-parser.jay (using_statement): Split.  Create UsingTemporary
3074         or Using as appropriate.  If there are multiple variable declared,
3075         create nested Using statements.
3076         (resource_acquisition): Kill.
3078         * statement.cs (ExceptionStatement.EmitForDispose): Use
3079         EmitFinallyBody, not EmitFinally.
3081         * flowanalysis.cs (FlowBranching.StealFinallyClauses): Remove.
3082         * iterator.cs: Update to changes.
3084         Start using the ResumableStatement infrastructure
3085         * statement.cs (ResumeableStatement.PrepareForDispose): New.
3086         (ResumableStatement.EmitForDispose): New.
3087         (ExceptionStatement): Override them.
3088         * iterators.cs (Iterator.EmitDispose): Use PrepareForDispose and
3089         EmitForDispose to create the body of the Dispose method.  Don't
3090         use OldResumePoint.
3092         * iterator.cs (Iterator.AddResumePoint): Move here from ...
3093         * statement.cs (Toplevel.AddResumePoint): ... here.
3094         (Toplevel.MoveNextStatement.Resolve): Create FlowBranchingIterator.
3095         * flowanalysis.cs (FlowBranchingIterator): New.
3096         * codegen.cs (EmitContext): Update to changes.
3098         * iterators.cs (Iterator.OldResumePoint): Rename from ResumePoint.
3099         (Iterator.old_resume_points): Rename from 'resume_points'.
3100         (Iterator.MoveNextStatement): Remove unused class.
3102         New infrastructure for try/finally in iterators (still unused)
3103         * flowanalysis.cs (FlowBranching.AddResumePoint): New.
3104         (FlowBranchingToplevel.AddResumePoint): Hook into
3105         ToplevelBlock.AddResumePoint.
3106         (FlowBranchingTryCatch): Move CS01626 and CS01631 checks here.
3107         (FlowBranchingException): Hook into ExceptionBlock.AddResumePoint.
3108         * statement.cs (ToplevelBlock.AddResumePoint): New.  Collect
3109         resume points and assign program-counter values.
3110         (ExceptionBlock.AddResumePoint): Collect resume points for
3111         de-muxer at the top of try block.
3112         * iterators.cs (Yield.CheckContext): Simplify.
3113         (Yield.Resolve): Use FlowBranching.AddResumePoint.
3115 2008-04-04  Raja R Harinath  <harinath@hurrynot.org>
3117         * flowanalysis.cs (FlowBranching.AddReturnOrigin): Change Location
3118         argument to an ExitStatement.
3119         (FlowBranchingException): Refactor saved origins code.
3120         * statement.cs (ExitStatement): Update to cahges.
3121         * iterator.cs (YieldBreak): Likewise.
3123         * statement.cs (ResumableStatement): New.  Common base class for
3124         YieldReturn and ExceptionStatement.
3125         (ExitStatement): New.  Common base class for Return and YieldBreak.
3126         (Return): Update to changes.
3127         * iterator.cs (YieldBreak): Likewise.
3128         * lambda.cs (ContextualReturn): Likewise.
3130         Fix #377028
3131         * ecore.cs (Expression.ResolveAsTypeStep): If '!silent' attempt to
3132         emit a meaningful error message.
3134         Fix #324765, #319508
3135         * flowanalysis.cs (VariableInfo.IsEverAssigned): New.
3136         (VariableInfo.SetAssigned): Set it.
3137         * statement.cs (Block.UsageWarning): Use 'IsEverAssigned' to
3138         determine if CS0219 or CS0168 is appropriate.  Don't use
3139         flow-analysis information.
3140         (Block.Resolve): Use ec.EndFlowBranching, not ec.DoEndFlowBranching.
3141         * codegen.cs (EmitContext.DoEndFlowBranching): Kill.  Inline into ...
3142         (EmitContext.EndFlowBranching): ... this.
3144 2008-04-03  Marek Safar  <marek.safar@gmail.com>
3146         * class.cs, typemanager.cs: Emit volatile field with IsVolatile modifier.
3148 2008-04-03  Marek Safar  <marek.safar@gmail.com>
3150         A fix for bug #376508
3151         * convert.cs, expression.cs: Fixed difference between ImplicitConversion and
3152         ImplicitConversionExists.
3154 2008-04-03  Marek Safar  <marek.safar@gmail.com>
3156         * expression.cs (Binary): Added remaining binary operators to expression
3157         tree builder.
3159         * nullable.cs: Optimize shift with null argument.
3161 2008-04-03  Raja R Harinath  <harinath@hurrynot.org>
3163         Fix minor IL regression
3164         * statement.cs (TryCatch..ctor): Add 'inside_try_finally' argument.
3165         (TryCatch.DoEmit): Use it to avoid creating another ExceptionBlock.
3166         * cs-parser.jay (try_statement): Update to changes.
3168         * statement.cs (TryFinally.need_exc_block): Delete.
3169         (TryFinally): Update to changes.
3171         Now all ExceptionStatements are unconditional
3172         * statement.cs (CollectionForeach.DisposableWrapper): New.
3173         Extract out the try/finally code into a new wrapper.
3174         (CollectionForeach.Resolve): Use it to simplify the code.
3176 2008-04-02  Raja R Harinath  <harinath@hurrynot.org>
3178         Start at simplifying ExceptionStatement semantics a bit
3179         * statement.cs (TryCatch, TryFinally): Split 'Try' into two pieces.
3180         * cs-parser.jay (try_statement): Update to changes.
3181         (opt_catch_clauses): Remove.
3182         * flowanalysis.cs: Update to changes.
3183         (FlowBranching.BranchingType.TryCatch): New.
3184         (FlowBranchingTryCatch): New.
3186         * flowanalysis.cs (FlowBranching.BranchingType.SwitchSection): Kill.
3187         (FlowBranching.CreateBranching): Update to changes.
3188         (FlowBranchingBlock.AddSibling): Add sanity check.
3189         * codegen.cs (EmitContext.StartFlowBranching) <Block variant>:
3190         Update to changes.
3192         * iterators.cs (Iterator.MarkFinally): Remove.
3193         * statement.cs (ExceptionStatement): Update to changes.
3195         Add support for skipping over finally blocks at runtime.  First
3196         in a series to fix #324708
3197         * iterators.cs (Iterator.SkipFinally): New LocalBuilder.
3198         (Iterator.EmitMoveNext): Initialize it.
3199         * statement.cs (ExceptionStatement.EmitFinally): Use it to emit a
3200         branch over the body of the 'finally' clause.
3202 2008-03-31  Raja R Harinath  <harinath@hurrynot.org>
3204         Avoid lopsided use of Foo/DoFoo names
3205         * statement.cs (ExpressionStatement.EmitFinallyBody):
3206         Rename from EmitFinally.
3207         (ExpressionStatement.EmitFinally): Rename from DoEmitFinally.
3208         * iterator.cs: Update to changes.
3210 2008-04-02  Marek Safar  <marek.safar@gmail.com>
3212         * ecore.cs, expression.cs, nullable.cs: ConditionalLogicalOperator is now
3213         based on UserOperatorCall. More binary nullable operators clean up.
3215 2008-04-02  Martin Baulig  <martin@ximian.com>
3217         * symbolwriter.cs: Remove the `#if !DISABLE_TERRANIA_CHANGES' conditionals.
3219 2008-04-02  Marek Safar  <marek.safar@gmail.com>
3221         * nullable.cs: Merge user and empty conversions when lifting expression
3222         trees.
3223         
3224         * expression.cs (StringConcat): Implemented expression tree representation.
3226 2008-04-01  Marek Safar  <marek.safar@gmail.com>
3228         * nullable.cs: When lifting null literal and a user operator exists, no call 
3229         is made.
3230         
3231 2008-04-01  Marek Safar  <marek.safar@gmail.com>
3233         * nullable.cs, ecore.cs, expression.cs: Convert null arithmetic to lifted
3234         null.
3236 2008-04-01  Marek Safar  <marek.safar@gmail.com>
3238         * nullable.cs, expression.cs: Use namespace instead heavily nested
3239         monster abstract class.
3241 2008-04-01  Marek Safar  <marek.safar@gmail.com>
3243         * ecore.cs, convert.cs, constant.cs, nullable.cs, expression.cs: Implemented
3244         lifting of null literal and user operators. Clean up of some temporary
3245         nullable hacks.
3247 2008-03-30  Raja R Harinath  <harinath@hurrynot.org>
3249         Fix #368224, test-629.cs
3250         * flowanalysis.cs (FlowBranching.StealFinallyClauses): Return true
3251         if it crossed an unwind-protect boundary.
3252         * iterators.cs (Yield.CheckContext): Relax check for 'yield break'.
3253         (Yield.Resolve, Yield.DoEmit): Track whether the yield occurs
3254         inside an unwind-protected region.
3255         (YieldBreak.Resolve, YieldBreak.DoEmit): Likewise.
3256         (Iterator.MarkYield): Add 'unwind_protect' parameter.  Emit a
3257         'leave' instead of a 'br' if unwind-protected.
3258         (Iterator.EmitYieldBreak): Likewise.
3260 2008-03-29  Gert Driesen  <drieseng@users.sourceforge.net>
3262         * driver.cs: Only define versioninfo resources if no win32 resource
3263         file was specified.
3265 2008-03-28  Marek Safar  <marek.safar@gmail.com>
3267         A fix for bug #372375
3268         * convert.cs: Fixed boxing of nullable types.
3270 2008-03-28  Marek Safar  <marek.safar@gmail.com>
3272         * typemanager.cs: Initialize InternalsVisibleTo as the very first optional
3273         type.
3275 2008-03-28  Marek Safar  <marek.safar@gmail.com>
3277         A fix for bug #374619
3278         * nullable.cs: Fixed guarding of EmitBitwiseBoolean.
3279         
3280 2008-03-27  Marek Safar  <marek.safar@gmail.com>
3282         * lambda.cs: Check return type only for invocation.
3283         
3284 2008-03-27  Marek Safar  <marek.safar@gmail.com>
3286         A fix for bug #374214
3287         * ecore.cs: Correctly report argument type mismatch.
3289 2008-03-27  Marek Safar  <marek.safar@gmail.com>
3291         * convert.cs (ImplicitReferenceConversionCore): Correctly compare enum type
3292         and not rely on broken IsEnum.
3294 2008-03-27  Marek Safar  <marek.safar@gmail.com>
3296         * nullable.cs: New file, extracted from generic.cs.
3297         
3298         * generic.cs, generic-mcs.cs, *.csproj, *.sources: Updated.
3300 2008-03-27  Marek Safar  <marek.safar@gmail.com>
3302         * generic.cs, convert.cs, generic-mcs.cs, expression.cs: Added lifting of
3303         predefined comparison operators and null literals.
3304         
3305         * report.cs: New warning ID.
3306         
3307 2008-03-25  Marek Safar  <marek.safar@gmail.com>
3309         A fix for bug #370577
3310         * lambda.cs: Check return type too.
3312 2008-03-25  Marek Safar  <marek.safar@gmail.com>
3314         A fix for bug #372846
3315         * class.cs: Automatic properties can be declared as unsafe.
3317 2008-03-20  Marek Safar  <marek.safar@gmail.com>
3319         * location.cs: Use string based concatenation.
3320         
3321         * expression.cs: LiftedBinaryOperator is gmcs only.
3322         
3323 2008-03-20  Marek Safar  <marek.safar@gmail.com>
3325         * generic.cs, literal.cs, ecore.cs, expression.cs: Ongoing work on nullable
3326         conversions rules and expression trees.
3328 2008-03-19  Marek Safar  <marek.safar@gmail.com>
3330         * delegate.cs: Use extension method source as delegate target.
3332 2008-03-19  Marek Safar  <marek.safar@gmail.com>
3334         * generic.cs, generic-mcs.cs, expression.cs, ecore.cs: Rewrote nullable
3335         binary operations to be purely based on binary operations and optimized
3336         emitted code (30% less in some cases). Introduced ReducedExpression for ETs
3337         and other ET refactoring.
3338         
3339         * typemanager.cs: Fixed warning.
3340         
3341 2008-03-17  Marek Safar  <marek.safar@gmail.com>
3343         * class.cs, decl.cs, delegate.cs: Do protected modifier check on each member
3344         
3345         * symbolwriter.cs: Fixed.
3347 2008-03-17  Marek Safar  <marek.safar@gmail.com>
3349         * anonymous.cs, driver.cs: Reset anonymous types counters.
3351 2008-03-17  Marek Safar  <marek.safar@gmail.com>
3353         * ecore.cs (MethodGroupExpr): Skip first candidate, it's already the best.
3354         
3355         * class.cs: Use fullname for all type member definitions.
3356         
3357 2008-02-19  Martin Baulig  <martin@ximian.com>
3359         * class.cs
3360         (IMethodData.EmitExtraSymbolInfo): New interface method.
3361         (MethodData.Emit): Call method.EmitExtraSymbolInfo().
3362         (MethodOrOperator.EmitExtraSymbolInfo): Implement this new
3363         interface method here as an empty public virtual method.
3365         * anonymous.cs
3366         (AnonymousMethodMethod.ctor): Added `string real_name' argument.
3367         (AnonymousMethodMethod.EmitExtraSymbolInfo): Override and call
3368         CodeGen.SymbolWriter.SetRealMethodName().       
3370 2008-02-18  Martin Baulig  <martin@ximian.com>
3372         * anonymous.cs
3373         (ScopeInfo.EmitType): Override this and emit debugging
3374         information for captured variables.
3375         (RootScopeInfo.EmitType): Override this and emit symbol
3376         information for a captured `this'.
3378 2008-02-15  Martin Baulig  <martin@ximian.com>
3380         * iterators.cs: Emit debugging info.
3382         * codegen.cs
3383         (EmitContext.Flags): Add `OmitDebuggingInfo'.
3384         (EmitContext.OmitDebuggingInfo): New public property.
3386         * statement.cs
3387         (While): Override Emit() and don't emit symbol info there; do it
3388         inside DoEmit() instead.
3389         (Block.Emit): Omit symbol information while emitting the scope
3390         initializers; don't ec.Mark() the `EndLocation'.  Fix the lexical
3391         block logic.
3392         (ExplicitBlock.IsIterator): Moved here from `ToplevelBlock'.
3393         (ToplevelBlock.MakeIterator): Pass the `flags' to `ExplicitBlock's
3394         .ctor to make `IsIterator' work.
3396 2008-03-14  Martin Baulig  <martin@ximian.com>
3398         * symbolwriter.cs: Added the new symbol writer function from the
3399         debugger's `terrania' branch; temporarily enclose them inside
3400         `#if !DISABLE_TERRANIA_CHANGES' conditionals until I'm back from
3401         my vacations.
3403 2008-03-14  Martin Baulig  <martin@ximian.com>
3405         * symbolwriter.cs
3406         (SymbolWriter): Make this a public static class.
3408         * codegen.cs
3409         (CodeGen.SymbolWriter): Removed; use the new static `SymbolWriter'
3410         class instead of using `if (CodeGen.SymbolWriter != null)' everywhere.
3412 2008-03-14  Marek Safar  <marek.safar@gmail.com>
3414         A fix for bug #370577
3415         * statement.cs, lambda.cs: Added extra limitations when dealing with void
3416         return type.
3417         
3418 2008-03-14  Marek Safar  <marek.safar@gmail.com>
3420         * typemanager.cs (CSharpName): Made 250 times faster.
3422 2008-03-13  Marek Safar  <marek.safar@gmail.com>
3424         * ecore.cs, expression.cs: Emit conversion for ET shift argument.
3425         
3426 2008-03-12  Marek Safar  <marek.safar@gmail.com>
3428         * generic.cs, typemanager.cs, enum.cs, codegen.cs, statement.cs: Try not to
3429         crash when predefined field does not exist.
3430         
3431 2008-03-12  Marek Safar  <marek.safar@gmail.com>
3433         * ecore.cs (PropertyExpr): Fixed IsSingleDimensionalArrayLength regression.
3434         
3435 2008-03-12  Marek Safar  <marek.safar@gmail.com>
3437         * class.cs (FixedField): Don't crash when contructors are missing.
3439 2008-03-11  Marek Safar  <marek.safar@gmail.com>
3441         * typemanager.cs, namespace.cs, literal.cs, ecore.cs, class.cs, decl.cs,
3442         convert.cs, constant.cs, expression.cs, statement.cs: Use same method to
3443         check internal types accessibility for internal and external types.
3444         Replaced EnumToUnderlying by GetEnumUnderlyingType.
3446 2008-03-11  Marek Safar  <marek.safar@gmail.com>
3448         * support.cs, typemanager.cs, pending.cs, ecore.cs, class.cs, delegate.cs
3449         convert.cs, const.cs, anonymous.cs, constant.cs, expression.cs,
3450         attribute.cs, statement: Use corect instance of predefined types (work
3451         related to #364674).
3453 2008-03-07  Marek Safar  <marek.safar@gmail.com>
3455         * expression.cs (TypeOfVoid): Fixed predefined method initialization.
3456         
3457 2008-03-07  Marek Safar  <marek.safar@gmail.com>
3459         * generic.cs, typemanager.cs, parameter.cs, rootcontext.cs, ecore.cs, 
3460         class.cs, delegate.cs, iterators.cs, const.cs, constant.cs, driver.cs,
3461         expression.cs, attribute.cs, codegen.cs, statement.cs: TypeManager optional
3462         predefined types clean up, delayed predefined types members initialization
3463         (work related to #364674).
3465 2008-03-05  Marek Safar  <marek.safar@gmail.com>
3467         * typemanager.cs (IsFriendAssembly): InternalsVisibleTo is not mandatory.
3468         
3469 2008-03-05  Marek Safar  <marek.safar@gmail.com>
3471         * typemanager.cs, parameter.cs, rootcontext.cs, ecore.cs, class.cs, decl.cs,
3472         delegate.cs, convert.cs, driver.cs, attribute.cs, codegen.cs: TypeManager
3473         predefined types clean up (work related to #364674).
3475 2008-03-04  Marek Safar  <marek.safar@gmail.com>
3477         * ecore.cs: Print an error message instead of throwing exception.
3478         
3479 2008-03-04  Marek Safar  <marek.safar@gmail.com>
3481         * generic.cs, typemanager.cs, literal.cs, convert.cs, cfold.cs, constant.cs,
3482         expression.cs, statement.cs: Unififed null literal representation.
3484 2008-03-03  Marek Safar  <marek.safar@gmail.com>
3486         * anonymous.cs, cfold.cs, convert.cs, delegate.cs, doc.cs, ecore.cs,
3487         expression.cs: Refactored binary operators resolve phase and improved speed.
3488         The nullable code is still missing and won't work correctly, more fixes
3489         required.
3491         It also fixes #323726, #324312, #324248, and many other unreported issues.
3493 2008-02-29  Zoltan Varga  <vargaz@gmail.com>
3495         * report.cs (FeatureIsNotAvailable): Use 'mcs1' instead of 'mcs', and 'mcs' 
3496         instead of 'gmcs'.
3498 2008-02-27  Marek Safar  <marek.safar@gmail.com>
3500         * ecore.cs: Clean-up and split BetterConversion.
3501         
3502 2008-02-25  Raja R Harinath  <harinath@hurrynot.org>
3504         Fix #363791
3505         * enum.cs (EnumMember.Value): Only access 'value' if
3506         ResolveValue says it's ok.
3507         (EnumMember.DoResolveValue): Don't set prev_member.value.
3508         (Enum.GetDefinition): Reverse arguments of Equals --
3509         EnumMember.Value can return 'null'.
3511         * statement.cs (Switch.Error_AlreadyOccurs): Fix typo in name.
3513 2008-02-22  Marek Safar  <marek.safar@gmail.com>
3515         * generic.cs, expression.cs: More ongoing work on expression trees.
3516         
3517 2008-02-21  Marek Safar  <marek.safar@gmail.com>
3519         * class.cs, typemanager.cs: Rewrote operator matching logic to correctly
3520         handle missing matches when mutiple operators exist.
3521         
3522 2008-02-20  Marek Safar  <marek.safar@gmail.com>
3524         A fix for bug #363218
3525         * expression.cs (ArrayCreation.Clone): Deal with multi-dimensional
3526         initializers.
3527         
3528 2008-02-20  Marek Safar  <marek.safar@gmail.com>
3530         * expression.cs, constant.cs, cfold.cs: Yet another side-effect constant
3531         update. This time to deal correctly with SideEffectConstant expression used
3532         as an argument for another constant folding.
3534 2008-02-20  Raja R Harinath  <harinath@hurrynot.org>
3536         * typemanager.cs (DropGenericMethodArguments): Ensure we get an underlying
3537         MethodBuilder.
3539 2008-02-19  Marek Safar  <marek.safar@gmail.com>
3541         * constant.cs, cfold.cs: SideEffectConstant results can apply for folding.
3543 2008-02-19  Marek Safar  <marek.safar@gmail.com>
3545         A fix for bug #328136
3546         * expression.cs: Do not fold immediately LogicalAnd operators when the left
3547         side is a false constant, because we still need to evaluate the right-hand
3548         side.
3550         * statement.cs (If): Emit two types of boolean constants (simple constant,
3551         side-effect constant).
3553 2008-02-19  Marek Safar  <marek.safar@gmail.com>
3555         * constant.cs (SideEffectConstant): Don't emit boolean constant.
3557         * expression.cs: Fold immediately LogicalAnd operators when both sides are
3558         constants.
3560 2008-02-18  Marek Safar  <marek.safar@gmail.com>
3562         A fix for bug #361457
3563         * ecore.cs (IsApplicable): Params methods have lower priority.
3565         * support.cs: Return correct parameter modifier for params types.
3567 2008-02-18  Marek Safar  <marek.safar@gmail.com>
3569         * generic.cs (TypeParameter): Cache attribute target name.
3571         * support.cs: Removed unused variable.
3573         * typemanager.cs: Removed debugging leftover.
3575         * ecore.cs: Use local type instead of a property;
3577         * class.cs (VerifyMembers): Consider also parent to test whether type member
3578         is local or public.
3580         * expression.cs (FullMethodDesc): Removed.
3582         * attribute.cs (IsValidArgumentType): Made static.
3584 2008-02-17  Raja R Harinath  <harinath@hurrynot.org>
3586         Cleanup to be more readable.
3587         * Makefile (GMCS_PROFILE): Remove.
3588         (COMPILER_NAME): New helper.
3590 2008-02-15  Miguel de Icaza  <miguel@novell.com>
3592         * cs-tokenizer.cs: if a conditional expression happens inside a
3593         (...) this also means that we do not need to de-ambiguate between
3594         an parenthesized expression and a cast.
3596         Fixes 346484.
3598         * constant.cs (SideEffectConstant): a constant value that happens
3599         to have a side effect.
3601         Fixes the build regressions introduced by the fix for #359789
3603 2008-02-14  Rodrigo Kumpera  <rkumpera@novell.com>
3605         * expression.cs (Conditional.Emit): when emitting the ternary
3606         operator, use local variables to generate code verifiable code.
3608         The verifier cannot infer that the type on stack before the
3609         stloc.0 is executed is of type ParentB. This happens because the
3610         stack merge algorithm uses only parent types when deciding which
3611         is the common type.  This is described in Part III 1.8.1.3 of ECMA
3612         335.
3614         This code compiled with mcs is not verifiable under MS. The MS
3615         verifier picks the first common interface of Foo and Bar, which is
3616         wrong, but doesn't use a full join type of the 2 interfaces.
3618         CSC uses a clever hack to compile such code in a verifiable
3619         way. It stores the intermediate values in a local variable with
3620         the expected type.
3622         Fixes: #358102
3624 2008-02-14  Miguel de Icaza  <miguel@novell.com>
3626         * expression.cs: Do not fold BitwiseAnd operators when the left
3627         side is a false constant, because we still need to evaluate the
3628         right-hand side.
3630         Fixes #359789
3632         * support.cs: Instead of throwing an InternalErrorException when
3633         the position of the stream is outside the boundary of our buffer,
3634         reset the state of the reader, and restart the reading from the
3635         beginning of the file.
3637 2008-02-14  Marek Safar  <marek.safar@gmail.com>
3639         * generic.cs (TypeParameter.GetMembers): Is not supported operation.
3641 2008-02-14  Marek Safar  <marek.safar@gmail.com>
3643         A fix for bug #361686
3644         * decl.cs: A protected types used inside a private class which parents
3645         derives from the protected class are accessible.
3647 2008-02-13  Marek Safar  <marek.safar@gmail.com>
3649         * generic.cs (ConstraintChecker): Use cached member lookup when looking for
3650         the parameterless constructor.
3652 2008-02-13  Marek Safar  <marek.safar@gmail.com>
3654         * generic.cs, typemanager.cs, iterators.cs, codegen.cs: Refactored core
3655         lookup methods to use standard member cache when doing member lookup.
3657 2008-02-12  Marek Safar  <marek.safar@gmail.com>
3659         * driver.cs: Don't report full path for referenced module as assembly error.
3661 2008-02-12  Marek Safar  <marek.safar@gmail.com>
3663         * Makefile: Fixed `qh' target to work on all machines.
3665         * report.cs, typemanager.cs, parameter.cs, ecore.cs, class.cs, anonymous.cs,
3666         expression.cs, codegen.cs, statement.cs, doc.cs: Replaced type IsSubclassOf
3667         and HasElementType with TypeManager implementation.
3669 2008-02-08  Marek Safar  <marek.safar@gmail.com>
3671         A fix for bugs #325134, #359749
3672         * expression.cs, ecore.cs: Try to resolve an extension method even if the
3673         first binds point to non-method member expression.
3675 2008-02-08  Marek Safar  <marek.safar@gmail.com>
3677         * cs-parser.jay: Null coalescing operator is not part of ISO-1.
3679 2008-02-08  Marek Safar  <marek.safar@gmail.com>
3681         A fix for bugs #321394, #323028
3682         * generic.cs, parameter.cs, ecore.cs, class.cs, decl.cs, delegate.cs:
3683         Reworked naive IsAccessibleAs implementation to handle nested types.
3685 2008-02-05  Jb Evain  <jbevain@novell.com>
3687         * class.cs: use generic type comparison for parameters
3688         as well.
3690 2008-02-05  Marek Safar  <marek.safar@gmail.com>
3692         A fix for bug #325372
3693         * class.cs: Use generic type comparison when testing method signatures.
3695 2008-02-05  Marek Safar  <marek.safar@gmail.com>
3697         A fix for bug #357047
3698         * ecore.cs: Applied C# 3.0 changes to better conversion.
3700 2008-02-05  Marek Safar  <marek.safar@gmail.com>
3702         A fix for bug #358374
3703         * cs-parser.jay: Correctly set modifiers for all constructor types.
3705 2008-02-04  Marek Safar  <marek.safar@gmail.com>
3707         A fix for bug #355251
3708         * generic.cs: Added base class constraint based type inference.
3710 2008-02-01  Marek Safar  <marek.safar@gmail.com>
3712         A fix for bug #357255
3713         * decl.cs: One more missing visibility check.
3715 2008-02-01  Marek Safar  <marek.safar@gmail.com>
3717         * support.cs: Fixed broken return.
3719 2008-01-25  Marek Safar  <marek.safar@gmail.com>
3721         * report.cs: Correctly reset warnings count after probing.
3723 2008-01-25  Martin Baulig  <martin@ximian.com>
3725         * namespace.cs
3726         (NamespaceEntry.SymbolFileID): Make this work again after
3727         MemberName.ToString() is gone.
3729 2008-01-25  Marek Safar  <marek.safar@gmail.com>
3731         * expression.cs: Implemented Divide, Equal, ExclusiveOr, GreaterThanOrEqual
3732         expressions.
3734 2008-01-25  Marek Safar  <marek.safar@gmail.com>
3736         * generic.cs: Use full implicit conversion for type inference fixing.
3738 2008-01-24  Marek Safar  <marek.safar@gmail.com>
3740         * ecore.cs, expression.cs, generic.cs: Implemented Convert, ConvertChecked.
3741         Fixed user operator conversions.
3743 2008-01-24  Marek Safar  <marek.safar@gmail.com>
3745         * generic.cs: Do nullable type to null comparison optimization during
3746         resolve phase.
3748 2008-01-24  Marek Safar  <marek.safar@gmail.com>
3750         A fix for bug #355163
3751         * generic.cs: Enabled l-value resolve on nullable expressions.
3753 2008-01-24  Marek Safar  <marek.safar@gmail.com>
3755         A fix for bug #353986
3756         * class.cs: Ingore static ctors with parameters for any further checks.
3758 2008-01-24  Marek Safar  <marek.safar@gmail.com>
3760         A fix for bug #354310
3761         * namespace.cs: Removed redundant check.
3763 2008-01-24  Marek Safar  <marek.safar@gmail.com>
3765         A fix for bug #354928
3766         * expression.cs: ElementInitializers can be resolved only once.
3768 2008-01-24  Marek Safar  <marek.safar@gmail.com>
3770         * convert.cs, ecore.cs, expression.cs, generic.cs: Implemented Coalesce and
3771         Condition expressions.
3773 2008-01-23  Marek Safar  <marek.safar@gmail.com>
3775         * codegen.cs: Fixed AssemblyBuilder initialization on other platforms.
3777 2008-01-22  Marek Safar  <marek.safar@gmail.com>
3779         * ecore.cs, expression.cs, generic.cs: Implicit bool? to bool conversion is
3780         not allowed.
3782         * generic.cs: Implemented coalesce expression.
3784 2008-01-22  Marek Safar  <marek.safar@gmail.com>
3786         A fix for bug #355145
3787         * anonymous.cs, convert.cs, ecore.cs, generic.cs, lambda.cs: Implemented
3788         expression tree type inference.
3790 2008-01-22  Raja R Harinath  <harinath@hurrynot.org>
3792         Fix #354663
3793         * expression.cs (Binary.IsUnsignedType): Fix typo.
3795 2008-01-22  Marek Safar  <marek.safar@gmail.com>
3797         * ecore.cs, expression.cs, generic.cs: Implemented NewArrayInit expression.
3799 2008-01-22  Marek Safar  <marek.safar@gmail.com>
3801         A fix for bug #355161
3802         * ecore.cs, expression.cs: Wider range of extension method supported
3803         expressions.
3805 2008-01-22  Gert Driesen  <drieseng@users.sourceforge.net>
3807         * codegen.cs: Use magic value for AssemblyBuilderAccess to instruct
3808         AssemblyBuilder to operate in compiler context. Fixes mcs part of
3809         bug #354970.
3811 2008-01-22  Marek Safar  <marek.safar@gmail.com>
3813         A fix for bug #355148
3814         * ecore.cs, expression.cs: Correctly report misused ref and out modifiers.
3816 2008-01-22  Miguel de Icaza  <miguel@novell.com>
3818         * expression.cs (CreateExpressionTree): Add support for or and
3819         logical or, and indent following the coding conventions.
3821         * typemanager.cs (LinqExpression): renamed from
3822         ExpressionTreeManager, for a shorter name.
3824         Use TypeManager.CoreLookupType to lookup types from our core
3825         assemblies and turn those into "Type" variables.
3827         Consumers that previously used "Namespace" and "Type" from this
3828         class should instead use the TypeExpression which is a type that
3829         is fully resolved (without involving the regular C# resolution
3830         rules). 
3832         This typically looks like this:
3834         TypeExpression texpr = new TypeExpression (LinqExpression.expression_type, loc);
3835         new MemberAccess (texpr, name, type_arguments, loc)
3837         This avoids the problem in: #355178
3839 2008-01-21  Marek Safar  <marek.safar@gmail.com>
3841         * cs-parser.jay, expression.cs: Check `namespace alias qualifier' language
3842         feature in parser only as we do in other cases.
3843         
3844 2008-01-21  Marek Safar  <marek.safar@gmail.com>
3846         * attribute.cs, ecore.cs, class.cs, delegate.cs, expression.cs, linq.cs,
3847         typemanager.cs: A refactoring of params arguments to reuse existing
3848         expressions (params -> array initializer) to emit params argument instead
3849         of specialized handling.
3850         It was required by expression tree implementation and it has other benefits
3851         as well, we now apply same optimization for params arguments as we do for
3852         array initializers.
3853         
3854 2008-01-18  Marek Safar  <marek.safar@gmail.com>
3856         A fix for bug #353526
3857         * generic.cs: A type inference of params arguments may not required any
3858         temporary array creation.
3859         
3860 2008-01-18  Marek Safar  <marek.safar@gmail.com>
3862         A fix for bug #353534
3863         * generic.cs, ecore.cs, expression.cs: A method group type inference is
3864         supported for delegates only.
3865         
3866 2008-01-18  Marek Safar  <marek.safar@gmail.com>
3868         * generic.cs: Fixed 3.0 type inference fixing phase to determine a unique
3869         type for more than 1 candidates.
3870         
3871 2008-01-18  Marek Safar  <marek.safar@gmail.com>
3873         * typemanager.cs, ecore.cs, expression.cs: Implemented ArrayLength and Call
3874         expressions.
3875         
3876 2008-01-16  Marek Safar  <marek.safar@gmail.com>
3878         * generic.cs, typemanager.cs, lambda.cs, parameter.cs, ecore.cs, constant.cs,
3879         expression.cs: Implemented Add, And, AndAlso, and ArrayIndex (without unary
3880         operator) expressions. 
3881                 
3882 2008-01-16  Zoltan Varga  <vargaz@gmail.com>
3884         * statement.cs: Avoid declaring an IL variable for this_variable since it is
3885         not accessed from the generated IL.
3887 2008-01-14  Marek Safar  <marek.safar@gmail.com>
3889         * typemanager.cs, lambda.cs, parameter.cs, ecore.cs, class.cs, delegate.cs,
3890         iterators.cs, convert.cs, assign.cs, anonymous.cs, expression.cs,
3891         statement.cs: The first expression tree implementation drop, mostly
3892         infrastructure work.
3894 2008-01-14  Marek Safar  <marek.safar@gmail.com>
3896         * ecore.cs (IsNestedChild): Refactored.
3898 2008-01-11  Marek Safar  <marek.safar@gmail.com>
3900         * lambda.cs: Don't use a cast on unknown expression statement.
3902 2008-01-10  Geoff Norton  <gnorton@novell.com>
3904         * cs-tokenizer.cs: One more token to distinguish between method and lambda
3905         arguments
3907 2008-01-09  Marek Safar  <marek.safar@gmail.com>
3909         * doc.cs: Report better /doc crash details.
3910         
3911 2008-01-09  Marek Safar  <marek.safar@gmail.com>
3913         A fix for bug #352536
3914         * ecore.cs, assign.cs, codegen.cs: Check event assignments.
3916 2008-01-08  Marek Safar  <marek.safar@gmail.com>
3918         A fix for bug #352287
3919         * ecore.cs, expression.cs: Do `this' access checking in all member access
3920         expressions.
3921         
3922 2008-01-08  Marek Safar  <marek.safar@gmail.com>
3924         * rootcontext.cs, driver.cs: Switch to linq mode by default.
3925         
3926         * report.cs: Reset message stacks.
3927         
3928 2008-01-08  Marek Safar  <marek.safar@gmail.com>
3930         * generic.cs (InferInPhases): Correctly calculate params position.
3931         
3932 2008-01-08  Marek Safar  <marek.safar@gmail.com>
3934         * cs-tokenizer.cs: No need to parse full string when parsing lambda
3935         arguments.
3937 2008-01-07  Marek Safar  <marek.safar@gmail.com>
3939         * cs-tokenizer.cs: Enabled lambda arguments micro-parser for all profiles.
3940         
3941         * decl.cs (LookupNamespaceOrType): Don't cache names which caused an error.
3942         
3943         * driver.cs: Updated --help option.
3944         
3945 2008-01-07  Marek Safar  <marek.safar@gmail.com>
3947         * generic.cs (InferParamsTypeArguments): Removed.
3948         (InferInPhases): Add params type inference.
3949         (LowerBoundInference): Fixed scoring mechanism.
3950         
3951         * cs-tokenizer.cs (PreProcessPragma): Use Location instead of line.
3952         
3953 2008-01-06  Gert Driesen  <drieseng@users.sourceforge.net>
3955         * typemanager.cs: On 2.0 profile, GetPublicKeyToken returns an empty
3956         byte array for unsigned "baked" assemblies.
3958 2008-01-05  Gert Driesen  <drieseng@users.sourceforge.net>
3960         * codegen.cs: AssemblyName.GetPublicKey returns a zero-length byte
3961         array for assemblies that are not strongnamed.
3963 2008-01-04  Marek Safar  <marek.safar@gmail.com>
3965         A fix for bug #351481
3966         * expression.cs (MemberAccess.ResolveNamespaceOrType): Use correct
3967         declaring type for nested generic types.
3968         
3969 2008-01-04  Marek Safar  <marek.safar@gmail.com>
3971         * namespace.cs, class.cs, decl.cs, cs-parser.jay: Use GetSignatureForError
3972         instead of ToString.
3973         
3974 2008-01-03  Marek Safar  <marek.safar@gmail.com>
3976         A fix for bug #351047
3977         * expression.cs (Binary.ResolveOperator): Allow equality operators between
3978         null and structs only when equality and inequality operators are defined
3979         either as an user-operators or predefined operators.
3980         
3981 2008-01-03  Marek Safar  <marek.safar@gmail.com>
3983         A fix for bug #351047
3984         * generic.cs, typemanager.cs, class.cs: New IsReferenceType helper method.
3985         
3986 2008-01-03  Marek Safar  <marek.safar@gmail.com>
3988         A fix for bug #351257
3989         * cs-tokenizer.cs: Advance line number for '\r' correctly.
3990         
3991 2008-01-03  Marek Safar  <marek.safar@gmail.com>
3993         A fix for bug #351157
3994         * class.cs (Using): Fixed yet another broken cloning.
3995         
3996         (Block): Put back more sensible default value for statements.
3997         
3998 2008-01-01  Gert Driesen  <drieseng@users.sourceforge.net>
4000         * codegen.cs: Allow AssemblyVersion with only major version component.
4001         Fixes bug #351055.
4003 2007-12-29  Marek Safar  <marek.safar@gmail.com>
4005         A fix for bug #324654
4006         * class.cs: Use FullName property as member name.
4008 2007-12-28  Marek Safar  <marek.safar@gmail.com>
4010         A fix for bug #342117
4011         * generic.cs (ConstraintChecker): Struct constraint also satisfies default
4012         constructor constraint.
4014 2007-12-28  Marek Safar  <marek.safar@gmail.com>
4016         A fix for bug #338273
4017         * class.cs (ProbertyBase): Access modifier checks are required for overrides
4018         only.
4020 2007-12-28  Marek Safar  <marek.safar@gmail.com>
4022         A fix for bug #350839
4023         * ecore.cs (MethodroupExpr): Probing hacks are no longer required.
4025 2007-12-27  AdTsai (http://code.google.com/u/AdTsai/)
4027         Reviewed by Ben Maurer, Miguel de Icaza, patches from Google's
4028         GHOP:
4029         
4030         http://code.google.com/p/google-highly-open-participation-mono/issues/detail?id=4 
4032         * statement.cs: Changed some Hashtables to use HybridDictionaries
4033         instead. It was observed that some HashTables only contained a few
4034         items in the vast majority of cases. Since HybridDictionary is
4035         more efficient on small sets (<10 elements), "known_variables"
4036         from class ExplicitBlock as well as "labels" and "constants " from
4037         class Block were changed to HybridDictionaries. 
4039         Atsai results: (56216kb->54987kb)
4041         Miguel results (bootstrap of mcs): 59819kb -> 59290kb
4044 2007-12-27  AdTsai (http://code.google.com/u/AdTsai/)
4046         Reviewed by Ben Maurer, Miguel de Icaza, patches from Google's
4047         GHOP:
4048         
4049         http://code.google.com/p/google-highly-open-participation-mono/issues/detail?id=4 
4050         
4051         * expression.cs: foreach loop to for loop, saved on allocation of
4052         enumerator (59333kb->59141kb)
4054         * statement.cs. Changed foreach loops to for loops, saved on
4055         allocation of enumerator (59141kb->59006kb)
4057         * decl.cs: ArrayLists in .NET 1.1 allocate 16 elements by default
4058         when constructed with no specified capacity. This was causing a
4059         few ArrayLists to allocate more memory than they would potentially
4060         need in the Block class and MemberCache class. Setting the
4061         ArrayLists to construct with a capacity of 1 saves some
4062         memory. (56216kb->55585kb)
4064 2007-12-27  Marek Safar  <marek.safar@gmail.com>
4066         A fix for bug #347189 (2nd issue)
4067         * expression.cs (MemberAccess): Nested type can be found in base non-generic
4068         type.
4070 2007-12-27  Miguel de Icaza  <miguel@novell.com>
4071         
4072         * report.cs: Do not use colors if stdout and stderr are not a
4073         terminal.
4075 2007-12-27  Marek Safar  <marek.safar@gmail.com>
4077         A fix for bug #346998
4078         * ecore.cs (MethodGroupExpr): Implemented override filter for generic
4079         overloads.
4081 2007-12-27  Marek Safar  <marek.safar@gmail.com>
4083         A fix for bug #343465
4084         * class.cs: Explicit method name for nested types uses dots only.
4086 2007-12-27  Marek Safar  <marek.safar@gmail.com>
4088         A fix for bug #343707
4089         * cs-tokenizer.cs: Advance line number for mixed CR/LF files correctly.
4091 2007-12-27  Marek Safar  <marek.safar@gmail.com>
4093         * ecore.cs: Report type inference errors only when arguments count matches
4094         parameter count.
4095         
4096         * generic.cs (NullCoalescingOperator): Cannot be applied to null.
4097         
4098         * expression.cs, report.cs: New warning.
4099         
4100         * typemanager.cs: Catch anonymous method type too.
4102 2007-12-23  Marek Safar  <marek.safar@gmail.com>
4104         A fix for bug #346379
4105         * expression.cs (UnaryMutator): Emit size of type for pointer mutator.
4107 2007-12-23  Marek Safar  <marek.safar@gmail.com>
4109         A fix for bug #347359
4110         * expression.cs (Invocation): Don't resolve already resolved expression.
4112 2007-12-23  Marek Safar  <marek.safar@gmail.com>
4114         A fix for bug #347189
4115         * class.cs (FixedField): Use non-dependent code only in the define phase.
4117 2007-12-23  Marek Safar  <marek.safar@gmail.com>
4119         A fix for bug #348076
4120         * ecore.cs (FieldExpr.DoResolve): Allow any variable based expression.
4122 2007-12-22  Marek Safar  <marek.safar@gmail.com>
4124         * ecore.cs (MethodGroupExpr.OverloadResolve): Set type arguments for
4125         discovered extension methods.
4127 2007-12-22  Marek Safar  <marek.safar@gmail.com>
4129         * ecore.cs, namespace.cs, expression.cs: Removed broken ResolveGeneric
4130         method.
4132 2007-12-21  Miguel de Icaza  <miguel@novell.com>
4134         * report.cs (ErrorMessage): Add support for using colors on
4135         terminals that support it. 
4137 2007-12-21  Marek Safar  <marek.safar@gmail.com>
4139         * ecore.cs: Use information about expanded params for error reporting.
4141 2007-12-21  Marek Safar  <marek.safar@gmail.com>
4143         * ecore.cs, generic.cs, delegate.cs: Refactoring of method overloading code
4144         and logic for params overloads.
4145         
4146 2007-12-15  Miguel de Icaza  <miguel@novell.com>
4148         * generic.cs (NullCoalescingOperator.CloneTo): implement this one,
4149         as this is also created from the parser.  Fixes #349034
4151 2007-12-12  Miguel de Icaza  <miguel@novell.com>
4153         * statement.cs (Throw.CloneTo): it is valid to have empty
4154         expressions for throw. 
4156 2007-12-03  Marek Safar  <marek.safar@gmail.com>
4158         * cs-parser.jay: Set delegate constraint parsing region correctly.
4160 2007-12-03  Marek Safar  <marek.safar@gmail.com>
4162         A fix for bug #345467
4163         * typemanager.cs (IsEqual): Compare generic parameters position only.
4164         
4165 2007-11-28  Marek Safar  <marek.safar@gmail.com>
4167         * expression.cs (BaseAccess): Type arguments can be null.
4169 2007-11-27  Raja R Harinath  <harinath@gmail.com>
4171         * statement.cs (Block.Resolve): Ensure flow-branching tree is
4172         consistent even when an error has occured.
4173         (Switch.Resolve): Likewise.
4175 2007-11-22  Marek Safar  <marek.safar@gmail.com>
4177         A fix for bug #334505
4178         * class.cs: Don't ignore InternalsVisibleTo attribute for internal
4179         overrides.
4180         
4181 2007-11-22  Marek Safar  <marek.safar@gmail.com>
4183         * ecore.cs, typemanager.cs, delegate.cs, expression.cs: The first of 
4184         refactorings required to resolve extension methods correctly when mixing
4185         generics and non-generics members.
4186         
4187 2007-11-20  Marek Safar  <marek.safar@gmail.com>
4189         A fix for bug #342584
4190         * convert.cs: Added not documented explicit IntPtr/UIntPtr to enum
4191         conversion.
4192         
4193 2007-11-19  Marek Safar  <marek.safar@gmail.com>
4195         A fix for bug #342512
4196         * delegate.cs: Use delegate argument expression when is available. Don't
4197         emit virtual call when class is sealed.
4198         
4199 2007-11-16  Marek Safar  <marek.safar@gmail.com>
4201         A fix for bug #325423
4202         * assign.cs (FieldInitializer): Use resolved expression for emit.
4203         
4204         * class.cs: Print less confusing error message.
4205         
4206 2007-11-16  Marek Safar  <marek.safar@gmail.com>
4208         * cs-tokenizer.cs: Removed GMCS ifdefs.
4209         
4210         * rootcontext.cs, report.cs: Report unavailable gmcs features used by
4211         mcs.
4212         
4213         * cs-parser.jay: Disabled nullable check.
4214         
4215         * generic-mcs: Copied more generic stuff.
4216                 
4217 2007-11-16  Marek Safar  <marek.safar@gmail.com>
4219         * gcs-parser.jay: Merged to cs-parser.jay.
4220         
4221         * generic.cs, typemanager.cs, cs-tokenizer.cs, linq.cs, Makefile
4222         * *.csproj, *.sources: Updated to use only jay parser file.
4224 2007-11-16  Marek Safar  <marek.safar@gmail.com>
4226         * gcs-parser.jay: Added nullable and default expression feature checks.
4227         
4228 2007-11-16  Marek Safar  <marek.safar@gmail.com>
4230         * gcs-parser.jay, cs-parser.jay, class.cs: Unified parameters parsing, 
4231         it fixes many TODOs and hidden bugs.
4232         
4233         * expression: Removed duplicate error check.
4235 2007-11-15  Marek Safar  <marek.safar@gmail.com>
4237         * gcs-parser.jay, statement.cs, decl.cs, ecore.cs: Try to resolve an
4238         implicitly type local variable only when it is used in a declaration.
4240 2007-11-15  Marek Safar  <marek.safar@gmail.com>
4242         * attribute.cs: Use CS0612 for empty strings.
4244 2007-11-14  Marek Safar  <marek.safar@gmail.com>
4246         * lambda.cs, statement.cs: Contextual return may act as a statement.
4248 2007-11-14  Marek Safar  <marek.safar@gmail.com>
4250         A fix for a regression cause by #324222
4251         * class.cs: Don't report unused even when it implements an interface.
4252         
4253 2007-11-13  Marek Safar  <marek.safar@gmail.com>
4255         A fix for bug #341205
4256         * ecore.cs, expression.cs: Method group expression cannot do static
4257         method access with an instance reference check before overloading takes
4258         a place.
4259         
4260 2007-11-13  Marek Safar  <marek.safar@gmail.com>
4262         A fix for bug #325359
4263         * class.cs: Use predictable name for automatically generated property.
4264         
4265 2007-11-12  Marek Safar  <marek.safar@gmail.com>
4267         A fix for bug #324996
4268         * expression.cs (Is): Handle case where D is nullable and T is not
4269         correctly.
4270         
4271         * generics.cs (Nullable.HasValue): Nullable HasValue expression.
4272         
4273 2007-11-12  Marek Safar  <marek.safar@gmail.com>
4275         * generic.cs, literal.cs, ecore.cs, class.cs, delegate.cs, const.cs,
4276         anonymous.cs, expression.cs, attribute.cs, codegen.cs, statement.cs:
4277         Flush small error reporting changes.
4278         
4279 2007-11-09  Marek Safar  <marek.safar@gmail.com>
4281         A fix for bug #324996
4282         * expression.cs: Rewrote Is expression implementation to work with
4283         generics, nullable types, anonymous method. A const result expression 
4284         uses existing infrastructure instead of custom not fully-featured one.
4285         
4286 2007-11-08  Marek Safar  <marek.safar@gmail.com>
4288         A fix for bug #340202
4289         * class.cs: Consider generics for volatile field.
4291 2007-11-08  Marek Safar  <marek.safar@gmail.com>
4293         A fix for bug #335594
4294         * expression.cs: Use conversion rules when handling string addition.
4295         
4296 2007-11-07  Marek Safar  <marek.safar@gmail.com>
4298         A fix for bug #336651
4299         * expression.cs: Fixed a crash when probing is on.
4300         
4301 2007-11-07  Marek Safar  <marek.safar@gmail.com>
4303         A fix for bug #324242
4304         * covert.cs: Added a conversion from any nullable-type with an 
4305         underlying enum-type to the type System.Enum.
4306         
4307 2007-11-07  Marek Safar  <marek.safar@gmail.com>
4309         A fix for bug #324222
4310         * class.cs: Report all non-used event fields.
4311         
4312 2007-11-07  Marek Safar  <marek.safar@gmail.com>
4314         A fix for bug #325161
4315         * cs-parser.jay, gcs-parser.jay, decl.cs: Implemented namespace alias
4316         qualifier for generic types.
4317         
4318 2007-11-07  Marek Safar  <marek.safar@gmail.com>
4320         A fix for bug #322971
4321         * expression.cs, ecore.cs: Added intermediate result value check for
4322         indexers. 
4323         
4324 2007-11-07  Marek Safar  <marek.safar@gmail.com>
4326         A fix for bug #324754
4327         * cs-parser.jay, gcs-parser.jay, class.cs: Try to create an interator
4328         when it was requested.
4330 2007-11-07  Marek Safar  <marek.safar@gmail.com>
4332         A fix for bug #325101
4333         * expression.cs: Do type not value comparison for `is' expression.
4335 2007-11-07  Marek Safar  <marek.safar@gmail.com>
4337         A fix for bug #320236
4338         * convert.cs: Don't apply user conversion on underlying target type.
4340 2007-11-06  Marek Safar  <marek.safar@gmail.com>
4342         * expression.cs: Don't use unresolved expression for error reporting.
4344 2007-11-06  Marek Safar  <marek.safar@gmail.com>
4346         A fix for bugs #337712, #324490
4347         * ecore.cs (MethodGroupExpr): Refactored to handle delegate method
4348         overloading resolution too.
4349         
4350         * delegate.cs: Uses MethodGroupExpr for overloading resolution. It makes
4351         the process consistent and more robust.
4352         
4353         * expression.cs, linq.cs, report.cs: Update.
4355 2007-11-02  Marek Safar  <marek.safar@gmail.com>
4357         A fix for bug #332909
4358         * attribute.cs: Resolve attributes in correct context using error
4359         handling procedure.
4360         
4361         * rootcontext.cs: Define Obsolete attribute members as core members.
4362         
4363 2007-11-02  Marek Safar  <marek.safar@gmail.com>
4365         * statement.cs: Removed unused methods.
4366         
4367 2007-10-31  Wade Berrier  <wberrier@novell.com>
4369         * Makefile:  reenable copy of gmcs.exe.config, but include it in EXTRA
4370         DIST (it doesn't get included because PROGRAM isn't defined to be gmcs
4371         during 'make dist')
4373 2007-10-31  Marek Safar  <marek.safar@gmail.com>
4375         A fix for bug #338102
4376         * decl.cs (CheckExistingMembersOverloads): Workaround issue with generic
4377         methods registered as non-generics.
4378         
4379 2007-10-31  Marek Safar  <marek.safar@gmail.com>
4381         A fix for bugs #337712, #324490
4382         * delegate.cs: Delegate covariance and contravariance is not allowed for
4383         value types.
4384         
4385 2007-10-31  Marek Safar  <marek.safar@gmail.com>
4387         A fix for bug #337719 
4388         * cs-tokenizer.cs: Restore identifier buffer when parsing contextual
4389         `from' keyword.
4390         
4391 2007-10-30  Marek Safar  <marek.safar@gmail.com>
4393         * Makefile (net_2_0_bootstrap/mcs.exe.config): Reverted copy gmcs.exe.config.
4395 2007-10-29  Marek Safar  <marek.safar@gmail.com>
4397         * cs-tokenizer.cs, gcs-parser.jay, driver.cs: Fixed parsing of nested
4398         query expressions.
4400 2007-10-29  Raja R Harinath  <rharinath@novell.com>
4402         * Makefile (net_2_0_bootstrap/mcs.exe.config): Copy gmcs.exe.config.
4404 2007-10-29  Marek Safar  <marek.safar@gmail.com>
4406         A fix for bug #334652
4407         * ecore.cs (MethodGroupExpr.OverloadResolve): Do also lookup for
4408         extension methods when we have not found the best candidate in normal
4409         container.
4411 2007-10-27  Marek Safar  <marek.safar@gmail.com>
4413         * AssemblyInfo.cs: Keep up-to-date.
4415 2007-10-27  Marek Safar  <marek.safar@gmail.com>
4417         * Makefile: Fixed generics compiler name.
4418         
4419 2007-10-27  Marek Safar  <marek.safar@gmail.com>
4421         * lambda.test: removed, lambda parsing is done differently.
4422         
4423         * gen-il.cs, gen-treedump.cs, old-code.cs : Obsolete.
4425 2007-10-27  Gert Driesen  <drieseng@users.sourceforge.net>
4427         * Makefile: Removed dependency on gmcs.exe.config. Fixes build.
4429 2007-10-27  Marek Safar  <marek.safar@gmail.com>
4431         * Makefile, *.sources : All C# compilers are in mcs folder.
4432         
4433         * *.cs: Use existing 2_1 define for smcs.
4435 2007-10-26  Marek Safar  <marek.safar@gmail.com>
4437         A fix for bug #335847
4438         * assign.cs, expression.cs: Couple of changes to avoid creating a
4439         temporary variable for each object initializer assignment statement. It
4440         simplifies struct initialization too, otherwise two temporary variables
4441         would be required.
4442         Implemented optimization of redundant default element initializers.
4443         
4444 2007-10-25  Marek Safar  <marek.safar@gmail.com>
4446         A fix for bug #336766
4447         * expression.cs (Class.CheckBase): Use generic name when method is
4448         generic.
4449         
4450 2007-10-25  Marek Safar  <marek.safar@gmail.com>
4452         A fix for bug #334737
4453         * expression.cs (IndexerAccess.EmitAssign): Emit local temporary
4454         variable and not variable argument for prepared copies.
4456 2007-10-24  Marek Safar  <marek.safar@gmail.com>
4458         A fix for bug #325110
4459         * class.cs, expression.cs, attribute.cs: Use open generic method when
4460         checking conditional attribute.
4461         
4462 2007-10-24  Marek Safar  <marek.safar@gmail.com>
4464         * report.cs, cs-tokenizer.cs, class.cs, cs-parser.jay, anonymous.cs, 
4465         expression.cs, statement.cs: Renamed method FeatureIsNotISO to
4466         FeatureIsNotAvailable.
4468 2007-10-24  Marek Safar  <marek.safar@gmail.com>
4470         ** C# 3.0 Partial methods
4471         
4472         * cs-tokenizer.cs, support.cs, class.cs, decl.cs: Implemented partial
4473         methods support. Because of member cache issue with generics only
4474         non-generics partial methods are fully supported.
4475         
4476 2007-10-23  Marek Safar  <marek.safar@gmail.com>
4477         
4478         * class.cs, decl.cs: Rewrote member overloads check to cope with 
4479         generics and to use member cache for member checking. It also improves
4480         performance and fixes remaining overloads issues.
4481         
4482 2007-10-20  Marek Safar  <marek.safar@gmail.com>
4483         
4484         * class.cs, const.cs, decl.cs, delegate.cs, enum.cs, generic.cs,
4485         roottypes.cs, typemanager.cs:
4486                 
4487         A member cache creation logic changed to add members immediately and
4488         not rely on fallback. The member cache is now only prefered way
4489         how to access and find type declaration members. It saves 5 MB of memory
4490         during MWF compilation and makes code ready for more optimizations and
4491         clean-ups, it's also a pre-requirement for partial methods.
4492         
4493 2007-10-18  Raja R Harinath  <harinath@gmail.com>
4495         * ecore.cs (Expression.Error_ValueCannotBeConverted): Add special
4496         handling for generic parameters.
4498 2007-10-15  Marek Safar  <marek.safar@gmail.com>
4499         
4500         * class.cs (FixedField): Removed redundant volatile check.
4501         
4502 2007-10-15  Marek Safar  <marek.safar@gmail.com>
4503         
4504         * class.cs, decl.cs: Fixed overload members verification to do only one
4505         check per possible collision.
4506         
4507 2007-10-13  Marek Safar  <marek.safar@gmail.com>
4508         
4509         A fix for bug #325478
4510         * anonymous.cs (AnonymousContainer.Compatible): Merge are flags together
4511         and create only one disposable flags container.
4512         
4513 2007-10-12  Marek Safar  <marek.safar@gmail.com>
4514         
4515         A fix for bug #332442 by Alexandre Gomes <alexmipego@gmail.com>
4516         * statement.cs (Fixed): Fixed variables cloning.
4517         
4518 2007-10-12  Marek Safar  <marek.safar@gmail.com>
4519         
4520         A fix for bug #333342
4521         * class.cs (EventField): Don't mark value type event as synchronized. 
4522         
4523 2007-10-12  Marek Safar  <marek.safar@gmail.com>
4524         
4525         * ecore.cs, anonymous.cs (MethodGroupExpr): Use score from type
4526         inference to identify best candidate method correctly.
4527         (ProperyExpr): A range variable is read only and cannot be modified.
4528         
4529 2007-10-11  Marek Safar  <marek.safar@gmail.com>
4530         
4531         * ecore.cs, delegate.cs (MethodGroupExpr): Refactored best candidate
4532         logic to identify best candidate method correctly.
4533         
4534 2007-10-11  Marek Safar  <marek.safar@gmail.com>
4535         
4536         * location.cs (Equals, GetHashCode): Removed.
4537         
4538 2007-10-11  Marek Safar  <marek.safar@gmail.com>
4539         
4540         * report.cs: Implemented message recorder. It is used mainly for lambda
4541         expressions to capture otherwise swallowed error messages.
4542         
4543         * anonymous.cs, lambda.cs.cs: Do full parameters check.
4545         * ecore.cs (ExtensionMethodGroup): Report binding failure at the botton
4546         and not at the top.
4547         (MethodGroupExpr.DoResolve): Use message recorder for error handling.
4548                 
4549         * expression.cs (MemberAccess): Always report lookup failure.
4550         
4551         * location.cs: Implemented Equals, GetHashCode.
4552         
4553         * statement.cs (Return.DoResolve): Fixed hardcoded error argument.
4554         
4555 2007-10-10  Jb Evain  <jbevain@novell.com>
4557         * codegen.cs: re-enable assembly version check.
4559 2007-10-09  Marek Safar  <marek.safar@gmail.com>
4560         
4561         * report.cs, anonymous.cs, driver.cs, expression.cs: Added few ISO-2
4562         checks.
4563         
4564         * namespace.cs (UsingAlias): Do correct version check.
4565         
4566 2007-10-08  Marek Safar  <marek.safar@gmail.com>
4567         
4568         * expresison.cs, ecore.cs: Issue extension method error message when
4569         appropriate.
4570         
4571         * rootcontext.cs: Added ISO_2 compiler mode option.
4573 2007-10-08  Marek Safar  <marek.safar@gmail.com>
4574         
4575         * expresison.cs (UnaryMutator.ResolveOperator): Print more useful error
4576          message.
4577         
4578 2007-10-08  Marek Safar  <marek.safar@gmail.com>
4579         
4580         * attribute.cs (GetString, GetBoolean): Work with both literal and
4581         constant.
4582         
4583         * ecore.cs, expresison.cs, delegate.cs (Invocation, MethodGroupExpr):
4584         Moved method overload specific methods to MethodGroupExpr.
4585         
4586         (IndexerAccess): Re-wrote resolving mechanism, fixed many issues and
4587         it should be less memory consuming.
4588         
4589 Mon Oct 8 09:29:15 CEST 2007 Paolo Molaro <lupus@ximian.com>
4591         * codegen.cs: remove the assembly version check until the buildbot is
4592         fixed.
4594 2007-10-07  Jb Evain  <jbevain@novell.com>
4596         * attribute.cs (Attribute.GetString): if the value
4597         expression is a StringConstant, return its string value.
4599 2007-10-07  Jb Evain  <jbevain@novell.com>
4601         * typemanager.cs: add `assembly_version_attribute_type`.
4602         * codegen.cs: on attribute emission, check that the
4603         AssemblyVersionAttribute doesn't overflow.
4605 2007-10-05  Marek Safar  <marek.safar@gmail.com>
4606         
4607         A fix for bug #324677
4608         * anonymous.cs, decl.cs: Yes another anonymous container hack. Overwrite
4609         parent container of a scope container with currently resolved one. 
4610         
4611 2007-10-05  Marek Safar  <marek.safar@gmail.com>
4612         
4613         A fix for bug #325534
4614         * class.cs (Invocation.DoResolve): Check invocation of object finalizer
4615         only.
4616         
4617 2007-10-05  Marek Safar  <marek.safar@gmail.com>
4618         
4619         A fix for bug #327504
4620         * class.cs (Operator.Define): Refactored implicit and explicit user
4621         operator conversion rules.
4622         
4623 2007-10-05  Marek Safar  <marek.safar@gmail.com>
4624         
4625         A fix for bug #327520
4626         * ecore.cs (ExtensionMethodGroupExpr): Emit resolved extension argument.
4627         
4628 2007-10-04  Marek Safar  <marek.safar@gmail.com>
4629         
4630         A fix for bug #328022
4631         * class.cs (MethodData.Define): Use correct method to check whether
4632         a method implementents an accessor.
4633         
4634 2007-10-04  Marek Safar  <marek.safar@gmail.com>
4635         
4636         A fix for bug #330069
4637         * statement.cs (Fixed.Resolve): Read the first array element only when
4638         an array is instantiated. 
4639         
4640 2007-10-04  Marek Safar  <marek.safar@gmail.com>
4641         
4642         * expression.cs, assign.cs, generics.cs: Print correct operator when
4643         compound assignment is used.
4644         
4645 2007-10-04  Marek Safar  <marek.safar@gmail.com>
4646         
4647         A fix for bug #325841
4648         * expression.cs (ArrayAccess): Use full argument cloning only for
4649         string compound concatenation.
4650         
4651 2007-10-03  Marek Safar  <marek.safar@gmail.com>
4652         
4653         A fix for bug #328774
4654         * ecore.cs (FieldExpr.EmitAssign): Fixed string concatenation compound
4655         assignment.
4656         (PropertyExpr.EmitAssign): Fixed string concatenation compound
4657         assignment.
4659 2007-10-03  Raja R Harinath  <rharinath@novell.com>
4661         Fix #328490
4662         * ecore.cs (SimpleName.DoSimpleNameResolve): Handle Property and
4663         Event accessibility checks here.  Remove some bogus code that
4664         accidently made GenericMethods work.
4665         (PropertyExpr.IsAccessibleFrom, EventExpr.IsAccessibleFrom): New.
4667 2007-09-25  Marek Safar  <marek.safar@gmail.com>
4668         
4669         * expression.cs (ArrayCreation): Fixed cloning of an implicit types.
4670         
4671         * statement.cs (Block): Refactored AddVariable to allow error handling
4672         customization.
4673         
4674         * generic.cs: New stub.
4675         
4676 2007-09-23  Marek Safar  <marek.safar@gmail.com>
4677         
4678         * anonymous.cs, codegen.cs: Changed InferReturnType to be EmitContext
4679         flag.
4680         
4681 2007-09-17  Marek Safar  <marek.safar@gmail.com>
4683         * class.cs: Use partial container to record whether any partial part
4684         contains static field initializer and therefore default contructor has
4685         to be defined.
4686         
4687 2007-09-14  Marek Safar  <marek.safar@gmail.com>
4689         * class.cs (TypeContainer.AddPartial): Fixed an issue reported on
4690         mono-list when only one of two partial parts has defined accessibility
4691         modifier.
4692         
4693 2007-09-14  Marek Safar  <marek.safar@gmail.com>
4695         A fix for bug #82845
4696         
4697         * class.cs (TypeContainer): Set correct resolve context for all field
4698         initializers.
4699         
4700 2007-09-13  Marek Safar  <marek.safar@gmail.com>
4702         * assign.cs: Fixed a crash when field is resolved twice with an error.
4703         
4704         * codegen.cs: Changed InFieldInitializer to be flag.
4705         
4706         * anonymous.cs, ecore.cs, expression.cs: Update after
4707         IsInFieldInitializer rename.
4708         
4709         * const.cs: Removed unused parameter.
4710         
4711         * class.cs: Changed the way how we resolve and emit field initializers.
4712         The field initilizers have to have access to contructor block to emit
4713         compiler generated code.
4715 2007-09-13  Marek Safar  <marek.safar@gmail.com>
4717         * expression.cs (MemberAccess.DoResolve): DeclSpace is broken by
4718         generics use TypeContainer instead.
4719         
4720 2007-09-12  Marek Safar  <marek.safar@gmail.com>
4721         
4722         * generic.cs (TypeInferenceContext.InflateGenericArgument): Stub.
4724         * lambda.cs (ResolveParameters): Use more powerful
4725         InflateGenericArgument.
4726         
4727         * parameters.cs: Better exception message.
4728                 
4729 2007-09-10  Marek Safar  <marek.safar@gmail.com>
4731         * anonymous.cs (AnonymousMethodExpression.CompatibleChecks): Report
4732         correct expression block type. 
4733         
4734         * ecore.cs (Expression.Error_MemberLookupFailed): Made virtual.
4735         
4736         * expression.cs (Invocation): Extracted method group resolve to
4737         DoResolveOverload.
4738         
4739 2007-09-07  Marek Safar  <marek.safar@gmail.com>
4741         * ecore.cs (Expression.MemberLookupFinal): Removed unused loc parameter.
4742         (MethodGroupExpr.ResolveGeneric): Use existing method group instance.
4743         
4744         * expression.cs (MemberAccess.DoResolve): Uses generic resolver for
4745         generic extension methods.
4747 2007-09-06  Marek Safar  <marek.safar@gmail.com>
4749         A fix for bug #82676 (Do I get it right now?)
4750         * convert.cs (Binary.ResolveOperator): An interface is converted to the
4751         object before a standard conversion is applied.
4752         
4753 2007-09-06  Marek Safar  <marek.safar@gmail.com>
4755         * convert.cs (ImplicitReferenceConversionCore): Reverted wrong fix of
4756         #82676.
4757         
4758 2007-09-05  Marek Safar  <marek.safar@gmail.com>
4760         A fix for bug #82676
4761         * convert.cs (ImplicitReferenceConversionCore): Check both sides for
4762         non-generic interface types.
4763         
4764 2007-09-05  Marek Safar  <marek.safar@gmail.com>
4766         A fix for bug #82690
4767         * ecore.cs (PropertyExpr.EmitAssign): Leave a copy does just that.
4768         
4769 2007-09-05  Marek Safar  <marek.safar@gmail.com>
4771         A fix for bug #82571
4772         * anonymous.cs (AnonymousMethod.DoCreateMethodHost): Use internal 
4773         modifier for container based methods.
4774         
4775 2007-09-05  Marek Safar  <marek.safar@gmail.com>
4777         A fix for bug #82676
4778         * convert.cs (ImplicitReferenceConversionCore): From any class-type S to
4779         any interface-type T means to any of interface type T.
4781 2007-09-04  Marek Safar  <marek.safar@gmail.com>
4783         * namespace.cs: We have 2 versions of System.Core assembly.
4785 2007-09-04  Marek Safar  <marek.safar@gmail.com>
4787         A fix for bug #82652
4788         * class.cs (Class.GetClassBases): Compare types and not expressions.
4790 2007-09-04  Marek Safar  <marek.safar@gmail.com>
4792         A fix for bug #82620
4793         * expression.cs (Invocation.EmitArguments): Duplicate params arguments
4794         actually never worked before.
4795         (IndexerAccess): Emit prepared arguments before they are modified.
4796         
4797 2007-09-04  Marek Safar  <marek.safar@gmail.com>
4799         A fix for bug #82563
4800         * assign.cs: Revert wrong fix.
4801         
4802         * expression.cs (VariableReference.EmitAssign): Handle ref reference
4803         correctly.
4804         (ArrayAccess): Changed the way we emit compound (prepared) assignments.
4805         Instead of ldelema/stdind we have to use temporary variables to handle
4806         cases like String.Concat (params string[]).
4807         
4808 2007-08-31  Marek Safar  <marek.safar@gmail.com>
4810         * class.cs: EmitAttributes to Emit rename.
4811         
4812         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Parent can be
4813         null.
4814         (MemberCore.HasClsCompliantAttribute): Don't depend on 
4815         GetClsCompliantAttributeValue execution.
4816         
4817 2007-08-31  Marek Safar  <marek.safar@gmail.com>
4819         * anonymous.cs: Use shorter type prefix.
4820         
4821         * ecore.cs (SimpleName.DoSimpleNameResolve): Use transparent identifiers
4822         when exist.
4823         
4824         * expression.cs (LocalVariableReference.DoResolveBase): Don't capture
4825         variables when probing is on.
4826         
4827         * statement.cs (LocaLInfo.Clone): Clone correctly resolved and 
4828         unresolved variables.
4829         (TopLevelBlock.GetTransparentIdentifier): Default implementation doesn't
4830         handle transparent identifiers.
4831         
4832 2007-08-26  Marek Safar  <marek.safar@gmail.com>
4834         * attribute.cs (IsClsCompliant): Add nullable types test.
4835         
4836 2007-08-24  Atsushi Enomoto  <atsushi@ximian.com>
4838         * doc.cs : catch other types of exception than XmlException to
4839           report CS1570. Fixed bug #82565.
4841 2007-08-23  Marek Safar  <marek.safar@gmail.com>
4843         * anonymous.cs (AnonymousMethodExpressin.ExplicitTypeInference): 
4844         The number of delegate parameters has to match.
4845         (AnonymousMethodExpressin.VerifyParameterCompatibility): Handles generic
4846         arrays.
4848 2007-08-21  Marek Safar  <marek.safar@gmail.com>
4850         * anonymous.cs (AnonymousMethod): Generate private anonymous method
4851         to fix problem with private arguments.
4853 2007-08-20  Marek Safar  <marek.safar@gmail.com>
4855         * anonymous.cs (AnonymousTypeClass): An anonymous type can be empty.
4856         
4857         * decl.cs (MemberName): Ignore generic type with no generic arguments. 
4858         
4859         * expression.cs (AnonymousTypeDeclaration): An anonymous type can be
4860         empty. Add cloning suport.
4861         
4862         * roottypes.cs (GetAnonymousType): Fixed argument comparison logic.
4864 2007-08-20  Marek Safar  <marek.safar@gmail.com>
4866         * convert.cs, ecore.cs, expression.cs, literal.cs: Use factory method 
4867         to create EmptyCast. It handles EmptyConstantCast specialization for
4868         constants.
4869         
4870 2007-08-18  Marek Safar  <marek.safar@gmail.com>
4872         * expression.cs (Binary.is_unsigned): Handle unsafe types too.
4873         (EmitArrayArgument): One routine for array arguments.
4874         (ArrayCreation.MakeByteBlob): Fixed an array alignment. 
4875         
4876 2007-08-17  Marek Safar  <marek.safar@gmail.com>
4878         * cs-tokenizer.cs (GetKeyword): Handle from keyword in a different way.
4880 2007-08-17  Marek Safar  <marek.safar@gmail.com>
4882         * anonymous.cs: MemberLookupFinal update.
4884         * class.cs (ConstructorInitializer): Is expression based.
4885         
4886         * delegate.cs: MethodGroupExpr update.
4887         
4888         * ecore.cs  (Error_MemberLookupFailed): Improved to report better error
4889         messages.
4890         (Error_MemberLookupFailed): Customizable error override.
4891         (MethodGroupExpr): Keep queried type for later usage.
4892         (MethodGroupExpr.OverloadResolve): Catch errors related to overload
4893         resolve.
4894         
4895         * expression.cs: Error_MemberLookupFailed refactoring.
4896         (New.DoResolve): Resolve as much as possible.
4897         (ElementInitializer.Error_MemberLookupFailed): Object initializer
4898         customization for invalid member types.
4900         * statement.cs: MethodGroupExpr update.
4901         
4902 2007-08-16  Marek Safar  <marek.safar@gmail.com>
4904         * modifier.cs (Check): Check all modifiers and not only accessibility
4905         ones.
4907 2007-08-16  Marek Safar  <marek.safar@gmail.com>
4909         * ecore.cs (Expression.Error_ValueCannotBeConverted): Report always a
4910         type and not an expression.
4912 2007-08-16  Marek Safar  <marek.safar@gmail.com>
4914         * statement.cs (Catch.Clone): Type and variable can be null.
4916 2007-08-16  Marek Safar  <marek.safar@gmail.com>
4918         A fix for bug #81979
4919         * assign.cs (Assign.Emit): Prepare arguments for string concatenation.
4920         I am really not sure whether this is the best fix.
4921         
4922         * expression.cs (VariableReference.EmitAssign): Do prepare_load test
4923         only once.
4924         
4925 2007-08-14  Marek Safar  <marek.safar@gmail.com>
4927         ** C# 3.0 Object and collection initializers (major re-write)
4928         
4929         * assign.cs (DoResolve): Initializers are not assign related.
4930         
4931         * codegen.cs (EmitContext.CurrentInitializerVariable): Holds a varible
4932         used during collection or object initialization.
4933         
4934         * expression.cs (Error_InvalidArguments): Add initializers specific
4935         messages. More will come later because it requires some general
4936         refactoring.
4937         (New.DoResolve): Better error handling for unsafe types.
4938         (EmptyExpressionStatement): New class.
4939         (ElementInitializer): An object initializer expression.
4940         (CollectionElementInitializer): A collection initializer expression.
4941         (CollectionOrObjectInitializers): A block of object or collection
4942         initializers.
4943         (NewInitialize): New expression with element/object initializers.
4944         
4945         * statement.cs: Reverted object/collection initializer hacks.
4946         
4947         * typemanager.cs (CSharpName): Filter __arglist type.
4948         
4949 2007-08-09  Marek Safar  <marek.safar@gmail.com>
4951         ** C# 3.0 Anonymous Types (update to the latest standard)
4952         
4953         * expression.cs (Binary.ResolveOperator): Threat all null based types
4954         same.
4955         (AnonymousTypeDeclaration): Renamed from AnonymousType and simplified.
4956         (AnonymousTypeParameter): Updated.
4957         
4958         * anonymous.cs (CompilerGeneratedClass): Add custom name overload.
4959         (AnonymousTypeClass): New anonymous type container.
4960         
4961         * class.cs (AddField): Return operation result.
4962         
4963         * generic.cs: Another empty TypeArguments overload.
4964         
4965         * roottypes.cs (AddAnonymousType, GetAnonymousType): Anonymous types
4966         are stored at top of normal hierarchy.
4967         
4968         * typemanager.cs (CSharpName): Filter anonymous types.
4969         
4970 2007-08-09  Marek Safar  <marek.safar@gmail.com>
4972         * expression.cs (StringConcat.Append): Handle 3 and more concatenation
4973         as single Concat call. How could we miss that :-(
4974         
4975 2007-08-08  Marek Safar  <marek.safar@gmail.com>
4977         * expression.cs (ArrayCreation.CloneTo): Allocate exact size.
4978         
4979 2007-08-07  Miguel de Icaza  <miguel@novell.com>
4981         * expression.cs: Fix the previous commit, the creation of the
4982         arguments array list needs also to be conditional on the arguments
4983         not being null.
4985         * class.cs: Add a little bit of help to help narrow down problems.
4987         * expression.cs (ArrayCreation.CloneTo): Argument can be null, do
4988         not try to copy in that case. 
4990         * driver.cs: When building SMCS, include a new different set of
4991         default assemblies here.   Do this here so we can control whether
4992         to include the default assemblies with /noconfig.
4994 2007-08-03  Marek Safar  <marek.safar@gmail.com>
4996         A fix for bug #81979
4997         * expression.cs (TypeOf.GetAttributableValue): Check for type arguments
4998         only.
5000 2007-08-03  Marek Safar  <marek.safar@gmail.com>
5002         A fix for bug #82300
5004         * anonymous.cs (AnonymousContainer.Define): Don't define anything when
5005         we are in probing scope.
5007 2007-08-03  Marek Safar  <marek.safar@gmail.com>
5009         A fix for bug #82301
5011         * statement.cs (Catch.CloneTo): Clone blocks in the right order.
5012         (Statement.CloneTo): Clone and not map children blocks.
5014 2007-08-03  Marek Safar  <marek.safar@gmail.com>
5016         A fix for bug #82299
5018         * expression.cs (LocalVariableReference.CloneTo): Remap local info
5019         variable too.
5020         
5021         * statement.cs (Statement.CloneTo): Clone variables before statements
5022         to allow remaping of local variables.
5024 2007-08-03  Marek Safar  <marek.safar@gmail.com>
5026         A fix for bug #82296
5028         * anonymous.cs,
5029         * report.cs: Log crash details for future clone problems.
5030         
5031         * statement.cs (Return.Clone): Don't clone non-existent expression.
5033 2007-08-03  Raja R Harinath  <harinath@gmail.com>
5035         * class.cs (TypeContainer.AddBasesForPart): Make virtual.
5036         (Class.AddBasesForPart): Move CS0537 check here from ...
5037         * cs-parser.jay (class_declaration): ... here.  Move calling of
5038         'AddBasesForPart' to ...
5039         (class_bases): ... here.
5040         (struct_declaration, interface_declaration): Update to changes.
5042 2007-08-02  Marek Safar  <marek.safar@gmail.com>
5044         A fix for bug #81923
5046         * statement.cs (Using.ResolveLocalVariableDecls): Only non-user implicit
5047         conversion is allowed.
5049 2007-08-02  Marek Safar  <marek.safar@gmail.com>
5051         A fix for bug #81564
5053         * ecore.cs (EventExpr): Add IsBase handling.
5055         * expression.cs (BaseAccess.CommonResolve): Events can use base accessor
5056         too.    
5057         
5058 2007-08-02  Raja R Harinath  <harinath@gmail.com>
5060         Reduce some differences between cs-parser.jay in mcs/ and gmcs/.
5061         * cs-parser.jay: Some whitespace cleanups.
5062         (current_delegate): New.
5063         (type_name): New.
5064         (struct_declaration): Make similar to gmcs/cs-parser.jay -- add
5065         a dummy code block, and use 'type_name' instead of 'member_name'.
5066         (interface_declaration, class_declaration): Likewise.
5067         (delegate_declaration): Likewise.  Rearrange slightly and use
5068         'current_delegate'.
5069         * cs-tokenizer.cs (handle_where): Rename from handle_constraints.
5070         (GetKeyword): Update to change.  Use '!foo' instead of 'foo == false'.
5072 2007-08-02  Marek Safar  <marek.safar@gmail.com>
5074         A fix for bug #82039
5076         * ecore.cs (TypeLookup.GetSignatureForError): Use name when type is not
5077         available.
5079         * typemanager.cs (CSharpName): Split to string overload.
5081 2007-08-02  Marek Safar  <marek.safar@gmail.com>
5083         * expression.cs,
5084         * report.cs: Updated warning CS0472.
5086 2007-08-01  Marek Safar  <marek.safar@gmail.com>
5088         A fix for bug #82181
5089         * cs-parser.jay,
5090         * cs-tokenizer.cs: Ignore partial keyword inside block expression.
5092 2007-08-01  Marek Safar  <marek.safar@gmail.com>
5094         A fix for bug #82277
5095         * statememnt.cs (Block.Clone): Don't clone explicit blocks twice.
5097 2007-08-01  Marek Safar  <marek.safar@gmail.com>
5099         ** C# 3.0 Type Inference (major bits are working)
5100         
5101         * anonymous.cs (AnonymousMethodExpression): Removed refactored fields.
5102         (.ImplicitStandardConversionExists): Uses compatible.
5103         (.ExplicitTypeInference): Infers type arguments based on explicit arguments
5104         (.InferReturnType): New method.
5105         (.Compatible): Refactored.
5106         (.ResolveParameters): Uses factory to create resolved parameters.
5107         (.CompatibleMethod): Add probing mode support.
5108         (AnonymousContainer): Removed unused fields. Split Define and Resolve to
5109         clearly distinguish between 2 different operations.
5110         (LambdaMethod): Moved to lambda.cs.
5111         (AnonymousMethod): Removed unused fields and methods.
5112         (AnonymousDelegate): Simplified.
5113         
5114         * codegen.cs (ResolveTopBlock): Updated renamed Resolve to Define.
5115         
5116         * convert. cs (ImplicitConversionStandard): Compatible works differently.
5117         
5118         * delegate.cs (Delegate): New mehods to reduce code duplication.
5119         (.GetConstructor): New method.
5120         (.GetInvokeMethod): New method.
5121         (DelegateCreation): Updated.
5122         
5123         * ecore.cs (ResolveOverloadExtensions): Don't crash when extension method
5124         does not exist.
5125         (OverloadResolve): Made probing little bit faster.
5126         
5127         * expression.cs (ParameterReference.DoResolveLValue): Reference can be null
5128         when probing is on.
5129         
5130         * generic.cs (TypeInferenceContext): Dummy implementation.
5131         
5132         * iterators.cs: Updated after Resolve/Define rename.
5133         
5134         * lambda.cs (LambdaExpression)
5135         (.ResolveParameters): Handles both type of arguments and type inference too.
5136         
5137         * parameter.cs (ImplicitLambdaParameter.Resolve): Sanity check.
5138         (InflateTypes): Updated.
5139         
5140         * support.cs (InflateTypes): Changed signature and updated.
5141         
5142         * typemanager.cs (LookupMemberCache): Better dynamic type check.
5143         (MemberLookup_FindMembers): More MS tricks.
5144         (GetParameterData): Ditto.
5145         (GetDelegateParameters): Uses quick path for dynamic types.
5146         
5147 2007-08-01  Marek Safar  <marek.safar@gmail.com>
5149         * class.cs (MethodData.Define): EmitContext is required for generic stuff
5150         only.
5152 2007-07-31  Marek Safar  <marek.safar@gmail.com>
5154         * statement.cs (ProcessParameters): Don't crash when parameters have wrong
5155         syntax.
5156         
5157 2007-07-26  Jb Evain  <jbevain@novell.com>
5159         * typemanager.cs (TypeManager.GetConstructor): Add a method overload
5160         which takes a boolean 'report_errors', similar to the GetMethod.
5161         (InitCodeHelpers): StructLayoutAttribute.ctor(int16) is not visible
5162         in .net 2.1, do not report errors here.
5164         * typemanager.cs (TypeManager.InitCoreTypes): System.ArgIterator,
5165         System.Runtime.CompilerServices.RequiredAttributeAttribute and
5166         System.Runtime.CompilerServices.TypeForwardedToAttribute are internal
5167         in .net 2.1.
5169         * typemanager.cs (TypeManager.InitCoreTypes): Move the resolution
5170         of the type InternalsVisibleToAttribute before the first call
5171         to CoreLookupType which is allowed to fail (third boolean parameter
5172         to true). Because, during the resolution for a type that is not
5173         immediately found, we try to check if the type is not defined in
5174         a friend assembly, and to do so, we need the
5175         InternalVisibleToAttribute.
5177 2007-07-23  Miguel de Icaza  <miguel@novell.com>
5179         * expression.cs (Binary): Add support for the brain-dead CSC 2.x
5180         feature that allows structs to be compared against null and inline
5181         the result as true or false.
5183         Notice that the same code is not permitted inside a generic block
5184         of code that would do:
5186         class Foo<T> where T : struct {
5187             bool Eval (T x)
5188             {
5189                  return x == null;
5190             }
5191         }
5193         It is only allowed if the type of T is not bound (no where
5194         clause).   In my opinion, this CSC 2 behavior is broken but people
5195         seem to be using it (IronRuby does, a few bug reports on bugzilla
5196         have it and some people have complained about it).
5198         All of the users that depend on this behavior have code that is
5199         very likely broken. 
5200         
5201         * report.cs (Warning, Error): make these take object arguments,
5202         not strings, as that allows us to take advantage of Format.
5204 2007-07-20  William Holmes  <billholmes54@gmail.com>
5206         * decl.cs: Changed MemberName.CountTypeArguments to also check the 
5207           Left member variable for the Count.
5208         * doc.cs: Changed DocUtil.GetMethodDocCommentName to call 
5209           MemberName.CountTypeArguments to avoid a NRE. 
5211         This code is contributed under the MIT X11 license
5213 2007-07-18  Marek Safar  <marek.safar@gmail.com>
5215         * cs-tokenizer.cs: Improved lambda parsing and removed old code.
5217 2007-07-18  Atsushi Enomoto  <atsushi@ximian.com>
5219         * doc.cs : generic method arguments are written as ``x while generic
5220           type arguments are `x. Combined with the previous change, fixed bug
5221           #79706.
5223 2007-07-18  Raja R Harinath  <rharinath@novell.com>
5225         Fix #82120
5226         * expression.cs (Binary.ResolveOperator): When converting
5227         'a + (- b)' to 'a - b', ensure that the unary '-' is discarded.
5229 2007-07-18  Atsushi Enomoto  <atsushi@ximian.com>
5231         * doc.cs : when T: or whatever x: is specified, it does not really
5232           check the doc comment's syntax correctness. Fixed bug #82006.
5234 2007-07-18  Marek Safar  <marek.safar@gmail.com>
5236         * anonymous.cs (AnonymouseMethodExpression): Refactored to work with
5237         LambdaExpression better.
5238         
5239         * cs-tokenizer.cs: Changed a way how we detect lambda parameters.
5240         
5241         * driver.cs (LambdaTypeParseTest): Removed, tested method is gone.
5242         
5243         * ecore.cs (Expression.MemberLookupFailed): Don't show currect context
5244         as it can be generated.
5245         
5246         * expression.cs (Invocation.Error_InvalidArguments): Show correct
5247         modifiers.
5248         
5249         * lambda.cs (LambdaExpression): Refactored to share same code with
5250         AnonymousMethodExpression.
5251         
5252 2007-07-17  Marek Safar  <marek.safar@gmail.com>
5254         * anonymous.cs (MakeName): Include host name for easier debugging.
5255         (LambdaMethod): New class for lambda spcecific stuff.
5256         
5257         * attribute.cs: Set EmitContext return type.
5259         * class.cs: Set EmitContext return type.
5260         
5261         * codegen.cs (EmitContext): Return type cannot be null to stop messing
5262         with null/void meaning.
5263         
5264         * iterators.cs (ContainerType): Implemented.
5265         
5266         * rootcontext.cs: Set value of TypeManager.bool_type at early stage.
5267         
5268         * statement.cs (Return): Updated to lambda expressions.
5269         (Block.CloneTo): Parent can be null.
5270                 
5271 2007-07-13  Marek Safar  <marek.safar@gmail.com>
5273         A fix for bug #81917
5274         * attribute.cs (AttributeTester.GetFixedBuffer): More robust testing.
5275         
5276         * class.cs (FixedField): Check whether field is in unsafe scope.
5278         * ecore.cs (FieldExpr.DoResolve): Create fixed buffer expression here.
5279         (FieldExpr.Emit): Fixed buffers cannot be volatile.
5281         * expression.cs (ElementAccess.Resolve): Move fixed buffers resolve to
5282         FieldExpr.
5283         
5284         * statement.cs (Fixed.Resolve): Simplified fixed buffers.
5285                 
5286 2007-07-13  Marek Safar  <marek.safar@gmail.com>
5288         * cs-tokenizer.cs, class.cs, decl.cs, driver.cs, namespace.cs,
5289         rootcontext.cs, expression.cs, statement.cs: Updated to use WarningLevel
5290         from Report class.
5292 2007-07-13  Marek Safar  <marek.safar@gmail.com>
5294         * ecore.cs (FieldExpr.AddressOf): Less confusing warning message.
5295         
5296 2007-07-13  Marek Safar  <marek.safar@gmail.com>
5298         * anonymous.cs (AnonymousMethodExpression): Parameters are r/o.
5299         (AnonymousContainer.ResolveNoDefine): Another ec to aec flag conversion.
5300         
5301         * codegen.cs(EmitContext): Add ProbingMode flag.
5302         
5303         * delegate.cs (DelegateInvocation): Set few instance variables as r/o.
5304         
5305         * driver.cs: For now set both warning values.
5306         
5307         * ecore.cs (SimpleName): Name is readonly.
5308         (MethodGroup.OverloadResolve): One quick path for probing.
5309         
5310         * expression.cs (Unary): Set Oper r/o.
5311         (Binary): Set Oper r/o.
5312         (ParameterReference): Set few instance variables as r/o.
5313         (ParameterReference.DoResolveBase): Don't capture aruments when 
5314         the probing is on.
5315         (Invocation.CloneTo): Fixed typo, looks easy, yeah.
5316         (Arglist): arguments are private.
5317         (SizeOf): type is private and r/o.
5318         (MemberAccess): arguments are private.
5320         * report.cs: Enhanced reporting on/off capabilities.
5321         
5322         * lambda.cs: Uses ec.IsInProbingMode.
5323         (ContextualReturn): Derives from return.
5324         
5325         * rootcontext.cs: For now set both warning values.
5326         
5327         * statement.cs (CloneContext.RemapBlockCopy): Remaps block to cloned
5328         copy if one exists.
5329         (Return.Resolve): Don't die immediately.
5330         (Block.Resolve): Speed-up probing.
5331         (Block.CloneTo): Clone only child blocks.
5333 Fri Jul 13 11:19:28 CEST 2007 Paolo Molaro <lupus@ximian.com>
5335         * iterators.cs: reverted Miguel's latest change (r81925) as it
5336         breaks the build in System.
5338 2007-07-13  Miguel de Icaza  <miguel@novell.com>
5340         * iterators.cs (Yield.CheckContext): Check for the iterator type
5341         also here as we can call into Yield even in codepaths that are not
5342         directly checked by
5343         (MethodOrOperator is the only path that was checked).
5345         In addition to the standard check, use a more specific check for
5346         constructors to report a more verbose error. 
5348 2007-07-12  Miguel de Icaza  <miguel@novell.com>
5350         * ecore.cs (FieldExpr.AddressOf): Do not stop processing here,
5351         report the warning and continue 
5353         * statement.cs (Using.EmitLocalVariableDecls): We were leaving
5354         values on the stack on the call to Emit.   Use EmitStatement if
5355         possible, or using Emit + Pop if not possible.   Fixes #82064
5357 2007-07-12  Raja R Harinath  <rharinath@novell.com>
5359         * expression.cs (Invocation.IsApplicable): Reorganize slightly to
5360         avoid try...finally in some cases.
5362 2007-07-10  Marek Safar  <marek.safar@gmail.com>
5364         * attribute.cs (Attribute.ResolveConstructor): Uses method group.
5365         
5366         * class.cs (ConstructorInitializer.Resolve): Use and keep method group
5367         instead of method. Re-use standard error handling.
5368         (ConstructorInitializer.Emit): Simplified.
5369         
5370         * delegate.cs: Updated after Invocation.EmitCall change.
5371         
5372         * ecore.cs (GetOperatorTrueOrFalse): Uses MethodGroupExpr only.
5373         (SimpleName.SimpleNameResolve): Set and reset in_transit flag correctly.
5374         (ExtensionMethodGroupExpr): Refactored to use same OverloadResolve
5375         method and don't permanently changing input arguments.
5376         (MethodGroupExpr): Introduced resolved best_candidate, when method group
5377         is resolved it has one of the candidates is the best one which is later
5378         used to emit. Removed a few unused method.
5379         (MethodGroupExpr.MakeUnionSet): Moved from Invocation, it belongs here.
5381         * expression.cs (StaticCallExpr.MakeSimpleCall): Uses method group.
5382         (Binary.ResolveOperator): Ditto.
5383         (ConditionalLogicalOperator.DoResolve): Ditto.
5384         (Invocation): Uses method group.
5385         (Invocation.DoResolve): Simplified.
5386         (Invocation.EmitCall): Removed useless is_static.
5387         (Invocation.Emit): Delegate to method group.
5388         (Invocation.EmitStatement): Simplified.
5389         (New): Uses method group.
5390         (MemberAccess.DoResolve): Don't destroy original expression.
5391         
5392         * statement.cs (ForEach.Resolve): Use null for no method arguments.
5393         
5394 2007-07-04  Marek Safar  <marek.safar@gmail.com>
5396         * ecore.cs (VarExpr.DoResolveLValue): More restriction checks.
5397         
5398         * anonymous.cs,
5399         * lambda.cs: Add custom error message type.
5401 2007-07-03  Marek Safar  <marek.safar@gmail.com>
5403         * lambda.cs: Simplified little bit.
5404         
5405         * parameter.cs: Introduced ImplicitLambdaParameter.
5406         (Parameters.CreateFullyResolved): New factory instead of ctor.
5407         
5408         * anonymous.cs,
5409         * class.cs,
5410         * delegate.cs: Updated parameter creation.
5411         
5412 2007-07-03  Marek Safar  <marek.safar@gmail.com>
5414         *  ecore.cs (SimpleName.GetSignatureForError): Display correctly generic
5415         arguments.
5416         
5417         * generic.cs: Synchronized with gmcs.
5418         
5419 2007-07-03  Marek Safar  <marek.safar@gmail.com>
5421         * class.cs (Indexer): Check return type as soon as possible.
5422         
5423         * cs-parser.jay: Initialize implicit_value_parameter_type for interface
5424         members too.
5425         
5426         * ecore.cs (VarExpr.DoResolveLValue): Set eclass value.
5427         
5428         * expression.cs (Invocation.Error_InvalidArguments): Show type only.
5429         
5430         * parameter.cs (Parameter): Use expression type when it is available.
5431         
5432         * support.cs (ReflectionParameters.ParameterDesc): Show an extension
5433         method modifier for the first parameter only.
5435 2007-06-24  Marek Safar  <marek.safar@gmail.com>
5437         A fix for bug #81938
5438         * typemanager.cs (ChangeType): Fixed couple of char conversions.
5439         
5440         * constant.cs: Tide up an exception message.
5442 2007-06-22  Marek Safar  <marek.safar@gmail.com>
5444         * ecore.cs (SimpleName.DoSimpleNameResolve): Better error reporting when
5445         an uninitialized variable is used.
5446         
5447         * expression.cs (LocalVariableReference.DoResolve): Ditto.
5449 2007-06-22  Marek Safar  <marek.safar@gmail.com>
5451         * ecore.cs (SimpleName.TypeOrNamespaceNotFound): Allow to override type
5452         not found error handling.
5454         * expression.cs (ArrayCreation): Removed redundant fields and little bit
5455         simplified.
5456         (ArrayCreation.ResolveArrayElement): To be ready to customization.
5457         (ArrayCreation.DoResolve): Simplified.
5458         (ImplicitlyTypedArrayCreation.DoResolve): Implicitly typed arrays have
5459         its own resolve process.
5460         (ImplicitlyTypedArrayCreation.ResolveArrayElement): Conversion magic.
5462 2007-06-20  Marek Safar  <marek.safar@gmail.com>
5464         * namespace.cs (NamespaceEntry.Error_AmbiguousTypeReference): Print
5465         more error details.
5466         
5467 2007-06-20  Marek Safar  <marek.safar@gmail.com>
5469         * cs-tokenizer.cs: Removed var related stuff.
5470         
5471         * ecore.cs (Expression.ResolveAsContextualType): Introduced new method.
5472         (VarExpr): Changed to derive from SimpleName. VarExpr now behaves as
5473         a type and a keyword at same time.
5474         
5475         * decl.cs (MembeName.GetTypeExpression): Create VarExpr when type name
5476         matches to "var".
5477         
5478         * expression.cs (ImplicitlyTypedArrayCreation): New empty class for
5479         implicitly typed arrays, more changes will follow.
5480         
5481         * statement.cs (LocalInfo.Resolve): Resolve type as contextual type.
5482         
5483 2007-06-19  Marek Safar  <marek.safar@gmail.com>
5485         * ecore.cs (VarExpr): Removed Handled field.
5486         
5487         * statement.cs (Using.ResolveLocalVariableDecls): Refactored to use
5488         build-in assign functionality.
5489         (ForEach.Resolve): Removed all implicitly typed local variable code and
5490         simplified.
5491         (ArrayForeach.Resolve): Infer implicitly typed local variable here.
5492         (CollectionForeach.Resolve): Infer implicitly typed local variable here.
5494 2007-06-18  Marek Safar  <marek.safar@gmail.com>
5496         * assign.cs: Removed implicitly typed local variable check.
5497         
5498         * expression.cs (LocalVariableReference.DoResolve): Add check for self
5499         referencing implicitly typed local variable.
5500         (LocalVariableReference.DoResolveLValue): Infer implicitly typed local
5501         variable here.
5502         
5503         * statement.cs (Fixed): Removed unsupported implicitly typed local
5504         variable code.
5506 2007-06-15  Marek Safar  <marek.safar@gmail.com>
5508         * decl.cs (MemberName): Moved all Unbound stuff to parser.
5510 2007-06-14  Marek Safar  <marek.safar@gmail.com>
5512         A fix for bugs #81855 and #76274
5513         * attribute.cs (AttachTo): Always set owner for global attributes to
5514         prefined owner.
5515         
5516         * ecore.cs (Error_TypeDoesNotContainDefinition): A type location can be
5517         usefull too.
5518         
5519         * cs-parser.jay: Assembly and module attributes must precede all other
5520         elements except using clauses and extern alias declarations.
5522 2007-06-13  Marek Safar  <marek.safar@gmail.com>
5524         A fix for bug #81748
5525         * cs-tokenizer.cs,
5526         * expression.cs: More checks for non ISO-1 features.
5528 2007-06-12  Marek Safar  <marek.safar@gmail.com>
5530         A fix for bug #81807
5531         * statement.cs(Switch.TableSwitchEmit): Define null label when it's not
5532         present inside switch statement and it is required by nullable check.
5534 2007-06-12  Marek Safar  <marek.safar@gmail.com>
5536         A fix for bug #81840
5537         * ecore.cs (SimpleName.ResolveAsTypeStep): Look for non-generic type
5538         when type matching fails.
5539         
5540         * namespace.cs: Tiny error message change.
5542 2007-06-12  Marek Safar  <marek.safar@gmail.com>
5544         * decl.cs (CheckAbstractAndExtern): Moved to MemberCore for easier error
5545         reporting. Added automatic property check.
5546         
5547         * class.cs: Updated after CheckAbstractAndExtern relocation.
5548         (AEventPropertyAccessor.GetSignatureForError): Customized.
5549         
5550 2007-06-11  Marek Safar  <marek.safar@gmail.com>
5552         * class.cs (DefineBaseTypes): Base type can be undefined.
5553         
5554         * ecore.cs (TypeLookup): Minor refactoring.
5555         (DoResolveAsTypeStep): Removed redundant check.
5557         * namespace.cs (Lookup): Removed redundant check.
5558                 
5559         * rootcontext.cs (BootstrapCorlib_ResolveType): Uses normal 
5560         ResolveAsTypeTerminal step.
5561         (BootstrapCorlib_*): Simplified.
5562         (PopulateCoreType): Core types can be now external.
5564 2007-06-07  Marek Safar  <marek.safar@gmail.com>
5566         * anonymous.cs (VerifyExplicitParameterCompatibility): Add flag to do
5567          verification only.
5568          (InferTypeArguments): Infers anonymous expression type arguments.
5569          (Compatible): Split to Compatible and InferTypeArguments. 
5570         
5571         * lambda.cs: Updated.
5573 2007-06-08  Marek Safar  <marek.safar@gmail.com>
5575         * anonymous.cs (AnonymousContainer): Marked as compiler generated.
5577 2007-06-07  Raja R Harinath  <harinath@gmail.com>
5579         Fix #80477, cs0135-2.cs, cs0135-3.cs
5580         * statement.cs (ToplevelBlock.ProcessParameters): Add parameter
5581         names to the "known" variables list.
5582         (Block.CheckInvariantMeaningInBlock): Handle the fact the
5583         parameter names are also "known".
5584         (Block.CheckError136): Remove.
5585         (ExplicitBlock.CloneTo): New.  Set 'known_variables' in target to
5586         null.
5588 2007-06-07  Marek Safar  <marek.safar@gmail.com>
5590         * ecore.cs (MethodGroupExpr.OverloadResolve): Print full method definition.
5592 2007-06-06  Marek Safar  <marek.safar@gmail.com>
5594         * ecore.cs (SimpleName.Emit): Emitting unresolved simple name is
5595         internal error not an user error.
5596          
5597         * expression.cs (IsApplicable): Refactored to make debugging easier.
5599         * support.cs: More tricks for non-mono runtimes.
5600         
5601         * typemanager.cs (CoreLookupType): Made public.
5602         (InitSystemCore): All linq specific stuff moved to linq.cs
5604 2007-06-05  Marek Safar  <marek.safar@gmail.com>
5606         * typemanager.cs (CSharpSignature): One more missing build-in types
5607         replacement.
5608         More tricks for non-mono runtime.
5610 2007-06-05  Raja R Harinath  <harinath@gmail.com>
5612         * statement.cs (Block.CheckError136_InParents): Remove.
5613         (Block.AddVariable): Use GetParameterInfo instead.
5614         (ToplevelBlock.ProcessArguments): Likewise.
5616 2007-06-04  Raja R Harinath  <rharinath@novell.com>
5618         * statement.cs (ToplevelBlock.CloneTo): New.  Copy over parameter
5619         information too.
5620         (ToplevelBlock.GetParameterInfo): Split out of ...
5621         (ToplevelBlock.GetParameterRefernce): ... this.
5622         (ToplevelBlock.ParameterMap): Remove.
5623         * expression.cs (ParameterReference): Update to use
5624         ToplevelParameterInfo.
5626         * statement.cs (ToplevelBlock.ProcessParameters): Workaround some
5627         regression.
5629         * flowanalysis.cs (FlowBranching.CheckOutParameters): Move ...
5630         * statement.cs (ToplevelBlock.CheckOutParameters): ... here.
5632         * statement.cs (ToplevelBlock.ResolveMeta): Move CS0136 checks ...
5633         (ToplevelBlock.ProcessParameters) ... here.
5634         (ToplevelBlock..ctor): Invoke it.
5636         * statement.cs (ToplevelBlock.ResolveMeta): Add sanity checks for
5637         new parameters.
5639         * statement.cs (IKnownVariable): New interface.
5640         (LocalInfo): Implement it.
5641         (ToplevelParameterInfo): New class.
5642         (ExplicitBlock.AddKnownVariable): Use IKnownVariable.
5643         (ExplicitBlock.GetKnownVariable): Likewise.  Rename from
5644         GetKnownVariableInfo.
5646 2007-06-03  Raja R Harinath  <harinath@gmail.com>
5648         Partly speed up CS0136 error checks.
5649         * statement.cs (ExplicitBlock.GetKnownVariableInfo): Remove
5650         'recurse' parameter.
5651         (Block.DoCheckError136): Only check errors in parameters.  Move
5652         local variable checks ...
5653         (Block.AddVariable): ... here, and ...
5654         (ToplevelBlock.ResolveMeta): ... here.
5656 2007-06-02  Raja R Harinath  <harinath@gmail.com>
5658         * statement.cs (Block.IsChildOf): Remove.
5660         * statement.cs (Statement.Clone): Move special case code ...
5661         (Block.CloneTo): ... here.
5663 2007-05-29  Raja R Harinath  <rharinath@novell.com>
5665         * statement.cs (ToplevelBlock.container): Remove field.  It's
5666         redundant with 'Parent'.
5667         (ToplevelBlock.ContainerBlock): Remove accessor.
5668         (ToplevelBlock..ctor): Update to changes.  Register anonymous
5669         child with parent here, ...
5670         * cs-parser.jay (end_anonymous): ... not here.  Don't modify
5671         current_block.
5672         (start_anonymous): Don't save current_block.
5673         (top_current_block): Remove.
5675         * statement.cs (Block.Flags): Remove IsExplicit and IsToplevel flags.
5676         (Block.Resolve): Update to changes.
5677         (Block..ctor): Move setting of "correct" 'Toplevel'
5678         and 'Explicit' fields to ...
5679         (ExplicitBlock..ctor, ToplevelBlock..ctor): ... here.
5681 2007-05-27  Raja R Harinath  <harinath@gmail.com>
5683         Kill Block.Implicit
5684         * statement.cs (Block.Implicit): Remove.
5685         (Block): Update to changes.
5686         * flowanalysis.cs: Likewise.
5688         Mildly speed up CheckInvariantMeaningInBlock
5689         * statement.cs (ExplicitBlock.AddKnownVariable): Move here from Block.
5690         Recursively call AddKnownVariable to all enclosing blocks.
5691         (ExplicitBlock.GetKnownVariableInfo): Move here from Block.
5692         Remove recursive calls.
5693         (Block): Update to changes.
5695         New ExplicitBlock invariants
5696         * statement.cs (Block.Explicit): New field.  It points to the
5697         immediately enclosing non-implicit block.
5698         (Block..ctor): Maintain the invariant.
5699         * cs-parser.jay: Take advantage of invariant.
5701         Introduce ExplicitBlock
5702         * statement.cs (ExplicitBlock): New.
5703         (ToplevelBlock): Derive from it.
5704         (Block.Flags.IsExplicit): Rename from '...Implicit' and invert
5705         sense of flag.
5706         (Block.Implicit): Update to changes.
5707         * cs-parser.jay: Update to changes.
5709         Remove unused field
5710         * codegen.cs (EmitContext.IsLastStatement): Remove.
5711         * statement.cs (Block.DoEmit): Update to changes.
5713 2007-05-25  Raja R Harinath  <rharinath@novell.com>
5715         * cs-parser.jay: Use 'start_block' and 'end_block' rather than
5716         modifying current_block directly.
5718 2007-05-23  Scott Peterson  <lunchtimemama@gmail.com>
5719         
5720         * class.cs: Implemented automatic properties (C# 3.0)
5721           Thanks to Marek for the help.
5723 2007-05-23  Raja R Harinath  <rharinath@novell.com>
5725         * flowanalysis.cs (VariableInfo.SetAssigned): When noting a
5726         variable as assigned, note also that all its components are
5727         assigned too.
5728         (MyBitVector.SetRange): New.  Function to set multiple bits to true.
5730 2007-05-19  Marek Safar  <marek.safar@gmail.com>
5732         * anonymous.cs, class.cs: Emit Compiler generated attribute when
5733         member is marked as compiler generated.
5734         
5735         * decl.cs (MemberCore): Refactored ModFlags into property.
5737         * modifiers.cs: Add new modifier (COMPILER_GENERATED).
5738         (Check): Check only accessibility modifiers.
5740 2007-05-18  Raja R Harinath  <rharinath@novell.com>
5742         Track all assignable slots in one bit array
5743         * statement.cs (ToplevelBlock.ParameterMap): Convert into array.
5744         (ToplevelBlock.ResolveMeta): Don't create a VariableMap.  Move
5745         logic from VariableMap constructor here.  Use the same 'offset'
5746         variable that's later used for computing offsets of local
5747         variables.
5748         * flowanalysis.cs (UsageVector.parameters): Remove.
5749         (UsageVector): Update to changes.
5750         (VariableMap): Remove.
5752         Avoid creating ParameterMap in every block
5753         * statement.cs (Block.ParameterMap): Move ...
5754         (ToplevelBlock.ParameterMap): ... here.
5755         (ToplevelBlock.ResolveMeta): Create VariableMap for parameters
5756         only once.
5757         * flowanalysis.cs (FlowBranching.param_map): Remove.
5758         (FlowBranching.UsageVector): Update to changes.
5759         (FlowBranchingToplevel.CheckOutParameters): Likewise.
5761         * statement.cs (Block.CloneTo): Clone Toplevel field too.
5763         * expression.cs (ParameterReference): Distinguish between block
5764         where parameter was referenced and declared.
5766 2007-05-18  Marek Safar  <marek.safar@gmail.com>
5768         * flowanalysis.cs, statement.cs: Put back improved error handling.
5770 2007-05-15  Scott Peterson  <lunchtimemama@gmail.com>
5771         
5772         * assign.cs:
5773         * expression.cs:
5774           Imporved object and collection initialization (C# 3.0).
5776 2007-05-15  Marek Safar  <marek.safar@gmail.com>
5778         A fix for bug #81380
5779         * expression.cs (Is.DoResolve): Only value types have constant `is'
5780         behaviour.
5782 2007-05-15  Raja R Harinath  <rharinath@novell.com>
5784         * statement.cs (ToplevelBlock.child): Remove.
5786 2007-05-15  Raja R Harinath  <harinath@gmail.com>
5788         Rationalize ResolveMeta: refactoring
5789         (Block.ResolveMeta): Remove wrong or superfluous comments.  Carve
5790         out constant handling code into ...
5791         (Block.DoResolveConstants): ... this.
5793         Rationalize ResolveMeta: kill local_map
5794         * statement.cs (Block.local_map, Block.LocalMap): Remove.
5795         (Block.AssignableSlots): New.
5796         (Block.ResolveMeta): Make protected.  Don't create a VariableMap
5797         for locals -- move code from VariableMap here.  Avoid unnecessary
5798         allocations.
5799         * flowanalysis.cs (FlowBranching.local_map): Remove.
5800         (FlowBranching..ctor): Use Block.AssignableSlots.
5801         (VariableMap): Remove unused constructors.
5803 2007-05-11  Raja R Harinath  <rharinath@novell.com>
5805         * Makefile [PROFILE=net_2_0_bootstrap]: Add special-case rules.
5807 2007-05-11  Marek Safar  <marek.safar@gmail.com>
5809         * typemanager.cs (IsFriendAssembly): Should not be called for building
5810         assembly.
5812 2007-05-09  Marek Safar  <marek.safar@gmail.com>
5814         * literal.cs (NullConstant): Print null in all cases.
5815         
5816         * expression.cs (Binary.ResolveOperator): Implemented delegate
5817          comparison based on C# 2.0 changes.
5819 2007-04-28  Scott Peterson  <lunchtimemama@gmail.com>
5821         This code is contributed under the MIT X11 license
5822         
5823         The following enables support for several C# 3.0 language features:
5824         
5825         * cs-tokenizer.cs: Added support for the "var" keyword.
5826         
5827         * ecore.cs: Refactored TypeLookupExpression.DoResolveAsTypeStep().
5828           Added VarExpr class to facilitate type inferencing.
5829         
5830         * class.cs: Added IDictionary field AnonymousTypes to TypeContainer
5831           to support anonymous types.
5832         
5833         * assign.cs: Added support for type inferencing and initialization.
5834         
5835         * anonymous.cs: Added AnonymousClass class to enable anonymous types.
5836         
5837         * expression.cs: Added implicit array support to ArrayCreation.
5838           Added 5 types and 1 interface:
5839           
5840           IInitializable                Implementing classes can inject initializing
5841                                         statements after object instantiation.
5842           
5843           Initializer                   Stores data for object initialization.
5844           
5845           AnonymousType                 An expression for anonymous types.
5846           
5847           AnonymousTypeParameter        Stores data about an anonymous type's field.
5848           
5849           NewInitialize                 An expression for object initialization.
5850           
5851           CollectionInitialize          An expression for collection initialization.
5852         
5853         * statement.cs: Added "var" keyword support to the foreach, using, and fixed
5854           statements.
5856 2007-05-06  Marek Safar  <marek.safar@gmail.com>
5858         A fix for bug #81500
5859         * cs-tokenizer.cs: Add special handling for coalescing operator.
5861 2007-05-06  Marek Safar  <marek.safar@gmail.com>
5863         A fix for bug #81529
5864         * attribute.cs (GetAttributeUsage): AttributeUsage attribute inherits
5865         its value from base class until it is redefined.
5867 2007-05-02  Raja R Harinath  <rharinath@novell.com>
5869         Fix regression in cs0631-3.cs
5870         * cs-parser.jay (operator_declarator): Add opt_attributes to error
5871         fallback.  Make error fallback catch more cases.
5873 2007-05-01  Miguel de Icaza  <miguel@novell.com>
5875         * cs-parser.jay: Allow parameters in operator declarations to have
5876         attributes. 
5878 2007-04-27  Miguel de Icaza  <miguel@novell.com>
5880         * statement.cs (If.CloneTo): Only clone the FalseStatement if it
5881         exists. 
5883         * lambda.cs (ContextualReturn.Resolve): An expression is valid
5884         inside the ContextualReturn, it does not have to be an
5885         ExpressionStatement. 
5887 2007-04-24  Miguel de Icaza  <miguel@novell.com>
5889         * lambda.cs (ContextualReturn.Resolve): if the return type is not
5890         set, set it.
5892 2007-04-23  Miguel de Icaza  <miguel@novell.com>
5894         * anonymous.cs (AnonymousContainer): split the virtual Resolve
5895         method in two methods: ResolveNoDefine and Resolve.
5897         ResolveNoDefine will stop just after ResolveTopBlock has been
5898         called.   
5900         Resolve will then continue by creating a method and issuing the
5901         call to method.Define ().
5903         (AnonymousMethod): Split and implement the new Resolve and
5904         ResolveNoDefine as well.
5906         * lambda.cs (LambdaExpression): Split the anonymous method
5907         resolution code into a separate routine (CoreCompatibilityTest)
5908         from DoCompatibleTest.
5910         (LambdaExpression.TryBuild): New method, this method tries to
5911         build the LambdaExpression with the given set of types to be used
5912         as the types for the various parameters of the lambda expression. 
5914         If the compilation succeed with the given types, the infered type
5915         of the Anonymous method is returned, otherwise null is returned.
5917 2007-04-23  Marek Safar  <marek.safar@gmail.com>
5919         A fix for bug #81414
5920         * delegate.cs: Better fix, moved ApplyAttributes from Define to Emit.
5922 2007-04-22  Miguel de Icaza  <miguel@novell.com>
5924         * cs-tokenizer.cs: Change various identifiers here from the
5925         camelCasing to the recommended Linux-like style for instance
5926         variables from the Coding Guidelines. 
5928 2007-04-19  Martin Baulig  <martin@ximian.com>
5930         * convert.cs
5931         (Convert.ImplicitReferenceConversionCore): Allow conversions from
5932         System.Enum to System.ValueType.
5934 2007-04-13  Martin Baulig  <martin@ximian.com>
5936         Rewrote implicit reference conversions.  We need to distinguish
5937         between implicit reference conversions (13.1.4) and implicit
5938         boxing conversions (13.1.5).
5940         According to the spec, there's an an implicit conversion
5941         "From a one-dimensional array-type S[] to IList<T> and base
5942         interfaces of this interface, provided there is an implicit
5943         reference conversion from S to T."  Note that this does not
5944         include boxing conversions.
5946         * convert.cs
5947         (Convert.ImplicitTypeParameterBoxingConversion): New method.
5948         (Convert.ImplicitReferenceConversion): Split into
5949         ImplicitReferenceConversionCore() and
5950         ImplicitBoxingConversionExist().
5951         (Convert.ImplicitReferenceConversionExists): Use the new
5952         ImplicitReferenceConversionCore() and ImplicitBoxingConversionExists().
5954 2007-04-12  Martin Baulig  <martin@ximian.com>
5956         * convert.cs (Convert.ImplicitReferenceConversion): Move the
5957         `TypeManager.null_type' checks up to the top of the method.
5959 2007-04-11  Marek Safar  <marek.safar@gmail.com>
5961         A fix for bug #81350
5962         * class.cs, decl.cs, ecore.cs, namespace.cs: The optimization for private
5963         extension methods.
5965 2007-04-11  Martin Baulig  <martin@ximian.com>
5967         * statement.cs (Foreach.CollectionForeach.ProbeCollectionType):
5968         Use `TypeManager.GetInterfaces(t)' rather than `t.GetInterfaces()'
5969         to make this work for generic classes; fixes #79561.
5971 2007-04-11  Martin Baulig  <martin@ximian.com>
5973         * expression.cs (As): Add support for nullable types; fixes #79371.
5975 2007-04-11  Martin Baulig  <martin@ximian.com>
5977         * doc.cs (DocUtil.GetSignatureForDoc): Don't crash if
5978         `type.FullName' is null; fixes #80243.
5980 2007-04-11  Martin Baulig  <martin@ximian.com>
5982         * expression.cs (Invocation.IsApplicable): Don't modify the method
5983         if type inference succeeded, but the method was not applicable.
5984         Fixes #81250.
5986 2007-04-10  Marek Safar  <marek.safar@gmail.com>
5988         A fix for bug #81324
5989         * namespace.cs (Namespace.LookupExtensionMethod): Always inspect both
5990         internal and external namespaces containers.
5992 2007-04-10  Martin Baulig  <martin@ximian.com>
5994         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Use
5995         TypeManager.DropGenericMethodArguments() so we also call
5996         IMethodData.SetMemberIsUsed() for generic methods.  Fixes #80357.
5998 2007-04-10  Martin Baulig  <martin@ximian.com>
6000         * iterators.cs (Iterator.CreateIterator): Don't crash if
6001         `method.ReturnType' is null.  This happens if something went wrong
6002         while resolving that typ (we already reported an error in this case).
6004 2007-04-10  Martin Baulig  <martin@ximian.com>
6006         * expression.cs (New.DoResolve): Don't call CheckComImport() on
6007         generic interfaces; report the CS0144 directly.
6009 2007-04-10  Martin Baulig  <martin@ximian.com>
6011         * ecore.cs (MemberExpr.ResolveMemberExpr): If `left' is a
6012         `TypeExpr', call ResolveAsTypeTerminal() on it; fixes #81180.
6014 2007-04-10  Martin Baulig  <martin@ximian.com>
6016         * expression.cs (New.DoEmitTypeParameter): Fix #81109.
6018 2007-04-09  Raja R Harinath  <rharinath@novell.com>
6020         A better fix
6021         * flowanalysis.cs (UsageVector.MergeChild): Handle child.Block == null.
6022         * statement.cs: Use KillFlowBranching only in ResolveUnreachable.
6024         Fix #81338
6025         * statement.cs (For.Resolve): If resolution fails, use
6026         KillFlowBranching.
6028 2007-04-08  Marek Safar  <marek.safar@gmail.com>
6030         * anonymous.cs (MakeName): Make faster and zero-based.
6031         (VerifyExplicitParameterCompatibility): Back to mode where generic
6032         parameter is ignored.
6033         (AnonymousMethodMethod.Emit): Decorate method as compiler generated.
6035         * class.cs (EmitType): Method can emit another new method.
6037         * cs-tokenizer.cs (IsLinqEnabled): Fixes static cctor race.
6039         * driver.cs: Updated.
6041         * lambda.cs: Reuse predefined empty parameters.
6043         * parameter.cs: Updated
6045         * support.cs: Implemented InflateTypes.
6047         * typemanager.cs (GetFullName): Don't use FullName as it can be null.
6048         (InitSystemCore): Introduced to isolate 3.0 dependencies.
6050 2007-04-03  Martin Baulig  <martin@ximian.com>
6052         Fix #80632.
6054         * statement.cs (Foreach.CollectionForeach.TryType): Use a custom
6055         version of TypeManager.IsOverride() which also works with generic
6056         types.  
6058 2007-04-03  Martin Baulig  <martin@ximian.com>
6060         Fix #81044.
6062         * convert.cs
6063         (Convert.ExplicitReferenceConversion): We need to cast when
6064         converting from IList<T> to S[].
6066 2007-04-01  Marek Safar  <marek.safar@gmail.com>
6068         * decl.cs (FindExtensionMethods): Consider all candidates with same name
6069         at this level.
6070         
6071         * expression.cs (MemberAccess.DoResolve): Cache resolved expression.
6073 2007-03-31  Marek Safar  <marek.safar@gmail.com>
6075         * anonymous.cs (AnonymousMethodExpression.Compatible): Handles both
6076         argument and return type inferring.
6078         * codegen.cs (InferReturnType): Flag whether return can be inferred.
6079         (ReturnType): Turned to property.
6081         * statement.cs (Return): Implemented return type inferring.
6083         * support.cs (ReflectionParameters): Use local types if possible.
6085 2007-03-30  Raja R Harinath  <rharinath@novell.com>
6087         * flowanalysis.cs (FlowBranching.Reachability): Remove.
6088         (FlowBranching.UsageVector): Update to changes.
6090         Prepare to kill 'Reachability'
6091         * flowanalysis.cs (UsageVector): Remove 'Reachability' from
6092         argument of constructor.
6094 2007-03-29  Raja R Harinath  <rharinath@novell.com>
6096         Prepare to kill 'Reachability'
6097         * flowanalysis.cs (UsageVector.is_unreachable): New.
6098         (UsageVector): Update to maintain 'is_unreachable' in parallel to
6099         'reachability', and verify they're consistent.
6101         Fix #81121
6102         * expression.cs (New.EmitStatement): Handle type parameters here too.
6104 2007-03-29  Martin Baulig  <martin@ximian.com>
6106         Fix #79148.
6108         * anonymous.cs
6109         (ScopeInfo.ctor): Use `Modifiers.PUBLIC' if we're a nested
6110         CompilerGeneratedClass.
6111         (ScopeInfo.EmitScopeInstance): Make this protected.
6112         (CapturedVariable.EmitInstance): Use `Ldarg_0' if
6113         `ec.CurrentAnonymousMethod.Scope == Scope'.
6115         * statement.cs (Block.ScopeInfo): Make this a property.
6117 2007-03-27  Raja R Harinath  <harinath@gmail.com>
6119         Prepare to kill 'Reachability'
6120         * flowanalysis.cs (FlowBranching.Reachability): Make class private.
6121         (FlowBranching.UsageVector.Reachability): Remove property.
6122         (FlowBranching.UsageVector.IsUnreachable): New property.
6123         (FlowBranching.UsageVector.ResetBarrier): New.
6124         (FlowBranching.UsageVector, FlowBranchingLabeled): Update to changes.
6125         * codegen.cs, statement.cs: Update to changes.
6127 2007-03-27  Martin Baulig  <martin@ximian.com>
6129         Fix #81209.
6131         * decl.cs
6132         (DeclSpace.LookupNestedTypeInHierarchy): Correctly handle nested
6133         generic types.
6135 2007-03-26  Raja R Harinath  <rharinath@novell.com>
6137         * flowanalysis.cs (FlowBranching.Reachability): Use a boolean
6138         instead of TriState.  Remove all mention of TriState.
6140         * flowanalysis.cs (FlowBranching.Reachability): Prepare to be
6141         replaced by a boolean.  Add boolean 'is_unreachable' field, check
6142         and maintain invariants.
6144 2007-03-25  Marek Safar  <marek.safar@gmail.com>
6146         * anonymous.cs: Restored checks disabled for uninflated anonymous methods.
6148 2007-03-25  Marek Safar  <marek.safar@gmail.com>
6150         * expression.cs: Stop using obsolete 2.0 opcodes.
6152 2007-03-25  Marek Safar  <marek.safar@gmail.com>
6154         * enum.cs (EnumMember.Define): Fixed regression and slowdown caused by
6155         one of the latests Martin's fixes.
6157 2007-03-23  Miguel de Icaza  <miguel@novell.com>
6159         * expression.cs: On BigEndian systems, swap the bytes, temporary
6160         solution until we get a new bitconverter class.
6162 2007-03-23  Martin Baulig  <martin@ximian.com>
6164         Fix #81158.
6166         * decl.cs (MemberCache.AddMembers): Add generic methods both as
6167         "Method" and "Method`1".  Normally, a cache lookup is done on the
6168         "Method" form (ie. without the generic arity), but this one makes
6169         lookups on the full form work as well.
6171 2007-03-22  Raja R Harinath  <rharinath@novell.com>
6173         * flowanalysis.cs (Reachability): Reorganize slightly, and remove
6174         unused properties.
6176 2007-03-20  Bill Holmes  <billholmes54@gmail.com>
6177         * class.cs: 
6178         Added 2 MemberCoreArrayList objects, ordered_explicit_member_list and
6179         ordered_member_list, to TypeBuilder to store members to be defined
6180         in the order they were parsed in.
6181         - ordered_explicit_member_list contains all properties indexers
6182           and methods that are defined as explicit implementation of an
6183           interface or base class.
6184         - ordered_member_list contains all properties indexers and methods
6185           that are not defined as explicit implementation of an interface
6186           or base class.
6188         Removed MethodArrayList and IndexerArrayList from TypeBuilder.  The 
6189         functionality in these removed classes has been replaced with 
6190         ComputeIndexerName, EmitIndexerName, HasEqualss, HasGetHashCode, and 
6191         CheckEqualsAndGetHashCode members defined and called in the TypeBuilderClass.
6193         Adding CheckForDuplications to PropertyBase.PropertyMethod and calls
6194         to CheckForDuplications inside GetMethod and SetMethod Define Method
6195         to handle method property and indexer name conflicts.
6197         Fixes #79434
6199         All code is contributed under the MIT/X11 license.
6201 2007-03-20  Martin Baulig  <martin@ximian.com>
6203         * class.cs (TypeContainer.Interfaces): Removed; they're now
6204         included in `TypeContainer.Types'.
6206 2007-03-20  Martin Baulig  <martin@ximian.com>
6208         Fix #77963, #80314 and #81019.  Added gtest-317, ..., gtest-320.
6210         * class.cs (TypeContainer.CreateType): New public method.  This is
6211         now called before DefineType() to create the TypeBuilders.
6212         (TypeContainer.DefineType): Don't create the TypeBuilder here; it
6213         has already been created by CreateType().
6214         (TypeContainer.DefineTypeBuilder): Renamed into CreateTypeBuilder();
6215         don't resolve our base classes here; this has been moved into
6216         DefineBaseTypes().  We're now called from CreateType().
6217         (TypeContainer.DefineBaseTypes): New private method; resolve our
6218         base classes here.  We're now called from DefineType().
6220         * rootcontext.cs
6221         (RootContext.ResolveTree): Call TypeContainer.CreateType() on all
6222         our types first to create all the TypeBuilders.  After that, call
6223         TypeContainer.DefineType() on all the types which'll resolve their
6224         base classes and setup the resolve order.
6226 2007-03-20  Martin Baulig  <martin@ximian.com>
6228         * class.cs (TypeContainer.Enums): Removed; they're now included in
6229         `TypeContainer.Types'.  
6231 2007-03-20  Martin Baulig  <martin@ximian.com>
6233         * class.cs
6234         (TypeContainer.DefineType): Don't call ResolveMembers() here.
6235         (TypeContainer.DoResolveMembers): Call DefineType() on our
6236         `compiler_generated' classes; moved here from DefineNestedTypes().
6238         * rootcontext.cs
6239         (RootContext.ResolveTree): Call ResolveMembers() on all
6240         TypeContainer's in the `type_container_resolve_order'.
6242 2007-03-19  Marek Safar  <marek.safar@gmail.com>
6244         * class.cs: Use corlib to handle InternalMethodImplAttribute.
6246 2007-03-17  Marek Safar  <marek.safar@gmail.com>
6248         * class.cs (EventFieldAccessor.EmitMethod): Don't override existing
6249         implementation flags.
6251 2007-03-17  Marek Safar  <marek.safar@gmail.com>
6253         * class.cs: More optimizations for type parameters.
6255 2007-03-15  Marek Safar  <marek.safar@gmail.com>
6257         * anonymous.cs (AnomymousMethod): Can be now hosted in generic container.
6259         * ecore.cs, parameter.cs: More common code for both corlibs.
6261         * typemanager.cs (IsGenericMethod): Simplified.
6263 2007-03-15  Raja R Harinath  <rharinath@novell.com>
6265         * flowanalysis.cs (FlowBranching.Reachability): Remove handling of
6266         'returns'.
6267         * statement.cs, iterators.cs, lambda.cs: Update to changes.
6269         * statement.cs (Lock.Resolve): Invoke 'ec.NeedReturnLabel'
6270         unconditionally.  Simplify explanation.
6271         (Try.Resolve, Using.Resolve): Likewise.
6273 2007-03-15  Martin Baulig  <martin@ximian.com>
6275         Fix #80731.
6277         * decl.cs (DeclSpace): If we're a partial class, use our
6278         `PartialContainer's `TypeParameters' and `CurrentTypeParameters'.
6280 2007-03-15  Raja R Harinath  <rharinath@novell.com>
6282         * flowanalysis.cs (FlowBranching.Reachability): Remove handling of
6283         'throws'.
6284         (FlowBranching.UsageVector): Update to changes.
6285         (FlowBranching.MergeSiblings): Likewise.
6286         * statement.cs: Likewise.
6288 2007-03-15  Martin Baulig  <martin@ximian.com>
6290         Fix #79302.
6292         * decl.cs
6293         (MemberCache): Added a special .ctor for type parameters.
6295         * typemanager.cs
6296         (TypeManager.MemberLookup_FindMembers): `TypeParameter' now has a
6297         `MemberCache'.  
6299 2007-03-09  Martin Baulig  <martin@ximian.com>
6301         * enum.cs (Enum): Make this a TypeContainer.
6302         (EnumMember): Derive from `Const'.
6304         * const.cs
6305         (Const.DoResolveValue): New protected virtual method; move most of
6306         the functionality of ResolveValue() here so we can override it in
6307         `EnumMember'.
6308         (Const.CreateConstantReference): Make this virtual.
6310         * class.cs (Kind): Add `Kind.Enum'.
6311         (TypeContainer.Emit): Don't emit the enums here; they're already
6312         in the `RootContext.typecontainer_resolve_order'.
6314         * rootcontext.cs (RootContext.EmitCode): Don't emit the enums
6315         here; they're already in the `typecontainer_resolve_order'.
6317         * ecore.cs (EnumConstant.ConvertImplicitly): Add
6318         TypeManager.DropGenericTypeArguments().
6320         * typemanager.cs
6321         (TypeManager.CSharpEnumValue): Add DropGenericTypeArguments().
6322         (TypeManager.IsEnumType): Likewise.
6323         (TypeManager.EnumToUnderlying): Likewise.
6324         (TypeManager.IsEqual): Add support for enums.
6326 2007-03-12  Raja R Harinath  <rharinath@novell.com>
6328         * typemanager.cs (InitCoreTypes) [NET_2_0]: Allow
6329         DefaultParameterValueAttribute to be undefined, say if System.dll
6330         is not referenced.
6332 2007-03-11  Marek Safar  <marek.safar@gmail.com>
6334         * ecore.cs, parameter.cs, typemanager.cs: Another gmcs fix to work with
6335         any mscorlib.
6337 2007-03-10  Marek Safar  <marek.safar@gmail.com>
6339         * class.cs, parameter.cs: Unified parameters verification.
6341 2007-03-08  Martin Baulig  <martin@ximian.com>
6343         * cs-parser.jay (constructor_header): Pass the location to the
6344         newly created TopLevelBlock.
6346 2007-03-07  Martin Baulig  <martin@ximian.com>
6348         * statement.cs (Block.Resolve): Don't crash on error; bug #80715.
6350 2007-03-06  Miguel de Icaza  <miguel@novell.com>
6352         * convert.cs (ExplicitReferenceConversionExists): Sync this method
6353         with the changes from David, fixes the build.
6355 2007-03-05  David Mitchell  <dmitchell@logos.com>
6357         * convert.cs: Implement From System.Collecitons.Generic.IList<T>
6358         and its base interfaces to a one-dimensional array type S[],
6359         provided there is an implicit or explicit reference conversion
6360         from S to T.
6362 2007-03-03  Marek Safar  <marek.safar@gmail.com>
6364         * cs-tokenizer.cs: Implemented basic linq grammar.
6366         * driver.cs: Set linq lang version on demand.
6368 2007-02-26  Marek Safar  <marek.safar@gmail.com>
6370         * cs-parser.jay, expression.cs: Compile empty __arglist correctly.
6372 2007-02-25  Marek Safar  <marek.safar@gmail.com>
6374         * attribute.cs: Replaced DefinePInvoke in favor of S.R.E implementation
6375         (Fixes #80455)
6377         * class.cs (InterfaceMemberBase): Share common `extern' modifier checks
6378         here.
6379         Check property and event extern attributes.
6381         * codegen.cs (ModuleClass): HasDefaultCharSet when module defined global
6382         charset.
6384 2007-02-24  Marek Safar  <marek.safar@gmail.com>
6386         A fix for bug #80407
6387         * ecore.cs: Don't report ambiguity error when methods have same parent.
6389 2007-02-23  Marek Safar  <marek.safar@gmail.com>
6391         A fix for bug #80878
6392         * class.cs, cs-parser.jay: Event property can host anonymous methods.
6394 2007-02-22  Marek Safar  <marek.safar@gmail.com>
6396         * attribute.cs: Enable ExtensionAttribute presence test.
6398 2007-02-22  Marek Safar  <marek.safar@gmail.com>
6400         * class.cs: Warn about missing GetHashCode only when Equals is override.
6402         * decl.cs: Check accessibility of type arguments.
6404         * typemanager.cs: Correctly report nullable array.
6406 2007-02-20  Marek Safar  <marek.safar@gmail.com>
6408         * class.cs, report.cs: Capture more details when things go wrong.
6410 2007-02-20  Marek Safar  <marek.safar@gmail.com>
6412         A fix for bug #80650
6413         * cs-parser.jay: Anonymous container starts at constructor declaration
6414         and not at block beginning because it has to be usable in constructor
6415         initializer.
6417         * statement.cs: Use context location and not block one for error reporting.
6419 2007-02-18  Marek Safar  <marek.safar@gmail.com>
6421         A fix for bug #78712
6422         * class.cs.cs, decl.cs, ecore.cs: LookupAnyGeneric inspects nested types
6423         too.
6425 2007-02-18  Marek Safar  <marek.safar@gmail.com>
6427         A fix for bug #80493 by Atsushi Enomoto
6428         * cs-parser.jay: Ignore invalid attribute target.
6430 2007-02-18  Marek Safar  <marek.safar@gmail.com>
6432         * cs-tokenizer.cs: Ignore '\0' as white space character.
6434 2007-02-17  Miguel de Icaza  <miguel@novell.com>
6436         * cs-parser.jay: Add support for lambda expressions to the mcs
6437         compiler as well.
6439         * lambda.cs: Only clone when we are probing, not on the final call
6440         (Compatible is the final call). 
6442         * statement.cs (CloneContext): Introduce class to provide block
6443         remapping during clone.
6445         All statements Clone themselves now.
6447         (Clone): special handling for blocks, when we clone a block, we
6448         register the block inside this routine, as children of the block
6449         might trigger a lookup. 
6450         
6451         * expression.cs: Add support for CloneContext in all expressions. 
6452         
6453 2007-02-17  Marek Safar  <marek.safar@gmail.com>
6455         A fix for bug #80493
6456         * statement.cs: Report ambiguous warning when interfaces are not related.
6458 2007-02-15  Marek Safar  <marek.safar@gmail.com>
6460         C# 3.0 extension methods.
6462         * attribute.cs (Error_MisusedExtensionAttribute): Extension attribute
6463         cannot be used directly.
6465         * class.cs (Class.Emit): Emit extension attribute if any class method
6466         is extension method.
6467         (Method.Define): Add basic extension method validation conditions.
6468         (Method.Emit): Emit extension attribute for method.
6470         * codegen.cs (AssemblyClass): Emit extension attribute if at least one
6471         extension method exists. Currently we follow same approach as Microsoft
6472         does, emit even if a method or a class are private but this can change
6473         later.
6475         * cs-parser.jay: Add handling of `this' keyword in method parameters
6476         context.
6478         * decl.cs (DeclSpace.IsStaticClass): New property.
6479         (MemberCache.FindExtensionMethods): Looks for extension methods with
6480         defined name and extension type.
6482         * doc.cs: Updated after OverloadResolve changes.
6484         * driver.cs: Add new soft reference to System.Core.dll.
6486         * ecore.cs (MethodLookup): Can return only MethodGroupExpr.
6487         (ExtensionMethodGroupExpr): Represents group of extension methods.
6489         * expression.cs (Invocation): Moved methods BetterConversion, MoreSpecific,
6490         BetterFunction, IsOverride, IsAncestralType, OverloadResolve
6491         to MethodGroupExpr and made non-static for easier customization.
6492         (Invocation.DoResolve): Add extension method lookup when no standard
6493         method was found.
6494         (MemberAccess.DoResolve): Try extension methods if no member exists.
6496         * modifiers.cs: Add METHOD_EXTENSION modifier.
6498         * namespace.cs (RegisterExtensionMethodClass): Register class namespace
6499         as well as candidate extension type.
6500         (ComputeNamespaces): When assembly constains extension methods registers
6501         them.
6502         (Namespace.RegisterExternalExtensionMethodClass): Register type for later
6503         extension method lookup.
6504         (Namespace.LookupExtensionMethod): Looks for extension method in this
6505         namespace.
6506         (NamespaceEntry.LookupExtensionMethod): Does extension methods lookup to
6507         find a method which matches name and extensionType.
6509         * parameter.cs (Parameter): Add This modifer.
6510         (HasExtensionMethodModifier): New property.
6511         (Resolve): Add extension parameter check.
6512         (ModFlags): turned to property to exclude this modifier as it is not real
6513         parameter modifier.
6514         (Parameters): Implemented ExtensionMethodType and HasExtensionMethodType.
6516         * support.cs (ParameterData): Add ExtensionMethodType.
6517         (ReflectionParameters): Implemented ExtensionMethodType interface property.
6519         * typemanager.cs: Add type and ctor extension attribute type.
6521 2007-02-15  Miguel de Icaza  <miguel@novell.com>
6523         * report.cs (DisableErrors, EnableErrors): used to prevent error
6524         output when we are "trying" to compile various methods with
6525         different types. 
6527         * ecore.cs (Expression): Add Clone method that calls the virtual
6528         CloneTo method.  The current CloneTo method in Expression throws
6529         an exception so we can track down all the places where this must
6530         be implemented (not using abstract, because that would be a lot of
6531         up-front-work before we can start testing the implementation
6532         idea). 
6534         Important: we only need Clone capabilities for expressions created
6535         by the parser, as the expressions we will be cloning are
6536         expressions in the pre-resolved state.   This vastly simplifies
6537         the work required. 
6538         
6539         (SimpleName): Add CloneTo that does nothing.
6540         (EmptyCast): Add CloneTo.
6541         
6542         * expression.cs (Binary): Implement CloneTo.
6543         (Invocation.IsApplicable): Store the current ec in
6544         EmitContext.TempEc and restore it on return.  This is used so we
6545         do not have to sprinkle hundres of methods with an extra
6546         EmitContext, we know that the only user is the lambda expression
6547         ImplicitConversionExists code. 
6548         
6549         (Argument): Add Cloning capabilities.
6550         (LocalVariableReference, ParenthesizedExpression, Unary, Probe,
6551         Cast, Conditional, ArrayCreation, InvocationOrCast, Invocation,
6552         ArglistAccess, ArgList, TypeOf, SizeOf, CheckedExpr,
6553         UnCheckedExpr, ElementAccess, BaseAccess, BaseIndexerAccess,
6554         IndexerAccess): Add Clone capability.
6556         (LocalVariableReference, This): TODO: needs cloned Block mapping.
6558         (Argument): Add cloning capability.
6560         * assign.cs (Assign): Implement CloneTo.
6562         * anonymous.cs (ImplicitStandardConversionExists): Make virtual.
6563         
6564         * lambda.cs (ImplicitStandardConversionExists): Implement lambda
6565         version by calling Convert with the EmitContext (that we are
6566         currently storing in ec, this is not great, but will do for now,
6567         to avoid passing EmitContext parameters to hundreds of functions
6568         that do not need them now).
6570         (SetExpression): Remove, it is not needed.
6571         
6572         (ContextualReturn): Implement CloneTo.
6574         * statement.cs (Statement): Implement cloning infrastructure,
6575         similar to expressions.
6577         (Block): Partial implementation of Clone for statements.
6579         (Return): Implement clone.
6580         
6581         * constant.cs (Constant.CloneTo): New method, does nothing.
6583         * codegen.cs (TempEc): Add a static EmitContext as a temporary
6584         solution, until we decide how to exactly do this.  
6585         
6586 2007-02-14  Marek Safar  <marek.safar@gmail.com>
6588         A fix for bug #80493
6589         * class.cs (FindOutBaseMethod): When the base accessor does not exist and
6590         a property is override we need to use second accessor.
6592 2007-02-13  Marek Safar  <marek.safar@gmail.com>
6594         A fix for bug #80418
6595         * attribute.cs, class.cs: Use correct calling conventions for pinvoke
6596         methods.
6598 2007-02-13  Marek Safar  <marek.safar@gmail.com>
6600         Another fix for bug #80749
6601         * pending.cs: Abstract class has priority over interfaces.
6603 2007-02-13  Marek Safar  <marek.safar@gmail.com>
6605         Another fix for bug #80749
6606         * pending.cs: Abstract class has priority over interfaces.
6608 2007-02-13  Marek Safar  <marek.safar@gmail.com>
6610         Another fix for bug #80749
6611         * pending.cs: Abstract class has priority over interfaces.
6613 2007-02-13  Marek Safar  <marek.safar@gmail.com>
6615         Another fix for bug #80749
6616         * pending.cs: Abstract class has priority over interfaces.
6618 2007-02-13  Marek Safar  <marek.safar@gmail.com>
6620         * class.cs Better error message.
6622         * driver.cs: Add shorter versions of -optimize option.
6624 2007-02-13  Martin Baulig  <martin@ximian.com>
6626         * class.cs (Constructor.Emit): Check the return value of
6627         ec.ResolveTopBlock() and return on error.
6629 2007-02-13  Raja R Harinath  <rharinath@novell.com>
6631         * ecore.cs (Error_InvalidExpressionStatement): Add a comma to error
6632         message to fix error message regression.
6634 2007-02-12  Marek Safar  <marek.safar@gmail.com>
6636         * delegate.cs: Delegate creation expression cannot be of Nullable type.
6638 2007-02-12  Marek Safar  <marek.safar@gmail.com>
6640         A fix for bug #80749
6641         * assign.cs (FieldInitializer): FieldInitializer has to keep track of
6642         its parent container.
6644         * class.cs (DefineFieldInitializers): Each initializer can has different
6645         resolve context.
6647         * const.cs: Updated.
6649 2007-02-11  Miguel de Icaza  <miguel@novell.com>
6651         * lambda.cs (LambdaExpression.Compatible): Remove some early code,
6652         now all the heavy lifting to check that embedded statements or
6653         expressions have the right form is done in the ContextualReturn.
6655         (ContextualReturn): New class.  
6657         * ecore.cs (Error_InvalidExpressionStatement): Make a helper
6658         method that can be invoked to report 201, so we do not replicate
6659         this everywhere.
6661         * cs-parser.jay: Reuse Error_InvalidExpressionStatement.
6662         
6663         * cs-tokenizer.cs (xtoken): Correctly compute the column, it was
6664         treating tabs as spaces. 
6666 2007-02-09  Marek Safar  <marek.safar@gmail.com>
6668         A fix for bug #80315 by martin.voelkle@gmail.com (Martin Voelkle)
6669         * assign.cs: Use full implicit conversion for right side check.
6671 2007-02-09  Marek Safar  <marek.safar@gmail.com>
6673         * statement.cs (Switch): Switch over boolean type is not standardized.
6675 2007-02-08  Marek Safar  <marek.safar@gmail.com>
6677         A fix for bug #80755
6678         * decl.cs (FindBaseEvent): Don't use method cache for events.
6680 2007-02-07  Marek Safar  <marek.safar@gmail.com>
6682         * cs-parser.jay: Better syntax error handling.
6684         * ecore.cs, enum.cs, statement.cs, typemanager.cs: Print enum member name
6685         instead of underlying type value.
6687 2007-02-06  Marek Safar  <marek.safar@gmail.com>
6689         * driver.cs: Check define identifier before is registered.
6691         * namespace.cs: Use existing error message.
6693         * report.cs: New warning.
6695 2007-02-06  Marek Safar  <marek.safar@gmail.com>
6697         A fix for bug #80742
6698         * expression.cs: Delegate Invoke method can be called directly.
6700 2007-02-06  Marek Safar  <marek.safar@gmail.com>
6702         A fix for bug #80676
6703         * class.cs (IsEntryPoint): The Main method can have params modifier.
6705 2007-02-04  Miguel de Icaza  <miguel@novell.com>
6707         * parameter.cs (Parameter, Parameters): Add Clone method.
6709         * anonymous.cs (Compatible): Turn method into virtual method, so
6710         LambdaExpression can implement a different behavior.
6712         (CompatibleChecks, VerifyExplicitParameterCompatibility): Factor
6713         out the basic checking here, so it can be used by
6714         LambdaExpressions.
6715         
6716         * lambda.cs: Introduce "Compatible" function that will do the
6717         heavy lifting.
6719 2007-02-02  Marek Safar  <marek.safar@gmail.com>
6721         * attribute.cs: Unified one error message.
6723         * class.cs (Class): Use type attributes and not properties to test static
6724         class.
6725         (IsEntryPoint): Don's pass local variable.
6727         * convert.cs: Removed duplicate check.
6729         * decl.cs, doc.cs, ecore.cs (LookupType): Renamed to LookupNamespaceOrType.
6731         * driver.cs: Don't crash when soft reference does not exist.
6733         * namespace.cs (EnsureNamespace): Renamed to RegisterNamespace.
6734         (UsingEntry): Removed redundant allocation.
6736         * parameter.cs: Add fast path for type parameters.
6738         * support.cs: Don't allocate attribute when it's not used.
6740 2007-01-30  Miguel de Icaza  <miguel@novell.com>
6742         * anonymous.cs
6743         (AnonymousMethodExpression.ImplicitStandardConversionExists): turn
6744         this into a virtual method, so we can override it in LambdaExpression.
6746         * driver.cs: Improve diagnostics in case of failure. 
6748         * cs-tokenizer.cs: Instead of trying to parse a type and a name,
6749         write a function that is slightly more complex and that parses:
6751         type identifier [, type identifier]* )
6753         The old function would return incorrectly a OPEN_PARENS_LAMBDA for
6754         this expression:
6756                 (canEmpty ? i >= 0 : i > 0)
6758 2007-01-30  Raja R Harinath  <rharinath@novell.com>
6760         * cs-tokenizer.cs (parse_namespace_or_typename): Don't throw an
6761         exception on possibly valid code.
6763 2007-01-29  Raja R Harinath  <rharinath@novell.com>
6765         * cs-tokenizer.cs (is_punct) ['<']: Update to changes in
6766         Push/PopPosition.
6767         (parse_opt_type_arguments): Remove.  It's almost the same as
6768         parse_less_than.
6769         (parse_namespace_or_typename): Use parse_less_than.
6771 2007-01-28  Miguel de Icaza  <miguel@novell.com>
6773         * cs-tokenizer.cs: Typo fix, its not GMCS_SOURCES but GMCS_SOURCE,
6774         this bug took a few hours to find, because the state saved and
6775         restored by PushPosition and PopPosition was ignoring the state of
6776         parse_generic_less_than.
6778         I can also now remove the handling of OP_LT and OP_GT, this solves
6779         the big mistery.
6780         
6781         * cs-tokenizer.cs: store the location for the ARROW token, we use
6782         that in the parser.
6784         (PushPosition, PopPosition): save/restore also `current_token',
6785         restore `parse_generic_less_than' (was missing).
6787         (parse_opt_type_arguments): use parse_type, not
6788         parse_namespace_or_typename to parse types.
6790         * lambda.cs: Empty new file, will eventually have the lambda
6791         expression implementation.
6793         * lambda.test: used to test the internal tokenizer. 
6795         * report.cs (FeatureIsNotISO1): Rename from
6796         FeatureIsNotStandardized, because it was about the language level
6797         (1 vs 2) it was not about standarization.
6799         (FeatureRequiresLINQ): New.
6801         * support.cs (SeekableStreamReader): Only require that the reader
6802         is a TextReader, not a StreamReader, so we can plug StringReader. 
6804         * cs-tokenizer.cs (parse_type_and_parameter): Returns true if at a
6805         given position in the input stream the following tokens can be
6806         parsed as a type followed by an identifier.
6808         (is_punct): after a '(' if parse_type_and_parameter returns true,
6809         then return a special token OPEN_PARENS_LAMBDA which is used to
6810         avoid reduce/reduce errors in the grammar for the
6811         lambda_expression rules.
6813         (parse_type): implement a type parser inside the
6814         tokenizer, the parser only returns true or false depending on
6815         whether the input at a given position can be parsed as a type.
6817         (peek_token): new method used during type parsing.
6819 2007-01-28  Raja R Harinath  <rharinath@novell.com>
6821         Fix #80531
6822         * anonymous.cs (ScopeInfo.InflateParameters): New.
6823         (AnonymousContainer.Resolve): Use it to redirect types of
6824         delegate parameters.
6826 2007-01-27  Raja R Harinath  <rharinath@novell.com>
6828         Fix #80530
6829         * expression.cs (Error_InvalidArguments): Don't use two different
6830         messages for CS1503.  Use ExtraInformation and
6831         SymbolRelatedToPreviousError instead.
6833         Fix #80358
6834         * decl.cs (DeclSpace.initialize_type_params): Don't access
6835         'type_params' of a partial class directly.
6837 2007-01-26  Miguel de Icaza  <miguel@novell.com>
6839         * constant.cs: Removed a handful of out-of-range checks that were
6840         not necessary. 
6842 2007-01-25  Marek Safar  <marek.safar@gmail.com>
6844         * expression.cs (CheckUselessComparison): Add additional check for char
6845         constants.
6847         * namespace.cs: Fixed typo.
6849 2007-01-23  Miguel de Icaza  <miguel@novell.com>
6851         * constant.cs: Bloat removal, CheckRange and CheckUnsigned are
6852         gone, instead we inline the test, preventing the needless casts to
6853         longs, ulongs and doubles for the parameters, avoiding calls to
6854         methods that overchecked stuff, and instead inlined things
6855         nicely. 
6857 2007-01-20  Marek Safar  <marek.safar@gmail.com>
6859         * cs-parser.jay: Better parameter error handling.
6861 2007-01-17  Marek Safar  <marek.safar@gmail.com>
6863         A fix for bug #80368, #80522
6864         * expression.cs (ArrayCreation.only_constant_initializers): Indicates
6865         whether array initializer contains constants only.
6866         (ArrayCreation.Emit): Use better formula to decide when
6867         are array initializers for static initialization.
6868         (ArrayCreation.EmitDynamicInitializers): When the array is small enough we
6869         have to emit even constants otherwise they are pre-initialized.
6871 2007-01-17  Bill Holmes  <bill.holmes@ansys.com>
6872             Raja R Harinath  <rharinath@novell.com>
6874         Fix emit order of 'get' vs. 'set'.
6875         * support.cs (Accessors): New.
6876         * cs-parser.jay (accessor_declarations): Use it instead of 'Pair'.
6877         Note the order in which accessors are declared in the source.
6878         * class.cs (PropertyBase.DefineGet, PropertyBase.DefineSet): New.
6879         Refactored from Property.Define and Indexer.Define.
6880         (PropertyBase.DefineAccessors): New helper that calls the above in
6881         appropriate order as noted by the parser.
6882         (Property.Define, Indexer.Define): Update to changes.
6883         (PropertyBase.SetMethod.PropertyInfo): Don't return a null.
6885 2007-01-17  Raja R Harinath  <rharinath@novell.com>
6887         Fix cs0029-6.cs and gcs0029-2.cs (regression)
6888         * ecore.cs (EmptyConstantCast.ConvertImplicitly): Check that
6889         there's an implicit conversion from the current type to the target
6890         type before converting the underlying constant.
6892 2007-01-16  Marek Safar  <marek.safar@gmail.com>
6894         * const.cs (ResolveValue): Updated after constant conversion was made more
6895         generic.
6897         * constant.cs (GetAttributableValue): constant to object conversion is
6898         used for attributes only.
6899         (IntConstant.ConvertImplicitly): Moved from convert to be used in all
6900         constant conversions.
6901         (LongConstant.ConvertImplicitly): Ditto.
6903         * convert.cs (ImplicitNumericConversion): Extracted constant bussiness.
6904         (ImplicitConversionStandard): Handle constant conversion as extra step.
6905         It solves the issue when constant conversion was called indirectly like
6906         inside array initializer and constant folding was skipped.
6908         * literal.cs (NullLiteral.ConvertImplicitly): Fixed an issue exposed by
6909         this change.
6911         * statement.cs(ImplicitConversionStandard): Updated after constant
6912         conversion was made more generic.
6914 2007-01-16  Sergey P. Kondratyev <se@unicom.tomica.ru>
6916         * expression.cs (As.DoResolve): Use GenericConstraints instead of
6917         Constraints, solves the problem where the compiler incorrectly
6918         reported that a type parameter was not constrained to a class (Bug
6919         80518)
6921 2007-01-14  Marek Habersack  <grendello@gmail.com>
6923         * doc-bootstrap.cs: Fix a compilation problem in the bootstrap phase.
6925 2007-01-14  Marek Safar  <marek.safar@gmail.com>
6927         A fix for bug #80368
6928         * assign.cs (FieldInitializer): New class implements field
6929         initializer statement.
6931         * attribute.cs: Update after FieldMember rename.
6933         * class.cs (PropertyBasedMember): New common class for property based
6934         types.
6935         (InterfaceMemberBase): New base class for all members which can be used as
6936         an interface members.
6937         (MethodCore): Moved really common code to InterfaceMemberBase.
6938         (Method.Define): Equal and GetHasCode detection is relevant for methods
6939         only.
6940         (MethodData.Define): Don't assume that public event implements an
6941         interface automatically.
6942         (MethodData.DefineMethodBuilder): Issue an error even if only extern
6943         modifier is used.
6944         (MemberBase): Moved all interface speficic code to InterfaceMemberBase.
6945         (FieldMember): Merged with FieldBase.
6946         (EventProperty.AEventPropertyAccessor): New specialization to check whether
6947         event extern modifier can be used.
6948         (EventField.EventFieldAccessor): Moved event field specific code here.
6949         (Event.AllowedModifiers): Even event can be extern.
6950         (Event.FindOutBaseMethod): New override specific to events.
6951         (Indexer.parameters): Reintroduce parameters because base class holds
6952         only properties common data.
6953         (Indexer.CheckForDuplications): Indexers are threated as methods so we
6954         need do extra parameters check.
6956         * const.cs: Update after FieldMember rename.
6958         * decl.cs (MemberCache.FindBaseEvent): New method.
6960         * doc.cs (GetMethodDocCommentName): Accept parameters as extra argument
6961         to reflect that indexer is now derived from PropertyBased.
6963         * ecore.cs (GetMemberType): Made public.
6964         (EventExpr.ResolveMemberAccess): Use right event cache and checks for
6965         obsolete event.
6967         * flowanalysis.cs, statement.cs: Update after FieldMember rename.
6968         
6969         * typemanager.cs (CSharpSignature): Correctly print event accessors.
6970         (RegisterEvent): Removed.
6971         (RegisterPrivateFieldOfEvent): Renamed to RegisterEventField.
6972         (GetPrivateFieldOfEvent): Renamed to GetEventField.
6974 2007-01-11  Raja R Harinath  <rharinath@novell.com>
6976         Fix #80249
6977         * statement.cs (CollectionForeach.TryType): Prefer generic
6978         GetEnumerator over non-generic variant.  Fix code to follow comments.
6980 2007-01-09  Raja R Harinath  <rharinath@novell.com>
6982         Fix #80446
6983         * support.cs (ReflectionParameter): Don't use an invalid index on
6984         the generic parameter data.
6986 2007-01-08  Miguel de Icaza  <miguel@novell.com>
6988         * driver.cs: Just add a tiny bit of infrastructure.
6990 2007-01-02  Marek Safar  <marek.safar@gmail.com>
6992         * class.cs (VerifyMembers): Fixed an crash reported on mono mailing list
6993         where field type is struct from current assembly.
6994         
6995         * ecore.cs (EnumConstant.AsString): Report an enum member name whenever
6996         it is possible.
6998 2007-01-02  Marek Safar  <marek.safar@gmail.com>
7000         A fix for bug #80381
7001         * attribute.cs (AttributeTester.RegisterNonObsoleteType): Registers
7002         the core types.
7004         * namespace.cs (GlobalRootNamespace.LookupTypeReflection): Better error
7005         messages.
7006         (Namespace.LookupType): Always use core types from corlib when speficied.
7008         * report.cs: A new warning.
7010         * rootcontext.cs (BootstrapCorlib_ResolveInterface,
7011         BootstrapCorlib_ResolveClass): Register type as non-obsolete type.
7012         (ResolveCore): Add missing System.Runtime.InteropServices._Attribute.
7014         * typemanager.cs (CoreLookupType): Register type as non-obsolete type.
7015         (InitCoreTypes): Set expression type of object_type and value_type
7016         immediately after lookup.
7018 2007-01-01  Miguel de Icaza  <miguel@novell.com>
7020         * cs-tokenizer.cs: Accept Pc class characters (Connector
7021         Punctuation) as valid identifiers.  Fixes #78259
7023         * expression.cs (Invocation.DoResolve): Moved the check for the
7024         use of `this' for doing method calls to the Invocation resolution
7025         step, after overload resolution has taken place instead of doing
7026         the check at the low-level `This.DoResolve' level.
7028         The `This.DoResolve'(appens before overload resolution, so it has
7029         no way of knowing if the method that will be called will be
7030         instace or static, triggering an erroneous report for cs0188 (Bug
7031         78113).
7033         We now do the check for instance method invocations after we know
7034         what method will be called.
7036         (This.CheckThisUsage): Move the actual use of this structure
7037         checking into its own method and expose it. 
7039         * Everywhere that called Error_ValueCannotBeConverted: pass a new
7040         EmitContext.
7042         Exceptions: Null.ConvertImplicitly,
7043         Constant.ImplicitConversionRequired as there are too many call
7044         sites for passing the ec. 
7046         * ecore.cs (Expression.Error_ValueCannotBeConverted): Take an
7047         EmitContext, if the value is null, then we do not try to provide
7048         the extra information from the error (If a userdefined conversion
7049         exists, as UserDefinedConversion requires a non null-EmitContext).
7051         Fixes: #80347
7053 2006-12-30  Raja R Harinath  <rharinath@novell.com>
7055         * flowanalysis.cs (MyBitVector): Document some invariants.
7056         (MyBitVector.Or, MyBitVector.And): Reimplement the optimizations
7057         introduced below, and add a couple of others, 
7059 2006-12-30  Marek Safar  <marek.safar@gmail.com>
7061         * attribute.cs (GetMethodObsoleteAttribute): Uses new
7062         GetPropertyFromAccessor and GetEventFromAccessor.
7063         
7064         * class.cs (MethodCore.CheckBase): A new warning when obsolete member
7065         overrides non-obsolete one.
7066         (Indexer.Define): Error message has been moved to the parser.
7068         * cs-parser.jay: Better syntax errors handling.
7070         * delegate.cs (NewDelegate.DoResolve): Issue less confusing error message
7071         when an invocation has no arguments.
7073         * ecore.cs: Removed not used caching.
7075         * expression.cs (IsSpecialMethodInvocation): Reuses TypeManager
7076         implementation.
7078         * report.cs: Add a new warning.
7080         * support.cs (ReflectionParameters): Implements Equals, GetHashCode.
7082         * typemanager.cs (enumeration_type): Removed.
7083         (CSharpSignature): Reuses IsSpecialMethod.
7084         (IsEqual): Hack for MS BCL.
7085         (GetPropertyFromAccessor): New method.
7086         (GetEventFromAccessor): New method.
7087         (IsSpecialMethod): Fixed to handle more cases.
7089 2006-12-30  Marek Safar  <marek.safar@gmail.com>
7091         * cs-tokenizer.cs (PreProcessDefinition, handle_preprocessing_directive):
7092         Made white spaces array static.
7094         * ecore.cs (RemoveGenericArity): Optimized.
7096         * flowanalysis.cs (MyBitVector.Or, MyBitVector.And): Optimized (up to
7097         10 times faster).
7098         (MyBitVector.initialize_vector): Simplified.
7100 2006-12-22  Miguel de Icaza  <miguel@novell.com>
7102         * ecore.cs: Am not entirely happy with this hack, but it seems to
7103         address the issue in 80257 (a small test case for
7104         CreativeDocs.NET). 
7106         I set the MethodGroupExpr.Type to an internal compiler type
7107         (itself in this case) to force the resolution to take place.   Why
7108         it does not take place with a null is beyond me.
7110 2006-12-20  Marek Safar  <marek.safar@gmail.com>
7112         A fix for bug #80288
7113         * expression.cs (ResolveOperator): Consider user defined conversion for
7114         logical and operator too.
7115         (EmitBranchable): Optimization for logical and when full constant folding
7116         could not be applied but one operand is constant.
7118 2006-12-19  Marek Safar  <marek.safar@gmail.com>
7120         * class.cs (GetClassBases): Write 5 times every day, will never use
7121         FullName for error reporting.
7123         * decl.cs (AsAccessible, CheckAccessLevel): Always unpack arrays first.
7125 2006-12-19  Martin Baulig  <martin@ximian.com>
7127         * statement.cs (LocalInfo.EmitSymbolInfo): New public method; emit
7128         the symbol file info here.
7130 2006-12-18  Marek Safar  <marek.safar@gmail.com>
7132         * cs-tokenizer.cs (handle_preprocessing_directive): When previous section
7133         of `elseif' is taking then following sections are not taking.
7134         Fixes an issue reported on mono mailing list.
7136 2006-12-18  Marek Safar  <marek.safar@gmail.com>
7138         A fix for bug #80300
7139         * cs-tokenizer.cs (PreProcessDefinition): Do no define/undefine when
7140         a caller is not taking.
7142 2006-12-18  Raja R Harinath  <rharinath@novell.com>
7144         * anonymous.cs: Change several TypeContainer declarations to DeclSpace.
7145         (CompilerGeneratedClass): Use parent.PartialContainer unconditionally.
7146         (RootScopeInfo, AnonymousMethodMethod): Update to changes.
7147         * iterator.cs: Change several TypeContainer declarations to DeclSpace.
7148         * class.cs: Update to changes.
7150 2006-12-17  Marek Safar  <marek.safar@gmail.com>
7152         A fix for bug #79934
7153         * anonymous.cs (CompilerGeneratedClass): Register class in a shared
7154         partial container.
7156         * class.cs (ResolveMembers): Register an iterator in current container and
7157         not in shared one.
7159 2006-12-16  Raja R Harinath  <rharinath@novell.com>
7161         Fix test-543.cs
7162         * expression.cs (VerifyArgumentsCompat): Allow zero arguments to
7163         satisfy a params annotated parameter.
7165 2006-12-16  Marek Safar  <marek.safar@gmail.com>
7167         A fix for bug #77014
7168         * expression.cs (Invocation.BetterFunction): Fixed to cope with dynamic
7169         paramters correctly and not rely on hacks in Parameters class.
7170         (Invocation.IsParamsMethodApplicable): Changed to accept params parameter
7171         at any possition.
7172         (Invocation.VerifyArgumentsCompat): Ditto.
7173         (Invocation.EmitArguments): Changed to correctly emit params arguments at
7174         any possition.
7176         * parameter.cs (HasParams): Don't assume that params is the last one.
7178         * support.cs (ReflectionParameters.ctor): Look for params attribute
7179         correctly.
7180         (ReflectionParameters.ParameterType): Removed hack when we returned last
7181         parameter for out of range parameters.
7182         (ParameterName, ParameterModifier): Ditto.
7184 2006-12-14  Marek Safar  <marek.safar@gmail.com>
7186         A fix for bug #79987
7187         * decl.cs (DeclSpace.VerifyClsCompliance): External names cache is null
7188         when assembly is not CLS compliant but type is. I have no idea why is this
7189         allowed.
7191         * typemanager.cs (Reset): Invalidate AllClsTopLevelTypes cache.
7193 2006-12-13  Miguel de Icaza  <miguel@novell.com>
7195         * class.cs (ConstructorInitializer.Resolve): Allow for ":this()"
7196         in struct constructors, they are basically no-ops.
7198 2006-12-12  Marek Safar  <marek.safar@gmail.com>
7200         * cs-tokenizer.cs (Position): Save preprocessor status too.
7202 2006-12-12  Marek Safar  <marek.safar@gmail.com>
7204         A fix for bug #77794
7205         * cs-tokenizer.cs (consume_identifier): Check for correct partial context.
7207 2006-12-12  Marek Safar  <marek.safar@gmail.com>
7209         * cs-tokenizer.cs (get_cmd_arg): Support CR as the line terminator.
7210         Fixes #69299.
7211         (pp_expr): Report error for an invalid expression.
7212         (handle_preprocessing_directive): Simplified; add more error checking.
7214 2006-12-11  Marek Safar  <marek.safar@gmail.com>
7216         A fix for bug #74939
7217         * cs-tokenizer.cs (is_punct): We cannot simply disable preprocessor
7218         directives handling.
7220 2006-12-10  Marek Safar  <marek.safar@gmail.com>
7222         A fix for bugs #80093, and #75984
7223         * cs-tokenizer.cs (handle_preprocessing_directive): Fixed #if/#else/#endif
7224         logic, it seems to me as it worked before "by coincidence".
7225         (xtoken): Simplified to use reworked handle_preprocessing_directive.
7226         (cleanup): Enabled endif check.
7228 2006-12-09  Marek Safar  <marek.safar@gmail.com>
7230         A fix for bug #80162
7231         * statement.cs (CollectionForeach.TryType): Generics and non-generics
7232         enumerators are never ambiguous.
7234 2006-12-08  Raja R Harinath  <rharinath@novell.com>
7236         Fix #80060
7237         * cs-tokenizer.cs (parse_less_than): Recognize double-colons too.
7239 2006-12-06  Marek Safar  <marek.safar@gmail.com>
7241         A fix for bug #80144
7242         * class.cs (EventProperty.Define): Explicit implementation means
7243         that an even is used.
7245 2006-12-06  Marek Safar  <marek.safar@gmail.com>
7247         Fixes the operators implementation (part II)
7249         * cfold.cs (DoConstantNumericPromotions): Renamed to
7250         DoBinaryNumericPromotions and simplified.
7251         (BinaryFold): Couple of conversion fixes; simplified.
7253         * constant.cs, ecore.cs, literal.cs
7254         (ToType): Renamed to ConvertImplicitly.
7255         (Reduce): Renamed to ConvertExplicitly.
7257         * class.cs, convert.cs: Updated.
7259         * expression.cs: TryReduce doesn't throw an exception.
7261 2006-12-01  Marek Safar  <marek.safar@gmail.com>
7263         A fix for bug #80108
7264         * ecore.cs (EventExpr.EmitAddOrRemove): Don't crash when right side is not
7265         compatible.
7267 2006-11-30  Marek Safar  <marek.safar@gmail.com>
7269         Fixes unary operators implementation (part I)
7270         Also fixes #80026
7272         * cfold.cs (Error_CompileTimeOverflow): Made internal
7274         * const.cs (IConstant): Changed to use reference to constant and
7275         not constant itself.
7276         Updated IConstant implementations.
7278         * constant.cs (CreateConstant): New factory method.
7279         Updated IConstant implementation.
7281         * convert.cs (ImplicitStandardConversionExists): Uses compiler Equals.
7283         * ecore.cs: Updated to use CreateConstantReference.
7285         * enum.cs: Reflects IConstant changes.
7287         * expression.cs (Unary): Reimplemented +,-,~ to conform C# standard.
7289         * literal.cs (NullConstant): Change to be independently usable.
7291 2006-11-29  Martin Baulig  <martin@ximian.com>
7293         * class.cs (Constructor.Emit): Correctly handle anonymous methods;
7294         we need to emit the scope initializer before calling the base .ctor.
7296         * anonymous.cs: Merged back from the new anonymous methods branch.
7297         (AnonymousMethodHost): Renamed to `RootScopeInfo'.
7299         * expression.cs (ParameterReference.DoResolveBase): Create a
7300         "normal" ScopeInfo when capturing parameters rather than using the
7301         root scope; this makes things work with anonymous methods having
7302         parameters.
7304         * statement.cs
7305         (ToplevelBlock.AnonymousMethodHost): Renamed into `RootScope'.
7307 2006-11-22  Marek Safar  <marek.safar@gmail.com>
7309         A fix for bug #79987
7310         * class.cs (VerifyClsCompliance): Move redundant CLS compliance attribute
7311         check to a base class.
7312         * decl.cs (VerifyClsCompliance): Warn that CLS compliance cannot be tested
7313         only when assembly has missing attribute.
7314         * report.cs: Update.
7316 2006-11-21  Marek Safar  <marek.safar@gmail.com>
7318         * cs-tokenizer.cs: Merged with gmcs version.
7320 2006-11-20  Marek Safar  <marek.safar@gmail.com>
7322         * cs-tokenizer.cs,
7323         * cs-parser.jay: Better error message when partial keyword is misplaced.
7325 2006-11-19  Gert Driesen  <drieseng@users.sourceforge.net>
7327         A fix for bug #79810
7328         report.cs: CS1058 only applies to 2.0 profile (gmcs).
7329         codegen.cs: on 2.0 profile, non-exception throwables are wrapped in
7330         a RuntimeWrappedException by default.
7332 2006-11-18  Marek Safar  <marek.safar@gmail.com>
7334         A fix for bug #79843
7335         * delegate.cs (Delegate.VerifyMethod): Fixed covariance and contravariance
7336         implementation.
7337         (DelegateCreation.Error_NoMatchingMethodForDelegate): Ditto.
7339 2006-11-18  Marek Safar  <marek.safar@gmail.com>
7341         * driver.cs, namespace.cs: Uses faster IndexOf version.
7343 2006-11-17  Marek Safar  <marek.safar@gmail.com>
7345         A fix for bug #79941
7346         * class.cs (MemberCore.IsDuplicateImplementation): Add more tricks for
7347         operators.
7348         (Operator.Define): Implicit/Explicit operator of same type is duplicate
7349         even if internal name is different.
7350         * convert.cs (GetConversionOperator): Replaced EmitContext with parentType.
7351         (UserDefinedConversion): Simplified as the operators cannot be internal.
7352         * ecore.cs (Error_ValueCannotBeConverted): Take account of user
7353         conversions.
7354         (MethodLookup): Replaced EmitContext with parentType.
7355         * expression.cs: Updated.
7357 2006-11-09  Raja R Harinath  <rharinath@novell.com>
7359         * driver.cs (BadAssembly): Handle all the ugliness of
7360         DefineDynamicAssembly.
7362 2006-11-08  Raja R Harinath  <rharinath@novell.com>
7364         Address parts of #58244 -- most of what's left is in the runtime
7365         * driver.cs (LoadAssembly): Simplify slightly.  Add CS0009 and
7366         CS1509 error checks, and handle them for all assembly loads, not
7367         just the first invocation.
7368         (LoadModule): Likewise.  Move handling of 'adder_method' ...
7369         * codegen.cs (AssemblyClass.AddModule): ... here.
7371 2006-11-02  Marek Safar  <marek.safar@gmail.com>
7373         * statement.cs.cs (CollectionForeach.TryType): Issue a error when
7374         IEnumerable<T> is ambiguous.
7376 2006-10-31  Marek Safar  <marek.safar@gmail.com>
7378         A fix for bug #67689
7379         * statement.cs.cs (CollectionForeach.TryType): Issue a warning when
7380         GetEnumerator is ambiguous.
7382         * report.cs: Add new warning.
7384 2006-10-29  Marek Safar  <marek.safar@gmail.com>
7386         A fix for bug #78602
7387         ecore.cs (PropertyExpr.InstanceResolve): The qualifier for access
7388         to protected member can be nested type.
7390 2006-10-28  Marek Safar  <marek.safar@gmail.com>
7392         A fix for bug #78965
7393         ecore.cs (PropertyExpr.InstanceResolve): The qualifier for access
7394         to protected member must derive from current type.
7396 2006-10-27  Marek Safar  <marek.safar@gmail.com>
7398         assign.cs: Reuses error method.
7400         ecore.cs (Expression.Error_ValueCannotBeConverted): Report a value
7401         instead of type for constants.
7402         (Expression.Error_ValueAssignment): Common error method.
7404         * expression.cs (UnaryMutator.ResolveOperator): Value cannot be used
7405         for any assignment.
7407 2006-10-27  Marek Safar  <marek.safar@gmail.com>
7409         A fix for bug #79081
7410         * expression.cs (MemberAccess.DoResolve): Check nested type
7411         accessibility.
7413 2006-10-27  Atsushi Enomoto  <atsushi@ximian.com>
7415         * doc.cs : nested delegates were not handled. Fixed bug #79754.
7417 2006-10-26  Marek Safar  <marek.safar@gmail.com>
7419         A fix for bug #76591
7420         * cs-tokenizer.cs (IsCastToken): Enable a cast of anonymous method.
7422 2006-10-26  Marek Safar  <marek.safar@gmail.com>
7424         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Don't allow to have
7425         type forwarder of the same type multiple times.
7427 2006-10-26  Raja R Harinath  <rharinath@novell.com>
7429         Fix #78820
7430         * ecore.cs (PropertyExpr.InstanceResolve): Always resolve the
7431         instance as an rvalue, even when we later resolve as an lvalue.
7433 2006-10-25  Martin Baulig  <martin@ximian.com>
7435         * anonymous.cs: Fix #79673.
7437 2006-10-24  Marek Safar  <marek.safar@seznam.cz>
7439         A fix for bug #79666
7440         expression.cs (ArrayCreation.GetAttributableValue): An initializer can be
7441         ignored when is optimized (= default value) as its value is already set.
7443 2006-10-23  Marek Safar  <marek.safar@seznam.cz>
7445         A fix for bug #79724
7446         * report.cs (SymbolRelatedToPreviousError): Uses DeclSpace instead of
7447         TypeContainer for type lookup.
7449 2006-10-23  Marek Safar  <marek.safar@seznam.cz>
7451         A fix for bug #79231
7452         * ecore.cs (ResolveAsBaseTerminal): Removed redundant error test.
7453         * expression.cs (OverloadResolve): Always convert type name for
7454         an error message.
7455         (ResolveNamespaceOrType): Don't confuse a nested type with any 
7456         other member.
7458 2006-10-18  Martin Baulig <martin@ximian.com>
7460         * anonymous.cs: Propagate the IsStatic state, fixes the crasher in banshee.
7462 2006-10-17  Miguel de Icaza  <miguel@novell.com>
7464         * convert.cs: Fix typo, fixes the test-535.cs, we were casting to
7465         an int32, but requesting an int64 from the conversion
7467 2006-10-12  Martin Baulig  <martin@ximian.com>
7469         * anonymous.cs
7470         (AnonymousContainer.Resolve): Inflate the `ReturnType'.  Fixes #79592.
7471         
7472 2006-10-12  Martin Baulig  <martin@ximian.com>
7474         * statement.cs
7475         (Using.EmitLocalVariableDeclFinally): Small fix for iterators.
7477 2006-10-11  Miguel de Icaza  <miguel@novell.com>
7479         * convert.cs: Remove broken code: I was doing the "Existance"
7480         tests for Implicit conversions.
7482 2006-10-10  Miguel de Icaza  <miguel@novell.com>
7484         * convert.cs: Added one missing case in
7485         ImplicitStandardConversionExists uint64 to intptr.
7487         Fixes #59800
7488         
7489         * typemanager.cs (uintptr_type): another core known type.   
7491         * ecore.cs (OperatorCast): routine used to do cast operations that
7492         depend on op_Explicit.  We could change some of the Decimal
7493         conversions to use this.
7495         This one has a probe mechanism that checks both types for an op_
7496         which it coudl be used to eliminate two classes: CastToDecimal
7497         and CastFromDecimal.
7499         * convert.cs: Implement the conversions documented in #59800
7500         
7501 2006-10-10  Martin Baulig  <martin@ximian.com>
7503         * iterators.cs (Iterator.Resolve): Call RootScope.ResolveType()
7504         before RootScope.ResolveMembers().
7506         * anonymous.cs (ScopeInfo.CapturedScope.ctor): Use the child's
7507         `CurrentType' if appropriate.
7509 2006-10-09  Marek Safar  <marek.safar@seznam.cz>
7511         A fix for bug #78568
7512         * cs-tokenizer.cs (Deambiguate_CloseParens): Expression cannot be cast
7513         when contains binary operators.
7514         * cs-parser.jay: Updated.
7516 2006-10-09  Martin Baulig  <martin@ximian.com>
7518         * delegate.cs
7519         (Delegate.DefineType): Don't call TypeParameter.Resolve() here;
7520         moved that into Define() and also do the other type parameter
7521         checks there.  Fixes #79094.  Added gtest-292.cs.
7523         * expression.cs
7524         (ArrayCreation.EmitDynamicInitializers): Use `etype.IsValueType'
7525         since that doesn't include type parameters; don't use `Ldelema'
7526         for type parameters.  Fixes #78980.  Added gtest-293.cs.
7528 2006-10-08  Marek Safar  <marek.safar@seznam.cz>
7530         A fix for #77796
7531         * convert.cs (ExplicitReferenceConversion): Only enum to enum value
7532         conversion is allowed.
7534 2006-10-06  Marek Safar  <marek.safar@seznam.cz>
7536         * ecore.cs (Expression.MemberLookup): Don't register any symbol for
7537         error reporting when no error occurs.
7539 2006-10-06  Marek Safar  <marek.safar@seznam.cz>
7541         * cfold.cs (ConstantFold.BinaryFold): Report an error when the conversion
7542         does not exist.
7544 2006-10-06  Raja R Harinath  <rharinath@novell.com>
7546         Fix #79584
7547         * class.cs (DefineTypeBuilder): Check circular dependencies before
7548         setting the parent of the TypeBuilder.
7549         (CheckRecursiveDefinition): Don't use 'BaseType', since
7550         it may not be valid until after DefineTypeBuilder.  Use
7551         'base_type' instead.
7553 2006-10-04  Martin Baulig  <martin@ximian.com>
7555         Merged the Anonymous Methods patch.
7557         * anonymous.cs, iterators.cs: The new anonymous methods code.
7559         * statement.cs (Variable): New public abstract class.
7560         (LocalInfo.Variable): New public property.
7561         (LocalInfo.ResolveVariable): New public method.
7562         (Block.Flags): Add `IsIterator'.
7563         (Block.AddVariable): Improved the CS0136 check.
7564         (Block.AnonymousChildren): New public property.
7565         (Block.AddAnonymousChild): New public method.
7566         (ToplevelBlock): Update to use the new anonymous method framework.
7567         (ToplevelBlock.ctor): `container' is now a `Block' and not a
7568         `ToplevelBlock'; this is required to correctly implement the
7569         CS0136 check.
7570         (Fixed, Using): Use `TemporaryVariable' instead of directly
7571         creating the `LocalBuilder'.
7573         * parameter.cs (Parameter.ResolveVariable): New public method.
7574         (Parameters.ResolveVariable): Likewise.
7576         * ecore.cs (TemporaryVariable): Use the new `Variable' framework.
7578         * class.cs (TypeContainer): Replaced the `iterators' list and
7579         corresponding methods with a list of `CompilerGeneratedClass'es.
7580         (TypeContainer.ResolveMembers): New public method.
7581         (Method): `IIteratorContainer' has been replaced by
7582         `IAnonymousHost'.
7584         * expression.cs (VariableReference): New public abstract base
7585         class for `LocalVariableReference', `ParameterReference' and
7586         `This'.
7588         * codegen.cs (EmitContext): Removed `capture_context',
7589         `HaveCaptureInfo', `EmitScopeInitFromBlock()' and `Capture*()'.
7590         (EmitContext.EmitThis): Removed.
7592         * cs-parser.jay: Replace `iterator_container' with
7593         `anonymous_host'.       
7595 2006-10-04  Martin Baulig  <martin@ximian.com>
7597         * generic.cs (GenericMethod): Don't make this abstract.
7598         (Constraints.Clone): Added dummy implementation.
7600 2006-10-04  Raja R Harinath  <harinath@gmail.com>
7602         Fix #79577
7603         * namespace.cs (LookForAnyGenericType): Avoid nullref on
7604         'declspaces'.  Avoid allocating arrays willy-nilly.
7606         Fix #79553
7607         * cfold.cs (BinaryFold): Move boolean Equality and Inequality
7608         cases out of the switch.
7610 2006-09-28  Marek Safar  <marek.safar@seznam.cz>
7612         * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Better error
7613         message when non-generic type is used with the type arguments.
7614         * expression.cs: Updated.
7616 2006-09-28  Raja R Harinath  <rharinath@novell.com>
7618         Fix #79013
7619         * convert.cs (Convert.ImplicitStandardConversionExists): Avoid infloop.
7620         * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
7621         Change semantics slightly.  Don't insist on having only one
7622         temporary EmptyExpression -- just throttle the creation of new ones.
7624         Fix #79451
7625         * ecore.cs (Expression.MemberLookup): Enable CS0229 errors for
7626         non-interfaces too.  If no methods are found, don't try to create
7627         a MethodGroupExpr.
7629 2006-09-28  Marek Safar  <marek.safar@seznam.cz>
7631         * ecore.cs (ResolveAsTypeStep): Print better error when type can be
7632         generic type.
7634         * namespace.cs (Namespace.LookForAnyGenericType): New method to help
7635         us produce better error message.
7637 2006-09-27  Marek Safar  <marek.safar@seznam.cz>
7639         * expression.cs (Binary.ResolveOperator): Warn about a side effect
7640         of the `|' operator.
7642         * report.cs: A new warning added.
7644 2006-09-27  Martin Baulig  <martin@ximian.com>
7646         * generic.cs (GenericMethod): Don't make this abstract.
7648 2006-09-27  Martin Baulig  <martin@ximian.com>
7650         * report.cs
7651         (InternalErrorException): Added overloaded ctor taking a params array.
7653 2006-09-26  Marek Safar  <marek.safar@seznam.cz>
7655         * class.cs, codegen.cs, const.cs, cs-tokenizer.cs, driver.cs, ecore.cs:
7656         Fixed the cases when same error was reported twice.
7658         * report.cs (SymbolRelatedToPreviousError): Simplified as all our messages
7659         now report symbol information.
7661 2006-09-25  Martin Baulig  <martin@ximian.com>
7663         * class.cs: Completely unified with the gmcs version.
7665 2006-09-25  Martin Baulig  <martin@ximian.com>
7667         * typemanager.cs (TypeManager.IsNullableType): New public function.
7668         (TypeManager.IsNullableTypeOf): Likewise.
7669         (TypeManager.IsNullableValueType): Likewise.
7671         * class.cs (MethodCore): Added the `GenericMethod' argument from
7672         gmcs and also unified all classes derived from `MethodCore' with gmcs.
7674 2006-09-24  Raja R Harinath  <harinath@gmail.com>
7676         * convert.cs: Unify with gmcs version.
7678 2006-09-24  Marek Safar  <marek.safar@seznam.cz>
7680         * decl.cs (DeclSpace.VerifyClsCompliance): When type has type parameters
7681         verify them as well.
7683         * report.cs: New warning.
7685 2006-09-24  Marek Safar  <marek.safar@seznam.cz>
7687         * anonymous.cs (AnonymousMethod.Compatible): Cannot generate arguments
7688         for anonymous block with out argument.
7690 2006-09-24  Marek Safar  <marek.safar@seznam.cz>
7692         * class.cs (ClassOrStruct.VerifyMembers): Fixed to report correctly
7693         not used private events only.
7695 2006-09-23  Marek Safar  <marek.safar@seznam.cz>
7697         * cfold.cs (BinaryFold): On the guest to unify empty constant cast.
7699         * const.cs (Const.Define): Check for constant type.
7700         (Const.IsConstantTypeValid): Looks for valid constant types.
7702         * convert.cs (ImplicitReferenceConversion): NullCast to EmptyConstantCast.
7704         * ecore.cs (EmptyConstantCast): New common class for all constant based
7705         EmptyCast(s).
7707         * expression.cs (Is.DoResolve): Handle null constant especially.
7708         (New.DoResolve): Check for new void().
7709         (MemberAccess.DoResolve): Cope with all kind of nulls.
7711         * literal.cs (NullConstant): Uses EmptyConstantCast.
7712         (NullDefault): Based on EmptyConstantCast.
7713         (NullLiteral): Uses EmptyConstantCast.
7715         * statement.cs (Block.ResolveMeta): Check for constant type.
7717 2006-09-22  Martin Baulig  <martin@ximian.com>
7719         * delegate.cs, attribute.cs: Merged with the gmcs versions.
7721 2006-09-22  Raja R Harinath  <rharinath@novell.com>
7723         * literal.cs (NullDefault): The type of default(IFoo) is 'IFoo',
7724         not the null type.
7726         Fix part of #79451
7727         * typemanager.cs (Closure.Filter): Consider PrivateScope attributes.
7728         * decl.cs (DeclSpace.FindMemberToOverride): Likewise.  Reorganize
7729         code slightly.
7731 2006-09-22  Martin Baulig  <martin@ximian.com>
7733         * ecore.cs: Merged with the gmcs version.
7735         * generic.cs (ConstructedType): New dummy class.
7736         (TypeArguments): Don't make this abstract.
7738         * typemanager.cs
7739         (TypeManager.IsGenericTypeDefinition): New method.
7740         (TypeManager.GetGenericFieldDefinition): Moved here from gmcs.
7742 2006-09-22  Raja R Harinath  <rharinath@novell.com>
7744         * expression.cs (ComposedCast): Check for arrays of TypedReference
7745         before creating the type, not after.
7747 2006-09-21  Marek Safar  <marek.safar@seznam.cz>
7749         * cfold.cs, const.cs, enum.cs, statement.cs: Updated
7750         after ToType change.
7752         * constant.cs (Constant.ImplicitConversionRequired): Designed to used
7753         when constant must be implicitly convertible.
7755         * convert.cs (ImplicitReferenceConversion): Reuse ToType.
7757         * ecore.cs (NullCast): Derives from NullConstant.
7759         * expression.cs (Is.DoResolve): Removed useless variables.
7760         (Conditional.DoResolve): Quick hack for `Foo () ? null : null'.
7761         (New.Constantify): Add enum support.
7762         (MemberAccess.DoResolve): Add warning when accessing null constant or
7763         variable.
7765         * generic.cs (GenericConstraints.IsReferenceType): Another dummy
7766         property.
7768         * literal.cs (NullConstant): New abstract class with common
7769         functionality for all null specializations.
7770         (NullDefault): Represents default(X) when result can be
7771         reduced to null.
7772         (NullLiteral): Updated.
7774         * report.cs: Add new warning.
7776 2006-09-21  Martin Baulig  <martin@ximian.com>
7778         * generic.cs (GenericTypeParameterBuilder): Removed this ugly hack.
7780 2006-09-21  Martin Baulig  <martin@ximian.com>
7782         * generic.cs (GenericConstraints): New dummy class.
7783         (Constraints): Likewise.
7784         (TypeParameter): Likewise.
7785         (TypeParameterName): Likewise.
7786         (GenericMethod): Likewise.
7788         * typemanager.cs (TypeManager.GetGenericArguments): New method.
7790         * decl.cs: Merged with the gmcs version.
7792 2006-09-21  Raja R Harinath  <rharinath@novell.com>
7794         * generic.cs (TypeParameter): Implement IMemberContainer.
7795         (GenericTypeParameterBuilder): New.  An abominable repugnant hack.
7797         * rootcontext.cs: Unify with gmcs version.
7799         * report.cs: Unify with gmcs version.
7800         * typemanager.cs (AddTypeParameter, LookupTypeParameter): Move
7801         from gmcs/generics.cs.
7802         * generics.cs (TypeParameter): New dummy class.
7804         * support.cs: Unify with gmcs version.
7806 2006-09-20  Raja R Harinath  <rharinath@novell.com>
7808         * ecore.cs (MethodGroupExpr.ResolveGeneric): New dummy method.
7809         * expression.cs (MemberAccess, BaseAccess): Remove GMCS_SOURCE #ifdef.
7811         * decl.cs (MemberName): Unify with gmcs, except for GetTypeExpression.
7812         * generic.cs (TypeArguments): New dummy class to help avoid #ifdefs.
7813         * mcs.exe.sources: Add generic.cs.
7815         * codegen.cs: Unify with gmcs version.
7817         * codegen.cs (IResolveContent.GenericDeclContainer): Copy from gmcs.
7818         (EmitContext): Add GenericDeclContainer implementation.
7819         * decl.cs (MemberCore, DeclSpace): Likewise.
7820         * namespace.cs: Remove #ifdef GMCS_SOURCE.
7822         * namespace.cs (GetTypeInAssembly): Remove #ifdef GMCS_SOURCE.
7823         MCS TypeManager has a corresponding dummy method.
7825 2006-09-19  Martin Baulig  <martin@ximian.com>
7827         * expression.cs: Completely merged with the gmcs version.
7829 2006-09-19  Martin Baulig  <martin@ximian.com>
7831         * expression.cs (Invocation): Merged with the gmcs version.
7832         (ArrayAccess.GetStoreOpcode): Likewise.
7834 2006-09-19  Martin Baulig  <martin@ximian.com>
7836         * typemanager.cs
7837         (TypeManager.IsGenericMethod): Moved here from ../gmcs/generic.cs.
7838         (TypeManager.IsGenericMethodDefinition): Likewise.
7840 2006-09-19  Martin Baulig  <martin@ximian.com>
7842         * typemanager.cs
7843         (TypeManager.IsEqual): Moved the gmcs implementation here.
7844         (TypeManager.DropGenericTypeArguments): Likewise.
7845         (TypeManager.DropGenericMethodArguments): Likewise.
7846         (TypeManager.GetTypeArguments): Moved here from gmcs.
7847         (TypeManager.HasGenericArguments): Likewise.
7849 2006-09-19  Martin Baulig  <martin@ximian.com>
7851         * expression.cs (Binary): Merged with the gmcs version.
7853 2006-09-19  Martin Baulig  <martin@ximian.com>
7855         * expression.cs (Probe, As, Is): Merged with the gmcs version.
7857 2006-09-19  Martin Baulig  <martin@ximian.com>
7859         * typemanager.cs: Merged with the gmcs version.
7861 2006-09-16  Raja R Harinath  <rharinath@novell.com>
7863         * AssemblyInfo.cs [GMCS_SOURCE]: Unify with gmcs source.
7864         * driver.cs: Likewise.
7866 2006-09-16  Marek Safar  <marek.safar@seznam.cz>
7868         A fix for #79401
7869         * class.cs (MethodCore.VerifyClsCompliance): Do check for abstract members
7870         only if parent type is class.
7871         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Fixed missing cache
7872         update.
7874 2006-09-15  Marek Safar  <marek.safar@seznam.cz>
7876         * cs-parser.jay,
7877         * expression.cs(MemberAccess.DoResolve): Don't crash when not allowed
7878         keywords are used.
7879         * typemanager.cs(CSharpName): Converts NullType to null.
7881 2006-09-15  Martin Baulig  <martin@ximian.com>
7883         * typemanager.cs
7884         (TypeManager.GetMethodName): Added mcs implementation.
7885         (TypeManager.IsEqual): Likewise.
7887         * ecore.cs
7888         (SimpleName.RemoveGenericArity): Added dummy implementation.
7890         * pending.cs: Merged with the gmcs version.     
7892 2006-09-15  Martin Baulig  <martin@ximian.com>
7894         * statement.cs: Merge with the gmcs version.
7896 2006-09-15  Martin Baulig  <martin@ximian.com>
7898         * statement.cs (Switch): Merge with the gmcs implementation
7899         (without nullables), which is newer.
7901 2006-09-15  Martin Baulig  <martin@ximian.com>
7903         * statement.cs (Block.Variables): Make this public.
7904         (ToplevelBlock.Parameters): Make this a property.
7905         (Throw.Resolve): Use `TypeManager.IsSubclassOf ()'.
7907 2006-09-15  Martin Baulig  <martin@ximian.com>
7909         * namespace.cs: Merge with the gmcs version.
7911 2006-09-15  Martin Baulig  <martin@ximian.com>
7913         * decl.cs (MemberName): Minor code cleanups.
7915 2006-09-15  Martin Baulig  <martin@ximian.com>
7917         * parameter.cs: Merge with the gmcs version.
7919 2006-09-15  Martin Baulig  <martin@ximian.com>
7921         * enum.cs: Merge with the gmcs version: 3005 is a warning in gmcs
7922         and an error in mcs.
7924 2006-09-15  Martin Baulig  <martin@ximian.com>
7926         * flowanalysis.cs: Merged from GMCS; added the generics code into
7927         a `GMCS_SOURCE' conditional so we can share this file.
7929 2006-09-08  Martin Baulig  <martin@ximian.com>
7931         * typemanager.cs (TypeManager.interlocked_type): New public field.
7932         (TypeManager.int_interlocked_compare-exchange): New public field.
7933         (TypeManager.InitEnumUnderlyingTypes): Also initialize the
7934         enumerator types here and call InitGenericCoreTypes().
7935         (TypeManager.InitCoreTypes): Call InitEnumeratorTypes() right
7936         after calling InitEnumUnderlyingTypes().
7938         * rootcontext.cs
7939         (RootContext.ResolveCore): Added `System.Threading.Interlocked' to
7940         `classes_second_stage'. 
7942 2006-09-14  Marek Safar  <marek.safar@seznam.cz>
7944         * assign.cs, ecore.cs, expression.cs: Share error message text.
7945         * class.cs (FieldMember.Define): Check for varible of static type.
7946         * driver.cs (LoadAssembly): Uses error output for errors.
7947         * statement.cs: Updated.
7949 2006-09-08  Marek Safar  <marek.safar@seznam.cz>
7951         * expression.cs (Error_OperatorCannotBeApplied): Report type instead of
7952         type instance.
7954 2006-09-07  Martin Baulig  <martin@ximian.com>
7956         * driver.cs
7957         (MainDriver): Revert r62663 from Marek; see #70506 for details.
7959 2006-08-29  Miguel de Icaza  <miguel@novell.com>
7961         * cs-parser.jay: Turn 1522 into a warning, instead of an error #79210
7962         
7963 2006-08-17  Miguel de Icaza  <miguel@novell.com>
7965         * cs-tokenizer.cs: Apply patch from Atsushi Enomoto that fixes
7966         #52019 and #79064, the use of the \uXXXX sequence in source code
7967         to represent unicode characters.
7969 2006-08-15  Marek Safar  <marek.safar@seznam.cz>
7971         * expression.cs (SizeOf.DoResolve): Check for void type. Fixed enum types
7972         support.
7973         * class.cs, ecore.cs, statement.cs: Merged to one error message.
7975 2006-08-13  Miguel de Icaza  <miguel@novell.com>
7977         * assign.cs: Catch attempts to assign to a method groups in += and
7978         report as 1656
7980 2006-08-13  Marek Safar  <marek.safar@seznam.cz>
7982         A fix for #79056
7983         * cs-parser.jay: Don't destroy current array type by typeof of array's.
7985 2006-08-12  Marek Safar  <marek.safar@seznam.cz>
7987         * class.cs (Method.Define): Issue a warning when generic method looks like
7988         an entry point.
7989         * decl.cs (MemberCore.GetSignatureForError): Print member type arguments
7990         as well.
7992 2006-08-09  Marek Safar  <marek.safar@seznam.cz>
7994         * anonymous.cs(AnonymousDelegate.Emit): Uses Constructor filter when
7995         looking for ctor.
7996         * decl.cs (MemberCache.FindMembers): When container is interface we need to
7997         search all base interfaces as a member can be ambiguous.
7998         * delegate.cs (Delegate.FindMembers): Fixed to return valid data for
7999         Constructor member type filter. 
8000         (Delegate.ResolveConstructorMethod) Uses Constructor filter.
8001         * ecore.cs: (Expression.MemberLookup): Implemented ambiguity error/warning
8002         reporting for returned memberinfos.
8003         * report.cs: Updated.
8004         * typemanager.cs (TypeManager.LookupBaseInterfacesCache): Uses TypeManager
8005         version to work on all runtimes.
8006         (TypeManager.RealMemberLookup): Removed members filtering.
8008 2006-08-08  Raja R Harinath  <rharinath@novell.com>
8010         * ecore.cs (FieldExpr.EmitAssign): Release temporary.
8011         (PropertyExpr.EmitAssign): Likewise.
8012         * expression.cs (Indirection.EmitAssign): Likewise.
8013         (LocalVariableReference.EmitAssign): Likewise.
8014         (ParameterReference.EmitAssign): Likewise.
8015         (Invocation.EmitArguments): Likewise.
8016         (ArrayAccess.EmitAssign): Likewise.
8017         (IndexerAccess.EmitAssign): Likewise.
8018         (This.EmitAssign): Likewise.
8019         (ConditionalLogicalOperator.Emit): Likewise.
8021         Fix #79026
8022         * codegen.cs (EmitContext.GetTemporaryLocal): Simplify.  Use Stack
8023         instead of ArrayList.  If the hashtable has a LocalBuilder, don't
8024         leave it in after returning it.
8025         (EmitContext.FreeTemporaryLocal): Simplify.  Update to changes.
8027 2006-08-06  Marek Safar  <marek.safar@seznam.cz>
8029         * expresssion.cs (IndexerAccess.DoResolve): Fixed to report correct error
8030         message.
8032 2006-08-03  Raja R Harinath  <rharinath@novell.com>
8034         Fix cs0146-3.cs and cs0146-4.cs.
8035         * class.cs (TypeManager.CheckRecursiveDefinition): Check that
8036         enclosing types don't depend on the current type.
8038 2006-08-02  Raja R Harinath  <rharinath@novell.com>
8040         Fix #77963
8041         * class.cs (TypeContainer.DoDefineMembers): Use
8042         FindBaseMemberWithSameName on Parent, since we're interested in
8043         whether we hide inherited members or not.
8044         (FindBaseMemberWithSameName): Make slightly more robust.
8046         Fix the non-generic testcase from #77396
8047         * decl.cs (DeclSpace.DeclContainer): Remove override.
8049         * namespace.cs (NamespaceEntry.Doppelganger): Create slave
8050         declspaces for doppelgangers too.
8051         (UsingEntry): Implement IResolveContext.
8052         (UsingEntry.Resolve): Don't set ToplevelTypes.Namespace.  Use
8053         'this' as the resolve context.
8054         (LocalAliasEntry): Likewise.
8056         Implement parts of #77403
8057         * roottypes.cs (RootDeclSpace): New.  Used to represent the
8058         toplevel declaration space.  Each namespace declaration introduces
8059         a "partial" root declaretion space.
8060         * namespace.cs (NamespaceEntry.SlaveDeclSpace): New.
8061         (NamespaceEntry.ctor): Create a SlaveDeclSpace if necessary.
8062         * cs-parser.jay (CSharpParser.ctor): Initialize 'current_class'
8063         from 'current_namespace.SlaveDeclSpace'.
8064         (namespace_declaration): Likewise.
8065         * class.cs (TypeContainer.ctor): Remove parent==ToplevelTypes
8066         check.  It can't happen now.
8067         * decl.cs (DeclSpace.LookupType): Likewise.
8068         * driver.cs (MainDriver): Sanity check.
8070 2006-08-01  Raja R Harinath  <rharinath@novell.com>
8072         * decl.cs (DeclSpace.FindNestedType): Remove.
8073         (DeclSpace.LookupNestedTypeINHierarchy): Use PartialContainer and
8074         LookupTypeContainer to get the container of the nested type.
8075         * class.cs (TypeContainer.FindNestedType): Make non-override.
8077 2006-07-31  Raja R Harinath  <rharinath@novell.com>
8079         * decl.cs (DeclSpace.PartialContainer): Move field from ...
8080         * class.cs (TypeContainer.PartialContainer): ... here.
8081         (TypeContainer.AddBasesForPart): New helper.
8082         (MemberBase.ParentContainer): Remove.  Use Parent.PartialContainer
8083         instead.
8084         * cs-parser.jay (current_class): Convert to DeclSpace.
8085         (struct_declaration, interface_declaration, class_declaration):
8086         Use AddBasesForPart instead of .Bases directly.
8087         * const.cs, iterators.cs: Update to changes.
8089 2006-07-28  Raja R Harinath  <rharinath@novell.com>
8091         * class.cs (TypeContainer.AddMemberType): Rename from
8092         AddToTypeContainer.
8093         (TypeContainer.AddMember): Rename from AddToMemberContainer.
8094         (AddTypeContainer): New.  Combine AddClassOrStruct and
8095         AddInterface.
8096         (AddPartial): Update.  Add 'is_partial' argument.
8097         * roottypes.cs: Update to changes.
8098         * cs-parser.jay (push_current_class): New helper for handling
8099         current_container and current_class.
8100         (struct_declaration, interface_declaration, class_declaration):
8101         Use it.
8103 2006-07-26  Raja R Harinath  <rharinath@novell.com>
8105         * roottypes.cs: Rename from tree.cs.
8107         Rename RootContext.Tree.Types to RootContext.ToplevelTypes.
8108         * tree.cs (Tree, ITreeDump): Remove types.
8109         * rootcontext.cs (tree, Tree): Remove fields.
8110         (root, ToplevelTypes): New.
8111         * *.cs: Update to rename.
8113         * tree.cs (Tree.RecordDecl): Remove.
8114         (RootTypes.AddToTypeContainer): Record the toplevel type in its
8115         namespace here.
8116         * class.cs, cs-parser.jay: Remove mention of RecordDecl.
8118 2006-07-23  Raja R Harinath  <harinath@gmail.com>
8120         * codegen.cs (EmitContext.Flags): Move InCatch, InFinally,
8121         DoFlowAnalysis and OmitStructFlowAnalysis here.
8122         (ec.With): Rename from WithUnsafe and generalize.
8123         (ec.WithCheckState): Remove.  All users can be handled by 'With'.
8124         (ec.WithFlowAnalyis): New.
8125         * ecore.cs, expression.cs, statement.cs: Update.
8127 2006-07-22  Raja R Harinath  <harinath@gmail.com>
8129         * statement.cs (Block.ResolveMeta): Simplify slightly.
8131         * codegen.cs (EmitContext.Flags): New enum.  Used to represent the
8132         multiple boolean fields.  Convert InUnsafe, constant_check_state,
8133         check_state to flags.
8134         (CheckState, ConstantCheckState): Update.
8135         (InUnsafe): New read-only property.
8136         (FlagsHandle): Rename from CheckStateHandle and convert to handle
8137         arbitrary flags.
8138         (WithUnsafe): New helper similar to WithCheckState.
8139         * statement.cs (Block.ResolveMeta): Use WithUnsafe.
8140         (Unsafe.Resolve, Unsafe.DoEmit): Likewise.
8142 2006-07-21  Raja R Harinath  <rharinath@novell.com>
8144         Make comparisons use the same IL irrespective of whether they're
8145         in a 'checked' or 'unchecked' context: one of the issues in #78899
8146         * codegen.cs (EmitContext.CheckState): Make read-only property.
8147         (EmitContext.ConstantCheckState): Likewise.
8148         (EmitContext.CheckStateHandle, EmitContext.WithCheckState): New
8149         helper that implement a save/restore stack for CheckState
8150         values.  This is the only way to change check-state.
8151         * ecore.cs (Expression.ExpressionToArrayArgument): Use WithCheckState.
8152         * expression.cs (CheckedExpr.DoResolve, CheckedExpr.Emit): Likewise.
8153         (CheckedExpr.EmitBranchable): New forwarding method.
8154         (UnCheckedExpr): Likewise.
8155         * statement.cs (Block.ResolveMeta): Use WithCheckState.
8156         (Unchecked.Resolve, Unchecked.DoEmit): Likewise.
8157         (Checked.Resolve, checked.DoEmit): Likewise.
8159 2006-07-20  Miguel de Icaza  <miguel@novell.com>
8161         * anonymous.cs: Cache the resolved anonymous delegate, and return
8162         this so that the ResolveTopBlock is only triggered once, not
8163         twice.
8165         Currently we trigger ResolvetopBlock twice due to a first pass of
8166         argument check compatibility, and a second pass that does the
8167         actual resolution.   
8168         
8169 2006-07-15  Marek Safar  <marek.safar@seznam.cz>
8171         * annonymous.cs (AnonymousMethod.CreateScopeType): Fixed nested type
8172         modifiers.
8173         * rootcontext.cs (Reset): Add helper_classes.
8175 2006-07-15  Marek Safar  <marek.safar@seznam.cz>
8177         A fix for #78860
8178         * statement.cs (Switch.SimpleSwitchEmit): Handle case null at any position
8179         correctly.
8181 2006-07-13  Miguel de Icaza  <miguel@novell.com>
8183         * statement.cs (Lock): Handle expressions of type
8184         TypeManager.null_type specially.  Fixes #78770
8186 2006-07-08  Marek Safar  <marek.safar@seznam.cz>
8188         * expression.cs (Binary.ResolveOperator): Don't crash when null is assigned
8189         to an event.
8191 2006-07-08  Marek Safar  <marek.safar@seznam.cz>
8193         * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Fixed to look
8194         for accessors as well.
8195         * ecore.cs (EventExpr): Add AccessorTable.
8197 2006-07-01  Marek Safar  <marek.safar@seznam.cz>
8199         A fix for #78738
8200         * attribute.cs, class.cs, ecore.cs : Add missing location of related symbol
8201         for CS0122 where appropriate.
8202         * typemanager.cs (IsNestedChildOf): Type can be null in the case of top
8203         level attributes.
8204         (Filter): Assembly can be null in the case of top level attributes.
8206 2006-06-25  Marek Safar  <marek.safar@seznam.cz>
8208         A fix for #78690
8210         * ecore.cs (Expression.MemberLookupFailed): Don't crash when failed lookup
8211         is done at global level.
8213 2006-06-24  Marek Safar  <marek.safar@seznam.cz>
8215         A fix for #77002, Implemented TypeForwarder support.
8217         * attribute.cs (Attribute.GetArgumentType): Reads type argument.
8218         * expression.cs (TypeOf.TypeArgument): Exposes typeof type.
8219         * typemanager.cs (): Add type_forwarder_attr_type.
8221 2006-06-24  Marek Safar  <marek.safar@seznam.cz>
8223         * report.cs: Add CS0469 warning.
8225 2006-06-21  Martin Baulig  <martin@ximian.com>
8227         * codegen.cs (CodeGen.Save): Moved the symbol file generation into
8228         the `try'-block, so we also report CS0016 etc. there.
8230 2006-06-21  Martin Baulig  <martin@ximian.com>
8232         * delegate.cs
8233         (Delegate.VerifyMethod): Allow `params' methods; fixes #78678.
8235 2006-06-21  Martin Baulig  <martin@ximian.com>
8237         * expression.cs (Unary.ResolveOperator): In `Operator.AddressOf',
8238         also report CS1686 for parameters.
8240 2006-06-21  Martin Baulig  <martin@ximian.com>
8242         * statement.cs (GotoCase.Resolve): Report a warning (CS0469)
8243         instead of an error if the value is not implicitly convertible to
8244         the switch types; fixes #77964.
8246 2006-06-21  Raja R Harinath  <rharinath@novell.com>
8248         Fix #78673
8249         * class.cs (FieldBase.ResolveInitializer): Stop resolution if
8250         FieldBuilder is null.
8252         Fix #78662
8253         * expression.cs (Binary.CheckShiftArguments): Don't overwrite original
8254         'left' and 'right' before error-checking.
8256 2006-06-16  Juraj Skripsky  <js@hotfeet.ch>
8258         * ecore.cs (SimpleName.Error_ObjectRefRequired): Do not truncate the name.
8259         Fixed bug #78601.
8260         (MemberExpr.EmitInstance): Use GetSignatureForError () to get full name.
8261         (FieldExpr.DoResolve): likewise.
8262         (PropertyExpr.InstanceResolve): likewise.
8263         (EventExpr.InstanceResolve): likewise. 
8265 2006-06-04  Marek Safar  <marek.safar@seznam.cz>
8267         * parameter.cs (Parameter.ApplyAttributeBuilder): More DefaultValue
8268         attribute applicable tests for attribute argument.
8270 2006-06-02  Raja R Harinath  <rharinath@novell.com>
8272         Fix #78079
8273         * expression.cs (Binary.DoNumericPromotions): Remove and rewrite.
8274         (Binary.OverloadResolve_PredefinedIntegral): New.
8275         (Binary.OverloadResolve_PredefinedFloating): New.
8276         (Binary.OverloadResolve_PredefinedString): New.
8277         (Binary.ResolveOperator): Use those instead of DoNumericPromotions.
8278         Follow the standard more closely, and treat numeric promotions in
8279         terms of overload resolution.
8280         (Binary.CheckShiftArguments): Simplify.
8282 2006-06-01  Raja R Harinath  <rharinath@novell.com>
8284         * flowanalysis.cs (MyBitVector): Simplify representation.
8285         (MyBitVector.Clone): Avoid allocating BitArray.
8286         (MyBitVector.operator&): Rename from MyBitVector.And and make symmetric.
8287         (MyBitVector.operator|): Likewise, with MyBitVector.Or.
8288         (*): Update.  Change all references to MyBitVector.And and
8289         MyBitVector.Or to &= and |=.
8291 2006-05-29  Raja R Harinath  <rharinath@novell.com>
8293         Fix cs0231-[34].cs.
8294         * cs-parser.jay (formal_parameter_list): Extend the pattern below
8295         to param arguments too.
8297 2006-05-26  Miguel de Icaza  <miguel@novell.com>
8299         * cs-parser.jay: Catch another parsing form for arglist being
8300         followed by other arguments.  Fixes #78313.
8302 2006-05-24  Raja R Harinath  <rharinath@novell.com>
8304         * flowanalysis.cs (FlowBranchingToplevel.AddReturnOrigin): Move
8305         checking of out parameters to ...
8306         (FlowBranchingToplevel.Merge): ... here.
8307         (FlowBranchingException.AddBreakOrigin): If 'finally_vector' is
8308         set, propagate the origin upward, and only complain if there was
8309         no other error.
8310         (FlowBranchingException.AddContinueOrigin): Likewise.
8311         (FlowBranchingException.AddReturnOrigin): Likewise.
8312         (FlowBranchingException.AddGotoOrigin): Likewise.       
8314 2006-05-23  Raja R Harinath  <rharinath@novell.com>
8316         * flowanalysis.cs (UsageVector.MergeOrigins): If an origin is
8317         unreachable, skip it.
8318         (FlowBranchingException.Merge): Always propagate jumps, even if
8319         the finally block renders subsequent code unreachable.
8321 2006-05-18  Raja R Harinath  <rharinath@novell.com>
8323         Fix #77601
8324         * statement.cs (Goto.Resolve): Move responsibility for resolving
8325         'goto' to FlowBranching.AddGotoOrigin.
8326         (Goto.SetResolvedTarget): New.  Callback to set the
8327         LabeledStatement that's the target of the goto.
8328         (Goto.DoEmit): Use Leave instead of Br when crossing an
8329         unwind-protect boundary.
8330         * flowanalysis.cs (FlowBranching.AddGotoOrigin): Rename from
8331         LookupLabel and adjust to new semantics.
8332         (FlowBranchingToplevel.AddGotoOrigin): Likewise.
8333         (FlowBranchingBlock.AddGotoOrigin): Likewise. Use
8334         Goto.SetResolvedTarget to update target.
8335         (FlowBranchingLabeled.AddGotoOrigin): Likewise.
8336         (FlowBranchingException.AddGotoOrigin): Rewrite to be similar to
8337         AddBreakOrigin & co.  Delay propagation until ...
8338         (FlowBranchingException.Merge): ... this.
8340         * statement.cs (Block.Resolve): Always depend on flow-branching to
8341         determine unreachability.  Kill workaround that originally emitted
8342         only one statement after an "unreachable" label (see infloop in
8343         test-515.cs).
8345         Fix #77869, #76148, #77755, #75255 and a host of other bugs.
8346         This is still "wrong", but anything better would probably need a
8347         multi-pass algorithm.
8348         * flowanalysis.cs (FlowBranchingLabeled): Salt away a copy of the
8349         usage vector.  Force current usage vector to be reachable, to
8350         optimistically signify backward jumps.
8351         (FlowBranchingLabeled.LookupLabel): Note if a backward jump is
8352         detected.
8353         (FlowBranchingLabeled.Merge): New.  If no backward jump was
8354         detected, return the original salted-away usage vector instead,
8355         updated with appropriate changes.  Print unreachable warning if
8356         necessary.
8357         * statement.cs (Block.Resolve): Don't print unreachable warning on
8358         a labeled statement.
8360 2006-05-17  Gert Driesen  <drieseng@users.sourceforge.net>
8362         * driver.cs: Pass filename without path to AssemblyBuilder's 
8363         AddResourceFile. Fixes bug #78407.
8365 2006-05-17  Raja R Harinath  <rharinath@novell.com>
8367         * statement.cs (LabeledStatement.Resolve): Move merging of origins ...
8368         * flowanalysis.cs (FlowBranchingLabeled): ... here.
8369         (FlowBranching.MergeChild): Overwrite
8370         reachability information from Labeled branchings too.
8372 2006-05-16  Raja R Harinath  <rharinath@novell.com>
8374         * statement.cs (Goto.Resolve): Merge jump origins here ...
8375         * flowanalysis.cs (FlowBranching.Label): ... rather than here.
8377         * flowanalysis.cs (FlowBranching.LookupLabel): Move CS0159 check ...
8378         (FlowBranchingToplevel.LookupLabel): ... here.  Add CS1632 check.
8379         (FlowBranchingGoto.LookupLabel): New.  Handle back jumps.
8380         (FlowBranchingBlock.LookupLabel): Call LabeledStatement.AddReference
8381         here, ...
8382         * statement.cs (Goto.Resolve): ... not here.
8383         (Goto.Emit): Remove CS1632 check.
8385 2006-05-14  Marek Safar  <marek.safar@seznam.cz>
8387         * ecore.cs (Expression.ResolveAsTypeTerminal): Fixed type in the obsolete
8388         error message.
8390 2006-05-11  Raja R Harinath  <rharinath@novell.com>
8392         * flowanalysis.cs (UsageVector.MergeJumpOrigins): Kill.
8393         (FlowBranchingBlock.Label): Use UsageVector.MergeOrigins.
8394         (FlowBranchingException.Label): Likewise.
8396         * flowanalysis.cs (MyBitVector.SetAll): New.  Sets all bits to the
8397         given value.
8398         (MyBitVector.Or): Use it to avoid losing information (Count).
8399         (FlowBranching.MergeOrigins): Likewise.
8401         * flowanalysis.cs (UsageVector.IsDirty): Remove.
8402         (UsageVector.Parameters, UsageVector.ParameterVector): Likewise.
8403         (UsageVector.Locals, UsageVector.LocalVector): Likewise.
8404         (UsageVector.ToString): Simplify.
8405         (UsageVector.MergeSiblings): Move here from ...
8406         (FlowBranching.Merge): ... here.
8407         (FlowBranchingToplevel.CheckOutParameters): Take an UsageVector,
8408         not a MyBitVector.
8410 2006-05-10  Raja R Harinath  <rharinath@novell.com>
8412         * flowanalysis.cs (UsageVector.MergeOrigins): Simplify, now that a
8413         null bitvector is treated as all-true.
8415         * flowanalysis.cs (MyBitVector.And, MyBitVector.Or): Make lazier.
8416         (MyBitVector): Rationalize invariants.  'vector != null' implies
8417         that we have our own copy of the bitvector.  Otherwise,
8418         'InheritsFrom == null' implies all inherited bits are true.
8420 2006-05-09  Marek Safar  <marek.safar@seznam.cz>
8422         * statement.cs (LocalInfo): Add IsConstant.
8423         (LocalInfo.DeclareLocal): Moved from EmitMeta and changed to don't emit
8424         local variable for constants.
8426 2006-05-09  Raja R Harinath  <rharinath@novell.com>
8428         * flowanalysis.cs (MyBitVector.Empty): New.
8429         (MyBitVector): Don't allow InheritedFrom to be null.
8430         (MyBitVector.And, MyBitVector.Or): Treat 'null' as all-ones.
8431         (UsageVector, FlowBranching): Update to changes.
8433         * flowanalysis.cs (FlowBranching.InTryWithCatch): Don't terminate
8434         recursion.  The 'Parent == null' condition isn't sufficient for
8435         anonymous methods.
8436         (FlowBranching.AddBreakOrigin): Likewise.
8437         (FlowBranching.AddContinueOrigin): Likewise.
8438         (FlowBranching.AddReturnOrigin): Likewise.
8439         (FlowBranching.StealFinallyClauses): Likewise.
8440         (FlowBranching.MergeTopBlock): Move to FlowBranchingToplevel.
8441         (FlowBranching.CheckOutParameters): Likewise.
8442         (FlowBranchingToplevel): Terminate all the above recursions here.
8443         (FlowBranchingToplevel.End): Rename from MergeTopBlock.
8444         * codegen.cs (EmitContext.ResolveTopBlock): Update to changes.
8446         * flowanalysis.cs (BranchingType.Toplevel): New.  Represents a
8447         toplevel block.
8448         (FlowBranchingToplevel): New.  Empty for now.
8449         (FlowBranching.MergeTopBlock): Update.
8450         * codegen.cs (EmitContext.ResolveTopBlock): Create a Toplevel
8451         branching for the anonymous delegate.
8452         (EmitContext.StartFlowBranching): Add ToplevelBlock variant.
8454         * flowanalysis.cs (UsageVector.MergeOrigins): Reorganize.
8455         (UsageVector.MergeJumpOrigins): Don't ignore current reachability
8456         information at the start of the merge.  Reorganize.
8458 2006-05-07  Marek Safar  <marek.safar@seznam.cz>
8460         * class.cs (MethodData.Define): Method cannot implement interface accessor.
8462 2006-05-07  Marek Safar  <marek.safar@seznam.cz>
8464         * expression.cs (QualifiedAliasMember.ResolveAsTypeStep): Pass location
8465         to newly introduced ctor.
8467         * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Moved an error
8468         message to one place.
8469         (GlobalRootNamespace.Error_NamespaceDoesNotExist): Custom message for
8470         global namespace.
8472 2006-05-07  Marek Safar  <marek.safar@seznam.cz>
8474         * const.cs (Const.Error_ExpressionMustBeConstant): Better error message.
8476         * ecore.cs (Expression.ResolveAsConstant): Updated.
8478         * statement.cs (ResolveMeta): Updated.
8480 2006-05-06  Marek Safar  <marek.safar@seznam.cz>
8482         * cs-parser.jay: __arglist cannot be used in initializer.
8484 2006-05-06  Marek Safar  <marek.safar@seznam.cz>
8486         A fix for #77879
8487         * namespace.cs (LocalAliasEntry.DoResolve): Don't allow to access nested
8488         private types.
8490 2006-05-05  Raja R Harinath  <rharinath@novell.com>
8492         * statement.cs (EmptyStatement.ResolveUnreachable): Override.
8493         (LabeledStatement): Add 'name' parameter.
8494         (LabeledStatement.Name, LabeledStatement.JumpOrigins): New.
8495         (Block.AddLabel): Update to changes.
8496         * cs-parser.jay (labeled_statement): Likewise.
8498         * flowanalysis.cs (BranchingType.Labeled): New.
8499         (UsageVector.MergeOrigins): Remove unused 'branching' argument.
8500         (FlowBranchingLabeled): New.  Does nothing for now, but will
8501         eventually handle 'goto' flows.
8502         * codegen.cs (StartFlowBranching): Add new LabeledStatement variant.
8503         * statement.cs (LabeledStatement.Resolve): Create a FlowBranching
8504         that's terminated ...
8505         (Block.Resolve): ... here.
8507         * flowanalysis.cs (UsageVector.MergeFinally): Remove.
8508         (UsageVector.MergeFinallyOrigins): Likewise.
8509         (FlowBranching.InTryOrCatch): Likewise.
8510         (FlowBranching.AddFinallyVector): Likewise.
8511         (FlowBranchingException): Update to changes.
8513         Fix #78290
8514         * statement.cs (Return.Resolve): Move error checking to ...
8515         * flowbranching.cs (FlowBranching.AddReturnOrigin): ... this.
8516         (FlowBranchingException): Handle return origins like break and
8517         continue origins.
8518         (FlowBranching.UsageVector.CheckOutParameters): Remove.
8520 2006-05-04  Marek Safar  <marek.safar@seznam.cz>
8522         A fix for #76122
8523         * class.cs (TypeContainer.FindMembers): Includes event method in the methods
8524         filter.
8526 2006-05-04  Marek Safar  <marek.safar@seznam.cz>
8528         A fix for #77543
8529         * class.cs (MethodData.Define): Do public accessor check only when method
8530         implements an interface.
8532 2006-05-04  Raja R Harinath  <rharinath@novell.com>
8534         Remove special handling of 'break'
8535         * flowanalysis.cs (Reachability): Remove all mention of 'breaks'.
8536         (Reachability.Meet): Simplify.  Remove 'do_breaks' argument.
8537         (UsageVector.Break): Remove.
8538         (FlowBranching.Merge): Use 'Reachable.IsUnreachable' to determine
8539         reachability.
8540         (FlowBranchingBreakable.Merge): Don't ResetBreaks.
8542         * statement.cs (Break.Resolve): Call UsageVector.Goto (), not
8543         UsageVector.Breaks ().  Don't set NeedsReturnLabel.
8545 2006-05-03  Marek Safar  <marek.safar@seznam.cz>
8547         A fix for #75726
8548         * pending.cs (PendingImplementation.BaseImplements): A found member cannot
8549         be the interface member.
8551 2006-05-03  Marek Safar  <marek.safar@seznam.cz>
8553         A fix for #60069
8554         * constant.cs (LongConstant.EmitLong): Fixed to catch also negative values
8555         for emitting small (int) values.
8557 2006-05-03  Raja R Harinath  <rharinath@novell.com>
8559         Fix #59427
8560         * flowanalysis.cs (FlowBranchingException.Merge): Ensure
8561         control-flow passes through the 'finally' after merging-in all the
8562         control-flows from 'try' and the 'catch' clauses.
8564         * flowanalysis.cs (FlowBranching.IsLoop): Remove.
8565         (FlowBranching.IsTryOrCatch): Remove 'is_return' parameter.  It's
8566         always true at the only non-recursive entry point.
8567         (FlowBranching.CreateBranching) [BranchingType.Loop]: Return a
8568         FlowBranchingBreakable.
8569         (FlowBranchingLoop): Remove.
8570         * statement.cs (Return.DoResolve): Update to changes.
8572         Fix #76471, #76665
8573         * flowanalysis.cs (FlowBranching.BranchingType.Embedded): New.
8574         (FlowBranching.CreateBranching): Handle it: create a
8575         FlowBranchingContinuable.
8576         (FlowBranching.BreakCrossesExceptionBoundary): Remove.
8577         (FlowBranching.AddContinueOrigin): Similar to AddBreakOrigin,
8578         except that it handles the 'continue' command.
8579         (FlowBranching.UsageVector.MergeOrigins): Rename from
8580         MergeBreakOrigins.
8581         (FlowBranchingContinuable): Similar to FlowBranchingBreakable,
8582         except that it overrides AddContinueOrigin.
8583         (FlowBranchingException): Override AddContinueOrigin, similar to
8584         AddBreakOrigin.
8585         * statement.cs (While.Resolve, Foreach.ArrayForeach.Resolve):
8586         Create a new branching around the embedded statement.
8587         (Do.Resolve, For.Resolve): Likewise.  Do reachability analysis for
8588         control flow after the embedded statement.
8589         (Continue.Resolve): Move all error checking to AddContinueOrigin.
8591         * flowanalysis.cs (FlowBranching.IsSwitch): Remove.
8592         (FlowBranching.CreateBranching) [BranchingType.Switch]: Create a
8593         FlowBranchingBreakable.
8594         (FlowBranchingSwitch): Remove.
8596         Fix test-503.cs
8597         * statement.cs (Break.Resolve): Simplify.  Move responsibility for
8598         error reporting to ...
8599         * flowanalysis.cs (FlowBranching.AddBreakOrigin) ... this.
8600         Rename from 'AddBreakVector'.  Add new location argument.  Return
8601         a bool indicating whether the 'break' crosses an unwind-protect.
8602         (FlowBranchingException.AddBreakOrigin): Add.
8603         (FlowBranchingException.Merge): Propagate 'break's to surrounding
8604         flowbranching after updating with the effects of the 'finally'
8605         clause.
8606         (FlowBranchingBreakable): New common base class for
8607         FlowBranchingLoop and FlowBranchingSwitch.
8609         * statement.cs (Foreach.ArrayForeach.Resolve): Set barrier after
8610         embedded statement.
8611         (Foreach.CollectionForeach.Resolve): Remove extraneous flowbranching.
8613 2006-05-02  Raja R Harinath  <rharinath@novell.com>
8615         * statement.cs (Do.Resolve): If the loop is infinite, set the
8616         barrier.
8617         (While.Resolve, For.Resolve): Set a barrier after the embedded
8618         statement.  There's no direct control flow that goes from the end
8619         of the embedded statement to the end of the loop.
8620         * flowanalysis.cs (FlowBranching.Infinite): Remove.
8621         (FlowBranchingLoop.Merge): Don't look at 'Infinite'.  The changes
8622         above ensure that the reachability is correctly computed.
8624         * flowanalysis.cs (Reachability.ResetBarrier): Remove.
8625         (UsageVector.MergeBreakOrigins): If the current path is
8626         unreachable, treat it as if all parameters/locals are initialized.
8627         (FlowBranchingLoop.Merge): Don't clear any barriers.  Handle
8628         infinite loops before merging-in break origins.
8630         * flowanalysis.cs (Reachability.Meet): Simplify code handling 'returns'.
8631         (Reachability.Reachable): Split part into ...
8632         (Reachability.Unreachable): ... this.  Simplify.
8633         (Reachability.IsUnreachable): Use 'Unreachable' instead.
8635         * flowanalysis.cs (Reachability.SetReturnsSometimes): Remove.
8636         (Reachability.SetThrowsSometimes): Likewise.
8637         (FlowBranchingBlock.MergeTopBlock): Don't compare against
8638         TriState.Always, use corresponding property.
8639         * statement.cs (Lock.Resolve, Try.Resolve, Using.Resolve): Likewise.
8640         (Block.Resolve): Likewise.  Remove some redundant checks.
8642 2006-05-02  Raja R Harinath  <harinath@gmail.com>
8644         * flowanalysis.cs (UsageVector.Throw): Set barrier too.
8645         (Reachability.Meet): Don't bother checking AlwaysThrows --
8646         barrier is always set.
8647         (FlowBranchingBlock.Merge): Likewise.
8649 2006-05-01  Raja R Harinath  <harinath@gmail.com>
8651         * codegen.cs (EmitContext.ResolveTopBlock): Remove redundant
8652         checks for unreachable.
8654 2006-05-01  Marek Safar  <marek.safar@seznam.cz>
8656         A fix for #77980
8657         * flowanalysis.cs (UsageVector.IsAssigned): Add flag to ignore short path.
8659         * statement.cs (Block.UsageWarning): Uses newly introduced flag to detect
8660         whether field is really assigned.
8662 2006-04-30  Raja R Harinath  <harinath@gmail.com>
8664         * flowanalysis.cs (Reachability): Make 4-argument constructor
8665         private.
8666         (Reachability.Meet): Rename from 'And'.  Remove static variant.
8667         (Reachability.Always): Rename from the highly misleading
8668         'Reachability.Never'.
8669         (FlowBranching.Merge): Update to changes.  Mark an impossible
8670         situation with a 'throw'.
8671         (*): Update to changes.
8673 2006-04-29  Raja R Harinath  <harinath@gmail.com>
8675         * flowanalysis.cs (TriState): Rename from FlowBranching.FlowReturns.
8676         Remove 'Undefined'.
8677         (FlowBranching.TriState_Meet): Rename from AndFlowReturns. Simplify.
8678         (FlowBranching.TriState_Max): Rename from OrFlowReturns. Simplify.
8679         (*): Update to changes.
8680         * statement.cs: Update to changes.
8682 2006-04-28  Marek Safar  <marek.safar@seznam.cz>
8684         A fix for #78049
8685         *class.cs (Method.FindOutBaseMethod): Base method cannot be property method.
8687 2006-04-28  Raja R Harinath  <harinath@gmail.com>
8689         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't create a
8690         dummy UsageVector.
8692         * flowanalysis.cs (UsageVector.MergeChild): Change FlowBranching
8693         argument to two arguments: an usage-vector and a bool.  Move call
8694         to FlowBranching.Merge () ...
8695         (FlowBranching.MergeChild, FlowBranching.MergeTopBlock): ... here.
8697         * flowanalysis.cs (UsageVector.MergeChild): Move special-case
8698         handling of loop and switch reachability to ...
8699         (FlowBranchingLoop.Merge, FlowBranchingSwitch.Merge): ... these.
8701 2006-04-27  Raja R Harinath  <harinath@gmail.com>
8703         * flowanalysis.cs (FlowBranching.InLoop): Move special-case
8704         handling to FlowBranchingLoop.InLoop.
8705         (FlowBranching.InSwitch): Likewise, to FlowBranchingSwitch.
8707 2006-04-26  Marek Safar  <marek.safar@seznam.cz>
8709         A fix for #78115
8710         * anonymous.cs (AnonymousMethod.DoResolve): Moved the check whether
8711         anonymous method is allowed from AnonymousContainer here.
8713         * attribute.cs, codegen.cs (EmitContext): Add IsAnonymousMethodAllowed.
8715 2006-04-24  Raja R Harinath  <rharinath@novell.com>
8717         Fix #78156
8718         * flowanalysis.cs (MyBitVector.Or): Add null check on argument.
8720 2006-04-23  Marek Safar  <marek.safar@seznam.cz>
8722         A fix for #49011.
8723         * constant.cs (FloatConstant.Reduce): Add range checking for checked context.
8724         (DoubleConstant.Reduce): Ditto.
8726 2006-04-23  Raja R Harinath  <rharinath@novell.com>
8728         * expression.cs (LocalVariableReference.DoResolveBase): Simplify.
8729         Remove 'lvalue_right_side' argument.  Move parts to ...
8730         (LocalVariableReference.ResolveLocalInfo, LocalVariable.DoResolve)
8731         (LocalVariable.DoResolveLValue): ... these.
8733 2006-04-21  Raja R Harinath  <rharinath@novell.com>
8735         Fix cs1655.cs
8736         * codegen.cs (EmitContext.InRefOutArgumentResolving): Remove.
8737         * expression.cs (EmptyExpression.LValueMemberOutAccess): New.
8738         (LocalVariableReference.DoResolveBase): Use it to implement new
8739         CS1655 check.
8740         (IndexerAccess.DoResolveLValue): Handle LValueMemberOutAccess.
8741         (Argument.Resolve): Simplify.  Move CS1510 check ...
8742         * ecore.cs (Expression.ResolveLValue): ... here.
8743         (UnboxCast.DoResolveLValue): Handle LValueMemberOutAccess.
8744         (PropertyExpr.DoResolveLValue): Likewise.
8745         (FieldExpr.Report_AssignToReadonly): Likewise.
8746         (FieldExpr.DoResolve): Add 'out_access' argument.  Use
8747         LValueMemberAccess or LValueMemberOutAccess on instance depending
8748         on it.
8749         (FieldExpr.DoResolveLValue): Pass 'out_access' argument to
8750         DoResolve as appropriate.
8752 2006-04-20  Raja R Harinath  <rharinath@novell.com>
8754         Fix #75800
8755         * expression.cs (Invocation.VerifyArgumentsCompat): Don't try
8756         implicit conversions on 'out' and 'ref' arguments.
8758         * expression.cs (Invocation.VerifyArgumentsCompat): Reorganize to
8759         improve clarity.  Remove dead code.
8761         Fix #66031
8762         * statement.cs (Block.UsageWarning): Allow VariableInfo to be null.
8763         (Catch.Resolve): Resolve VarBlock if it exists.
8765 2006-04-19  Miguel de Icaza  <miguel@novell.com>
8767         * statement.cs (Foreach.EmitFinally): Do not emit the enumerator
8768         twice, this was some residual code, the enumerator was emitted
8769         properly in the two branche of if later.
8771 2006-04-19  Raja R Harinath  <rharinath@novell.com>
8773         * expression.cs (Cast.ResolveLValue): Remove.  The result of a
8774         cast is never an lvalue.
8775         (Cast.DoResolve, Cast.ResolveRest): Combine.
8776         (Argument.Emit): Simplify slightly.  Move 'Expr is
8777         IMemoryLocation' check ...
8778         (Argument.Resolve): ... here.
8779         (Argument.Error_LValueRequired): Remove.  Inline into only user.
8781         Simplifications.  Fix cs0191-2.cs
8782         * ecore.cs (FieldExpr.DoResolve): Move handling of CS0192, CS0198,
8783         CS1649 and CS1651 to ...
8784         (FieldExpr.Report_AssignToReadonly): ... this.  Simplify by moving
8785         the actual selection of the error code and message to a lookup
8786         table.  Add a dummy return value to simplify callsites.
8787         (FieldExpr.ResolveLValue): Don't allow a constructor to write to
8788         readonly fields of other instances of the same type.  Move CS0197
8789         warning from ...
8790         * expression.cs (Argument.Resolve): ... here.  Simplify code.
8791         Ensure that ec.InRefOutArgumentResolving is only set during LValue
8792         resolution of an out or ref argument.  The code simplification
8793         above uses this invariant.
8795 2006-04-18  Raja R Harinath  <rharinath@novell.com>
8797         Possibly fix #77752.  Fix cs1690-[4-7].cs.
8798         * ecore.cs (Expression.CheckMarshalByRefAccess): Renamed from
8799         CheckMarshallByRefAccess.  Drop parameter.
8800         (FieldExpr.CheckMarshalByRefAccess): Update.  Change CS1690 to a
8801         warning.
8802         (FieldExpr.DoResolve): Call CheckMarshalByRefAccess on
8803         InstanceExpression.
8804         * report.cs (AllWarnings): Add CS1690.
8805         * expression.cs (Argument.Resolve): Use EmptyExpression.OutAccess
8806         for ref access too.
8807         (LocalVariableReference.DoResolveBase): Update.
8809 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
8811         * class.cs (MethodOrOperator): Moved common parts from method class.
8812         detect obsolete attributes.
8813         (Method.Define): Simplified as it reuses code from base.
8814         (Constructor.ValidAttributeTargets): Fixed issue found during
8815         refactoring.
8816         (Destructor.ValidAttributeTargets): Fixed issue found during
8817         refactoring.
8818         (Operator): Finished refactoring set off by #78020. Operator class is now
8819         ordinary method class.
8821         * anonymous.cs: Updated.
8823         * decl.cs (DeclSpace): Add IsGeneric
8825 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
8827         * class.cs (Constructor.Emit): Don't emit the attributes twice.
8829 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
8831         * class.cs (Operator.Emit): Extracted code from MethodData to correctly
8832         detect obsolete attributes.
8833         (Method.CreateEmitContext): Moved to MethodOrOperator.
8835 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
8837         A fix for #78048.
8838         * class.cs (TypeContainer.MemberCoreArrayList.DefineContainerMembers): Throw
8839         customized exception to make crash detection easier.
8840         (MethodOrOperator): Started to work on new base class for methods and
8841         operators.
8842         (Method): Derives from MethodOrOperator.
8843         (Constructor.Emit): Emits its own attributes.
8844         (AbstractPropertyEventMethod.Emit): Ditto.
8845         (Operator): Derives from MethodOrOperator, will refactor fully in extra
8846         patch.
8847         (Operator.Emit): It's temporary more tricky than should be.
8848         
8849         * doc.cs (GetMethodDocCommentName): Updated after operator changes.
8851         * report.cs (InternalErrorException): Add ctor with inner exception.
8853 2006-04-08  Marek Safar  <marek.safar@seznam.cz>
8855         A fix for #76744.
8856         * ecore.cs (SimpleName.ResolveAsTypeStep): Report better error when type is
8857         only not visible.
8859 2006-04-07  Marek Safar  <marek.safar@seznam.cz>
8861         A fix for #77916.
8862         * expression.cs (ArrayCreation.GetAttributableValue): Creates correctly typed
8863         array.
8865 2006-04-06  Marek Safar  <marek.safar@seznam.cz>
8867         * class.cs (Class.ApplyAttributeBuilder): Report an error when ComImport
8868         attribute is present and Guid not.
8869         (Interface.ApplyAttributeBuilder): Ditto.
8871         * attribute.cs: Add error message.
8873 2006-04-06  Marek Safar  <marek.safar@seznam.cz>
8875         A fix for #78020.
8877         * attribute.cs (Attribute.AttachTo): The attribute can have multiple
8878         sources (it's composite) so hold them in extra array as they are used in
8879         Emit phase only. It worked in the previous versions by mistake.
8880         (Attribute.Emit): Emit attribute for more owners when exist.
8882         * codegen.cs, class.cs: Updated to don't re-attach attribute twice as now
8883         it has now different behaviour.
8885 2006-04-04  Marek Safar  <marek.safar@seznam.cz>
8887         * constant.cs (Constant.IsDefaultInitializer): New method.
8889         * class.cs: Updated.
8891         * expression.cs (ArrayCreation.CheckIndices): Add an optimization to don't
8892         re-initialize default values. It saves KBs almost for every assembly.
8893         Thanks Zoltan for the idea.
8894         (ArrayCreation.ResolveInitializers): Renamed from ValidateInitializers.
8895         (ArrayCreation.DoResolve): Resolve only once.
8896         (ArrayCreation.Emit): Emit static initializer only when it is faster.
8897         (ArrayCreation.GetAttributableValue): Cope with optimized values.
8899 2006-04-03  Zoltan Varga  <vargaz@gmail.com>
8901         * report.cs (Warning, Error): Add 0-, 1-, and 2- argument specializations.
8902         From #77961.
8904 2006-04-01  Marek Safar  <marek.safar@seznam.cz>
8906         * assign.cs (Assign.DoResolve): Assignment to same variable can occur
8907         in an embedded statement too.
8909 2006-04-01  Raja R Harinath  <rharinath@novell.com>
8911         Fix #77958
8912         * statement.cs (Switch.EmitObjectInteger) [ulong]: Remove bad cast.
8914 2006-04-01  Marek Safar  <marek.safar@seznam.cz>
8916         A fix for #77966.
8918         * class.cs (TypeContainer.AddPartial): Don't report an error when modifier
8919         was not specified.
8921         * modifiers.cs: Add DEFAULT_ACCESS_MODIFER.
8923 2006-03-31  Marek Safar  <marek.safar@seznam.cz>
8925         * assign.cs (LocalTemporary): Don't require ILGenerator in the resolve
8926         phase.
8928         * anonymous.cs, assign.cs, ecore.cs, expression.cs: Updated after
8929         LocalTemporary change.
8931         * class.cs (ClassOrStruct.DefineDefaultConstructor): Moved from
8932         TypeContainer.
8933         (ClassOrStruct.DefineFieldInitializers): Implemented static field
8934         initializers optimization.
8935         (ClassOrStruct.TypeAttr): Moved from modifiers.
8936         (Constructor.CheckBase): Don't crash when static ctor has parameters.
8937         (FieldBase.ResolveInitializer): Resolves initializer.
8938         (FieldBase.HasDefaultInitializer): New property.
8940         * cs-parser.jay: Removed message.
8942         * expression.cs (CompilerGeneratedThis): New specialization.
8944         * modifiers.cs (TypeAttr): Moved to ClassOrStruct.TypeAttr
8946 2006-03-28  Marek Safar  <marek.safar@seznam.cz>
8948         * cs-parser.jay, cs-tokenizer.cs: On demand Stack allocation.
8950 2006-03-27  Marek Safar  <marek.safar@seznam.cz>
8952         * ecore.cs (Expression.ResolveAsConstant): Clean up, enum constants should
8953         be now EnumConstants only.
8955 2006-03-27  Marek Safar  <marek.safar@seznam.cz>
8957         * attribute.cs, driver.cs: Reset more caches.
8959 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
8961         * cs-tokenizer.cs (adjust_real): Uses float.Parse for float literals.
8963 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
8965         * constant.cs (Constant.Reduce): Replaced EmitContext with single bool
8966         for easier reuse. Updated all overrides.
8967         (IntegralConstant): New base class for all integral constants.
8968         (IntegralConstant.Error_ValueCannotBeConverted): When assigned value if out
8969         of the constant range, report custom error.
8970         (UIntConstant.Reduce): Fixed uint conversion.
8972         * ecore.cs, literal.cs: Reduce updates.
8974 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
8976         A fix for #75813.
8978         * class.cs (Constructor.Define): Removed extra if for default ctors.
8979         A patch from Atsushi Enomoto.
8981 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
8983         * attribute.cs (Attribute.ResolveConstructor): Conversion was moved to
8984         GetAttributableValue.
8986         * constant.cs (Constant.GetAttributableValue): Does implicit conversion
8987         when required.
8989         * convert.cs (ImplicitConversionRequired): Error message moved to
8990         DoubleLiteral.
8992         * ecore.cs (Expression.GetAttributableValue): Add type parameter for
8993         automatic implicit conversion of an output value.
8994         (EnumConstant.GetAttributableValue): Don't reduce the enum constants.
8996         * expression.cs (ArrayCreation.GetAttributableValue): Add element type
8997         conversion.
8998         (TypeOf.GetAttributableValue): Add extra handling for object type.
9000         * literal.cs (DoubleLiteral.Error_ValueCannotBeConverted): Doubles can have
9001         special error message.
9003 2006-03-25  Marek Safar  <marek.safar@seznam.cz>
9005         * class.cs (Constructor.Emit): Don't crash when struct ctor is
9006         InternalCall.
9007         (Constructor.ApplyAttributeBuilder): Transform MethodImplAttribute to be
9008         compatible with MS runtime.
9010 2006-03-23  Marek Safar  <marek.safar@seznam.cz>
9012         * attribute.cs (Attribute.ResolveConstructor): Check for an invalid
9013         attribute arguments here.
9015         * class.cs (Indexer.Define): The check was moved to attribute class.
9017 2006-03-22  Marek Safar  <marek.safar@seznam.cz>
9019         * assign.cs, class.cs, codegen.cs, convert.cs, decl.cs, ecore.cs,
9020         expression.cs, typemanager.cs: Minor changes from gmcs to make merging
9021         easier.
9023 2006-03-22  Raja R Harinath  <rharinath@novell.com>
9025         Support ParameterDefaultValueAttribute in gmcs.  Also applied to
9026         mcs to keep code differences small.
9027         * attribute.cs (Attribute.GetParameterDefaultValue): New.
9028         * typemanager.cs (parameter_default_value_attribute_type): New.
9029         * parameter.cs (Parameter.ApplyAttributeBuilder): Use them.  Add
9030         CS1908 check.
9032 2006-03-21  Marek Safar  <marek.safar@seznam.cz>
9034         * expression.cs (StringConcat.Append): Reverted back to no warning state.
9036 2006-03-21  Marek Safar  <marek.safar@seznam.cz>
9038         * const.cs (Error_ConstantCanBeInitializedWithNullOnly): Share a message.
9040         * statement.cs (Block.ResolveMeta): Look for wrong object constants in
9041         the blocks too.
9043 2006-03-21  Atsushi Enomoto  <atsushi@ximian.com>
9045         * doc-bootstrap.cs : fix build.
9047 2006-03-20  Marek Safar  <marek.safar@seznam.cz>
9049         * expression.cs (StringConcat.Append): Issue a warning when empty string
9050         is going to append.
9052 2006-03-20  Marek Safar  <marek.safar@seznam.cz>
9054         * assign.cs (CompoundAssign.ResolveSource): Removed.
9056         * attribute.cs (ResolvePossibleAttributeType): Updated after MemberAccess
9057         clean up.
9059         * class.cs (TypeContainer.FindMethods): Removed.
9060         (TypeContainer.CheckMemberUsage): Made static.
9062         * codegen.cs (GetAssemblyName): Uses Length for empty string test.
9064         * constant.cs (CheckRange): Removed unused type argument.
9065         (CheckUnsigned): Removed unused type argument.
9067         * cs-parser.jay: Updated after MemberAccess clean up.
9068         Uses Length for empty string test.
9070         * cs-tokenizer.cs: Uses Length for empty string test.
9071         (IsCastToken): Made static.
9072         (is_hex): Made static.
9073         (real_type_suffix): Made static.
9075         * decl.cs (SetupCache): Made static.
9076         (OnGenerateDocComment): Removed unused ds argument.
9078         * delegate.cs (VerifyDelegate): Removed unused argument.
9080         * doc.cs: Uses Length for empty string test.
9082         * driver.cs: Uses Length for empty string test.
9084         * enum.cs (IsValidEnumType): Made static
9086         * expression.cs (EnumLiftUp): Removed unused argument.
9087         (ResolveMethodGroup): Ditto.
9088         (BetterConversion): Ditto.
9089         (GetVarargsTypes): Ditto.
9090         (UpdateIndices): Ditto.
9091         (ValidateInitializers): Ditto.
9092         (MemberAccess.ctor): Ditto.
9093         (GetIndexersForType): Ditto.
9095         * flowanalysis.cs: (MergeFinally): Removed unused argument.
9097         * iterators.cs: Updated after MemberAccess clean up.
9099         * location.cs: Uses Length for empty string test.
9101         * namespace.cs: Uses Length for empty string test.
9103          * report.cs (CheckWarningCode): Made static.
9105         * statement.cs (LabeledStatement): Removed unused argument.
9107         * typemanager.cs (FilterNone): Removed.
9109 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
9111         * codegen.cs (EmitContext.TestObsoleteMethodUsage): Removed as it become
9112         obsolete.
9114         * class.cs: Updated.
9116 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
9118         * cs-parser.jay.cs: __arglist is not allowed for delegates.
9120 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
9122         A fix for #77822.
9124         * expression.cs (VerifyArgumentsCompat): Reverted to double error
9125         reporting, it's more tricky than I thought.
9127 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
9129         A fix for #77816.
9131         * anonymous.cs.cs (AnonymousMethod): Add host to allow access to 
9132         host container.
9133         (AnonymousMethod.ImplicitStandardConversionExists): New method.
9134         (AnonymousMethod.Compatible): Moved parameter resolving to DoResolve.
9135         Add more error reporting; Fixed issue with params.
9137         * convert.cs (ImplicitStandardConversionExists): Returned conversion check.
9139         * cs-parser.jay: AnonymousMethod requires host container.
9141         * delegate.cs (NewDelegate.DoResolve): Updated after Compatible changes.
9143 2006-03-18  Raja R Harinath  <harinath@gmail.com>
9145         * class.cs: Change 'TypeContainer ds' constructor argument to
9146         'DeclSpace parent'.  Some classes were missed below due to
9147         different naming convention.
9149         * class.cs (MemberCore.Parent): Delete.  This makes the
9150         ParentContainer changes below enforceable by the compiler.
9152         Treat pointers to enclosing declaration space as 'DeclSpace', not
9153         'TypeContainer'.
9154         * class.cs, const.cs, delegate.cs, enum.cs, iterator.cs: Change
9155         'TypeContainer parent' constructor argument to 'DeclSpace parent'.
9157         * statement.cs (LocalInfo..ctor): Use DeclSpace argument instead
9158         of TypeContainer.
9159         (Block.AddThisVariable): Likewise.
9160         * class.cs (MethodData.Define, MethodData.Emit): Likewise.
9161         (AbstractPropertyEventMethod.Emit): Likewise.
9162         (AbstractPropertyEventMethod.EmitMethod): Likewise.
9163         (GetMethod.Define, SetMethod.Define): Likewise.
9164         (PropertyMethod.Define, DelegateMethod.Define): Likewise.
9165         (DelegateMethod.EmitMethod): Likewise.
9167         Fix regression test-partial-13.cs.
9168         Rationalize use of PartialContainer.  Ensure that the partial
9169         class semantics can be tied to type-correctness, i.e., any
9170         violation will cause a compile error.
9171         * class.cs, const.cs: Access all fields that belong to class
9172         TypeContainer via ParentContainer.  Arguments of EmitContexts and
9173         Resolve()-like functions still use 'Parent'.
9175         * class.cs (SourceMethod): Use DeclSpace, not TypeContainer.
9176         (*.CreateEmitContext): Change TypeContainer argument to DeclSpace.
9177         (PropertyMethod.CheckModifiers): Remove unused argument.
9178         * codegen.cs (EmitContext..ctor): Change TypeContainer argument to
9179         DeclSpace.
9181 2006-03-17  Raja R Harinath  <harinath@gmail.com>
9183         Make semantics of PartialContainer simpler.
9184         * decl.cs (DeclSpace.IsPartial): Remove.
9185         * class.cs (TypeContainer.IsPartial): Likewise.
9186         (TypeContainer..ctor): Set PartialContainer to point to self.
9187         (TypeContainer.GetClsCompliantAttributeValue): Don't use IsPartial.
9188         (TypeContainer.FindNestedType): Likewise.
9189         (MemberCore.ParentContainer): Simplify.  Remove deprecation.
9191 2006-03-17  Marek Safar  <marek.safar@seznam.cz>
9193         * typemanager.cs.cs (GetInterfaces): Don't recreate 0-sized arrays.
9195 2006-03-15  Marek Safar  <marek.safar@seznam.cz>
9197         * class.cs (FieldMember.Emit): ParentContainer is real parent for partial
9198         classes.
9200 2006-03-15  Marek Safar  <marek.safar@seznam.cz>
9202         * class.cs (Operator.Define): An error for base conversion was not
9203         reported correctly.
9205 2006-03-14  Atsushi Enomoto  <atsushi@ximian.com>
9207         * iterator.cs : yield break is allowed in try statement which has
9208           catch clauses. Fixed bug #77767.
9210 2006-03-13  Marek Safar  <marek.safar@seznam.cz>
9212         A fix for #77593, #77574.
9214         * class.cs (MethodCore.CheckBase): Another if for operator.
9216 2006-03-09  Marek Safar  <marek.safar@seznam.cz>
9218         * anonymous.cs (AnonymousMethod.Compatible): Don't crash when parameters
9219         were not resolved
9221         * delegate.cs (Delegate.GetInvokeMethod): Use emitcontext free MemberLookup.
9222         (DelegateCreation.ImplicitStandardConversionExists): New method for just
9223         conversion test.
9224         
9225         *ecore.cs (Expression.MemberLookup): Don't ask for emitcontext when it's
9226         not needed.
9228         * assign.cs, constant.cs, convert.cs, delegate.cs, expression.cs:
9229         Updated after another emitcontext usage was clean up. It should help us to
9230         synchronize with gmcs easier.
9232 2006-03-04  Marek Safar  <marek.safar@seznam.cz>
9234         A fix for #77353.
9236         * class.cs (SetMethod.DefineParameters): Uses new parameters type ctor.
9237         (Event.Define): ditto
9238         (SetIndexerMethod.DefineParameters): Uses Parameters.MergeGenerated.
9240         * delegate.cs (Delegate.Define): Uses Parameters.MergeGenerated.
9241         Removed redundant code and set NewSlot for Invoke method too.
9243         * parameter.cs (Parameters.ctor): Add custom, type ctor.
9244         (Parameters.MergeGenerated): New method. Use this method when you merge
9245         compiler generated argument with user arguments.
9247 2006-03-03  Marek Safar  <marek.safar@seznam.cz>
9249         * attribute.cs (ResolveAsTypeTerminal): Removed.
9251         * ecore.cs (Expression.ResolveAsTypeTerminal): Make virtual to allow
9252         specialization for predefined types; 30% speed up.
9253         Finally placed obsolete check to right place.
9254         (Expression.ResolveType): Removed.
9256         * enum.cs, expression.cs, parameter.cs, statement.cs, typemanager.cs:
9257         Updated after ResolveType was removed.
9259         * expression.cs (Cast.ctor): Check void cast.
9260         (Binary.ResolveAsTypeTerminal): Is never type.
9261         (Conditional.ResolveAsTypeTerminal): Is never type.
9263         * rootcontext.cs (ResolveCore): Set base type to simplify some code later.
9265 2006-03-01  Raja R Harinath  <rharinath@novell.com>
9267         Fix #77679.
9268         * expression.cs (ParameterReference.DoResolveBase): Change return
9269         type to bool.
9270         (ParameterReference.DoResolve, ParameterReference.DoResolveLValue):
9271         Update.
9273         Fix #77628.
9274         * ecore.cs (PropertyExpr.InstanceResolve): Fix CS1540 check.
9276         Fix #77642.
9277         * typemanager.cs (GetFullNameSignature): Don't nullref on
9278         protected accessors.
9280 2006-02-27  Marek Safar  <marek.safar@seznam.cz>
9282         * attribute.cs (Attribute.PosArguments, Attribute.NamedArguments): Use
9283         these two separated members to simplify the code.
9284         (Attribute.Resolve): Refactored to use new fields and methods.
9285         (Attribute.ResolveConstructor): Extracted from ResolveArguments and
9286         implemented obsolete attribute checking.
9287         (Attribute.ResolveNamedArguments): Extracted from ResolveArguments and
9288         implemented obsolete checking again. It look line never ending quest ;-)
9289         (GlobalAttribute.ResolveConstructor): Need to override as the rest.
9291         * cfold.cs (BinaryFold): TryReduce throws an exception to indicate error.
9293         * constanct.cs (TryReduce): Throws OverflowException to indicate error.
9295         *class.cs (Property.Define): Add RegisterProperty call.
9297         * cs-parser.jay: Replaced ArrayList with fixed array for attribute
9298         argument groups (only 2).
9300         * ecore.cs (Expression.GetAttributableValue): New virtual method used for
9301         encoding expression to arguments.
9302         (Expression.ExprClassToResolveFlags): Just turned to property.
9304         * expression.cs (ArrayCreation.ValidateInitializers): Slightly optimized.
9305         (ArrayCreation.GetAttributableValue): Renamed from EncodeAsAttribute and
9306         optimized as well as implemented support for zero-length attributes.
9308         * typemanager.cs (TypeManager.RegisterProperty, TypeManager.GetProperty):
9309         Add caching of PropertyInfo's.
9311 2006-02-25  Marek Safar  <marek.safar@seznam.cz>
9313         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Don't report
9314         error multiple times.
9316 2006-02-25  Marek Safar  <marek.safar@seznam.cz>
9318         New partial class implementation.
9319         A fix for #77027, #77029, #77403
9321         * attribute.cs (Attributable): Made attributes protected.
9323         * class.cs (TypeContainer): Add PartialContainer and partial_parts as
9324         the replacements of ClassPart and PartialContainer.
9325         (TypeContainer.AddClassOrStruct): Call RecordDecl here.
9326         (TypeContainer.AddInterface): Ditto.
9327         (TypeContainer.AddPartial): The main method for partial classes. It checks
9328         for errors and merges ModFlags and attributes. At the end class is added to
9329         partial_parts list.
9330         (TYpeContainer.DefineDefaultConstructor): Checks whether default ctor is
9331         required here.
9332         (TypeContainer.GetClsCompliantAttributeValue): Cope with partial class too.
9333         (TypeContainer.GetNormalPartialBases): Resolves base classes and interfaces
9334         from the rest of partial classes.
9335         (TypeContainer.GetClassBases): Simplified.
9336         (TypeContainer.DefineTypeBuilder): New method, mostly extracted from
9337         DefineType.
9338         (TypeContainer.DefineDefaultConstructor): Is used by derived classes.
9339         (TypeContainer.HasExplicitLayout): Uses Flags now.
9340         (PartialContainer): Removed.
9341         (ClassOrStruct.AddToContainer): Moved enclosing member name check here.
9342         (StaticClass): Was merged with Class.
9343         (Class.GetClassBases): class and static class bases are verified here.
9344         (Class.TypeAttr): Added static attributes when class is static.
9345         (Struct.RegisterFieldForInitialization): Moved from TypeContainer.
9346         (MemberBase): In some cases we need to call parent container for partial
9347         class. It should be eliminated but it's not easy now.
9349         * cs-parser.jay: Replaced all PartialContainer with AddPartial.
9351         * decls.cs (MemberCore.DocComment): Introduced new property as is used by
9352         partial classed to accumulate class comments.
9353         (MemberCore.GetClsCompliantAttributeValue): Moved from TypeContainer.
9355         * doc.cs (GenerateTypeDocComment): Partial classes clean up.
9357         * driver.cs (MainDriver): Tree.GetDecl was removed.
9359         * modifiers.cs (Modifiers): Add partial modifier.
9361         * tree.cs (Tree.decl): Removed.
9362         (RootTypes): Started to use this class more often for root types
9363         specializations.
9365 2006-02-22  Marek Safar  <marek.safar@seznam.cz>
9367         A fix for #77615
9369         * attribute.cs (AttributeTester.GetCoClassAttribute): Don't crash when
9370         external interface does not have an attribute.
9372 2006-02-22  Marek Safar  <marek.safar@seznam.cz>
9374         Another prerequisites for new partial classs implementation.
9375         
9376         * attribute.cs (Attribute.Equal): Implemented.
9377         (Attribute.Emit): Changed as attributes can be applied more than twice.
9378         (Attributes.Emit): Check for duplicate attributes here.
9380         * class.cs, decl.cs, delegate.cs, doc.cs, enum.cs: Don't pass DeclSpace
9381         as a parameter, clean-up.
9383 2006-02-11  Marek Safar  <marek.safar@seznam.cz>
9385         A fix for #77485
9387         * class.cs (TypeContainer.DefineType): Cannot use ResolveType because it
9388         contains obsolete attribute check which can in some cases look for base
9389         type of current class which is not initialized yet.
9390         (TypeContainer.BaseType): Replacement of ptype.
9392         * decl.cs (MemberCore.CheckObsoleteType): Reuse existing code.
9394 2006-02-11  Marek Safar  <marek.safar@seznam.cz>
9396         First of prerequisites for new partial classs implemention.
9397         
9398         * attribute.cs (Attributable): Extended by ResolveContext;
9399         Attributes finally have correct context for resolving in all cases.
9400         (AttachTo): Attribute owner is assigned here.
9402         * codegen.cs (IResolveContext): Introduce new interface to hold
9403         all information needed in resolving phase.
9404         (EmitContext): Implements IResolveContext; more clean-up needed here.
9405         
9406         * decl.cs (MemberCore): Implemented IResolveContext.
9408         * anonymous.cs, attribute.cs, class.cs, codegen.cs, const.cs,
9409         decl.cs, ecore.cs, enum.cs, expression.cs, iterators.cs, namespace.cs,
9410         parameter.cs, statement.cs, tree.cs, typemanager.cs:
9411         Refactored to use new IResolveContext instead of EmitContext; cleanup
9413 2006-02-06  Miguel de Icaza  <miguel@novell.com>
9415         * codegen.cs (EmitScopeInitFromBlock): check here the
9416         capture_context, there is no need to make two calls to the
9417         EmitContext. 
9419         * anonymous.cs: Add some debugging messages that might help me
9420         track other instances of this problem in the future (the
9421         regression of test 467).
9423         * cs-parser.jay: track the variable block, as we need to initalize
9424         any captured variables declared in this block for the "catch"
9425         portion of the "Try" statement.
9427         * statement.cs (Try.Emit): If the "Catch" has a VarBlock, emit any
9428         scope initialization for captured variables. 
9430         Also, move the emit for the variables after the block location has
9431         been marked.
9433 2006-02-06  Marek Safar  <marek.safar@seznam.cz>
9435         * ecore.cs (PropertyExpr.FindAccessors): Just made flags const.
9437 2006-02-02  Miguel de Icaza  <miguel@novell.com>
9439         * anonymous.cs (CaptureContext.EmitInitScope): I was wrong in the
9440         commit yesterday, the initialization for the roots is necessary.
9441         What is not necessary is the scope activation.
9443 2006-02-02  Raja R Harinath  <rharinath@novell.com>
9445         * ecore.cs (PropertyExpr.DoResolveLValue): Add CS0206 check.
9446         * expression.cs (IndexerAccess.DoResolveLValue): Add CS1612 and
9447         CS0206 checks.
9448         (Argument.Resolve): Remove CS0206 checks.
9450 2006-02-01  Miguel de Icaza  <miguel@novell.com>
9452         * anonymous.cs (CaptureContext.EmitInitScope): Do not emit the
9453         scopes for all the roots, the scopes will now be emitted when the
9454         Blocks are entered.   [This change was wrong, fixed on 2006-02-02]
9456         (CaptureContext.EmitScopeInitFromBlock): Simply emit the ScopeInfo
9457         code.  This reduces a lot of existing cruft.
9458         
9459         * statement.cs (Block.Emit): Call EmitScopeInitFromBlock here, so
9460         that the ScopeInfo is generated as we enter the scope, not at the
9461         time of use, which is what we used to do before.
9463         * codegen.cs (EmitScopeInitFromBlock): New routine, this is called
9464         every time a Block is about to be emitted if we have a
9465         CaptureContext. 
9467 2006-02-01  Raja R Harinath  <rharinath@novell.com>
9469         * typemanager.cs (NoTypes, NoTypeExprs): Remove.
9470         (Reset): Update.
9471         * *.cs: Use Type.EmptyTypes instead of TypeManager.NoTypes.
9473         * typemanager.cs (cons_param_array_attribute): Make private.
9474         (Reset): Set it to null.
9475         (InitCoreHelpers): Don't initialize it.
9476         (ConsParamArrayAttribute): New.  Initialize it as needed.
9477         * parameter.cs (ParamsParameter.ApplyAttribute): Update to change.
9479 2006-01-31  Miguel de Icaza  <miguel@novell.com>
9481         * expression.cs: There might be errors reported during the
9482         selection of applicable methods.  If there are errors, do not
9483         continue execution as it will lead the compiler to crash.
9485 2006-01-30  Miguel de Icaza  <miguel@novell.com>
9487         * expression.cs: Member access is not allowed on anonymous
9488         methods.  Fixes #77402.
9490 2006-01-30  Raja R Harinath  <rharinath@novell.com>
9492         Fix #77401
9493         * cs-parser.jay (VariableDeclaration): Don't set
9494         current_array_type to null.
9495         (field_declaration, event_declaration, declaration_statement):
9496         Set it to null here.
9498 2006-01-28  Raja R Harinath  <harinath@gmail.com>
9500         * typemanager.cs (GenericParameterPosition): New.
9501         * doc.cs: Use it.
9503 2006-01-28  Atsushi Enomoto  <atsushi@ximian.com>
9505         * doc.cs : To process "include" elements, first we should create
9506           another list than XmlNodeList, because it could result in node
9507           removal, which could result in that the XmlNodeList gives up
9508           yielding next node.
9510           (Also made code identical to gmcs again.)
9512 2006-01-25  Miguel de Icaza  <miguel@novell.com>
9514         * ecore.cs: Introduce an error report that we were not catching
9515         before, if not silent, we must report the error.  Gonzalo ran into
9516         it.
9518 2006-01-23  Miguel de Icaza  <miguel@novell.com>
9520         A fix for bug: #76957
9521         
9522         * iterators.cs (MoveNextMethod.CreateMethodHost): call
9523         ComputeMethodHost before creating the method, this is a new
9524         requirement. 
9526         * anonymous.cs (AnonymousContainer): Now we track all the scopes
9527         that this method references (RegisterScope).  The actual scope
9528         where the method is hosted is computed with the ComputeMethodHost
9529         before we create the method.
9531         Moved the Deepest routine here.
9533         (AnonymousContainer.ComputeMethodHost): New routine used to
9534         compute the proper ScopeInfo that will host the anonymous method.
9536         (ScopeInfo): Deal with multiple roots.  The problem was that we
9537         did not have a unique root where all ScopeInfos could be hanged
9538         from.   Remove `topmost' ScopeInfo, and instead keep an arraylist
9539         of roots.  
9541         Remove AdjustMethodScope which is now computed at the end.  Remove
9542         LinkScope which did a partial link, instead link all ScopeInfos
9543         before code generation from the new "LinkScopes" routine. 
9545         Simplify all the Add* routines as they no longer need to maintain
9546         the tree, they just need to record that they are using variables
9547         from a ScopeInfo.
9549         (IsAncestor, GetAncestorScopes, GetParentScope, LinkScope): New
9550         routines to produce the forest of ScopeInfo trees.
9552         * class.cs (TypeContainer.AppendMethod): This is just like
9553         AddMethod, but ensures that an interface implementation method
9554         (IEnumerable.XXX) is not inserted at the beginning of the queue of
9555         methods, but at the end.
9557         We use this functionality to ensure that the generated MoveNext
9558         method in the iterator class is resolved/emitted before the
9559         enumerator methods created.   
9561         This is required because the MoveNext method computes the right
9562         ScopeInfo for the method.  And the other methods will eventually
9563         need to resolve and fetch information computed from the anonymous
9564         method. 
9566 2006-01-21  Raja R Harinath  <harinath@gmail.com>
9567             Carlos Alberto Cortez  <calberto.cortez@gmail.com>
9569         Fix rest of #76995.
9570         * namespace.cs (NamespaceEntry.UsingExternalAliases): Don't add to
9571         the 'aliases' hash.
9572         (NamespaceEntry.LookupAlias): Lookup 'extern_aliases' hash too.
9573         (NamespaceEntry.VerifyUsing): Resolve external aliases too.
9575 2006-01-18  Raja R Harinath  <rharinath@novell.com>
9577         Fix #76656, cs0231-2.cs.
9578         * cs-parser.jay (formal_parameter_list): Make error case catch
9579         more issues.
9580         (parenthesized_expression_0): Add CS1026 check.
9581         (invocation_expression): Remove unused { $$ = lexer.Location }.
9583 2006-01-17  Raja R Harinath  <rharinath@novell.com>
9585         Fix #76824.
9586         * cs-parser.jay (statement_expression): Don't list out the
9587         individual statement-expressions.  Convert syntax error into
9588         CS0201 check.
9590 2006-01-16  Raja R Harinath  <rharinath@novell.com>
9592         Fix #76874.
9593         * ecore.cs (MemberAccess.CheckIntermediateModification): Remove.
9594         (UnboxCast.DoResolveLValue): New.  Move CS0445 check from
9595         CheckIntermediateModification.
9596         (FieldExpr.DoResolve): Add new two-argument version that
9597         allows us to resolve the InstanceExpression as an lvalue.
9598         The one-argument variant is now just a wrapper.
9599         (FieldExpr.DoResolveLValue): Use two-argument DoResolve.
9600         Resolve the lhs as an lvalue if the it has a value type.
9601         (FieldExpr.AssignToReadonly): Move CS1648 and CS1650 checks
9602         from Assign.DoResolve.
9603         (PropertyExpr.InstanceResolve): Allow InstanceExpression to be
9604         resolved as an lvalue.
9605         (PropertyExpr.DoResolve): Update.
9606         (PropertyExpr.DoResolveLValue): Resolve the lhs as an lvalue if it
9607         has a value type.  Move CS1612 check here from
9608         CheckIntermediateModification.
9609         * assign.cs (Assign.DoResolve): Remove CS1648 and CS1650 checks.
9610         * expression.cs (EmptyExpression.OutAccess): New.  Used as the
9611         'right_side' of a ResolveLValue on an 'out' argument.
9612         (EmptyExpression.LValueMemberAccess): New.  Used as the
9613         'right_side' of a propagated ResolveLValue on a value type.
9614         (LocalVariableReference.DoResolveBase): Recognize
9615         EmptyExpression.OutAccess and EmptyExpression.LValueMemberAccess.
9616         Add CS1654 check.
9617         (Argument.Resolve): Use EmptyExpression.OutAccess rather than
9618         EmptyExpression.Null.
9620 2006-01-16  Atsushi Enomoto  <atsushi@ximian.com>
9622         * typemanager.cs : added IsGenericParameter(). In mcs it always
9623           return false.
9624         * doc.cs : for generic parameters, use GenericParameterPosition,
9625           not FullName.
9627 2006-01-12  Ben Maurer  <bmaurer@andrew.cmu.edu>
9629         * expression.cs: Fix Console.WriteLine ((this = x).foo);
9631 2006-01-12  Miguel de Icaza  <miguel@novell.com>
9633         This fixes the problem where we used ldfld instead of ldflda to
9634         load the "THIS" pointer on captured parameters, when THIS is a
9635         value type.  See bug #77205.
9636         
9637         * iterators.cs (CapturedThisReference.Emit): Pass false to
9638         EmitThis (we do not need the address).
9640         * codegen.cs (EmitThis): it needs to know whether we need the
9641         address of `this' or not.  This is used by value types.  
9643         * expression.cs (This.AddressOf): Pass true to the EmitThis call,
9644         every other call passes false.
9646 2006-01-12  Raja R Harinath  <rharinath@novell.com>
9648         Fix #77221.
9649         * typemanager.cs (TryGetBaseDefinition): Rename from the mis-named
9650         GetOverride.
9651         * expression.cs (Invocation.OverloadResolve): Update.
9652         (Invocation.DoResolve): Avoid double resolution of invocation.
9654 2006-01-11  Raja R Harinath  <rharinath@novell.com>
9656         Fix #77180.
9657         * expression.cs (Unary.Emit): When in /checked+ mode, don't emit
9658         unary negation of floating point types as 0-expr; negation cannot
9659         overflow in floating point types.
9661         Fix #77204.
9662         * expression.cs (MemberAccess.DoResolve): Disallow the use of '.'
9663         on operands of 'void' type.
9665         Fix #77200.
9666         * cfold.cs (BinaryFold): Implement folding of BinaryOr, BinaryAnd
9667         and ExclusiveOr for boolean constants too.
9669 2006-01-09  Raja R Harinath  <rharinath@novell.com>
9671         Fix #75636.
9672         * expression.cs (Invocation.OverloadResolve): Replace reflected
9673         override methods with their base virtual methods, rather than
9674         skipping over them.
9675         * typemanager.cs (TypeManager.GetOverride): New.
9677 2006-01-05  Jb Evain  <jbevain@gmail.com>
9679         * class.cs (Property.Define, Indexer.Define): do not tag the
9680         properties as SpecialName | RTSpecialName.
9682 2006-01-04  Miguel de Icaza  <miguel@novell.com>
9684         * class.cs (MethodCore.IsDuplicateImplementation): This method was
9685         doing a low-level comparission of parameter types.  It was lacking
9686         a check for __argslist. 
9688 2005-12-30  Miguel de Icaza  <miguel@novell.com>
9690         * expression.cs (ParameterReference.DoResolveBase): Allow
9691         reference parameters if they are local to this block. 
9693         This allows the ref and out parameters of a delegate to be used in
9694         an anonymous method, for example:
9696         delegate void set (out int x);
9698         set s = delegate (out int x){
9699                 x = 0;
9700         };
9702         This is used by functionality introduced late in the C# language.
9703         
9704         * anonymous.cs (AnonymousMethod.Compatible): Allow anonymous
9705         method that take ref and out parameters. 
9707         Fixes #77119 which was a late change in the spec.
9709 2005-12-23  Miguel de Icaza  <miguel@novell.com>
9711         * anonymous.cs (ScopeInfo.LinkScope): Do not link the scope to its
9712         parent if its the same scope.  Fixes #77060.
9714 2005-12-21  Miguel de Icaza  <miguel@novell.com>
9716         * driver.cs: Report the case of no source files and no -out:
9717         argument provided.
9719 2005-12-20  Raja R Harinath  <rharinath@novell.com>
9721         Fix #77035.
9722         * expression.cs (ComposedCast.GetSignatureForError): Define.
9724 2005-12-18 Carlos Alberto Cortez <calberto.cortez@gmail.com>
9726         Fix #76995
9728         * namespace.cs (NamespaceEntry): Add extern_aliases as a
9729         ListDictionary, to contain the ExternAliasEntry entries (in
9730         addition to the NamespaceEntry.aliases hashtable). This field is
9731         shared between the original entry and its doppelganger (bodyless 
9732         copy of it).
9733         (NamespaceEntry.UsingExternalAlias): Add the extern alias entry to
9734         extern_aliases field.
9735         (NamespaceEntry.Lookup): Move the IsImplicit check after the
9736         lookup in extern_aliases.
9738 2005-12-16  Raja R Harinath  <rharinath@novell.com>
9740         Fix #77006.
9741         * class.cs (TypeContainer.Mark_HasEquals): New.
9742         (TypeContainer.Mark_HasGetHashCode): New.
9743         (ClassPart): Override them.
9744         (MethodCore.CheckBase): Use them instead of referring to Parent.Methods.
9746         Fix #77008.
9747         * enum.cs (EnumMember.EnumMember): Pass the parent_enum as the
9748         'parent' argument to the base constructor.
9750         Remove all mention of TypeContainer from decl.cs.
9751         * decl.cs (MemberCore.Parent): Change into a DeclSpace.
9752         (MemberCore.MemberCore): Change type of 'parent' argument to DeclSpace.
9753         (DeclSpace.DeclSpace): Likewise.
9754         (DeclSpace.DefineMembers): Remove unused argument.
9755         * cs-parser.jay (pop_current_class): Update to changes.  Simplify
9756         debugging check -- we don't care if the debug code throws an
9757         InvalidCastException instead of an InternalErrorException.
9758         * class.cs (TypeContainer.DefineMembers): Update to changes.
9759         (TypeContainer.DoDefineMembers): Likewise.
9760         (TypeContainer.GetMethods): Likewise.
9761         (PropertyMember.Define): Likewise.
9762         (MemberBase.Parent): New property that forwards to
9763         MemberCore.Parent, but ensures that we get a TypeContainer.
9764         * rootcontext.cs (RootContext.PopulateCoreType): Update to changes.
9765         (RootContext.PopulateTypes): Likewise.  Remove special case code
9766         for !RootContext.StdLib: DefineMembers is idempotent.
9768 2005-12-14  Miguel de Icaza  <miguel@novell.com>
9770         * convert.cs (ExplicitConversionCore): Check the return value from
9771         ExplicitConversionCore which can return null on failure.  Fixes #76914
9773 2005-12-13  Marek Safar  <marek.safar@seznam.cz>
9775         * class.cs (Method.ApplyAttributeBuilder): Test out modifier properly.
9777 2005-12-11  Atsushi Enomoto  <atsushi@ximian.com>
9779         * doc.cs : The search for referenced namespace was insufficient to
9780           get global one as it used to do. Fixed bug #76965.
9782 2005-12-10  Atsushi Enomoto  <atsushi@ximian.com>
9784         * doc.cs : check name in cref in the last phase that whether it is
9785           namespace or not.
9787 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
9789         * cs-tokenizer.cs : reverted the latest change: it somehow broke
9790           Mono.C5.
9792 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
9794         * doc.cs : so it turned out that we cannot skip override check for 
9795           interface members. Fixed bug #76954.
9797 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
9799         * cs-tokenizer.cs : fixed bug #75984:
9800           - #warning and #error should not be handled when the source line
9801             is disabled.
9802           - #line is not checked strictly when the source line is disabled.
9803           - #define and #undef is on the other hand checked strictly at any
9804             state.
9806 2005-12-08  Atsushi Enomoto  <atsushi@ximian.com>
9808         * cs-tokenizer.cs : missing Location (actually, filename) in one of
9809           CS1027 report.
9811 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
9813         * attribute.cs (GlobalAttribute.ctor): Pass NamespaceEntry only.
9815         * class.cs (EmitFieldInitializers): Simplified and fixed to work with
9816         event initializers.
9817         (FieldBase.EmitInitializer): Moved from TypeContainer and simplified.
9818         (FieldBase.Initializer): Initializer is now optional.
9819         (EventField.Define): Only event field can have initializer.
9821         * codegen.cs (EmitContext): DeclSpace is not readonly (small hack).
9823         * const.cs (Const): Reuse initializer.
9825         * cs-parser.jay: Updated after FieldBase changes.
9826         Added current_array_type to simplify array initializers.
9828         * ecore.cs (NullCast.IsDefaultValue): Implemented.
9830         * expression.cs, iterators.cs: Updated.
9832         * namespace.cs (NamespaceEntry): Made UsingFound private.
9834 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
9836         * parameterCollection.cs: Obsolete, removed.
9837         * parser.cs: Obsolete, removed.
9839 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
9841         Fix #76849.
9842         * class.cs (Constructor.Emit): Set obsolete checking for whole context.
9844         * enum.cs (Enum.Define): Set obsolete context here.
9846 2005-12-05  Atsushi Enomoto  <atsushi@ximian.com>
9848         * doc.cs :
9849           - FindDocumentedMember() now expects 1) paramList as null
9850             when "we don't have to check the number of parameters" and
9851             2) Type.EmptyTypes when "there is no arguments".
9852           - Introduced FoundMember struct to hold the exact type which was
9853             used to find the documented member (the above change broke
9854             test-xml-044; it might be better just to use DeclaringType than
9855             what MS does, like this change does, but it depends on usage.)
9857 2005-12-05  Atsushi Enomoto  <atsushi@ximian.com>
9859         * doc.cs : documented member might be from DeclaringType for nested
9860           types. Fixed bug #76782.
9862 2005-12-03  Ben Maurer  <bmaurer@ximian.com>
9864         * anonymous.cs: Have the param code handle leaving copies on the
9865         stack etc. Allows anonymous params to take part in the assignment
9866         code (++, +=, etc). Fixes bug #76550
9868         * expression.cs: Handle the prepare_for_load/leave_copy by passing
9869         it down to the anon code.
9871         * iterators.cs: Use dummy var here
9873         * codegen.cs: Handle new vars
9875 2005-12-01  Marek Safar  <marek.safar@seznam.cz>
9877         Fix #76849.
9878         * class.cs (MethodData.Define): Set proper Obsolete context.
9880         * ecore.cs (FieldExpr.ResolveMemberAccess): Don't check [Obsolete] in
9881         obsolete context.
9882         (FieldExpr.DoResolve): Ditto.
9884 2005-12-01  Marek Safar  <marek.safar@seznam.cz>
9886         Fix #76849.
9887         * class.cs (MethodCore.DoDefineParameters): Test [Obsolete] only when
9888         parent is not obsolete.
9890 2005-12-01  Atsushi Enomoto  <atsushi@ximian.com>
9892         * doc.cs : (FindDocumentedMember) find parameterless members first
9893           and get CS0419 in the early stage. Fixed first case of bug #76727.
9895 2005-11-30  Marek Safar  <marek.safar@seznam.cz>
9897         Fix #76859.
9898         * ecore.cs (Expression.ResolveAsConstant): Report constant error only when
9899         no error was reported.
9901         *expression.cs (Binary.DoResolve): left can be null.
9903 2005-11-22  Marek Safar  <marek.safar@seznam.cz>
9905         Fix #76783.
9906         * class.cs (MethodData.Emit): Parameters should be labeled first.
9908 2005-11-21  Marek Safar  <marek.safar@seznam.cz>
9910         Fix #76761.
9911         * parameter.cs (Parameter.ApplyAttributeBuilder): Fixed `ref' detection.
9913 2005-11-18  Marek Safar  <marek.safar@seznam.cz>
9915         * attribute.cs (AreParametersCompliant): Moved to Parameter.
9917         * class.cs (MethodCore): Parameter clean up.
9918         (IMethodData): Added ParameterInfo.
9919         (MethodData): Parameter clean up.
9920         (Indexer.Define): Parameter clean up.
9922         * anonymous.cs,
9923         * codegen.cs,
9924         * cs-parser.jay,
9925         * decl.cs,
9926         * doc.cs,
9927         * ecore.cs,
9928         * flowanalysis.cs,
9929         * iterators.cs,
9930         * pending.cs,
9931         * statement.cs,
9932         * typemanager.cs: Parameter clean up.
9934         * delegate.cs (Define): Get rid of duplicated code.
9936         * expression.cs (ParameterReference): Removed useless parameters
9937         and simplified.
9938         (Invocation): Ditto.
9940         * parameter.cs (ParamsParameter): New class, params specialization.
9941         (ArglistParameter): Attemp to separate arglist.
9942         (Parameter): Refactored to be reusable and faster.
9943         (Parameter.Modifier): Made understandable.
9944         (Parameters): Changed to be used as a class for `this' assembly
9945         parameters. Refactored to use new specialized classes.
9947         * support.cs (ParameterData): Added Types property.
9948         (InternalParameters): Deleted.
9950 2005-08-20  Martin Baulig  <martin@ximian.com>
9952         Merging this patch from GMCS to fix #75867.
9954         * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
9955         scope if we don't already have it.
9957 2005-11-17  Martin Baulig  <martin@ximian.com>
9959         * anonymous.cs
9960         (CaptureContext.EmitMethodHostInstance): Use `Ldarg_0' if we
9961         inherit the scope from our parent.  Fixes #76653.
9963 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
9965         * doc.cs : the previous patch does not actually fix the bug.
9966           PropertyInfo override check is now implemented and really fixed it.
9967         * expression.cs : Invocation.IsAncestralType() is used from doc.cs.
9969 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
9971         * doc.cs : apply "override filter" also to properties.
9972           Fixed bug #76730.
9974 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
9976         * doc.cs : renamed FindMembers() to FindMethodBase(). For interfaces,
9977           no need to check overrides. For classes, omit those results from 
9978           interfaces since they must exist in the class. Fixed bug #76726.
9980 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
9982         * typemanager.cs : (GetFullNameSignature) differentiate indexers
9983           with different parameters. Fixed the second problem in #76685.
9985 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
9987         * doc.cs : (FindDocumentedMember) pass invocation_type as well (to
9988           get expected 'protected' access in CheckValidFamilyAccess()).
9989           Fixed bug #76692.
9991 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
9993         * doc.cs : (GenerateTypeDocComment) Fields could be FixedField.
9994           Fixed bug #76705.  CS1569 was incorrectly commented out.
9996 2005-11-14  Atsushi Enomoto  <atsushi@ximian.com>
9998         * doc.cs : use Invocation.IsOverride() to do real override check.
9999         * expression.cs : made Invocation.IsOverride() internal.
10001 2005-11-14  Atsushi Enomoto  <atsushi@ximian.com>
10003         * doc.cs : use TypeManager.FindMembers() instead of (possible)
10004           TypeBuilder.FindMembers() and filter overriden base members out.
10005           Fixed bug #76990.
10007 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
10009         * doc.cs : ref/out parameters are represented as '@' (instead of
10010           '&' in type FullName). Fixed bug #76630 (additionally crefs).
10012 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
10014         * doc.cs : when there was no '.' in cref to methods in doc comment,
10015           then parameters were missing in the output. Fixed bug #76691.
10017 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
10019         * driver.cs : don't output docs when there is an error.
10020           Fixed bug #76693.
10022 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
10024         * doc.cs :
10025           Now it should detect indexers. Fixed primary concern in bug #76685.
10026           Fixed CS0419 message to not show the identical member signature in
10027           the message.
10029 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
10031         * doc.cs : (FindDocumentedMember) use TypeManager.MemberLookup()
10032           instead of Type.FindMembers() since it does not handle events.
10033           Fixed bug #71604.
10035 2005-11-12  Gert Driesen  <drieseng@users.sourceforge.net>
10037         * codegen.cs: Fixed typo (speficied -> specified).
10039 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
10041         Fix #76369.
10042         * doc.cs (FindDocumentedTypeNonArray): Don't resolve again.
10044 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
10046         * attribute.cs: Changed error message.
10048         * cs-tokenizer.cs: One more check.
10050 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
10052         * statement.cs (Block.Resolve): Ignore empty statement.
10054 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
10056         * report.cs: Made error/warning methods more strict to avoid
10057         their misuse.
10059         * anonymous.cs, attribute.cs, class.cs, codegen.cs, constant.cs,
10060         convert.cs, cs-parser.jay, cs-tokenizer.cs, decl.cs, delegate.cs,
10061         doc.cs, driver.cs, ecore.cs, expression.cs, location.cs,
10062         namespace.cs, parameter.cs, statement.cs, typemanager.cs: Updated.
10064 2005-11-08  Marek Safar  <marek.safar@seznam.cz>
10066         * attribute.cs (Attribute.GetCoClassAttributeValue): New method.
10067         (AttributeTester.GetCoClassAttribute): Get CoClassAttribute.
10069         * class.cs (TypeContainer.IsComImport): New property.
10070         (Constructor.Define): Create proper ctor for ComImport types.
10072         * expression.cs (New.CheckComImport): Fixed.
10074 2005-11-07  Miguel de Icaza  <miguel@novell.com>
10076         * anonymous.cs (CaptureContext.AddParameterToContext): The fact
10077         that a parameter has been captured does not mean that we do not
10078         have to do the rest of the processing.  This fixes the second part
10079         of #76592.  If there was another anonymous method capturing
10080         values in the past, the Scope would never be set for the second
10081         method that captured the same parameter.
10083         (CaptureContext.EmitAssignParameter): When `leave_copy' is passed,
10084         properly manipulate the stack.   Second part of fix for #76592.
10086         * expression.cs (New): Add support for invoking "new" on
10087         interfaces that have been flagged with the ComImport attribute and
10088         the CoClass.  Fixes #76637 
10090         * statement.cs (Try.DoEmit): When a variable is captured, do not
10091         try to emit the vi.LocalBuilder variable as it has been captured.
10092         Create a temporary variable and store the results on the
10093         FieldBuilder.  Fixes #76642
10095 2005-11-07  Marek Safar  <marek.safar@seznam.cz>
10097         * class.cs (CheckPairedOperators): Made compilable with csc 2.0.
10099         * ecore.cs (InstanceResolve): Fixed CS1540 detection.
10101         * expression.cs (Binary.DoResolve): Added && optimalization.
10102     
10103         * typemanager.cs (AddUserType): Removed useless argument.
10105 2005-11-04  Marek Safar  <marek.safar@seznam.cz>
10107         * statement.cs (Block.variables): Uses ListDictionary.
10109 2005-11-03  Marek Safar  <marek.safar@seznam.cz>
10111         Fix #75969.
10112         * class.cs (PartialContainer.EmitType): Customized to emit
10113         security attributes.
10114         (ClassPart.ApplyAttributeBuilder): Transform security attribute
10115         for partial classes.
10117 2005-11-03  Marek Safar  <marek.safar@seznam.cz>
10119         Fix #76599.
10120         * expression.cs (ElementAccess.DoResolveLValue): Fixed buffer
10121         access has to be fixed.
10122         
10123         * typemanager.cs (IsUnmanagedType): Wrong common field type.
10125 2005-11-01  Marek Safar  <marek.safar@seznam.cz>
10127         Fix #76590.
10128         * ecore.cs (NullCast.Reduce): Implemented.
10130         * expression.cs (ArrayCreation.CheckIndices): Correcly check
10131         constant type.
10132         
10133         * statement.cs (SwitchLabel.ResolveAndReduce): Catch null
10134         properly.
10135         (Foreach.Resolve): Catch null properly.
10137 2005-10-29  Marek Safar  <marek.safar@seznam.cz>
10139         * cs-tokenizer.cs: Warning text fix.
10141         * driver.cs: AllWarningNumbers exposed on public interface.
10143         * report.cs (): Reviewed warning numbers.
10144         (IsValidWarning): Use binary search.
10146 2005-10-29  Marek Safar  <marek.safar@seznam.cz>
10148         * driver.cs: Implemeted resource visibility.
10149         (Resources): New class for code sharing between /res: and
10150         /linkres:
10152 2005-10-28  Marek Safar  <marek.safar@seznam.cz>
10154         Fix #76568.
10155         * cfold.cs (ConstantFold.BinaryFold): Implemented null cast
10156         folding.
10157         
10158         * convert (Convert.ImplicitReferenceConversion): NullCast holds
10159         contants only.
10160         
10161         * ecore.cs (NullCast): Child is contant only.
10162         
10163         * literal.cs (NullLiteral.Reduce): null can be converted to any
10164         reference type.
10166 2005-10-28  Kornél Pál  <kornelpal@hotmail.com>
10168         * driver.cs: Use Encoding.Default as default code page instead
10169           of ISO-28591.
10171 2005-10-27  Raja R Harinath  <rharinath@novell.com>
10173         Fix #76085.
10174         * expression.cs (Invocation.Error_InvalidArguments): Handle
10175         __arglist parameters.
10176         (Invocation.VerifyArgumentsCompat): Likewise.
10177         * support.cs (ReflectionParameters.GetSignatureForError): Print
10178         __arglist parameters.
10179         (InternalParamters.GetSignatureForError): Likewise.
10180         * parameter.cs (Parameters.GetSignatureForError): Likewise.
10182 2005-10-26  Marek Safar  <marek.safar@seznam.cz>
10184         * attribute.cs (GetPropertyValue): Made public.
10186         * codegen.cs (AssemblyClass): ResolveClsCompliance renamed to
10187         Resolve.
10188         Add new property WrapNonExceptionThrows to handle 2.0 assembly
10189         attribute.
10190         (AssemblyClass.Emit): Emit RuntimeCompatibilityAttribute when it
10191         is not defined.
10192         
10193         * driver.cs: Reflect method name change.
10194         
10195         * statement.cs (Try.Resolve): Warn when try has both general
10196         exception handlers.
10197         
10198         * typemanager.cs: runtime_compatibility_attr_type new predefined
10199         type.
10201 2005-10-26  Raja R Harinath  <harinath@gmail.com>
10203         Fix #76419.
10204         * pending.cs (InterfaceMethod): Allow tm.args [i] to be null --
10205         treat it as an empty parameter list.
10207 2005-10-26  Raja R Harinath  <rharinath@novell.com>
10209         Fix #76271.     
10210         * ecore.cs (SimpleName.DoSimpleNameResolve): Make fall-back 
10211         ResolveAsTypeStep silent.
10212         * statement.cs (Block.AddConstant): Mark block as used.
10213         (Block.ResolveMeta): Avoid piling on error messages
10214         if a constant initializer resolution fails.
10216 2005-10-25  Raja R Harinath  <rharinath@novell.com>
10218         * namespace.cs (RootNamespace.VerifyUsingForAll, Namespace.VerifyUsing):
10219         Remove.
10220         (NamespaceEntry.VerifyAllUsing): New.
10221         (NamespaceEntry.AliasEntry.Resolve): New.  Handles common error
10222         behaviour.  Delegates actual resolution of alias to ...
10223         (NamespaceEntry.DoResolve): ... this.  Renamed from Resolve.
10224         (NamespaceEntry.LocalAliasEntry, NamespaceEntry.ExternAliasEntry):
10225         Update.
10226         * driver.cs (Driver.MainDriver): Update.
10227         
10228         * namespace.cs (NamespaceEntry.DefineNamespace): Remove.
10229         (NamespaceEntry.SymbolFileID): Make into a on-demand computed
10230         property.
10231         (Namespace.DefineNamespaces, RootNamespace.DefineNamespacesForAll):
10232         Remove.
10233         * symbolwriter.cs (SymbolWriter.Initialize): Don't call
10234         RootNamespace.DefineNamespacesForAll.
10236 2005-10-24  Raja R Harinath  <harinath@gmail.com>
10238         * typemanager.cs (assemblies, external_aliases, modules)
10239         (AddAssembly, AddExternAlias, AddModule GetAssemblies, Modules)
10240         (ComputeNamespaces, GetRootNamespace): Remove extra staging
10241         overhead.  Move resposibility ...
10242         * namespace.cs (GlobalRootNamespace): ... here.  Update to changes.
10243         * driver.cs, attribute.cs, codegen.cs: Update to changes.
10245 2005-10-23  Raja R Harinath  <harinath@gmail.com>
10247         * namespace.cs (RootNamespace.all_namespaces): Renamed from
10248         cached_namespaces.  Improve usage.
10249         (RootNamespace.Reset, RootNamespace.RegisterNamespace)
10250         (RootNamespace.VerifyUsingForAll, RootNamespace.DefineNamespacesForAll):
10251         Move from GlobalRootNamespace and simplify.
10252         (RootNamespace.Global): Make instance variable.
10253         (RootNamespace.RootNamespace): Add "alias name" parameter.
10254         (GlobalRootNamespace): Simplify drastically.
10255         (Namespace.Lookup): Don't use GetNamespace.
10256         * typemanager.cs (GetRootNamespace): Rename from
10257         ComputeNamespaceForAlias.
10258         (NamespaceClash): Use Global.IsNamespace instead of GetNamespace.
10260 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
10262         * anonymous.cs (AnonymousContainer): Don't crash when container
10263         doesn't exist.
10265 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
10267         * expression.cs (Binary.DoResolve): Warn when comparing same
10268         values.
10270 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
10272         Fix #76486.
10273         * expression.cs (Binary.DoResolve): It looks like there are no
10274         convetsion rules in enum context.
10276 2005-10-19  Carlos Alberto Cortez <calberto.cortez@gmail.com>
10278         Add support for extern alias qualifiers.
10279         * typemanager.cs: Move some LookupTypeReflection code
10280         to namespace.cs, to have cleaner code. Added some methods
10281         to help us keep track of the extern aliased references.
10282         * driver.cs: Add suport for extern alias assemblies on command
10283         line and check for their warnings/errors. Also keep track of the
10284         extern aliased assemblies.
10285         * namespace.cs: Move the global functionality of Namespace
10286         to GlobalRootNamespace/RootNamespace. Now the global namespace
10287         is GlobalRootNamespace.Globa. Also the code moved from 
10288         typemanager.cs lives in GlobalRootNames.cs/RootNamespace.cs. 
10289         Finally added LocalAliasEntry (AliasEntry before) and
10290         ExternAliasEntry, to handle alias statements.
10291         * cs-parser.jay: Add support in the grammar for extern alias
10292         statement.
10293         * doc.cs, delegate.cs, expression.cs ecore.cs, symbolwriter.cs: 
10294         Update callings to Namespace (now in GlobalRootNamespace).
10296 2005-10-18  Raja R Harinath  <rharinath@novell.com>
10298         Fix #76371.
10299         * class.cs (TypeContainer.DefineType): Move updating of
10300         topological sort earlier in the code.
10301         * decl.cs (DeclSpace.ResolveBaseTypeExpr): Don't use TypeBuilder.
10303 2005-10-18  Marek Safar  <marek.safar@seznam.cz>
10305         Fix #76273.
10306         * cfold.cs (BinaryFold): Reduce constant in enum conversion.
10307         
10308         * constant.cs (Constant.TryReduce): Moved from Cast class.
10309         (Reduce): Made little bit more OO and fixed missing conversions.
10310         
10311         * ecore.cs (Reduce): Implemented.
10312         (Binary.EnumLiftUp): New method to upgrade values to enum values.
10313         
10314         * literal.cs (Reduce): Implemented.
10315         
10316         * class.cs: Reverted Miguel's wrong commit.
10318 2005-10-14  Miguel de Icaza  <miguel@novell.com>
10320         * ecore.cs (GetMemberType): Report the correct mapping for the MemberCore
10322 2005-10-14  Atsushi Enomoto  <atsushi@ximian.com>
10324         * cs-parser.jay, expression.cs : CS0214 was missing error location
10325           for constants. Fixed bug #76404.
10327 2005-10-11  Marek Safar  <marek.safar@seznam.cz>
10329         Fix #76370.
10330         * convert.cs (ExplicitConversionCore): Fixed object->enum
10331         conversion.
10333 2005-10-10  Raja R Harinath  <rharinath@novell.com>
10335         * ecore.cs (PropertyExpr.Emit): Use Invocation.EmitCall to emit
10336         InstanceExpression.
10337         (PropertyExpr.EmitCall): Likewise.
10338         * expression.cs (Invocation.EmitArguments): Handle case where
10339         arguments == null.
10340         (Invocation.EmitCall): Avoid allocating temporary variable if
10341         there are no arguments.
10343 2005-10-07  Raja R Harinath  <rharinath@novell.com>
10345         Fix #76323.
10346         * convert.cs (ImplicitConversionStandard): Move conversion of
10347         void* to arbitrary pointer types ...
10348         (ExplicitConversionStandard): .. here.
10349         * ecore.cs (Expression.Error_ValueCannotBeConverted): Fix CS0266
10350         error to always print typenames.
10352 2005-10-07  Raja R Harinath  <rharinath@novell.com>
10354         * convert.cs (GetConversionOperator): Rename from
10355         GetConversionOperators.  Move operator selection code from ...
10356         (UserDefinedConversion): ... here.
10358 2005-10-06  Marek Safar  <marek.safar@seznam.cz>
10360         * convert.cs (ExplicitConversionCore): Removed duplicate enum
10361         conversion.
10363 2005-10-05  Marek Safar  <marek.safar@seznam.cz>
10365         * assign.cs (Assign.DoResolve): Error method changed.
10367         * cfold.cs (DoConstantNumericPromotions): Error method changed.
10368         
10369         * const.cs (ResolveValue): Reset in_transit immediately.
10370         
10371         * constant.cs: Error method changed.
10372         
10373         * convert.cs: Removed useless location parameter.
10374         (ExplicitNumericConversion): Don't do double enum check.
10375         (ExplicitConversionCore): Renamed from ExplicitConversion.
10376         (ExplicitUnsafe): Extracted from ExplicitConversion.
10377         (ExplicitConversion): Uses for error reporting.
10378         
10379         * ecore.cs (Error_ValueCannotBeConverted): More logic for more
10380         error messages.
10381         (ResolveBoolean): Uses common error method.
10382         (CastToDecimal): Get rid of ec.
10383         (CastFromDecimal): Optimized.
10384         (ConvCast): Get rid of ec.
10385         
10386         * enum.cs (ResolveValue): Reset in_transit immediately.
10387         (Emit): Return after first error.
10388         
10389         * expression.cs: Convert changes.
10390         
10391         * literal.cs: Error method changed.
10392         
10393         * statement.cs: Error method changed.
10395 2005-10-03  Raja R Harinath  <rharinath@novell.com>
10397         * support.cs (SeekableStreamReader.Position): Don't error out when
10398         the requested position is just beyond the end of the current
10399         buffered data.
10401 2005-09-28  Raja R Harinath  <rharinath@novell.com>
10403         * support.cs (SeekableStreamReader): Simplify drastically.  Don't
10404         try to keep in sync with the byte count of the underlying Stream.
10405         However, this limits us to a window size of 2048 characters: i.e.,
10406         the maximum lookahead of our lexer/parser can be 2048 characters.
10408 2005-09-28  Marek Safar  <marek.safar@seznam.cz>
10410         Fix #76255.
10411         * driver.cs: Fix compilation files with full root path.
10413 2005-09-25  Miguel de Icaza  <miguel@novell.com>
10415         * report.cs (SymbolRelatedToPreviousError): Format the output so
10416         it does not use an open parenthesis that is never closed. 
10418         * driver.cs: Follow coding guidelines
10420 2005-09-27  Marek Safar  <marek.safar@seznam.cz>
10422         Fix #72930.
10423         * const.cs (Const.ResolveValue): Check for assigning non-null
10424         value to reference type.
10426 2005-09-27  Marek Safar  <marek.safar@seznam.cz>
10428         * anonymous.cs: Implemented ExprClassName.
10429         
10430         * assign.cs (Assign.DoResolve): Don't chrash when type is not
10431         delegate.
10432         
10433         * attribute.cs (ResolveArguments): Enabled MethodImplOptions
10434         check.
10435         
10436         * class.cs (StaticClass.DefineContainerMembers): Report protected
10437         members as error.
10438         
10439         * codegen.cs: if(ed) PRODUCTION.
10440         
10441         * convert.cs (Error_CannotImplicitConversion): Better error
10442         distinction.
10443         
10444         * cs-parser.jay: More error checks.
10445         
10446         * cs-tokenizer.cs (consume_identifier): Fixed Miguel's revert.
10447         
10448         * driver.cs (CSCParseOption): Enabled wrong option check.
10449         
10450         * ecore.cs (Expression.ExprClassName): Turned to property.
10451         (MemberExpr.CheckIntermediateModification): For checking boxed
10452         value types     modification.
10453         
10454         * statement.cs (Fixed.Resolve): Expression type must be
10455         convertible to fixed type.
10456         (CollectionForeach.GetEnumeratorFilter,TryType):
10457         Small refactoring for easier error checking.
10459 2005-09-26  Marek Safar  <marek.safar@seznam.cz>
10461         * attribute.cs (Attribute.Resolve): Check Obsolete attribute for
10462         attributes.
10463         
10464         * class.cs (GeneratedBaseInitializer): New class for customization
10465         compiler generated initializers.
10466         (MemberBase.DoDefine): Check Obsolete attribute here.
10467         (FieldMember.DoDefine): Ditto.
10468         
10469         * const.cs (ExternalConstant.CreateDecimal): Builder for decimal
10470         constants.
10471         
10472         * decl.cs (MemberCore.EmitContext): Returns valid current ec.
10473         (MemberCore.GetObsoleteAttribute): Removed argument.
10474         (MemberCore.CheckObsoleteness): Obsolete attributes are hierarchic.
10475         (MemberCore.CheckObsoleteType): New helper.
10476         
10477         * delegate.cs,
10478         * enum.cs,
10479         * statement.cs: Updates after MemberCore changes.
10480         
10481         * ecore.cs (TypeExpr.ResolveType): Check type obsoleteness here.
10482         (FieldExpr.ResolveMemberAccess): Fixed decimal constants checks.
10483         
10484         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't check
10485         obsolete attribute for compiler construct.
10486         (As.DoResolve): Cache result.
10487         
10488         * iterators.cs (Define_Constructor): Use GeneratedBaseInitializer.
10490 2005-09-26  Raja R Harinath  <rharinath@novell.com>
10492         Fix #76133.
10493         * expression.cs (This.VerifyFixed): In a value type T, the type of
10494         'this' is T&, iow, 'this' is either an out or ref parameter.  In a
10495         value type R, 'this' is treated as a value parameter.
10497 2005-09-22  Miguel de Icaza  <miguel@novell.com>
10499         * statement.cs (Lock): Use the TemporaryVariable class instead of
10500         manually using local variables as those do not work when variables
10501         are captured.
10503         * ecore.cs: Moved the TemporaryVariable class from being a nested
10504         class inside Foreach to be a public class that can be employed in
10505         other places. 
10507 2005-09-19  Marek Safar  <marek.safar@seznam.cz>
10509         * cs-parser.jay: interface_accessors replaced by
10510         accessor_declarations.
10512         * ecore.cs, literal.cs, statement.cs: NullLiteral holds null
10513         location.
10514         
10515         * statement.cs (GotoCase.Resolve): Convert null constant to
10516         null case.
10517         (SwitchLabel.ResolveAndReduce): Ditto.
10518         (SwitchLabel.NullStringCase): Custom null stamp.
10519         (Switch.SimpleSwitchEmit): Fix from NullLiteral to NullStringCase.
10520         
10521         typemanager.cs (CSharpSignature): Don't skip first argument
10522         for full names.
10524 2005-09-18  Miguel de Icaza  <miguel@novell.com>
10526         * driver.cs: Set InEmacs based on the environment variable EMACS. 
10528         * location.cs (InEmacs): in this mode, do not report column
10529         location as it confuses Emacs.
10531 2005-09-16  Marek Safar  <marek.safar@seznam.cz>
10533         * cfold.cs, constant.cs, convert.cs, ecore.cs,
10534         expression.cs, iterators.cs, literal.cs: Store constants and
10535         literals location.
10536         
10537         * class.cs (MemberBase.ShortName): Pass location.
10538         
10539         * cs-parser.jay: Some location fixes.
10540         
10541         * ecore.cs (Expression.Location): Made virtual.
10543 2005-09-05  Miguel de Icaza  <miguel@novell.com>
10545         * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
10546         if the underlying types are the same, otherwise we need to produce
10547         code that will do the proper cast.
10549         This was exposed by Marek's constant rewrite which produced
10550         invalid code for the call site:
10552         enum X : long { a }
10553         void Method (X v) {}
10555         Method ((X) 5)
10557         This fixes test-49.cs
10559 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
10561         * attribute.cs : (Attribute.IsValidArgumentType): array of string/
10562           Type/Object should be allowed as well. Fixed bug #75968.
10564 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
10566         * expression.cs : (Binary.DoResolve): when one is enum constant and
10567           another is constant 0, then return enum one *as enum type*.
10568           Fixed bug 74846.
10570 2005-09-02  Raja R Harinath  <rharinath@novell.com>
10572         * attribute.cs (GetMarshal): Work even if "DefineCustom" is
10573         internal.
10575         Fix #75941.
10576         * ecore.cs (SimpleNameResolve.DoSimpleNameResolve): Disable
10577         flow-branching for LocalVariableReferences in case we were invoked
10578         from a MemberAccess.
10579         * expression.cs (LocalVariableReference.VerifyAssigned): New.
10580         Carved out of ...
10581         (LocalVariableReference.DoResolveBase): ... this.
10582         (MemberAccess.Resolve): Do the check that was disabled during
10583         SimpleNameResolve.
10585 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
10587         * class.cs :
10588           (PartialContainer.Create): check abstract/sealed/static strictly
10589           but abstract/sealed can exist only at one side. Fixed bug #75883.
10591 2005-09-01  Kornél Pál  <kornelpal@hotmail.com>
10593         Fix #75945.
10594         * attribute.cs (Attribute.GetMarshal): If ArraySubType is not
10595         specified, don't default to UnmanagedType.I4.
10597 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
10599         * expression.cs : conditional operator should check possibly
10600           incorrect assign expression. Fixed bug #75946.
10602 2005-08-31  Atsushi Enomoto  <atsushi@ximian.com>
10604         * cs-tokenizer.cs, cs-parser.jay, driver.cs, support.cs :
10605           Reverting the change. gmcs is much complex than mcs on this matter.
10607 2005-08-31  Atsushi Enomoto  <atsushi@ximian.com>
10609         * cs-tokenizer.cs : To read another token ahead of the actual 
10610           consumption, use new SavedToken and cache token instead of moving
10611           back the stream with SeekableStreamReader (it seemed problematic).
10612         * cs-parser.jay,
10613           driver.cs : Thus use StreamReader directly.
10614         * support.cs : Thus removed SeekableStreamReader.
10616 2005-08-30  Raja R Harinath  <rharinath@novell.com>
10618         Fix #75934.
10619         * anonymous.cs (ScopeInfo.MakeFieldName): New helper.
10620         (ScopeInfo.EmitScopeType): Use it to construct field names from
10621         names of captured locals.
10623         Fix #75929.
10624         * ecore.cs (BoxedCast.BoxedCast) [1-argument variant]: Remove.
10625         * convert.cs (ImplicitReferenceConversion, TryImplicitIntConversion):
10626         Pass 'target_type' to BoxedCast.  Don't default to 'object'.
10627         (ExplicitConversion): Remove enum cases already handled by
10628         implicit conversion.  Move implicit conversion check to the beginning.
10629         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Update.
10630         * expression.cs (ArrayCreation.EmitDynamicInitializers):
10631         Don't treat System.Enum as a struct.
10633 2005-08-30  Jb Evain  <jbevain@gmail.com>
10635         * attribute.cs: handles as expression in parameters.
10637 2005-08-30  Raja R Harinath  <rharinath@novell.com>
10639         Fix #75802.
10640         * class.cs (TypeContainer.VerifyClsName): Don't use a
10641         PartialContainer when verifying CLS compliance.
10642         (AbstractPropertyEventMethod): Set Parent here, ...
10643         (PropertyMethod): ... not here.
10645 2005-08-30  Atsushi Enomoto  <atsushi@ximian.com>
10647         * attribute.cs : escaped attribute name should not be allowed to be
10648           resolved (e.g. @class as classAttribute). Fixed bug #75930.
10650 2005-08-29  Raja R Harinath  <rharinath@novell.com>
10652         Fix #75927.
10653         * convert.cs (ImplicitStandardConversionExists): Allow zero also
10654         when converting a long constant to unsigned long.
10655         * expression.cs (Invocation.OverloadResolve): Add sanity check to
10656         detect where IsApplicable and VerifyArgumentsCompat disagree.
10658 2005-08-29  Raja R Harinath  <rharinath@novell.com>
10659         and Carlos Alberto Cortez  <carlos@unixmexico.org>
10661         Fix #75848.
10662         * class.cs (TypeContainer.CanElideInitializer): New helper.
10663         (TypeContainer.EmitFieldInitializers): Use it to determine if we
10664         can safely emitting the initializer of a field.
10666 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
10668         * statement.cs : (Continue.Resolve()) Unlike break, continue is not
10669           allowed inside a switch (without loop). Fixed bug #75433.
10671 2005-08-26  Kornél Pál  <kornelpal@hotmail.com>
10673         * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
10674         * mcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
10676 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
10678         * driver.cs : kinda reverting the default encoding changes (not exact 
10679           revert since I noticed that "codepage:reset" might not work fine).
10681 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
10683         * class.cs : (AbstractPropertyEventMethod) SetupName() now takes
10684           Location. Now getter and setter store location correctly.
10685           (errors/cs0111-12.cs now reports the expected location.)
10687 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
10689         * driver.cs : Use default encoding on the environment.
10690           Removed (now that) extra parameter for SeekableStreamReader.
10691         * support.cs : (SeekableStreamReader) third .ctor() argument for
10692           StreamReader is not required (always true). preamble size could
10693           be acquired in simpler and safe way.
10695 2005-08-24  Atsushi Enomoto  <atsushi@ximian.com>
10697         * cs-parser.jay: report CS0642 at warning level 3
10698           and report CS0642 for an if else statement also
10699           fixes bug #74745. Patch by John Luke (and a bit
10700           modified by me).
10701           Removed extra CS0642 warning check for "while",
10702           "for" and "fixed".
10703         * statement.cs: In Block.Resolve(), CS0642 check
10704           is reimplemented to check a sequence of an empty
10705           statement and a block.
10707           Both fix bug #66777.
10709 2005-08-24  Marek Safar  <marek.safar@seznam.cz>
10711         * attribute.cs (GetMethodObsoleteAttribute): Disabled obsolete properties
10712         detection until I fix it.
10713         
10714         * cs-tokenizer.cs: Changed error message.
10715         
10716         * cs-parser.jay: Fixed 2 error locations.
10717         
10718         * ecore.cs (Error_TypeDoesNotContainDefinition): Share error message.
10719         (PropertyExpr.Error_PropertyNotFound): First attempt to detect non C#
10720         properties.
10721         
10722         * enum.cs (GetSignatureForError): Fixed.
10723         
10724         * expression.cs (Invocation.IsSpecialMethodInvocation): Improved special
10725         method detection.
10726         
10727         * class.cs,
10728         * typemanager.cs (RegisterProperty): Removed.
10729         
10730         * statement.cs (CheckInvariantMeaningInBlock): Changed error message.
10732 2005-08-24  Raja R Harinath  <rharinath@novell.com>
10734         Fix #75874.
10735         * expression.cs (ArrayAccess.EmitLoadOpcode): Emit ldelem.i for pointers.
10736         (ArrayAccess.GetStoreOpcode): Return stelem.i for pointers.
10738 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
10740         * expression.cs : tiny fix is required for not warning positive ulong.
10741           See test-441.cs.
10743 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
10745         * expression.cs : add CS0652 check for constant and integral
10746           expression. Fixed bug #53974.
10748 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
10750         * expression.cs : in DoNumericPromotions(), check if there is implicit
10751           conversion overload for string (to check CS0034). Fixed bug #52492.
10753 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
10755         * cs-tokenizer.cs : Check newline in char constant. Fixed bug #75245.
10757 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
10759         * ecore.cs : report location when it is *not* Null.
10761 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
10763         * codegen.cs,
10764           ecore.cs,
10765           flowanalysis.cs,
10766           expression.cs:
10767           Added OmitStructFlowAnalysis to EmitContext to handle CS0165 check
10768           correctly. Fixed bug #75721.
10770 2005-08-23  Raja R Harinath  <rharinath@novell.com>
10772         * support.cs (SeekableStreamReader.Position): Avoid an expensive
10773         loop that performs 'min (pos, char_count)'.
10775         Fix #75862.
10776         * expression.cs (Unary.ResolveOperator): Don't discard implicit
10777         converted value in Operator.OnesComplement.
10779 2005-08-22  Ben Maurer  <bmaurer@ximian.com>
10781         * anonymous.cs: If the anon method is pulled into a helper class,
10782         it needs to be `internal' not `private'. Fixes runtime behavior on
10783         msft. bug #75704
10785 2005-08-20  Martin Baulig  <martin@ximian.com>
10787         * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
10788         scope if we don't already have it.
10790         * expression.cs (Invocation.EmitCall): Use `ec.EmitThis ()' rather
10791         than `ig.Emit (OpCodes.Ldarg_0)' to make it work inside iterators;
10792         fixes #75867.
10794 2005-08-17  Marek Safar  <marek.safar@seznam.cz>
10796         Fix #75803
10797         * decl.cs (DeclSpace.VerifyClsCompliance): Skip when collision object
10798         is a partial class.
10800 2005-08-16  Marek Safar  <marek.safar@seznam.cz>
10802         The big constants rewrite
10803         Fix #75746, #75685 and more
10804         As a side effect saved 1MB for MWF ;-)
10805         
10806         * attribute.cs (GetAttributeArgumentExpression): Use ToType, GetTypedValue.
10807         (GetMarshal, GetMethodImplOptions, GetLayoutKindValue): Values are not
10808         enum based for corlib compilation.
10809         
10810         * cfold.cs (BinaryFold): Convert operand for enum additions. Fixed enum
10811         subtractions.
10812         
10813         * class.cs (FixedField.Define): Use ResolveAsConstant.
10814         
10815         * const.cs (IConstant): Interface constants and enums.
10816         (Const.ResolveValue): New method for constant resolvning.
10817         (ExternalConstant): Constants from imported assemblies.
10818         
10819         * constant.cs (Constant.GetTypedValue): Used to get constant with forced
10820         conversion; like enums.
10821         (Constant.ToType): Converts this constant to different type.
10822         (Constant.Increment): Adds 1.
10823         
10824         * convert.cs (ImplicitConversionRequired): Simplified.
10825         
10826         * cs-parser.jay: Create EnumMember directly.
10827         
10828         * decl.cs (MemberCore.CheckObsoleteness): Checks for ObsoleteAttribute presence.
10829         
10830         * doc.cs (GenerateEnumDocComment): Removed.
10831         
10832         * ecore.cs (Expression.ResolveAsConstant): New constant specific method.
10833         (ConvertIntLiteral): Removed.
10834         (FieldExpr.ResolveMemberAccess): Refactored to remove constant specific if(s).
10835         
10836         * enum.cs (EnumMember): Implement IConstant.
10837         (Enum.IsValidEnumConstant): Removed.
10838         (Enum.GetNextDefaultValue): Removed.
10839         (Enum.FindMembers): Updated.
10840         (Enum.GenerateDocComment): Iterate enum members.
10841         
10842         * expression.cs (Cast.TryReduce): Handle enums correctly.
10843         (New.Constantify): Made public.
10844         (MemberAccess.DoResolve): Removed contant specific if(s).
10845         
10846         * literal.cs (NullLiteral): Implement new abstract methods.
10847         
10848         * statement.cs (GotoCase.Resolve): Use new constant methods.
10849         (SwitchLabel.ResolveAndReduce): Use new constant methods.
10850         
10851         * typemanager.cs (LookupEnum): Removed.
10852         (IsEnumType): Fixed to work with corlib.
10853         (RegisterConstant): Removed.
10854         (LookupConstant): Removed.
10855         (GetConstant): Changed to work with IConstant.
10857 2005-08-04  Atsushi Enomoto  <atsushi@ximian.com>
10859         * location.cs : Fixed overflown (>255) column number.
10861 2005-08-03  Raja R Harinath  <rharinath@novell.com>
10863         First cut of the qualified-alias-member feature.
10864         * cs-tokenizer.cs (Tokenizer.is_punct): Recognize the double-colon
10865         token.
10866         * cs-parser.jay (DOUBLE_COLON): New token.
10867         (namespace_or_type_name): Add rule for recognizing
10868         qualified-alias-members.
10869         (primary_expression): Likewise.
10870         (element_access): Allow QualifiedAliasMember as a possible
10871         type-bearing expression.
10872         (local_variable_type, local_variable_pointer_type): Likewise.
10873         * namespace.cs (NamespaceEntry.LookupAlias): New.  Looks up
10874         aliases in the current and enclosing namespace declarations.
10875         (NamespaceEntry.UsingAlias): Add CS0440 warning.
10876         * decl.cs (MemberName.is_double_colon): New.
10877         (MemberName.MemberName): Add new constructor for alias-member.
10878         (MemberName.GetTypeExpression): Generate QualifiedAliasMember too.
10879         * expression.cs (QualifiedAliasMember): New expression type.
10881 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
10883         * location.cs : it borked when no argument was specified.
10885 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
10887         * location.cs : tiny ToString() format fix.
10889 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
10891         * statement.cs : oops, it was missing.
10893 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
10895         A set of fixes for precise line/column location.
10897         * location.cs :
10898           "token" field now holds a file/line "delta", a line number offset 
10899           from the segment, and a column number. See also:
10900           http://lists.ximian.com/pipermail/mono-devel-list/2004-
10901           December/009508.html
10902           Removed static IsNull. Use instance IsNull property instead.
10903         * cs-tokenizer.cs :
10904           For some tokens it stores Location. For Identifier it stores
10905           LocatedToken which is a pair of string name and location.
10906           Column numbers are adjusted only at getChar().
10907         * report.cs :
10908           Use Location.ToString() for reporting (it now contains column).
10909         * cs-parser.jay :
10910           Largely modified to use LocatedToken instead of
10911           string (IDENTIFIER), and to acquire Location from some tokens.
10912         * namespace.cs, decl.cs, ecore.cs, class.cs, delegate.cs,
10913           iterators.cs, const.cs, anonymous.cs, tree.cs, enum.cs,
10914           codegen.cs :
10915           Now MemberName holds Location. DeclSpace.ctor() receives Location
10916           as a parameter. Removed extra parameters to all derived classes.
10917           Replaced Location.IsNull() with instance property.
10918         * assign.cs, expression.cs :
10919           Added .ctor() overload that omits Location.
10920         * attribute.cs :
10921           Added "nameEscaped" flag that indicates the identifier was escaped
10922           in the source file. This fixes bug #57047.
10924 2005-08-02  Marek Safar  <marek.safar@seznam.cz>
10926         * attribute.cs (AttributeTester.GetImportedIgnoreCaseClsType):
10927         New method, looking for lo-case imported cls type.
10929         * decl.cs (DeclSpace.VerifyClsCompliance): Check CS3005 for types
10930         here.
10932         * driver.cs: Removed VerifyTopLevelNameClsCompliance usage.
10934         * enum (Enum.VerifyClsCompliance): Hardcode non-compliant types.
10936         * typemanager.cs (TypeManager.AllClsTopLevelTypes): Renamed from
10937         all_imported_types.
10938         (TypeManager.LoadAllImportedTypes): Lo-case imported types.
10940         Optimized to save 3.5 MB for SWF compilation.
10942 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
10944         * class.cs (AddToTypeContainer): Use inheritance insted of if(s).
10945         (PartialContainer.Create): Moved logic AddToContainer.
10946         (PartialContainer.MarkForDuplicationCheck): Shares name.
10947         
10948         * decl.cs (DeclSpace.AddToContainer): Check name collisions at one
10949         place.
10950         
10951         * namespace.cs (Namespace.AddDeclSpace): Lazy declspaces
10952         initialization.
10953         (Namespace.GetSignatureForError): New method.
10954         
10955         * tree.cs (Tree.RecordDecl): Moved to AddToContainer.
10956         (RootTypes.AddToTypeContainer): se inheritance insted of if(s).
10958 2005-08-01  Raja R Harinath  <rharinath@novell.com>
10960         Fix #75669.
10961         * ecore.cs (Expression.MemberLookupFailed): Use queried_type for
10962         member lookup rather than qualifier_type, since qualifier_type can
10963         be null.
10965 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
10967         * enum.cs (Enum.VerifyClsName): Fixed to allow not CLSCompliant
10968         enum member.
10970 2005-07-31  Miguel de Icaza  <miguel@novell.com>
10972         * statement.cs: Copy the local exception into the exception
10973         captured local.  Fixes 75674
10975 2005-07-31  Raja R Harinath  <harinath@gmail.com>
10977         Fix #75658.
10978         * expression.cs (Invocation.OverloadResolve): Don't report error
10979         CS1501 if error CS1502 has been reported.
10980         (New.DoResolve): Delegate CS1501 reporting to
10981         Invocation.OverloadResolve.
10983         Fix #75656.
10984         * statement.cs (Block.CheckInvariantMeaningInBlock): Verify
10985         invariant-meaning-in-block property in an enclosing block if
10986         necessary.
10988 2005-07-29  Marek Safar  <marek.safar@seznam.cz>
10990         * statement.cs (SwitchLabel.ResolveAndReduce): Refactored.
10991         (SwitchLabel.Erorr_AlreadyOccurs): Share error message.
10992         (Switch.CheckSwitch): Just save 50kb for SWF.
10994 2005-07-27  Martin Baulig  <martin@ximian.com>
10996         * anonymous.cs (CaptureContext.AddField): Added
10997         `AnonymousContainer am' argument; compute its toplevel scope if
10998         it's not already computed.  Fixes #75649.
11000 2005-07-26  Raja R Harinath  <rharinath@novell.com>
11002         Fix #75628.
11003         * class.cs (Constructor.Emit): Reset block to null if the block
11004         resolve fails.
11006 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
11008         * class.cs (TypeContainer.VerifyMembers): Be compatible in warning 169.
11010 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
11012         * class.cs (MethodData.Define): Check whether accessor implementing
11013         interface is public.
11015         * driver.cs (Driver.parse): Try to be smart and check for `MZ' header.
11017 2005-07-22  Marek Safar  <marek.safar@seznam.cz>
11019         Fix #57245
11020         * namespace.cs (LookupType): Moved same type check to...
11021         
11022         * typemanager.cs (LookupTypeReflection): Don't allow to import more types
11023         with the same name.
11025 2005-07-21  Raja R Harinath  <rharinath@novell.com>
11027         * namespace.cs (NamespaceLookupType): Avoid a string allocation when we
11028         already found a typebuilder.
11029         * class.cs (MethodCore.IsDuplicateImplementation): Compare
11030         MemberNames, not strings.
11032         * const.cs (Error_ExpressionMustBeConst): 
11033         Rename from Error_EpressionMustBeConst.
11034         * const.cs, class.cs, statement.cd: Update.
11036 2005-07-21  Marek Safar  <marek.safar@seznam.cz>
11038         Fix #65573
11040         * const.cs (Const.LookupConstantValue): Report missing contant expression
11041         everytime.
11042         (Error_EpressionMustBeConstant): Only one error method.
11044         * class.cs, statement.c: Updated.
11046 2005-07-20  Raja R Harinath  <rharinath@novell.com>
11048         * statement.cs (Block.Flags): Add back HasVarargs.
11049         (Block.flags): Make protected.
11050         (ToplevelBlock.HasVarargs): Convert to a property that updates flags.
11052         * typemanager.cs (types, typecontainers, user_types): Remove.
11053         (UserTypes, TypeContainers): Likewise.
11054         (HandleDuplicate, AddDelegateType, AddEnumType): Likewise.
11055         (CleanUp, Reset): Update.
11056         (AddUserType): Combine variants.  Now, only updates builder_to_declspace.
11057         (GetNestedType): Use Type.GetNestedType.
11058         (CoreLookupType): Take two arguments, the namespace and the
11059         basename of the type.  Update to use the Namespace.Lookup
11060         mechanism.
11061         (InitEnumUnderlyingTypes, InitCoreTypes): Update.
11062         (RealMemberLookup): Use IsNestedChildOf instead of playing with
11063         string concatenation and substring matches.
11064         * class.cs, enum.cs, delegate.cs: Update to changes.
11066 2005-07-20  Marek Safar  <marek.safar@seznam.cz>
11068         * constant.cs (Constant.Error_ConstantValueCannotBeConverted): Moved from
11069         Expression and made virtual.
11071         * convert.cs (ImplicitReferenceConversionExists): Skip for value types.
11072         (ImplicitStandardConversionExists): Fixed `byte' typo ?
11074         * ecore.cs (Expression.Error_ConstantValueCannotBeConverted): Moved.
11076         * literal.cs (NullLiteral.Error_ConstantValueCannotBeConverted): Customize
11077         error message.
11079         * convert.cs, ecore.cs, enum.cs: Reflect Error_ConstantValueCannotBeConverted
11080         change.
11082 2005-07-18  Marek Safar  <marek.safar@seznam.cz>
11084         Fix #57707
11085         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Check whether
11086         AssemblyCultureAttribute is not used on executable.
11088         * rootcontext.cs,
11089         * typemanager.cs: Add System.Reflection.AssemblyCultureAttribute.
11091 2005-07-16  Raja R Harinath  <rharinath@novell.com>
11093         Fix #60638.
11094         * expression.cs (Binary.Warning_UnintendeReferenceComparison):
11095         New.  Reports CS0252/CS0253.
11096         Mostly taken from preliminary patch by Duncak Mak.
11097         (Binary.DoResolveOperator): Store results of operator lookup.
11098         Use them to detect if we need to warn about unintended reference
11099         comparisons.
11101 2005-07-15  Raja R Harinath  <rharinath@novell.com>
11103         Fix #72969.
11104         * namespace.cs (Namespace.Lookup): Add back location parameter.
11105         (Namespace.LookupType): Add CS0436 report.  Add location parameter.
11106         * delegate.cs, ecore.cs, expression.cs: Update to changes.
11108         * codegen.cs (EmitContext.DeclSpace): Make readonly.
11109         * namespace.cs (Namespace.Lookup): Carve out type lookup into ...
11110         (Namespace.LookupType): ... this.
11111         (NamespaceEntry.GetUsingTable): Allocate only one zero-sized array
11112         of namespaces.
11113         * typemanager.cs (LookupTypeReflection): Remove buggy code that
11114         purported to handle pointers.
11115         (char_ptr_type, void_ptr_type): Use GetPointerType rather than
11116         CoreLookupType.
11118 2005-07-15  Marek Safar  <marek.safar@seznam.cz>
11120         * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
11121         type as namespace.
11123 2005-07-15  Raja R Harinath  <rharinath@novell.com>
11125         * namespace.cs (Namespace.Lookup): Drop location parameter.
11126         (NamespaceEntry.LookupAlias): Remove.  Merge into ...
11127         (NamespaceEntry.Lookup): ... this.
11128         (NamespaceEntry.Error_AmbiguousTypeReference):
11129         Move here from DeclSpace.
11130         (NamespaceEntry.LookupNamespaceOrType): Move support for dotted
11131         names ...
11132         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): ... here.
11133         * decl.cs (DeclSpace.ErrorAmbiguousTypeReference):
11134         Move to NamespaceEntry.
11135         * delegate.cs, expression.cs: Update to changes.
11137 2005-07-14  Marek Safar  <marek.safar@seznam.cz>
11139         * attribute.cs (Attribute.ResolveAttributeType): Renamed from
11140         CheckAttributeType and refactored.
11141         (Attribute.ResolvePossibleAttributeType): Changed to reuse
11142         ResolveAsTypeTerminal error handling.
11143         (ResolveAsTypeTerminal): Introduced because of global attributes extra
11144         handling.
11145         (GetSignatureForError): Print errors in same way.
11147         * class.cs,
11148         * codegen.cs: Reflect attribute GetSignatureForError change.
11150         * ecore.cs,
11151         * expression.cs: Add silent parameter to ResolveAsTypeStep.
11153         * namespace.cs (UsingEntry): Refactored to make fields private.
11155         * assign.cs,
11156         statement.cs: Error_UnexpectedKind has extra parameter.
11158 2005-07-14  Raja R Harinath  <rharinath@novell.com>
11160         * ecore.cs (IAlias): Remove.
11161         * decl.cs (DeclSpace): Don't derive from IAlias.  Remove members
11162         that implement the interface.
11163         * namespace.cs (Namespace): Likewise.
11164         (Namespace.declspaces): Renamed from 'defined_names'.
11165         (Namespace.AddDeclSpace): Renamed from 'DefineName'.  Take a
11166         DeclSpace instead of an IAlias.
11167         * tree.cs (Tree.AddDecl): Update.
11169 2005-07-12  Raja R Harinath  <rharinath@novell.com>
11171         * statement.cs (Block.Flags); Remove HasVarargs.
11172         (Block.HasVarargs): Move to ToplevelBlock.
11173         (Block.ThisVariable, Block.AddThisVariable): Likewise.
11174         (Block.Variables): Make protected.  Initialize variable hashtable
11175         if necessary.
11176         (Block.AddVariable): Update.
11177         (Block.Resolve): Update to changes.
11178         (ToplevelBlock.HasVarargs): New boolean.
11179         (ToplevelBlock.ThisVariable): Move here from Block.
11180         (ToplevelBlock.AddThisVariable): Likewise.
11181         (ToplevelBlock.IsThisAssigned): New.  Forwards call to this_variable.
11182         * expression.cs (This.ResolveBase): Update to changes.
11183         (ArglistAccess.DoResolve): Likewise.
11185 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
11187         Fix #75321
11188         * ecore.cs, class.cs: Use SetAssigned instead of direct access.
11190         * class.cs (TypeContainer.VerifyMembers): Distinguish between
11191         not used and not used & assigned.
11192         (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
11194 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
11196         Fix #75053
11197         * expression.cs (Is.DoResolve): null is never provided type.
11199 2005-07-08  Marek Safar  <marek.safar@seznam.cz>
11201         Fix #52496
11202         * cs-parser.jay: Less strict event error rule to catch more errors.
11204 2005-07-08  Martin Baulig  <martin@ximian.com>
11206         Fix test-iter-10.cs - distinguish whether we `yield' in a property
11207         gettter (allowed) or setter (not allowed).
11209         * class.cs (Accessor): Implement IIteratorContainer.
11210         (Accessor.Yields): New public field.
11211         (PropertyBase.PropertyMethod.Define): Handle iterators on a
11212         per-accessor basis.
11214         * cs-parser.jay
11215         (get_accessor_declaration, set_accessor_declaration): Set the
11216         `yields' flag on the accessor, not the property.
11217         (property_declaration): Do the iterators check on a per-accessor
11218         basis and not for the whole property.
11220 2005-07-08  Martin Baulig  <martin@ximian.com>
11222         * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
11223         handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
11225 2005-07-07  Marek Safar  <marek.safar@seznam.cz>
11227         Fix #74975
11228         * attribute.cs (orig_sec_assembly): Holds original version of assembly.
11229         (ExtractSecurityPermissionSet): Cope with self referencing security
11230         attributes properly.
11232         * driver.cs (SetOutputFile): Made public property OutputFile.
11234 2005-07-07  Raja R Harinath  <rharinath@novell.com>
11236         Fix #75486.
11237         * class.cs (TypeContainer.first_nonstatic_field): Rename from
11238         has_nonstatic_fields.  Make into a FieldBase pointer.
11239         (TypeContainer.AddField): Add CS0282 check.
11240         (TypeContainer.EmitType): Update.
11242 2005-07-06  Miguel de Icaza  <miguel@novell.com>
11244         * cs-tokenizer.cs (consume_identifier): Do not create strings to
11245         compare if they start with __.
11247 2005-07-06  Raja R Harinath  <rharinath@novell.com>
11249         * statement.cs (Switch.SwitchGoverningType): Only look at
11250         UserCasts that don't need implicit standard conversions to one of
11251         the allowed switch types (Fixes test-322.cs).
11252         (LocalInfo.Resolve): Re-enable sanity-test.
11254 2005-07-06  Marek Safar  <marek.safar@seznam.cz>
11256         * cs-tokenizer.cs (consume_identifier): Detect double undescores
11257         
11258         * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
11259         
11260         * expression.cs (Invocation.DoResolve): Report error CS0245 here.
11262 2005-07-06  Raja R Harinath  <rharinath@novell.com>
11264         Fix #75472.
11265         * ecore.cs (SimpleName.GetSignatureForError): Add.
11266         * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
11267         (MemberAccess.GetSignatureForError): Add.
11269 2005-07-05  Marek Safar  <marek.safar@seznam.cz>
11271         The big error and warning messages review.
11272         
11273         * anonymous.cs,
11274         * assign.cs,
11275         * attribute.cs,
11276         * class.cs,
11277         * codegen.cs,
11278         * convert.cs,
11279         * cs-parser.jay,
11280         * cs-tokenizer.cs,
11281         * decl.cs,
11282         * delegate.cs,
11283         * doc.cs,
11284         * driver.cs,
11285         * ecore.cs,
11286         * enum.cs,
11287         * expression.cs,
11288         * flowanalysis.cs,
11289         * iterators.cs,
11290         * literal.cs,
11291         * location.cs,
11292         * modifiers.cs,
11293         * namespace.cs,
11294         * parameter.cs,
11295         * pending.cs,
11296         * report.cs,
11297         * rootcontext.cs,
11298         * statement.cs,
11299         * support.cs,
11300         * tree.cs,
11301         * typemanager.cs: Updated.
11302         
11303         * class.cs: (MethodCore.SetYields): Moved here to share.
11304         (PropertyMethod.Define): Moved iterator setup here.
11305         
11306         * iterators.cs: Add orig_method to have full access to parent
11307         container.
11309 2005-07-05  Raja R Harinath  <rharinath@novell.com>
11311         Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
11312         * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
11313         (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
11314         variable of struct type.
11315         * expression.cs (Unary.ResolveOperator): Update to change.
11316         (Indirection.VerifyFixed): Likewise.
11317         (LocalVariableReference.VerifyFixed): A local variable is always fixed.
11318         (ParameterReference.VerifyFixed): Value parameters are fixed.
11319         (This.VerifyFixed): Treat 'this' as a value parameter.
11320         * statement.cs (LocalInfo.IsFixed): Remove.
11322 2005-07-01  Martin Baulig  <martin@ximian.com>
11324         * iterators.cs (Iterator.CapturedThisReference.Emit): Use
11325         `ec.EmitThis ()' to get the correct scope.
11327 2005-07-01  Martin Baulig  <martin@ximian.com>
11329         * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
11330         instance is a ParameterReference; fixes #75299.
11332 2005-07-01  Martin Baulig  <martin@ximian.com>
11334         Reverted Marek's latest patch (r46725):
11335         - it contains structural changes which are neither mentioned in
11336           the ChangeLog nor explained anywhere; for example the additional
11337           argument of EmitContext's and Iterator's .ctor's and the
11338           TypeContainer.DefineMembers() change.
11339         - structural changes like this should go in in seperate patches
11340           and not be hidden in a huge patch which just seems to affect
11341           warnings and errors.
11342           a big and hard to understand patch.
11343         - it breaks iterators and causes regressions, for instance in
11344           test-iter-03.cs.      
11346 2005-06-30  Raja R Harinath  <rharinath@novell.com>
11348         Fix #75412.
11349         * expression.cs (Indexers.map): Remove.
11350         (Indexers.Append): Filter out inaccessible setters and getters.
11351         (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
11353         Fix #75283.
11354         * ecore.cs (MemberExpr.EmitInstance): New.  Add CS0120 check.
11355         Refactored from ...
11356         (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
11357         (FieldExpr.Emit, PropertyExpr.Emit): Update.
11358         (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
11359         * expression.cs (Invocation.EmitCall): Add CS0120 check.
11361 2005-06-30  Marek Safar  <marek.safar@seznam.cz>
11363         Fix #75322
11364         * class.cs (FieldBase.GetInitializerExpression): One more field
11365         for backup.
11367 2005-06-28  Miguel de Icaza  <miguel@novell.com>
11369         * pending.cs: Do not define a proxy if the base method is virtual,
11370         it will be picked up by the runtime (bug 75270).
11372 2005-06-08  Martin Baulig  <martin@ximian.com>
11374         The big Iterators rewrite :-)
11376         * iterators.cs: Rewrite this to use the anonymous methods framework.
11378         * rootcontext.cs (RootContext.DefineTypes): Define Delegates
11379         before the TypeContainers; see 2test-21.cs.
11381         * class.cs
11382         (TypeContainer.DefineType): Don't create a new EmitContext if we
11383         already have one (this only happens if we're an Iterator).
11384         (TypeContainer.Define): Also call Define() on all our iterators.
11385         (Method.CreateEmitContext): Added support for iterators.
11387         * anonymous.cs
11388         (AnonymousContainer): New abstract base class for `AnonymousMethod'.
11389         (AnonymousContainer.CreateMethodHost): Moved here from
11390         AnonymousMethod and made abstract.
11391         (AnonymousContainer.CreateScopeType): New abstract method.
11392         (AnonymousContainer.IsIterator): New public property.
11393         (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
11394         get the ScopeTypeBuilder rather than manually defining it here. 
11395         (ScopeInfo.EmitScopeInstance): New public method; correctly handle
11396         iterators here.
11398         * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
11399         before RootContext.DefineTypes().
11401         * codegen.cs (EmitContext.RemapToProxy): Removed.
11402         (EmitContext.CurrentAnonymousMethod): Changed type from
11403         AnonymousMethod -> AnonymousContainer.
11404         (EmitContext.ResolveTopBlock): Protect from being called twice.
11405         (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
11406         (EmitContext.EmitThis): Removed the iterators hacks; use the
11407         anonymous methods framework for that.
11409         * statement.cs
11410         (ToplevelBlock.Container): Make this a property, not a field.
11411         (ToplevelBlock.ReParent): New public method; move the
11412         ToplevelBlock into a new container.
11413         (Foreach.TemporaryVariable): Simplify.
11415 2005-06-05  Martin Baulig  <martin@ximian.com>
11417         * statement.cs (LocalInfo.CompilerGenerated): New flag.
11418         (Block.AddTemporaryVariable): New public method; creates a new
11419         `LocalInfo' for a temporary variable.
11420         (Block.EmitMeta): Create the LocalBuilders for all the temporary
11421         variables here.
11422         (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
11423         non-iterator variables.
11425 2005-06-05  Martin Baulig  <martin@ximian.com>
11427         * statement.cs (Foreach.TemporaryVariable): Create the
11428         LocalBuilder in the Emit phase and not in Resolve since in some
11429         situations, we don't have an ILGenerator during Resolve; see
11430         2test-19.cs for an example.
11432 2005-06-04  Martin Baulig  <martin@ximian.com>
11434         **** Merged r45395 from GCS ****
11436         The big Foreach rewrite - Part II.
11438         * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
11439         with `PropertyInfo ienumerator_getcurrent'.
11441         * codegen.cs (VariableStorage): Removed.
11443         * statement.cs
11444         (Foreach): Derive from Statement, not ExceptionStatement.
11445         (Foreach.CollectionForeach): New nested class.  Moved all the code
11446         dealing with collection foreach here.
11447         (Foreach.ForeachHelperMethods): Removed.
11448         (Foreach.TemporaryVariable): Implement IMemoryLocation.
11450 2005-05-23  Martin Baulig  <martin@ximian.com>
11452         * statement.cs (Try.DoResolve): Don't create a `finally' if we
11453         don't need to.  Fix #75014.
11455 2005-05-20  Martin Baulig  <martin@ximian.com>
11457         Merged r44808 from GMCS.
11459         * class.cs (TypeContainer.CircularDepException): Removed.
11460         (TypeContainer.DefineType): Removed the `InTransit' stuff.
11461         (TypeContainer.CheckRecursiveDefinition): Check for circular class
11462         (CS0146) and interface (CS0529) dependencies here.
11464 2005-06-21  Raja R Harinath  <rharinath@novell.com>
11466         * expression.cs (Invocation.EmitCall): Fix initialization
11467         'this_call' to reflect current behaviour.  Fix indentation.
11469         * convert.cs (FindMostEncompassedType): Add two trivial special
11470         cases (number_of_types == 0 || number_of_types == 1).
11471         (FindMostEncompasingType): Likewise.
11473 2005-06-17  Raja R Harinath  <rharinath@novell.com>
11475         Some cleanups preparing for the fix of #75283.
11476         * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
11477         error testing.
11478         (EventExpr.InstanceResolve): Likewise.
11479         (EventExpr.DoResolve): Remove redundant checks.
11481 2005-06-10  Duncan Mak  <duncan@novell.com>
11483         * cs-tokenizer.cs (process_directives): New flag for controlling
11484         the processing of preprocessor directives.
11485         (x_token): After seeing a '#', return Token.NONE instead of going
11486         to handle_preprocessing_directive() when not processing
11487         directives. This avoids unnecessary processing during the token peek in
11488         is_punct().
11490         This fixes #74939.
11492         * cs-tokenizer.cs (handle_preprocessing_directive, xtoken): Use
11493         the existing error reporting methods instead of Report.Error.
11495         * convert.cs (priv_fmt_expr): Remove. It's not needed anymore
11496         after Raja's rewrite.
11498 2005-06-08  Miguel de Icaza  <miguel@novell.com>
11500         * class.cs: Small fix.
11502 2005-06-08  Raja R Harinath  <rharinath@novell.com>
11504         Fix #75160.
11505         * class.cs (GetPartialBases): Fix return value check of
11506         part.GetClassBases.
11508 2005-06-07  Raja R Harinath  <rharinath@novell.com>
11510         Ensure that partial classes are registered in their enclosing
11511         namespace.  Initial part of fix of #75160.
11512         * tree.cs (Tree.RecordDecl): Add new namespace argument.
11513         Register declspace with namespace here, not in
11514         DeclSpace.RecordDecl.
11515         * cs-parser.jay: Pass namespace to RecordDecl.
11516         * class.cs (PartialContainer.Create): Likewise.
11517         (ClassPart.DefineType): New sanity-check.  Throws an exception if
11518         called.
11519         * decl.cs (Declspace.RecordDecl): Remove.
11520         * namespace.cs (NamespaceEntry.DefineName): Remove.
11522 2005-06-06  Marek Safar  <marek.safar@seznam.cz>
11524         * rootcontext.cs: Reset TargetExt as well.
11526 2005-06-03  Raja R Harinath  <rharinath@novell.com>
11528         * ecore.cs (Expression.Resolve): Emit CS0654 error when
11529         -langversion:ISO-1.
11531 2005-06-02  Raja R Harinath  <rharinath@novell.com>
11533         Fix #75080, cs0119.cs.
11534         * ecore.cs (Expression.ExprClassToResolveFlags): New.  Broken out
11535         of ...
11536         (Expression.Resolve): ... this.  Use it.  Remove bogus code
11537         allowing ExprClass.Type and ExprClass.Namespace for
11538         ResolveFlags.VariableOrValue.
11539         (Expression.Resolve) [1-argument variant]: Change default resolve
11540         flags based on language version.
11541         (Expression.Error_UnexpectedKind): Use a simple string array
11542         rather than an ArrayList.
11543         * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
11544         not ExprClass.Type.
11545         (TypeOfVoid.DoResolve): Likewise.
11546         (MemberAccess.DoResolve) [3-argument variant]: Make private.  Drop
11547         flags argument -- it always has the same value.
11549 2005-05-31  Raja R Harinath  <rharinath@novell.com>
11551         Fix #75081.
11552         * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
11553         Use it in the error message.
11554         * assign.cs, expression.cs, statement.cs: Update.
11556 2005-05-30  Raja R Harinath  <rharinath@novell.com>
11558         Fix #75088.
11559         * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
11560         the "almostMatchedMember" case too.
11561         * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
11562         that failed the accessibility checks to 'almost_match'.
11564 2005-05-27  Vladimir Vukicevic  <vladimir@pobox.com>
11566         * attribute.cs: Use internal MethodBuilder methods to set
11567         ExactSpelling and SetLastError on PInvoke methods, instead
11568         of passing them via charset.  Fixes #75060.
11570 2005-05-27  Raja R Harinath  <rharinath@novell.com>
11572         * parameter.cs (Parameter): Remove TODO comment.
11573         (Parameter.DefineParameter): Remove Location parameter.
11574         (Parameters.LabelParameters): Likewise.
11575         * class.cs (Constructor.Emit): Update to change.
11576         (MethodData.Emit): Likewise.
11577         * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.  
11578         * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
11580 2005-05-27  Atsushi Enomoto  <atsushi@ximian.com>
11582         * parameter.cs,
11583           Removed Parameters.Location and added Parameter.Location instead.
11584           Removed Location parameter from Emit() and GetSignature().
11585         * anonymous.cs,
11586           class.cs,
11587           cs-parser.jay,
11588           delegate.cs,
11589           iterators.cs,
11590           statement.cs :
11591           Modified all related calls.
11593 2005-05-26  Raja R Harinath  <rharinath@novell.com>
11595         Improve user-defined conversion handling.
11596         * convert.cs (GetConversionOperators): Rewrite.  Return only the
11597         applicable operators.
11598         (AddConversionOperators): New.  Helper for GetConversionOperators.
11599         (FindMostEncompassedType, FindMostEncompassingType): Verify that
11600         there is only one most encompassed/encompassing type.
11601         (FindMostSpecificSource, FindMostSpecificTarget): Remove
11602         "applicable operator" handling.
11603         (UserConversion): Move cache here from GetConversionOperators.
11604         Directly cache the chosen operator, rather than the whole
11605         MethodGroup.
11606         (ExplicitNumericConversion): Fix buggy implementation of Decimal
11607         case.  Allow conversion of decimal to sbyte and byte too.
11608         * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
11609         New static methods.  Used to avoid allocating EmptyExpressions in
11610         convert.cs.
11612 2005-05-24  Duncan Mak  <duncan@novell.com>
11614         * ecore.cs (CastFromDecimal): New class for casting a decimal to
11615         another class, used in Convert.ExplicitNumericConversion.
11616         (CastToDecimal): New class, similar to above, but casts to
11617         System.Decimal, used in Convert.ImplicitNumericConversion and also
11618         in explicit convesion from double/float to decimal.
11620         * convert.cs (ImplicitNumericConversion): Handle implicit
11621         conversions to System.Decimal.
11622         (ExplicitNumericConversion): handle explicit conversions to
11623         System.Decimal.
11625         This fixes #68711.
11626         
11627 2005-05-20  Miguel de Icaza  <miguel@novell.com>
11629         * typemanager.cs (EnumToUnderlying): Do not throw if we do not
11630         know the type at this stage, just break through.   Fixes #75008 
11632 2005-05-19  Martin Baulig  <martin@ximian.com>
11634         * delegate.cs
11635         (ImplicitDelegateCreation.Check): Added `bool check_only' argument
11636         to disable error reporting.
11638         * convert.cs (Convert.ImplicitStandardConversionExists): Use it
11639         here since we don't want to report an error; see the new test-336.cs.
11641 2005-05-19  Raja R Harinath  <rharinath@novell.com>
11643         * statement.cs (ToplevelBlock.GetParameterReference)
11644         (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
11645         Move here from class Block.
11646         * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
11647         * expression.cs (ParameterReference.DoResolveBase): Likewise.
11649 2005-05-18  Martin Baulig  <martin@ximian.com>
11651         Fix #74978.
11653         * flowanalysis.cs
11654         (FlowBranching.Reachability): Add non-static public And() and Or()
11655         methods.
11656         (FlowBranchingSwitch): New class; do the `break_origins' thing
11657         like in FlowBranchingLoop.
11658         (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
11659         reachability, not just locals and parameters.
11660         (FlowBranching.MergeChild): Remove some of the hacks for loop and
11661         switch; MergeBreakOrigins() now takes care of that.
11663 2005-05-18  Martin Baulig  <martin@ximian.com>
11665         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
11666         a loop and may leave it, reset the barrier; fixes #74974.
11668 2005-05-17  Marek Safar  <marek.safar@seznam.cz>
11669         
11670         * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
11671         is back.
11672         
11673         * cs-parser.jay: Catch more lexical errors.
11674         
11675         * report.cs: Add one more Error method.
11676         
11677         * rootcontext.cs,
11678         * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
11680 2005-05-17  Martin Baulig  <martin@ximian.com>
11682         * expression.cs (Argument.Resolve): Turn on flow analysis; fix
11683         #70970. 
11685 2005-05-16  Raja R Harinath  <rharinath@novell.com>
11687         Fix test-382.cs.  Emit values of decimal constants.
11688         * class.cs (TypeContainer.RegisterFieldForInitialization): New.
11689         Carved out of ...
11690         (TypeContainer.AddField): ... this.
11691         (TypeContainer.EmitFieldInitializers): Allow the list of fields
11692         with initializers to include 'Const's.
11693         (ClassPart.RegisterFieldForInitialization): Forward to
11694         PartialContainer.
11695         * const.cs (Const.Const): Pass initializer to base class.
11696         (Const.Define): In case of decimal constants, register them for
11697         initialization in a static constructor.
11699 2005-05-14  Martin Baulig  <martin@ximian.com>
11701         * statement.cs (Block.Resolve): Correctly handle unreachable code;
11702         do not call ResolveUnreachable() on unreachable statements in
11703         here, see the comment in the source code.
11705 2005-05-13  Raja R Harinath  <rharinath@novell.com>
11707         Fix #74934.
11708         * expression.cs (BinaryResolveOperator): If one of the operands of
11709         an equality comparison is 'null' and the other is a pointer type,
11710         convert the null to a NullPointer.
11711         * convert.cs (ImplicitReferenceConversion): If the expression is a
11712         NullLiteral and the target type is a pointer type, return a
11713         NullPointer instead.
11714         (ImplicitConversionStandard): Likewise.
11716 2005-05-13  Marek Safar  <marek.safar@seznam.cz>
11717         
11718         * cs-parser.jay: Set readonly context based on special constructs.
11719         
11720         * expression.cs (LocalVariableReference.DoResolveBase): Improved
11721         readonly variable error handling.
11722         
11723         * rootcontext.cs (EmitCode): Don't verify members when error
11724         occurred.
11725         
11726         * statement.cs (LocalInfo): Add reaodnly context information.
11727         (SetReadOnlyContext, GetReadOnlyContext): New methods.
11729 2005-05-13  Raja R Harinath  <rharinath@novell.com>
11731         * statement.cs (Block.Resolve): Revert change below.  Modify fix
11732         for #74041 to initialize 'resolved' to false only for explicit
11733         blocks.  Fixes #74873.
11735 2005-05-12  Raja R Harinath  <harinath@gmail.com>
11737         Fix #74920.
11738         * typemanager.cs (unmanaged_enclosing_types): New.
11739         (IsUnmanagedType): Avoid infloops by using
11740         'unmanaged_enclosing_types' to talk with recursive invocations.
11742 2005-05-13  Martin Baulig  <martin@ximian.com>
11744         * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
11745         instance variable, not a local.  Fix #74873.
11746         (Block.ResolveUnreachable): Set it to true here.
11748 2005-05-11  Duncan Mak  <duncan@novell.com>
11750         * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
11751         continuing to process for 'arg'.
11752         (handle_preprocessing_directive): Check the argument of the #endif
11753         directive and report error CS1025 if there are any trailing
11754         characters.
11756         According to the C# spec, having even whitespace after the #endif
11757         directive is illegal; however, because we call arg.TrimEnd ()
11758         beforehand, we have the same behavior as csc, allowing whitespace
11759         after the directive.
11761         Fixes #74892.
11763 2005-05-11  Marek Safar  <marek.safar@seznam.cz>
11765         Fix #74863.
11766         
11767         * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
11768         (Constructor.GetObsoleteAttribute): Implemented correctly.
11770 2005-05-10  Martin Baulig  <martin@ximian.com>
11772         * support.cs (ReflectionParameters.ParameterModifier): Use
11773         `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
11774         and `ParameterAttributes.In'.  Fixes #74884.
11776 2005-05-10  Marek Safar  <marek.safar@seznam.cz>
11778         * class.cs (Method.Define): Catch attempt for Finalizer declaration.
11779         
11780         * expression.cs (Argument.GetParameterModifier): Turned to property.
11781         (Invocation.Error_InvalidArguments): Add more descriptive errors.
11782         
11783         * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
11784         its C# equivalent.
11785         
11786 2005-05-09  Raja R Harinath  <rharinath@novell.com>
11788         Fix #74852.
11789         * decl.cs (MemberCache.AddMethods): Register override methods,
11790         rather than non-override methods.
11791         * typemanager.cs (RegisterOverride): New.
11792         (IsOverride): Update.
11794 2005-05-09  Marek Safar  <marek.safar@seznam.cz>
11796         Fix #73105.
11797         
11798         * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
11799         recursive declaration.
11800         
11801         * statement.cs (Block.ResolveMeta): Report any error in resolving.
11802         
11803 2005-05-06  Marek Safar  <marek.safar@seznam.cz>
11805         * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
11806         
11807         * expression.cs (Binary.DoResolve): (x && 0) is always 0.
11809 2005-05-05  Raja R Harinath  <rharinath@novell.com>
11811         Fix #74797.
11812         * decl.cs (DeclSpace.FamilyAccessible): 
11813         Use TypeManager.IsNestedFamilyAccessible.
11815         Fix reopened #64812.
11816         * typemanager.cs (Closure.Filter): Introduce checks for 'protected
11817         internal'.
11819 2005-05-04  Raja R Harinath  <rharinath@novell.com>
11820             Abin Thomas  <projectmonokochi@rediffmail.com>
11821             Anoob V E  <projectmonokochi@rediffmail.com>
11822             Harilal P R  <projectmonokochi@rediffmail.com>
11824         Fix #64812.
11825         * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
11826         allow access to all static members.
11828 2005-05-04  Martin Baulig  <martin@ximian.com>
11830         * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
11832 2005-05-04  Martin Baulig  <martin@ximian.com>
11834         Fix #74655.
11836         * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
11837         section at the end; make things work if `default' is not the last
11838         section.        
11840 2005-05-04  Martin Baulig  <martin@ximian.com>
11842         Fix #70400.
11844         * statement.cs (Switch): Replaced the `got_default' field with a
11845         `default_section' one.
11846         (Switch.CheckSwitch): Set `default_section' here.
11847         (Switch.Resolve): If we're a constant switch and the constant is
11848         not found, use the default section.
11850 2005-05-03  Martin Baulig  <martin@ximian.com>
11852         * expression.cs (ArrayAccess.EmitGetLength): New public method.
11854         * statement.cs (Foreach.ArrayForeach): New nested class.
11855         (Foreach.TemporaryVariable): New nested class.
11856         (Foreach.EmitArrayForeach): Removed; this is now in the new
11857         ArrayForeach class.
11859 2005-05-03  Raja R Harinath  <rharinath@novell.com>
11861         * pending.cs (BaseImplements): Move the #74773 fix here.  This is
11862         more conservative.
11863         (VerifyPendingMethods): Revert change below.
11865         * typemanager.cs (IsOverride, RegisterNonOverride): New.
11866         * decl.cs (MemberCache.AddMethod): Register "non-override" methods
11867         that used to trigger warning -28.  Remove warning -28.
11868         * expression.cs (Invocation.OverloadResolve): Use
11869         TypeManager.IsOverride to distinguish override methods.
11871         Fix #74773.
11872         * pending.cs (VerifyPendingMethods): If a base type implements the
11873         requested interface, don't bother checking individual methods of
11874         the base type.  As a side-effect, this prevents the creation of
11875         unnecessary proxies.
11877 2005-05-02  Martin Baulig  <martin@ximian.com>
11879         Fix #70182.
11881         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
11882         Also `And' the locals if the old vector is null.
11883         (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
11884         null; in this case we basically reset all the variables.        
11886 2005-05-02  Martin Baulig  <martin@ximian.com>
11888         Fix #74529.
11890         * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
11891         Added `FlowBranching branching' argument; always `and' the
11892         variables instead of `or'ing them unless we're an infinite loop.
11894         * statement.cs (While.Resolve): Create a new sibling unless we're
11895         infinite.       
11897 2005-05-02  Martin Baulig  <martin@ximian.com>
11899         Fix #70140.
11901         * class.cs (ConstructorInitializer.Resolve): Added `Block block'
11902         arguments; use it instead of creating a new TopLevelBlock.
11903         (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
11904         our ConstructorInitializer.
11906         * statement.cs
11907         (TopLevelBlock.TopLevelBranching): New public property.
11908         (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
11909         and create our `TopLevelBranching'.
11911         * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
11912         anonymous method host, use `block.TopLevelBranching' rather than
11913         creating a new branching.
11915 2005-04-20  Miguel de Icaza  <miguel@novell.com>
11917         * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
11918         a ScopeInfo, if any of the current children is a child of the new
11919         entry, move those children there.
11921 2005-04-30  Martin Baulig  <martin@ximian.com>
11923         * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
11924         at the beginning of a SwitchSection.  Fix #73335.
11926 2005-04-27  Marek Safar  <marek.safar@seznam.cz>
11928         Fix #74378
11929         * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
11930         
11931         * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
11932         (FieldExpr.DoResolve): Obsolete members are ignored for field
11933         initializers.
11934         
11935 2005-04-26  Marek Safar  <marek.safar@seznam.cz>
11937         * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
11938         of arrays detection.
11940         * class.cs (Interface.VerifyClsCompliance): Add base interfaces
11941         verification.
11942         (Field.VerifyClsCompliance): Volatile fields are not compliant.
11944         * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
11945         arrays report.
11947 2005-04-25  Ben Maurer  <bmaurer@ximian.com>
11949         * cs-parser.jay: Use the prefered version of -unsafe in error
11950         message.
11952 2005-04-22  Marek Safar  <marek.safar@seznam.cz>
11954         * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
11955         circumstances.
11957 2005-04-20  John Luke  <john.luke@gmail.com>
11959         * driver.cs: fix typo in error message, --outout to --output
11961 2005-04-20  Marek Safar  <marek.safar@seznam.cz>
11963         * codegen.cs (InRefOutArgumentResolving): New field.
11964         
11965         * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
11966         fields outside contructor.
11967         
11968         * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
11969         
11970 2005-04-19  Miguel de Icaza  <miguel@novell.com>
11972         * anonymous.cs (CaptureContext.EmitParameterInstance): The
11973         parameter code was not completed ever, so it was not as up-to-date
11974         as local variables.  Must finish it.
11976         The bug fix was to compare the Toplevel of the block, not the
11977         current block.  Thanks for Ben for pointing this out. 
11979 2005-04-19  Raja R Harinath  <rharinath@novell.com>
11981         * decl.cs (AddMethods): Use the declaring type of the problem
11982         method to determine if we want to squash a warning.
11984 2005-04-19  Marek Safar  <marek.safar@seznam.cz>
11986         * attribute.cs: Removed debug output.
11988         * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
11989         
11990         * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
11991         Report.Stderr.
11992         
11993 2005-04-18  Raja R Harinath  <rharinath@novell.com>
11995         Fix #74481.
11996         * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
11997         (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
11998         all null comparisons against reference types.
12000 2005-04-18  Marek Safar  <marek.safar@seznam.cz>
12002         Fix# 74565
12003         * class.cs (TypeContainer.CircularDepException) New nested
12004         exception class.
12005         (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
12006         (TypeContainer.DefineType): Removed error, reset InTransit before
12007         exit.
12008         (Class.DefineType): Throw exception when is in Transit.
12009         Catch exception and report error.
12010         (Struct.DefineType): Throw exception when is in Transit.
12011         Catch exception and report error.
12012         (Interface.DefineType): Throw exception when is in Transit.
12013         Catch exception and report error.
12015         * codegen.cs: Add InCatch,InFinally to EmitContext to easily
12016         handle nested exception handlers.
12018         * flowanalysis.cs (InTryWithCatch): New method, search for try with
12019         a catch.
12021         * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
12022         InFinally and InCatch storage.
12024         * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
12025         (Catch.Resolve): Set and Restore ec.InCatch.
12026         (Try.Resolve): Set and Restore ec.InFinally.
12027         (Try.HasCatch): True when try has catch.
12029 2005-04-17  Atsushi Enomoto  <atsushi@ximian.com>
12031         * doc.cs : In some cases FilterName returns MonoEvent and MonoField
12032           for the same event member, so exclude such cases from warning 419.
12033           Fixed bug #74633.
12035 2005-04-16  Miguel de Icaza  <miguel@novell.com>
12037         * expression.cs (Binary.ResolveOperator): Apply patch from John
12038         Luke to fix bug 59864: operators &, | and ^ on enumerations
12039         require that the same enum type on both sides.
12041         * driver.cs: Add warnings to old flag usage, this is to assist
12042         people who produce Makefiles and hope that the Makefiles will be
12043         used on Windows.
12045         * class.cs (TypeContainer.EmitType): Moved the definition of the
12046         special $PRIVATE$ field from the resolve phase to the Emit phase.
12047         During resolve we do not know if we are a struct with
12048         HasExplicitLayout, we know this only after the attributes for the
12049         type are emitted.
12051         Set the FieldOffset to zero on the dummy field that we create for
12052         the class.   Fixes 74590.
12054 2005-04-16  Raja R Harinath  <rharinath@novell.com>
12056         Fix #73834.
12057         * ecore.cs (PropertyExpr.resolved): New.
12058         (DoResolve): Use it to handle a case of double resolution here.
12059         Handle a case of identical-name-and-type-name.
12060         * expression.cs (ArrayCreation.CheckIndices): Avoid double
12061         resolution by storing the results of expression resolution back
12062         into the "probes" array.
12064 2005-04-15  Raja R Harinath  <rharinath@novell.com>
12066         Fix cs0208-7.cs and cs0208-8.cs.
12067         * typemanager.cs (IsUnmanagedType): Arrays are not allowed
12068         (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0).  Improve
12069         error reporting to point out the reason a struct is not unmanaged.
12071 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
12073         * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and 
12074           just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
12076 2005-04-13  Raja R Harinath  <rharinath@novell.com>
12078         Fix #74528.
12079         * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
12080         IdenticalNameAndTypeName here.
12081         (EventExpr.InstanceResolve): Likewise.
12083 2005-04-13  Marek Safar  <marek.safar@seznam.cz>
12085         C# 2.0 DefaultCharSetAttribute implementation
12086         
12087         * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
12088         which allows us to set GlobalNamespace for every resolve.
12089         (Attribute.ResolveArguments): Cut from Resolve.
12090         (Attribute.GetCharSetValue): Returns CharSet named argument.
12091         (Attribute.DefinePInvokeMethod): Gets default charset from
12092         module settings.
12093         (GlobalAttribute.ResolveAsTypeStep): Override.
12094         (GlobalAttribute.ResolveArguments): Override.
12095         
12096         * class.cs (TypeAttr): Is protected.
12097         
12098         * codegen.cs (ModuleClass.DefaultCharSet): New member.
12099         (ModuleClass.DefaultCharSetType): New memeber.
12100         (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
12101         
12102         * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
12103         charset from module.
12104         
12105         * delegate.cs (TypeAttr): Override.
12106         (Delegate.DefineType): Use this TypeAttr.
12107         
12108         * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
12109         at very early stage (before types are defined) to resolve model
12110         module attributes. It will probably not work with corlib but it
12111         should be ok.
12112         
12113         * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
12114         charset from module.
12115         
12116         * typemanager.cs (default_charset_type): New type.
12118 2005-04-13  Raja R Harinath  <rharinath@novell.com>
12120         * decl.cs (MemberCache.AddMethods): Don't warn if
12121         System.Object.Finalize has buggy MethodAttributes.
12123         * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
12124         removed below.
12126 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
12128         * doc.cs : detect ambiguous reference to overloaded members.
12129           Fixed bug #71603. MS 1.1 csc does not detect it.
12131 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
12133         * doc.cs : delegates must not be referenced with parameters.
12134           Fixed bug #71605.
12136 2005-04-12  Miguel de Icaza  <miguel@novell.com>
12138         * typemanager.cs (IsUnmanagedType): Arrays are allowed.
12140 2005-04-10  Miguel de Icaza  <miguel@novell.com>
12142         * driver.cs (MainDriver): Stop processing if the CLS stage found
12143         errors. 
12145         (CompilerCallableEntryPoint.InvokeCompiler): Always
12146         reset after execution;   Take a TextWriter argument for the
12147         output.
12149         * report.cs: Use the error stream instead of hardcoding stderr. 
12151 2005-04-09  Miguel de Icaza  <miguel@novell.com>
12153         * class.cs: Reduce code paths to test, too small of an
12154         optimization to make it worth the extra testing.  Always perform
12155         it. 
12157 2005-04-08  Raja R Harinath  <rharinath@novell.com>
12159         Fix #74510.
12160         * class.cs (OperatorArrayList.CheckPairedOperators): Skip
12161         operators that had errors reported on them.
12163 2005-04-08  Marek Safar  <marek.safar@seznam.cz>
12165         * attribute.cs (Attribute.IsValidArgumentType): Test valid named
12166         argument types.
12167         (Attribute.Resolve): Add named argument type checking.
12168         
12169         * class.cs (FixedField.Define): Use IsPrimitiveType
12170         
12171         * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
12172         
12173         * iterators.cs (Iterator.DefineIterator): Add check for arglist and
12174         unsafe parameter types.
12175         
12176         * statement.cs (Using.ResolveExpression): Add better error description.
12177         
12178         * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
12179         
12180 2005-04-08  Raja R Harinath  <rharinath@novell.com>
12182         Fix #74484.
12183         * attribute.cs (Attribute.GetAttributeUsage): Resolve
12184         AttributeUsageAttribute in the emitcontext of the attribute class,
12185         not in the emitcontext of the attributable entity it was attached to.
12186         * cs-parser.jay: Use 'current_class', not 'current_container',
12187         when creating a GlobalAttribute.
12189 2005-04-08  Alp Toker  <alp@atoker.com>
12191         * pending.cs: The fix to #58413 failed to compile methods implementing
12192         interfaces with/without params modifiers and vice versa, even though
12193         params modifiers aren't part of the signature. Make the modifier check
12194         less strict as in csc.
12196 2005-04-07  Abin Thomas  <projectmonokochi@rediffmail.com>
12197             Anoob V E  <projectmonokochi@rediffmail.com>
12198             Harilal P R  <projectmonokochi@rediffmail.com>
12200         Fix #58413.
12201         * pending.cs (TypeAndMethods.mods): New.  Store the parameter
12202         modifiers of pending methods.
12203         (PendingImplementation.PendingImplementation): Initialize it.
12204         Add Parameter.Modifier [][] mods and initialize it with ParameterData.
12205         (PendingImplementation.InterFaceMethod): Repalce Type[] argument
12206         with ParameterData.  Add check for modifiers.
12207         * class.cs (MethodData.Define): Update to changes.
12209 2005-04-07  Raja R Harinath  <rharinath@novell.com>
12211         * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
12213 2005-04-07  Marek Safar  <marek.safar@seznam.cz>
12215         * class.cs (PropertyMethod.Define): Check private accessor in abstract
12216         property.
12217         
12218         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
12219         
12220         * rootcontext.cs,
12221         * typemanager.cs: Registered RequiredAttributeAttribute.
12222         
12223 2005-04-06  Marek Safar  <marek.safar@seznam.cz>
12225         * class.cs (VerifyMembers): Doesn't need EmitContext argument.
12226         Warning CS0169 is back at level 3.
12227         (IMethodData.SetMemberIsUsed): New method.
12228         
12229         * decl.cs (IsUsed): New value; moved from FieldBase.Status
12230         (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
12231         
12232         * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
12234         * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
12235         contants.
12236         (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
12237         is used.
12238         
12239         * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
12240         is used.
12241         
12242         * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
12243         to avoid the problems with nested types.
12245 2005-04-05  Abin Thomas  <projectmonokochi@rediffmail.com>
12246             Anoob V.E  <projectmonokochi@rediffmail.com>
12247             Harilal P.R  <projectmonokochi@rediffmail.com>
12248             Raja R Harinath  <rharinath@novell.com>
12250         Fix #73820.
12251         * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
12252         attribute.
12253         * typemanager (GetConstructor): Make public.
12255 2005-04-05  John Luke  <john.luke@gmail.com>
12256             Raja R Harinath  <rharinath@novell.com>
12258         Fix #62232.
12259         * typemanager.cs (IsUnmanagedType): Check non-public fields of a
12260         struct too.  Return false quicker in a few cases.
12261         (VerifyUnManaged): Use it.
12263 2005-04-05  Raja R Harinath  <rharinath@novell.com>
12265         Fix #74041.
12266         * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
12267         not 'unreachable_seen'.
12269 2005-04-04  Marek Safar  <marek.safar@seznam.cz>
12271         * attribute.cs (Attribute.GetValue): Removed unused.
12272         
12273         * codegen.cs (CodeGen.TrimExt): Removed unused.
12274         
12275         * cs-parser.jay (output): Removed unused.
12276         
12277         * cs-tokenizer.cs (hex_digits): Removed unused.
12278         
12279         * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
12280         
12281         * expression.cs (Indirection.LoadExprValue): Removed unused.
12282         (ArrayCreation.ExpressionToArrayArgument): Removed unused.
12283         
12284         * iterators.cs (Iterator.param_types): Removed unused.
12285         
12286         * statement.cs (Goto.block): Removed unused.
12287         (ToplevelBlock.did): Removed unused.
12288         (Switch.ResolveConstantSwitch): Removed unused.
12290 2005-04-01  Ben Maurer  <bmaurer@ximian.com>
12292         * rootcontext.cs: Allow mcs to bootstrap with the compilation
12293         resetting thingy.
12295 2005-04-01  Raja R Harinath  <rharinath@novell.com>
12297         Fix #74232 and cs0208-3.cs.
12298         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
12299         * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
12300         unmanaged type.  Don't use FieldBuilders when 't' is a
12301         TypeBuilder.  Use ModFlags and MemberType fields.
12302         * class.cs (MemberBase.member_type): Rename from MemberType.
12303         (MemberBase.MemberType): New property.  Determines member_type on
12304         demand.
12305         (MemberBase.DoDefine): Don't initialize MemberType here.
12306         (FieldMember.Define): Likewise.
12308 2005-04-01  Marek Safar  <marek.safar@seznam.cz>
12310         Fix #74241
12311         * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
12312         Attributes are emitted there.
12313         
12314 2005-04-01  Raja R Harinath  <rharinath@novell.com>
12316         * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
12317         keyword in 'partial enum' too.
12318         * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
12319         is not allowed).
12320         Report from Kamil Skalski <nazgul@omega.pl>.
12322         Fix #74309.
12323         * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
12324         have partial containers too.
12326         * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
12327         in block' checks to Block.CheckInvariantMeaningInBlock.
12328         * statement.cs (Block.GetKnownVariableInfo): Make private.
12329         (Block.IsVariableUsedInChildBlock): Remove.
12330         (Block.IsVariableUsedInBlock): Likewise.
12331         (Block.CheckInvariantMeaningInBlock): New.  Show location of
12332         conflicting declaration.
12333         (Block.AddVariable): Make error messages less long-winded and more
12334         specific.  Show location of conflicting declaration.
12335         * parameter.cs (Parameters.Location): New readonly property.
12337 2005-03-31  Raja R Harinath  <rharinath@novell.com>
12339         Clean up semantics of invoking ResolveMemberAccess.
12340         * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
12341         can have an instance, ensure that we pass in a non-TypeExpression
12342         to ResolveMemberAccess.  Tighten up IdenticalNameAndTypeName checks.
12343         (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
12344         argument.  Update to changes and simplify.
12345         (FieldExpr.Emitinstance): Remove CS0120 check.
12346         (PropertyExpr.EmitInstance): Likewise.
12347         * expression.cs (Argument.Resolve): Likewise.
12348         (Invocation.DoResolve): Update to changes in semantics of
12349         InstanceExpression.
12351 2005-03-31  Marek Safar  <marek.safar@seznam.cz>
12353         Fix #74241
12354         * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
12355         customization.
12356         
12357         * decl.cs (MemberCache.AddMethods): Fix infinite loop.
12359 2005-03-31  Raja R Harinath  <rharinath@novell.com>
12361         Fix difference in behaviour with commandline invocation.
12362         * driver.cs (Driver.Reset): New.
12363         (CompilerCallableEntryPoint): Call it.
12365         * statement.cs (If.Resolve): Avoid spurious "uninitialized
12366         variable" warnings if the boolean expression failed to resolve.
12368 2005-03-30  Sebastien Pouliot  <sebastien@ximian.com>
12370         * attribute.cs: Fix the union of several permissions when some of them
12371         are unrestricted (so the result isn't an unrestricted permission set).
12372         Fix #74036.
12374 2005-03-30  Raja R Harinath  <rharinath@novell.com>
12376         * ecore.cs (MemberExpr): New class.  Convert from interface
12377         IMemberExpr.
12378         (MemberExpr.ResolveMemberAccess): Refactor and move here from
12379         MemberAccess.ResolveMemberAccess.  Tighten up pre-conditions and
12380         error checks.
12381         (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
12382         (MethodGroupExpr.IsExplicitImpl): Remove.
12383         (Expression.GetFieldFromEvent): Remove.
12384         (SimpleName.MemberStaticCheck): Remove.
12385         (SimpleName.DoSimpleNameResolve): Update to changes.
12386         * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
12387         (MemberAccess.IdenticalNameAndTypeName): Remove.
12388         (MemberAccess.error176): Move to MemberExpr.
12389         (MemberAccess.DoResolve): Update to changes.
12390         (BaseAccess.DoResolve): Likewise.
12392 2005-03-30  Marek Safar  <marek.safar@seznam.cz>
12394         C# 2.0 Conditional attribute class implementation
12395         
12396         * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
12397         Analyzes class whether it has attribute which has ConditionalAttribute
12398         and its condition is not defined.
12399         
12400         * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
12401         (Class.IsExcluded): New method. Search for at least one defined
12402         condition in ConditionalAttribute of attribute class.
12404 2005-03-30  Raja R Harinath  <rharinath@novell.com>
12406         * ecore.cs (PropertyExpr): Derive from Expression, not
12407         ExpressionStatement.
12408         (PropertyExpr.EmitStatement): Remove.
12410 2005-03-29  Raja R Harinath  <rharinath@novell.com>
12412         Fix #74060.
12413         * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
12414         internal field "value__" of an enum be private.  The examples for
12415         "value__" that I found on MSDN all used FieldAttributes.Private.
12417         * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
12418         Don't mention IL method attribute names.
12420         Fix #47991.  Remove a TODO.
12421         * statement.cs (Block.Toplevel): Make into a field.
12422         (Block.Parameters): Move into ToplevelBlock.
12423         (Block.known_variables): Rename from child_variable_names.
12424         (Block.Block): Remove variants that take Parameters.  Initialize
12425         'Toplevel' with the immediately surrounding toplevel block.
12426         (Block.AddKnownVariable): Rename from AddChildVariableName.  Add a
12427         LocalInfo parameter.
12428         (Block.GetKnownVariableInfo): New.
12429         (Block.IsVariableNameUsedInChildBlock): Update.
12430         (Block.IsVariableNameUsedInBlock): New.  Checks if a name is used in
12431         the block, even though it may not be in scope.
12432         (Block.AddVariable): Remove Parameters parameter.  Use
12433         Toplevel.Parameters instead.
12434         (Block.AddConstant): Remove Parameters parameter.
12435         (Block.GetParameterReference): Update to use Toplevel.Parameters.
12436         (Block.IsParamaterReference): Likewise.
12437         (Block.IsLocalParameter): Likewise.  Simplify a lot.
12438         (ToplevelBlock.Parameters): New.  Moved from Block.
12439         (ToplevelBlock.ToplevelBlock): Update to changes.  Always
12440         initialize Parameters to a non-null value.
12441         * cs-parser.jay: Update to changes.
12442         * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
12443         simple names that mean different things in the same block.  Use
12444         Block.IsVariableNameUsedInBlock.
12446 2005-03-28  Raja R Harinath  <rharinath@novell.com>
12448         * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
12449         (TypeHandle.TypeHandle): Use LookupMemberCache rather than
12450         GetTypeHandle.  It is possible for a reflected type to derive from
12451         a TypeBuilder (e.g., int[] derives from the TypeBuilder
12452         System.Array during mscorlib compilation).
12453         * decl.cs (MemberCache.MemberCache): If the base cache doesn't
12454         contain a method_hash, don't create one either.  Don't create a
12455         deep copy of the base cache's method_hash.
12456         (MemberCache.SetupCache): Rename back from DeepCopy.
12457         (MemberCache.AddMethods): Rewrite, now that method_hash isn't
12458         already initialized.  If we see an override function, add its
12459         underlying base virtual function to the member_hash too.
12461         * enum.cs (Enum.LookupEnumValue): Remove debugging code.
12463 2005-03-26  Raja R Harinath  <harinath@acm.org>
12465         Fix #73038.
12466         * assign.cs (Assign.DoResolve): When the RHS of an assignment
12467         fails to resolve, ensure that the LHS is still resolved as an
12468         lvalue.
12470 2005-03-25  Raja R Harinath  <harinath@acm.org>
12472         * enum.cs (Enum.DefineType): Set ec.InEnumContext and
12473         ec.ContainerType.
12474         (Enum.current_ec): Remove.
12475         (Enum.LookupEnumValue): Remove EmitContext argument.
12476         Just uses the one created during DefineType.
12477         (Enum.FindMembers): Update.
12478         * expression.cs (MemberAccess.DoResolve): Update.
12480 2005-03-22  Marek Safar  <marek.safar@seznam.cz>
12482         * assign.cs (Assign.DoResolve): Check for CS1717 when
12483         source and target are same (uses Equals).
12485         * expression.cs (LocalVariableReference, ParameterReference,
12486         This): Implemented Equals, GetHashCode.
12488         * statement.cs (Block.GetParameterReference): Removed useless
12489         local variable.
12491 2005-03-22  Raja R Harinath  <rharinath@novell.com>
12493         Fix cs0128.cs
12494         * statement.cs (Block.AddVariable): Ensure that we skip implicit
12495         blocks before deciding whether the error is cs0136 or cs0128.
12497         * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
12498         (using_alias_directive, using_namespace_directive): Pass
12499         MemberName, not an expression to Namespace.UsingAlias and
12500         Namespace.Using.
12501         (MakeName): Use the MemberName of the namespace.
12502         * namespace.cs (Namespace.MemberName): New.
12503         (UsingEntry.UsingEntry): Take a MemberName, not an expression.
12504         (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
12505         Likewise.
12506         * decl.cs (MemberName.Name): Make readonly.
12507         (MemberName.FromDotted): New "constructor".
12508         (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
12509         (MemberCore.Name): Compute from MemberName on demand.
12510         (MemberCore.SetMemberName): Provide a way to change the
12511         MemberName.
12512         (MemberCore.AddToContainer): Don't take a fullname parameter.
12513         * class.cs (TypeContainer.AddToMemberContainer): Don't add the
12514         fully qualified name of the container to the member name.
12515         (TypeContainer.AddToTypeContainer): Use a fully qualified name
12516         only if the type is a member of the root container.
12517         (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
12518         MemberName.Left rather than searching for an embedded ".".
12519         (PartialContainer.CreatePart): Update to changes in RootContext.
12520         (MemberBase.ShortName): Turn into a property.  Use
12521         MemberCore.SetMemberName.
12522         (MemberBase.ExplicitInterfaceName): Remove.
12523         (MemberBase.UpdateMemberName): Remove.
12524         (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
12525         (PropertyBase.SetMemberName): New override.
12526         * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
12527         (Tree.GetDecl): New.
12528         (Tree.AllDecls): Rename from Decls.
12529         * attribute.cs, enum.cs, report.cs: Update to changes.
12530         * driver.cs (MainDriver): Use MemberName.FromDotted on
12531         RootContext.MainClass.
12533 2005-03-21  Marek Safar  <marek.safar@seznam.cz>
12535         * class.cs (FixedField.Define): Check for CS1664 and more sanity
12536         checks.
12538         * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
12540 2005-03-18  Marek Safar  <marek.safar@seznam.cz>
12542         * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
12543         property accessor modifiers.
12545         * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
12546         fixed buffer attribute (CS1716).
12547         (PropertyMethod.HasCustomAccessModifier): When property accessor
12548         has custom modifier.
12550         * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
12551         modifiers.
12552         (PropertyExpr.DoResolveLValue): Add CS0272.
12554 2005-03-17  Miguel de Icaza  <miguel@novell.com>
12556         * convert.cs: When converting to a pointer, use the proper Conv.U
12557         or Conv.I depending on the source data type.
12559         * cs-tokenizer.cs: Make the size for large decimal constants,
12560         fixes #72957.
12562 2005-03-17  Martin Baulig  <martin@ximian.com>
12564         * anonymous.cs (AnonymousMethod.method_modifiers): Change default
12565         from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'.  Fixes #73260.
12567 2005-03-17  Martin Baulig  <martin@ximian.com>
12569         * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
12570         to bool so we can return an error condition.
12571         (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
12572         returned an error.
12574 2005-03-16  Zoltan Varga  <vargaz@freemail.hu>
12576         * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
12577         attributes.
12579 2005-03-16  Raja R Harinath  <rharinath@novell.com>
12581         Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
12582         Refactor to avoid traversing the list of assemblies, and to avoid
12583         string concatenation.
12584         * typemanager.cs (guid_attr_type): Remove.
12585         (negative_hits, pointers, references): Remove hashes.
12586         (type_hash): New.
12587         (GetConstructedType): New.  Uses type_hash to handle constructed
12588         types (arrays, references, pointers).
12589         (GetReferenceType, GetPointerType): Use it.
12590         (GetNestedType): New.  Uses type_hash to handle nested types of
12591         reflected types.
12592         (LookupType, LookupTypeDirect): Remove.
12593         (CoreLookupType): Inline parts of old LookupTypeDirect code.  Use
12594         'types' hash and LookupTypeReflection directly.
12595         (params_string, params_object): Use GetConstructedType.
12596         * namespace.cs (Namespace.cached_types): New.  Cache of reflected
12597         top-level types.
12598         (Namespace.Lookup): Use cached_types.
12599         (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
12600         provided by old TypeManager.LookupType.
12601         * rootcontext.cs (MakeFQN): Remove.
12602         * decl.cs (DeclSpace.MakeFQN): Likewise.
12603         (DeclSpace.LookupType): Use TypeManager.GetNestedType.
12604         * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
12605         TypeManager.GetConstructedType.
12606         * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
12608 2005-03-15  Marek Safar  <marek.safar@seznam.cz>
12610         * class.cs (MethodCore.CheckBase): Report CS1715 for properties and
12611         indexers.
12613         * cs-parser.jay: Reports CS1527 for any namespace element.
12615         * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
12616         Added CS0407.
12618         * expression.cs (ParameterReference.IsAssigned): Changed error to
12619         CS0269.
12620         (Error_WrongNumArguments): Moved CS0245 detection here.
12622         * statement.cs (Return.Resolve): Add CS1622 report.
12624 2005-03-11  Marek Safar  <marek.safar@seznam.cz>
12626         * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
12628 2005-03-11  Zoltan Varga  <vargaz@freemail.hu>
12630         * attribute.cs expression.cs: Get rid of some allocations.
12632 2004-03-11  Atsushi Enomoto  <atsushi@ximian.com>
12634         * doc.cs : just eliminate the latest change.
12636 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
12638         * doc.cs : commented out the latest change. It breaks xml-030.cs
12640 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
12642         * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
12643           fail. So invoke CreateType() in FindDocumentedType().
12645 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
12647         * cs-tokenizer.cs : added IsKeyword().
12648         * doc.cs : Detect keyword incorrectly used as identifier.
12649           Allow identifiers prefixed by @.
12651 2005-03-10  Marek Safar  <marek.safar@seznam.cz>
12653         * attributes.cs (Attributes.Emit): Continue after CheckTargets.
12654         It caused exception in namespace resolving (again!).
12655         
12656         * class.cs (Class.ctor): Removed exit.
12657         (PropertyMethod.ctor): ditto.
12658         
12659         * codegen.cs (Codegen.Reset): Reset static data.
12660         (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
12661         
12662         * cs-tokenizer.cs (Cleanup): Removed.
12663         
12664         * driver.cs (GetSystemDir): Rewrote to one line command.
12665         It caused problem with unloaded dynamic modules.
12666         (UnixParseOption): Removed Exit.
12667         (CompilerCallableEntryPoint.InvokeCompiler): Make static.
12668         (CompilerCallableEntryPoint.Reset): Reset suitable static data.
12669         Now can be mcs used as library.
12670         
12671         * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
12672         empty location.
12673         
12674         * location.cs (Reset): Reset static data.
12675         
12676         * namespace.cs (Reset): Reset static data.
12677         
12678         * report.cs (Report.Reset): Reset static data.
12679         
12680         * rootcontext.cs (RootContext.Reset): Reset static data.
12681         
12682         * tree.cs (RootTypes.ctor): Use Location.Null
12683         
12684         * typemanager.cs (TypeManager.Reset): Reset static data.
12685         (CoreLookupType): Removed Exit.
12686         (TypeHandle.Reset): Reset static data.
12687         
12688 2005-03-10  Raja R Harinath  <rharinath@novell.com>
12690         Fix #73516.
12691         * typemanager.cs (ComputeNamespaces): Import namespaces from
12692         referenced modules too.
12694 2005-03-09  Raja R Harinath  <rharinath@novell.com>
12696         * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
12697         than '.'.
12699 2005-03-09  Raja R Harinath  <rharinath@novell.com>
12701         * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
12702         enclosing DeclSpace.  This ensures that a name-lookup populates
12703         more caches and there are fewer 'TypeExpression's.  Carve out
12704         nested type lookup into ...
12705         (LookupNestedTypeInHierarchy): ... this.
12707 2005-03-09  Raja R Harinath  <rharinath@novell.com>
12709         Clean up a few partial-class semantics.  
12710         Fixes test-357.cs and cs1618-2.cs.
12711         * cs-parser.jay (struct_declaration): Use 'current_class' as
12712         parent of newly-created struct.  Remove call to Register ().
12713         Use 'pop_current_class' to complete handing the current struct.
12714         (interface_declaration): Likewise.
12715         (class_declaration): Likewise.
12716         (enum_declaration): Use 'current_class' as parent of newly created
12717         enum.
12718         (delegate_declaration): Likewise.
12719         (pop_current_class): New function.  This is used to handle closing
12720         up the 'current_class' and 'current_container', and pointing them
12721         to the enclosing class/container.
12722         (CSharpParser): Initialize 'current_class' too.
12723         * decl.cs (MemberCore): Add check for invariant: a partial
12724         container is not a parsed entity, and thus does not enclose any
12725         parsed members.
12726         (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
12727         (DeclSpace.BaseTypeExpr): Use it.
12728         (DeclSpace.LookupType): Add check for invariant.
12729         * class.cs (TypeContainer): Add check for invariant: a nested
12730         class should have the same NamespaceEntry as its enclosing class.
12731         (TypeContainer.EmitFieldInitializers): Make virtual.
12732         (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
12733         MemberCore.
12734         (TypeContainer.Register): Remove.
12735         (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
12736         null.  Use TypeResolveEmitContext for resolving base types and
12737         interfaces.  Move initialization of Parts.TypeBuilder here from
12738         ...
12739         (TypeContainer.DefineNestedTypes): ... here.
12740         (PartialContainer): Take a Namespace not a NamespaceEntry.
12741         (PartialContainer.Create): Don't use Register.  Call the
12742         appropriate Add... function directly.
12743         (ClassPart): Take both the PartialContainer and the enclosing
12744         class as constructor arguments.
12745         (ClassPart.EmitFieldInitializers): Override.
12746         (ClassPart.PartFindNestedTypes): Remove.
12747         (FieldBase.GetInitializerExpression): Resolve the initializer
12748         expression in the emit context of the enclosing class.
12749         * tree.cs (RootTypes): Remove Register ().
12750         
12751 2005-03-08  Marek Safar  <marek.safar@seznam.cz>
12753         * cs-parser.jay: Removed CS0134.
12754         
12755         * driver.cs: Removed CS1901.
12756         
12757         * expression.cs (SizeOf.DoResolve): Don't report CS0233
12758         for predefined types.
12760 2005-03-07  Duncan Mak  <duncan@novell.com>
12762         * codegen.cs (Save):  Catch UnauthorizedAccessException as
12763         well. Fixes bug #73454.
12765 2005-03-07  Marek Safar  <marek.safar@seznam.cz>
12767         * cs-tokenizer.cs (xtoken): Add CS1035.
12768         
12769         * class.cs (MethodData.Define): Add CS0683.
12770         (FieldMember.ctor): Add CS0681.
12772 2005-03-07  Raja R Harinath  <rharinath@novell.com>
12774         * ecore.cs (SimpleName.DoResolve): Rename from
12775         SimpleName.DoResolveAllowStatic.
12776         (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
12777         Pass 'intermediate' flag to MemberStaticCheck.
12778         (SimpleName.MemberStaticCheck): Skip "static check" only in case
12779         of "intermediate" lookups via MemberAccess.
12780         (SimpleName.IdenticalNameAndTypeName): New.  Carved out of ...
12781         * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
12783 2005-03-07  Raja R Harinath  <rharinath@novell.com>
12785         Fix #73394.
12786         * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
12787         slipped in because of variable names that are identical to a
12788         builtin type's BCL equivalent ('string String;', 'int Int32;').
12789         (PropertyExpr.EmitInstance): Likewise.
12791 2005-03-04  Marek Safar  <marek.safar@seznam.cz>
12793         * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
12794         
12795         * report.cs (warning_ignore_table): Made public.
12797 2005-03-04  Raja R Harinath  <rharinath@novell.com>
12799         Fix #73282.
12800         * class.cs (MethodData.Emit): Pass 'container' to
12801         container.GetObsoleteAttribute instead of 'container.Parent'.
12803 2005-03-03  Marek Safar  <marek.safar@seznam.cz>
12805         * cs-parser.jay: Add 1534 error test.
12807         * iterators.cs (Yield.CheckContext): Add error 1629.
12808         (Iterator.ctor): Save unsafe modifier.
12809         (MoveNextMethod.DoEmit): Restore unsafe context.
12811         * namespace.cs (UsingAlias): Better error message.
12813 2005-03-03  Dan Winship  <danw@novell.com>
12815         * convert.cs (Error_CannotImplicitConversion): fix two bugs in
12816         the warning message [#73219]
12818 2005-03-03  Raja R Harinath  <rharinath@novell.com>
12820         Fix compile with MCS 1.0.0.0.
12821         * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
12822         w_restore to not depend on string constant folding.
12824 2005-03-03  Raja R Harinath  <rharinath@novell.com>
12826         * decl.cs (DeclSpace.LookupType): Remove 'silent' argument.  Move
12827         CS0246 check to users who passed 'silent = false'.
12828         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
12829         check.
12830         (SimpleName.SimpleNameResolve): Update.
12831         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
12832         (MemberAccess.IdenticalNameAndTypeName): Update.
12833         * doc.cs (FindDocumentedTypeNonArray): Update.
12835 2005-03-03  Raja R Harinath  <rharinath@novell.com>     
12837         * codegen.cs (EmitContext): Remove ResolvingTypeTree.
12838         * parameters.cs (ComputeAndDefineParameters): Remove.
12839         * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
12840         * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
12841         Use GetParameterInfo.
12843 2005-03-02  Marek Safar  <marek.safar@seznam.cz>
12845         * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
12847 2005-03-02  Raja R Harinath  <rharinath@novell.com>
12849         Unify DeclSpace.LookupType and DeclSpace.FindType.
12850         * decl.cs (DeclSpace.FindNestedType): New virtual function.  This
12851         is in charge of defining nested types on demand.
12852         (DeclSpace.LookupType): Use it when the current_type is a
12853         TypeBuilder.  Use LookupTypeDirect for reflected types.
12854         (DeclSpace.FindType): Remove.
12855         (DeclSpace.LookupInterfaceOrClass): Likewise.
12856         (DeclSpace.DefineTypeAndParents): Likewise.
12857         * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
12858         DeclSpace.LookupType.
12859         * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
12860         * typemanager.cs (LookupType): Simplify.
12861         (AddUserType): Remove type from negative_hits.
12862         * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
12863         * class.cs (TypeContainer.FindMembers): Move handling of nested
12864         types ...
12865         (TypeContainer.FindMembers_NestedTypes): ... here.
12866         (TypeContainer.FindNestedType): Implement override.
12867         (ClassPart.FindNestedType): Delegate to PartialContainer.
12868         (ClassPart.PartFindNestedType): Looks up the nested types of the
12869         part alone.
12871 2005-03-02  Martin Baulig  <martin@ximian.com>
12873         * class.cs (TypeContainer.DoDefineMembers): We also need a default
12874         static constructor in static classes.
12876 2005-03-01  Zoltan Varga  <vargaz@freemail.hu>
12878         * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
12879         sizeParamIndex is not specified.
12881 2005-03-01  Marek Safar  <marek.safar@seznam.cz>
12883         Fix #73117
12884         * report.cs (WarningMessage.IsEnabled): Missing null check.
12886 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
12888         * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
12889         in the fields and not in the properties.
12891 2005-02-28  Zoltan Varga  <vargaz@freemail.hu>
12893         * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex 
12894         fields as well.
12896 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
12898         * attribute.cs: Small refactoring (improved robustness).
12899         (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
12900         (ValidateGuid): Removed.
12901         (Resolve): Removed referenced to above mentioned.
12902         (GetAttributeUsage): Made private and changed to work without
12903         class assistance.
12904         (GetIndexerAttributeValue): Don't crash.
12905         (GetConditionalAttributeValue): Ditto.
12906         (GetClsCompliantAttributeValue): Ditto.
12907         (ExtractSecurityPermissionSet): All attributes exceptions are
12908         error 648.
12909         (GetPropertyValue): New helper.
12910         (GetMethodImplOptions): New method.
12911         (DefinePInvokeMethod): Reuse common code. Implemented handling of
12912         some missing properties.
12913         
12914         * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
12915         (Method.ApplyAttributeBuilder): Updated.
12916         
12917         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
12918         exception.
12920 2005-02-28  Raja R Harinath  <rharinath@novell.com>
12922         Fix #73052.
12923         * report.cs (Report.SymbolRelatedToPreviousError): Handle
12924         non-simple types (array, pointer, reference).
12926 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
12928         * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
12930         * class.cs (MethodCore.IsDuplicateImplementation): Special error
12931         for operators.
12932         (Method.CheckBase): Catch wrong destructor here.
12933         (MethodData.Define): Add errors 550, 668.
12935         * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
12937         * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
12939         * pending.cs (VerifyPendingMethods): Add error 551.
12941         * typemanager.cs (CSharpName): Next error report helper.
12943 2005-02-25  Marek Safar  <marek.safar@seznam.cz>
12945         * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
12946         attributes. Removed useless attribute double check.
12947         It saves almost 2MBs for corlib.
12949 2005-02-25  Raja R Harinath  <rharinath@novell.com>
12951         Fix #72924.
12952         * statement.cs (ExpressionStatement.Resolve): Make robust to being
12953         called twice in case of error.
12955 2005-02-23  Chris Toshok  <toshok@ximian.com>
12957         Fix compiler portions of #72827.
12958         * statement.cs (Block.Emit): call Begin/EndScope on the
12959         EmitContext instead of the ILGenerator.
12961         * codegen.cs (EmitContext.BeginScope): new method, call
12962         ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
12963         we have one.)
12964         (EmitContext.BeginScope): same, but EndScope and CloseScope
12966         * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
12967         offset and call the superclass's OpenScope(int) with it.
12968         (SymbolWriter.CloseScope): get the current il
12969         offset and call superclass's CloseScope(int) with it.
12971 2005-02-23  Marek Safar  <marek.safar@seznam.cz>
12973         * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
12974         CS1677 for out and ref as well.
12976         * class.cs (Method.Define): Add error CS1599 detection.
12977         
12978         * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
12979         
12980         * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
12981         
12982         * delegate.cs (Delegate.Define): Add error CS1599 detection.
12983         
12984         * support.cs.cs (ModifierDesc): New helper method.
12986 2005-02-23  Raja R Harinath  <rharinath@novell.com>
12987             Abin Thomas  <projectmonokochi@rediffmail.com>
12988             Anoob V E  <projectmonokochi@rediffmail.com>
12989             Harilal P R  <projectmonokochi@rediffmail.com>
12991         Fix #57851, #72718.
12992         * class.cs (ConstructorBuilder.Resolve): Make sure that the second
12993         MemberLookup (used for error reporting) actually returns a result.
12994         Fix error report number (122, not 112).
12996 2005-02-22  Abin Thomas  <projectmonokochi@rediffmail.com>
12997             Anoob V E  <projectmonokochi@rediffmail.com>
12998             Harilal P R  <projectmonokochi@rediffmail.com>
13000         Fix #71134.
13001         * pending.cs (PendingImplementation.GetAbstractMethods):
13002         Find NonPublic members too.
13004 2005-02-22  Marek Safar  <marek.safar@seznam.cz>
13006         * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
13007         Fixed error 217.
13008         
13009         * class.cs (MethodCore.CheckMethodAgainstBase):
13010         Add error 239 report.
13012 2005-02-21  Raja R Harinath  <rharinath@novell.com>
13014         Fix #68955.
13015         * expression.cs (Invocation.IsApplicable): Make public.
13016         (Invocation.IsParamsMethodApplicable): Likewise.
13017         * delegate.cs (Delegate.VerifyApplicability): Don't use
13018         Invocation.VerifyArgumentCompat for parameter applicability
13019         testing.  Use Invocation.IsApplicable and
13020         Invocation.IsParamsMethodApplicable.
13022 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
13024         * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
13025         
13026         * class.cs (Operator.Define): Add error 217 report.
13027         
13028 2005-02-21  Raja R Harinath  <rharinath@novell.com>
13030         * namespace.cs (UsingEntry.Resolve): Undo change below.
13032 2005-02-21  Raja R Harinath  <rharinath@novell.com>
13034         Fix #72756.
13035         * ecore.cs (Expression.MemberLookupFailed): Add argument to
13036         disable the error message when the extended MemberLookup also
13037         fails.
13038         (Expression.MemberLookupFinal): Update.
13039         (SimpleName.DoSimpleNameResolve): Update.
13040         * expression.cs (MemberAccess.ResolveNamespaceOrType):
13041         Don't use MemberLookupFinal.
13042         (New.DoResolve): Update.
13043         (BaseAccess.CommonResolve): Update.
13045 2005-02-21  Raja R Harinath  <rharinath@novell.com>
13047         Fix #72732.
13048         * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
13049         occured previously, don't resolve again.
13051 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
13053         Fix #69949
13054         * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
13055         argument. Call ResolveAttributeUsage for unresolved.
13056         when types doesn't match ctor arguments.
13057         
13058         * class.cs (DoDefineMembers.TypeContainer): Removed safety check
13059         for nested attribute classes.
13060         (Class.attribute_usage): Removed.
13061         (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
13062         for attribute class.
13063         
13064         * ecore.cs (IsAttribute): Removed.
13065         
13066         * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
13067         
13068         * rootcontext.cs (RegisterAttribute): Removed, attributes are
13069         now normal types.
13070         (attribute_types): Removed.
13071         (EmitCode): Global attributes are emited as the latest.
13073 2005-02-18  Marek Safar  <marek.safar@seznam.cz>
13075         * class.cs (EmitFieldInitializers): Don't emit field initializer
13076         for default values when optimilization is on.
13077         
13078         * constant.cs (Constant.IsDefaultValue): New property.
13079         
13080         * driver.cs: Add /optimize handling.
13081         
13082         * constant.cs,
13083         * ecore.cs,
13084         * literal.cs: Implement new IsDefaultValue property.
13085         
13086         * rootcontext.cs (Optimize): New field, holds /optimize option.
13088 2005-02-18  Raja R Harinath  <rharinath@novell.com>
13090         Fix crasher in re-opened #72347.
13091         * namespace.cs (Namespace.Lookup): Return null if
13092         DeclSpace.DefineType returns null.
13094         Fix #72678.
13095         * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
13097 2005-02-18  Raja R Harinath  <rharinath@novell.com>
13099         Fix remainder of #63202.  Change semantics of DoResolveLValue: it
13100         now returns null if it cannot resolve to an lvalue.
13101         * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
13102         (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
13103         returned null.  Remove check for SimpleName.
13104         (EventExpr.DoResolveLValue): New.
13105         * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
13106         * expression.cs (Argument.Error_LValueRequired): New.  Move CS1510
13107         error from ...
13108         (Argument.Resolve): ... here.  Use it.  Use DoResolveLValue to
13109         avoid CS0131 error.
13110         (Unary.ResolveOperator): Move CS0211 check ...
13111         (Unary.DoResolve): ... here.  Use DoResolveLValue to avoid
13112         CS0131 error.
13113         (Unary.DoResolveLValue): Simplify.
13114         (AddressOf.DoResolveLValue): New.
13115         (ArrayAccess.DoResolveLValue): New.
13117 2005-02-16  Marek Safar  <marek.safar@seznam.cz>
13119         * attribute.cs (Attribute.Resolve): Add arguments casting for
13120         when types doesn't match ctor arguments.
13122 2005-02-16  Raja R Harinath  <rharinath@novell.com>
13124         Fix parts of #63202.
13125         * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
13126         lookup of operator in base type.  Ensure that all checks happen
13127         when the operator resolves to an "op_..." method.
13129 2005-02-15  Raja R Harinath  <rharinath@novell.com>
13131         Fix #71992.
13132         * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
13133         'ignore_cs0104' parameter.  Pass it to ...
13134         (NamespaceEntry.Lookup): ... this.
13135         * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
13136         * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
13137         (TypeLookupExpression.DoResolveAsTypeStep): Update.
13138         * expression.cs (MemberAccess.IdenticalNameAndTypeName):
13139         Update.  Request that cs0104 errors be ignored.
13140         (ComposedCast.ResolveAsTypeStep): Update.
13142 2005-02-14  Raja R Harinath  <rharinath@novell.com>
13144         Fix #59209.
13145         * expression.cs (Invocation.BetterFunction): Remove support for
13146         comparing virtual functions and their overrides.
13147         (Invocation.IsOverride): New.
13148         (Invocation.OverloadResolve): Don't consider 'override' functions
13149         during candidate selection.  Store them in a lookaside list.
13150         If the selected method is a 'virtual' function, use the list to
13151         find any overrides that are closer to the LHS type.
13153 2005-02-14  Marek Safar  <marek.safar@seznam.cz>
13155         * expression.cs (New.DoResolve): Add complex core type reduction.
13156         (New.Constantify): Converts complex core type syntax like 'new int ()'
13157         to simple constant.
13158         
13159 2005-02-14  Raja R Harinath  <rharinath@novell.com>
13161         * decl.cs (EntryType.EntryType): New constructor to create an
13162         updated copy of a cache entry.
13163         (MemberCache.AddMethods): Use it.
13164         (MemberCache.ClearDeclaredOnly): Remove.
13165         (MemberCache.MemberCache): Update.
13167 2005-02-11  Miguel de Icaza  <miguel@novell.com>
13169         * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
13170         variable.  This one is represents the actual low-level declaration
13171         of the method, as opposed to the semantic level `IsStatic'.   
13173         An anonymous method which is hosted into a static method might be
13174         actually an instance method.  IsStatic would reflect the
13175         container, while MethodIsStatic represents the actual code
13176         generated.
13178         * expression.cs (ParameterReference): Use the new MethodIsStatic
13179         instead of IsStatic.
13181         * anonymous.cs (AnonymousMethod.Compatible): Pass the
13182         Modifiers.STATIC to the Anonymous' Method EmitContext if static is
13183         set on the current EmitContext. 
13185         * expression.cs (Cast): Overload DoResolveLValue so we can pass
13186         resolve our casted expression as an LValue.  This triggers the
13187         proper LValue processing that is later required by Assign.
13189         This fixes 72347.
13191         * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
13193 2005-02-11  Marek Safar  <marek.safar@seznam.cz>
13195         C# 2.0 Fixed buffer implementation
13197         * anonymous.cs: Update after RegisterHelperClass renaming.
13199         * attribute.cs (AttributeTester.fixed_buffer_cache):
13200         Cache of external fixed buffers.
13201         (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
13202         implementation if field is fixed buffer else null.
13204         * class.cs
13205         (TypeContainer.AddField): Accept FieldMember instead of Field.
13206         (FieldBase.IsFieldClsCompliant): Extracted code from
13207         VerifyClsCompliance descendant customization.
13208         (FixedField): New class handles fixed buffer fields.
13209         (FixedFieldExternal): Keeps information about imported fixed
13210         buffer.
13211         (IFixedField): Make access to internal or external fixed buffer
13212         same.
13214         * cs-parser.jay: Add fixed buffer parsing.
13216         * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
13217         buffer.
13219         * expression.cs (Indirection): Extended implementation to accept
13220         fixed buffer field.
13221         (PointerArithmetic.Emit): Get element from fixed buffer as well.
13222         (ElementAccess.MakePointerAccess): Get type as parameter.
13223         (DoResolve): Add fixed buffer field expression conversion.
13224         (DoResolveLValue): Ditto.
13225         (FixedBufferPtr): New class. Moved most of original ArrayPtr.
13226         (ArrayPtr): Derives from FixedBufferPtr.
13227         (ArrayPtr.Emit): Add extra emit for array elements.
13229         * flowanalysis.cs.cs (StructInfo): Use FieldMember.
13231         * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
13232         for compiler generated types.
13233         (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
13235         * statement.cs (Fixed): Refactored to be easier add fixed buffer
13236         and consume less memory.
13237         (Fixed.Resolve): Add fixed buffer case.
13239         * typemanager.cs (compiler_generated_attr_ctor,
13240         fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
13241         (HasElementType): Add our own implementation to work on every
13242         runtime.
13244 2005-02-11  Miguel de Icaza  <miguel@novell.com>
13246         * anonymous.cs (CaptureContext): Track whether `this' has been
13247         referenced.   
13249         * expression.cs (This.ResolveBase): Call CaptureThis.  Before we
13250         only captured `this' if it was implicitly done (instance
13251         methods/variables were used). 
13253         * codegen.cs (EmitContext.CaptureThis): New method to flag that
13254         `this' must be captured.
13256 2005-01-30  Miguel de Icaza  <miguel@novell.com>
13258         * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
13259         is null it means that there has been no need to capture anything,
13260         so we just create a sibling.
13262         Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
13264         Just a partial fix.  The other half is fairly elusive.
13265         
13266 2005-02-10  Raja R Harinath  <rharinath@novell.com>
13268         Fix #52586, cs0121-4.cs.
13269         * decl.cs (MemberCache.DeepCopy): Rename from SetupCache.  Take
13270         and return a hashtable.
13271         (MemberCache.ClearDeclaredOnly): New.
13272         (MemberCache.MemberCache): Update to change.  Make a deep copy of
13273         the method_hash of a base type too.
13274         (MemberCache.AddMethods): Adapt to having a deep copy of the base
13275         type methods.  Overwrite entries with the same MethodHandle so
13276         that the ReflectedType is correct.  The process leaves in base
13277         virtual functions and their overrides as distinct entries.
13278         (CacheEntry): Now a class instead of a struct.  It shouldn't alter
13279         matters since it was boxed in a ArrayList before.
13280         (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
13281         modifier.
13282         * expression.cs (Invocation.BetterFunction): Simplify.  Handle the
13283         case of a virtual function and its override (choose the overload
13284         as better).
13285         (Invocation.OverloadResolve): Avoid 'override' members during
13286         'applicable_type' calculation.
13288 2005-02-09  Raja R Harinath  <rharinath@novell.com>
13290         Combine two near-redundant caches.
13291         * typemanager.cs (method_params): Rename from method_internal_params.
13292         (TypeManager.GetParameterData): New.  Replace
13293         Invocation.GetParameterData.
13294         (TypeManager.LookupParametersByBuilder): Remove.
13295         * expression.cs (Invocation.method_parameter_cache): Remove.
13296         (Invocation.GetParameterData): Remove.
13297         Update to changes.
13298         * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
13299         Update to changes.
13301 2005-02-08  Raja R Harinath  <rharinath@novell.com>
13303         Fix #72015.
13304         * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
13305         TypeManager.multicast_delegate_type is null, resolve it by looking
13306         up "System.MulticastDelegate".
13307         * rootcontext.cs (RootContext.ResolveCore): Simplify.
13309 2005-02-07  Abin Thomas (NOSIP)  <projectmonokochi@rediffmail.com>
13310             Anoob V.E (NOSIP)  <projectmonokochi@rediffmail.com>
13311             Harilal P.R (NOSIP)  <projectmonokochi@rediffmail.com>
13313         Fix cs0164.cs.
13314         * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
13315         (LabeledStatement.AddReference): New.  Set 'referenced'.
13316         (Goto.Resolve): Use it.
13318 2005-02-05  John Luke  <john.luke@gmail.com>
13320         * driver.cs: remove duplicate -doc line in Usage ()
13322 2005-02-04  Raja R Harinath  <rharinath@novell.com>
13324         * location.cs (Location.AddFile): Fix CS2002 error report.
13326 2005-02-02  Martin Baulig  <martin@ximian.com>
13328         * delegate.cs (Delegate.DefineType): Report an internal error if
13329         TypeManager.multicast_delegate_type is null.  See bug #72015 for
13330         details.        
13332 2005-02-02  Raja R Harinath  <rharinath@novell.com>
13334         Fix a crasher in a variant of #31984.
13335         * const.cs (Constant.CheckBase): New override that defers the
13336         new-or-override check in case the base type hasn't been populated
13337         yet.
13338         (Constant.Define): Ensure the new-or-override check is performed.
13340 2005-02-01  Duncan Mak  <duncan@ximian.com>
13342         * const.cs (LookupConstantValue): Check that `ce' is not null
13343         before calling GetValue ().
13345 2005-02-01  Raja R Harinath  <rharinath@novell.com>
13347         Fix test-334.cs (#69519).
13348         * cs-parser.jay (using_alias_directive): Pass in an expression to
13349         NamespaceEntry.UsingAlias.
13350         (using_namespace_directive): Pass in an expression to
13351         NamespaceEntry.Using.
13352         (namespace_name): Don't flatten to a string.
13353         * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
13354         (NamespaceEntry.AliasEntry.Resolve): Lookup using
13355         ResolveAsTypeStep.
13356         (NamespaceEntry.UsingEntry): Likewise.
13357         (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
13358         changes.
13359         (NamespaceEntry.LookupForUsing): Remove.
13360         (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
13361         names.
13362         (NamespaceEntry.Lookup): Remove support for dotted names.
13364 2005-02-01  Raja R Harinath  <rharinath@novell.com>
13366         * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
13367         split into two.
13368         (NamespaceEntry.ImplicitParent): Compute on demand.
13369         (NamespaceEntry.Doppelganger): New implicit namespace-entry that
13370         parallels the current.
13371         (NamespaceEntry.LookupForUsing): Use it.
13372         (NamespaceEntry.Lookup): If the current namespace-entry is
13373         implicit, don't search aliases and using tables.
13375 2005-02-01  Raja R Harinath  <rharinath@novell.com>
13377         Fix #31984.
13378         * class.cs (TypeContainer.DoDefineMembers): Don't initialize
13379         BaseCache here.
13380         (TypeContainer.BaseCache): Compute on demand.
13381         (TypeContainer.FindMembers): Define constants and types if they're
13382         not already created.
13383         (FieldMember.Define): Move resetting of ec.InUnsafe before error
13384         check.
13385         * const.cs (Constant.Define): Make idempotent.
13387 2005-01-29  Miguel de Icaza  <miguel@novell.com>
13389         * pending.cs: Produce better code (no nops produced by using Ldarg
13390         + value).
13391         
13392         * pending.cs (PendingImplementation.DefineProxy): It was not `arg
13393         i - 1' it should be arg + 1.
13395         Fixes bug #71819.
13397 2005-01-28  Raja R Harinath  <rharinath@novell.com>
13399         * attribute.cs (Attribute.CheckAttributeType): Make private
13400         non-virtual.
13401         (Attribute.ResolveType): Make virtual.
13402         (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
13403         handling of RootContext.Tree.Types.
13405 2005-01-27  Raja R Harinath  <rharinath@novell.com>
13407         Update attribute-handling to use the SimpleName/MemberAccess
13408         mechanisms.
13409         * cs-parser.jay (attribute): Pass in an expression to the
13410         constructors of Attribute and GlobalAttribute.
13411         * attribute.cs (Attribute): Take an expression for the name.
13412         (Attribute.ResolvePossibleAttributeTypes): New.  Resolves the
13413         passed in attribute name expression.
13414         (Attribute.CheckAttributeType): Use it.
13415         * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
13416         * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
13417         (MemberAccess.ResolveNamespaceOrType): ... here.  Add 'silent'
13418         argument to prevent error messages if the lookup fails.
13420 2005-01-27  Marek Safar  <marek.safar@seznam.cz>
13422         * expression.cs (Indirection): Implemented IVariable interface
13423         to support indirection in AddressOf operator.
13424         (PointerArithmetic.Emit): Add optimalization for case where
13425         result can be precomputed.
13427 2005-01-26  Martin Baulig  <martin@ximian.com>
13429         * class.cs (TypeContainer.AttributeTargets): Return the correct
13430         AttributeTargets depending on our `Kind' instead of throwing an
13431         exception; fixes #71632.
13433 2005-01-26  Marek Safar  <marek.safar@seznam.cz>
13435         Fix #71257
13436         * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
13437         constant members.
13439 2005-01-25  Raja R Harinath  <rharinath@novell.com>
13441         Fix #71602.
13442         * expression.cs (MemberAccess.DoResolve): Don't complain with
13443         cs0572 when the LHS of a member access has identical name and type
13444         name.
13446 2005-01-25  Marek Safar  <marek.safar@seznam.cz>
13448         Fix #71651, #71675
13449         * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
13450         CreatePermission.
13451         Create custom PermissionSet only for PermissionSetAttribute.
13453 2005-01-24  Marek Safar  <marek.safar@seznam.cz>
13455         Fix #71649
13456         * class.cs (StaticClass.DefineContainerMembers): Enable enums and
13457         delegates in static class.
13459 2005-01-24  Martin Baulig  <martin@ximian.com>
13461         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
13462         merging an implicit block, just use its reachability.
13464         * statement.cs (Block.Resolve): Make the unreachable code check
13465         work wrt. implicit blocks; see test-337 from #63842.
13467 2005-01-21  Alp Toker  <alp@atoker.com>
13469         * cs-parser.jay: destructor_declaration's container is PartialContainer
13470         not Class when partial types are used, so use Kind prop instead of
13471         'is'.
13472         
13473 2005-01-22  Miguel de Icaza  <miguel@ximian.com>
13475         * cs-parser.jay: Improve error reporting when an interface
13476         declares new types.
13478 2005-01-20  Dick Porter  <dick@ximian.com>
13480         * support.cs: SeekableStreamReader fix from Sandor Dobos
13481         (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
13482         chars are read.  Fixes bug 70369.
13484 2005-01-20  Raja R Harinath  <rharinath@novell.com>
13486         * cs-parser.jay (catch_clause): Simplify current_block handling
13487         somewhat.
13489 2005-01-17  Miguel de Icaza  <miguel@ximian.com>
13491         * convert.cs (ImplicitStandardConversionExists): Synchronize the
13492         code with ImplicitStandardConversion to handle the implicit
13493         conversion of method groups into valid delegate invocations. 
13495         The problem is that in parameter handling we were using this code
13496         path.  Fixes bug #64698
13498 2005-01-19  Raja R Harinath  <rharinath@novell.com>
13500         * cs-parser.jay: Fix several infelicities.
13501         - Avoid assigning to the parser value stack.  Code like 
13502           '$3 = null' is unclean.  Synthesize a value for the code block
13503           instead. 
13504         - Avoid using oob_stack for storing location information.  Use ...
13505         (_mark_): ... this.  New (empty) rule.  Saves the current location
13506         in $$.
13507         (foreach_statement): Avoid using oob_stack for current_block
13508         handling.  Use technique used in for_statement and
13509         using_statement.  Synthesize a value for the code block to store
13510         additional intermediate information.
13512 2005-01-13  Miguel de Icaza  <miguel@ximian.com>
13514         * ecore.cs (IsAccessorAccessible): Accessibility to private fields
13515         of a different type is only allowed to private fields of a
13516         containing type, not on fields of a base class.
13518         See test-174.cs and error cs0122-9.cs
13520 2005-01-13  Raja R Harinath  <rharinath@novell.com>
13522         Fix test-335.cs (bug #58126).
13523         * cs-parser.jay (argument): Split out non-expression parts of the
13524         rule into 'non_simple_argument'.
13525         (invocation_expression): Support parenthesized invocations with
13526         multiple arguments, and with single non-simple arguments.
13528 2005-01-13  Raja R Harinath  <rharinath@novell.com>
13530         * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
13531         places.
13533 2005-01-12  Raja R Harinath  <rharinath@novell.com>
13535         Fix cs0038-1.cs, cs1640-6.cs.
13536         * ecore.cs (Expression.Resolve): Remove special-case for
13537         SimpleName in error-handling.
13538         (Expression.almostMatchedMembers): Relax access permission to
13539         protected.
13540         (Expression.MemberLookupFailed): Handle duplicates in
13541         almostMatchedMembers list.
13542         (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
13543         * expression.cs (New.DoResolve): Report CS1540 for more cases.
13544         * typemanager.cs (GetFullNameSignature): Use the MethodBase
13545         overload if the passed in MemberInfo is a MethodBase.
13547 2005-01-12  Marek Safar  <marek.safar@seznam.cz>
13549         Fix #70749
13550         * attribute.cs (ExtractSecurityPermissionSet): Don't report error
13551         for non-CAS & merge permission sets properly.
13553 2005-01-11  Raja R Harinath  <rharinath@novell.com>
13555         Improve standard-compliance of simple name and member access 
13556         resolution.  Fixes bugs #52697, #57200, #67520, #69519.
13557         * ecore.cs (FullNamedExpression): New abstract base class 
13558         for Namespaces and TypeExpressions.
13559         (ResolveFlags.SimpleName): Remove.
13560         (SimpleName): Remove support for dotted names.
13561         (SimpleName.ResolveAsTypeStep): Simplify.  Now just a wrapper to 
13562         DeclSpace.FindType and DeclSpace.LookupType.
13563         (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
13564         (Expression.ExprClassName): Make member function.
13565         * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
13566         a namespace.  Remove creation of dotted "SimpleName"s.
13567         (MemberAccess.DoResolve): Likewise.
13568         * decl.cs (DeclSpace.Cache): Make private.
13569         (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
13570         (DeclSpace.FindType): Update.
13571         (DeclSpace.LookupType): Move here from RootContext.  Return a 
13572         FullNamedExpression.
13573         * namespace.cs (Namespace): Derive from FullNamedExpression
13574         so that it can be part of expression resolution.
13575         (Namespace.Lookup): Return an FullNamedExpression.
13576         (NamespaceEntry.LookupAlias): Lookup aliases only in current
13577         namespace.
13578         * rootcontext.cs (NamespaceLookup): Remove.
13579         (LookupType): Move to DeclSpace.
13580         * attribute.cs (CheckAttributeType): Update.
13581         * doc.cs (FindDocumentedType): Remove allowAlias argument.
13582         (FindDocumentedTypeNonArray): Likewise.
13584 2005-01-11  Raja R Harinath  <rharinath@novell.com>
13586         Fix cs0509.cs, cs1632.cs.
13587         * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
13588         is the same as IsInterface.
13589         (TypeContainer.GetClassBases): Likewise.
13590         * statement.cs (LabeledStatement.ig): New field.
13591         (LabeledStatement.LabelTarget): Save ILGenerator which created the
13592         label.
13593         (LabeledStatement.DoEmit): Check that the label was created with
13594         the same ILGenerator.
13596 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
13598         Fix #71058
13599         * attribute.cs (GetMethodObsoleteAttribute): Need to transform
13600         accessors to its properties.
13602         * ecore.cs (PropertyExpr): Add AccessorTable to help track back
13603         from accessors to property.
13604         
13605 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
13607         Fix #70722
13608         * class.cs (MethodCore.CheckBase): Test base method obsoleteness
13609         only for overrides.
13610         
13611 2005-01-08  Miguel de Icaza  <miguel@ximian.com>
13613         * attribute.cs: Check for null and empty strings.  
13615         I have lost another battle to Paolo.
13617 2005-01-07  Marek Safar  <marek.safar@seznam.cz>
13619         Fix #70942
13620         * class.cs (PropertyMethod): Set Parent field in ctors.
13621         (SetMethod.InternalParameters): Add unsafe switch hack.
13622         Override MarkForDuplicationCheck where it is appropriate.
13624         * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
13625         It says whether container allows members with the same name.
13626         Base default is no.
13627         (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
13628         Removed is_method parameter.
13630 2005-01-06  Duncan Mak  <duncan@ximian.com>
13632         * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
13633         because the previous change led to incorrect reporting of CS1032
13634         ("Cannot define/undefine preprocessor symbols after first token in
13635         file"). Instead of using `tokens_seen' as the only flag that
13636         triggers CS1040, introduce `comments_seen'. This new flag is used
13637         to signify having seen comments on the current line, so it is
13638         unset after a newline.
13640 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
13642         * doc.cs : When searching for a type, find nested type too.
13643           This fixes bug #71040.
13645 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
13647         * doc.cs :
13648           - Warn missing member comment on those classes which also does not
13649             have doc comments. Fixed bug #71041.
13650           - Don't warn missing doc comment on default constructor.
13651             Fixed bug #71042.
13653 2005-01-06  Duncan Mak  <duncan@ximian.com>
13655         * cs-tokenizer.cs (xtoken): After handling traditional C-style
13656         comments, set `tokens_seen' to true. This allows us to detect
13657         misplaced preprocessor directives (i.e. not at the beginning of
13658         the a line, nor after whitespaces). In that case, report error
13659         CS1040. This fixes bug #56460.
13661         * cs-parser.jay (interface_member_declaration): Add checks for
13662         IsExplicitImpl, and report CS0541 error if an interface member is
13663         defined as an explicit interface declaration.
13665 2005-01-06  Marek Safar  <marek.safar@seznam.cz>
13667         Fix #70817
13668         * class.cs (PropertyMethod): Set Parent field in ctors.
13669         (SetMethod.InternalParameters): Add unsafe switch hack.
13670         
13671         * decl.cs (MemberCore.Parent): Cannot be readonly.
13673 2005-01-06  Raja R Harinath  <rharinath@novell.com>
13675         * decl.cs (DeclSpace.ResolveType): Remove.
13676         (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
13677         Merge in code from ...
13678         (DeclSpace.GetTypeResolvingEmitContext): ... here.  Remove.
13679         * class.cs, enum.cs: Update to changes.
13681 2005-01-06  Miguel de Icaza  <miguel@ximian.com>
13683         * anonymous.cs: Ensure that we init the scope of our parent if it
13684         has not been initialized yet.
13686 2004-12-30  Duncan Mak  <duncan@ximian.com>
13688         * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
13689         if field.FieldBuilder is null. Fixes #70758.
13691         * convert.cs: Fixed some typos and updated some of the comments.
13692         (ImplicitStandardConversionExists):
13693         (TryImplicitIntConversion): If `target_type' is an interface and
13694         the type of `ic' implements this interface, return true or a new
13695         BoxedCast instead of null. This fixes #70468.
13697 2004-12-29  Duncan Mak  <duncan@ximian.com>
13699         * expression.cs (Argument.Emit): Check that Expr is
13700         IMemoryLocation before casting to it, and report CS1510 otherwise.
13702         This fixes #70402.
13704 2004-12-21  Ben Maurer  <bmaurer@ximian.com>
13706         * statement.cs (Block.ThisVariable): remove the recursion here, to
13707         make the --profile more sane.
13709 2004-12-17  Carlos Cortez <calberto.cortez@gmail.com>
13711         * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
13712         assembly, by JB Evain.
13714 2004-12-17  Raja R Harinath  <rharinath@novell.com>
13716         * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs, 
13717           rootcontext.cs, typemanager.cs: Make nomenclature consistent.
13718         "parent" refers to enclosing type/class.  "base" refers to superclass.
13720 2004-12-17  Raja R Harinath  <rharinath@novell.com>
13722         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
13723         Ensure that we only have GlobalAttributes.
13724         * attribute.cs (Attribute.Emit): Make non-virtual.
13725         (GlobalAttribute.Emit): Remove.
13726         (Attribute.Resolve): Make virtual.
13727         (GlobalAttribute.Resolve): New.  Set Rootcontext.Tree.Types.NamespaceEntry.
13728         (Attribute.GetConditionalAttributeValue): Take an EmitContext as
13729         the argument. Don't create one.
13730         (Attribute.GetObsoleteAttribute): Likewise.
13731         (Attribute.GetClsCompliantAttributeValue): Likewise.
13732         * class.cs, decl.cs: Update to changes.
13734 2004-12-17  Marek Safar  <marek.safar@seznam.cz>
13736         * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
13737         
13738         * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
13739         
13740         * statement.cs (Foreach.Resolve): Add error 186 report.
13742 2004-12-16  Marek Safar  <marek.safar@seznam.cz>
13744         * expression.cs (Conditional.DoResolve): Add warning 429.
13745         
13746         * statement.cs (If.Resolve): Add warning 665.
13748 2004-12-16  Raja R Harinath  <rharinath@novell.com>
13750         New invariant: RootContext.Tree.Types.NamespaceEntry == null
13751         except when in the parser, and in GlobalAttribute.
13752         * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
13753         * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
13754         RootContext.Tree.Types.NamespaceEntry once work is done.
13755         (GlobalAttribute.Emit): New.  Wrapper for Attribute.Emit, but sets
13756         and resets RootContext.Tree.Types.NamespaceEntry.
13758 2004-12-15  Marek Safar  <marek.safar@seznam.cz>
13760         * cs-parser.jay: Don't create a block for every variable.
13762 2004-12-14  Miguel de Icaza  <miguel@ximian.com>
13764         * location.cs: Provide extra information.
13766         * statement.cs: The instance is not `ldarg_0.THIS' when accessing
13767         variables from the captured environment, it is the ldarg_0.
13769 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
13771         * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
13772         find a conclusion.
13773         
13774         * class.cs: Changed warning level for 169 to avoid developer
13775         displeasure from warning flooding. It will be changed back when they
13776         fix most of current BCL warnings.
13777         
13778         * RootContext.cs: Pushed default WarningLevel to 3.
13779         
13780         * statement.cs: Removed unused variable.
13782 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
13784         * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
13785         (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
13786         Add error 502 report.
13787         (StaticClass.DefineType): Add error 441 report.
13788         (Class.AllowedModifiersProp): New virtual property as temporary
13789         extension to AllowedModifiers.
13790         (Class.DefineType): Add error 418 report. Moved ModFlags check here
13791         to share implementation with StaticClass and don't call virtual
13792         methods from ctor.
13793         
13794         * driver.cs (MainDriver): Add error 1558 test.
13796         * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
13797         report. Moved error 36 test here.
13799         * statement.cs (Throw.Resolve): Add error 724 report.
13801         * typemanager.cs: Add out_attribute_type core type.
13802         
13803 2004-12-13  Marek Safar  <marek.safar@seznam.cz>
13805         * class.cs (TypeContainer.VerifyClsCompliance): Add error
13806         3018 report.
13807         (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
13809         * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
13810         3017 report.
13811         
13812         * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
13814         * parameter.cs (ReturnParameter.ApplyAttributeBuilder): 
13815         Add error 3023 report.
13816         (Parameter.ApplyAttributeBuilder): Add error 3022 report.
13818         * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
13819         implementation.
13821 2004-12-12  John Luke  <john.luke@gmail.com>
13823         * driver.cs (AddArgs): take -- into account when
13824         adding arguments, fixes bug 65710 
13826 2004-12-12  Martin Baulig  <martin@ximian.com>
13828         * expression.cs (Unary.TryReduceNegative): Added support for
13829         SByteConstant and ByteConstant.
13830         (Unary.Reduce): Check error values from TryReduceNegative().
13832 2004-12-10  Marek Safar  <marek.safar@seznam.cz>
13834         * attributes.cs (Attribute.Resolve): Avoid multiple error report
13835         and report exception as error 182.
13837 2004-12-10  Raja R Harinath  <rharinath@novell.com>
13839         * driver.cs (Main): Fix message when there are warnings.
13841 2004-12-09  Miguel de Icaza  <miguel@ximian.com>
13843         * delegate.cs: Fixed my fix from yesterday, sorry about that.
13845 2004-12-09  Marek Safar  <marek.safar@seznam.cz>
13847         * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs: 
13848         Reduced number of warnings.
13849         
13850         * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
13852 2004-12-08  Miguel de Icaza  <miguel@ximian.com>
13854         * driver.cs: Removed message.
13856         * delegate.cs: Fix bug introduced in 1.1.x: 70219.
13858 2004-12-08    <vargaz@freemail.hu>
13860         * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
13862 2004-12-08  Martin Baulig  <martin@ximian.com>
13864         * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
13865         instead of a CS3002 for properties and indexer.
13867 2004-12-08  Martin Baulig  <martin@ximian.com>
13869         * decl.cs (MemberName.ToString): Make this work again.
13871 2004-12-08  Marek Safar  <marek.safar@seznam.cz>
13873         * attribute.cs (Resolve): Add error 591 detection.
13875         * class.cs (FieldMember.Define): Add error 1547 detection.
13876         (Indexer.Define): Add error 620 detection.
13877         (Operator.Define): Add error 590 detection.
13879         * ecore.cs: Missing argument for error 79.
13881         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
13882         detection.
13884 2004-12-07  Marek Safar  <marek.safar@seznam.cz>
13886         Fix #70106
13887         * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
13888         only.
13890 2004-12-07  Atsushi Enomoto  <atsushi@ximian.com>
13892         * cs-parser.jay : handle doc comments on implicit/explicit operators.
13893           Some operator comments were suppressed.
13894         * doc.cs : Implicit/explicit operator name in doc comments are like
13895           "op_Explicit(type)~returnType", so added suffix handling.
13897 2004-12-07  Martin Baulig  <martin@ximian.com>
13899         * decl.cs
13900         (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
13901         (MemberCore.GetClsCompliantAttributeValue): Likewise.
13902         (DeclSpace.ec): New protected field; store the EmitContext here.
13903         (DeclSpace.EmitContext): New public property; moved here from
13904         `TypeContainer'.
13905         (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
13906         EmitContext.
13908         * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
13909         (Enum.Emit): Don't create a new EmitContext.
13911         * delegate.cs (Delegate.DefineType): Always create the
13912         EmitContext.
13914         * iterators.cs (Iterators.DefineIterator): Create a new
13915         EmitContext and store it in `ec'.
13917 2004-08-24  Martin Baulig  <martin@ximian.com>
13919         * typemanager.cs
13920         (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
13921         this for accessibility checks.
13922         (TypeManager.IsSubclassOrNestedChildOf): Renamed to
13923         IsNestedFamilyAccessible.
13924         (TypeManager.IsSubclassOf): New method, do what the name actually
13925         says.   
13927 2004-12-06  Raja R Harinath  <rharinath@novell.com>
13929         Fix crash on cs0657-17.cs.
13930         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
13931         Use RootContext.Tree.Types, not 'new RootTypes ()'.
13932         * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
13933         the case where the NamespaceEntry gets overwritten.
13935 2004-12-06  Marek Safar  <marek.safar@seznam.cz>
13937         Fixed #69195, #56821
13938         * ecore.cs (ResolveBoolean): Tiny refactoring.
13940         * expression.cs (Binary.DoResolve): Add warning 429 and skipping
13941         of right expression resolving when left is false constant and
13942         operator is LogicalAnd OR true constant and operator is LogicalOr.
13944         * statement.cs (ResolveUnreachable): Always reports warning.
13946 2004-12-05  Miguel de Icaza  <miguel@ximian.com>
13948         * class.cs: Distinguish between 1721 and 1722 (just a little help
13949         for the programmer).
13951 2004-12-03  Miguel de Icaza  <miguel@ximian.com>
13953         * delegate.cs: Only allow this on new versions of the language. 
13955 2004-12-02  Duncan Mak  <duncan@ximian.com>
13957         * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
13958         Expression class.
13959         (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
13960         here as a static method. Take an additional bool out parameter
13961         `must_do_cs1540_check' for signaling to InstanceResolve.
13962         (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
13963         member field from PropertyExpr class and made it an argument of
13964         the method instead.
13965         (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
13966         check for MarshalByRefObject, and report CS0122 instead of CS1540.
13967         (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
13968         and `remove_accessor' as well as InstanceResolve: report CS0122
13969         where applicable.
13971         Fixes #70129.
13973 2004-12-03  Raja R Harinath  <rharinath@novell.com>
13975         Fix test-327.cs, test-328.cs, and put in early infrastructure
13976         for eventually fixing #52697.
13977         * namespace.cs (NamespaceEntry.LookupForUsing): New method.
13978         (NamespaceEntry.LookupNamespaceOrType): New method, refactored
13979         from other methods.
13980         (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
13981         (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
13982         (VerifyUsing, error246): Update.
13983         * rootcontext.cs (RootContext.NamespaceLookup): Just use
13984         'NamespaceEntry.LookupNamespaceOrType'.
13986 2004-12-03  Martin Baulig  <martin@ximian.com>
13988         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
13989         method as our child, call AnonymousMethod.Compatible() on it.
13991 2004-12-03  Raja R Harinath  <rharinath@novell.com>
13993         Disable XML documentation support in 'basic' profile.
13994         * decl.cs, class.cs [BOOTSTRAP_WITH_OLDLIB]: Don't import System.Xml.
13995         Redirect XmlElement to System.Object.
13996         * driver.cs, enum.cs, rootcontext.cs: Don't reference System.Xml.
13997         * doc.cs [BOOTSTRAP_WITH_OLDLIB]: Disable compile.
13998         * mcs.exe.sources: Add doc-bootstrap.cs.
13999         * doc-bootstrap.cs: New file.  Contains empty stub implementation
14000         of doc.cs.
14002 2004-12-03  Atsushi Enomoto  <atsushi@ximian.com>
14004         * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
14005           comments are allowed.
14007 2004-12-03  Carlos Alberto Cortez <calberto.cortez@gmail.com>
14009         * delegate.cs: Add checks for subtypes in paramaters and return values
14010         in VerifyMethod () to add support for Covariance/Contravariance
14011         in delegates.
14012         
14013 2004-12-02  Miguel de Icaza  <miguel@ximian.com>
14015         * report.cs: Remove extra closing parenthesis.
14017         * convert.cs (Error_CannotImplicitConversion): If the name of the
14018         types are the same, provide some extra information.
14020         * class.cs (FieldBase): Use an unused bit field from the field to
14021         encode the `has_offset' property from the FieldMember.  This saves
14022         a couple of Ks on bootstrap compilation.
14024         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
14025         method as our child, return the AnonymousMethod resolved
14026         expression.
14028         * expression.cs (New.DoResolve): Allow return values from
14029         NewDelegate to also include AnonymousMethods.
14031         Fixes #70150.
14033 2004-12-02  Marek Safar  <marek.safar@seznam.cz>
14035         Fix bug #70102
14036         * attribute.cs (Resolve): Improved implementation of params
14037         attribute arguments.
14039         * support.cs (ParameterData): Add HasParams to be faster.
14041 2004-12-02  Atsushi Enomoto  <atsushi@ximian.com>
14043         all things are for /doc support:
14045         * doc.cs: new file that supports XML documentation generation.
14046         * mcs.exe.sources: added doc.cs.
14047         * driver.cs:
14048           Handle /doc command line option.
14049           Report error 2006 instead of 5 for missing file name for /doc.
14050           Generate XML documentation when required, after type resolution.
14051         * cs-tokenizer.cs:
14052           Added support for picking up documentation (/// and /** ... */),
14053           including a new XmlCommentState enumeration.
14054         * cs-parser.jay:
14055           Added lines to fill Documentation element for field, constant,
14056           property, indexer, method, constructor, destructor, operator, event
14057           and class, struct, interface, delegate, enum.
14058           Added lines to warn incorrect comment.
14059         * rootcontext.cs :
14060           Added Documentation field (passed only when /doc was specified).
14061         * decl.cs:
14062           Added DocComment, DocCommentHeader, GenerateDocComment() and
14063           OnGenerateDocComment() and some supporting private members for
14064           /doc feature to MemberCore.
14065         * class.cs:
14066           Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
14067         * delegate.cs:
14068           Added overriden DocCommentHeader.
14069         * enum.cs:
14070           Added overriden DocCommentHeader and GenerateDocComment().
14072 2004-12-01  Miguel de Icaza  <miguel@ximian.com>
14074         * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
14075         unwrapping the enumeration values, chain to
14076         DoConstantNumericPromotions again, so we can promote things to the
14077         fundamental types (takes care of enums that are bytes, sbytes).
14079         Fixes bug #62054.
14081 2004-12-01  Raja R Harinath  <rharinath@novell.com>
14083         * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
14084         Fix long-standing bug in type-lookup.  Use FindType instead of
14085         LookupType when ec.ResolvingTypeTree.
14086         (Attribute.ResolveType, Attribute.Resolve)
14087         (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
14088         Update to changes.
14089         (Attributes.Search): Remove internal version.  Update.
14090         (Attributes.SearchMulti): Update.
14091         (Attributes.GetClsCompliantAttribute): Remove.
14092         (Attributes.GetIndexerNameAttribute): Remove.
14093         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
14094         (DeclSpace.GetClsCompliantAttributeValue): Likewise.
14095         * class.cs (Indexer.Define): Likewise.
14097 2004-12-01  Marek Safar  <marek.safar@seznam.cz>
14099         Fix bug #68790
14100         * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
14101         MarshallByReference members access.
14103         * expression.cs: Use CheckMarshallByRefAccess;
14104         Better error CS0197 message.
14106         * report.cs: Print whole related error message.
14108 2004-11-30  Raja R Harinath  <rharinath@novell.com>
14110         * Makefile (mcs.exe) [PROFILE=default]: Keep a copy of mcs.exe in
14111         the current directory to help debugging.
14113 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
14115         * class (GetClassBases): Better error 60 report.
14116         (EventProperty): Disabled warning 67 detection.
14118 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
14120         Fix bug #60324
14121         * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
14123         * constant.cs (DecimalConstant.Emit): Don't use int ctor for
14124         precise values.
14126 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
14128         Fix bug #49488
14129         * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
14131         * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
14133 2004-11-26  Miguel de Icaza  <miguel@ximian.com>
14135         * attribute.cs (Attribute.Resolve): Refine error reporting and
14136         report a cs0117 if the identifier does not exist, to distinguish
14137         from 0617 which is a miss-use of the actual identifier.
14139         * ecore.cs (EventExpr.Emit): Refine error report and distinguish
14140         between cs0070 and cs0079.
14142         * class.cs (MemberBase.DoDefine): When reporting a wrong
14143         accessibility level, we use MethodCore to compare instead of
14144         Method (this was a regression in some refactoring effort).
14146         So now we correctly report cs0056 again.
14148         * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
14149         testing the target_type (which was known to be object_type) and
14150         not the source type (which is anonymous_method).
14152         Fixed reporting of error cs1660.
14154         * expression.cs (UserCast.Source): Expose the underlying cast.
14156         * statement.cs (Switch.SwitchGoverningType): Sort the list of
14157         allowed types to find a match to int32 first (most common).
14159         In addition, it ignores any ImplicitUserConversions that did an
14160         internal implicit conversion (as the switch statement allows only
14161         one integral conversion to exist).
14163         * class.cs (PartialContainer.Create): rename `name' to
14164         `member_name' for clarity.  Then replace the string calls with a
14165         call to MemberName.GetPartialName, as now using
14166         MemberName.ToString is an error (this is due to the side effects
14167         it had, that were fixed in the past).
14169         This will restore the error reporting on a number of partial class
14170         errors that were missusing this (and getting an exception as a
14171         results, which is now just a plain textual warning, because
14172         yyparse debug output would crash otherwise).
14174 2004-11-26  Raja R Harinath  <rharinath@novell.com>
14176         * Makefile (PROGRAM_INSTALL_DIR): Remove.
14178 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
14180         * rootcontext.cs (LookupType): Make sure to cache lookups that
14181         don't give us a negative result. This saves about 5% of corlib
14182         compilation time.
14184 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
14186         * report.cs (AbstractMessage.Print): messages are sent to stderr
14188         * class.cs (TypeContainer.GetClassBases): It is an error to have a
14189         non-interface in the list of interfaces (at this point, either
14190         parent was properly set, or a base class is being listed in the
14191         interfaces section).
14193         This flags error 1722, and resolves the crash from bug 69259.
14195 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
14197         * statement.cs (Using.EmitExpressionFinally): make this work right
14198         for valuetypes. Fixes 69926.
14200 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
14202         * const.cs (Const.ChangeType): Cope with the "0 literal can be
14203         converted to an enum" here, before we try to change the underlying
14204         type.  This code exists, but it is a different code path than the
14205         one used while encoding constants.
14207         * convert.cs (ImplicitReferenceConversionExists): A surprisingly
14208         old bug: when converting from the null literal to a pointer,
14209         return an EmptyCast, not the NullLiteral.
14211         This fixes #69921, the recent null_type changes probably made this
14212         bug more prominent.
14214         (ImplicitReferenceConversionExists): In addition, resynchronized
14215         the code here, so it matches the same code in
14216         ImplicitReferenceConversionExists for the `from any class-type S
14217         to any interface-type T'.
14218         
14220 2004-11-25  Marek Safar  <marek.safar@seznam.cz>
14222         * cfold.cs (BinaryFold): Add addition for DecimalConstant.
14224 2004-11-24  Miguel de Icaza  <miguel@ximian.com>
14226         * cs-parser.jay: Use verbosity accordingly. 
14228 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
14230         * expression.cs (Unary.ResolveOperator): Do not report warning;
14231         AddressOf reads from variable.
14232         
14233         (LocalVariableReferences.DoResolveBase): Improved my previous fix.
14235 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
14237         Fix bug #69462
14239         * attribute.cs (Attributable): Removed CheckTargets.
14240         (Attributes.Emit): Explicit attribute targets are tested here.
14242         * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
14243         not enabled for interfaces.
14245         * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
14246         (GetAssemblyName): Ouch next bug there.
14248 2004-11-23  Carlos Alberto Cortez <calberto.cortez@gmail.com>
14250         * expression.cs: Error 275 added.
14251         
14252 2004-11-23  Marek Safar  <marek.safar@seznam.cz>
14254         Fix bug #69177 (Implemented decimal constant support)
14256         * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
14257         (BinaryFold): Add DecimalConstant.
14259         * const.cs (Define): Decimal constant 
14260         (is not constant.
14261         (ChangeType): Add decimal type handling.
14262         (LookupConstantValue): Don't set value for decimal type but
14263         emit DecimalConstantAttribute. Needed for constant optimization.
14265         * constant.cs (ToDecimal): New method.
14266         (ConvertToDecimal): New method.
14267         (IntConstant): Implemented ConvertToDecimal.
14268         (DecimalConstant.Emit): Emit optimized version for decimals in
14269         int range.
14271         * expression.cs (ResolveOperator): Changed order of constant
14272         reduction to work correctly with native types which have
14273         overloaded operators.
14274         (ResolveMemberAccess): Extract constant value from attribute
14275         for decimal type.
14277         * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
14279         * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
14280         void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
14281         (ChangeType): Decimal is special.
14282         (TypeToCoreType): Add decimal type.
14284 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
14286         * convert.cs (ImplicitConversionRequired): Add error cs0642 for
14287         decimal types.
14289 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
14291         * class.cs (EventField.ApplyAttributeBuilder): Fix error
14292         test cs1667-5.cs.
14294 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
14296         * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
14298         * pending.cs (PendingImplementation): Grab only interfaces.
14300 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
14302         * statement.cs (ForeachHelperMethods): Add location member and
14303         error 202 detection.
14305 2004-11-19  Raja R Harinath  <rharinath@novell.com>
14307         * Makefile (EXTRA_DISTFILES): Remove mcs.exe.config.  It's
14308         automatically handled by executable.make.
14309         (PROGRAM): Make profile-specific.
14311 2004-11-18  Marek Safar  <marek.safar@seznam.cz>
14313         * expression.cs (DoResolveBase): Fixed wrong warning for out
14314         variables.
14316 2004-11-18  Martin Baulig  <martin@ximian.com>
14318         Merged latest changes into gmcs.  Please keep this comment in
14319         here, it makes it easier for me to see what changed in MCS since
14320         the last time I merged.
14322 2004-11-17  Raja R Harinath  <rharinath@novell.com>
14324         * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
14325         (TypeHandle.GetMemberCache): New.
14326         (TypeHandle.TypeHandle): Update.
14327         (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
14328         (TypeManager.LookupParentInterfacesCache):
14329         Rename from LookupInterfaceCache.  Optimize slightly.
14330         (TypeManager.MemberLookup_FindMembers): Update.
14331         * decl.cs (MemberCache.MemberCache): Set Container to null in the
14332         multi-type variant.
14333         (AddCacheContents): Rename from AddHashtable.
14334         * class.cs (TypeContainer.parent_container): Remove.
14335         (TypeContainer.VerifyClsCompliance): Don't use parent_container.
14336         (TypeContainer.DoDefineMembers): Don't initialize it.
14337         Update to name changes.
14338         
14339 2004-11-17  Miguel de Icaza  <miguel@ximian.com>
14341         * class.cs (MethodCore.CheckAccessModifiers): New helper routine
14342         that factors the code to check access modifiers on override.  
14344         (PropertyBase): Use the code here.
14346         Patch from Lluis S'anchez, fixes bug #69361.
14348 2004-11-15  Miguel de Icaza  <miguel@ximian.com>
14350         * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
14351         routine that is used to report the use of a captured variable
14352         whose address has been taken.
14354         There are two checks: one when variables are being captured and
14355         the other check is when the address of a variable is taken. 
14356         
14357         (because an anonymous methods might be resolved before *or* after
14358         the address has been taken) and 
14360         * expression.cs (Conditional.DoResolve): Remove the special
14361         casing that Martin added to trueExpr and falseExpr being both
14362         NullLiteral.  We get the right behavior now just by introducing
14363         the null_type into the compiler. 
14365         * convert.cs (ExplicitConversion): Change the code to use
14366         null_type instead of testing `expr is NullLiteral'.
14367         (ImplicitConversionStandard): use null_type too.
14368         (ImplicitReferenceConversionExists): use null_type too.
14369         (ImplicitReferenceConversion): use null_type too.
14371         * literal.cs: The type of `NullLiteral' is now null_type instead
14372         of object_type. 
14373         (Resolve): Set the type here.
14375         * typemanager.cs: Introduce null_type.
14377 2004-11-17  Martin Baulig  <martin@ximian.com>
14379         * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
14380         direction, like FindMembers() does.  Fixes #69546, testcase is in
14381         test-315.cs.    
14383 2004-11-16  Martin Baulig  <martin@ximian.com>
14385         This is based on a patch from Marek Safar, see bug #69082.
14386         Fixes bugs #63705 and #67130.
14388         * typemanager.cs (TypeManager.LookupInterfaceCache): New public
14389         method; create a MemberCache for an interface type and cache the
14390         result.
14392         * decl.cs (IMemberContainer.ParentContainer): Removed.
14393         (IMemberContainer.ParentCache): New property.
14394         (MemberCache.SetupCacheForInterface): Removed.
14395         (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
14396         to create a cache for an interface's "parent".
14398         * class.cs (TypeContainer.DoDefineMembers): Setup cache for
14399         interfaces too.
14401 2004-11-16  Martin Baulig  <martin@ximian.com>
14403         Merged back from gmcs; these changes already went into gmcs a
14404         couple of weeks ago.
14406         * typemanager.cs
14407         (TypeManager.AddUserType): Removed the `ifaces' argument.
14408         (TypeManager.RegisterBuilder): Take a `Type []' instead of a
14409         `TypeExpr []'.
14410         (TypeManager.AddUserInterface): Removed.
14411         (TypeManager.ExpandInterfaces): Return a `Type []' instead of a
14412         `TypeExpr []'.
14413         (TypeManager.GetInterfaces): Likewise.
14414         (TypeManager.GetExplicitInterfaces): Likewise.
14416         * ecore.cs (TypeExpr.GetInterfaces): Removed.
14418         * class.cs (TypeContainer.base_class_type): Replaced with `ptype'.
14419         (TypeContainer.base_inteface_types): Replaced with `ifaces'.
14421 2004-11-14  Ben Maurer  <bmaurer@ximian.com>
14423         * statement.cs: Avoid adding bools to a hashtable.
14425 2004-11-07  Miguel de Icaza  <miguel@ximian.com>
14427         * expression.cs (Invocation.OverloadResolve): Flag error if we are
14428         calling an unsafe method from a safe location.
14430 2004-11-06  Marek Safar  <marek.safar@seznam.cz>
14432         Fix #69167
14433         * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
14435 2004-11-06  Miguel de Icaza  <miguel@ximian.com>
14437         * namespace.cs (VerifyUsing): use GetPartialName instead of
14438         ToString. 
14440 2004-11-05  Miguel de Icaza  <miguel@ximian.com>
14442         * statement.cs (Return.Resolve): Fix regression in typo: if
14443         `in_exc', we have to request a NeedReturnLabel, this was a typo
14444         introduced in the anonymous method check-in.  Fixes #69131.
14446         * Indexers were using the ShortName when defining themselves,
14447         causing a regression in the compiler bootstrap when applying the
14448         patch from 2004-11-02 (first part), now they use their full name
14449         and the bug is gone.
14451 2004-11-04  Zoltan Varga  <vargaz@freemail.hu>
14453         * driver.cs: Strip the path from the names of embedded resources. Fixes
14454         #68519.
14456 2004-11-04  Raja R Harinath  <rharinath@novell.com>
14458         Fix error message regression: cs0104-2.cs.
14459         * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
14460         (AliasEntry.Resolve): Update.
14461         * rootcontext.cs (RootContext.NamespaceLookup): Update.  Remove
14462         'silent' flag.
14463         (RootContext.LookupType): Update.
14465 2004-11-03  Carlos Alberto Cortez <carlos@unixmexico.org>
14467         * cs-parser.jay: Add support for handling accessor modifiers
14468         * class: Add support port accessor modifiers and error checking,
14469         define PropertyMethod.Define as virtual (not abstract anymore)
14470         * ecore.cs: Add checking for proeprties access with access modifiers
14471         * iterators.cs: Modify Accessor constructor call based in the modified
14472         constructor
14473 2004-11-02  Ben Maurer  <bmaurer@ximian.com>
14475         * expression.cs (StringConcat): Handle being called twice,
14476         as when we have a concat in a field init with more than two
14477         ctors in the class
14479 2004-11-02  Miguel de Icaza  <miguel@ximian.com>
14481         * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
14482         special case explicit implementations, we should always produce
14483         the .property or .event declaration.
14484         
14485         * decl.cs (MemberName): Renamed GetFullName to GetPartialName
14486         since it will not return correct data if people use this
14487         unresolved in the presence of using statements (see test-313).
14489         * class.cs (MethodData.Define): If we are an explicit interface
14490         implementation, set the method name to the full name of the
14491         interface plus the name of the method.  
14493         Notice that using the method.MethodName.GetFullName() does not
14494         work, as it will only contain the name as declared on the source
14495         file (it can be a shorthand in the presence of using statements)
14496         and not the fully qualifed type name, for example:
14498         using System;
14500         class D : ICloneable {
14501                 object ICloneable.Clone ()  {
14502                 }
14503         }
14505         Would produce a method called `ICloneable.Clone' instead of
14506         `System.ICloneable.Clone'.
14508         * namespace.cs (Alias.Resolve): Use GetPartialName.
14509         
14510 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
14512         * cs-parser.jay: Add error 1055 report.
14514 2004-11-01  Miguel de Icaza  <miguel@ximian.com>
14516         * assign.cs (Assign.DoResolve): Only do the transform of
14517         assignment into a New if the types are compatible, if not, fall
14518         through and let the implicit code deal with the errors and with
14519         the necessary conversions. 
14521 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
14523         * cs-parser.jay: Add error 1031 report.
14525         * cs-tokenizer.cs: Add location for error 1038.
14527 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
14529         * cs-parser.jay: Add error 1016 report.
14531 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
14533         * cs-parser.jay: Add errors 1575,1611 report.
14535 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
14537         * cs-parser.jay: Add error 1001 report.
14539 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
14541         Fix #68850
14542         * attribute.cs (GetMarshal): Add method argument for
14543         caller identification.
14545         * class.cs, codegen.cs, enum.cs, parameter.cs: Added
14546         agument for GetMarshal and RuntimeMissingSupport.
14548 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
14550         * attribute.cs (ExtractSecurityPermissionSet): Removed
14551         TypeManager.code_access_permission_type.
14553         * typemanager.cs: Removed TypeManager.code_access_permission_type.
14555 2004-10-27  Miguel de Icaza  <miguel@ximian.com>
14557         * expression.cs (LocalVariableReference.DoResolveLValue): Check
14558         for obsolete use of a variable here.   Fixes regression on errors
14559         cs0619-25 and cs0619-26.
14561 2004-10-27  Marek Safar  <marek.safar@seznam.cz>
14563         Fix #62358, implemented security attribute encoding.
14565         * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
14566         Tests permitted SecurityAction for assembly or other types.
14567         (Assembly.ExtractSecurityPermissionSet): New method. Transforms
14568         data from SecurityPermissionAttribute to PermisionSet class.
14570         * class.cs (ApplyAttributeBuilder): Added special handling
14571         for System.Security.Permissions.SecurityAttribute based types.
14573         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
14574         special handling for System.Security.Permissions.SecurityAttribute
14575         based types.
14577         * enum.cs (ApplyAttributeBuilder): Added special handling
14578         for System.Security.Permissions.SecurityAttribute based types.
14580         * parameter.cs (ApplyAttributeBuilder): Added special handling
14581         for System.Security.Permissions.SecurityAttribute based types.
14583         * rootcontext.cs: Next 2 core types.
14585         * typemanager.cs (TypeManager.security_permission_attr_type):
14586         Built in type for the SecurityPermission Attribute.
14587         (code_access_permission_type): Build in type.
14589 2004-10-17  Miguel de Icaza  <miguel@ximian.com>
14591         * expression.cs (LocalVariableReference.DoResolveBase, Emit):
14592         Remove the tests for `ec.RemapToProxy' from here, and encapsulate
14593         all of this information into
14594         EmitContext.EmitCapturedVariableInstance.
14595         
14596         * codegen.cs (EmitCapturedVariableInstance): move here the
14597         funcionality of emitting an ldarg.0 in the presence of a
14598         remapping.   This centralizes the instance emit code.
14600         (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
14601         then emit a load of this: it means that we have reached the
14602         topmost ScopeInfo: the one that contains the pointer to the
14603         instance of the class hosting the anonymous method.
14605         * anonymous.cs (AddField, HaveCapturedFields): Propagate field
14606         captures to the topmost CaptureContext.
14608 2004-10-12  Miguel de Icaza  <miguel@ximian.com>
14610         * expression.cs (LocalVariableReference): Move the knowledge about
14611         the iterators into codegen's EmitCapturedVariableInstance.
14613 2004-10-11  Miguel de Icaza  <miguel@ximian.com>
14615         * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
14616         all code paths return a value from an anonymous method (it is the
14617         same as the 161 error, but for anonymous methods).
14619 2004-10-08  Miguel de Icaza  <miguel@ximian.com>
14621         The introduction of anonymous methods in the compiler changed
14622         various ways of doing things in the compiler.  The most
14623         significant one is the hard split between the resolution phase
14624         and the emission phases of the compiler.
14626         For instance, routines that referenced local variables no
14627         longer can safely create temporary variables during the
14628         resolution phase: they must do so from the emission phase,
14629         since the variable might have been "captured", hence access to
14630         it can not be done with the local-variable operations from the runtime.
14631         
14632         * statement.cs 
14634         (Block.Flags): New flag `IsTopLevel' to indicate that this block
14635         is a toplevel block.
14637         (ToplevelBlock): A new kind of Block, these are the blocks that
14638         are created by the parser for all toplevel method bodies.  These
14639         include methods, accessors and anonymous methods.
14641         These contain some extra information not found in regular blocks:
14642         A pointer to an optional CaptureContext (for tracking captured
14643         local variables and parameters).  A pointer to the parent
14644         ToplevelBlock.
14645         
14646         (Return.Resolve): Catch missmatches when returning a value from an
14647         anonymous method (error 1662).
14648         Invoke NeedReturnLabel from the Resolve phase instead of the emit
14649         phase.
14651         (Break.Resolve): ditto.
14653         (SwitchLabel): instead of defining the labels during the
14654         resolution phase, we now turned the public ILLabel and ILLabelCode
14655         labels into methods called GetILLabelCode() and GetILLabel() that
14656         only define the label during the Emit phase.
14658         (GotoCase): Track the SwitchLabel instead of the computed label
14659         (its contained therein).  Emit the code by using
14660         SwitchLabel.GetILLabelCode ().
14662         (LocalInfo.Flags.Captured): A new flag has been introduce to track
14663         whether the Local has been captured or not.
14665         (LocalInfo.IsCaptured): New property, used to tell whether the
14666         local has been captured.
14667         
14668         * anonymous.cs: Vastly updated to contain the anonymous method
14669         support.
14671         The main classes here are: CaptureContext which tracks any
14672         captured information for a toplevel block and ScopeInfo used to
14673         track the activation frames for various local variables.   
14675         Each toplevel block has an optional capture context associated
14676         with it.  When a method contains an anonymous method both the
14677         toplevel method and the anonymous method will create a capture
14678         context.   When variables or parameters are captured, they are
14679         recorded on the CaptureContext that owns them, for example:
14681         void Demo () {
14682              int a;
14683              MyDelegate d = delegate {
14684                  a = 1;
14685              }
14686         }
14688         Here `a' will be recorded as captured on the toplevel
14689         CapturedContext, the inner captured context will not have anything
14690         (it will only have data if local variables or parameters from it
14691         are captured in a nested anonymous method.
14693         The ScopeInfo is used to track the activation frames for local
14694         variables, for example:
14696         for (int i = 0; i < 10; i++)
14697                 for (int j = 0; j < 10; j++){
14698                    MyDelegate d = delegate {
14699                         call (i, j);
14700                    }
14701                 }
14703         At runtime this captures a single captured variable `i', but it
14704         captures 10 different versions of the variable `j'.  The variable
14705         `i' will be recorded on the toplevel ScopeInfo, while `j' will be
14706         recorded on a child.  
14708         The toplevel ScopeInfo will also track information like the `this'
14709         pointer if instance variables were referenced (this is necessary
14710         as the anonymous method lives inside a nested class in the host
14711         type of the method). 
14713         (AnonymousMethod): Expanded to track the Toplevel, implement
14714         `AnonymousMethod.Compatible' to tell whether an anonymous method
14715         can be converted to a target delegate type. 
14717         The routine now also produces the anonymous method content
14719         (AnonymousDelegate): A helper class that derives from
14720         DelegateCreation, this is used to generate the code necessary to
14721         produce the delegate for the anonymous method that was created. 
14723         * assign.cs: API adjustments for new changes in
14724         Convert.ImplicitStandardConversionExists.
14726         * class.cs: Adjustments to cope with the fact that now toplevel
14727         blocks are of type `ToplevelBlock'. 
14729         * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
14730         insteda of standard blocks.
14732         Flag errors if params arguments are passed to anonymous methods.
14734         * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
14735         `CurrentAnonymousMethod' which points to the current Anonymous
14736         Method.  The variable points to the AnonymousMethod class that
14737         holds the code being compiled.  It is set in the new EmitContext
14738         created for the anonymous method.
14740         (EmitContext.Phase): Introduce a variable and an enumeration to
14741         assist in enforcing some rules about when and where we are allowed
14742         to invoke certain methods (EmitContext.NeedsReturnLabel is the
14743         only one that enfonces this right now).
14745         (EmitContext.HaveCaptureInfo): new helper method that returns
14746         whether we have a CapturedContext initialized.
14748         (EmitContext.CaptureVariable): New method used to register that a
14749         LocalInfo must be flagged for capturing. 
14751         (EmitContext.CapturedParameter): New method used to register that a
14752         parameters must be flagged for capturing. 
14753         
14754         (EmitContext.CapturedField): New method used to register that a
14755         field must be flagged for capturing. 
14757         (EmitContext.HaveCapturedVariables,
14758         EmitContext.HaveCapturedFields): Return whether there are captured
14759         variables or fields. 
14761         (EmitContext.EmitMethodHostInstance): This is used to emit the
14762         instance for the anonymous method.  The instance might be null
14763         (static methods), this (for anonymous methods that capture nothing
14764         and happen to live side-by-side with the current method body) or a
14765         more complicated expression if the method has a CaptureContext.
14767         (EmitContext.EmitTopBlock): Routine that drives the emission of
14768         code: it will first resolve the top block, then emit any metadata
14769         and then emit the code.  The split is done so that we can extract
14770         any anonymous methods and flag any captured variables/parameters.
14771         
14772         (EmitContext.ResolveTopBlock): Triggers the resolution phase,
14773         during this phase, the ILGenerator should not be used as labels
14774         and local variables declared here might not be accessible to any
14775         code that is part of an anonymous method.  
14777         Exceptions to this include the temporary variables that are
14778         created by some statements internally for holding temporary
14779         variables. 
14780         
14781         (EmitContext.EmitMeta): New routine, in charge of emitting all the
14782         metadata for a cb
14784         (EmitContext.TemporaryReturn): This method is typically called
14785         from the Emit phase, and its the only place where we allow the
14786         ReturnLabel to be defined other than the EmitMeta.  The reason is
14787         that otherwise we would have to duplicate a lot of logic in the
14788         Resolve phases of various methods that today is on the Emit
14789         phase. 
14791         (EmitContext.NeedReturnLabel): This no longer creates the label,
14792         as the ILGenerator is not valid during the resolve phase.
14794         (EmitContext.EmitThis): Extended the knowledge in this class to
14795         work in anonymous methods in addition to iterators. 
14797         (EmitContext.EmitCapturedVariableInstance): This emits whatever
14798         code is necessary on the stack to access the instance to a local
14799         variable (the variable will be accessed as a field).
14801         (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
14802         EmitContext.EmitAddressOfParameter): Routines to support
14803         parameters (not completed at this point). 
14804         
14805         Removals: Removed RemapLocal and RemapLocalLValue.  We probably
14806         will also remove the parameters.
14808         * convert.cs (Convert): Define a `ConstantEC' which points to a
14809         null.  This is just to prefity some code that uses
14810         ImplicitStandardConversion code and do not have an EmitContext
14811         handy.
14813         The idea is to flag explicitly that at that point in time, it is
14814         known that the conversion will not trigger the delegate checking
14815         code in implicit conversions (which requires a valid
14816         EmitContext). 
14818         Everywhere: pass new EmitContext parameter since
14819         ImplicitStandardConversionExists now requires it to check for
14820         anonymous method conversions. 
14822         (Convert.ImplicitStandardConversionExists): If the type of an
14823         expression is the anonymous_method_type, and the type is a
14824         delegate, we invoke the AnonymousMethod.Compatible method to check
14825         whether an implicit conversion is possible. 
14827         (Convert.ImplicitConversionStandard): Only do implicit method
14828         group conversions if the language level is not ISO_1.
14830         * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
14831         MethodInfo for the Invoke method.  used by Delegate and
14832         AnonymousDelegate.
14834         * expression.cs (Binary.DoNumericPromotions): only allow anonymous
14835         method conversions if the target type is a delegate.
14837         Removed extra debugging nops.
14839         (LocalVariableReference): Turn the `local_info' into a public
14840         field. 
14842         Add `prepared' field, the same hack used for FieldExprs to cope
14843         with composed assignments, as Local variables do not necessarily
14844         operate purely on the stack as they used to: they can be captured
14845         fields. 
14847         Add `temp' for a temporary result, like fields.
14849         Refactor DoResolve and DoResolveLValue into DoResolveBase.
14851         It now copes with Local variables that are captured and emits the
14852         proper instance variable to load it from a field in the captured
14853         case. 
14855         (ParameterReference.DoResolveBase): During the resolve phase,
14856         capture parameters if we are in an anonymous method.
14858         (ParameterReference.Emit, ParameterReference.AddressOf): If in an
14859         anonymous method, use the EmitContext helper routines to emit the
14860         parameter reference.
14862         * iterators.cs: Set RemapToProxy to true/false during the
14863         EmitDispose class.
14865         * parameters.cs (GetParameterByName): New helper method. 
14867         * typemanager.cs (anonymous_method_type) a new type that
14868         represents an anonyous method.  This is always an internal type,
14869         used as a fencepost to test against the anonymous-methodness of an
14870         expression. 
14871         
14872 2004-10-20  Marek Safar  <marek.safar@seznam.cz>
14874         * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
14875         561 report.
14876         (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
14878 2004-10-18  Martin Baulig  <martin@ximian.com>
14880         * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
14881         `Type' directly, but call ResolveType() on it.
14882         (Catch.Resolve): Likewise.
14883         (Foreach.Resolve): Likewise.
14885 2004-10-18  Martin Baulig  <martin@ximian.com>
14887         * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
14888         `Type' directly, but call ResolveType() on it.
14889         (Probe.DoResolve): Likewise.
14890         (ArrayCreation.LookupType): Likewise.
14891         (TypeOf.DoResolve): Likewise.
14892         (SizeOf.DoResolve): Likewise.
14894 2004-10-18  Martin Baulig  <martin@ximian.com>
14896         * expression.cs (Invocation.BetterFunction): Put back
14897         TypeManager.TypeToCoreType().
14899 2004-10-18  Raja R Harinath  <rharinath@novell.com>
14901         * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
14902         the ResolveType.
14904 2004-10-18  Martin Baulig  <martin@ximian.com>
14906         * parameter.cs (Parameter.Resolve):  Don't access the TypeExpr's
14907         `Type' directly, but call ResolveType() on it.
14909 2004-10-18  Martin Baulig  <martin@ximian.com>
14911         * class.cs (FieldMember.Define): Don't access the TypeExpr's
14912         `Type' directly, but call ResolveType() on it.
14913         (MemberBase.DoDefine): Likewise.
14915         * expression.cs (New.DoResolve): Don't access the TypeExpr's
14916         `Type' directly, but call ResolveType() on it.
14917         (ComposedCast.DoResolveAsTypeStep): Likewise.
14919         * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
14920         `Type' directly, but call ResolveType() on it.
14922 2004-10-17  John Luke  <john.luke@gmail.com>
14924         * class.cs (Operator.GetSignatureForError): use CSharpName
14926         * parameter.cs (Parameter.GetSignatureForError): Returns
14927         correct name even if was not defined.
14929 2004-10-13  Raja R Harinath  <rharinath@novell.com>
14931         Fix #65816.
14932         * class.cs (TypeContainer.EmitContext): New property.
14933         (DefineNestedTypes): Create an emitcontext for each part.
14934         (MethodCore.DoDefineParameters): Use container's emitcontext.
14935         Pass type array to InternalParameters.
14936         (MemberBase.DoDefine): Use container's emitcontext.
14937         (FieldMember.Define): Likewise.
14938         (Event.Define): Likewise.
14939         (SetMethod.GetParameterInfo): Change argument to EmitContext.
14940         Pass type array to InternalParameters.
14941         (SetIndexerMethod.GetParameterInfo): Likewise.
14942         (SetMethod.Define): Pass emitcontext to GetParameterInfo.
14943         * delegate.cs (Define): Pass emitcontext to
14944         ComputeAndDefineParameterTypes and GetParameterInfo.  Pass type
14945         array to InternalParameters.
14946         * expression.cs (ParameterReference.DoResolveBase): Pass
14947         emitcontext to GetParameterInfo.
14948         (ComposedCast.DoResolveAsTypeStep): Remove check on
14949         ec.ResolvingTypeTree.
14950         * parameter.cs (Parameter.Resolve): Change argument to
14951         EmitContext.  Use ResolveAsTypeTerminal.
14952         (Parameter.GetSignature): Change argument to EmitContext.
14953         (Parameters.ComputeSignature): Likewise.
14954         (Parameters.ComputeParameterTypes): Likewise.
14955         (Parameters.GetParameterInfo): Likewise.
14956         (Parameters.ComputeAndDefineParameterTypes): Likewise.
14957         Re-use ComputeParameterTypes.  Set ec.ResolvingTypeTree.
14958         * support.cs (InternalParameters..ctor): Remove variant that takes
14959         a DeclSpace.
14960         * typemanager.cs (system_intptr_expr): New.
14961         (InitExpressionTypes): Initialize it.
14963 2004-10-12  Chris Toshok  <toshok@ximian.com>
14965         * cs-parser.jay: fix location for try_statement and catch_clause.
14967 2004-10-11  Martin Baulig  <martin@ximian.com>
14969         * report.cs: Don't make --fatal abort on warnings, we have
14970         -warnaserror for that.
14972 2004-10-07  Raja R Harinath  <rharinath@novell.com>
14974         More DeclSpace.ResolveType avoidance.
14975         * decl.cs (MemberCore.InUnsafe): New property.
14976         * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal 
14977         with newly created EmitContext.
14978         (FieldMember.Define): Likewise.
14979         * delegate.cs (Delegate.Define): Likewise.
14980         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
14981         only if normal name-lookup fails.
14982         (TypeExpr.DoResolve): Enable error-checking.
14983         * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
14984         (SizeOf.DoResolve): Likewise.
14985         (ComposedCast.DoResolveAsTypeStep): Likewise.
14986         (StackAlloc.DoResolve): Likewise.
14987         * statement.cs (Block.Flags): Add new flag 'Unsafe'.
14988         (Block.Unsafe): New property.
14989         (Block.EmitMeta): Set ec.InUnsafe as appropriate.
14990         (Unsafe): Set 'unsafe' flag of contained block.
14991         (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
14992         (Fixed.Resolve): Likewise.
14993         (Catch.Resolve): Likewise.
14994         (Using.ResolveLocalVariableDecls): Likewise.
14995         (Foreach.Resolve): Likewise.
14997 2004-10-05  John Luke <john.luke@gmail.com>
14999         * cs-parser.jay: add location to error CS0175
15001 2004-10-04  Miguel de Icaza  <miguel@ximian.com>
15003         * ecore.cs (Expression.Constantity): Add support for turning null
15004         into a constant.
15006         * const.cs (Const.Define): Allow constants to be reference types
15007         as long as the value is Null.
15009 2004-10-04  Juraj Skripsky  <js@hotfeet.ch>
15011         * namespace.cs (NamespaceEntry.Using): No matter which warning
15012         level is set, check if this namespace name has already been added.
15014 2004-10-03 Ben Maurer  <bmaurer@ximian.com>
15016         * expression.cs: reftype [!=]= null should always use br[true,false].
15017         # 67410
15019 2004-10-03  Marek Safar  <marek.safar@seznam.cz>
15021         Fix #67108
15022         * attribute.cs: Enum conversion moved to 
15023         GetAttributeArgumentExpression to be applied to the all
15024         expressions.
15026 2004-10-01  Raja R Harinath  <rharinath@novell.com>
15028         Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
15029         * class.c (TypeContainer.DefineType): Flag error if
15030         base types aren't accessible due to access permissions.
15031         * decl.cs (DeclSpace.ResolveType): Move logic to
15032         Expression.ResolveAsTypeTerminal.
15033         (DeclSpace.ResolveTypeExpr): Thin layer over
15034         Expression.ResolveAsTypeTerminal.
15035         (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
15036         Refactor code into NestedAccess.  Use it.
15037         (DeclSpace.NestedAccess): New.
15038         * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
15039         argument to silence errors.  Check access permissions.
15040         (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
15041         * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
15042         (Cast.DoResolve): Likewise.
15043         (New.DoResolve): Likewise.
15044         (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
15045         (TypeOf.DoResolve): Likewise.
15047         * expression.cs (Invocation.BetterConversion): Return the Type of
15048         the better conversion.  Implement section 14.4.2.3 more faithfully.
15049         (Invocation.BetterFunction): Make boolean.  Make correspondence to
15050         section 14.4.2.2 explicit.
15051         (Invocation.OverloadResolve): Update.
15052         (Invocation): Remove is_base field.
15053         (Invocation.DoResolve): Don't use is_base.  Use mg.IsBase.
15054         (Invocation.Emit): Likewise.
15056 2004-09-27  Raja R Harinath  <rharinath@novell.com>
15058         * README: Update to changes.
15060 2004-09-24  Marek Safar  <marek.safar@seznam.cz>
15062         * cs-parser.jay: Reverted 642 warning fix.
15064 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
15066         Fix bug #66615
15067         * decl.cs (FindMemberWithSameName): Indexer can have more than
15068         1 argument.
15070 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
15072         * expression.cs (LocalVariableReference.DoResolveLValue):
15073         Do not report warning 219 for out values.
15074         (EmptyExpression.Null): New member to avoid extra allocations.
15076 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
15078         * cs-parser.jay: Fix wrong warning 642 report.
15080         * cs-tokenizer.cs (CheckNextToken): New helper;
15081         Inspect next character if is same as expected.
15083 2004-09-23  Martin Baulig  <martin@ximian.com>
15085         * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
15086         (Convert.ImplicitReferenceConversionExists): Likewise.
15088 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
15090         * class.cs (Operator.Define): Add error 448 and 559 report.
15092 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
15094         * class.cs (MemberBase.IsTypePermitted): New protected
15095         method for checking error CS0610.
15097 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
15099         * class.cs (TypeContainer.HasExplicitLayout): New property
15100         Returns whether container has StructLayout attribute set Explicit.
15101         (FieldMember): New abstract class for consts and fields.
15102         (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
15103         (Field): Reuse FieldMember.
15105         * const.cs (Const): Reuse FieldMember.
15107         * rootcontext.cs: EmitConstants call moved to class.
15109 2004-09-22  Martin Baulig  <martin@ximian.com>
15111         Thanks to Peter Sestoft for this bug report.
15113         * expression.cs (Conditional): If both the `trueExpr' and the
15114         `falseExpr' is a NullLiteral, return a NullLiteral.
15116 2004-09-22  Martin Baulig  <martin@ximian.com>
15118         * statement.cs (Foreach.EmitCollectionForeach): If we're in an
15119         iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
15120         for the "get_Current" call.
15122 2004-09-22  Martin Baulig  <martin@ximian.com>
15124         Marek and me just fixed one of our oldest bugs: #28562 :-)
15126         * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
15128         * attribute.cs (Attribute.GetAttributeArgumentExpression): If
15129         we're an EnumConstant, just return that.
15130         (Attribute.Resolve): GetAttributeArgumentExpression() may give us
15131         an EnumConstant.  In this case, we need to use GetValueAsEnumType()
15132         to get the value which'll actually be written into the attribute.
15133         However, we have to use GetValue() to access the attribute's value
15134         in the compiler.        
15136 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
15138         * constant.cs (Constant.IsNegative): New abstract property
15139         IsNegative.
15141         * expression.cs (ArrayAccess.DoResolve): Add warning 251.
15142         (StackAlloc.DoResolve): Reused IsNegative.
15144 2004-09-21  Martin Baulig  <martin@ximian.com>
15146         * codegen.cs (VariableStorage): Don't store the ILGenerator here;
15147         if we're used in an iterator, we may be called from different
15148         methods.
15150         * statement.cs (Foreach.EmitFinally): Only emit an `Endfinally' if
15151         we actually have an exception block.
15153 2004-09-20  John Luke <jluke@cfl.rr.com>
15155         * class.cs, cs-parser.jay: Improve the error report for 1520:
15156         report the actual line where the error happens, not where the
15157         class was declared.
15159         * assign.cs, delegate.cs, ecore.cs, expression.cs, statement.cs:
15160         Pass location information that was available elsewhere.
15162 2004-09-19  Sebastien Pouliot  <sebastien@ximian.com>
15164         * codegen.cs: Fix bug #56621. It is now possible to use MCS on the MS
15165         runtime to delay sign assemblies.
15167 2004-09-19  Miguel de Icaza  <miguel@ximian.com>
15169         * cs-parser.jay: Do not report the stack trace, this is barely
15170         used nowadays.
15172 2004-08-22  John Luke  <john.luke@gmail.com>
15174         * driver.cs : check that a resource id is not already used
15175         before adding it, report CS1508 if it is, bug #63637
15177 2004-09-19  Miguel de Icaza  <miguel@ximian.com>
15179         * ecore.cs: Removed dead code.
15181 2004-09-18  Marek Safar  <marek.safar@seznam.cz>
15183         * class.cs: Do not report warning CS0067 on the interfaces.
15185 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
15187         * cs-parser.jay: Add error 504 report.
15189 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
15191         * rootcontext.cs: WarningLevel is 4 by default now.
15193         * statement.cs (Fixed.Resolve): Do not null
15194         VariableInfo.
15196 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
15198         Fixed bug #55780
15199         * ecore.cs (PropertyExpr.FindAccessors): Do not perform
15200         deep search when property is not virtual.
15201         (PropertyExpr.ResolveAccessors): Make one call for both
15202         accessors.
15204 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
15206         Fixed bug #65766
15207         * statement.cs: Error 152 report constains also location.
15209 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
15211         Fixed bug #65766
15212         * const.cs: Explicitly set constant as static.
15214 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
15216         Fixed bug #64226
15217         * cs-parser.jay: Add error 1017 report.
15219 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
15221         Fixed bug #59980, #64224
15222         * expression.cs (Invocation.DoResolve): Fixed error CS0571 test.
15224         * typemanager.cs (IsSpecialMethod): Simplified
15226 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
15228         * decl.cs (MemberCore.Emit): Resuscitated VerifyObsoleteAttribute
15229         condition with better params.
15231 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
15233         Fixed bug #65238
15234         * attribute.cs (Resolve): Property has to have both
15235         accessors.
15237 2004-09-14  Martin Baulig  <martin@ximian.com>
15239         * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
15241 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
15243         Fixed bug #61902
15244         * codegen.cs (TestObsoleteMethodUsage): Trace when method is
15245         called and is obsolete then this member suppress message
15246         when call is inside next [Obsolete] method or type.
15248         * expression.cs: Use TestObsoleteMethodUsage member.
15250 2004-09-14  Martin Baulig  <martin@ximian.com>
15252         * cs-parser.jay: Sync a bit with the GMCS version.
15254 2004-09-14  Martin Baulig  <martin@ximian.com>
15256         * cs-parser.jay (CSharpParser): Don't derive from GenericsParser.
15257         (CSharpParser.yacc_verbose_flag): New public field.
15259         * genericparser.cs: Removed.
15261 2004-09-14  Raja R Harinath  <rharinath@novell.com>
15263         * cs-parser.jay (event_declaration): Re-enable cs0071 error.
15265 2004-09-13  Marek Safar  <marek.safar@seznam.cz>
15267         * class.cs (MethodCore.CheckBase): Fix bug #65757.
15269 2004-09-10  Martin Baulig  <martin@ximian.com>
15271         Backported my MemberName changes from GMCS into MCS.
15273         - we are now using a special `MemberName' class instead of using
15274         strings; in GMCS, the `MemberName' also contains the type
15275         arguments.
15277         - changed the grammar rules a bit:
15278           * the old `member_name' is now a `namespace_or_type_name':
15279             The rule is that we use `namespace_or_type_name' everywhere
15280             where we expect either a "member name" (GetEnumerator) or a
15281             "member name" with an explicit interface name
15282             (IEnumerable.GetEnumerator).
15283             In GMCS, the explicit interface name may include type arguments
15284             (IEnumerable<T>.GetEnumerator).
15285           * we use `member_name' instead of just `IDENTIFIER' for
15286             "member names":
15287             The rule is that we use `member_name' wherever a member may
15288             have type parameters in GMCS.       
15290         * decl.cs (MemberName): New public class.
15291         (MemberCore.MemberName): New public readonly field.
15292         (MemberCore.ctor): Take a `MemberName' argument, not a string.
15293         (DeclSpace): Likewise.
15295         * delegate.cs (Delegate.ctor): Take a MemberName, not a string.
15296         * enum.cs (Enum.ctor): Likewise.
15298         * namespace.cs (AliasEntry.Alias): Changed type from Expression to
15299         MemberName.     
15300         (AliasEntry.ctor): Take a MemberName, not an Expression.
15301         (AliasEntry.UsingAlias): Likewise.
15303         * class.cs (TypeContainer.ctor): Take a MemberName, not a string.
15304         (IMethodData.MemberName): Changed type from string to MemberName.
15305         (MemberBase.ExplicitInterfaceName): Likewise.
15306         (AbstractPropertyEventMethod.SetupName): Make this private.
15307         (AbstractPropertyEventMethod.ctor): Added `string prefix'
15308         argument; compute the member name here.
15309         (AbstractPropertyEventMethod.UpdateName): Recompute the name based
15310         on the `member.MemberName' and the `prefix'.
15312         * cs-parser.jay (attribute_name): Use `namespace_or_type_name',
15313         not `type_name'.
15314         (struct_declaration): Use `member_name' instead of `IDENTIFIER';
15315         thus, we get a `MemberName' instead of a `string'.  These
15316         declarations may have type parameters in GMCS.
15317         (interface_method_declaration, delegate_declaration): Likewise.
15318         (class_declaration, interface_declaration): Likewise.
15319         (method_header): Use `namespace_or_type_name' instead of
15320         `member_name'.  We may be an explicit interface implementation.
15321         (property_declaration, event_declaration): Likewise.
15322         (member_name): This is now just an `IDENTIFIER', not a
15323         `namespace_or_type_name'.
15324         (type_name, interface_type): Removed.
15325         (namespace_or_type_name): Return a MemberName, not an Expression.
15326         (primary_expression): Use `member_name' instead of `IDENTIFIER';
15327         call GetTypeExpression() on the MemberName to get an expression.
15328         (IndexerDeclaration.interface_type): Changed type from string to
15329         MemberName.
15330         (MakeName): Operate on MemberName's instead of string's.
15332 2004-09-13  Raja R Harinath  <rharinath@novell.com>
15334         Fix bug #55770.
15335         * namespace.cs (AliasEntry.Resolve): Implement section 16.3.1.
15336         (NamespaceEntry.Lookup): Add new argument to flag if we want the
15337         lookup to avoid symbols introduced by 'using'.
15338         * rootcontext.cs (NamespaceLookup): Update.
15340 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
15342         * class.cs (TypeContainer.DoDefineMembers): Do not call
15343         DefineDefaultConstructor for static classes.
15345 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
15347         * attribute.cs (Attribute.Resolve): Add error 653 report.
15349         * class.cs (Class.ApplyAttributeBuilder): Add error 641
15350         report.
15351         (Method.ApplyAttributeBuilder): Add error 685 report.
15352         (Operator.Define): Add error 564 report.
15354         * cs-tokenizer.cs (handle_hex): Add error 1013 report.
15356         * expression.cs (Invocation.DoResolve): Add error
15357         245 and 250 report.
15359         * parameter.cs (Parameter.ApplyAttributeBuilder): Add
15360         error 674 report.
15362 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
15364         * class.cs (ConstructorInitializer.Resolve):
15365         Wrong error number (515->516).
15367 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
15369         * class.cs (Indexer.Define): Add error 631 report.
15371 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
15373         * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
15375 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
15377         * expression.cs (Probe.DoResolve): Add error CS0241 report.
15379 2004-09-10  Marek Safar  <marek.safar@seznam.cz>
15381         * cs-parser.jay: Added error CS0241 report.
15383 2004-09-10  Raja R Harinath  <rharinath@novell.com>
15385         * cs-parser.jay (fixed_statement): Introduce a scope for the
15386         declaration in the 'fixed' statement.
15388 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
15390         * cs-parser.jay: Added CS0230 error report.
15392 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
15394         * cs-parser.jay: Added errors CS0231 and CS0257 report.
15396 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
15398         * expression.cs (Argument.Resolve): Added error CS0192 and
15399         CS0199 report.
15401 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
15403         C# 2.0 #pragma warning feature
15405         * cs-tokenizer.cs (PreProcessPragma): New method; 
15406         Handles #pragma directive.
15408         * report.cs (WarningRegions): New class; Support
15409         class for #pragma warning directive. It tests whether
15410         warning is enabled for a given line.
15412 2004-09-08  Miguel de Icaza  <miguel@ximian.com>
15414         * const.cs: Add more descriptive error report, tahnks to
15415         Sebastien. 
15417 2004-09-08  Marek Safar  <marek.safar@seznam.cz>
15419         * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
15421 2004-09-07  Miguel de Icaza  <miguel@ximian.com>
15423         * expression.cs: Apply patch from Ben: Remove dead code from
15424         ArrayCreation, and remove the TurnintoConstant call in const.cs,
15425         as that code just threw an exception anwyays.
15427         * const.cs: Remove the call to the turnintoconstant, for details
15428         see bug: #63144
15429         
15430         * literal.cs: The type of the null-literal is the null type;  So
15431         we use a placeholder type (literal.cs:System.Null, defined here)
15432         for it.
15434         * expression.cs (Conditional.DoResolve): Remove some old code that
15435         is no longer needed, conversions have been fixed.
15437         (ArrayCreationExpression.DoResolve): Return false if we fail to
15438         resolve the inner expression.
15440 2004-09-07  Raja R Harinath  <rharinath@novell.com>
15442         Fix test-290.cs.
15443         * cs-parser.jay (delegate_declaration): Record a delegate
15444         declaration as a type declaration.
15445         Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
15447 2004-09-06  Miguel de Icaza  <miguel@ximian.com>
15449         * parameter.cs: Do not crash if the type can not be resolved. 
15451         * expression.cs: Report errors with unsafe pointers, fixes #64896
15453 2004-09-06 Ben Maurer  <bmaurer@users.sourceforge.net>
15455         * expression.cs: Pointer arith always needs to do a conv.i
15456         if the operand is a long. fix 65320
15458 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
15460         Fixed cs0619-37.cs, cs0619-38.cs
15462         * enum.cs (GetObsoleteAttribute): Removed.
15464         * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
15465         on Enum member is double staged. The first is tested member
15466         and then enum.
15468 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
15470         Fixed #56986, #63631, #65231
15472         * class.cs: (TypeContainer.AddToMemberContainer): New method,
15473         adds member to name container.
15474         (TypeContainer.AddToTypeContainer): New method, adds type to
15475         name container.
15476         (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
15477         AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
15478         AddOperator): Simplified by reusing AddToMemberContainer.
15479         (TypeContainer.UserDefinedStaticConstructor): Changed to property
15480         instead of field.
15481         (Method.CheckForDuplications): Fixed implementation to test all
15482         possibilities.
15483         (MemberBase): Detection whether member is explicit interface
15484         implementation is now in constructor.
15485         (MemberBase.UpdateMemberName): Handles IndexerName.
15486         (Accessor): Changed to keep also location information.
15487         (AbstractPropertyEventMethod): Is derived from MemberCore.
15488         (AbstractPropertyEventMethod.IsDummy): Says whether accessor
15489         will be emited or not.
15490         (PropertyBase.AreAccessorsDuplicateImplementation):
15491         Tests whether accessors are not in collision with some method.
15492         (Operator): Is derived from MethodCore to simplify common
15493         operations.
15495         * decl.cs (Flags.TestMethodDuplication): Test for duplication
15496         must be performed.
15497         (DeclSpace.AddToContainer): Adds the member to defined_names
15498         table. It tests for duplications and enclosing name conflicts.
15500         * enum.cs (EnumMember): Clean up to reuse the base structures
15502 2004-09-03  Martin Baulig  <martin@ximian.com>
15504         * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
15505         into TypeContainer, to make partial classes work again.
15507 2004-09-03  Martin Baulig  <martin@ximian.com>
15509         * rootcontext.cs (RootContext.V2): Removed.
15511 2004-03-23  Martin Baulig  <martin@ximian.com>
15513         * expression.cs (Invocation.OverloadResolve): Added `bool
15514         may_fail' argument and use it instead of the Location.IsNull() hack.
15516 2004-09-03  Martin Baulig  <martin@ximian.com>
15518         Merged latest changes into gmcs.  Please keep this comment in
15519         here, it makes it easier for me to see what changed in MCS since
15520         the last time I merged.
15522 2004-09-03  Raja R Harinath  <rharinath@novell.com>
15524         Fix #61128.
15525         * expression.cs (BetterConversion): Don't allow either conversion 
15526         to be null.  Remove redundant implicit conversion test when 'q ==
15527         null' -- when this function is invoked, we already know that the
15528         implicit conversion exists.
15529         (BetterFunction): Assume that 'best' is non-null.  Remove
15530         redundant reimplementation of IsApplicable when 'best' is null.
15531         (IsParamsMethodApplicable, IsApplicable): Add new parameter for
15532         number of arguments.
15533         (IsAncestralType): Extract from OverloadResolve.
15534         (OverloadResolve): Make robust to the MethodGroupExpr being
15535         unsorted.  Implement all the logic of Section 14.5.5.1, and
15536         support overloading of methods from multiple applicable types.
15537         Clean up logic somewhat.  Don't pass null methods to BetterFunction.
15539         * report.cs (SymbolRelatedToPreviousError): Cleanup output.
15540         (RealError, Warning): Append type of report to related symbol.
15542 2004-09-03  Marek Safar  <marek.safar@seznam.cz>
15544         * enum.cs: Fixed CLS-Compliance checks for enum members.
15545         Error tests cs3008-8.cs, cs3014-8.cs
15547 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
15549         Fixed bug #62342, #63102
15550         * class.cs: ImplementIndexer uses member.IsExplicitImpl
15551         like ImplementMethod.
15553 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
15555         * attribute.cs (Attribute.GetAttributeArgumentExpression):
15556         Fixed bug #65170.
15558 2004-09-02  Martin Baulig  <martin@ximian.com>
15560         * statement.cs (Using.EmitLocalVariableDeclFinally): Use
15561         TypeManager.GetArgumentTypes() rather than calling GetParameters()
15562         on the MethodBase.
15564 2004-09-01  Marek Safar  <marek.safar@seznam.cz>
15566         C# 2.0 Static classes implemented
15568         * class.cs (TypeContainer): instance_constructors,
15569         initialized_fields, initialized_static_fields,
15570         default_constructor, base_inteface_types are protected to be
15571         accessible from StaticClass.
15572         (TypeContainer.DefineDefaultConstructor): New virtual method
15573         for custom default constructor generating
15574         (StaticClass): New class to handle "Static classes" feature.
15576         * cs-parser.jay: Handle static keyword on class like instance
15577         of StaticClass.
15579         * driver.cs: Added "/langversion" command line switch with two
15580         options (iso-1, default).
15582 2004-08-31  Marek Safar  <marek.safar@seznam.cz>
15584         * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
15586 2004-08-31  Miguel de Icaza  <miguel@ximian.com>
15588         * delegate.cs: Style.
15590 2004-08-31 Ben Maurer  <bmaurer@users.sourceforge.net>
15592         * delegate.cs: Add seperate instance expr field for miguel.
15594 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
15596         * PointerArithmetic (Resolve): make sure we are not doing
15597         pointer arith on void*. Also, make sure we are resolved
15598         by not setting eclass until resolve.
15600         All callers: Make sure that PointerArithmetic gets resolved.
15602 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
15604         * ArrayCreation (LookupType): If the type does not resolve 
15605         to an array, give an error.
15607 2004-08-27  Marek Safar  <marek.safar@seznam.cz>
15609         * statement.cs (Try.Resolve): Fixed bug #64222
15611 2004-08-27  Martin Baulig  <martin@ximian.com>
15613         * class.cs
15614         (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
15615         crash here.     
15617 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
15619         * ecore.cs (Constantify): Get underlying type via
15620         System.Enum.GetUnderlyingType to avoid StackOverflow on the
15621         Windows in special cases.
15623 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
15625         * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
15626         for obtaining also private methods.
15627         (GetRemoveMethod): Used GetRemoveMethod (true)
15628         for obtaining also private methods.
15630 2004-08-24  Martin Baulig  <martin@ximian.com>
15632         * class.cs (Method.Define): Set MethodAttributes.SpecialName and
15633         MethodAttributes.HideBySig for operators.
15635 2004-08-23  Martin Baulig  <martin@ximian.com>
15637         Back to the old error reporting system :-)
15639         * report.cs (Message): Removed.
15640         (Report.MessageData, ErrorData, WarningData): Removed.
15641         (Report.Error, Warning): Back to the old system.
15643 2004-08-23  Martin Baulig  <martin@ximian.com>
15645         * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
15647         * class.cs (TypeContainer.ParentContainer): New public virtual
15648         method; replaces the explicit interface implementation.
15649         (ClassPart.ParentContainer): Override.
15651 2004-08-23  Martin Baulig  <martin@ximian.com>
15653         * statement.cs (Switch): Added support for constant switches; see
15654         #59428 or test-285.cs.
15656 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
15658         Fixed bug #62740.
15659         * statement.cs (GetEnumeratorFilter): Removed useless
15660         logic because C# specs is strict. GetEnumerator must be
15661         public.
15663 2004-08-22  Martin Baulig  <martin@ximian.com>
15665         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
15666         a switch and may break, reset the barrier.  Fixes #59867.
15668 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
15670         CLS-Compliance speed up (~5% for corlib)
15672         * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
15673         New method. Tests container for CLS-Compliant names
15675         * class.cs (TypeContainer.VerifyClsName): New method.
15676         Checks whether container name is CLS Compliant.
15677         (Constructor): Implements IMethodData.
15679         * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
15680         low-case table for CLS Compliance test.
15681         (MemberCache.VerifyClsParameterConflict): New method.
15682         Checks method parameters for CS3006 error.
15684         * enum.cs (EnumMember): Is derived from MemberCore.
15685         (Enum.VerifyClsName): Optimized for better performance.
15687 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
15689         * report.cs: Renamed Error_T to Error and changed all
15690         references.
15692 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
15694         * class.cs (TypeContainer.IndexerArrayList): New inner class
15695         container for indexers.
15696         (TypeContainer.DefaultIndexerName): New constant for default
15697         indexer name. Replaced all "Item" with this constant.
15698         (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
15700         * typemanager.cs (TypeManager.default_member_ctor): Cache here
15701         DefaultMemberAttribute constructor.
15703 2004-08-05  Martin Baulig  <martin@ximian.com>
15705         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
15706         Fix bug #59429.
15708 2004-08-05  Marek Safar  <marek.safar@seznam.cz>
15710         * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
15711         multi platforms problem.
15713         * compiler.csproj: Included shared files.
15715 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
15717         Fix bug 60333, 55971 in the more general way
15718         * attribute.cs (Attribute.GetAttributeArgumentExpression):
15719         Added arg_type argument for constant conversion.
15720         (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
15722 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
15724         Fix bug #59760
15725         * class.cs (TypeContainer ): New inner classes MethodArrayList, 
15726         OperatorArrayList, MethodCoreArrayList for typecontainer
15727         containers. Changed class member types to these new types.
15728         (MethodArrayList.DefineMembers): Added test for CS0659.
15730 2004-08-04  Miguel de Icaza  <miguel@ximian.com>
15732         * cfold.cs: Synchronize the folding with the code in expression.cs
15733         Binary.DoNumericPromotions for uint operands.
15735         * attribute.cs: Revert patch from Raja, it introduced a regression
15736         while building Blam-1.2.1 (hard to isolate a test case).
15738 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
15740         Fix for #55382
15741         * class.cs:
15742         (TypeContainer.Define): Renamed to DefineContainerMembers because of
15743         name collision.
15744         (MethodCore.parent_method): New member. The method we're overriding
15745         if this is an override method.
15746         (MethodCore.CheckBase): Moved from Method class and made common.
15747         (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
15748         private.
15749         (MethodCore.CheckForDuplications): New abstract method. For custom
15750         member duplication search in a container
15751         (MethodCore.FindOutParentMethod): New abstract method. Gets parent
15752         method and its return type.
15753         (Event.conflict_symbol): New member. Symbol with same name in the
15754         parent class.
15756         * decl.cs:
15757         (MemberCache.FindMemberWithSameName): New method. The method
15758         is looking for conflict with inherited symbols.
15760 2004-08-04  Martin Baulig  <martin@ximian.com>
15762         * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
15764         * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
15766 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
15768         * report.cs (Message): New enum for better error, warning reference in
15769         the code.
15770         (MessageData): New inner abstract class. It generally handles printing of
15771         error and warning messages.
15772         Removed unused Error, Warning, Message methods.
15774 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
15776         Fix for cs0592-8.cs test
15777         * attribute.cs
15778         (Attributable.ValidAttributeTargets): Made public.
15779         (Attribute.ExplicitTarget): New member for explicit target value.
15780         (Attribute.CheckTargets): Now we translate explicit attribute
15781         target to Target here.
15783 2004-08-03  Ben Maurer  <bmaurer@ximian.com>
15785         * ecore.cs (MethodGroupExpr): new IsBase property.
15787         * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
15789         * delegate.cs (DelegateCreation): store a MethodGroupExpr
15790         rather than an instance expr.
15792         (DelegateCreation.Emit): Use the method group rather than
15793         the instance expression. Also, if you have base.Foo as the
15794         method for a delegate, make sure to emit ldftn, not ldftnvirt.
15796         (ResolveMethodGroupExpr): Use the MethodGroupExpr. 
15798         (NewDelegate.DoResolve): Only check for the existance of Invoke
15799         if the method is going to be needed. Use MethodGroupExpr.
15801         (NewDelegate.Emit): Remove, DelegateCreation implements this.   
15803         * expression.cs: For pointer arith., make sure to use
15804         the size of the type, not the size of the pointer to
15805         the type.
15807 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
15809         Fix for #60722
15810         * class.cs (Class): Added error CS0502 test.
15812 2004-08-03  John Luke  <jluke@cfl.rr.com>
15813             Raja R Harinath  <rharinath@novell.com>
15815         Fix for #60997.
15816         * attribute.cs (Attribute.complained_before): New flag.
15817         (Attribute.ResolveType, Attribute.Resolve),
15818         (Attribute.DefinePInvokeMethod): Set it.
15819         (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
15820         
15821 2004-08-03  Martin Baulig  <martin@ximian.com>
15823         * expression.cs (Binary.ResolveOperator): Don't abort if we can't
15824         use a user-defined operator; we still need to do numeric
15825         promotions in case one argument is a builtin type and the other
15826         one has an implicit conversion to that type.  Fixes #62322.
15828 2004-08-02  Martin Baulig  <martin@ximian.com>
15830         * statement.cs (LocalInfo.Flags): Added `IsThis'.
15831         (LocalInfo.IsThis): New public property.
15832         (Block.EmitMeta): Don't create a LocalBuilder for `this'.
15834 2004-08-01  Martin Baulig  <martin@ximian.com>
15836         * class.cs (TypeContainer.GetClassBases): Don't set the default
15837         here since we may get called from GetPartialBases().
15838         (TypeContainer.DefineType): If GetClassBases() didn't return a
15839         parent, use the default one.
15841 2004-07-30  Duncan Mak  <duncan@ximian.com>
15843         * Makefile (mcs2.exe, mcs3.exe): add $(EXTRA_SOURCES).
15845 2004-07-30  Martin Baulig  <martin@ximian.com>
15847         * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
15849         * class.cs (SourceMethod): New public class, derive from the
15850         symbol writer's ISourceMethod.
15851         (Method): Use the new symbol writer API.
15853         * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
15854         as argument and use the new symbol writer.
15856         * location.cs
15857         (SourceFile): Implement the symbol writer's ISourceFile.
15858         (Location.SymbolDocument): Removed.
15859         (Location.SourceFile): New public property.
15861         * symbolwriter.cs: Use the new symbol writer API.
15863 2004-07-30  Raja R Harinath  <rharinath@novell.com>
15865         * Makefile (install-local): Remove.  Functionality moved to
15866         executable.make.
15868 2004-07-28  Lluis Sanchez Gual  <lluis@novell.com>
15870         * Makefile: Install mcs.exe.config file together with mcs.exe.
15871         * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
15872         correct runtime version.
15873         
15874 2004-07-25  Martin Baulig  <martin@ximian.com>
15876         * class.cs
15877         (TypeContainer.RegisterOrder): Removed, this was unused.
15878         (TypeContainer, interface_order): Removed.
15879         (TypeContainer.AddClass, AddStruct, AddInterface): Take a
15880         TypeContainer as argument since we can also be called with a
15881         `PartialContainer' for a partial class/struct/interface.
15882         (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
15883         of checking whether we're an `Interface' - we could be a
15884         `PartialContainer'.
15885         (PartialContainer.Register): Override; call
15886         AddClass()/AddStruct()/AddInterface() on our parent.
15888         * cs-parser.jay (interface_member_declaration): Add things to the
15889         `current_container', not the `current_class'.
15891         * rootcontext.cs (RegisterOrder): The overloaded version which
15892         takes an `Interface' was unused, removed.
15894         * typemanager.cs (TypeManager.LookupInterface): Return a
15895         `TypeContainer', not an `Interface'.
15896         (TypeManager.IsInterfaceType): The `builder_to_declspace' may
15897         contain a `PartialContainer' for an interface, so check it's
15898         `Kind' to figure out what it is.
15900 2004-07-25  Martin Baulig  <martin@ximian.com>
15902         * class.cs (Class.DefaultTypeAttributes): New public constant.
15903         (Struct.DefaultTypeAttributes): Likewise.
15904         (Interface.DefaultTypeAttributes): Likewise.
15905         (PartialContainer.TypeAttr): Override this and add the
15906         DefaultTypeAttributes.
15908 2004-07-25  Martin Baulig  <martin@ximian.com>
15910         * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
15911         we can just use the `Parent' field instead.
15913 2004-07-25  Martin Baulig  <martin@ximian.com>
15915         * class.cs (TypeContainer.Emit): Renamed to EmitType().
15917 2004-07-25  Martin Baulig  <martin@ximian.com>
15919         * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
15920         our parts before defining any methods.
15921         (TypeContainer.VerifyImplements): Make this virtual.
15922         (ClassPart.VerifyImplements): Override and call VerifyImplements()
15923         on our PartialContainer.
15925 2004-07-25  Martin Baulig  <martin@ximian.com>
15927         * iterators.cs (Iterator.Define): Renamed to DefineIterator().
15929         * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
15930         argument, we can just use the `Parent' field instead.
15932         * class.cs
15933         (MemberBase.CheckBase): Removed the `TypeContainer' argument.   
15934         (MemberBase.DoDefine): Likewise.
15936 2004-07-24  Martin Baulig  <martin@ximian.com>
15938         * decl.cs (MemberCore.Parent): New public field.
15939         (DeclSpace.Parent): Moved to MemberCore.
15941         * class.cs (MethodCore.ds): Removed; use `Parent' instead.
15942         (MemberBase.ctor): Added TypeContainer argument, pass it to our
15943         parent's .ctor.
15944         (FieldBase, Field, Operator): Likewise.
15945         (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
15946         (EventField, Event): Likewise.
15948 2004-07-23  Martin Baulig  <martin@ximian.com>
15950         * class.cs (PartialContainer): New public class.
15951         (ClassPart): New public class.
15952         (TypeContainer): Added support for partial classes.
15953         (TypeContainer.GetClassBases): Splitted some of the functionality
15954         out into GetNormalBases() and GetPartialBases().
15956         * cs-tokenizer.cs (Token.PARTIAL): New token.
15957         (Tokenizer.consume_identifier): Added some hacks to recognize
15958         `partial', but only if it's immediately followed by `class',
15959         `struct' or `interface'.
15961         * cs-parser.jay: Added support for partial clases.
15963 2004-07-23  Martin Baulig  <martin@ximian.com>
15965         * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
15966         a `DeclSpace' and also made it readonly.
15967         (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
15968         (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
15969         (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
15971         * cs-parser.jay: Pass the `current_class', not the
15972         `current_container' (at the moment, this is still the same thing)
15973         to a new Method, Property, Event, Indexer or Constructor.
15975 2004-07-23  Martin Baulig  <martin@ximian.com>
15977         * cs-parser.jay (CSharpParser): Added a new `current_class' field
15978         and removed the `current_interface' one.
15979         (struct_declaration, class_declaration, interface_declaration):
15980         Set `current_class' to the newly created class/struct/interface;
15981         set their `Bases' and call Register() before parsing their body.
15983 2004-07-23  Martin Baulig  <martin@ximian.com>
15985         * class.cs (Kind): New public enum.
15986         (TypeContainer): Made this class abstract.
15987         (TypeContainer.Kind): New public readonly field.
15988         (TypeContainer.CheckDef): New public method; moved here from
15989         cs-parser.jay.
15990         (TypeContainer.Register): New public abstract method.
15991         (TypeContainer.GetPendingImplementations): New public abstract
15992         method.
15993         (TypeContainer.GetClassBases): Removed the `is_class' and
15994         `is_iface' parameters.
15995         (TypeContainer.DefineNestedTypes): Formerly known as
15996         DoDefineType().
15997         (ClassOrStruct): Made this class abstract.
15999         * tree.cs (RootTypes): New public type. 
16001 2004-07-20  Martin Baulig  <martin@ximian.com>
16003         * tree.cs (Tree.RecordNamespace): Removed.
16004         (Tree.Namespaces): Removed.
16006         * rootcontext.cs (RootContext.IsNamespace): Removed.
16008         * cs-parser.jay (namespace_declaration): Just create a new
16009         NamespaceEntry here.
16011 2004-07-20  Martin Baulig  <martin@ximian.com>
16013         * statement.cs (ExceptionStatement): New abstract class.  This is
16014         now used as a base class for everyone who's using `finally'.
16015         (Using.ResolveLocalVariableDecls): Actually ResolveLValue() all
16016         our local variables before using them.
16018         * flowanalysis.cs (FlowBranching.StealFinallyClauses): New public
16019         virtual method.  This is used by Yield.Resolve() to "steal" an
16020         outer block's `finally' clauses.
16021         (FlowBranchingException): The .ctor now takes an ExceptionStatement
16022         argument.
16024         * codegen.cs (EmitContext.StartFlowBranching): Added overloaded
16025         version which takes an ExceptionStatement.  This version must be
16026         used to create exception branchings.
16028         * iterator.cs
16029         (Yield.Resolve): "Steal" all `finally' clauses from containing blocks.
16030         (Iterator.EmitMoveNext): Added exception support; protect the
16031         block with a `fault' clause, properly handle 'finally' clauses.
16032         (Iterator.EmitDispose): Run all the `finally' clauses here.
16034 2004-07-20  Martin Baulig  <martin@ximian.com>
16036         * iterator.cs: This is the first of a set of changes in the
16037         iterator code.  Match the spec more closely: if we're an
16038         IEnumerable, then GetEnumerator() must be called.  The first time
16039         GetEnumerator() is called, it returns the current instance; all
16040         subsequent invocations (if any) must create a copy.
16042 2004-07-19  Miguel de Icaza  <miguel@ximian.com>
16044         * expression.cs: Resolve the constant expression before returning
16045         it. 
16047 2004-07-19  Martin Baulig  <martin@ximian.com>
16049         * iterators.cs (Iterator.MapVariable): Don't define fields twice.
16050         (Iterator.MoveNextMethod.DoEmit): Use `TypeManager.int32_type' as
16051         the return type of the new EmitContext.
16053 2004-07-18  Martin Baulig  <martin@ximian.com>
16055         * class.cs (Property.Define): Fix iterators.
16057         * iterators.cs (Iterator.Define): Moved the
16058         `container.AddInterator (this)' call here from the .ctor; only do
16059         it if we resolved successfully.
16061 2004-07-17  Miguel de Icaza  <miguel@ximian.com>
16063         * cs-tokenizer.cs (handle_preprocessing_directive): Do not return
16064         `true' for preprocessing directives that we parse.  The return
16065         value indicates whether we should return to regular tokenizing or
16066         not, not whether it was parsed successfully.
16068         In the past if we were in: #if false ... #line #endif, we would
16069         resume parsing after `#line'.  See bug 61604.
16071         * typemanager.cs: Removed an old hack from Gonzalo to get corlib
16072         building: IsEnumType should return true only for enums, not for
16073         enums or System.Enum itself.  This fixes #61593.
16075         Likely what happened is that corlib was wrong: mcs depended on
16076         this bug in some places.  The bug got fixed, we had to add the
16077         hack, which caused bug 61593.
16079         * expression.cs (ArrayAccess.GetStoreOpCode): Remove an old hack
16080         that was a workaround for the older conditions.
16082 2004-07-16  Ben Maurer  <bmaurer@ximian.com>
16084         * assign.cs: IAssignMethod has a new interface, as documented
16085         inline. All assignment code now uses this new api.
16087         * ecore.cs, expression.cs: All classes which implement
16088         IAssignMethod now use the new interface.
16090         * expression.cs (Invocation): add a hack to EmitCall so that
16091         IndexerAccess can be the target of a compound assignment without
16092         evaluating its arguments twice.
16094         * statement.cs: Handle changes in Invocation api.
16096 2004-07-16  Martin Baulig  <martin@ximian.com>
16098         * iterators.cs: Rewrote this.  We're now using one single Proxy
16099         class for both the IEnumerable and the IEnumerator interface and
16100         `Iterator' derives from Class so we can use the high-level API.
16102         * class.cs (TypeContainer.AddIterator): New method.
16103         (TypeContainer.DoDefineType): New protected virtual method, which
16104         is called from DefineType().
16105         (TypeContainer.DoDefineMembers): Call DefineType() and
16106         DefineMembers() on all our iterators.
16107         (TypeContainer.Emit): Call Emit() on all our iterators.
16108         (TypeContainer.CloseType): Call CloseType() on all our iterators.
16110         * codegen.cs (EmitContext.CurrentIterator): New public field.
16112 2004-07-15  Martin Baulig  <martin@ximian.com>
16114         * typemanager.cs
16115         (TypeManager.not_supported_exception_type): New type.   
16117 2004-07-14  Martin Baulig  <martin@ximian.com>
16119         * iterators.cs: Use real error numbers.
16121 2004-07-14  Martin Baulig  <martin@ximian.com>
16123         * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
16124         requires this to be a System.Collection.IEnumerable and not a
16125         class implementing that interface.
16126         (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.      
16128 2004-07-13  Marek Safar  <marek.safar@seznam.cz>
16130         * class.cs: Fixed previous fix, it broke some error tests.
16132 2004-07-12  Martin Baulig  <martin@ximian.com>
16134         * enum.cs (Enum.Define): Call Emit() to emit the attributes.
16135         Fixes #61293.
16137 2004-07-09  Miguel de Icaza  <miguel@ximian.com>
16139         * assign.cs (LocalTemporary): Add new argument: is_address,If
16140         `is_address' is true, then the value that we store is the address
16141         to the real value, and not the value itself.
16142         
16143         * ecore.cs (PropertyExpr): use the new local temporary
16144         stuff to allow us to handle X.Y += z (where X is a struct)
16146 2004-07-08  Martin Baulig  <martin@ximian.com>
16148         * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
16149         not always return, just like we're doing in Using.Resolve().
16151 2004-07-07  Miguel de Icaza  <miguel@ximian.com>
16153         * cs-parser.jay (fixed_statement): flag this as Pinned.
16155 2004-07-06  Miguel de Icaza  <miguel@ximian.com>
16157         * typemanager.cs (TypeManager): Removed MakePinned method, this
16158         mechanism is replaced with the .NET 2.x compatible mechanism of
16159         calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
16161         * statement.cs (LocalInfo): Remove MakePinned, add Pinned property 
16162         Rename `Fixed' to `Pinned' as a flag, to distinguish from the
16163         `IsFixed' property which has a different meaning.
16165 2004-07-02  Raja R Harinath  <rharinath@novell.com>
16167         * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
16168         visible from inside a nested class, not just the names of the
16169         immediately enclosing class.
16170         Fix for bug #60730.
16172 2004-06-24  Raja R Harinath  <rharinath@novell.com>
16174         * expression.cs (BetterConversion): Remove buggy special-case
16175         handling of "implicit constant expression conversions".  At this
16176         point, we already know that the conversion is possible -- we're
16177         only checking to see which is better.
16179 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
16181         * cs-parser.jay: Added error CS0210 test.
16183 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
16185         * cs-parser.jay: Added error CS0134 test.
16187 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
16189         Fix bug #52507
16190         * cs-parser.jay: Added error CS0145 test.
16192 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
16194         * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
16196 2004-06-23  Ben Maurer  <bmaurer@ximian.com>
16197         
16198         * expression.cs (StackAlloc.Resolve): The argument may not
16199         be a constant; deal with this case.
16200         
16201 2004-06-23  Marek Safar  <marek.safar@seznam.cz>
16203         * attribute.cs (IndexerName_GetIndexerName): Renamed to
16204         GetIndexerAttributeValue.
16205         (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
16207         * class.cs (Indexer.Define): Added error tests for CS0415,
16208         CS0609.
16210 2004-06-23  Miguel de Icaza  <miguel@ximian.com>
16212         * attribute.cs (Attribute.Resolve): Keep field code in sync with
16213         property code.
16215 2004-06-23  Martin Baulig  <martin@ximian.com>
16217         * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
16218         neither return nor throw, reset the barrier as well.  Fixes #60457.
16220 2004-06-22  Atsushi Enomoto  <atsushi@ximian.com>
16222         * class.cs : EventAttributes is now set to None by default.
16223           This fixes bug #60459.
16225 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
16227         Fix bug #60219
16228         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
16229         Don't throw exception but return null (it's sufficient now).
16231 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
16233         * typemanager.cs (GetArgumentTypes): Faster implementation.
16235 2004-06-18  Martin Baulig  <martin@ximian.com>
16237         * attribute.cs (Attribute.Resolve): Check whether we're an
16238         EmptyCast which a Constant child.  Fixes #60333.
16240 2004-06-17  Ben Maurer  <bmaurer@ximian.com>
16242         * statement.cs (EmitCollectionForeach): Account for the fact that
16243         not all valuetypes are in areas which we can take the address of.
16244         For these variables, we store to a temporary variable. Also, make
16245         sure that we dont emit a `callvirt' on a valuetype method.
16247 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
16249         * expression.cs (StackAlloc.DoReSolve): Added test for
16250         negative parameter (CS0247).
16252 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
16254         Fix bug #59792
16255         * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
16257 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
16259         Fix bug #59781
16260         * expression.cs: (Binary.DoNumericPromotions): Added conversion for
16261         ulong.
16263 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
16265         Fix bug #58254 & cs1555.cs, cs1556.cs
16266         * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
16268 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
16270         * cs-parser.jay: Added error CS1669 test for indexers.
16272 2004-06-11  Martin Baulig  <martin@ximian.com>
16274         * expression.cs (Invocation.IsParamsMethodApplicable): We need to
16275         call this twice: for params and varargs methods.
16277 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
16279         * class.cs:
16280         (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
16282 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
16284         * attribute.cs (Attribute.GetValidTargets): Made public.
16286         * class.cs: 
16287         (AbstractPropertyEventMethod): New class for better code sharing.
16288         (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
16289         CS1667 report.
16290         (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
16292 2004-06-11  Raja R Harinath  <rharinath@novell.com>
16294         Fix bug #59477.
16295         * ecore.cs (ResolveFlags): Add new 'Intermediate' flag to tell
16296         that the call to Resolve is part of a MemberAccess.
16297         (Expression.Resolve): Use it for SimpleName resolution.
16298         (SimpleName.SimpleNameResolve, SimpleName.DoResolveAllowStatic):
16299         Add 'intermediate' boolean argument.
16300         (SimpleName.DoSimpleNameResolve): Likewise.  Use it to disable an
16301         error message when the SimpleName can be resolved ambiguously
16302         between an expression and a type.
16303         * expression.cs (MemberAccess.IdenticalNameAndTypeName): Make
16304         public.
16305         (MemberAccess.Resolve): Pass 'Intermediate' flag to the Resolve()
16306         call on the left-side.
16308 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
16310         * class.cs:
16311         (MethodCore.VerifyClsCompliance): Added test for error CS3000.
16313 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
16315         * attribute.cs (Attribute.Emit): Fixed error CS0579 reporting.
16317 2004-06-11  Martin Baulig  <martin@ximian.com>
16319         * expression.cs (Invocation.EmitCall): Use OpCodes.Callvirt for
16320         varargs methods if applicable.
16322 2004-06-11  Martin Baulig  <martin@ximian.com>
16324         * expression.cs (Invocation.EmitCall): Don't use
16325         `method.CallingConvention == CallingConventions.VarArgs' since the
16326         method could also have `CallingConventions.HasThis'.
16328 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
16330         * class.cs (Event.GetSignatureForError): Implemented.
16331         Fixed crash in error test cs3010.cs
16333 2004-06-10  Miguel de Icaza  <miguel@ximian.com>
16335         * cs-tokenizer.cs: Change the way we track __arglist to be
16336         consistent with the other keywords.
16338 2004-06-09  Miguel de Icaza  <miguel@ximian.com>
16340         * codegen.cs: FAQ avoider: turn 1577 into a warning for now until
16341         tomorrow.
16343 2004-06-09  Sebastien Pouliot  <sebastien@ximian.com>
16345         * codegen.cs: Check that all referenced assemblies have a strongname
16346         before strongnaming the compiled assembly. If not report error CS1577.
16347         Fix bug #56563. Patch by Jackson Harper.
16348         * typemanager.cs: Added a method to return all referenced assemblies.
16349         Fix bug #56563. Patch by Jackson Harper.
16351 2004-06-08  Marek Safar  <marek.safar@seznam.cz>
16353         * class.cs:
16354         (Method.ApplyAttributeBuilder): Moved and added conditional
16355         attribute error tests (CS0577, CS0578, CS0243, CS0582, CS0629).
16357         * delegate.cs:
16358         (DelegateCreation.ResolveMethodGroupExpr): Added error CS1618 test.
16360 2004-06-08  Marek Safar  <marek.safar@seznam.cz>
16362         Fixed #59640
16363         * class.cs: (EventField.attribute_targets): Changed default target.
16365 2004-06-08  Martin Baulig  <martin@ximian.com>
16367         * expression.cs (Invocation.EmitCall): Enable varargs methods.
16369 2004-06-08  Martin Baulig  <martin@ximian.com>
16371         * rootcontext.cs (ResolveCore): Added "System.RuntimeArgumentHandle".
16373 2004-06-07  Martin Baulig  <martin@ximian.com>
16375         Added support for varargs methods.
16377         * cs-tokenizer.cs (Token.ARGLIST): New token for the `__arglist'
16378         keyword.
16380         * cs-parser.jay: Added support for `__arglist'.
16382         * decl.cs (MemberCache.AddMethods): Don't ignore varargs methods.
16384         * expression.cs (Argument.AType): Added `ArgList'.
16385         (Invocation): Added support for varargs methods.
16386         (ArglistAccess): New public class.
16387         (Arglist): New public class.
16389         * parameter.cs (Parameter.Modifier): Added `ARGLIST'.
16391         * statement.cs (Block.Flags): Added `HasVarargs'.  We set this on
16392         a method's top-level block if the method has varargs.
16394         * support.cs (ReflectionParameters, InternalParameters): Added
16395         support for varargs methods.    
16397 2004-06-07  Miguel de Icaza  <miguel@ximian.com>
16399         * class.cs: Provide location in indexer error report.
16401         * driver.cs: Use standard names.
16403         * namespace.cs: Catch the use of using after a namespace has been
16404         declared also on using aliases.
16406 2004-06-03  Raja R Harinath  <rharinath@novell.com>
16408         Bug #50820.
16409         * typemanager.cs (closure_private_ok, closure_invocation_type)
16410         (closure_qualifier_type, closure_invocation_assembly)
16411         (FilterWithClosure): Move to ...
16412         (Closure): New internal nested class.
16413         (Closure.CheckValidFamilyAccess): Split out from Closure.Filter.
16414         (MemberLookup, RealMemberLookup): Add new almost_match parameter.
16415         * ecore.cs (almostMatchedMembers): New variable to help report CS1540.
16416         (MemberLookup, MemberLookupFailed): Use it.
16417         * expression.cs (New.DoResolve): Treat the lookup for the
16418         constructor as being qualified by the 'new'ed type.
16419         (Indexers.GetIndexersForTypeOrInterface): Update.
16421 2004-06-03  Marek Safar  <marek.safar@seznam.cz>
16423         * attribute.cs
16424         (GetConditionalAttributeValue): New method. Returns
16425         condition of ConditionalAttribute.
16426         (SearchMulti): New method.  Returns all attributes of type 't'.
16427         Use it when attribute is AllowMultiple = true.
16428         (IsConditionalMethodExcluded): New method.
16430         * class.cs
16431         (Method.IsExcluded): Implemented. Returns true if method has conditional
16432         attribute and the conditions is not defined (method is excluded).
16433         (IMethodData): Extended interface for ConditionalAttribute support.
16434         (PropertyMethod.IsExcluded): Implemented.
16436         * decl.cs
16437         (MemberCore.Flags): Excluded_Undetected, Excluded new caching flags.
16439         * expression.cs
16440         (Invocation.IsMethodExcluded): Checks the ConditionalAttribute
16441         on the method.
16443 2004-06-02 Ben Maurer  <bmaurer@users.sourceforge.net>
16445         * expression.cs (ArrayCreationExpression): Make this just an
16446         `expression'. It can't be a statement, so the code here was
16447         dead.
16449 2004-06-02  Marek Safar  <marek.safar@seznam.cz>
16451         Fixed #59072
16452         * typemanager.cs (GetFullNameSignature): New method for
16453         MethodBase types.
16455 2004-06-02  Marek Safar  <marek.safar@seznam.cz>
16457         Fixed #56452
16458         * class.cs (MemberBase.GetSignatureForError): New virtual method.
16459         Use this method when MethodBuilder is null.
16460         (MethodData.DefineMethodBuilder): Encapsulated code to the new method.
16461         Added test for error CS0626 (MONO reports error for this situation).
16462         (IMethodData.GetSignatureForError): Extended interface.
16464 2004-06-01  Marek Safar  <marek.safar@seznam.cz>
16466         * attribute.cs
16467         (AttributeTester.GetObsoleteAttribute): Returns instance of
16468         ObsoleteAttribute when type is obsolete.
16470         * class.cs
16471         (TypeContainer.VerifyObsoleteAttribute): Override.
16472         (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
16473         (MethodCode.VerifyObsoleteAttribute): Override.
16474         (MemberBase.VerifyObsoleteAttribute): Override.
16476         * decl.cs
16477         (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
16478         and report proper error.
16480         *delegate.cs
16481         Delegate.VerifyObsoleteAttribute): Override.
16483         * ecore.cs
16484         (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
16485         and report proper error.
16486         (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
16488         * enum.cs
16489         (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
16490         and enum member.
16492         * expression.cs
16493         (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
16494         New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
16495         Added test for ObsoleteAttribute.
16497         * statement.cs
16498         (Catch): Derived from Statement.
16500 2004-06-01  Marek Safar  <marek.safar@seznam.cz>
16502         Fixed bug #59071 & cs0160.cs
16504         * statement.cs (Try.Resolve): Check here whether order of catch
16505         clauses matches their dependencies.
16507 2004-05-31  Miguel de Icaza  <miguel@ximian.com>
16509         * Reverted patch to namespace.cs (Use lookuptypedirect).  This
16510         caused a regression: #59343.  Referencing nested classes from an
16511         assembly stopped working.
16513 2004-05-31  Martin Baulig  <martin@ximian.com>
16515         MCS is now frozen for beta 2.
16517 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
16519         * convert.cs: add a trivial cache for overload operator resolution.
16521 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
16523         * decl.cs: If possible, use lookuptypedirect here. We can only do
16524         this if there is no `.' after the namespace. Avoids using
16525         LookupType, which does lots of slow processing.
16526         (FindNestedType) New method, does what it says :-).
16527         * namespace.cs: use LookupTypeDirect.
16528         * rootcontext.cs: use membercache, if possible.
16529         * typemanager.cs (LookupTypeDirect): Cache negative hits too.
16531 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
16533         * expression.cs:
16534         According to the spec, 
16536         In a member access of the form E.I, if E is a single identifier,
16537         and if the meaning of E as a simple-name (§7.5.2) is a constant,
16538         field, property, localvariable, or parameter with the same type as
16539         the meaning of E as a type-name (§3.8), then both possible
16540         meanings of E are permitted.
16542         We did not check that E as a simple-name had the same type as E as
16543         a type name.
16545         This trivial check gives us 5-7% on bootstrap time.
16547 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
16549         * expression.cs (Invocation.OverloadResolve): Avoid the
16550         use of hashtables and boxing here by allocating on demand.
16552 2004-05-30  Martin Baulig  <martin@ximian.com>
16554         * rootcontext.cs (RootContext.LookupType): Don't cache things if
16555         we're doing a silent lookup.  Don't try to lookup nested types in
16556         TypeManager.object_type (thanks to Ben Maurer).
16558 2004-05-30  Martin Baulig  <martin@ximian.com>
16560         Committing a patch from Ben Maurer.
16562         * rootcontext.cs (RootContext.LookupType): Cache negative results.
16564 2004-05-29  Martin Baulig  <martin@ximian.com>
16566         * class.cs (IMethodData.ShouldIgnore): New method.
16568         * typemanager.cs (TypeManager.MethodFlags): Don't take a
16569         `Location' argument, we don't need it anywhere.  Use
16570         `IMethodData.ShouldIgnore ()' instead of
16571         `MethodData.GetMethodFlags ()'.
16572         (TypeManager.AddMethod): Removed.
16573         (TypeManager.AddMethod2): Renamed to AddMethod.
16575 2004-05-29  Martin Baulig  <martin@ximian.com>
16577         Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
16579         * convert.cs (Convert.ImplicitReferenceConversion): If we're
16580         converting from a class type S to an interface type and we already
16581         have an object on the stack, don't box it again.  Fixes #52578.
16583 2004-05-29  Martin Baulig  <martin@ximian.com>
16585         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
16586         Added support for `params' parameters.  Fixes #59267.
16588 2004-05-29  Martin Baulig  <martin@ximian.com>
16590         * literal.cs (NullPointer): Provide a private .ctor which sets
16591         `type' to TypeManager.object_type.  Fixes #59048.
16593 2004-05-29  Martin Baulig  <martin@ximian.com>
16595         * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
16596         EventExpr, set `ee.InstanceExpression = left'.  Fixes #59188.
16598         * ecore.cs (EventExpr.instance_expr): Make the field private.
16600 2004-05-26  Marek Safar  <marek.safar@seznam.cz>
16602         Fixed bug #50080 & cs0214-2.cs
16603         * expression.cs (Cast.DoResolve): Check unsafe context here.
16604         
16605         * statement.cs (Resolve.DoResolve): Likewise.
16607 2004-05-26  Martin Baulig  <martin@ximian.com>
16609         * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
16611         * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
16612         (RootContext.LookupType): Pass down the `silent' flag.
16614 2004-05-25  Martin Baulig  <martin@ximian.com>
16616         * expression.cs
16617         (MethodGroupExpr.IdenticalTypeName): New public property.
16618         (Invocation.DoResolve): Don't report a CS0176 if the "instance"
16619         expression actually refers to a type.
16621 2004-05-25  Martin Baulig  <martin@ximian.com>
16623         * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
16624         for #56176 and made it actually work.
16626 2004-05-25  Martin Baulig  <martin@ximian.com>
16628         * ecore.cs (Expression.CacheTemporaries): Make this virtual.
16629         (FieldExpr, PropertyExpr): Override and implement
16630         CacheTemporaries.  Fixes #52279.
16632 2004-05-25  Miguel de Icaza  <miguel@ximian.com>
16634         * location.cs: In the new compiler listing a file twice is a
16635         warning, not an error.
16637 2004-05-24  Martin Baulig  <martin@ximian.com>
16639         * enum.cs (Enum.DefineType): For the `BaseType' to be a
16640         TypeLookupExpression; otherwise, report a CS1008.  Fixes #58571.
16642 2004-05-24  Martin Baulig  <martin@ximian.com>
16644         * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
16645         walking the `using' list.  Fixes #53921.
16647 2004-05-24  Martin Baulig  <martin@ximian.com>
16649         * const.cs (Const.LookupConstantValue): Added support for
16650         EmptyCast's; fixes #55251.
16652 2004-05-24  Martin Baulig  <martin@ximian.com>
16654         * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
16655         DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
16656         which does the CS0135 check.  The reason is that we first need to
16657         check whether the variable actually exists.
16659 2004-05-24  Martin Baulig  <martin@ximian.com>
16661         * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
16662         than RootContext.LookupType() to find the explicit interface
16663         type.  Fixes #58584.
16665 2004-05-24  Raja R Harinath  <rharinath@novell.com>
16667         * Makefile: Simplify.  Use executable.make.
16668         * mcs.exe.sources: New file.  List of sources of mcs.exe.
16670 2004-05-24  Anders Carlsson  <andersca@gnome.org>
16672         * decl.cs:
16673         * enum.cs:
16674         Use the invariant culture when doing String.Compare for CLS case
16675         sensitivity.
16676         
16677 2004-05-23  Martin Baulig  <martin@ximian.com>
16679         * decl.cs (DeclSpace.FindType): Only check the `using' list if we
16680         don't have any dots.  Fixes #52622, added cs0246-8.cs.
16682         * namespace.cs (NamespaceEntry.Lookup): Likewise.
16683         
16684 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
16686         * class.cs (MemberBase.Define): Reuse MemberType member for 
16687         resolved type. Other methods can use it too.
16689 2004-05-23  Martin Baulig  <martin@ximian.com>
16691         * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
16692         the variable also exists in the current block (otherwise, we need
16693         to report a CS0103).  Fixes #58670.
16695 2004-05-23  Martin Baulig  <martin@ximian.com>
16697         * flowanalysis.cs (Reachability.Reachable): Compute this
16698         on-the-fly rather than storing it as a field.
16700 2004-05-23  Martin Baulig  <martin@ximian.com>
16702         * flowanalysis.cs (Reachability.And): Manually compute the
16703         resulting `barrier' from the reachability.      
16704        
16705 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
16707         Fix bug #57835
16708         * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
16709         instance of ObsoleteAttribute when symbol is obsolete.
16711         * class.cs
16712         (IMethodData): Extended interface for ObsoleteAttribute support.
16714 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
16716         * attribute.cs: Fix bug #55970
16718 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
16720         Fix bug #52705
16721         * attribute.cs
16722         (GetObsoleteAttribute): New method. Creates the instance of
16723         ObsoleteAttribute.
16724         (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
16725         ObsoleteAttribute when member is obsolete.
16726         (AttributeTester.Report_ObsoleteMessage): Common method for
16727         Obsolete error/warning reporting.
16729         * class.cs
16730         (TypeContainer.base_classs_type): New member for storing parent type.
16732         * decl.cs
16733         (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
16734         for this MemberCore.
16736 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
16738         * attribute.cs, const.cs: Fix bug #58590
16740 2004-05-21  Martin Baulig  <martin@ximian.com>
16742         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
16743         out parameters if the end of the method is unreachable.  Fixes
16744         #58098. 
16746 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
16748         * codegen.cs, cs-parser.jay: Removed SetAttributes method.
16749         Hari was right, why extra method.
16751 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
16753         * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
16755 2004-05-20  Martin Baulig  <martin@ximian.com>
16757         Merged this back from gmcs to keep the differences to a minumum.
16759         * attribute.cs (Attribute.CheckAttributeType): Take an EmitContext
16760         instead of a Declspace.
16761         (Attribute.ResolveType): Likewise.
16762         (Attributes.Search): Likewise.
16763         (Attributes.Contains): Likewise.
16764         (Attributes.GetClsCompliantAttribute): Likewise.
16766         * class.cs (TypeContainer.VerifyMembers): Added EmitContext
16767         argument.
16768         (MethodData.ApplyAttributes): Take an EmitContext instead of a
16769         DeclSpace.
16771 2004-05-19  Marek Safar  <marek.safar@seznam.cz>
16773         Fix bug #58688 (MCS does not report error when the same attribute
16774         is assigned twice)
16776         * attribute.cs (Attribute.Emit): Distinction between null and default.
16778 2004-05-19  Raja R Harinath  <rharinath@novell.com>
16780         * cs-parser.jay (attribute): Create a GlobalAttribute for the case
16781         of a top-level attribute without an attribute target.
16782         * attribute.cs (Attribute.Error_AttributeConstructorMismatch): 
16783         Make non-static.
16784         (Attribute.Conditional_GetConditionName), 
16785         (Attribute.Obsolete_GetObsoleteMessage): Update.
16786         (Attribute.IndexerName_GetIndexerName): New.  Attribute-specific
16787         part of ScanForIndexerName.
16788         (Attribute.CanIgnoreInvalidAttribute): New function.
16789         (Attribute.ScanForIndexerName): Move to ...
16790         (Attributes.ScanForIndexerName): ... here.
16791         (Attributes.Attrs): Rename from now-misnamed AttributeSections.
16792         (Attributes.Search): New internal variant that can choose not to
16793         complain if types aren't resolved.  The original signature now
16794         complains.
16795         (Attributes.GetClsCompliantAttribute): Use internal variant, with
16796         complaints suppressed.
16797         (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
16798         only if it not useful.
16799         (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
16800         top-level for attributes that are shared between the assembly
16801         and a top-level class.
16802         * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
16803         * class.cs: Update to reflect changes.
16804         (DefineIndexers): Fuse loops.
16805         * codegen.cs (GetAssemblyName): Update to reflect changes.  Accept
16806         a couple more variants of attribute names.
16808 2004-05-18  Marek Safar  <marek.safar@seznam.cz>
16810         Fix bug #52585 (Implemented explicit attribute declaration)
16812         * attribute.cs:
16813         (Attributable.ValidAttributeTargets): New abstract method. It gets
16814         list of valid attribute targets for explicit target declaration.
16815         (Attribute.Target): It holds target itself.
16816         (AttributeSection): Removed.
16817         (Attribute.CheckTargets): New method. It checks whether attribute
16818         target is valid for the current element.
16820         * class.cs:
16821         (EventProperty): New class. For events that are declared like
16822         property (with add and remove accessors).
16823         (EventField): New class. For events that are declared like field.
16824         class.cs
16826         * cs-parser.jay: Implemented explicit attribute target declaration.
16828         * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:        
16829         Override ValidAttributeTargets.
16831         * parameter.cs:
16832         (ReturnParameter): Class for applying custom attributes on 
16833         the return type.
16834         (ParameterAtribute): New class. Class for applying custom
16835         attributes on the parameter type.
16837 2004-05-17  Miguel de Icaza  <miguel@ximian.com>
16839         * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
16840         definitions. 
16842         (Method): Allow UNSAFE here.
16844         * modifiers.cs: Support unsafe reporting.
16846 2004-05-17  Marek Safar  <marek.safar@seznam.cz>
16848         * decl.cs: Fix bug #58478.
16850 2004-05-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16852         * statement.cs: When checking for unreachable code on an EmptyStatement,
16853         set the location. Fixes bug #58488.
16855 2004-05-13  Miguel de Icaza  <miguel@ximian.com>
16857         * driver.cs: Add -pkg handling.
16859         From Gonzalo: UseShelLExecute=false
16861 2004-05-12  Marek Safar  <marek.safar@seznam.cz>
16863         * attribute.cs:
16864         (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
16865         for attribute.
16866         (Attribute.IsClsCompliaceRequired): Moved to base for better
16867         accesibility.
16868         (Attribute.UsageAttribute): New property for AttributeUsageAttribute
16869         when attribute is AttributeUsageAttribute.
16870         (Attribute.GetValidTargets): Simplified.
16871         (Attribute.GetAttributeUsage): New method returns AttributeUsage
16872         attribute for this type.
16873         (Attribute.ApplyAttributes): Method renamed to Emit and make
16874         non-static.
16875         (GlobalAttributeSection): New class for special handling of global
16876         attributes (assembly, module).
16877         (AttributeSection.Emit): New method.
16879         * class.cs: Implemented Attributable abstract methods.
16880         (MethodCore.LabelParameters): Moved to Parameter class.
16881         (Accessor): Is back simple class.
16882         (PropertyMethod): Implemented Attributable abstract class.
16883         (DelegateMethod): Implemented Attributable abstract class.
16884         (Event): New constructor for disctintion between normal Event
16885         and Event with accessors.
16887         * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
16889         * codegen.cs, const.cs, decl.cs, delegate.cs:
16890         (CommonAssemblyModulClass): Implemented Attributable abstract class
16891         and simplified.
16893         * enum.cs: Implement IAttributeSupport interface.
16894         (EnumMember): New class for emum members. Implemented Attributable
16895         abstract class
16897         * parameter.cs:
16898         (ParameterBase): Is abstract.
16899         (ReturnParameter): New class for easier [return:] attribute handling.
16901         * typemanager.cs: Removed builder_to_attr.
16903 2004-05-11  Raja R Harinath  <rharinath@novell.com>
16905         Fix bug #57151.
16906         * attribute.cs (Attribute.GetPositionalValue): New function.
16907         * class.cs (TypeContainer.VerifyMembers): New function.
16908         (TypeContainer.Emit): Use it.
16909         (ClassOrStruct): New base class for Class and Struct.
16910         (ClassOrStruct.ApplyAttributeBuilder): New function.  Note if 
16911         StructLayout(LayoutKind.Explicit) was ascribed to the struct or
16912         class.
16913         (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
16914         then each non-static field should have a FieldOffset attribute.
16915         Otherwise, none of the fields should have a FieldOffset attribute.
16916         * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout 
16917         and FieldOffset attributes.
16918         * typemanager.cs (TypeManager.struct_layout_attribute_type)
16919         (TypeManager.field_offset_attribute_type): New core types.
16920         (TypeManager.InitCoreTypes): Initialize them.
16922 2004-05-11  Michal Moskal  <malekith@pld-linux.org>
16924         * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
16925         Return correct type.
16926         From bug #58270.
16928 2004-05-09  Miguel de Icaza  <miguel@ximian.com>
16930         * expression.cs (Binary.DoNumericPromotions): 0 long constant can
16931         be implicitly converted to ulong.
16932         
16933         * expression.cs: The logic for allowing operator &, | and ^ worked
16934         was wrong, it worked before because we did not report an error in
16935         an else branch.  Fixes 57895.
16937         * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
16938         allow volatile fields to be reference types.
16940 2004-05-07  Miguel de Icaza  <miguel@ximian.com>
16942         * driver.cs: Add support for /debug-
16944 2004-05-07  Raja R Harinath  <rharinath@novell.com>
16946         * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType): 
16947         Add a 'complain' parameter to silence errors.
16948         (Attribute.Resolve): Update to changes.  Put in sanity check to catch
16949         silently overlooked type-resolutions.
16950         (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
16951         to reflect changes.
16952         (Attributes.Search): New function.
16953         (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
16954         (Attributes.GetAttributeFullName): Remove hack.
16955         * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes): 
16956         Update to reflect changes.
16957         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
16958         Use Attributes.Search instead of nested loops.
16960 2004-05-07  Marek Safar  <marek.safar@seznam.cz>
16962         * decl.cs:
16963         (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
16964         (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
16965         (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
16967         * report.cs: (Report.Warning): Renamed to Warning_T because of
16968         parameter collision.
16970 2004-05-05  Raja R Harinath  <rharinath@novell.com>
16972         * expression.cs (MemberAccess.ResolveMemberAccess):
16973         Exit with non-zero status after Report.Error.
16974         * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
16975         Likewise.
16976         * typemanager.cs (TypeManager.CoreLookupType): Likewise.
16978 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
16980         * support.cs: Don't hang when the file is empty.
16982 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
16984         * support.cs: In SeekableStreamReader, compute the preamble size of the
16985           underlying stream. Position changes should take into account that initial
16986           count of bytes.
16988 2004-05-03  Todd Berman  <tberman@sevenl.net>
16990         * driver.cs: remove unused GetSysVersion function.
16992 2004-05-03  Todd Berman  <tberman@sevenl.net>
16994         * driver.cs: Remove the hack from saturday, as well as the hack
16995         from jackson (LoadAssemblyFromGac), also adds the CWD to the
16996         link_paths to get that bit proper.
16998 2004-05-01  Todd Berman  <tberman@sevenl.net>
17000         * driver.cs: Try a LoadFrom before a Load, this checks the current
17001         path. This is currently a bug in mono that is be fixed, however, this
17002         provides a workaround for now. This will be removed when the bug
17003         is fixed.
17005 2004-05-01  Sebastien Pouliot  <sebastien@ximian.com>
17007         * CryptoConvert.cs: Updated to latest version. Fix issue with 
17008         incomplete key pairs (#57941).
17010 2004-05-01  Todd Berman  <tberman@sevenl.net>
17012         * driver.cs: Remove '.' from path_chars, now System.* loads properly
17013         from the GAC
17015 2004-04-30  Jackson Harper  <jackson@ximian.com>
17017         * codegen.cs: Open keys readonly.
17018         
17019 2004-04-30  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17021         * typemanager.cs: don't report cyclic struct layout when a struct
17022         contains 2 or more fields of the same type. Failed for Pango.AttrShape
17023         which has 2 Pango.Rectangle fields.
17025 2004-04-29 Ben Maurer  <bmaurer@users.sourceforge.net>
17027         * expression.cs: Handle IntPtr comparisons with IL code
17028         rather than a method call.
17030 2004-04-29  Martin Baulig  <martin@ximian.com>
17032         * ecore.cs (PropertyExpr.FindAccessor): New private method.  Walk
17033         the list of PropertyInfo's in class hierarchy and find the
17034         accessor.  Fixes #56013.
17036 2004-04-29  Martin Baulig  <martin@ximian.com>
17038         * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
17040 2004-04-29  Martin Baulig  <martin@ximian.com>
17042         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
17044         * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
17046 2004-04-29  Martin Baulig  <martin@ximian.com>
17048         * class.cs (ConstructorInitializer.Resolve): Check whether the
17049         parent .ctor is accessible.  Fixes #52146.
17051 2004-04-29  Martin Baulig  <martin@ximian.com>
17053         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
17055         * statement.cs (Using.EmitLocalVariableDecls): Use
17056         TypeManager.idisposable_type, not typeof (IDisposable).
17057         (Foreach.EmitCollectionForeach): Added support for valuetypes.
17059 2004-04-29  Martin Baulig  <martin@ximian.com>
17061         * class.cs (Event.Define): Don't emit the field and don't set
17062         RTSpecialName and SpecialName for events on interfaces.  Fixes
17063         #57703. 
17065 2004-04-29  Raja R Harinath  <rharinath@novell.com>
17067         Refactor Attribute.ApplyAttributes.
17068         * attribute.cs (Attributable): New base class for objects that can
17069         have Attributes applied on them.
17070         (Attribute): Make AttributeUsage fields public.
17071         (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
17072         (Attribute.IsInternalCall): New property.
17073         (Attribute.UsageAttr): Convert to a public read-only property.
17074         (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
17075         (Attribute.ResolveType, Attribute.Resolve)
17076         (Attribute.ScanForIndexerName): Update to reflect changes.
17077         (Attribute.CheckAttributeTarget): Re-format.
17078         (Attribute.ApplyAttributes): Refactor, to various
17079         Attributable.ApplyAttributeBuilder methods.
17080         * decl.cs (MemberCore): Make Attributable.
17081         * class.cs (Accessor): Make Attributable.
17082         (MethodData.ApplyAttributes): Use proper attribute types, not
17083         attribute names.
17084         (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
17085         (TypeContainer.ApplyAttributeBuilder)
17086         (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
17087         (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)   
17088         (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
17089         (Operator.ApplyAttributeBuilder): New factored-out methods.
17090         * const.cs (Const.ApplyAttributeBuilder): Likewise.
17091         * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
17092         * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
17093         * parameter.cs (ParameterBase): New Attributable base class
17094         that can also represent Return types.
17095         (Parameter): Update to the changes.
17097 2004-04-29  Jackson Harper  <jackson@ximian.com>
17099         * driver.cs: Prefer the corlib system version when looking for
17100         assemblies in the GAC. This is still a hack, but its a better hack
17101         now.
17102         
17103 2004-04-29  Marek Safar  <marek.safar@seznam.cz>
17105         * decl.cs, enum.cs: Improved error 3005 reporting.
17106   
17107         * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
17108         (related_symbols): New private member for list of symbols
17109         related to reported error/warning.
17110         
17111         * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
17113 2004-04-29  Martin Baulig  <martin@ximian.com>
17115         * ecore.cs (Expression.Constantify): If we're an enum and
17116         TypeManager.TypeToCoreType() doesn't give us another type, use
17117         t.UnderlyingSystemType.  Fixes #56178.  
17119 2004-04-29  Martin Baulig  <martin@ximian.com>
17121         * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
17122         interfaces and for each interface, only add members directly
17123         declared in that interface.  Fixes #53255.
17125 2004-04-28  Martin Baulig  <martin@ximian.com>
17127         * expression.cs (ConditionalLogicalOperator): Use a temporary
17128         variable for `left' to avoid that we evaluate it more than once;
17129         bug #52588.
17131 2004-04-28  Martin Baulig  <martin@ximian.com>
17133         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
17134         `void[]' (CS1547).
17136 2004-04-28  Martin Baulig  <martin@ximian.com>
17138         * statement.cs (LocalInfo.Resolve): Check whether the type is not
17139         void (CS1547).
17141         * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
17142         whether the type is not void (CS1547).
17144 2004-04-28  Martin Baulig  <martin@ximian.com>
17146         * expression.cs (Unary.DoResolveLValue): Override this and report
17147         CS0131 for anything but Operator.Indirection.
17149 2004-04-28  Martin Baulig  <martin@ximian.com>
17151         Committing a patch from Ben Maurer; see bug #50820.
17153         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
17154         check for classes.
17156         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
17157         classes.        
17159 2004-04-28  Martin Baulig  <martin@ximian.com>
17161         Committing a patch from Ben Maurer; see bug #50820.
17163         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
17164         check for classes.
17166         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
17167         classes.        
17169 2004-04-28  Martin Baulig  <martin@ximian.com>
17171         * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
17172         (Block.AddLabel): Call DoLookupLabel() to only search in the
17173         current block.
17175 2004-04-28  Martin Baulig  <martin@ximian.com>
17177         * cfold.cs (ConstantFold.BinaryFold): Added special support for
17178         comparing StringConstants and NullLiterals in Equality and Inequality.
17180 2004-04-28  Jackson Harper  <jackson@ximian.com>
17182         * driver.cs: Attempt to load referenced assemblies from the
17183         GAC. This is the quick and dirty version of this method that
17184         doesnt take into account versions and just takes the first
17185         canidate found. Will be good enough for now as we will not have more
17186         then one version installed into the GAC until I update this method.
17188 2004-04-28  Martin Baulig  <martin@ximian.com>
17190         * typemanager.cs (TypeManager.CheckStructCycles): New public
17191         static method to check for cycles in the struct layout.
17193         * rootcontext.cs (RootContext.PopulateTypes): Call
17194         TypeManager.CheckStructCycles() for each TypeContainer.
17195         [Note: We only need to visit each type once.]
17197 2004-04-28  Martin Baulig  <martin@ximian.com>
17199         * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
17201         * const.cs (Const.LookupConstantValue): Return a `bool' signalling
17202         success and added `out object value'.  Use a `bool resolved' field
17203         to check whether we've already been called rather than
17204         `ConstantValue != null' since this breaks for NullLiterals.
17206 2004-04-28  Raja R Harinath  <rharinath@novell.com>
17208         * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
17209         setting of this flag, since the 'set' method may be non-public.
17211 2004-04-28  Raja R Harinath  <rharinath@novell.com>
17213         * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
17214         check on current_vector.Block.
17216 2004-04-27  Martin Baulig  <martin@ximian.com>
17218         * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
17219         a field initializer.  Fixes #56459.
17221 2004-04-27  Martin Baulig  <martin@ximian.com>
17223         * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
17224         we're not attempting to use an indexer.  Fixes #52154.
17226 2004-04-27  Martin Baulig  <martin@ximian.com>
17228         * statement.cs (Return): Don't create a return label if we don't
17229         need it; reverts my change from January 20th.  Thanks to Ben
17230         Maurer for this.
17232 2004-04-27  Martin Baulig  <martin@ximian.com>
17234         According to the spec, `goto' can only leave a nested scope, but
17235         never enter it.
17237         * statement.cs (Block.LookupLabel): Only lookup in the current
17238         block, don't recurse into parent or child blocks.
17239         (Block.AddLabel): Check in parent and child blocks, report
17240         CS0140/CS0158 if we find a duplicate.
17241         (Block): Removed this indexer for label lookups.
17242         (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
17243         this already does the error reporting for us.
17245         * flowanalysis.cs
17246         (FlowBranching.UsageVector.Block): New public variable; may be null.
17247         (FlowBranching.CreateSibling): Added `Block' argument.
17248         (FlowBranching.LookupLabel): New public virtual method.  Lookup a
17249         label for the target of a `goto' and check whether we're not
17250         leaving a `finally'.
17252 2004-04-27  Martin Baulig  <martin@ximian.com>
17254         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
17255         a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
17256         just for returns).
17258 2004-04-27  Martin Baulig  <martin@ximian.com>
17260         * statement.cs (Block.AddLabel): Also check for implicit blocks
17261         and added a CS0158 check.
17263 2004-04-27  Martin Baulig  <martin@ximian.com>
17265         * flowanalysis.cs (FlowBranchingLoop): New class.
17266         (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
17267         UsageVector's instead of an ArrayList.
17268         (FlowBranching.Label): Likewise.
17269         (FlowBranching.UsageVector.MergeBreakOrigins): New method.
17270         (FlowBranching.AddBreakVector): New method.
17272 2004-04-27  Miguel de Icaza  <miguel@ximian.com>
17274         * attribute.cs: Small regression fix: only convert the type if we
17275         the type is different, fixes System.Drawing build.
17277 2004-04-27  Martin Baulig  <martin@ximian.com>
17279         * attribute.cs (Attribute.Resolve): If we have a constant value
17280         for a named field or property, implicity convert it to the correct
17281         type.
17283 2004-04-27  Raja R Harinath  <rharinath@novell.com>
17285         * statement.cs (Block.Block): Implicit blocks share
17286         'child_variable_names' fields with parent blocks.
17287         (Block.AddChildVariableNames): Remove.
17288         (Block.AddVariable): Mark variable as "used by a child block" in
17289         every surrounding block.
17290         * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
17291         been used in a child block, complain about violation of "Invariant
17292         meaning in blocks" rule.
17293         * cs-parser.jay (declare_local_variables): Don't use
17294         AddChildVariableNames.
17295         (foreach_statement): Don't create an implicit block: 'foreach'
17296         introduces a scope.
17298 2004-04-23  Miguel de Icaza  <miguel@ximian.com>
17300         * convert.cs (ImplicitNumericConversion): 0 is also positive when
17301         converting from 0L to ulong.  Fixes 57522.
17303 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
17305         * decl.cs (FindMemberToOverride): Fix wrong warning for case when
17306         derived class hides via 'new' keyword field from base class (test-242.cs).
17307         TODO: Handle this in the more general way.
17308         
17309         * class.cs (CheckBase): Ditto.
17311 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
17313         * decl.cs (caching_flags): New member for storing cached values
17314         as bit flags.
17315         (MemberCore.Flags): New enum where bit flags for caching_flags
17316         are defined.
17317         (MemberCore.cls_compliance): Moved to caching_flags.
17318         (DeclSpace.Created): Moved to caching_flags.
17320         * class.cs: Use caching_flags instead of DeclSpace.Created
17321         
17322 2004-04-21  Miguel de Icaza  <miguel@ximian.com>
17324         * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
17325         if we are only a derived class, not a nested class.
17327         * typemanager.cs: Same as above, but do this at the MemberLookup
17328         level (used by field and methods, properties are handled in
17329         PropertyExpr).   Allow for the qualified access if we are a nested
17330         method. 
17332 2004-04-21  Marek Safar  <marek.safar@seznam.cz>
17334         * class.cs: Refactoring.
17335         (IMethodData): New inteface; Holds links to parent members
17336         to avoid member duplication (reduced memory allocation).
17337         (Method): Implemented IMethodData interface.
17338         (PropertyBase): New inner classes for get/set methods.
17339         (PropertyBase.PropertyMethod): Implemented IMethodData interface
17340         (Event): New inner classes for add/remove methods.
17341         (Event.DelegateMethod): Implemented IMethodData interface.
17343         * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
17344         EmitContext (related to class.cs refactoring).
17346 2004-04-21  Raja R Harinath  <rharinath@novell.com>
17348         * delegate.cs (Delegate.VerifyApplicability): If the number of
17349         arguments are the same as the number of parameters, first try to
17350         verify applicability ignoring  any 'params' modifier on the last
17351         parameter.
17352         Fixes #56442.
17354 2004-04-16  Raja R Harinath  <rharinath@novell.com>
17356         * class.cs (TypeContainer.AddIndexer): Use
17357         'ExplicitInterfaceName' to determine if interface name was
17358         explicitly specified.  'InterfaceType' is not initialized at this time.
17359         (TypeContainer.DefineIndexers): Remove use of temporary list.  The
17360         Indexers array is already in the required order.  Initialize
17361         'IndexerName' only if there are normal indexers.
17362         (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
17363         (TypeContainer.Emit): Emit DefaultMember attribute only if
17364         IndexerName is initialized.
17365         Fixes #56300.
17367 2004-04-15  Benjamin Jemlich  <pcgod@gmx.net>
17369         * enum.cs (Enum.DefineType): Don't allow char as type for enum.
17370         Fixes #57007
17372 2004-04-15  Raja R Harinath  <rharinath@novell.com>
17374         * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
17375         attributes.
17376         Fix for #56456.
17378         * attribute.cs (Attribute.Resolve): Check for duplicate named
17379         attributes.
17380         Fix for #56463.
17382 2004-04-15  Miguel de Icaza  <miguel@ximian.com>
17384         * iterators.cs (MarkYield): track whether we are in an exception,
17385         and generate code accordingly.  Use a temporary value to store the
17386         result for our state.
17388         I had ignored a bit the interaction of try/catch with iterators
17389         since their behavior was not entirely obvious, but now it is
17390         possible to verify that our behavior is the same as MS .NET 2.0
17392         Fixes 54814
17394 2004-04-14  Miguel de Icaza  <miguel@ximian.com>
17396         * iterators.cs: Avoid creating temporaries if there is no work to
17397         do. 
17399         * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
17400         Enumerations, use TypeManager.EnumToUnderlying and call
17401         recursively. 
17403         Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
17404         bug #57013
17406         (This.Emit): Use EmitContext.EmitThis to emit our
17407         instance variable.
17409         (This.EmitAssign): Ditto.
17411         * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
17412         codepaths, we will move all the functionality into
17413         Mono.CSharp.This 
17415         (FieldExpr.EmitAssign): Ditto.
17417         This fixes several hidden bugs that I uncovered while doing a code
17418         review of this today.
17420         * codegen.cs (EmitThis): reworked so the semantics are more clear
17421         and also support value types "this" instances.
17423         * iterators.cs: Changed so that for iterators in value types, we
17424         do not pass the value type as a parameter.  
17426         Initialization of the enumerator helpers is now done in the caller
17427         instead of passing the parameters to the constructors and having
17428         the constructor set the fields.
17430         The fields have now `assembly' visibility instead of private.
17432 2004-04-11  Miguel de Icaza  <miguel@ximian.com>
17434         * expression.cs (Argument.Resolve): Check if fields passed as ref
17435         or out are contained in a MarshalByRefObject.
17437         * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
17438         another compiler type.
17440 2004-04-06 Ben Maurer  <bmaurer@users.sourceforge.net>
17442         * class.cs (Indexer.Define): use the new name checking method.
17443         Also, return false on an error.
17444         * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
17445         (is_identifier_[start/part]_character): make static.
17447 2004-04-10  Miguel de Icaza  <miguel@ximian.com>
17449         * expression.cs (Binary.ResolveOperator): Do no append strings
17450         twice: since we can be invoked more than once (array evaluation)
17451         on the same concatenation, take care of this here.  Based on a fix
17452         from Ben (bug #56454)
17454 2004-04-08  Sebastien Pouliot  <sebastien@ximian.com>
17456         * codegen.cs: Fix another case where CS1548 must be reported (when 
17457         delay-sign isn't specified and no private is available #56564). Fix
17458         loading the ECMA "key" to delay-sign an assembly. Report a CS1548 
17459         error when MCS is used on the MS runtime and we need to delay-sign 
17460         (which seems unsupported by AssemblyBuilder - see #56621).
17462 2004-04-08  Marek Safar  <marek.safar@seznam.cz>
17464         * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
17465         (TypeManager.ComputeNamespaces): Faster implementation for
17466         Microsoft runtime.
17468         * compiler.csproj: Updated AssemblyName to mcs.
17470 2004-04-07  Miguel de Icaza  <miguel@ximian.com>
17472         * rootcontext.cs: Add new types to the boot resolution.
17474         * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
17475         MulticastDelegate is not allowed.
17477         * typemanager.cs: Add new types to lookup: System.TypedReference
17478         and ArgIterator.
17480         * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
17481         check for TypedReference or ArgIterator, they are not allowed. 
17483         * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
17484         makes us properly catch 1510 in some conditions (see bug 56016 for
17485         details). 
17487 2004-04-06  Bernie Solomon  <bernard@ugsolutions.com>
17489         * CryptoConvert.cs: update from corlib version
17490         with endian fixes.
17492 2004-04-05  Miguel de Icaza  <miguel@ximian.com>
17494         * class.cs (Indexer.Define): Check indexername declaration
17496 2004-04-05  Marek Safar  <marek.safar@seznam.cz>
17498         * attribute.cs (IsClsCompliant): Fixed problem with handling
17499         all three states (compliant, not-compliant, undetected).
17501 2004-03-30  Marek Safar  <marek.safar@seznam.cz>
17503         * attribute.cs (Attribute): Location is now public.
17504         (Resolve): Store resolved arguments (pos_values) in attribute class.
17505         Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
17506         (GetClsCompliantAttributeValue): New method that gets
17507         CLSCompliantAttribute value.
17508         (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
17509         if exists else null.
17510         (AttributeTester): New class for CLS-Compliant verification routines.
17512         * class.cs (Emit): Add CLS-Compliant verification.
17513         (Method.GetSignatureForError): Implemented.
17514         (Constructor.GetSignatureForError): Implemented
17515         (Constructor.HasCompliantArgs): Returns if constructor has
17516         CLS-Compliant arguments.
17517         (Constructor.Emit): Override.
17518         (Construcor.IsIdentifierClsCompliant): New method; For constructors
17519         is needed to test only parameters.
17520         (FieldBase.GetSignatureForError): Implemented.
17521         (TypeContainer): New member for storing base interfaces.
17522         (TypeContainer.FindMembers): Search in base interfaces too.
17524         * codegen.cs (GetClsComplianceAttribute): New method that gets
17525         assembly or module CLSCompliantAttribute value.
17526         (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
17527         for assembly.
17528         (ModuleClass.Emit): Add error 3012 test.
17530         * const.cs (Emit): Override and call base for CLS-Compliant tests.
17532         * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
17533         state for all decl types.
17534         (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
17535         if CLS-Compliant tests are required.
17536         (IsClsCompliaceRequired): New method. Analyze whether code
17537         must be CLS-Compliant.
17538         (IsExposedFromAssembly): New method. Returns true when MemberCore
17539         is exposed from assembly.
17540         (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
17541         value or gets cached value.
17542         (HasClsCompliantAttribute): New method. Returns true if MemberCore
17543         is explicitly marked with CLSCompliantAttribute.
17544         (IsIdentifierClsCompliant): New abstract method. This method is
17545         used to testing error 3005.
17546         (IsIdentifierAndParamClsCompliant): New method. Common helper method
17547         for identifier and parameters CLS-Compliant testing.
17548         (VerifyClsCompliance): New method. The main virtual method for
17549         CLS-Compliant verifications.
17550         (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
17551         null. I don't know why is null (too many public members !).
17552         (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
17553         and get value of first CLSCompliantAttribute that found.
17555         * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
17556         (VerifyClsCompliance): Override and add extra tests.
17558         * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
17559         clscheck- disable CLS-Compliant verification event if assembly is has
17560         CLSCompliantAttribute(true).
17562         * enum.cs (Emit): Override and call base for CLS-Compliant tests.
17563         ApllyAttribute is now called in emit section as in the other cases.
17564         Possible future Emit integration.
17565         (IsIdentifierClsCompliant): New override.
17566         (VerifyClsCompliance): New override.
17567         (GetEnumeratorName): Returns full enum name.
17569         * parameter.cs (GetSignatureForError): Implemented.
17571         * report.cs (WarningData): New struct for Warning message information.
17572         (LocationOfPreviousError): New method.
17573         (Warning): New method. Reports warning based on the warning table.
17574         (Error_T): New method. Reports error based on the error table.
17576         * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
17577         verifications are done here.
17579         * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
17581         * typemanager.cs (cls_compliant_attribute_type): New member thath holds
17582         CLSCompliantAttribute.
17583         (all_imported_types): New member holds all imported types from other
17584         assemblies.
17585         (LoadAllImportedTypes): New method fills static table with exported types
17586         from all referenced assemblies.
17587         (Modules): New property returns all assembly modules.
17589 2004-03-30  Miguel de Icaza  <miguel@ximian.com>
17591         * cs-parser.jay: Add a rule to catch wrong event syntax instead of
17592         throwing a parser error.
17594         * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
17595         which removes the hardcoded get_/set_ prefixes for properties, as
17596         IL allows for the properties to be named something else.  
17598         Bug #56013
17600         * expression.cs: Do not override operand before we know if it is
17601         non-null.  Fix 56207
17603 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
17605         * typemanager.cs: support for pinned variables.
17607 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
17609         * decl.cs, typemanager.cs: Avoid using an arraylist
17610         as a buffer if there is only one result set.
17612 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
17614         * expression.cs: Make sure you cant call a static method
17615         with an instance expression, bug #56174.
17617 2004-03-29  Miguel de Icaza  <miguel@ximian.com>
17619         * class.cs (IsDuplicateImplementation): Improve error reporting to
17620         flag 663 (method only differs in parameter modifier).
17622         * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
17623         in preprocessor directives.
17625         * location.cs (LookupFile): Allow for the empty path.
17627         * attribute.cs (DefinePInvokeMethod): Fix 56148;  I would like a
17628         better approach for some of that patch, but its failing with the
17629         CharSet enumeration.  For now try/catch will do.
17631         * typemanager.cs: Do not crash if a struct does not have fields.
17632         Fixes 56150.
17634 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
17636         * expression.cs: cs0213, cant fix a fixed expression.
17637         fixes 50231.
17639 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
17641         * cs-parser.jay: detect invalid embeded statements gracefully.
17642         bug #51113.
17644 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
17646         * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
17647         As a regex:
17648         s/
17649         the invocation type may not be a subclass of the tye of the item/
17650         The type of the item must be a subclass of the invocation item.
17651         /g
17653         Fixes bug #50820.
17655 2004-03-25  Sebastien Pouliot  <sebastien@ximian.com>
17657         * attribute.cs: Added methods to get a string and a bool from an
17658         attribute. Required to information from AssemblyKeyFileAttribute,
17659         AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
17660         * codegen.cs: Modified AssemblyName creation to include support for
17661         strongnames. Catch additional exceptions to report them as CS1548.
17662         * compiler.csproj: Updated include CryptoConvert.cs.
17663         * compiler.csproj.user: Removed file - user specific configuration.
17664         * CryptoConvert.cs: New. A COPY of the class CryptoConvert from 
17665         Mono.Security assembly. The original class is maintained and tested in
17666         /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
17667         * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
17668         like CSC 8.0 (C# v2) supports.
17669         * Makefile: Added CryptoConvert.cs to mcs sources.
17670         * rootcontext.cs: Added new options for strongnames.
17672 2004-03-24 Ben Maurer  <bmaurer@users.sourceforge.net>
17674         * driver.cs: For --expect-error, report error code `2'
17675         if the program compiled with no errors, error code `1' if
17676         it compiled with an error other than the one expected.
17678 2004-03-24  Sebastien Pouliot  <sebastien@ximian.com>
17680         * compiler.csproj: Updated for Visual Studio .NET 2003.
17681         * compiler.csproj.user: Updated for Visual Studio .NET 2003.
17682         * compiler.sln: Updated for Visual Studio .NET 2003.
17684 2004-03-24  Ravi Pratap M  <ravi@ximian.com>
17686         * expression.cs: Fix bug #47234. We basically need to apply the
17687         rule that we prefer the conversion of null to a reference type
17688         when faced with a conversion to 'object' (csc behaviour).
17690 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
17692         * statement.cs: Shorter form for foreach, eliminates
17693         a local variable. r=Martin.
17695 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
17697         * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
17698         checks if we can use brtrue/brfalse to test for 0.
17699         * expression.cs: use the above in the test for using brtrue/brfalse.
17700         cleanup code a bit.
17702 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
17704         * expression.cs: Rewrite string concat stuff. Benefits:
17706         - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
17707         - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
17708         rather than a concat chain.
17710         * typemanager.cs: Add lookups for more concat overloads.
17712 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
17714         * expression.cs: Emit shorter il code for array init.
17716         newarr
17717         dup
17718         // set 1
17720         // set 2
17722         newarr
17723         stloc.x
17725         ldloc.x
17726         // set 1
17728         ldloc.x
17729         // set 2
17731 2004-03-22 Ben Maurer  <bmaurer@users.sourceforge.net>
17733         * statement.cs: Before, two switch blocks would be merged if the
17734         total size of the blocks (end_item - begin_item + 1) was less than
17735         two times the combined sizes of the blocks.
17737         Now, it will only merge if after the merge at least half of the
17738         slots are filled.
17740         fixes 55885.
17742 2004-03-20  Atsushi Enomoto  <atsushi@ximian.com>
17744         * class.cs : csc build fix for GetMethods(). See bug #52503.
17746 2004-03-20 Ben Maurer  <bmaurer@users.sourceforge.net>
17748         * expression.cs: Make sure fp comparisons work with NaN.
17749         This fixes bug #54303. Mig approved this patch a long
17750         time ago, but we were not able to test b/c the runtime
17751         had a related bug.
17753 2004-03-19  Miguel de Icaza  <miguel@ximian.com>
17755         * ecore.cs (TypExpr.GetHashCode): implement this overload. 
17757 2004-03-19  Martin Baulig  <martin@ximian.com>
17759         * class.cs (MemberCore.IsDuplicateImplementation): Report the
17760         error here and not in our caller.
17762 2004-03-19  Martin Baulig  <martin@ximian.com>
17764         * interface.cs: Completely killed this file.
17765         (Interface): We're now a TypeContainer and live in class.cs.
17767         * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
17768         argument; we're now also called for interfaces.
17769         (TypeContainer.DefineMembers): Allow this method being called
17770         multiple times.
17771         (TypeContainer.GetMethods): New public method; formerly known as
17772         Interface.GetMethod().  This is used by PendingImplementation.
17773         (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
17774         it's now private and non-static.
17775         (Interface): Moved this here; it's now implemented similar to
17776         Class and Struct.
17777         (Method, Property, Event, Indexer): Added `bool is_interface'
17778         argument to their .ctor's.
17779         (MemberBase.IsInterface): New public field.
17781         * cs-parser.jay: Create normal Method, Property, Event, Indexer
17782         instances instead of InterfaceMethod, InterfaceProperty, etc.
17783         (opt_interface_base): Removed; we now use `opt_class_base' instead.
17784         (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
17786 2004-03-19  Martin Baulig  <martin@ximian.com>
17788         * class.cs (MethodCore.IsDuplicateImplementation): New private
17789         method which does the CS0111 checking.
17790         (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
17791         Use IsDuplicateImplementation().
17793 2004-03-17 Ben Maurer  <bmaurer@users.sourceforge.net>
17795         * decl.cs (FindMemberToOverride): New method to find the correct
17796         method or property to override in the base class.
17797         * class.cs
17798             - Make Method/Property use the above method to find the
17799               version in the base class.
17800             - Remove the InheritableMemberSignatureCompare as it is now
17801               dead code.
17803         This patch makes large code bases much faster to compile, as it is
17804         O(n) rather than O(n^2) to do this validation.
17806         Also, it fixes bug 52458 which is that nested classes are not
17807         taken into account when finding the base class member.
17809         Reviewed/Approved by Martin.
17811 2004-03-17  Marek Safar  <marek.safar@seznam.cz>
17813         * interface.cs: In all interface classes removed redundant
17814         member initialization.
17816 2004-03-16  Martin Baulig  <martin@ximian.com>
17818         * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
17820 2004-03-15  Miguel de Icaza  <miguel@ximian.com>
17822         * decl.cs (DefineTypeAndParents): New helper method to define a
17823         type's containers before the type itself is defined;  This is a
17824         bug exposed by the recent changes to Windows.Forms when an
17825         implemented interface was defined inside a class that had not been
17826         built yet.   
17828         * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
17830         (Check): Loop correctly to report errors modifiers
17831         (UNSAFE was not in the loop, since it was the same as TOP).
17833         * interface.cs: Every interface member now takes a ModFlags,
17834         instead of a "is_new" bool, which we set on the base MemberCore. 
17836         Every place where we called "UnsafeOk" in the interface, now we
17837         call the proper member (InterfaceMethod.UnsafeOK) instead to get
17838         the unsafe settings from the member declaration instead of the
17839         container interface. 
17841         * cs-parser.jay (opt_new): Allow unsafe here per the spec. 
17843         * pending.cs (TypeAndMethods): Add `get_indexer_name' and
17844         `set_indexer_name' to the pending bits (one per type).
17846         We fixed a bug today that was picking the wrong method to
17847         override, since for properties the existing InterfaceMethod code
17848         basically ignored the method name.  Now we make sure that the
17849         method name is one of the valid indexer names.
17851 2004-03-14  Gustavo Giráldez  <gustavo.giraldez@gmx.net>
17853         * support.cs (SeekableStreamReader): Keep track of stream byte
17854         positions and don't mix them with character offsets to the buffer.
17856         Patch from Gustavo Giráldez
17858 2004-03-15  Marek Safar  <marek.safar@seznam.cz>
17860         * interface.cs (InterfaceSetGetBase): Removed double member
17861         initialization, base class does it as well.
17863 2004-03-13  Martin Baulig  <martin@ximian.com>
17865         * class.cs: Reverted Miguel's latest commit; it makes mcs crash
17866         when compiling corlib.
17868 2004-03-13  Miguel de Icaza  <miguel@ximian.com>
17870         * convert.cs (ExplicitConversion): We were reporting an error on
17871         certain conversions (object_type source to a value type, when the
17872         expression was `null') before we had a chance to pass it through
17873         the user defined conversions.
17875         * driver.cs: Replace / and \ in resource specifications to dots.
17876         Fixes 50752
17878         * class.cs: Add check for duplicate operators.  Fixes 52477
17880 2004-03-11  Miguel de Icaza  <miguel@ximian.com>
17882         * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
17883         that are in the middle of the statements, not only at the end.
17884         Fixes #54987
17886         * class.cs (TypeContainer.AddField): No longer set the
17887         `HaveStaticConstructor' flag, now we call it
17888         `UserDefineStaticConstructor' to diferentiate the slightly
17889         semantic difference.
17891         The situation is that we were not adding BeforeFieldInit (from
17892         Modifiers.TypeAttr) to classes that could have it.
17893         BeforeFieldInit should be set to classes that have no static
17894         constructor. 
17896         See:
17898         http://www.yoda.arachsys.com/csharp/beforefieldinit.html
17900         And most importantly Zoltan's comment:
17902         http://bugzilla.ximian.com/show_bug.cgi?id=44229
17904         "I think beforefieldinit means 'it's ok to initialize the type sometime 
17905          before its static fields are used', i.e. initialization does not need
17906          to be triggered by the first access to the type. Setting this flag
17907          helps the JIT to compile better code, since it can run the static
17908          constructor at JIT time, and does not need to generate code to call it
17909          (possibly lots of times) at runtime. Unfortunately, mcs does not set
17910          this flag for lots of classes like String. 
17911          
17912          csc sets this flag if the type does not have an explicit static 
17913          constructor. The reasoning seems to be that if there are only static
17914          initalizers for a type, and no static constructor, then the programmer
17915          does not care when this initialization happens, so beforefieldinit
17916          can be used.
17917          
17918          This bug prevents the AOT compiler from being usable, since it 
17919          generates so many calls to mono_runtime_class_init that the AOT code
17920          is much slower than the JITted code. The JITted code is faster, 
17921          because it does not generate these calls if the vtable is type is
17922          already initialized, which is true in the majority of cases. But the
17923          AOT compiler can't do this."
17925 2004-03-10  Miguel de Icaza  <miguel@ximian.com>
17927         * class.cs (MethodData.Emit): Refactor the code so symbolic
17928         information is generated for destructors;  For some reasons we
17929         were taking a code path that did not generate symbolic information
17930         before. 
17932 2004-03-11 Ben Maurer  <bmaurer@users.sourceforge.net>
17934         * class.cs: Create a Constructor.CheckBase method that
17935         takes care of all validation type code. The method
17936         contains some code that was moved from Define.
17938         It also includes new code that checks for duplicate ctors.
17939         This fixes bug #55148.
17941 2004-03-09  Joshua Tauberer <tauberer@for.net>
17943         * expression.cs (ArrayCreation): Fix: More than 6 nulls in
17944         a { ... }-style array creation invokes EmitStaticInitializers
17945         which is not good for reference-type arrays.  String, decimal
17946         and now null constants (NullCast) are not counted toward
17947         static initializers.
17949 2004-03-05  Martin Baulig  <martin@ximian.com>
17951         * location.cs (SourceFile.HasLineDirective): New public field;
17952         specifies whether the file contains or is referenced by a "#line"
17953         directive.
17954         (Location.DefineSymbolDocuments): Ignore source files which
17955         either contain or are referenced by a "#line" directive.        
17957 2004-02-29  Ben Maurer <bmaurer@users.sourceforge.net>
17959         * class.cs (Method.CheckBase): Avoid using FindMembers, we have
17960         direct access to our parent, so check the method inline there.
17962 2004-02-27 Ben Maurer  <bmaurer@users.sourceforge.net>
17964         * expression.cs (Invocation.EmitCall): Miguel's last commit
17965         caused a regression. If you had:
17967             T t = null;
17968             t.Foo ();
17970         In Foo the implict this would be null.
17972 2004-02-27  Miguel de Icaza  <miguel@ximian.com>
17974         * expression.cs (Invocation.EmitCall): If the method is not
17975         virtual, do not emit a CallVirt to it, use Call.
17977         * typemanager.cs (GetFullNameSignature): Improve the method to
17978         cope with ".ctor" and replace it with the type name.
17980         * class.cs (ConstructorInitializer.Resolve): Now the method takes
17981         as an argument the ConstructorBuilder where it is being defined,
17982         to catch the recursive constructor invocations.
17984 2004-02-26  Miguel de Icaza  <miguel@ximian.com>
17986         * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
17987         routines to check if a type is an enumerable/enumerator allow
17988         classes that implement the IEnumerable or IEnumerator interfaces.
17990         * class.cs (Property, Operator): Implement IIteratorContainer, and
17991         implement SetYields.
17993         (Property.Define): Do the block swapping for get_methods in the
17994         context of iterators.   We need to check if Properties also
17995         include indexers or not.
17997         (Operator): Assign the Block before invoking the
17998         OperatorMethod.Define, so we can trigger the Iterator code
17999         replacement. 
18001         * cs-parser.jay (SimpleIteratorContainer): new helper class.  Both
18002         Property and Operator classes are not created when we parse the
18003         declarator but until we have the block completed, so we use a
18004         singleton SimpleIteratorContainer.Simple to flag whether the
18005         SetYields has been invoked.
18007         We propagate this setting then to the Property or the Operator to
18008         allow the `yield' to function.
18010 2004-02-25  Marek Safar  <marek.safar@seznam.cz>
18012         * codegen.cs: Implemented attribute support for modules.
18013         New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
18014         Assembly/Module functionality.
18016         * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
18017         interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
18018         Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
18020 2004-02-16  Marek Safar  <marek.safar@seznam.cz>
18022         * interface.cs (FindMembers): The operation is performed on all base
18023         interfaces and not only on the first. It is required for future CLS Compliance patch.
18025 2004-02-12 Ben Maurer  <bmaurer@users.sourceforge.net>
18027         * statement.cs, codegen.cs:
18028         This patch deals with patterns such as:
18030         public class List : IEnumerable {
18032                 public MyEnumerator GetEnumerator () {
18033                         return new MyEnumerator(this);
18034                 }
18036                 IEnumerator IEnumerable.GetEnumerator () {
18037                         ...
18038                 }
18039                 
18040                 public struct MyEnumerator : IEnumerator {
18041                         ...
18042                 }
18043         }
18045         Before, there were a few things we did wrong:
18046         1) we would emit callvirt on a struct, which is illegal
18047         2) we emited ldarg when we needed to emit ldarga
18048         3) we would mistakenly call the interface methods on an enumerator
18049         type that derived from IEnumerator and was in another assembly. For example:
18051         public class MyEnumerator : IEnumerator
18053         Would have the interface methods called, even if there were public impls of the
18054         method. In a struct, this lead to invalid IL code.
18056 2004-02-11  Marek Safar  <marek.safar@seznam.cz>
18058         * const.cs: Const is now derived from FieldBase. Method EmitConstant name
18059           renamed to Emit.
18061         * delegate.cs (Define): Fixed crash when delegate type is undefined.
18063 2004-02-11  Miguel de Icaza  <miguel@ximian.com>
18065         * cs-parser.jay: Fix small regression: we were not testing V2
18066         compiler features correctly.
18068         * interface.cs: If the emit context is null, then create one
18070 2004-02-09  Marek Safar  <marek.safar@seznam.cz>
18072         * decl.cs (GetSignatureForError): New virtual method to get full name
18073           for error messages.
18075         * attribute.cs (IAttributeSupport): New interface for attribute setting.
18076           Now it is possible to rewrite ApplyAttributes method to be less if/else.
18078         * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
18079           Duplicated members and code in these classes has been removed.
18080           Better encapsulation in these classes.
18082 2004-02-07  Miguel de Icaza  <miguel@ximian.com>
18084         * assign.cs (Assign.DoResolve): When dealing with compound
18085         assignments, there is a new rule in ECMA C# 2.4 (might have been
18086         there before, but it is documented here) that states that in:
18088         a op= b;
18090         If b is of type int, and the `op' is a shift-operator, then the
18091         above is evaluated as:
18093         a = (int) a op b 
18095         * expression.cs (Binary.ResolveOperator): Instead of testing for
18096         int/uint/long/ulong, try to implicitly convert to any of those
18097         types and use that in pointer arithmetic.
18099         * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
18100         method to print information for from the type, not from the
18101         null-method we were given.
18103 2004-02-01  Duncan Mak  <duncan@ximian.com>
18105         * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
18106         parsing for cmd, fixes bug #53694.
18108 2004-02-04  Marek Safar  <marek.safar@seznam.cz>
18110         * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
18111         in the member name duplication tests. Property and operator name duplication
18112         was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
18114 2004-02-03  Marek Safar  <marek.safar@seznam.cz>
18116         * interface.cs (PopulateMethod): Fixed crash when interface method
18117         returns not existing type (error test cs0246-3.cs).
18119 2004-02-02  Ravi Pratap M <ravi@ximian.com>
18121         * cs-parser.jay (interface_accessors): Re-write actions to also
18122         store attributes attached to get and set methods. Fix spelling
18123         while at it.
18125         (inteface_property_declaration): Modify accordingly.
18127         (InterfaceAccessorInfo): New helper class to store information to pass
18128         around between rules that use interface_accessors.
18130         * interface.cs (Emit): Apply attributes on the get and set
18131         accessors of properties and indexers too.
18133         * attribute.cs (ApplyAttributes): Modify accordingly to use the
18134         right MethodBuilder when applying attributes to the get and set accessors.
18136 2004-01-31  Miguel de Icaza  <miguel@ximian.com>
18138         * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
18140 2004-01-26  Miguel de Icaza  <miguel@ximian.com>
18142         * cs-tokenizer.cs: Handle #line hidden from PDC bits.
18144 2004-01-25  Miguel de Icaza  <miguel@ximian.com>
18146         * cs-parser.jay: Remove YIELD token, instead use the new grammar
18147         changes that treat `yield' specially when present before `break'
18148         or `return' tokens.
18150         * cs-tokenizer.cs: yield is no longer a keyword.
18152 2004-01-23  Marek Safar  <marek.safar@seznam.cz>
18154         * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
18155         setting for default constructors.
18156         For default constructors are almost every time set wrong Modifier. The
18157         generated IL code has been alright. But inside mcs this values was
18158         wrong and this was reason why several of my CLS Compliance tests
18159         failed.
18161 2004-01-22  Martin Baulig  <martin@ximian.com>
18163         * cs-parser.jay (namespace_or_type_name): Return an Expression,
18164         not a QualifiedIdentifier.  This is what `type_name_expression'
18165         was previously doing.
18166         (type_name_expression): Removed; the code is now in
18167         `namespace_or_type_name'.
18168         (qualified_identifier): Removed, use `namespace_or_type_name'
18169         instead.
18170         (QualifiedIdentifier): Removed this class.      
18172 2004-01-22  Martin Baulig  <martin@ximian.com>
18174         * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
18175         not a string as alias name.
18177 2004-01-21  Miguel de Icaza  <miguel@ximian.com>
18179         * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
18180         #52730 bug, and instead compute correctly the need to use a
18181         temporary variable when requesting an address based on the
18182         static/instace modified of the field and the constructor.
18184 2004-01-21  Martin Baulig  <martin@ximian.com>
18186         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
18187         class and namespace before looking up aliases.  Fixes #52517.
18189 2004-01-21  Martin Baulig  <martin@ximian.com>
18191         * flowanalysis.cs (UsageVector.Merge): Allow variables being
18192         assinged in a 'try'; fixes exception4.cs.
18194 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
18195         * class.cs : Implemented parameter-less constructor for TypeContainer
18197         * decl.cs: Attributes are now stored here. New property OptAttributes
18199         * delegate.cs, enum.cs, interface.cs: Removed attribute member.
18201         * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
18203 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
18205         * typemanager.cs (CSharpSignature): Now reports also inner class name.
18206           (CSharpSignature): New method for indexer and property signature.
18208 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
18210         * pending.cs (IsVirtualFilter): Faster implementation.
18212 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
18214         * typemanager.cs: Avoid inclusion of same assembly more than once.
18216 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
18218         * cs-parser.jay: Fixed problem where the last assembly attribute
18219           has been applied also to following declaration (class, struct, etc.)
18220           
18221 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
18223         * class.cs: Added error CS0538, CS0539 reporting.
18224         Fixed crash on Microsoft runtime when field type is void.
18226         * cs-parser.jay: Added error CS0537 reporting.
18228         * pending.cs: Added error CS0535 reporting.
18229         Improved error report for errors CS0536, CS0534.
18231 2004-01-20  Miguel de Icaza  <miguel@ximian.com>
18233         Merge a few bits from the Anonymous Method MCS tree.
18235         * statement.cs (ToplevelBlock): New class for toplevel methods,
18236         will hold anonymous methods, lifted variables.
18238         * cs-parser.jay: Create toplevel blocks for delegates and for
18239         regular blocks of code. 
18241 2004-01-20  Martin Baulig  <martin@ximian.com>
18243         * codegen.cs (EmitContext): Removed `InTry', `InCatch',
18244         `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
18245         and `NeedExplicitReturn'; added `IsLastStatement'.
18246         (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
18247         have a `ReturnLabel' or we're not unreachable.
18249         * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
18250         child's reachability; don't just override ours with it.  Fixes
18251         #58058 (lluis's example).
18252         (FlowBranching): Added public InTryOrCatch(), InCatch(),
18253         InFinally(), InLoop(), InSwitch() and
18254         BreakCrossesTryCatchBoundary() methods.
18256         * statement.cs (Return): Do all error checking in Resolve().
18257         Unless we are the last statement in a top-level block, always
18258         create a return label and jump to it.
18259         (Break, Continue): Do all error checking in Resolve(); also make
18260         sure we aren't leaving a `finally'.
18261         (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
18262         statement in a top-level block.
18263         (Block.Flags): Added `IsDestructor'.
18264         (Block.IsDestructor): New public property.
18266 2004-01-20  Martin Baulig  <martin@ximian.com>
18268         * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
18270 2004-01-20  Martin Baulig  <martin@ximian.com>
18272         * statement.cs (Statement.ResolveUnreachable): New public method.
18273         (If, While): Do the dead-code elimination in Resolve(), not in Emit().
18274         (Block.Resolve): Resolve unreachable statements.
18276 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
18278         * expression.cs: We need to fix the case where we do
18279         not have a temp variable here.
18281         * assign.cs: Only expression compound assignments need
18282         temporary variables.
18284 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
18286         * flowanalysis.cs: Reduce memory allocation in a few ways:
18287           - A block with no variables should not allocate a bit
18288             vector for itself.
18289           - A method with no out parameters does not need any tracking
18290             for assignment of the parameters, so we need not allocate
18291             any data for it.
18292           - The arrays:
18293                 public readonly Type[] VariableTypes;
18294                 public readonly string[] VariableNames;
18295             Are redundant. The data is already stored in the variable
18296             map, so we need not allocate another array for it.
18297           - We need to add alot of checks for if (params | locals) == null
18298             due to the first two changes.
18300 2004-01-18  Miguel de Icaza  <miguel@ximian.com>
18302         * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
18303         implement IMemoryLocation, we store a copy on a local variable and
18304         take the address of it.  Patch from Benjamin Jemlich
18306         * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
18307         to use a special "type_name_expression" rule which reduces the
18308         number of "QualifiedIdentifier" classes created, and instead
18309         directly creates MemberAccess expressions.
18311 2004-01-17  Miguel de Icaza  <miguel@ximian.com>
18313         * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
18314         that fixes #52853.  Null literal assignment to ValueType
18316         * class.cs (MethodData.Emit): Instead of checking the name of the
18317         method to determine if its a destructor, create a new derived
18318         class from Method called Destructor, and test for that.  
18320         * cs-parser.jay: Create a Destructor object instead of a Method.  
18322         Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
18324         Fixes: 52933
18326 2004-01-16  Miguel de Icaza  <miguel@ximian.com>
18328         * expression.cs (Binary.ResolveOperator): Perform an implicit
18329         conversion from MethodGroups to their delegate types on the
18330         Addition operation.
18332         * delegate.cs: Introduce a new class DelegateCreation that is the
18333         base class for `NewDelegate' and `ImplicitDelegateCreation',
18334         factor some code in here.
18336         * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
18337         conversion from MethodGroups to compatible delegate types. 
18339         * ecore.cs (Expression.Resolve): Do not flag error 654
18340         (Methodgroupd needs parenthesis) if running on the V2 compiler, as
18341         we allow conversions from MethodGroups to delegate types now.
18343         * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
18344         assignments in v2 either.
18346 2004-01-10  Miguel de Icaza  <miguel@ximian.com>
18348         * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
18349         static read-only fields in ctors.
18351         Applied patch from Benjamin Jemlich 
18353         * expression.cs (UnaryMutator): Avoid leaking local variables. 
18355 2004-01-09  Miguel de Icaza  <miguel@ximian.com>
18357         * cs-tokenizer.cs (IsCastToken): Allow the various native types
18358         here to return true, as they can be used like this:
18360                 (XXX) int.MEMBER ()
18362         Fixed 49836 and all the other dups
18364 2004-01-09  Zoltan Varga  <vargaz@freemail.hu>
18366         * driver.cs: Implement /win32res and /win32icon.
18368 2004-01-08  Miguel de Icaza  <miguel@ximian.com>
18370         * cs-parser.jay: Add a rule to improve error handling for the
18371         common mistake of placing modifiers after the type.
18373 2004-01-07  Miguel de Icaza  <miguel@ximian.com>
18375         * cs-parser.jay (interface_event_declaration): Catch
18376         initialization of events on interfaces, and report cs0068
18378         * cs-parser.jay (interface_event_declaration): Catch
18379         initialization of events. 
18381         * ecore.cs: Better report missing constructors.
18383         * expression.cs (Binary.ResolveOperator): My previous bug fix had
18384         the error reporting done in the wrong place.  Fix.
18386         * expression.cs (Binary.ResolveOperator): Catch the 
18387         operator + (E x, E y) error earlier, and later allow for implicit
18388         conversions in operator +/- (E e, U x) from U to the underlying
18389         type of E.
18391         * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
18392         52596, if the container class is abstract, the default constructor
18393         is protected otherwise its public (before, we were always public).
18395         * statement.cs (Fixed.Resolve): Catch a couple more errors in the
18396         fixed statement.
18398         (Using.EmitLocalVariableDecls): Applied patch from Benjamin
18399         Jemlich that fixes bug #52597, MCS was generating invalid code for
18400         idisposable structs.   Thanks to Ben for following up with this
18401         bug as well.
18403 2004-01-06  Miguel de Icaza  <miguel@ximian.com>
18405         * driver.cs: Allow assemblies without code to be generated, fixes
18406         52230.
18408 2004-01-07  Nick Drochak <ndrochak@gol.com>
18410         * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
18412 2004-01-05  Miguel de Icaza  <miguel@ximian.com>
18414         * cs-parser.jay: Add rules to improve error reporting if fields or
18415         methods are declared at the namespace level (error 116)
18417         * Add rules to catch event add/remove
18419 2004-01-04  David Sheldon <dave-mono@earth.li>
18421   * expression.cs: Added matching ")" to error message for 
18422   CS0077
18424 2004-01-03 Todd Berman <tberman@gentoo.org>
18426         * ecore.cs, attribute.cs:
18427         Applying fix from #52429.
18429 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
18431         * ecore.cs, expression.cs, statement.cs:
18432         Total rewrite of how we handle branching. We
18433         now handle complex boolean expressions with fewer
18434         jumps. As well if (x == 0) no longer emits a ceq.
18436         if (x is Foo) is much faster now, because we generate
18437         better code.
18439         Overall, we get a pretty big improvement on our benchmark
18440         tests. The code we generate is smaller and more readable.
18442         I did a full two-stage bootstrap. The patch was reviewed
18443         by Martin and Miguel.
18445 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
18447         * cs-parser.jay: Make primary_expression not take a QI.
18448         we dont need this because the member_access rule covers
18449         us here. So we replace the rule with just IDENTIFIER.
18451         This has two good effects. First, we remove a s/r conflict.
18452         Second, we allocate many fewer QualifiedIdentifier objects.
18454 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
18456         * attribute.cs: Handle MarshalAs attributes as pseudo, and
18457         set the correct information via SRE. This prevents
18458         hanging on the MS runtime. Fixes #29374.
18460 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
18462         * convert.cs: correctly handle conversions to value types
18463         from Enum and ValueType as unboxing conversions.
18465         Fixes bug #52569. Patch by Benjamin Jemlich.
18467 2004-01-02  Ravi Pratap  <ravi@ximian.com>
18469         * expression.cs (BetterConversion): Prefer int -> uint
18470         over int -> ulong (csc's behaviour). This fixed bug #52046.
18472 2004-01-02 Ben Maurer  <bmaurer@users.sourceforge.net>
18474         * decl.cs (MemberCache.FindMembers): now returns a
18475         MemberInfo [].
18477         * typemanager.cs: In general, go with with ^^.
18478         (CopyNewMethods): take an IList.
18479         (RealMemberLookup): Only allocate an arraylist
18480         if we copy from two sets of methods.
18482         This change basically does two things:
18483         1) Fewer array lists allocated due to CopyNewMethods.
18484         2) the explicit cast in MemberList costed ALOT.
18486 2004-01-02  Zoltan Varga  <vargaz@freemail.hu>
18488         * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
18489         a hashtable to avoid needless string allocations when an identifier is
18490         used more than once (the common case).
18492 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
18494         * pending.cs: MS's TypeBuilder.GetInterfaces ()
18495         is broken, it will not return anything. So, we
18496         have to use the information we have in mcs to
18497         do the task.
18499         * typemanager.cs: Add a cache for GetInterfaces,
18500         since this will now be used more often (due to ^^)
18502         (GetExplicitInterfaces) New method that gets the
18503         declared, not effective, interfaces on a type
18504         builder (eg, if you have interface IFoo, interface
18505         IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
18506         { IBar }.
18508         This patch makes MCS able to bootstrap itself on
18509         Windows again.
18511 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
18513         * expression.cs: Remove the Nop's that Miguel put
18514         in by mistake.
18516 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
18518         * report.cs, codegen.cs: Give the real stack trace to
18519         the error when an exception is thrown.
18521 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
18523         * decl.cs: only allocate hashtables for ifaces if 
18524         it is an iface!
18526 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
18528         * expression.cs: fix the error from cs0121-2.cs
18529         (a parent interface has two child interfaces that
18530         have a function with the same name and 0 params
18531         and the function is called through the parent).
18533 2003-12-30 Ben Maurer  <bmaurer@users.sourceforge.net>
18535         * class.cs, rootcontext.cs, typmanager.cs: do not
18536         leak pointers.
18538 2003-12-28 Ben Maurer  <bmaurer@users.sourceforge.net>
18540         * codegen.cs: remove stack for the ec flow branching.
18541         It is already a linked list, so no need.
18543 2003-12-27 Ben Maurer  <bmaurer@users.sourceforge.net>
18545         * Makefile: Allow custom profiler here.
18547 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
18549         * typemanager.cs (LookupType):
18550           - Use a static char [], because split takes
18551             a param array for args, so it was allocating
18552             every time.
18553           - Do not store true in a hashtable, it boxes.
18555 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
18557         * flowanalysis.cs: bytify common enums.
18559 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
18561         * modifiers.cs: Add a new set of flags for the
18562         flags allowed on explicit interface impls.
18563         * cs-parser.jay: catch the use of modifiers in
18564         interfaces correctly.
18565         * class.cs: catch private void IFoo.Blah ().
18567         All related to bug #50572.
18569 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
18571         * decl.cs: Rewrite the consistant accessability checking.
18572         Accessability is not linear, it must be implemented in
18573         a tableish way. Fixes #49704.
18575 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
18577         * expression.cs: Handle negation in a checked context.
18578         We must use subtraction from zero. Fixes #38674.
18580 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
18582         * class.cs: Ignore static void main in DLLs.
18583         * rootcontext.cs: Handle the target type here,
18584         since we are have to access it from class.cs
18585         * driver.cs: account for the above.
18587 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
18589         * report.cs: Give line numbers and files if available.
18591 2003-12-20  Zoltan Varga  <vargaz@freemail.hu>
18593         * driver.cs: Implement /addmodule.
18595         * typemanager.cs:  Change 'modules' field so it now contains Modules not
18596         ModuleBuilders.
18598 2003-12-20  Martin Baulig  <martin@ximian.com>
18600         * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
18601         (FieldBase.IsAssigned): Removed this field.
18602         (FieldBase.SetAssigned): New public method.
18603         (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
18605 2003-12-20  Martin Baulig  <martin@ximian.com>
18607         * expression.cs (LocalVariableReference.DoResolve): Don't set
18608         `vi.Used' if we're called from DoResolveLValue().
18610         * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
18611         returns the usage vector it just merged into the current one -
18612         pass this one to UsageWarning().
18613         (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
18614         of the `EmitContext', don't call this recursively on our children.
18616 2003-12-19  Zoltan Varga  <vargaz@freemail.hu>
18618         * driver.cs: Implement /target:module.
18620 2003-12-18  Zoltan Varga  <vargaz@freemail.hu>
18622         * support.cs (CharArrayHashtable): New helper class.
18624         * cs-tokenizer.cs: Store keywords in a hashtable indexed by 
18625         char arrays, not strings, so we can avoid creating a string in
18626         consume_identifier if the identifier is a keyword.
18628 2003-12-16  Martin Baulig  <martin@ximian.com>
18630         * statement.cs (LocalInfo.Assigned): Removed this property.
18631         (LocalInfo.Flags): Removed `Assigned'.
18632         (LocalInfo.IsAssigned): New public method; takes the EmitContext
18633         and uses flow analysis.
18634         (Block.UsageWarning): Made this method private.
18635         (Block.Resolve): Call UsageWarning() if appropriate.
18637         * expression.cs (LocalVariableReference.DoResolve): Always set
18638         LocalInfo.Used here.
18640 2003-12-13  Martin Baulig  <martin@ximian.com>
18642         * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
18643         any value here; we're now using flow analysis to figure out
18644         whether a statement/block returns a value.
18646 2003-12-13  Martin Baulig  <martin@ximian.com>
18648         * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
18649         working again.
18650         (FlowBranching.MergeFinally): Don't call
18651         `branching.CheckOutParameters()' here, this is called in
18652         MergeTopBlock().
18653         (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
18654         when adding the `finally' vector.       
18656 2003-12-13  Martin Baulig  <martin@ximian.com>
18658         * flowanalysis.cs
18659         (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
18660         actually work and also fix #48962.
18662 2003-12-12 Ben Maurer  <bmaurer@users.sourceforge.net>
18664         * decl.cs: Do not check System.Object for nested types,
18665         since we know it does not have any. Big bang for buck:
18667         BEFORE:
18668            Run 1:   8.35 seconds
18669            Run 2:   8.32 seconds
18670            corlib:  17.99 seconds
18671         AFTER:
18672            Run 1:   8.17 seconds
18673            Run 2:   8.17 seconds
18674            corlib:  17.39 seconds
18676 2003-12-11 Ben Maurer  <bmaurer@users.sourceforge.net>
18678         * class.cs (FindMembers): Allocate arraylists on demand. Most of the
18679         time we are returning 0 members, so we save alot here.
18681 2003-12-11  Martin Baulig  <martin@ximian.com>
18683         * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
18684         `MergeChild()', also just take the `FlowBranching' as argument;
18685         call Merge() on it and return the result.
18686         (FlowBranching.Merge): We don't need to do anything if we just
18687         have one sibling.
18689 2003-12-11  Martin Baulig  <martin@ximian.com>
18691         * flowanalysis.cs: Use a list of `UsageVector's instead of storing
18692         them in an `ArrayList' to reduce memory usage.  Thanks to Ben
18693         Maurer for this idea.
18695 2003-12-11  Martin Baulig  <martin@ximian.com>
18697         * flowanalysis.cs (MergeResult): This class is now gone; we now
18698         use the `UsageVector' for this.  The reason for this is that if a
18699         branching just has one sibling, we don't need to "merge" them at
18700         all - that's the next step to do.
18701         (FlowBranching.Merge): We now return a `UsageVector' instead of a
18702         `MergeResult'.
18704 2003-12-11  Martin Baulig  <martin@ximian.com>
18706         Reworked flow analyis and made it more precise and bug-free.  The
18707         most important change is that we're now using a special `Reachability'
18708         class instead of having "magic" meanings of `FlowReturns'.  I'll
18709         do some more cleanups and optimizations and also add some more
18710         documentation this week.
18712         * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
18713         largely reworked this class.
18714         (FlowReturns): Removed `Unreachable' and `Exception'; we now use
18715         the new `Reachability' class instead of having "magic" values here.
18716         (FlowBranching): We're now using an instance of `Reachability'
18717         instead of having separate `Returns', `Breaks' etc. fields.
18719         * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
18720         based on flow analysis; ignore the return value of block.Emit ().
18722 2003-12-10  Zoltan Varga  <vargaz@freemail.hu>
18724         * driver.cs typemanager.cs: Find the mono extensions to corlib even
18725         if they are private.
18727 2003-12-09  Martin Baulig  <martin@ximian.com>
18729         * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
18730         call them directly on the UsageVector.
18732 2003-12-09  Martin Baulig  <martin@ximian.com>
18734         * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
18735         Changed return type from `FlowReturns' to `Reachability'.
18737 2003-12-09  Martin Baulig  <martin@ximian.com>
18739         * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
18740         (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
18741         `Reachable' fields with a single `Reachability' one.
18743 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
18745         * class.cs (FindMembers): Remove foreach's.
18747         Bootstrap times:
18749         BEFORE
18750                 Run 1:   8.74 seconds
18751                 Run 2:   8.71 seconds
18753         AFTER
18754                 Run 1:   8.64 seconds
18755                 Run 2:   8.58 seconds
18758 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
18760         * cs-parser.jay:
18761         * gen-treedump.cs:
18762         * statement.cs:
18763         This patch does a few things:
18764                 1. EmptyStatement is now a singleton, so it is never reallocated.
18765                 2. All blah is EmptyStatement constructs have been changed to
18766                    blah == EmptyStatement.Value, which is much faster and valid
18767                    now that EmptyStatement is a singleton.
18768                 3. When resolving a block, rather than allocating a new array for
18769                    the non-empty statements, empty statements are replaced with
18770                    EmptyStatement.Value
18771                 4. Some recursive functions have been made non-recursive.
18772         Mainly the performance impact is from (3), however (1) and (2) are needed for
18773         this to work. (4) does not make a big difference in normal situations, however
18774         it makes the profile look saner.
18776         Bootstrap times:
18778         BEFORE
18779         9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
18780         9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
18781         Total memory allocated: 56397 KB
18783         AFTER
18784         9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
18785         8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
18786         Total memory allocated: 55666 KB
18788 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
18790         * support.cs: Rewrite DoubleHash to use its own impl. Is faster
18791         than the hashtable in a hashtable version
18793         * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
18794         we always end up concating a string. This results in a huge perf
18795         loss, because many strings have to be tracked by the GC. In this
18796         patch, we first use a hashtable that works with two keys, so that
18797         the strings do not need to be concat'ed.
18799         Bootstrap times:
18800         BEFORE
18801                 Run 1:   8.74 seconds
18802                 Run 2:   8.71 seconds
18804         AFTER
18805                 Run 1:   8.65 seconds
18806                 Run 2:   8.56 seconds
18808 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
18810         * Makefile: Add a new target `do-time' that does a quick and simple
18811         profile, leaving easy to parse output.
18813 2003-12-08  Zoltan Varga  <vargaz@freemail.hu>
18815         * codegen.cs (Init): Create the dynamic assembly with 
18816         AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
18818 2003-12-02 Ben Maurer  <bmaurer@users.sourceforge.net>
18820         * support.cs: Make the PtrHashtable use only one
18821         instance of its comparer.
18823 2003-11-30  Zoltan Varga  <vargaz@freemail.hu>
18825         * typemanager.cs: Fix lookup of GetNamespaces.
18827 2003-11-29  Miguel de Icaza  <miguel@ximian.com>
18829         * expression.cs: Removed redundant line.
18831         * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
18832         ArrayLists, use for loops with bounds.  
18834         * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
18835         arraylist.
18837         * expression.cs (Invocation.OverloadResolve): Avoid foreach on
18838         arraylists, use for loop with bounds.
18840         The above three changes give us a 0.071 second performance
18841         improvement out of 3.294 seconds down to 3.223.  On my machine
18842         the above changes reduced the memory usage by 1,387 KB during
18843         compiler bootstrap.
18845         * cs-parser.jay (QualifiedIdentifier): New class used to represent
18846         QualifiedIdentifiers.  Before we created a new string through
18847         concatenation, and mostly later on, the result would be
18848         manipulated by DecomposeQI through string manipulation.
18850         This reduced the compiler memory usage for bootstrapping from
18851         59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
18852         compile times in 0.05 seconds.
18854 2003-11-28  Dick Porter  <dick@ximian.com>
18856         * support.cs: Do string compares with the Invariant culture.
18858         * rootcontext.cs: 
18859         * gen-treedump.cs: 
18860         * expression.cs: 
18861         * driver.cs: 
18862         * decl.cs: 
18863         * codegen.cs: 
18864         * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
18865         the comparison is done with the Invariant culture.
18867 2003-11-27  Miguel de Icaza  <miguel@ximian.com>
18869         * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
18870         GetEnumerator method.
18872         (ProbeCollectionType): Iterate starting at the most specific type
18873         upwards looking for a GetEnumerator
18875         * expression.cs: Shift count can be up to 31 for int/uint and 63
18876         for long/ulong.
18878 2003-11-26  Miguel de Icaza  <miguel@ximian.com>
18880         * statement.cs (Block.LookupLabel): Also look for the label on the
18881         children blocks.  Use a hash table to keep track of visited
18882         nodes. 
18884         * cfold.cs (IntConstant to UIntConstant mapping): Only return if
18885         we actually did transform the other operand, otherwise fall back
18886         to the common codepath that casts to long.
18888         * cs-tokenizer.cs: Use the same code pattern as the int case.
18889         Maybe I should do the parsing myself, and avoid depending on the
18890         Parse routines to get this done.
18892 2003-11-25  Miguel de Icaza  <miguel@ximian.com>
18894         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
18895         which fixes bug 51347.  This time test it.
18897         * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
18898         attributes for example can not tell the difference between these.
18899         The difference was only a syntax feature of the language. 
18901         * attribute.cs: Apply attributes to delegates.
18903         * delegate.cs: Call the apply attributes method.
18905 2003-11-24  Miguel de Icaza  <miguel@ximian.com>
18907         * convert.cs (TryImplicitIntConversion): One line bug fix: we were
18908         comparing 0 vs Byte.MinValue, not the value
18910         (ImplicitConversionRequired): When reporting a conversion error,
18911         use error 31 to print out the constant error instead of the
18912         simpler 29.
18914         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
18915         which fixes bug 51347.
18917 2003-11-22  Miguel de Icaza  <miguel@ximian.com>
18919         * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen) 
18920         which fixes the -warnaserror command line option.
18922 2003-11-21  Miguel de Icaza  <miguel@ximian.com>
18924         * cfold.cs (DoNumericPromotions): During constant folding of
18925         additions on UIntConstant, special case intconstants with
18926         IntConstants like we do on the expression binary operator. 
18928 2003-11-12  Miguel de Icaza  <miguel@ximian.com>
18930         * convert.cs (ImplicitReferenceConversion): We were missing a case
18931         (System.Enum are not value types or class types, so we need to
18932         classify them separatedly).
18934         * driver.cs: We do not support error 2007.
18936 2003-11-12 Jackson Harper <jackson@ximian.com>
18938         * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
18939         system directory. Also use the full file name so users can
18940         libraries names mscorlib-o-tron.dll in a non system dir.
18942 2003-11-10  Martin Baulig  <martin@ximian.com>
18944         * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
18945         (TypeManager.InitCoreTypes): Initialize them here, but instead of
18946         calling `ResolveType()' on them, directly assign their `Type'.
18948 2003-11-08  Martin Baulig  <martin@ximian.com>
18950         * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
18951         return value and the `out parent' parameter.
18952         (TypeContainer.DefineType): Moved the CS0644 check into
18953         GetClassBases().  Don't pass the interface types to the
18954         `builder.DefineType()'/`builder.DefineNestedType()', but resolve
18955         them later and then call `TypeBuilder.AddInterfaceImplementation()'.
18957         * ecore.cs (TypeExpr.IsAttribute): New property.
18958         (TypeExpr.GetInterfaces): New method.
18960         * interface.cs (Interface.GetInterfaceTypeByName): Return a
18961         TypeExpr instead of a Type.
18962         (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
18963         (Interface.DefineType): Don't pass the interface types to the
18964         `builder.Definetype()'/`builder.DefineNestedType()', but resolve
18965         them later and then call `TypeBulider.AddInterfaceImplementation()'.
18967         * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
18968         instead of a `Type[]'.
18969         (TypeManager.RegisterBuilder): Likewise.
18970         (TypeManager.AddUserInterface): Likewise.
18971         (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
18972         `Type[]' and also return a `TypeExpr[]'.
18973         (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
18975 2003-11-08  Martin Baulig  <martin@ximian.com>
18977         * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
18978         Expression.     
18980 2003-11-08  Martin Baulig  <martin@ximian.com>
18982         * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
18983         TypeManager.ResolveExpressionTypes().
18985         * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
18986         instead of an Expression.
18987         (TypeExpr): This is now an abstract base class for `TypeExpression'.
18988         (TypeExpression): New public class; formerly known as `TypeExpr'.
18990         * expression.cs (ComposedCast): Derive from TypeExpr.
18992         * typemanager.cs (TypeManager.system_*_expr): These are now
18993         TypExpr's instead of Expression's.
18994         (TypeManager.ResolveExpressionTypes): New public static function;
18995         called from DeclSpace.GetTypeResolveEmitContext() to resolve all
18996         of them.        
18998 2003-11-06  Miguel de Icaza  <miguel@ximian.com>
19000         * expression.cs (New.DoResolve): Do not dereference value that
19001         might be a null return.
19003         * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
19004         sure that the constant value has the right type.  Fixes an
19005         unreported bug, similar to 50425.
19007         * const.cs (Const.LookupConstantValue): Call
19008         ImplicitStandardConversionExists before doing a conversion to
19009         avoid havng the TypeManager.ChangeType do conversions.
19011         Reduced the number of casts used
19013         (Const.ChangeType): New routine to enable reuse of the constant
19014         type changing code from statement.
19016         * typemanager.cs (ChangeType): Move common initialization to
19017         static global variables.
19019         Fixes #50425.
19021         * convert.cs (ImplicitReferenceConversion): Somehow we allowed
19022         every value type to go through, even if it was void.  Fix that. 
19024         * cs-tokenizer.cs: Use is_identifier_start_character on the start
19025         character of the define, and the is_identifier_part_character for
19026         the rest of the string.
19028 2003-11-05  Miguel de Icaza  <miguel@ximian.com>
19030         * expression.cs (UnaryMutator.EmitCode): When I updated
19031         LocalVariableReference.DoResolve, I overdid it, and dropped an
19032         optimization done on local variable references.
19034 2003-11-04  Miguel de Icaza  <miguel@ximian.com>
19036         * ecore.cs: Convert the return from Ldlen into an int.
19038 2003-10-20  Miguel de Icaza  <miguel@ximian.com>
19040         * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
19041         the accessibility, this is a special case for toplevel non-public
19042         classes (internal for instance).
19044 2003-10-20  Nick Drochak <ndrochak@gol.com>
19046         * ecore.cs: Fix typo and build.  Needed another right paren.
19048 2003-10-19  Miguel de Icaza  <miguel@ximian.com>
19050         * ecore.cs: Applied fix from Ben Maurer.   We were handling in the
19051         `internal' case regular and protected, but not allowing protected
19052         to be evaluated later.  Bug 49840
19054 2003-10-15  Miguel de Icaza  <miguel@ximian.com>
19056         * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
19057         to kb.Nlast, and not the kb.nFirst to isolate the switch
19058         statement.
19060         Extract the underlying type, so enumerations of long/ulong are
19061         treated like long/ulong.
19063 2003-10-14  Miguel de Icaza  <miguel@ximian.com>
19065         * expression.cs (New): Overload the meaning of RequestedType to
19066         track the possible creation of the NewDelegate type, since
19067         DoResolve is invoked more than once for new constructors on field
19068         initialization.
19070         See bugs: #48800 and #37014
19072         * cs-parser.jay (declare_local_constants): Take an arraylist
19073         instead of a single constant.
19075         (local_constant_declaration): It should take a
19076         constant_declarators, not a constant_declarator.  Fixes 49487
19078         * convert.cs: Fix error report.
19080 2003-10-13 Jackson Harper <jackson@ximian.com>
19082         * typemanager.cs (TypeToCoreType): Add float and double this fixes
19083         bug #49611
19085 2003-10-09  Martin Baulig  <martin@ximian.com>
19087         * class.cs (MethodCore): Added additional `DeclSpace ds' argument
19088         to the .ctor.
19089         (MethodCore.DoDefineParameters): Removed the TypeContainer
19090         argument; use the DeclSpace which was passed to the .ctor instead.
19091         (MethodCore.CheckParameter): Take a DeclSpace instead of a
19092         TypeContainer; we only need a DeclSpace here.
19094 2003-10-09  Martin Baulig  <martin@ximian.com>
19096         * class.cs (MethodData): Added additional `DeclSpace ds' argument
19097         to the .ctor.
19098         (MethodData.Define, MethodData.Emit): Pass the `ds' to the
19099         EmitContext's .ctor.    
19101 2003-10-09  Martin Baulig  <martin@ximian.com>
19103         * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
19104         (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
19105         AsAccessible(), moved them as well.
19107         * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
19109 2003-10-08  Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
19111         * cs-parser.jay : Renamed yyName to yyNames related to jay.
19113 2003-10-07  Miguel de Icaza  <miguel@ximian.com>
19115         * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
19116         generation for >=, as spotted by Paolo, bug 48679.  
19117         Patch from David Waite.
19119         * cs-tokenizer.cs: Add handling for #pragma.
19121         * cs-parser.jay: Allow for both yield and yield return in the
19122         syntax.  The anti-cobolization of C# fight will go on!
19124         * class.cs (TypeBuilder.DefineType): Catch error condition here
19125         (Parent.DefineType erroring out and returning null).
19127         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
19128         coping with enumerations variables, we were mistakenly processing
19129         them as a regular value type instead of built-in types.  Fixes the
19130         bug #48063
19132         * typemanager.cs (IsBuiltinOrEnum): New method.
19134 2003-09-30  Miguel de Icaza  <miguel@ximian.com>
19136         * cs-parser.jay: Upgrade: yield now needs the return clause.
19138 2003-09-19  Martin Baulig  <martin@ximian.com>
19140         * decl.cs (MemberCache.SetupCacheForInterface): Take a
19141         `MemberCache parent' argument.  Normally, an interface doesn't
19142         have a parent type except System.Object, but we use this in gmcs
19143         for generic type parameters.
19145 2003-09-18  Martin Baulig  <martin@ximian.com>
19147         * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
19148         on `type.IsInterface'; don't check whether the type has a parent
19149         to determine whether it's an interface.
19151 2003-09-15  Martin Baulig  <martin@ximian.com>
19153         * class.cs (TypeContainer.DefineType): Added an error flag to
19154         avoid reporting duplicate CS0146's ("class definition is
19155         circular.").
19157         * driver.cs (Driver.MainDriver): Abort if
19158         RootContext.ResolveTree() reported any errors.
19160 2003-09-07  Martin Baulig  <martin@ximian.com>
19162         * report.cs (Error, Warning): Added overloaded versions which take
19163         a `params object[] args' and call String.Format().
19165 2003-09-07  Martin Baulig  <martin@ximian.com>
19167         * decl.cs (DeclSpace..ctor): Don't call
19168         NamespaceEntry.DefineName() here; do it in RecordDecl() which is
19169         called from Tree.RecordDecl().  Fixes the CS0101 reporting.
19170         (DeclSpace.RecordDecl): New method.
19172         * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
19174 2003-09-02  Ravi Pratap  <ravi@ximian.com>
19176         * attribute.cs (CheckAttributeTarget): Ensure that we allow return
19177         value attributes to be applied to ParameterBuilders.
19179         * class.cs (MethodCore.LabelParameters): Make static and more
19180         generic so that it can be used from other places - like interface
19181         methods, for instance.
19183         * interface.cs (Interface.Emit): Call LabelParameters before
19184         emitting attributes on the InterfaceMethod.
19186 2003-08-26  Martin Baulig  <martin@ximian.com>
19188         * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
19189         resolving aliases; fixes #47927.
19191 2003-08-26  Martin Baulig  <martin@ximian.com>
19193         * statement.cs (Using.DoResolve): This is internally emitting a
19194         try/finally clause, so we need to set ec.NeedExplicitReturn if we
19195         do not always return.  Fixes #47681.
19197 2003-08-26  Martin Baulig  <martin@ximian.com>
19199         * decl.cs (MemberCore): Moved WarningNotHiding(),
19200         Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
19201         into MemberBase.
19202         (AdditionResult): Make this nested in DeclSpace.
19203         (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
19204         argument; call NamespaceEntry.Define() unless we're nested in a
19205         class or struct.
19207         * namespace.cs (Namespace.DefineName): New public function.  This
19208         is called from DeclSpace's .ctor to add 
19209         (Namespace.Lookup): Include DeclSpaces in the lookup.
19211         * class.cs (Operator): Derive from MemberBase, not MemberCore.
19213         * const.cs (Const): Derive from MemberBase, not MemberCore.     
19215 2003-08-25  Martin Baulig  <martin@ximian.com>
19217         * convert.cs (Convert.ExplicitReferenceConversion): When
19218         converting from an interface type to a class, unbox if the target
19219         type is a struct type.  Fixes #47822.
19221 2003-08-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19223         * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
19224         #47854.
19226 2003-08-22  Martin Baulig  <martin@ximian.com>
19228         * class.cs (TypeManager.DefineType): When defining a nested type,
19229         call DefineType() on our parent; fixes #47801.
19231 2003-08-22  Martin Baulig  <martin@ximian.com>
19233         * class.cs (MethodData.Define): While checking if a method is an
19234         interface implementation, improve the test a bit more to fix #47654.
19236 2003-08-22  Martin Baulig  <martin@ximian.com>
19238         * expression.cs (Probe.DoResolve): Check whether `expr' resolved
19239         correctly; fixes #47722.
19241 2003-08-22  Martin Baulig  <martin@ximian.com>
19243         * expression.cs (UnaryMutator.ResolveVariable): If the target is a
19244         LocalVariableReference, ensure it's not read-only.  Fixes #47536.
19246         * statement.cs (Fixed.DoResolve): Make all variables read-only. 
19248 2003-08-22  Martin Baulig  <martin@ximian.com>
19250         * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
19251         can only be assigned in static constructors.  Fixes #47161.
19253 2003-08-22  Martin Baulig  <martin@ximian.com>
19255         Rewrote and improved the flow analysis code.
19257         * flowbranching.cs (FlowBranching): Make this class abstract.
19258         (FlowBranching.CreateBranching): New static function to create a
19259         new flow branching.
19260         (FlowBranchingBlock, FlowBranchingException): New classes.
19261         (FlowBranching.UsageVector.Type): New public readonly field.
19262         (FlowBranching.UsageVector.Breaks): Removed the setter.
19263         (FlowBranching.UsageVector.Returns): Removed the setter.
19264         (FlowBranching.UsageVector): Added Break(), Return(),
19265         NeverReachable() and Throw() methods to modify the reachability.
19266         (FlowBranching.UsageVector.MergeChildren): Removed, this is now
19267         done by FlowBranching.Merge().
19268         (FlowBranching.UsageVector.MergeChild): New method; merges the
19269         merge result into the current vector.
19270         (FlowBranching.Merge): New abstract method to merge a branching.
19272 2003-08-12  Martin Baulig  <martin@ximian.com>
19274         * expression.cs (Indirection.CacheTemporaries): Create the
19275         LocalTemporary with the pointer type, not its element type.
19277 2003-08-10  Miguel de Icaza  <miguel@ximian.com>
19279         * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
19280         token was a keyword or not.
19282         Add `error' options where an IDENTIFIER was expected;  Provide
19283         CheckToken and CheckIdentifierToken convenience error reporting
19284         functions. 
19286         Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
19288         * decl.cs: Rename `NamespaceEntry Namespace' public field into
19289         NameSpaceEntry NameSpaceEntry.
19291         (LookupInterfaceOrClass): Avoid creating a full qualified name
19292         from namespace and name: avoid doing lookups when we know the
19293         namespace is non-existant.   Use new Tree.LookupByNamespace which
19294         looks up DeclSpaces based on their namespace, name pair.
19296         * driver.cs: Provide a new `parser verbose' to display the
19297         exception thrown during parsing.  This is turned off by default
19298         now, so the output of a failure from mcs is more graceful.
19300         * namespace.cs: Track all the namespaces defined in a hashtable
19301         for quick lookup.
19303         (IsNamespace): New method
19305 2003-08-09  Miguel de Icaza  <miguel@ximian.com>
19307         * namespace.cs: Remove redundant call;  Avoid using MakeFQN when
19308         we know that we need to concatenate (full typename can never be
19309         null). 
19311         * class.cs: ditto.
19313         * statement.cs: Use a bitfield;  Do not initialize to null things
19314         which are done by the constructor by default.
19316         * cs-parser.jay: bug fix, parameter was 4, not 3.
19318         * expression.cs: Just use the property;
19320         * statement.cs: No need for GetVariableInfo method.
19322 2003-08-08  Martin Baulig  <martin@ximian.com>
19324         * flowanalysis.cs (FlowReturns): This is now nested in the
19325         `FlowBranching' class.
19326         (MyBitVector): Moved this here from statement.cs.
19327         (FlowBranching.SiblingType): New enum type.
19328         (FlowBranching.CreateSibling): Added `SiblingType' argument.
19330 2003-08-07  Martin Baulig  <martin@ximian.com>
19332         * flowanalysis.cs (FlowBranchingType): This is now nested in the
19333         `FlowBranching' class and called `BranchingType'.
19335 2003-08-07  Martin Baulig  <martin@ximian.com>
19337         * flowanalysis.cs: Moved all the control flow analysis code into
19338         its own file.
19340 2003-08-07  Martin Baulig  <martin@ximian.com>
19342         * assign.cs (Assign.DoResolve): `target' must either be an
19343         IAssignMethod or an EventAccess; report a CS0131 otherwise.  Fixes
19344         #37319.
19346 2003-08-07  Miguel de Icaza  <miguel@ximian.com>
19348         * expression.cs (BinaryMethod): This kind of expression is created by the
19349         Binary class if it determines that the operator has to be handled
19350         by a method.
19352         (BinaryDelegate): This kind of expression is created if we are
19353         dealing with a + or - operator on delegates.
19355         (Binary): remove method, argumetns, and DelegateOperator: when
19356         dealing with methods, 
19358         * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
19360         * statement.cs (Block): use bitfields for the three extra booleans
19361         we had in use.   Remove unused topblock parameter.
19363         * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
19365         * assign.cs: Drop extra unneeded tests.
19367 2003-08-06  Miguel de Icaza  <miguel@ximian.com>
19369         * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
19371         * statement.cs (Foreach): Use VariableStorage instead of
19372         LocalBuilders.   
19374         * codegen.cs (VariableStorage): New class used by clients that
19375         require a variable stored: locals or fields for variables that
19376         need to live across yield.
19378         Maybe provide a convenience api for EmitThis+EmitLoad?
19380         (GetTemporaryLocal, FreeTemporaryLocal): Recycle
19381         these bad boys.
19383 2003-08-05  Miguel de Icaza  <miguel@ximian.com>
19385         * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
19386         RemapParameterLValue): New methods that are used to turn a
19387         precomputed FieldInfo into an expression like this:
19389                 instance.FieldInfo
19391         The idea is to use this instead of making LocalVariableReference
19392         have more than one meaning.
19394         * cs-parser.jay: Add error production to BASE.
19396         * ecore.cs: Deal with TypeManager.GetField returning null, which
19397         is now a valid return value.
19399         (FieldExprNoAddress): New expression for Fields whose address can
19400         not be taken.
19402         * expression.cs (LocalVariableReference): During the resolve
19403         phases, create new expressions if we are in a remapping context.
19404         Remove code that dealt with remapping here.
19406         (ParameterReference): same.
19408         (ProxyInstance): New expression, like the `This' expression, but
19409         it is born fully resolved.  We know what we are doing, so remove
19410         the errors that are targeted to user-provided uses of `this'.
19412         * statement.cs (Foreach): our variable is now stored as an
19413         Expression;  During resolution, follow the protocol, dont just
19414         assume it will return this.
19416 2003-08-06  Martin Baulig  <martin@ximian.com>
19418         * support.cs (SeekableStreamReader.cs): New public class.
19420         * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
19421         SeekableStreamReader instead of the normal StreamReader.
19423 2003-08-04  Martin Baulig  <martin@ximian.com>
19425         * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
19426         CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
19427         deambiguate casts and delegate invocations.
19428         (parenthesized_expression): Use the new tokens to ensure this is
19429         not a cast of method invocation.
19431         * cs-tokenizer.cs (is_punct): Return one of the new special tokens
19432         when reading a `)' and Deambiguate_CloseParens () was previously
19433         called.
19435         * expression.cs (ParenthesizedExpression): New class.  This is
19436         just used for the CS0075 test.
19437         (Binary.DoResolve): Check for CS0075.   
19439 2003-07-29  Ravi Pratap  <ravi@ximian.com>
19441         * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
19442         Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
19443         reference comparison.
19445         (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
19446         examine the ReturnType for equality - this is necessary in the
19447         cases of implicit and explicit operators whose signature also
19448         includes the return type.
19450 2003-07-26  Miguel de Icaza  <miguel@ximian.com>
19452         * namespace.cs: Cache the result of the namespace computation,
19453         instead of computing it every time.
19455 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
19457         * decl.cs: Use a global arraylist that we reuse over invocations
19458         to avoid excesive memory consumption.  Reduces memory usage on an
19459         mcs compile by one meg (45 average).
19461         * typemanager.cs (LookupTypeReflection): In .NET pointers are
19462         private, work around that.
19464 2003-07-23  Miguel de Icaza  <miguel@ximian.com>
19466         * literal.cs (IntLiteral): Define Zero and One static literals. 
19468         * cs-parser.jay (integer_literal): use static literals to reduce
19469         memory usage for the most used literals (0, 1 and -1).  211kb
19470         reduced in memory usage.
19472         Replace all calls to `new ArrayList' with `new
19473         ArrayList(4)' which is a good average number for most allocations,
19474         and also requires only 16 bytes of memory for its buffer by
19475         default. 
19477         This reduced MCS memory usage in seven megabytes for the RSS after
19478         bootstrapping.
19480 2003-07-28  Ravi Pratap  <ravi@ximian.com>
19482         * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
19483         handle params methods the correct way by forming only one
19484         applicable set with params and normal methods in them. Earlier we
19485         were looking at params methods only if we found no normal methods
19486         which was not the correct thing to do.
19488         (Invocation.BetterFunction): Take separate arguments indicating
19489         when candidate and the best method are params methods in their
19490         expanded form.
19492         This fixes bugs #43367 and #46199.
19494         * attribute.cs: Documentation updates.
19496         (CheckAttribute): Rename to CheckAttributeTarget.
19497         (GetValidPlaces): Rename to GetValidTargets.
19499         * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
19500         bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
19502         Fixes bug #44468.
19504 2003-07-28  Martin Baulig  <martin@ximian.com>
19506         * class.cs (TypeContainer.DefineMembers): Use the base type's full
19507         name when looking up the base class of a nested class.  Fixes #46977.
19509 2003-07-26  Martin Baulig  <martin@ximian.com>
19511         * expression.cs (Indexers.Indexer): New nested struct; contains
19512         getter, setter and the indexer's type.
19513         (Indexers.Properties): This is now an ArrayList of
19514         Indexers.Indexer's.
19515         (IndexerAccess.DoResolveLValue): Correctly set the type if the
19516         indexer doesn't have any getters.
19518         * assign.cs (Assign.DoResolve): Also do the implicit conversions
19519         for embedded property and indexer assignments.
19521 2003-07-26  Martin Baulig  <martin@ximian.com>
19523         * cs-tokenizer.cs (Tokenizer.xtoken): Report a CS1040 if a
19524         preprocessor directive is not the first non-whitespace character
19525         on a line.
19527 2003-07-26  Martin Baulig  <martin@ximian.com>
19529         * namespace.cs (NamespaceEntry.Lookup): New method; rewrote the
19530         namespace parsing, follow the spec more closely.
19532         * rootcontext.cs (RootContext.NamespaceLookup): Use the new
19533         NamespaceEntry.Lookup().
19535 2003-07-25  Martin Baulig  <martin@ximian.com>
19537         * MethodCore.cs (OverridesSomething): New public field; it's set
19538         from TypeContainer.DefineMembers if this method overrides
19539         something (which doesn't need to be a method).  Fix #39462.
19541 2003-07-25  Ravi Pratap  <ravi@ximian.com>
19543         * typemanager.cs (GetMembers): Ensure that the list of members is
19544         reversed. This keeps things in sync.
19546         * attribute.cs (Attribute.CheckAttribute): Break as soon as we
19547         find an AttributeUsage attribute.
19549         * expression.cs (Invocation.OverloadResolve): Perform the check
19550         which disallows Invoke to be directly called on a Delegate.
19552         (Error_InvokeOnDelegate): Report error cs1533.
19554 2003-07-25  Martin Baulig  <martin@ximian.com>
19556         * expression.cs (Indexers.GetIndexersForType): Only look in the
19557         interface hierarchy if the requested type is already an
19558         interface.  Fixes #46788 while keeping #46502 fixed.
19560 2003-07-25  Martin Baulig  <martin@ximian.com>
19562         * class.cs (TypeContainer.DefineMembers): Check whether all
19563         readonly fields have been assigned and report warning CS0649 if
19564         not.
19566         * statement.cs (LocalInfo.IsFixed): Always return true if this is
19567         a valuetype.
19569 2003-07-24  Ravi Pratap  <ravi@ximian.com>
19571         * decl.cs (MemberCache.AddMethods): Reverse the order of the array
19572         returned from GetMethods to make things consistent with the
19573         assumptions MCS makes about ordering of methods.
19575         This should comprehensively fix bug #45127 and it does :-)
19577         * ecore.cs (MethodGroupExpr.DeclaringType): Correct bug - the
19578         ordering is actually reverse.
19580         * Clean up some debug messages I left lying around.
19582         * interface.cs (Populate*): Get rid of code which emits attributes
19583         since the stage in which we emit attributes is the 'Emit' stage,
19584         not the define stage.
19586         (Emit): Move attribute emission for interface members here.
19588 2003-07-22  Ravi Pratap  <ravi@ximian.com>
19590         * expression.cs (Invocation.OverloadResolve): Follow the spec more
19591         closely: we eliminate methods in base types when we have an
19592         applicable method in a top-level type.
19594         Please see section 14.5.5.1 for an exact description of what goes
19595         on. 
19597         This fixes bug #45127 and a host of other related to corlib compilation.
19599         * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
19600         array is the method corresponding to the top-level type (this is
19601         because of the changes made to icall.c) so we change this
19602         accordingly.
19604         (MethodGroupExpr.Name): This too.
19606         * typemanager.cs (GetElementType): New method which does the right
19607         thing when compiling corlib. 
19609         * everywhere: Make use of the above in the relevant places.
19611 2003-07-22  Martin Baulig  <martin@ximian.com>
19613         * cs-parser.jay (invocation_expression): Moved
19614         `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
19615         `cast_expression', but create a InvocationOrCast which later
19616         resolves to either an Invocation or a Cast.
19618         * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
19619         method; call this before EmitStatement() to make sure that this
19620         expression can be used as a statement.
19622         * expression.cs (InvocationOrCast): New class; resolves to either
19623         an Invocation or a Cast.
19625         * statement.cs (StatementExpression): Call ResolveStatement() on
19626         the ExpressionStatement before emitting it.
19628 2003-07-21  Martin Baulig  <martin@ximian.com>
19630         * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
19631         `ref' and `out' attributes match; fixes #46220.
19632         (MemberAccess.ResolveMemberAccess): You can't reference a type
19633         through an expression; fixes #33180.
19634         (Indexers.GetIndexersForType): Don't return the indexers from
19635         interfaces the class implements; fixes #46502.
19637 2003-07-21  Martin Baulig  <martin@ximian.com>
19639         * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
19640         CS0661 checks; fixes bug #30442.
19642 2003-07-21  Martin Baulig  <martin@ximian.com>
19644         * decl.cs (AdditionResult): Added `Error'.
19646         * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
19648         * typemanager.cs (TypeManager.ChangeType): Catch exceptions;
19649         makes cs0031.cs actually work.
19651 2003-07-20  Martin Baulig  <martin@ximian.com>
19653         * namespace.cs: Fixed that bug which caused a crash when compiling
19654         the debugger's GUI.
19656 2003-07-20  Miguel de Icaza  <miguel@ximian.com>
19658         * typemanager.cs (LookupTypeReflection): Never expose types which
19659         are NotPublic, NestedPrivate, NestedAssembly, or
19660         NestedFamANDAssem.  We used to return these, and later do a check
19661         that would report a meaningful error, but the problem is that we
19662         would not get the real match, if there was a name override.
19664 2003-07-18  Miguel de Icaza  <miguel@ximian.com>
19666         * namespace.cs (Namespace, Name): Do not compute the namespace
19667         name dynamically, compute it in the constructor.  This reduced
19668         memory usage by 1697 KB.
19670         * driver.cs: Use --pause to pause at the end.
19672 2003-07-17  Peter Williams  <peter@newton.cx>
19674         * Makefile: Change the name of the test target so that it doesn't
19675         conflict with the recursive test target.
19677 2003-07-17  Miguel de Icaza  <miguel@ximian.com>
19679         * expression.cs (LocalVariableReference.Emit, EmitAssign,
19680         AddressOf): Do not use EmitThis, that was wrong, use the actual
19681         this pointer.
19683 2003-07-15  Miguel de Icaza  <miguel@ximian.com>
19685         * class.cs (MethodData.Define): While checking if a method is an
19686         interface implementation, improve the test: If we are not public
19687         (use new test here: use the computed MethodAttributes directly,
19688         instead of the parsed modifier flags) check if the `implementing'
19689         method comes from an interface or not.
19691         * pending.cs (VerifyPendingMethods): Slightly better error
19692         message.
19694         * makefile: add test target that does the mcs bootstrap.
19696 2003-07-16  Ravi Pratap  <ravi@ximian.com>
19698         * interface.cs (Define): Do nothing here since there are no
19699         members to populate etc. Move the attribute emission out of here
19700         since this was just totally the wrong place to put it. Attribute
19701         application happens during the 'Emit' phase, not in the 'Define'
19702         phase.
19704         (Emit): Add this method and move the attribute emission here
19706         * rootcontext.cs (EmitCode): Call the Emit method on interface
19707         types too.
19709 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
19711         * expression.cs (OverloadResolve): Report error only if Location
19712         is not 'Null' which means that there was a probe going on.
19714 2003-07-14  Martin Baulig  <martin@ximian.com>
19716         * expression.cs (ConditionalLogicalOperator): New public class to
19717         implement user defined conditional logical operators.
19718         This is section 14.11.2 in the spec and bug #40505.
19720 2003-07-14  Martin Baulig  <martin@ximian.com>
19722         * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
19724 2003-07-14  Martin Baulig  <martin@ximian.com>
19726         * codegen.cs (EmitContext.InFixedInitializer): New public field.
19728         * ecore.cs (IVariable.VerifyFixed): New interface method.
19730         * expression.cs (Unary.ResolveOperator): When resolving the `&'
19731         operator, check whether the variable is actually fixed.  Fixes bug
19732         #36055.  Set a variable definitely assigned when taking its
19733         address as required by the spec.
19735         * statement.cs (LocalInfo.IsFixed): New field.
19736         (LocalInfo.MakePinned): Set `IsFixed' to true.
19738 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
19740         * attribute.cs (Attribute.Resolve): While doing a Member lookup
19741         for .ctors, ensure that we only ask for members declared in the
19742         attribute type (BindingFlags.DeclaredOnly).
19744         Fixes bug #43632.
19746         * expression.cs (Error_WrongNumArguments): Report error 1501
19747         correctly the way CSC does.
19749 2003-07-13  Martin Baulig  <martin@ximian.com>
19751         * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
19752         lookup on the fully qualified name, to make things like "X.X" work
19753         where "X.X" is a fully qualified type name, but we also have a
19754         namespace "X" in the using list.  Fixes #41975.
19756 2003-07-13  Martin Baulig  <martin@ximian.com>
19758         * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
19759         function. If we're a CompoundAssign, we need to create an embedded
19760         CompoundAssign, not an embedded Assign.
19761         (Assign.DoResolve): Make this work for embedded CompoundAssign's.
19762         Fixes #45854.
19764 2003-07-13  Martin Baulig  <martin@ximian.com>
19766         * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
19767         work to fix bug #46088.
19769 2003-07-13  Ravi Pratap <ravi@ximian.com>
19771         * class.cs (Operator.Emit): Do not emit attributes here - it is
19772         taken care of by the Method class that we delegate too. This takes
19773         care of bug #45876.
19775 2003-07-10  Martin Baulig  <martin@ximian.com>
19777         * expression.cs (TypeOfVoid): New class.
19778         (TypeOf): Report a CS0673 if it's System.Void.  Fixes #42264.
19780 2003-07-10  Martin Baulig  <martin@ximian.com>
19782         * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
19783         bug #35957.
19785 2003-07-10  Martin Baulig  <martin@ximian.com>
19787         * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
19788         not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
19790         * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
19792         * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
19794 2003-07-10  Martin Baulig  <martin@ximian.com>
19796         * expression.cs (ArrayCreation): Don't use a byte blob for arrays
19797         of decimal.  Fixes #42850.
19799         NOTE: I also fixed the created byte blob, but this doesn't work on
19800         the MS runtime and csc never produces any byte blobs for decimal
19801         arrays.
19803 2003-07-10  Martin Baulig  <martin@ximian.com>
19805         * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
19806         structs; fixes #32068.
19807         (Block.AddChildVariableNames): Fixed #44302.
19809 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19811         * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
19813 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
19815         * attribute.cs: And this test is onger needed.
19817 2003-07-08  Martin Baulig  <martin@ximian.com>
19819         * rootcontext.cs (RootContext.NamespaceLookup): Ignore
19820         inaccessible types.  Fixes #36313.
19822         * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
19824         * namespace.cs (NamespaceEntry): Create implicit entries for all
19825         namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
19826         implicit entries for N1.N2 and N1.
19828 2003-07-08  Martin Baulig  <martin@ximian.com>
19830         Rewrote the handling of namespaces to fix a lot of the issues
19831         wrt. `using' aliases etc.
19833         * namespace.cs (Namespace): Splitted this class into a
19834         per-assembly `Namespace' and a per-file `NamespaceEntry'.
19836         * typemanager.cs (TypeManager.IsNamespace): Removed.
19837         (TypeManager.ComputeNamespaces): Only compute namespaces from
19838         loaded assemblies here, not the namespaces from the assembly we're
19839         currently compiling.
19841 2003-07-08  Martin Baulig  <martin@ximian.com>
19843         * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
19845 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
19847         * typemanager.cs: Reverted patch from Gonzalo, my previous patch
19848         already fixed it.  
19850         I thought about the memory savings here, but LookupTypeReflection
19851         is used under already very constrained scenarios.  Compiling
19852         corlib or mcs only exposes one hit, so it would not really reduce
19853         any memory consumption.
19855 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19857         * typemanager.cs: fixes bug #45889 by only adding public types from
19858         other assemblies to the list of known types.
19860 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
19862         * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
19863         on the type we resolved.
19865 2003-07-05  Martin Baulig  <martin@ximian.com>
19867         * pending.cs (PendingImplementation.ParentImplements): Don't
19868         create the proxy if the parent is abstract.
19870         * class.cs (TypeContainer.DefineIndexers): Process explicit
19871         interface implementations first.  Fixes #37714.
19873 2003-07-04  Miguel de Icaza  <miguel@ximian.com>
19875         * expression.cs (MemberAccess.ResolveMemberAccess): Events are
19876         defined recursively;  but since we modify the input parameters
19877         (left is set to `this' temporarily), we reset this value if the
19878         left_is_explicit is false, which gives the original semantics to
19879         the code.  
19881         * literal.cs (NullPointer): new class used to represent a null
19882         literal in a pointer context.
19884         * convert.cs (Convert.ImplicitReferenceConversion): Is the target
19885         type is a pointer, use a NullPointer object instead of a
19886         NullLiteral.   Closes 43687
19888         (ExplicitConversion): Convert pointer values using
19889         the conv opcode to the proper type.
19891         * ecore.cs (New): change ValueTypeVariable property into a method,
19892         that returns whether the valuetype is suitable for being used.
19894         * expression.cs (Binary.DoNumericPromotions): Only return if we
19895         the int constant was a valid uint, and we can return both left and
19896         right as uints.  If not, we continue processing, to trigger the
19897         type conversion.  This fixes 39018.
19899         * statement.cs (Block.EmitMeta): During constant resolution, set
19900         the CurrentBlock property on the emitcontext, so that we resolve
19901         constants propertly.
19903 2003-07-02  Martin Baulig  <martin@ximian.com>
19905         * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
19906         (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
19908         * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
19909         than emitting it here.
19911         * statement.cs: Fixed some more flow analysis bugs.
19913 2003-07-02  Martin Baulig  <martin@ximian.com>
19915         * class.cs (MethodData.Define): When implementing interface
19916         methods, set Final unless we're Virtual.
19918         * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
19919         check work for interface methods.
19921 2003-07-01  Martin Baulig  <martin@ximian.com>
19923         * ecore.cs (EmitContext.This): Replaced this property with a
19924         GetThis() method which takes a Location argument.  This ensures
19925         that we get the correct error location for a CS0188.
19927 2003-07-01  Miguel de Icaza  <miguel@ximian.com>
19929         * ecore.cs: (Convert.ConvertIntLiteral): Add test for
19930         ImplicitStandardConversion.
19932         * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
19934 2003-07-01  Zoltan Varga  <vargaz@freemail.hu>
19936         * expression.cs (ResolveOperator): Fix Concat (string, string, string)
19937         optimization.
19939 2003-06-30  Miguel de Icaza  <miguel@ximian.com>
19941         * class.cs (Constructor.Define): Turn off initlocals for unsafe
19942         constructors.
19944         (MethodData.Define): Turn off initlocals for unsafe methods.
19946 2003-06-29  Miguel de Icaza  <miguel@ximian.com>
19948         * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
19949         complete;  Fixes #37521.
19951         * delegate.cs: Use Modifiers.TypeAttr to compute the
19952         TypeAttributes, instead of rolling our own.  This makes the flags
19953         correct for the delegates.
19955 2003-06-28  Miguel de Icaza  <miguel@ximian.com>
19957         * class.cs (Constructor.Define): Set the private flag for static
19958         constructors as well.
19960         * cs-parser.jay (statement_expression): Set the return value to
19961         null, to avoid a crash when we catch an error.
19963 2003-06-24  Miguel de Icaza  <miguel@ximian.com>
19965         * cs-parser.jay: Applied patch from Jackson that adds support for
19966         extern and unsafe modifiers to destructor declarations.
19968         * expression.cs: Report error 21 if the user is trying to index a
19969         System.Array.
19971         * driver.cs: Add an error message, suggested by the bug report.
19973         * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
19974         if we do not have a ": this ()" constructor initializer.  Fixes 45149
19976 2003-06-14  Miguel de Icaza  <miguel@ximian.com>
19978         * namespace.cs: Add some information to reduce FAQs.
19980 2003-06-13  Miguel de Icaza  <miguel@ximian.com>
19982         * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
19983         underlying enumeration types.  Fixes #43915.
19985         * expression.cs: Treat ushort/short as legal values to be used in
19986         bitwise operations.
19988 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
19990         * delegate.cs: transfer custom attributes for paramenters from
19991         the delegate declaration to Invoke and BeginInvoke.
19993 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
19995         * attribute.cs: handle custom marshalers and emit marshal info
19996         for fields, too.
19998 2003-05-28  Hector E. Gomez Morales  <hgomez_36@flashmail.com>
20000         * makefile.gnu: Added anonymous.cs to the compiler sources.
20002 2003-05-28  Miguel de Icaza  <miguel@ximian.com>
20004         * iterators.cs: Change the name of the proxy class to include two
20005         underscores.
20007         * cs-parser.jay: Update grammar to include anonymous methods.
20009         * anonymous.cs: new file.
20011 2003-05-27  Miguel de Icaza  <miguel@ximian.com>
20013         * class.cs (Field.Define): Add missing test for pointers and
20014         safety. 
20016 2003-05-27  Ravi Pratap  <ravi@ximian.com>
20018         * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
20019         we use the stobj opcode.
20021         (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
20022         since it wasn't the correct fix. 
20024         It still is puzzling that we are required to use stobj for IntPtr
20025         which seems to be a ValueType.
20027 2003-05-26  Miguel de Icaza  <miguel@ximian.com>
20029         * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
20030         during regular simple name resolution.   Now, the trick is that
20031         instead of returning for processing the simplename, we do a
20032         TypeManager.LookupType (ie, a rooted lookup as opposed to a
20033         contextual lookup type).   If a match is found, return that, if
20034         not, return for further composition.
20036         This fixes long-standing 30485.
20038         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
20039         using the address to initialize an object, do an Stobj instead of
20040         using the regular Stelem.
20042         (IndexerAccess.Emit, IndexerAccess.EmitAssign):
20043         Pass `is_base_indexer' to Invocation.EmitCall instead of false.
20044         Because if we are a BaseIndexerAccess that value will be true.
20045         Fixes 43643.
20047         * statement.cs (GotoCase.Resolve): Return after reporting an
20048         error, do not attempt to continue. 
20050         * expression.cs (PointerArithmetic.Emit): If our operand is a
20051         long, convert our constants to match the operand before
20052         multiplying.  Convert to I type before adding.   Fixes 43670.
20054 2003-05-14  Ravi Pratap  <ravi@ximian.com>
20056         * enum.cs (ImplicitConversionExists) : Rename to
20057         ImplicitEnumConversionExists to remove ambiguity. 
20059         * ecore.cs (NullCast): New type of cast expression class which
20060         basically is very similar to EmptyCast with the difference being
20061         it still is a constant since it is used only to cast a null to
20062         something else
20063         (eg. (string) null)
20065         * convert.cs (ImplicitReferenceConversion): When casting a null
20066         literal, we return a NullCast.
20068         * literal.cs (NullLiteralTyped): Remove - I don't see why this
20069         should be around anymore.
20071         The renaming (reported was slightly wrong). Corrections:
20073         ConvertImplicitStandard -> ImplicitConversionStandard
20074         ConvertExplicitStandard -> ExplicitConversionStandard
20076         * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
20077         before passing them in !
20079         * convert.cs (ImplicitConversionStandard): When comparing for
20080         equal expr and target types, ensure that expr is not a
20081         NullLiteral.
20083         In general, we must not be checking (expr_type ==
20084         target_type) in the top level conversion methods
20085         (ImplicitConversion, ExplicitConversion etc). This checking is
20086         done in the methods that they delegate to.
20088 2003-05-20  Miguel de Icaza  <miguel@ximian.com>
20090         * convert.cs: Move Error_CannotConvertType,
20091         ImplicitReferenceConversion, ImplicitReferenceConversionExists,
20092         ImplicitNumericConversion, ImplicitConversionExists,
20093         ImplicitUserConversionExists, StandardConversionExists,
20094         FindMostEncompassedType, FindMostSpecificSource,
20095         FindMostSpecificTarget, ImplicitUserConversion,
20096         ExplicitUserConversion, GetConversionOperators,
20097         UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
20098         TryImplicitIntConversion, Error_CannotConvertImplicit,
20099         ConvertImplicitRequired, ConvertNumericExplicit,
20100         ExplicitReferenceConversionExists, ConvertReferenceExplicit,
20101         ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
20102         its own file.
20104         Perform the following renames:
20106         StandardConversionExists -> ImplicitStandardConversionExists
20107         ConvertImplicit -> ImplicitConversion
20108         ConvertImplicitStandard -> ImplicitStandardConversion
20109         TryImplicitIntConversion -> ImplicitIntConversion
20110         ConvertImplicitRequired -> ImplicitConversionRequired
20111         ConvertNumericExplicit -> ExplicitNumericConversion
20112         ConvertReferenceExplicit -> ExplicitReferenceConversion
20113         ConvertExplicit -> ExplicitConversion
20114         ConvertExplicitStandard -> ExplicitStandardConversion
20116 2003-05-19  Martin Baulig  <martin@ximian.com>
20118         * statement.cs (TypeInfo.StructInfo): Made this type protected.
20119         (TypeInfo): Added support for structs having structs as fields.
20121         * ecore.cs (FieldExpr): Implement IVariable.
20122         (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
20123         VariableInfo for the field.
20125 2003-05-18  Martin Baulig  <martin@ximian.com>
20127         * expression.cs (This.DoResolve): Report a CS0027 if we're
20128         emitting a field initializer.
20130 2003-05-18  Martin Baulig  <martin@ximian.com>
20132         * expression.cs (This.ResolveBase): New public function.
20133         (This.DoResolve): Check for CS0188.
20135         * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
20136         This.Resolve().
20138         * ecore.cs (MethodGroupExpr.DoResolve): Set the
20139         `instance_expression' to null if we don't have any non-static
20140         methods.
20142 2003-05-18  Martin Baulig  <martin@ximian.com>
20144         Reworked the way how local variables and parameters are handled by
20145         the flow analysis code.
20147         * statement.cs (TypeInfo, VariableMap): New public classes.
20148         (VariableInfo): New public class.  This is now responsible for
20149         checking whether a variable has been assigned.  It is used for
20150         parameters and local variables.
20151         (Block.EmitMeta): Take the InternalParameters as argument; compute
20152         the layout of the flow vectors here.
20153         (Block.LocalMap, Block.ParameterMap): New public properties.
20154         (FlowBranching): The .ctor doesn't get the InternalParameters
20155         anymore since Block.EmitMeta() now computes the layout of the flow
20156         vector.
20157         (MyStructInfo): This class is now known as `StructInfo' and nested
20158         in `TypeInfo'; we don't access this directly anymore.
20160         * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
20161         property and removed IsAssigned(), IsFieldAssigned(),
20162         SetAssigned() and SetFieldAssigned(); we now call them on the
20163         VariableInfo so we don't need to duplicate this code everywhere.
20165         * expression.cs (ParameterReference): Added `Block block' argument
20166         to the .ctor.
20167         (LocalVariableReference, ParameterReference, This): The new
20168         VariableInfo class is now responsible for all the definite
20169         assignment stuff.
20171         * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
20172         IsParameterAssigned, SetParameterAssigned): Removed.
20174 2003-05-18  Martin Baulig  <martin@ximian.com>
20176         * typemanager.cs (InitCoreTypes): Try calling
20177         SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
20178         the 3-args-version.  Corlib now also needs our `void_type'.
20179         (GetMethod): Added overloaded version which takes an optional
20180         `bool report_errors' to allow lookups of optional methods.
20182 2003-05-12  Martin Baulig  <martin@ximian.com>
20184         * statement.cs (VariableInfo): Renamed to LocalInfo since it's
20185         only used for locals and not for parameters.
20187 2003-05-12  Miguel de Icaza  <miguel@ximian.com>
20189         * support.cs (InternalParameters.ParameterType): Return the
20190         ExternalType of the parameter.
20192         * parameter.cs (Parameter.ExternalType): drop the two arguments,
20193         they were unused.
20195 2003-05-11  Miguel de Icaza  <miguel@ximian.com>
20197         * class.cs (MethodData.Define): Do not set the `newslot' on
20198         interface members, if they are also flagged as "override".
20200         * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
20201         better code for ++i and i++.  This only works for static fields
20202         and local variables.
20204         * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
20205         want to pull the DeclSpace out of the builder_to_declspace instead
20206         of the TypeBuilder (like in TypeContainer.FindMembers).
20208         * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
20209         instead of LookupTypeContainer.  Fixes the crash on .NET for
20210         looking up interface members.
20212         * const.cs: Create our own emit context during the Definition
20213         stage, so that constants are evaluated in the proper context, when
20214         a recursive definition happens.
20216 2003-05-11  Martin Baulig  <martin@ximian.com>
20218         * statement.cs (Block.CreateSwitchBlock): New method.  Creates a
20219         new block for a switch section.
20220         (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
20221         the adding/lookup in the switch block.  Fixes #39828.
20223 2003-05-09  Miguel de Icaza  <miguel@ximian.com>
20225         * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
20226         functionality: I needed to convert the data after I had performed
20227         the add/sub operation into the operands type size.
20229         * ecore.cs (ImplicitReferenceConversion): When boxing an interface
20230         pass the type for the box operation, otherwise the resulting
20231         object would have been of type object.
20233         (BoxedCast): Add constructor to specify the type to box as.
20235 2003-05-07  Miguel de Icaza  <miguel@ximian.com>
20237         * iterators.cs: I was reusing the `count' variable inadvertently,
20238         take steps to not allow this to happen.
20240 2003-05-06  Miguel de Icaza  <miguel@ximian.com>
20242         * attribute.cs (Attribute.Resolve): Params attributes are encoded
20243         by creating an array at the point where the params starts and
20244         putting all those arguments there, then adjusting the size of the
20245         array.
20247 2003-05-05  Miguel de Icaza  <miguel@ximian.com>
20249         * expression.cs (New.AddressOf): Implement interface
20250         IMemoryLocation.  This is used when the `new' operator is used in
20251         the context of an invocation to a method on a value type.
20253         See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
20254         example. 
20256         * namespace.cs: Also check the using aliases here.
20258         * driver.cs: Move the test for using validity after the types have
20259         been entered, so we do a single pass that also includes the using
20260         aliases. 
20262         * statement.cs (Try.Resolve): Avoid crashing if there is a failure
20263         in the regular case.   CreateSiblingForFinally is doing extra
20264         error checking.
20266         * attribute.cs (GetAttributeArgumentExpression): Store the result
20267         on an out value, and use the return value to indicate failure
20268         instead of using null (which is a valid return for Constant.GetValue).
20270         * statement.cs: Perform the analysis flow for the increment
20271         portion after the statement, because this will be the real flow of
20272         execution.  Fixes #42385
20274         * codegen.cs (EmitContext.EmitArgument,
20275         EmitContext.EmitStoreArgument): New helper functions when the
20276         RemapToProxy flag is set.
20278         * expression.cs (ParameterReference.EmitLdarg): Expose this useful
20279         function.
20281         Add support for remapping parameters. 
20283         * iterators.cs: Propagate parameter values;  Store parameter
20284         values in the proxy classes.
20286 2003-05-04  Miguel de Icaza  <miguel@ximian.com>
20288         * ecore.cs (FieldExpr): Fix an obvious bug.  static fields do not
20289         need a proxy reference;  I do not know what I was thinking
20291         * cs-parser.jay (constructor_initializer): catch another error,
20292         and display nice message.
20294         (field_declaration): catch void field declaration
20295         to flag a better error. 
20297         * class.cs (MemberBase.CheckBase): Report an error instead of a
20298         warning if a new protected member is declared in a struct. 
20299         (Field.Define): catch the error of readonly/volatile.
20301         * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
20303         (FieldExpr.AddressOf): ditto.  Catch error where the address of a
20304         volatile variable is taken
20306 2003-05-02  Miguel de Icaza  <miguel@ximian.com>
20308         * statement.cs (Fixed.Resolve): Report an error if we are not in
20309         an unsafe context.
20311 2003-05-01  Miguel de Icaza  <miguel@ximian.com>
20313         * typemanager.cs: reuse the code that handles type clashes for
20314         delegates and enumerations.
20316         * class.cs (Report28): Always report.
20318         * expression.cs (EncodeAsAttribute): Allow nulls here.
20320 2003-04-28  Miguel de Icaza  <miguel@ximian.com>
20322         * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
20323         the functionality for testing whether an expression is valid for
20324         an attribute here.  Also handle the case of arrays of elements
20325         being stored. 
20327         * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
20328         encoding a linear array into an array of objects that are suitable
20329         to be passed to an CustomAttributeBuilder.
20331         * delegate.cs: Check unsafe types being used outside of an Unsafe context.
20333         * ecore.cs: (FieldExpr): Handle field remapping here.
20335         * iteratators.cs: Pass the instance variable (if the method is an
20336         instance method) to the constructors, so we can access the field
20337         variables on the class.
20339         TODO: Test this with structs.  I think the THIS variable on
20340         structs might have to be a pointer, and not a refenrece
20342 2003-04-27  Miguel de Icaza  <miguel@ximian.com>
20344         * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
20345         local variables to fields in a proxy class.
20347         * iterators.cs (PopulateProxy): Rename our internal fields to
20348         <XXX>.  
20349         Create a <THIS> field if we are an instance method, so we can
20350         reference our parent container variables.
20351         (MapVariable): Called back from the EmitContext code to enter a
20352         new variable to field mapping into the proxy class (we just create
20353         a FieldBuilder).
20355         * expression.cs
20356         (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
20357         for using the remapped locals to fields.
20359         I placed the code here, because that gives the same semantics to
20360         local variables, and only changes the Emit code.
20362         * statement.cs (Fixed.Resolve): it is not allowed to have fixed
20363         statements inside iterators.
20364         (VariableInfo): Add a FieldBuilder for the cases when we are
20365         remapping local variables to fields in a proxy class
20367         * ecore.cs (SimpleNameResolve): Avoid testing two times for
20368         current_block != null.
20370         * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
20371         not cope with strings, as it has been moved to the
20372         TableSwitchEmit.  Fixed bug in switch generation.
20374         * expression.cs (New.DoResolve): Provide more context for the user
20375         when reporting an error.
20377         * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
20378         pointers. 
20380         * expression.cs (MemberAccess.DoResolve): When we get a type back,
20381         check the permissions for it.  Note than in a type-resolution
20382         context the check was already present in DeclSpace.ResolveType,
20383         but was missing from the MemberAccess.
20385         (ArrayCreation.CheckIndices): warn if the user has
20386         more nested levels of expressions, but there are no more
20387         dimensions specified.  Avoids crash on bug 41906.
20389 2003-04-26  Miguel de Icaza  <miguel@ximian.com>
20391         * statement.cs (Block): replace Implicit bool, for a generic
20392         flags.   
20393         New flag: `Unchecked'.  This is used during the EmitMeta phase
20394         (which is out-of-line with the regular Resolve/Emit process for a
20395         statement, as this is done ahead of time, but still gets a chance
20396         to call constant resolve).
20398         (Block.Flags): new enum for adding a new flag.
20400         (Block.EmitMeta): track the state of unchecked.
20402         (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
20403         to enable constant resolution to work there as well.
20405 2003-04-22  Miguel de Icaza  <miguel@ximian.com>
20407         * typemanager.cs (ienumerable_type): Also look up
20408         System.Collections.IEnumerable. 
20410 2003-04-21  Miguel de Icaza  <miguel@ximian.com>
20412         TODO: Test more than one conditional per method.
20414         * class.cs (Indexer.Define): Report the location where the user is
20415         referencing the unsupported feature.
20417         (MethodData): Overload the use of `conditionals' to
20418         minimize the creation of needless ArrayLists.   This saves roughly
20419         212kb on my machine.
20421         (Method): Implement the new IIteratorContainer interface.
20422         (Method.SetYields): Implement the method by setting the ModFlags
20423         to contain METHOD_YIELDS.
20425         * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
20426         which just got set to null.
20428         * iterators.cs: New file.
20430         (Yield, YieldBreak): New statements.
20432         * statement.cs (Return.Resolve): Flag an error if we are used in
20433         an iterator method.
20435         * codegen.cs (InIterator): New flag set if the code is being
20436         compiled in an iterator method.
20438         * modifiers.cs: New flag METHOD_YIELDS.  This modifier is an
20439         internal modifier, and we just use it to avoid adding extra
20440         fields, as this is seldom used.  
20442         * cs-parser.jay: Add yield_statement (yield and yield break).
20444         * driver.cs: New flag -v2 to turn on version 2 features. 
20446         * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
20447         hashtable when v2 is enabled.
20449 2003-04-20  Miguel de Icaza  <miguel@ximian.com>
20451         * typemanager.cs (TypeManager.NamespaceClash): Use to check if
20452         there is already a namespace defined with this name.
20454         (TypeManager.InitCoreTypes): Remove the temporary workaround, as
20455         people upgraded their corlibs.
20457         (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
20458         always use fully qualified types, no need to use the compiler
20459         front end.
20461         (TypeManager.IsNamespace): Use binarysearch.
20463         * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
20464         AddDelegate): I did not quite use the new IsValid API properly: I
20465         have to pass the short-name and the fullname.  I was passing only
20466         the basename instead of the fullname sometimes. 
20468         (TypeContainer.DefineType): call NamespaceClash.
20470         * interface.cs (Interface.DefineType): use NamespaceClash before
20471         defining the type.
20473         * delegate.cs (Delegate.DefineType): use NamespaceClash before
20474         defining the type.
20476         * enum.cs: (Enum.DefineType): use NamespaceClash before
20477         defining the type.
20479         * typemanager.cs (: 3-line patch that gives us some tasty 11%
20480         speed increase.  First, use the negative_hits cache when we get a
20481         negative.  Second, add the type with its full original name
20482         instead of the new . and + encoded name (reflection uses + to
20483         separate type from a nested type).  Use LookupTypeReflection
20484         directly which bypasses the type->name hashtable (that we already
20485         know does not contain the type.
20487         * decl.cs (DeclSpace.ResolveTypeExpr): track the
20488         location/container type. 
20490         * driver.cs: When passing utf8, use directly the UTF8Encoding.
20492 2003-04-19  Miguel de Icaza  <miguel@ximian.com>
20494         * decl.cs (ResolveTypeExpr): Mirror check acess here too.
20496         * delegate.cs (NewDelegate.Resolve): Test whether an instance
20497         method is being referenced in the method group from a static
20498         context, and report error 120 if so.
20500         * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
20501         Error118. 
20503         * typemanager.cs: Add intermediate namespaces (if a namespace A.B
20504         is created, we create the A namespace).
20506         * cs-parser.jay: A namespace also introduces a DeclarationFound.
20507         Fixes #41591
20509 2003-04-18  Miguel de Icaza  <miguel@ximian.com>
20511         * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
20512         invocation to ModuleBuilder.GetType with the same values will
20513         return a new type instance, so we need to cache its return
20514         values. 
20516         * expression.cs (Binary.ResolveOperator): Only allow the compare
20517         operators on enums if they are of the same type.
20519         * ecore.cs (Expression.ImplicitReferenceConversion): handle target
20520         types of ValueType on their own case.  Before we were giving them
20521         the same treatment as objects.
20523         * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
20524         fullname.  Short name is used to compare against container name.
20525         Fullname is used to check against defined namespace names.
20527         * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
20528         AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
20530         (Method.CheckBase): Call parent.
20531         (MemberBase.CheckBase): Check for protected members on sealed
20532         classes.
20533         (PropertyBase.CheckBase): Call parent.
20534         (Field.Define): Call parent.
20536         * report.cs: Negative error codes are now mapped to 8000 - code,
20537         so that the display is render more nicely.
20539         * typemanager.cs: Do not use try/catch, instead report a regular
20540         error. 
20542         (GetPointerType, GetReferenceType): These methods provide
20543         mechanisms to obtain the T* and T& from a T.  We had the code
20544         previously scattered around the code base, and it also used
20545         TypeManager.LookupType that would go through plenty of caches.
20546         This one goes directly to the type source.
20548         In some places we did the Type.GetType followed by
20549         ModuleBuilder.GetType, but not in others, so this unifies the
20550         processing as well.
20552         * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
20553         statements now that we have namespace information.
20555         * typemanager.cs (IsNamespace): New method, returns whether the
20556         string presented is a namespace or not.
20558         (ComputeNamespaces): New public entry point, computes the list of
20559         available namespaces, using the GetNamespaces API call in Mono, or
20560         the slower version in MS.NET.   
20562         Now before we start the semantic analysis phase, we have a
20563         complete list of namespaces including everything that the user has
20564         provided.
20566         Deleted old code to cache namespaces in .nsc files.
20568 2003-04-17  Miguel de Icaza  <miguel@ximian.com>
20570         * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
20571         class/struct location definition Location for the implicit
20572         constructor location.
20574         (Operator.Define): Use the location of the operator for the
20575         implicit Method definition.
20577         (Constructor.Emit): use the constructor location for the implicit
20578         base initializer constructor.
20580         * ecore.cs: Remove ITypeExpression.  This interface is now gone,
20581         and the Expression class now contains two new methods:
20583         ResolveAsTypeStep and ResolveAsTypeTerminal.  This is used to
20584         isolate type lookup from the rest of the resolution process.
20586         Since we use Expressions to hold type definitions due to the way
20587         we parse the input we have historically overloaded Resolve to
20588         perform the Type lookups if a special flag is passed.  Now this is
20589         eliminated and two methods take their place. 
20591         The differences in the two methods between xStep and xTerminal is
20592         that xStep is involved in our current lookup system that uses
20593         SimpleNames to compose a name, while xTerminal is used just to
20594         catch the case where the simplename lookup failed.
20596 2003-04-16  Miguel de Icaza  <miguel@ximian.com>
20598         * expression.cs (ResolveMemberAccess): Remove redundant code.
20599         TypeExpr expressions are always born fully resolved.
20601         * interface.cs (PopulateMethod): Do not lookup the types twice.
20602         We were doing it once during SemanticAnalysis and once during
20603         PopulateMethod.
20605         * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
20606         in local variable type definitions, were being returned as a
20607         SimpleName (we decomposed everything into a string), that is
20608         because primary_expression was being used instead of a type in the
20609         grammar (reduce/reduce conflicts).
20611         The part that was wrong is that we converted the expression into a
20612         string (an oversimplification in one hand, compounded with primary
20613         expressions doing string concatenation).
20615         So things like:
20617         A.B.C [] x;
20619         Would return "A.B.C[]" as a SimpleName.  This stopped things like
20620         using clauses from working on this particular context.  And a type
20621         was being matched directly against "A.B.C[]".
20623         We now use the correct approach, and allow for ComposedCast to be
20624         part of the unary expression.  So the "A.B.C []" become a composed
20625         cast of "A.B.C" (as a nested group of MemberAccess with a
20626         SimpleName at the end) plus the rank composition "[]". 
20628         Also fixes 35567
20630 2003-04-10  Miguel de Icaza  <miguel@ximian.com>
20632         * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
20633         for the access level checking.
20635         * class.cs: Cosmetic changes.  Renamed `TypeContainer parent' to
20636         `TypeContainer container', because I kept getting confused when I
20637         was debugging this code.
20639         * expression.cs (Indexers): Instead of tracking getters/setters,
20640         we now track them in parallel.  We create one arraylist less, but
20641         most importantly it is possible now for the LValue code to find a
20642         matching get for a set.
20644         (IndexerAccess.DoResolveLValue): Update the code.
20645         GetIndexersForType has been modified already to extract all the
20646         indexers from a type.  The code assumed it did not.
20648         Also make the code set the correct return type for the indexer.
20649         This was fixed a long time ago for properties, but was missing for
20650         indexers.  It used to be void_type.
20652         (Binary.Emit): Test first for doubles instead of
20653         floats, as they are more common.
20655         (Binary.EmitBranchable): Use the .un version of the branch opcodes
20656         when dealing with floats and the <=, >= operators.  This fixes bug
20657         #39314 
20659         * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
20660         to load the array value by emitting a load on the foreach variable
20661         type.  This was incorrect.  
20663         We now emit the code to load an element using the the array
20664         variable type, and then we emit the conversion operator.
20666         Fixed #40176
20668 2003-04-10  Zoltan Varga  <vargaz@freemail.hu>
20670         * attribute.cs: Avoid allocation of ArrayLists in the common case.
20672 2003-04-09  Miguel de Icaza  <miguel@ximian.com>
20674         * class.cs (MethodSignature.InheritableMemberSignatureCompare):
20675         test for protection before we test for signatures. 
20677         (MethodSignature.ToString): implement.
20679         * expression.cs (Unary.TryReduceNegative): Add missing minus sign
20680         to the case where we reduced into a LongConstant.
20682         * decl.cs (CheckAccessLevel): If the type is an array, we can not
20683         depend on whether the information is acurrate, because the
20684         Microsoft runtime will always claim that the array type is public,
20685         regardless of the real state.
20687         If the type is a pointer, another problem happens: the type is
20688         reported as non-public in Microsoft.  
20690         In both cases we have to call CheckAccessLevel recursively with
20691         the underlying type as the argument to be tested.
20693 2003-04-08  Miguel de Icaza  <miguel@ximian.com>
20695         * assign.cs (Assign.Emit): If we are dealing with a compound
20696         assignment expression, we should use the code path that stores the
20697         intermediate result in a temporary value.  This fixes #40903.
20699         *expression.cs (Indirection.ToString): Provide ToString method for
20700         debugging. 
20702 2003-04-08  Zoltan Varga  <vargaz@freemail.hu>
20704         * class.cs: Null out fields holding references to Block objects so
20705         they can be garbage collected.
20707         * expression.cs (OverloadResolve): Remove unused local.
20709 2003-04-07  Martin Baulig  <martin@ximian.com>
20711         * codegen.cs (EmitContext.CurrentFile): New public field.
20712         (EmitContext.Mark): Use the CurrentFile to check whether the
20713         location is in the correct file.
20714         (EmitContext.EmitTopBlock): Initialize CurrentFile here.
20716 2003-04-07  Martin Baulig  <martin@ximian.com>
20718         * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
20720         * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
20721         location.  [FIXME: The location argument which gets passed to this
20722         method is sometimes wrong!]
20724 2003-04-07  Nick Drochak <ndrochak@gol.com>
20726         * codegen.cs: Be more verbose when we can't find the symbol writer dll.
20728 2003-04-07  Miguel de Icaza  <miguel@ximian.com>
20730         * expression.cs (Indirection.EmitAssign): We were using the
20731         temporary, but returning immediately instead of continuing the
20732         EmitAssing flow.
20734 2003-04-06  Martin Baulig  <martin@ximian.com>
20736         * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
20737         if it's a nested child, but also deriving from the outer class.
20738         See test 190.cs.
20740         * typemanager.cs (IsNestedChildOf): Make this work if it's a
20741         nested child, but also deriving from the outer class.  See
20742         test-190.cs.
20743         (FilterWithClosure): We may access private members of the outer
20744         class if we're a nested child and deriving from the outer class.
20745         (RealMemberLookup): Only set `closure_private_ok' if the
20746         `original_bf' contained BindingFlags.NonPublic.
20748 2003-04-05  Martin Baulig  <martin@ximian.com>
20750         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #40670.
20752 2003-04-02  Miguel de Icaza  <miguel@ximian.com>
20754         * class.cs (Event.Define): Do not allow abstract events to have
20755         initializers. 
20757 2003-04-01  Miguel de Icaza  <miguel@ximian.com>
20759         * cs-parser.jay: Add error productions for ADD/REMOVE missing a
20760         block in event declarations.
20762         * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
20763         value type, get its address.
20765         * expression.cs (Is.Emit): For action `LeaveOnStack' we were
20766         leaving a class on the stack instead of a boolean value (int
20767         0/1).  Change the code so we compare against null, and then the
20768         result against zero.
20770         * class.cs (TypeContainer.GetClassBases): We were checking for the
20771         parent class being sealed too late.
20773         * expression.cs (Binary.Emit): For <= and >= when dealing with
20774         floating point values, use cgt.un and clt.un instead of cgt and
20775         clt alone.
20777 2003-04-01  Zoltan Varga  <vargaz@freemail.hu>
20779         * statement.cs: Apply the same optimization as MS: skip the 
20780         GetEnumerator returning an IEnumerator, and use the one returning a 
20781         CharEnumerator instead. This allows us to avoid the try-finally block 
20782         and the boxing.
20784 2003-03-31  Gaurav Vaish <gvaish_mono@lycos.com>
20786         * cs-parser.jay: Attributes cannot be applied to
20787                          namespaces. Fixes #40473
20789 2003-03-31  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20791         * class.cs:
20792         (Add*): check if the name is valid using the full name for constants,
20793         fields, properties and events.
20795 2003-03-28  Miguel de Icaza  <miguel@ximian.com>
20797         * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
20798         char constants to be part of the enumeration.
20800         * expression.cs (Conditional.DoResolve): Add support for operator
20801         true. Implements the missing functionality from 14.12
20803         * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
20804         operator true/false as required by the spec.
20806         * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
20807         implicit conversion to boolean.
20809         * statement.cs (Statement.ResolveBoolean): A boolean expression is
20810         also one where the type implements `operator true'. 
20812         * ecore.cs (Expression.GetOperatorTrue): New helper routine to
20813         get an expression that will invoke operator true based on an
20814         expression.  
20816         (GetConversionOperators): Removed the hack that called op_True
20817         here.  
20819         (Expression.ResolveBoolean): Move this from Statement.
20821 2003-03-17  Miguel de Icaza  <miguel@ximian.com>
20823         * ecore.cs (FieldExpr): do not allow initialization of initonly
20824         fields on derived classes
20826 2003-03-13  Martin Baulig  <martin@ximian.com>
20828         * statement.cs (Block.Emit): Call ig.BeginScope() and
20829         ig.EndScope() when compiling with debugging info; call
20830         LocalBuilder.SetLocalSymInfo _after_ opening the scope.
20832 2003-03-08  Miguel de Icaza  <miguel@ximian.com>
20834         * expression.cs (Indexers): Do not construct immediately, allow
20835         for new members to be appended as we go.  Fixes 38143
20837 2003-03-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20839         * expression.cs: save/restore context when resolving an unchecked
20840         expression.
20842 2003-03-05  Miguel de Icaza  <miguel@ximian.com>
20844         * cfold.cs: Catch division by zero in modulus operator during
20845         constant folding.
20847 2003-03-03  Miguel de Icaza  <miguel@ximian.com>
20849         * interface.cs (Interface.DefineMembers): Avoid defining members
20850         twice. 
20852 2003-02-27  Miguel de Icaza  <miguel@ximian.com>
20854         * driver.cs: handle the +/- options for -noconfig
20856         * statement.cs (Unckeched.Resolve): Also track the state of
20857         unchecked in the Resolve phase.
20859 2003-02-27  Martin Baulig  <martin@ximian.com>
20861         * ecore.cs (Expression.MemberLookup): Don't create a
20862         MethodGroupExpr for something which is not a method.  Fixes #38291.
20864 2003-02-25  Miguel de Icaza  <miguel@ximian.com>
20866         * class.cs (MemberBase.CheckParameters): Also check that the type
20867         is unmanaged if it is a pointer.
20869         * expression.cs (SizeOf.Resolve): Add location information.
20871         * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
20872         a managed type is declared.
20874         * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
20875         parameter modifiers as well.  Fixes bug 38606
20877         * class.cs: Very sad.  Am backing out the speed up changes
20878         introduced by the ArrayList -> Array in the TypeContainer, as they
20879         were not actually that much faster, and introduced a bug (no error
20880         reports on duplicated methods).
20882         * assign.cs (CompoundAssign.DoLResolve): Resolve the original
20883         source first, this will guarantee that we have a valid expression
20884         before calling in lower levels functions that will require a
20885         resolved object.  Then use this original_source in the
20886         target.ResolveLValue instead of the original source that was
20887         passed to us.
20889         Another change.  Use target.Resolve instead of LValueResolve.
20890         Although we are resolving for LValues, we will let the Assign code
20891         take care of that (it will be called again from Resolve).  This
20892         basically allows code like this:
20894         class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
20895         class Y { void A (X x) { x [0] += o; }
20897         The problem was that the indexer was trying to resolve for
20898         set_Item (idx, object o) and never finding one.  The real set_Item
20899         was set_Item (idx, X).  By delaying the process we get the right
20900         semantics. 
20902         Fixes bug 36505
20904 2003-02-23  Martin Baulig  <martin@ximian.com>
20906         * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
20907         while calling DoEmit ().
20909         * codegen.cs (EmitContext.Mark): Don't mark locations in other
20910         source files; if you use the #line directive inside a method, the
20911         compiler stops emitting line numbers for the debugger until it
20912         reaches the end of the method or another #line directive which
20913         restores the original file.
20915 2003-02-23  Martin Baulig  <martin@ximian.com>
20917         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
20919 2003-02-23  Martin Baulig  <martin@ximian.com>
20921         * statement.cs (Block.AddChildVariableNames): We need to call this
20922         recursively, not just for our immediate children.
20924 2003-02-23  Martin Baulig  <martin@ximian.com>
20926         * class.cs (Event.Define): Always make the field private, like csc does.
20928         * typemanager.cs (TypeManager.RealMemberLookup): Make events
20929         actually work, fixes bug #37521.
20931 2003-02-23  Miguel de Icaza  <miguel@ximian.com>
20933         * delegate.cs: When creating the various temporary "Parameters"
20934         classes, make sure that we call the ComputeAndDefineParameterTypes
20935         on those new parameters (just like we do with the formal ones), to
20936         allow them to be resolved in the context of the DeclSpace.
20938         This fixes the bug that Dick observed in Bugzilla #38530.
20940 2003-02-22  Miguel de Icaza  <miguel@ximian.com>
20942         * expression.cs (ResolveMemberAccess): When resolving a constant,
20943         do not attempt to pull a constant if the value was not able to
20944         generate a valid constant.
20946         * const.cs (LookupConstantValue): Do not report more errors than required.
20948 2003-02-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20950         * expression.cs: fixes bug #38328.
20952 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
20954         * class.cs: Changed all the various members that can be part of a
20955         class from being an ArrayList to be an Array of the right type.
20956         During the DefineType type_list, interface_list, delegate_list and
20957         enum_list are turned into types, interfaces, delegates and enums
20958         arrays.  
20960         And during the member population, indexer_list, event_list,
20961         constant_list, field_list, instance_constructor_list, method_list,
20962         operator_list and property_list are turned into their real arrays.
20964         Although we could probably perform this operation earlier, for
20965         good error reporting we need to keep the lists and remove the
20966         lists for longer than required.
20968         This optimization was triggered by Paolo profiling the compiler
20969         speed on the output of `gen-sample-program.pl' perl script. 
20971         * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
20972         not crash in methods like MemberLookupFailed that use this field.  
20974         This problem arises when the compiler fails to resolve a type
20975         during interface type definition for example.
20977 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
20979         * expression.cs (Indexers.GetIndexersForType): Interfaces do not
20980         inherit from System.Object, so we have to stop at null, not only
20981         when reaching System.Object.
20983 2003-02-17  Miguel de Icaza  <miguel@ximian.com>
20985         * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
20986         DeclaredOnly because the parent indexer might have had a different
20987         name, but did not loop until the top of the hierarchy was reached.
20989         The problem this one fixes is 35492: when a class implemented an
20990         indexer from an interface, we were getting the interface method
20991         (which was abstract) and we were flagging an error (can not invoke
20992         abstract method).
20994         This also keeps bug 33089 functioning, and test-148 functioning.
20996         * typemanager.cs (IsSpecialMethod): The correct way of figuring
20997         out if a method is special is to see if it is declared in a
20998         property or event, or whether it is one of the predefined operator
20999         names.   This should fix correctly #36804.
21001 2003-02-15  Miguel de Icaza  <miguel@ximian.com>
21003         The goal here is to remove the dependency on EmptyCast.Peel ().
21004         Killing it completely.
21006         The problem is that currently in a number of places where
21007         constants are expected, we have to "probe" for an EmptyCast, and
21008         Peel, which is not the correct thing to do, as this will be
21009         repetitive and will likely lead to errors. 
21011         The idea is to remove any EmptyCasts that are used in casts that
21012         can be reduced to constants, so we only have to cope with
21013         constants. 
21015         This bug hunt was triggered by Bug 37363 and the desire to remove
21016         the duplicate pattern where we were "peeling" emptycasts to check
21017         whether they were constants.  Now constants will always be
21018         constants.
21020         * ecore.cs: Use an enumconstant here instead of wrapping with
21021         EmptyCast.  
21023         * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
21024         throwing me off.  By handling this we can get rid of a few hacks.
21026         * statement.cs (Switch): Removed Peel() code.
21028 2003-02-14  Miguel de Icaza  <miguel@ximian.com>
21030         * class.cs: Location information for error 508
21032         * expression.cs (New.DoResolve): Add a guard against double
21033         resolution of an expression.  
21035         The New DoResolve might be called twice when initializing field
21036         expressions (see EmitFieldInitializers, the call to
21037         GetInitializerExpression will perform a resolve on the expression,
21038         and later the assign will trigger another resolution
21040         This leads to bugs (#37014)
21042         * delegate.cs: The signature for EndInvoke should contain any ref
21043         or out parameters as well.  We were not doing this in the past. 
21045         * class.cs (Field.Define): Do not overwrite the type definition
21046         inside the `volatile' group.  Turns out that volatile enumerations
21047         were changing the type here to perform a validity test, which
21048         broke conversions. 
21050 2003-02-12  Miguel de Icaza  <miguel@ximian.com>
21052         * ecore.cs (FieldExpr.AddressOf): In the particular case of This
21053         and structs, we do not want to load the instance variable
21055         (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
21056         enum_type has to be handled like an object reference (implicit
21057         conversions exists from this to object), but the regular IsClass
21058         and IsValueType tests will never return true for this one.
21060         Also we use TypeManager.IsValueType instead of type.IsValueType,
21061         just for consistency with the rest of the code (this is only
21062         needed if we ever use the construct exposed by test-180.cs inside
21063         corlib, which we dont today).
21065 2003-02-12  Zoltan Varga  <vargaz@freemail.hu>
21067         * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
21068         just InternalCall.
21070 2003-02-09  Martin Baulig  <martin@ximian.com>
21072         * namespace.cs (Namespace..ctor): Added SourceFile argument.
21073         (Namespace.DefineNamespaces): New static public method; this is
21074         called when we're compiling with debugging to add all namespaces
21075         to the symbol file.
21077         * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
21078         pass it to the Namespace's .ctor.
21080         * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
21081         and MethodBase arguments; pass the namespace ID to the symwriter;
21082         pass the MethodBase instead of the token to the symwriter.
21083         (SymbolWriter.DefineNamespace): New method to add a namespace to
21084         the symbol file.
21086 2003-02-09  Martin Baulig  <martin@ximian.com>
21088         * symbolwriter.cs: New file.  This is a wrapper around
21089         ISymbolWriter with a cleaner API.  We'll dynamically Invoke()
21090         methods here in near future.
21092 2003-02-09  Martin Baulig  <martin@ximian.com>
21094         * codegen.cs (EmitContext.Mark): Just pass the arguments to
21095         ILGenerator.MarkSequencePoint() which are actually used by the
21096         symbol writer.
21098 2003-02-09  Martin Baulig  <martin@ximian.com>
21100         * location.cs (SourceFile): New public sealed class.  This
21101         contains the name and an index which is used in the location's token.
21102         (Location): Reserve an appropriate number of bits in the token for
21103         the source file instead of walking over that list, this gives us a
21104         really huge performance improvement when compiling with debugging.
21106         * driver.cs (Driver.parse, Driver.tokenize_file): Take a
21107         `SourceFile' argument instead of a string.
21108         (Driver.ProcessFile): Add all the files via Location.AddFile(),
21109         but don't parse/tokenize here, we need to generate the list of all
21110         source files before we do that.
21111         (Driver.ProcessFiles): New static function.  Parses/tokenizes all
21112         the files.
21114         * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
21115         instead of a string.
21117         * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
21118         of a string.
21120 2003-02-09  Martin Baulig  <martin@ximian.com>
21122         * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
21123         filename on `#line default'.
21125 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
21127         * statement.cs: don't clear the pinned var when the fixed statement
21128         returns from the method (fixes bug#37752).
21130 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
21132         * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban) 
21133         to IsValueType.
21135 2003-02-07  Martin Baulig  <martin@ximian.com>
21137         * driver.cs: Removed the `--debug-args' command line argument.
21139         * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
21140         automatically by the AsssemblyBuilder.
21141         (CodeGen.InitializeSymbolWriter): We don't need to call any
21142         initialization function on the symbol writer anymore.  This method
21143         doesn't take any arguments.
21145 2003-02-03  Miguel de Icaza  <miguel@ximian.com>
21147         * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
21148         from referenced assemblies as well.
21150 2003-02-02  Martin Baulig  <martin@ximian.com>
21152         * class.cs (MethodData.Emit): Generate debugging info for external methods.
21154 2003-02-02  Martin Baulig  <martin@ximian.com>
21156         * class.cs (Constructor.Emit): Open the symbol writer before
21157         emitting the constructor initializer.
21158         (ConstructorInitializer.Emit): Call ec.Mark() to allow
21159         single-stepping through constructor initializers.
21161 2003-01-30  Miguel de Icaza  <miguel@ximian.com>
21163         * class.cs: Handle error 549: do not allow virtual methods in
21164         sealed classes. 
21166 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
21168         * decl.cs: Check access levels when resolving types
21170 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
21172         * statement.cs: Add parameters and locals set in catch blocks that might 
21173         return to set vector
21175 2003-01-29  Miguel de Icaza  <miguel@ximian.com>
21177         * class.cs (Operator): Set the SpecialName flags for operators.
21179         * expression.cs (Invocation.DoResolve): Only block calls to
21180         accessors and operators on SpecialName methods.
21182         (Cast.TryReduce): Handle conversions from char constants.
21185 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
21187         * statement.cs: small memory and time optimization in FlowBranching.
21189 2003-01-28  Pedro Mart  <yoros@wanadoo.es>
21191         * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
21192         problem that the last fix but in the other sid (Set).
21194         * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
21195         access when there is no indexer in the hierarchy.
21197 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
21199         * class.cs: Combine some if statements.
21201 2003-01-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21203         * driver.cs: fixed bug #37187.
21205 2003-01-27  Pedro Martinez Juliá  <yoros@wanadoo.es>
21207         * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
21208         any indexer, it's needed to build a list with all the indexers in the
21209         hierarchy (AllGetters), else we have problems. Fixes #35653.
21211 2003-01-23  Miguel de Icaza  <miguel@ximian.com>
21213         * class.cs (MethodData.Define): It is wrong for an interface
21214         implementation to be static in both cases: explicit and implicit.
21215         We were only handling this in one case.
21217         Improve the if situation there to not have negations.
21219         * class.cs (Field.Define): Turns out that we do not need to check
21220         the unsafe bit on field definition, only on usage.  Remove the test.
21222 2003-01-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21224         * driver.cs: use assembly.Location instead of Codebase (the latest
21225         patch made mcs fail when using MS assemblies).
21227 2003-01-21  Tim Haynes <thaynes@openlinksw.com>
21229         * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
21230         get the path to *corlib.dll.
21232 2003-01-21  Nick Drochak <ndrochak@gol.com>
21234         * cs-tokenizer.cs:
21235         * pending.cs:
21236         * typemanager.cs: Remove compiler warnings
21238 2003-01-20  Duncan Mak  <duncan@ximian.com>
21240         * AssemblyInfo.cs: Bump the version number to 0.19.
21242 2003-01-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21244         * cs-tokenizer.cs: little fixes to line numbering when #line is used.
21246 2003-01-18  Zoltan Varga  <vargaz@freemail.hu>
21248         * class.cs (Constructor::Emit): Emit debugging info for constructors.
21250 2003-01-17  Miguel de Icaza  <miguel@ximian.com>
21252         * cs-parser.jay: Small fix: we were not comparing the constructor
21253         name correctly.   Thanks to Zoltan for the initial pointer.
21255 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
21257         * cs-tokenizer.cs: Set file name when specified with #line
21259 2003-01-15  Miguel de Icaza  <miguel@ximian.com>
21261         * cs-parser.jay: Only perform the constructor checks here if we
21262         are named like the class;  This will help provider a better
21263         error.  The constructor path is taken when a type definition is
21264         not found, but most likely the user forgot to add the type, so
21265         report that rather than the constructor error.
21267 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
21269         * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
21270         allocations.
21272 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
21274         * cs-parser.jay: Add cleanup call.
21276 2003-01-13  Duncan Mak  <duncan@ximian.com>
21278         * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
21279         consistent with other methods.
21281 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
21283         * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
21285 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
21287         * attribute.cs: only set GuidAttr to true when we have a
21288         GuidAttribute.
21290 2003-01-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21292         * ecore.cs:
21293         * expression.cs:
21294         * typemanager.cs: fixes to allow mcs compile corlib with the new
21295         Type.IsSubclassOf fix.
21297 2003-01-08  Miguel de Icaza  <miguel@ximian.com>
21299         * expression.cs (LocalVariableReference.DoResolve): Classify a
21300         constant as a value, not as a variable.   Also, set the type for
21301         the variable.
21303         * cs-parser.jay (fixed_statement): take a type instead of a
21304         pointer_type, so we can produce a better error message later.
21306         * statement.cs (Fixed.Resolve): Flag types that are not pointers
21307         as an error.  
21309         (For.DoEmit): Make inifinite loops have a
21310         non-conditional branch back.
21312         (Fixed.DoEmit): First populate the pinned variables, then emit the
21313         statement, then clear the variables.  Before I was emitting the
21314         code once for each fixed piece.
21317 2003-01-08  Martin Baulig  <martin@ximian.com>
21319         * statement.cs (FlowBranching.MergeChild): A break in a
21320         SWITCH_SECTION does not leave a loop.  Fixes #36155.
21322 2003-01-08  Martin Baulig  <martin@ximian.com>
21324         * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
21325         lives in the same number space than `param_map'.  Fixes #36154.
21327 2003-01-07  Miguel de Icaza  <miguel@ximian.com>
21329         * cs-parser.jay (constructor_declaration): Set the
21330         Constructor.ModFlags before probing for it.  This makes the
21331         compiler report 514, 515 and 132 (the code was there, but got
21332         broken). 
21334         * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
21335         (GotoDefault.Resolve): Set `Returns' to ALWAYS.
21336         (GotoCase.Resolve): Set `Returns' to ALWAYS.
21338 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
21340         * enum.cs: create the enum static fields using the enum type.
21342 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
21344         * class.cs: don't try to create the ParamBuilder for the return
21345         type if it's not needed (and handle it breaking for the ms runtime
21346         anyway).
21348 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
21350         * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
21352 2002-12-29  Miguel de Icaza  <miguel@ximian.com>
21354         * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
21355         the command.   This showed up while compiling the JANET source
21356         code, which used \r as its only newline separator.
21358 2002-12-28  Miguel de Icaza  <miguel@ximian.com>
21360         * class.cs (Method.Define): If we are an operator (because it
21361         reuses our code), then set the SpecialName and HideBySig.  #36128
21363 2002-12-22  Miguel de Icaza  <miguel@ximian.com>
21365         * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
21366         exception, report error 120 `object reference required'.
21368         * driver.cs: Add --pause option, used during to measure the size
21369         of the process as it goes with --timestamp.
21371         * expression.cs (Invocation.DoResolve): Do not allow methods with
21372         SpecialName to be invoked.
21374 2002-12-21  Miguel de Icaza  <miguel@ximian.com>
21376         * cs-tokenizer.cs: Small fix to the parser: compute the ascii
21377         number before adding it.
21379 2002-12-21  Ravi Pratap  <ravi@ximian.com>
21381         * ecore.cs (StandardImplicitConversion): When in an unsafe
21382         context, we allow conversion between void * to any other pointer
21383         type. This fixes bug #35973.
21385 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
21387         * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
21388         is not thrown when extensionless outputs are used 
21390 2002-12-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21392         * rootcontext.cs: fixed compilation of corlib.
21394 2002-12-19  Miguel de Icaza  <miguel@ximian.com>
21396         * attribute.cs (Attributes.Contains): Add new method.
21398         * class.cs (MethodCore.LabelParameters): if the parameter is an
21399         `out' parameter, check that no attribute `[In]' has been passed.
21401         * enum.cs: Handle the `value__' name in an enumeration.
21403 2002-12-14  Jaroslaw Kowalski <jarek@atm.com.pl>
21405         * decl.cs: Added special case to allow overrides on "protected
21406         internal" methods
21408 2002-12-18  Ravi Pratap  <ravi@ximian.com>
21410         * attribute.cs (Attributes.AddAttributeSection): Rename to this
21411         since it makes much more sense.
21413         (Attributes.ctor): Don't require a Location parameter.
21415         * rootcontext.cs (AddGlobalAttributeSection): Rename again.
21417         * attribute.cs (ApplyAttributes): Remove extra Location parameters
21418         since we already have that information per attribute.
21420         * everywhere : make appropriate changes.
21422         * class.cs (LabelParameters): Write the code which actually
21423         applies attributes to the return type. We can't do this on the MS
21424         .NET runtime so we flag a warning in the case an exception is
21425         thrown.
21427 2002-12-18  Miguel de Icaza  <miguel@ximian.com>
21429         * const.cs: Handle implicit null conversions here too.
21431 2002-12-17  Ravi Pratap  <ravi@ximian.com>
21433         * class.cs (MethodCore.LabelParameters): Remove the extra
21434         Type [] parameter since it is completely unnecessary. Instead
21435         pass in the method's attributes so that we can extract
21436         the "return" attribute.
21438 2002-12-17  Miguel de Icaza  <miguel@ximian.com>
21440         * cs-parser.jay (parse): Use Report.Error to flag errors instead
21441         of ignoring it and letting the compile continue.
21443         * typemanager.cs (ChangeType): use an extra argument to return an
21444         error condition instead of throwing an exception.
21446 2002-12-15  Miguel de Icaza  <miguel@ximian.com>
21448         * expression.cs (Unary.TryReduce): mimic the code for the regular
21449         code path.  Perform an implicit cast in the cases where we can
21450         implicitly convert to one of the integral types, and then reduce
21451         based on that constant.   This fixes bug #35483.
21453 2002-12-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21455         * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
21457 2002-12-13  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21459         * namespace.cs: fixed bug #35489.
21461 2002-12-12  Miguel de Icaza  <miguel@ximian.com>
21463         * class.cs: Remove some dead code.
21465         * cs-parser.jay: Estimate the number of methods needed
21466         (RootContext.MethodCount);
21468         * cs-tokenizer.cs: Use char arrays for parsing identifiers and
21469         numbers instead of StringBuilders.
21471         * support.cs (PtrHashtable): Add constructor with initial size;
21472         We can now reduce reallocations of the method table.
21474 2002-12-10  Ravi Pratap  <ravi@ximian.com>
21476         * attribute.cs (ApplyAttributes): Keep track of the emitted
21477         attributes on a per-target basis. This fixes bug #35413.
21479 2002-12-10  Miguel de Icaza  <miguel@ximian.com>
21481         * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
21482         default to the Windows 1252 encoding.
21484         (UnixParseOption): Support version, thanks to Alp for the missing
21485         pointer. 
21487         * AssemblyInfo.cs: Add nice assembly information.
21489         * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
21490         (bug 35169).
21492         * cs-parser.jay: Allow a trailing comma before the close bracked
21493         in the attribute_section production.
21495         * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
21496         address of the instance was being taken, I will take this out,
21497         because we take the address of the object immediately here.
21499 2002-12-09  Ravi Pratap  <ravi@ximian.com>
21501         * typemanager.cs (AreMultipleAllowed): Take care of the most
21502         obvious case where attribute type is not in the current assembly -
21503         stupid me ;-)
21505 2002-12-08  Miguel de Icaza  <miguel@ximian.com>
21507         * ecore.cs (SimpleName.DoResolve): First perform lookups on using
21508         definitions, instead of doing that afterwards.  
21510         Also we use a nice little hack, depending on the constructor, we
21511         know if we are a "composed" name or a simple name.  Hence, we
21512         avoid the IndexOf test, and we avoid 
21514         * codegen.cs: Add code to assist in a bug reporter to track down
21515         the source of a compiler crash. 
21517 2002-12-07  Ravi Pratap  <ravi@ximian.com>
21519         * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
21520         types have been emitted for a given element and flag an error
21521         if something which does not have AllowMultiple set is used more
21522         than once.
21524         * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
21525         attribute types and their corresponding AllowMultiple properties
21527         (AreMultipleAllowed): Check the property for a given type.
21529         * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
21530         property in the case we have a TypeContainer.
21532         (Attributes.AddAttribute): Detect duplicates and just skip on
21533         adding them. This trivial fix catches a pretty gross error in our
21534         attribute emission - global attributes were being emitted twice!
21536         Bugzilla bug #33187 is now fixed.
21538 2002-12-06  Miguel de Icaza  <miguel@ximian.com>
21540         * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
21541         instead of pp_and).
21543         * expression.cs (Binary.ResolveOperator): I can only use the
21544         Concat (string, string, string) and Concat (string, string,
21545         string, string) if the child is actually a concatenation of
21546         strings. 
21548 2002-12-04  Miguel de Icaza  <miguel@ximian.com>
21550         * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
21551         context where we need a 2-character lookahead.
21553         * pending.cs (PendingImplementation): Rework so we can keep track
21554         of interface types all the time, and flag those which were
21555         implemented by parents as optional.
21557 2002-12-03  Miguel de Icaza  <miguel@ximian.com>
21559         * expression.cs (Binary.ResolveOperator): Use
21560         String.Concat(string,string,string) or
21561         String.Concat(string,string,string,string) when possible. 
21563         * typemanager: More helper methods.
21566 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
21568         * pending.cs: remove the bogus return from GetMissingInterfaces()
21569         (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
21571 2002-12-02  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21573         * namespace.cs: avoid duplicated 'using xxx' being added to
21574         using_clauses. This prevents mcs from issuing and 'ambiguous type' error
21575         when we get more than one 'using' statement for the same namespace.
21576         Report a CS0105 warning for it.
21578 2002-11-30  Miguel de Icaza  <miguel@ximian.com>
21580         * cs-tokenizer.cs (consume_identifier): use read directly, instead
21581         of calling getChar/putback, uses internal knowledge of it.    
21583         (xtoken): Reorder tokenizer so most common patterns are checked
21584         first.  This reduces the compilation time in another 5% (from 8.11s
21585         average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
21587         The parsing time is 22% of the compilation in mcs, and from that
21588         64% is spent on the tokenization process.  
21590         I tried using a binary search for keywords, but this is slower
21591         than the hashtable.  Another option would be to do a couple of
21592         things:
21594                 * Not use a StringBuilder, instead use an array of chars,
21595                   with a set value.  Notice that this way we could catch
21596                   the 645 error without having to do it *afterwards*.
21598                 * We could write a hand-parser to avoid the hashtable
21599                   compares altogether.
21601         The identifier consumption process takes 37% of the tokenization
21602         time.  Another 15% is spent on is_number.  56% of the time spent
21603         on is_number is spent on Int64.Parse:
21605                 * We could probably choose based on the string length to
21606                   use Int32.Parse or Int64.Parse and avoid all the 64-bit
21607                   computations. 
21609         Another 3% is spend on wrapping `xtoken' in the `token' function.
21611         Handle 0xa0 as whitespace (#34752)
21613 2002-11-26  Miguel de Icaza  <miguel@ximian.com>
21615         * typemanager.cs (IsCLRType): New routine to tell whether a type
21616         is one of the builtin types.  
21618         Maybe it needs to use TypeCodes to be faster.  Maybe we could use
21619         typecode in more places instead of doing pointer comparissions.
21620         We could leverage some knowledge about the way the typecodes are
21621         laid out.
21623         New code to cache namespaces in assemblies, it is currently not
21624         invoked, to be used soon.
21626         * decl.cs (DeclSpace.MakeFQN): Simple optimization.
21628         * expression.cs (Binary.ResolveOperator): specially handle
21629         strings, and do not perform user-defined operator overloading for
21630         built-in types.
21632 2002-11-24  Miguel de Icaza  <miguel@ximian.com>
21634         * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
21635         internalcall as it is a pretty simple operation;  Avoid whenever
21636         possible to call Char.IsLetter.
21638         (consume_identifier): Cut by half the number of
21639         hashtable calls by merging the is_keyword and GetKeyword behavior.
21641         Do not short-circuit, because if we do, we
21642         report errors (ie, #if false && true would produce an invalid
21643         directive error);
21646 2002-11-24  Martin Baulig  <martin@ximian.com>
21648         * expression.cs (Cast.TryReduce): If we're in checked syntax,
21649         check constant ranges and report a CS0221.  Fixes #33186.
21651 2002-11-24  Martin Baulig  <martin@ximian.com>
21653         * cs-parser.jay: Make this work for uninitialized variable
21654         declarations in the `for' initializer.  Fixes #32416.
21656 2002-11-24  Martin Baulig  <martin@ximian.com>
21658         * ecore.cs (Expression.ConvertExplicit): Make casting from/to
21659         System.Enum actually work.  Fixes bug #32269, added verify-6.cs.
21661 2002-11-24  Martin Baulig  <martin@ximian.com>
21663         * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
21664         argument; if true, we also check for user-defined conversions.
21665         This is only needed if both arguments are of a user-defined type.
21666         Fixes #30443, added test-175.cs.
21667         (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
21669         * ecore.cs (Expression.ImplicitUserConversionExists): New method.
21671 2002-11-24  Martin Baulig  <martin@ximian.com>
21673         * expression.cs (ArrayAccess.GetStoreOpcode): New public static
21674         function to get the store opcode.
21675         (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
21676         only emit the Ldelema if the store opcode is Stobj.  You must run
21677         both test-34 and test-167 to test this.  Fixes #34529.
21679 2002-11-23  Martin Baulig  <martin@ximian.com>
21681         * ecore.cs (Expression.MemberLookup): Added additional
21682         `qualifier_type' argument which is used when we're being called
21683         from MemberAccess.DoResolve() and null if we're called from a
21684         SimpleName lookup.
21685         (Expression.MemberLookupFailed): New method to report errors; this
21686         does the CS1540 check and reports the correct error message.
21688         * typemanager.cs (MemberLookup): Added additional `qualifier_type'
21689         argument for the CS1540 check and redone the way how we're dealing
21690         with private members.  See the comment in the source code for details.
21691         (FilterWithClosure): Reverted this back to revision 1.197; renamed
21692         `closure_start_type' to `closure_qualifier_type' and check whether
21693         it's not null.  It was not this filter being broken, it was just
21694         being called with the wrong arguments.
21696         * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
21697         and pass it the correct `qualifier_type'; this also does the error
21698         handling for us.
21700 2002-11-22  Miguel de Icaza  <miguel@ximian.com>
21702         * expression.cs (Invocation.EmitParams): If the we are dealing
21703         with a non-built-in value type, load its address as well.
21705         (ArrayCreation): Use a a pretty constant instead
21706         of the hardcoded value 2.   Use 6 instead of 2 for the number of
21707         static initializers.  
21709         (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
21710         because they are not really value types, just glorified integers. 
21712         * driver.cs: Do not append .exe, the CSC compiler does not do it.
21714         * ecore.cs: Remove redundant code for enumerations, make them use
21715         the same code path as everything else, fixes the casting issue
21716         with enumerations in Windows.Forms.
21718         * attribute.cs: Do only cast to string if it is a string, the
21719         validation happens later.
21721         * typemanager.cs: Temproary hack to avoid a bootstrap issue until
21722         people upgrade their corlibs.
21724         * ecore.cs: Oops, enumerations were not following the entire code path
21726 2002-11-21  Miguel de Icaza  <miguel@ximian.com>
21728         * typemanager.cs (FilterWithClosure): Commented out the test for
21729         1540 in typemanager.cs, as it has problems when accessing
21730         protected methods from a parent class (see test-174.cs). 
21732         * attribute.cs (Attribute.ValidateGuid): new method.
21733         (Attribute.Resolve): Use above.
21735 2002-11-19  Miguel de Icaza  <miguel@ximian.com>
21737         * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
21739         * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
21740         handling for enumerations, as we only needed the TypeContainer
21741         functionality to begin with (this is required for the fix below to
21742         work for enums that reference constants in a container class for
21743         example). 
21745         * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
21747         * enum.cs (Enum.Define): Use `this' instead of parent, so we have
21748         a valid TypeBuilder to perform lookups on.o
21750         * class.cs (InheritableMemberSignatureCompare): Use true in the
21751         call to GetGetMethod and GetSetMethod, because we are comparing
21752         the signature, and we need to get the methods *even* if they are
21753         private. 
21755         (PropertyBase.CheckBase): ditto.
21757         * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
21758         GotoCase.Resolve): Use Peel on EmpytCasts.
21760         * ecore.cs (EmptyCast): drop child, add Peel method.
21762 2002-11-17  Martin Baulig  <martin@ximian.com>
21764         * ecore.cs (EmptyCast.Child): New public property.
21766         * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
21767         label resolved to an EmptyCast.  Fixes #34162.
21768         (GotoCase.Resolve): Likewise.
21769         (Block.EmitMeta): Likewise.
21771 2002-11-17  Martin Baulig  <martin@ximian.com>
21773         * expression.cs (Invocation.BetterConversion): Prefer int over
21774         uint; short over ushort; long over ulong for integer literals.
21775         Use ImplicitConversionExists instead of StandardConversionExists
21776         since we also need to check for user-defined implicit conversions.
21777         Fixes #34165.  Added test-173.cs.
21779 2002-11-16  Martin Baulig  <martin@ximian.com>
21781         * expression.cs (Binary.EmitBranchable): Eliminate comparisions
21782         with the `true' and `false' literals.  Fixes #33151.
21784 2002-11-16  Martin Baulig  <martin@ximian.com>
21786         * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
21787         October 22nd; don't do the cs1540 check for static members.
21789         * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
21790         now using our own filter here and doing the cs1540 check again.
21792 2002-11-16  Martin Baulig  <martin@ximian.com>
21794         * support.cs (InternalParameters): Don't crash if we don't have
21795         any fixed parameters.  Fixes #33532.
21797 2002-11-16  Martin Baulig  <martin@ximian.com>
21799         * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
21800         when looking up static methods to make this work on Windows.
21801         Fixes #33773.
21803 2002-11-16  Martin Baulig  <martin@ximian.com>
21805         * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
21806         a setter rather than using PropertyInfo.CanWrite.
21808 2002-11-15  Nick Drochak  <ndrochak@gol.com>
21810         * class.cs: Allow acces to block member by subclasses. Fixes build
21811         breaker.
21813 2002-11-14  Martin Baulig  <martin@ximian.com>
21815         * class.cs (Constructor.Emit): Added the extern/block check.
21816         Fixes bug #33678.
21818 2002-11-14  Martin Baulig  <martin@ximian.com>
21820         * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
21821         iteration while looking for indexers, this is needed because the
21822         indexer may have a different name in our base classes.  Fixed the
21823         error reporting (no indexers at all, not get accessor, no
21824         overloaded match).  Fixes bug #33089.
21825         (IndexerAccess.DoResolveLValue): Likewise.
21827 2002-11-14  Martin Baulig  <martin@ximian.com>
21829         * class.cs (PropertyBase.CheckBase): Make this work for multiple
21830         indexers.  Fixes the first part of bug #33089.
21831         (MethodSignature.InheritableMemberSignatureCompare): Added support
21832         for properties.
21834 2002-11-13  Ravi Pratap  <ravi@ximian.com>
21836         * attribute.cs (Attribute.Resolve): Catch the
21837         NullReferenceException and report it since it isn't supposed to
21838         happen. 
21840 2002-11-12  Miguel de Icaza  <miguel@ximian.com>
21842         * expression.cs (Binary.EmitBranchable): Also handle the cases for
21843         LogicalOr and LogicalAnd that can benefit from recursively
21844         handling EmitBranchable.  The code now should be nice for Paolo.
21846 2002-11-08  Miguel de Icaza  <miguel@ximian.com>
21848         * typemanager.cs (LookupType): Added a negative-hit hashtable for
21849         the Type lookups, as we perform quite a number of lookups on
21850         non-Types.  This can be removed once we can deterministically tell
21851         whether we have a type or a namespace in advance.
21853         But this might require special hacks from our corlib.
21855         * TODO: updated.
21857         * ecore.cs (TryImplicitIntConversion): Handle conversions to float
21858         and double which avoids a conversion from an integer to a double.
21860         * expression.cs: tiny optimization, avoid calling IsConstant,
21861         because it effectively performs the lookup twice.
21863 2002-11-06  Miguel de Icaza  <miguel@ximian.com>
21865         But a bogus return here to keep the semantics of the old code
21866         until the Mono runtime is fixed.
21868         * pending.cs (GetMissingInterfaces): New method used to remove all
21869         the interfaces that are already implemented by our parent
21870         classes from the list of pending methods. 
21872         * interface.cs: Add checks for calls after ResolveTypeExpr.
21874 2002-11-05  Miguel de Icaza  <miguel@ximian.com>
21876         * class.cs (Class.Emit): Report warning 67: event not used if the
21877         warning level is beyond 3.
21879         * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
21880         being a NullLiteral.
21882         * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
21883         specifiers. 
21885         * class.cs (TypeContainer.GetClassBases): Cover a missing code
21886         path that might fail if a type can not be resolved.
21888         * expression.cs (Binary.Emit): Emit unsigned versions of the
21889         operators. 
21891         * driver.cs: use error 5.
21893 2002-11-02  Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
21895         * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
21897 2002-11-01  Miguel de Icaza  <miguel@ximian.com>
21899         * cs-parser.jay (switch_section): A beautiful patch from Martin
21900         Baulig that fixed 33094.
21902 2002-10-31  Miguel de Icaza  <miguel@ximian.com>
21904         * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
21905         Check whether the base is abstract and report an error if so.
21907         * expression.cs (IndexerAccess.DoResolveLValue,
21908         IndexerAccess.DoResolve): ditto. 
21910         (Invocation.DoResolve): ditto.
21912         (Invocation.FullMethodDesc): Improve the report string.
21914         * statement.cs (Block): Eliminate IsVariableDefined as it is
21915         basically just a wrapper for GetVariableInfo.
21917         * ecore.cs (SimpleName): Use new 
21919         * support.cs (ReflectionParamter.ParameterType): We unwrap the
21920         type, as we return the actual parameter ref/unref state on a
21921         different call.
21923 2002-10-30  Miguel de Icaza  <miguel@ximian.com>
21925         * support.cs: Return proper flags REF/OUT fixing the previous
21926         commit.  
21928         * expression.cs: Reverted last patch, that was wrong.  Is_ref is
21929         not used to mean `ref' but `ref or out' in ParameterReference
21931         * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
21932         full type signature instead of calling TypeManger.CSharpName
21933         ourselves. 
21935         * support.cs (InternalParameters.ParameterDesc): Do not compare
21936         directly to the modflags, because REF/OUT will actually be bitsets
21937         if set. 
21939         * delegate.cs (VerifyMethod): Check also the modifiers.
21941         * cs-tokenizer.cs: Fix bug where floating point values with an
21942         exponent where a sign was missing was ignored.
21944         * driver.cs: Allow multiple assemblies to be specified in a single
21945         /r: argument
21947 2002-10-28  Miguel de Icaza  <miguel@ximian.com>
21949         * cs-parser.jay: Ugly.  We had to add a multiplicative_expression,
21950         because identifiers after a parenthesis would end up in this kind
21951         of production, and we needed to desamiguate it for having casts
21952         like:
21954                 (UserDefinedType *) xxx
21956 2002-10-24  Miguel de Icaza  <miguel@ximian.com>
21958         * typemanager.cs (RealMemberLookup): when we deal with a subclass,
21959         we should set on the Bindingflags.NonPublic, but not turn on
21960         private_ok.  private_ok controls whether a Private member is
21961         returned (this is chekced on the filter routine), while the
21962         BindingFlags.NonPublic just controls whether private/protected
21963         will be allowed.   This fixes the problem part of the problem of
21964         private properties being allowed to be used in derived classes.
21966         * expression.cs (BaseAccess): Provide an DoResolveLValue method,
21967         so we can call the children DoResolveLValue method (this will
21968         properly signal errors on lvalue assignments to base properties)
21970         * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
21971         getter are null, and we have a property info, we know that this
21972         happened because the lookup failed, so we report an error 122 for
21973         protection level violation.
21975         We also silently return if setter and getter are null in the
21976         resolve functions, this condition only happens if we have flagged
21977         the error before.  This is the other half of the problem. 
21979         (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
21980         not have accessibility information, that is why we were returning
21981         true in the filter function in typemanager.cs.
21983         To properly report 122 (property is inaccessible because of its
21984         protection level) correctly, we report this error in ResolveAccess
21985         by failing if both the setter and the getter are lacking (ie, the
21986         lookup failed). 
21988         DoResolve and DoLResolve have been modified to check for both
21989         setter/getter being null and returning silently, the reason being
21990         that I did not want to put the knowledge about this error in upper
21991         layers, like:
21993         int old = Report.Errors;
21994         x = new PropertyExpr (...);
21995         if (old != Report.Errors)
21996                 return null;
21997         else
21998                 return x;
22000         So the property expr is returned, but it is invalid, so the error
22001         will be flagged during the resolve process. 
22003         * class.cs: Remove InheritablePropertySignatureCompare from the
22004         class, as we no longer depend on the property signature to compute
22005         whether it is possible to implement a method or not.
22007         The reason is that calling PropertyInfo.GetGetMethod will return
22008         null (in .NET, in Mono it works, and we should change this), in
22009         cases where the Get Method does not exist in that particular
22010         class.
22012         So this code:
22014         class X { public virtual int A { get { return 1; } } }
22015         class Y : X { }
22016         class Z : Y { public override int A { get { return 2; } } }
22018         Would fail in Z because the parent (Y) would not have the property
22019         defined.  So we avoid this completely now (because the alternative
22020         fix was ugly and slow), and we now depend exclusively on the
22021         method names.
22023         (PropertyBase.CheckBase): Use a method-base mechanism to find our
22024         reference method, instead of using the property.
22026         * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
22027         routines are gone now.
22029         * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
22030         names, they were incorrectly named.
22032         * cs-tokenizer.cs: Return are more gentle token on failure. 
22034         * pending.cs (PendingImplementation.InterfaceMethod): This routine
22035         had an out-of-sync index variable, which caused it to remove from
22036         the list of pending methods the wrong method sometimes.
22038 2002-10-22  Miguel de Icaza  <miguel@ximian.com>
22040         * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
22041         CanWrite, because those refer to this particular instance of the
22042         property, and do not take into account the fact that we can
22043         override single members of a property.
22045         Constructor requires an EmitContext.  The resolution process does
22046         not happen here, but we need to compute the accessors before,
22047         because the resolution does not always happen for properties.
22049         * typemanager.cs (RealMemberLookup): Set private_ok if we are a
22050         subclass, before we did not update this flag, but we did update
22051         bindingflags. 
22053         (GetAccessors): Drop this routine, as it did not work in the
22054         presence of partially overwritten set/get methods. 
22056         Notice that this broke the cs1540 detection, but that will require
22057         more thinking. 
22059 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
22061         * class.cs:
22062         * codegen.cs:
22063         * driver.cs: issue a warning instead of an error if we don't support
22064         debugging for the platform. Also ignore a couple of errors that may
22065         arise when trying to write the symbols. Undo my previous patch.
22067 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
22069         * driver.cs: ignore /debug switch except for Unix platforms.
22071 2002-10-23  Nick Drochak  <ndrochak@gol.com>
22073         * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
22075 2002-10-21  Miguel de Icaza  <miguel@ximian.com>
22077         * driver.cs: Do not make mcs-debug conditional, so we do not break
22078         builds that use it.
22080         * statement.cs (UsageVector.MergeChildren): I would like Martin to
22081         review this patch.  But basically after all the children variables
22082         have been merged, the value of "Breaks" was not being set to
22083         new_breaks for Switch blocks.  I think that it should be set after
22084         it has executed.  Currently I set this to the value of new_breaks,
22085         but only if new_breaks is FlowReturn.ALWAYS, which is a bit
22086         conservative, but I do not understand this code very well.
22088         I did not break anything in the build, so that is good ;-)
22090         * cs-tokenizer.cs: Also allow \r in comments as a line separator.
22092 2002-10-20  Mark Crichton  <crichton@gimp.org>
22094         * cfold.cs: Fixed compile blocker.  Really fixed it this time.
22096 2002-10-20  Nick Drochak  <ndrochak@gol.com>
22098         * cfold.cs: Fixed compile blocker.
22100 2002-10-20  Miguel de Icaza  <miguel@ximian.com>
22102         * driver.cs: I was chekcing the key, not the file.
22104 2002-10-19  Ravi Pratap  <ravi@ximian.com>
22106         * ecore.cs (UserDefinedConversion): Get rid of the bogus error
22107         message that we were generating - we just need to silently return
22108         a null.
22110 2002-10-19  Miguel de Icaza  <miguel@ximian.com>
22112         * class.cs (Event.Define): Change my previous commit, as this
22113         breaks the debugger.  This is a temporary hack, as it seems like
22114         the compiler is generating events incorrectly to begin with.
22116         * expression.cs (Binary.ResolveOperator): Added support for 
22117         "U operator - (E x, E y)"
22119         * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
22120         y)".
22122         * ecore.cs (FieldExpr.AddressOf): We had a special code path for
22123         init-only variables, but this path did not take into account that
22124         there might be also instance readonly variables.  Correct this
22125         problem. 
22127         This fixes bug 32253
22129         * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
22130         delegates as well.
22132         * driver.cs: Change the extension for modules to `netmodule'
22134         * cs-parser.jay: Improved slightly the location tracking for
22135         the debugger symbols.
22137         * class.cs (Event.Define): Use Modifiers.FieldAttr on the
22138         modifiers that were specified instead of the hardcoded value
22139         (FamAndAssem).  This was basically ignoring the static modifier,
22140         and others.  Fixes 32429.
22142         * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
22143         fixed a bug in the process (32476)
22145         * expression.cs (ArrayAccess.EmitAssign): Patch from
22146         hwang_rob@yahoo.ca that fixes bug 31834.3
22148 2002-10-18  Miguel de Icaza  <miguel@ximian.com>
22150         * driver.cs: Make the module extension .netmodule.
22152 2002-10-16  Miguel de Icaza  <miguel@ximian.com>
22154         * driver.cs: Report an error if the resource file is not found
22155         instead of crashing.
22157         * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
22158         false, like Emit does.
22160 2002-10-16  Nick Drochak  <ndrochak@gol.com>
22162         * typemanager.cs: Remove unused private member.  Also reported mcs
22163         bug to report this as a warning like csc.
22165 2002-10-15  Martin Baulig  <martin@gnome.org>
22167         * statement.cs (Statement.Emit): Made this a virtual method; emits
22168         the line number info and calls DoEmit().
22169         (Statement.DoEmit): New protected abstract method, formerly knows
22170         as Statement.Emit().
22172         * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
22174 2002-10-11  Miguel de Icaza  <miguel@ximian.com>
22176         * class.cs: Following the comment from 2002-09-26 to AddMethod, I
22177         have fixed a remaining problem: not every AddXXXX was adding a
22178         fully qualified name.  
22180         Now everyone registers a fully qualified name in the DeclSpace as
22181         being defined instead of the partial name.  
22183         Downsides: we are slower than we need to be due to the excess
22184         copies and the names being registered this way.  
22186         The reason for this is that we currently depend (on the corlib
22187         bootstrap for instance) that types are fully qualified, because
22188         we dump all the types in the namespace, and we should really have
22189         types inserted into the proper namespace, so we can only store the
22190         basenames in the defined_names array.
22192 2002-10-10  Martin Baulig  <martin@gnome.org>
22194         * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
22195         from bug #31834, see the bug report for a testcase which is
22196         miscompiled.
22198 2002-10-10  Martin Baulig  <martin@gnome.org>
22200         * codegen.cs (EmitContext.Breaks): Removed, we're now using the
22201         flow analysis code for this.
22203         * statement.cs (Do, While, For): Tell the flow analysis code about
22204         infinite loops.
22205         (FlowBranching.UsageVector): Added support for infinite loops.
22206         (Block.Resolve): Moved the dead code elimination here and use flow
22207         analysis to do it.
22209 2002-10-09  Miguel de Icaza  <miguel@ximian.com>
22211         * class.cs (Field.Define): Catch cycles on struct type
22212         definitions. 
22214         * typemanager.cs (IsUnmanagedtype): Do not recursively check
22215         fields if the fields are static.  We only need to check instance
22216         fields. 
22218         * expression.cs (As.DoResolve): Test for reference type.
22220         * statement.cs (Using.ResolveExpression): Use
22221         ConvertImplicitRequired, not ConvertImplicit which reports an
22222         error on failture
22223         (Using.ResolveLocalVariableDecls): ditto.
22225         * expression.cs (Binary.ResolveOperator): Report errors in a few
22226         places where we had to.
22228         * typemanager.cs (IsUnmanagedtype): Finish implementation.
22230 2002-10-08  Miguel de Icaza  <miguel@ximian.com>
22232         * expression.cs: Use StoreFromPtr instead of extracting the type
22233         and then trying to use Stelem.  Patch is from hwang_rob@yahoo.ca
22235         * ecore.cs (ImplicitReferenceConversion): It is possible to assign
22236         an enumeration value to a System.Enum, but System.Enum is not a
22237         value type, but an class type, so we need to box.
22239         (Expression.ConvertExplicit): One codepath could return
22240         errors but not flag them.  Fix this.  Fixes #31853
22242         * parameter.cs (Resolve): Do not allow void as a parameter type.
22244 2002-10-06  Martin Baulig  <martin@gnome.org>
22246         * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
22247         if it's a class type and not a struct.  Fixes #31815.
22249 2002-10-06  Martin Baulig  <martin@gnome.org>
22251         * statement.cs: Reworked the flow analysis code a bit to make it
22252         usable for dead code elimination.
22254 2002-10-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
22256         * cs-parser.jay: allow empty source files. Fixes bug #31781.
22258 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
22260         * expression.cs (ComposedCast.DoResolveType): A quick workaround
22261         to fix the test 165, will investigate deeper.
22263 2002-10-04  Martin Baulig  <martin@gnome.org>
22265         * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
22266         finally blocks actually work.
22267         (Try.Resolve): We don't need to create a sibling for `finally' if
22268         there is no finally block.
22270 2002-10-04  Martin Baulig  <martin@gnome.org>
22272         * class.cs (Constructor.Define): The default accessibility for a
22273         non-default constructor is private, not public.
22275 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
22277         * class.cs (Constructor): Make AllowedModifiers public, add
22278         EXTERN.
22280         * cs-parser.jay: Perform the modifiers test here, as the
22281         constructor for the Constructor class usually receives a zero
22282         because of the way we create it (first we create, later we
22283         customize, and we were never checking the modifiers).
22285         * typemanager.cs (Typemanager.LookupTypeDirect): This new function
22286         is a version of LookupTypeReflection that includes the type-name
22287         cache.  This can be used as a fast path for functions that know
22288         the fully qualified name and are only calling into *.GetType() to
22289         obtain a composed type.
22291         This is also used by TypeManager.LookupType during its type
22292         composition.
22294         (LookupType): We now also track the real type name, as sometimes
22295         we can get a quey for the real type name from things like
22296         ComposedCast.  This fixes bug 31422.
22298         * expression.cs (ComposedCast.Resolve): Since we are obtaining a
22299         complete type fullname, it does not have to go through the type
22300         resolution system to obtain the composed version of the type (for
22301         obtaining arrays or pointers).
22303         (Conditional.Emit): Use the EmitBoolExpression to
22304         generate nicer code, as requested by Paolo.
22306         (ArrayCreation.CheckIndices): Use the patch from
22307         hwang_rob@yahoo.ca to validate the array initializers. 
22309 2002-10-03  Miguel de Icaza  <miguel@ximian.com>
22311         * class.cs (ConstructorInitializer.Emit): simplify code by using
22312         Invocation.EmitCall, and at the same time, fix the bugs in calling
22313         parent constructors that took variable arguments. 
22315         * ecore.cs (Expression.ConvertNumericExplicit,
22316         Expression.ImplicitNumericConversion): Remove the code that
22317         manually wrapped decimal (InternalTypeConstructor call is now gone
22318         as well).
22320         * expression.cs (Cast.TryReduce): Also handle decimal types when
22321         trying to perform a constant fold on the type.
22323         * typemanager.cs (IsUnmanagedtype): Partially implemented.
22325         * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
22326         that only turned off an error report, and did nothing else. 
22328 2002-10-02  Miguel de Icaza  <miguel@ximian.com>
22330         * driver.cs: Handle and ignore /fullpaths
22332 2002-10-01  Miguel de Icaza  <miguel@ximian.com>
22334         * expression.cs (Binary.ResolveOperator): Catch the case where
22335         DoNumericPromotions returns true, 
22337         (Binary.DoNumericPromotions): Simplify the code, and the tests.
22339 2002-09-27  Miguel de Icaza  <miguel@ximian.com>
22341         * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
22342         report error 70.
22344 2002-09-26  Miguel de Icaza  <miguel@ximian.com>
22346         * ecore.cs (ConvertNumericExplicit): It is not enough that the
22347         conversion exists, but it is also required that the conversion be
22348         performed.  This manifested in "(Type64Enum) 2".  
22350         * class.cs (TypeManager.AddMethod): The fix is not to change
22351         AddEnum, because that one was using a fully qualified name (every
22352         DeclSpace derivative does), but to change the AddMethod routine
22353         that was using an un-namespaced name.  This now correctly reports
22354         the duplicated name.
22356         Revert patch until I can properly fix it.  The issue
22357         is that we have a shared Type space across all namespaces
22358         currently, which is wrong.
22360         Options include making the Namespace a DeclSpace, and merge
22361         current_namespace/current_container in the parser.
22363 2002-09-25  Miguel de Icaza  <miguel@ximian.com>
22365         * cs-parser.jay: Improve error reporting when we get a different
22366         kind of expression in local_variable_type and
22367         local_variable_pointer_type. 
22369         Propagate this to avoid missleading errors being reported.
22371         * ecore.cs (ImplicitReferenceConversion): treat
22372         TypeManager.value_type as a target just like object_type.   As
22373         code like this:
22375         ValueType v = 1;
22377         Is valid, and needs to result in the int 1 being boxed before it
22378         is assigned to the value type v.
22380         * class.cs (TypeContainer.AddEnum): Use the basename, not the name
22381         to validate the enumeration name.
22383         * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
22384         EmitDynamicInitializers for the criteria to use Ldelema.  Thanks
22385         to hwang_rob@yahoo.ca for finding the bug and providing a patch.
22387         * ecore.cs (TryImplicitIntConversion): When doing an
22388         implicit-enumeration-conversion, check if the type is 64-bits and
22389         perform a conversion before passing to EnumConstant.
22391 2002-09-23  Miguel de Icaza  <miguel@ximian.com>
22393         * decl.cs (Error_AmbiguousTypeReference); New routine used to
22394         report ambiguous type references.  Unlike the MS version, we
22395         report what the ambiguity is.   Innovation at work ;-)
22397         (DeclSpace.FindType): Require a location argument to
22398         display when we display an ambiguous error.
22400         * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
22402         * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
22404         * expression.cs (EmitDynamicInitializers): Apply patch from
22405         hwang_rob@yahoo.ca that fixes the order in which we emit our
22406         initializers. 
22408 2002-09-21  Martin Baulig  <martin@gnome.org>
22410         * delegate.cs (Delegate.VerifyApplicability): Make this work if the
22411         delegate takes no arguments.
22413 2002-09-20  Miguel de Icaza  <miguel@ximian.com>
22415         * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
22416         from integers.
22418         * expression.cs: Extract the underlying type.
22420         * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
22422         * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
22424 2002-09-19  Miguel de Icaza  <miguel@ximian.com>
22426         * class.cs (TypeContainer.DefineType): We can not use the nice
22427         PackingSize with the size set to 1 DefineType method, because it
22428         will not allow us to define the interfaces that the struct
22429         implements.
22431         This completes the fixing of bug 27287
22433         * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
22434         means also structs.  This fixes part of the problem. 
22435         (Expresion.ImplicitReferenceConversionExists): ditto.
22437         * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
22438         error if there were no errors reported during the type lookup
22439         process, to avoid duplicates or redundant errors.  Without this
22440         you would get an ambiguous errors plus a type not found.  We have
22441         beaten the user enough with the first error.  
22443         (DeclSparce.FindType): Emit a warning if we have an ambiguous
22444         reference. 
22446         * ecore.cs (SimpleName.DoResolveType): If an error is emitted
22447         during the resolution process, stop the lookup, this avoids
22448         repeated error reports (same error twice).
22450         * rootcontext.cs: Emit a warning if we have an ambiguous reference.
22452         * typemanager.cs (LookupType): Redo the type lookup code to match
22453         the needs of System.Reflection.  
22455         The issue is that System.Reflection requires references to nested
22456         types to begin with a "+" sign instead of a dot.  So toplevel
22457         types look like: "NameSpace.TopLevelClass", and nested ones look
22458         like "Namespace.TopLevelClass+Nested", with arbitrary nesting
22459         levels. 
22461 2002-09-19  Martin Baulig  <martin@gnome.org>
22463         * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
22464         says that a method always returns or always throws an exception,
22465         don't report the CS0161.
22467         * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
22468         set `Returns = new_returns'.
22470 2002-09-19  Martin Baulig  <martin@gnome.org>
22472         * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
22473         to an enum constant, check for a CS0176.
22475 2002-09-18  Miguel de Icaza  <miguel@ximian.com>
22477         * class.cs (TypeContainer.CheckPairedOperators): Now we check
22478         for operators that must be in pairs and report errors.
22480         * ecore.cs (SimpleName.DoResolveType): During the initial type
22481         resolution process, when we define types recursively, we must
22482         check first for types in our current scope before we perform
22483         lookups in the enclosing scopes.
22485         * expression.cs (MakeByteBlob): Handle Decimal blobs.
22487         (Invocation.VerifyArgumentsCompat): Call
22488         TypeManager.TypeToCoreType on the parameter_type.GetElementType.
22489         I thought we were supposed to always call this, but there are a
22490         few places in the code where we dont do it.
22492 2002-09-17  Miguel de Icaza  <miguel@ximian.com>
22494         * driver.cs: Add support in -linkres and -resource to specify the
22495         name of the identifier.
22497 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
22499         * ecore.cs (StandardConversionExists): Sync with the conversion
22500         code: allow anything-* to void* conversions.
22502         (FindMostSpecificSource): Use an Expression argument
22503         instead of a Type, because we might be handed over a Literal which
22504         gets a few more implicit conversions that plain types do not.  So
22505         this information was being lost.
22507         Also, we drop the temporary type-holder expression when not
22508         required.
22510 2002-09-17  Martin Baulig  <martin@gnome.org>
22512         * class.cs (PropertyBase.CheckBase): Don't check the base class if
22513         this is an explicit interface implementation.
22515 2002-09-17  Martin Baulig  <martin@gnome.org>
22517         * class.cs (PropertyBase.CheckBase): Make this work for indexers with
22518         different `IndexerName' attributes.
22520         * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
22521         (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
22522         virtual CommonResolve().
22524 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
22526         * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
22527         and convert that to the UnderlyingType.
22529         * statement.cs (Foreach.Resolve): Indexers are just like variables
22530         or PropertyAccesses.
22532         * cs-tokenizer.cs (consume_string): Track line numbers and columns
22533         inside quoted strings, we were not doing this before.
22535 2002-09-16  Martin Baulig  <martin@gnome.org>
22537         * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
22538         resolve it.  This is needed for the definite assignment check of the
22539         instance expression, fixes bug #29846.
22540         (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
22542 2002-09-16  Nick Drochak  <ndrochak@gol.com>
22544         * parameter.cs: Fix compile error.  Cannot reference static member
22545         from an instance object.  Is this an mcs bug?
22547 2002-09-14  Martin Baulig  <martin@gnome.org>
22549         * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
22550         multiple times.  Fixes bug #30295, added test-166.cs.
22552 2002-09-14  Martin Baulig  <martin@gnome.org>
22554         * statement.cs (Block.Emit): Don't emit unreachable code.
22555         (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
22556         `break' statements.
22557         (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
22559 2002-09-14  Martin Baulig  <martin@gnome.org>
22561         * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
22562         is set.
22564 2002-09-14  Martin Baulig  <martin@gnome.org>
22566         * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
22567         if `type == parent' since in this case `type.IsSubclassOf (parent)' will
22568         be false on the ms runtime.
22570 2002-09-13  Martin Baulig  <martin@gnome.org>
22572         * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
22573         the CS0038 error message.
22575 2002-09-12  Miguel de Icaza  <miguel@ximian.com>
22577         * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
22578         constant inside, return it.
22580 2002-09-12  Martin Baulig  <martin@gnome.org>
22582         * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
22583         implicit conversion can be done between enum types.
22585         * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
22586         check whether an implicit conversion to the current enum's UnderlyingType
22587         exists and report an error if not.
22589         * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
22590         without debugging support.
22592         * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
22593         Fixes bug #30235.  Thanks to Ricardo Fernández Pascual.
22595 2002-09-12  Martin Baulig  <martin@gnome.org>
22597         * typemanager.cs (TypeManager.IsNestedChildOf): New method.
22599         * ecore.cs (IMemberExpr.DeclaringType): New property.
22600         (SimpleName.SimpleNameResolve): Check whether we're accessing a
22601         nonstatic member of an outer type (CS0038).
22603 2002-09-11  Miguel de Icaza  <miguel@ximian.com>
22605         * driver.cs: Activate the using-error detector at warning level
22606         4 (at least for MS-compatible APIs).
22608         * namespace.cs (VerifyUsing): Small buglett fix.
22610         * pending.cs (PendingImplementation): pass the container pointer. 
22612         * interface.cs (GetMethods): Allow for recursive definition.  Long
22613         term, I would like to move every type to support recursive
22614         definitions, not the current ordering mechanism that we have right
22615         now.
22617         The situation is this: Attributes are handled before interfaces,
22618         so we can apply attributes to interfaces.  But some attributes
22619         implement interfaces, we will now handle the simple cases
22620         (recursive definitions will just get an error).  
22622         * parameter.cs: Only invalidate types at the end if we fail to
22623         lookup all types.  
22625 2002-09-09  Martin Baulig  <martin@gnome.org>
22627         * ecore.cs (PropertyExpr.Emit): Also check for
22628         TypeManager.system_int_array_get_length so this'll also work when
22629         compiling corlib.  Fixes #30003.
22631 2002-09-09  Martin Baulig  <martin@gnome.org>
22633         * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
22634         and throw an exception if we can't get the type's size.  Fixed #30040,
22635         added test-165.cs.
22637 2002-09-09  Martin Baulig  <martin@gnome.org>
22639         * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
22641         * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
22642         context.  Fixes bug #30027.
22644         * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
22645         virtual functions.  Fixes bug #30043, added test-164.cs.
22647 2002-09-08  Ravi Pratap  <ravi@ximian.com>
22649         * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
22651 2002-09-08  Nick Drochak  <ndrochak@gol.com>
22653         * driver.cs: Use an object to get the windows codepage since it's not a
22654         static property.
22656 2002-09-08  Miguel de Icaza  <miguel@ximian.com>
22658         * statement.cs (For.Emit): for infinite loops (test == null)
22659         return whether there is a break inside, not always "true".
22661         * namespace.cs (UsingEntry): New struct to hold the name of the
22662         using definition, the location where it is defined, and whether it
22663         has been used in a successful type lookup.
22665         * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
22666         strings.
22668         * decl.cs: ditto.
22670 2002-09-06  Ravi Pratap  <ravi@ximian.com>
22672         * attribute.cs : Fix incorrect code which relied on catching
22673         a NullReferenceException to detect a null being passed in
22674         where an object was expected.
22676 2002-09-06  Miguel de Icaza  <miguel@ximian.com>
22678         * statement.cs (Try): flag the catch variable as assigned
22680         * expression.cs (Cast): Simplified by using ResolveType instead of
22681         manually resolving.
22683         * statement.cs (Catch): Fix bug by using ResolveType.
22685 2002-09-06  Ravi Pratap  <ravi@ximian.com>
22687         * expression.cs (BetterConversion): Special case for when we have
22688         a NullLiteral as the argument and we have to choose between string
22689         and object types - we choose string the way csc does.
22691         * attribute.cs (Attribute.Resolve): Catch the
22692         NullReferenceException and report error #182 since the Mono
22693         runtime no more has the bug and having this exception raised means
22694         we tried to select a constructor which takes an object and is
22695         passed a null.
22697 2002-09-05  Ravi Pratap  <ravi@ximian.com>
22699         * expression.cs (Invocation.OverloadResolve): Flag a nicer error
22700         message (1502, 1503) when we can't locate a method after overload
22701         resolution. This is much more informative and closes the bug
22702         Miguel reported.
22704         * interface.cs (PopulateMethod): Return if there are no argument
22705         types. Fixes a NullReferenceException bug.
22707         * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
22708         expressions too. Previously we were checking only in one place for
22709         positional arguments leaving out named arguments.
22711         * ecore.cs (ImplicitNumericConversion): Conversion from underlying
22712         type to the enum type is not allowed. Remove code corresponding to
22713         that.
22715         (ConvertNumericExplicit): Allow explicit conversions from
22716         the underlying type to enum type. This precisely follows the spec
22717         and closes a bug filed by Gonzalo.
22719 2002-09-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
22721         * compiler.csproj:
22722         * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
22724 2002-09-03  Miguel de Icaza  <miguel@ximian.com>
22726         * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
22727         it was important that we stored the right value after the
22728         reduction in `converted'.
22730 2002-09-04  Martin Baulig  <martin@gnome.org>
22732         * location.cs (Location.SymbolDocument): Use full pathnames for the
22733         source files.
22735 2002-08-30  Miguel de Icaza  <miguel@ximian.com>
22737         * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
22738         of the expression resolve mechanism, because that will catch the
22739         SimpleName error failures.
22741         (Conditional): If we can not resolve the
22742         expression, return, do not crash.
22744 2002-08-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
22746         * cs-tokenizer.cs:
22747         (location): display token name instead of its number.
22749 2002-08-28  Martin Baulig  <martin@gnome.org>
22751         * expression.cs (Binary.ResolveOperator): Don't silently return
22752         but return an error if an operator cannot be applied between two
22753         enum types.
22755 2002-08-28  Martin Baulig  <martin@gnome.org>
22757         * class.cs (Constructor.Define): Set the permission attributes
22758         correctly instead of making all constructors public.
22760 2002-08-28  Martin Baulig  <martin@gnome.org>
22762         * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
22763         for private members before reporting a CS0103; if we find anything,
22764         it's a CS0122.
22766 2002-08-28  Martin Baulig  <martin@gnome.org>
22768         * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
22769         to check whether `closure_start_type == closure_invocation_type',
22770         we also need to check whether `m.DeclaringType == closure_invocation_type'
22771         before bypassing the permission checks.  We might be accessing
22772         protected/private members from the base class.
22773         (TypeManager.RealMemberLookup): Only set private_ok if private
22774         members were requested via BindingFlags.NonPublic.
22776         * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
22778         * expression.cs (MemberAccess.ResolveMemberAccess): Set
22779         MethodGroupExpr.IsExplicitImpl if appropriate.
22780         (Invocation.DoResolve): Don't report the CS0120 for explicit
22781         interface implementations.
22783 2002-08-27  Martin Baulig  <martin@gnome.org>
22785         * expression.cs (Invocation.DoResolve): If this is a static
22786         method and we don't have an InstanceExpression, we must report
22787         a CS0120.
22789 2002-08-25  Martin Baulig  <martin@gnome.org>
22791         * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
22792         `==' between a valuetype and an object.
22794 2002-08-25  Miguel de Icaza  <miguel@ximian.com>
22796         * ecore.cs (TypeExpr): Provide a ToString method.
22798 2002-08-24  Martin Baulig  <martin@gnome.org>
22800         * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
22801         now called proggie.dbg and it's a binary file.
22803 2002-08-23  Martin Baulig  <martin@gnome.org>
22805         * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
22807 2002-08-23  Martin Baulig  <martin@gnome.org>
22809         * struct.cs (MyStructInfo.ctor): Make this work with empty
22810         structs; it's not allowed to use foreach() on null.
22812 2002-08-23  Martin Baulig  <martin@gnome.org>
22814         * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
22815         writer the full pathname of the generated assembly.
22817 2002-08-23  Martin Baulig  <martin@gnome.org>
22819         * statements.cs (FlowBranching.UsageVector.MergeChildren):
22820         A `finally' block never returns or breaks; improved handling of
22821         unreachable code.
22823 2002-08-23  Martin Baulig  <martin@gnome.org>
22825         * statement.cs (Throw.Resolve): Allow `throw null'.
22827 2002-08-23  Martin Baulig  <martin@gnome.org>
22829         * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
22830         EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
22831         `ee.EventInfo.DeclaringType == ec.ContainerType'.  The
22832         MemberLookup would return a wrong event if this is an explicit
22833         interface implementation and the class has an event with the same
22834         name.
22836 2002-08-23  Martin Baulig  <martin@gnome.org>
22838         * statement.cs (Block.AddChildVariableNames): New public method.
22839         (Block.AddChildVariableName): Likewise.
22840         (Block.IsVariableNameUsedInChildBlock): Likewise.
22841         (Block.AddVariable): Check whether a variable name has already
22842         been used in a child block.
22844         * cs-parser.jay (declare_local_variables): Mark all variable names
22845         from the current block as being used in a child block in the
22846         implicit block.
22848 2002-08-23  Martin Baulig  <martin@gnome.org>
22850         * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
22851         find the symbol writer.
22853         * driver.cs: csc also allows the arguments to /define being
22854         separated by commas, not only by semicolons.
22856 2002-08-23  Martin Baulig  <martin@gnome.org>
22858         * interface.cs (Interface.GetMembers): Added static check for events.
22860 2002-08-15  Martin Baulig  <martin@gnome.org>
22862         * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
22863         call, use ec.ContainerType.BaseType as queried_type and invocation_type.
22865         * ecore.cs (Expression.MemberLookup): Added documentation and explained
22866         why the MethodData.EmitDestructor() change was necessary.
22868 2002-08-20  Martin Baulig  <martin@gnome.org>
22870         * class.cs (TypeContainer.FindMembers): Added static check for events.
22872         * decl.cs (MemberCache.AddMembers): Handle events like normal members.
22874         * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
22875         use Type.GetEvents(), not Type.FindMembers().
22877 2002-08-20  Martin Baulig  <martin@gnome.org>
22879         * decl.cs (MemberCache): Added a special method cache which will
22880         be used for method-only searched.  This ensures that a method
22881         search will return a MethodInfo with the correct ReflectedType for
22882         inherited methods.      
22884 2002-08-20  Martin Baulig  <martin@gnome.org>
22886         * decl.cs (DeclSpace.FindMembers): Made this public.
22888 2002-08-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
22890         * delegate.cs: fixed build on windows.
22891         [FIXME:  Filed as bug #29150: MCS must report these errors.]
22893 2002-08-19  Ravi Pratap  <ravi@ximian.com>
22895         * ecore.cs (StandardConversionExists): Return a false
22896         if we are trying to convert the void type to anything else
22897         since that is not allowed.
22899         * delegate.cs (DelegateInvocation.DoResolve): Ensure that
22900         we flag error 70 in the event an event is trying to be accessed
22901         directly from outside the declaring type.
22903 2002-08-20  Martin Baulig  <martin@gnome.org>
22905         * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
22906         MemberCache from typemanager.cs to decl.cs.
22908 2002-08-19  Martin Baulig  <martin@gnome.org>
22910         * class.cs (TypeContainer): Implement IMemberContainer.
22911         (TypeContainer.DefineMembers): Create the MemberCache.
22912         (TypeContainer.FindMembers): Do better BindingFlags checking; only
22913         return public members if BindingFlags.Public was given, check
22914         whether members are static.
22916 2002-08-16  Martin Baulig  <martin@gnome.org>
22918         * decl.cs (DeclSpace.Define): Splitted this in Define and
22919         DefineMembers.  DefineMembers is called first and initializes the
22920         MemberCache.
22922         * rootcontext.cs (RootContext.DefineMembers): New function.  Calls
22923         DefineMembers() on all our DeclSpaces.
22925         * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
22926         but call DefineMembers() on all nested interfaces.  We call their
22927         Define() in our new Define() function.
22929         * interface.cs (Interface): Implement IMemberContainer.
22930         (Interface.Define): Moved all code except the attribute stuf to
22931         DefineMembers().
22932         (Interface.DefineMembers): Initialize the member cache.
22934         * typemanager.cs (IMemberFinder): Removed this interface, we don't
22935         need this anymore since we can use MemberCache.FindMembers directly.
22937 2002-08-19  Martin Baulig  <martin@gnome.org>
22939         * typemanager.cs (MemberCache): When creating the cache for an
22940         interface type, add all inherited members.
22941         (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
22942         to `out bool used_cache' and documented it.
22943         (TypeManager.MemberLookup): If we already used the cache in the first
22944         iteration, we don't need to do the interfaces check.
22946 2002-08-19  Martin Baulig  <martin@gnome.org>
22948         * decl.cs (DeclSpace.FindMembers): New abstract method.  Moved this
22949         here from IMemberFinder and don't implement this interface anymore.
22950         (DeclSpace.MemberCache): Moved here from IMemberFinder.
22952         * typemanager.cs (IMemberFinder): This interface is now only used by
22953         classes which actually support the member cache.
22954         (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
22955         since we only put DeclSpaces into this Hashtable.
22956         (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
22957         a dynamic type and TypeHandle.GetTypeHandle() otherwise.
22959 2002-08-16  Martin Baulig  <martin@gnome.org>
22961         * typemanager.cs (ICachingMemberFinder): Removed.
22962         (IMemberFinder.MemberCache): New property.
22963         (TypeManager.FindMembers): Merged this with RealFindMembers().
22964         This function will never be called from TypeManager.MemberLookup()
22965         so we can't use the cache here, just the IMemberFinder.
22966         (TypeManager.MemberLookup_FindMembers): Check whether the
22967         IMemberFinder has a MemberCache and call the cache's FindMembers
22968         function.
22969         (MemberCache): Rewrote larger parts of this yet another time and
22970         cleaned it up a bit.
22972 2002-08-15  Miguel de Icaza  <miguel@ximian.com>
22974         * driver.cs (LoadArgs): Support quoting.
22976         (Usage): Show the CSC-like command line arguments.
22978         Improved a few error messages.
22980 2002-08-15  Martin Baulig  <martin@gnome.org>
22982         * typemanager.cs (IMemberContainer.Type): New property.
22983         (IMemberContainer.IsInterface): New property.
22985         The following changes are conditional to BROKEN_RUNTIME, which is
22986         defined at the top of the file.
22988         * typemanager.cs (MemberCache.MemberCache): Don't add the base
22989         class'es members, but add all members from TypeHandle.ObjectType
22990         if we're an interface.
22991         (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
22992         is the current type.
22993         (MemberCache.CacheEntry.Container): Removed this field.
22994         (TypeHandle.GetMembers): Include inherited members.
22996 2002-08-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
22998         * typemanager.cs: fixed compilation and added a comment on a field that
22999         is never used.
23001 2002-08-15  Martin Baulig  <martin@gnome.org>
23003         * class.cs (ConstructorInitializer.Resolve): In the
23004         Expression.MemberLookup call, use the queried_type as
23005         invocation_type.
23007         * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
23008         declared' attribute, it's always true.
23009         (IMemberContainer.Parent, IMemberContainer.Name): New properties.
23010         (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
23011         temporary wrapper for FindMembers which tells MemberLookup whether
23012         members from the base classes are included in the return value.
23013         This will go away soon.
23014         (TypeManager.MemberLookup): Use this temporary hack here; once the
23015         new MemberCache is completed, we don't need to do the DeclaredOnly
23016         looping here anymore since the MemberCache will take care of this.
23017         (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
23018         (MemberCache): When creating the MemberCache for a class, get
23019         members from the current class and all its base classes.
23020         (MemberCache.CacheEntry.Container): New field.  This is a
23021         temporary hack until the Mono runtime is fixed to distinguish
23022         between ReflectedType and DeclaringType.  It allows us to use MCS
23023         with both the MS runtime and the unfixed Mono runtime without
23024         problems and without accecting performance.
23025         (MemberCache.SearchMembers): The DeclaredOnly looping from
23026         TypeManager.MemberLookup is now done here.      
23028 2002-08-14  Martin Baulig  <martin@gnome.org>
23030         * statement.cs (MyStructInfo.MyStructInfo): Don't call
23031         Type.GetFields on dynamic types but get the fields from the
23032         corresponding TypeContainer.
23033         (MyStructInfo.GetStructInfo): Added check for enum types.
23035         * typemanager.cs (MemberList.IsSynchronized): Implemented.
23036         (MemberList.SyncRoot): Implemented.
23037         (TypeManager.FilterWithClosure): No need to check permissions if
23038         closure_start_type == closure_invocation_type, don't crash if
23039         closure_invocation_type is null.
23041 2002-08-13  Martin Baulig  <martin@gnome.org>
23043         Rewrote TypeContainer.FindMembers to use a member cache.  This
23044         gives us a speed increase of about 35% for the self-hosting MCS
23045         build and of about 15-20% for the class libs (both on GNU/Linux).
23047         * report.cs (Timer): New class to get enhanced profiling.  This
23048         whole class is "TIMER" conditional since it remarkably slows down
23049         compilation speed.
23051         * class.cs (MemberList): New class.  This is an IList wrapper
23052         which we're now using instead of passing MemberInfo[]'s around to
23053         avoid copying this array unnecessarily.
23054         (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
23055         (ICachingMemberFinder, IMemberContainer): New interface.
23056         (TypeManager.FilterWithClosure): If `criteria' is null, the name
23057         has already been checked, otherwise use it for the name comparision.
23058         (TypeManager.FindMembers): Renamed to RealMemberFinder and
23059         provided wrapper which tries to use ICachingMemberFinder.FindMembers
23060         if possible.  Returns a MemberList, not a MemberInfo [].
23061         (TypeHandle): New class, implements IMemberContainer.  We create
23062         one instance of this class per type, it contains a MemberCache
23063         which is used to do the member lookups.
23064         (MemberCache): New class.  Each instance of this class contains
23065         all members of a type and a name-based hash table.
23066         (MemberCache.FindMembers): This is our new member lookup
23067         function.  First, it looks up all members of the requested name in
23068         the hash table.  Then, it walks this list and sorts out all
23069         applicable members and returns them.
23071 2002-08-13  Martin Baulig  <martin@gnome.org>
23073         In addition to a nice code cleanup, this gives us a performance
23074         increase of about 1.4% on GNU/Linux - not much, but it's already
23075         half a second for the self-hosting MCS compilation.
23077         * typemanager.cs (IMemberFinder): New interface.  It is used by
23078         TypeManager.FindMembers to call FindMembers on a TypeContainer,
23079         Enum, Delegate or Interface.
23080         (TypeManager.finder_to_member_finder): New PtrHashtable.
23081         (TypeManager.finder_to_container): Removed.
23082         (TypeManager.finder_to_delegate): Removed.
23083         (TypeManager.finder_to_interface): Removed.
23084         (TypeManager.finder_to_enum): Removed.
23086         * interface.cs (Interface): Implement IMemberFinder.
23088         * delegate.cs (Delegate): Implement IMemberFinder.
23090         * enum.cs (Enum): Implement IMemberFinder.
23092         * class.cs (TypeContainer): Implement IMemberFinder.
23094 2002-08-12  Martin Baulig  <martin@gnome.org>
23096         * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
23098 2002-08-12  Martin Baulig  <martin@gnome.org>
23100         * ecore.cs (ITypeExpression): New interface for expressions which
23101         resolve to a type.
23102         (TypeExpression): Renamed to TypeLookupExpression.
23103         (Expression.DoResolve): If we're doing a types-only lookup, the
23104         expression must implement the ITypeExpression interface and we
23105         call DoResolveType() on it.
23106         (SimpleName): Implement the new ITypeExpression interface.
23107         (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
23108         hack, the situation that we're only looking up types can't happen
23109         anymore when this method is called.  Moved the type lookup code to
23110         DoResolveType() and call it.
23111         (SimpleName.DoResolveType): This ITypeExpression interface method
23112         is now doing the types-only lookup.
23113         (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
23114         (ResolveFlags): Added MaskExprClass.
23116         * expression.cs (MemberAccess): Implement the ITypeExpression
23117         interface.
23118         (MemberAccess.DoResolve): Added support for a types-only lookup
23119         when we're called via ITypeExpression.DoResolveType().
23120         (ComposedCast): Implement the ITypeExpression interface.
23122         * codegen.cs (EmitContext.OnlyLookupTypes): Removed.  Call
23123         Expression.Resolve() with ResolveFlags.Type instead.
23125 2002-08-12  Martin Baulig  <martin@gnome.org>
23127         * interface.cs (Interface.Define): Apply attributes.
23129         * attribute.cs (Attribute.ApplyAttributes): Added support for
23130         interface attributes.
23132 2002-08-11  Martin Baulig  <martin@gnome.org>
23134         * statement.cs (Block.Emit): Only check the "this" variable if we
23135         do not always throw an exception.
23137         * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
23138         whether the property has a set accessor.
23140 2002-08-11  Martin Baulig  <martin@gnome.org>
23142         Added control flow analysis support for structs.
23144         * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
23145         with control flow analysis turned off.
23146         (IVariable): New interface.
23147         (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
23148         returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
23149         (FieldExpr.DoResolve): Resolve the instance expression with flow
23150         analysis turned off and do the definite assignment check after the
23151         resolving when we know what the expression will resolve to.
23153         * expression.cs (LocalVariableReference, ParameterReference):
23154         Implement the new IVariable interface, only call the flow analysis
23155         code if ec.DoFlowAnalysis is true.
23156         (This): Added constructor which takes a Block argument.  Implement
23157         the new IVariable interface.
23158         (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
23159         DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
23160         This does the definite assignment checks for struct members.
23162         * class.cs (Constructor.Emit): If this is a non-static `struct'
23163         constructor which doesn't have any initializer, call
23164         Block.AddThisVariable() to tell the flow analysis code that all
23165         struct elements must be initialized before control returns from
23166         the constructor.
23168         * statement.cs (MyStructInfo): New public class.
23169         (UsageVector.this [VariableInfo vi]): Added `int field_idx'
23170         argument to this indexer.  If non-zero, check an individual struct
23171         member, not the whole struct.
23172         (FlowBranching.CheckOutParameters): Check struct members.
23173         (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
23174         overloaded versions of these methods which take an additional
23175         `int field_idx' argument to check struct members.
23176         (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
23177         overloaded versions of these methods which take an additional
23178         `string field_name' argument to check struct member.s
23179         (VariableInfo): Implement the IVariable interface.
23180         (VariableInfo.StructInfo): New public property.  Returns the
23181         MyStructInfo instance of the variable if it's a struct or null.
23182         (Block.AddThisVariable): New public method.  This is called from
23183         Constructor.Emit() for non-static `struct' constructor which do
23184         not have any initializer.  It creates a special variable for the
23185         "this" instance variable which will be checked by the flow
23186         analysis code to ensure that all of the struct's fields are
23187         initialized before control returns from the constructor.
23188         (UsageVector): Added support for struct members.  If a
23189         variable/parameter is a struct with N members, we reserve a slot
23190         in the usage vector for each member.  A struct is considered fully
23191         initialized if either the struct itself (slot 0) or all its
23192         members are initialized.
23194 2002-08-08  Martin Baulig  <martin@gnome.org>
23196         * driver.cs (Driver.MainDriver): Only report an error CS5001
23197         if there were no compilation errors.
23199         * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
23200         `UnsafeContext' property to determine whether the parent is in
23201         unsafe context rather than checking the parent's ModFlags:
23202         classes nested in an unsafe class are unsafe as well.
23204 2002-08-08  Martin Baulig  <martin@gnome.org>
23206         * statement.cs (UsageVector.MergeChildren): Distinguish between
23207         `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
23208         we return.  Added test17() and test18() to test-154.cs.
23210 2002-08-08  Martin Baulig  <martin@gnome.org>
23212         * typemanager.cs (TypeManager.FilterWithClosure): If we have
23213         Family access, make sure the invoking type isn't a subclass of the
23214         queried type (that'd be a CS1540).
23216         * ecore.cs (Expression.MemberLookup): Added overloaded version of
23217         this method which takes an additional `Type invocation_type'.
23219         * expression.cs (BaseAccess.DoResolve): Use the base type as
23220         invocation and query type.
23221         (MemberAccess.DoResolve): If the lookup failed and we're about to
23222         report a CS0122, try a lookup with the ec.ContainerType - if this
23223         succeeds, we must report a CS1540.
23225 2002-08-08  Martin Baulig  <martin@gnome.org>
23227         * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
23228         (MethodGroupExpr): Implement the IMemberExpr interface.
23230         * expression (MemberAccess.ResolveMemberAccess): No need to have
23231         any special code for MethodGroupExprs anymore, they're now
23232         IMemberExprs.   
23234 2002-08-08  Martin Baulig  <martin@gnome.org>
23236         * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
23237         Family, FamANDAssem and FamORAssem permissions.
23238         (TypeManager.IsSubclassOrNestedChildOf): New public method.
23240 2002-08-08  Martin Baulig  <martin@gnome.org>
23242         * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
23243         (UsageVector.MergeChildren): `break' breaks unless we're in a switch
23244         or loop block.
23246 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
23248         * driver.cs: implemented /resource option to embed managed resources.
23250 2002-08-07  Martin Baulig  <martin@gnome.org>
23252         * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
23253         (FieldBase.HasFieldInitializer): New public property.
23254         (FieldBase.GetInitializerExpression): New public method.  Resolves and
23255         returns the field initializer and makes sure it is only resolved once.
23256         (TypeContainer.EmitFieldInitializers): Call
23257         FieldBase.GetInitializerExpression to get the initializer, this ensures
23258         that it isn't resolved multiple times.
23260         * codegen.cs (EmitContext): Added `bool IsFieldInitialier'.  This tells
23261         the resolving process (SimpleName/MemberLookup) that we're currently
23262         emitting a field initializer (which must not access any instance members,
23263         this is an error CS0236).
23265         * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
23266         argument, if the `IsFieldInitializer' flag is set, we must report and
23267         error CS0236 and not an error CS0120.   
23269 2002-08-07  Martin Baulig  <martin@gnome.org>
23271         * ecore.cs (IMemberExpr): New public interface.
23272         (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
23273         (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
23274         if the expression is an IMemberExpr.
23276         * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
23277         to be null, implicitly default to `this' if we're non-static in
23278         this case.  Simplified the code a lot by using the new IMemberExpr
23279         interface.  Also fixed bug #28176 here.
23281 2002-08-06  Martin Baulig  <martin@gnome.org>
23283         * cs-parser.jay (SimpleLookup): Removed.  We need to create
23284         ParameterReferences during semantic analysis so that we can do a
23285         type-only search when resolving Cast, TypeOf and SizeOf.
23286         (block): Pass the `current_local_parameters' to the Block's
23287         constructor.
23289         * class.cs (ConstructorInitializer): Added `Parameters parameters'
23290         argument to the constructor.
23291         (ConstructorInitializer.Resolve): Create a temporary implicit
23292         block with the parameters.
23294         * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
23295         references here if we aren't doing a type-only search.
23297         * statement.cs (Block): Added constructor which takes a
23298         `Parameters parameters' argument.
23299         (Block.Parameters): New public property.
23301         * support.cs (InternalParameters.Parameters): Renamed `parameters'
23302         to `Parameters' and made it public readonly.
23304 2002-08-06  Martin Baulig  <martin@gnome.org>
23306         * ecore.cs (Expression.Warning): Made this public as well.
23308         * report.cs (Report.Debug): Print the contents of collections.
23310 2002-08-06  Martin Baulig  <martin@gnome.org>
23312         * ecore.cs (Expression.ResolveFlags): New [Flags] enum.  This is
23313         used to tell Resolve() which kinds of expressions it may return.
23314         (Expression.Resolve): Added overloaded version of this method which
23315         takes a `ResolveFlags flags' argument.  This can be used to tell
23316         Resolve() which kinds of expressions it may return.  Reports a
23317         CS0118 on error.
23318         (Expression.ResolveWithSimpleName): Removed, use Resolve() with
23319         ResolveFlags.SimpleName.
23320         (Expression.Error118): Added overloaded version of this method which
23321         takes a `ResolveFlags flags' argument.  It uses the flags to determine
23322         which kinds of expressions are allowed.
23324         * expression.cs (Argument.ResolveMethodGroup): New public method.
23325         Resolves an argument, but allows a MethodGroup to be returned.
23326         This is used when invoking a delegate.
23328         * TODO: Updated a bit.
23330 2002-08-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
23332         Fixed compilation with csc.
23334         * ecore.cs: Expression.Error made public. Is this correct? Should
23335         Warning be made public too?
23337         * expression.cs: use ea.Location instead of ea.loc.
23338         [FIXME:  Filed as bug #28607: MCS must report these errors.]
23340 2002-08-06  Martin Baulig  <martin@gnome.org>
23342         * ecore.cs (Expression.loc): Moved the location here instead of
23343         duplicating it in all derived classes.
23344         (Expression.Location): New public property.
23345         (Expression.Error, Expression.Warning): Made them non-static and
23346         removed the location argument.
23347         (Expression.Warning): Added overloaded version which takes an
23348         `int level' argument.
23349         (Expression.Error118): Make this non-static and removed the
23350         expression and location arguments.
23351         (TypeExpr): Added location argument to the constructor.
23353         * expression.cs (StaticCallExpr): Added location argument to
23354         the constructor.
23355         (Indirection, PointerArithmetic): Likewise.
23356         (CheckedExpr, UnCheckedExpr): Likewise.
23357         (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
23358         (StringPtr): Likewise.
23361 2002-08-05  Martin Baulig  <martin@gnome.org>
23363         * expression.cs (BaseAccess.DoResolve): Actually report errors.
23365         * assign.cs (Assign.DoResolve): Check whether the source
23366         expression is a value or variable.
23368         * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
23369         while resolving the corresponding blocks.
23371         * interface.cs (Interface.GetInterfaceTypeByName): Actually report
23372         an error, don't silently return null.
23374         * statement.cs (Block.AddVariable): Do the error reporting here
23375         and distinguish between CS0128 and CS0136.
23376         (Block.DoResolve): Report all unused labels (warning CS0164).
23377         (LabeledStatement): Pass the location to the constructor.
23378         (LabeledStatement.HasBeenReferenced): New property.
23379         (LabeledStatement.Resolve): Set it to true here.
23381         * statement.cs (Return.Emit): Return success even after reporting
23382         a type mismatch error (CS0126 or CS0127), this is what csc does and
23383         it avoids confusing the users with any consecutive errors.
23385 2002-08-05  Martin Baulig  <martin@gnome.org>
23387         * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
23389         * const.cs (Const.LookupConstantValue): Catch circular definitions.
23391         * expression.cs (MemberAccess.DoResolve): Silently return if an
23392         error has already been reported.
23394         * ecore.cs (Expression.MemberLookupFinal): Silently return if an
23395         error has already been reported.
23397 2002-08-05  Martin Baulig  <martin@gnome.org>
23399         * statement.cs (UsageVector): Only initialize the `parameters'
23400         vector if we actually have any "out" parameters.
23402 2002-08-05  Martin Baulig  <martin@gnome.org>
23404         * expression.cs (Binary.ResolveOperator): When combining delegates,
23405         they must have the same type.
23407 2002-08-05  Martin Baulig  <martin@gnome.org>
23409         * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
23410         PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
23411         work with the ms runtime and we also don't need it: if we're a
23412         PropertyBuilder and not in the `indexer_arguments' hash, then we
23413         are a property and not an indexer.
23415         * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
23416         Type.IsPointer and Type.IsByRef instead of Type.HasElementType
23417         since the latter one doesn't work with the ms runtime.
23419 2002-08-03  Martin Baulig  <martin@gnome.org>
23421         Fixed bugs #27998 and #22735.
23423         * class.cs (Method.IsOperator): New public field.
23424         (Method.CheckBase): Report CS0111 if there's already a method
23425         with the same parameters in the current class.  Report CS0508 when
23426         attempting to change the return type of an inherited method.
23427         (MethodData.Emit): Report CS0179 if a method doesn't have a body
23428         and it's not marked abstract or extern.
23429         (PropertyBase): New abstract base class for Property and Indexer.
23430         (PropertyBase.CheckBase): Moved here from Property and made it work
23431         for indexers.
23432         (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
23433         the same so we can reuse it there.
23434         (Property, Indexer): Derive from PropertyBase.
23435         (MethodSignature.inheritable_property_signature_filter): New delegate
23436         to find properties and indexers.
23438         * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
23439         argument and improved error reporting.
23441         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
23442         EmptyReadOnlyParameters and made it a property.
23444         * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
23445         version of this method which takes a `PropertyInfo indexer'.
23446         (TypeManager.RegisterIndexer): New method.
23448         * class.cs: Added myself as author of this file :-)
23450 2002-08-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
23452         * class.cs: fixed compilation on windoze.
23454 2002-08-03  Martin Baulig  <martin@gnome.org>
23456         * interface.cs (Interface.GetInterfaceBases): Check whether all
23457         base interfaces are at least as accessible than the current one.
23459         * class.cs (TypeContainer.GetClassBases): Check whether base types
23460         are at least as accessible than the current type.
23461         (TypeContainer.AsAccessible): Implemented and made non-static.
23462         (MemberBase.CheckParameters): Report errors if the accessibility
23463         checks fail.
23465         * delegate.cs (Delegate.Delegate): The default visibility is
23466         internal for top-level types and private for nested types.
23467         (Delegate.Define): Report errors if the accessibility checks fail.
23469         * enum.cs (Enum.Enum): The default visibility is internal for
23470         top-level types and private for nested types.
23471         (Enum.DefineType): Compute the correct visibility.
23473         * modifiers.cs (Modifiers.TypeAttr): Added a version of this
23474         function which takes a `bool is_toplevel' instead of a TypeContainer.
23476         * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
23477         builtin type.
23479 2002-08-02  Martin Baulig  <martin@gnome.org>
23481         * expression.cs (LocalVariableReferenc): Added constructor which
23482         takes additional `VariableInfo vi' and `bool is_readonly' arguments.
23483         (LocalVariableReference.IsReadOnly): New property.
23484         (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
23485         variable is readonly, use our own readonly flag to do this; you can
23486         use the new constructor to get a writable reference to a read-only
23487         variable.
23489         * cs-parser.jay (foreach_statement, using_statement): Get a writable
23490         reference to the local variable.
23492 2002-08-01  Miguel de Icaza  <miguel@ximian.com>
23494         * rootcontext.cs (ResolveCore): Also include System.Exception
23496         * statement.cs (Block.Emit): Do not emit the dead-code warnings if
23497         we reach an EmptyStatement.
23499         (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
23500         is also fine.
23502         * expression.cs (Binary.ResolveOperator): Check error result in
23503         two places.
23505         use brtrue/brfalse directly and avoid compares to null.
23507 2002-08-02  Martin Baulig  <martin@gnome.org>
23509         * class.cs (TypeContainer.Define): Define all nested interfaces here.
23510         Fixes bug #28407, added test-155.cs.
23512 2002-08-01  Martin Baulig  <martin@gnome.org>
23514         * class.cs (Event.EmitDefaultMethod): Make this work with static
23515         events.  Fixes #28311, added verify-3.cs.
23517 2002-08-01  Martin Baulig  <martin@gnome.org>
23519         * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
23520         `is_disposable' fields.
23521         (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
23522         `hm.is_disposable' if we're using the collection pattern.
23523         (Foreach.EmitCollectionForeach): Use the correct type for the
23524         enumerator's local variable, only emit the try/finally block if
23525         necessary (fixes #27713).
23527 2002-08-01  Martin Baulig  <martin@gnome.org>
23529         * ecore.cs (Expression.report118): Renamed to Error118 and made
23530         it public static.
23532         * statement.cs (Throw.Resolve): Check whether the expression is of
23533         the correct type (CS0118) and whether the type derives from
23534         System.Exception (CS0155).
23535         (Catch.Resolve): New method.  Do the type lookup here and check
23536         whether it derives from System.Exception (CS0155).
23537         (Catch.CatchType, Catch.IsGeneral): New public properties.
23539         * typemanager.cs (TypeManager.exception_type): Added.
23541 2002-07-31  Miguel de Icaza  <miguel@ximian.com>
23543         * driver.cs: Updated About function.
23545 2002-07-31  Martin Baulig  <martin@gnome.org>
23547         Implemented Control Flow Analysis.
23549         * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
23550         (EmitContext.CurrentBranching): Added.
23551         (EmitContext.StartFlowBranching): Added.
23552         (EmitContext.EndFlowBranching): Added.
23553         (EmitContext.KillFlowBranching): Added.
23554         (EmitContext.IsVariableAssigned): Added.
23555         (EmitContext.SetVariableAssigned): Added.
23556         (EmitContext.IsParameterAssigned): Added.
23557         (EmitContext.SetParameterAssigned): Added.
23558         (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
23559         Added control flow analysis stuff here.
23561         * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
23562         resolve the expression as lvalue.
23563         (LocalVariableReference.DoResolve): Check whether the variable has
23564         already been assigned.
23565         (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
23566         the parameter as assigned here.
23567         (ParameterReference.DoResolve): Check whether the parameter has already
23568         been assigned.
23569         (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
23570         expression as lvalue.
23572         * statement.cs (FlowBranching): New class for the flow analysis code.
23573         (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
23574         (LabeledStatement.IsDefined): New public property.
23575         (LabeledStatement.AddUsageVector): New public method to tell flow
23576         analyis that the label may be reached via a forward jump.
23577         (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
23578         flow analysis.
23579         (VariableInfo.Number): New public field.  This is used by flow analysis
23580         to number all locals of a block.
23581         (Block.CountVariables): New public property.  This is the number of
23582         local variables in this block (including the locals from all parent
23583         blocks).
23584         (Block.EmitMeta): Number all the variables.
23586         * statement.cs: Added flow analysis support to all classes.
23588 2002-07-31  Martin Baulig  <martin@gnome.org>
23590         * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
23591         To get debugging messages, compile mcs with /define:MCS_DEBUG and
23592         then use this argument.
23594         * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
23596         * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
23597         use this to specify /define options.
23599 2002-07-29  Martin Baulig  <martin@gnome.org>
23601         * statement.cs (Fixed): Moved all code that does variable lookups
23602         and resolvings from Emit to Resolve.
23604         * statement.cs (For): Moved all code that does variable lookups
23605         and resolvings from Emit to Resolve.
23607         * statement.cs (Using): Moved all code that does variable lookups
23608         and resolvings from Emit to Resolve.
23610 2002-07-29  Martin Baulig  <martin@gnome.org>
23612         * attribute.cs (Attribute.Resolve): Explicitly catch a
23613         System.NullReferenceException when creating the
23614         CustromAttributeBuilder and report a different warning message.
23616 2002-07-29  Martin Baulig  <martin@gnome.org>
23618         * support.cs (ParameterData.ParameterName): Added method to
23619         get the name of a parameter.
23621         * typemanager.cs (TypeManager.IsValueType): New public method.
23623 2002-07-29  Martin Baulig  <martin@gnome.org>
23625         * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'.  This
23626         is a flag which specifies that it's either ref or out.
23627         (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
23628         the out parameter to `out Parameter.Modifier mod', also set the
23629         Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
23631         * support.cs (InternalParameters.ParameterModifier): Distinguish
23632         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
23633         Parameter.Modifier.ISBYREF flag if it's either ref or out.
23635         * expression.cs (Argument.GetParameterModifier): Distinguish
23636         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
23637         Parameter.Modifier.ISBYREF flag if it's either ref or out.
23639 2002-07-29  Martin Baulig  <martin@gnome.org>
23641         * expression.cs (ParameterReference.ParameterReference): Added
23642         `Location loc' argument to the constructor.
23644         * cs-parser.jay: Pass location to ParameterReference.
23646 2002-07-28  Miguel de Icaza  <miguel@ximian.com>
23648         * statement.cs (Try): Initialize the location.
23650         * cs-parser.jay: pass location to Try.
23652         * expression.cs (Unary.Reduce): Change the prototype to return
23653         whether a constant fold could be performed or not.  The result is
23654         returned in an out parameters.  In the case of Indirection and
23655         AddressOf, we want to perform the full tests.
23657 2002-07-26  Miguel de Icaza  <miguel@ximian.com>
23659         * statement.cs (Statement.Emit): Flag dead code.
23661 2002-07-27  Andrew Birkett  <andy@nobugs.org>
23663         * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
23665 2002-07-27  Martin Baulig  <martin@gnome.org>
23667         * class.cs (MethodData.Define): Put back call to
23668         TypeManager.AddMethod(), accidentally commented this out.
23670         * report.cs (Debug): New public method to print debugging information,
23671         this is `[Conditional ("DEBUG")]'.
23673 2002-07-26  Martin Baulig  <martin@gnome.org>
23675         * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
23676         (switch_statement): Push the current_block to the switch_stack and
23677         pop it again when we're done with the switch.
23678         (switch_section): The new block is a child of the current_block.
23679         Fixes bug #24007, added test-152.cs.
23681 2002-07-27  Martin Baulig  <martin@gnome.org>
23683         * expression.cs (Invocation.EmitArguments): When calling a varargs
23684         function with only its fixed arguments, we need to pass an empty
23685         array.
23687 2002-07-27  Martin Baulig  <martin@gnome.org>
23689         Mono 0.13 has been released.
23691 2002-07-25  Miguel de Icaza  <miguel@ximian.com>
23693         * driver.cs: Rename --resource to --linkres, because that is what
23694         we do currently, we dont support --resource yet.
23696         * cs-tokenizer.cs: Fix test for reporting endif mismatches.
23698 2002-07-25  Martin Baulig  <martin@gnome.org>
23700         * class.cs (MethodData): New public class.  This is a `method builder'
23701         class for a method or one accessor of a Property/Indexer/Event.
23702         (MethodData.GetMethodFlags): Moved here from MemberBase.
23703         (MethodData.ApplyAttributes): Likewise.
23704         (MethodData.ApplyObsoleteAttribute): Likewise.
23705         (MethodData.ApplyConditionalAttribute): Likewise.
23706         (MethodData.ApplyDllImportAttribute): Likewise.
23707         (MethodData.CheckAbstractAndExternal): Likewise.
23708         (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
23709         (MethodData.Emit): Formerly known as Method.Emit().
23710         (MemberBase): Moved everything which was specific to a single
23711         accessor/method to MethodData.
23712         (Method): Create a new MethodData and call Define() and Emit() on it.
23713         (Property, Indexer, Event): Create a new MethodData objects for each
23714         accessor and call Define() and Emit() on them.
23716 2002-07-25  Martin Baulig  <martin@gnome.org>
23718         Made MethodCore derive from MemberBase to reuse the code from there.
23719         MemberBase now also checks for attributes.
23721         * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
23722         (MemberBase.GetMethodFlags): Moved here from class Method and marked
23723         as virtual.
23724         (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
23725         `CallingConventions cc' and `Attributes opt_attrs' arguments.
23726         (MemberBase.ApplyAttributes): New virtual method; applies the
23727         attributes to a method or accessor.
23728         (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
23729         (MemberBase.ApplyConditionalAttribute): Likewise.
23730         (MemberBase.ApplyDllImportAttribute): Likewise.
23731         (MemberBase.CheckAbstractAndExternal): Likewise.
23732         (MethodCore.ParameterTypes): This is now a property instead of a
23733         method, it's initialized from DoDefineParameters().
23734         (MethodCore.ParameterInfo): Removed the set accessor.
23735         (MethodCore.DoDefineParameters): New protected virtual method to
23736         initialize ParameterTypes and ParameterInfo.
23737         (Method.GetReturnType): We can now simply return the MemberType.
23738         (Method.GetMethodFlags): Override the MemberBase version and add
23739         the conditional flags.
23740         (Method.CheckBase): Moved some code from Define() here, call
23741         DoDefineParameters() here.
23742         (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
23743         here to avoid some larger code duplication.
23744         (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
23745         ensure that abstract and external accessors don't declare a body.
23747         * attribute.cs (Attribute.GetValidPieces): Make this actually work:
23748         `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
23749         lookup in the attribute's parent classes, so we need to abort as soon
23750         as we found the first match.
23751         (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
23752         the attribute has no arguments.
23754         * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
23755         of a Method.
23757 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
23759         * cs-parser.jay: reverted previous patch.
23761 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
23763         * cs-parser.jay: fixed bug #22119.
23765 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
23767         * attribute.cs: fixed compilation. The error was:
23768         "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must 
23769         be assigned to before control leaves the current method."
23770         [FIXME:  Filed as bug #28186: MCS must report this error.]
23772 2002-07-25  Martin Baulig  <martin@gnome.org>
23774         * attribute.cs (Attribute.Conditional_GetConditionName): New static
23775         method to pull the condition name ouf of a Conditional attribute.
23776         (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
23777         the obsolete message and error flag out of an Obsolete attribute.
23779         * class.cs (Method.GetMethodFlags): New public method to get the
23780         TypeManager.MethodFlags for this method.
23781         (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
23782         private methods.
23783         (Method.Define): Get and apply the Obsolete and Conditional attributes;
23784         if we're overriding a virtual function, set the new private variable
23785         `parent_method'; call the new TypeManager.AddMethod().
23787         * typemanager.cs (TypeManager.AddMethod): New static method.  Stores
23788         the MethodBuilder and the Method in a PtrHashtable.
23789         (TypeManager.builder_to_method): Added for this purpose.
23790         (TypeManager.MethodFlags): Added IsObsoleteError.
23791         (TypeManager.GetMethodFlags): Added `Location loc' argument.  Lookup
23792         Obsolete and Conditional arguments in MethodBuilders.  If we discover
23793         an Obsolete attribute, emit an appropriate warning 618 / error 619 with
23794         the message from the attribute.
23796 2002-07-24  Martin Baulig  <martin@gnome.org>
23798         * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
23799         preprocessor directives, ensure that the argument to #define/#undef is
23800         exactly one identifier and that it's actually an identifier.
23802         Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
23803         did not work ....
23805 2002-07-24  Martin Baulig  <martin@gnome.org>
23807         * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
23808         initialize it to TypeManager.object_type in the constructor.
23809         (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
23810         of the `hm.get_current' method if we're using the collection pattern.
23811         (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
23812         for the explicit conversion to make it work when we're using the collection
23813         pattern and the `Current' property has a different return type than `object'.
23814         Fixes #27713.
23816 2002-07-24  Martin Baulig  <martin@gnome.org>
23818         * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
23819         does not match, but don't report any errors.  This method is called in
23820         order for all methods in a MethodGroupExpr until a matching method is
23821         found, so we don't want to bail out if the first method doesn't match.
23822         (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
23823         matches, report the 123.  Fixes #28070.
23825 2002-07-24  Martin Baulig  <martin@gnome.org>
23827         * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
23828         TypeManager.TypeToCoreType() to the top of the method so the
23829         following equality checks will work.  Fixes #28107.
23831 2002-07-24  Martin Baulig  <martin@gnome.org>
23833         * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
23834         operand is of type uint, and the other operand is of type sbyte,
23835         short or int, the operands are converted to type long." -
23836         Actually do what this comment already told us.  Fixes bug #28106,
23837         added test-150.cs.
23839 2002-07-24  Martin Baulig  <martin@gnome.org>
23841         * class.cs (MethodBase): New abstract class.  This is now a base
23842         class for Property, Indexer and Event to avoid some code duplication
23843         in their Define() and DefineMethods() methods.
23844         (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
23845         generic methods for Define() and DefineMethods().
23846         (FieldBase): Derive from MemberBase, not MemberCore.
23847         (Property): Derive from MemberBase, not MemberCore.
23848         (Property.DefineMethod): Moved all the code from this method to the
23849         new MethodBase.DefineAccessor(), just call it with appropriate
23850         argumetnts.
23851         (Property.Define): Call the new Property.DoDefine(), this does some
23852         sanity checks and we don't need to duplicate the code everywhere.
23853         (Event): Derive from MemberBase, not MemberCore.
23854         (Event.Define): Use the new MethodBase.DefineAccessor() to define the
23855         accessors, this will also make them work with interface events.
23856         (Indexer): Derive from MemberBase, not MemberCore.
23857         (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
23858         (Indexer.Define): Use the new MethodBase functions.
23860         * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
23861         argument to the constructor.
23862         (Interface.FindMembers): Added support for interface events.
23863         (Interface.PopluateEvent): Implemented.
23865         Added test-149.cs for this.  This also fixes bugs #26067 and #24256.
23867 2002-07-22  Miguel de Icaza  <miguel@ximian.com>
23869         * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
23870         but this is required to check for a method name being the same as
23871         the containing class.  
23873         Handle this now.
23875 2002-07-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
23877         * interface.cs: initialize variable.
23879 2002-07-23  Martin Baulig  <martin@gnome.org>
23881         Implemented the IndexerName attribute in interfaces.
23883         * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
23884         name if this is an explicit interface implementation.
23885         (Indexer.InterfaceIndexerName): New public variable.  If we're
23886         implementing an interface indexer, this is the IndexerName in that
23887         interface.  Otherwise, it's the IndexerName.
23888         (Indexer.DefineMethod): If we're implementing interface indexer,
23889         set InterfaceIndexerName.  Use the new Pending.IsInterfaceIndexer
23890         and Pending.ImplementIndexer methods.
23891         (Indexer.Define): Also define the PropertyBuilder if we're
23892         implementing an interface indexer and this is neither an explicit
23893         interface implementation nor do the IndexerName match the one in
23894         the interface.
23896         * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
23897         If a method is defined here, then we always need to create a proxy
23898         for it.  This is used when implementing interface indexers.
23899         (Pending.IsInterfaceIndexer): New public method.
23900         (Pending.ImplementIndexer): New public method.
23901         (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
23902         This is used when implementing interface indexers to define a proxy
23903         if necessary.
23904         (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
23905         define a proxy if necessary.
23907         * interface.cs (Interface.IndexerName): New public variable.
23908         (Interface.PopulateIndexer): Set the IndexerName.
23909         (Interface.DefineIndexers): New private method.  Populate all the
23910         indexers and make sure their IndexerNames match.
23912         * typemanager.cs (IndexerPropertyName): Added support for interface
23913         indexers.
23915 2002-07-22  Martin Baulig  <martin@gnome.org>
23917         * codegen.cs (EmitContext.HasReturnLabel): New public variable.
23918         (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
23919         ret if HasReturnLabel.
23920         (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
23921         variables.
23923         * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
23924         and set the ec.LoopBeginTryCatchLevel.
23925         (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
23926         (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
23927         the current ec.TryCatchLevel, the branch goes out of an exception
23928         block.  In this case, we need to use Leave and not Br.
23930 2002-07-22  Martin Baulig  <martin@gnome.org>
23932         * statement.cs (Try.Emit): Emit an explicit ret after the end of the
23933         block unless the block does not always return or it is contained in
23934         another try { ... } catch { ... } block.  Fixes bug #26506.
23935         Added verify-1.cs to the test suite.
23937 2002-07-22  Martin Baulig  <martin@gnome.org>
23939         * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
23940         then we do not always return.  Fixes bug #24985.
23942 2002-07-22  Martin Baulig  <martin@gnome.org>
23944         * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
23945         lookup on a per-class level; ie. walk up the class hierarchy until we
23946         found at least one applicable method, then choose the best among them.
23947         Fixes bug #24463 and test-29.cs.
23949 2002-07-22  Martin Baulig  <martin@gnome.org>
23951         * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
23952         return types of the methods.  The return type is not part of the
23953         signature and we must not check it to make the `new' modifier work.
23954         Fixes bug #27999, also added test-147.cs.
23955         (TypeManager.TypeToCoreType): Added TypeManager.type_type.
23957         * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
23958         on the method's return type.
23960 2002-07-21  Martin Baulig  <martin@gnome.org>
23962         * assign.cs: Make this work if the rightmost source is a constant and
23963         we need to do an implicit type conversion.  Also adding a few more tests
23964         to test-38.cs which should have caught this.
23966         * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
23967         target in the makefile for this.  The makefile.gnu is primarily intended
23968         for end-users who don't want to debug the compiler.
23970 2002-07-21  Martin Baulig  <martin@gnome.org>
23972         * assign.cs: Improved the Assign class so it can now handle embedded
23973         assignments (X = Y = Z = something).  As a side-effect this'll now also
23974         consume less local variables.  test-38.cs now passes with MCS, added
23975         a few new test cases to that test.
23977 2002-07-20  Martin Baulig  <martin@gnome.org>
23979         * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
23980         instructions.  Fixes bug #27977, also added test-146.cs.
23982 2002-07-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
23984         * cs-tokenizer.cs: fixed getHex ().
23986 2002-07-19  Martin Baulig  <martin@gnome.org>
23988         * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
23989         not Type.GetType() to lookup the array type.  This is needed when
23990         we're constructing an array of a user-defined type.
23991         (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
23992         single-dimensional arrays, but also for single-dimensial arrays of
23993         type decimal.
23995 2002-07-19  Martin Baulig  <martin@gnome.org>
23997         * expression.cs (New.DoEmit): Create a new LocalTemporary each time
23998         this function is called, it's not allowed to share LocalBuilders
23999         among ILGenerators.
24001 2002-07-19  Martin Baulig  <martin@gnome.org>
24003         * expression.cs (Argument.Resolve): Report an error 118 when trying
24004         to pass a type as argument.
24006 2002-07-18  Martin Baulig  <martin@gnome.org>
24008         * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
24009         Conv_R_Un for the signed `long' type.
24011 2002-07-15  Miguel de Icaza  <miguel@ximian.com>
24013         * expression.cs (MemberAccess.DoResolve): Do not reuse the field
24014         `expr' for the temporary result, as that will fail if we do
24015         multiple resolves on the same expression.
24017 2002-07-05  Miguel de Icaza  <miguel@ximian.com>
24019         * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
24020         ec.TypeContainer for looking up aliases. 
24022         * class.cs (TypeContainer): Remove LookupAlias from here.
24024         * decl.cs (DeclSpace); Move here.
24026 2002-07-01  Miguel de Icaza  <miguel@ximian.com>
24028         * class.cs (FindMembers): Only call filter if the constructor
24029         bulider is not null.
24031         Also handle delegates in `NestedTypes' now.  Now we will perform
24032         type lookups using the standard resolution process.  This also
24033         fixes a bug.
24035         * decl.cs (DeclSpace.ResolveType): New type resolution routine.
24036         This uses Expressions (the limited kind that can be parsed by the
24037         tree) instead of strings.
24039         * expression.cs (ComposedCast.ToString): Implement, used to flag
24040         errors since now we have to render expressions.
24042         (ArrayCreation): Kill FormElementType.  Use ComposedCasts in
24043         FormArrayType. 
24045         * ecore.cs (SimpleName.ToString): ditto.
24047         * cs-parser.jay: Instead of using strings to assemble types, use
24048         Expressions to assemble the type (using SimpleName, ComposedCast,
24049         MemberAccess).  This should fix the type lookups in declarations,
24050         because we were using a different code path for this.
24052         * statement.cs (Block.Resolve): Continue processing statements
24053         even when there is an error.
24055 2002-07-17  Miguel de Icaza  <miguel@ximian.com>
24057         * class.cs (Event.Define): Also remove the `remove' method from
24058         the list of pending items.
24060         * expression.cs (ParameterReference): Use ldarg.N (0..3) to
24061         generate more compact code. 
24063 2002-07-17  Martin Baulig  <martin@gnome.org>
24065         * const.cs (Const.LookupConstantValue): Add support for constant
24066         `unchecked' and `checked' expressions.
24067         Also adding test case test-140.cs for this.
24069 2002-07-17  Martin Baulig  <martin@gnome.org>
24071         * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
24072         check whether mi.ReturnType implements the IEnumerator interface; the
24073         `==' and the IsAssignableFrom() will fail in this situation.
24075 2002-07-16  Ravi Pratap  <ravi@ximian.com>
24077         * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix 
24078         here too.
24080 2002-07-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24082         * expression.cs: fixed bug #27811.
24084 2002-07-14  Miguel de Icaza  <miguel@ximian.com>
24086         * expression.cs (ParameterReference.AddressOf): Patch from Paolo
24087         Molaro: when we are a ref, the value already contains a pointer
24088         value, do not take the address of it.
24090 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
24091         * removed mb-parser.jay and mb-tokenizer.cs
24093 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
24095         * expression.cs: check against the building corlib void type.
24097 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
24099         * ecore.cs: fix for valuetype static readonly fields: when 
24100         initializing them, we need their address, not the address of a copy.
24102 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
24104         * typemanager.cs: register also enum_type in corlib.
24106 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
24108         * class.cs: allow calling this (but not base) initializers in structs.
24110 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
24112         * ecore.cs: make sure we compare against the building base types
24113         in GetTypeSize ().
24115 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
24117         * typemanager.cs: fix TypeToCoreType() to handle void and object
24118         (corlib gets no more typerefs after this change).
24120 2002-07-12  Miguel de Icaza  <miguel@ximian.com>
24122         * expression.cs (ArrayCreation.EmitArrayArguments): use
24123         Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
24125         (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
24126         Conv_Ovf_I_Un for the array arguments.  Even if C# allows longs as
24127         array indexes, the runtime actually forbids them.
24129         * ecore.cs (ExpressionToArrayArgument): Move the conversion code
24130         for array arguments here.
24132         * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
24133         instead of the default for ValueTypes.
24135         (New.DoEmit): Use IsValueType instead of
24136         IsSubclassOf (value_type)
24137         (New.DoResolve): ditto.
24138         (Invocation.EmitCall): ditto.
24140         * assign.cs (Assign): ditto.
24142         * statement.cs (Unsafe): Ok, so I got the semantics wrong.
24143         Statements *are* currently doing part of their resolution during
24144         Emit.  
24146         Expressions do always resolve during resolve, but statements are
24147         only required to propagate resolution to their children.
24149 2002-07-11  Miguel de Icaza  <miguel@ximian.com>
24151         * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
24153         (LoadAssembly): Do not add the dll if it is already specified
24155         (MainDriver): Add the System directory to the link path at the end,
24156         after all the other -L arguments. 
24158         * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
24159         wrong opcode for loading bytes and bools (ldelem.i1 instead of
24160         ldelem.u1) and using the opposite for sbytes.
24162         This fixes Digger, and we can finally run it.
24164         * driver.cs (UnixParseOption): Move the option parsing here.  
24165         (CSCParseOption): Implement CSC-like parsing of options.
24167         We now support both modes of operation, the old Unix way, and the
24168         new CSC-like way.  This should help those who wanted to make cross
24169         platform makefiles.
24171         The only thing broken is that /r:, /reference: and /lib: are not
24172         implemented, because I want to make those have the same semantics
24173         as the CSC compiler has, and kill once and for all the confussion
24174         around this.   Will be doing this tomorrow.
24176         * statement.cs (Unsafe.Resolve): The state is checked during
24177         resolve, not emit, so we have to set the flags for IsUnsfe here.
24179 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
24181         * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
24182         not catch the Error_ObjectRefRequired in SimpleName (as it is
24183         possible to have a class/instance variable name that later gets
24184         deambiguated), we have to check this here.      
24186 2002-07-10  Ravi Pratap  <ravi@ximian.com>
24188         * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
24189         make static and put into Expression.
24191         (Event.Define): Register the private field of the event with the 
24192         TypeManager so that GetFieldFromEvent can get at it.
24194         (TypeManager.RegisterPrivateFieldOfEvent): Implement to
24195         keep track of the private field associated with an event which
24196         has no accessors.
24198         (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
24199         private field.
24201         * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
24203 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
24205         * expression.cs (Binary.EmitBranchable): this routine emits the
24206         Binary expression in a branchable context.  This basically means:
24207         we need to branch somewhere, not just get the value on the stack.
24209         This works together with Statement.EmitBoolExpression.
24211         * statement.cs (Statement.EmitBoolExpression): Use
24212         EmitBranchable. 
24214 2002-07-09  Miguel de Icaza  <miguel@ximian.com>
24216         * statement.cs (For): Reduce the number of jumps in loops.
24218         (For): Implement loop inversion for the For statement.
24220         (Break): We can be breaking out of a Try/Catch controlled section
24221         (foreach might have an implicit try/catch clause), so we need to
24222         use Leave instead of Br.
24224         * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
24225         now).  If the instace expression supports IMemoryLocation, we use
24226         the AddressOf method from the IMemoryLocation to extract the
24227         address instead of emitting the instance.
24229         This showed up with `This', as we were emitting the instance
24230         always (Emit) instead of the Address of This.  Particularly
24231         interesting when This is a value type, as we dont want the Emit
24232         effect (which was to load the object).
24234 2002-07-08  Miguel de Icaza  <miguel@ximian.com>
24236         * attribute.cs: Pass the entry point to the DefinePInvokeMethod
24238         * statement.cs (Checked): Set the CheckedState during the resolve
24239         process too, as the ConvCast operations track the checked state on
24240         the resolve process, and not emit.
24242         * cs-parser.jay (namespace_member_declaration): Flag that we have
24243         found a declaration when we do.  This is used to flag error 1529
24245         * driver.cs: Report ok when we display the help only.
24247 2002-07-06  Andrew Birkett  <adb@tardis.ed.ac.uk>
24249         * cs-tokenizer.cs (xtoken): Improve handling of string literals.
24251 2002-07-04  Miguel de Icaza  <miguel@ximian.com>
24253         * cs-tokenizer.cs (define): We also have to track locally the
24254         defines.  AllDefines is just used for the Conditional Attribute,
24255         but we also need the local defines for the current source code. 
24257 2002-07-03  Miguel de Icaza  <miguel@ximian.com>
24259         * statement.cs (While, For, Do): These loops can exit through a
24260         Break statement, use this information to tell whether the
24261         statement is the last piece of code.
24263         (Break): Flag that we break.
24265         * codegen.cs (EmitContexts): New `Breaks' state variable.
24267 2002-07-03  Martin Baulig  <martin@gnome.org>
24269         * class.cs (TypeContainer.MethodModifiersValid): Allow override
24270         modifiers in method declarations in structs.  Otherwise, you won't
24271         be able to override things like Object.Equals().
24273 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
24275         * class.cs (Method, Property, Indexer): Do not allow the public
24276         modifier to be used in explicit interface implementations.
24278         (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
24279         override modifiers in method declarations in structs
24281 2002-07-02   Andrew Birkett <adb@tardis.ed.ac.uk>
24283         * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
24284         integer or real overflow, report an error
24286 2002-07-02  Martin Baulig  <martin@gnome.org>
24288         * typemanager.cs (TypeManager.InitCoreTypes): When compiling
24289         corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
24290         to tell the runtime about our newly created System.Object and
24291         System.ValueType types.
24293 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
24295         * expression.cs (This): Use Stobj/Ldobj when we are a member of a
24296         struct instead of Ldarg/Starg.
24298 2002-07-02  Martin Baulig  <martin@gnome.org>
24300         * expression.cs (Indirection.Indirection): Call
24301         TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
24303 2002-07-02  Martin Baulig  <martin@gnome.org>
24305         * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
24306         ValueType, call TypeManager.TypeToCoreType() on it.
24307         (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
24308         the OpCodes.Newarr argument.
24310 2002-07-02  Martin Baulig  <martin@gnome.org>
24312         * expression.cs (Invocation.EmitCall): When compiling corlib,
24313         replace all calls to the system's System.Array type to calls to
24314         the newly created one.
24316         * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
24317         System.Array methods.
24318         (TypeManager.InitCoreTypes): When compiling corlib, get the methods
24319         from the system's System.Array type which must be replaced.
24321 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
24323         * typemanager.cs: load unverifiable_code_ctor so we can build
24324         corlib using the correct type. Avoid using GetTypeCode() with
24325         TypeBuilders.
24326         * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
24327         TypeManager.object_type to allow building corlib.
24329 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
24331         * ecore.cs: handle System.Enum separately in LoadFromPtr().
24333 2002-07-01  Martin Baulig  <martin@gnome.org>
24335         * class.cs: Make the last change actually work, we need to check
24336         whether `ifaces != null' to avoid a crash.
24338 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
24340         * class.cs: when we build structs without fields that implement
24341         interfaces, we need to add the interfaces separately, since there is
24342         no API to both set the size and add the interfaces at type creation
24343         time.
24345 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
24347         * expression.cs: the dimension arguments to the array constructors
24348         need to be converted if they are a long.
24350 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
24352         * class.cs: don't emit ldarg.0 if there is no parent constructor
24353         (fixes showstopper for corlib).
24355 2002-06-29  Martin Baulig  <martin@gnome.org>
24357         MCS now compiles corlib on GNU/Linux :-)
24359         * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
24360         ie. check for MethodImplOptions.InternalCall.
24362         * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
24363         and TypeManager.attribute_type are null, so we must explicitly check
24364         whether parent is not null to find out whether it's an attribute type.
24365         (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
24366         and SetBuilder, not only if the property is neither abstract nor external.
24367         This is necessary to set the MethodImplOptions on the accessor methods.
24368         (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
24369         SetBuilder, see Property.Emit().
24371         * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
24372         populate "System.Object", "System.ValueType" and "System.Attribute" since
24373         they've already been populated from BootCorlib_PopulateCoreTypes().
24375 2002-06-29  Martin Baulig  <martin@gnome.org>
24377         * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
24378         is the NullLiteral, we also need to make sure that target_type is not
24379         an enum type.   
24381 2002-06-29  Martin Baulig  <martin@gnome.org>
24383         * rootcontext.cs (RootContext.ResolveCore): We must initialize
24384         `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
24385         before calling BootstrapCorlib_ResolveDelegate ().
24387 2002-06-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24389         * statement.cs: fixed build-breaker. All tests passed ok.
24391 2002-06-27  Martin Baulig  <martin@gnome.org>
24393         * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
24394         for System.Decimal when compiling corlib.
24396 2002-06-27  Martin Baulig  <martin@gnome.org>
24398         * statement.cs (Switch.TableSwitchEmit): Make this work with empty
24399         switch blocks which contain nothing but a default clause.
24401 2002-06-26  Andrew  <adb@tardis.ed.ac.uk>
24403        * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
24405 2002-06-27  Martin Baulig  <martin@gnome.org>
24407         * ecore.cs (PropertyExpr.PropertyExpr): Call
24408         TypeManager.TypeToCoreType() on the `pi.PropertyType'.
24410         * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
24411         is already a TypeBuilder.
24413 2002-06-27  Martin Baulig  <martin@gnome.org>
24415         * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
24416         `target_type == TypeManager.array_type', not IsAssignableFrom() in
24417         the "from an array-type to System.Array" case.  This makes it work
24418         when compiling corlib.
24420 2002-06-27  Martin Baulig  <martin@gnome.org>
24422         * ecore.cs (Expression.SimpleNameResolve): If the expression is a
24423         non-static PropertyExpr, set its InstanceExpression.  This makes
24424         the `ICollection.Count' property work in System/Array.cs.
24426 2002-06-25  Andrew Birkett  <adb@tardis.ed.ac.uk>
24428         * driver.cs: Made error handling more consistent.  Errors now
24429         tracked by Report class, so many methods which used to return int
24430         now return void.  Main() now prints success/failure and 
24431         errors/warnings message.
24433         Renamed '--probe' compiler argument to '--expect-error'.  Removed
24434         the magic number return values (123 and 124).  Now, if the
24435         expected error occurs, the compiler exits with success (exit value
24436         0).  If the compilation completes without seeing that particular
24437         error, the compiler exits with failure (exit value 1).  The
24438         makefile in mcs/errors has been changed to handle the new behaviour.
24440         * report.cs: Made 'expected error' number a property and renamed
24441         it from 'Probe' to 'ExpectedError'.
24443         * genericparser.cs: Removed error handling support, since it is
24444         now all done by Report class.
24446         * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
24447         class, so parse() no longer returns an int.
24449         * namespace.cs: Use Report.Error instead of GenericParser.error
24451 2002-06-22  Miguel de Icaza  <miguel@ximian.com>
24453         * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
24454         TypeContainer.AddOperator): At the front of the list put the
24455         explicit implementations, so they get resolved/defined first. 
24457 2002-06-21  Miguel de Icaza  <miguel@ximian.com>
24459         * class.cs (TypeContainer.VerifyImplements): Verifies that a given
24460         interface type is implemented by this TypeContainer.  Used during
24461         explicit interface implementation.
24463         (Property.Define, Indexer.Define, Method.Define): Validate that
24464         the given interface in the explicit implementation is one of the
24465         base classes for the containing type.
24467         Also if we are explicitly implementing an interface, but there is
24468         no match in the pending implementation table, report an error.
24470         (Property.Define): Only define the property if we are
24471         not explicitly implementing a property from an interface.  Use the
24472         correct name also for those properties (the same CSC uses,
24473         although that is really not needed).
24475         (Property.Emit): Do not emit attributes for explicitly implemented
24476         properties, as there is no TypeBuilder.
24478         (Indexer.Emit): ditto.
24480         Hiding then means that we do not really *implement* a pending
24481         implementation, which makes code fail.
24483 2002-06-22  Martin Baulig  <martin@gnome.org>
24485         * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
24486         the return value of Object.GetType().  [FIXME: we need to do this whenever
24487         we get a type back from the reflection library].
24489 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
24491         * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
24493 2002-06-20  Miguel de Icaza  <miguel@ximian.com>
24495         * attribute.cs: Return null if we can not look up the type.
24497         * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
24498         the interface types found.
24500         * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
24501         interface types found.
24503         * typemanager.cs (GetInterfaces): Make this routine returns alll
24504         the interfaces and work around the lame differences between
24505         System.Type and System.Reflection.Emit.TypeBuilder in the results
24506         result for GetInterfaces.
24508         (ExpandInterfaces): Given an array of interface types, expand and
24509         eliminate repeated ocurrences of an interface.  This expands in
24510         context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
24511         be IA, IB, IC.
24513 2002-06-21  Martin Baulig  <martin@gnome.org>
24515         * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
24516         on System.Enum.
24518 2002-06-21  Martin Baulig  <martin@gnome.org>
24520         * typemanager.cs (TypeManager.TypeToCoreType): New function.  When compiling corlib
24521         and called with one of the core types, return the corresponding typebuilder for
24522         that type.
24524         * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
24525         element type.
24527 2002-06-21  Martin Baulig  <martin@gnome.org>
24529         * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
24530         `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
24531         (Expression.ConvertReferenceExplicit): Likewise.
24533         * expression.cs (ElementAccess.DoResolve): Likewise.
24534         (ElementAccess.DoResolveLValue): Likewise.
24536 2002-06-10  Martin Baulig  <martin@gnome.org>
24538         * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
24539         add the "value" parameter to the parameter list.
24541         * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
24542         to our caller.
24544 2002-06-19  Miguel de Icaza  <miguel@ximian.com>
24546         * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
24547         the argument to an int, uint, long or ulong, per the spec.  Also
24548         catch negative constants in array creation.
24550 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
24552         * class.cs: do not allow the same interface to appear twice in
24553         the definition list.
24555 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
24557         * ecore.cs: don't use ldlen with System.Array.
24559 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
24561         * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
24563 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
24565         * modifiers.cs: produce correct field attributes for protected
24566         internal. Easy fix so miguel can work on ther harder stuff:-)
24568 2002-06-18  Miguel de Icaza  <miguel@ximian.com>
24570         * pending.cs: New file.  Move the code from class.cs here.
24571         Support clearning the pending flag for all methods (when not doing
24572         explicit interface implementation).
24574 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
24576         * rootcontext.cs: added a couple more types needed to bootstrap.
24578 2002-06-17  Miguel de Icaza  <miguel@ximian.com>
24580         * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
24581         constructor in the type, instead of any constructor in the type
24582         hierarchy.  Thanks to Paolo for finding this bug (it showed up as
24583         a bug in the Mono runtime when applying the params attribute). 
24585 2002-06-16  Rafael Teixeira  <rafaelteixeirabr@hotmail.com>
24586         * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
24588 2002-06-14  Rachel Hestilow  <hestilow@ximian.com>
24590         * expression.cs (Unary.ResolveOperator): Use TypeManager
24591         to resolve the type.
24593 2002-06-13  Ravi Pratap  <ravi@ximian.com>
24595         * cs-parser.jay (enum_member_declaration): Pass in the attributes
24596         attached.
24598         * enum.cs (AddEnumMember): Add support to store the attributes associated 
24599         with each member too.
24601         * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
24602         field builders too - this takes care of the enum member case.
24604 2002-06-10  Rachel Hestilow  <hestilow@ximian.com>
24606         * typemanager.cs (TypeManager.VerifyUnManaged): Allow
24607         address-of operator on both value types and pointers.
24609 2002-06-10  Martin Baulig  <martin@gnome.org>
24611         * interface.cs (Interface.PopulateIndexer): Add the indexer's
24612         PropertyBuilder to the `property_builders' list.
24614         * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
24615         (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
24616         `lookup_type' and all its interfaces.  Unfortunately, Type.FindMembers() won't
24617         find any indexers which are inherited from an interface.
24619 2002-06-09  Martin Baulig  <martin@gnome.org>
24621         * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
24622         the same type as the constant if necessary.  There's also a test-130.cs
24623         for this.
24625         * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
24627         * typemanager.cs (TypeManager.ChangeType): Previously known as
24628         Enum.ChangeEnumType().
24630 2002-06-09  Martin Baulig  <martin@gnome.org>
24632         * expression.cs (Cast.TryReduce): Added support for consts.
24634 2002-06-08  Ravi Pratap  <ravi@ximian.com>
24636         * class.cs (Accessor): Hold attributes information so we can pass
24637         it along.
24639         * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
24640         Modify to pass in attributes attached to the methods.
24642         (add_accessor_declaration, remove_accessor_declaration): Ditto.
24644         * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
24645         to handle the Accessor kind :-)
24647         * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
24649 2002-06-08  Martin Baulig  <martin@gnome.org>
24651         * expression.cs (Unary.TryReduceNegative): Added support for
24652         ULongConstants.
24654 2002-06-08  Martin Baulig  <martin@gnome.org>
24656         * enum.cs (Enum.LookupEnumValue): Don't report an error if the
24657         name can't be found in the `defined_names' - the caller will do a
24658         MemberLookup in this case and thus find methods in System.Enum
24659         such as Enum.IsDefined().
24661 2002-06-08  Martin Baulig  <martin@gnome.org>
24663         * enum.cs (Enum.ChangeEnumType): This is a custom version of
24664         Convert.ChangeType() which works with TypeBuilder created types.
24665         (Enum.LookupEnumValue, Enum.Define): Use it here.
24667         * class.cs (TypeContainer.RegisterRequiredImplementations): Added
24668         `TypeBuilder.BaseType != null' check.
24669         (TypeContainer.FindMembers): Only lookup parent members if we
24670         actually have a parent.
24671         (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
24672         (ConstructorInitializer.Resolve): Likewise.
24674         * interface.cs (Interface.FindMembers): Added
24675         `TypeBuilder.BaseType != null' check.
24677         * rootcontext.cs (RootContext.ResolveCore): Added
24678         "System.Runtime.CompilerServices.IndexerNameAttribute" to
24679         classes_second_stage.
24681         * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
24682         debug_type and trace_type when compiling with --nostdlib.       
24684 2002-06-07  Martin Baulig  <martin@gnome.org>
24686         * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
24687         (AddField): Set it to true when adding a non-static field.
24688         (DefineType): Use `have_nonstatic_fields' to find out whether we
24689         have non-static fields, not `Fields != null'.
24691 2002-06-02  Miguel de Icaza  <miguel@ximian.com>
24693         * ecore.cs (SimpleNameResolve): Removed simple bug (we were
24694         dereferencing a null on the static-field code path)
24696 2002-05-30  Martin Baulig  <martin@gnome.org>
24698         * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
24699         to take command line arguments.  Use reflection to call the new
24700         custom `Initialize' function on the symbol writer and pass it the
24701         command line arguments.
24703         * driver.cs (--debug-args): New command line argument to pass command
24704         line arguments to the symbol writer.
24706 2002-05-28  Miguel de Icaza  <miguel@ximian.com>
24708         * assign.cs (DoResolve): Forgot to do the implicit conversion to
24709         the target type for indexers and properties.  Thanks to Joe for
24710         catching this.
24712 2002-05-27  Miguel de Icaza  <miguel@ximian.com>
24714         * typemanager.cs (MethodFlags): returns the method flags
24715         (Obsolete/ShouldIgnore) that control warning emission and whether
24716         the invocation should be made, or ignored. 
24718         * expression.cs (Invocation.Emit): Remove previous hack, we should
24719         not do this on matching a base type, we should do this based on an attribute
24721         Only emit calls to System.Diagnostics.Debug and
24722         System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
24723         on the command line.
24725         * rootcontext.cs: Global settings for tracing and debugging.
24727         * cs-tokenizer.cs (define): New utility function to track
24728         defines.   Set the global settings for TRACE and DEBUG if found.
24730 2002-05-25  Ravi Pratap  <ravi@ximian.com>
24732         * interface.cs (Populate*): Pass in the TypeContainer as well as
24733         the DeclSpace as parameters so that we can create EmitContexts and
24734         then use that to apply attributes etc.
24736         (PopulateMethod, PopulateEvent, PopulateProperty)
24737         (PopulateIndexer): Apply attributes everywhere.
24739         * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
24740         etc.
24742         (ApplyAttributes): Update accordingly.
24744         We now apply interface attributes for all members too.
24746 2002-05-26  Miguel de Icaza  <miguel@ximian.com>
24748         * class.cs (Indexer.Define); Correctly check if we are explicit
24749         implementation (instead of checking the Name for a ".", we
24750         directly look up if the InterfaceType was specified).
24752         Delay the creation of the PropertyBuilder.
24754         Only create the PropertyBuilder if we are not an explicit
24755         interface implementation.   This means that explicit interface
24756         implementation members do not participate in regular function
24757         lookups, and hence fixes another major ambiguity problem in
24758         overload resolution (that was the visible effect).
24760         (DefineMethod): Return whether we are doing an interface
24761         implementation. 
24763         * typemanager.cs: Temporary hack until we get attributes in
24764         interfaces (Ravi is working on that) and we get IndexerName
24765         support in interfaces.
24767         * interface.cs: Register the indexers as properties.
24769         * attribute.cs (Attribute.Resolve): Catch the error, and emit a
24770         warning, I have verified that this is a bug in the .NET runtime
24771         (JavaScript suffers of the same problem).
24773         * typemanager.cs (MemberLookup): When looking up members for
24774         interfaces, the parent of an interface is the implicit
24775         System.Object (so we succeed in searches of Object methods in an
24776         interface method invocation.  Example:  IEnumerable x;  x.ToString
24777         ()) 
24779 2002-05-25  Miguel de Icaza  <miguel@ximian.com>
24781         * class.cs (Event): Events should also register if they do
24782         implement the methods that an interface requires.
24784         * typemanager.cs (MemberLookup); use the new GetInterfaces
24785         method. 
24787         (GetInterfaces): The code used to lookup interfaces for a type is
24788         used in more than one place, factor it here. 
24790         * driver.cs: Track the errors at the bottom of the file, we kept
24791         on going.
24793         * delegate.cs (NewDelegate.Emit): We have to emit a null as the
24794         instance if the method we are calling is static!
24796 2002-05-24  Miguel de Icaza  <miguel@ximian.com>
24798         * attribute.cs (ApplyAttributes): Make this function filter out
24799         the IndexerName attribute (as that attribute in reality is never
24800         applied) and return the string constant for the IndexerName
24801         attribute. 
24803         * class.cs (TypeContainer.Emit): Validate that all the indexers
24804         have the same IndexerName attribute, and if so, set the
24805         DefaultName attribute on the class. 
24807         * typemanager.cs: The return value might contain other stuff (not
24808         only methods).  For instance, consider a method with an "Item"
24809         property and an Item method.
24811         * class.cs: If there is a problem with the parameter types,
24812         return. 
24814 2002-05-24  Ravi Pratap  <ravi@ximian.com>
24816         * ecore.cs (ImplicitConversionExists): Wrapper function which also
24817         looks at user defined conversion after making a call to 
24818         StandardConversionExists - we need this for overload resolution.
24820         * expression.cs : Update accordingly the various method calls.
24822         This fixes 2 bugs filed against implicit user defined conversions 
24824 2002-05-22  Miguel de Icaza  <miguel@ximian.com>
24826         * statement.cs: Track the result of the assignment.
24828 2002-05-21  Miguel de Icaza  <miguel@ximian.com>
24830         * expression.cs (MemberAccess): Improved error reporting for
24831         inaccessible members.
24833 2002-05-22  Martin Baulig  <martin@gnome.org>
24835         * makefile (mcs-mono2.exe): New target.  This is mcs compiled with
24836         itself with debugging support.
24838 2002-05-22  Martin Baulig  <martin@gnome.org>
24840         * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
24841         Removed, this isn't needed anymore.
24843 2002-05-20  Martin Baulig  <martin@gnome.org>
24845         * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
24846         be underlying type for an enum.
24848 2002-05-20  Miguel de Icaza  <miguel@ximian.com>
24850         * typemanager.cs (InitEnumUnderlyingTypes): New helper function
24851         that splits out the loading of just the core types.
24853         * rootcontext.cs (ResolveCore): Split the struct resolution in
24854         two, so we can load the enumeration underlying types before any
24855         enums are used.
24857         * expression.cs (Is): Bandaid until we fix properly Switch (see
24858         bug #24985 for details).
24860         * typemanager.cs (ImplementsInterface): The hashtable will contain
24861         a null if there are no interfaces implemented.
24863 2002-05-18  Miguel de Icaza  <miguel@ximian.com>
24865         * cs-parser.jay (indexer_declarator): It is fine to have array
24866         parameters
24868 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
24870         * typemanager.cs: (RegisterBuilder): New function used to register
24871         TypeBuilders that implement interfaces.  Since
24872         TypeBuilder.GetInterfaces (as usual) does not work with lame
24873         Reflection.Emit. 
24874         (AddUserType): register interfaces.
24876         (ImplementsInterface): Use the builder_to_ifaces hash if we are
24877         dealing with TypeBuilder.  Also, arrays are showing up as
24878         SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
24879         methods can not be invoked on them!
24881         * ecore.cs (ExplicitReferenceConversionExists): Made public.
24882         (ImplicitReferenceConversionExists): Split out from
24883         StandardConversionExists. 
24885         * expression.cs (As): We were only implementing one of the three
24886         cases for the as operator.  We now implement them all.
24887         (Is): Implement the various other cases for Is as well.
24889         * typemanager.cs (CACHE): New define used to control if we want or
24890         not the FindMembers cache.  Seems to have a negative impact on
24891         performance currently
24893         (MemberLookup): Nested types have full acess to
24894         enclosing type members
24896         Remove code that coped with instance/static returns for events, we
24897         now catch this in RealFindMembers.
24899         (RealFindMembers): only perform static lookup if the instance
24900         lookup did not return a type or an event.  
24902 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
24904         * assign.cs (CompoundAssign): We pass more semantic information
24905         now to Compound Assignments than we did before: now we have all
24906         the information at hand, and now we resolve the target *before* we
24907         do the expression expansion, which allows the "CacheValue" method
24908         to have the effect we intended (before, a [x] += 1 would generate
24909         two differen ArrayAccess expressions from the ElementAccess,
24910         during the resolution process).
24912         (CompoundAssign.DoResolve): Resolve target and original_source here.
24914 2002-05-16  Miguel de Icaza  <miguel@ximian.com>
24916         * expression.cs (ArrayAccess): dropped debugging information. 
24918         * typemanager.cs: Small bug fix: I was always returning i_members,
24919         instead of one of i_members or s_members (depending on which had
24920         the content).
24922         * assign.cs (IAssignMethod.CacheTemporaries): New method.  This
24923         method is invoked before any code generation takes place, and it
24924         is a mechanism to inform that the expression will be invoked more
24925         than once, and that the method should use temporary values to
24926         avoid having side effects
24928         (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
24930         * ecore.cs (Expression.CacheTemporaries): Provide empty default
24931         implementation.
24933         * expression.cs (Indirection, ArrayAccess): Add support for
24934         CacheTemporaries in these two bad boys. 
24936         * ecore.cs (LoadFromPtr): figure out on our own if we need to use
24937         ldobj or ldind_ref.  
24938         (StoreFromPtr): Handle stobj as well.
24940         * expression.cs (UnaryMutator): Share more code.
24942         * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
24943         down: I was not tracking the Filter function as well, which
24944         was affecting the results of the cache.
24946 2002-05-15  Miguel de Icaza  <miguel@ximian.com>
24948         * attribute.cs: Remove the hack to handle the CharSet property on
24949         StructLayouts. 
24951 2002-05-14  Miguel de Icaza  <miguel@ximian.com>
24953         * attribute.cs (DoResolve): More uglyness, we now only try to
24954         resolve the attribute partially, to extract the CharSet
24955         information (only if we are a StructLayout attribute).  Otherwise 
24957         (GetExtraTypeInfo): Add some code to conditionally kill in the
24958         future this.   I am more and more convinced that the .NET
24959         framework has special code to handle the attribute setting on
24960         certain elements.
24962         * expression.cs (IsParamsMethodApplicable): Revert my previous
24963         foreach change here, it was wrong.
24965 2002-05-13  Miguel de Icaza  <miguel@ximian.com>
24967         * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
24968         (pp_expr): do not abort on unknown input, just return.
24969         (eval): abort if there are pending chars.
24971         * attribute.cs (Attribute.Resolve): Positional parameters are
24972         optional.  Deal with that case.
24974         * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
24975         the Ansi/Unicode/Auto information for the type.
24977         (TypeContainer.DefineType): instantiate the EmitContext here, as
24978         we will be using it during the type definition (to resolve
24979         attributes) and during the emit phase.
24981         * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
24982         to pull type information out of the attributes
24984         (Attribute.Resolve): track the constructor builder, and allow for
24985         multiple invocations (structs and classes will use this).
24987         * ecore.cs (MemberLookupFinal): new version with all the
24988         parameters customizable.
24990         * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
24991         constructors.  Return if the result value is null (as the error
24992         would have been flagged already by MemberLookupFinal)
24994         Do not allow instances of abstract classes or interfaces to be
24995         created.
24997         * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
24998         We have to compare the assembly property here when dealing with
24999         FamANDAssem and Assembly access modifiers, because we might be
25000         creating an assembly from *modules* (that means that we are not
25001         getting TypeBuilders for types defined in other modules that are
25002         part of this assembly).
25004         (Method.Emit): If the method is marked abstract and has a body,
25005         emit an error. 
25007         (TypeContainer.DefineMembers): If both the defined member and the
25008         parent name match are methods, then do not emit any warnings: let
25009         the Method.Define routine take care of flagging warnings.  But if
25010         there is a mismatch (method overrides something else, or method is
25011         overriwritten by something, then emit warning).
25013         (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
25014         set to null, this means `do not check for the return type on the
25015         signature'. 
25017         (Method.Define): set the return type for the method signature to
25018         null, so that we get methods with the same name and parameters and
25019         different return types.  This is used to flag warning 114 (you are
25020         hiding a method, and you probably want to use the new/override
25021         keywords instead).
25023         * typemanager.cs (MemberLookup): Implemented proper access
25024         control, closing a long standing set of bug reports.  The problem
25025         was that the Framework only has two bits: Public and NonPublic,
25026         and NonPublic includes private and protected methods, but we need
25027         to enforce the FamANDAssem, FamOrAssem and Family. 
25029 2002-05-11  Miguel de Icaza  <miguel@ximian.com>
25031         * statement.cs (GotoCase): Return true: Ammounts to giving up
25032         knowledge on whether we return or not, and letting the other case
25033         be responsible for it.
25035 2002-05-10  Miguel de Icaza  <miguel@ximian.com>
25037         * driver.cs: Do not load directories for each file processed, only
25038         do it if there is a pattern.
25040         * ecore.cs: Report readonly assigns here as well, as we might have
25041         been resolved only by MemberAccess.
25043         (SimpleName.SimpleNameResolve): Also be useful for LValue
25044         resolution.   We need this to propagate assign to local readonly variables
25046         * typemanager.cs: Use a ptrhashtable for the criteria, because we
25047         do not want to reuse potential criteria memory.
25049         * class.cs (MyEventBuilder): Set reflected_type;
25051         * ecore.cs (Constantify): Added support for constifying bools.
25053         (RootContext.LookupType): Added a cache for values looked up in
25054         the declaration space.
25056         * typemanager.cs (FindMembers): Now is a front-end to
25057         RealFindMembers, and provides a two-level hashtable-based cache to
25058         the request.  
25060         15% performance improvement: from 22.5 to 19.2 seconds.
25062         * expression.cs (IsParamsMethodApplicable): use foreach.
25063         (Invocation.DoResolve): ditto.
25064         (New.DoResolve): ditto.
25065         (ArrayCreation.DoResolve): ditto.
25067         * ecore.cs (FindMostEncompassingType): use foreach.
25069         * delegate.cs (NewDelegate.DoResolve): Use foreach
25071         * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
25072         (RemoveMethods): use foreach.
25074         * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
25075         nested foreach statements instead of for, and also break out of
25076         the inner loop once a match is found.
25078         (Invocation.OverloadResolve): Use foreach, simplify the code. 
25080 2002-05-08  Miguel de Icaza  <miguel@ximian.com>
25082         * cfold.cs (BinaryFold): During an enumeration evaluation context,
25083         we actually unwrap the expression to allow for extra information
25084         to be extracted. 
25086         * expression.cs: Use Shr_Un on unsigned operations. 
25088 2002-05-08  Ravi Pratap  <ravi@ximian.com>
25090         * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of 
25091         applicable operators was not being considered correctly. This closes
25092         the bug Miguel reported.
25094 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
25096         * attribute.cs: check that the type derives from System.Attribute
25097         and report the correct error in that case (moved the duplicate code to
25098         its own method, too).
25100 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
25102         * attribute.cs: lookup attribute type name as the spec says: first the
25103         bare attribute name and then name + "Attribute" (nant compiles with
25104         mcs after this fix).
25106 2002-05-07  Miguel de Icaza  <miguel@ximian.com>
25108         * expression.cs (Unary.TryReduceNegative): Ah!  Tricky!  Tricky!
25109         Because of the way we parse things, we should try to see if a
25110         UIntConstant can fit in an integer.
25112 2002-05-07  Ravi Pratap  <ravi@ximian.com>
25114         * ecore.cs (GetConversionOperators): Do not pick up op_True operators
25115         when we are in an explicit context.
25117         (ConvertReferenceExplicit): When converting from Iface type S to Class
25118         T make sure the rules are implemented as an OR.
25120         * parameter.cs (ParameterType): Make it a property for now although the
25121         purpose really isn't anything immediate.
25123         * expression.cs (Is*Applicable): Do better checking on the parameter type
25124         of a ref/out parameter. The ones from the system assemblies are already 
25125         marked with the correct type so we don't need to do any correction.
25127         * ecore.cs (StandardConversionExists): Conversion from Interface types to 
25128         the object type is standard too so include that.
25130 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
25132         * ecore.cs (StandardConversionExists): Augment with missing code:
25133         deal with IntConstant, LongConstants and Enumerations.
25135         * assign.cs: Report the error, instead of failing silently
25137         * rootcontext.cs (AddGlobalAttributes): Track attributes on the
25138         typecontainer that they are declared, because the
25139         typecontainer/namespace will have the list of using clauses that
25140         need to be applied.
25142         Assembly Attributes were escaping the normal registration
25143         mechanism. 
25145         (EmitCode): Apply attributes within an EmitContext that represents
25146         the container they were declared on.
25148         * cs-parser.jay: Track bases for structs.  How did I get this wrong?
25150 2002-05-06  Ravi Pratap  <ravi@ximian.com>
25152         * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
25153         Revamp completely - make much cleaner as we now operate only
25154         on a set of Types.
25156         (FindMostSpecificSource, FindMostSpecificTarget): New methods
25157         to implement the logic detailed in the spec more correctly.
25159         (UserDefinedConversion): Update accordingly.
25161 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
25163         * statement.cs: Return flow analysis information up.
25165         * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
25166         and the default.
25168         (token): Do not consume an extra character before calling
25169         decimal_digits.
25171 2002-05-06  Piers Haken <piersh@friskit.com>
25173         * cs-parser.jay: add 'override' attribute to System.Object.Finalize
25175 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
25177         * class.cs (Constructor.Emit): Set the IsStatic flag in the
25178         EmitContext during the instance constructor initializer
25179         resolution, to stop access to instance variables.
25181         This is mandated by the spec, last paragraph of the `constructor
25182         initializers' section. 
25184 2002-05-05  Miguel de Icaza  <miguel@ximian.com>
25186         * cs-parser.jay, class.cs (Accessor): new class used to represent
25187         an accessor (get or set).  In the past we used `null' to represent
25188         a missing accessor.  But this is ambiguous because there was no
25189         way to tell in abstract indexers/properties if one of them was
25190         specified.
25192         Now there is a way of addressing that.
25194         * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
25195         instead of FindMembers.
25197         * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
25198         the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
25200         * attribute.cs: Treat indexers and properties as the same in terms
25201         of applying attributes
25203         * ecore.cs (FindMostEncompassedType): Use statically initialized
25204         EmptyExpressions()s like we do elsewhere to avoid creating useless
25205         objects (and we take this out of the tight loop).
25207         (GetConversionOperators): Move the code to extract the actual
25208         operators to a separate routine to clean things up.
25210 2002-05-04  Miguel de Icaza  <miguel@ximian.com>
25212         * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
25213         events are always registered FieldBuilders.
25215         * class.cs (FieldBase): New class shared by Fields 
25217         * delegate.cs: If we are a toplevel delegate, use our full name.
25218         If we are a nested delegate, then only use our tail name.
25220 2002-05-02  Ravi Pratap  <ravi@ximian.com>
25222         * expression.cs (IsApplicable): Ensure that we add the "&" to
25223         ref/out types before comparing it with the type of the argument.
25225         (IsParamsMethodApplicable): Ditto.
25227         (Argument.Type): Use TypeManager.LookupType instead of Type.GetType - 
25228         silly me ;-)
25230         * delegate.cs : Handle the case when we have more than one applicable
25231         method. Flag an error only when we finish checking all.
25233 2002-05-02  Miguel de Icaza  <miguel@ximian.com>
25235         * expression.cs: Add support for boolean static initializers.
25237 2002-05-01  Miguel de Icaza  <miguel@ximian.com>
25239         * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
25241         * parameter.cs (ComputeParameterTypes,
25242         ComputeAndDefineParameterTypes): Better error handling: now we
25243         clear the `types' cache if we fail during any of the type lookups.
25244         We also return the status code correctly to our caller
25246         * delegate.cs: If we fail to define a delegate, abort the extra
25247         steps. 
25249         * expression.cs (Binary.ResolveOperator): for
25250         operator==(object,object) and operator !=(object, object) we also
25251         have to verify that there is an implicit conversion from one to
25252         the other.
25254         (ArrayAccess.DoResolve): Array Access can operate on
25255         non-variables. 
25257 2002-04-30  Miguel de Icaza  <miguel@ximian.com>
25259         * assign.cs (CompoundAssign): A new class used as a "flag" that
25260         the assignment actually is happening as part of a compound
25261         assignment operator.
25263         During compound assignment, a few new rules exist to enable things
25264         like:
25266         byte b |= 1 + 2
25268         From the spec:
25270         x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
25271         to the type of x) if y is implicitly convertible to the type of x,
25272         and the operator is a builtin operator and the return type of the
25273         operator is explicitly convertible to the type of x. 
25275         * rootcontext.cs: Reset warning level to 2.  4 catches various
25276         "interesting" features in mcs, we must clean this up at some
25277         point, but currently am trying to kill other bugs ;-)
25279         * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
25280         in container classes as well.  
25282         * expression.cs (Binary.ResolveOperator): Handle string case
25283         before anything else (as operator overloading does emit an error
25284         before doing anything else).
25286         This code could go away when we move to a table driven model, but
25287         i could not come up with a good plan last night.
25289 2002-04-30  Lawrence Pit <loz@cable.a2000.nl>
25291         * typemanager.cs (CSharpName): reimplementation using regex.
25292         * class.cs: added null check for fields in Emit
25293         * rootcontext.cs: set warninglevel to 4
25295 2002-04-29  Miguel de Icaza  <miguel@ximian.com>
25297         * typemanager.cs (CSharpName): reimplemented with Lupus
25298         suggestion.
25300 2002-04-28  Miguel de Icaza  <miguel@ximian.com>
25302         * statement.cs (If): correclty implement Resolve, because we were
25303         not catching sem errors in there.  The same process is needed
25304         everywhere else. 
25305         (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
25308         (Statement.Warning_DeadCodeFound): Factorize code.
25309         (While): Report dead code here too.
25311         (Statement): Added Resolve virtual method to allow
25312         for resolution split from the emit code.
25314 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
25316         * statement.cs (EmitBoolExpression): No longer try to resolve the
25317         expression here.    
25318         (MakeBoolean): New utility function that resolve, implicitly
25319         converts to boolean and tags the expression. 
25322         (If, Do): Implement dead code elimination.
25323         (While): Implement loop inversion
25325         (Do, While, For, If): Resolve the expression prior to calling our
25326         code generation.
25328 2002-04-22  Lawrence Pit <loz@cable.a2000.nl>
25330         * class.cs:
25331           - added method Report28 (warning: program has more than one entry point)
25332           - added method IsEntryPoint, implements paragraph 10.1 of the spec
25333           - modified method Method.Define, the part at the end of the method
25335         * rootcontext.cs: added static public Location EntryPointLocation;
25336           
25337         * ../errors/cs0028.cs : Add test case for the above warning.              
25339         * typemanager.cs:
25340           - modified method CSharpName to allow arrays of primitive type to
25341             be printed nicely (e.g. instead of System.Int32[][] it now prints
25342             int[][])
25343           - added method CSharpSignature: returns the signature of a method
25344             in string format to be used in reporting errors, warnings, etc.
25346         * support.cs: InternalParameters.ParameterDesc variable tmp initialized
25347         with String.Empty.
25349 2002-04-26  Ravi Pratap  <ravi@ximian.com>
25351         * delegate.cs (Define): Fix extremely silly bug where I was
25352         setting the type of the 'object' parameter of the BeginInvoke
25353         method to System.IAsyncResult instead of System.Object ;-)
25355 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
25357         * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
25358         here. 
25360         (Constructor.Emit): return if we fail to initialize the
25361         constructor.  Another door closed!  
25363         * expression.cs (New.DoResolve): Improve error message (from -6 to
25364         1501).  Use DeclaredOnly lookup to find the exact constructor.
25366         * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
25367         loop.  This is useful.
25369         * cs-parser.jay: Adjust the default parameters so that destructors
25370         have the proper signature.
25372 2002-04-26  Martin Baulig  <martin@gnome.org>
25374         * driver.cs (LoadAssembly): If `assembly' contains any characters
25375         which are only valid in path names and not in assembly names
25376         (currently slash, backslash and point), use Assembly.LoadFrom ()
25377         instead of Assembly.Load () on the `assembly' (before iteration
25378         over the link_paths).
25380 2002-04-26  Martin Baulig  <martin@gnome.org>
25382         * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
25384 2002-04-25  Miguel de Icaza  <miguel@ximian.com>
25386         * class.cs (Property): use the new typemanager.MemberLookup
25388         (TypeContainer.MemberLookup): Implement using the
25389         TypeManager.MemberLookup now. 
25391         * typemanager.cs: Make MemberLookup a function of the TypeManager,
25392         and return MemberInfos, so that these can be used without an
25393         EmitContext (what we had before).
25395 2002-04-24  Miguel de Icaza  <miguel@ximian.com>
25397         * expression.cs: Fix the case where the argument to params if the
25398         type of the params.  I omitted handling this before.   Fixed
25400 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
25402         * driver.cs: Call BootCorlib_PopulateCoreType
25404         * class.cs (Property.CheckBase): Check for properties only, not
25405         for all members. 
25407         * interface.cs: Temporary hack: try/catch around the
25408         CustomAttributeBuilder, because I am getting an exception that I
25409         do not understand.
25411         * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
25412         types whose definitions are required to be there (attributes are
25413         defined before standard types).
25415         Compute definitions as we boot the various types, as they are used
25416         immediately (value_type class will need object_type, but if we do
25417         not initialize object_type, we will pass a null, which will let
25418         the runtime pick the System.Object from the existing corlib, which
25419         is not what we want).
25421 2002-04-22  Patrik Torstensson <totte@labs2.com>
25423         * cs-tokenizer.cs: fixed a number of trim() issues.
25425 2002-04-22  Ravi Pratap  <ravi@ximian.com>
25427         * expression.cs (Argument.Type): Ensure that we return the correct
25428         type when we have out or ref parameters [in which case we 
25429         append a "&"].
25431 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
25433         * class.cs (Property, Indexer): Allow extern modifier in there. 
25435         * typemanager.cs (InitBaseTypes): Initializes object_type and
25436         value_type, since those will be used early on during the bootstrap
25437         process to compile corlib.
25439         (InitCoreTypes): Move code from here to InitBaseTypes.
25441 2002-04-21  Miguel de Icaza  <miguel@ximian.com>
25443         * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
25444         single-dimension arrays as using the ldlen opcode.  
25446         Daniel Lewis discovered this optimization.  
25448         * typemanager.cs: Add signature for System.Array::get_Length
25450 2002-04-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25452         * statement.cs: report the error when the foreach does not apply to an
25453         array nor a collection.
25455 2002-04-19  Miguel de Icaza  <miguel@ximian.com>
25457         * expression.cs: Add implicit conversions to the operator ~.
25459         * constant.cs (DecimalConstant.Emit): Emit decimal value.
25461         * typemanager.cs: Locate the decimal constructor.
25463 2002-04-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25465         * attribute.cs: use the new property of TypeOf.
25466         * expression.cs: added 'get' property around typearg.
25468         These changes fix a build breaker reported by NickD. Is this the
25469         correct way to fix?  If not, please, revert my changes and make it
25470         work :-).
25472 2002-04-17  Miguel de Icaza  <miguel@ximian.com>
25474         * attribute.cs: Add support for typeof in attribute invocations.
25475         I am not sure that this is right though.
25477 2002-04-14  Duncan Mak  <duncan@ximian.com>
25479         * cfold.cs (BinaryFold): Catch DivideByZeroException in the
25480         Binary.Operator.Division case.
25482 2002-04-13  Ravi Pratap  <ravi@ximian.com>
25484         * class.cs (DefineType): Ensure that we do a proper check on
25485         attribute types and also register it with the TypeManager.
25487         (TypeContainer.Targets): The default for attribute types is
25488         AttributeTargets.All.
25490         * attribute.cs (ApplyAttributes): Registering the attribute type
25491         is done elsewhere, not when we discover we have a Usage attribute.
25493 2002-04-12  Ravi Pratap  <ravi@ximian.com>
25495         * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
25496         and get rid of is_delegate parameter.
25498         * everywhere : update.
25500 2002-04-12  Ravi Pratap  <ravi@ximian.com>
25502         * cs-parser.jay (compilation_unit): Revamp completely to use
25503         some new ideas that I got from Rhys' grammar to solve the problems
25504         with assembly level attributes.
25506         (outer_declaration): New grammar production.
25508         (attribute_sections): Add.
25510         (opt_attributes): Base on attribute_sections
25512         (namespace_declaration): Allow opt_attributes to tackle the case
25513         when we have assembly level attributes - we are clever in this
25514         regard now ;-)
25516         * attribute.cs (ApplyAttributes): Do not worry about assembly 
25517         attributes in the non-global context.
25519         * rootcontext.cs (AddGlobalAttributes): Go back to using this
25520         instead of SetGlobalAttributes.
25522         * class.cs, rootcontext.cs : Ensure we define and generate 
25523         attribute types before anything else.
25525         * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
25526         and flag the new error -20 for the case when the attribute type
25527         does not have valid targets specified. csc does not catch this.
25529         * ../errors/errors.txt : update for error # -20
25531 2002-04-11  Ravi Pratap  <ravi@ximian.com>
25533         * support.cs (InternalParameters.ParameterModifier): Do some null
25534         checking and return sane values.
25536         * class.cs (Method.Define): If we are a PInvoke method, ensure
25537         that we are static and extern. Report error # 601
25539         * ../errors/cs0601.cs : Add test case for the above error.
25541 2002-04-07  Ravi Pratap  <ravi@ximian.com>
25543         * rootcontext.cs (attribute_types): We need to keep type of
25544         all attribute types separately and emit code for them first.
25546         (RegisterAttribute) : Implement.
25548         * class.cs (DefineType): Check if the current Type is a custom
25549         attribute type and register it accordingly.
25551         * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
25552         adding the first attribute twice and rename to
25554         (SetGlobalAttributes): this.
25556         * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
25557         lookups.
25559         * attribute.cs (ApplyAttributes): Take an additional argument telling us
25560         if we are processing global arguments. Hmm, I am unsure of this.
25562 2002-04-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25564         * expression.cs: added static array of strings to avoid calling
25565         Enum.ToString () for Operator in Binary. Significant recover of
25566         performance.
25568 2002-04-10  Miguel de Icaza  <miguel@ximian.com>
25570         * class.cs (FindMembers): Allow the Builders of the various
25571         members to be null.  If they are skip them.  This only happens
25572         during the PInvoke declaration.
25574 2002-04-09  Miguel de Icaza  <miguel@ximian.com>
25576         * parameter.cs (Parameters.ComputeParameterTypes): Flag the
25577         failure, so we do not keep going afterwards.
25579         * expression.cs: (Invocation.OverloadResolve): I believe Ravi
25580         wanted to pass `false' as the `is_delegate' argument.  If this is
25581         the case, why not use delegate_type == null to mean `is_delegate =
25582         false' and anything else as is_delegate = true.
25584 Tue Apr  9 05:40:12  2002 Piers Haken <piersh@friskit.com>
25586         * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
25587         code for the section, not the beginning of the tests.
25589 2002-04-08  Miguel de Icaza  <miguel@ximian.com>
25591         * cfold.cs: Handle operator + (Enum x, Underlying x) 
25593         * expression.cs (Binary): same.  Warn about errors where we have
25594         Enum/Enum in operator + as well.
25596 Mon Apr  8 06:29:03  2002 Piers Haken <piersh@friskit.com>
25598         * statement.cs:
25599                 - added support for switch(bool)
25600                 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
25601                 - add TableSwitchEmit() to handle table-based switch statements
25603 2002-04-05  Ravi Pratap  <ravi@ximian.com>
25605         * expression.cs (Invocation.OverloadResolve): Factor out code which
25606         does parameter compatibility checking with arguments so that we can 
25607         re-use the code even from Delegate.VerifyApplicability
25609         (VerifyArgumentsCompat): Move above code here.
25611         * delegate.cs (VerifyApplicability): Get rid of duplicate code
25612         and instead make a call to the above method.
25614 2002-03-31  Ravi Pratap  <ravi@ximian.com>
25616         * typemanager.cs (attribute_type): Corresponds to System.Attribute.
25617         We use it to keep track of classes which are attribute types.
25619 2002-04-02  Miguel de Icaza  <miguel@ximian.com>
25621         * delegate.cs (Delegate.Define): Correctly define the types in the
25622         presence of fixed and array parameters.
25624         * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
25625         doing FindMembers.
25627         * ecore.cs (Expression.MemberLookup): Reset binding flags to not
25628         include NonPublic after the first iteration.
25630         * class.cs (Indexer.CheckBase): Only check if both parents are
25631         non-null. 
25633         * cs-parser.jay (accessor_body): If empty, set to null.
25635         * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
25636         same code path here to resolve constants names that we did have in
25637         MemberAccess.DoResolve.  There is too much code duplicated here.
25639 2002-04-01  Miguel de Icaza  <miguel@ximian.com>
25641         * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
25643         * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
25644         to MakeUnionSet.
25646         * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
25647         tokens, numbers and strings.
25649         * ecore.cs (MethodGroupExpr): Make Emit warn about missing
25650         parenthesis.
25652         * delegate.cs: Use ComputeAndDefineParameterTypes for both the
25653         asyncronous parameters and the regular parameters.  
25655         * codegen.cs (CodeGen.Init): Use the constructor that allows us to
25656         specify the target directory.
25658         * expression.cs: (This.DoResolve): Simplify
25659         (As.Emit): Optimize, do not generate IsInst if the expression is
25660         always of the given type.
25662         (Is.DoResolve): Bug fix, we were reporting both always/never for
25663         the is expression.
25665         * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
25666         creating too many unnecessary arrays.
25668 2002-03-31  Miguel de Icaza  <miguel@ximian.com>
25670         * class.cs (EmitFieldInitializer): Use Assign expression to assign
25671         fields instead of rolling our own initializer.   Takes care of all
25672         implicit conversions, and drops unnecessary static checks/argument.
25674 2002-03-31  Dick Porter  <dick@ximian.com>
25676         * driver.cs: use the GetDirectories() return values properly, and
25677         use "/" as path separator.
25679 2002-03-30  Miguel de Icaza  <miguel@ximian.com>
25681         * expression.cs (Unary): Optimize - - expr into expr.
25682         (Binary): Optimize a + (-b) into a -b.
25684         * codegen.cs (CodeGen): Made all methods static.
25686 2002-03-29  Miguel de Icaza  <miguel@ximian.com>
25688         * rootcontext.cs: 
25690         * decl.cs: Rename `definition' into `TypeBuilder' and drop the
25691         TypeBuilder property.
25693         * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
25694         instead. 
25696         * tree.cs: Removed the various RecordXXXX, and replaced with a
25697         single RecordDecl.  Removed all the accessor methods, and just
25698         left a single access point Type 
25700         * enum.cs: Rename DefineEnum to DefineType.
25702         * decl.cs: New abstract method `DefineType' used to unify the
25703         Defines for Enumerations, Interfaces, TypeContainers and
25704         Delegates.
25706         (FindType): Moved LookupInterfaceOrClass here.  Moved the
25707         LookupBaseClasses method that used to live in class.cs and
25708         interface.cs here, and renamed to FindType.
25710         * delegate.cs: Implement DefineType.  Take advantage of the
25711         refactored pattern for locating the parent builder without taking
25712         the parent_builder argument (which we know does not work if we are
25713         nested, and triggering a toplevel definition).
25715 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
25717         * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
25718         accessibility of a member has changed during override and report
25719         an error if so.
25721         * class.cs (Method.Define, Property.Define): Only complain on
25722         overrides if the method is private, any other accessibility is
25723         fine (and since we just checked the permission is the same, we are
25724         good to go).
25726         * cs-tokenizer.cs: only line, region, endregion, if, endif, else
25727         and elif are processed always.  The other pre-processing
25728         directives are only processed if we are "taking" the path
25730 2002-03-29  Martin Baulig  <martin@gnome.org>
25732         * class.cs (Method.Emit): Only emit symbolic debugging info if the
25733         current location is not Null.
25735         * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
25736         a separate method so we can profile it.
25738         * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
25739         `span.Seconds' are just seconds, but no minutes or hours.
25740         (MainDriver): Profile the CodeGen.SaveSymbols calls.
25742 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
25744         * class.cs (Method.Define), (Property.Define), (Indexer.Define):
25745         Remove the gratuitous set of Final:
25747                                 // If an interface implementation, then we can set Final.
25748                                 if (((flags & MethodAttributes.Abstract) == 0) &&
25749                                     implementing.DeclaringType.IsInterface)
25750                                         flags |= MethodAttributes.Final;
25752         I do not know what I was smoking when I used that.
25755         * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
25756         step into fixing the name resolution issues for delegates and
25757         unifying the toplevel name resolution.
25759 2002-03-28  Martin Baulig  <martin@gnome.org>
25761         * class.cs (Method.Emit): If we have a symbol writer, call its
25762         OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
25763         tell it about the current method.
25765         * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
25766         writer that we're going to emit the first byte of IL code for a new
25767         statement (a new source line).
25768         (EmitContext.EmitTopBlock): If we have a symbol writer, call
25769         EmitContext.Mark() before emitting any code.
25771         * location.cs (SymbolDocument): Return null when we're Null.
25773         * statement.cs (Statement): Moved the `Location loc' variable here.
25774         (Statement.EmitBoolExpression): If we have a symbol writer, call
25775         ec.Mark() before emitting any code to tell it that we're at the
25776         beginning of a new statement.
25777         (StatementExpression): Added `Location' argument to the constructor.
25778         (Block): Added public readonly variable `StartLocation' and public
25779         variable `EndLocation'.  The latter is to be set using SetEndLocation().
25780         (Block): Added constructor which takes a start and end location.
25781         (Block.SetEndLocation): New method. This sets the end location.
25782         (Block.EmitMeta): If we have a symbol writer, tell it the names of the
25783         local variables we create.
25784         (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
25785         each statement and do also mark the begin and end of the block.
25787         * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
25788         tell it the current lexer.Location, use Location.Null for the end of the
25789         block.
25790         (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
25791         current block, set its end location using SetEndLocation().
25792         (statement_expression): StatementExpression constructor now takes the
25793         lexer.Location as additional argument.
25794         (for_statement, declare_local_variables): Likewise.
25795         (declare_local_variables): When creating a new implicit block, use the
25796         new Block constructor and pass it the lexer.Location.
25798 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
25800         * ecore.cs (Expression.MemberLookup): On interfaces, lookup
25801         members also on the parent interfaces recursively.
25803 2002-03-27  Miguel de Icaza  <miguel@ximian.com>
25805         * report.cs: Use new formats, since Gonzalo finished the missing
25806         bits. 
25808         * expression.cs (Binary.ResolveOperator): added missing operator|
25809         operator& and operator^ for bool/bool.
25811         * cs-parser.jay: CheckDef now takes a Location argument that is
25812         used to report errors more precisly (instead of reporting the end
25813         of a definition, we try to track something which is a lot closer
25814         to the source of the problem).
25816         * cs-tokenizer.cs: Track global token use, so we can properly flag
25817         the use of #define/#undef after the first token has been seen.
25819         Also, rename the reportXXXX to Error_DescriptiveName
25821         * decl.cs (DeclSpace.IsTopLevel): Move property here from
25822         TypeContainer, so that Enum and Interface can use this too.
25824         * class.cs (TypeContainer.LookupInterfaceOrClass,
25825         GetInterfaceOrClass, GetClassBases, DefineType): Drop the
25826         `builder' argument.  Typically this was used to pass the parent
25827         builder (a ModuleBuilder or a TypeBuilder from whoever triggered
25828         the definition).  
25830         The problem is that a nested class could trigger the definition of
25831         a toplevel class, and the builder would be obviously wrong in that
25832         case. 
25834         So we drop this argument, and we compute dynamically the
25835         TypeBuilder/ModuleBuilder (the correct information was available
25836         to us anyways from DeclSpace.Parent)
25838         * interface.cs (Interface.DefineInterface): Drop builder
25839         parameter cleanup like class.cs
25841         * enum.cs (Enum.DefineEnum): Drop builder parameter.  Clean up
25842         like class.cs
25844         * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
25845         values. 
25847         (Try.Emit): Propagate the returns value from the statement.
25849         (Return.Emit): Even if we are leavning 
25851         * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
25853         * modifiers.cs: Fix the computation of MethodAttributes flags.
25855 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
25857         * driver.cs: allow compilation of files that start with '/'.
25858         Add a default case when checking the argument of --target.
25860 2002-03-25  Miguel de Icaza  <miguel@ximian.com>
25862         * interface.cs: Implement the same search algorithm for types in
25863         the interface code.
25865         * delegate.cs: Do not allow multiple definition.
25867         * Recovered ChangeLog that got accidentally amputated
25869         * interface.cs (Interface.DefineInterface): Prevent from double definitions.
25871         * rootcontext.cs: Load manually enum to allow core classes to
25872         contain enumerations.
25874         * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
25875         Update to new static methods in TypeManager.
25877         * typemanager.cs (GetMethod, GetConstructor): Use our
25878         implementation of FindMembers to find the members, since during
25879         corlib compilation, the types are TypeBuilders and GetMethod and
25880         GetConstructor do not work.
25882         Make all methods in TypeManager static.
25884         (InitCodeHelpers): Split the functionality from
25885         the InitCodeTypes function.
25887         * driver.cs: Call InitCodeHelpers after we have populated the
25888         types. 
25890         * cs-parser.jay (delegate_declaration): we did not used to compute
25891         the delegate name correctly for void delegates.
25893 2002-03-24  Miguel de Icaza  <miguel@ximian.com>
25895         * rootcontext.cs (RootContext): Init the interface_resolve_order
25896         and type_container_resolve_order always.
25898         (ResolveCore, BootstrapCorlib_ResolveClass,
25899         BootstrapCorlib_ResolveStruct): New functions to bootstrap the
25900         compiler when compiling with --nostdlib
25902         * class.cs (TypeContainer.DefineType): Check that our parent is
25903         not null.  This test is most important when we are bootstraping
25904         the core types.
25906         * codegen.cs: Split out the symbol writing code.
25908 2002-03-25  Martin Baulig  <martin@gnome.org>
25910         * driver.cs (-g): Made -g an alias for --debug.
25912 2002-03-24  Martin Baulig  <martin@gnome.org>
25914         * codegen.cs (SymbolWriter): New public variable. Returns the
25915         current symbol writer.
25916         (CodeGen): Added `bool want_debugging_support' argument to the
25917          constructor. If true, tell the ModuleBuild that we want debugging
25918         support and ask it for the ISymbolWriter.
25919         (Save): If we have a symbol writer, call it's Close() method after
25920         saving the assembly.
25922         * driver.c (--debug): New command line argument to create a
25923         debugger information file.
25925         * location.cs (SymbolDocument): New public property. Returns an
25926         ISymbolDocumentWriter object for the current source file or null
25927         if we don't have a symbol writer.
25929 2002-03-21  Miguel de Icaza  <miguel@ximian.com>
25931         * driver.cs (LoadAssembly): Correctly return when all the paths
25932         have been tried and not before.
25934         * statement.cs (Switch.Emit): return the actual coverage for this
25935         statement (returns/not-returns)
25937         (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
25938         switch of the statement if we are the last switch section.  That
25939         kills two problems: try/catch problems (we used to emit an empty
25940         nop at the end) and switch statements where all branches would
25941         return. 
25943 2002-03-19  Miguel de Icaza  <miguel@ximian.com>
25945         * driver.cs: Add default assemblies (the equivalent to the
25946         Microsoft CSC.RSP file)
25948         * cs-tokenizer.cs: When updating `cols and setting it to zero,
25949         also update tokens_seen and set it to false.
25951         * driver.cs: Implement --recurse for Mike.
25953         * driver.cs (SplitPathAndPattern): Small bug fix, I was not
25954         correctly splitting out the paths.
25956 2002-03-18  Miguel de Icaza  <miguel@ximian.com>
25958         * interface.cs (Interface.PopulateProperty): Instead of using
25959         `parent' as the declaration space for the set parameters, use
25960         `this' 
25962         * support.cs (InternalParameters): InternalParameters constructor
25963         takes a DeclSpace instead of a TypeContainer.
25965         * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
25966         types are being initialized, load the address of it before calling
25967         the function.  
25969         (New): Provide a mechanism to disable the generation of local
25970         value type temporaries when the caller will be providing us with
25971         an address to store it.
25973         (ArrayCreation.EmitDynamicInitializers): Use it.
25975 2002-03-17  Miguel de Icaza  <miguel@ximian.com>
25977         * expression.cs (Invocation.EmitArguments): Only probe for array
25978         property if there is more than one argument.  Sorry about that.
25980         * class.cs (Invocation.EmitArguments): Fix to emit arguments for
25981         empty param arrays.
25983         * class.cs (Method.LabelParameters): Fix incorrect code path that
25984         prevented the `ParamArrayAttribute' from being applied to the
25985         params attribute.
25987 2002-03-16  Miguel de Icaza  <miguel@ximian.com>
25989         * support.cs (ReflectionParameters): Correctly compute whether the
25990         last argument is a params array.  Fixes the problem with
25991         string.Split ('a')
25993         * typemanager.cs: Make the assemblies array always be non-null
25994         (empty, but non-null)
25996         * tree.cs (RecordDecl): New function that abstracts the recording
25997         of names.  This reports error 101, and provides a pointer to the
25998         previous declaration.  Fixes a crash in the compiler.
26000         * cs-parser.jay (constructor_declaration): Update to new grammar,
26001         and provide a constructor_body that can be empty.
26003 2002-03-15  Miguel de Icaza  <miguel@ximian.com>
26005         * driver.cs: Add support for --resources.
26007         * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
26008         Make all types for the various array helper methods be integer.
26010         * ecore.cs (Expression.ConvertNumericExplicit): Pass the
26011         CheckState to ConvCast.
26013         (ConvCast): Now it takes a `checked' state argument, to avoid
26014         depending on the emit context for the conversion, and just using
26015         the resolve time setting.
26017         * expression.cs (ArrayCreation.EmitArrayArguments): New function,
26018         instead of Invocation.EmitArguments.  We do not emit the original
26019         arguments, instead we emit those which have been converted to
26020         unsigned int expressions.
26022         * statement.cs (Block.EmitMeta): Drop tracking of indexes.
26024         * codegen.cs: ditto.
26026         * expression.cs (LocalVariableReference): Drop the use of the
26027         Store function that depended on the variable index.
26029         * statement.cs (VariableInfo): Drop the `Idx' property from this
26030         class, as this is not taking into account the indexes for
26031         temporaries tat we generate during the execution, getting the
26032         indexes wrong.
26034         * class.cs: First emit class initializers, then call the parent
26035         constructor. 
26037         * expression.cs (Binary): Fix opcode emision.
26038         (UnaryMutator.EmitCode): Support checked code generation
26040         * ecore.cs (MemberLookup): TypeManager.FindMembers will return
26041         matches for events for both the Static and Instance scans,
26042         pointing to the same element.   Fix that.
26044 2002-03-14  Miguel de Icaza  <miguel@ximian.com>
26046         * rootcontext.cs (ResolveTree): Always set the
26047         interface_resolve_order, because nested interfaces will be calling
26048         into us.
26050         * class.cs (GetInterfaceOrClass): Track the same resolution
26051         process used by TypeManager.LookupType.  This fixes the nested
26052         type lookups in class declarations (separate path from
26053         LookupType). 
26055         (TypeContainer.DefineType): Also define nested interfaces.
26056         (TypeContainer.RegisterOrder): New public function used to
26057         register the order in which child interfaces need to be closed.
26059         Nested interfaces need to be closed after their parents have been
26060         created. 
26062         * interface.cs (InterfaceAttr): Put all the logic for computing
26063         the interface attribute here. 
26065         (DefineInterface): Register our interface order with the
26066         RootContext or with the TypeContainer depending on the case.
26068 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
26070         * cs-parser.jay: rework foreach statement to work with the new
26071         changes to the policy on SimpleNames.
26073         * report.cs: support Stacktrace on warnings as well.
26075         * makefile: drop --unsafe and /unsafe from the compile.
26077 2002-03-13  Ravi Pratap  <ravi@ximian.com>
26079         * ecore.cs (StandardConversionExists): Modify to take an Expression
26080         as the first parameter. Ensure we do null -> reference type conversion
26081         checking.
26083         * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
26084         temporary Expression objects.
26086 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
26088         * interface.cs: workaround bug in method overloading resolution
26089         (there is already a bugzilla bug for it).
26091 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
26093         We could also solve this problem by having a separate path for
26094         performing type lookups, instead of DoResolve, we could have a
26095         ResolveType entry point, and only participating pieces of the
26096         production (simplename, deref, array) would implement this. 
26098         * codegen.cs (EmitContext): New field OnlyLookupTypes used to
26099         signal SimpleName to only resolve type names and not attempt to
26100         resolve anything else.
26102         * expression.cs (Cast): Set the flag.
26104         * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
26106         * class.cs: Only report 108 if there is no `new' modifier.
26108         * cs-parser.jay: rework foreach statement to work with the new
26109         changes to the policy on SimpleNames.
26111         * report.cs: support Stacktrace on warnings as well.
26113         * makefile: drop --unsafe and /unsafe from the compile.
26115 2002-03-11  Miguel de Icaza  <miguel@ximian.com>
26117         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
26118         lookups here, instead of doing that at parse time.  This means
26119         that our grammar will not introduce `LocalVariableReferences' as
26120         expressions at this point.  That solves the problem of code like
26121         this:
26123         class X {
26124            static void Main ()
26125            { int X = 1;
26126             { X x = null }}}
26128         This is only half the fix.  The full fix requires parameters to
26129         also be handled in this way.
26131         * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
26132         makes the use more obvious of the DeclSpace.  The
26133         ec.TypeContainer.TypeBuilder is now only used to pull the
26134         TypeBuilder for it.
26136         My theory is that I can get rid of the TypeBuilder completely from
26137         the EmitContext, and have typecasts where it is used (from
26138         DeclSpace to where it matters).  
26140         The only pending problem is that the code that implements Aliases
26141         is on TypeContainer, and probably should go in DeclSpace.
26143         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
26144         lookups here, instead of doing that at parse time.  This means
26145         that our grammar will not introduce `LocalVariableReferences' as
26146         expressions at this point.  That solves the problem of code like
26147         this:
26149         class X {
26150            static void Main ()
26151            { int X = 1;
26152             { X x = null }}}
26154         This is only half the fix.  The full fix requires parameters to
26155         also be handled in this way.
26157         * class.cs (Property.DefineMethod): When implementing an interface
26158         method, set newslot, when implementing an abstract method, do not
26159         set the flag (before we tried never setting it, or always setting
26160         it, which is the difference).
26161         (Indexer.DefineMethod): same.
26162         (Method.DefineMethod): same.
26164         * ecore.cs: Only set the status used flag if we get back a Field.
26166         * attribute.cs: Temporary hack, so Paolo can keep working.
26168 2002-03-08  Ravi Pratap  <ravi@ximian.com>
26170         * attribute.cs (Attribute.UnmanagedType): This is to keep track of
26171         the unmanaged type in the case we have a MarshalAs attribute.
26173         (Resolve): Handle the case when we are parsing the special MarshalAs
26174         attribute [we need to store the unmanaged type to use later]
26176         * typemanager.cs (marshal_as_attr_type): Built in type for the 
26177         MarshalAs Attribute.
26179         * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute 
26180         on parameters and accordingly set the marshalling info.
26182 2002-03-09  Miguel de Icaza  <miguel@ximian.com>
26184         * class.cs: Optimizing slightly by removing redundant code after
26185         we switched to the `NoTypes' return value.
26186         (Property.DefineMethod): use NoTypes here too.
26188         This fixes the bug I introduced in my last batch of changes.
26190 2002-03-05  Ravi Pratap  <ravi@ximian.com>
26192         * tree.cs (RecordEnum): Add. We now keep track of enums too.
26194         * class.cs (LookupInterfaceOrClass): Check against the list of recorded
26195         Enums since those are types too. 
26197         * cs-parser.jay (enum_declaration): Record enums as we parse them.
26199         * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined 
26200         thanks to a call during the lookup process.
26202 2002-03-07  Miguel de Icaza  <miguel@ximian.com>
26204         * statement.cs (Foreach): Lots of work to accomodate a particular
26205         kind of foreach statement that I had not kept in mind.  It is
26206         possible to have foreachs on classes that provide a GetEnumerator
26207         method that return objects that implement the "pattern" for using
26208         a foreach, there is no need to support GetEnumerator
26209         specifically. 
26211         This is needed to compile nant.
26213         * decl.cs: Only report 114 if the member is not `Finalize' and if
26214         the warning level is at least 2.
26216         * class.cs: Moved the compare function from Method to
26217         MethodSignature. 
26219         (MethodSignature.InheritableMemberSignatureCompare): Add new
26220         filter function that is used to extract inheritable methods from a
26221         class. 
26223         (Method.Define): Use the new `inheritable_method_signature_filter'
26224         delegate
26226         * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
26227         command. 
26229 2002-03-06  Miguel de Icaza  <miguel@ximian.com>
26231         * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
26233         * cs-parser.jay: Add opt_semicolon to the interface declaration.
26235         * expression.cs: Pass location information to
26236         ConvertImplicitStandard. 
26238         * class.cs: Added debugging code to track return values from
26239         interfaces. 
26241 2002-03-05  Miguel de Icaza  <miguel@ximian.com>
26243         * expression.cs (Is.DoResolve): If either side of the `is' is an
26244         interface, do not flag the warning.
26246         * ecore.cs (ImplicitReferenceConversion): We need a separate test
26247         for interfaces
26249         * report.cs: Allow for --fatal to be used with --probe.
26251         * typemanager.cs (NoTypes): Move the definition for the empty Type
26252         array here. 
26254         * class.cs (TypeContainer.FindMembers): Also look for methods defined by
26255         properties. 
26256         (TypeContainer.DefineProxy): New function used to proxy to parent
26257         implementations when implementing interfaces.
26258         (TypeContainer.ParentImplements): used to lookup if our parent
26259         implements a public function that is required by an interface.
26260         (TypeContainer.VerifyPendingMethods): Hook this up.
26262         * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
26263         `modules' and `assemblies' arraylists into arrays.  We only grow
26264         these are the very early start up of the program, so this improves
26265         the speedof LookupType (nicely measured).
26267         * expression.cs (MakeByteBlob): Replaced unsafe code with
26268         BitConverter, as suggested by Paolo.
26270         * cfold.cs (ConstantFold.Binary): Special case: perform constant
26271         folding of string concatenation, but if either side is a string,
26272         and the other is not, then return null, and let the runtime use
26273         the concatenation on the string plus the object (using
26274         `Object.ToString'). 
26276 2002-03-04  Miguel de Icaza  <miguel@ximian.com>
26278         Constant Folding has been implemented now.
26280         * expression.cs (Unary.Reduce): Do not throw an exception, catch
26281         the error instead on types that are not supported in one's
26282         complement. 
26284         * constant.cs (Constant and all children): New set of functions to
26285         perform implict and explicit conversions.
26287         * ecore.cs (EnumConstant): Implement the new functions to perform
26288         conversion by proxying to the child expression.
26290         * codegen.cs: (ConstantCheckState): Constant evaluation has its
26291         own separate setting that can not be turned off from the command
26292         line using --unchecked or --checked and is only controlled using
26293         the checked/unchecked statements and expressions.  This setting is
26294         used by the constant folder to flag errors.
26296         * expression.cs (CheckedExpr, UncheckedExpr): Set the
26297         ConstantCheckState as well.   
26299         During Resolve, they also have to flag the state, because the
26300         constant folder runs completely in the Resolve phase.
26302         * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
26303         well.
26305 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
26307         * cfold.cs: New file, this file contains the constant folder.
26309         * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
26310         argument to track whether we are using the resulting address to
26311         load or store a value and provide better error messages. 
26313         (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
26314         new AddressOf arguments.
26316         * statement.cs (Foreach.EmitCollectionForeach): Update
26318         * expression.cs (Argument.Emit): Call AddressOf with proper
26319         arguments to track usage.
26321         (New.DoEmit): Call AddressOf with new arguments.
26323         (Unary.Emit): Adjust AddressOf call.
26325 2002-03-01  Ravi Pratap  <ravi@ximian.com>
26327         * cs-parser.jay (member_access): Change the case for pre-defined types
26328         to use a MemberAccess instead of a SimpleName. Thanks to Felix again for 
26329         this suggestion.
26331         * class.cs (Operator::Emit): If we are abstract or extern, we don't have
26332         a method body.
26334         * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
26335         essentially like methods and apply attributes like MethodImplOptions to them too.
26337         * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
26338         not being null.
26340         * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
26341         DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
26342         is the DeclSpace.
26344         * Update code everywhere accordingly.
26346         * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
26348         * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
26350 2002-02-28  Ravi Pratap  <ravi@ximian.com>
26352         * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
26353         try performing lookups against those instead of jumping straight into using
26354         the 'using' clauses.
26356         (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
26358         (LookupType): Perform lookups in implicit parents too.
26360         * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
26361         sequence as RootContext.LookupType. 
26363         * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries 
26364         the various cases of namespace lookups into this method.
26366 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
26368         * cs-parser.jay: Add support for [Attribute ()] (empty arguments
26369         in positional arguments)
26371         * class.cs (Operator): Update the AllowedModifiers to contain
26372         extern. 
26374         * cs-parser.jay: Update operator declaration to allow for the
26375         operator body to be empty.
26377         * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
26378         values. 
26380 2002-02-27  Miguel de Icaza  <miguel@ximian.com>
26382         * class.cs (Method.Emit): Label parameters.
26384         * driver.cs: Return 1 or 0 as the program exit code.
26386 2002-02-26  Miguel de Icaza  <miguel@ximian.com>
26388         * expression.cs: Special case the `null' object when trying to
26389         auto-compute the type, as anything can be explicitly converted to
26390         that. 
26392         * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
26393         spotting this Paolo.
26395         (Expression.ImplicitNumericConversion): Perform comparissions of
26396         the type using the underlying type in the case of an enumeration
26397         rather than using the enumeration type for the compare.
26399         Cope with the underlying == type case, which is not possible to
26400         catch before. 
26402         (Expression.ConvertNumericExplicit): Perform comparissions of
26403         the type using the underlying type in the case of an enumeration
26404         rather than using the enumeration type for the compare.
26406         * driver.cs: If the user does not supply an extension, assume .exe
26408         * cs-parser.jay (if_statement): Rewrote so that we can track the
26409         location for the if statement.
26411         * expression.cs (Binary.ConstantFold): Only concat strings when
26412         the operation is "+", not everything ;-)
26414         * statement.cs (Statement.EmitBoolExpression): Take a location
26415         argument. 
26416         (If, While, Do): Track location.
26418         * expression.cs (Binary.ResolveOperator): In the object + string
26419         case, I was missing a call to ConvertImplicit
26421 2002-02-25  Ravi Pratap  <ravi@ximian.com>
26423         * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
26424         Location arguments. Ensure we use RootContext.LookupType to do our work
26425         and not try to do a direct Type.GetType and ModuleBuilder.GetType
26427         * interface.cs (PopulateMethod): Handle the type of the parameter being
26428         null gracefully.
26430         * expression.cs (Invocation.BetterFunction): Handle the case when we 
26431         have a params method with no fixed arguments and a call is made with no
26432         arguments.
26434 2002-02-25  Miguel de Icaza  <miguel@ximian.com>
26436         * cs-tokenizer.cs: Add support for the quote-escape-sequence in
26437         the verbatim-string-literal
26439         * support.cs (InternalParameters.ParameterModifier): handle null
26440         fixed parameters.
26441         (InternalParameters.ParameterType): ditto.
26443         * parameter.cs (VerifyArgs): Also check if the fixed parameter is
26444         duplicating the name of the variable parameter.
26445         (GetParameterByName): Fix bug where we were not looking up array
26446         paramters if they were the only present (thanks Paolo!).
26447         (GetParameterInfo): We only have an empty set of types if both
26448         fixed and array are set to null.
26449         (GetParameterInfo-idx): Handle FixedParameter == null
26451         * cs-parser.jay: Handle the case where there is no catch
26452         statements (missing null test).
26454 2002-02-22  Miguel de Icaza  <miguel@ximian.com>
26456         * driver.cs (MainDriver): Be conservative on our command line
26457         handling.
26459         Catch DirectoryNotFoundException when calling GetFiles.
26461         (SplitPathAndPattern): Used to split the input specification into
26462         a path and a pattern that we can feed to Directory.GetFiles.
26464 2002-02-21  Miguel de Icaza  <miguel@ximian.com>
26466         * statement.cs (Fixed): Implement the last case of the Fixed
26467         statement (string handling).
26469         * expression.cs (StringPtr): New class used to return a char * to
26470         a string;  Used by the Fixed statement.
26472         * typemanager.cs: Add char_ptr_type.  Add get_OffsetToStringData method.
26474         * expression.cs (Binary.ResolveOperator): Remove redundant
26475         MemberLookup pn parent type.
26476         Optimize union call, we do not need a union if the types are the same.
26477         (Unary.ResolveOperator): REmove redundant MemberLookup on parent
26478         type.
26480         Specialize the use of MemberLookup everywhere, instead of using
26481         the default settings. 
26483         (StackAlloc): Implement stackalloc keyword.
26485         * cs-parser.jay: Add rule to parse stackalloc.
26487         * driver.cs: Handle /h, /help, /?
26489         * expression.cs (MakeByteBlob): Removed the hacks we had in place
26490         before we supported unsafe code.
26492         * makefile: add --unsafe to the self compilation of mcs.
26494 2002-02-20  Miguel de Icaza  <miguel@ximian.com>
26496         * expression.cs (PointerArithmetic): New class that is used to
26497         perform pointer arithmetic.
26498         (Binary.Resolve): Handle pointer arithmetic
26499         Handle pointer comparission.
26500         (ArrayPtr): Utility expression class that is used to take the
26501         address of an array.
26503         (ElementAccess): Implement array access for pointers
26505         * statement.cs (Fixed): Implement fixed statement for arrays, we
26506         are missing one more case before we are done.
26508         * expression.cs (Indirection): Implement EmitAssign and set the
26509         ExprClass to Variable.  This allows pointer dereferences to be
26510         treated as variables, and to have values assigned to them.
26512         * ecore.cs (Expression.StoreFromPtr): New utility function to
26513         store values dereferencing.
26515 2002-02-20  Ravi Pratap  <ravi@ximian.com>
26517         * expression.cs (Binary.ResolveOperator): Ensure that we are
26518         not trying to operate on a void type - this fixes the reported
26519         bug.
26521         * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
26522         the parent implementation is sealed.
26524         * ../errors/cs0239.cs : Add.
26526         * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
26528         * typemanager.cs (unverifiable_code_type): Corresponds to 
26529         System.Security.UnverifiableCodeAttribute. We need to emit this for modules
26530         which have unsafe code in them.
26532         * rootcontext.cs (EmitCode): Emit the above attribute when we are in an 
26533         unsafe context.
26535 2002-02-19  Miguel de Icaza  <miguel@ximian.com>
26537         * cs-tokenizer.cs: Add support for @"litreal strings"
26539         Make tokenizer accept pre-processor directives
26540         on any column (remove the old C-like limitation). 
26542         * rootcontext.cs (EmitCode): Emit any global attributes.
26543         (AddGlobalAttributes): Used to keep track of assembly attributes. 
26545         * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
26547         * cs-parser.jay: Add support for global attributes.  
26549 2002-02-17  Miguel de Icaza  <miguel@ximian.com>
26551         * expression.cs (Indirection): New helper class.  Unary will
26552         create Indirection classes to be able to implement the
26553         IMemoryLocation interface on it.
26555 2002-02-16  Miguel de Icaza  <miguel@ximian.com>
26557         * cs-parser.jay (fixed_statement): reference the right statement.
26559         * statement.cs (Fixed.Emit): Finish implementing the fixed
26560         statement for the &x case.
26562 2002-02-14  Miguel de Icaza  <miguel@ximian.com>
26564         * class.cs (Property.Define, Method.Define): Remove newslot when
26565         `implementing'.  
26567         * modifiers.cs: My use of NewSlot when `Abstract' was set was
26568         wrong.  NewSlot should only be used if the `new' keyword is present.
26570         * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
26571         locating our system dir.  Sorry about this.
26573 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
26575         * driver.cs (GetSystemDir): Compute correctly the location of our
26576         system assemblies.  I was using the compiler directory instead of
26577         the library directory.
26579 2002-02-13  Ravi Pratap  <ravi@ximian.com>
26581         * expression.cs (BetterFunction): Put back in what Miguel commented out
26582         since it is the correct fix. The problem is elsewhere ;-)
26584         (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
26585         parameters of the parms method are themselves compatible or not !
26587         (StandardConversionExists): Fix very dangerous bug where we were forgetting
26588         to check that a class implements an interface before saying that an implicit
26589         conversion was allowed. Use ImplementsInterface to do the checking.
26591 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
26593         * class.cs (Method.Define): Track whether we are an explicit
26594         implementation or not.  And only call DefineMethodOverride if we
26595         are an explicit implementation.
26597         (Property.DefineMethod): Ditto.
26599 2002-02-11  Ravi Pratap  <ravi@ximian.com>
26601         * expression.cs (BetterFunction): Catch hideous bug which was
26602          preventing us from detecting ambiguous calls due to implicit casts i.e
26603         cs0121.
26605 2002-01-29  Miguel de Icaza  <miguel@ximian.com>
26607         * support.cs (Pair): Remove un-needed method.  I figured why I was
26608         getting the error in cs-parser.jay, the variable in a foreach loop
26609         is readonly, and the compiler does not really treat this as a variable.
26611         * cs-parser.jay (fixed_statement): Fix grammar.  Use ASSIGN
26612         instead of EQUALS in grammar.  
26614         * typemanager.cs (VerifyUnmanaged): Report correct error (208)
26616         * expression.cs (Unary.DoResolve): Check whether the argument is
26617         managed or not.
26619 2002-01-28  Miguel de Icaza  <miguel@ximian.com>
26621         * support.cs: Api for Pair to set a value.  Despite the fact that
26622         the variables are public the MS C# compiler refuses to compile
26623         code that accesses the field if the variable is part of a foreach
26624         statement. 
26626         * statement.cs (Fixed): Begin implementation of the fixed
26627         statement.
26629         (Block.AddVariable): Return the VariableInfo on success and null
26630         on failure instead of true/false. 
26632         * cs-parser.jay (foreach): Catch errors on variables already
26633         defined (we were ignoring this value before) and properly unwind
26634         the block hierarchy
26636         (fixed_statement): grammar for the fixed statement.
26638 2002-01-25  Miguel de Icaza  <miguel@ximian.com>
26640         * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
26641         pointer types to be incretemented.
26643         (SizeOf): Implement.
26645         * cs-parser.jay (pointer_member_access): Implement
26646         expr->IDENTIFIER production.
26648         * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
26649         MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
26650         on safe contexts.
26652         (Unary): Implement indirection.
26654         * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
26655         use in non-unsafe context).
26657         (SimpleName.DoResolve): Check for pointers in field access on safe
26658         contexts. 
26660         (Expression.LoadFromPtr): Factor the load-indirect code in this
26661         function.  This was duplicated in UnboxCast and ParameterReference
26663 2002-01-24  Miguel de Icaza  <miguel@ximian.com>
26665         * expression.cs (ComposedCast): report an error if a pointer cast
26666         is used in a safe region.
26668         * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
26669         pointer type casts in unsafe context.
26671         * codegen.cs (EmitContext): Set up IsUnsafe.
26673         * cs-parser.jay (non_expression_type): Add productions for pointer
26674         casts. 
26676         * expression.cs (Invocation.EmitCall): Remove chunk of buggy
26677         code.  We should not use force into static mode if the method is
26678         not virtual.  Fixes bug in MIS
26680         * statement.cs (Do.Emit, While.Emit, For.Emit,
26681         Statement.EmitBoolExpression): Add support to Do and While to
26682         propagate infinite loop as `I do return' semantics.
26684         Improve the For case to also test for boolean constants.
26686         * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
26687         to the list of attributes we can add.
26689         Remove `EmitContext' argument.
26691         * class.cs (Method.Define): Apply parameter attributes.
26692         (Constructor.Define): Apply parameter attributes.
26693         (MethodCore.LabelParameters): Move here the core of labeling
26694         parameters. 
26696         * support.cs (ReflectionParameters.ParameterModifier,
26697         InternalParameters.ParameterModifier): Use IsByRef on the type and
26698         only return the OUT bit for these parameters instead of in/out/ref
26699         flags.
26701         This is because I miss-understood things.  The ParameterInfo.IsIn
26702         and IsOut represent whether the parameter has the [In] and [Out]
26703         attributes set.  
26705 2002-01-22  Miguel de Icaza  <miguel@ximian.com>
26707         * ecore.cs (FieldExpr.Emit): Release temporaries.
26709         * assign.cs (LocalTemporary.Release): new function.
26711         * codegen.cs (EmitContext.GetTemporaryStorage,
26712         EmitContext.FreeTemporaryStorage): Rework the way we deal with
26713         temporary storage.  Now we can "put back" localbuilders when we
26714         are done with them
26716 2002-01-21  Miguel de Icaza  <miguel@ximian.com>
26718         * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
26719         need to make a copy of the variable to generate verifiable code.
26721 2002-01-19  Miguel de Icaza  <miguel@ximian.com>
26723         * driver.cs: Compute dynamically the system directory.
26725         * ecore.cs (CopyNewMethods): reworked, exposed, made public.
26726         Slower, but more generally useful.  Used by the abstract
26727         registering implementation. 
26729         * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
26730         the rules for the special rule on Type/instances.  First check if
26731         we have the same name, and if so, try that special static path
26732         rather than the instance path.
26734 2002-01-18  Miguel de Icaza  <miguel@ximian.com>
26736         * cs-parser.jay: Emit 642 (warning: possible empty statement) for
26737         for, while and if.
26739         * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
26740         Enum, ValueType, Delegate or Array for non-corlib compiles.
26742         * cs-tokenizer.cs: Catch long identifiers (645)
26744         * typemanager.cs (IndexerPropetyName): Ravi never tested this
26745         piece of code.
26747         * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
26748         fix, we were returning too early, so we were not registering
26749         pending methods from abstract classes.
26751         Do not register pending methods if the class is abstract.
26753         * expression.cs (Conditional.DoResolve): Report circular implicit
26754         conversions when we neecd to compute it for conditional
26755         expressions. 
26757         (Is.DoResolve): If the expression is always of the provided type,
26758         flag warning 183.  If the expression can not ever be of the
26759         provided type flag warning 184.
26761         * class.cs: Catch 169 as well.
26763         * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
26764         read. 
26766 2002-01-18  Nick Drochak  <ndrochak@gol.com>
26768         * makefile: remove path to beta2 csc.exe.  path to csc.exe must be in PATH instead.
26770 2002-01-17  Miguel de Icaza  <miguel@ximian.com>
26772         * interface.cs: (PopulateMethod): Check for pointers being defined
26773         only if the unsafe context is active.
26774         (PopulateProperty): ditto.
26775         (PopulateIndexer): ditto.
26777         * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
26778         specified.  If pointers are present, make sure that they are
26779         present in an unsafe context.
26780         (Constructor, Constructor.Define): ditto.
26781         (Field, Field.Define): ditto.
26782         (Property, Property.Define): ditto.
26783         (Event, Event.Define): ditto.
26785         * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
26786         hashtable if there are classes or structs defined.
26788         * expression.cs (LocalVariableReference.DoResolve): Simplify this
26789         code, as the constant resolution moved.
26791         * statement.cs (Block.EmitMeta): Resolve all constants as we emit
26792         the metadata, so we can flag error 133. 
26794         * decl.cs (MemberCore.UnsafeOK): New function to test that a
26795         pointer is being declared in an unsafe context.
26797 2002-01-16  Miguel de Icaza  <miguel@ximian.com>
26799         * modifiers.cs (Modifiers.Check): Require a Location argument.
26800         Report error 227 for Unsafe use.
26802         * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
26804         * statement.cs (For.Emit): If the test is null, then report that
26805         we do `return', as we wont reach anything afterwards.
26807         (Switch.SwitchGoverningType): Track the expression that matched
26808         the conversion.
26810         * driver.cs: Allow negative numbers as an error code to flag.
26812         * cs-parser.jay: Handle 1551.
26814         * namespace.cs: Add 1537 checking (repeated using alias namespaces).
26816 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
26818         * cs-parser.jay: Report 1518 (type declaration can only contain
26819         class, struct, interface, enum or delegate)
26821         (switch_label): Report 1523 (keywords `case' or `default' must
26822         preced code)
26824         (opt_switch_sections): Report 1522 (empty switch)
26826         * driver.cs: Report 1515 (response file specified multiple times)
26827         Report 1516 (Source file specified multiple times).
26829         * expression.cs (Argument.Resolve): Signal 1510
26831         (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
26832         access not allowed in static code)
26834 2002-01-11  Ravi Pratap  <ravi@ximian.com>
26836         * typemanager.cs (IsPointerType): Utility method which we are going
26837         to need a lot.
26839         * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
26840         the object type, so we take care of that.
26842         * expression.cs (FullMethodDesc): Also include the return type in descriptions.
26844         * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
26845         added to non-params parameters :-)
26847         * typemanager.cs (CSharpName): Include 'void' type too. 
26849         (void_ptr_type): Include in the set of core types.
26851         * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of 
26852         duplicating code.
26854         (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have 
26855         an unsafe context.
26857         * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had 
26858         completely forgotten about it.
26860 2002-01-10  Ravi Pratap  <ravi@ximian.com>
26862         * cs-parser.jay (pointer_type): Add. This begins our implementation
26863         of parsing rules for unsafe code.
26865         (unsafe_statement): Implement.
26867         (embedded_statement): Modify to include the above.
26869         * statement.cs (Unsafe): Implement new class for unsafe blocks.
26871         * codegen.cs (EmitContext.InUnsafe): Add. This determines
26872         if the current context is an unsafe one.
26874         * cs-parser.jay (local_variable_pointer_type): Since local variable types
26875         are handled differently, we need separate rules for them.
26877         (local_variable_declaration): Update to use local_variable_pointer_type
26878         to allow variable declarations of unmanaged pointer types.
26880         * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
26881         in unsafe contexts.
26883         * ../errors/cs0214.cs : Add.
26885 2002-01-16  Nick Drochak  <ndrochak@gol.com>
26887         * makefile: remove 'response' file when cleaning.
26889 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
26891         * cs-parser.jay: Report 1524.
26893 2002-01-14  Miguel de Icaza  <miguel@ximian.com>
26895         * typemanager.cs (RegisterMethod): drop checking if we have
26896         registered this from here
26898 2002-01-12  Miguel de Icaza  <miguel@ximian.com>
26900         * class.cs (Method.EmitDestructor): Implement calling our base
26901         destructor. 
26903         * statement.cs (Try.Emit): Fix to reset the InFinally to the old
26904         value of InFinally.
26906         * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
26907         this routine and will wrap the call in a try/catch block.  Deal
26908         with the case.
26910 2002-01-11  Miguel de Icaza  <miguel@ximian.com>
26912         * ecore.cs (Expression.MemberLookup): instead of taking a
26913         parameter `same_type' that was used to tell whether we could
26914         access private members we compute our containing type from the
26915         EmitContext.
26917         (FieldExpr): Added partial support for volatile fields.  This does
26918         not work for volatile fields exposed from assemblies, as I can not
26919         figure out how to extract the modreq from it.
26921         Updated all the source files to use this.
26923         * codegen.cs (EmitContext): Compute ContainerType ahead of time,
26924         because it is referenced by MemberLookup very often. 
26926 2002-01-09  Ravi Pratap  <ravi@ximian.com>
26928         * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
26929         TypeBuilder.GetCustomAttributes to retrieve what we need.
26931         Get rid of redundant default_member_attr_type as this is the same as
26932         default_member_type which already exists.
26934         * interface.cs, attribute.cs : Update accordingly.
26936 2002-01-08  Miguel de Icaza  <miguel@ximian.com>
26938         * typemanager.cs: Enable IndexerPropertyName again.  It does not
26939         work for TYpeBuilders though.  Ravi, can you please fix this?
26941         * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
26943         * expression.cs (Argument.Emit): Handle the case of ref objects
26944         being passed to ref functions;  
26946         (ParameterReference.EmitLoad): Loads the content of the pointer
26947         without dereferencing.
26949 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
26951         * cs-tokenizer.cs: Implemented the pre-processing expressions.
26953 2002-01-08  Ravi Pratap  <ravi@ximian.com>
26955         * class.cs (Indexer.DefineMethod): Incorporate the interface
26956         type in the name of the method if we are doing explicit interface
26957         implementation.
26959         * expression.cs (ConversionExists): Remove as it is completely obsolete.
26961         (BetterConversion): Fix extremely trivial bug where we were referring to
26962         ConversionExists instead of StandardConversionExists ! Hooray, things are fine
26963         again !
26965         * ../errors/bug16.cs : Add although we have fixed it.
26967 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
26969         * expression.cs (BaseIndexer): Begin implementation.
26971         * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
26973         * cs-parser.jay (indexer_declarator): Use qualified_identifier
26974         production directly to remove a shift/reduce, and implement
26975         explicit interface implementation.
26977         * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
26978         after a floating point suffix.
26980         * expression.cs (DoNumericPromotions): Improved the conversion for
26981         uint/uint.  If we have a constant, we avoid doing a typecast to a
26982         larger type.
26984         * class.cs (Indexer): Implement explicit interface implementation
26985         for indexers.
26987 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
26989         * class.cs: make the default instance constructor public and hidebysig.
26991 2001-01-03  Ravi Pratap  <ravi@ximian.com>
26993         * interface.cs (EmitDefaultMemberAttr): Make this helper method static
26994         so we can call it from elsewhere.
26996         * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
26997         we emit it internally if the class has a defined indexer; otherwise the user
26998         emits it by decorating the class definition with the DefaultMemberAttribute.
27000         * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
27001         attribute is not used on a type which defines an indexer.
27003         * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
27004         character when we skip whitespace.
27006         * ../errors/cs0646.cs : Add.
27008 2002-01-03  Miguel de Icaza  <miguel@ximian.com>
27010         * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
27011         again. 
27013         * makefile: Add practical target `mcs3.exe' which builds the third
27014         generation compiler. 
27016         * expression.cs (New): Fix structures constructor calling.
27018         * class.cs (Property, Method, Indexer): Emit Final flag on the
27019         method if we are an interface implementation and we are not
27020         abstract. 
27022         * ecore.cs (PropertyExpr): New public field `IsBase', tells
27023         whether this property is referencing a `base' method.
27025         * expression.cs (Invocation.EmitCall): take an extra argument:
27026         is_base, this is used to determine whether the `call' or
27027         `callvirt' opcode should be used.
27030         * delegate.cs: update EmitCall.
27032         * class.cs (Method.Define): Set NewSlot for the cases where we are
27033         not implementing an interface method.
27035         (Property.Define): ditto.
27037 2002-01-02  Miguel de Icaza  <miguel@ximian.com>
27039         * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
27040         'r'.  Allows mcs to parse itself fully.
27042 2002-01-02  Ravi Pratap  <ravi@ximian.com>
27044         * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
27045         of the number of initializers that require the InitializeArray method.
27047         (CheckIndices): Store the Expression in all cases - not the plain value. Also
27048         update the above field where necessary.
27050         (MakeByteBlob): Update accordingly.
27052         (DoEmit): Call EmitStaticInitializers only if the number of initializers is 
27053         greater than 2.
27055         (EmitDynamicInitializers): Update in accordance with the new optimization.
27057         (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
27058         same OpCode applies.
27060         * cs-parser.jay : Fix some glaring errors I introduced.
27062 2002-01-01  Ravi Pratap  <ravi@ximian.com> 
27064         * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
27065         so that we can check for name clashes there too.
27067         * typemanager.cs (default_member_attr_type): The attribute that we need to emit
27068         for interface indexers.
27070         * interfaces.cs (Define): Emit the default member attribute.
27072         * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
27073         variable was being referred to while setting the value ;-)
27075 2002-01-01  Miguel de Icaza  <miguel@ximian.com>
27077         * expression.cs (MakeByteBlob): Optimize: we do not need to fill
27078         byte-by-byte information when we know the data is zero.
27080         Make the block always a multiple of 4, because
27081         DefineInitializedData has a bug.
27083         * assign.cs: Fix, we should assign from the temporary, not from
27084         the source. 
27086         * expression.cs (MakeByteBlob): Fix my incorrect code.
27088 2001-12-31  Miguel de Icaza  <miguel@ximian.com>
27090         * typemanager.cs (EnumToUnderlying): This function is used to get
27091         the underlying type from an enumeration, because it does not
27092         always work. 
27094         * constant.cs: Use the I4_S form for values between -128 and 127.
27096         * statement.cs (Block.LookupLabel): Looks up a label.
27097         (Block): Drop support for labeled blocks.
27099         (LabeledStatement): New kind of statement that represents a label
27100         only.
27102         (Goto): Finally implement this bad boy.
27104         * cs-parser.jay: Update to reflect new mechanism to implement
27105         labels.
27107 2001-12-30  Miguel de Icaza  <miguel@ximian.com>
27109         * codegen.cs (EmitContext.This): a codegen property that keeps the
27110         a single instance of this instead of creating many different this
27111         instances. 
27113         * delegate.cs (Delegate.DoResolve): Update to use the property;
27115         * ecore.cs (SimpleName.SimpleNameResolve): Ditto
27117         * expression.cs (BaseAccess.DoResolve): Ditto.
27119 2001-12-29  Ravi Pratap  <ravi@ximian.com>
27121         * typemanager.cs (methodimpl_attr_type): Add to hold the type
27122         corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
27124         (InitCoreTypes): Update accordingly.
27126         * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
27127         so we can quickly store the state.
27129         (ApplyAttributes): Set the correct implementation flags
27130         for InternalCall methods.
27132 2001-12-29  Miguel de Icaza  <miguel@ximian.com>
27134         * expression.cs (EmitCall): if a method is not virtual, then do
27135         not use callvirt on it.
27137         (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
27138         user defined stuff) requires the use of stobj, which takes an
27139         address on the stack instead of an array and an index.  So emit
27140         the Ldelema operation for it.
27142         (EmitStoreOpcode): Use stobj for valuetypes.
27144         (UnaryMutator.EmitCode): Use the right 1 value depending on
27145         whether we are dealing with int64/uint64, float or doubles.
27147         * class.cs (TypeContainer.AddConstructor): Fix the logic to define
27148         constructors that I implemented last night.
27150         (Constructor.IsDefault): Fix to work properly for static
27151         constructors.
27153         * cs-parser.jay (CheckDef): report method signature errors.
27154         Update error number 103 to be 132.
27156         * decl.cs: New AdditionResult enumeration value: MethodExists.
27157         Although we do this check for methods later on in the semantic
27158         analysis, catching repeated default constructors is so easy that
27159         we catch these here. 
27161         * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
27162         promotions code.
27164         (ParameterReference.EmitAssign, Emit): handle
27165         bools as bytes.
27167         (ArrayAccess.EmitLoadOpcode): Handle bool type here.
27168         (ArrayAccess.EmitStoreOpcode): ditto.
27170         * cs-tokenizer.cs (is_punct): Eliminated empty computation.
27172         * expression.cs (MakeByteBlob): Complete all the missing types
27173         (uint, short, ushort, byte, sbyte)
27175         * class.cs: Only init instance field initializers on instance
27176         constructors. 
27178         Rename `constructors' to instance_constructors. 
27180         (TypeContainer.AddConstructor): Only add constructors to the list
27181         if it is not static.
27183         Make sure that we handle default_static_constructor independently
27184         everywhere where we handle instance_constructors
27186 2001-12-28  Miguel de Icaza  <miguel@ximian.com>
27188         * class.cs: Do not lookup or create a base initializer for a
27189         static constructor.
27191         (ConstructorInitializer.Resolve): use the proper type to lookup
27192         for constructors.
27194         * cs-parser.jay: Report error 1585 (modifiers between type and name).
27196         * enum.cs, interface.cs: Remove CloseType, this is taken care by
27197         in DeclSpace. 
27199         * decl.cs: CloseType is now an virtual method, the default
27200         implementation just closes this type.
27202 2001-12-28  Ravi Pratap  <ravi@ximian.com>
27204         * attribute.cs (DefinePInvokeMethod): Set the implementation flags
27205         to PreserveSig by default. Also emit HideBySig on such methods.
27207         Basically, set the defaults to standard values.
27209         * expression.cs (Invocation.BetterFunction): We need to make sure that for each
27210         argument, if candidate is better, it can't be worse than the best !
27212         (Invocation): Re-write bits to differentiate between methods being
27213         applicable in their expanded form and their normal form - for params
27214         methods of course.
27216         Get rid of use_standard everywhere as only standard conversions are allowed
27217         in overload resolution. 
27219         More spec conformance.
27221 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
27223         * driver.cs: Add --timestamp, to see where the compiler spends
27224         most of its time.
27226         * ecore.cs (SimpleName.DoResolve): Do not create an implicit
27227         `this' in static code.
27229         (SimpleName.DoResolve): Implement in terms of a helper function
27230         that allows static-references to be passed upstream to
27231         MemberAccess.
27233         (Expression.ResolveWithSimpleName): Resolve specially simple
27234         names when called by MemberAccess to implement the special
27235         semantics. 
27237         (Expression.ImplicitReferenceConversion): Handle conversions from
27238         Null to reference types before others, as Null's type is
27239         System.Object. 
27241         * expression.cs (Invocation.EmitCall): Handle the special case of
27242         calling methods declared on a reference type from a ValueType
27243         (Base classes System.Object and System.Enum)
27245         (MemberAccess.Resolve): Only perform lookups on Enumerations if
27246         the left hand side is a TypeExpr, not on every enumeration. 
27248         (Binary.Resolve): If types are reference types, then do a cast to
27249         object on operators != and == of both arguments.
27251         * typemanager.cs (FindMembers): Extract instance and static
27252         members if requested.
27254         * interface.cs (PopulateProperty): Use void_type instead of null
27255         as the return type for the setter method.
27257         (PopulateIndexer): ditto.
27259 2001-12-27  Ravi Pratap  <ravi@ximian.com>
27261         * support.cs (ReflectionParameters): Fix minor bug where we
27262         were examining the wrong parameter for the ParamArray attribute.
27264         Cope with requests for the type of the parameter at position
27265         greater than the params parameter's. We now return the element
27266         type of the params array as that makes more sense.
27268         * expression.cs (Invocation.IsParamsMethodApplicable): Update 
27269         accordingly as we no longer have to extract the element type
27270         ourselves.
27272         (Invocation.OverloadResolve): Update.
27274 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
27276         * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
27277         against IEnumerator, test whether the return value is a descendant
27278         of the IEnumerator interface.
27280         * class.cs (Indexer.Define): Use an auxiliary method to implement
27281         the other bits of the method definition.  Begin support for
27282         explicit interface implementation.
27284         (Property.DefineMethod): Use TypeManager.void_type instead of null
27285         for an empty return value.
27287 2001-12-26  Miguel de Icaza  <miguel@ximian.com>
27289         * expression.cs (MemberAccess.ResolveMemberAccess): if we are
27290         dealing with a FieldExpr which is composed of a FieldBuilder, in
27291         the code path we did extract the constant, but we should have
27292         obtained the underlying value to be able to cast it (otherwise we
27293         end up in an infinite loop, this is what Ravi was running into).
27295         (ArrayCreation.UpdateIndices): Arrays might be empty.
27297         (MemberAccess.ResolveMemberAccess): Add support for section
27298         14.5.4.1 that deals with the special case of E.I when E is a type
27299         and something else, that I can be a reference to a static member.
27301         (ArrayCreation.MakeByteBlob): It is not an error to not be able to
27302         handle a particular array type to create byte blobs, it is just
27303         something we dont generate byteblobs for.
27305         * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
27306         arguments. 
27308         * location.cs (Push): remove the key from the hashtable that we
27309         are about to add.   This happens for empty files.
27311         * driver.cs: Dispose files after we have parsed them.
27313         (tokenize): new function that only runs the tokenizer on its
27314         input, for speed testing.
27316 2001-12-26  Ravi Pratap  <ravi@ximian.com>
27318         * class.cs (Event.Define): Define the private field only if there
27319         are no accessors defined.
27321         * expression.cs (ResolveMemberAccess): If there is no associated
27322         field with the event, that means we have an event defined with its
27323         own accessors and we should flag error cs0070 since transforming
27324         ourselves into a field is not valid in that case.
27326         * ecore.cs (SimpleName.DoResolve): Same as above.
27328         * attribute.cs (DefinePInvokeMethod): Set the default calling convention
27329         and charset to sane values.
27331 2001-12-25  Ravi Pratap  <ravi@ximian.com>
27333         * assign.cs (DoResolve): Perform check on events only if they 
27334         are being accessed outside the declaring type.
27336         * cs-parser.jay (event_declarations): Update rules to correctly
27337         set the type of the implicit parameter etc.
27339         (add_accessor, remove_accessor): Set current local parameters.
27341         * expression.cs (Binary): For delegate addition and subtraction,
27342         cast the return value from the method into the appropriate delegate
27343         type.
27345 2001-12-24  Ravi Pratap  <ravi@ximian.com>
27347         * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
27348         of these as the workaround is unnecessary.
27350         * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
27351         delegate data - none of that is needed at all.
27353         Re-write bits to extract the instance expression and the delegate method
27354         correctly.
27356         * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator 
27357         on delegates too.
27359         * attribute.cs (ApplyAttributes): New method to take care of common tasks
27360         of attaching attributes instead of duplicating code everywhere.
27362         * everywhere : Update code to do attribute emission using the above method.
27364 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
27366         * expression.cs (IsParamsMethodApplicable): if there are not
27367         parameters, return immediately.
27369         * ecore.cs: The 0 literal can be implicity converted to an enum
27370         type. 
27372         (SimpleName.DoResolve): First lookup the type, then lookup the
27373         members. 
27375         (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
27376         want to get its address.  If the InstanceExpression is not
27377         addressable, store the result in a temporary variable, then get
27378         the address of it.
27380         * codegen.cs: Only display 219 errors on warning level or above. 
27382         * expression.cs (ArrayAccess): Make it implement the
27383         IMemoryLocation interface.
27385         (Binary.DoResolve): handle the operator == (object a, object b)
27386         and operator != (object a, object b) without incurring into a
27387         BoxedCast (because 5 != o should never be performed).
27389         Handle binary enumerator operators.
27391         (EmitLoadOpcode): Use Ldelema if the object we are loading is a
27392         value type, otherwise use Ldelem_ref.
27394         Use precomputed names;
27396         (AddressOf): Implement address of
27398         * cs-parser.jay (labeled_statement): Fix recursive block
27399         addition by reworking the production.
27401         * expression.cs (New.DoEmit): New has a special case:
27402                 
27403                  If we are dealing with a ValueType, we have a few
27404                  situations to deal with:
27405                 
27406                     * The target of New is a ValueType variable, that is
27407                       easy, we just pass this as the variable reference
27408                 
27409                     * The target of New is being passed as an argument,
27410                       to a boxing operation or a function that takes a
27411                       ValueType.
27412                 
27413                       In this case, we need to create a temporary variable
27414                       that is the argument of New.
27417 2001-12-23  Ravi Pratap  <ravi@ximian.com>
27419         * rootcontext.cs (LookupType): Check that current_type is not null before
27420         going about looking at nested types.
27422         * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
27423         not implement the IAssignMethod interface any more.
27425         * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
27426         where we tranform them into FieldExprs if they are being resolved from within
27427         the declaring type.
27429         * ecore.cs (SimpleName.DoResolve): Do the same here.
27431         * assign.cs (DoResolve, Emit): Clean up code considerably. 
27433         * ../errors/bug10.cs : Add.
27435         * ../errors/cs0070.cs : Add.
27437         * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
27439         * assign.cs : Get rid of EventIsLocal everywhere.
27441 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
27443         * ecore.cs (ConvertIntLiteral): finished the implementation.
27445         * statement.cs (SwitchLabel): Convert the value we are using as a
27446         key before looking up the table.
27448 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
27450         * codegen.cs (EmitTopBlock): Require a Location argument now.
27452         * cs-parser.jay (constructor_declarator): We need to setup
27453         current_local_parameters before we parse the
27454         opt_constructor_initializer, to allow the variables to be bound
27455         to the constructor arguments.
27457         * rootcontext.cs (LookupType): First lookup nested classes in our
27458         class and our parents before we go looking outside our class.
27460         * expression.cs (ConstantFold): Extract/debox the values at the
27461         beginnning. 
27463         * rootcontext.cs (EmitCode): Resolve the constants first before we
27464         resolve the types.  This is not really needed, but it helps debugging.
27466         * statement.cs: report location.
27468         * cs-parser.jay: pass location to throw statement.
27470         * driver.cs: Small bug fix.
27472         * report.cs: Updated format to be 4-zero filled digits.
27474 2001-12-22  Ravi Pratap  <ravi@ximian.com>
27476         * expression.cs (CheckIndices): Fix minor bug where the wrong
27477         variable was being referred to ;-)
27479         (DoEmit): Do not call EmitStaticInitializers when the 
27480         underlying type is System.Object.
27482 2001-12-21  Ravi Pratap  <ravi@ximian.com>
27484         * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
27485         and do the usual workaround for SRE.
27487         * class.cs (MyEventBuilder.EventType): New member to get at the type
27488         of the event, quickly.
27490         * expression.cs (Binary.ResolveOperator): Handle delegate addition.
27492         * assign.cs (Assign.DoResolve): Handle the case when the target
27493         is an EventExpr and perform the necessary checks.
27495         * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
27496         interface.
27498         (SimpleName.MemberStaticCheck): Include check for EventExpr.
27500         (EventExpr): Set the type in the constructor itself since we 
27501         are meant to be born fully resolved.
27503         (EventExpr.Define): Revert code I wrote earlier.
27504                 
27505         * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
27506         instance expression is null. The instance expression is a This in that case
27507         or a null, depending on whether it is a static method or not.
27509         Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
27510         refers to more than one method.
27512         * assign.cs (DoResolve): Check whether the event belongs to the same Type container
27513         and accordingly flag errors.
27515 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
27517         * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
27519 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
27521         * location.cs (ToString): Provide useful rutine.
27523 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
27525         * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
27526         objects, return the actual integral boxed.
27528         * statement.cs (SwitchLabel): define an ILLabel for each
27529         SwitchLabel. 
27531         (Switch.CheckSwitch): If the value is a Literal, extract
27532         the underlying literal.
27534         Also in the unused hashtable we had, add the SwitchLabel so we can
27535         quickly look this value up.
27537         * constant.cs: Implement a bunch of new constants.  Rewrite
27538         Literal based on this.  Made changes everywhere to adapt to this.
27540         * expression.cs (Expression.MakeByteBlob): Optimize routine by
27541         dereferencing array only once, and also copes with enumrations.
27543         bytes are two bytes wide, not one.
27545         (Cast): Perform constant conversions.
27547         * ecore.cs (TryImplicitIntConversion): Return literals instead of
27548         wrappers to the literals here.
27550         * expression.cs (DoNumericPromotions): long literals can converted
27551         to ulong implicity (this is taken care of elsewhere, but I was
27552         missing this spot).
27554         * ecore.cs (Expression.Literalize): Make the return type Literal,
27555         to improve type checking.
27557         * rootcontext.cs: Lookup for nested classes in our class hierarchy.
27559 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
27561         * literal.cs: Revert code from ravi that checked the bounds.  The
27562         bounds are sane by the definition of the type itself. 
27564         * typemanager.cs: Fix implementation of ImplementsInterface.  We
27565         need to actually look up in our parent hierarchy for interfaces
27566         implemented. 
27568         * const.cs: Use the underlying type for enumerations
27570         * delegate.cs: Compute the basename for the delegate creation,
27571         that should fix the delegate test case, and restore the correct
27572         Type Lookup semantics in rootcontext
27574         * rootcontext.cs: Revert Ravi's last patch.  The correct way of
27575         referencing a nested type with the Reflection API is using the "+"
27576         sign. 
27578         * cs-parser.jay: Do not require EOF token at the end.
27580 2001-12-20  Ravi Pratap  <ravi@ximian.com>
27582         * rootcontext.cs (LookupType): Concatenate type names with
27583         a '.' instead of a '+' The test suite passes again.
27585         * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
27586         field of the enumeration.
27588         * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
27589         the case when the member is an EventExpr.
27591         * ecore.cs (EventExpr.InstanceExpression): Every event which is not
27592         static has an associated instance expression.
27594         * typemanager.cs (RegisterEvent): The usual workaround, now for events.
27596         (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
27598         * class.cs (Event.Define): Register event and perform appropriate checks
27599         for error #111.
27601         We define the Add and Remove methods even if the use provides none because
27602         in that case, we provide default implementations ourselves.
27604         Define a private field of the type of the event. This is done by the CSC compiler
27605         and we should be doing it too ;-)
27607         * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
27608         More methods we use in code we generate.
27610         (multicast_delegate_type, delegate_type): Two separate types since the distinction
27611         is important.
27613         (InitCoreTypes): Update accordingly for the above.
27615         * class.cs (Event.Emit): Generate code for default accessors that we provide
27617         (EmitDefaultMethod): Do the job in the above.
27619         * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the 
27620         appropriate place.
27622 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
27624         * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
27625         builders even if we were missing one.
27627         * interface.cs, class.cs, enum.cs: When calling DefineNestedType
27628         pass the Basename as our class name instead of the Name.  The
27629         basename will be correctly composed for us.
27631         * parameter.cs (Paramters): Now takes a Location argument.
27633         * decl.cs (DeclSpace.LookupType): Removed convenience function and
27634         make all the code call directly LookupType in RootContext and take
27635         this chance to pass the Location information everywhere.
27637         * Everywhere: pass Location information.
27639 2001-12-19  Miguel de Icaza  <miguel@ximian.com>
27641         * class.cs (Constructor.Define): Updated way of detecting the
27642         length of the parameters.
27644         (TypeContainer.DefineType): Use basename as the type name for
27645         nested types.
27647         (TypeContainer.Define): Do not recursively define types here, as
27648         definition is taken care in order by the RootContext.
27650         * tree.cs: Keep track of namespaces in a per-file basis.
27652         * parameter.cs (Parameter.ComputeSignature): Update to use
27653         DeclSpace. 
27655         (Parameters.GetSignature): ditto.
27657         * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
27658         instead of a TypeContainer.
27660         (Interface.SemanticAnalysis): Use `this' instead of our parent to
27661         resolve names.  Because we need to be resolve in our context, not
27662         our parents.
27664         * driver.cs: Implement response files.
27666         * class.cs (TypeContainer.DefineType): If we are defined, do not
27667         redefine ourselves.
27669         (Event.Emit): Emit the code for add/remove handlers.
27670         (Event.Define): Save the MethodBuilders for add/remove.
27672         * typemanager.cs: Use pair here too.
27674         * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
27675         DictionaryEntry requires the first argument to be non-null.  
27677         (enum_declaration): Compute full name for registering the
27678         enumeration.
27680         (delegate_declaration): Instead of using
27681         formal_parameter_list, use opt_formal_parameter_list as the list
27682         can be empty.
27684         * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
27685         (EventParsing): New property that controls whether `add' and
27686         `remove' are returned as tokens or identifiers (for events);
27688 2001-12-19  Ravi Pratap  <ravi@ximian.com>
27690         * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
27691         use MyEventBuilder only and let it wrap the real builder for us.
27693         (MyEventBuilder): Revamp constructor etc.
27695         Implement all operations that we perform on EventBuilder in precisely the same
27696         way here too.
27698         (FindMembers): Update to use the EventBuilder member.
27700         (Event.Emit): Update accordingly.
27702 2001-12-18  Ravi Pratap  <ravi@ximian.com>
27704         * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
27705         by calling the appropriate methods.
27707         (GetCustomAttributes): Make stubs as they cannot possibly do anything
27708         useful.
27710         (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
27712 2001-12-17  Ravi Pratap  <ravi@ximian.com>
27714         * delegate.cs (Delegate.Populate): Check that the return type
27715         and various parameters types are indeed accessible.
27717         * class.cs (Constructor.Define): Same here.
27719         (Field.Define): Ditto.
27721         (Event.Define): Ditto.
27723         (Operator.Define): Check that the underlying Method defined itself
27724         correctly - so it's MethodBuilder should not be null.
27726         * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
27727         expression happens to be null.
27729         * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
27730         members but as of now we don't seem to be able to do anything really useful with it.
27732         (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
27733         not the EventBuilder.
27735 2001-12-18  Miguel de Icaza  <miguel@ximian.com>
27737         * cs-tokenizer.cs: Add support for defines.
27738         Add support for #if, #elif, #else, #endif
27740         (eval_var): evaluates a variable.
27741         (eval): stubbed for evaluating functions.
27743         * cs-parser.jay: Pass the defines information
27745         * driver.cs: Add --define command line option.
27747         * decl.cs: Move MemberCore here.
27749         Make it the base class for DeclSpace.  This allows us to catch and
27750         report 108 and 109 for everything now.
27752         * class.cs (TypeContainer.Define): Extract all the members
27753         before populating and emit the warning 108 (new keyword required
27754         to override) instead of having each member implement this.
27756         (MemberCore.Define): New abstract method, we will be using this in
27757         the warning reporting engine in Populate.
27759         (Operator.Define): Adjust to new MemberCore protocol. 
27761         * const.cs (Const): This does not derive from Expression, it is a
27762         temporary object we use to create fields, it is a MemberCore. 
27764         * class.cs (Method.Define): Allow the entry point to be in a
27765         specific class.
27767         * driver.cs: Rewrite the argument handler to clean it up a bit.
27769         * rootcontext.cs: Made it just an auxiliary namespace feature by
27770         making everything static.
27772         * driver.cs: Adapt code to use RootContext type name instead of
27773         instance variable.
27775         * delegate.cs: Remove RootContext argument.
27777         * class.cs: (Struct, TypeContainer, Class): Remove RootContext
27778         argument. 
27780         * class.cs (Event.Define): The lookup can fail.
27782         * cs-tokenizer.cs: Begin implementation of pre-procesor. 
27784         * expression.cs: Resolve the this instance before invoking the code.
27786 2001-12-17  Miguel de Icaza  <miguel@ximian.com>
27788         * cs-parser.jay: Add a production in element_access that allows
27789         the thing to become a "type" reference.  This way we can parse
27790         things like "(string [])" as a type.
27792         Note that this still does not handle the more complex rules of
27793         casts. 
27796         * delegate.cs (Delegate.Populate): Register the delegage constructor builder here. 
27798         * ecore.cs: (CopyNewMethods): new utility function used to
27799         assemble the list of methods from running FindMembers.
27801         (MemberLookup): Rework FindMembers so that 
27803 2001-12-16  Miguel de Icaza  <miguel@ximian.com>
27805         * class.cs (TypeContainer): Remove Delegates who fail to be
27806         defined.
27808         * delegate.cs (Populate): Verify that we dont get null return
27809         values.   TODO: Check for AsAccessible.
27811         * cs-parser.jay: Use basename to emit error 574 (destructor should
27812         have the same name as container class), not the full name.
27814         * cs-tokenizer.cs (adjust_int): Fit the integer in the best
27815         possible representation.  
27817         Also implements integer type suffixes U and L.
27819 2001-12-15  Miguel de Icaza  <miguel@ximian.com>
27821         * expression.cs (ArrayCreation.DoResolve): We need to do the
27822         argument resolution *always*.
27824         * decl.cs: Make this hold the namespace.  Hold the root context as
27825         well.
27826         (LookupType): Move here.
27828         * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
27830         * location.cs (Row, Name): Fixed the code, it was always returning
27831         references to the first file.
27833         * interface.cs: Register properties defined through interfaces.
27835         * driver.cs: Add support for globbing on the command line
27837         * class.cs (Field): Make it derive from MemberCore as well.
27838         (Event): ditto.
27840 2001-12-15  Ravi Pratap  <ravi@ximian.com>
27842         * class.cs (Event::Define): Check that the type of the event is a delegate
27843         type else flag error #66.
27845         Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
27846         same.
27848         * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
27849         values of EntryPoint, CharSet etc etc.
27851         Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
27853         * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
27854         be null and we should ignore this. I am not sure if this is really clean. Apparently,
27855         there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
27856         which needs this to do its work.
27858         * ../errors/cs0066.cs : Add.
27860 2001-12-14  Miguel de Icaza  <miguel@ximian.com>
27862         * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
27863         helper functions.
27865         * class.cs: (MethodSignature.MethodSignature): Removed hack that
27866         clears out the parameters field.
27867         (MemberSignatureCompare): Cleanup
27869         (MemberCore): New base class used to share code between MethodCore
27870         and Property.
27872         (RegisterRequiredImplementations) BindingFlags.Public requires
27873         either BindingFlags.Instace or Static.  Use instance here.
27875         (Property): Refactored code to cope better with the full spec.
27877         * parameter.cs (GetParameterInfo): Return an empty array instead
27878         of null on error.
27880         * class.cs (Property): Abstract or extern properties have no bodies.
27882         * parameter.cs (GetParameterInfo): return a zero-sized array.
27884         * class.cs (TypeContainer.MethodModifiersValid): Move all the
27885         method modifier validation to the typecontainer so we can reuse
27886         this on properties.
27888         (MethodCore.ParameterTypes): return an empty sized array of types.
27890         (Property.Define): Test property modifier validity.
27892         Add tests for sealed/override too.
27894         (Method.Emit): abstract or extern methods have no bodies.
27896 2001-12-14  Ravi Pratap  <ravi@ximian.com>
27898         * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
27899         thing.
27901         (Method::Define, ::Emit): Modify accordingly.
27903         * expression.cs (Invocation::OverloadResolve): Handle error # 121.
27905         (ArrayCreation::MakeByteBlob): Handle floats and doubles.
27907         * makefile: Pass in /unsafe.
27909 2001-12-13  Miguel de Icaza  <miguel@ximian.com>
27911         * class.cs (MakeKey): Kill routine.
27913         * class.cs (TypeContainer.Define): Correctly define explicit
27914         method implementations (they require the full interface name plus
27915         the method name).
27917         * typemanager.cs: Deply the PtrHashtable here and stop using the
27918         lame keys.  Things work so much better.
27920         This of course broke everyone who depended on `RegisterMethod' to
27921         do the `test for existance' test.  This has to be done elsewhere.
27923         * support.cs (PtrHashtable): A hashtable that avoid comparing with
27924         the object stupid Equals method (because, that like fails all over
27925         the place).  We still do not use it.
27927         * class.cs (TypeContainer.SetRequiredInterface,
27928         TypeContainer.RequireMethods): Killed these two routines and moved
27929         all the functionality to RegisterRequiredImplementations.
27931         (TypeContainer.RegisterRequiredImplementations): This routine now
27932         registers all the implementations required in an array for the
27933         interfaces and abstract methods.  We use an array of structures
27934         which can be computed ahead of time to reduce memory usage and we
27935         also assume that lookups are cheap as most classes will not
27936         implement too many interfaces.
27938         We also avoid creating too many MethodSignatures.
27940         (TypeContainer.IsInterfaceMethod): Update and optionally does not
27941         clear the "pending" bit if we find that there are problems with
27942         the declaration.
27944         (TypeContainer.VerifyPendingMethods): Update to report errors of
27945         methods that look like implementations but are not.
27947         (TypeContainer.Define): Add support for explicit interface method
27948         implementation. 
27950 2001-12-12  Miguel de Icaza  <miguel@ximian.com>
27952         * typemanager.cs: Keep track of the parameters here instead of
27953         being a feature of the TypeContainer.
27955         * class.cs: Drop the registration of parameters here, as
27956         InterfaceMethods are also interface declarations.
27958         * delegate.cs: Register methods with the TypeManager not only with
27959         the TypeContainer.  This code was buggy.
27961         * interface.cs: Full registation here.
27963 2001-12-11  Miguel de Icaza  <miguel@ximian.com>
27965         * expression.cs: Remove reducer for binary expressions, it can not
27966         be done this way.
27968         * const.cs: Put here the code that used to go into constant.cs
27970         * constant.cs: Put here the code for constants, this is a new base
27971         class for Literals.
27973         * literal.cs: Make Literal derive from Constant.
27975 2001-12-09  Miguel de Icaza  <miguel@ximian.com>
27977         * statement.cs (Return.Emit): Report error 157 if the user
27978         attempts to return from a finally block.
27980         (Return.Emit): Instead of emitting a return, jump to the end of
27981         the function.
27983         * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
27984         LocalBuilder to store the result of the function.  ReturnLabel is
27985         the target where we jump.
27988 2001-12-09  Radek Doulik  <rodo@ximian.com>
27990         * cs-parser.jay: remember alias in current namespace
27992         * ecore.cs (SimpleName::DoResolve): use aliases for types or
27993         namespaces
27995         * class.cs (LookupAlias): lookup alias in my_namespace
27997         * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
27998         aliases hashtable
27999         (LookupAlias): lookup alias in this and if needed in parent
28000         namespaces
28002 2001-12-08  Miguel de Icaza  <miguel@ximian.com>
28004         * support.cs: 
28006         * rootcontext.cs: (ModuleBuilder) Made static, first step into
28007         making things static.  I need this to avoid passing the
28008         TypeContainer when calling ParameterType.
28010         * support.cs (InternalParameters.ParameterType): Remove ugly hack
28011         that did string manipulation to compute the type and then call
28012         GetType.  Use Parameter.ParameterType instead.
28014         * cs-tokenizer.cs: Consume the suffix for floating values.
28016         * expression.cs (ParameterReference): figure out whether this is a
28017         reference parameter or not.  Kill an extra variable by computing
28018         the arg_idx during emission.
28020         * parameter.cs (Parameters.GetParameterInfo): New overloaded
28021         function that returns whether a parameter is an out/ref value or not.
28023         (Parameter.ParameterType): The type of the parameter (base,
28024         without ref/out applied).
28026         (Parameter.Resolve): Perform resolution here.
28027         (Parameter.ExternalType): The full type (with ref/out applied).
28029         * statement.cs (Using.Emit, Using.EmitExpression): Implement
28030         support for expressions on the using statement.
28032 2001-12-07  Miguel de Icaza  <miguel@ximian.com>
28034         * statement.cs (Using.EmitLocalVariableDecls): Split the
28035         localvariable handling of the using statement.
28037         (Block.EmitMeta): Keep track of variable count across blocks.  We
28038         were reusing slots on separate branches of blocks.
28040         (Try.Emit): Emit the general code block, we were not emitting it. 
28042         Check the type of the declaration to be an IDisposable or
28043         something that can be implicity converted to it. 
28045         Emit conversions if required.
28047         * ecore.cs (EmptyExpression): New utility class.
28048         (Expression.ImplicitConversionExists): New utility function.
28050 2001-12-06  Miguel de Icaza  <miguel@ximian.com>
28052         * statement.cs (Using): Implement.
28054         * expression.cs (LocalVariableReference): Support read only variables.
28056         * statement.cs: Remove the explicit emit for the Leave opcode.
28057         (VariableInfo): Add a readonly field.
28059 2001-12-05  Miguel de Icaza  <miguel@ximian.com>
28061         * ecore.cs (ConvCast): new class used to encapsulate the various
28062         explicit integer conversions that works in both checked and
28063         unchecked contexts.
28065         (Expression.ConvertNumericExplicit): Use new ConvCast class to
28066         properly generate the overflow opcodes.
28068 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
28070         * statement.cs: The correct type for the EmptyExpression is the
28071         element_type, not the variable type.  Ravi pointed this out.
28073 2001-12-04  Ravi Pratap  <ravi@ximian.com>
28075         * class.cs (Method::Define): Handle PInvoke methods specially
28076         by using DefinePInvokeMethod instead of the usual one.
28078         * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
28079         above to do the task of extracting information and defining the method.
28081 2001-12-04  Ravi Pratap  <ravi@ximian.com>
28083         * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
28084         of the condition for string type.
28086         (Emit): Move that here. 
28088         (ArrayCreation::CheckIndices): Keep string literals in their expression
28089         form.
28091         (EmitDynamicInitializers): Handle strings appropriately.
28093 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
28095         * codegen.cs (EmitContext): Replace multiple variables with a
28096         single pointer to the current Switch statement.
28098         * statement.cs (GotoDefault, Switch): Adjust to cleaned up
28099         EmitContext.
28101 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
28103         * statement.cs 
28105         * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
28106         default'.
28108         (Foreach.Emit): Foreach on arrays was not setting
28109         up the loop variables (for break/continue).
28111         (GotoCase): Semi-implented.
28113 2001-12-03  Ravi Pratap  <ravi@ximian.com>
28115         * attribute.cs (CheckAttribute): Handle system attributes by using
28116         Attribute.GetAttributes to examine information we need.
28118         (GetValidPlaces): Same here.
28120         * class.cs (Method::Define): Catch invalid use of extern and abstract together.
28122         * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
28124         * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
28126         (Method::Define): Set appropriate flags if we have a DllImport attribute.
28128         (Method::Emit): Handle the case when we are a PInvoke method.
28130 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
28132         * expression.cs: Use ResolveWithSimpleName on compound names.
28134 2001-12-02  Ravi Pratap  <ravi@ximian.com>
28136         * constant.cs (EmitConstant): Make sure we resolve the associated expression
28137         before trying to reduce it.
28139         * typemanager.cs (RegisterConstant, LookupConstant): Implement.
28141         * constant.cs (LookupConstantValue): Implement.
28143         (EmitConstant): Use the above in emitting the constant.
28145         * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
28146         that are user-defined by doing a LookupConstantValue on them.
28148         (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
28149         too, like above.
28151 2001-11-29  Miguel de Icaza  <miguel@ximian.com>
28153         * expression.cs (BaseAccess, BaseIndexer): Also split this out.
28155         (BaseAccess.DoResolve): Implement.
28157         (MemberAccess.DoResolve): Split this routine into a
28158         ResolveMemberAccess routine that can be used independently
28160 2001-11-28  Miguel de Icaza  <miguel@ximian.com>
28162         * expression.cs (Probe, Is, As): Split Probe in two classes Is and
28163         As that share bits of the implementation.  Is returns a boolean,
28164         while As returns the Type that is being probed.
28166 2001-12-01  Ravi Pratap  <ravi@ximian.com>
28168         * enum.cs (LookupEnumValue): Re-write various bits, return an object value
28169         instead of a Literal - much easier.
28171         (EnumInTransit): Remove - utterly useless :-)
28173         (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
28175         * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
28177         * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
28178         chain when we have no associated expression.
28180 2001-11-30  Ravi Pratap  <ravi@ximian.com>
28182         * constant.cs (Define): Use Location while reporting the errror.
28184         Also emit a warning when 'new' is used and there is no inherited
28185         member to hide.
28187         * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being 
28188         populated.
28190         (LookupEnumValue): Implement to lookup an enum member's value and define it
28191         if necessary.
28193         (Populate): Re-write accordingly to use the above routine.
28195 2001-11-27  Miguel de Icaza  <miguel@ximian.com>
28197         * expression.cs (This): Fix prototype for DoResolveLValue to
28198         override the base class DoResolveLValue.
28200         * cs-parser.cs: Report errors cs574 and cs575 (destructor
28201         declarations) 
28203         * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
28204         (we need to load the address of the field here).  This fixes
28205         test-22. 
28207         (FieldExpr.DoResolveLValue): Call the DoResolve
28208         function to initialize the Instance expression.
28210         * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
28211         correctly the GetEnumerator operation on a value type.
28213         * cs-parser.jay: Add more simple parsing error catches.
28215         * statement.cs (Switch): Add support for string switches.
28216         Handle null specially.
28218         * literal.cs (NullLiteral): Make NullLiteral objects singletons. 
28220 2001-11-28  Ravi Pratap  <ravi@ximian.com>
28222         * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
28224         (declare_local_constant): New helper function.
28226         * statement.cs (AddConstant): Keep a separate record of constants
28228         (IsConstant): Implement to determine if a variable is a constant.
28230         (GetConstantExpression): Implement.
28232         * expression.cs (LocalVariableReference): Handle the case when it is a constant.
28234         * statement.cs (IsVariableDefined): Re-write.
28236 2001-11-27  Ravi Pratap  <ravi@ximian.com>
28238         * class.cs (TypeContainer::FindMembers): Look for constants
28239         in the case when we are looking for MemberTypes.Field
28241         * expression.cs (MemberAccess::DoResolve): Check that in the
28242         case we are a FieldExpr and a Literal, we are not being accessed
28243         by an instance reference.
28245         * cs-parser.jay (local_constant_declaration): Implement.
28247         (declaration_statement): Implement for constant declarations.
28249 2001-11-26  Miguel de Icaza  <miguel@ximian.com>
28251         * statement.cs (Switch): Catch double defaults.
28253         (Switch): More work on the switch() statement
28254         implementation.  It works for integral values now, need to finish
28255         string support.
28258 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
28260         * ecore.cs (Expression.ConvertIntLiteral): New function to convert
28261         integer literals into other integer literals.  To be used by
28262         switch. 
28264 2001-11-24  Ravi Pratap  <ravi@ximian.com>
28266         * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
28267         some memory.
28269         (EmitDynamicInitializers): Cope with the above since we extract data
28270         directly from ArrayData now.
28272         (ExpectInitializers): Keep track of whether initializers are mandatory
28273         or not.
28275         (Bounds): Make it a hashtable to prevent the same dimension being 
28276         recorded for every element in that dimension.
28278         (EmitDynamicInitializers): Fix bug which prevented the Set array method
28279         from being found.
28281         Also fix bug which was causing the indices to be emitted in the reverse
28282         order.
28284 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
28286         * expression.cs (ArrayCreation): Implement the bits that Ravi left
28287         unfinished.  They do not work, because the underlying code is
28288         sloppy.
28290 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
28292         * cs-parser.jay: Remove bogus fixme.
28294         * statement.cs (Switch, SwitchSection, SwithLabel): Started work
28295         on Switch statement.
28297 2001-11-23  Ravi Pratap  <ravi@ximian.com>
28299         * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
28300         the same. 
28302         * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
28303         parameter. Apparently, any expression is allowed. 
28305         (ValidateInitializers): Update accordingly.
28307         (CheckIndices): Fix some tricky bugs thanks to recursion.
28309         * delegate.cs (NewDelegate::DoResolve): Re-write large portions as 
28310         I was being completely brain-dead.
28312         (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
28313         and re-write acordingly.
28315         (DelegateInvocation): Re-write accordingly.
28317         * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
28319         (MakeByteBlob): Handle types more correctly.
28321         * expression.cs (ArrayCreation:Emit): Write preliminary code to do
28322         initialization from expressions but it is incomplete because I am a complete
28323         Dodo :-|
28325 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
28327         * statement.cs (If.Emit): Fix a bug that generated incorrect code
28328         on If.  Basically, we have to return `true' (ie, we do return to
28329         our caller) only if both branches of the if return.
28331         * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
28332         short-circuit operators, handle them as short circuit operators. 
28334         (Cast.DoResolve): Resolve type.
28335         (Cast.Cast): Take an expression as the target type.
28337         * cs-parser.jay (cast_expression): Remove old hack that only
28338         allowed a limited set of types to be handled.  Now we take a
28339         unary_expression and we resolve to a type during semantic
28340         analysis.
28342         Use the grammar productions from Rhys to handle casts (this is
28343         not complete like Rhys syntax yet, we fail to handle that corner
28344         case that C# has regarding (-x), but we will get there.
28346 2001-11-22  Ravi Pratap  <ravi@ximian.com>
28348         * class.cs (EmitFieldInitializer): Take care of the case when we have a
28349         field which is an array type.
28351         * cs-parser.jay (declare_local_variables): Support array initialization too.
28353         * typemanager.cs (MakeKey): Implement.
28355         (everywhere): Use the above appropriately.
28357         * cs-parser.jay (for_statement): Update for array initialization while
28358         declaring variables.
28360         * ecore.cs : The error message was correct, it's the variable's names that
28361         were misleading ;-) Make the code more readable.
28363         (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
28364         the correct type etc.
28366         (ConvertExplicit): Handle Enum types by examining the underlying type.
28368 2001-11-21  Ravi Pratap  <ravi@ximian.com>
28370         * parameter.cs (GetCallingConvention): Always return
28371         CallingConventions.Standard for now.
28373 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
28375         * expression.cs (Binary.ResolveOperator): Update the values of `l'
28376         and `r' after calling DoNumericPromotions.
28378         * ecore.cs: Fix error message (the types were in the wrong order).
28380         * statement.cs (Foreach.ProbeCollectionType): Need to pass
28381         BindingFlags.Instance as well 
28383         * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
28384         implicit int literal conversion in an empty cast so that we
28385         propagate the right type upstream.
28387         (UnboxCast): new class used to unbox value types.
28388         (Expression.ConvertExplicit): Add explicit type conversions done
28389         by unboxing.
28391         (Expression.ImplicitNumericConversion): Oops, forgot to test for
28392         the target type before applying the implicit LongLiterals to ULong
28393         literal cast.
28395 2001-11-21  Miguel de Icaza  <miguel@ximian.com>
28397         * cs-parser.jay (for_statement): Reworked the way For works: now
28398         we declare manually any variables that are introduced in
28399         for_initializer to solve the problem of having out-of-band code
28400         emition (that is what got for broken).
28402         (declaration_statement): Perform the actual variable declaration
28403         that used to be done in local_variable_declaration here.
28405         (local_variable_declaration): Do not declare anything, just pass
28406         the information on a DictionaryEntry
28408 2001-11-20  Ravi Pratap  <ravi@ximian.com>
28410         * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
28411         re-write of the logic to now make it recursive.
28413         (UpdateIndices): Re-write accordingly.
28415         Store element data in a separate ArrayData list in the above methods.
28417         (MakeByteBlob): Implement to dump the array data into a byte array.
28419 2001-11-19  Ravi Pratap  <ravi@ximian.com>
28421         * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
28422         into CheckIndices.
28424         * constant.cs (Define): Implement.
28426         (EmitConstant): Re-write fully.
28428         Pass in location info.
28430         * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
28431         respectively.
28433         * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
28434         DictionaryEntry since we need location info too.
28436         (constant_declaration): Update accordingly.
28438         * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
28439         code into another method : UpdateIndices.
28441 2001-11-18  Ravi Pratap  <ravi@ximian.com>
28443         * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
28444         some type checking etc.
28446 2001-11-17  Ravi Pratap  <ravi@ximian.com>
28448         * expression.cs (ArrayCreation::ValidateInitializers): Implement
28449         bits to provide dimension info if the user skips doing that.
28451         Update second constructor to store the rank correctly.
28453 2001-11-16  Ravi Pratap  <ravi@ximian.com>
28455         * expression.cs (ArrayCreation::ValidateInitializers): Poke around
28456         and try to implement.
28458         * ../errors/cs0150.cs : Add.
28460         * ../errors/cs0178.cs : Add.
28462 2001-11-16  Miguel de Icaza  <miguel@ximian.com>
28464         * statement.cs: Implement foreach on multi-dimensional arrays. 
28466         * parameter.cs (Parameters.GetParameterByName): Also lookup the
28467         name of the params argument.
28469         * expression.cs: Use EmitStoreOpcode to get the right opcode while
28470         initializing the array.
28472         (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
28473         we can use this elsewhere.
28475         * statement.cs: Finish implementation of foreach for single
28476         dimension arrays.
28478         * cs-parser.jay: Use an out-of-band stack to pass information
28479         around, I wonder why I need this.
28481         foreach_block: Make the new foreach_block the current_block.
28483         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
28484         function used to return a static Parameters structure.  Used for
28485         empty parameters, as those are created very frequently.
28487         * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
28489 2001-11-15  Ravi Pratap  <ravi@ximian.com>
28491         * interface.cs : Default modifier is private, not public. The
28492         make verify test passes again.
28494 2001-11-15  Ravi Pratap  <ravi@ximian.com>
28496         * support.cs (ReflectionParameters): Fix logic to determine
28497         whether the last parameter is a params one. Test 9 passes again.
28499         * delegate.cs (Populate): Register the builders we define with
28500         RegisterParameterForBuilder. Test 19 passes again.
28502         * cs-parser.jay (property_declaration): Reference $6 instead
28503         of $$ to get at the location.
28505         (indexer_declaration): Similar stuff.
28507         (attribute): Ditto.
28509         * class.cs (Property): Register parameters for the Get and Set methods
28510         if they exist. Test 23 passes again.
28512         * expression.cs (ArrayCreation::Emit): Pass null for the method in the
28513         call to EmitArguments as we are sure there aren't any params arguments. 
28514         Test 32 passes again.
28516         * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
28517         IndexOutOfRangeException. 
28519         * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
28520         Test 33 now passes again.
28522 2001-11-15  Miguel de Icaza  <miguel@ximian.com>
28524         * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
28525         broke a bunch of things.  Will have to come up with a better way
28526         of tracking locations.
28528         * statement.cs: Implemented foreach for single dimension arrays.
28530 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
28532         * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
28533         an error.  This removes the lookup from the critical path.
28535         * cs-parser.jay: Removed use of temporary_loc, which is completely
28536         broken. 
28538 2001-11-14  Miguel de Icaza  <miguel@ximian.com>
28540         * support.cs (ReflectionParameters.ParameterModifier): Report
28541         whether the argument is a PARAMS argument or not.
28543         * class.cs: Set the attribute `ParamArrayAttribute' on the
28544         parameter argument.
28546         * typemanager.cs: Define param_array_type (ParamArrayAttribute)
28547         and cons_param_array_attribute (ConstructorInfo for
28548         ParamArrayAttribute)., 
28550         * codegen.cs: Emit the return using the `Return' statement, that
28551         way we can report the error correctly for missing return values. 
28553         * class.cs (Method.Emit): Clean up.
28555         * expression.cs (Argument.Resolve): Take another argument: the
28556         location where this argument is used.  Notice that this is not
28557         part of the "Argument" class as to reduce the size of the
28558         structure (we know the approximate location anyways).
28560         Test if the argument is a variable-reference, if not, then
28561         complain with a 206.
28563         (Argument.Emit): Emit addresses of variables.
28565         (Argument.FullDesc): Simplify.
28567         (Invocation.DoResolve): Update for Argument.Resolve.
28569         (ElementAccess.DoResolve): ditto.
28571         * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
28572         method should be virtual, as this method is always virtual.
28574         (NewDelegate.DoResolve): Update for Argument.Resolve.
28576         * class.cs (ConstructorInitializer.DoResolve): ditto.
28578         * attribute.cs (Attribute.Resolve): ditto.
28580 2001-11-13  Miguel de Icaza  <miguel@ximian.com>
28582         * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
28584         * expression.cs (ParameterReference): Drop IStackStorage and implement
28585         IAssignMethod instead. 
28587         (LocalVariableReference): ditto.
28589         * ecore.cs (FieldExpr): Drop IStackStorage and implement
28590         IAssignMethod instead. 
28592 2001-11-13  Miguel de Icaza <miguel@ximian.com>
28594         * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
28595         enumerations that are used in heavily used structures derive from
28596         byte in a laughable and pathetic attempt to reduce memory usage.
28597         This is the kind of pre-optimzations that you should not do at
28598         home without adult supervision.
28600         * expression.cs (UnaryMutator): New class, used to handle ++ and
28601         -- separatedly from the other unary operators.  Cleans up the
28602         code, and kills the ExpressionStatement dependency in Unary.
28604         (Unary): Removed `method' and `Arguments' from this class, making
28605         it smaller, and moving it all to SimpleCall, so I can reuse this
28606         code in other locations and avoid creating a lot of transient data
28607         strucutres when not required.
28609         * cs-parser.jay: Adjust for new changes.
28611 2001-11-11  Miguel de Icaza  <miguel@ximian.com>
28613         * enum.cs (Enum.Populate): If there is a failure during
28614         definition, return
28616         * cs-parser.jay (opt_enum_base): we used to catch type errors
28617         here, but this is really incorrect.  The type error should be
28618         catched during semantic analysis.
28620 2001-12-11  Ravi Pratap  <ravi@ximian.com>
28622         * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
28623         current_local_parameters as expected since I, in my stupidity, had forgotten
28624         to do this :-)
28626         * attribute.cs (GetValidPlaces): Fix stupid bug.
28628         * class.cs (Method::Emit): Perform check on applicability of attributes.
28630         (Constructor::Emit): Ditto.
28632         (Field::Emit): Ditto.
28634         (Field.Location): Store location information.
28636         (Property, Event, Indexer, Operator): Ditto.
28638         * cs-parser.jay (field_declaration): Pass in location for each field.
28640         * ../errors/cs0592.cs : Add.
28642 2001-11-12  Ravi Pratap  <ravi@ximian.com>
28644         * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
28646         (InitCoreTypes): Update accordingly.
28648         (RegisterAttrType, LookupAttr): Implement.
28650         * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
28651         info about the same.
28653         (Resolve): Update to populate the above as necessary.
28655         (Error592): Helper.
28657         (GetValidPlaces): Helper to the above.
28659         (CheckAttribute): Implement to perform validity of attributes on declarative elements.
28661         * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
28663 2001-11-12  Ravi Pratap  <ravi@ximian.com>
28665         * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
28667         * ../errors/cs0617.cs : Add.
28669 2001-11-11  Ravi Pratap  <ravi@ximian.com>
28671         * enum.cs (Emit): Rename to Populate to be more consistent with what
28672         we expect it to do and when exactly it is called.
28674         * class.cs, rootcontext.cs : Update accordingly.
28676         * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
28677         FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
28679         * enum.cs (Populate): Register fields with TypeManager.RegisterField.
28681         * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
28682         of a fieldinfo using the above, when dealing with a FieldBuilder.
28684 2001-11-10  Ravi Pratap  <ravi@ximian.com>
28686         * ../errors/cs0031.cs : Add.
28688         * ../errors/cs1008.cs : Add.
28690         * ../errrors/cs0543.cs : Add.
28692         * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
28693         enum type.
28695         (FindMembers): Implement.
28697         * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
28698         enums and delegates too.
28700         (enum_types): Rename to builder_to_enum.
28702         (delegate_types): Rename to builder_to_delegate.
28704         * delegate.cs (FindMembers): Implement.
28706 2001-11-09  Ravi Pratap  <ravi@ximian.com>
28708         * typemanager.cs (IsEnumType): Implement.
28710         * enum.cs (Emit): Re-write parts to account for the underlying type
28711         better and perform checking etc.
28713         (GetNextDefaultValue): Helper to ensure we don't overshoot max value
28714         of the underlying type.
28716         * literal.cs (GetValue methods everywhere): Perform bounds checking and return
28717         value
28719         * enum.cs (error31): Helper to report error #31.
28721         * cs-parser.jay (enum_declaration): Store location of each member too.
28723         * enum.cs (member_to_location): New hashtable. 
28725         (AddEnumMember): Update location hashtable.
28727         (Emit): Use the location of each member while reporting errors.
28729 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
28731         * cs-parser.jay: A for_initializer if is a
28732         local_variable_declaration really ammount to have an implicit
28733         block with the variable declaration and no initializer for for.
28735         * statement.cs (For.Emit): Cope with null initializers.
28737         This fixes the infinite loop on for initializers.
28739 2001-11-08  Miguel de Icaza  <miguel@ximian.com>
28741         * enum.cs: More cleanup.
28743         * ecore.cs: Remove dead code.
28745         * class.cs (Property.Emit): More simplification.
28746         (Event.Emit): ditto.
28748         Reworked to have less levels of indentation.
28750 2001-11-08  Ravi Pratap  <ravi@ximian.com>
28752         * class.cs (Property): Emit attributes.
28754         (Field): Ditto.
28756         (Event): Ditto.
28758         (Indexer): Ditto.
28760         (Operator): Ditto.
28762         * enum.cs (Emit): Ditto.
28764         * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
28765         Enums too.
28767         * class.cs (Field, Event, etc.): Move attribute generation into the
28768         Emit method everywhere.
28770         * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
28771         we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
28772         as we had no way of defining nested enums !
28774         * rootcontext.cs : Adjust code accordingly.
28776         * typemanager.cs (AddEnumType): To keep track of enum types separately.
28778 2001-11-07  Ravi Pratap  <ravi@ximian.com>
28780         * expression.cs (EvalConstantExpression): Move into ecore.cs
28782         * enum.cs (Enum): Rename some members and make them public and readonly
28783         according to our convention.
28785         * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
28786         nothing else.
28788         * enum.cs (Enum::Define): Use the above instead of TypeAttr.
28790         (Enum::Emit): Write a simple version for now which doesn't try to compute
28791         expressions. I shall modify this to be more robust in just a while.
28793         * class.cs (TypeContainer::Emit): Make sure we include Enums too.
28795         (TypeContainer::CloseType): Create the Enum types too.
28797         * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
28799         * expression.cs (EvalConstantExpression): Get rid of completely.
28801         * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
28802         user-defined values and other cases.
28804         (IsValidEnumLiteral): Helper function.
28806         * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing 
28807         out there in the case we had a literal FieldExpr.
28809         (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
28811         (Literalize): Revamp a bit to take two arguments.
28813         (EnumLiteral): New class which derives from Literal to wrap enum literals.
28815 2001-11-06  Ravi Pratap  <ravi@ximian.com>
28817         * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
28819         * expression.cs (ArrayCreation::ValidateInitializers): Implement.
28821         (Resolve): Use the above to ensure we have proper initializers.
28823 2001-11-05  Ravi Pratap  <ravi@ximian.com>
28825         * expression.cs (Expression::EvalConstantExpression): New method to 
28826         evaluate constant expressions.
28828         * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
28830 2001-11-07  Miguel de Icaza  <miguel@ximian.com>
28832         * expression.cs (ArrayCreation.Emit): Some bits to initialize data
28833         in an array.
28835         (Binary.ResolveOperator): Handle operator != (object a, object b)
28836         and operator == (object a, object b);
28838         (Binary.DoNumericPromotions): Indicate whether the numeric
28839         promotion was possible.
28841         (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
28842         Implement.  
28844         Made the ArrayAccess implement interface IAssignMethod instead of
28845         IStackStore as the order in which arguments are passed reflects
28846         this.
28848         * assign.cs: Instead of using expr.ExprClass to select the way of
28849         assinging, probe for the IStackStore/IAssignMethod interfaces.
28851         * typemanager.cs: Load InitializeArray definition.
28853         * rootcontext.cs (RootContext.MakeStaticData): Used to define
28854         static data that can be used to initialize arrays. 
28856 2001-11-05  Miguel de Icaza  <miguel@ximian.com>
28858         * expression.cs: Handle operator== and operator!= for booleans.
28860         (Conditioal.Reduce): Implement reducer for the ?: operator.
28862         (Conditional.Resolve): Implement dead code elimination.
28864         (Binary.Resolve): Catch string literals and return a new
28865         concatenated string.
28867         (Unary.Reduce): Implement reduction of unary expressions.
28869         * ecore.cs: Split out the expression core handling here.
28871         (Expression.Reduce): New method used to perform constant folding
28872         and CSE.  This is needed to support constant-expressions. 
28874         * statement.cs (Statement.EmitBoolExpression): Pass true and false
28875         targets, and optimize for !x.
28877 2001-11-04  Ravi Pratap  <ravi@ximian.com>
28879         * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
28880         of an attribute gives us a CustomAttributeBuilder which we use accordingly to
28881         set custom atttributes.
28883         * literal.cs (Literal::GetValue): New abstract method to return the actual
28884         value of the literal, cast as an object.
28886         (*Literal): Implement GetValue method.
28888         * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
28889         expressions to the arraylist but objects of type Argument.
28891         * class.cs (TypeContainer::Emit): Emit our attributes too.
28893         (Method::Emit, Constructor::Emit): Ditto.
28895         * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
28896         to be ignoring earlier.
28898 2001-11-03  Ravi Pratap  <ravi@ximian.com>
28900         * attribute.cs (AttributeSection::Define): Implement to do the business
28901         of constructing a CustomAttributeBuilder.
28903         (Attribute): New trivial class. Increases readability of code.  
28905         * cs-parser.jay : Update accordingly.
28907         (positional_argument_list, named_argument_list, named_argument): New rules
28909         (attribute_arguments): Use the above so that we are more correct.
28911 2001-11-02  Ravi Pratap  <ravi@ximian.com>
28913         * expression.cs (Invocation::IsParamsMethodApplicable): Implement
28914         to perform all checks for a method with a params parameter.
28916         (Invocation::OverloadResolve): Update to use the above method and therefore
28917         cope correctly with params method invocations.
28919         * support.cs (InternalParameters::ParameterDesc): Provide a desc for 
28920         params too.
28922         * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
28923         constructors in our parent too because we can't afford to miss out on 
28924         protected ones ;-)
28926         * attribute.cs (AttributeSection): New name for the class Attribute
28928         Other trivial changes to improve readability.
28930         * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
28931         use the new class names.
28933 2001-11-01  Ravi Pratap  <ravi@ximian.com>
28935         * class.cs (Method::Define): Complete definition for params types too
28937         (Indexer::Define): Ditto.
28939         * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
28940         Cope everywhere with a request for info about the array parameter.
28942 2001-11-01  Ravi Pratap  <ravi@ximian.com>
28944         * tree.cs (RecordNamespace): Fix up to check for the correct key.
28946         * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in 
28947         local_variable_type to extract the string corresponding to the type.
28949         (local_variable_type): Fixup the action to use the new helper method.
28951         * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to 
28952         go.
28954         * expression.cs : Clean out code which uses the above.
28956 2001-10-31  Ravi Pratap  <ravi@ximian.com>
28958         * typemanager.cs (RegisterMethod): Check if we already have an existing key
28959         and bale out if necessary by returning a false.
28961         (RegisterProperty): Ditto.
28963         * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
28964         and print out appropriate error messages.
28966         * interface.cs (everywhere): Ditto.
28968         * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
28969         location to constructor.
28971         * class.cs (Property, Event, Indexer): Update accordingly.
28973         * ../errors/cs111.cs : Added.
28975         * expression.cs (Invocation::IsApplicable): New static method to determine applicability
28976         of a method, as laid down by the spec.
28978         (Invocation::OverloadResolve): Use the above method.
28980 2001-10-31  Ravi Pratap  <ravi@ximian.com>
28982         * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
28983         now take a TypeContainer and a Parameters object.
28985         (ParameterData): Modify return type of ParameterModifier method to be 
28986         Parameter.Modifier and not a string.
28988         (ReflectionParameters, InternalParameters): Update accordingly.
28990         * expression.cs (Argument::GetParameterModifier): Same here.
28992         * support.cs (InternalParameters::ParameterType): Find a better way of determining
28993         if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
28994         symbol in it at all so maybe this is only for now.
28996 2001-10-30  Ravi Pratap  <ravi@ximian.com>
28998         * support.cs (InternalParameters): Constructor now takes an extra argument 
28999         which is the actual Parameters class.
29001         (ParameterDesc): Update to provide info on ref/out modifiers.
29003         * class.cs (everywhere): Update call to InternalParameters to pass in
29004         the second argument too.
29006         * support.cs (ParameterData): Add ParameterModifier, which is a method 
29007         to return the modifier info [ref/out etc]
29009         (InternalParameters, ReflectionParameters): Implement the above.
29011         * expression.cs (Argument::ParameterModifier): Similar function to return
29012         info about the argument's modifiers.
29014         (Invocation::OverloadResolve): Update to take into account matching modifiers 
29015         too.
29017         * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
29018         a new SetFormalParameters object which we pass to InternalParameters.
29020 2001-10-30  Ravi Pratap  <ravi@ximian.com>
29022         * expression.cs (NewArray): Merge into the ArrayCreation class.
29024 2001-10-29  Ravi Pratap  <ravi@ximian.com>
29026         * expression.cs (NewArray): Merge classes NewBuiltinArray and 
29027         NewUserdefinedArray into one as there wasn't much of a use in having
29028         two separate ones.
29030         * expression.cs (Argument): Change field's name to ArgType from Type.
29032         (Type): New readonly property which returns the proper type, taking into 
29033         account ref/out modifiers.
29035         (everywhere): Adjust code accordingly for the above.
29037         * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
29038         whether we are emitting for a ref or out parameter.
29040         * expression.cs (Argument::Emit): Use the above field to set the state.
29042         (LocalVariableReference::Emit): Update to honour the flag and emit the
29043         right stuff.
29045         * parameter.cs (Attributes): Set the correct flags for ref parameters.
29047         * expression.cs (Argument::FullDesc): New function to provide a full desc.
29049         * support.cs (ParameterData): Add method ParameterDesc to the interface.
29051         (ReflectionParameters, InternalParameters): Implement the above method.
29053         * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
29054         reporting errors.
29056         (Invocation::FullMethodDesc): Ditto. 
29058 2001-10-29  Miguel de Icaza  <miguel@ximian.com>
29060         * cs-parser.jay: Add extra production for the second form of array
29061         creation. 
29063         * expression.cs (ArrayCreation): Update to reflect the above
29064         change. 
29066         * Small changes to prepare for Array initialization.
29068 2001-10-28  Miguel de Icaza  <miguel@ximian.com>
29070         * typemanager.cs (ImplementsInterface): interface might be null;
29071         Deal with this problem;
29073         Also, we do store negative hits on the cache (null values), so use
29074         this instead of calling t.GetInterfaces on the type everytime.
29076 2001-10-28  Ravi Pratap  <ravi@ximian.com>
29078         * typemanager.cs (IsBuiltinType): New method to help determine the same.
29080         * expression.cs (New::DoResolve): Get rid of array creation code and instead
29081         split functionality out into different classes.
29083         (New::FormArrayType): Move into NewBuiltinArray.
29085         (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
29086         quite useless.
29088         (NewBuiltinArray): New class to handle creation of built-in arrays.
29090         (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
29091         account creation of one-dimensional arrays.
29093         (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
29095         (NewUserdefinedArray::DoResolve): Implement.
29097         * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
29099         * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
29100         we maintain inside the TypeManager. This is necessary to perform lookups on the
29101         module builder.
29103         (LookupType): Update to perform GetType on the module builders too.     
29105         * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
29107         * exprssion.cs (NewUserdefinedArray::Emit): Implement.
29109 2001-10-23  Ravi Pratap  <ravi@ximian.com>
29111         * expression.cs (New::DoResolve): Implement guts of array creation.
29113         (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
29115 2001-10-27  Miguel de Icaza  <miguel@ximian.com>
29117         * expression.cs: Fix bug I introduced lsat night that broke
29118         Delegates. 
29120         (Expression.Resolve): Report a 246 error (can not resolve name)
29121         if we find a SimpleName in the stream.
29123         (Expression.ResolveLValue): Ditto.
29125         (Expression.ResolveWithSimpleName): This function is a variant of
29126         ResolveName, this one allows SimpleNames to be returned without a
29127         warning.  The only consumer of SimpleNames is MemberAccess
29129 2001-10-26  Miguel de Icaza  <miguel@ximian.com>
29131         * expression.cs (Invocation::DoResolve): Catch SimpleNames that
29132         might arrive here.  I have my doubts that this is correct.
29134         * statement.cs (Lock): Implement lock statement.
29136         * cs-parser.jay: Small fixes to support `lock' and `using'
29138         * cs-tokenizer.cs: Remove extra space
29140         * driver.cs: New flag --checked, allows to turn on integer math
29141         checking. 
29143         * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
29144         Threading.Monitor.Exit 
29146 2001-10-23  Miguel de Icaza  <miguel@ximian.com>
29148         * expression.cs (IndexerAccess::DoResolveLValue): Set the
29149         Expression Class to be IndexerAccess.
29151         Notice that Indexer::DoResolve sets the eclass to Value.
29153 2001-10-22  Miguel de Icaza  <miguel@ximian.com>
29155         * class.cs (TypeContainer::Emit): Emit code for indexers.
29157         * assign.cs (IAssignMethod): New interface implemented by Indexers
29158         and Properties for handling assignment.
29160         (Assign::Emit): Simplify and reuse code. 
29162         * expression.cs (IndexerAccess, PropertyExpr): Implement
29163         IAssignMethod, clean up old code. 
29165 2001-10-22  Ravi Pratap  <ravi@ximian.com>
29167         * typemanager.cs (ImplementsInterface): New method to determine if a type
29168         implements a given interface. Provides a nice cache too.
29170         * expression.cs (ImplicitReferenceConversion): Update checks to use the above
29171         method.
29173         (ConvertReferenceExplicit): Ditto.
29175         * delegate.cs (Delegate::Populate): Update to define the parameters on the 
29176         various methods, with correct names etc.
29178         * class.cs (Operator::OpType): New members Operator.UnaryPlus and 
29179         Operator.UnaryNegation.
29181         * cs-parser.jay (operator_declarator): Be a little clever in the case where
29182         we have a unary plus or minus operator.
29184         * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and 
29185         UnaryMinus.
29187         * everywhere : update accordingly.
29189         * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
29190         respectively.
29192         * class.cs (Method::Define): For the case where we are implementing a method
29193         inherited from an interface, we need to set the MethodAttributes.Final flag too. 
29194         Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
29196 2001-10-21  Ravi Pratap  <ravi@ximian.com>
29198         * interface.cs (FindMembers): Implement to work around S.R.E
29199         lameness.
29201         * typemanager.cs (IsInterfaceType): Implement.
29203         (FindMembers): Update to handle interface types too.
29205         * expression.cs (ImplicitReferenceConversion): Re-write bits which
29206         use IsAssignableFrom as that is not correct - it doesn't work.
29208         * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
29209         and accordingly override EmitStatement.
29211         * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
29212         using the correct logic :-)
29214 2001-10-19  Ravi Pratap  <ravi@ximian.com>
29216         * ../errors/cs-11.cs : Add to demonstrate error -11 
29218 2001-10-17  Miguel de Icaza  <miguel@ximian.com>
29220         * assign.cs (Assign::Resolve): Resolve right hand side first, and
29221         then pass this as a hint to ResolveLValue.
29223         * expression.cs (FieldExpr): Add Location information
29225         (FieldExpr::LValueResolve): Report assignment to readonly
29226         variable. 
29228         (Expression::ExprClassFromMemberInfo): Pass location information.
29230         (Expression::ResolveLValue): Add new method that resolves an
29231         LValue. 
29233         (Expression::DoResolveLValue): Default invocation calls
29234         DoResolve. 
29236         (Indexers): New class used to keep track of indexers in a given
29237         Type. 
29239         (IStackStore): Renamed from LValue, as it did not really describe
29240         what this did.  Also ResolveLValue is gone from this interface and
29241         now is part of Expression.
29243         (ElementAccess): Depending on the element access type
29245         * typemanager.cs: Add `indexer_name_type' as a Core type
29246         (System.Runtime.CompilerServices.IndexerNameAttribute)
29248         * statement.cs (Goto): Take a location.
29250 2001-10-18  Ravi Pratap  <ravi@ximian.com>
29252         * delegate.cs (Delegate::VerifyDelegate): New method to verify
29253         if two delegates are compatible.
29255         (NewDelegate::DoResolve): Update to take care of the case when
29256         we instantiate a delegate from another delegate.
29258         * typemanager.cs (FindMembers): Don't even try to look up members
29259         of Delegate types for now.
29261 2001-10-18  Ravi Pratap  <ravi@ximian.com>
29263         * delegate.cs (NewDelegate): New class to take care of delegate
29264         instantiation.
29266         * expression.cs (New): Split the delegate related code out into 
29267         the NewDelegate class.
29269         * delegate.cs (DelegateInvocation): New class to handle delegate 
29270         invocation.
29272         * expression.cs (Invocation): Split out delegate related code into
29273         the DelegateInvocation class.
29275 2001-10-17  Ravi Pratap  <ravi@ximian.com>
29277         * expression.cs (New::DoResolve): Implement delegate creation fully
29278         and according to the spec.
29280         (New::DoEmit): Update to handle delegates differently.
29282         (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
29283         because of which we were printing out arguments in reverse order !
29285         * delegate.cs (VerifyMethod): Implement to check if the given method
29286         matches the delegate.
29288         (FullDelegateDesc): Implement.
29290         (VerifyApplicability): Implement.
29292         * expression.cs (Invocation::DoResolve): Update to accordingly handle
29293         delegate invocations too.
29295         (Invocation::Emit): Ditto.
29297         * ../errors/cs1593.cs : Added.
29299         * ../errors/cs1594.cs : Added.
29301         * delegate.cs (InstanceExpression, TargetMethod): New properties.
29303 2001-10-16  Ravi Pratap  <ravi@ximian.com>
29305         * typemanager.cs (intptr_type): Core type for System.IntPtr
29307         (InitCoreTypes): Update for the same.
29309         (iasyncresult_type, asynccallback_type): Ditto.
29311         * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
29312         correct.
29314         * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
29315         too.
29317         * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
29318         the builders for the 4 members of a delegate type :-)
29320         (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
29321         type.
29323         * expression.cs (New::DoResolve): Implement guts for delegate creation.
29325         * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
29327 2001-10-15  Miguel de Icaza  <miguel@ximian.com>
29329         * statement.cs (Break::Emit): Implement.   
29330         (Continue::Emit): Implement.
29332         (For::Emit): Track old being/end loops;  Set Begin loop, ack end loop
29333         (While::Emit): Track old being/end loops;  Set Begin loop, ack end loop
29334         (Do::Emit): Track old being/end loops;  Set Begin loop, ack end loop
29335         (Foreach::Emit): Track old being/end loops;  Set Begin loop, ack
29336         end loop
29338         * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
29339         properties that track the label for the current loop (begin of the
29340         loop and end of the loop).
29342 2001-10-15  Ravi Pratap  <ravi@ximian.com>
29344         * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
29345         use of emitting anything at all.
29347         * class.cs, rootcontext.cs : Get rid of calls to the same.
29349         * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
29351         (Populate): Define the constructor correctly and set the implementation
29352         attributes.
29354         * typemanager.cs (delegate_types): New hashtable to hold delegates that
29355         have been defined.
29357         (AddDelegateType): Implement.
29359         (IsDelegateType): Implement helper method.
29361         * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
29363         * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
29364         and accordingly handle it.
29366         * delegate.cs (Populate): Take TypeContainer argument.
29367         Implement bits to define the Invoke method. However, I still haven't figured out
29368         how to take care of the native int bit :-(
29370         * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-) 
29371         Qualify the name of the delegate, not its return type !
29373         * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
29374         conversion.
29376         (StandardConversionExists): Checking for array types turns out to be recursive.
29378         (ConvertReferenceExplicit): Implement array conversion.
29380         (ExplicitReferenceConversionExists): New method to determine precisely that :-)
29382 2001-10-12  Ravi Pratap  <ravi@ximian.com>
29384         * cs-parser.jay (delegate_declaration): Store the fully qualified
29385         name as it is a type declaration.
29387         * delegate.cs (ReturnType, Name): Rename members to these. Make them 
29388         readonly.
29390         (DefineDelegate): Renamed from Define. Does the same thing essentially,
29391         as TypeContainer::DefineType.
29393         (Populate): Method in which all the definition of the various methods (Invoke)
29394         etc is done.
29396         (Emit): Emit any code, if necessary. I am not sure about this really, but let's
29397         see.
29399         (CloseDelegate): Finally creates the delegate.
29401         * class.cs (TypeContainer::DefineType): Update to define delegates.
29402         (Populate, Emit and CloseType): Do the same thing here too.
29404         * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
29405         delegates in all these operations.
29407 2001-10-14  Miguel de Icaza  <miguel@ximian.com>
29409         * expression.cs: LocalTemporary: a new expression used to
29410         reference a temporary that has been created.
29412         * assign.cs: Handle PropertyAccess back here, so that we can
29413         provide the proper semantic access to properties.
29415         * expression.cs (Expression::ConvertReferenceExplicit): Implement
29416         a few more explicit conversions. 
29418         * modifiers.cs: `NEW' modifier maps to HideBySig.
29420         * expression.cs (PropertyExpr): Make this into an
29421         ExpressionStatement, and support the EmitStatement code path. 
29423         Perform get/set error checking, clean up the interface.
29425         * assign.cs: recognize PropertyExprs as targets, and if so, turn
29426         them into toplevel access objects.
29428 2001-10-12  Miguel de Icaza  <miguel@ximian.com>
29430         * expression.cs: PropertyExpr::PropertyExpr: use work around the
29431         SRE.
29433         * typemanager.cs: Keep track here of our PropertyBuilders again to
29434         work around lameness in SRE.
29436 2001-10-11  Miguel de Icaza  <miguel@ximian.com>
29438         * expression.cs (LValue::LValueResolve): New method in the
29439         interface, used to perform a second resolution pass for LValues. 
29441         (This::DoResolve): Catch the use of this in static methods.
29443         (This::LValueResolve): Implement.
29445         (This::Store): Remove warning, assigning to `this' in structures
29446         is 
29448         (Invocation::Emit): Deal with invocation of
29449         methods on value types.  We need to pass the address to structure
29450         methods rather than the object itself.  (The equivalent code to
29451         emit "this" for structures leaves the entire structure on the
29452         stack instead of a pointer to it). 
29454         (ParameterReference::DoResolve): Compute the real index for the
29455         argument based on whether the method takes or not a `this' pointer
29456         (ie, the method is static).
29458         * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
29459         value types returned from functions when we need to invoke a
29460         method on the sturcture.
29463 2001-10-11  Ravi Pratap  <ravi@ximian.com>
29465         * class.cs (TypeContainer::DefineType): Method to actually do the business of
29466         defining the type in the Modulebuilder or Typebuilder. This is to take
29467         care of nested types which need to be defined on the TypeBuilder using
29468         DefineNestedMethod.
29470         (TypeContainer::GetClassBases): Implement. Essentially the code from the 
29471         methods in RootContext, only ported to be part of TypeContainer.
29473         (TypeContainer::GetInterfaceOrClass): Ditto.
29475         (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
29477         * interface.cs (Interface::DefineInterface): New method. Does exactly
29478         what RootContext.CreateInterface did earlier, only it takes care of nested types 
29479         too.
29481         (Interface::GetInterfaces): Move from RootContext here and port.
29483         (Interface::GetInterfaceByName): Same here.
29485         * rootcontext.cs (ResolveTree): Re-write.
29487         (PopulateTypes): Re-write.
29489         * class.cs (TypeContainer::Populate): Populate nested types too.
29490         (TypeContainer::Emit): Emit nested members too.
29492         * typemanager.cs (AddUserType): Do not make use of the FullName property,
29493         instead just use the name argument passed in as it is already fully
29494         qualified.
29496         (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
29497         to TypeContainer mapping to see if a type is user-defined.
29499         * class.cs (TypeContainer::CloseType): Implement. 
29501         (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
29502         the default constructor.
29504         (TypeContainer::Populate): Fix minor bug which led to creating default constructors
29505         twice.
29507         (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
29509         * interface.cs (CloseType): Create the type here.
29511         * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
29512         the hierarchy.
29514         Remove all the methods which are now in TypeContainer.
29516 2001-10-10  Ravi Pratap  <ravi@ximian.com>
29518         * delegate.cs (Define): Re-write bits to define the delegate
29519         correctly.
29521 2001-10-10  Miguel de Icaza  <miguel@ximian.com>
29523         * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
29525         * expression.cs (ImplicitReferenceConversion): handle null as well
29526         as a source to convert to any reference type.
29528         * statement.cs (Return): Perform any implicit conversions to
29529         expected return type.  
29531         Validate use of return statement.  
29533         * codegen.cs (EmitContext): Pass the expected return type here.
29535         * class.cs (Method, Constructor, Property): Pass expected return
29536         type to EmitContext.
29538 2001-10-09  Miguel de Icaza  <miguel@ximian.com>
29540         * expression.cs: Make DoResolve take an EmitContext instead of a
29541         TypeContainer.
29543         Replaced `l' and `location' for `loc', for consistency.
29545         (Error, Warning): Remove unneeded Tc argument.
29547         * assign.cs, literal.cs, constant.cs: Update to new calling
29548         convention. 
29550         * codegen.cs: EmitContext now contains a flag indicating whether
29551         code is being generated in a static method or not.
29553         * cs-parser.jay: DecomposeQI, new function that replaces the old
29554         QualifiedIdentifier.  Now we always decompose the assembled
29555         strings from qualified_identifier productions into a group of
29556         memberaccesses.
29558 2001-10-08  Miguel de Icaza  <miguel@ximian.com>
29560         * rootcontext.cs: Deal with field-less struct types correctly now
29561         by passing the size option to Define Type.
29563         * class.cs: Removed hack that created one static field. 
29565 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
29567         * statement.cs: Moved most of the code generation here. 
29569 2001-10-09  Ravi Pratap  <ravi@ximian.com>
29571         * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
29572         seem very right.
29574         (ElementAccess): Remove useless bits for now - keep checks as the spec
29575         says.
29577 2001-10-08  Ravi Pratap  <ravi@ximian.com>
29579         * expression.cs (ElementAccess::DoResolve): Remove my crap code
29580         and start performing checks according to the spec.
29582 2001-10-07  Ravi Pratap  <ravi@ximian.com>
29584         * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
29585         rank_specifiers instead.
29587         (rank_specifiers): Change the order in which the rank specifiers are stored
29589         (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
29591         * expression.cs (ElementAccess): Implement the LValue interface too.
29593 2001-10-06  Ravi Pratap  <ravi@ximian.com>
29595         * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
29596         except that user defined conversions are not included.
29598         (UserDefinedConversion): Update to use the ConvertExplicitStandard to 
29599         perform the conversion of the return type, if necessary.
29601         (New::DoResolve): Check whether we are creating an array or an object
29602         and accordingly do the needful.
29604         (New::Emit): Same here.
29606         (New::DoResolve): Implement guts of array creation.
29608         (New::FormLookupType): Helper function.
29610 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
29612         * codegen.cs: Removed most of the code generation here, and move the
29613         corresponding code generation bits to the statement classes. 
29615         Added support for try/catch/finalize and throw.
29617         * cs-parser.jay: Added support for try/catch/finalize.
29619         * class.cs: Catch static methods having the flags override,
29620         virtual or abstract.
29622         * expression.cs (UserCast): This user cast was not really doing
29623         what it was supposed to do.  Which is to be born in fully resolved
29624         state.  Parts of the resolution were being performed at Emit time! 
29626         Fixed this code.
29628 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
29630         * expression.cs: Implicity convert the result from UserCast.
29632 2001-10-05  Ravi Pratap  <ravi@ximian.com>
29634         * expression.cs (Expression::FindMostEncompassingType): Fix bug which
29635         prevented it from working correctly. 
29637         (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
29638         merely ConvertImplicit.
29640 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
29642         * typemanager.cs: Make the LookupTypeContainer function static,
29643         and not per-instance.  
29645         * class.cs: Make static FindMembers (the one that takes a Type
29646         argument). 
29648         * codegen.cs: Add EmitForeach here.
29650         * cs-parser.jay: Make foreach a toplevel object instead of the
29651         inline expansion, as we need to perform semantic analysis on it. 
29653 2001-10-05  Ravi Pratap  <ravi@ximian.com>
29655         * expression.cs (Expression::ImplicitUserConversion): Rename to
29656         UserDefinedConversion.
29658         (Expression::UserDefinedConversion): Take an extra argument specifying 
29659         whether we look for explicit user conversions too.
29661         (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
29663         (UserDefinedConversion): Incorporate support for user defined explicit conversions.
29665         (ExplicitUserConversion): Make it a call to UserDefinedConversion
29666         with the appropriate arguments.
29668         * cs-parser.jay (cast_expression): Record location too.
29670         * expression.cs (Cast): Record location info.
29672         (Expression::ConvertExplicit): Take location argument.
29674         (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
29675         to determine if we are doing explicit conversions.
29677         (UserCast::Emit): Update accordingly.
29679         (Expression::ConvertExplicit): Report an error if everything fails.
29681         * ../errors/cs0030.cs : Add.
29683 2001-10-04  Miguel de Icaza  <miguel@ximian.com>
29685         * modifiers.cs: If the ABSTRACT keyword is present, also set the
29686         virtual and newslot bits. 
29688         * class.cs (TypeContainer::RegisterRequiredImplementations):
29689         Record methods we need.
29691         (TypeContainer::MakeKey): Helper function to make keys for
29692         MethodBases, since the Methodbase key is useless.
29694         (TypeContainer::Populate): Call RegisterRequiredImplementations
29695         before defining the methods.   
29697         Create a mapping for method_builders_to_methods ahead of time
29698         instead of inside a tight loop.
29700         (::RequireMethods):  Accept an object as the data to set into the
29701         hashtable so we can report interface vs abstract method mismatch.
29703 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
29705         * report.cs: Make all of it static.
29707         * rootcontext.cs: Drop object_type and value_type computations, as
29708         we have those in the TypeManager anyways.
29710         Drop report instance variable too, now it is a global.
29712         * driver.cs: Use try/catch on command line handling.
29714         Add --probe option to debug the error reporting system with a test
29715         suite. 
29717         * report.cs: Add support for exiting program when a probe
29718         condition is reached.
29720 2001-10-03  Ravi Pratap  <ravi@ximian.com>
29722         * expression.cs (Binary::DoNumericPromotions): Fix the case when
29723         we do a forcible conversion regardless of type, to check if 
29724         ForceConversion returns a null.
29726         (Binary::error19): Use location to report error.
29728         (Unary::error23): Use location here too.
29730         * ../errors/cs0019.cs : Check in.
29732         * ../errors/cs0023.cs : Check in.
29734         * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
29735         case of a non-null MethodInfo object with a length of 0 !
29737         (Binary::ResolveOperator): Flag error if overload resolution fails to find
29738         an applicable member - according to the spec :-)
29739         Also fix logic to find members in base types.
29741         (Unary::ResolveOperator): Same here.
29743         (Unary::report23): Change name to error23 and make first argument a TypeContainer
29744         as I was getting thoroughly confused between this and error19 :-)
29746         * expression.cs (Expression::ImplicitUserConversion): Re-write fully
29747         (::FindMostEncompassedType): Implement.
29748         (::FindMostEncompassingType): Implement.
29749         (::StandardConversionExists): Implement.
29751         (UserImplicitCast): Re-vamp. We now need info about most specific
29752         source and target types so that we can do the necessary conversions.
29754         (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
29755         mathematical union with no duplicates.
29757 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
29759         * rootcontext.cs (RootContext::PopulateTypes): Populate containers
29760         in order from base classes to child classes, so that we can in
29761         child classes look up in our parent for method names and
29762         attributes (required for handling abstract, virtual, new, override
29763         constructs: we need to instrospect our base class, and if we dont
29764         populate the classes in order, the introspection might be
29765         incorrect.  For example, a method could query its parent before
29766         the parent has any methods and would determine that the parent has
29767         no abstract methods (while it could have had them)).
29769         (RootContext::CreateType): Record the order in which we define the
29770         classes.
29772 2001-10-02  Miguel de Icaza  <miguel@ximian.com>
29774         * class.cs (TypeContainer::Populate): Also method definitions can
29775         fail now, keep track of this.
29777         (TypeContainer::FindMembers): Implement support for
29778         DeclaredOnly/noDeclaredOnly flag.
29780         (Constructor::Emit) Return the ConstructorBuilder.
29782         (Method::Emit) Return the MethodBuilder. 
29783         Check for abstract or virtual methods to be public.
29785         * rootcontext.cs (RootContext::CreateType): Register all the
29786         abstract methods required for the class to be complete and the
29787         interface methods that must be implemented. 
29789         * cs-parser.jay: Report error 501 (method requires body if it is
29790         not marked abstract or extern).
29792         * expression.cs (TypeOf::Emit): Implement.
29794         * typemanager.cs: runtime_handle_type, new global type.
29796         * class.cs (Property::Emit): Generate code for properties.
29798 2001-10-02  Ravi Pratap  <ravi@ximian.com>
29800         * expression.cs (Unary::ResolveOperator): Find operators on base type
29801         too - we now conform exactly to the spec.
29803         (Binary::ResolveOperator): Same here.
29805         * class.cs (Operator::Define): Fix minor quirk in the tests.
29807         * ../errors/cs0215.cs : Added.
29809         * ../errors/cs0556.cs : Added.
29811         * ../errors/cs0555.cs : Added.
29813 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
29815         * cs-tokenizer.cs: Reimplemented Location to be a struct with a
29816         single integer which is really efficient
29818 2001-10-01  Ravi Pratap  <ravi@ximian.com>
29820         *  expression.cs (Expression::ImplicitUserConversion): Use location
29821         even in the case when we are examining True operators.
29823         * class.cs (Operator::Define): Perform extensive checks to conform
29824         with the rules for operator overloading in the spec.
29826         * expression.cs (Expression::ImplicitReferenceConversion): Implement
29827         some of the other conversions mentioned in the spec.
29829         * typemanager.cs (array_type): New static member for the System.Array built-in
29830         type.
29832         (cloneable_interface): For System.ICloneable interface.
29834         * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
29835         we start resolving the tree and populating types.
29837         * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
29839 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
29841         * expression.cs (Expression::ExprClassFromMemberInfo,
29842         Expression::Literalize): Create literal expressions from
29843         FieldInfos which are literals.
29845         (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
29846         type casts, because they were wrong.  The test suite in tests
29847         caught these ones.
29849         (ImplicitNumericConversion): ushort to ulong requires a widening
29850         cast. 
29852         Int32 constant to long requires widening cast as well.
29854         * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
29855         for integers because the type on the stack is not i4.
29857 2001-09-30  Miguel de Icaza  <miguel@ximian.com>
29859         * expression.cs (report118): require location argument. 
29861         * parameter.cs: Do not dereference potential null value.
29863         * class.cs: Catch methods that lack the `new' keyword when
29864         overriding a name.  Report warnings when `new' is used without
29865         anything being there to override.
29867         * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
29869         * class.cs: Only add constructor to hashtable if it is non-null
29870         (as now constructors can fail on define).
29872         (TypeManager, Class, Struct): Take location arguments.
29874         Catch field instance initialization in structs as errors.
29876         accepting_filter: a new filter for FindMembers that is static so
29877         that we dont create an instance per invocation.
29879         (Constructor::Define): Catch errors where a struct constructor is
29880         parameterless 
29882         * cs-parser.jay: Pass location information for various new
29883         constructs. 
29885         * delegate.cs (Delegate): take a location argument.
29887         * driver.cs: Do not call EmitCode if there were problesm in the
29888         Definition of the types, as many Builders wont be there. 
29890         * decl.cs (Decl::Decl): Require a location argument.
29892         * cs-tokenizer.cs: Handle properly hex constants that can not fit
29893         into integers, and find the most appropiate integer for it.
29895         * literal.cs: Implement ULongLiteral.
29897         * rootcontext.cs: Provide better information about the location of
29898         failure when CreateType fails.
29900 2001-09-29  Miguel de Icaza  <miguel@ximian.com>
29902         * rootcontext.cs (RootContext::PopulateTypes): Populates structs
29903         as well.
29905         * expression.cs (Binary::CheckShiftArguments): Add missing type
29906         computation.
29907         (Binary::ResolveOperator): Add type to the logical and and logical
29908         or, Bitwise And/Or and Exclusive Or code paths, it was missing
29909         before.
29911         (Binary::DoNumericPromotions): In the case where either argument
29912         is ulong (and most signed types combined with ulong cause an
29913         error) perform implicit integer constant conversions as well.
29915 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
29917         * expression.cs (UserImplicitCast): Method should always be
29918         non-null. 
29919         (Invocation::BetterConversion): Simplified test for IntLiteral.
29921         (Expression::ImplicitNumericConversion): Split this routine out.
29922         Put the code that performs implicit constant integer conversions
29923         here. 
29925         (Expression::Resolve): Become a wrapper around DoResolve so we can
29926         check eclass and type being set after resolve.
29928         (Invocation::Badness): Remove this dead function
29930         (Binary::ResolveOperator): Do not compute the expensive argumnets
29931         unless we have a union for it.
29933         (Probe::Emit): Is needs to do an isinst and then
29934         compare against null.
29936         (::CanConvert): Added Location argument.  If the Location argument
29937         is null (Location.Null), then we do not report errors.  This is
29938         used by the `probe' mechanism of the Explicit conversion.  We do
29939         not want to generate an error for something that the user
29940         explicitly requested to be casted.  But the pipeline for an
29941         explicit cast first tests for potential implicit casts.
29943         So for now, if the Location is null, it means `Probe only' to
29944         avoid adding another argument.   Might have to revise this
29945         strategy later.
29947         (ClassCast): New class used to type cast objects into arbitrary
29948         classes (used in Explicit Reference Conversions).
29950         Implement `as' as well.
29952         Reverted all the patches from Ravi below: they were broken:
29954                 * The use of `level' as a mechanism to stop recursive
29955                   invocations is wrong.  That was there just to catch the
29956                   bug with a strack trace but not as a way of addressing
29957                   the problem.
29959                   To fix the problem we have to *understand* what is going
29960                   on and the interactions and come up with a plan, not
29961                   just get things going.
29963                 * The use of the type conversion cache that I proposed
29964                   last night had an open topic: How does this work across
29965                   protection domains.  A user defined conversion might not
29966                   be public in the location where we are applying the
29967                   conversion, a different conversion might be selected
29968                   (ie, private A->B (better) but public B->A (worse),
29969                   inside A, A->B applies, but outside it, B->A will
29970                   apply).
29972                 * On top of that (ie, even if the above is solved),
29973                   conversions in a cache need to be abstract.  Ie, `To
29974                   convert from an Int to a Short use an OpcodeCast', not
29975                   `To convert from an Int to a Short use the OpcodeCast on
29976                   the variable 5' (which is what this patch was doing).
29978 2001-09-28  Ravi Pratap  <ravi@ximian.com>
29980         * expression.cs (Invocation::ConversionExists): Re-write to use
29981         the conversion cache
29983         (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
29984         cache all conversions done, not just user-defined ones.
29986         (Invocation::BetterConversion): The real culprit. Use ConversionExists
29987         to determine if a conversion exists instead of acutually trying to 
29988         perform the conversion. It's faster too.
29990         (Expression::ConvertExplicit): Modify to use ConversionExists to check
29991         and only then attempt the implicit conversion.
29993 2001-09-28  Ravi Pratap  <ravi@ximian.com>
29995         * expression.cs (ConvertImplicit): Use a cache for conversions
29996         already found. Check level of recursion and bail out if necessary.
29998 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
30000         * typemanager.cs (string_concat_string_string, string_concat_object_object):
30001         Export standard methods that we expect for string operations.
30003         * statement.cs (Block::UsageWarning): Track usage of variables and
30004         report the errors for not used variables.
30006         * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
30007         operator. 
30009 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
30011         * codegen.cs: remove unnneded code 
30013         * expression.cs: Removed BuiltinTypeAccess class
30015         Fix the order in which implicit conversions are
30016         done.  
30018         The previous fixed dropped support for boxed conversions (adding a
30019         test to the test suite now)
30021         (UserImplicitCast::CanConvert): Remove test for source being null,
30022         that code is broken.  We should not feed a null to begin with, if
30023         we do, then we should track the bug where the problem originates
30024         and not try to cover it up here.
30026         Return a resolved expression of type UserImplicitCast on success
30027         rather than true/false.  Ravi: this is what I was talking about,
30028         the pattern is to use a static method as a "constructor" for
30029         objects. 
30031         Also, do not create arguments until the very last minute,
30032         otherwise we always create the arguments even for lookups that
30033         will never be performed. 
30035         (UserImplicitCast::Resolve): Eliminate, objects of type
30036         UserImplicitCast are born in a fully resolved state. 
30038         * typemanager.cs (InitCoreTypes): Init also value_type
30039         (System.ValueType). 
30041         * expression.cs (Cast::Resolve): First resolve the child expression.
30043         (LValue): Add new method AddressOf to be used by
30044         the `&' operator.  
30046         Change the argument of Store to take an EmitContext instead of an
30047         ILGenerator, because things like FieldExpr need to be able to call
30048         their children expression to generate the instance code. 
30050         (Expression::Error, Expression::Warning): Sugar functions for
30051         reporting errors.
30053         (Expression::MemberLookup): Accept a TypeContainer instead of a
30054         Report as the first argument.
30056         (Expression::ResolvePrimary): Killed.  I still want to improve
30057         this as currently the code is just not right.
30059         (Expression::ResolveMemberAccess): Simplify, but it is still
30060         wrong. 
30062         (Unary::Resolve): Catch errors in AddressOf operators.
30064         (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
30065         index to a byte for the short-version, or the compiler will choose
30066         the wrong Emit call, which generates the wrong data.
30068         (ParameterReference::Emit, ::Store): same.
30070         (FieldExpr::AddressOf): Implement.
30072         * typemanager.cs: TypeManager: made public variable instead of
30073         property.
30075         * driver.cs: document --fatal.
30077         * report.cs (ErrorMessage, WarningMessage): new names for the old
30078         Error and Warning classes.
30080         * cs-parser.jay (member_access): Turn built-in access to types
30081         into a normal simplename
30083 2001-09-27  Ravi Pratap  <ravi@ximian.com>
30085         * expression.cs (Invocation::BetterConversion): Fix to cope
30086         with q being null, since this was introducing a bug.
30088         * expression.cs (ConvertImplicit): Do built-in conversions first.
30090 2001-09-27  Ravi Pratap  <ravi@ximian.com>
30092         * expression.cs (UserImplicitCast::Resolve): Fix bug.
30094 2001-09-27  Ravi Pratap  <ravi@ximian.com>
30096         * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
30097         I had introduced long ago (what's new ?).
30099         * expression.cs (UserImplicitCast::CanConvert): Static method to do 
30100         the work of all the checking. 
30101         (ConvertImplicit): Call CanConvert and only then create object if necessary.
30102         (UserImplicitCast::CanConvert, ::Resolve): Re-write.
30104         (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
30105         that is the right way. 
30107         (Invocation::MakeUnionSet): Convenience function to make unions of sets for 
30108         overloading resolution. Use everywhere instead of cutting and pasting code.
30110         (Binary::ResolveOperator): Use MakeUnionSet.
30112         (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when 
30113         we have to convert to bool types. Not complete yet.
30115 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
30117         * typemanager.cs (TypeManager::CSharpName): support ushort.
30119         * expression.cs (Expression::TryImplicitIntConversion): Attempts
30120         to provide an expression that performsn an implicit constant int
30121         conversion (section 6.1.6).
30122         (Expression::ConvertImplicitRequired): Reworked to include
30123         implicit constant expression conversions.
30125         (Expression::ConvertNumericExplicit): Finished.
30127         (Invocation::Emit): If InstanceExpression is null, then it means
30128         that we perform a call on this.
30130 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
30132         * expression.cs (Unary::Emit): Remove some dead code.
30133         (Probe): Implement Resolve and Emit for `is'.
30134         (Expression::ConvertImplicitRequired): Attempt to do constant
30135         expression conversions here.  Maybe should be moved to
30136         ConvertImplicit, but I am not sure.
30137         (Expression::ImplicitLongConstantConversionPossible,
30138         Expression::ImplicitIntConstantConversionPossible): New functions
30139         that tell whether is it possible to apply an implicit constant
30140         expression conversion.
30142         (ConvertNumericExplicit): Started work on explicit numeric
30143         conversions.
30145         * cs-parser.jay: Update operator constants.
30147         * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
30148         (Parameters::GetSignature): Hook up VerifyArgs here.
30149         (Parameters::VerifyArgs): Verifies that no two arguments have the
30150         same name. 
30152         * class.cs (Operator): Update the operator names to reflect the
30153         ones that the spec expects (as we are just stringizing the
30154         operator names).
30156         * expression.cs (Unary::ResolveOperator): Fix bug: Use
30157         MethodInfo's ReturnType instead of LookupMethodByBuilder as the
30158         previous usage did only work for our methods.
30159         (Expression::ConvertImplicit): Handle decimal implicit numeric
30160         conversions as well.
30161         (Expression::InternalTypeConstructor): Used to invoke constructors
30162         on internal types for default promotions.
30164         (Unary::Emit): Implement special handling for the pre/post
30165         increment/decrement for overloaded operators, as they need to have
30166         the same semantics as the other operators.
30168         (Binary::ResolveOperator): ditto.
30169         (Invocation::ConversionExists): ditto.
30170         (UserImplicitCast::Resolve): ditto.
30172 2001-09-26  Ravi Pratap  <ravi@ximian.com>
30174         * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
30175         operator, return after emitting body. Regression tests pass again !
30177         * expression.cs (ConvertImplicit): Take TypeContainer as first argument
30178         (Unary::ForceConversion, Binary::ForceConversion): Ditto.
30179         (Invocation::OverloadResolve): Ditto.
30180         (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
30182         * everywhere : update calls to the above methods accordingly.
30184 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
30186         * assign.cs (Assign): Make it inherit from ExpressionStatement.
30188         * expression.cs (ExpressionStatement): New base class used for
30189         expressions that can appear in statements, so that we can provide
30190         an alternate path to generate expression that do not leave a value
30191         on the stack.
30193         (Expression::Emit, and all the derivatives): We no longer return
30194         whether a value is left on the stack or not.  Every expression
30195         after being emitted leaves a single value on the stack.
30197         * codegen.cs (EmitContext::EmitStatementExpression): Use the
30198         facilties of ExpressionStatement if possible.
30200         * cs-parser.jay: Update statement_expression.
30202 2001-09-25  Miguel de Icaza  <miguel@ximian.com>
30204         * driver.cs: Change the wording of message
30206 2001-09-25  Ravi Pratap  <ravi@ximian.com>
30208         * expression.cs (Binary::ResolveOperator): Had forgottten to set 
30209         the type of the expression to the return type of the method if
30210         we have an overloaded operator match ! The regression tests pass again !
30211         (Unary::ResolveOperator): Ditto.
30213         * expression.cs (Invocation::ConversionExists): Correct the member lookup
30214         to find "op_Implicit", not "implicit" ;-)
30215         (UserImplicitCast): New class to take care of user-defined implicit conversions.
30216         (ConvertImplicit, ForceConversion): Take TypeContainer argument
30218         * everywhere : Correct calls to the above accordingly.
30220         * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
30221         (ConvertImplicit): Do user-defined conversion if it exists.
30223 2001-09-24  Miguel de Icaza  <miguel@ximian.com>
30225         * assign.cs: track location.
30226         (Resolve): Use implicit conversions on assignment.
30228         * literal.cs: Oops.  Not good, Emit of short access values should
30229         pass (Bytes) or the wrong argument will be selected.
30231         * expression.cs (Unary::Emit): Emit code for -expr.
30233         (Unary::ResolveOperator): Handle `Substract' for non-constants
30234         (substract from zero from the non-constants).
30235         Deal with Doubles as well. 
30237         (Expression::ConvertImplicitRequired): New routine that reports an
30238         error if no implicit conversion exists. 
30240         (Invocation::OverloadResolve): Store the converted implicit
30241         expressions if we make them
30243 2001-09-24  Ravi Pratap  <ravi@ximian.com>
30245         * class.cs (ConstructorInitializer): Take a Location argument.
30246         (ConstructorBaseInitializer): Same here.
30247         (ConstructorThisInitializer): Same here.
30249         * cs-parser.jay : Update all calls accordingly.
30251         * expression.cs (Unary, Binary, New): Take location argument.
30252         Update accordingly everywhere.
30254         * cs-parser.jay : Update all calls to the above to take a location
30255         argument.
30257         * class.cs : Ditto.
30259 2001-09-24  Ravi Pratap  <ravi@ximian.com>
30261         * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
30262         (Invocation::BetterConversion): Same here
30263         (Invocation::ConversionExists): Ditto.
30265         (Invocation::ConversionExists): Implement.
30267 2001-09-22  Ravi Pratap  <ravi@ximian.com>
30269         * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
30270         Also take an additional TypeContainer argument.
30272         * All over : Pass in TypeContainer as argument to OverloadResolve.
30274         * typemanager.cs (CSharpName): Update to check for the string type and return
30275         that too.
30277         * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
30278         a given method.
30280 2001-09-21  Ravi Pratap  <ravi@ximian.com>
30282         * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
30283         (Invocation::BetterFunction): Implement.
30284         (Invocation::BetterConversion): Implement.
30285         (Invocation::ConversionExists): Skeleton, no implementation yet.
30287         Okay, things work fine !
30289 2001-09-21  Miguel de Icaza  <miguel@ximian.com>
30291         * typemanager.cs: declare and load enum_type, delegate_type and
30292         void_type. 
30294         * expression.cs (Expression::Emit): Now emit returns a value that
30295         tells whether a value is left on the stack or not.  This strategy
30296         might be reveted tomorrow with a mechanism that would address
30297         multiple assignments.
30298         (Expression::report118): Utility routine to report mismatches on
30299         the ExprClass.
30301         (Unary::Report23): Report impossible type/operator combination
30302         utility function.
30304         (Unary::IsIncrementableNumber): Whether the type can be
30305         incremented or decremented with add.
30306         (Unary::ResolveOperator): Also allow enumerations to be bitwise
30307         complemented. 
30308         (Unary::ResolveOperator): Implement ++, !, ~,
30310         (Invocation::Emit): Deal with new Emit convetion.
30312         * All Expression derivatives: Updated their Emit method to return
30313         whether they leave values on the stack or not.
30315         * codegen.cs (CodeGen::EmitStatement): Pop values left on the
30316         stack for expressions that are statements. 
30318 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
30320         * expression.cs (LValue): New interface.  Must be implemented by
30321         LValue objects.
30322         (LocalVariableReference, ParameterReference, FieldExpr): Implement
30323         LValue interface.
30325         * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
30326         interface for generating code, simplifies the code.
30328 2001-09-20  Ravi Pratap  <ravi@ximian.com>
30330         * expression.cs (everywhere): Comment out return statements in ::Resolve
30331         methods to avoid the warnings.
30333 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
30335         * driver.cs (parse): Report error 2001 if we can not open the
30336         source file.
30338         * expression.cs (SimpleName::ResolveSimpleName): Error if we can
30339         not resolve it.
30341         * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
30342         object. 
30344         * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
30345         otherwise nested blocks end up with the same index.
30347         * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
30349         * expression.cs:  Instead of having FIXMEs in the Resolve
30350         functions, throw exceptions so it is obvious that we are facing a
30351         bug. 
30353         * cs-parser.jay (invocation_expression): Pass Location information.
30355         * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
30356         Use a basename for those routines because .NET does not like paths
30357         on them. 
30359         * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
30360         already defined.
30362 2001-09-19  Miguel de Icaza  <miguel@ximian.com>
30364         * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
30365         are loading the correct data types (throws an exception if not).
30366         (TypeManager::InitCoreTypes): Use CoreLookupType
30368         * expression.cs (Unary::ResolveOperator): return the child
30369         expression for expressions which are just +expr.
30370         (Unary::ResolveOperator): Return negative literals for -LITERAL
30371         expressions (otherwise they are Unary {Literal}).
30372         (Invocation::Badness): Take into account `Implicit constant
30373         expression conversions'.
30375         * literal.cs (LongLiteral): Implement long literal class.
30376         (IntLiteral): export the `Value' of the intliteral. 
30378 2001-09-19  Ravi Pratap  <ravi@ximian.com>
30380         * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
30382         * class.cs (Operator::Define): Change the methodname prefix to 'op_' 
30383         instead of 'Operator'
30385         * expression.cs (Binary::ResolveOperator): Update accordingly.
30386         (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
30387         and 'Minus'
30389         * cs-parser.jay (unary_expression): Update to use the new names.
30391         * gen-treedump.cs (GetUnary): Same here.
30393         * expression.cs (Unary::Resolve): Implement.
30394         (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded 
30395         operators are found instead of making noise ;-)
30396         (Unary::ResolveOperator): New method to do precisely the same thing which
30397         Binary::ResolveOperator does for Binary expressions.
30398         (Unary.method, .Arguments): Add.
30399         (Unary::OperName): Implement.   
30400         (Unary::ForceConversion): Copy and Paste !
30402         * class.cs (Operator::Define): Fix a small bug for the case when we have 
30403         a unary operator.
30405         * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
30406         for the inbuilt operators. Only overloading works for now ;-)
30408 2001-09-18  Miguel de Icaza  <miguel@ximian.com>
30410         * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
30411         UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
30413         * expression.cs (This::Emit): Implement. 
30414         (This::Resolve): Implement.
30415         (TypeOf:Resolve): Implement.
30416         (Expression::ResolveSimpleName): Add an implicit this to instance
30417         field references. 
30418         (MemberAccess::Resolve): Deal with Parameters and Fields. 
30419         Bind instance variable to Field expressions.
30420         (FieldExpr::Instance): New field used to track the expression that
30421         represents the object instance.
30422         (FieldExpr::Resolve): Track potential errors from MemberLookup not
30423         binding 
30424         (FieldExpr::Emit): Implement.
30426         * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
30427         the last instruction contains a return opcode to avoid generating
30428         the last `ret' instruction (this generates correct code, and it is
30429         nice to pass the peverify output).
30431         * class.cs (TypeContainer::EmitFieldInitializers): Implement field
30432         initializer for static and instance variables.
30433         (Constructor::Emit): Allow initializer to be null in the case of
30434         static constructors.  Only emit initializer for instance
30435         constructors. 
30437         (TypeContainer::FindMembers): Return a null array if there are no
30438         matches.
30440         Also fix the code for the MemberTypes.Method branch, as it was not
30441         scanning that for operators (or tried to access null variables before).
30443         * assign.cs (Assign::Emit): Handle instance and static fields. 
30445         * TODO: Updated.
30447         * driver.cs: Stop compilation if there are parse errors.
30449         * cs-parser.jay (constructor_declaration): Provide default base
30450         initializer for non-static constructors.
30451         (constructor_declarator): Do not provide a default base
30452         initializers if none was specified.
30453         Catch the fact that constructors should not have parameters.
30455         * class.cs: Do not emit parent class initializers for static
30456         constructors, that should be flagged as an error.
30458 2001-09-18  Ravi Pratap  <ravi@ximian.com>
30460         * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
30461         Move back code into TypeContainer::Populate.
30463 2001-09-18  Ravi Pratap  <ravi@ximian.com>
30465         * class.cs (TypeContainer::AddConstructor): Fix the check to
30466         compare against Name, not Basename. 
30467         (Operator::OpType): Change Plus and Minus to Add and Subtract.
30469         * cs-parser.jay : Update accordingly.
30471         * class.cs (TypeContainer::FindMembers): For the case where we are searching
30472         for methods, don't forget to look into the operators too.
30473         (RegisterMethodBuilder): Helper method to take care of this for
30474         methods, constructors and operators.
30475         (Operator::Define): Completely revamp.
30476         (Operator.OperatorMethod, MethodName): New fields.
30477         (TypeContainer::Populate): Move the registering of builders into
30478         RegisterMethodBuilder.
30479         (Operator::Emit): Re-write.
30481         * expression.cs (Binary::Emit): Comment out code path to emit method
30482         invocation stuff for the case when we have a user defined operator. I am
30483         just not able to get it right !
30485 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
30487         * expression.cs (Expression::OverloadResolve): Drop TypeContainer
30488         argument. 
30490         (Expression::MemberLookup): Provide a version that allows to
30491         specify the MemberTypes and BindingFlags. 
30493         * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
30494         so it was not fetching variable information from outer blocks.
30496         * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
30497         Beforefieldinit as it was buggy.
30499         * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
30500         that Ravi put here.  
30502         * class.cs (Constructor::Emit): Only emit if block is not null.
30503         (TypeContainer::EmitDefaultConstructor): Removed routine, now we
30504         deal with this by semantically definining it as if the user had
30505         done it.
30507         (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
30508         constructors as we now "emit" them at a higher level.
30510         (TypeContainer::DefineDefaultConstructor): Used to define the
30511         default constructors if none was provided.
30513         (ConstructorInitializer): Add methods Resolve and Emit. 
30515         * expression.cs: Cast to ConstructorInfo instead of MethodInfo
30517 2001-09-17  Ravi Pratap  <ravi@ximian.com>
30519         * class.cs (TypeContainer::EmitDefaultConstructor): Register
30520         the default constructor builder with our hashtable for methodbuilders
30521         to methodcores.
30523         * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
30524         and argument_count is 0 in which case we have a match.
30525         (Binary::ResolveOperator): More null checking and miscellaneous coding
30526         style cleanup.
30528 2001-09-17  Ravi Pratap  <ravi@ximian.com>
30530         * rootcontext.cs (IsNameSpace): Compare against null.
30532         * everywhere : Correct spelling to 'Greater' and to 'Subtract'
30534         * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
30535         and Unary::Operator.
30537         * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
30538         accordingly.
30540         * expression.cs (Binary::method): New member to hold the MethodBase for the case when
30541         we have overloaded operators.
30542         (Binary::ResolveOperator): Implement the part which does the operator overload
30543         resolution.
30545         * class.cs (Operator::Emit): Implement.
30546         (TypeContainer::Emit): Emit the operators we have too.
30548         * expression.cs (Binary::Emit): Update to emit the appropriate code for
30549         the case when we have a user-defined operator.
30551 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
30553         * rootcontext.cs: Fix bug: tree.Namespaces might be null.
30555 2001-09-16  Ravi Pratap  <ravi@ximian.com>
30557         * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
30558         (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
30559         (Constructor::Emit): Implement.
30560         (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
30561         if we have no work to do. 
30562         (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's 
30563         Emit method.
30565         * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
30566         (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
30568         * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
30569         of parent.parent.
30571 2001-09-15  Ravi Pratap  <ravi@ximian.com>
30573         * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
30574         in the source.
30575         (Tree::RecordNamespace): Method to do what the name says ;-)
30576         (Tree::Namespaces): Property to get at the namespaces hashtable.
30578         * cs-parser.jay (namespace_declaration): Call RecordNamespace to 
30579         keep track.
30581         * rootcontext.cs (IsNamespace): Fixed it :-)
30583 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
30585         * class.cs (TypeContainer::FindMembers): Add support for
30586         constructors. 
30587         (MethodCore): New class that encapsulates both the shared aspects
30588         of a Constructor and a Method.  
30589         (Method, Constructor): Factored pieces into MethodCore.
30591         * driver.cs: Added --fatal which makes errors throw exceptions.
30592         Load System assembly as well as part of the standard library.
30594         * report.cs: Allow throwing exceptions on errors for debugging.
30596         * modifiers.cs: Do not use `parent', instead use the real type
30597         container to evaluate permission settings.
30599         * class.cs: Put Ravi's patch back in.  He is right, and we will
30600         have to cope with the
30602 2001-09-14  Ravi Pratap  <ravi@ximian.com>
30604         * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
30605         FamORAssem, not FamANDAssem.
30607 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
30609         * driver.cs: Added --parse option that only parses its input files
30610         and terminates.
30612         * class.cs: Reverted last change from Ravi to IsTopLevel.  That is
30613         incorrect.  IsTopLevel is not used to tell whether an object is
30614         root_types or not (that can be achieved by testing this ==
30615         root_types).  But to see if this is a top-level *class* (not
30616         necessarly our "toplevel" container). 
30618 2001-09-14  Ravi Pratap  <ravi@ximian.com>
30620         * enum.cs (Enum::Define): Modify to call the Lookup method on the
30621         parent instead of a direct call to GetType.
30623 2001-09-14  Ravi Pratap  <ravi@ximian.com>
30625         * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
30626         Modifiers.TypeAttr. This should just be a call to that method.
30628         * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
30629         object so that we can determine if we are top-level or not.
30631         * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the 
30632         TypeContainer too.
30634         * enum.cs (Enum::Define): Ditto.
30636         * modifiers.cs (FieldAttr): Re-write.
30638         * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
30639         (TypeContainer::HaveStaticConstructor): New property to provide access
30640         to precisely that info.
30642         * modifiers.cs (MethodAttr): Re-write.
30643         (EventAttr): Remove altogether as there seems to be no ostensible use for it.
30645         * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
30646         of top-level types as claimed.
30648 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
30650         * expression.cs (MemberLookup): Fruitless attempt to lookup
30651         constructors.  Maybe I need to emit default constructors?  That
30652         might be it (currently .NET emits this for me automatically).
30653         (Invocation::OverloadResolve): Cope with Arguments == null.
30654         (Invocation::EmitArguments): new function, shared by the new
30655         constructor and us.
30656         (Invocation::Emit): Handle static and instance methods.  Emit
30657         proper call instruction for virtual or non-virtual invocations.
30658         (New::Emit): Implement.
30659         (New::Resolve): Implement.
30660         (MemberAccess:Resolve): Implement.
30661         (MethodGroupExpr::InstanceExpression): used conforming to the spec
30662         to track instances.
30663         (FieldExpr::Resolve): Set type.
30665         * support.cs: Handle empty arguments.
30666                 
30667         * cs-parser.jay (CompositeLookup, QualifierIdentifier,
30668         SimpleLookup): Auxiliary routines to help parse a qualifier
30669         identifier.  
30671         Update qualifier_identifier rule.
30673         * codegen.cs: Removed debugging messages.
30675         * class.cs: Make this a global thing, this acts just as a "key" to
30676         objects that we might have around.
30678         (Populate): Only initialize method_builders_to_methods once.
30680         * expression.cs (PropertyExpr): Initialize type from the
30681         PropertyType. 
30683         * codegen.cs (EmitContext::EmitBoolExpression): Use propper
30684         Resolve pattern.  Attempt to implicitly convert value to boolean.
30685         Emit code.
30687         * expression.cs: Set the type for the int32/int32 argument case.
30688         (Binary::ResolveOperator): Set the return type to boolean for
30689         comparission operators
30691         * typemanager.cs: Remove debugging print code.
30693         (Invocation::Resolve): resolve type.
30695         * class.cs: Allocate a MemberInfo of the correct size, as the code
30696         elsewhere depends on the test to reflect the correct contents.
30698         (Method::) Keep track of parameters, due to System.Reflection holes
30700         (TypeContainer::Populate): Keep track of MethodBuilders to Method
30701         mapping here.
30703         (TypeContainer::FindMembers): Use ArrayList and then copy an array
30704         of the exact size and return that.
30706         (Class::LookupMethodByBuilder): New function that maps
30707         MethodBuilders to its methods.  Required to locate the information
30708         on methods because System.Reflection bit us again.
30710         * support.cs: New file, contains an interface ParameterData and
30711         two implementations: ReflectionParameters and InternalParameters
30712         used to access Parameter information.  We will need to grow this
30713         as required.
30715         * expression.cs (Invocation::GetParameterData): implement a cache
30716         and a wrapper around the ParameterData creation for methods. 
30717         (Invocation::OverloadResolve): Use new code.
30719 2001-09-13  Ravi Pratap  <ravi@ximian.com>
30721         * class.cs (TypeContainer::EmitField): Remove and move into 
30722         (Field::Define): here and modify accordingly.
30723         (Field.FieldBuilder): New member.
30724         (TypeContainer::Populate): Update accordingly.
30725         (TypeContainer::FindMembers): Implement.
30727 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
30729         * statement.cs: (VariableInfo::VariableType): New field to be
30730         initialized with the full type once it is resolved. 
30732 2001-09-12  Miguel de Icaza  <miguel@ximian.com>
30734         * parameter.cs (GetParameterInfo): Use a type cache to compute
30735         things only once, and to reuse this information
30737         * expression.cs (LocalVariableReference::Emit): Implement.
30738         (OpcodeCast::Emit): fix.
30740         (ParameterReference::Resolve): Implement.
30741         (ParameterReference::Emit): Implement.
30743         * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
30744         that are expressions need to stay as Expressions.
30746         * typemanager.cs (CSharpName): Returns the C# name of a type if
30747         possible. 
30749         * expression.cs (Expression::ConvertImplicit): New function that
30750         implements implicit type conversions.
30752         (Expression::ImplicitReferenceConversion): Implements implicit
30753         reference conversions.
30755         (EmptyCast): New type for transparent casts.
30757         (OpcodeCast): New type for casts of types that are performed with
30758         a sequence of bytecodes.
30760         (BoxedCast): New type used for casting value types into reference
30761         types.  Emits a box opcode.
30763         (Binary::DoNumericPromotions): Implements numeric promotions of
30764         and computation of the Binary::Type.
30766         (Binary::EmitBranchable): Optimization.
30768         (Binary::Emit): Implement code emission for expressions.
30770         * typemanager.cs (TypeManager): Added two new core types: sbyte
30771         and byte.
30773 2001-09-12  Ravi Pratap  <ravi@ximian.com>
30775         * class.cs (TypeContainer::FindMembers): Method which does exactly
30776         what Type.FindMembers does, only we don't have to use reflection. No
30777         implementation yet.
30779         * typemanager.cs (typecontainers): New hashtable to hold the corresponding
30780         typecontainer objects as we need to get at them.
30781         (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
30783         * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
30784         typecontainer object.
30786         * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
30787         of just a Report object.
30789 2001-09-11  Ravi Pratap  <ravi@ximian.com>
30791         * class.cs (Event::Define): Go back to using the prefixes "add_" and
30792         "remove_"
30793         (TypeContainer::Populate): Now define the delegates of the type too.
30794         (TypeContainer.Delegates): Property to access the list of delegates defined
30795         in the type.
30797         * delegates.cs (Delegate::Define): Implement partially.
30799         * modifiers.cs (TypeAttr): Handle more flags.
30801 2001-09-11  Ravi Pratap  <ravi@ximian.com>
30803         * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
30804         and not <=
30805         (Operator::Define): Re-write logic to get types by using the LookupType method
30806         instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
30807         (Indexer::Define): Ditto.
30808         (Event::Define): Ditto.
30809         (Property::Define): Ditto.
30811 2001-09-10  Ravi Pratap  <ravi@ximian.com>
30813         * class.cs (TypeContainer::Populate): Now define operators too. 
30814         (TypeContainer.Operators): New property to access the list of operators
30815         in a type.
30816         (Operator.OperatorMethodBuilder): New member to hold the method builder
30817         for the operator we are defining.
30818         (Operator::Define): Implement.
30820 2001-09-10  Ravi Pratap  <ravi@ximian.com>
30822         * class.cs (Event::Define): Make the prefixes of the accessor methods
30823         addOn_ and removeOn_ 
30825         * genericparser.cs (GenericParser::error): Overloaded method to handle the case
30826         of the location being passed in too. Ideally, this should go later since all
30827         error reporting should be done through the Report object.
30829         * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
30830         (Populate): Iterate thru the indexers we have and define them too.
30831         (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
30832         for the get and set accessors.
30833         (Indexer::Define): Implement.
30835 2001-09-09  Miguel de Icaza  <miguel@ximian.com>
30837         * expression.cs (Binary::Resolve): Beginning of it.  I scratched
30838         my previous implementation, did not work.
30840         * typemanager.cs: Add a couple of missing types (the longs).
30842         * literal.cs: Use TypeManager.bool_type instead of getting it.
30844         * expression.cs (EventExpr): New kind of expressions.
30845         (Expressio::ExprClassFromMemberInfo): finish
30847 2001-09-08  Miguel de Icaza  <miguel@ximian.com>
30849         * assign.cs: Emit stores to static fields differently.
30851 2001-09-08  Ravi Pratap  <ravi@ximian.com>
30853         * Merge in changes and adjust code to tackle conflicts. Backed out my
30854         code in Assign::Resolve ;-) 
30856 2001-09-08  Ravi Pratap  <ravi@ximian.com>
30858         * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
30859         instead Report.Error and also pass in the location.
30860         (CSharpParser::Lexer): New readonly property to return the reference
30861         to the Tokenizer object.
30862         (declare_local_variables): Use Report.Error with location instead of plain 
30863         old error.
30864         (CheckDef): Ditto.
30866         * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
30867         (Operator.CheckBinaryOperator): Ditto.
30869         * cs-parser.jay (operator_declarator): Update accordingly.
30871         * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
30872         (CheckBinaryOperator): Same here.
30874         * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
30875         on the name without any prefixes of namespace names etc. This is because we
30876         already might have something already fully qualified like 
30877         'System.Console.WriteLine'
30879         * assign.cs (Resolve): Begin implementation. Stuck ;-)
30881 2001-09-07  Ravi Pratap  <ravi@ximian.com>
30883         * cs-tokenizer.cs (location): Return a string which also contains
30884         the file name.
30886         * expression.cs (ElementAccess): New class for expressions of the
30887         type 'element access.'
30888         (BaseAccess): New class for expressions of the type 'base access.'
30889         (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
30890         respectively.
30892         * cs-parser.jay (element_access): Implement action.
30893         (base_access): Implement actions.
30894         (checked_expression, unchecked_expression): Implement.
30896         * cs-parser.jay (local_variable_type): Correct and implement.
30897         (type_suffixes, type_suffix_list, type_suffix): Implement actions.
30899         * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
30901         * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
30902         name and the specifiers.
30904         * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
30906         * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of 
30907         making them all public ;-)
30909         * cs-parser.jay (error): Remove entirely as we have an implementation in the base
30910         class anyways.
30912 2001-09-07  Miguel de Icaza  <miguel@ximian.com>
30914         * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
30915         PropertyExprs.
30916         (FieldExpr, PropertyExprs): New resolved expressions.
30917         (SimpleName::MemberStaticCheck): Perform static checks for access
30918         to non-static fields on static methods. Maybe this should be
30919         generalized for MemberAccesses. 
30920         (SimpleName::ResolveSimpleName): More work on simple name
30921         resolution. 
30923         * cs-parser.jay (primary_expression/qualified_identifier): track
30924         the parameter index.
30926         * codegen.cs (CodeGen::Save): Catch save exception, report error.
30927         (EmitContext::EmitBoolExpression): Chain to expression generation
30928         instead of temporary hack.
30929         (::EmitStatementExpression): Put generic expression code generation.
30931         * assign.cs (Assign::Emit): Implement variable assignments to
30932         local variables, parameters and fields.
30934 2001-09-06  Miguel de Icaza  <miguel@ximian.com>
30936         * statement.cs (Block::GetVariableInfo): New method, returns the
30937         VariableInfo for a variable name in a block.
30938         (Block::GetVariableType): Implement in terms of GetVariableInfo
30940         * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
30941         DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
30943 2001-09-06  Ravi Pratap  <ravi@ximian.com>
30945         * cs-parser.jay (operator_declaration): Continue on my quest : update
30946         to take attributes argument.
30947         (event_declaration): Ditto.
30948         (enum_declaration): Ditto.
30949         (indexer_declaration): Ditto.
30951         * class.cs (Operator::Operator): Update constructor accordingly.
30952         (Event::Event): Ditto.
30954         * delegate.cs (Delegate::Delegate): Same here.
30956         * enum.cs (Enum::Enum): Same here.
30958 2001-09-05  Ravi Pratap  <ravi@ximian.com>
30960         * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
30962         * ../tests/cs0658.cs : New file to demonstrate error 0658.
30964         * attribute.cs (Attributes): New class to encapsulate all attributes which were
30965         being passed around as an arraylist.
30966         (Attributes::AddAttribute): Method to add attribute sections.
30968         * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
30969         (struct_declaration): Update accordingly.
30970         (constant_declaration): Update.
30971         (field_declaration): Update.
30972         (method_header): Update.
30973         (fixed_parameter): Update.
30974         (parameter_array): Ditto.
30975         (property_declaration): Ditto.
30976         (destructor_declaration): Ditto.
30978         * class.cs (Struct::Struct): Update constructors accordingly.
30979         (Class::Class): Ditto.
30980         (Field::Field): Ditto.
30981         (Method::Method): Ditto.
30982         (Property::Property): Ditto.
30983         (TypeContainer::OptAttribute): update property's return type.
30985         * interface.cs (Interface.opt_attributes): New member.
30986         (Interface::Interface): Update to take the extra Attributes argument.
30988         * parameter.cs (Parameter::Parameter): Ditto.
30990         * constant.cs (Constant::Constant): Ditto.
30992         * interface.cs (InterfaceMemberBase): New OptAttributes field.
30993         (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take 
30994         the attributes as a parameter.
30995         (InterfaceProperty): Update constructor call.
30996         (InterfaceEvent): Ditto.
30997         (InterfaceMethod): Ditto.
30998         (InterfaceIndexer): Ditto.
31000         * cs-parser.jay (interface_indexer_declaration): Update call to constructor to 
31001         pass the attributes too.
31002         (interface_event_declaration): Ditto.
31003         (interface_property_declaration): Ditto.
31004         (interface_method_declaration): Ditto.
31005         (interface_declaration): Ditto.
31007 2001-09-05  Miguel de Icaza  <miguel@ximian.com>
31009         * class.cs (Method::Define): Track the "static Main" definition to
31010         create an entry point. 
31012         * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
31013         EntryPoint if we find it. 
31015         * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
31016         (EmitContext::ig): Make this variable public.
31018         * driver.cs: Make the default output file be the first file name
31019         with the .exe extension.  
31021         Detect empty compilations
31023         Handle various kinds of output targets.  Handle --target and
31024         rename -t to --dumper.
31026         * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
31027         methods inherited from Expression return now an Expression.  This
31028         will is used during the tree rewriting as we resolve them during
31029         semantic analysis.
31031         (Expression::MemberLookup): Implements the MemberLookup (7.3) from
31032         the spec.  Missing entirely is the information about
31033         accessability of elements of it.
31035         (Expression::ExprClassFromMemberInfo): New constructor for
31036         Expressions that creates a fully initialized Expression based on
31037         a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
31038         a Type.
31040         (Invocation::Resolve): Begin implementing resolution of invocations.
31042         * literal.cs (StringLiteral):  Implement Emit.
31044 2001-09-05  Ravi Pratap  <ravi@ximian.com>
31046         * cs-parser.jay (error): Add new modifier because we are hiding an inherited
31047         member.
31049 2001-09-04  Ravi Pratap  <ravi@ximian.com>
31051         * cs-parser.jay (attribute_arguments): Implement actions.
31052         (attribute): Fix bug in production. Implement action.
31053         (attribute_list): Implement.
31054         (attribute_target): Implement.
31055         (attribute_target_specifier, opt_target_specifier): Implement
31056         (CheckAttributeTarget): New method to check if the attribute target
31057         is valid.
31058         (attribute_section): Implement.
31059         (opt_attributes): Implement.
31061         * attribute.cs : New file to handle attributes.
31062         (Attribute): Class to hold attribute info.
31064         * cs-parser.jay (opt_attribute_target_specifier): Remove production
31065         (attribute_section): Modify production to use 2 different rules to 
31066         achieve the same thing. 1 s/r conflict down !
31067         Clean out commented, useless, non-reducing dimension_separator rules.
31069         * class.cs (TypeContainer.attributes): New member to hold list
31070         of attributes for a type.
31071         (Struct::Struct): Modify to take one more argument, the attribute list.
31072         (Class::Class): Ditto.
31073         (Field::Field): Ditto.
31074         (Method::Method): Ditto.
31075         (Property::Property): Ditto.
31077         * cs-parser.jay (struct_declaration): Update constructor call to
31078         pass in the attributes too.
31079         (class_declaration): Ditto.
31080         (constant_declaration): Ditto.
31081         (field_declaration): Ditto.
31082         (method_header): Ditto.
31083         (fixed_parameter): Ditto.
31084         (parameter_array): Ditto.
31085         (property_declaration): Ditto.
31087         * constant.cs (Constant::Constant): Update constructor similarly.
31088         Use System.Collections.
31090         * parameter.cs (Parameter::Parameter): Update as above.
31092 2001-09-02  Ravi Pratap  <ravi@ximian.com>
31094         * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
31095         (TypeContainer.delegates): New member to hold list of delegates.
31097         * cs-parser.jay (delegate_declaration): Implement the action correctly 
31098         this time as I seem to be on crack ;-)
31100 2001-09-02  Miguel de Icaza  <miguel@ximian.com>
31102         * rootcontext.cs (RootContext::IsNamespace): new function, used to
31103         tell whether an identifier represents a namespace.
31105         * expression.cs (NamespaceExpr): A namespace expression, used only
31106         temporarly during expression resolution.
31107         (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
31108         utility functions to resolve names on expressions.
31110 2001-09-01  Miguel de Icaza  <miguel@ximian.com>
31112         * codegen.cs: Add hook for StatementExpressions. 
31114         * class.cs: Fix inverted test for static flag in methods.
31116 2001-09-02  Ravi Pratap  <ravi@ximian.com>
31118         * class.cs (Operator::CheckUnaryOperator): Correct error number used
31119         to make it coincide with MS' number.
31120         (Operator::CheckBinaryOperator): Ditto.
31122         * ../errors/errors.txt : Remove error numbers added earlier.
31124         * ../errors/cs1019.cs : Test case for error # 1019
31126         * ../errros/cs1020.cs : Test case for error # 1020
31128         * cs-parser.jay : Clean out commented cruft.
31129         (dimension_separators, dimension_separator): Comment out. Ostensibly not
31130         used anywhere - non-reducing rule.
31131         (namespace_declarations): Non-reducing rule - comment out.
31133         * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
31134         with TypeContainer::AddEnum.
31136         * delegate.cs : New file for delegate handling classes.
31137         (Delegate): Class for declaring delegates.
31139         * makefile : Update.
31141         * cs-parser.jay (delegate_declaration): Implement.
31143 2001-09-01  Ravi Pratap  <ravi@che.iitm.ac.in>
31145         * class.cs (Event::Define): Implement.
31146         (Event.EventBuilder): New member.
31148         * class.cs (TypeContainer::Populate): Update to define all enums and events
31149         we have.
31150         (Events): New property for the events arraylist we hold. Shouldn't we move to using
31151         readonly fields for all these cases ?
31153 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
31155         * class.cs (Property): Revamp to use the convention of making fields readonly.
31156         Accordingly modify code elsewhere.
31158         * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
31159         the Define method of the Property class.
31161         * class.cs : Clean up applied patch and update references to variables etc. Fix 
31162         trivial bug.
31163         (TypeContainer::Populate): Update to define all the properties we have. Also
31164         define all enumerations.
31166         * enum.cs (Define): Implement.
31168 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
31170         * cs-parser.jay (overloadable_operator): The semantic value is an
31171         enum of the Operator class.
31172         (operator_declarator): Implement actions.
31173         (operator_declaration): Implement.
31175         * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
31176         validity of definitions.
31177         (Operator::CheckBinaryOperator): Static method to check for binary operators
31178         (TypeContainer::AddOperator): New method to add an operator to a type.
31180         * cs-parser.jay (indexer_declaration): Added line to actually call the
31181         AddIndexer method so it gets added ;-)
31183         * ../errors/errors.txt : Update to include new error numbers. Are these numbers 
31184         already taken care of by the MS compiler ?  
31186 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
31188         * class.cs (Operator): New class for operator declarations.
31189         (Operator::OpType): Enum for the various operators.
31191 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
31193         * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
31194         ostensibly handle this in semantic analysis.
31196         * cs-parser.jay (general_catch_clause): Comment out
31197         (specific_catch_clauses, specific_catch_clause): Ditto.
31198         (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
31199         (catch_args, opt_catch_args): New productions.
31200         (catch_clause): Rewrite to use the new productions above
31201         (catch_clauses): Modify accordingly.
31202         (opt_catch_clauses): New production to use in try_statement
31203         (try_statement): Revamp. Basically, we get rid of one unnecessary rule
31204         and re-write the code in the actions to extract the specific and
31205         general catch clauses by being a little smart ;-)
31207         * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
31208         Hooray, try and catch statements parse fine !
31210 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
31212         * statement.cs (Block::GetVariableType): Fix logic to extract the type
31213         string from the hashtable of variables.
31215         * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
31216         I end up making that mistake ;-)
31217         (catch_clauses): Fixed gross error which made Key and Value of the 
31218         DictionaryEntry the same : $1 !!
31220 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
31222         * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
31224         * cs-parser.jay (event_declaration): Correct to remove the semicolon
31225         when the add and remove accessors are specified. 
31227 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
31229         * cs-parser.jay (IndexerDeclaration): New helper class to hold
31230         information about indexer_declarator.
31231         (indexer_declarator): Implement actions.
31232         (parsing_indexer): New local boolean used to keep track of whether
31233         we are parsing indexers or properties. This is necessary because 
31234         implicit_parameters come into picture even for the get accessor in the 
31235         case of an indexer.
31236         (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
31238         * class.cs (Indexer): New class for indexer declarations.
31239         (TypeContainer::AddIndexer): New method to add an indexer to a type.
31240         (TypeContainer::indexers): New member to hold list of indexers for the
31241         type.
31243 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
31245         * cs-parser.jay (add_accessor_declaration): Implement action.
31246         (remove_accessor_declaration): Implement action.
31247         (event_accessors_declaration): Implement
31248         (variable_declarators): swap statements for first rule - trivial.
31250         * class.cs (Event): New class to hold information about event
31251         declarations.
31252         (TypeContainer::AddEvent): New method to add an event to a type
31253         (TypeContainer::events): New member to hold list of events.
31255         * cs-parser.jay (event_declaration): Implement actions.
31257 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
31259         * cs-parser.jay (dim_separators): Implement. Make it a string
31260         concatenating all the commas together, just as they appear.
31261         (opt_dim_separators): Modify accordingly
31262         (rank_specifiers): Update accordingly. Basically do the same
31263         thing - instead, collect the brackets here.
31264         (opt_rank_sepcifiers): Modify accordingly.
31265         (array_type): Modify to actually return the complete type string
31266         instead of ignoring the rank_specifiers.
31267         (expression_list): Implement to collect the expressions
31268         (variable_initializer): Implement. We make it a list of expressions
31269         essentially so that we can handle the array_initializer case neatly too.
31270         (variable_initializer_list): Implement.
31271         (array_initializer): Make it a list of variable_initializers
31272         (opt_array_initializer): Modify accordingly.
31274         * expression.cs (New::NType): Add enumeration to help us
31275         keep track of whether we have an object/delegate creation
31276         or an array creation.
31277         (New:NewType, New::Rank, New::Indices, New::Initializers): New
31278         members to hold data about array creation.
31279         (New:New): Modify to update NewType
31280         (New:New): New Overloaded contructor for the array creation
31281         case.
31283         * cs-parser.jay (array_creation_expression): Implement to call
31284         the overloaded New constructor.
31286 2001-08-26  Ravi Pratap  <ravi@che.iitm.ac.in>
31288         * class.cs (TypeContainer::Constructors): Return member
31289         constructors instead of returning null.
31291 2001-08-26  Miguel de Icaza  <miguel@ximian.com>
31293         * typemanager.cs (InitCoreTypes): Initialize the various core
31294         types after we have populated the type manager with the user
31295         defined types (this distinction will be important later while
31296         compiling corlib.dll)
31298         * expression.cs, literal.cs, assign.cs, constant.cs: Started work
31299         on Expression Classification.  Now all expressions have a method
31300         `Resolve' and a method `Emit'.
31302         * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
31303         generation from working.     Also add some temporary debugging
31304         code. 
31306 2001-08-24  Miguel de Icaza  <miguel@ximian.com>
31308         * codegen.cs: Lots of code generation pieces.  This is only the
31309         beginning, will continue tomorrow with more touches of polish.  We
31310         handle the fundamentals of if, while, do, for, return.  Others are
31311         trickier and I need to start working on invocations soon.
31313         * gen-treedump.cs: Bug fix, use s.Increment here instead of
31314         s.InitStatement. 
31316         * codegen.cs (EmitContext): New struct, used during code
31317         emission to keep a context.   Most of the code generation will be
31318         here. 
31320         * cs-parser.jay: Add embedded blocks to the list of statements of
31321         this block.  So code generation proceeds in a top down fashion.
31323 2001-08-23  Miguel de Icaza  <miguel@ximian.com>
31325         * statement.cs: Add support for multiple child blocks.
31327 2001-08-22  Miguel de Icaza  <miguel@ximian.com>
31329         * codegen.cs (EmitCode): New function, will emit the code for a
31330         Block of code given a TypeContainer and its ILGenerator. 
31332         * statement.cs (Block): Standard public readonly optimization.
31333         (Block::Block constructors): Link children. 
31334         (Block::Child): Child Linker.
31335         (Block::EmitVariables): Emits IL variable declarations.
31337         * class.cs: Drop support for MethodGroups here, delay until
31338         Semantic Analysis.
31339         (Method::): Applied the same simplification that I did before, and
31340         move from Properties to public readonly fields.
31341         (Method::ParameterTypes): Returns the parameter types for the
31342         function, and implements a cache that will be useful later when I
31343         do error checking and the semantic analysis on the methods is
31344         performed.
31345         (Constructor::GetCallingConvention): Renamed from CallingConvetion
31346         and made a method, optional argument tells whether this is a class
31347         or a structure to apply the `has-this' bit.
31348         (Method::GetCallingConvention): Implement, returns the calling
31349         convention. 
31350         (Method::Define): Defines the type, a second pass is performed
31351         later to populate the methods.
31353         (Constructor::ParameterTypes): implement a cache similar to the
31354         one on Method::ParameterTypes, useful later when we do semantic
31355         analysis. 
31357         (TypeContainer::EmitMethod):  New method.  Emits methods.
31359         * expression.cs: Removed MethodGroup class from here.
31361         * parameter.cs (Parameters::GetCallingConvention): new method.
31363 2001-08-21  Miguel de Icaza  <miguel@ximian.com>
31365         * class.cs (TypeContainer::Populate): Drop RootContext from the
31366         argument. 
31368         (Constructor::CallingConvention): Returns the calling convention.
31369         (Constructor::ParameterTypes): Returns the constructor parameter
31370         types. 
31372         (TypeContainer::AddConstructor): Keep track of default constructor
31373         and the default static constructor.
31375         (Constructor::) Another class that starts using `public readonly'
31376         instead of properties. 
31378         (Constructor::IsDefault): Whether this is a default constructor. 
31380         (Field::) use readonly public fields instead of properties also.
31382         (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
31383         track of static constructors;  If none is used, turn on
31384         BeforeFieldInit in the TypeAttributes. 
31386         * cs-parser.jay (opt_argument_list): now the return can be null
31387         for the cases where there are no arguments. 
31389         (constructor_declarator): If there is no implicit `base' or
31390         `this', then invoke the default parent constructor. 
31392         * modifiers.cs (MethodAttr): New static function maps a set of
31393         modifiers flags into a MethodAttributes enum
31394         (FieldAttr): renamed from `Map'.  So now we have FieldAttr,
31395         MethodAttr, TypeAttr to represent the various mappings where the
31396         modifiers are used.
31397         (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'  
31399 2001-08-19  Miguel de Icaza  <miguel@ximian.com>
31401         * parameter.cs (GetParameterInfo): Fix bug where there would be no
31402         method arguments.
31404         * interface.cs (PopulateIndexer): Implemented the code generator
31405         for interface indexers.
31407 2001-08-17  Miguel de Icaza  <miguel@ximian.com>
31409         * interface.cs (InterfaceMemberBase): Now we track the new status
31410         here.  
31412         (PopulateProperty): Implement property population.  Woohoo!  Got
31413         Methods and Properties going today. 
31415         Removed all the properties for interfaces, and replaced them with
31416         `public readonly' fields. 
31418 2001-08-16  Miguel de Icaza  <miguel@ximian.com>
31420         * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
31421         initialize their hashtables/arraylists only when they are needed
31422         instead of doing this always.
31424         * parameter.cs: Handle refs and out parameters.
31426         * cs-parser.jay: Use an ArrayList to construct the arguments
31427         instead of the ParameterCollection, and then cast that to a
31428         Parameter[] array.
31430         * parameter.cs: Drop the use of ParameterCollection and use
31431         instead arrays of Parameters.
31433         (GetParameterInfo): Use the Type, not the Name when resolving
31434         types. 
31436 2001-08-13  Miguel de Icaza  <miguel@ximian.com>
31438         * parameter.cs: Eliminate the properties Name, Type and ModFlags,
31439         and instead use public readonly fields.
31441         * class.cs: Put back walking code for type containers.
31443 2001-08-11  Miguel de Icaza  <miguel@ximian.com>
31445         * class.cs (MakeConstant): Code to define constants.
31447         * rootcontext.cs (LookupType): New function.  Used to locate types 
31450 2001-08-08  Miguel de Icaza  <miguel@ximian.com>
31452         * rootcontext.cs: OH MY!  My trick works!   It is amazing how nice
31453         this System.Reflection code is.  Kudos to Microsoft
31455         * typemanager.cs: Implement a type cache and avoid loading all
31456         types at boot time.  Wrap in LookupType the internals.  This made
31457         the compiler so much faster.  Wow.  I rule!
31459         * driver.cs: Make sure we always load mscorlib first (for
31460         debugging purposes, nothing really important).
31462         * Renamespaced things that were on `CSC' to `CIR'.  Maybe I should
31463         have moved to `CSC' rather than `CIR'.  Oh man!  The confussion!  
31465         * rootcontext.cs: Lookup types on their namespace;  Lookup types
31466         on namespaces that have been imported using the `using' keyword.
31468         * class.cs (TypeContainer::TypeAttr): Virtualize.
31469         (Class::TypeAttr): Return attributes suitable for this bad boy.
31470         (Struct::TypeAttr): ditto.
31471         Handle nested classes.
31472         (TypeContainer::) Remove all the type visiting code, it is now
31473         replaced with the rootcontext.cs code
31475         * rootcontext.cs (GetClassBases): Added support for structs. 
31477 2001-08-06  Miguel de Icaza  <miguel@ximian.com>
31479         * interface.cs, statement.cs, class.cs, parameter.cs,
31480         rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
31481         Drop use of TypeRefs, and use strings instead.
31483 2001-08-04  Miguel de Icaza  <miguel@ximian.com>
31485         * rootcontext.cs: 
31487         * class.cs (Struct::Struct): set the SEALED flags after
31488         checking the modifiers.
31489         (TypeContainer::TypeAttr): new property, returns the
31490         TypeAttributes for a class.  
31492         * cs-parser.jay (type_list): Oops, list production was creating a
31493         new list of base types.
31495         * rootcontext.cs (StdLib): New property.
31496         (GetInterfaceTypeByName): returns an interface by type name, and
31497         encapsulates error handling here.
31498         (GetInterfaces): simplified.
31499         (ResolveTree): Encapsulated all the tree resolution here.
31500         (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
31501         types. 
31503         * driver.cs: Add support for --nostdlib, to avoid loading the
31504         default assemblies.
31505         (Main): Do not put tree resolution here. 
31507         * rootcontext.cs: Beginning of the class resolution.
31509 2001-08-03  Miguel de Icaza  <miguel@ximian.com>
31511         * rootcontext.cs: Provide better error reporting. 
31513         * cs-parser.jay (interface_base): set our $$ to be interfaces.
31515         * rootcontext.cs (CreateInterface): Handle the case where there
31516         are no parent interfaces.
31518         (CloseTypes): Routine to flush types at the end.
31519         (CreateInterface): Track types.
31520         (GetInterfaces): Returns an array of Types from the list of
31521         defined interfaces.
31523         * typemanager.c (AddUserType): Mechanism to track user types (puts
31524         the type on the global type hash, and allows us to close it at the
31525         end). 
31527 2001-08-02  Miguel de Icaza  <miguel@ximian.com>
31529         * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
31530         RecordInterface instead.
31532         * cs-parser.jay: Updated to reflect changes above.
31534         * decl.cs (Definition): Keep track of the TypeBuilder type that
31535         represents this type here.  Not sure we will use it in the long
31536         run, but wont hurt for now.
31538         * driver.cs: Smaller changes to accomodate the new code.
31540         Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
31541         when done. 
31543         * rootcontext.cs (CreateInterface):  New method, used to create
31544         the System.TypeBuilder type for interfaces.
31545         (ResolveInterfaces): new entry point to resolve the interface
31546         hierarchy. 
31547         (CodeGen): Property, used to keep track of the code generator.
31549 2001-07-26  Miguel de Icaza  <miguel@ximian.com>
31551         * cs-parser.jay: Add a second production for delegate_declaration
31552         with `VOID'.
31554         (enum_body): Put an opt_comma here instead of putting it on
31555         enum_body or enum_member_declarations so we can handle trailing
31556         commas on enumeration members.  Gets rid of a shift/reduce.
31558         (type_list): Need a COMMA in the middle.
31560         (indexer_declaration): Tell tokenizer to recognize get/set
31562         * Remove old targets.
31564         * Re-add the parser target.
31566 2001-07-13  Simon Cozens <simon@simon-cozens.org>
31568         * cs-parser.jay: Add precendence rules for a number of operators
31569         ot reduce the number of shift/reduce conflicts in the grammar.
31571 2001-07-17  Miguel de Icaza  <miguel@ximian.com>
31573         * tree.cs: moved IGenerator interface and renamed it to ITreeDump
31574         and put it here.
31576         Get rid of old crufty code.
31578         * rootcontext.cs: Use this to keep track of the parsed
31579         representation and the defined types available to the program. 
31581         * gen-treedump.cs: adjust for new convention.
31583         * type.cs: Split out the type manager, and the assembly builder
31584         from here. 
31586         * typemanager.cs: the type manager will live here now.
31588         * cil-codegen.cs: And the code generator here. 
31590 2001-07-14  Sean MacIsaac  <macisaac@ximian.com>
31592         * makefile: Fixed up for easy making.
31594 2001-07-13  Simon Cozens <simon@simon-cozens.org>
31596         * cs-parser.jay (rank_specifier): Remove a conflict by reordering
31597         the 
31599         (unary_expression): Expand pre_increment_expression and
31600         post_decrement_expression to reduce a shift/reduce.
31602 2001-07-11  Simon Cozens
31604         * cs-tokenizer.cs: Hex numbers should begin with a 0.
31606         Improve allow_keyword_as_indent name.
31608 2001-06-19  Miguel de Icaza  <miguel@ximian.com>
31610         * Adjustments for Beta2. 
31612 2001-06-13  Miguel de Icaza  <miguel@ximian.com>
31614         * decl.cs: Added `Define' abstract method.
31615         (InTransit): new property, used to catch recursive definitions. 
31617         * interface.cs: Implement `Define'. 
31619         * modifiers.cs: Map Modifiers.constants to
31620         System.Reflection.TypeAttribute flags.
31622         * class.cs: Keep track of types and user-defined types.
31623         (BuilderInit): New method for creating an assembly
31624         (ResolveType): New function to launch the resolution process, only
31625         used by interfaces for now.
31627         * cs-parser.jay: Keep track of Classes, Structs and Interfaces
31628         that are inserted into the name space. 
31630 2001-06-08  Miguel de Icaza  <miguel@ximian.com>
31632         * ARGH.  I have screwed up my tree so many times due to the use of
31633         rsync rather than using CVS.  Going to fix this at once. 
31635         * driver.cs: Objetify driver.  Load assemblies, use assemblies to
31636         load types.
31638 2001-06-07  Miguel de Icaza  <miguel@ximian.com>
31640         * Experiment successful: Use System.Type rather that our own
31641         version of Type.  
31643 2001-05-25  Miguel de Icaza  <miguel@ximian.com>
31645         * cs-parser.jay: Removed nsAliases from here.
31647         Use new namespaces, handle `using XXX;' 
31649         * namespace.cs: Reimplemented namespace handling, use a recursive
31650         definition of the class.  Now we can keep track of using clauses
31651         and catch invalid using clauses.
31653 2001-05-24  Miguel de Icaza  <miguel@ximian.com>
31655         * gen-treedump.cs: Adapted for all the renaming.
31657         * expression.cs (Expression): this class now has a Type property
31658         which returns an expression Type.
31660         (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
31661         `Type', as this has a different meaning now in the base
31663 2001-05-22  Miguel de Icaza  <miguel@ximian.com>
31665         * interface.cs, class.cs: Removed from all the sources the
31666         references to signature computation, as we can not do method
31667         signature computation during the parsing time, as we are not
31668         trying to solve at that point distinguishing:
31670         class X {
31671                 void a (Blah x) {}
31672                 void a (NS.Blah x) {}
31673         }
31675         Which depending on the context might be valid or not, as we do not
31676         know if Blah is the same thing as NS.Blah at that point.
31678         * Redid everything so the code uses TypeRefs now instead of
31679         Types.  TypeRefs are just temporary type placeholders, that need
31680         to be resolved.  They initially have a pointer to a string and the
31681         current scope in which they are used.  This is used later by the
31682         compiler to resolve the reference to an actual Type. 
31684         * DeclSpace is no longer a CIR.Type, and neither are
31685         TypeContainers (Class and Struct) nor Interfaces nor Enums.  They
31686         are all DeclSpaces, but no Types. 
31688         * type.cs (TypeRefManager): This implements the TypeRef manager,
31689         which keeps track of all the types that need to be resolved after
31690         the parsing has finished. 
31692 2001-05-13  Miguel de Icaza  <miguel@ximian.com>
31694         * ARGH.  We are going to have to store `foreach' as a class rather
31695         than resolving it, as we need to verify error 1579 after name
31696         resolution.   *OR* we could keep a flag that says `This request to
31697         IEnumerator comes from a foreach statement' which we can then use
31698         to generate the error.
31700 2001-05-10  Miguel de Icaza  <miguel@ximian.com>
31702         * class.cs (TypeContainer.AddMethod): we now add methods to the
31703         MethodGroup instead of the method hashtable.  
31705         * expression.cs: Add MethodGroup abstraction, which gets us one
31706         step closer to the specification in the way we handle method
31707         declarations.  
31709         * cs-parser.jay (primary_expression): qualified_identifier now
31710         tried to match up an identifier to a local variable reference or
31711         to a parameter reference.
31713         current_local_parameters is now a parser global variable that
31714         points to the current parameters for the block, used during name
31715         lookup.
31717         (property_declaration): Now creates an implicit `value' argument to
31718         the set accessor.
31720 2001-05-09  Miguel de Icaza  <miguel@ximian.com>
31722         * parameter.cs: Do not use `param' arguments as part of the
31723         signature, per the spec.
31725 2001-05-08  Miguel de Icaza  <miguel@ximian.com>
31727         * decl.cs: Base class for classes, structs and interfaces.  This
31728         is the "Declaration Space" 
31730         * cs-parser.jay: Use CheckDef for checking declaration errors
31731         instead of having one on each function.
31733         * class.cs: Factor out some code for handling error handling in
31734         accordance to the "Declarations" section in the "Basic Concepts"
31735         chapter in the ECMA C# spec.
31737         * interface.cs: Make all interface member classes derive from
31738         InterfaceMemberBase.
31740 2001-05-07  Miguel de Icaza  <miguel@ximian.com>
31742         * Many things: all interfaces are parsed and generated in
31743         gen-treedump.  Support for member variables, constructors,
31744         destructors, properties, constants is there.
31746         Beginning of the IL backend, but very little done, just there for
31747         testing purposes. 
31749 2001-04-29  Miguel de Icaza  <miguel@ximian.com>
31751         * cs-parser.jay: Fix labeled statement.
31753         * cs-tokenizer.cs (escape): Escape " and ' always.
31754         ref_line, ref_name: keep track of the line/filename as instructed
31755         by #line by the compiler.
31756         Parse #line.
31758 2001-04-27  Miguel de Icaza  <miguel@ximian.com>
31760         * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
31761         to match the values in System.CodeDOM.
31763         Divid renamed to Divide.
31765         * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
31766         statements. 
31767         (Statements.set): remove.
31769         * System.CodeDOM/CodeCatchClause.cs: always have a valid
31770         statements. 
31772         * System.CodeDOM/CodeIfStatement.cs: trueStatements and
31773         falseStatements always have valid values. 
31775         * cs-parser.jay: Use System.CodeDOM now.