2001-10-29 Miguel de Icaza <miguel@ximian.com>
[mono.git] / mcs / mcs / ChangeLog
index d47542e964f60e96381e3ee47b1e09f88f82beac..35c0c687edd624deaa5f180b7411b1bac314a07f 100755 (executable)
@@ -1,3 +1,598 @@
+2001-10-29  Miguel de Icaza  <miguel@ximian.com>
+
+       * cs-parser.jay: Add extra production for the second form of array
+       creation. 
+
+       * expression.cs (ArrayCreation): Update to reflect the above
+       change. 
+
+       * Small changes to prepare for Array initialization.
+
+2001-10-28  Miguel de Icaza  <miguel@ximian.com>
+
+       * typemanager.cs (ImplementsInterface): interface might be null;
+       Deal with this problem;
+
+       Also, we do store negative hits on the cache (null values), so use
+       this instead of calling t.GetInterfaces on the type everytime.
+
+2001-10-28  Ravi Pratap  <ravi@ximian.com>
+
+       * typemanager.cs (IsBuiltinType): New method to help determine the same.
+
+       * expression.cs (New::DoResolve): Get rid of array creation code and instead
+       split functionality out into different classes.
+
+       (New::FormArrayType): Move into NewBuiltinArray.
+
+       (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
+       quite useless.
+
+       (NewBuiltinArray): New class to handle creation of built-in arrays.
+
+       (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
+       account creation of one-dimensional arrays.
+
+       (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
+
+       (NewUserdefinedArray::DoResolve): Implement.
+
+       * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
+
+       * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
+       we maintain inside the TypeManager. This is necessary to perform lookups on the
+       module builder.
+
+       (LookupType): Update to perform GetType on the module builders too.     
+
+       * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
+
+       * exprssion.cs (NewUserdefinedArray::Emit): Implement.
+
+2001-10-23  Ravi Pratap  <ravi@ximian.com>
+
+       * expression.cs (New::DoResolve): Implement guts of array creation.
+
+       (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
+       
+2001-10-27  Miguel de Icaza  <miguel@ximian.com>
+
+       * expression.cs: Fix bug I introduced lsat night that broke
+       Delegates. 
+
+       (Expression.Resolve): Report a 246 error (can not resolve name)
+       if we find a SimpleName in the stream.
+       
+       (Expression.ResolveLValue): Ditto.
+       
+       (Expression.ResolveWithSimpleName): This function is a variant of
+       ResolveName, this one allows SimpleNames to be returned without a
+       warning.  The only consumer of SimpleNames is MemberAccess
+
+2001-10-26  Miguel de Icaza  <miguel@ximian.com>
+
+       * expression.cs (Invocation::DoResolve): Catch SimpleNames that
+       might arrive here.  I have my doubts that this is correct.
+
+       * statement.cs (Lock): Implement lock statement.
+
+       * cs-parser.jay: Small fixes to support `lock' and `using'
+
+       * cs-tokenizer.cs: Remove extra space
+
+       * driver.cs: New flag --checked, allows to turn on integer math
+       checking. 
+
+       * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
+       Threading.Monitor.Exit 
+       
+2001-10-23  Miguel de Icaza  <miguel@ximian.com>
+
+       * expression.cs (IndexerAccess::DoResolveLValue): Set the
+       Expression Class to be IndexerAccess.
+
+       Notice that Indexer::DoResolve sets the eclass to Value.
+
+2001-10-22  Miguel de Icaza  <miguel@ximian.com>
+
+       * class.cs (TypeContainer::Emit): Emit code for indexers.
+
+       * assign.cs (IAssignMethod): New interface implemented by Indexers
+       and Properties for handling assignment.
+
+       (Assign::Emit): Simplify and reuse code. 
+       
+       * expression.cs (IndexerAccess, PropertyExpr): Implement
+       IAssignMethod, clean up old code. 
+
+2001-10-22  Ravi Pratap  <ravi@ximian.com>
+
+       * typemanager.cs (ImplementsInterface): New method to determine if a type
+       implements a given interface. Provides a nice cache too.
+
+       * expression.cs (ImplicitReferenceConversion): Update checks to use the above
+       method.
+
+       (ConvertReferenceExplicit): Ditto.
+
+       * delegate.cs (Delegate::Populate): Update to define the parameters on the 
+       various methods, with correct names etc.
+
+       * class.cs (Operator::OpType): New members Operator.UnaryPlus and 
+       Operator.UnaryNegation.
+
+       * cs-parser.jay (operator_declarator): Be a little clever in the case where
+       we have a unary plus or minus operator.
+
+       * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and 
+       UnaryMinus.
+
+       * everywhere : update accordingly.
+
+       * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
+       respectively.
+
+       * class.cs (Method::Define): For the case where we are implementing a method
+       inherited from an interface, we need to set the MethodAttributes.Final flag too. 
+       Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
+       
+2001-10-21  Ravi Pratap  <ravi@ximian.com>
+
+       * interface.cs (FindMembers): Implement to work around S.R.E
+       lameness.
+
+       * typemanager.cs (IsInterfaceType): Implement.
+
+       (FindMembers): Update to handle interface types too.
+
+       * expression.cs (ImplicitReferenceConversion): Re-write bits which
+       use IsAssignableFrom as that is not correct - it doesn't work.
+
+       * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
+       and accordingly override EmitStatement.
+
+       * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
+       using the correct logic :-)
+
+2001-10-19  Ravi Pratap  <ravi@ximian.com>
+
+       * ../errors/cs-11.cs : Add to demonstrate error -11 
+
+2001-10-17  Miguel de Icaza  <miguel@ximian.com>
+
+       * assign.cs (Assign::Resolve): Resolve right hand side first, and
+       then pass this as a hint to ResolveLValue.
+       
+       * expression.cs (FieldExpr): Add Location information
+
+       (FieldExpr::LValueResolve): Report assignment to readonly
+       variable. 
+       
+       (Expression::ExprClassFromMemberInfo): Pass location information.
+
+       (Expression::ResolveLValue): Add new method that resolves an
+       LValue. 
+
+       (Expression::DoResolveLValue): Default invocation calls
+       DoResolve. 
+
+       (Indexers): New class used to keep track of indexers in a given
+       Type. 
+
+       (IStackStore): Renamed from LValue, as it did not really describe
+       what this did.  Also ResolveLValue is gone from this interface and
+       now is part of Expression.
+
+       (ElementAccess): Depending on the element access type
+       
+       * typemanager.cs: Add `indexer_name_type' as a Core type
+       (System.Runtime.CompilerServices.IndexerNameAttribute)
+
+       * statement.cs (Goto): Take a location.
+       
+2001-10-18  Ravi Pratap  <ravi@ximian.com>
+
+       * delegate.cs (Delegate::VerifyDelegate): New method to verify
+       if two delegates are compatible.
+
+       (NewDelegate::DoResolve): Update to take care of the case when
+       we instantiate a delegate from another delegate.
+
+       * typemanager.cs (FindMembers): Don't even try to look up members
+       of Delegate types for now.
+
+2001-10-18  Ravi Pratap  <ravi@ximian.com>
+
+       * delegate.cs (NewDelegate): New class to take care of delegate
+       instantiation.
+
+       * expression.cs (New): Split the delegate related code out into 
+       the NewDelegate class.
+
+       * delegate.cs (DelegateInvocation): New class to handle delegate 
+       invocation.
+
+       * expression.cs (Invocation): Split out delegate related code into
+       the DelegateInvocation class.
+
+2001-10-17  Ravi Pratap  <ravi@ximian.com>
+
+       * expression.cs (New::DoResolve): Implement delegate creation fully
+       and according to the spec.
+
+       (New::DoEmit): Update to handle delegates differently.
+
+       (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
+       because of which we were printing out arguments in reverse order !
+
+       * delegate.cs (VerifyMethod): Implement to check if the given method
+       matches the delegate.
+
+       (FullDelegateDesc): Implement.
+
+       (VerifyApplicability): Implement.
+
+       * expression.cs (Invocation::DoResolve): Update to accordingly handle
+       delegate invocations too.
+
+       (Invocation::Emit): Ditto.
+
+       * ../errors/cs1593.cs : Added.
+
+       * ../errors/cs1594.cs : Added.
+
+       * delegate.cs (InstanceExpression, TargetMethod): New properties.
+
+2001-10-16  Ravi Pratap  <ravi@ximian.com>
+
+       * typemanager.cs (intptr_type): Core type for System.IntPtr
+
+       (InitCoreTypes): Update for the same.
+
+       (iasyncresult_type, asynccallback_type): Ditto.
+
+       * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
+       correct.
+
+       * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
+       too.
+
+       * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
+       the builders for the 4 members of a delegate type :-)
+
+       (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
+       type.
+
+       * expression.cs (New::DoResolve): Implement guts for delegate creation.
+
+       * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
+
+2001-10-15  Miguel de Icaza  <miguel@ximian.com>
+
+       * statement.cs (Break::Emit): Implement.   
+       (Continue::Emit): Implement.
+
+       (For::Emit): Track old being/end loops;  Set Begin loop, ack end loop
+       (While::Emit): Track old being/end loops;  Set Begin loop, ack end loop
+       (Do::Emit): Track old being/end loops;  Set Begin loop, ack end loop
+       (Foreach::Emit): Track old being/end loops;  Set Begin loop, ack
+       end loop
+       
+       * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
+       properties that track the label for the current loop (begin of the
+       loop and end of the loop).
+
+2001-10-15  Ravi Pratap  <ravi@ximian.com>
+
+       * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
+       use of emitting anything at all.
+
+       * class.cs, rootcontext.cs : Get rid of calls to the same.
+
+       * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
+
+       (Populate): Define the constructor correctly and set the implementation
+       attributes.
+
+       * typemanager.cs (delegate_types): New hashtable to hold delegates that
+       have been defined.
+
+       (AddDelegateType): Implement.
+
+       (IsDelegateType): Implement helper method.
+
+       * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
+
+       * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
+       and accordingly handle it.
+
+       * delegate.cs (Populate): Take TypeContainer argument.
+       Implement bits to define the Invoke method. However, I still haven't figured out
+       how to take care of the native int bit :-(
+
+       * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-) 
+       Qualify the name of the delegate, not its return type !
+
+       * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
+       conversion.
+
+       (StandardConversionExists): Checking for array types turns out to be recursive.
+
+       (ConvertReferenceExplicit): Implement array conversion.
+
+       (ExplicitReferenceConversionExists): New method to determine precisely that :-)
+       
+2001-10-12  Ravi Pratap  <ravi@ximian.com>
+
+       * cs-parser.jay (delegate_declaration): Store the fully qualified
+       name as it is a type declaration.
+
+       * delegate.cs (ReturnType, Name): Rename members to these. Make them 
+       readonly.
+
+       (DefineDelegate): Renamed from Define. Does the same thing essentially,
+       as TypeContainer::DefineType.
+
+       (Populate): Method in which all the definition of the various methods (Invoke)
+       etc is done.
+
+       (Emit): Emit any code, if necessary. I am not sure about this really, but let's
+       see.
+       
+       (CloseDelegate): Finally creates the delegate.
+
+       * class.cs (TypeContainer::DefineType): Update to define delegates.
+       (Populate, Emit and CloseType): Do the same thing here too.
+
+       * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
+       delegates in all these operations.
+
+2001-10-14  Miguel de Icaza  <miguel@ximian.com>
+
+       * expression.cs: LocalTemporary: a new expression used to
+       reference a temporary that has been created.
+
+       * assign.cs: Handle PropertyAccess back here, so that we can
+       provide the proper semantic access to properties.
+
+       * expression.cs (Expression::ConvertReferenceExplicit): Implement
+       a few more explicit conversions. 
+
+       * modifiers.cs: `NEW' modifier maps to HideBySig.
+
+       * expression.cs (PropertyExpr): Make this into an
+       ExpressionStatement, and support the EmitStatement code path. 
+
+       Perform get/set error checking, clean up the interface.
+
+       * assign.cs: recognize PropertyExprs as targets, and if so, turn
+       them into toplevel access objects.
+
+2001-10-12  Miguel de Icaza  <miguel@ximian.com>
+
+       * expression.cs: PropertyExpr::PropertyExpr: use work around the
+       SRE.
+
+       * typemanager.cs: Keep track here of our PropertyBuilders again to
+       work around lameness in SRE.
+
+2001-10-11  Miguel de Icaza  <miguel@ximian.com>
+
+       * expression.cs (LValue::LValueResolve): New method in the
+       interface, used to perform a second resolution pass for LValues. 
+       
+       (This::DoResolve): Catch the use of this in static methods.
+
+       (This::LValueResolve): Implement.
+
+       (This::Store): Remove warning, assigning to `this' in structures
+       is 
+
+       (Invocation::Emit): Deal with invocation of
+       methods on value types.  We need to pass the address to structure
+       methods rather than the object itself.  (The equivalent code to
+       emit "this" for structures leaves the entire structure on the
+       stack instead of a pointer to it). 
+
+       (ParameterReference::DoResolve): Compute the real index for the
+       argument based on whether the method takes or not a `this' pointer
+       (ie, the method is static).
+
+       * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
+       value types returned from functions when we need to invoke a
+       method on the sturcture.
+       
+
+2001-10-11  Ravi Pratap  <ravi@ximian.com>
+
+       * class.cs (TypeContainer::DefineType): Method to actually do the business of
+       defining the type in the Modulebuilder or Typebuilder. This is to take
+       care of nested types which need to be defined on the TypeBuilder using
+       DefineNestedMethod.
+
+       (TypeContainer::GetClassBases): Implement. Essentially the code from the 
+       methods in RootContext, only ported to be part of TypeContainer.
+
+       (TypeContainer::GetInterfaceOrClass): Ditto.
+
+       (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
+
+       * interface.cs (Interface::DefineInterface): New method. Does exactly
+       what RootContext.CreateInterface did earlier, only it takes care of nested types 
+       too.
+
+       (Interface::GetInterfaces): Move from RootContext here and port.
+
+       (Interface::GetInterfaceByName): Same here.
+
+       * rootcontext.cs (ResolveTree): Re-write.
+
+       (PopulateTypes): Re-write.
+
+       * class.cs (TypeContainer::Populate): Populate nested types too.
+       (TypeContainer::Emit): Emit nested members too.
+
+       * typemanager.cs (AddUserType): Do not make use of the FullName property,
+       instead just use the name argument passed in as it is already fully
+       qualified.
+
+       (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
+       to TypeContainer mapping to see if a type is user-defined.
+
+       * class.cs (TypeContainer::CloseType): Implement. 
+
+       (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
+       the default constructor.
+       
+       (TypeContainer::Populate): Fix minor bug which led to creating default constructors
+       twice.
+
+       (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
+
+       * interface.cs (CloseType): Create the type here.
+       
+       * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
+       the hierarchy.
+
+       Remove all the methods which are now in TypeContainer.
+
+2001-10-10  Ravi Pratap  <ravi@ximian.com>
+
+       * delegate.cs (Define): Re-write bits to define the delegate
+       correctly.
+
+2001-10-10  Miguel de Icaza  <miguel@ximian.com>
+
+       * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
+
+       * expression.cs (ImplicitReferenceConversion): handle null as well
+       as a source to convert to any reference type.
+
+       * statement.cs (Return): Perform any implicit conversions to
+       expected return type.  
+
+       Validate use of return statement.  
+
+       * codegen.cs (EmitContext): Pass the expected return type here.
+
+       * class.cs (Method, Constructor, Property): Pass expected return
+       type to EmitContext.
+
+2001-10-09  Miguel de Icaza  <miguel@ximian.com>
+
+       * expression.cs: Make DoResolve take an EmitContext instead of a
+       TypeContainer.
+
+       Replaced `l' and `location' for `loc', for consistency.
+       
+       (Error, Warning): Remove unneeded Tc argument.
+
+       * assign.cs, literal.cs, constant.cs: Update to new calling
+       convention. 
+       
+       * codegen.cs: EmitContext now contains a flag indicating whether
+       code is being generated in a static method or not.
+
+       * cs-parser.jay: DecomposeQI, new function that replaces the old
+       QualifiedIdentifier.  Now we always decompose the assembled
+       strings from qualified_identifier productions into a group of
+       memberaccesses.
+
+2001-10-08  Miguel de Icaza  <miguel@ximian.com>
+
+       * rootcontext.cs: Deal with field-less struct types correctly now
+       by passing the size option to Define Type.
+
+       * class.cs: Removed hack that created one static field. 
+
+2001-10-07  Miguel de Icaza  <miguel@ximian.com>
+
+       * statement.cs: Moved most of the code generation here. 
+
+2001-10-09  Ravi Pratap  <ravi@ximian.com>
+
+       * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
+       seem very right.
+
+       (ElementAccess): Remove useless bits for now - keep checks as the spec
+       says.
+
+2001-10-08  Ravi Pratap  <ravi@ximian.com>
+
+       * expression.cs (ElementAccess::DoResolve): Remove my crap code
+       and start performing checks according to the spec.
+
+2001-10-07  Ravi Pratap  <ravi@ximian.com>
+
+       * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
+       rank_specifiers instead.
+
+       (rank_specifiers): Change the order in which the rank specifiers are stored
+
+       (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
+
+       * expression.cs (ElementAccess): Implement the LValue interface too.
+       
+2001-10-06  Ravi Pratap  <ravi@ximian.com>
+       
+       * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
+       except that user defined conversions are not included.
+
+       (UserDefinedConversion): Update to use the ConvertExplicitStandard to 
+       perform the conversion of the return type, if necessary.
+
+       (New::DoResolve): Check whether we are creating an array or an object
+       and accordingly do the needful.
+
+       (New::Emit): Same here.
+
+       (New::DoResolve): Implement guts of array creation.
+
+       (New::FormLookupType): Helper function.
+
+2001-10-07  Miguel de Icaza  <miguel@ximian.com>
+
+       * codegen.cs: Removed most of the code generation here, and move the
+       corresponding code generation bits to the statement classes. 
+
+       Added support for try/catch/finalize and throw.
+       
+       * cs-parser.jay: Added support for try/catch/finalize.
+
+       * class.cs: Catch static methods having the flags override,
+       virtual or abstract.
+
+       * expression.cs (UserCast): This user cast was not really doing
+       what it was supposed to do.  Which is to be born in fully resolved
+       state.  Parts of the resolution were being performed at Emit time! 
+
+       Fixed this code.
+
+2001-10-05  Miguel de Icaza  <miguel@ximian.com>
+
+       * expression.cs: Implicity convert the result from UserCast.
+
+2001-10-05  Ravi Pratap  <ravi@ximian.com>
+
+       * expression.cs (Expression::FindMostEncompassingType): Fix bug which
+       prevented it from working correctly. 
+
+       (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
+       merely ConvertImplicit.
+
+2001-10-05  Miguel de Icaza  <miguel@ximian.com>
+
+       * typemanager.cs: Make the LookupTypeContainer function static,
+       and not per-instance.  
+
+       * class.cs: Make static FindMembers (the one that takes a Type
+       argument). 
+
+       * codegen.cs: Add EmitForeach here.
+
+       * cs-parser.jay: Make foreach a toplevel object instead of the
+       inline expansion, as we need to perform semantic analysis on it. 
+
 2001-10-05  Ravi Pratap  <ravi@ximian.com>
 
        * expression.cs (Expression::ImplicitUserConversion): Rename to