[Issue 6777] alias this + cast(void*) == bug
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Sun Oct 23 08:05:50 PDT 2011
http://d.puremagic.com/issues/show_bug.cgi?id=6777
timon.gehr at gmx.ch changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |timon.gehr at gmx.ch
--- Comment #2 from timon.gehr at gmx.ch 2011-10-23 08:04:47 PDT ---
(In reply to comment #1)
> I think this is right behavior.
> In D2, the implicit conversion from class type to void* is disabled. So
>
> auto p = cast(void*) c;
>
> the expression c is transformed to c.s, and cause an error.
>
auto p = cast(void*) c; works if there is no alias this;. Implicit conversion
rules are irrelevant, because this is an explicit conversion. Therefore, I
think this is definitely a bug, because adding alias this should never disable
features to work, it should only be considered if the code would not compile
otherwise.
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
More information about the Digitalmars-d-bugs
mailing list