This commit is contained in:
Ivan Bondarev 2023-02-05 11:04:35 +01:00
parent 9e89da9b32
commit 71c09cd619
2 changed files with 17 additions and 3 deletions

12
TestSuite/params22.pas Normal file
View file

@ -0,0 +1,12 @@
function f1(x: integer) := 1;
type TFnc = integer -> integer;
procedure p(params arr: array of object);
begin
assert(TFnc(arr[0])(2) = 1);
assert(TFnc(arr[1])(2) = 1);
end;
begin
p(f1, f1);
end.

View file

@ -1207,11 +1207,11 @@ namespace PascalABCCompiler.TreeConverter
ptci.to = formal_param_type;
tc.AddElement(ptci);
factparams[i] = syntax_tree_visitor.CreateDelegateCall((factparams[i].type as delegated_methods).proper_methods[0]);
return tc;
//return tc;
}
if (is_alone_method_defined) // если мы сюда попали, то ошибка более явная
else if (is_alone_method_defined) // если мы сюда попали, то ошибка более явная
error = new CanNotConvertTypes(factparams[i], factparams[i].type, formal_param_type, locg);
return null;
//return null;
}
}
@ -1449,6 +1449,8 @@ namespace PascalABCCompiler.TreeConverter
for(int i=0;i<left.Count;i++)
{
if (i >= right.Count)
break;
type_conversion_compare tcc=compare_type_conversions(left[i],right[i]);
if (tcc==type_conversion_compare.less_type_conversion)
{