opEquals unsafe? Please tell me this isnt true...

2014-11-24 Thread Eric via Digitalmars-d-learn
@safe class Y { } @safe class X { } @safe class Z { int x; this() { if (typeid(X) == typeid(Y)) x = 1; // Compile Error else x = 2; } } void main() { new Z; } // test.d(19): Error: safe function 'test.Z.this' // cannot call system function 'object.opEquals'

Re: opEquals unsafe? Please tell me this isnt true...

2014-11-24 Thread Jonathan M Davis via Digitalmars-d-learn
On Monday, November 24, 2014 22:12:08 Eric via Digitalmars-d-learn wrote: @safe class Y { } @safe class X { } @safe class Z { int x; this() { if (typeid(X) == typeid(Y)) x = 1; // Compile Error else x = 2; } } void main() { new Z; } //

Re: opEquals unsafe? Please tell me this isnt true...

2014-11-24 Thread Eric via Digitalmars-d-learn
On Tuesday, 25 November 2014 at 02:48:43 UTC, Jonathan M Davis via Digitalmars-d-learn wrote: On Monday, November 24, 2014 22:12:08 Eric via Digitalmars-d-learn wrote: @safe class Y { } @safe class X { } @safe class Z { int x; this() { if (typeid(X) == typeid(Y)) x =

Re: opEquals unsafe? Please tell me this isnt true...

2014-11-24 Thread Adam D. Ruppe via Digitalmars-d-learn
On Tuesday, 25 November 2014 at 03:42:50 UTC, Eric wrote: I'm finding it really hard to write robust classes in D due to all the problems with Object. I wish Object didn't have any methods. One thing I do is kinda act as if it didn't and make my own interfaces instead.