@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'
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; }
//
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 =
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.