[Issue 735] forward reference to type Object??

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Feb 12 18:47:16 PST 2007


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





------- Comment #4 from davidl at 126.com  2007-02-12 20:47 -------
the following represents the bug :

simplified case: buginawhole.d 

extern(D) Object _d_newclass(ClassInfo a);
class testclass{
        template getCtor(TInterface, char[] classname,T...) {
                static ClassInfo typeClass;
                static Object function (T, Object) rawCtor;
                static TInterface internalCtor(T t) {
                        Object a = _d_newclass(typeClass);
                        rawCtor(t, a);
                        return cast(TInterface)a;
                }

                TInterface function(T) getCtor() {
                        return &internalCtor;
               }
        }

}

interface ITestClass {
 void callable();
}
void main()
{
        auto testLibrary = new testclass;
        auto testCtor =
testLibrary.getCtor!(ITestClass,"test.testmodule.TestClass")();
}

modulefault.d(8): Error: forward reference to type Object
modulefault.d(8): Error: cannot implicitly convert expression (a) of type
object
.Object to Object


-- 



More information about the Digitalmars-d-bugs mailing list