From 65bdec22a08079f9f1d84e81e6f4e8de3ccbded4 Mon Sep 17 00:00:00 2001 From: Mikhalkovich Stanislav Date: Wed, 19 Apr 2023 10:21:00 +0300 Subject: [PATCH] =?UTF-8?q?Covariance=20=D1=83=D0=BB=D1=83=D1=87=D1=88?= =?UTF-8?q?=D0=B5=D0=BD=D0=B8=D1=8F:=20IEnumerable=20=D0=BC?= =?UTF-8?q?=D0=BE=D0=B6=D0=BD=D0=BE=20=D0=BF=D1=80=D0=B8=D1=81=D0=B2=D0=BE?= =?UTF-8?q?=D0=B8=D1=82=D1=8C=20IEnumerable=20=D0=B8=20?= =?UTF-8?q?=D0=BB=D1=8E=D0=B1=D0=BE=D0=B9=20=D0=BA=D0=BB=D0=B0=D1=81=D1=81?= =?UTF-8?q?,=20=D0=B5=D0=B3=D0=BE=20=D1=80=D0=B5=D0=B0=D0=BB=D0=B8=D0=B7?= =?UTF-8?q?=D1=83=D1=8E=D1=89=D0=B8=D0=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Configuration/GlobalAssemblyInfo.cs | 2 +- Configuration/Version.defs | 4 ++-- Release/pabcversion.txt | 2 +- ReleaseGenerators/PascalABCNET_version.nsh | 2 +- TestSuite/CompilationSamples/graph3d.pas | 2 +- TreeConverter/TreeRealization/type_table.cs | 14 ++++++++++---- 6 files changed, 16 insertions(+), 10 deletions(-) diff --git a/Configuration/GlobalAssemblyInfo.cs b/Configuration/GlobalAssemblyInfo.cs index 6ca0335cd..6374f8c38 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 = "3259"; + public const string Revision = "3262"; 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 244639777..ad9818d2f 100644 --- a/Configuration/Version.defs +++ b/Configuration/Version.defs @@ -1,4 +1,4 @@ -%MINOR%=8 -%REVISION%=3259 %COREVERSION%=3 +%REVISION%=3262 +%MINOR%=8 %MAJOR%=3 diff --git a/Release/pabcversion.txt b/Release/pabcversion.txt index e5a792554..6c2976075 100644 --- a/Release/pabcversion.txt +++ b/Release/pabcversion.txt @@ -1 +1 @@ -3.8.3.3259 +3.8.3.3262 diff --git a/ReleaseGenerators/PascalABCNET_version.nsh b/ReleaseGenerators/PascalABCNET_version.nsh index ad347be72..0f510ea8d 100644 --- a/ReleaseGenerators/PascalABCNET_version.nsh +++ b/ReleaseGenerators/PascalABCNET_version.nsh @@ -1 +1 @@ -!define VERSION '3.8.3.3259' +!define VERSION '3.8.3.3262' diff --git a/TestSuite/CompilationSamples/graph3d.pas b/TestSuite/CompilationSamples/graph3d.pas index 0c47cd717..72ce1fcc0 100644 --- a/TestSuite/CompilationSamples/graph3d.pas +++ b/TestSuite/CompilationSamples/graph3d.pas @@ -4259,7 +4259,7 @@ function BillboardText(p: Point3D; Text: string; Fontsize: real) := BillboardTex function CoordinateSystem(ArrowsLength, Diameter: real): CoordinateSystemT := Inv(()->CoordinateSystemT.Create(0, 0, 0, arrowslength, diameter)); -function CoordinateSystem(ArrowsLength: real) := CoordinateSystem(arrowslength, arrowslength / 10); +function CoordinateSystem(ArrowsLength: real) := CoordinateSystem(arrowslength, (arrowslength / 10).ClampTop(0.2)); function Text3D(x, y, z: real; Text: string; Height: real; fontname: string; c: Color): TextT := Inv(()->TextT.Create(x, y, z, text, height, fontname, c)); diff --git a/TreeConverter/TreeRealization/type_table.cs b/TreeConverter/TreeRealization/type_table.cs index 40903246e..17e6b89f8 100644 --- a/TreeConverter/TreeRealization/type_table.cs +++ b/TreeConverter/TreeRealization/type_table.cs @@ -571,8 +571,8 @@ namespace PascalABCCompiler.TreeRealization implements = false; // Цикл по всем реализуемым интерфейсам. А если tnode сам является интерфейсом? var ImplementingInterfaces = tnode.ImplementingInterfaces.ToList(); - //if (tnode.IsInterface) - // ImplementingInterfaces.Add(tnode); + if (tnode.IsInterface) + ImplementingInterfaces.Add(tnode); foreach (var interf in ImplementingInterfaces) { var ctn = interf as compiled_type_node; @@ -597,10 +597,11 @@ namespace PascalABCCompiler.TreeRealization // Тут можно проверить на ковариантность // еще где то надо проверять, что IEnumerable -> IEnumerable, но здесь base_class предполагает, // что это - класс, и рассматривает все его интерфейсы, упуская ситуацию, когда base_class - это и есть интерфейс - //else if ((cgitn != null || ctn != null) && (bcgitn != null || bcctn != null)) + else if ((cgitn != null || ctn != null) && (bcgitn != null || bcctn != null)) // SSM 19/04 //else if (cgitn != null && (bcgitn != null || bcctn != null)) //else if ((cgitn != null || ctn != null) && bcgitn != null) - else if (cgitn != null && bcgitn != null) + //else if (cgitn != null && bcgitn != null) + //else if (cgitn != null && bcgitn != null || ctn != null && bcctn != null) // SSM 18/04 немного большие ограничения { compiled_type_node interf_original_generic = cgitn != null ? cgitn.original_generic as compiled_type_node : ctn.original_generic as compiled_type_node; compiled_type_node base_original_generic = bcgitn != null ? bcgitn.original_generic as compiled_type_node : bcctn.original_generic as compiled_type_node; @@ -636,6 +637,11 @@ namespace PascalABCCompiler.TreeRealization { // OK } + else // SSM 19/04/23 -вот эта ветка была решающей + { + impl = false; + break; + } } // Почему то когда это закомментировано, то работает. А так не вызывается ??! /*else if (base_instance_params[i] == interf_instance_params[i])