void main()
{
    StaticThingy.register(new SomeAdapter());
    StaticThingy.createSome!Dummy();
}


interface FooAdapter
{
    FooBundle!(Handle) createSome(Handle)();
}

private class SomeAdapter : FooAdapter
{
    Bundle createSome()
    {
        auto w = new Dummy();
        auto c = new FooDummy();
        auto b = Bundle(c, w);
        return b;
    }
}

struct StaticThingy
{
static:
    FooBundle!(Handle) createSome(Handle)()
    {
        return fooAdapter.createSome!(Handle)();
    }

// ...


error: undefined reference to '_D9onlineapp10FooAdapter__T10createSomeTCQBn5DummyZQyMFZSQCd__T9FooBundleTQBiZQp'
collect2: error: ld returned 1 exit status
Error: linker exited with status 1


Hey :)

During playing around I came up with code similar to the example above.

As the title says, this code doesn't link.
For the full example please see: https://run.dlang.io/is/mr0u2i

- But should this even compile successfully?
- Does `SomeAdapter` even implement `FooAdapter` correctly?


 ~ Elias

Reply via email to