diff --git a/Configuration/GlobalAssemblyInfo.cs b/Configuration/GlobalAssemblyInfo.cs index 3f7ef19e1..039e0020d 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 = "10"; public const string Build = "0"; - public const string Revision = "3550"; + public const string Revision = "3551"; 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 5a3b6930a..a7c9a2668 100644 --- a/Configuration/Version.defs +++ b/Configuration/Version.defs @@ -1,4 +1,4 @@ -%COREVERSION%=0 -%REVISION%=3550 %MINOR%=10 +%REVISION%=3551 +%COREVERSION%=0 %MAJOR%=3 diff --git a/Release/pabcversion.txt b/Release/pabcversion.txt index 64d0cbea7..97f582fa8 100644 --- a/Release/pabcversion.txt +++ b/Release/pabcversion.txt @@ -1 +1 @@ -3.10.0.3550 +3.10.0.3551 diff --git a/ReleaseGenerators/PascalABCNET_version.nsh b/ReleaseGenerators/PascalABCNET_version.nsh index a3a65e25e..7acc9fa20 100644 --- a/ReleaseGenerators/PascalABCNET_version.nsh +++ b/ReleaseGenerators/PascalABCNET_version.nsh @@ -1 +1 @@ -!define VERSION '3.10.0.3550' +!define VERSION '3.10.0.3551' diff --git a/TestSuite/CompilationSamples/PABCExtensions.pas b/TestSuite/CompilationSamples/PABCExtensions.pas index 306d448d2..0a5fd23c9 100644 --- a/TestSuite/CompilationSamples/PABCExtensions.pas +++ b/TestSuite/CompilationSamples/PABCExtensions.pas @@ -433,6 +433,8 @@ function operator implicit(a: array of BigInteger): set of BigInteger; extension function operator implicit(a: array of decimal): set of decimal; extensionmethod := TypedSet.InitBy(a); ///-- function operator implicit(a: array of single): set of single; extensionmethod := TypedSet.InitBy(a); +///-- +function operator implicit(a: array of T): set of T; extensionmethod := TypedSet.InitBy(a); //------------------------------------------------------------------------------ // Операции для procedure diff --git a/TreeConverter/NetWrappers/NetHelper.cs b/TreeConverter/NetWrappers/NetHelper.cs index 33a608ef1..d866e9dfc 100644 --- a/TreeConverter/NetWrappers/NetHelper.cs +++ b/TreeConverter/NetWrappers/NetHelper.cs @@ -1152,11 +1152,34 @@ private static function_node get_conversion(compiled_type_node in_type,compiled_ fn.parameters[0].type.type_special_kind == type_special_kind.array_kind && fn.parameters[0].type.element_type.is_generic_parameter && fn.parameters.Count == 1 + // Вот это условие для set of T должно удовлетвориться и тогда всё будет работать! && (fn.return_value_type == to || fn.return_value_type.original_generic == to) ) { return fn; } + // А теперь конкретно для преобразования array of T в set of T !!! Надо переделывать. Позже + if ( + fn.parameters[0].type.type_special_kind == type_special_kind.array_kind + && fn.parameters[0].type.element_type.is_generic_parameter + && fn.parameters.Count == 1 + && to is common_type_node ctn && ctn.type_special_kind == type_special_kind.set_type + ) + { + List instance_params = new List(); + + instance_params.Add(ctn.element_type); // Это должен быть конкретный тип + var fn1 = fn.get_instance(instance_params, false, null); + if ( + fn1.return_value_type == to || fn1.return_value_type.original_generic == to + ) + { + // Вернуть тем не менее fn! Во внешнем коде он тоже инстанцируется! + // Это обязательно надо переделывать! + return fn; + } + } + } } } diff --git a/bin/Lib/PABCExtensions.pas b/bin/Lib/PABCExtensions.pas index add1e5b3b..2f47a11ac 100644 --- a/bin/Lib/PABCExtensions.pas +++ b/bin/Lib/PABCExtensions.pas @@ -433,6 +433,8 @@ function operator implicit(a: array of BigInteger): set of BigInteger; extension function operator implicit(a: array of decimal): set of decimal; extensionmethod := TypedSet.InitBy(a); ///-- function operator implicit(a: array of single): set of single; extensionmethod := TypedSet.InitBy(a); +///-- +function operator implicit(a: array of T): set of T; extensionmethod := TypedSet.InitBy(a); //------------------------------------------------------------------------------ // Операции для procedure