fix #2079
This commit is contained in:
parent
259b3c34b5
commit
5e89c96a0f
|
|
@ -15,7 +15,7 @@ internal static class RevisionClass
|
||||||
public const string Major = "3";
|
public const string Major = "3";
|
||||||
public const string Minor = "6";
|
public const string Minor = "6";
|
||||||
public const string Build = "3";
|
public const string Build = "3";
|
||||||
public const string Revision = "2538";
|
public const string Revision = "2541";
|
||||||
|
|
||||||
public const string MainVersion = Major + "." + Minor;
|
public const string MainVersion = Major + "." + Minor;
|
||||||
public const string FullVersion = Major + "." + Minor + "." + Build + "." + Revision;
|
public const string FullVersion = Major + "." + Minor + "." + Build + "." + Revision;
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
%COREVERSION%=3
|
|
||||||
%REVISION%=2538
|
|
||||||
%MINOR%=6
|
%MINOR%=6
|
||||||
|
%REVISION%=2541
|
||||||
|
%COREVERSION%=3
|
||||||
%MAJOR%=3
|
%MAJOR%=3
|
||||||
|
|
|
||||||
Binary file not shown.
|
|
@ -1 +1 @@
|
||||||
3.6.3.2538
|
3.6.3.2541
|
||||||
|
|
|
||||||
|
|
@ -1 +1 @@
|
||||||
!define VERSION '3.6.3.2538'
|
!define VERSION '3.6.3.2541'
|
||||||
|
|
|
||||||
7
TestSuite/SeqSeq.pas
Normal file
7
TestSuite/SeqSeq.pas
Normal file
|
|
@ -0,0 +1,7 @@
|
||||||
|
// #2079
|
||||||
|
begin
|
||||||
|
Seq&<sequence of byte>(Seq&<byte>);
|
||||||
|
var q := Seq&<sequence of byte>(Seq&<byte>,Seq&<byte>);
|
||||||
|
Assert(q.Count=2);
|
||||||
|
Assert(q.First.Count=0);
|
||||||
|
end.
|
||||||
|
|
@ -404,7 +404,7 @@ namespace PascalABCCompiler.TreeConverter
|
||||||
common_type_node converted_type, common_function_node top_function, bool allow_procedure, List<SyntaxTree.expression> syntax_nodes_parameters = null)
|
common_type_node converted_type, common_function_node top_function, bool allow_procedure, List<SyntaxTree.expression> syntax_nodes_parameters = null)
|
||||||
{
|
{
|
||||||
function_node fn = select_function(exprs, si, loc, syntax_nodes_parameters);
|
function_node fn = select_function(exprs, si, loc, syntax_nodes_parameters);
|
||||||
|
|
||||||
//allow_procedure = true;
|
//allow_procedure = true;
|
||||||
if ((!allow_procedure) && (fn.return_value_type == null))
|
if ((!allow_procedure) && (fn.return_value_type == null))
|
||||||
{
|
{
|
||||||
|
|
@ -1658,7 +1658,28 @@ namespace PascalABCCompiler.TreeConverter
|
||||||
private void convert_function_call_expressions(function_node fn,expressions_list exprs,
|
private void convert_function_call_expressions(function_node fn,expressions_list exprs,
|
||||||
possible_type_convertions_list ptcal)
|
possible_type_convertions_list ptcal)
|
||||||
{
|
{
|
||||||
for(int i=0;i<exprs.Count;i++)
|
var needToConvertParamsToFunctionCall = true;
|
||||||
|
var lastIsParams = fn.parameters.Count > 0 && fn.parameters[fn.parameters.Count - 1].is_params;
|
||||||
|
if (lastIsParams && fn.parameters[fn.parameters.Count - 1].type.element_type.IsDelegate)
|
||||||
|
needToConvertParamsToFunctionCall = false; // параметры params - преобразовывать ли в вызовы
|
||||||
|
|
||||||
|
|
||||||
|
for (int i = 0; i < exprs.Count; i++)
|
||||||
|
{
|
||||||
|
// надо отдельно расшифровывать params и в них тоже не преобразовывать если там делегаты
|
||||||
|
// Если функция возвращает функцию, то это к сожалению не будет работать
|
||||||
|
if (i <= fn.parameters.Count - 1 && fn.parameters[i].type.IsDelegate || lastIsParams && i >= fn.parameters.Count - 1 && !needToConvertParamsToFunctionCall)
|
||||||
|
{
|
||||||
|
// ничего не делать
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
var ex = exprs[i];
|
||||||
|
syntax_tree_visitor.try_convert_typed_expression_to_function_call(ref ex);
|
||||||
|
exprs[i] = ex;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for (int i=0;i<exprs.Count;i++)
|
||||||
{
|
{
|
||||||
if ((ptcal.snl != null) && (i >= fn.parameters.Count - 1))
|
if ((ptcal.snl != null) && (i >= fn.parameters.Count - 1))
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue