Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Object.factory fails for static libs #19139

Open
dlangBugzillaToGithub opened this issue Jun 5, 2016 · 0 comments
Open

Object.factory fails for static libs #19139

dlangBugzillaToGithub opened this issue Jun 5, 2016 · 0 comments
Labels

Comments

@dlangBugzillaToGithub
Copy link

Andre reported this on 2016-06-05T08:46:01Z

Transferred from https://issues.dlang.org/show_bug.cgi?id=16124

CC List

  • Ketmar Dark

Description

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant