diff --git a/Configuration/GlobalAssemblyInfo.cs b/Configuration/GlobalAssemblyInfo.cs index 96c5ef12c..2e6f076eb 100644 --- a/Configuration/GlobalAssemblyInfo.cs +++ b/Configuration/GlobalAssemblyInfo.cs @@ -15,7 +15,7 @@ internal static class RevisionClass public const string Major = "3"; public const string Minor = "8"; public const string Build = "3"; - public const string Revision = "3119"; + public const string Revision = "3121"; public const string MainVersion = Major + "." + Minor; public const string FullVersion = Major + "." + Minor + "." + Build + "." + Revision; diff --git a/Configuration/Version.defs b/Configuration/Version.defs index 5edd2690c..005c69cfb 100644 --- a/Configuration/Version.defs +++ b/Configuration/Version.defs @@ -1,4 +1,4 @@ %MINOR%=8 -%REVISION%=3119 +%REVISION%=3121 %COREVERSION%=3 %MAJOR%=3 diff --git a/Release/pabcversion.txt b/Release/pabcversion.txt index b79c95ac3..4ed234109 100644 --- a/Release/pabcversion.txt +++ b/Release/pabcversion.txt @@ -1 +1 @@ -3.8.3.3119 +3.8.3.3121 diff --git a/ReleaseGenerators/PascalABCNET_version.nsh b/ReleaseGenerators/PascalABCNET_version.nsh index 83524f143..f4b3aea02 100644 --- a/ReleaseGenerators/PascalABCNET_version.nsh +++ b/ReleaseGenerators/PascalABCNET_version.nsh @@ -1 +1 @@ -!define VERSION '3.8.3.3119' +!define VERSION '3.8.3.3121' diff --git a/SyntaxVisitors/SugarVisitors/CacheFunctionVisitor.cs b/SyntaxVisitors/SugarVisitors/CacheFunctionVisitor.cs index babd3dde4..34a2e1b7e 100644 --- a/SyntaxVisitors/SugarVisitors/CacheFunctionVisitor.cs +++ b/SyntaxVisitors/SugarVisitors/CacheFunctionVisitor.cs @@ -76,12 +76,18 @@ namespace SyntaxVisitors.SugarVisitors // var @tpar := Tuple.Create(все параметры) var tupleIdent = new ident("@tpar" + UniqueNumStr()); // SSM 08.05.22 - один параметр не надо оборачивать в кортеж + + // SSM 09.05.22 - для реализации кортежа используется ValueTuple если он определен + var TupleName = "Tuple"; + if (System.Type.GetType("System.ValueTuple") != null) + TupleName = "ValueTuple"; + var_statement vs; if (pp.Length == 1) vs = new var_statement(tupleIdent, pp[0].Item1 as expression); else vs = new var_statement(tupleIdent, new method_call( - new dot_node(new dot_node("?System", "Tuple"),new ident("Create")), + new dot_node(new dot_node("?System", TupleName),new ident("Create")), new expression_list(pp.Select(pair => pair.Item1 as expression).ToList()) ) ); @@ -103,7 +109,7 @@ namespace SyntaxVisitors.SugarVisitors if (pp.Length == 1) ttr_tuple = pp[0].Item2 as type_definition; else - ttr_tuple = new template_type_reference(new named_type_reference(new List { new ident("System"), new ident("Tuple") }), + ttr_tuple = new template_type_reference(new named_type_reference(new List { new ident("System"), new ident(TupleName) }), ttp );