D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 16124 - Object.factory fails for static libs
Summary: Object.factory fails for static libs
Status: NEW
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: x86_64 Windows
: P2 major
Assignee: No Owner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-06-05 08:46 UTC by Andre
Modified: 2024-12-13 18:48 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Andre 2016-06-05 08:46:01 UTC
In this example all 3 assertions fails. Class Base and Child are imported via static libraries. The issue occus on linux and windows with recent
dmd compiler.

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);
}


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 { }


The application is compiled via
dmd base -lib
dmd child -lib base.lib
dmd main base.lib child.lib
main
PAUSE
Comment 1 dlangBugzillaToGithub 2024-12-13 18:48:19 UTC
THIS ISSUE HAS BEEN MOVED TO GITHUB

https://github.com/dlang/dmd/issues/19139

DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB