From f2b22688667089ae0ba4483845f22428b1f78c66 Mon Sep 17 00:00:00 2001 From: Ivan Bondarev Date: Fri, 5 Jan 2024 12:18:10 +0100 Subject: [PATCH] #2729 --- TestSuite/errors/err0532.pas | 4 ++++ TreeConverter/TreeConversion/syntax_tree_visitor.cs | 2 ++ 2 files changed, 6 insertions(+) create mode 100644 TestSuite/errors/err0532.pas diff --git a/TestSuite/errors/err0532.pas b/TestSuite/errors/err0532.pas new file mode 100644 index 000000000..d1987a73d --- /dev/null +++ b/TestSuite/errors/err0532.pas @@ -0,0 +1,4 @@ +//!Операции нельзя вызывать, используя данный синтаксис +begin + Writeln(string.operator*=); +end. \ No newline at end of file diff --git a/TreeConverter/TreeConversion/syntax_tree_visitor.cs b/TreeConverter/TreeConversion/syntax_tree_visitor.cs index 611c945a5..0682a2ccd 100644 --- a/TreeConverter/TreeConversion/syntax_tree_visitor.cs +++ b/TreeConverter/TreeConversion/syntax_tree_visitor.cs @@ -9601,6 +9601,8 @@ private expression_node create_static_expression(type_node tn, SyntaxTree.ident private void dot_node_as_type_ident(type_node tn, SyntaxTree.ident id_right, motivation mot) { + if (id_right is SyntaxTree.operator_name_ident) + AddError(get_location(id_right), "OPERATIONS_CANNOT_BE_CALLED_USING_THIS_SYNTAX"); List si_right = tn.find_in_type(id_right.name, context.CurrentScope); if (si_right == null) {