This commit is contained in:
parent
33e8b383be
commit
9d3e2db5ec
7
TestSuite/errors/err0540.pas
Normal file
7
TestSuite/errors/err0540.pas
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
//!Только динамический массив может описываться с ключевым словом params
|
||||
procedure pr1(params par1: array[,] of integer);
|
||||
begin end;
|
||||
|
||||
begin
|
||||
pr1(1, 2, 3);
|
||||
end.
|
||||
10
TestSuite/errors/err0541.pas
Normal file
10
TestSuite/errors/err0541.pas
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
//!Только динамический массив может описываться с ключевым словом params
|
||||
type TClass = class
|
||||
|
||||
end;
|
||||
procedure pr1(params par1: array[,] of TClass);
|
||||
begin end;
|
||||
|
||||
begin
|
||||
|
||||
end.
|
||||
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Reference in a new issue