From f70abef278587fb7290f8bc5fcea035e0cca13c2 Mon Sep 17 00:00:00 2001 From: Mikhalkovich Stanislav Date: Mon, 22 Jun 2026 18:00:17 +0300 Subject: [PATCH] fix #3431 --- Configuration/GlobalAssemblyInfo.cs | 2 +- Configuration/Version.defs | 2 +- Release/pabcversion.txt | 2 +- ReleaseGenerators/PascalABCNET_version.nsh | 2 +- TestSuite/errors/err0549.pas | 14 ++++++++++++++ TreeConverter/TreeRealization/type_table.cs | 10 +++++++++- 6 files changed, 27 insertions(+), 5 deletions(-) create mode 100644 TestSuite/errors/err0549.pas diff --git a/Configuration/GlobalAssemblyInfo.cs b/Configuration/GlobalAssemblyInfo.cs index 7abd20a81..78e5822d3 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 = "11"; public const string Build = "1"; - public const string Revision = "3833"; + public const string Revision = "3835"; 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 eb80c3ecb..cb603f14f 100644 --- a/Configuration/Version.defs +++ b/Configuration/Version.defs @@ -1,4 +1,4 @@ %MINOR%=11 -%REVISION%=3833 +%REVISION%=3835 %COREVERSION%=1 %MAJOR%=3 diff --git a/Release/pabcversion.txt b/Release/pabcversion.txt index 5788eb486..c1904229e 100644 --- a/Release/pabcversion.txt +++ b/Release/pabcversion.txt @@ -1 +1 @@ -3.11.1.3833 +3.11.1.3835 diff --git a/ReleaseGenerators/PascalABCNET_version.nsh b/ReleaseGenerators/PascalABCNET_version.nsh index 542126095..172c7f7c3 100644 --- a/ReleaseGenerators/PascalABCNET_version.nsh +++ b/ReleaseGenerators/PascalABCNET_version.nsh @@ -1 +1 @@ -!define VERSION '3.11.1.3833' +!define VERSION '3.11.1.3835' diff --git a/TestSuite/errors/err0549.pas b/TestSuite/errors/err0549.pas new file mode 100644 index 000000000..30c4693aa --- /dev/null +++ b/TestSuite/errors/err0549.pas @@ -0,0 +1,14 @@ +type + Matr = class + static function operator implicit(a: array [,] of integer): Matr; + begin + + end; + end; + + +begin + var a: array of integer; + var m: Matr; + m := a; +end. \ No newline at end of file diff --git a/TreeConverter/TreeRealization/type_table.cs b/TreeConverter/TreeRealization/type_table.cs index d9965b029..033346215 100644 --- a/TreeConverter/TreeRealization/type_table.cs +++ b/TreeConverter/TreeRealization/type_table.cs @@ -1020,7 +1020,15 @@ namespace PascalABCCompiler.TreeRealization if (left is ref_type_node && right is ref_type_node) return is_type_or_original_generics_equal((left as ref_type_node).pointed_type, (right as ref_type_node).pointed_type); if (left.type_special_kind == SemanticTree.type_special_kind.array_kind && right.type_special_kind == SemanticTree.type_special_kind.array_kind) - return is_type_or_original_generics_equal(left.element_type, right.element_type); + { + var lctn = left as compiled_type_node; + var rctn = right as compiled_type_node; + if (lctn == null || rctn == null) + return is_type_or_original_generics_equal(left.element_type, right.element_type); + if (lctn != null && rctn != null && lctn.rank == rctn.rank) + return is_type_or_original_generics_equal(left.element_type, right.element_type); + } + return left == right; }