http://d.puremagic.com/issues/show_bug.cgi?id=2484


Justin <mrjn...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |mrjn...@gmail.com




--- Comment #2 from Justin <mrjn...@gmail.com>  2009-07-01 10:56:19 PDT ---
Following Chris Wright's suggestion, I can confirm that this works (dmd.1.045):

import std.stdio,
    std.moduleinit;

void main() {

    auto foo = new Container!(int)();
    foo.thingy = 3;
    assert(foo.thingy == 3);
    writefln("foo Classinfo.name : ", foo.classinfo.name);

    // Patch ModuleInfo
    foreach (mod; ModuleInfo.modules)
    {
        if (mod.name == "factory")
        {
            mod.localClasses ~= [foo.classinfo];
            break;
        }
    }

    auto bar = Object.factory(foo.classinfo.name);
    assert(bar !is null);
    writefln("bar Classinfo.name : ", bar.classinfo.name);
}
class Container(T) { T thingy; }

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------

Reply via email to