<div dir="ltr">As the "reference to" feature was recently added to fpc trunk, I'd like to ask if internally there are any penalties (performance perhaps) or drawbacks to using them in place of the more traditional "procedure" and "procedure of object" types?<div><br></div><div>It's my understanding that for example using this code:</div><div><br></div><div>type</div><div>  TNotifyEvent = reference to procedure(Sender: TObject);</div><div>  // old version below</div><div><div>  // TNotifyEvent = procedure(Sender: TObject) of object;</div><br class="gmail-Apple-interchange-newline"></div><div>Would allow BOTH methods and normal procedures to be assigned to fields or variables of this redefined version of TNotifyEvent. The obvious benefit would be that users could then have more options when assigning event handlers, including anonymous procedures in addition to normal procedures and methods.</div><div><br></div><div>If there are no drawbacks to using "reference to" (given that the compiler someone is using is up to date with this feature), would it make sense for everyone to start using it in place of l "procedure" and "procedure of object" types? Obviously, when I say "procedure" in this question, I also mean to include "function" as well.</div></div>