This commit is contained in:
Ivan Bondarev 2024-07-04 19:19:37 +02:00
parent 33e8b383be
commit 9d3e2db5ec
3 changed files with 25 additions and 0 deletions

View file

@ -0,0 +1,7 @@
//!Только динамический массив может описываться с ключевым словом params
procedure pr1(params par1: array[,] of integer);
begin end;
begin
pr1(1, 2, 3);
end.

View file

@ -0,0 +1,10 @@
//!Только динамический массив может описываться с ключевым словом params
type TClass = class
end;
procedure pr1(params par1: array[,] of TClass);
begin end;
begin
end.

View file

@ -14795,6 +14795,14 @@ namespace PascalABCCompiler.TreeConverter
{
AddError(get_location(_typed_parametres.vars_type), "ONLY_UNSIZED_ARRAY_PARAMS_PARAMETER_ALLOWED");
}
if (tn is compiled_type_node && (tn as compiled_type_node).rank > 1)
{
AddError(get_location(_typed_parametres.vars_type), "ONLY_UNSIZED_ARRAY_PARAMS_PARAMETER_ALLOWED");
}
if (tn is common_type_node && (tn as common_type_node).rank > 1)
{
AddError(get_location(_typed_parametres.vars_type), "ONLY_UNSIZED_ARRAY_PARAMS_PARAMETER_ALLOWED");
}
}
com_par.type = tn;
foreach (SyntaxTree.ident id in _typed_parametres.idents.idents)