WTF! new in class is static?!?!

Steven Schveighoffer schveiguy at yahoo.com
Thu Jun 7 21:57:17 UTC 2018


On 6/7/18 5:07 PM, DigitalDesigns wrote:
> class A;
> 
> class B
> {
>     A a = new A();
> }
> 
> auto b1 = new B();
> auto b2 = new B();
> 
> assert(b1.a == b2.a)!!

Yep, long-standing issue: https://issues.dlang.org/show_bug.cgi?id=2947

Almost a decade old!

-Steve


More information about the Digitalmars-d-learn mailing list