The code for "object.destroy" for interfaces looks like:
void destroy(T)(T obj) if (is(T == interface))
{
destroy(cast(Object)obj);
}
Casting an interface will only work for a D interface. There are C++, Objective-C and COM interfaces as well.
Comment #1 by doob — 2020-01-17T15:48:33Z
This issue applies to C++ and COM interface as well, not just Objective-C interfaces.
Comment #2 by robert.schadek — 2024-12-07T13:38:34Z