Index: src/Common/PassVisitor.h
===================================================================
--- src/Common/PassVisitor.h	(revision 1e8bbac9370b8c548860154f7bd8bb7610ca6ea8)
+++ src/Common/PassVisitor.h	(revision d8893ca8c3a93edede949bb75c6d4f23d5d6cf8a)
@@ -298,4 +298,6 @@
 	void indexerAddUnionFwd ( UnionDecl           * node ) { indexer_impl_addUnionFwd ( pass, 0, node ); }
 	void indexerAddTrait    ( TraitDecl           * node ) { indexer_impl_addTrait    ( pass, 0, node ); }
+	void indexerAddWith     ( WithStmt            * node ) { indexer_impl_addWith    ( pass, 0, node ); }
+
 
 	template< typename TreeType, typename VisitorType >
Index: src/Common/PassVisitor.impl.h
===================================================================
--- src/Common/PassVisitor.impl.h	(revision 1e8bbac9370b8c548860154f7bd8bb7610ca6ea8)
+++ src/Common/PassVisitor.impl.h	(revision d8893ca8c3a93edede949bb75c6d4f23d5d6cf8a)
@@ -985,14 +985,32 @@
 }
 
+
+
 //--------------------------------------------------------------------------
 // NullStmt
 template< typename pass_type >
 void PassVisitor< pass_type >::visit( WithStmt * node ) {
-	VISIT_BODY( node );
+	VISIT_START( node );
+	maybeAccept_impl( node->exprs, *this );
+	{
+		// catch statements introduce a level of scope (for the caught exception)
+		auto guard = makeFuncGuard( [this]() { indexerScopeEnter(); }, [this]() { indexerScopeLeave(); } );
+		indexerAddWith( node );
+		maybeAccept_impl( node->stmt, *this );
+	}
+	VISIT_END( node );
 }
 
 template< typename pass_type >
 Statement * PassVisitor< pass_type >::mutate( WithStmt * node ) {
-	MUTATE_BODY( Statement, node );
+	MUTATE_START( node );
+	maybeMutate_impl( node->exprs, *this );
+	{
+		// catch statements introduce a level of scope (for the caught exception)
+		auto guard = makeFuncGuard( [this]() { indexerScopeEnter(); }, [this]() { indexerScopeLeave(); } );
+		indexerAddWith( node );
+		maybeMutate_impl( node->stmt, *this );
+	}
+	MUTATE_END( Statement, node );
 }
 
Index: src/Common/PassVisitor.proto.h
===================================================================
--- src/Common/PassVisitor.proto.h	(revision 1e8bbac9370b8c548860154f7bd8bb7610ca6ea8)
+++ src/Common/PassVisitor.proto.h	(revision d8893ca8c3a93edede949bb75c6d4f23d5d6cf8a)
@@ -208,4 +208,5 @@
 INDEXER_FUNC( addUnion  , UnionDecl *           );
 INDEXER_FUNC( addTrait  , TraitDecl *           );
+INDEXER_FUNC( addWith   , WithStmt *            );
 
 
