+2001-10-02 Miguel de Icaza <miguel@ximian.com>
+
+ * expression.cs (TypeOf::Emit): Implement.
+
+ * typemanager.cs: runtime_handle_type, new global type.
+
+ * class.cs (Property::Emit): Generate code for properties.
+
+2001-10-02 Ravi Pratap <ravi@ximian.com>
+
+ * expression.cs (Unary::ResolveOperator): Find operators on base type
+ too - we now conform exactly to the spec.
+
+ (Binary::ResolveOperator): Same here.
+
+ * class.cs (Operator::Define): Fix minor quirk in the tests.
+
+ * ../errors/cs0215.cs : Added.
+
+ * ../errors/cs0556.cs : Added.
+
+ * ../errors/cs0555.cs : Added.
+
+2001-10-01 Miguel de Icaza <miguel@ximian.com>
+
+ * cs-tokenizer.cs: Reimplemented Location to be a struct with a
+ single integer which is really efficient
+
+2001-10-01 Ravi Pratap <ravi@ximian.com>
+
+ * expression.cs (Expression::ImplicitUserConversion): Use location
+ even in the case when we are examining True operators.
+
+ * class.cs (Operator::Define): Perform extensive checks to conform
+ with the rules for operator overloading in the spec.
+
+ * expression.cs (Expression::ImplicitReferenceConversion): Implement
+ some of the other conversions mentioned in the spec.
+
+ * typemanager.cs (array_type): New static member for the System.Array built-in
+ type.
+
+ (cloneable_interface): For System.ICloneable interface.
+
+ * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
+ we start resolving the tree and populating types.
+
+ * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
+
+2001-10-01 Miguel de Icaza <miguel@ximian.com>
+
+ * expression.cs (Expression::ExprClassFromMemberInfo,
+ Expression::Literalize): Create literal expressions from
+ FieldInfos which are literals.
+
+ (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
+ type casts, because they were wrong. The test suite in tests
+ caught these ones.
+
+ (ImplicitNumericConversion): ushort to ulong requires a widening
+ cast.
+
+ Int32 constant to long requires widening cast as well.
+
+ * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
+ for integers because the type on the stack is not i4.
+
+2001-09-30 Miguel de Icaza <miguel@ximian.com>
+
+ * expression.cs (report118): require location argument.
+
+ * parameter.cs: Do not dereference potential null value.
+
+ * class.cs: Catch methods that lack the `new' keyword when
+ overriding a name. Report warnings when `new' is used without
+ anything being there to override.
+
+ * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
+
+ * class.cs: Only add constructor to hashtable if it is non-null
+ (as now constructors can fail on define).
+
+ (TypeManager, Class, Struct): Take location arguments.
+
+ Catch field instance initialization in structs as errors.
+
+ accepting_filter: a new filter for FindMembers that is static so
+ that we dont create an instance per invocation.
+
+ (Constructor::Define): Catch errors where a struct constructor is
+ parameterless
+
+ * cs-parser.jay: Pass location information for various new
+ constructs.
+
+ * delegate.cs (Delegate): take a location argument.
+
+ * driver.cs: Do not call EmitCode if there were problesm in the
+ Definition of the types, as many Builders wont be there.
+
+ * decl.cs (Decl::Decl): Require a location argument.
+
+ * cs-tokenizer.cs: Handle properly hex constants that can not fit
+ into integers, and find the most appropiate integer for it.
+
+ * literal.cs: Implement ULongLiteral.
+
+ * rootcontext.cs: Provide better information about the location of
+ failure when CreateType fails.
+
+2001-09-29 Miguel de Icaza <miguel@ximian.com>
+
+ * rootcontext.cs (RootContext::PopulateTypes): Populates structs
+ as well.
+
+ * expression.cs (Binary::CheckShiftArguments): Add missing type
+ computation.
+ (Binary::ResolveOperator): Add type to the logical and and logical
+ or, Bitwise And/Or and Exclusive Or code paths, it was missing
+ before.
+
+ (Binary::DoNumericPromotions): In the case where either argument
+ is ulong (and most signed types combined with ulong cause an
+ error) perform implicit integer constant conversions as well.
+
+2001-09-28 Miguel de Icaza <miguel@ximian.com>
+
+ * expression.cs (UserImplicitCast): Method should always be
+ non-null.
+ (Invocation::BetterConversion): Simplified test for IntLiteral.
+
+ (Expression::ImplicitNumericConversion): Split this routine out.
+ Put the code that performs implicit constant integer conversions
+ here.
+
+ (Expression::Resolve): Become a wrapper around DoResolve so we can
+ check eclass and type being set after resolve.
+
+ (Invocation::Badness): Remove this dead function
+
+ (Binary::ResolveOperator): Do not compute the expensive argumnets
+ unless we have a union for it.
+
+ (Probe::Emit): Is needs to do an isinst and then
+ compare against null.
+
+ (::CanConvert): Added Location argument. If the Location argument
+ is null (Location.Null), then we do not report errors. This is
+ used by the `probe' mechanism of the Explicit conversion. We do
+ not want to generate an error for something that the user
+ explicitly requested to be casted. But the pipeline for an
+ explicit cast first tests for potential implicit casts.
+
+ So for now, if the Location is null, it means `Probe only' to
+ avoid adding another argument. Might have to revise this
+ strategy later.
+
+ (ClassCast): New class used to type cast objects into arbitrary
+ classes (used in Explicit Reference Conversions).
+
+ Implement `as' as well.
+
+ Reverted all the patches from Ravi below: they were broken:
+
+ * The use of `level' as a mechanism to stop recursive
+ invocations is wrong. That was there just to catch the
+ bug with a strack trace but not as a way of addressing
+ the problem.
+
+ To fix the problem we have to *understand* what is going
+ on and the interactions and come up with a plan, not
+ just get things going.
+
+ * The use of the type conversion cache that I proposed
+ last night had an open topic: How does this work across
+ protection domains. A user defined conversion might not
+ be public in the location where we are applying the
+ conversion, a different conversion might be selected
+ (ie, private A->B (better) but public B->A (worse),
+ inside A, A->B applies, but outside it, B->A will
+ apply).
+
+ * On top of that (ie, even if the above is solved),
+ conversions in a cache need to be abstract. Ie, `To
+ convert from an Int to a Short use an OpcodeCast', not
+ `To convert from an Int to a Short use the OpcodeCast on
+ the variable 5' (which is what this patch was doing).
+
+2001-09-28 Ravi Pratap <ravi@ximian.com>
+
+ * expression.cs (Invocation::ConversionExists): Re-write to use
+ the conversion cache
+
+ (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
+ cache all conversions done, not just user-defined ones.
+
+ (Invocation::BetterConversion): The real culprit. Use ConversionExists
+ to determine if a conversion exists instead of acutually trying to
+ perform the conversion. It's faster too.
+
+ (Expression::ConvertExplicit): Modify to use ConversionExists to check
+ and only then attempt the implicit conversion.
+
+2001-09-28 Ravi Pratap <ravi@ximian.com>
+
+ * expression.cs (ConvertImplicit): Use a cache for conversions
+ already found. Check level of recursion and bail out if necessary.
+
+2001-09-28 Miguel de Icaza <miguel@ximian.com>
+
+ * typemanager.cs (string_concat_string_string, string_concat_object_object):
+ Export standard methods that we expect for string operations.
+
+ * statement.cs (Block::UsageWarning): Track usage of variables and
+ report the errors for not used variables.
+
+ * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
+ operator.
+
+2001-09-27 Miguel de Icaza <miguel@ximian.com>
+
+ * codegen.cs: remove unnneded code
+
+ * expression.cs: Removed BuiltinTypeAccess class
+
+ Fix the order in which implicit conversions are
+ done.
+
+ The previous fixed dropped support for boxed conversions (adding a
+ test to the test suite now)
+
+ (UserImplicitCast::CanConvert): Remove test for source being null,
+ that code is broken. We should not feed a null to begin with, if
+ we do, then we should track the bug where the problem originates
+ and not try to cover it up here.
+
+ Return a resolved expression of type UserImplicitCast on success
+ rather than true/false. Ravi: this is what I was talking about,
+ the pattern is to use a static method as a "constructor" for
+ objects.
+
+ Also, do not create arguments until the very last minute,
+ otherwise we always create the arguments even for lookups that
+ will never be performed.
+
+ (UserImplicitCast::Resolve): Eliminate, objects of type
+ UserImplicitCast are born in a fully resolved state.
+
+ * typemanager.cs (InitCoreTypes): Init also value_type
+ (System.ValueType).
+
+ * expression.cs (Cast::Resolve): First resolve the child expression.
+
+ (LValue): Add new method AddressOf to be used by
+ the `&' operator.
+
+ Change the argument of Store to take an EmitContext instead of an
+ ILGenerator, because things like FieldExpr need to be able to call
+ their children expression to generate the instance code.
+
+ (Expression::Error, Expression::Warning): Sugar functions for
+ reporting errors.
+
+ (Expression::MemberLookup): Accept a TypeContainer instead of a
+ Report as the first argument.
+
+ (Expression::ResolvePrimary): Killed. I still want to improve
+ this as currently the code is just not right.
+
+ (Expression::ResolveMemberAccess): Simplify, but it is still
+ wrong.
+
+ (Unary::Resolve): Catch errors in AddressOf operators.
+
+ (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
+ index to a byte for the short-version, or the compiler will choose
+ the wrong Emit call, which generates the wrong data.
+
+ (ParameterReference::Emit, ::Store): same.
+
+ (FieldExpr::AddressOf): Implement.
+
+ * typemanager.cs: TypeManager: made public variable instead of
+ property.
+
+ * driver.cs: document --fatal.
+
+ * report.cs (ErrorMessage, WarningMessage): new names for the old
+ Error and Warning classes.
+
+ * cs-parser.jay (member_access): Turn built-in access to types
+ into a normal simplename
+
+2001-09-27 Ravi Pratap <ravi@ximian.com>
+
+ * expression.cs (Invocation::BetterConversion): Fix to cope
+ with q being null, since this was introducing a bug.
+
+ * expression.cs (ConvertImplicit): Do built-in conversions first.
+
+2001-09-27 Ravi Pratap <ravi@ximian.com>
+
+ * expression.cs (UserImplicitCast::Resolve): Fix bug.
+
+2001-09-27 Ravi Pratap <ravi@ximian.com>
+
+ * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
+ I had introduced long ago (what's new ?).
+
+ * expression.cs (UserImplicitCast::CanConvert): Static method to do
+ the work of all the checking.
+ (ConvertImplicit): Call CanConvert and only then create object if necessary.
+ (UserImplicitCast::CanConvert, ::Resolve): Re-write.
+
+ (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
+ that is the right way.
+
+ (Invocation::MakeUnionSet): Convenience function to make unions of sets for
+ overloading resolution. Use everywhere instead of cutting and pasting code.
+
+ (Binary::ResolveOperator): Use MakeUnionSet.
+
+ (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when
+ we have to convert to bool types. Not complete yet.
+
+2001-09-27 Miguel de Icaza <miguel@ximian.com>
+
+ * typemanager.cs (TypeManager::CSharpName): support ushort.
+
+ * expression.cs (Expression::TryImplicitIntConversion): Attempts
+ to provide an expression that performsn an implicit constant int
+ conversion (section 6.1.6).
+ (Expression::ConvertImplicitRequired): Reworked to include
+ implicit constant expression conversions.
+
+ (Expression::ConvertNumericExplicit): Finished.
+
+ (Invocation::Emit): If InstanceExpression is null, then it means
+ that we perform a call on this.
+
+2001-09-26 Miguel de Icaza <miguel@ximian.com>
+
+ * expression.cs (Unary::Emit): Remove some dead code.
+ (Probe): Implement Resolve and Emit for `is'.
+ (Expression::ConvertImplicitRequired): Attempt to do constant
+ expression conversions here. Maybe should be moved to
+ ConvertImplicit, but I am not sure.
+ (Expression::ImplicitLongConstantConversionPossible,
+ Expression::ImplicitIntConstantConversionPossible): New functions
+ that tell whether is it possible to apply an implicit constant
+ expression conversion.
+
+ (ConvertNumericExplicit): Started work on explicit numeric
+ conversions.
+
+ * cs-parser.jay: Update operator constants.
+
+ * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
+ (Parameters::GetSignature): Hook up VerifyArgs here.
+ (Parameters::VerifyArgs): Verifies that no two arguments have the
+ same name.
+
+ * class.cs (Operator): Update the operator names to reflect the
+ ones that the spec expects (as we are just stringizing the
+ operator names).
+
+ * expression.cs (Unary::ResolveOperator): Fix bug: Use
+ MethodInfo's ReturnType instead of LookupMethodByBuilder as the
+ previous usage did only work for our methods.
+ (Expression::ConvertImplicit): Handle decimal implicit numeric
+ conversions as well.
+ (Expression::InternalTypeConstructor): Used to invoke constructors
+ on internal types for default promotions.
+
+ (Unary::Emit): Implement special handling for the pre/post
+ increment/decrement for overloaded operators, as they need to have
+ the same semantics as the other operators.
+
+ (Binary::ResolveOperator): ditto.
+ (Invocation::ConversionExists): ditto.
+ (UserImplicitCast::Resolve): ditto.
+
+2001-09-26 Ravi Pratap <ravi@ximian.com>
+
+ * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
+ operator, return after emitting body. Regression tests pass again !
+
+ * expression.cs (ConvertImplicit): Take TypeContainer as first argument
+ (Unary::ForceConversion, Binary::ForceConversion): Ditto.
+ (Invocation::OverloadResolve): Ditto.
+ (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
+
+ * everywhere : update calls to the above methods accordingly.
+
+2001-09-26 Miguel de Icaza <miguel@ximian.com>
+
+ * assign.cs (Assign): Make it inherit from ExpressionStatement.
+
+ * expression.cs (ExpressionStatement): New base class used for
+ expressions that can appear in statements, so that we can provide
+ an alternate path to generate expression that do not leave a value
+ on the stack.
+
+ (Expression::Emit, and all the derivatives): We no longer return
+ whether a value is left on the stack or not. Every expression
+ after being emitted leaves a single value on the stack.
+
+ * codegen.cs (EmitContext::EmitStatementExpression): Use the
+ facilties of ExpressionStatement if possible.
+
+ * cs-parser.jay: Update statement_expression.
+
+2001-09-25 Miguel de Icaza <miguel@ximian.com>
+
+ * driver.cs: Change the wording of message
+
+2001-09-25 Ravi Pratap <ravi@ximian.com>
+
+ * expression.cs (Binary::ResolveOperator): Had forgottten to set
+ the type of the expression to the return type of the method if
+ we have an overloaded operator match ! The regression tests pass again !
+ (Unary::ResolveOperator): Ditto.
+
+ * expression.cs (Invocation::ConversionExists): Correct the member lookup
+ to find "op_Implicit", not "implicit" ;-)
+ (UserImplicitCast): New class to take care of user-defined implicit conversions.
+ (ConvertImplicit, ForceConversion): Take TypeContainer argument
+
+ * everywhere : Correct calls to the above accordingly.
+
+ * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
+ (ConvertImplicit): Do user-defined conversion if it exists.
+
+2001-09-24 Miguel de Icaza <miguel@ximian.com>
+
+ * assign.cs: track location.
+ (Resolve): Use implicit conversions on assignment.
+
+ * literal.cs: Oops. Not good, Emit of short access values should
+ pass (Bytes) or the wrong argument will be selected.
+
+ * expression.cs (Unary::Emit): Emit code for -expr.
+
+ (Unary::ResolveOperator): Handle `Substract' for non-constants
+ (substract from zero from the non-constants).
+ Deal with Doubles as well.
+
+ (Expression::ConvertImplicitRequired): New routine that reports an
+ error if no implicit conversion exists.
+
+ (Invocation::OverloadResolve): Store the converted implicit
+ expressions if we make them
+
+2001-09-24 Ravi Pratap <ravi@ximian.com>
+
+ * class.cs (ConstructorInitializer): Take a Location argument.
+ (ConstructorBaseInitializer): Same here.
+ (ConstructorThisInitializer): Same here.
+
+ * cs-parser.jay : Update all calls accordingly.
+
+ * expression.cs (Unary, Binary, New): Take location argument.
+ Update accordingly everywhere.
+
+ * cs-parser.jay : Update all calls to the above to take a location
+ argument.
+
+ * class.cs : Ditto.
+
+2001-09-24 Ravi Pratap <ravi@ximian.com>
+
+ * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
+ (Invocation::BetterConversion): Same here
+ (Invocation::ConversionExists): Ditto.
+
+ (Invocation::ConversionExists): Implement.
+
+2001-09-22 Ravi Pratap <ravi@ximian.com>
+
+ * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
+ Also take an additional TypeContainer argument.
+
+ * All over : Pass in TypeContainer as argument to OverloadResolve.
+
+ * typemanager.cs (CSharpName): Update to check for the string type and return
+ that too.
+
+ * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
+ a given method.
+
+2001-09-21 Ravi Pratap <ravi@ximian.com>
+
+ * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
+ (Invocation::BetterFunction): Implement.
+ (Invocation::BetterConversion): Implement.
+ (Invocation::ConversionExists): Skeleton, no implementation yet.
+
+ Okay, things work fine !
+
+2001-09-21 Miguel de Icaza <miguel@ximian.com>
+
+ * typemanager.cs: declare and load enum_type, delegate_type and
+ void_type.
+
+ * expression.cs (Expression::Emit): Now emit returns a value that
+ tells whether a value is left on the stack or not. This strategy
+ might be reveted tomorrow with a mechanism that would address
+ multiple assignments.
+ (Expression::report118): Utility routine to report mismatches on
+ the ExprClass.
+
+ (Unary::Report23): Report impossible type/operator combination
+ utility function.
+
+ (Unary::IsIncrementableNumber): Whether the type can be
+ incremented or decremented with add.
+ (Unary::ResolveOperator): Also allow enumerations to be bitwise
+ complemented.
+ (Unary::ResolveOperator): Implement ++, !, ~, ++ and --.
+
+ (Invocation::Emit): Deal with new Emit convetion.
+
+ * All Expression derivatives: Updated their Emit method to return
+ whether they leave values on the stack or not.
+
+ * codegen.cs (CodeGen::EmitStatement): Pop values left on the
+ stack for expressions that are statements.
+
+2001-09-20 Miguel de Icaza <miguel@ximian.com>
+
+ * expression.cs (LValue): New interface. Must be implemented by
+ LValue objects.
+ (LocalVariableReference, ParameterReference, FieldExpr): Implement
+ LValue interface.
+
+ * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
+ interface for generating code, simplifies the code.
+
+2001-09-20 Ravi Pratap <ravi@ximian.com>
+
+ * expression.cs (everywhere): Comment out return statements in ::Resolve
+ methods to avoid the warnings.
+
+2001-09-20 Miguel de Icaza <miguel@ximian.com>
+
+ * driver.cs (parse): Report error 2001 if we can not open the
+ source file.
+
+ * expression.cs (SimpleName::ResolveSimpleName): Error if we can
+ not resolve it.
+
+ * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
+ object.
+
+ * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
+ otherwise nested blocks end up with the same index.
+
+ * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
+
+ * expression.cs: Instead of having FIXMEs in the Resolve
+ functions, throw exceptions so it is obvious that we are facing a
+ bug.
+
+ * cs-parser.jay (invocation_expression): Pass Location information.
+
+ * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
+ Use a basename for those routines because .NET does not like paths
+ on them.
+
+ * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
+ already defined.
+
+2001-09-19 Miguel de Icaza <miguel@ximian.com>
+
+ * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
+ are loading the correct data types (throws an exception if not).
+ (TypeManager::InitCoreTypes): Use CoreLookupType
+
+ * expression.cs (Unary::ResolveOperator): return the child
+ expression for expressions which are just +expr.
+ (Unary::ResolveOperator): Return negative literals for -LITERAL
+ expressions (otherwise they are Unary {Literal}).
+ (Invocation::Badness): Take into account `Implicit constant
+ expression conversions'.
+
+ * literal.cs (LongLiteral): Implement long literal class.
+ (IntLiteral): export the `Value' of the intliteral.
+
+2001-09-19 Ravi Pratap <ravi@ximian.com>
+
+ * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
+
+ * class.cs (Operator::Define): Change the methodname prefix to 'op_'
+ instead of 'Operator'
+
+ * expression.cs (Binary::ResolveOperator): Update accordingly.
+ (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
+ and 'Minus'
+
+ * cs-parser.jay (unary_expression): Update to use the new names.
+
+ * gen-treedump.cs (GetUnary): Same here.
+
+ * expression.cs (Unary::Resolve): Implement.
+ (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded
+ operators are found instead of making noise ;-)
+ (Unary::ResolveOperator): New method to do precisely the same thing which
+ Binary::ResolveOperator does for Binary expressions.
+ (Unary.method, .Arguments): Add.
+ (Unary::OperName): Implement.
+ (Unary::ForceConversion): Copy and Paste !
+
+ * class.cs (Operator::Define): Fix a small bug for the case when we have
+ a unary operator.
+
+ * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
+ for the inbuilt operators. Only overloading works for now ;-)
+
+2001-09-18 Miguel de Icaza <miguel@ximian.com>
+
+ * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
+ UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
+
+ * expression.cs (This::Emit): Implement.
+ (This::Resolve): Implement.
+ (TypeOf:Resolve): Implement.
+ (Expression::ResolveSimpleName): Add an implicit this to instance
+ field references.
+ (MemberAccess::Resolve): Deal with Parameters and Fields.
+ Bind instance variable to Field expressions.
+ (FieldExpr::Instance): New field used to track the expression that
+ represents the object instance.
+ (FieldExpr::Resolve): Track potential errors from MemberLookup not
+ binding
+ (FieldExpr::Emit): Implement.
+
+ * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
+ the last instruction contains a return opcode to avoid generating
+ the last `ret' instruction (this generates correct code, and it is
+ nice to pass the peverify output).
+
+ * class.cs (TypeContainer::EmitFieldInitializers): Implement field
+ initializer for static and instance variables.
+ (Constructor::Emit): Allow initializer to be null in the case of
+ static constructors. Only emit initializer for instance
+ constructors.
+
+ (TypeContainer::FindMembers): Return a null array if there are no
+ matches.
+
+ Also fix the code for the MemberTypes.Method branch, as it was not
+ scanning that for operators (or tried to access null variables before).
+
+ * assign.cs (Assign::Emit): Handle instance and static fields.
+
+ * TODO: Updated.
+
+ * driver.cs: Stop compilation if there are parse errors.
+
+ * cs-parser.jay (constructor_declaration): Provide default base
+ initializer for non-static constructors.
+ (constructor_declarator): Do not provide a default base
+ initializers if none was specified.
+ Catch the fact that constructors should not have parameters.
+
+ * class.cs: Do not emit parent class initializers for static
+ constructors, that should be flagged as an error.
+
+2001-09-18 Ravi Pratap <ravi@ximian.com>
+
+ * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
+ Move back code into TypeContainer::Populate.
+
+2001-09-18 Ravi Pratap <ravi@ximian.com>
+
+ * class.cs (TypeContainer::AddConstructor): Fix the check to
+ compare against Name, not Basename.
+ (Operator::OpType): Change Plus and Minus to Add and Subtract.
+
+ * cs-parser.jay : Update accordingly.
+
+ * class.cs (TypeContainer::FindMembers): For the case where we are searching
+ for methods, don't forget to look into the operators too.
+ (RegisterMethodBuilder): Helper method to take care of this for
+ methods, constructors and operators.
+ (Operator::Define): Completely revamp.
+ (Operator.OperatorMethod, MethodName): New fields.
+ (TypeContainer::Populate): Move the registering of builders into
+ RegisterMethodBuilder.
+ (Operator::Emit): Re-write.
+
+ * expression.cs (Binary::Emit): Comment out code path to emit method
+ invocation stuff for the case when we have a user defined operator. I am
+ just not able to get it right !
+
+2001-09-17 Miguel de Icaza <miguel@ximian.com>
+
+ * expression.cs (Expression::OverloadResolve): Drop TypeContainer
+ argument.
+
+ (Expression::MemberLookup): Provide a version that allows to
+ specify the MemberTypes and BindingFlags.
+
+ * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
+ so it was not fetching variable information from outer blocks.
+
+ * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
+ Beforefieldinit as it was buggy.
+
+ * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
+ that Ravi put here.
+
+ * class.cs (Constructor::Emit): Only emit if block is not null.
+ (TypeContainer::EmitDefaultConstructor): Removed routine, now we
+ deal with this by semantically definining it as if the user had
+ done it.
+
+ (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
+ constructors as we now "emit" them at a higher level.
+
+ (TypeContainer::DefineDefaultConstructor): Used to define the
+ default constructors if none was provided.
+
+ (ConstructorInitializer): Add methods Resolve and Emit.
+
+ * expression.cs: Cast to ConstructorInfo instead of MethodInfo
+
+2001-09-17 Ravi Pratap <ravi@ximian.com>
+
+ * class.cs (TypeContainer::EmitDefaultConstructor): Register
+ the default constructor builder with our hashtable for methodbuilders
+ to methodcores.
+
+ * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
+ and argument_count is 0 in which case we have a match.
+ (Binary::ResolveOperator): More null checking and miscellaneous coding
+ style cleanup.
+
+2001-09-17 Ravi Pratap <ravi@ximian.com>
+
+ * rootcontext.cs (IsNameSpace): Compare against null.
+
+ * everywhere : Correct spelling to 'Greater' and to 'Subtract'
+
+ * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
+ and Unary::Operator.
+
+ * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
+ accordingly.
+
+ * expression.cs (Binary::method): New member to hold the MethodBase for the case when
+ we have overloaded operators.
+ (Binary::ResolveOperator): Implement the part which does the operator overload
+ resolution.
+
+ * class.cs (Operator::Emit): Implement.
+ (TypeContainer::Emit): Emit the operators we have too.
+
+ * expression.cs (Binary::Emit): Update to emit the appropriate code for
+ the case when we have a user-defined operator.
+
+2001-09-17 Miguel de Icaza <miguel@ximian.com>
+
+ * rootcontext.cs: Fix bug: tree.Namespaces might be null.
+
+2001-09-16 Ravi Pratap <ravi@ximian.com>
+
+ * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
+ (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
+ (Constructor::Emit): Implement.
+ (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
+ if we have no work to do.
+ (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's
+ Emit method.
+
+ * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
+ (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
+
+ * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
+ of parent.parent.
+
+2001-09-15 Ravi Pratap <ravi@ximian.com>
+
+ * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
+ in the source.
+ (Tree::RecordNamespace): Method to do what the name says ;-)
+ (Tree::Namespaces): Property to get at the namespaces hashtable.
+
+ * cs-parser.jay (namespace_declaration): Call RecordNamespace to
+ keep track.
+
+ * rootcontext.cs (IsNamespace): Fixed it :-)
+
+2001-09-14 Miguel de Icaza <miguel@ximian.com>
+
+ * class.cs (TypeContainer::FindMembers): Add support for
+ constructors.
+ (MethodCore): New class that encapsulates both the shared aspects
+ of a Constructor and a Method.
+ (Method, Constructor): Factored pieces into MethodCore.
+
+ * driver.cs: Added --fatal which makes errors throw exceptions.
+ Load System assembly as well as part of the standard library.
+
+ * report.cs: Allow throwing exceptions on errors for debugging.
+
+ * modifiers.cs: Do not use `parent', instead use the real type
+ container to evaluate permission settings.
+
+ * class.cs: Put Ravi's patch back in. He is right, and we will
+ have to cope with the
+
+2001-09-14 Ravi Pratap <ravi@ximian.com>
+
+ * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
+ FamORAssem, not FamANDAssem.
+
+2001-09-14 Miguel de Icaza <miguel@ximian.com>
+
+ * driver.cs: Added --parse option that only parses its input files
+ and terminates.
+
+ * class.cs: Reverted last change from Ravi to IsTopLevel. That is
+ incorrect. IsTopLevel is not used to tell whether an object is
+ root_types or not (that can be achieved by testing this ==
+ root_types). But to see if this is a top-level *class* (not
+ necessarly our "toplevel" container).
+
+2001-09-14 Ravi Pratap <ravi@ximian.com>
+
+ * enum.cs (Enum::Define): Modify to call the Lookup method on the
+ parent instead of a direct call to GetType.
+
+2001-09-14 Ravi Pratap <ravi@ximian.com>
+
+ * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
+ Modifiers.TypeAttr. This should just be a call to that method.
+
+ * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
+ object so that we can determine if we are top-level or not.
+
+ * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the
+ TypeContainer too.
+
+ * enum.cs (Enum::Define): Ditto.
+
+ * modifiers.cs (FieldAttr): Re-write.
+
+ * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
+ (TypeContainer::HaveStaticConstructor): New property to provide access
+ to precisely that info.
+
+ * modifiers.cs (MethodAttr): Re-write.
+ (EventAttr): Remove altogether as there seems to be no ostensible use for it.
+
+ * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
+ of top-level types as claimed.
+
+2001-09-13 Miguel de Icaza <miguel@ximian.com>
+
+ * expression.cs (MemberLookup): Fruitless attempt to lookup
+ constructors. Maybe I need to emit default constructors? That
+ might be it (currently .NET emits this for me automatically).
+ (Invocation::OverloadResolve): Cope with Arguments == null.
+ (Invocation::EmitArguments): new function, shared by the new
+ constructor and us.
+ (Invocation::Emit): Handle static and instance methods. Emit
+ proper call instruction for virtual or non-virtual invocations.
+ (New::Emit): Implement.
+ (New::Resolve): Implement.
+ (MemberAccess:Resolve): Implement.
+ (MethodGroupExpr::InstanceExpression): used conforming to the spec
+ to track instances.
+ (FieldExpr::Resolve): Set type.
+
+ * support.cs: Handle empty arguments.
+
+ * cs-parser.jay (CompositeLookup, QualifierIdentifier,
+ SimpleLookup): Auxiliary routines to help parse a qualifier
+ identifier.
+
+ Update qualifier_identifier rule.
+
+ * codegen.cs: Removed debugging messages.
+
+ * class.cs: Make this a global thing, this acts just as a "key" to
+ objects that we might have around.
+
+ (Populate): Only initialize method_builders_to_methods once.
+
+ * expression.cs (PropertyExpr): Initialize type from the
+ PropertyType.
+
+ * codegen.cs (EmitContext::EmitBoolExpression): Use propper
+ Resolve pattern. Attempt to implicitly convert value to boolean.
+ Emit code.
+
+ * expression.cs: Set the type for the int32/int32 argument case.
+ (Binary::ResolveOperator): Set the return type to boolean for
+ comparission operators
+
+ * typemanager.cs: Remove debugging print code.
+
+ (Invocation::Resolve): resolve type.
+
+ * class.cs: Allocate a MemberInfo of the correct size, as the code
+ elsewhere depends on the test to reflect the correct contents.
+
+ (Method::) Keep track of parameters, due to System.Reflection holes
+
+ (TypeContainer::Populate): Keep track of MethodBuilders to Method
+ mapping here.
+
+ (TypeContainer::FindMembers): Use ArrayList and then copy an array
+ of the exact size and return that.
+
+ (Class::LookupMethodByBuilder): New function that maps
+ MethodBuilders to its methods. Required to locate the information
+ on methods because System.Reflection bit us again.
+
+ * support.cs: New file, contains an interface ParameterData and
+ two implementations: ReflectionParameters and InternalParameters
+ used to access Parameter information. We will need to grow this
+ as required.
+
+ * expression.cs (Invocation::GetParameterData): implement a cache
+ and a wrapper around the ParameterData creation for methods.
+ (Invocation::OverloadResolve): Use new code.
+
+2001-09-13 Ravi Pratap <ravi@ximian.com>
+
+ * class.cs (TypeContainer::EmitField): Remove and move into
+ (Field::Define): here and modify accordingly.
+ (Field.FieldBuilder): New member.
+ (TypeContainer::Populate): Update accordingly.
+ (TypeContainer::FindMembers): Implement.
+
+2001-09-13 Miguel de Icaza <miguel@ximian.com>
+
+ * statement.cs: (VariableInfo::VariableType): New field to be
+ initialized with the full type once it is resolved.
+
+2001-09-12 Miguel de Icaza <miguel@ximian.com>
+
+ * parameter.cs (GetParameterInfo): Use a type cache to compute
+ things only once, and to reuse this information
+
+ * expression.cs (LocalVariableReference::Emit): Implement.
+ (OpcodeCast::Emit): fix.
+
+ (ParameterReference::Resolve): Implement.
+ (ParameterReference::Emit): Implement.
+
+ * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
+ that are expressions need to stay as Expressions.
+
+ * typemanager.cs (CSharpName): Returns the C# name of a type if
+ possible.
+
+ * expression.cs (Expression::ConvertImplicit): New function that
+ implements implicit type conversions.
+
+ (Expression::ImplicitReferenceConversion): Implements implicit
+ reference conversions.
+
+ (EmptyCast): New type for transparent casts.
+
+ (OpcodeCast): New type for casts of types that are performed with
+ a sequence of bytecodes.
+
+ (BoxedCast): New type used for casting value types into reference
+ types. Emits a box opcode.
+
+ (Binary::DoNumericPromotions): Implements numeric promotions of
+ and computation of the Binary::Type.
+
+ (Binary::EmitBranchable): Optimization.
+
+ (Binary::Emit): Implement code emission for expressions.
+
+ * typemanager.cs (TypeManager): Added two new core types: sbyte
+ and byte.
+
+2001-09-12 Ravi Pratap <ravi@ximian.com>
+
+ * class.cs (TypeContainer::FindMembers): Method which does exactly
+ what Type.FindMembers does, only we don't have to use reflection. No
+ implementation yet.
+
+ * typemanager.cs (typecontainers): New hashtable to hold the corresponding
+ typecontainer objects as we need to get at them.
+ (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
+
+ * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
+ typecontainer object.
+
+ * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
+ of just a Report object.
+
+2001-09-11 Ravi Pratap <ravi@ximian.com>
+
+ * class.cs (Event::Define): Go back to using the prefixes "add_" and
+ "remove_"
+ (TypeContainer::Populate): Now define the delegates of the type too.
+ (TypeContainer.Delegates): Property to access the list of delegates defined
+ in the type.
+
+ * delegates.cs (Delegate::Define): Implement partially.
+
+ * modifiers.cs (TypeAttr): Handle more flags.
+
+2001-09-11 Ravi Pratap <ravi@ximian.com>
+
+ * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
+ and not <=
+ (Operator::Define): Re-write logic to get types by using the LookupType method
+ instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
+ (Indexer::Define): Ditto.
+ (Event::Define): Ditto.
+ (Property::Define): Ditto.
+
+2001-09-10 Ravi Pratap <ravi@ximian.com>
+
+ * class.cs (TypeContainer::Populate): Now define operators too.
+ (TypeContainer.Operators): New property to access the list of operators
+ in a type.
+ (Operator.OperatorMethodBuilder): New member to hold the method builder
+ for the operator we are defining.
+ (Operator::Define): Implement.
+
+2001-09-10 Ravi Pratap <ravi@ximian.com>
+
+ * class.cs (Event::Define): Make the prefixes of the accessor methods
+ addOn_ and removeOn_
+
+ * genericparser.cs (GenericParser::error): Overloaded method to handle the case
+ of the location being passed in too. Ideally, this should go later since all
+ error reporting should be done through the Report object.
+
+ * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
+ (Populate): Iterate thru the indexers we have and define them too.
+ (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
+ for the get and set accessors.
+ (Indexer::Define): Implement.
+
+2001-09-09 Miguel de Icaza <miguel@ximian.com>
+
+ * expression.cs (Binary::Resolve): Beginning of it. I scratched
+ my previous implementation, did not work.
+
+ * typemanager.cs: Add a couple of missing types (the longs).
+
+ * literal.cs: Use TypeManager.bool_type instead of getting it.
+
+ * expression.cs (EventExpr): New kind of expressions.
+ (Expressio::ExprClassFromMemberInfo): finish
+
+2001-09-08 Miguel de Icaza <miguel@ximian.com>
+
+ * assign.cs: Emit stores to static fields differently.
+
+2001-09-08 Ravi Pratap <ravi@ximian.com>
+
+ * Merge in changes and adjust code to tackle conflicts. Backed out my
+ code in Assign::Resolve ;-)
+
+2001-09-08 Ravi Pratap <ravi@ximian.com>
+
+ * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
+ instead Report.Error and also pass in the location.
+ (CSharpParser::Lexer): New readonly property to return the reference
+ to the Tokenizer object.
+ (declare_local_variables): Use Report.Error with location instead of plain
+ old error.
+ (CheckDef): Ditto.
+
+ * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
+ (Operator.CheckBinaryOperator): Ditto.
+
+ * cs-parser.jay (operator_declarator): Update accordingly.
+
+ * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
+ (CheckBinaryOperator): Same here.
+
+ * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
+ on the name without any prefixes of namespace names etc. This is because we
+ already might have something already fully qualified like
+ 'System.Console.WriteLine'
+
+ * assign.cs (Resolve): Begin implementation. Stuck ;-)
+
+2001-09-07 Ravi Pratap <ravi@ximian.com>
+
+ * cs-tokenizer.cs (location): Return a string which also contains
+ the file name.
+
+ * expression.cs (ElementAccess): New class for expressions of the
+ type 'element access.'
+ (BaseAccess): New class for expressions of the type 'base access.'
+ (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
+ respectively.
+
+ * cs-parser.jay (element_access): Implement action.
+ (base_access): Implement actions.
+ (checked_expression, unchecked_expression): Implement.
+
+ * cs-parser.jay (local_variable_type): Correct and implement.
+ (type_suffixes, type_suffix_list, type_suffix): Implement actions.
+
+ * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
+
+ * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
+ name and the specifiers.
+
+ * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
+
+ * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of
+ making them all public ;-)
+
+ * cs-parser.jay (error): Remove entirely as we have an implementation in the base
+ class anyways.
+
+2001-09-07 Miguel de Icaza <miguel@ximian.com>
+
+ * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
+ PropertyExprs.
+ (FieldExpr, PropertyExprs): New resolved expressions.
+ (SimpleName::MemberStaticCheck): Perform static checks for access
+ to non-static fields on static methods. Maybe this should be
+ generalized for MemberAccesses.
+ (SimpleName::ResolveSimpleName): More work on simple name
+ resolution.
+
+ * cs-parser.jay (primary_expression/qualified_identifier): track
+ the parameter index.
+
+ * codegen.cs (CodeGen::Save): Catch save exception, report error.
+ (EmitContext::EmitBoolExpression): Chain to expression generation
+ instead of temporary hack.
+ (::EmitStatementExpression): Put generic expression code generation.
+
+ * assign.cs (Assign::Emit): Implement variable assignments to
+ local variables, parameters and fields.
+
+2001-09-06 Miguel de Icaza <miguel@ximian.com>
+
+ * statement.cs (Block::GetVariableInfo): New method, returns the
+ VariableInfo for a variable name in a block.
+ (Block::GetVariableType): Implement in terms of GetVariableInfo
+
+ * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
+ DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
+
2001-09-06 Ravi Pratap <ravi@ximian.com>
* cs-parser.jay (operator_declaration): Continue on my quest : update
* literal.cs (StringLiteral): Implement Emit.
->>>>>>> 1.37
2001-09-05 Ravi Pratap <ravi@ximian.com>
* cs-parser.jay (error): Add new modifier because we are hiding an inherited