public override void Compile(ActionBranch currentAction, ActionBranch nextAction, ILimnorCodeCompiler compiler, IMethodCompile methodToCompile, CodeMemberMethod method, CodeStatementCollection statements, CodeExpressionCollection parameters, IObjectPointer returnReceiver, bool debug)
        {
            CodeExpression cmi;

            CodeExpression[] ps;
            if (parameters != null)
            {
                ps = new CodeExpression[parameters.Count];
                parameters.CopyTo(ps, 0);
            }
            else
            {
                ps = new CodeExpression[] { };
            }
            CodeExpression oce;

            if (_returnReceiver != null)
            {
                if (_returnReceiver.BaseClassType.IsArray)
                {
                    if (ps.Length == 1)
                    {
                        oce = new CodeArrayCreateExpression(_returnReceiver.TypeString, ps[0]);
                    }
                    else
                    {
                        oce = new CodeArrayCreateExpression(_returnReceiver.TypeString, ps);
                    }
                }
                else
                {
                    //currently custom generic type is not supported
                    oce = new CodeObjectCreateExpression(_returnReceiver.GetCodeTypeReference(), ps);
                }
            }
            else
            {
                oce = new CodeObjectCreateExpression(ReturnType, ps);
            }
            cmi = oce;
            CodeExpression      cr  = _returnReceiver.GetReferenceCode(methodToCompile, statements, true);
            CodeAssignStatement cas = new CodeAssignStatement(cr, cmi);

            statements.Add(cas);
        }