diff gen/toir.cpp @ 150:2c336566ffed trunk

[svn r156] added a testcase for the most annoying bug ever
author lindquist
date Mon, 24 Mar 2008 20:05:44 +0100
parents a27941d00351
children d11848349f97
line wrap: on
line diff
--- a/gen/toir.cpp	Mon Mar 24 19:43:02 2008 +0100
+++ b/gen/toir.cpp	Mon Mar 24 20:05:44 2008 +0100
@@ -1199,6 +1199,7 @@
 
 DValue* CastExp::toElem(IRState* p)
 {
+    assert(type);
     Logger::print("CastExp::toElem: %s | %s\n", toChars(), type->toChars());
     LOG_SCOPE;
 
@@ -2254,7 +2255,10 @@
     else if (func->toParent()->isInterfaceDeclaration())
         assert(0 && "TODO delegate to interface method");
     else
+    {
+        DtoForceDeclareDsymbol(func);
         castfptr = func->irFunc->func;
+    }
 
     castfptr = DtoBitCast(castfptr, fptr->getType()->getContainedType(0));
     DtoStore(castfptr, fptr);