Why does the following code:
TYPE
TFmxObjHelper = CLASS HELPER FOR TFmxObject
FUNCTION GetInterface<T:IInterface> : T;
END;
FUNCTION TFmxObjHelper.GetInterface<T> : T;
BEGIN
IF NOT Supports(Self,T,Result) THEN Result:=NIL // Error on this line
END;
produce E2250 There is no overloaded version of 'Supports' that can be called with these arguments
?
And how should it be written in order to have a "GetInterface
" mehod that either returns the specified interface (if the object implements it) or NIL (if the object doesn't)?