procedure Assert(cond: boolean; sourceFile: string := ''; line: integer := 0);
+procedure Assert(cond: boolean);
|
-procedure Assert(cond: boolean; message: string; sourceFile: string := ''; line: integer := 0);
+ | procedure Assert(cond: boolean; message: string);
|
function ChangeFileNameExtension(name, newext: string): string;
name newext |
diff --git a/ReleaseGenerators/PascalABCNET_version.nsh b/ReleaseGenerators/PascalABCNET_version.nsh
index 341635f6d..cbebb92c0 100644
--- a/ReleaseGenerators/PascalABCNET_version.nsh
+++ b/ReleaseGenerators/PascalABCNET_version.nsh
@@ -1 +1 @@
-!define VERSION '3.5.0.2177'
+!define VERSION '3.5.0.2179'
diff --git a/TestSuite/errors/err0330.pas b/TestSuite/errors/err0330.pas
new file mode 100644
index 000000000..6d375d657
--- /dev/null
+++ b/TestSuite/errors/err0330.pas
@@ -0,0 +1,4 @@
+begin
+ var l: (A, B, C);
+ print(l.A);
+end.
\ No newline at end of file
diff --git a/TestSuite/errors/err0331.pas b/TestSuite/errors/err0331.pas
new file mode 100644
index 000000000..a827d8a62
--- /dev/null
+++ b/TestSuite/errors/err0331.pas
@@ -0,0 +1,4 @@
+type Foo = (One, Two, Three, Four);
+begin
+ print(Foo.One.Two.Three.Four.Four.Two.One);
+end.
\ No newline at end of file
diff --git a/TreeConverter/TreeConversion/syntax_tree_visitor.cs b/TreeConverter/TreeConversion/syntax_tree_visitor.cs
index 3cb2c774a..c90fc5a62 100644
--- a/TreeConverter/TreeConversion/syntax_tree_visitor.cs
+++ b/TreeConverter/TreeConversion/syntax_tree_visitor.cs
@@ -9701,6 +9701,10 @@ namespace PascalABCCompiler.TreeConverter
AddError(new MemberIsNotDeclaredInType(id_right, get_location(id_right), en.type));
}
List sil = en.type.find_in_type(id_right.name, context.CurrentScope);
+ if (en.type.IsEnum && sil != null && sil[0].sym_info is class_constant_definition) // l.A
+ {
+ AddError(get_location(id_right), "ACCESS_TO_ENUM_CONST_THROUGH_OBJECT");
+ }
if (sil == null)
{
AddError(new MemberIsNotDeclaredInType(id_right, get_location(id_right), en.type));
diff --git a/bin/Lib/PABCSystem.pas b/bin/Lib/PABCSystem.pas
index d69b8cd78..47a5885a2 100644
--- a/bin/Lib/PABCSystem.pas
+++ b/bin/Lib/PABCSystem.pas
@@ -1150,8 +1150,10 @@ function ChangeFileNameExtension(name, newext: string): string;
/// Возвращает True, если файл с именем name существует
function FileExists(name: string): boolean;
+///- procedure Assert(cond: boolean);
/// Выводит в специальном окне стек вызовов подпрограмм если условие не выполняется
procedure Assert(cond: boolean; sourceFile: string := ''; line: integer := 0);
+///- procedure Assert(cond: boolean; message: string);
/// Выводит в специальном окне диагностическое сообщение и стек вызовов подпрограмм если условие не выполняется
procedure Assert(cond: boolean; message: string; sourceFile: string := ''; line: integer := 0);
diff --git a/bin/Lng/Eng/SemanticErrors_ms.dat b/bin/Lng/Eng/SemanticErrors_ms.dat
index d441474e1..4c8e34a14 100644
--- a/bin/Lng/Eng/SemanticErrors_ms.dat
+++ b/bin/Lng/Eng/SemanticErrors_ms.dat
@@ -28,4 +28,5 @@ UNNAMED_RECORD_CAN_CONTAIN_ONLY_ONE_PUBLIC_VISIBILITY_SECTION=Unnamed records ca
UNNAMED_RECORD_CANNOT_CONTAIN_SEVERAL_VISIBILITY_SECTIONS=Unnamed records can not contain several visibility section
OPENMP_CONTROLLED_CONSTRUCTIONS_CANNOT_CONTAIN_LAMBDAS=OpenMP-directive-based constructions cannot contain lambdas
LAMBDAS_IN_CONSTRUCTOR_PARAMETERS_ARE_FORBIDDEN_IN_THIS_CONTEXT=Lambda-expressions as constructor parameters are forbidden in this context
-PROCEDURE_TYPE_SHOULD_BE_REPLACED_BY_TYPE_NAME_IN_THIS_CONTEXT=Procedure type should be replaced by type name in this context
\ No newline at end of file
+PROCEDURE_TYPE_SHOULD_BE_REPLACED_BY_TYPE_NAME_IN_THIS_CONTEXT=Procedure type should be replaced by type name in this context
+ACCESS_TO_ENUM_CONST_THROUGH_OBJECT=Enum constant can not be accessed through an object
\ No newline at end of file
diff --git a/bin/Lng/Rus/SemanticErrors_ms.dat b/bin/Lng/Rus/SemanticErrors_ms.dat
index bfa8dcd2b..8768d7cfd 100644
--- a/bin/Lng/Rus/SemanticErrors_ms.dat
+++ b/bin/Lng/Rus/SemanticErrors_ms.dat
@@ -29,4 +29,5 @@ UNNAMED_RECORD_CAN_CONTAIN_ONLY_ONE_PUBLIC_VISIBILITY_SECTION=Безымянны
UNNAMED_RECORD_CANNOT_CONTAIN_SEVERAL_VISIBILITY_SECTIONS=Безымянные записи не могут содержать несколько секций видимости
OPENMP_CONTROLLED_CONSTRUCTIONS_CANNOT_CONTAIN_LAMBDAS=Лямбда-выражения не могут содержаться внутри конструкций под управлением OpenMP-директив
LAMBDAS_IN_CONSTRUCTOR_PARAMETERS_ARE_FORBIDDEN_IN_THIS_CONTEXT=Лямбда-выражения как параметры конструктора запрещены в этом контексте
-PROCEDURE_TYPE_SHOULD_BE_REPLACED_BY_TYPE_NAME_IN_THIS_CONTEXT=Процедурный тип следует заменить именем типа в данном контексте
\ No newline at end of file
+PROCEDURE_TYPE_SHOULD_BE_REPLACED_BY_TYPE_NAME_IN_THIS_CONTEXT=Процедурный тип следует заменить именем типа в данном контексте
+ACCESS_TO_ENUM_CONST_THROUGH_OBJECT=Нельзя обратиться к элементу перечисления через объект
\ No newline at end of file
diff --git a/bin/PascalABCNET.chm b/bin/PascalABCNET.chm
index 2fdfe828e..2d1d78575 100644
Binary files a/bin/PascalABCNET.chm and b/bin/PascalABCNET.chm differ
|