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;