From 033e26e9849f0516f86851a526065f04c4495a94 Mon Sep 17 00:00:00 2001 From: miks1965 Date: Wed, 31 Oct 2018 20:46:54 +0300 Subject: [PATCH] bug fix #1441 --- TestSuite/errors/err0299.pas | 10 ++++++++++ TreeConverter/TreeRealization/type_table.cs | 4 ++++ 2 files changed, 14 insertions(+) create mode 100644 TestSuite/errors/err0299.pas diff --git a/TestSuite/errors/err0299.pas b/TestSuite/errors/err0299.pas new file mode 100644 index 000000000..8e9e520d0 --- /dev/null +++ b/TestSuite/errors/err0299.pas @@ -0,0 +1,10 @@ +type + t1=class + static function operator=(a,b: t1): word := 5; + end; + +begin + var a := new t1; + var b := new t1; + var c := a=b;//Ошибка: Несколько подпрограмм могут быть вызваны +end. \ No newline at end of file diff --git a/TreeConverter/TreeRealization/type_table.cs b/TreeConverter/TreeRealization/type_table.cs index ced305d0a..c951216e9 100644 --- a/TreeConverter/TreeRealization/type_table.cs +++ b/TreeConverter/TreeRealization/type_table.cs @@ -603,6 +603,10 @@ namespace PascalABCCompiler.TreeRealization { return type_compare.non_comparable_type; } + if (tins.Length == 1 && tins[0].this_to_another != null && tins[0].this_to_another.is_explicit) // SSM bug fix #1441 + { + return type_compare.non_comparable_type; + } if (tins.Length == 1) { return tins[0].type_compare;