Index: src/GenPoly/Lvalue.cc
===================================================================
--- src/GenPoly/Lvalue.cc	(revision d978ada7bb8f8a45b1fa33ff5bdccc7e6e466c3e)
+++ src/GenPoly/Lvalue.cc	(revision 546b51e3e5ef24205e8851131df135cfcaa7fb52)
@@ -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();
