public static expression_node convert_delegate_to_return_value_type(location call_location, params expression_node[] parameters)
        {
            expression_node             par = parameters[0];
            internal_interface          ii  = par.type.get_internal_interface(internal_interface_kind.delegate_interface);
            delegate_internal_interface dii = (delegate_internal_interface)ii;
            common_method_node          cmn = dii.invoke_method as common_method_node;

            if (cmn != null)
            {
                expression_node exp = new common_method_call(cmn, par, call_location);
                return(exp);
            }
            compiled_function_node cfn = dii.invoke_method as compiled_function_node;

            if (cfn != null)
            {
                expression_node exp = new compiled_function_call(cfn, par, call_location);
                return(exp);
            }
            return(null);
        }
        //TODO: Возможно стоит если пересечение типов найдено в откомпилированных типах, добавлять к нашим структурам и не искать повторно.
        public static possible_type_convertions get_convertions(type_node from, type_node to, bool is_implicit)
        {
            possible_type_convertions ret = new possible_type_convertions();

            ret.first  = null;
            ret.second = null;

            if ((from == null) || (to == null))
            {
                return(ret);
            }

            type_intersection_node tin_from = from.get_type_intersection(to);
            type_intersection_node tin_to   = to.get_type_intersection(from);

            if (tin_from != null)
            {
                if (tin_from.this_to_another != null)
                {
                    if ((!is_implicit) || (!(tin_from.this_to_another.is_explicit)))
                    {
                        add_conversion(ret, tin_from.this_to_another.convertion_method, from, to);
                    }
                }
            }
            if (tin_to != null)
            {
                if (tin_to.another_to_this != null)
                {
                    if ((!is_implicit) || (!(tin_to.another_to_this.is_explicit)))
                    {
                        add_conversion(ret, tin_to.another_to_this.convertion_method, from, to);
                    }
                }
            }
            if (ret.second != null)
            {
                return(ret);
            }

            if (is_derived(to, from) || (from.IsInterface && to == SystemLibrary.object_type) || (from.is_generic_type_instance && to == SystemLibrary.object_type))
            {
                add_conversion(ret, convertion_data_and_alghoritms.get_empty_conversion(from, to, true), from, to);
                //add_conversion(ret, SystemLibrary.empty_method, from, to);
            }

            if (ret.second != null)
            {
                return(ret);
            }

            wrapped_type ctn_to   = to as wrapped_type;
            wrapped_type ctn_from = from as wrapped_type;

            if (ctn_to != null)
            {
                function_node fnode1 = null;
                fnode1 = ctn_to.get_implicit_conversion_from(from);
                add_conversion(ret, fnode1, from, to);
                if (ret.second != null)
                {
                    return(ret);
                }
                fnode1 = null;
                if (!is_implicit)
                {
                    fnode1 = ctn_to.get_explicit_conversion_from(from);
                }
                add_conversion(ret, fnode1, from, to);
                if (ret.second != null)
                {
                    return(ret);
                }
            }
            if (ctn_from != null)
            {
                function_node fnode2 = null;
                fnode2 = ctn_from.get_implicit_conversion_to(to);
                add_conversion(ret, fnode2, from, to);
                if (ret.second != null)
                {
                    return(ret);
                }
                fnode2 = null;
                if (!is_implicit)
                {
                    fnode2 = ctn_from.get_explicit_conversion_to(to);
                }
                add_conversion(ret, fnode2, from, to);
                if (ret.second != null)
                {
                    return(ret);
                }
            }

            //TODO: Вот это должно быть в каком нибудь другом месте.
            internal_interface ii = from.get_internal_interface(internal_interface_kind.delegate_interface);

            if (ii != null)
            {
                delegate_internal_interface dii = (delegate_internal_interface)ii;

                internal_interface to_ii = to.get_internal_interface(internal_interface_kind.delegate_interface);
                if (to_ii != null)
                {
                    delegate_internal_interface to_dii = (delegate_internal_interface)to_ii;
                    if (dii.parameters.Count == to_dii.parameters.Count)
                    {
                        //ms100 error fixed (DS)
                        bool eq = convertion_data_and_alghoritms.function_eq_params_and_result(dii.invoke_method, to_dii.invoke_method);
                        if (eq)
                        {
                            delegate_to_delegate_type_converter dtdtc = new delegate_to_delegate_type_converter(to);
                            add_conversion(ret, new convert_types_function_node(dtdtc.convert_delegates_to_delegates, false), from, to);
                        }
                    }
                }

                if (dii.parameters.Count == 0)
                {
                    if (dii.return_value_type == to)
                    {
                        add_conversion(ret, new convert_types_function_node(convert_delegate_to_return_value_type, true), from, to);
                    }
                    else
                    {
                        possible_type_convertions ptcc = get_convertions(dii.return_value_type, to);
                        if ((ptcc.first != null) && (ptcc.first.convertion_method != null))
                        {
                            delegate_type_converter dtc = new delegate_type_converter(ptcc.first.convertion_method);
                            add_conversion(ret, new convert_types_function_node(dtc.convert_delegate_to_return_value_type_with_convertion, false), from, to);
                        }
                        if ((ptcc.second != null) && (ptcc.second.convertion_method != null))
                        {
                            delegate_type_converter dtc = new delegate_type_converter(ptcc.second.convertion_method);
                            add_conversion(ret, new convert_types_function_node(dtc.convert_delegate_to_return_value_type_with_convertion, false), from, to);
                        }
                    }
                }
            }

            return(ret);
        }