diff --git a/Configuration/GlobalAssemblyInfo.cs b/Configuration/GlobalAssemblyInfo.cs index 8eff029b9..ce01703e4 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 = "5"; public const string Build = "1"; - public const string Revision = "2277"; + public const string Revision = "2281"; 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 12df07188..203aa5e04 100644 --- a/Configuration/Version.defs +++ b/Configuration/Version.defs @@ -1,4 +1,4 @@ %MINOR%=5 -%REVISION%=2277 +%REVISION%=2281 %COREVERSION%=1 %MAJOR%=3 diff --git a/Release/pabcversion.txt b/Release/pabcversion.txt index 2ddca5a7c..29776b212 100644 --- a/Release/pabcversion.txt +++ b/Release/pabcversion.txt @@ -1 +1 @@ -3.5.1.2277 +3.5.1.2281 diff --git a/ReleaseGenerators/PascalABCNET_version.nsh b/ReleaseGenerators/PascalABCNET_version.nsh index f97faa8ad..eb9183104 100644 --- a/ReleaseGenerators/PascalABCNET_version.nsh +++ b/ReleaseGenerators/PascalABCNET_version.nsh @@ -1 +1 @@ -!define VERSION '3.5.1.2277' +!define VERSION '3.5.1.2281' diff --git a/TestSuite/CompilationSamples/PABCSystem.pas b/TestSuite/CompilationSamples/PABCSystem.pas index ddd4eb6c7..318b29ea3 100644 --- a/TestSuite/CompilationSamples/PABCSystem.pas +++ b/TestSuite/CompilationSamples/PABCSystem.pas @@ -1926,6 +1926,8 @@ function ReadArrString(prompt: string; n: integer): array of string; // ----------------------------------------------------- /// Возвращает двумерный массив размера m x n, заполненный указанными значениями по строкам function Matr(m,n: integer; params data: array of T): array [,] of T; +/// Возвращает двумерный массив, заполненный значениями из одномерных массивов +function Matr(params aa: array of array of T): array [,] of T; /// Возвращает двумерный массив размера m x n, заполненный случайными целыми значениями function MatrRandom(m: integer := 5; n: integer := 5; a: integer := 0; b: integer := 100): array [,] of integer; /// Возвращает двумерный массив размера m x n, заполненный случайными целыми значениями @@ -4066,19 +4068,17 @@ begin Result := Result.Concat(a); end; -///-- -function operator*(a: sequence of T; n: integer): sequence of T; extensionmethod; +{function operator*(a: sequence of T; n: integer): sequence of T; extensionmethod; begin Result := System.Linq.Enumerable.Empty&(); loop n do Result := Result.Concat(a); end; -///-- function operator*(n: integer; a: sequence of T): sequence of T; extensionmethod; begin Result := a * n; -end; +end;} ///-- function operator in(x: T; Self: sequence of T): boolean; extensionmethod; @@ -10046,6 +10046,18 @@ begin end; end; +function Matr(params aa: array of array of T): array [,] of T; +begin + var cols := aa.Max(a -> a.Length); + var r := new T[aa.Length,cols]; + + for var i:=0 to aa.Length-1 do + for var j:=0 to aa[i].Length-1 do + r[i,j] := aa[i][j]; + + Result := r; +end; + // Реализация операций с матрицами - только после введения RowCount и ColCount function MatrRandom(m: integer; n: integer; a, b: integer): array [,] of integer; begin diff --git a/TestSuite/CompilationSamples/WPFObjects.pas b/TestSuite/CompilationSamples/WPFObjects.pas index c35a91bd2..d02919458 100644 --- a/TestSuite/CompilationSamples/WPFObjects.pas +++ b/TestSuite/CompilationSamples/WPFObjects.pas @@ -230,7 +230,7 @@ type /// Видимость графического объекта property Visible: boolean read InvokeBoolean(()->ob.Visibility = Visibility.Visible) - write Invoke(procedure -> if value then ob.Visibility := Visibility.Visible else ob.Visibility := Visibility.Hidden); + write Invoke(procedure -> if value then begin gr.Visibility := Visibility.Visible; ob.Visibility := Visibility.Visible end else begin gr.Visibility := Visibility.Hidden; ob.Visibility := Visibility.Hidden end); /// Выравнивание текста внутри графического объекта property TextAlignment: Alignment write Invoke(WTA,Value); /// Размер шрифта текста внутри графического объекта diff --git a/TestSuite/ExplicitInterface4.pas b/TestSuite/ExplicitInterface4.pas new file mode 100644 index 000000000..d6c44cc9d --- /dev/null +++ b/TestSuite/ExplicitInterface4.pas @@ -0,0 +1,31 @@ +var s: integer; + +type + IA = interface + procedure P(); + end; + + A = class(IA) + public + {procedure P(); + begin + end;} + procedure IA.P(); + begin + s := 1; + end; + end; + + B = class(A, IA) + public + procedure IA.P(); + begin + s := 2; + end; + end; + +begin + var b1 := new B; + IA(b1).P; + Assert(s=2) +end. \ No newline at end of file diff --git a/TestSuite/ExplicitInterface5.pas b/TestSuite/ExplicitInterface5.pas new file mode 100644 index 000000000..ef9c0fed4 --- /dev/null +++ b/TestSuite/ExplicitInterface5.pas @@ -0,0 +1,31 @@ +var s: integer; + +type + IA = interface + procedure P(); + end; + + A = class(IA) + public + {procedure P(); + begin + end;} + procedure IA.P(); + begin + s := 1; + end; + end; + + B = class(A, IA) + public + {procedure IA.P(); + begin + s := 2; + end;} + end; + +begin + var b1 := new B; + IA(b1).P; + Assert(s=1) +end. \ No newline at end of file diff --git a/TreeConverter/TreeConversion/compilation_context.cs b/TreeConverter/TreeConversion/compilation_context.cs index 356b8915a..6149ccbb7 100644 --- a/TreeConverter/TreeConversion/compilation_context.cs +++ b/TreeConverter/TreeConversion/compilation_context.cs @@ -989,7 +989,7 @@ namespace PascalABCCompiler.TreeConverter { compar = si.sym_info as function_node; if (fn != compar && convertion_data_and_alghoritms.function_eq_params(fn, compar)) - //if (fn is common_namespace_function_node && compar is common_namespace_function_node && (fn as common_namespace_function_node).comprehensive_namespace == (compar as common_namespace_function_node).comprehensive_namespace) + if (fn is common_namespace_function_node && compar is common_namespace_function_node && (fn as common_namespace_function_node).comprehensive_namespace == (compar as common_namespace_function_node).comprehensive_namespace) AddError(new FunctionDuplicateDefinition(compar, fn)); } @@ -2723,7 +2723,8 @@ namespace PascalABCCompiler.TreeConverter { if (fn_common.name != meth.name) { - syntax_tree_visitor.AddError(fn_common.loc, "AMBIGUITY_BETWEEN_NAMES_{0}_AND_{1}", fn_common.name, meth.name); + // SSM 21.12.19 - закомментировал - исправляет баг #2163. Не пойму, зачем эта проверка + //syntax_tree_visitor.AddError(fn_common.loc, "AMBIGUITY_BETWEEN_NAMES_{0}_AND_{1}", fn_common.name, meth.name); } } else diff --git a/bin/Lib/PABCSystem.pas b/bin/Lib/PABCSystem.pas index a4f0ec569..318b29ea3 100644 --- a/bin/Lib/PABCSystem.pas +++ b/bin/Lib/PABCSystem.pas @@ -1926,6 +1926,8 @@ function ReadArrString(prompt: string; n: integer): array of string; // ----------------------------------------------------- /// Возвращает двумерный массив размера m x n, заполненный указанными значениями по строкам function Matr(m,n: integer; params data: array of T): array [,] of T; +/// Возвращает двумерный массив, заполненный значениями из одномерных массивов +function Matr(params aa: array of array of T): array [,] of T; /// Возвращает двумерный массив размера m x n, заполненный случайными целыми значениями function MatrRandom(m: integer := 5; n: integer := 5; a: integer := 0; b: integer := 100): array [,] of integer; /// Возвращает двумерный массив размера m x n, заполненный случайными целыми значениями @@ -10044,6 +10046,18 @@ begin end; end; +function Matr(params aa: array of array of T): array [,] of T; +begin + var cols := aa.Max(a -> a.Length); + var r := new T[aa.Length,cols]; + + for var i:=0 to aa.Length-1 do + for var j:=0 to aa[i].Length-1 do + r[i,j] := aa[i][j]; + + Result := r; +end; + // Реализация операций с матрицами - только после введения RowCount и ColCount function MatrRandom(m: integer; n: integer; a, b: integer): array [,] of integer; begin diff --git a/bin/Lib/WPFObjects.pas b/bin/Lib/WPFObjects.pas index c35a91bd2..d02919458 100644 --- a/bin/Lib/WPFObjects.pas +++ b/bin/Lib/WPFObjects.pas @@ -230,7 +230,7 @@ type /// Видимость графического объекта property Visible: boolean read InvokeBoolean(()->ob.Visibility = Visibility.Visible) - write Invoke(procedure -> if value then ob.Visibility := Visibility.Visible else ob.Visibility := Visibility.Hidden); + write Invoke(procedure -> if value then begin gr.Visibility := Visibility.Visible; ob.Visibility := Visibility.Visible end else begin gr.Visibility := Visibility.Hidden; ob.Visibility := Visibility.Hidden end); /// Выравнивание текста внутри графического объекта property TextAlignment: Alignment write Invoke(WTA,Value); /// Размер шрифта текста внутри графического объекта