This commit is contained in:
Бондарев Иван 2016-12-05 21:45:15 +01:00
parent 50ecdde5e9
commit 23fa39928e
2 changed files with 23 additions and 3 deletions

View file

@ -0,0 +1,3 @@
begin
assert('3626 abcdef 22'.ToWords[1].Length = 6);
end.

View file

@ -8973,9 +8973,26 @@ namespace PascalABCCompiler.TreeConverter
return make_delegate_wrapper(en, si, get_location(id_right), false); return make_delegate_wrapper(en, si, get_location(id_right), false);
else else
{ {
function_node fn = convertion_data_and_alghoritms.select_function(new expressions_list(), function_node tmp_fn = null;
si, get_location(id_right)); SymbolInfo tmp_si = si;
expressions_list pars = new expressions_list();
if (en != null)
while (tmp_si != null)
{
tmp_fn = tmp_si.sym_info as function_node;
if (tmp_fn != null && tmp_fn.is_extension_method &&
(tmp_fn.parameters.Count == 1 || tmp_fn.parameters.Count == 2 && (tmp_fn.parameters[1].is_params || tmp_fn.parameters[1].default_value != null)))
{
pars.AddElement(en);
break;
}
tmp_si = tmp_si.Next;
}
function_node fn = convertion_data_and_alghoritms.select_function(pars, si, get_location(id_right));
if (!fn.is_extension_method)
return create_not_static_method_call(fn, en, get_location(id_right), false); return create_not_static_method_call(fn, en, get_location(id_right), false);
else
return create_static_method_call_with_params(fn, get_location(id_right), fn.return_value_type, false, pars);
} }
} }
case general_node_type.property_node: case general_node_type.property_node: