**** Merged r45656-r45657 from MCS ****
[mono.git] / mcs / gmcs / ChangeLog
index 6cd8c8f56b467961efea2c5ceeb60c94766da6d2..457f328c68c54a388169eec5fbf8ad40d47a2027 100644 (file)
@@ -1,3 +1,443 @@
+2005-06-08  Miguel de Icaza  <miguel@novell.com>
+
+       * class.cs: Small fix.
+
+2005-06-08  Raja R Harinath  <rharinath@novell.com>
+
+       Fix #75160.
+       * class.cs (GetPartialBases): Fix return value check of
+       part.GetClassBases.
+
+2005-06-07  Raja R Harinath  <rharinath@novell.com>
+
+       Ensure that partial classes are registered in their enclosing
+       namespace.  Initial part of fix of #75160.
+       * tree.cs (Tree.RecordDecl): Add new namespace argument.
+       Register declspace with namespace here, not in
+       DeclSpace.RecordDecl.
+       * cs-parser.jay: Pass namespace to RecordDecl.
+       * class.cs (PartialContainer.Create): Likewise.
+       (ClassPart.DefineType): New sanity-check.  Throws an exception if
+       called.
+       * decl.cs (Declspace.RecordDecl): Remove.
+       * namespace.cs (NamespaceEntry.DefineName): Remove.
+
+2005-06-06  Marek Safar  <marek.safar@seznam.cz>
+
+       * rootcontext.cs: Reset TargetExt as well.
+
+2005-06-03  Raja R Harinath  <rharinath@novell.com>
+
+       * ecore.cs (Expression.Resolve): Emit CS0654 error when
+       -langversion:ISO-1.
+
+2005-06-02  Raja R Harinath  <rharinath@novell.com>
+
+       Fix #75080, cs0119.cs.
+       * ecore.cs (Expression.ExprClassToResolveFlags): New.  Broken out
+       of ...
+       (Expression.Resolve): ... this.  Use it.  Remove bogus code
+       allowing ExprClass.Type and ExprClass.Namespace for
+       ResolveFlags.VariableOrValue.
+       (Expression.Resolve) [1-argument variant]: Change default resolve
+       flags based on language version.
+       (Expression.Error_UnexpectedKind): Use a simple string array
+       rather than an ArrayList.
+       * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
+       not ExprClass.Type.
+       (TypeOfVoid.DoResolve): Likewise.
+       (MemberAccess.DoResolve) [3-argument variant]: Make private.  Drop
+       flags argument -- it always has the same value.
+
+2005-05-31  Raja R Harinath  <rharinath@novell.com>
+
+       Fix #75081.
+       * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
+       Use it in the error message.
+       * assign.cs, expression.cs, statement.cs: Update.
+
+2005-05-30  Raja R Harinath  <rharinath@novell.com>
+
+       Fix #75088.
+       * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
+       the "almostMatchedMember" case too.
+       * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
+       that failed the accessibility checks to 'almost_match'.
+
+2005-05-27  Vladimir Vukicevic  <vladimir@pobox.com>
+
+       * attribute.cs: Use internal MethodBuilder methods to set
+       ExactSpelling and SetLastError on PInvoke methods, instead
+       of passing them via charset.  Fixes #75060.
+
+2005-05-27  Raja R Harinath  <rharinath@novell.com>
+
+       * parameter.cs (Parameter): Remove TODO comment.
+       (Parameter.DefineParameter): Remove Location parameter.
+       (Parameters.LabelParameters): Likewise.
+       * class.cs (Constructor.Emit): Update to change.
+       (MethodData.Emit): Likewise.
+       * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.  
+       * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
+
+2005-05-27  Atsushi Enomoto  <atsushi@ximian.com>
+
+       * parameter.cs,
+         Removed Parameters.Location and added Parameter.Location instead.
+         Removed Location parameter from Emit() and GetSignature().
+       * anonymous.cs,
+         class.cs,
+         cs-parser.jay,
+         delegate.cs,
+         iterators.cs,
+         statement.cs :
+         Modified all related calls.
+
+2005-06-21  Martin Baulig  <martin@ximian.com>
+
+       * generic.cs (NullCoalescingOperator.Emit): Make this work if the
+       left-hand side is not a nullable type; fixes #75328.
+
+2005-06-21  Martin Baulig  <martin@ximian.com>
+
+       * typemanager.cs
+       (TypeManager.CSharpName): Use GetFullName() instead of `t.FullName'.
+       (TypeManager.GetFullNameSignature): Likewise.
+
+       * convert.cs (Convert.Error_CannotImplicitConversion): Compare
+       `source.FullName' and `target.FullName' to check whether there are
+       two conflicting definitions.
+
+2005-06-21  Martin Baulig  <martin@ximian.com>
+
+       * convert.cs (Convert.ImplicitTypeParameterConversion): Always use
+       a BoxedCast - also for reference types - to be compatible with csc.
+
+2005-06-21  Martin Baulig  <martin@ximian.com>
+
+       * expression.cs (MemberAccess.DoResolve): Add support for nested
+       types in a generic instance; fixes #75320.
+
+2005-06-20  Martin Baulig  <martin@ximian.com>
+
+       * generic.cs (TypeManager.InferType): Also walk the class
+       hierarchy for generic instances; fixes #75261.
+
+2005-06-17  Martin Baulig  <martin@ximian.com>
+
+       * typemanager.cs (TypeManager.IsBuiltinType): Use TypeToCoreType()
+       to make things work for corlib.
+
+2005-06-15  Martin Baulig  <martin@ximian.com>
+
+       * attribute.cs (Attribute.CheckSecurityActionValidity): Remove the
+       obsolete `SecurityAction' values.
+
+2005-06-06  Marek Safar  <marek.safar@seznam.cz>
+
+       * rootcontext.cs: Reset TargetExt as well.
+       
+2005-06-09  Martin Baulig  <martin@ximian.com>
+
+       * delegate.cs (Delegate.VerifyMethod): Added
+       `MethodGroupExpr old_mg' argument; inherit its
+       `HasTypeParameters'; fix #75085.
+
+2005-06-09  Martin Baulig  <martin@ximian.com>
+
+       * expression.cs (Invocation.OverloadResolve): Correctly handle
+       generic methods for the SetMemberIsUsed(); fix #75064.
+
+2005-06-09  Martin Baulig  <martin@ximian.com>
+
+       * statement.cs (Throw.Resolve): Use TypeManager.IsSubclassOf();
+       fixes #75062.
+
+2005-06-08  Martin Baulig  <martin@ximian.com>
+
+       * cs-parser.jay (nullable_type_or_conditional): If we put the
+       nullable back and our `type' is a `ComposedCast', remove the
+       nullable from it.  Fixes #75156.
+
+       * expression.cs (ComposedCast.RemoveNullable): New public method.
+
+2005-06-08  Martin Baulig  <martin@ximian.com>
+
+       The big Iterators rewrite :-)
+
+       * iterators.cs: Rewrite this to use the anonymous methods framework.
+
+       * rootcontext.cs (RootContext.DefineTypes): Define Delegates
+       before the TypeContainers; see 2test-21.cs.
+
+       * class.cs
+       (TypeContainer.DefineType): Don't create a new EmitContext if we
+       already have one (this only happens if we're an Iterator).
+       (TypeContainer.Define): Also call Define() on all our iterators.
+       (Method.CreateEmitContext): Added support for iterators.
+
+       * anonymous.cs
+       (AnonymousContainer): New abstract base class for `AnonymousMethod'.
+       (AnonymousContainer.CreateMethodHost): Moved here from
+       AnonymousMethod and made abstract.
+       (AnonymousContainer.CreateScopeType): New abstract method.
+       (AnonymousContainer.IsIterator): New public property.
+       (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
+       get the ScopeTypeBuilder rather than manually defining it here. 
+       (ScopeInfo.EmitScopeInstance): New public method; correctly handle
+       iterators here.
+
+       * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
+       before RootContext.DefineTypes().
+
+       * codegen.cs (EmitContext.RemapToProxy): Removed.
+       (EmitContext.CurrentAnonymousMethod): Changed type from
+       AnonymousMethod -> AnonymousContainer.
+       (EmitContext.ResolveTopBlock): Protect from being called twice.
+       (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
+       (EmitContext.EmitThis): Removed the iterators hacks; use the
+       anonymous methods framework for that.
+
+       * statement.cs
+       (ToplevelBlock.Container): Make this a property, not a field.
+       (ToplevelBlock.ReParent): New public method; move the
+       ToplevelBlock into a new container.
+       (Foreach.TemporaryVariable): Simplify.
+
+2005-06-05  Martin Baulig  <martin@ximian.com>
+
+       * statement.cs (LocalInfo.CompilerGenerated): New flag.
+       (Block.AddTemporaryVariable): New public method; creates a new
+       `LocalInfo' for a temporary variable.
+       (Block.EmitMeta): Create the LocalBuilders for all the temporary
+       variables here.
+       (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
+       non-iterator variables.
+
+2005-06-05  Martin Baulig  <martin@ximian.com>
+
+       * statement.cs (Foreach.TemporaryVariable): Create the
+       LocalBuilder in the Emit phase and not in Resolve since in some
+       situations, we don't have an ILGenerator during Resolve; see
+       2test-19.cs for an example.
+
+2005-06-04  Martin Baulig  <martin@ximian.com>
+
+       The big Foreach rewrite - Part II.
+
+       * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
+       with `PropertyInfo ienumerator_getcurrent'.
+
+       * codegen.cs (VariableStorage): Removed.
+
+       * statement.cs
+       (Foreach): Derive from Statement, not ExceptionStatement.
+       (Foreach.CollectionForeach): New nested class.  Moved all the code
+       dealing with collection foreach here.
+       (Foreach.ForeachHelperMethods): Removed.
+       (Foreach.TemporaryVariable): Implement IMemoryLocation.
+
+2005-05-23  Martin Baulig  <martin@ximian.com>
+
+       * statement.cs (Try.DoResolve): Don't create a `finally' if we
+       don't need to.  Fix #75014.
+
+2005-05-24  Duncan Mak  <duncan@novell.com>
+
+       * ecore.cs (CastFromDecimal): New class for casting a decimal to
+       another class, used in Convert.ExplicitNumericConversion.
+       (CastToDecimal): New class, similar to above, but casts to
+       System.Decimal, used in Convert.ImplicitNumericConversion and also
+       in explicit convesion from double/float to decimal.
+
+       * convert.cs (ImplicitNumericConversion): Handle implicit
+       conversions to System.Decimal.
+       (ExplicitNumericConversion): handle explicit conversions to
+       System.Decimal.
+
+       This fixes #68711.
+       
+2005-05-20  Miguel de Icaza  <miguel@novell.com>
+
+       * typemanager.cs: Do not throw an exception in the TypeBuilder
+       case, we take care of it on the TypeCode.
+
+2005-05-17  Marek Safar  <marek.safar@seznam.cz>
+       
+       * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
+       is back.
+       
+       * cs-parser.jay: Catch more lexical errors.
+       
+       * report.cs: Add one more Error method.
+       
+       * rootcontext.cs,
+       * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
+
+2005-05-20  Martin Baulig  <martin@ximian.com>
+
+       * class.cs (TypeContainer.CircularDepException): Removed.
+       (TypeContainer.DefineType): Removed the `InTransit' stuff.
+       (TypeContainer.CheckRecursiveDefinition): Check for circular class
+       (CS0146) and interface (CS0529) dependencies here.
+
+2005-05-20  Martin Baulig  <martin@ximian.com>
+
+       * expression.cs (New.DoResolve): Move the CS0712 check above the
+       CS0144 check; otherwise it can never be reached.
+
+2005-05-20  Martin Baulig  <martin@ximian.com>
+
+       * cs-parser.jay: Fix CS0080 check; add CS0231 and CS0257 from MCS.
+
+2005-05-20  Martin Baulig  <martin@ximian.com>
+
+       * class.cs (TypeContainer.DefineType): Fix CS0698 check.
+
+       * typemanager.cs (TypeManager.IsAttributeType): New public method.
+
+2005-05-19  Martin Baulig  <martin@ximian.com>
+
+       * delegate.cs
+       (ImplicitDelegateCreation.Check): Added `bool check_only' argument
+       to disable error reporting.
+
+       * convert.cs (Convert.ImplicitStandardConversionExists): Use it
+       here since we don't want to report an error; see the new test-336.cs.
+
+2005-05-19  Raja R Harinath  <rharinath@novell.com>
+
+       * statement.cs (ToplevelBlock.GetParameterReference)
+       (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
+       Move here from class Block.
+       * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
+       * expression.cs (ParameterReference.DoResolveBase): Likewise.
+
+2005-05-18  Martin Baulig  <martin@ximian.com>
+
+       Fix #74978.
+
+       * flowanalysis.cs
+       (FlowBranching.Reachability): Add non-static public And() and Or()
+       methods.
+       (FlowBranchingSwitch): New class; do the `break_origins' thing
+       like in FlowBranchingLoop.
+       (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
+       reachability, not just locals and parameters.
+       (FlowBranching.MergeChild): Remove some of the hacks for loop and
+       switch; MergeBreakOrigins() now takes care of that.
+
+2005-05-18  Martin Baulig  <martin@ximian.com>
+
+       * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
+       a loop and may leave it, reset the barrier; fixes #74974.
+
+2005-05-16  Raja R Harinath  <rharinath@novell.com>
+
+       Fix test-382.cs.  Emit values of decimal constants.
+       * class.cs (TypeContainer.RegisterFieldForInitialization): New.
+       Carved out of ...
+       (TypeContainer.AddField): ... this.
+       (TypeContainer.EmitFieldInitializers): Allow the list of fields
+       with initializers to include 'Const's.
+       (ClassPart.RegisterFieldForInitialization): Forward to
+       PartialContainer.
+       * const.cs (Const.Const): Pass initializer to base class.
+       (Const.Define): In case of decimal constants, register them for
+       initialization in a static constructor.
+
+2005-05-14  Martin Baulig  <martin@ximian.com>
+
+       * statement.cs (Block.Resolve): Correctly handle unreachable code;
+       do not call ResolveUnreachable() on unreachable statements in
+       here, see the comment in the source code.
+
+2005-05-13  Raja R Harinath  <rharinath@novell.com>
+
+       Fix #74934.
+       * expression.cs (BinaryResolveOperator): If one of the operands of
+       an equality comparison is 'null' and the other is a pointer type,
+       convert the null to a NullPointer.
+       * convert.cs (ImplicitReferenceConversion): If the expression is a
+       NullLiteral and the target type is a pointer type, return a
+       NullPointer instead.
+       (ImplicitConversionStandard): Likewise.
+
+2005-05-13  Marek Safar  <marek.safar@seznam.cz>
+       
+       * cs-parser.jay: Set readonly context based on special constructs.
+       
+       * expression.cs (LocalVariableReference.DoResolveBase): Improved
+       readonly variable error handling.
+       
+       * rootcontext.cs (EmitCode): Don't verify members when error
+       occurred.
+       
+       * statement.cs (LocalInfo): Add reaodnly context information.
+       (SetReadOnlyContext, GetReadOnlyContext): New methods.
+
+2005-05-17  Martin Baulig  <martin@ximian.com>
+
+       * expression.cs (Argument.Resolve): Turn on flow analysis; fix
+       #70970. 
+
+2005-05-13  Martin Baulig  <martin@ximian.com>
+
+       * statement.cs (Block.Resolve, ResolveUnreachable): Correctly
+       handle unreachable blocks.
+
+2005-05-13  Martin Baulig  <martin@ximian.com>
+
+       * class.cs
+       (ConstructorInitializer.GetOverloadedConstructor): Don't crash.
+       (MethodCore.CheckCore): Use TypeManager.IsEqual(); fix #74904 and
+       #74905. 
+
+2005-05-13  Martin Baulig  <martin@ximian.com>
+
+       * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
+       instance variable, not a local.  Fix #74873.
+       (Block.ResolveUnreachable): Set it to true here.
+
+2005-05-12  Martin Baulig  <martin@ximian.com>
+
+       * cs-parser.jay (property_declaration): Pass the `current_class',
+       not the `current_container' to Property's .ctor.  Fixes #74912.
+
+2005-05-11  Martin Baulig  <martin@ximian.com>
+
+       * typemanager.cs (Closure): Copy this from MCS and merge all the
+       GMCS-specific changes into it.
+
+2005-05-12  Raja R Harinath  <harinath@gmail.com>
+
+       Fix #74920.
+       * typemanager.cs (unmanaged_enclosing_types): New.
+       (IsUnmanagedType): Avoid infloops by using
+       'unmanaged_enclosing_types' to talk with recursive invocations.
+
+2005-05-11  Duncan Mak  <duncan@novell.com>
+
+       * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
+       continuing to process for 'arg'.
+       (handle_preprocessing_directive): Check the argument of the #endif
+       directive and report error CS1025 if there are any trailing
+       characters.
+
+       According to the C# spec, having even whitespace after the #endif
+       directive is illegal; however, because we call arg.TrimEnd ()
+       beforehand, we have the same behavior as csc, allowing whitespace
+       after the directive.
+
+       Fixes #74892.
+
+2005-05-11  Marek Safar  <marek.safar@seznam.cz>
+
+       Fix #74863.
+       
+       * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
+       (Constructor.GetObsoleteAttribute): Implemented correctly.
+
 2005-05-10  Martin Baulig  <martin@ximian.com>
 
        * generic.cs (Constraints.Resolve): Report CS0246 if we cannot
 
        * codegen.cs (EmitContext.ResolvingTypeTree): New public field.
 
+2005-05-10  Marek Safar  <marek.safar@seznam.cz>
+
+       * class.cs (Method.Define): Catch attempt for Finalizer declaration.
+       
+       * expression.cs (Argument.GetParameterModifier): Turned to property.
+       (Invocation.Error_InvalidArguments): Add more descriptive errors.
+       
+       * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
+       its C# equivalent.
+       
+2005-05-09  Raja R Harinath  <rharinath@novell.com>
+
+       Fix #74852.
+       * decl.cs (MemberCache.AddMethods): Register override methods,
+       rather than non-override methods.
+       * typemanager.cs (RegisterOverride): New.
+       (IsOverride): Update.
+
 2005-05-09  Marek Safar  <marek.safar@seznam.cz>
 
        * typemanager.cs (TypeManager): Moved InitGenerics to Reset method.
        (Attributable.IsClsComplianceRequired): Fix typo in the method name.
        (AttributeTester.AnalyzeTypeCompliance): Add generics support.
 
+2005-05-09  Marek Safar  <marek.safar@seznam.cz>
+
+       Fix #73105.
+       
+       * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
+       recursive declaration.
+       
+       * statement.cs (Block.ResolveMeta): Report any error in resolving.
+       
+2005-05-06  Marek Safar  <marek.safar@seznam.cz>
+
+       * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
+       
+       * expression.cs (Binary.DoResolve): (x && 0) is always 0.
+
+2005-05-05  Raja R Harinath  <rharinath@novell.com>
+
+       Fix #74797.
+       * decl.cs (DeclSpace.FamilyAccessible): 
+       Use TypeManager.IsNestedFamilyAccessible.
+
+       Fix reopened #64812.
+       * typemanager.cs (Closure.Filter): Introduce checks for 'protected
+       internal'.
+
+2005-05-04  Raja R Harinath  <rharinath@novell.com>
+           Abin Thomas  <projectmonokochi@rediffmail.com>
+           Anoob V E  <projectmonokochi@rediffmail.com>
+           Harilal P R  <projectmonokochi@rediffmail.com>
+
+       Fix #64812.
+       * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
+       allow access to all static members.
+
 2005-05-04  Martin Baulig  <martin@ximian.com>
 
        * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
 
 2005-05-03  Raja R Harinath  <rharinath@novell.com>
 
+       * pending.cs (BaseImplements): Move the #74773 fix here.  This is
+       more conservative.
+       (VerifyPendingMethods): Revert change below.
+
        * typemanager.cs (IsOverride, RegisterNonOverride): New.
        * decl.cs (MemberCache.AddMethod): Register "non-override" methods
        that used to trigger warning -28.  Remove warning -28.
        * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
        Report.Stderr.
        
+2005-04-18  Raja R Harinath  <rharinath@novell.com>
+
+       Fix #74481.
+       * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
+       (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
+       all null comparisons against reference types.
+
 2005-04-18  Marek Safar  <marek.safar@seznam.cz>
 
        Fix# 74565