Index: src/GenPoly/Box.cc
===================================================================
--- src/GenPoly/Box.cc	(revision e01559ccdf149d938faa048d3be60e6b7461bb1c)
+++ src/GenPoly/Box.cc	(revision 8c84ebde3a7ebf0cf2619525ce0d94191f1d49fc)
@@ -527,4 +527,5 @@
 
 		void Pass1::passAdapters( ApplicationExpr *appExpr, FunctionType *functionType, const TyVarMap &exprTyVars ) {
+			// collect a list of function types passed as parameters or implicit parameters (assertions)
 			std::list< DeclarationWithType *> &paramList = functionType->get_parameters();
 			std::list< FunctionType *> functions;
@@ -537,12 +538,25 @@
 				findFunction( (*arg)->get_type(), functions, exprTyVars, needsAdapter );
 			} // for
+
+			// parameter function types for which an appropriate adapter has been generated.
+			// we cannot use the types after applying substitutions, since two different 
+			// parameter types may be unified to the same type
 			std::set< std::string > adaptersDone;
+
 			for ( std::list< FunctionType *>::iterator funType = functions.begin(); funType != functions.end(); ++funType ) {
 				FunctionType *realFunction = (*funType)->clone();
-				assert( env );
-				env->apply( realFunction );
-
 				std::string mangleName = SymTab::Mangler::mangle( realFunction );
+
+				// only attempt to create an adapter or pass one as a parameter if we haven't 
+				// already done so for this pre-substitution parameter function type.
 				if ( adaptersDone.find( mangleName ) == adaptersDone.end() ) {
+					std::string mangleName = SymTab::Mangler::mangle( realFunction );
+					adaptersDone.insert( adaptersDone.begin(), mangleName );
+					
+					// apply substitution to type variables to figure out what the 
+					// adapter's type should look like
+					assert( env );
+					env->apply( realFunction );
+					mangleName = SymTab::Mangler::mangle( realFunction );
 					AdapterMap & adapters = Pass1::adapters.top();
 					AdapterMap::iterator adapter = adapters.find( mangleName );
@@ -555,4 +569,5 @@
 						continue;
 					} else if ( adapter == adapters.end() ) {
+						// adapter has not been created yet in the current scope, so define it
 						FunctionDecl *newAdapter = makeAdapter( *funType, realFunction, mangleName, exprTyVars );
 						adapter = adapters.insert( adapters.begin(), std::pair< std::string, FunctionDecl *>( mangleName, newAdapter ) );
@@ -560,7 +575,7 @@
 					} // if
 					assert( adapter != adapters.end() );
+
+					// add the appropriate adapter as a parameter
 					appExpr->get_args().push_front( new VariableExpr( adapter->second ) );
-					// appExpr->get_args().push_front( new NameExpr( makeAdapterName ( mangleName ) ) );
-					adaptersDone.insert( adaptersDone.begin(), mangleName );
 				} // if
 			} // for
@@ -880,4 +895,6 @@
 
 		void Pass1::doBeginScope() {
+			// actually, maybe this could (should?) push
+			// a copy of the current map
 			adapters.push(AdapterMap());
 		}
