digitalmars.D.learn - Object.factory fails for static libraries
- Andre Pany (39/39) Jun 04 2016 Hi,
- Andre Pany (7/21) Jun 05 2016 I just validated, the same issue also occurs on ubuntu linux with
- Andre Pany (4/17) Jun 05 2016 Issue https://issues.dlang.org/show_bug.cgi?id=16124 created.
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é
Jun 04 2016
On Saturday, 4 June 2016 at 16:12:04 UTC, Andre Pany wrote:Hi, I try to create objects by using the factory method in a static library scenario. ... 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éI just validated, the same issue also occurs on ubuntu linux with the recent dmd compiler. The api for Object.factory does neither say whether this should work or not. Kind regards André
Jun 05 2016
On Sunday, 5 June 2016 at 08:40:18 UTC, Andre Pany wrote:On Saturday, 4 June 2016 at 16:12:04 UTC, Andre Pany wrote:Issue https://issues.dlang.org/show_bug.cgi?id=16124 created. Kind regards AndréHi, I try to create objects by using the factory method in a static library scenario. ...I just validated, the same issue also occurs on ubuntu linux with the recent dmd compiler. The api for Object.factory does neither say whether this should work or not. Kind regards André
Jun 05 2016