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

Steven Schveighoffer <schvei...@yahoo.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|WORKSFORME                  |---

--- Comment #15 from Steven Schveighoffer <schvei...@yahoo.com> ---
No, it still doesn't work right. The example wasn't complete. Essentially, the
cast shouldn't compile.

https://run.dlang.io/is/8Hihr0

Note that I would expect the call to foo to produce output, but it doesn't.

If I add in a printout of the class and interface addresses, you get identical
addresses. That is, the cast didn't perform the thunk to get to the actual
interface record. Which would be expected (a correct cast would have to
reallocate the array).

I think the correct thing to do here is require a reinterpret cast if you
really want this cast to succeed (cast to void * and back).

--

Reply via email to