diff --git a/TestSuite/CompilationSamples/GraphWPF.pas b/TestSuite/CompilationSamples/GraphWPF.pas index 752072d0c..9180fcb5d 100644 --- a/TestSuite/CompilationSamples/GraphWPF.pas +++ b/TestSuite/CompilationSamples/GraphWPF.pas @@ -1620,6 +1620,11 @@ begin var sz := Size(host.DataContext); + if sz.Width = 0 then + sz.Width := GraphWindow.Width; + if sz.Height = 0 then + sz.Height := GraphWindow.Height; + var bmp := new RenderTargetBitmap(Round(sz.Width*scalex), Round(sz.Height*scaley), dpiX, dpiY, PixelFormats.Pbgra32); var myvis := new DrawingVisual(); diff --git a/TestSuite/units/u_overloads3.pas b/TestSuite/units/u_overloads3.pas new file mode 100644 index 000000000..5467483db --- /dev/null +++ b/TestSuite/units/u_overloads3.pas @@ -0,0 +1,5 @@ +unit u_overloads3; +function f(a: integer) := int64(20); + +begin +end. \ No newline at end of file diff --git a/TestSuite/usesunits/use_overloads3.pas b/TestSuite/usesunits/use_overloads3.pas new file mode 100644 index 000000000..580930d51 --- /dev/null +++ b/TestSuite/usesunits/use_overloads3.pas @@ -0,0 +1,7 @@ +uses u_overloads3; +function f(a: integer): integer := 10; + +begin + var r := f(0); + assert(r = 10); +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 4f35a5240..b5e09aeae 100644 --- a/TreeConverter/TreeConversion/convertion_data_and_alghoritms.cs +++ b/TreeConverter/TreeConversion/convertion_data_and_alghoritms.cs @@ -1432,6 +1432,15 @@ namespace PascalABCCompiler.TreeConverter } } } + if (left_func.return_value_type != null && right_func.return_value_type != null && function_eq_params(left_func, right_func, true)) + { + var tc = type_table.compare_types(left_func.return_value_type, right_func.return_value_type); + if (tc == type_compare.less_type) + return method_compare.greater_method; + if (tc == type_compare.greater_type) + return method_compare.less_method; + } + return method_compare.not_comparable_methods; }