diff --git a/Configuration/GlobalAssemblyInfo.cs b/Configuration/GlobalAssemblyInfo.cs index e9d5633e2..a2839cfe1 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 = "6"; public const string Build = "2"; - public const string Revision = "2361"; + public const string Revision = "2365"; 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 81f9521cb..c5e658948 100644 --- a/Configuration/Version.defs +++ b/Configuration/Version.defs @@ -1,4 +1,4 @@ %MINOR%=6 -%REVISION%=2361 +%REVISION%=2365 %COREVERSION%=2 %MAJOR%=3 diff --git a/Localization/DefaultLang.resources b/Localization/DefaultLang.resources index d2ca1fb01..702deb292 100644 Binary files a/Localization/DefaultLang.resources and b/Localization/DefaultLang.resources differ diff --git a/Release/pabcversion.txt b/Release/pabcversion.txt index 0d8a49339..26d764cd9 100644 --- a/Release/pabcversion.txt +++ b/Release/pabcversion.txt @@ -1 +1 @@ -3.6.2.2361 +3.6.2.2365 diff --git a/ReleaseGenerators/PascalABCNET_version.nsh b/ReleaseGenerators/PascalABCNET_version.nsh index 20b349720..7d24b47bd 100644 --- a/ReleaseGenerators/PascalABCNET_version.nsh +++ b/ReleaseGenerators/PascalABCNET_version.nsh @@ -1 +1 @@ -!define VERSION '3.6.2.2361' +!define VERSION '3.6.2.2365' diff --git a/TestSuite/CompilationSamples/PABCSystem.pas b/TestSuite/CompilationSamples/PABCSystem.pas index ddf3213e8..99471197a 100644 --- a/TestSuite/CompilationSamples/PABCSystem.pas +++ b/TestSuite/CompilationSamples/PABCSystem.pas @@ -12507,27 +12507,31 @@ begin result := 0; end; +type NotPinnableWrapper = class + [ThreadStatic] + static notPinnableTypes: HashSet<&Type>; +end; + // ----------------------------------------------------- // Internal procedures for PABCRTL.dll: implementation // ----------------------------------------------------- var __initialized := false; - notPinnableTypes: HashSet<&Type> := nil; - + [System.Diagnostics.DebuggerStepThrough] function __FixPointer(obj: object): GCHandle; begin if obj <> nil then begin try - if notPinnableTypes.Contains(obj.GetType()) then + if (NotPinnableWrapper.notPinnableTypes <> nil) and NotPinnableWrapper.notPinnableTypes.Contains(obj.GetType()) then Result := GCHandle.Alloc(obj) else Result := GCHandle.Alloc(obj, GCHandleType.Pinned); except - if notPinnableTypes = nil then - notPinnableTypes := new HashSet<&Type>; - notPinnableTypes.Add(obj.GetType()); + if NotPinnableWrapper.notPinnableTypes = nil then + NotPinnableWrapper.notPinnableTypes := new HashSet<&Type>; + NotPinnableWrapper.notPinnableTypes.Add(obj.GetType()); Result := GCHandle.Alloc(obj); end; end; diff --git a/TestSuite/af1_method_call_as_procedure.pas b/TestSuite/af1_method_call_as_procedure.pas new file mode 100644 index 000000000..9d1b246ff --- /dev/null +++ b/TestSuite/af1_method_call_as_procedure.pas @@ -0,0 +1,21 @@ +type + TBase = class + function f1: real; + begin + Result := 3.5; + Assert(False); + end; + end; + + TErr = class(TBase) + function f1: integer; + begin + Result := 2 + end; + end; + +begin + var a := new TErr; + Assert(a.f1=2); + a.f1; +end. \ No newline at end of file diff --git a/TreeConverter/TreeConversion/convertion_data_and_alghoritms.cs b/TreeConverter/TreeConversion/convertion_data_and_alghoritms.cs index e6d56863f..8c476283b 100644 --- a/TreeConverter/TreeConversion/convertion_data_and_alghoritms.cs +++ b/TreeConverter/TreeConversion/convertion_data_and_alghoritms.cs @@ -1927,7 +1927,14 @@ namespace PascalABCCompiler.TreeConverter if ((parameters.Count >= cfn.parameters.Count - cfn.num_of_default_variables) && (parameters.Count <= cfn.parameters.Count) || parameters.Count == 0 && cfn.parameters.Count == 1 && cfn.parameters[0].is_params) { - if (is_exist_eq_method_in_list(fn, set_of_possible_functions) != null) + var fm = find_eq_method_in_list(fn, set_of_possible_functions); // без возвращаемого значения в отличие от is_exist_eq_method_in_list + + bool bo = fm != null; + if (bo) + bo = eq_type_nodes(fn.return_value_type, fm.return_value_type); + + //var bo = is_exist_eq_method_in_list(fn, set_of_possible_functions) != null; + if (bo) { if (set_of_possible_functions.Count > 0) if (set_of_possible_functions[0] is basic_function_node) @@ -1938,7 +1945,12 @@ namespace PascalABCCompiler.TreeConverter continue; } - set_of_possible_functions.Add(fn); + if (fm != null && fn is common_method_node cmnfn && fm is common_method_node cmnfm && cmnfn.comperehensive_type != cmnfm.comperehensive_type) + { + //fn = fn; + } + // Если fm и fn принадлежат к разным классам, то не добавлять fn - она принадлежит предку поскольку встречалась позже + else set_of_possible_functions.Add(fn); } } else