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