Index: src/GenPoly/Lvalue.cc
===================================================================
--- src/GenPoly/Lvalue.cc	(revision 098f7ff82a41df8f91550ab661699753dd53e90f)
+++ src/GenPoly/Lvalue.cc	(revision c9c9ac4f37b1932b3b5d84b2da1ab654a58e3069)
@@ -353,4 +353,6 @@
 			Type * destType = castExpr->result;
 			Type * srcType = castExpr->arg->result;
+			assertf( destType, "Cast to no type in: %s", toCString( castExpr ) );
+			assertf( srcType, "Cast from no type in: %s", toCString( castExpr ) );
 			int depth1 = destType->referenceDepth();
 			int depth2 = srcType->referenceDepth();
