On Wednesday, 1 August 2018 at 20:10:44 UTC, Hakan Aras wrote:
On Wednesday, 1 August 2018 at 16:25:28 UTC, Hakan Aras wrote:


https://run.dlang.io/is/dSVruv


Whoops, that was the wrong one. It's fixed now.

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

As a workaround remove static, as that causes y to be initialised at compile time. static here has nothing to do with static_cast in C++.

The analogy to a static_cast would be

const X x = new Y();

casting up the hierarchy, as opposed to dynamic casting down the hierarchy.

Reply via email to