On 2/3/18 12:37 PM, Kagamin wrote:
---
interface A{}
void* a=cast(void*)5;
A b=cast(A)a; //ok
A c=cast(A)cast(void*)5; //error
---
Last line gives Error: cannot cast `void*` to `A`. Is it intended?
Superficially, it looks like it should work, given the previous 2 lines.
But I don't know what the compiler does to convince itself your code is
wrong when you do it all in one expression.
Is there a more pragmatic use case why this should be possible? It would
help give motivation for fixing the problem. Clearly, `5` isn't going to
be a valid interface pointer.
-Steve