diff --git a/Configuration/GlobalAssemblyInfo.cs b/Configuration/GlobalAssemblyInfo.cs index 2988f5ba8..c53df5830 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 = "7"; public const string Build = "1"; - public const string Revision = "2767"; + public const string Revision = "2768"; 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 961119af3..094db1fd7 100644 --- a/Configuration/Version.defs +++ b/Configuration/Version.defs @@ -1,4 +1,4 @@ -%MINOR%=7 -%REVISION%=2767 %COREVERSION%=1 +%REVISION%=2768 +%MINOR%=7 %MAJOR%=3 diff --git a/Release/pabcversion.txt b/Release/pabcversion.txt index 6b829ae12..a41468fb6 100644 --- a/Release/pabcversion.txt +++ b/Release/pabcversion.txt @@ -1 +1 @@ -3.7.1.2767 +3.7.1.2768 diff --git a/ReleaseGenerators/PascalABCNET_version.nsh b/ReleaseGenerators/PascalABCNET_version.nsh index 0d87d0037..6d7860ec2 100644 --- a/ReleaseGenerators/PascalABCNET_version.nsh +++ b/ReleaseGenerators/PascalABCNET_version.nsh @@ -1 +1 @@ -!define VERSION '3.7.1.2767' +!define VERSION '3.7.1.2768' diff --git a/TestSuite/2363.pas b/TestSuite/2363.pas new file mode 100644 index 000000000..d1dbd02ad --- /dev/null +++ b/TestSuite/2363.pas @@ -0,0 +1,14 @@ +procedure p0(o: T); +begin + //Print(1); +end; + +procedure p1; where T: record; +begin + //Ошибка: Возможны два преобразования типов + p0&(nil); +end; + +begin + Assert(1=1) +end. \ No newline at end of file diff --git a/TestSuite/CompilationSamples/School.pas b/TestSuite/CompilationSamples/School.pas index 081bdaba4..e563ab2f7 100644 --- a/TestSuite/CompilationSamples/School.pas +++ b/TestSuite/CompilationSamples/School.pas @@ -41,6 +41,9 @@ function MinMax(s: sequence of integer): (integer, integer); /// Возвращает кортеж из минимума и максимума последовательности s function MinMax(s: sequence of real): (real, real); +/// Возвращает кортеж из минимума и максимума последовательности s +function MinMax(s: sequence of BigInteger): (BigInteger, BigInteger); + /// Возвращает НОД function НОД(a, b: int64): int64; @@ -316,6 +319,24 @@ begin Result := (min, max) end; +/// Возвращает кортеж из минимума и максимума последовательности s +function MinMax(s: sequence of BigInteger): (BigInteger, BigInteger); +begin + var min, max: BigInteger; + var FirstValue := True; + foreach var m in s do + if FirstValue then + (min, max, FirstValue) := (m, m, False) + else + begin + if m < min then + min := m; + if m > max then + max := m + end; + Result := (min, max) +end; + /// Возвращает кортеж из минимума и максимума последовательности function MinMax(Self: sequence of int64): (int64, int64); extensionmethod := MinMax(Self); @@ -329,6 +350,10 @@ MinMax(Self); function MinMax(Self: sequence of real): (real, real); extensionmethod := MinMax(Self); +/// Возвращает кортеж из минимума и максимума последовательности +function MinMax(Self: sequence of BigInteger): (BigInteger, BigInteger); +extensionmethod := MinMax(Self); + {$endregion} {$region GCDLCM} diff --git a/TreeConverter/TreeConversion/convertion_data_and_alghoritms.cs b/TreeConverter/TreeConversion/convertion_data_and_alghoritms.cs index 02bbbf85f..d667f86b6 100644 --- a/TreeConverter/TreeConversion/convertion_data_and_alghoritms.cs +++ b/TreeConverter/TreeConversion/convertion_data_and_alghoritms.cs @@ -1667,6 +1667,8 @@ namespace PascalABCCompiler.TreeConverter { if (ptc.second!=null) { + if (ptc.first.from is null_type_node || ptc.second.from is null_type_node) + continue; // SSM 9/12/20 fix 2363 AddError(new PossibleTwoTypeConversionsInFunctionCall(loc,ptc.first,ptc.second)); } diff --git a/bin/Lib/School.pas b/bin/Lib/School.pas index 081bdaba4..e563ab2f7 100644 --- a/bin/Lib/School.pas +++ b/bin/Lib/School.pas @@ -41,6 +41,9 @@ function MinMax(s: sequence of integer): (integer, integer); /// Возвращает кортеж из минимума и максимума последовательности s function MinMax(s: sequence of real): (real, real); +/// Возвращает кортеж из минимума и максимума последовательности s +function MinMax(s: sequence of BigInteger): (BigInteger, BigInteger); + /// Возвращает НОД function НОД(a, b: int64): int64; @@ -316,6 +319,24 @@ begin Result := (min, max) end; +/// Возвращает кортеж из минимума и максимума последовательности s +function MinMax(s: sequence of BigInteger): (BigInteger, BigInteger); +begin + var min, max: BigInteger; + var FirstValue := True; + foreach var m in s do + if FirstValue then + (min, max, FirstValue) := (m, m, False) + else + begin + if m < min then + min := m; + if m > max then + max := m + end; + Result := (min, max) +end; + /// Возвращает кортеж из минимума и максимума последовательности function MinMax(Self: sequence of int64): (int64, int64); extensionmethod := MinMax(Self); @@ -329,6 +350,10 @@ MinMax(Self); function MinMax(Self: sequence of real): (real, real); extensionmethod := MinMax(Self); +/// Возвращает кортеж из минимума и максимума последовательности +function MinMax(Self: sequence of BigInteger): (BigInteger, BigInteger); +extensionmethod := MinMax(Self); + {$endregion} {$region GCDLCM}