diff --git a/NETGenerator/NETGenerator.cs b/NETGenerator/NETGenerator.cs index 005ee08ae..d6ad44a8a 100644 --- a/NETGenerator/NETGenerator.cs +++ b/NETGenerator/NETGenerator.cs @@ -9630,10 +9630,11 @@ namespace PascalABCCompiler.NETGenerator { is_dot_expr = false; } - if (init_call_awaited && !value.new_obj_awaited()) + if (init_call_awaited && !value.new_obj_awaited() && cnstr.DeclaringType != cur_type) { il.Emit(OpCodes.Ldarg_0); il.Emit(OpCodes.Call, cur_ti.init_meth); + //throw new Exception(cnstr.DeclaringType.Name+"-"+cur_meth.DeclaringType.Name); init_call_awaited = false; } } diff --git a/TestSuite/CompilationSamples/PABCSystem.pas b/TestSuite/CompilationSamples/PABCSystem.pas index 3d0c1c010..7c1dbc897 100644 --- a/TestSuite/CompilationSamples/PABCSystem.pas +++ b/TestSuite/CompilationSamples/PABCSystem.pas @@ -9413,7 +9413,7 @@ end; /// Возвращает индекс последнего минимального элемента function LastIndexMin(Self: array of T): integer; extensionmethod; where T: System.IComparable; begin - Result := Self.LastIndexMin(Self.Count - 1); + Result := Self.LastIndexMin(Self.Length - 1); end; /// Возвращает индекс последнего минимального элемента в диапазоне [0,index-1] diff --git a/TestSuite/class3.pas b/TestSuite/class3.pas new file mode 100644 index 000000000..e17b48a9f --- /dev/null +++ b/TestSuite/class3.pas @@ -0,0 +1,39 @@ +type + t1=class + + public i1 := 1; + public i2 := 2; + public o: object := new Object; + + public constructor(i1, i2: integer); + begin + assert(o <> nil); + self.i1 := i1; + self.i2 := i2; + end; + + public constructor(i1: integer) := + Create(i1,6); + + end; + + t2 = class + a: array of integer := (1, 2, 3); + b: set of char := ['a', 'b', 'c']; + constructor(a: array of integer); + begin + assert('b' in b); + assert(self.a[0] = 1); + self.a := a; + end; + end; + + +begin + var o1 := new t1(3,4); + var o2 := new t1(5); + assert(o2.i1 = 5); + assert(o2.i2 = 6); + var o3 := new t2(Arr(4, 5, 6)); + assert(o3.a[0] = 4); +end. \ No newline at end of file diff --git a/_GenerateAllSetups.bat b/_GenerateAllSetups.bat index d2bbf277d..1be7acccc 100644 --- a/_GenerateAllSetups.bat +++ b/_GenerateAllSetups.bat @@ -45,6 +45,7 @@ TestRunner.exe 2 TestRunner.exe 3 TestRunner.exe 4 TestRunner.exe 5 +TestRunner.exe 6 cd ..\ReleaseGenerators call PascalABCNET_ALL.bat diff --git a/_RebuildReleaseAndRunTests.bat b/_RebuildReleaseAndRunTests.bat index 9ce4bc6de..d6fc274a9 100644 --- a/_RebuildReleaseAndRunTests.bat +++ b/_RebuildReleaseAndRunTests.bat @@ -28,6 +28,7 @@ TestRunner.exe 2 TestRunner.exe 3 TestRunner.exe 4 TestRunner.exe 5 +TestRunner.exe 6 cd .. GOTO EXIT diff --git a/bin/TestRunner.exe b/bin/TestRunner.exe index 5114254be..9f504e384 100644 Binary files a/bin/TestRunner.exe and b/bin/TestRunner.exe differ diff --git a/bin/TestRunner.pas b/bin/TestRunner.pas index fa1c8894f..6bae4a64c 100644 --- a/bin/TestRunner.pas +++ b/bin/TestRunner.pas @@ -367,8 +367,7 @@ begin end; if (ParamCount = 0) or (ParamStr(1) = '5') then begin - if ParamStr(1) = '5' then - begin + CompileAllRunTests(false, true); writeln('Tests in 32bit mode compiled successfully'); RunAllTests(false); @@ -377,22 +376,11 @@ begin CompileAllRunTests(true); writeln('Tests with pabcrtl compiled successfully'); CompileAllCompilationTests('pabcrtl_tests', true); - RunAllTests(false); - writeln('Tests with pabcrtl run successfully'); - end - else - begin - CompileAllRunTests(true); - writeln('Tests with pabcrtl compiled successfully'); - CompileAllCompilationTests('pabcrtl_tests', true); - RunAllTests(false); - writeln('Tests with pabcrtl run successfully'); - ClearExeDir; - CompileAllRunTests(false, true); - writeln('Tests in 32bit mode compiled successfully'); - RunAllTests(false); - writeln('Tests in 32bit run successfully'); - end; + end; + if (ParamCount = 0) or (ParamStr(1) = '6') then + begin + RunAllTests(false); + writeln('Tests with pabcrtl run successfully'); System.Environment.CurrentDirectory := Path.GetDirectoryName(GetEXEFileName()); RunExpressionsExtractTests; writeln('Intellisense expression tests run successfully');