2001-12-11 Ravi Pratap <ravi@ximian.com>
[mono.git] / mcs / mcs / ChangeLog
index 650a8904039a88033b1d5f5d6982a16b2846bf8c..5d865be9dfa499eb6765d34ce0f6756f04a7d608 100755 (executable)
@@ -1,5 +1,298 @@
-2001-10-31  Ravi Pratap  <ravi@ximian.com>
+2001-12-11  Ravi Pratap  <ravi@ximian.com>
+
+       * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
+
+       * ../errors/cs0617.cs : Add.
+
+2001-11-11  Ravi Pratap  <ravi@ximian.com>
+
+       * enum.cs (Emit): Rename to Populate to be more consistent with what
+       we expect it to do and when exactly it is called.
+
+       * class.cs, rootcontext.cs : Update accordingly.
+
+       * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
+       FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
+
+       * enum.cs (Populate): Register fields with TypeManager.RegisterField.
+
+       * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
+       of a fieldinfo using the above, when dealing with a FieldBuilder.
+
+2001-11-10  Ravi Pratap  <ravi@ximian.com>
+
+       * ../errors/cs0031.cs : Add.
+
+       * ../errors/cs1008.cs : Add.
+
+       * ../errrors/cs0543.cs : Add.
+
+       * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
+       enum type.
+
+       (FindMembers): Implement.
+
+       * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
+       enums and delegates too.
+
+       (enum_types): Rename to builder_to_enum.
+
+       (delegate_types): Rename to builder_to_delegate.
+
+       * delegate.cs (FindMembers): Implement.
+
+2001-11-09  Ravi Pratap  <ravi@ximian.com>
+
+       * typemanager.cs (IsEnumType): Implement.
+
+       * enum.cs (Emit): Re-write parts to account for the underlying type
+       better and perform checking etc.
+
+       (GetNextDefaultValue): Helper to ensure we don't overshoot max value
+       of the underlying type.
+
+       * literal.cs (GetValue methods everywhere): Perform bounds checking and return
+       value
+
+       * enum.cs (error31): Helper to report error #31.
+
+       * cs-parser.jay (enum_declaration): Store location of each member too.
+
+       * enum.cs (member_to_location): New hashtable. 
+
+       (AddEnumMember): Update location hashtable.
+
+       (Emit): Use the location of each member while reporting errors.
+
+2001-11-09  Miguel de Icaza  <miguel@ximian.com>
+
+       * cs-parser.jay: A for_initializer if is a
+       local_variable_declaration really ammount to have an implicit
+       block with the variable declaration and no initializer for for.
+
+       * statement.cs (For.Emit): Cope with null initializers.
+
+       This fixes the infinite loop on for initializers.
+
+2001-11-08  Miguel de Icaza  <miguel@ximian.com>
+
+       * enum.cs: More cleanup.
+
+       * ecore.cs: Remove dead code.
+
+       * class.cs (Property.Emit): More simplification.
+       (Event.Emit): ditto.
+
+       Reworked to have less levels of indentation.
+       
+2001-11-08  Ravi Pratap  <ravi@ximian.com>
+
+       * class.cs (Property): Emit attributes.
+
+       (Field): Ditto.
+       
+       (Event): Ditto.
+
+       (Indexer): Ditto.
+
+       (Operator): Ditto.
+
+       * enum.cs (Emit): Ditto.
+
+       * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
+       Enums too.
+
+       * class.cs (Field, Event, etc.): Move attribute generation into the
+       Emit method everywhere.
+
+       * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
+       we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
+       as we had no way of defining nested enums !
+
+       * rootcontext.cs : Adjust code accordingly.
+
+       * typemanager.cs (AddEnumType): To keep track of enum types separately.
+
+2001-11-07  Ravi Pratap  <ravi@ximian.com>
+
+       * expression.cs (EvalConstantExpression): Move into ecore.cs
+       
+       * enum.cs (Enum): Rename some members and make them public and readonly
+       according to our convention.
+
+       * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
+       nothing else.
+
+       * enum.cs (Enum::Define): Use the above instead of TypeAttr.
+
+       (Enum::Emit): Write a simple version for now which doesn't try to compute
+       expressions. I shall modify this to be more robust in just a while.
+
+       * class.cs (TypeContainer::Emit): Make sure we include Enums too.
+
+       (TypeContainer::CloseType): Create the Enum types too.
+
+       * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
+
+       * expression.cs (EvalConstantExpression): Get rid of completely.
+
+       * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
+       user-defined values and other cases.
+
+       (IsValidEnumLiteral): Helper function.
+
+       * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing 
+       out there in the case we had a literal FieldExpr.
 
+       (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
+
+       (Literalize): Revamp a bit to take two arguments.
+       
+       (EnumLiteral): New class which derives from Literal to wrap enum literals.
+       
+2001-11-06  Ravi Pratap  <ravi@ximian.com>
+
+       * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
+
+       * expression.cs (ArrayCreation::ValidateInitializers): Implement.
+
+       (Resolve): Use the above to ensure we have proper initializers.
+
+2001-11-05  Ravi Pratap  <ravi@ximian.com>
+
+       * expression.cs (Expression::EvalConstantExpression): New method to 
+       evaluate constant expressions.
+
+       * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
+
+2001-11-07  Miguel de Icaza  <miguel@ximian.com>
+
+       * expression.cs (ArrayCreation.Emit): Some bits to initialize data
+       in an array.
+
+       (Binary.ResolveOperator): Handle operator != (object a, object b)
+       and operator == (object a, object b);
+
+       (Binary.DoNumericPromotions): Indicate whether the numeric
+       promotion was possible.
+
+       (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
+       Implement.  
+
+       Made the ArrayAccess implement interface IAssignMethod instead of
+       IStackStore as the order in which arguments are passed reflects
+       this.
+
+       * assign.cs: Instead of using expr.ExprClass to select the way of
+       assinging, probe for the IStackStore/IAssignMethod interfaces.
+
+       * typemanager.cs: Load InitializeArray definition.
+
+       * rootcontext.cs (RootContext.MakeStaticData): Used to define
+       static data that can be used to initialize arrays. 
+
+2001-11-05  Miguel de Icaza  <miguel@ximian.com>
+
+       * expression.cs: Handle operator== and operator!= for booleans.
+
+       (Conditioal.Reduce): Implement reducer for the ?: operator.
+
+       (Conditional.Resolve): Implement dead code elimination.
+
+       (Binary.Resolve): Catch string literals and return a new
+       concatenated string.
+
+       (Unary.Reduce): Implement reduction of unary expressions.
+
+       * ecore.cs: Split out the expression core handling here.
+
+       (Expression.Reduce): New method used to perform constant folding
+       and CSE.  This is needed to support constant-expressions. 
+       
+       * statement.cs (Statement.EmitBoolExpression): Pass true and false
+       targets, and optimize for !x.
+
+2001-11-04  Ravi Pratap  <ravi@ximian.com>
+
+       * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
+       of an attribute gives us a CustomAttributeBuilder which we use accordingly to
+       set custom atttributes.
+
+       * literal.cs (Literal::GetValue): New abstract method to return the actual
+       value of the literal, cast as an object.
+
+       (*Literal): Implement GetValue method.
+
+       * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
+       expressions to the arraylist but objects of type Argument.
+
+       * class.cs (TypeContainer::Emit): Emit our attributes too.
+
+       (Method::Emit, Constructor::Emit): Ditto.
+
+       * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
+       to be ignoring earlier.
+
+2001-11-03  Ravi Pratap  <ravi@ximian.com>
+
+       * attribute.cs (AttributeSection::Define): Implement to do the business
+       of constructing a CustomAttributeBuilder.
+
+       (Attribute): New trivial class. Increases readability of code.  
+
+       * cs-parser.jay : Update accordingly.
+
+       (positional_argument_list, named_argument_list, named_argument): New rules
+
+       (attribute_arguments): Use the above so that we are more correct.
+       
+2001-11-02  Ravi Pratap  <ravi@ximian.com>
+       
+       * expression.cs (Invocation::IsParamsMethodApplicable): Implement
+       to perform all checks for a method with a params parameter.
+
+       (Invocation::OverloadResolve): Update to use the above method and therefore
+       cope correctly with params method invocations.
+
+       * support.cs (InternalParameters::ParameterDesc): Provide a desc for 
+       params too.
+
+       * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
+       constructors in our parent too because we can't afford to miss out on 
+       protected ones ;-)
+
+       * attribute.cs (AttributeSection): New name for the class Attribute
+
+       Other trivial changes to improve readability.
+
+       * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
+       use the new class names.
+       
+2001-11-01  Ravi Pratap  <ravi@ximian.com>
+
+       * class.cs (Method::Define): Complete definition for params types too
+
+       (Indexer::Define): Ditto.
+
+       * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
+       Cope everywhere with a request for info about the array parameter.
+
+2001-11-01  Ravi Pratap  <ravi@ximian.com>
+
+       * tree.cs (RecordNamespace): Fix up to check for the correct key.
+
+       * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in 
+       local_variable_type to extract the string corresponding to the type.
+
+       (local_variable_type): Fixup the action to use the new helper method.
+
+       * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to 
+       go.
+
+       * expression.cs : Clean out code which uses the above.
+
+2001-10-31  Ravi Pratap  <ravi@ximian.com>
+       
        * typemanager.cs (RegisterMethod): Check if we already have an existing key
        and bale out if necessary by returning a false.