Inference/src/CodeGeneration/ILCodeGenerator.cs
/// <summary>
/// Writes the 'token' of call instructions.
/// </summary>
/// <param name="memberType">Member type (null when the implicit object is a fresh type variable).</param>
/// <param name="klass">WriteType of the object to access to the member.</param>
/// <param name="member">Member to call.</param>
/// <param name="arguments">Actual arguments. This parameter is only necessary when the "memberType" parameter may be null.</param>
Writes the 'token' of call instructions.
Writes the ' token ' of call instructions .
virtual protected void WriteCall(MethodType memberType, TypeExpression klass, string member, AST.CompoundExpression arguments) {
            if (IsInstance(memberType))
                this.ilStamentsCodeGeneration.Write("instance ");
            string returnILType, classILType;
            if (memberType != null) {
                if (memberType.Return is FieldType && ((FieldType)memberType.Return).FieldTypeExpression is TypeVariable)
                    returnILType = "object"; 
                else
                    returnILType = memberType.Return.ILType();
                classILType = klass.ILType();
            } else {
                returnILType = "object"; 
                classILType = "[mscorlib]System.Object";
            }
            this.ilStamentsCodeGeneration.Write("{0} {1}::{2}", returnILType, classILType, member);
            this.WriteParams(memberType, arguments);
        }
virtual protected void WriteCall ( MethodType memberType , TypeExpression klass , string member , AST . CompoundExpression arguments ) { if ( IsInstance ( memberType ) ) this . ilStamentsCodeGeneration . Write ( " " ) ; string returnILType , classILType ; if ( memberType != null ) { if ( memberType . Return is FieldType && ( ( FieldType ) memberType . Return ) . FieldTypeExpression is TypeVariable ) returnILType = " " ; else returnILType = memberType . Return . ILType ( ) ; classILType = klass . ILType ( ) ; } else { returnILType = " " ; classILType = " " ; } this . ilStamentsCodeGeneration . Write ( " " , returnILType , classILType , member ) ; this . WriteParams ( memberType , arguments ) ; }
Writes the 'token' of call instructions.
Writes the ' token ' of call instructions .
// * Fresh type variables // * Fresh type variables
memberType
MethodType
Member type (null when the implicit object is a fresh type variable).
Member type ( null when the implicit object is a fresh type variable ) .
klass
TypeExpression
WriteType of the object to access to the member.
WriteType of the object to access to the member .
member
string
Member to call.
Member to call .
arguments
AST.CompoundExpression
Actual arguments. This parameter is only necessary when the "memberType" parameter may be null.
Actual arguments . This parameter is only necessary when the " memberType " parameter may be null .