On 9/10/2011 5:11 PM, Mehrdad wrote:
I just realized some of my code broke because of the (apparent?) changes to typedef.

I had something like:

   extern(Windows) void Foo(HANDLE h);

   const HANDLE h = CreateFile(...);
   Foo(h);

which now broke because Foo's parameter can no longer be const (since HANDLE is now an alias for void*, and so const HANDLE means const(void*), which can't be cast to void*).

Obviously, I can make the variable non-const to solve the problem, but like, was the change to typedef really necessary? Is there a plan to get around problems like these in the long term?
Oh FYI, apparently code like this also broke:

       HANDLE h;
       @property HANDLE handle() const { return h; }

because you can't return const(void*) as void*...
so frustrating. :(

Reply via email to