Index: src/ResolvExpr/PtrsCastable.cc
===================================================================
--- src/ResolvExpr/PtrsCastable.cc	(revision b0837e4dfda21dcfd8fa2bbaaaf2078ad86ba096)
+++ src/ResolvExpr/PtrsCastable.cc	(revision 6810fcbdd4088ea4c0f59fc278c03b4f3db26acb)
@@ -14,4 +14,5 @@
 //
 
+#include "Common/PassVisitor.h"
 #include "ResolvExpr/TypeEnvironment.h"  // for EqvClass, TypeEnvironment
 #include "SymTab/Indexer.h"              // for Indexer
@@ -21,7 +22,6 @@
 #include "typeops.h"                     // for ptrsAssignable
 
-
 namespace ResolvExpr {
-	class PtrsCastable : public Visitor {
+	struct PtrsCastable : public WithShortCircuiting  {
 	  public:
 		PtrsCastable( Type *dest, const TypeEnvironment &env, const SymTab::Indexer &indexer );
@@ -29,18 +29,20 @@
 		int get_result() const { return result; }
 
-		virtual void visit(VoidType *voidType);
-		virtual void visit(BasicType *basicType);
-		virtual void visit(PointerType *pointerType);
-		virtual void visit(ArrayType *arrayType);
-		virtual void visit(FunctionType *functionType);
-		virtual void visit(StructInstType *inst);
-		virtual void visit(UnionInstType *inst);
-		virtual void visit(EnumInstType *inst);
-		virtual void visit(TraitInstType *inst);
-		virtual void visit(TypeInstType *inst);
-		virtual void visit(TupleType *tupleType);
-		virtual void visit(VarArgsType *varArgsType);
-		virtual void visit(ZeroType *zeroType);
-		virtual void visit(OneType *oneType);
+		void previsit( Type * ) { visit_children = false; }
+
+		void postvisit( VoidType * voidType );
+		void postvisit( BasicType * basicType );
+		void postvisit( PointerType * pointerType );
+		void postvisit( ArrayType * arrayType );
+		void postvisit( FunctionType * functionType );
+		void postvisit( StructInstType * inst );
+		void postvisit( UnionInstType * inst );
+		void postvisit( EnumInstType * inst );
+		void postvisit( TraitInstType * inst );
+		void postvisit( TypeInstType * inst );
+		void postvisit( TupleType * tupleType );
+		void postvisit( VarArgsType * varArgsType );
+		void postvisit( ZeroType * zeroType );
+		void postvisit( OneType * oneType );
 	  private:
 		Type *dest;
@@ -79,4 +81,5 @@
 			EqvClass eqvClass;
 			if ( env.lookup( destAsTypeInst->get_name(), eqvClass ) ) {
+				// xxx - should this be ptrsCastable?
 				return ptrsAssignable( src, eqvClass.type, env );
 			} // if
@@ -85,7 +88,7 @@
 			return objectCast( src, env, indexer );
 		} else {
-			PtrsCastable ptrs( dest, env, indexer );
+			PassVisitor<PtrsCastable> ptrs( dest, env, indexer );
 			src->accept( ptrs );
-			return ptrs.get_result();
+			return ptrs.pass.get_result();
 		} // if
 	}
@@ -95,34 +98,34 @@
 	}
 
-	void PtrsCastable::visit( VoidType * ) {
+	void PtrsCastable::postvisit( VoidType * ) {
 		result = objectCast( dest, env, indexer );
 	}
 
-	void PtrsCastable::visit( BasicType * ) {
+	void PtrsCastable::postvisit( BasicType * ) {
 		result = objectCast( dest, env, indexer );
 	}
 
-	void PtrsCastable::visit( PointerType * ) {
+	void PtrsCastable::postvisit( PointerType * ) {
 		result = objectCast( dest, env, indexer );
 	}
 
-	void PtrsCastable::visit( ArrayType * ) {
+	void PtrsCastable::postvisit( ArrayType * ) {
 		result = objectCast( dest, env, indexer );
 	}
 
-	void PtrsCastable::visit( FunctionType * ) {
+	void PtrsCastable::postvisit( FunctionType * ) {
 		// result = -1;
 		result = functionCast( dest, env, indexer );
 	}
 
-	void PtrsCastable::visit( StructInstType * ) {
+	void PtrsCastable::postvisit( StructInstType * ) {
 		result = objectCast( dest, env, indexer );
 	}
 
-	void PtrsCastable::visit( UnionInstType * ) {
+	void PtrsCastable::postvisit( UnionInstType * ) {
 		result = objectCast( dest, env, indexer );
 	}
 
-	void PtrsCastable::visit( EnumInstType * ) {
+	void PtrsCastable::postvisit( EnumInstType * ) {
 		if ( dynamic_cast< EnumInstType* >( dest ) ) {
 			result = 1;
@@ -138,24 +141,24 @@
 	}
 
-	void PtrsCastable::visit( TraitInstType * ) {}
+	void PtrsCastable::postvisit( TraitInstType * ) {}
 
-	void PtrsCastable::visit(TypeInstType *inst) {
+	void PtrsCastable::postvisit(TypeInstType *inst) {
 		//result = objectCast( inst, env, indexer ) > 0 && objectCast( dest, env, indexer ) > 0 ? 1 : -1;
 		result = objectCast( inst, env, indexer ) == objectCast( dest, env, indexer ) ? 1 : -1;
 	}
 
-	void PtrsCastable::visit( TupleType * ) {
+	void PtrsCastable::postvisit( TupleType * ) {
 		result = objectCast( dest, env, indexer );
 	}
 
-	void PtrsCastable::visit( VarArgsType * ) {
+	void PtrsCastable::postvisit( VarArgsType * ) {
 		result = objectCast( dest, env, indexer );
 	}
 
-	void PtrsCastable::visit( ZeroType * ) {
+	void PtrsCastable::postvisit( ZeroType * ) {
 		result = objectCast( dest, env, indexer );
 	}
 
-	void PtrsCastable::visit( OneType * ) {
+	void PtrsCastable::postvisit( OneType * ) {
 		result = objectCast( dest, env, indexer );
 	}
