Index: src/ResolvExpr/Resolver.cc
===================================================================
--- src/ResolvExpr/Resolver.cc	(revision 4670c791e276890b50caee6d89362de9e62c28a8)
+++ src/ResolvExpr/Resolver.cc	(revision c28a038d643e82580facb0e038d69d9bfca11e42)
@@ -82,12 +82,11 @@
 		void previsit( ConstructorInit *ctorInit );
 	  private:
-  	typedef std::list< Initializer * >::iterator InitIterator;
+		typedef std::list< Initializer * >::iterator InitIterator;
 
 		template< typename PtrType >
 		void handlePtrType( PtrType * type );
 
-	  void resolveAggrInit( ReferenceToType *, InitIterator &, InitIterator & );
-	  void resolveSingleAggrInit( Declaration *, InitIterator &, InitIterator &, TypeSubstitution sub );
-	  void fallbackInit( ConstructorInit * ctorInit );
+		void resolveWithExprs( std::list< Expression * > & withExprs, std::list< Statement * > & newStmts );
+		void fallbackInit( ConstructorInit * ctorInit );
 
 		Type * functionReturn = nullptr;
@@ -269,5 +268,5 @@
 		std::cerr << std::endl;
 #endif
-		Type *new_type = resolveTypeof( functionDecl->get_type(), indexer );
+		Type *new_type = resolveTypeof( functionDecl->type, indexer );
 		functionDecl->set_type( new_type );
 		GuardValue( functionReturn );
@@ -279,9 +278,9 @@
 		// xxx - it might be necessary to somehow keep the information from this environment, but I can't currently
 		// see how it's useful.
-		for ( Declaration * d : functionDecl->get_functionType()->get_parameters() ) {
+		for ( Declaration * d : functionDecl->type->parameters ) {
 			if ( ObjectDecl * obj = dynamic_cast< ObjectDecl * >( d ) ) {
-				if ( SingleInit * init = dynamic_cast< SingleInit * >( obj->get_init() ) ) {
-					delete init->get_value()->get_env();
-					init->get_value()->set_env( nullptr );
+				if ( SingleInit * init = dynamic_cast< SingleInit * >( obj->init ) ) {
+					delete init->value->env;
+					init->value->env = nullptr;
 				}
 			}
@@ -584,7 +583,6 @@
 	}
 
-
-	void Resolver::previsit( WithStmt * withStmt ) {
-		for ( Expression *& expr : withStmt->exprs )  {
+	void Resolver::resolveWithExprs( std::list< Expression * > & withExprs, std::list< Statement * > & newStmts ) {
+		for ( Expression *& expr : withExprs )  {
 			// only struct- and union-typed expressions are viable candidates
 			findKindExpression( expr, indexer, "with statement", isStructOrUnion );
@@ -595,5 +593,5 @@
 				ObjectDecl * tmp = ObjectDecl::newObject( tmpNamer.newName(), expr->result->clone(), new SingleInit( expr ) );
 				expr = new VariableExpr( tmp );
-				stmtsToAddBefore.push_back( new DeclStmt( tmp ) );
+				newStmts.push_back( new DeclStmt( tmp ) );
 				if ( InitTweak::isConstructable( tmp->type ) ) {
 					// generate ctor/dtor and resolve them
@@ -603,4 +601,8 @@
 			}
 		}
+	}
+
+	void Resolver::previsit( WithStmt * withStmt ) {
+		resolveWithExprs( withStmt->exprs, stmtsToAddBefore );
 	}
 
