Index: src/GenPoly/Box.cc
===================================================================
--- src/GenPoly/Box.cc	(revision 7e003011cac72e307c02d183bca9cbd4a982d69b)
+++ src/GenPoly/Box.cc	(revision ec95d1177c41ea894d346d43b00af99c7f01bb8b)
@@ -110,5 +110,5 @@
 			Type *replaceWithConcrete( ApplicationExpr *appExpr, Type *type, bool doClone = true );
 			/// wraps a function application returning a polymorphic type with a new temporary for the out-parameter return value
-			Expression *addDynRetParam( ApplicationExpr *appExpr, FunctionType *function, Type *polyType, std::list< Expression *>::iterator &arg );
+			Expression *addDynRetParam( ApplicationExpr *appExpr, Type *polyType, std::list< Expression *>::iterator &arg );
 			Expression *applyAdapter( ApplicationExpr *appExpr, FunctionType *function, std::list< Expression *>::iterator &arg, const TyVarMap &exprTyVars );
 			void boxParam( Type *formal, Expression *&arg, const TyVarMap &exprTyVars );
@@ -728,5 +728,5 @@
 		}
 
-		Expression *Pass1::addDynRetParam( ApplicationExpr *appExpr, FunctionType *function, Type *dynType, std::list< Expression *>::iterator &arg ) {
+		Expression *Pass1::addDynRetParam( ApplicationExpr *appExpr, Type *dynType, std::list< Expression *>::iterator &arg ) {
 			assert( env );
 			Type *concrete = replaceWithConcrete( appExpr, dynType );
@@ -1148,5 +1148,5 @@
 			if ( dynRetType ) {
 				Type *concRetType = appExpr->get_result()->isVoid() ? nullptr : appExpr->get_result();
-				ret = addDynRetParam( appExpr, function, concRetType, arg ); // xxx - used to use dynRetType instead of concRetType
+				ret = addDynRetParam( appExpr, concRetType, arg ); // xxx - used to use dynRetType instead of concRetType
 			} else if ( needsAdapter( function, scopeTyVars ) && ! needsAdapter( function, exprTyVars) ) { // xxx - exprTyVars is used above...?
 				// xxx - the ! needsAdapter check may be incorrect. It seems there is some situation where an adapter is applied where it shouldn't be, and this fixes it for some cases. More investigation is needed.
Index: src/GenPoly/Specialize.cc
===================================================================
--- src/GenPoly/Specialize.cc	(revision 7e003011cac72e307c02d183bca9cbd4a982d69b)
+++ src/GenPoly/Specialize.cc	(revision ec95d1177c41ea894d346d43b00af99c7f01bb8b)
@@ -93,5 +93,5 @@
 	}
 
-	bool needsTupleSpecialization( Type *formalType, Type *actualType, TypeSubstitution *env ) {
+	bool needsTupleSpecialization( Type *formalType, Type *actualType ) {
 		// Needs tuple specialization if the structure of the formal type and actual type do not match.
 		// This is the case if the formal type has ttype polymorphism, or if the structure  of tuple types
@@ -112,5 +112,5 @@
 
 	bool needsSpecialization( Type *formalType, Type *actualType, TypeSubstitution *env ) {
-		return needsPolySpecialization( formalType, actualType, env ) || needsTupleSpecialization( formalType, actualType, env );
+		return needsPolySpecialization( formalType, actualType, env ) || needsTupleSpecialization( formalType, actualType );
 	}
 
