You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
They need to be delegates instead of function pointers. That's why the error message in that case suggests trying the delegate keyword - it specifies to the compiler that you need that specifically (though it is true the library could convert them internally too...).
The difference between them is a delegate accesses some local data and a function pointer doesn't. So { foo(); } works because foo is the local data it accesses. writeln doesn't because it is global, not local. And empty {} needs no extra data at all. So the compiler types them as function pointer.
If you use the delegate keyword though, the compiler just passes it a null pointer to local data, which since it doesn't use anyway, all works nicely.
Since you can just add the keyword on the outside when needed, I think that's good enough but it is tempting to make the library just go ahead and convert when necessary too, it wouldn't be that hard to add.
What determines what is usable as a handler and what isn't? I am getting inconsistent behavior
The text was updated successfully, but these errors were encountered: