disable the building of mjs while I solve the problem with the unexposed ctr of Context
[mono.git] / mcs / mcs / ChangeLog
index a9c059a725bfc252614172b675b7136b0a9531c3..774ddaffcc1449f541e39c585265d3853fbc5bc0 100644 (file)
@@ -1,3 +1,556 @@
+2005-02-11  Miguel de Icaza  <miguel@novell.com>
+
+       * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
+       variable.  This one is represents the actual low-level declaration
+       of the method, as opposed to the semantic level `IsStatic'.   
+
+       An anonymous method which is hosted into a static method might be
+       actually an instance method.  IsStatic would reflect the
+       container, while MethodIsStatic represents the actual code
+       generated.
+
+       * expression.cs (ParameterReference): Use the new MethodIsStatic
+       instead of IsStatic.
+
+       * anonymous.cs (AnonymousMethod.Compatible): Pass the
+       Modifiers.STATIC to the Anonymous' Method EmitContext if static is
+       set on the current EmitContext. 
+
+       * expression.cs (Cast): Overload DoResolveLValue so we can pass
+       resolve our casted expression as an LValue.  This triggers the
+       proper LValue processing that is later required by Assign.
+
+       This fixes 72347.
+
+       * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
+
+2005-02-11  Marek Safar  <marek.safar@seznam.cz>
+
+       C# 2.0 Fixed buffer implementation
+
+       * anonymous.cs: Update after RegisterHelperClass renaming.
+
+       * attribute.cs (AttributeTester.fixed_buffer_cache):
+       Cache of external fixed buffers.
+       (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
+       implementation if field is fixed buffer else null.
+
+       * class.cs
+       (TypeContainer.AddField): Accept FieldMember instead of Field.
+       (FieldBase.IsFieldClsCompliant): Extracted code from
+       VerifyClsCompliance descendant customization.
+       (FixedField): New class handles fixed buffer fields.
+       (FixedFieldExternal): Keeps information about imported fixed
+       buffer.
+       (IFixedField): Make access to internal or external fixed buffer
+       same.
+
+       * cs-parser.jay: Add fixed buffer parsing.
+
+       * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
+       buffer.
+
+       * expression.cs (Indirection): Extended implementation to accept
+       fixed buffer field.
+       (PointerArithmetic.Emit): Get element from fixed buffer as well.
+       (ElementAccess.MakePointerAccess): Get type as parameter.
+       (DoResolve): Add fixed buffer field expression conversion.
+       (DoResolveLValue): Ditto.
+       (FixedBufferPtr): New class. Moved most of original ArrayPtr.
+       (ArrayPtr): Derives from FixedBufferPtr.
+       (ArrayPtr.Emit): Add extra emit for array elements.
+
+       * flowanalysis.cs.cs (StructInfo): Use FieldMember.
+
+       * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
+       for compiler generated types.
+       (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
+
+       * statement.cs (Fixed): Refactored to be easier add fixed buffer
+       and consume less memory.
+       (Fixed.Resolve): Add fixed buffer case.
+
+       * typemanager.cs (compiler_generated_attr_ctor,
+       fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
+       (HasElementType): Add our own implementation to work on every
+       runtime.
+
+2005-02-11  Miguel de Icaza  <miguel@novell.com>
+
+       * anonymous.cs (CaptureContext): Track whether `this' has been
+       referenced.   
+
+       * expression.cs (This.ResolveBase): Call CaptureThis.  Before we
+       only captured `this' if it was implicitly done (instance
+       methods/variables were used). 
+
+       * codegen.cs (EmitContext.CaptureThis): New method to flag that
+       `this' must be captured.
+
+2005-01-30  Miguel de Icaza  <miguel@novell.com>
+       * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
+       is null it means that there has been no need to capture anything,
+       so we just create a sibling.
+
+       Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
+
+       Just a partial fix.  The other half is fairly elusive.
+       
+2005-02-10  Raja R Harinath  <rharinath@novell.com>
+
+       Fix #52586, cs0121-4.cs.
+       * decl.cs (MemberCache.DeepCopy): Rename from SetupCache.  Take
+       and return a hashtable.
+       (MemberCache.ClearDeclaredOnly): New.
+       (MemberCache.MemberCache): Update to change.  Make a deep copy of
+       the method_hash of a base type too.
+       (MemberCache.AddMethods): Adapt to having a deep copy of the base
+       type methods.  Overwrite entries with the same MethodHandle so
+       that the ReflectedType is correct.  The process leaves in base
+       virtual functions and their overrides as distinct entries.
+       (CacheEntry): Now a class instead of a struct.  It shouldn't alter
+       matters since it was boxed in a ArrayList before.
+       (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
+       modifier.
+       * expression.cs (Invocation.BetterFunction): Simplify.  Handle the
+       case of a virtual function and its override (choose the overload
+       as better).
+       (Invocation.OverloadResolve): Avoid 'override' members during
+       'applicable_type' calculation.
+
+2005-02-09  Raja R Harinath  <rharinath@novell.com>
+
+       Combine two near-redundant caches.
+       * typemanager.cs (method_params): Rename from method_internal_params.
+       (TypeManager.GetParameterData): New.  Replace
+       Invocation.GetParameterData.
+       (TypeManager.LookupParametersByBuilder): Remove.
+       * expression.cs (Invocation.method_parameter_cache): Remove.
+       (Invocation.GetParameterData): Remove.
+       Update to changes.
+       * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
+       Update to changes.
+
+2005-02-08  Raja R Harinath  <rharinath@novell.com>
+
+       Fix #72015.
+       * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
+       TypeManager.multicast_delegate_type is null, resolve it by looking
+       up "System.MulticastDelegate".
+       * rootcontext.cs (RootContext.ResolveCore): Simplify.
+
+2005-02-07  Abin Thomas (NOSIP)  <projectmonokochi@rediffmail.com>
+           Anoob V.E (NOSIP)  <projectmonokochi@rediffmail.com>
+           Harilal P.R (NOSIP)  <projectmonokochi@rediffmail.com>
+
+       Fix cs0164.cs.
+       * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
+       (LabeledStatement.AddReference): New.  Set 'referenced'.
+       (Goto.Resolve): Use it.
+
+2005-02-05  John Luke  <john.luke@gmail.com>
+
+       * driver.cs: remove duplicate -doc line in Usage ()
+
+2005-02-04  Raja R Harinath  <rharinath@novell.com>
+
+       * location.cs (Location.AddFile): Fix CS2002 error report.
+
+2005-02-02  Martin Baulig  <martin@ximian.com>
+
+       * delegate.cs (Delegate.DefineType): Report an internal error if
+       TypeManager.multicast_delegate_type is null.  See bug #72015 for
+       details.        
+
+2005-02-02  Raja R Harinath  <rharinath@novell.com>
+
+       Fix a crasher in a variant of #31984.
+       * const.cs (Constant.CheckBase): New override that defers the
+       new-or-override check in case the base type hasn't been populated
+       yet.
+       (Constant.Define): Ensure the new-or-override check is performed.
+
+2005-02-01  Duncan Mak  <duncan@ximian.com>
+
+       * const.cs (LookupConstantValue): Check that `ce' is not null
+       before calling GetValue ().
+
+2005-02-01  Raja R Harinath  <rharinath@novell.com>
+
+       Fix test-334.cs (#69519).
+       * cs-parser.jay (using_alias_directive): Pass in an expression to
+       NamespaceEntry.UsingAlias.
+       (using_namespace_directive): Pass in an expression to
+       NamespaceEntry.Using.
+       (namespace_name): Don't flatten to a string.
+       * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
+       (NamespaceEntry.AliasEntry.Resolve): Lookup using
+       ResolveAsTypeStep.
+       (NamespaceEntry.UsingEntry): Likewise.
+       (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
+       changes.
+       (NamespaceEntry.LookupForUsing): Remove.
+       (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
+       names.
+       (NamespaceEntry.Lookup): Remove support for dotted names.
+
+2005-02-01  Raja R Harinath  <rharinath@novell.com>
+
+       * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
+       split into two.
+       (NamespaceEntry.ImplicitParent): Compute on demand.
+       (NamespaceEntry.Doppelganger): New implicit namespace-entry that
+       parallels the current.
+       (NamespaceEntry.LookupForUsing): Use it.
+       (NamespaceEntry.Lookup): If the current namespace-entry is
+       implicit, don't search aliases and using tables.
+
+2005-02-01  Raja R Harinath  <rharinath@novell.com>
+
+       Fix #31984.
+       * class.cs (TypeContainer.DoDefineMembers): Don't initialize
+       BaseCache here.
+       (TypeContainer.BaseCache): Compute on demand.
+       (TypeContainer.FindMembers): Define constants and types if they're
+       not already created.
+       (FieldMember.Define): Move resetting of ec.InUnsafe before error
+       check.
+       * const.cs (Constant.Define): Make idempotent.
+
+2005-01-29  Miguel de Icaza  <miguel@novell.com>
+
+       * pending.cs: Produce better code (no nops produced by using Ldarg
+       + value).
+       
+       * pending.cs (PendingImplementation.DefineProxy): It was not `arg
+       i - 1' it should be arg + 1.
+
+       Fixes bug #71819.
+
+2005-01-28  Raja R Harinath  <rharinath@novell.com>
+
+       * attribute.cs (Attribute.CheckAttributeType): Make private
+       non-virtual.
+       (Attribute.ResolveType): Make virtual.
+       (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
+       handling of RootContext.Tree.Types.
+
+2005-01-27  Raja R Harinath  <rharinath@novell.com>
+
+       Update attribute-handling to use the SimpleName/MemberAccess
+       mechanisms.
+       * cs-parser.jay (attribute): Pass in an expression to the
+       constructors of Attribute and GlobalAttribute.
+       * attribute.cs (Attribute): Take an expression for the name.
+       (Attribute.ResolvePossibleAttributeTypes): New.  Resolves the
+       passed in attribute name expression.
+       (Attribute.CheckAttributeType): Use it.
+       * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
+       * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
+       (MemberAccess.ResolveNamespaceOrType): ... here.  Add 'silent'
+       argument to prevent error messages if the lookup fails.
+
+2005-01-27  Marek Safar  <marek.safar@seznam.cz>
+
+       * expression.cs (Indirection): Implemented IVariable interface
+       to support indirection in AddressOf operator.
+       (PointerArithmetic.Emit): Add optimalization for case where
+       result can be precomputed.
+
+2005-01-26  Martin Baulig  <martin@ximian.com>
+
+       * class.cs (TypeContainer.AttributeTargets): Return the correct
+       AttributeTargets depending on our `Kind' instead of throwing an
+       exception; fixes #71632.
+
+2005-01-26  Marek Safar  <marek.safar@seznam.cz>
+
+       Fix #71257
+       * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
+       constant members.
+
+2005-01-25  Raja R Harinath  <rharinath@novell.com>
+
+       Fix #71602.
+       * expression.cs (MemberAccess.DoResolve): Don't complain with
+       cs0572 when the LHS of a member access has identical name and type
+       name.
+
+2005-01-25  Marek Safar  <marek.safar@seznam.cz>
+
+       Fix #71651, #71675
+       * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
+       CreatePermission.
+       Create custom PermissionSet only for PermissionSetAttribute.
+
+2005-01-24  Marek Safar  <marek.safar@seznam.cz>
+
+       Fix #71649
+       * class.cs (StaticClass.DefineContainerMembers): Enable enums and
+       delegates in static class.
+
+2005-01-24  Martin Baulig  <martin@ximian.com>
+
+       * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
+       merging an implicit block, just use its reachability.
+
+       * statement.cs (Block.Resolve): Make the unreachable code check
+       work wrt. implicit blocks; see test-337 from #63842.
+
+2005-01-21  Alp Toker  <alp@atoker.com>
+       * cs-parser.jay: destructor_declaration's container is PartialContainer
+       not Class when partial types are used, so use Kind prop instead of
+       'is'.
+       
+2005-01-22  Miguel de Icaza  <miguel@ximian.com>
+
+       * cs-parser.jay: Improve error reporting when an interface
+       declares new types.
+
+2005-01-20  Dick Porter  <dick@ximian.com>
+
+       * support.cs: SeekableStreamReader fix from Sandor Dobos
+       (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
+       chars are read.  Fixes bug 70369.
+
+2005-01-20  Raja R Harinath  <rharinath@novell.com>
+
+       * cs-parser.jay (catch_clause): Simplify current_block handling
+       somewhat.
+
+2005-01-17  Miguel de Icaza  <miguel@ximian.com>
+
+       * convert.cs (ImplicitStandardConversionExists): Synchronize the
+       code with ImplicitStandardConversion to handle the implicit
+       conversion of method groups into valid delegate invocations. 
+
+       The problem is that in parameter handling we were using this code
+       path.  Fixes bug #64698
+
+2005-01-19  Raja R Harinath  <rharinath@novell.com>
+
+       * cs-parser.jay: Fix several infelicities.
+       - Avoid assigning to the parser value stack.  Code like 
+         '$3 = null' is unclean.  Synthesize a value for the code block
+         instead. 
+       - Avoid using oob_stack for storing location information.  Use ...
+       (_mark_): ... this.  New (empty) rule.  Saves the current location
+       in $$.
+       (foreach_statement): Avoid using oob_stack for current_block
+       handling.  Use technique used in for_statement and
+       using_statement.  Synthesize a value for the code block to store
+       additional intermediate information.
+
+2005-01-13  Miguel de Icaza  <miguel@ximian.com>
+
+       * ecore.cs (IsAccessorAccessible): Accessibility to private fields
+       of a different type is only allowed to private fields of a
+       containing type, not on fields of a base class.
+
+       See test-174.cs and error cs0122-9.cs
+
+2005-01-13  Raja R Harinath  <rharinath@novell.com>
+
+       Fix test-335.cs (bug #58126).
+       * cs-parser.jay (argument): Split out non-expression parts of the
+       rule into 'non_simple_argument'.
+       (invocation_expression): Support parenthesized invocations with
+       multiple arguments, and with single non-simple arguments.
+
+2005-01-13  Raja R Harinath  <rharinath@novell.com>
+
+       * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
+       places.
+
+2005-01-12  Raja R Harinath  <rharinath@novell.com>
+
+       Fix cs0038-1.cs, cs1640-6.cs.
+       * ecore.cs (Expression.Resolve): Remove special-case for
+       SimpleName in error-handling.
+       (Expression.almostMatchedMembers): Relax access permission to
+       protected.
+       (Expression.MemberLookupFailed): Handle duplicates in
+       almostMatchedMembers list.
+       (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
+       * expression.cs (New.DoResolve): Report CS1540 for more cases.
+       * typemanager.cs (GetFullNameSignature): Use the MethodBase
+       overload if the passed in MemberInfo is a MethodBase.
+
+2005-01-12  Marek Safar  <marek.safar@seznam.cz>
+
+       Fix #70749
+       * attribute.cs (ExtractSecurityPermissionSet): Don't report error
+       for non-CAS & merge permission sets properly.
+
+2005-01-11  Raja R Harinath  <rharinath@novell.com>
+
+       Improve standard-compliance of simple name and member access 
+       resolution.  Fixes bugs #52697, #57200, #67520, #69519.
+       * ecore.cs (FullNamedExpression): New abstract base class 
+       for Namespaces and TypeExpressions.
+       (ResolveFlags.SimpleName): Remove.
+       (SimpleName): Remove support for dotted names.
+       (SimpleName.ResolveAsTypeStep): Simplify.  Now just a wrapper to 
+       DeclSpace.FindType and DeclSpace.LookupType.
+       (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
+       (Expression.ExprClassName): Make member function.
+       * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
+       a namespace.  Remove creation of dotted "SimpleName"s.
+       (MemberAccess.DoResolve): Likewise.
+       * decl.cs (DeclSpace.Cache): Make private.
+       (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
+       (DeclSpace.FindType): Update.
+       (DeclSpace.LookupType): Move here from RootContext.  Return a 
+       FullNamedExpression.
+       * namespace.cs (Namespace): Derive from FullNamedExpression
+       so that it can be part of expression resolution.
+       (Namespace.Lookup): Return an FullNamedExpression.
+       (NamespaceEntry.LookupAlias): Lookup aliases only in current
+       namespace.
+       * rootcontext.cs (NamespaceLookup): Remove.
+       (LookupType): Move to DeclSpace.
+       * attribute.cs (CheckAttributeType): Update.
+       * doc.cs (FindDocumentedType): Remove allowAlias argument.
+       (FindDocumentedTypeNonArray): Likewise.
+
+2005-01-11  Raja R Harinath  <rharinath@novell.com>
+
+       Fix cs0509.cs, cs1632.cs.
+       * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
+       is the same as IsInterface.
+       (TypeContainer.GetClassBases): Likewise.
+       * statement.cs (LabeledStatement.ig): New field.
+       (LabeledStatement.LabelTarget): Save ILGenerator which created the
+       label.
+       (LabeledStatement.DoEmit): Check that the label was created with
+       the same ILGenerator.
+
+2005-01-10  Marek Safar  <marek.safar@seznam.cz>
+
+       Fix #71058
+       * attribute.cs (GetMethodObsoleteAttribute): Need to transform
+       accessors to its properties.
+
+       * ecore.cs (PropertyExpr): Add AccessorTable to help track back
+       from accessors to property.
+       
+2005-01-10  Marek Safar  <marek.safar@seznam.cz>
+
+       Fix #70722
+       * class.cs (MethodCore.CheckBase): Test base method obsoleteness
+       only for overrides.
+       
+2005-01-08  Miguel de Icaza  <miguel@ximian.com>
+
+       * attribute.cs: Check for null and empty strings.  
+
+       I have lost another battle to Paolo.
+
+2005-01-07  Marek Safar  <marek.safar@seznam.cz>
+
+       Fix #70942
+       * class.cs (PropertyMethod): Set Parent field in ctors.
+       (SetMethod.InternalParameters): Add unsafe switch hack.
+       Override MarkForDuplicationCheck where it is appropriate.
+
+       * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
+       It says whether container allows members with the same name.
+       Base default is no.
+       (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
+       Removed is_method parameter.
+
+2005-01-06  Duncan Mak  <duncan@ximian.com>
+
+       * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
+       because the previous change led to incorrect reporting of CS1032
+       ("Cannot define/undefine preprocessor symbols after first token in
+       file"). Instead of using `tokens_seen' as the only flag that
+       triggers CS1040, introduce `comments_seen'. This new flag is used
+       to signify having seen comments on the current line, so it is
+       unset after a newline.
+
+2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
+
+       * doc.cs : When searching for a type, find nested type too.
+         This fixes bug #71040.
+
+2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
+
+       * doc.cs :
+         - Warn missing member comment on those classes which also does not
+           have doc comments. Fixed bug #71041.
+         - Don't warn missing doc comment on default constructor.
+           Fixed bug #71042.
+
+2005-01-06  Duncan Mak  <duncan@ximian.com>
+
+       * cs-tokenizer.cs (xtoken): After handling traditional C-style
+       comments, set `tokens_seen' to true. This allows us to detect
+       misplaced preprocessor directives (i.e. not at the beginning of
+       the a line, nor after whitespaces). In that case, report error
+       CS1040. This fixes bug #56460.
+
+       * cs-parser.jay (interface_member_declaration): Add checks for
+       IsExplicitImpl, and report CS0541 error if an interface member is
+       defined as an explicit interface declaration.
+
+2005-01-06  Marek Safar  <marek.safar@seznam.cz>
+
+       Fix #70817
+       * class.cs (PropertyMethod): Set Parent field in ctors.
+       (SetMethod.InternalParameters): Add unsafe switch hack.
+       
+       * decl.cs (MemberCore.Parent): Cannot be readonly.
+
+2005-01-06  Raja R Harinath  <rharinath@novell.com>
+
+       * decl.cs (DeclSpace.ResolveType): Remove.
+       (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
+       Merge in code from ...
+       (DeclSpace.GetTypeResolvingEmitContext): ... here.  Remove.
+       * class.cs, enum.cs: Update to changes.
+
+2005-01-06  Miguel de Icaza  <miguel@ximian.com>
+
+       * anonymous.cs: Ensure that we init the scope of our parent if it
+       has not been initialized yet.
+
+2004-12-30  Duncan Mak  <duncan@ximian.com>
+
+       * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
+       if field.FieldBuilder is null. Fixes #70758.
+
+       * convert.cs: Fixed some typos and updated some of the comments.
+       (ImplicitStandardConversionExists):
+       (TryImplicitIntConversion): If `target_type' is an interface and
+       the type of `ic' implements this interface, return true or a new
+       BoxedCast instead of null. This fixes #70468.
+
+2004-12-29  Duncan Mak  <duncan@ximian.com>
+
+       * expression.cs (Argument.Emit): Check that Expr is
+       IMemoryLocation before casting to it, and report CS1510 otherwise.
+
+       This fixes #70402.
+
+2004-12-21  Ben Maurer  <bmaurer@ximian.com>
+
+       * statement.cs (Block.ThisVariable): remove the recursion here, to
+       make the --profile more sane.
+
+2004-12-17  Carlos Cortez <calberto.cortez@gmail.com>
+
+       * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
+       assembly, by JB Evain.
+
+2004-12-17  Raja R Harinath  <rharinath@novell.com>
+
+       * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs, 
+         rootcontext.cs, typemanager.cs: Make nomenclature consistent.
+       "parent" refers to enclosing type/class.  "base" refers to superclass.
+
 2004-12-17  Raja R Harinath  <rharinath@novell.com>
 
        * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):