mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-04-17 17:29:02 +02:00
[svn r116] Implemented the ClassInfo.destructor field.
This commit is contained in:
@@ -16,13 +16,13 @@ void main()
|
||||
char[] name = ci.name;
|
||||
printf("%.*s\n", name.length, name.ptr);
|
||||
assert(ci.name == "classinfo1.NoPtrs");
|
||||
assert(ci.flags == 2);
|
||||
assert(ci.flags & 2);
|
||||
}
|
||||
{
|
||||
ClassInfo ci = HasPtrs.classinfo;
|
||||
char[] name = ci.name;
|
||||
printf("%.*s\n", name.length, name.ptr);
|
||||
assert(ci.name == "classinfo1.HasPtrs");
|
||||
assert(ci.flags == 0);
|
||||
assert(!(ci.flags & 2));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,15 +4,40 @@ class C
|
||||
{
|
||||
}
|
||||
|
||||
class D
|
||||
class D : C
|
||||
{
|
||||
this()
|
||||
{
|
||||
}
|
||||
~this()
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
template T()
|
||||
{
|
||||
~this()
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
class E : D
|
||||
{
|
||||
this()
|
||||
{
|
||||
}
|
||||
~this()
|
||||
{
|
||||
}
|
||||
mixin T;
|
||||
}
|
||||
|
||||
void main()
|
||||
{
|
||||
assert(C.classinfo.defaultConstructor is null);
|
||||
assert(C.classinfo.destructor is null);
|
||||
assert(D.classinfo.defaultConstructor !is null);
|
||||
assert(D.classinfo.destructor !is null);
|
||||
assert(E.classinfo.defaultConstructor !is null);
|
||||
assert(E.classinfo.destructor !is null);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user