Index: src/ResolvExpr/CastCost.cc
===================================================================
--- src/ResolvExpr/CastCost.cc	(revision f76dd1adda60db081c9d143fad2048e7f9700c7c)
+++ src/ResolvExpr/CastCost.cc	(revision e563edf0e794d4c67e735b589a1c95f7fce848f6)
@@ -23,8 +23,9 @@
 #include "Cost.h"                        // for Cost, Cost::infinity
 #include "ResolvExpr/TypeEnvironment.h"  // for TypeEnvironment, EqvClass
+#include "ResolvExpr/typeops.h"          // for ptrsCastable
+#include "ResolvExpr/Unify.h"            // for typesCompatibleIgnoreQualifiers
 #include "SymTab/Indexer.h"              // for Indexer
 #include "SynTree/Declaration.h"         // for TypeDecl, NamedTypeDecl
 #include "SynTree/Type.h"                // for PointerType, Type, TypeInstType
-#include "typeops.h"                     // for typesCompatibleIgnoreQualifiers
 
 #if 0
Index: src/ResolvExpr/Unify.cc
===================================================================
--- src/ResolvExpr/Unify.cc	(revision f76dd1adda60db081c9d143fad2048e7f9700c7c)
+++ src/ResolvExpr/Unify.cc	(revision e563edf0e794d4c67e735b589a1c95f7fce848f6)
@@ -50,5 +50,5 @@
 
 namespace SymTab {
-class Indexer;
+	class Indexer;
 }  // namespace SymTab
 
@@ -56,4 +56,28 @@
 
 namespace ResolvExpr {
+
+// Template Helpers:
+template< typename Iterator1, typename Iterator2 >
+bool unifyList( Iterator1 list1Begin, Iterator1 list1End, Iterator2 list2Begin, Iterator2 list2End, TypeEnvironment &env, AssertionSet &needAssertions, AssertionSet &haveAssertions, OpenVarSet &openVars, const SymTab::Indexer &indexer, std::list< Type* > &commonTypes ) {
+	for ( ; list1Begin != list1End && list2Begin != list2End; ++list1Begin, ++list2Begin ) {
+		Type *commonType = 0;
+		if ( ! unify( *list1Begin, *list2Begin, env, needAssertions, haveAssertions, openVars, indexer, commonType ) ) {
+			return false;
+		} // if
+		commonTypes.push_back( commonType );
+	} // for
+	return ( list1Begin == list1End && list2Begin == list2End );
+}
+
+template< typename Iterator1, typename Iterator2 >
+bool unifyList( Iterator1 list1Begin, Iterator1 list1End, Iterator2 list2Begin, Iterator2 list2End, TypeEnvironment &env, AssertionSet &needAssertions, AssertionSet &haveAssertions, OpenVarSet &openVars, const SymTab::Indexer &indexer ) {
+	std::list< Type* > commonTypes;
+	if ( unifyList( list1Begin, list1End, list2Begin, list2End, env, needAssertions, haveAssertions,  openVars, indexer, commonTypes ) ) {
+		deleteAll( commonTypes );
+		return true;
+	} else {
+		return false;
+	} // if
+}
 
 	struct Unify_old : public WithShortCircuiting {
Index: src/ResolvExpr/Unify.h
===================================================================
--- src/ResolvExpr/Unify.h	(revision f76dd1adda60db081c9d143fad2048e7f9700c7c)
+++ src/ResolvExpr/Unify.h	(revision e563edf0e794d4c67e735b589a1c95f7fce848f6)
@@ -9,7 +9,7 @@
 // Author           : Richard C. Bilson
 // Created On       : Sun May 17 13:09:04 2015
-// Last Modified By : Aaron B. Moss
-// Last Modified On : Mon Jun 18 11:58:00 2018
-// Update Count     : 4
+// Last Modified By : Andrew Beach
+// Last Modified On : Tue Jan 17 11:12:00 2023
+// Update Count     : 5
 //
 
@@ -37,56 +37,51 @@
 
 namespace ResolvExpr {
-	bool unify( Type *type1, Type *type2, TypeEnvironment &env, AssertionSet &needAssertions, AssertionSet &haveAssertions, OpenVarSet &openVars, const SymTab::Indexer &indexer );
-	bool unify( Type *type1, Type *type2, TypeEnvironment &env, AssertionSet &needAssertions, AssertionSet &haveAssertions, OpenVarSet &openVars, const SymTab::Indexer &indexer, Type *&commonType );
-	bool unifyExact( Type *type1, Type *type2, TypeEnvironment &env, AssertionSet &needAssertions, AssertionSet &haveAssertions, OpenVarSet &openVars, const SymTab::Indexer &indexer );
-	bool unifyInexact( Type *type1, Type *type2, TypeEnvironment &env, AssertionSet &needAssertions, AssertionSet &haveAssertions, const OpenVarSet &openVars, WidenMode widen, const SymTab::Indexer &indexer, Type *&common );
 
-	template< typename Iterator1, typename Iterator2 >
-	bool unifyList( Iterator1 list1Begin, Iterator1 list1End, Iterator2 list2Begin, Iterator2 list2End, TypeEnvironment &env, AssertionSet &needAssertions, AssertionSet &haveAssertions, OpenVarSet &openVars, const SymTab::Indexer &indexer, std::list< Type* > &commonTypes ) {
-		for ( ; list1Begin != list1End && list2Begin != list2End; ++list1Begin, ++list2Begin ) {
-			Type *commonType = 0;
-			if ( ! unify( *list1Begin, *list2Begin, env, needAssertions, haveAssertions, openVars, indexer, commonType ) ) {
-				return false;
-			} // if
-			commonTypes.push_back( commonType );
-		} // for
-		if ( list1Begin != list1End || list2Begin != list2End ) {
-			return false;
-		} else {
-			return true;
-		} // if
-	}
+bool unify( Type *type1, Type *type2, TypeEnvironment &env, AssertionSet &needAssertions, AssertionSet &haveAssertions, OpenVarSet &openVars, const SymTab::Indexer &indexer );
+bool unify( Type *type1, Type *type2, TypeEnvironment &env, AssertionSet &needAssertions, AssertionSet &haveAssertions, OpenVarSet &openVars, const SymTab::Indexer &indexer, Type *&commonType );
+bool unifyExact( Type *type1, Type *type2, TypeEnvironment &env, AssertionSet &needAssertions, AssertionSet &haveAssertions, OpenVarSet &openVars, const SymTab::Indexer &indexer );
+bool unifyInexact( Type *type1, Type *type2, TypeEnvironment &env, AssertionSet &needAssertions, AssertionSet &haveAssertions, const OpenVarSet &openVars, WidenMode widen, const SymTab::Indexer &indexer, Type *&common );
 
-	template< typename Iterator1, typename Iterator2 >
-	bool unifyList( Iterator1 list1Begin, Iterator1 list1End, Iterator2 list2Begin, Iterator2 list2End, TypeEnvironment &env, AssertionSet &needAssertions, AssertionSet &haveAssertions, OpenVarSet &openVars, const SymTab::Indexer &indexer ) {
-		std::list< Type* > commonTypes;
-		if ( unifyList( list1Begin, list1End, list2Begin, list2End, env, needAssertions, haveAssertions, openVars, indexer, commonTypes ) ) {
-			deleteAll( commonTypes );
-			return true;
-		} else {
-			return false;
-		} // if
-	}
+bool typesCompatible( const Type *, const Type *, const SymTab::Indexer & indexer, const TypeEnvironment & env );
+bool typesCompatibleIgnoreQualifiers( const Type *, const Type *, const SymTab::Indexer & indexer, const TypeEnvironment & env );
 
-	bool unify( 
-		const ast::ptr<ast::Type> & type1, const ast::ptr<ast::Type> & type2, 
-		ast::TypeEnvironment & env, ast::AssertionSet & need, ast::AssertionSet & have, 
-		ast::OpenVarSet & open, const ast::SymbolTable & symtab );
+inline bool typesCompatible( const Type * t1, const Type * t2, const SymTab::Indexer & indexer ) {
+	TypeEnvironment env;
+	return typesCompatible( t1, t2, indexer, env );
+}
 
-	bool unify( 
-		const ast::ptr<ast::Type> & type1, const ast::ptr<ast::Type> & type2, 
-		ast::TypeEnvironment & env, ast::AssertionSet & need, ast::AssertionSet & have, 
-		ast::OpenVarSet & open, const ast::SymbolTable & symtab, ast::ptr<ast::Type> & common );
+inline bool typesCompatibleIgnoreQualifiers( const Type * t1, const Type * t2, const SymTab::Indexer & indexer ) {
+	TypeEnvironment env;
+	return typesCompatibleIgnoreQualifiers( t1, t2, indexer, env );
+}
 
-	bool unifyExact( 
-		const ast::Type * type1, const ast::Type * type2, ast::TypeEnvironment & env, 
-		ast::AssertionSet & need, ast::AssertionSet & have, const ast::OpenVarSet & open, 
-		WidenMode widen, const ast::SymbolTable & symtab );
+bool unify(
+	const ast::ptr<ast::Type> & type1, const ast::ptr<ast::Type> & type2,
+	ast::TypeEnvironment & env, ast::AssertionSet & need, ast::AssertionSet & have,
+	ast::OpenVarSet & open, const ast::SymbolTable & symtab );
 
-	bool unifyInexact( 
-		const ast::ptr<ast::Type> & type1, const ast::ptr<ast::Type> & type2, 
-		ast::TypeEnvironment & env, ast::AssertionSet & need, ast::AssertionSet & have, 
-		const ast::OpenVarSet & open, WidenMode widen, const ast::SymbolTable & symtab, 
-		ast::ptr<ast::Type> & common );
+bool unify(
+	const ast::ptr<ast::Type> & type1, const ast::ptr<ast::Type> & type2,
+	ast::TypeEnvironment & env, ast::AssertionSet & need, ast::AssertionSet & have,
+	ast::OpenVarSet & open, const ast::SymbolTable & symtab, ast::ptr<ast::Type> & common );
+
+bool unifyExact(
+	const ast::Type * type1, const ast::Type * type2, ast::TypeEnvironment & env,
+	ast::AssertionSet & need, ast::AssertionSet & have, const ast::OpenVarSet & open,
+	WidenMode widen, const ast::SymbolTable & symtab );
+
+bool unifyInexact(
+	const ast::ptr<ast::Type> & type1, const ast::ptr<ast::Type> & type2,
+	ast::TypeEnvironment & env, ast::AssertionSet & need, ast::AssertionSet & have,
+	const ast::OpenVarSet & open, WidenMode widen, const ast::SymbolTable & symtab,
+	ast::ptr<ast::Type> & common );
+
+bool typesCompatible(
+	const ast::Type *, const ast::Type *, const ast::SymbolTable & symtab = {},
+	const ast::TypeEnvironment & env = {} );
+
+bool typesCompatibleIgnoreQualifiers(
+	const ast::Type *, const ast::Type *, const ast::SymbolTable & symtab = {},
+	const ast::TypeEnvironment & env = {} );
 
 } // namespace ResolvExpr
Index: src/ResolvExpr/typeops.h
===================================================================
--- src/ResolvExpr/typeops.h	(revision f76dd1adda60db081c9d143fad2048e7f9700c7c)
+++ src/ResolvExpr/typeops.h	(revision e563edf0e794d4c67e735b589a1c95f7fce848f6)
@@ -107,26 +107,4 @@
 		const ast::Type * src, const ast::Type * dst, const ast::SymbolTable & symtab,
 		const ast::TypeEnvironment & env );
-
-	// in Unify.cc
-	bool typesCompatible( const Type *, const Type *, const SymTab::Indexer & indexer, const TypeEnvironment & env );
-	bool typesCompatibleIgnoreQualifiers( const Type *, const Type *, const SymTab::Indexer & indexer, const TypeEnvironment & env );
-
-	inline bool typesCompatible( const Type * t1, const Type * t2, const SymTab::Indexer & indexer ) {
-		TypeEnvironment env;
-		return typesCompatible( t1, t2, indexer, env );
-	}
-
-	inline bool typesCompatibleIgnoreQualifiers( const Type * t1, const Type * t2, const SymTab::Indexer & indexer ) {
-		TypeEnvironment env;
-		return typesCompatibleIgnoreQualifiers( t1, t2, indexer, env );
-	}
-
-	bool typesCompatible(
-		const ast::Type *, const ast::Type *, const ast::SymbolTable & symtab = {},
-		const ast::TypeEnvironment & env = {} );
-
-	bool typesCompatibleIgnoreQualifiers(
-		const ast::Type *, const ast::Type *, const ast::SymbolTable &,
-		const ast::TypeEnvironment & env = {} );
 
 	/// creates the type represented by the list of returnVals in a FunctionType. The caller owns the return value.
