Assign an anonymous method to an interface variable or parameter?
问题 Anonymous methods are essentially interface s with an Invoke method: type TProc = reference to procedure; IProc = interface procedure Invoke; end; Now, is there a possibility to assign them to an actual interface variable or pass them as interface parameter? procedure TakeInterface(const Value: IInterface); begin end; var P: TProc; I: IInterface; begin I := P; // E2010 TakeInterface(P); // E2010 end; [DCC32 Error] E2010 Incompatible types: 'IInterface' and 'procedure, untyped pointer or