Inference/src/CodeGeneration/Operations/CGRuntimeCheckArgumentOperation.cs
/// <summary>
/// Groups several kind of calls.
/// Checks if the parameter passed (operand) matches with the proper argument.
/// Finally, if the operand is a value type it perforns an unbox.any over the the operand
/// </summary>
/// <param name="operand">parameter to check</param>
/// <returns></returns>
Groups several kind of calls.
Checks if the parameter passed (operand) matches with the proper argument.
Finally, if the operand is a value type it perforns an unbox.any over the the operand
Groups several kind of calls . Checks if the parameter passed ( operand ) matches with the proper argument . Finally if the operand is a value type it perforns an unbox . any over the the operand
private object MultiTypeExec(TypeExpression operand, object arg) {
            this.codeGenerator.dup(this.indent);
            this.codeGenerator.isinst(this.indent, operand);
            this.nextMethod.Add(this.codeGenerator.NewLabel);
            this.codeGenerator.brfalse(this.indent, nextMethod[nextMethod.Count - 1]);
            if (operand.IsValueType())
                this.codeGenerator.UnboxAny(this.indent, operand);
            return null;
        }
private object MultiTypeExec ( TypeExpression operand , object arg ) { this . codeGenerator . dup ( this . indent ) ; this . codeGenerator . isinst ( this . indent , operand ) ; this . nextMethod . Add ( this . codeGenerator . NewLabel ) ; this . codeGenerator . brfalse ( this . indent , nextMethod [ nextMethod . Count - 1 ] ) ; if ( operand . IsValueType ( ) ) this . codeGenerator . UnboxAny ( this . indent , operand ) ; return null ; }
Groups several kind of calls.
Groups several kind of calls .
// if check fail then check nextMethod
None
operand
TypeExpression
parameter to check
parameter to check
arg
object