Index: src/ResolvExpr/CastCost.cc
===================================================================
--- src/ResolvExpr/CastCost.cc	(revision db4977a40d5da006bc537019085e0faa0ef2c736)
+++ src/ResolvExpr/CastCost.cc	(revision 1840193fdfce8adada879e32b171fcadce385e9b)
@@ -66,5 +66,6 @@
 
 	void CastCost::visit( BasicType *basicType ) {
-		if ( dynamic_cast< PointerType* >( dest ) ) {
+		PointerType *destAsPointer = dynamic_cast< PointerType* >( dest );
+		if ( destAsPointer && basicType->isInteger() ) {
 			cost = Cost( 1, 0, 0 );
 		} else {
@@ -77,8 +78,4 @@
 			if ( pointerType->get_qualifiers() <= destAsPtr->get_qualifiers() && typesCompatibleIgnoreQualifiers( pointerType->get_base(), destAsPtr->get_base(), indexer, env ) ) {
 				cost = Cost( 0, 0, 1 );
-			} else if ( BasicType *destAsBasic = dynamic_cast< BasicType* >( dest ) ) {
-				if ( destAsBasic->isInteger() ) {
-					cost = Cost( 1, 0, 0 );
-				} // if
 			} else {
 				TypeEnvironment newEnv( env );
@@ -92,5 +89,9 @@
 				} // if
 			} // if
-		} // if
+		} else if ( BasicType *destAsBasic = dynamic_cast< BasicType* >( dest ) ) {
+			if ( destAsBasic->isInteger() ) {
+				cost = Cost( 1, 0, 0 );
+			} // if
+		}
 	}
 } // namespace ResolvExpr
