mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-01-16 12:53:14 +01:00
Basically it tries to do the following in order: Resolve types, Declare symbols, Create constant initializers, Apply initializers, Generate functions bodies. ClassInfo is now has the most useful(biased?) members working. Probably other stuf...
29 lines
472 B
D
29 lines
472 B
D
module classinfo1;
|
|
|
|
class NoPtrs
|
|
{
|
|
}
|
|
|
|
class HasPtrs
|
|
{
|
|
void* p;
|
|
}
|
|
|
|
void main()
|
|
{
|
|
{
|
|
ClassInfo ci = NoPtrs.classinfo;
|
|
char[] name = ci.name;
|
|
printf("%.*s\n", name.length, name.ptr);
|
|
assert(ci.name == "classinfo1.NoPtrs");
|
|
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);
|
|
}
|
|
}
|