Index: src/ResolvExpr/Alternative.cc
===================================================================
--- src/ResolvExpr/Alternative.cc	(revision 97397a26b44bae1c0120193fd3d160297ec1db7a)
+++ src/ResolvExpr/Alternative.cc	(revision b21c77a0e211d9361763565a2eb5ef4330f2957b)
@@ -30,5 +30,5 @@
 
 namespace ResolvExpr {
-	Alternative::Alternative() : cost( Cost::zero ), cvtCost( Cost::zero ), expr( 0 ) {}
+	Alternative::Alternative() : cost( Cost::zero ), cvtCost( Cost::zero ), expr( nullptr ) {}
 
 	Alternative::Alternative( Expression *expr, const TypeEnvironment &env, const Cost& cost )
Index: src/ResolvExpr/AlternativeFinder.cc
===================================================================
--- src/ResolvExpr/AlternativeFinder.cc	(revision 97397a26b44bae1c0120193fd3d160297ec1db7a)
+++ src/ResolvExpr/AlternativeFinder.cc	(revision b21c77a0e211d9361763565a2eb5ef4330f2957b)
@@ -100,4 +100,5 @@
 		void postvisit( InitExpr * initExpr );
 		void postvisit( DeletedExpr * delExpr );
+		void postvisit( GenericExpr * genExpr );
 
 		/// Adds alternatives for anonymous members
@@ -177,8 +178,18 @@
 						selected[ mangleName ] = current;
 					} else if ( candidate->cost == mapPlace->second.candidate->cost ) {
-						PRINT(
-							std::cerr << "marking ambiguous" << std::endl;
-						)
-						mapPlace->second.isAmbiguous = true;
+						// if one of the candidates contains a deleted identifier, can pick the other, since
+						// deleted expressions should not be ambiguous if there is another option that is at least as good
+						if ( findDeletedExpr( candidate->expr ) ) {
+							// do nothing
+							PRINT( std::cerr << "candidate is deleted" << std::endl; )
+						} else if ( findDeletedExpr( mapPlace->second.candidate->expr ) ) {
+							PRINT( std::cerr << "current is deleted" << std::endl; )
+							selected[ mangleName ] = current;
+						} else {
+							PRINT(
+								std::cerr << "marking ambiguous" << std::endl;
+							)
+							mapPlace->second.isAmbiguous = true;
+						}
 					} else {
 						PRINT(
@@ -300,6 +311,6 @@
 		// it's okay for the aggregate expression to have reference type -- cast it to the base type to treat the aggregate as the referenced value
 		Expression* aggrExpr = alt.expr->clone();
-		alt.env.apply( aggrExpr->get_result() );
-		Type * aggrType = aggrExpr->get_result();
+		alt.env.apply( aggrExpr->result );
+		Type * aggrType = aggrExpr->result;
 		if ( dynamic_cast< ReferenceType * >( aggrType ) ) {
 			aggrType = aggrType->stripReferences();
@@ -307,7 +318,7 @@
 		}
 
-		if ( StructInstType *structInst = dynamic_cast< StructInstType* >( aggrExpr->get_result() ) ) {
+		if ( StructInstType *structInst = dynamic_cast< StructInstType* >( aggrExpr->result ) ) {
 			addAggMembers( structInst, aggrExpr, alt.cost+Cost::safe, alt.env, "" );
-		} else if ( UnionInstType *unionInst = dynamic_cast< UnionInstType* >( aggrExpr->get_result() ) ) {
+		} else if ( UnionInstType *unionInst = dynamic_cast< UnionInstType* >( aggrExpr->result ) ) {
 			addAggMembers( unionInst, aggrExpr, alt.cost+Cost::safe, alt.env, "" );
 		} // if
@@ -319,9 +330,12 @@
 		aggInst->lookup( name, members );
 
-		for ( std::list< Declaration* >::const_iterator i = members.begin(); i != members.end(); ++i ) {
-			if ( DeclarationWithType *dwt = dynamic_cast< DeclarationWithType* >( *i ) ) {
-				alternatives.push_back( Alternative( new MemberExpr( dwt, expr->clone() ), env, newCost ) );
-				renameTypes( alternatives.back().expr );
-				addAnonConversions( alternatives.back() ); // add anonymous member interpretations whenever an aggregate value type is seen as a member expression.
+		for ( Declaration * decl : members ) {
+			if ( DeclarationWithType *dwt = dynamic_cast< DeclarationWithType* >( decl ) ) {
+				// addAnonAlternatives uses vector::push_back, which invalidates references to existing elements, so
+				// can't construct in place and use vector::back
+				Alternative newAlt( new MemberExpr( dwt, expr->clone() ), env, newCost );
+				renameTypes( newAlt.expr );
+				addAnonConversions( newAlt ); // add anonymous member interpretations whenever an aggregate value type is seen as a member expression.
+				alternatives.push_back( std::move(newAlt) );
 			} else {
 				assert( false );
@@ -333,22 +347,9 @@
 		if ( ConstantExpr * constantExpr = dynamic_cast< ConstantExpr * >( member ) ) {
 			// get the value of the constant expression as an int, must be between 0 and the length of the tuple type to have meaning
-			// xxx - this should be improved by memoizing the value of constant exprs
-			// during parsing and reusing that information here.
-			std::stringstream ss( constantExpr->get_constant()->get_value() );
-			int val = 0;
+			auto val = constantExpr->intValue();
 			std::string tmp;
-			if ( ss >> val && ! (ss >> tmp) ) {
-				if ( val >= 0 && (unsigned int)val < tupleType->size() ) {
-					alternatives.push_back( Alternative( new TupleIndexExpr( expr, val ), env, newCost ) );
-				} // if
+			if ( val >= 0 && (unsigned long long)val < tupleType->size() ) {
+				alternatives.push_back( Alternative( new TupleIndexExpr( expr->clone(), val ), env, newCost ) );
 			} // if
-		} else if ( NameExpr * nameExpr = dynamic_cast< NameExpr * >( member ) ) {
-			// xxx - temporary hack until 0/1 are int constants
-			if ( nameExpr->get_name() == "0" || nameExpr->get_name() == "1" ) {
-				std::stringstream ss( nameExpr->get_name() );
-				int val;
-				ss >> val;
-				alternatives.push_back( Alternative( new TupleIndexExpr( expr, val ), env, newCost ) );
-			}
 		} // if
 	}
@@ -437,4 +438,11 @@
 					return Cost::infinity;
 				}
+			}
+			if ( DefaultArgExpr * def = dynamic_cast< DefaultArgExpr * >( *actualExpr ) ) {
+				// default arguments should be free - don't include conversion cost.
+				// Unwrap them here because they are not relevant to the rest of the system.
+				*actualExpr = def->expr;
+				++formal;
+				continue;
 			}
 			Type * formalType = (*formal)->get_type();
@@ -764,6 +772,8 @@
 	ConstantExpr* getDefaultValue( Initializer* init ) {
 		if ( SingleInit* si = dynamic_cast<SingleInit*>( init ) ) {
-			if ( CastExpr* ce = dynamic_cast<CastExpr*>( si->get_value() ) ) {
-				return dynamic_cast<ConstantExpr*>( ce->get_arg() );
+			if ( CastExpr* ce = dynamic_cast<CastExpr*>( si->value ) ) {
+				return dynamic_cast<ConstantExpr*>( ce->arg );
+			} else {
+				return dynamic_cast<ConstantExpr*>( si->value );
 			}
 		}
@@ -1026,5 +1036,5 @@
 								indexer ) ) {
 							results.emplace_back(
-								i, cnstExpr, move(env), move(need), move(have),
+								i, new DefaultArgExpr( cnstExpr ), move(env), move(need), move(have),
 								move(openVars), nextArg, nTuples );
 						}
@@ -1359,4 +1369,5 @@
 		funcFinder.findWithAdjustment( untypedExpr->function );
 		// if there are no function alternatives, then proceeding is a waste of time.
+		// xxx - findWithAdjustment throws, so this check and others like it shouldn't be necessary.
 		if ( funcFinder.alternatives.empty() ) return;
 
@@ -1386,5 +1397,5 @@
 			argExpansions.emplace_back();
 			auto& argE = argExpansions.back();
-			argE.reserve( arg.alternatives.size() );
+			// argE.reserve( arg.alternatives.size() );
 
 			for ( const Alternative& actual : arg ) {
@@ -1409,6 +1420,6 @@
 							std::back_inserter( candidates ) );
 					}
-				} else if ( TypeInstType *typeInst = dynamic_cast< TypeInstType* >( func->expr->get_result()->stripReferences() ) ) { // handle ftype (e.g. *? on function pointer)
-					if ( ClassRef eqvClass = func->env.lookup( typeInst->get_name() ) ) {
+				} else if ( TypeInstType *typeInst = dynamic_cast< TypeInstType* >( func->expr->result->stripReferences() ) ) { // handle ftype (e.g. *? on function pointer)
+					if ( ClassRef eqvClass = func->env.lookup( typeInst->name ) ) {
 						if ( FunctionType *function = dynamic_cast< FunctionType* >( eqvClass.get_bound().type ) ) {
 							Alternative newFunc( *func );
@@ -1665,5 +1676,8 @@
 			Cost cost = Cost::zero;
 			Expression * newExpr = data.combine( cost );
-			alternatives.push_back( Alternative( newExpr, env, Cost::zero, cost ) );
+
+			// addAnonAlternatives uses vector::push_back, which invalidates references to existing elements, so
+			// can't construct in place and use vector::back
+			Alternative newAlt( newExpr, env, Cost::zero, cost );
 			PRINT(
 				std::cerr << "decl is ";
@@ -1674,6 +1688,7 @@
 				std::cerr << std::endl;
 			)
-			renameTypes( alternatives.back().expr );
-			addAnonConversions( alternatives.back() ); // add anonymous member interpretations whenever an aggregate value type is seen as a name expression.
+			renameTypes( newAlt.expr );
+			addAnonConversions( newAlt ); // add anonymous member interpretations whenever an aggregate value type is seen as a name expression.
+			alternatives.push_back( std::move(newAlt) );
 		} // for
 	}
@@ -2042,4 +2057,8 @@
 		assertf( false, "AlternativeFinder should never see a DeletedExpr." );
 	}
+
+	void AlternativeFinder::Finder::postvisit( GenericExpr * ) {
+		assertf( false, "_Generic is not yet supported." );
+	}
 } // namespace ResolvExpr
 
Index: src/ResolvExpr/CommonType.cc
===================================================================
--- src/ResolvExpr/CommonType.cc	(revision 97397a26b44bae1c0120193fd3d160297ec1db7a)
+++ src/ResolvExpr/CommonType.cc	(revision b21c77a0e211d9361763565a2eb5ef4330f2957b)
@@ -24,5 +24,5 @@
 #include "SynTree/Type.h"                // for BasicType, BasicType::Kind::...
 #include "SynTree/Visitor.h"             // for Visitor
-#include "Unify.h"                       // for unifyExact, bindVar, WidenMode
+#include "Unify.h"                       // for unifyExact, WidenMode
 #include "typeops.h"                     // for isFtype
 
@@ -176,31 +176,37 @@
 	}
 
-	static const BasicType::Kind combinedType[ BasicType::NUMBER_OF_BASIC_TYPES ][ BasicType::NUMBER_OF_BASIC_TYPES ] =
+	static const BasicType::Kind combinedType[][ BasicType::NUMBER_OF_BASIC_TYPES ] =
 	{
-/* 		Bool		Char	SignedChar	UnsignedChar	ShortSignedInt	ShortUnsignedInt	SignedInt	UnsignedInt	LongSignedInt	LongUnsignedInt	LongLongSignedInt	LongLongUnsignedInt	Float	Double	LongDouble	FloatComplex	DoubleComplex	LongDoubleComplex	FloatImaginary	DoubleImaginary	LongDoubleImaginary   SignedInt128   UnsignedInt128 */
-		/* Bool */ 	{ BasicType::Bool,		BasicType::Char,	BasicType::SignedChar,	BasicType::UnsignedChar,	BasicType::ShortSignedInt,	BasicType::ShortUnsignedInt,	BasicType::SignedInt,	BasicType::UnsignedInt,	BasicType::LongSignedInt,	BasicType::LongUnsignedInt,	BasicType::LongLongSignedInt,	BasicType::LongLongUnsignedInt,	BasicType::Float,	BasicType::Double,	BasicType::LongDouble,	BasicType::FloatComplex,	BasicType::DoubleComplex,	BasicType::LongDoubleComplex,	BasicType::FloatComplex,	BasicType::DoubleComplex,	BasicType::LongDoubleComplex,	BasicType::SignedInt128,	BasicType::UnsignedInt128, },
-		/* Char */ 	{ BasicType::Char,		BasicType::Char,	BasicType::UnsignedChar,	BasicType::UnsignedChar,	BasicType::ShortSignedInt,	BasicType::ShortUnsignedInt,	BasicType::SignedInt,	BasicType::UnsignedInt,	BasicType::LongSignedInt,	BasicType::LongUnsignedInt,	BasicType::LongLongSignedInt,	BasicType::LongLongUnsignedInt,	BasicType::Float,	BasicType::Double,	BasicType::LongDouble,	BasicType::FloatComplex,	BasicType::DoubleComplex,	BasicType::LongDoubleComplex,	BasicType::FloatComplex,	BasicType::DoubleComplex,	BasicType::LongDoubleComplex,	BasicType::SignedInt128,	BasicType::UnsignedInt128, },
-		/* SignedChar */ 	{ BasicType::SignedChar,	BasicType::UnsignedChar,	BasicType::SignedChar,	BasicType::UnsignedChar,	BasicType::ShortSignedInt,	BasicType::ShortUnsignedInt,	BasicType::SignedInt,	BasicType::UnsignedInt,	BasicType::LongSignedInt,	BasicType::LongUnsignedInt,	BasicType::LongLongSignedInt,	BasicType::LongLongUnsignedInt,	BasicType::Float,	BasicType::Double,	BasicType::LongDouble,	BasicType::FloatComplex,	BasicType::DoubleComplex,	BasicType::LongDoubleComplex,	BasicType::FloatComplex,	BasicType::DoubleComplex,	BasicType::LongDoubleComplex,	BasicType::SignedInt128,	BasicType::UnsignedInt128, },
-		/* UnsignedChar */ 	{ BasicType::UnsignedChar,	BasicType::UnsignedChar,	BasicType::UnsignedChar,	BasicType::UnsignedChar,	BasicType::ShortSignedInt,	BasicType::ShortUnsignedInt,	BasicType::SignedInt,	BasicType::UnsignedInt,	BasicType::LongSignedInt,	BasicType::LongUnsignedInt,	BasicType::LongLongSignedInt,	BasicType::LongLongUnsignedInt,	BasicType::Float,	BasicType::Double,	BasicType::LongDouble,	BasicType::FloatComplex,	BasicType::DoubleComplex,	BasicType::LongDoubleComplex,	BasicType::FloatComplex,	BasicType::DoubleComplex,	BasicType::LongDoubleComplex,	BasicType::SignedInt128,	BasicType::UnsignedInt128, },
-		/* ShortSignedInt */ 	{ BasicType::ShortSignedInt,	BasicType::ShortSignedInt,	BasicType::ShortSignedInt,	BasicType::ShortSignedInt,	BasicType::ShortSignedInt,	BasicType::ShortUnsignedInt,	BasicType::SignedInt,	BasicType::UnsignedInt,	BasicType::LongSignedInt,	BasicType::LongUnsignedInt,	BasicType::LongLongSignedInt,	BasicType::LongLongUnsignedInt,	BasicType::Float,	BasicType::Double,	BasicType::LongDouble,	BasicType::FloatComplex,	BasicType::DoubleComplex,	BasicType::LongDoubleComplex,	BasicType::FloatComplex,	BasicType::DoubleComplex,	BasicType::LongDoubleComplex,	BasicType::SignedInt128,	BasicType::UnsignedInt128, },
-		/* ShortUnsignedInt */ 	{ BasicType::ShortUnsignedInt,	BasicType::ShortUnsignedInt,	BasicType::ShortUnsignedInt,	BasicType::ShortUnsignedInt,	BasicType::ShortUnsignedInt,	BasicType::ShortUnsignedInt,	BasicType::SignedInt,	BasicType::UnsignedInt,	BasicType::LongSignedInt,	BasicType::LongUnsignedInt,	BasicType::LongLongSignedInt,	BasicType::LongLongUnsignedInt,	BasicType::Float,	BasicType::Double,	BasicType::LongDouble,	BasicType::FloatComplex,	BasicType::DoubleComplex,	BasicType::LongDoubleComplex,	BasicType::FloatComplex,	BasicType::DoubleComplex,	BasicType::LongDoubleComplex,	BasicType::SignedInt128,	BasicType::UnsignedInt128, },
-		/* SignedInt */ 	{ BasicType::SignedInt,		BasicType::SignedInt,	BasicType::SignedInt,	BasicType::SignedInt,	BasicType::SignedInt,	BasicType::SignedInt,	BasicType::SignedInt,	BasicType::UnsignedInt,	BasicType::LongSignedInt,	BasicType::LongUnsignedInt,	BasicType::LongLongSignedInt,	BasicType::LongLongUnsignedInt,	BasicType::Float,	BasicType::Double,	BasicType::LongDouble,	BasicType::FloatComplex,	BasicType::DoubleComplex,	BasicType::LongDoubleComplex,	BasicType::FloatComplex,	BasicType::DoubleComplex,	BasicType::LongDoubleComplex,	BasicType::SignedInt128,	BasicType::UnsignedInt128, },
-		/* UnsignedInt */ 	{ BasicType::UnsignedInt,		BasicType::UnsignedInt,	BasicType::UnsignedInt,	BasicType::UnsignedInt,	BasicType::UnsignedInt,	BasicType::UnsignedInt,	BasicType::UnsignedInt,	BasicType::UnsignedInt,	BasicType::LongUnsignedInt,	BasicType::LongUnsignedInt,	BasicType::LongLongSignedInt,	BasicType::LongLongUnsignedInt,	BasicType::Float,	BasicType::Double,	BasicType::LongDouble,	BasicType::FloatComplex,	BasicType::DoubleComplex,	BasicType::LongDoubleComplex,	BasicType::FloatComplex,	BasicType::DoubleComplex,	BasicType::LongDoubleComplex,	BasicType::SignedInt128,	BasicType::UnsignedInt128, },
-		/* LongSignedInt */ 	{ BasicType::LongSignedInt,		BasicType::LongSignedInt,	BasicType::LongSignedInt,	BasicType::LongSignedInt,	BasicType::LongSignedInt,	BasicType::LongSignedInt,	BasicType::LongSignedInt,	BasicType::LongUnsignedInt,	BasicType::LongSignedInt,	BasicType::LongUnsignedInt,	BasicType::LongLongSignedInt,	BasicType::LongLongUnsignedInt,	BasicType::Float,	BasicType::Double,	BasicType::LongDouble,	BasicType::FloatComplex,	BasicType::DoubleComplex,	BasicType::LongDoubleComplex,	BasicType::FloatComplex,	BasicType::DoubleComplex,	BasicType::LongDoubleComplex,	BasicType::SignedInt128,	BasicType::UnsignedInt128, },
-		/* LongUnsignedInt */ 	{ BasicType::LongUnsignedInt,	BasicType::LongUnsignedInt,	BasicType::LongUnsignedInt,	BasicType::LongUnsignedInt,	BasicType::LongUnsignedInt,	BasicType::LongUnsignedInt,	BasicType::LongUnsignedInt,	BasicType::LongUnsignedInt,	BasicType::LongUnsignedInt,	BasicType::LongUnsignedInt,	BasicType::LongLongSignedInt,	BasicType::LongLongUnsignedInt,	BasicType::Float,	BasicType::Double,	BasicType::LongDouble,	BasicType::FloatComplex,	BasicType::DoubleComplex,	BasicType::LongDoubleComplex,	BasicType::FloatComplex,	BasicType::DoubleComplex,	BasicType::LongDoubleComplex,	BasicType::SignedInt128,	BasicType::UnsignedInt128, },
-		/* LongLongSignedInt */ 	{ BasicType::LongLongSignedInt,	BasicType::LongLongSignedInt,	BasicType::LongLongSignedInt,	BasicType::LongLongSignedInt,	BasicType::LongLongSignedInt,	BasicType::LongLongSignedInt,	BasicType::LongLongSignedInt,	BasicType::LongLongSignedInt,	BasicType::LongLongSignedInt,	BasicType::LongLongSignedInt,	BasicType::LongLongSignedInt,	BasicType::LongLongUnsignedInt,	BasicType::Float,	BasicType::Double,	BasicType::LongDouble,	BasicType::FloatComplex,	BasicType::DoubleComplex,	BasicType::LongDoubleComplex,	BasicType::FloatComplex,	BasicType::DoubleComplex,	BasicType::LongDoubleComplex,	BasicType::SignedInt128,	BasicType::UnsignedInt128, },
-		/* LongLongUnsignedInt */ 	{ BasicType::LongLongUnsignedInt,	BasicType::LongLongUnsignedInt,	BasicType::LongLongUnsignedInt,	BasicType::LongLongUnsignedInt,	BasicType::LongLongUnsignedInt,	BasicType::LongLongUnsignedInt,	BasicType::LongLongUnsignedInt,	BasicType::LongLongUnsignedInt,	BasicType::LongLongUnsignedInt,	BasicType::LongLongUnsignedInt,	BasicType::LongLongUnsignedInt,	BasicType::LongLongUnsignedInt,	BasicType::Float,	BasicType::Double,	BasicType::LongDouble,	BasicType::FloatComplex,	BasicType::DoubleComplex,	BasicType::LongDoubleComplex,	BasicType::FloatComplex,	BasicType::DoubleComplex,	BasicType::LongDoubleComplex,	BasicType::SignedInt128,	BasicType::UnsignedInt128, },
-		/* Float */ 	{ BasicType::Float,	BasicType::Float,	BasicType::Float,	BasicType::Float,	BasicType::Float,	BasicType::Float,	BasicType::Float,	BasicType::Float,	BasicType::Float,	BasicType::Float,	BasicType::Float,	BasicType::Float,	BasicType::Float,	BasicType::Double,	BasicType::LongDouble,	BasicType::FloatComplex,	BasicType::DoubleComplex,	BasicType::LongDoubleComplex,	BasicType::FloatComplex,	BasicType::DoubleComplex,	BasicType::LongDoubleComplex,	BasicType::Float,	BasicType::Float, },
-		/* Double */ 	{ BasicType::Double,	BasicType::Double,	BasicType::Double,	BasicType::Double,	BasicType::Double,	BasicType::Double,	BasicType::Double,	BasicType::Double,	BasicType::Double,	BasicType::Double,	BasicType::Double,	BasicType::Double,	BasicType::Double,	BasicType::Double,	BasicType::LongDouble,	BasicType::DoubleComplex,	BasicType::DoubleComplex,	BasicType::LongDoubleComplex,	BasicType::DoubleComplex,	BasicType::DoubleComplex,	BasicType::LongDoubleComplex,	BasicType::Double,	BasicType::Double, },
-		/* LongDouble */ 	{ BasicType::LongDouble,		BasicType::LongDouble,	BasicType::LongDouble,	BasicType::LongDouble,	BasicType::LongDouble,	BasicType::LongDouble,	BasicType::LongDouble,	BasicType::LongDouble,	BasicType::LongDouble,	BasicType::LongDouble,	BasicType::LongDouble,	BasicType::LongDouble,	BasicType::LongDouble,	BasicType::LongDouble,	BasicType::LongDouble,	BasicType::LongDoubleComplex,	BasicType::LongDoubleComplex,	BasicType::LongDoubleComplex,	BasicType::LongDoubleComplex,	BasicType::LongDoubleComplex,	BasicType::LongDoubleComplex,	BasicType::LongDouble,	BasicType::LongDouble, },
-		/* FloatComplex */ 	{ BasicType::FloatComplex,	BasicType::FloatComplex,	BasicType::FloatComplex,	BasicType::FloatComplex,	BasicType::FloatComplex,	BasicType::FloatComplex,	BasicType::FloatComplex,	BasicType::FloatComplex,	BasicType::FloatComplex,	BasicType::FloatComplex,	BasicType::FloatComplex,	BasicType::FloatComplex,	BasicType::FloatComplex,	BasicType::DoubleComplex,	BasicType::LongDoubleComplex,	BasicType::FloatComplex,	BasicType::DoubleComplex,	BasicType::LongDoubleComplex,	BasicType::FloatComplex,	BasicType::DoubleComplex,	BasicType::LongDoubleComplex,	BasicType::FloatComplex,	BasicType::FloatComplex, },
-		/* DoubleComplex */ 	{ BasicType::DoubleComplex,	BasicType::DoubleComplex,	BasicType::DoubleComplex,	BasicType::DoubleComplex,	BasicType::DoubleComplex,	BasicType::DoubleComplex,	BasicType::DoubleComplex,	BasicType::DoubleComplex,	BasicType::DoubleComplex,	BasicType::DoubleComplex,	BasicType::DoubleComplex,	BasicType::DoubleComplex,	BasicType::DoubleComplex,	BasicType::DoubleComplex,	BasicType::LongDoubleComplex,	BasicType::DoubleComplex,	BasicType::DoubleComplex,	BasicType::LongDoubleComplex,	BasicType::DoubleComplex,	BasicType::DoubleComplex,	BasicType::LongDoubleComplex,	BasicType::DoubleComplex,	BasicType::DoubleComplex, },
-		/* LongDoubleComplex */ 	{ BasicType::LongDoubleComplex,	BasicType::LongDoubleComplex,	BasicType::LongDoubleComplex,	BasicType::LongDoubleComplex,	BasicType::LongDoubleComplex,	BasicType::LongDoubleComplex,	BasicType::LongDoubleComplex,	BasicType::LongDoubleComplex,	BasicType::LongDoubleComplex,	BasicType::LongDoubleComplex,	BasicType::LongDoubleComplex,	BasicType::LongDoubleComplex,	BasicType::LongDoubleComplex,	BasicType::LongDoubleComplex,	BasicType::LongDoubleComplex,	BasicType::LongDoubleComplex,	BasicType::LongDoubleComplex,	BasicType::LongDoubleComplex,	BasicType::LongDoubleComplex,	BasicType::LongDoubleComplex,	BasicType::LongDoubleComplex,	BasicType::LongDoubleComplex,	BasicType::LongDoubleComplex, },
-		/* FloatImaginary */ 	{ BasicType::FloatComplex,	BasicType::FloatComplex,	BasicType::FloatComplex,	BasicType::FloatComplex,	BasicType::FloatComplex,	BasicType::FloatComplex,	BasicType::FloatComplex,	BasicType::FloatComplex,	BasicType::FloatComplex,	BasicType::FloatComplex,	BasicType::FloatComplex,	BasicType::FloatComplex,	BasicType::FloatComplex,	BasicType::DoubleComplex,	BasicType::LongDoubleComplex,	BasicType::FloatComplex,	BasicType::DoubleComplex,	BasicType::LongDoubleComplex,	BasicType::FloatImaginary,	BasicType::DoubleImaginary,	BasicType::LongDoubleImaginary,	BasicType::FloatImaginary,	BasicType::FloatImaginary, },
-		/* DoubleImaginary */ 	{ BasicType::DoubleComplex,	BasicType::DoubleComplex,	BasicType::DoubleComplex,	BasicType::DoubleComplex,	BasicType::DoubleComplex,	BasicType::DoubleComplex,	BasicType::DoubleComplex,	BasicType::DoubleComplex,	BasicType::DoubleComplex,	BasicType::DoubleComplex,	BasicType::DoubleComplex,	BasicType::DoubleComplex,	BasicType::DoubleComplex,	BasicType::DoubleComplex,	BasicType::LongDoubleComplex,	BasicType::DoubleComplex,	BasicType::DoubleComplex,	BasicType::LongDoubleComplex,	BasicType::DoubleImaginary,	BasicType::DoubleImaginary,	BasicType::LongDoubleImaginary,	BasicType::DoubleImaginary,	BasicType::DoubleImaginary, },
-		/* LongDoubleImaginary */ 	{ BasicType::LongDoubleComplex,	BasicType::LongDoubleComplex,	BasicType::LongDoubleComplex,	BasicType::LongDoubleComplex,	BasicType::LongDoubleComplex,	BasicType::LongDoubleComplex,	BasicType::LongDoubleComplex,	BasicType::LongDoubleComplex,	BasicType::LongDoubleComplex,	BasicType::LongDoubleComplex,	BasicType::LongDoubleComplex,	BasicType::LongDoubleComplex,	BasicType::LongDoubleComplex,	BasicType::LongDoubleComplex,	BasicType::LongDoubleComplex,	BasicType::LongDoubleComplex,	BasicType::LongDoubleComplex,	BasicType::LongDoubleComplex,	BasicType::LongDoubleImaginary,	BasicType::LongDoubleImaginary,	BasicType::LongDoubleImaginary },
-		/* SignedInt128 */ 	{ BasicType::SignedInt128,	BasicType::SignedInt128,	BasicType::SignedInt128,	BasicType::SignedInt128,	BasicType::SignedInt128,	BasicType::SignedInt128,	BasicType::SignedInt128,	BasicType::SignedInt128,	BasicType::SignedInt128,	BasicType::SignedInt128,	BasicType::SignedInt128,	BasicType::SignedInt128,	BasicType::Float,	BasicType::Double,	BasicType::LongDouble,	BasicType::FloatComplex,	BasicType::DoubleComplex,	BasicType::LongDoubleComplex,	BasicType::FloatComplex,	BasicType::DoubleComplex,	BasicType::LongDoubleComplex,	BasicType::SignedInt128,	BasicType::UnsignedInt128, },
-		/* UnsignedInt128 */ 	{ BasicType::UnsignedInt128,	BasicType::UnsignedInt128,	BasicType::UnsignedInt128,	BasicType::UnsignedInt128,	BasicType::UnsignedInt128,	BasicType::UnsignedInt128,	BasicType::UnsignedInt128,	BasicType::UnsignedInt128,	BasicType::UnsignedInt128,	BasicType::UnsignedInt128,	BasicType::UnsignedInt128,	BasicType::UnsignedInt128,	BasicType::Float,	BasicType::Double,	BasicType::LongDouble,	BasicType::FloatComplex,	BasicType::DoubleComplex,	BasicType::LongDoubleComplex,	BasicType::FloatComplex,	BasicType::DoubleComplex,	BasicType::LongDoubleComplex,	BasicType::UnsignedInt128,	BasicType::UnsignedInt128, },
+/* 		Bool		Char	SignedChar	UnsignedChar	ShortSignedInt	ShortUnsignedInt	SignedInt	UnsignedInt	LongSignedInt	LongUnsignedInt	LongLongSignedInt	LongLongUnsignedInt	Float	Double	LongDouble	FloatComplex	DoubleComplex	LongDoubleComplex	FloatImaginary	DoubleImaginary	LongDoubleImaginary   SignedInt128   UnsignedInt128   Float80   Float128 */
+		/* Bool */ 	{ BasicType::Bool,		BasicType::Char,	BasicType::SignedChar,	BasicType::UnsignedChar,	BasicType::ShortSignedInt,	BasicType::ShortUnsignedInt,	BasicType::SignedInt,	BasicType::UnsignedInt,	BasicType::LongSignedInt,	BasicType::LongUnsignedInt,	BasicType::LongLongSignedInt,	BasicType::LongLongUnsignedInt,	BasicType::Float,	BasicType::Double,	BasicType::LongDouble,	BasicType::FloatComplex,	BasicType::DoubleComplex,	BasicType::LongDoubleComplex,	BasicType::FloatComplex,	BasicType::DoubleComplex,	BasicType::LongDoubleComplex,	BasicType::SignedInt128,	BasicType::UnsignedInt128, BasicType::Float80, BasicType::Float128 },
+		/* Char */ 	{ BasicType::Char,		BasicType::Char,	BasicType::UnsignedChar,	BasicType::UnsignedChar,	BasicType::ShortSignedInt,	BasicType::ShortUnsignedInt,	BasicType::SignedInt,	BasicType::UnsignedInt,	BasicType::LongSignedInt,	BasicType::LongUnsignedInt,	BasicType::LongLongSignedInt,	BasicType::LongLongUnsignedInt,	BasicType::Float,	BasicType::Double,	BasicType::LongDouble,	BasicType::FloatComplex,	BasicType::DoubleComplex,	BasicType::LongDoubleComplex,	BasicType::FloatComplex,	BasicType::DoubleComplex,	BasicType::LongDoubleComplex,	BasicType::SignedInt128,	BasicType::UnsignedInt128, BasicType::Float80, BasicType::Float128 },
+		/* SignedChar */ 	{ BasicType::SignedChar,	BasicType::UnsignedChar,	BasicType::SignedChar,	BasicType::UnsignedChar,	BasicType::ShortSignedInt,	BasicType::ShortUnsignedInt,	BasicType::SignedInt,	BasicType::UnsignedInt,	BasicType::LongSignedInt,	BasicType::LongUnsignedInt,	BasicType::LongLongSignedInt,	BasicType::LongLongUnsignedInt,	BasicType::Float,	BasicType::Double,	BasicType::LongDouble,	BasicType::FloatComplex,	BasicType::DoubleComplex,	BasicType::LongDoubleComplex,	BasicType::FloatComplex,	BasicType::DoubleComplex,	BasicType::LongDoubleComplex,	BasicType::SignedInt128,	BasicType::UnsignedInt128, BasicType::Float80, BasicType::Float128 },
+		/* UnsignedChar */ 	{ BasicType::UnsignedChar,	BasicType::UnsignedChar,	BasicType::UnsignedChar,	BasicType::UnsignedChar,	BasicType::ShortSignedInt,	BasicType::ShortUnsignedInt,	BasicType::SignedInt,	BasicType::UnsignedInt,	BasicType::LongSignedInt,	BasicType::LongUnsignedInt,	BasicType::LongLongSignedInt,	BasicType::LongLongUnsignedInt,	BasicType::Float,	BasicType::Double,	BasicType::LongDouble,	BasicType::FloatComplex,	BasicType::DoubleComplex,	BasicType::LongDoubleComplex,	BasicType::FloatComplex,	BasicType::DoubleComplex,	BasicType::LongDoubleComplex,	BasicType::SignedInt128,	BasicType::UnsignedInt128, BasicType::Float80, BasicType::Float128 },
+		/* ShortSignedInt */ 	{ BasicType::ShortSignedInt,	BasicType::ShortSignedInt,	BasicType::ShortSignedInt,	BasicType::ShortSignedInt,	BasicType::ShortSignedInt,	BasicType::ShortUnsignedInt,	BasicType::SignedInt,	BasicType::UnsignedInt,	BasicType::LongSignedInt,	BasicType::LongUnsignedInt,	BasicType::LongLongSignedInt,	BasicType::LongLongUnsignedInt,	BasicType::Float,	BasicType::Double,	BasicType::LongDouble,	BasicType::FloatComplex,	BasicType::DoubleComplex,	BasicType::LongDoubleComplex,	BasicType::FloatComplex,	BasicType::DoubleComplex,	BasicType::LongDoubleComplex,	BasicType::SignedInt128,	BasicType::UnsignedInt128, BasicType::Float80, BasicType::Float128 },
+		/* ShortUnsignedInt */ 	{ BasicType::ShortUnsignedInt,	BasicType::ShortUnsignedInt,	BasicType::ShortUnsignedInt,	BasicType::ShortUnsignedInt,	BasicType::ShortUnsignedInt,	BasicType::ShortUnsignedInt,	BasicType::SignedInt,	BasicType::UnsignedInt,	BasicType::LongSignedInt,	BasicType::LongUnsignedInt,	BasicType::LongLongSignedInt,	BasicType::LongLongUnsignedInt,	BasicType::Float,	BasicType::Double,	BasicType::LongDouble,	BasicType::FloatComplex,	BasicType::DoubleComplex,	BasicType::LongDoubleComplex,	BasicType::FloatComplex,	BasicType::DoubleComplex,	BasicType::LongDoubleComplex,	BasicType::SignedInt128,	BasicType::UnsignedInt128, BasicType::Float80, BasicType::Float128 },
+		/* SignedInt */ 	{ BasicType::SignedInt,		BasicType::SignedInt,	BasicType::SignedInt,	BasicType::SignedInt,	BasicType::SignedInt,	BasicType::SignedInt,	BasicType::SignedInt,	BasicType::UnsignedInt,	BasicType::LongSignedInt,	BasicType::LongUnsignedInt,	BasicType::LongLongSignedInt,	BasicType::LongLongUnsignedInt,	BasicType::Float,	BasicType::Double,	BasicType::LongDouble,	BasicType::FloatComplex,	BasicType::DoubleComplex,	BasicType::LongDoubleComplex,	BasicType::FloatComplex,	BasicType::DoubleComplex,	BasicType::LongDoubleComplex,	BasicType::SignedInt128,	BasicType::UnsignedInt128, BasicType::Float80, BasicType::Float128 },
+		/* UnsignedInt */ 	{ BasicType::UnsignedInt,		BasicType::UnsignedInt,	BasicType::UnsignedInt,	BasicType::UnsignedInt,	BasicType::UnsignedInt,	BasicType::UnsignedInt,	BasicType::UnsignedInt,	BasicType::UnsignedInt,	BasicType::LongUnsignedInt,	BasicType::LongUnsignedInt,	BasicType::LongLongSignedInt,	BasicType::LongLongUnsignedInt,	BasicType::Float,	BasicType::Double,	BasicType::LongDouble,	BasicType::FloatComplex,	BasicType::DoubleComplex,	BasicType::LongDoubleComplex,	BasicType::FloatComplex,	BasicType::DoubleComplex,	BasicType::LongDoubleComplex,	BasicType::SignedInt128,	BasicType::UnsignedInt128, BasicType::Float80, BasicType::Float128 },
+		/* LongSignedInt */ 	{ BasicType::LongSignedInt,		BasicType::LongSignedInt,	BasicType::LongSignedInt,	BasicType::LongSignedInt,	BasicType::LongSignedInt,	BasicType::LongSignedInt,	BasicType::LongSignedInt,	BasicType::LongUnsignedInt,	BasicType::LongSignedInt,	BasicType::LongUnsignedInt,	BasicType::LongLongSignedInt,	BasicType::LongLongUnsignedInt,	BasicType::Float,	BasicType::Double,	BasicType::LongDouble,	BasicType::FloatComplex,	BasicType::DoubleComplex,	BasicType::LongDoubleComplex,	BasicType::FloatComplex,	BasicType::DoubleComplex,	BasicType::LongDoubleComplex,	BasicType::SignedInt128,	BasicType::UnsignedInt128, BasicType::Float80, BasicType::Float128 },
+		/* LongUnsignedInt */ 	{ BasicType::LongUnsignedInt,	BasicType::LongUnsignedInt,	BasicType::LongUnsignedInt,	BasicType::LongUnsignedInt,	BasicType::LongUnsignedInt,	BasicType::LongUnsignedInt,	BasicType::LongUnsignedInt,	BasicType::LongUnsignedInt,	BasicType::LongUnsignedInt,	BasicType::LongUnsignedInt,	BasicType::LongLongSignedInt,	BasicType::LongLongUnsignedInt,	BasicType::Float,	BasicType::Double,	BasicType::LongDouble,	BasicType::FloatComplex,	BasicType::DoubleComplex,	BasicType::LongDoubleComplex,	BasicType::FloatComplex,	BasicType::DoubleComplex,	BasicType::LongDoubleComplex,	BasicType::SignedInt128,	BasicType::UnsignedInt128, BasicType::Float80, BasicType::Float128 },
+		/* LongLongSignedInt */ 	{ BasicType::LongLongSignedInt,	BasicType::LongLongSignedInt,	BasicType::LongLongSignedInt,	BasicType::LongLongSignedInt,	BasicType::LongLongSignedInt,	BasicType::LongLongSignedInt,	BasicType::LongLongSignedInt,	BasicType::LongLongSignedInt,	BasicType::LongLongSignedInt,	BasicType::LongLongSignedInt,	BasicType::LongLongSignedInt,	BasicType::LongLongUnsignedInt,	BasicType::Float,	BasicType::Double,	BasicType::LongDouble,	BasicType::FloatComplex,	BasicType::DoubleComplex,	BasicType::LongDoubleComplex,	BasicType::FloatComplex,	BasicType::DoubleComplex,	BasicType::LongDoubleComplex,	BasicType::SignedInt128,	BasicType::UnsignedInt128, BasicType::Float80, BasicType::Float128 },
+		/* LongLongUnsignedInt */ 	{ BasicType::LongLongUnsignedInt,	BasicType::LongLongUnsignedInt,	BasicType::LongLongUnsignedInt,	BasicType::LongLongUnsignedInt,	BasicType::LongLongUnsignedInt,	BasicType::LongLongUnsignedInt,	BasicType::LongLongUnsignedInt,	BasicType::LongLongUnsignedInt,	BasicType::LongLongUnsignedInt,	BasicType::LongLongUnsignedInt,	BasicType::LongLongUnsignedInt,	BasicType::LongLongUnsignedInt,	BasicType::Float,	BasicType::Double,	BasicType::LongDouble,	BasicType::FloatComplex,	BasicType::DoubleComplex,	BasicType::LongDoubleComplex,	BasicType::FloatComplex,	BasicType::DoubleComplex,	BasicType::LongDoubleComplex,	BasicType::SignedInt128,	BasicType::UnsignedInt128, BasicType::Float80, BasicType::Float128 },
+		/* Float */ 	{ BasicType::Float,	BasicType::Float,	BasicType::Float,	BasicType::Float,	BasicType::Float,	BasicType::Float,	BasicType::Float,	BasicType::Float,	BasicType::Float,	BasicType::Float,	BasicType::Float,	BasicType::Float,	BasicType::Float,	BasicType::Double,	BasicType::LongDouble,	BasicType::FloatComplex,	BasicType::DoubleComplex,	BasicType::LongDoubleComplex,	BasicType::FloatComplex,	BasicType::DoubleComplex,	BasicType::LongDoubleComplex,	BasicType::Float,	BasicType::Float, BasicType::Float80, BasicType::Float128 },
+		/* Double */ 	{ BasicType::Double,	BasicType::Double,	BasicType::Double,	BasicType::Double,	BasicType::Double,	BasicType::Double,	BasicType::Double,	BasicType::Double,	BasicType::Double,	BasicType::Double,	BasicType::Double,	BasicType::Double,	BasicType::Double,	BasicType::Double,	BasicType::LongDouble,	BasicType::DoubleComplex,	BasicType::DoubleComplex,	BasicType::LongDoubleComplex,	BasicType::DoubleComplex,	BasicType::DoubleComplex,	BasicType::LongDoubleComplex,	BasicType::Double,	BasicType::Double, BasicType::Float80, BasicType::Float128 },
+		/* LongDouble */ 	{ BasicType::LongDouble,		BasicType::LongDouble,	BasicType::LongDouble,	BasicType::LongDouble,	BasicType::LongDouble,	BasicType::LongDouble,	BasicType::LongDouble,	BasicType::LongDouble,	BasicType::LongDouble,	BasicType::LongDouble,	BasicType::LongDouble,	BasicType::LongDouble,	BasicType::LongDouble,	BasicType::LongDouble,	BasicType::LongDouble,	BasicType::LongDoubleComplex,	BasicType::LongDoubleComplex,	BasicType::LongDoubleComplex,	BasicType::LongDoubleComplex,	BasicType::LongDoubleComplex,	BasicType::LongDoubleComplex,	BasicType::LongDouble,	BasicType::LongDouble, BasicType::BasicType::LongDouble, BasicType::Float128 },
+		/* FloatComplex */ 	{ BasicType::FloatComplex,	BasicType::FloatComplex,	BasicType::FloatComplex,	BasicType::FloatComplex,	BasicType::FloatComplex,	BasicType::FloatComplex,	BasicType::FloatComplex,	BasicType::FloatComplex,	BasicType::FloatComplex,	BasicType::FloatComplex,	BasicType::FloatComplex,	BasicType::FloatComplex,	BasicType::FloatComplex,	BasicType::DoubleComplex,	BasicType::LongDoubleComplex,	BasicType::FloatComplex,	BasicType::DoubleComplex,	BasicType::LongDoubleComplex,	BasicType::FloatComplex,	BasicType::DoubleComplex,	BasicType::LongDoubleComplex,	BasicType::FloatComplex,	BasicType::FloatComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, },
+		/* DoubleComplex */ 	{ BasicType::DoubleComplex,	BasicType::DoubleComplex,	BasicType::DoubleComplex,	BasicType::DoubleComplex,	BasicType::DoubleComplex,	BasicType::DoubleComplex,	BasicType::DoubleComplex,	BasicType::DoubleComplex,	BasicType::DoubleComplex,	BasicType::DoubleComplex,	BasicType::DoubleComplex,	BasicType::DoubleComplex,	BasicType::DoubleComplex,	BasicType::DoubleComplex,	BasicType::LongDoubleComplex,	BasicType::DoubleComplex,	BasicType::DoubleComplex,	BasicType::LongDoubleComplex,	BasicType::DoubleComplex,	BasicType::DoubleComplex,	BasicType::LongDoubleComplex,	BasicType::DoubleComplex,	BasicType::DoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex },
+		/* LongDoubleComplex */ 	{ BasicType::LongDoubleComplex,	BasicType::LongDoubleComplex,	BasicType::LongDoubleComplex,	BasicType::LongDoubleComplex,	BasicType::LongDoubleComplex,	BasicType::LongDoubleComplex,	BasicType::LongDoubleComplex,	BasicType::LongDoubleComplex,	BasicType::LongDoubleComplex,	BasicType::LongDoubleComplex,	BasicType::LongDoubleComplex,	BasicType::LongDoubleComplex,	BasicType::LongDoubleComplex,	BasicType::LongDoubleComplex,	BasicType::LongDoubleComplex,	BasicType::LongDoubleComplex,	BasicType::LongDoubleComplex,	BasicType::LongDoubleComplex,	BasicType::LongDoubleComplex,	BasicType::LongDoubleComplex,	BasicType::LongDoubleComplex,	BasicType::LongDoubleComplex,	BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, BasicType::LongDoubleComplex, },
+		/* FloatImaginary */ 	{ BasicType::FloatComplex,	BasicType::FloatComplex,	BasicType::FloatComplex,	BasicType::FloatComplex,	BasicType::FloatComplex,	BasicType::FloatComplex,	BasicType::FloatComplex,	BasicType::FloatComplex,	BasicType::FloatComplex,	BasicType::FloatComplex,	BasicType::FloatComplex,	BasicType::FloatComplex,	BasicType::FloatComplex,	BasicType::DoubleComplex,	BasicType::LongDoubleComplex,	BasicType::FloatComplex,	BasicType::DoubleComplex,	BasicType::LongDoubleComplex,	BasicType::FloatImaginary,	BasicType::DoubleImaginary,	BasicType::LongDoubleImaginary,	BasicType::FloatImaginary,	BasicType::FloatImaginary, BasicType::LongDoubleImaginary, BasicType::LongDoubleImaginary, },
+		/* DoubleImaginary */ 	{ BasicType::DoubleComplex,	BasicType::DoubleComplex,	BasicType::DoubleComplex,	BasicType::DoubleComplex,	BasicType::DoubleComplex,	BasicType::DoubleComplex,	BasicType::DoubleComplex,	BasicType::DoubleComplex,	BasicType::DoubleComplex,	BasicType::DoubleComplex,	BasicType::DoubleComplex,	BasicType::DoubleComplex,	BasicType::DoubleComplex,	BasicType::DoubleComplex,	BasicType::LongDoubleComplex,	BasicType::DoubleComplex,	BasicType::DoubleComplex,	BasicType::LongDoubleComplex,	BasicType::DoubleImaginary,	BasicType::DoubleImaginary,	BasicType::LongDoubleImaginary,	BasicType::DoubleImaginary,	BasicType::DoubleImaginary, BasicType::LongDoubleImaginary, BasicType::LongDoubleImaginary, },
+		/* LongDoubleImaginary */ 	{ BasicType::LongDoubleComplex,	BasicType::LongDoubleComplex,	BasicType::LongDoubleComplex,	BasicType::LongDoubleComplex,	BasicType::LongDoubleComplex,	BasicType::LongDoubleComplex,	BasicType::LongDoubleComplex,	BasicType::LongDoubleComplex,	BasicType::LongDoubleComplex,	BasicType::LongDoubleComplex,	BasicType::LongDoubleComplex,	BasicType::LongDoubleComplex,	BasicType::LongDoubleComplex,	BasicType::LongDoubleComplex,	BasicType::LongDoubleComplex,	BasicType::LongDoubleComplex,	BasicType::LongDoubleComplex,	BasicType::LongDoubleComplex,	BasicType::LongDoubleImaginary,	BasicType::LongDoubleImaginary,	BasicType::LongDoubleImaginary, BasicType::LongDoubleImaginary, BasicType::LongDoubleImaginary, },
+		/* SignedInt128 */ 	{ BasicType::SignedInt128,	BasicType::SignedInt128,	BasicType::SignedInt128,	BasicType::SignedInt128,	BasicType::SignedInt128,	BasicType::SignedInt128,	BasicType::SignedInt128,	BasicType::SignedInt128,	BasicType::SignedInt128,	BasicType::SignedInt128,	BasicType::SignedInt128,	BasicType::SignedInt128,	BasicType::Float,	BasicType::Double,	BasicType::LongDouble,	BasicType::FloatComplex,	BasicType::DoubleComplex,	BasicType::LongDoubleComplex,	BasicType::FloatComplex,	BasicType::DoubleComplex,	BasicType::LongDoubleComplex,	BasicType::SignedInt128,	BasicType::UnsignedInt128, BasicType::Float80, BasicType::Float128, },
+		/* UnsignedInt128 */ 	{ BasicType::UnsignedInt128,	BasicType::UnsignedInt128,	BasicType::UnsignedInt128,	BasicType::UnsignedInt128,	BasicType::UnsignedInt128,	BasicType::UnsignedInt128,	BasicType::UnsignedInt128,	BasicType::UnsignedInt128,	BasicType::UnsignedInt128,	BasicType::UnsignedInt128,	BasicType::UnsignedInt128,	BasicType::UnsignedInt128,	BasicType::Float,	BasicType::Double,	BasicType::LongDouble,	BasicType::FloatComplex,	BasicType::DoubleComplex,	BasicType::LongDoubleComplex,	BasicType::FloatComplex,	BasicType::DoubleComplex,	BasicType::LongDoubleComplex,	BasicType::UnsignedInt128,	BasicType::UnsignedInt128, BasicType::Float80, BasicType::Float128, },
+		/* Float80 */ 	{ BasicType::Float80,	BasicType::Float80,	BasicType::Float80,	BasicType::Float80,	BasicType::Float80,	BasicType::Float80,	BasicType::Float80,	BasicType::Float80,	BasicType::Float80,	BasicType::Float80,	BasicType::Float80,	BasicType::Float80,	BasicType::Float80,	BasicType::Float80,	BasicType::LongDouble,	BasicType::LongDoubleComplex,	BasicType::LongDoubleComplex,	BasicType::LongDoubleComplex,	BasicType::LongDoubleComplex,	BasicType::LongDoubleComplex,	BasicType::LongDoubleComplex,	BasicType::Float80,	BasicType::Float80, BasicType::Float80, BasicType::Float128 },
+		/* Float128 */ 	{ BasicType::Float128,	BasicType::Float128,	BasicType::Float128,	BasicType::Float128,	BasicType::Float128,	BasicType::Float128,	BasicType::Float128,	BasicType::Float128,	BasicType::Float128,	BasicType::Float128,	BasicType::Float128,	BasicType::Float128,	BasicType::Float128,	BasicType::Float128,	BasicType::Float128,	BasicType::LongDoubleComplex,	BasicType::LongDoubleComplex,	BasicType::LongDoubleComplex,	BasicType::LongDoubleComplex,	BasicType::LongDoubleComplex,	BasicType::LongDoubleComplex,	BasicType::Float128,	BasicType::Float128, BasicType::Float128, BasicType::Float128 },
 	};
+	static_assert(
+		sizeof(combinedType)/sizeof(combinedType[0][0]) == BasicType::NUMBER_OF_BASIC_TYPES*BasicType::NUMBER_OF_BASIC_TYPES,
+		"Each basic type kind should have a corresponding row in the combined type matrix"
+	);
 
 	CommonType::CommonType( Type *type2, bool widenFirst, bool widenSecond, const SymTab::Indexer &indexer, TypeEnvironment &env, const OpenVarSet &openVars )
@@ -232,5 +238,5 @@
 				AssertionSet need, have;
 				WidenMode widen( widenFirst, widenSecond );
-				if ( entry != openVars.end() && ! bindVar(var, voidPointer->get_base(), entry->second, env, need, have, openVars, widen, indexer ) ) return;
+				if ( entry != openVars.end() && ! env.bindVar(var, voidPointer->get_base(), entry->second, need, have, openVars, widen, indexer ) ) return;
 			}
 		}
Index: src/ResolvExpr/ConversionCost.cc
===================================================================
--- src/ResolvExpr/ConversionCost.cc	(revision 97397a26b44bae1c0120193fd3d160297ec1db7a)
+++ src/ResolvExpr/ConversionCost.cc	(revision b21c77a0e211d9361763565a2eb5ef4330f2957b)
@@ -231,32 +231,40 @@
 */
 
-	static const int costMatrix[ BasicType::NUMBER_OF_BASIC_TYPES ][ BasicType::NUMBER_OF_BASIC_TYPES ] = {
-	/* Src \ Dest:	Bool	Char	SChar	UChar	Short	UShort	Int 	UInt	Long	ULong	LLong	ULLong	Float	Double	LDbl	FCplex	DCplex	LDCplex	FImag	DImag	LDImag	I128,	U128 */
-		/* Bool */ 	{ 0,	1,		1,		2,		3,		4,		5,		6,		6,		7,		8,		9,		12,		13,		14,		12,		13,		14,		-1,		-1,		-1,		10,		11,	},
-		/* Char */ 	{ -1,	0,		-1,		1,		2,		3,		4,		5,		5,		6,		7,		8,		11,		12,		13,		11,		12,		13,		-1,		-1,		-1,		9,		10,	},
-		/* SChar */ { -1,	-1,		0,		1,		2,		3,		4,		5,		5,		6,		7,		8,		11,		12,		13,		11,		12,		13,		-1,		-1,		-1,		9,		10,	},
-		/* UChar */ { -1,	-1,		-1,		0,		1,		2,		3,		4,		4,		5,		6,		7,		10,		11,		12,		10,		11,		12,		-1,		-1,		-1,		8,		9,	},
-		/* Short */ { -1,	-1,		-1,		-1,		0,		1,		2,		3,		3,		4,		5,		6,		9,		10,		11,		9,		10,		11,		-1,		-1,		-1,		7,		8,	},
-		/* UShort */{ -1,	-1,		-1,		-1,		-1,		0,		1,		2,		2,		3,		4,		5,		8,		9,		10,		8,		9,		10,		-1,		-1,		-1,		6,		7,	},
-		/* Int */ 	{ -1,	-1,		-1,		-1,		-1,		-1,		0,		1,		1,		2,		3,		4,		7,		8,		9,		7,		8,		9,		-1,		-1,		-1,		5,		6,	},
-		/* UInt */ 	{ -1,	-1,		-1,		-1,		-1,		-1,		-1,		0,		-1,		1,		2,		3,		6,		7,		8,		6,		7,		8,		-1,		-1,		-1,		4,		5,	},
-		/* Long */ 	{ -1,	-1,		-1,		-1,		-1,		-1,		-1,		-1,		0,		1,		2,		3,		6,		7,		8,		6,		7,		8,		-1,		-1,		-1,		4,		5,	},
-		/* ULong */ { -1,	-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		0,		1,		2,		5,		6,		7,		5,		6,		7,		-1,		-1,		-1,		3,		4,	},
-		/* LLong */ { -1,	-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		0,		1,		4,		5,		6,		4,		5,		6,		-1,		-1,		-1,		2,		3,	},
-		/* ULLong */{ -1,	-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		0,		3,		4,		5,		3,		4,		5,		-1,		-1,		-1,		1,		2,	},
-
-		/* Float */ { -1,	-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		0,		1,		2,		1,		2,		3,		-1,		-1,		-1,		-1,		-1,	},
-		/* Double */{ -1,	-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		0,		1,		-1,		1,		2,		-1,		-1,		-1,		-1,		-1,	},
-		/* LDbl */ 	{ -1,	-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		0,		-1,		-1,		1,		-1,		-1,		-1,		-1,		-1,	},
-		/* FCplex */{ -1,	-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		0,		1,		2,		-1,		-1,		-1,		-1,		-1,	},
-		/* DCplex */{ -1,	-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		0,		1,		-1,		-1,		-1,		-1,		-1,	},
-		/* LDCplex */{ -1,	-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		0,		-1,		-1,		-1,		-1,		-1,	},
-		/* FImag */ { -1,	-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		1,		2,		3,		0,		1,		2,		-1,		-1,	},
-		/* DImag */ { -1,	-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		1,		2,		-1,		0,		1,		-1,		-1,	},
-		/* LDImag */{ -1,	-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		1,		-1,		-1,		0,		-1,		-1,	},
-
-		/* I128 */  { -1,	-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		2,		3,		4,		3,		4,		5,		-1,		-1,		-1,		0,		1,	},
-		/* U128 */  { -1,	-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		1,		2,		3,		2,		3,		4,		-1,		-1,		-1,		-1,		0,	},
+	static const int costMatrix[][ BasicType::NUMBER_OF_BASIC_TYPES ] = {
+	/* Src \ Dest:	Bool	Char	SChar	UChar	Short	UShort	Int 	UInt	Long	ULong	LLong	ULLong	Float	Double	LDbl	FCplex	DCplex	LDCplex	FImag	DImag	LDImag	I128,	U128, F80, F128 */
+		/* Bool */ 	{ 0,	1,		1,		2,		3,		4,		5,		6,		6,		7,		8,		9,		12,		13,		14,		12,		13,		14,		-1,		-1,		-1,		10,		11,	  14,   15},
+		/* Char */ 	{ -1,	0,		-1,		1,		2,		3,		4,		5,		5,		6,		7,		8,		11,		12,		13,		11,		12,		13,		-1,		-1,		-1,		9,		10,	  13,   14},
+		/* SChar */ { -1,	-1,		0,		1,		2,		3,		4,		5,		5,		6,		7,		8,		11,		12,		13,		11,		12,		13,		-1,		-1,		-1,		9,		10,	  13,   14},
+		/* UChar */ { -1,	-1,		-1,		0,		1,		2,		3,		4,		4,		5,		6,		7,		10,		11,		12,		10,		11,		12,		-1,		-1,		-1,		8,		9,	  12,   13},
+		/* Short */ { -1,	-1,		-1,		-1,		0,		1,		2,		3,		3,		4,		5,		6,		9,		10,		11,		9,		10,		11,		-1,		-1,		-1,		7,		8,	  11,   12},
+		/* UShort */{ -1,	-1,		-1,		-1,		-1,		0,		1,		2,		2,		3,		4,		5,		8,		9,		10,		8,		9,		10,		-1,		-1,		-1,		6,		7,	  10,   11},
+		/* Int */ 	{ -1,	-1,		-1,		-1,		-1,		-1,		0,		1,		1,		2,		3,		4,		7,		8,		9,		7,		8,		9,		-1,		-1,		-1,		5,		6,	  9,    10},
+		/* UInt */ 	{ -1,	-1,		-1,		-1,		-1,		-1,		-1,		0,		-1,		1,		2,		3,		6,		7,		8,		6,		7,		8,		-1,		-1,		-1,		4,		5,	  8,    9},
+		/* Long */ 	{ -1,	-1,		-1,		-1,		-1,		-1,		-1,		-1,		0,		1,		2,		3,		6,		7,		8,		6,		7,		8,		-1,		-1,		-1,		4,		5,	  8,    9},
+		/* ULong */ { -1,	-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		0,		1,		2,		5,		6,		7,		5,		6,		7,		-1,		-1,		-1,		3,		4,	  7,    8},
+		/* LLong */ { -1,	-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		0,		1,		4,		5,		6,		4,		5,		6,		-1,		-1,		-1,		2,		3,	  6,    7},
+		/* ULLong */{ -1,	-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		0,		3,		4,		5,		3,		4,		5,		-1,		-1,		-1,		1,		2,	  5,    6},
+
+		/* Float */ { -1,	-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		0,		1,		2,		1,		2,		3,		-1,		-1,		-1,		-1,		-1,	  2,    3},
+		/* Double */{ -1,	-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		0,		1,		-1,		1,		2,		-1,		-1,		-1,		-1,		-1,	  1,    2},
+		/* LDbl */ 	{ -1,	-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		0,		-1,		-1,		1,		-1,		-1,		-1,		-1,		-1,	  -1,   1},
+		/* FCplex */{ -1,	-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		0,		1,		2,		-1,		-1,		-1,		-1,		-1,	  -1,   -1},
+		/* DCplex */{ -1,	-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		0,		1,		-1,		-1,		-1,		-1,		-1,	  -1,   -1},
+		/* LDCplex */{ -1,	-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		0,		-1,		-1,		-1,		-1,		-1,	  -1,   -1},
+		/* FImag */ { -1,	-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		1,		2,		3,		0,		1,		2,		-1,		-1,	  -1,   -1},
+		/* DImag */ { -1,	-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		1,		2,		-1,		0,		1,		-1,		-1,	  -1,   -1},
+		/* LDImag */{ -1,	-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		1,		-1,		-1,		0,		-1,		-1,	  -1,   -1},
+
+		/* I128 */  { -1,	-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		2,		3,		4,		3,		4,		5,		-1,		-1,		-1,		0,		1,	  4,    4},
+		/* U128 */  { -1,	-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		1,		2,		3,		2,		3,		4,		-1,		-1,		-1,		-1,		0,	  3,    3},
+
+		/* F80 */ 	{ -1,	-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		1,		-1,		-1,		1,		-1,		-1,		-1,		-1,		-1,	  0,    1},
+		/* F128 */ 	{ -1,	-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		-1,		1,		-1,		-1,		-1,		-1,		-1,	  -1,   0},
 	};
+	static_assert(
+		sizeof(costMatrix)/sizeof(costMatrix[0][0]) == BasicType::NUMBER_OF_BASIC_TYPES*BasicType::NUMBER_OF_BASIC_TYPES,
+		"Each basic type kind should have a corresponding row in the cost matrix"
+	);
+
 
 	void ConversionCost::postvisit( VoidType * ) {
Index: src/ResolvExpr/ExplodedActual.h
===================================================================
--- src/ResolvExpr/ExplodedActual.h	(revision 97397a26b44bae1c0120193fd3d160297ec1db7a)
+++ src/ResolvExpr/ExplodedActual.h	(revision b21c77a0e211d9361763565a2eb5ef4330f2957b)
@@ -31,6 +31,7 @@
 
 		ExplodedActual() : env(), cost(Cost::zero), exprs() {}
-
 		ExplodedActual( const Alternative& actual, const SymTab::Indexer& indexer );
+		ExplodedActual(ExplodedActual&&) = default;
+		ExplodedActual& operator= (ExplodedActual&&) = default;
 	};
 }
Index: src/ResolvExpr/Resolver.cc
===================================================================
--- src/ResolvExpr/Resolver.cc	(revision 97397a26b44bae1c0120193fd3d160297ec1db7a)
+++ src/ResolvExpr/Resolver.cc	(revision b21c77a0e211d9361763565a2eb5ef4330f2957b)
@@ -217,5 +217,5 @@
 			if ( findDeletedExpr( choice.expr ) ) {
 				trace( choice.expr );
-				SemanticError( choice.expr, "Unique best alternative includes deleted identifier in " );
+				SemanticError( untyped->location, choice.expr, "Unique best alternative includes deleted identifier in " );
 			}
 			alt = std::move( choice );
@@ -252,4 +252,5 @@
 
 		auto untyped = new CastExpr{ expr }; // cast to void
+		untyped->location = expr->location;
 
 		// set up and resolve expression cast to void
@@ -277,5 +278,8 @@
 	void findSingleExpression( Expression *& untyped, Type * type, const SymTab::Indexer & indexer ) {
 		assert( untyped && type );
+		// transfer location to generated cast for error purposes
+		CodeLocation location = untyped->location;
 		untyped = new CastExpr( untyped, type );
+		untyped->location = location;
 		findSingleExpression( untyped, indexer );
 		removeExtraneousCast( untyped, indexer );
@@ -580,8 +584,6 @@
 
 							// Make sure we don't widen any existing bindings
-							for ( auto & i : resultEnv ) {
-								i.allowWidening = false;
-							}
-
+							resultEnv.forbidWidening();
+							
 							// Find any unbound type variables
 							resultEnv.extractOpenVars( openVars );
Index: src/ResolvExpr/Resolver.h
===================================================================
--- src/ResolvExpr/Resolver.h	(revision 97397a26b44bae1c0120193fd3d160297ec1db7a)
+++ src/ResolvExpr/Resolver.h	(revision b21c77a0e211d9361763565a2eb5ef4330f2957b)
@@ -36,4 +36,6 @@
 	void resolveCtorInit( ConstructorInit * ctorInit, const SymTab::Indexer & indexer );
 	void resolveStmtExpr( StmtExpr * stmtExpr, const SymTab::Indexer & indexer );
+	/// Searches expr and returns the first DeletedExpr found, otherwise nullptr
+	DeletedExpr * findDeletedExpr( Expression * expr );
 } // namespace ResolvExpr
 
Index: src/ResolvExpr/TypeEnvironment.cc
===================================================================
--- src/ResolvExpr/TypeEnvironment.cc	(revision 97397a26b44bae1c0120193fd3d160297ec1db7a)
+++ src/ResolvExpr/TypeEnvironment.cc	(revision b21c77a0e211d9361763565a2eb5ef4330f2957b)
@@ -7,9 +7,9 @@
 // TypeEnvironment.cc --
 //
-// Author           : Richard C. Bilson
+// Author           : Aaron B. Moss
 // Created On       : Sun May 17 12:19:47 2015
-// Last Modified By : Peter A. Buhr
-// Last Modified On : Sun May 17 12:23:36 2015
-// Update Count     : 3
+// Last Modified By : Aaron B. Moss
+// Last Modified On : Fri Jun 29 15:51:00 2018
+// Update Count     : 5
 //
 
@@ -27,4 +27,5 @@
 #include "SynTree/TypeSubstitution.h"  // for TypeSubstitution
 #include "TypeEnvironment.h"
+#include "typeops.h"                   // for occurs
 #include "Unify.h"                     // for unifyInexact
 
@@ -50,18 +51,29 @@
 #if 0
 	void EqvClass::initialize( const EqvClass &src, EqvClass &dest ) {
+		initialize( src, dest, src.type );
+	}
+
+	void EqvClass::initialize( const EqvClass &src, EqvClass &dest, const Type *ty ) {
 		dest.vars = src.vars;
-		dest.type = maybeClone( src.type );
+		dest.type = maybeClone( ty );
 		dest.allowWidening = src.allowWidening;
 		dest.data = src.data;
 	}
 
-	EqvClass::EqvClass() : vars(), type( 0 ), allowWidening( true ), data() {}
-
-	EqvClass::EqvClass( std::vector<interned_string>&& vs, BoundType&& bound )
-		: vars( vs.begin(), vs.end() ), type( maybeClone( bound.type ) ), 
-		  allowWidening( bound.allowWidening ), data( bound.data ) {}
+	EqvClass::EqvClass() : type( nullptr ), allowWidening( true ) {
+	}
 
 	EqvClass::EqvClass( const EqvClass &other ) {
 		initialize( other, *this );
+	}
+
+	EqvClass::EqvClass( const EqvClass &other, const Type *ty ) {
+		initialize( other, *this, ty );
+	}
+
+	EqvClass::EqvClass( EqvClass &&other ) 
+	: vars{std::move(other.vars)}, type{other.type}, 
+	  allowWidening{std::move(other.allowWidening)}, data{std::move(other.data)} {
+		  other.type = nullptr;
 	}
 
@@ -71,4 +83,17 @@
 		return *this;
 	}
+
+	EqvClass &EqvClass::operator=( EqvClass &&other ) {
+		if ( this == &other ) return *this;
+		
+		vars = std::move(other.vars);
+		type = other.type;
+		allowWidening = std::move(other.allowWidening);
+		data = std::move(other.data);
+
+		return *this;
+	}
+
+	void EqvClass::set_type( Type* ty ) { type = ty; }
 
 	void EqvClass::print( std::ostream &os, Indenter indent ) const {
@@ -88,11 +113,5 @@
 	const EqvClass* TypeEnvironment::lookup( const std::string &var ) const {
 		for ( std::list< EqvClass >::const_iterator i = env.begin(); i != env.end(); ++i ) {
-			if ( i->vars.find( var ) != i->vars.end() ) {
-///       std::cout << var << " is in class ";
-///       i->print( std::cout );
-				return &*i;
-			}
-///     std::cout << var << " is not in class ";
-///     i->print( std::cout );
+			if ( i->vars.find( var ) != i->vars.end() ) return &*i;
 		} // for
 		return nullptr;
@@ -118,4 +137,13 @@
 		if ( root ) return { this, root };
 		else return { nullptr, var };
+	}
+
+	bool isFtype( Type *type ) {
+		if ( dynamic_cast< FunctionType* >( type ) ) {
+			return true;
+		} else if ( TypeInstType *typeInst = dynamic_cast< TypeInstType* >( type ) ) {
+			return typeInst->get_isFtype();
+		} // if
+		return false;
 	}
 
@@ -288,9 +316,4 @@
 	}
 
-	void TypeEnvironment::add( const EqvClass &eqvClass ) {
-		filterOverlappingClasses( env, eqvClass );
-		env.push_back( eqvClass );
-	}
-
 	void TypeEnvironment::add( EqvClass &&eqvClass ) {
 		filterOverlappingClasses( env, eqvClass );
@@ -303,5 +326,5 @@
 			newClass.vars.insert( (*i)->get_name() );
 			newClass.data = TypeDecl::Data{ (*i) };
-			env.push_back( newClass );
+			env.push_back( std::move(newClass) );
 		} // for
 	}
@@ -317,5 +340,5 @@
 			// transition to TypeSubstitution
 			newClass.data = TypeDecl::Data{ TypeDecl::Dtype, false };
-			add( newClass );
+			add( std::move(newClass) );
 		}
 	}
@@ -324,27 +347,18 @@
 		for ( std::list< EqvClass >::const_iterator theClass = env.begin(); theClass != env.end(); ++theClass ) {
 			for ( std::set< std::string >::const_iterator theVar = theClass->vars.begin(); theVar != theClass->vars.end(); ++theVar ) {
-///       std::cerr << "adding " << *theVar;
 				if ( theClass->type ) {
-///         std::cerr << " bound to ";
-///         theClass->type->print( std::cerr );
-///         std::cerr << std::endl;
 					sub.add( *theVar, theClass->type );
 				} else if ( theVar != theClass->vars.begin() ) {
 					TypeInstType *newTypeInst = new TypeInstType( Type::Qualifiers(), *theClass->vars.begin(), theClass->data.kind == TypeDecl::Ftype );
-///         std::cerr << " bound to variable " << *theClass->vars.begin() << std::endl;
 					sub.add( *theVar, newTypeInst );
 				} // if
 			} // for
 		} // for
-///   std::cerr << "input env is:" << std::endl;
-///   print( std::cerr, 8 );
-///   std::cerr << "sub is:" << std::endl;
-///   sub.print( std::cerr, 8 );
 		sub.normalize();
 	}
 
 	void TypeEnvironment::print( std::ostream &os, Indenter indent ) const {
-		for ( std::list< EqvClass >::const_iterator i = env.begin(); i != env.end(); ++i ) {
-			i->print( os, indent );
+		for ( const EqvClass & theClass : env ) {
+			theClass.print( os, indent );
 		} // for
 	}
@@ -352,7 +366,5 @@
 	std::list< EqvClass >::iterator TypeEnvironment::internal_lookup( const std::string &var ) {
 		for ( std::list< EqvClass >::iterator i = env.begin(); i != env.end(); ++i ) {
-			if ( i->vars.find( var ) == i->vars.end() ) {
-				return i;
-			} // if
+			if ( i->vars.count( var ) ) return i;
 		} // for
 		return env.end();
Index: src/ResolvExpr/TypeEnvironment.h
===================================================================
--- src/ResolvExpr/TypeEnvironment.h	(revision 97397a26b44bae1c0120193fd3d160297ec1db7a)
+++ src/ResolvExpr/TypeEnvironment.h	(revision b21c77a0e211d9361763565a2eb5ef4330f2957b)
@@ -10,6 +10,6 @@
 // Created On       : Sun May 17 12:24:58 2015
 // Last Modified By : Aaron B. Moss
-// Last Modified On : Wed Jun 13 16:31:00 2018
-// Update Count     : 4
+// Last Modified On : Fri Jun 29 16:00:00 2018
+// Update Count     : 5
 //
 
@@ -24,4 +24,6 @@
 #include <utility>                         // for pair
 #include <vector>                          // for vector
+
+#include "WidenMode.h"                 // for WidenMode
 
 #include "Common/InternedString.h"         // for interned_string
@@ -95,12 +97,18 @@
 
 		void initialize( const EqvClass &src, EqvClass &dest );
+		void initialize( const EqvClass &src, EqvClass &dest, const Type *ty );
 		EqvClass();
-		EqvClass( std::vector<interned_string>&& vars, BoundType&& bound );
 		EqvClass( const EqvClass &other );
+		EqvClass( const EqvClass &other, const Type *ty );
+		EqvClass( EqvClass &&other );
 		EqvClass &operator=( const EqvClass &other );
+		EqvClass &operator=( EqvClass &&other );
 		void print( std::ostream &os, Indenter indent = {} ) const;
-	};
-#endif
-
+
+		/// Takes ownership of `ty`, freeing old `type`
+		void set_type(Type* ty);
+	};
+#endif
+	
 	class TypeEnvironment;
 
@@ -206,6 +214,7 @@
 			WidenMode widenMode, const SymTab::Indexer& indexer );
 #if !1
-		void add( const EqvClass &eqvClass );
-		void add( EqvClass &&eqvClass  );
+	private:
+		void add( EqvClass &&eqvClass );
+	public:
 		void add( const Type::ForallList &tyDecls );
 		void add( const TypeSubstitution & sub );
@@ -226,13 +235,11 @@
 		/// and extracts open variables.
 		void addActual( const TypeEnvironment& actualEnv, OpenVarSet& openVars );
+
+		/// Disallows widening for all bindings in the environment
+		void forbidWidening();
 #endif
 
 		iterator begin() { return { this, bindings->begin() }; }
 		iterator end() { return { this, bindings->end() }; }
-#if 0
-		typedef std::list< EqvClass >::const_iterator const_iterator;
-		const_iterator begin() const { return env.begin(); }
-		const_iterator end() const { return env.end(); }
-#endif
 	};
 
Index: src/ResolvExpr/Unify.cc
===================================================================
--- src/ResolvExpr/Unify.cc	(revision 97397a26b44bae1c0120193fd3d160297ec1db7a)
+++ src/ResolvExpr/Unify.cc	(revision b21c77a0e211d9361763565a2eb5ef4330f2957b)
@@ -9,7 +9,7 @@
 // Author           : Richard C. Bilson
 // Created On       : Sun May 17 12:27:10 2015
-// Last Modified By : Peter A. Buhr
-// Last Modified On : Thu Mar 16 16:22:54 2017
-// Update Count     : 42
+// Last Modified By : Aaron B. Moss
+// Last Modified On : Mon Jun 18 11:58:00 2018
+// Update Count     : 43
 //
 
@@ -122,135 +122,4 @@
 	}
 
-	bool isFtype( Type *type ) {
-		if ( dynamic_cast< FunctionType* >( type ) ) {
-			return true;
-		} else if ( TypeInstType *typeInst = dynamic_cast< TypeInstType* >( type ) ) {
-			return typeInst->get_isFtype();
-		} // if
-		return false;
-	}
-
-	bool bindVar( TypeInstType *typeInst, Type *other, const TypeDecl::Data & data, TypeEnvironment &env, AssertionSet &needAssertions, AssertionSet &haveAssertions, const OpenVarSet &openVars, WidenMode widenMode, const SymTab::Indexer &indexer ) {
-		// remove references from other, so that type variables can only bind to value types
-		other = other->stripReferences();
-		OpenVarSet::const_iterator tyvar = openVars.find( typeInst->get_name() );
-		assert( tyvar != openVars.end() );
-		if ( ! tyVarCompatible( tyvar->second, other ) ) {
-			return false;
-		} // if
-		if ( occurs( other, typeInst->get_name(), env ) ) {
-			return false;
-		} // if
-		if ( const EqvClass *curClass = env.lookup( typeInst->get_name() ) ) {
-			if ( curClass->type ) {
-				Type *common = 0;
-				// attempt to unify equivalence class type (which has qualifiers stripped, so they must be restored) with the type to bind to
-				Type* newType = curClass->type->clone();
-				newType->get_qualifiers() = typeInst->get_qualifiers();
-				if ( unifyInexact( newType, other, env, needAssertions, haveAssertions, openVars, widenMode & WidenMode( curClass->allowWidening, true ), indexer, common ) ) {
-					if ( common ) {
-						common->get_qualifiers() = Type::Qualifiers();
-						EqvClass newClass = *curClass;
-						newClass.type = common;
-						env.add( std::move(newClass) );
-					} // if
-					return true;
-				} else {
-					return false;
-				} // if
-			} else {
-				EqvClass newClass = *curClass;
-				newClass.type = other->clone();
-				newClass.type->get_qualifiers() = Type::Qualifiers();
-				newClass.allowWidening = widenMode.widenFirst && widenMode.widenSecond;
-				env.add( std::move(newClass) );
-			} // if
-		} else {
-			EqvClass newClass;
-			newClass.vars.insert( typeInst->get_name() );
-			newClass.type = other->clone();
-			newClass.type->get_qualifiers() = Type::Qualifiers();
-			newClass.allowWidening = widenMode.widenFirst && widenMode.widenSecond;
-			newClass.data = data;
-			env.add( newClass );
-		} // if
-		return true;
-	}
-
-	bool bindVarToVar( TypeInstType *var1, TypeInstType *var2, const TypeDecl::Data & data, TypeEnvironment &env, AssertionSet &needAssertions, AssertionSet &haveAssertions, const OpenVarSet &openVars, WidenMode widenMode, const SymTab::Indexer &indexer ) {
-		bool result = true;
-		const EqvClass *class1 = env.lookup( var1->get_name() );
-		const EqvClass *class2 = env.lookup( var2->get_name() );
-		bool widen1 = false, widen2 = false;
-		Type *type1 = nullptr, *type2 = nullptr;
-
-		if ( class1 ) {
-			if ( class1->type ) {
-				if ( occurs( class1->type, var2->get_name(), env ) ) {
-					return false;
-				} // if
-				type1 = class1->type->clone();
-			} // if
-			widen1 = widenMode.widenFirst && class1->allowWidening;
-		} // if
-		if ( class2 ) {
-			if ( class2->type ) {
-				if ( occurs( class2->type, var1->get_name(), env ) ) {
-					return false;
-				} // if
-				type2 = class2->type->clone();
-			} // if
-			widen2 = widenMode.widenSecond && class2->allowWidening;
-		} // if
-
-		if ( type1 && type2 ) {
-//    std::cerr << "has type1 && type2" << std::endl;
-			WidenMode newWidenMode ( widen1, widen2 );
-			Type *common = 0;
-			if ( unifyInexact( type1, type2, env, needAssertions, haveAssertions, openVars, newWidenMode, indexer, common ) ) {
-				EqvClass newClass1 = *class1;
-				newClass1.vars.insert( class2->vars.begin(), class2->vars.end() );
-				newClass1.allowWidening = widen1 && widen2;
-				if ( common ) {
-					common->get_qualifiers() = Type::Qualifiers();
-					newClass1.type = common;
-				} // if
-				env.add( std::move(newClass1) );
-			} else {
-				result = false;
-			} // if
-		} else if ( class1 && class2 ) {
-			if ( type1 ) {
-				EqvClass newClass1 = *class1;
-				newClass1.vars.insert( class2->vars.begin(), class2->vars.end() );
-				newClass1.allowWidening = widen1;
-				env.add( std::move(newClass1) );
-			} else {
-				EqvClass newClass2 = *class2;
-				newClass2.vars.insert( class1->vars.begin(), class1->vars.end() );
-				newClass2.allowWidening = widen2;
-				env.add( std::move(newClass2) );
-			} // if
-		} else if ( class1 ) {
-			EqvClass newClass1 = *class1;
-			newClass1.vars.insert( var2->get_name() );
-			newClass1.allowWidening = widen1;
-			env.add( std::move(newClass1) );
-		} else if ( class2 ) {
-			EqvClass newClass2 = *class2;
-			newClass2.vars.insert( var1->get_name() );
-			newClass2.allowWidening = widen2;
-			env.add( std::move(newClass2) );
-		} else {
-			EqvClass newClass;
-			newClass.vars.insert( var1->get_name() );
-			newClass.vars.insert( var2->get_name() );
-			newClass.allowWidening = widen1 && widen2;
-			newClass.data = data;
-			env.add( newClass );
-		} // if
-		return result;
-	}
-
 	bool unify( Type *type1, Type *type2, TypeEnvironment &env, AssertionSet &needAssertions, AssertionSet &haveAssertions, OpenVarSet &openVars, const SymTab::Indexer &indexer ) {
 		OpenVarSet closedVars;
@@ -290,9 +159,9 @@
 
 		if ( isopen1 && isopen2 && entry1->second == entry2->second ) {
-			result = bindVarToVar( var1, var2, entry1->second, env, needAssertions, haveAssertions, openVars, widenMode, indexer );
+			result = env.bindVarToVar( var1, var2, entry1->second, needAssertions, haveAssertions, openVars, widenMode, indexer );
 		} else if ( isopen1 ) {
-			result = bindVar( var1, type2, entry1->second, env, needAssertions, haveAssertions, openVars, widenMode, indexer );
+			result = env.bindVar( var1, type2, entry1->second, needAssertions, haveAssertions, openVars, widenMode, indexer );
 		} else if ( isopen2 ) { // TODO: swap widenMode values in call, since type positions are flipped?
-			result = bindVar( var2, type1, entry2->second, env, needAssertions, haveAssertions, openVars, widenMode, indexer );
+			result = env.bindVar( var2, type1, entry2->second, needAssertions, haveAssertions, openVars, widenMode, indexer );
 		} else {
 			PassVisitor<Unify> comparator( type2, env, needAssertions, haveAssertions, openVars, widenMode, indexer );
Index: src/ResolvExpr/Unify.h
===================================================================
--- src/ResolvExpr/Unify.h	(revision 97397a26b44bae1c0120193fd3d160297ec1db7a)
+++ src/ResolvExpr/Unify.h	(revision b21c77a0e211d9361763565a2eb5ef4330f2957b)
@@ -9,7 +9,7 @@
 // Author           : Richard C. Bilson
 // Created On       : Sun May 17 13:09:04 2015
-// Last Modified By : Peter A. Buhr
-// Last Modified On : Fri Jul 21 23:09:34 2017
-// Update Count     : 3
+// Last Modified By : Aaron B. Moss
+// Last Modified On : Mon Jun 18 11:58:00 2018
+// Update Count     : 4
 //
 
@@ -21,4 +21,5 @@
 #include "SynTree/Declaration.h"  // for TypeDecl, TypeDecl::Data
 #include "TypeEnvironment.h"      // for AssertionSet, OpenVarSet
+#include "WidenMode.h"            // for WidenMode
 
 class Type;
@@ -29,19 +30,8 @@
 
 namespace ResolvExpr {
-	struct WidenMode {
-		WidenMode( bool widenFirst, bool widenSecond ): widenFirst( widenFirst ), widenSecond( widenSecond ) {}
-		WidenMode &operator|=( const WidenMode &other ) { widenFirst |= other.widenFirst; widenSecond |= other.widenSecond; return *this; }
-		WidenMode &operator&=( const WidenMode &other ) { widenFirst &= other.widenFirst; widenSecond &= other.widenSecond; return *this; }
-		WidenMode operator|( const WidenMode &other ) { WidenMode newWM( *this ); newWM |= other; return newWM; }
-		WidenMode operator&( const WidenMode &other ) { WidenMode newWM( *this ); newWM &= other; return newWM; }
-		operator bool() { return widenFirst && widenSecond; }
-
-		bool widenFirst : 1, widenSecond : 1;
-	};
-
-	bool bindVar( TypeInstType *typeInst, Type *other, const TypeDecl::Data & data, TypeEnvironment &env, AssertionSet &needAssertions, AssertionSet &haveAssertions, const OpenVarSet &openVars, WidenMode widenMode, const SymTab::Indexer &indexer );
 	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 widenMode, const SymTab::Indexer &indexer, Type *&common );
 
 	template< typename Iterator1, typename Iterator2 >
Index: src/ResolvExpr/WidenMode.h
===================================================================
--- src/ResolvExpr/WidenMode.h	(revision b21c77a0e211d9361763565a2eb5ef4330f2957b)
+++ src/ResolvExpr/WidenMode.h	(revision b21c77a0e211d9361763565a2eb5ef4330f2957b)
@@ -0,0 +1,35 @@
+//
+// Cforall Version 1.0.0 Copyright (C) 2015 University of Waterloo
+//
+// The contents of this file are covered under the licence agreement in the
+// file "LICENCE" distributed with Cforall.
+//
+// WidenMode.h --
+//
+// Author           : Aaron B. Moss
+// Created On       : Mon Jun 18 11:58:00 2018
+// Last Modified By : Aaron B. Moss
+// Last Modified On : Mon Jun 18 11:58:00 2018
+// Update Count     : 1
+//
+
+#pragma once
+
+namespace ResolvExpr {
+	struct WidenMode {
+		WidenMode( bool widenFirst, bool widenSecond ): widenFirst( widenFirst ), widenSecond( widenSecond ) {}
+		WidenMode &operator|=( const WidenMode &other ) { widenFirst |= other.widenFirst; widenSecond |= other.widenSecond; return *this; }
+		WidenMode &operator&=( const WidenMode &other ) { widenFirst &= other.widenFirst; widenSecond &= other.widenSecond; return *this; }
+		WidenMode operator|( const WidenMode &other ) { WidenMode newWM( *this ); newWM |= other; return newWM; }
+		WidenMode operator&( const WidenMode &other ) { WidenMode newWM( *this ); newWM &= other; return newWM; }
+		operator bool() { return widenFirst && widenSecond; }
+
+		bool widenFirst : 1, widenSecond : 1;
+	};
+} // namespace ResolvExpr
+
+// Local Variables: //
+// tab-width: 4 //
+// mode: c++ //
+// compile-command: "make install" //
+// End: //
