Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/pascalabcnet/pascalabcnet
Browse files Browse the repository at this point in the history
…into test
  • Loading branch information
BH_build_bot authored and BH_build_bot committed Oct 10, 2024
2 parents c2c9435 + 53b3fd0 commit 7e6f1d1
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Configuration/GlobalAssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions Configuration/Version.defs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
%COREVERSION%=0
%REVISION%=3550
%MINOR%=10
%REVISION%=3551
%COREVERSION%=0
%MAJOR%=3
2 changes: 1 addition & 1 deletion Release/pabcversion.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.10.0.3550
3.10.0.3551
2 changes: 1 addition & 1 deletion ReleaseGenerators/PascalABCNET_version.nsh
Original file line number Diff line number Diff line change
@@ -1 +1 @@
!define VERSION '3.10.0.3550'
!define VERSION '3.10.0.3551'
2 changes: 2 additions & 0 deletions TestSuite/CompilationSamples/PABCExtensions.pas
Original file line number Diff line number Diff line change
Expand Up @@ -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<T>(a: array of T): set of T; extensionmethod := TypedSet.InitBy(a);

//------------------------------------------------------------------------------
// Операции для procedure
Expand Down
23 changes: 23 additions & 0 deletions TreeConverter/NetWrappers/NetHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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<type_node> instance_params = new List<type_node>();

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;
}
}

}
}
}
Expand Down
2 changes: 2 additions & 0 deletions bin/Lib/PABCExtensions.pas
Original file line number Diff line number Diff line change
Expand Up @@ -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<T>(a: array of T): set of T; extensionmethod := TypedSet.InitBy(a);

//------------------------------------------------------------------------------
// Операции для procedure
Expand Down

0 comments on commit 7e6f1d1

Please sign in to comment.