Index: src/AST/SymbolTable.cpp
===================================================================
--- src/AST/SymbolTable.cpp	(revision 9845cb6d529fd96e3423e971fbf240545e90a0c4)
+++ src/AST/SymbolTable.cpp	(revision e563edf0e794d4c67e735b589a1c95f7fce848f6)
@@ -28,5 +28,6 @@
 #include "InitTweak/InitTweak.h"
 #include "ResolvExpr/Cost.h"
-#include "ResolvExpr/typeops.h"
+#include "ResolvExpr/typeops.h"     // for referenceToRvalueConversion
+#include "ResolvExpr/Unify.h"
 #include "SymTab/Mangler.h"
 
Index: src/GenPoly/Box.cc
===================================================================
--- src/GenPoly/Box.cc	(revision 9845cb6d529fd96e3423e971fbf240545e90a0c4)
+++ src/GenPoly/Box.cc	(revision e563edf0e794d4c67e735b589a1c95f7fce848f6)
@@ -14,4 +14,6 @@
 //
 
+#include "Box.h"
+
 #include <algorithm>                     // for mismatch
 #include <cassert>                       // for assert, strict_dynamic_cast
@@ -23,6 +25,4 @@
 #include <string>                        // for string, allocator, basic_string
 #include <utility>                       // for pair
-
-#include "Box.h"
 
 #include "CodeGen/OperatorTable.h"
@@ -37,5 +37,5 @@
 #include "InitTweak/InitTweak.h"         // for getFunctionName, isAssignment
 #include "Lvalue.h"                      // for generalizedLvalue
-#include "ResolvExpr/typeops.h"          // for typesCompatible
+#include "ResolvExpr/Unify.h"            // for typesCompatible
 #include "ScopedSet.h"                   // for ScopedSet, ScopedSet<>::iter...
 #include "ScrubTyVars.h"                 // for ScrubTyVars
Index: src/GenPoly/InstantiateGeneric.cc
===================================================================
--- src/GenPoly/InstantiateGeneric.cc	(revision 9845cb6d529fd96e3423e971fbf240545e90a0c4)
+++ src/GenPoly/InstantiateGeneric.cc	(revision e563edf0e794d4c67e735b589a1c95f7fce848f6)
@@ -28,5 +28,6 @@
 #include "GenPoly.h"                   // for isPolyType, typesPolyCompatible
 #include "InitTweak/InitTweak.h"
-#include "ResolvExpr/typeops.h"
+#include "ResolvExpr/typeops.h"        // for adjustExprType
+#include "ResolvExpr/Unify.h"          // for typesCompatible
 #include "ScopedSet.h"                 // for ScopedSet, ScopedSet<>::iterator
 #include "ScrubTyVars.h"               // for ScrubTyVars
Index: src/GenPoly/InstantiateGenericNew.cpp
===================================================================
--- src/GenPoly/InstantiateGenericNew.cpp	(revision 9845cb6d529fd96e3423e971fbf240545e90a0c4)
+++ src/GenPoly/InstantiateGenericNew.cpp	(revision e563edf0e794d4c67e735b589a1c95f7fce848f6)
@@ -32,5 +32,6 @@
 #include "GenPoly/GenPoly.h"           // for isPolyType, typesPolyCompatible
 #include "GenPoly/ScrubTyVars.h"       // for scrubAll
-#include "ResolvExpr/typeops.h"        // for typesCompatible
+#include "ResolvExpr/typeops.h"        // for adjustExprType
+#include "ResolvExpr/Unify.h"          // for typesCompatible
 
 namespace GenPoly {
Index: src/InitTweak/FixInit.cc
===================================================================
--- src/InitTweak/FixInit.cc	(revision 9845cb6d529fd96e3423e971fbf240545e90a0c4)
+++ src/InitTweak/FixInit.cc	(revision e563edf0e794d4c67e735b589a1c95f7fce848f6)
@@ -39,5 +39,5 @@
 #include "InitTweak.h"                 // for getFunctionName, getCallArg
 #include "ResolvExpr/Resolver.h"       // for findVoidExpression
-#include "ResolvExpr/typeops.h"        // for typesCompatible
+#include "ResolvExpr/Unify.h"          // for typesCompatible
 #include "SymTab/Autogen.h"            // for genImplicitCall
 #include "SymTab/Indexer.h"            // for Indexer
Index: src/InitTweak/FixInitNew.cpp
===================================================================
--- src/InitTweak/FixInitNew.cpp	(revision 9845cb6d529fd96e3423e971fbf240545e90a0c4)
+++ src/InitTweak/FixInitNew.cpp	(revision e563edf0e794d4c67e735b589a1c95f7fce848f6)
@@ -26,5 +26,5 @@
 #include "GenPoly/GenPoly.h"           // for getFunctionType
 #include "ResolvExpr/Resolver.h"       // for findVoidExpression
-#include "ResolvExpr/typeops.h"        // for typesCompatible
+#include "ResolvExpr/Unify.h"          // for typesCompatible
 #include "SymTab/Autogen.h"            // for genImplicitCall
 #include "SymTab/Indexer.h"            // for Indexer
Index: src/InitTweak/InitTweak.cc
===================================================================
--- src/InitTweak/InitTweak.cc	(revision 9845cb6d529fd96e3423e971fbf240545e90a0c4)
+++ src/InitTweak/InitTweak.cc	(revision e563edf0e794d4c67e735b589a1c95f7fce848f6)
@@ -35,5 +35,5 @@
 #include "GenPoly/GenPoly.h"       // for getFunctionType
 #include "InitTweak.h"
-#include "ResolvExpr/typeops.h"    // for typesCompatibleIgnoreQualifiers
+#include "ResolvExpr/Unify.h"      // for typesCompatibleIgnoreQualifiers
 #include "SymTab/Autogen.h"
 #include "SymTab/Indexer.h"        // for Indexer
Index: src/ResolvExpr/CastCost.cc
===================================================================
--- src/ResolvExpr/CastCost.cc	(revision 9845cb6d529fd96e3423e971fbf240545e90a0c4)
+++ 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 9845cb6d529fd96e3423e971fbf240545e90a0c4)
+++ 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 9845cb6d529fd96e3423e971fbf240545e90a0c4)
+++ 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 9845cb6d529fd96e3423e971fbf240545e90a0c4)
+++ 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.
Index: src/SymTab/Indexer.cc
===================================================================
--- src/SymTab/Indexer.cc	(revision 9845cb6d529fd96e3423e971fbf240545e90a0c4)
+++ src/SymTab/Indexer.cc	(revision e563edf0e794d4c67e735b589a1c95f7fce848f6)
@@ -31,5 +31,6 @@
 #include "InitTweak/InitTweak.h"   // for isConstructor, isCopyFunction, isC...
 #include "Mangler.h"               // for Mangler
-#include "ResolvExpr/typeops.h"    // for typesCompatible
+#include "ResolvExpr/typeops.h"    // for referenceToRvalueConversion
+#include "ResolvExpr/Unify.h"      // for typesCompatible
 #include "SynTree/LinkageSpec.h"   // for isMangled, isOverridable, Spec
 #include "SynTree/Constant.h"      // for Constant
Index: src/SymTab/Validate.cc
===================================================================
--- src/SymTab/Validate.cc	(revision 9845cb6d529fd96e3423e971fbf240545e90a0c4)
+++ src/SymTab/Validate.cc	(revision e563edf0e794d4c67e735b589a1c95f7fce848f6)
@@ -63,5 +63,6 @@
 #include "InitTweak/GenInit.h"         // for fixReturnStatements
 #include "InitTweak/InitTweak.h"       // for isCtorDtorAssign
-#include "ResolvExpr/typeops.h"        // for typesCompatible
+#include "ResolvExpr/typeops.h"        // for extractResultType
+#include "ResolvExpr/Unify.h"          // for typesCompatible
 #include "ResolvExpr/Resolver.h"       // for findSingleExpression
 #include "ResolvExpr/ResolveTypeof.h"  // for resolveTypeof
Index: src/Validate/ReplaceTypedef.cpp
===================================================================
--- src/Validate/ReplaceTypedef.cpp	(revision 9845cb6d529fd96e3423e971fbf240545e90a0c4)
+++ src/Validate/ReplaceTypedef.cpp	(revision e563edf0e794d4c67e735b589a1c95f7fce848f6)
@@ -20,5 +20,5 @@
 #include "Common/UniqueName.h"
 #include "Common/utility.h"
-#include "ResolvExpr/typeops.h"
+#include "ResolvExpr/Unify.h"
 
 namespace Validate {
