Implicit Specialization: Function type Matching not possible
Summary
The implicit specialization does not seem to be able to match function signatures correctly
System Information
Win 10: FPC Trunk/main
Example Project
program Project1;
{$mode objfpc}{$H+}
{$ModeSwitch implicitfunctionspecialization}
type
generic TFunc<TResult> = function: TResult;
generic procedure Bar<T>(f: specialize TFunc<T>);
begin
end;
function Foo: Integer;
begin
end;
begin
specialize Bar<Integer>(@Foo); // works
Bar(@Foo); // Error
end.
Edited by Frederic Kehrein