www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 19217] New: object.destroy doesn't handle non D interfaces

https://issues.dlang.org/show_bug.cgi?id=19217

          Issue ID: 19217
           Summary: object.destroy doesn't handle non D interfaces
                    correctly
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: druntime
          Assignee: nobody puremagic.com
          Reporter: doob me.com

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.

--
Sep 04 2018