Hi,
I try to create objects by using the factory method in a static
library scenario.
file base.d
-------------------------------
module base;
class Base { }
Object createObject(string name)
{
return Object.factory(name);
}
-------------------------------
file child.d
-------------------------------
module child;
import base;
class Child: Base { }
-------------------------------
file main.d
-------------------------------
import base, child;
void main()
{
import std.traits: fullyQualifiedName;
assert( Object.factory(fullyQualifiedName!Child) !is null);
assert( createObject(fullyQualifiedName!Base) !is null);
assert( createObject(fullyQualifiedName!Child) !is null);
}
-------------------------------
My windows batch file looks like this:
dmd base -lib
dmd child -lib base.lib
dmd main base.lib child.lib
main
PAUSE
All assertions fails. Should this work, or is this a restriction
of object.factory?
Kind regards
André