2
0
Эх сурвалжийг харах

+ add test for already fixed #23997

Sven/Sarah Barth 2 өдөр өмнө
parent
commit
38298fa215
1 өөрчлөгдсөн 29 нэмэгдсэн , 0 устгасан
  1. 29 0
      tests/webtbs/tw23997.pp

+ 29 - 0
tests/webtbs/tw23997.pp

@@ -0,0 +1,29 @@
+{ %NORUN }
+
+program tw23997;
+
+{$MODE fpc}
+
+type TMyFunc = function (x: single): single;
+
+function Foo (x: array of single): single; overload;
+begin
+  Foo := 2*x[0];
+end;
+
+function Foo (x: single): single; overload;
+begin
+  Foo := 2*x;
+end;
+
+procedure GoAhead (x: single; func: TMyFunc);
+begin
+  writeln (func (x));
+end;
+
+begin
+  GoAhead (42, @Foo);
+  //compiler stops on the first definition of foo
+  //which does not match TMyFunc
+end.
+