Index: src/GenPoly/Box.cc
===================================================================
--- src/GenPoly/Box.cc	(revision 8ca3a72b36ccb51a65310cc76b8097bfeab9dcef)
+++ src/GenPoly/Box.cc	(revision ade20d0d432fff8119b549cccd88e03774188486)
@@ -101,5 +101,5 @@
 			void passTypeVars( ApplicationExpr *appExpr, Type *polyRetType, std::list< Expression *>::iterator &arg, const TyVarMap &exprTyVars );
 			/// wraps a function application with a new temporary for the out-parameter return value
-			Expression *addRetParam( ApplicationExpr *appExpr, FunctionType *function, Type *retType, std::list< Expression *>::iterator &arg );
+			Expression *addRetParam( ApplicationExpr *appExpr, Type *retType, std::list< Expression *>::iterator &arg );
 			/// Replaces all the type parameters of a generic type with their concrete equivalents under the current environment
 			void replaceParametersWithConcrete( ApplicationExpr *appExpr, std::list< Expression* >& params );
@@ -134,5 +134,5 @@
 		  public:
 			template< typename DeclClass >
-			DeclClass *handleDecl( DeclClass *decl, Type *type );
+			DeclClass *handleDecl( DeclClass *decl );
 			template< typename AggDecl >
 			AggDecl * handleAggDecl( AggDecl * aggDecl );
@@ -663,5 +663,5 @@
 		}
 
-		Expression *Pass1::addRetParam( ApplicationExpr *appExpr, FunctionType *function, Type *retType, std::list< Expression *>::iterator &arg ) {
+		Expression *Pass1::addRetParam( ApplicationExpr *appExpr, Type *retType, std::list< Expression *>::iterator &arg ) {
 			// Create temporary to hold return value of polymorphic function and produce that temporary as a result
 			// using a comma expression.
@@ -730,5 +730,5 @@
 			Type *concrete = replaceWithConcrete( appExpr, dynType );
 			// add out-parameter for return value
-			return addRetParam( appExpr, function, concrete, arg );
+			return addRetParam( appExpr, concrete, arg );
 		}
 
@@ -737,5 +737,5 @@
 //			if ( ! function->get_returnVals().empty() && isPolyType( function->get_returnVals().front()->get_type(), tyVars ) ) {
 			if ( isDynRet( function, tyVars ) ) {
-				ret = addRetParam( appExpr, function, function->get_returnVals().front()->get_type(), arg );
+				ret = addRetParam( appExpr, function->get_returnVals().front()->get_type(), arg );
 			} // if
 			std::string mangleName = mangleAdapterName( function, tyVars );
@@ -1280,5 +1280,5 @@
 
 		template< typename DeclClass >
-		DeclClass * Pass2::handleDecl( DeclClass *decl, Type *type ) {
+		DeclClass * Pass2::handleDecl( DeclClass *decl ) {
 			DeclClass *ret = static_cast< DeclClass *>( Parent::mutate( decl ) );
 
@@ -1294,5 +1294,5 @@
 
 		DeclarationWithType * Pass2::mutate( FunctionDecl *functionDecl ) {
-			functionDecl = safe_dynamic_cast< FunctionDecl * > ( handleDecl( functionDecl, functionDecl->get_functionType() ) );
+			functionDecl = safe_dynamic_cast< FunctionDecl * > ( handleDecl( functionDecl ) );
 			FunctionType * ftype = functionDecl->get_functionType();
 			if ( ! ftype->get_returnVals().empty() && functionDecl->get_statements() ) {
@@ -1319,5 +1319,5 @@
 
 		ObjectDecl * Pass2::mutate( ObjectDecl *objectDecl ) {
-			return handleDecl( objectDecl, objectDecl->get_type() );
+			return handleDecl( objectDecl );
 		}
 
@@ -1342,5 +1342,5 @@
 			addToTyVarMap( typeDecl, scopeTyVars );
 			if ( typeDecl->get_base() ) {
-				return handleDecl( typeDecl, typeDecl->get_base() );
+				return handleDecl( typeDecl );
 			} else {
 				return Parent::mutate( typeDecl );
@@ -1349,5 +1349,5 @@
 
 		TypedefDecl * Pass2::mutate( TypedefDecl *typedefDecl ) {
-			return handleDecl( typedefDecl, typedefDecl->get_base() );
+			return handleDecl( typedefDecl );
 		}
 
