Index: src/ResolvExpr/AdjustExprType.cc
===================================================================
--- src/ResolvExpr/AdjustExprType.cc	(revision 99da2670a9c3077bcfe60c06fde4a115b84eccae)
+++ src/ResolvExpr/AdjustExprType.cc	(revision 4eb43fa21537c79c32be1ee375bd917f2a305475)
@@ -47,7 +47,7 @@
 		void premutate( OneType * ) { visit_children = false; }
 
-		Type * postmutate( ArrayType *arrayType );
-		Type * postmutate( FunctionType *functionType );
-		Type * postmutate( TypeInstType *aggregateUseType );
+		Type * postmutate( ArrayType * arrayType );
+		Type * postmutate( FunctionType * functionType );
+		Type * postmutate( TypeInstType * aggregateUseType );
 
 		private:
@@ -61,5 +61,5 @@
 
 	Type * AdjustExprType_old::postmutate( ArrayType * arrayType ) {
-		PointerType *pointerType = new PointerType{ arrayType->get_qualifiers(), arrayType->base };
+		PointerType * pointerType = new PointerType{ arrayType->get_qualifiers(), arrayType->base };
 		arrayType->base = nullptr;
 		delete arrayType;
@@ -72,10 +72,10 @@
 
 	Type * AdjustExprType_old::postmutate( TypeInstType * typeInst ) {
-		if ( const EqvClass* eqvClass = env.lookup( typeInst->get_name() ) ) {
+		if ( const EqvClass * eqvClass = env.lookup( typeInst->get_name() ) ) {
 			if ( eqvClass->data.kind == TypeDecl::Ftype ) {
 				return new PointerType{ Type::Qualifiers(), typeInst };
 			}
-		} else if ( NamedTypeDecl *ntDecl = indexer.lookupType( typeInst->get_name() ) ) {
-			if ( TypeDecl *tyDecl = dynamic_cast< TypeDecl* >( ntDecl ) ) {
+		} else if ( const NamedTypeDecl * ntDecl = indexer.lookupType( typeInst->get_name() ) ) {
+			if ( const TypeDecl * tyDecl = dynamic_cast< const TypeDecl * >( ntDecl ) ) {
 				if ( tyDecl->get_kind() == TypeDecl::Ftype ) {
 					return new PointerType{ Type::Qualifiers(), typeInst };
@@ -89,5 +89,5 @@
 void adjustExprType( Type *&type, const TypeEnvironment &env, const SymTab::Indexer &indexer ) {
 	PassVisitor<AdjustExprType_old> adjuster( env, indexer );
-	Type *newType = type->acceptMutator( adjuster );
+	Type * newType = type->acceptMutator( adjuster );
 	type = newType;
 }
@@ -149,6 +149,6 @@
 } // anonymous namespace
 
-const ast::Type * adjustExprType( 
-	const ast::Type * type, const ast::TypeEnvironment & env, const ast::SymbolTable & symtab 
+const ast::Type * adjustExprType(
+	const ast::Type * type, const ast::TypeEnvironment & env, const ast::SymbolTable & symtab
 ) {
 	ast::Pass<AdjustExprType_new> adjuster{ env, symtab };
Index: src/ResolvExpr/AlternativeFinder.cc
===================================================================
--- src/ResolvExpr/AlternativeFinder.cc	(revision 99da2670a9c3077bcfe60c06fde4a115b84eccae)
+++ src/ResolvExpr/AlternativeFinder.cc	(revision 4eb43fa21537c79c32be1ee375bd917f2a305475)
@@ -336,7 +336,7 @@
 		}
 
-		if ( StructInstType *structInst = dynamic_cast< StructInstType* >( aggrExpr->result ) ) {
+		if ( StructInstType * structInst = dynamic_cast< StructInstType* >( aggrExpr->result ) ) {
 			addAggMembers( structInst, aggrExpr.get(), alt, alt.cost+Cost::safe, "" );
-		} else if ( UnionInstType *unionInst = dynamic_cast< UnionInstType* >( aggrExpr->result ) ) {
+		} else if ( UnionInstType * unionInst = dynamic_cast< UnionInstType* >( aggrExpr->result ) ) {
 			addAggMembers( unionInst, aggrExpr.get(), alt, alt.cost+Cost::safe, "" );
 		} // if
@@ -344,10 +344,10 @@
 
 	template< typename StructOrUnionType >
-	void AlternativeFinder::Finder::addAggMembers( StructOrUnionType *aggInst, Expression *expr, const Alternative& alt, const Cost &newCost, const std::string & name ) {
+	void AlternativeFinder::Finder::addAggMembers( StructOrUnionType * aggInst, Expression * expr, const Alternative& alt, const Cost &newCost, const std::string & name ) {
 		std::list< Declaration* > members;
 		aggInst->lookup( name, members );
 
 		for ( Declaration * decl : members ) {
-			if ( DeclarationWithType *dwt = dynamic_cast< DeclarationWithType* >( decl ) ) {
+			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
@@ -362,5 +362,5 @@
 	}
 
-	void AlternativeFinder::Finder::addTupleMembers( TupleType *tupleType, Expression *expr, 			const Alternative &alt, const Cost &newCost, Expression *member ) {
+	void AlternativeFinder::Finder::addTupleMembers( TupleType * tupleType, Expression * expr, const Alternative &alt, const Cost &newCost, Expression * member ) {
 		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
@@ -368,5 +368,5 @@
 			std::string tmp;
 			if ( val >= 0 && (unsigned long long)val < tupleType->size() ) {
-				alternatives.push_back( Alternative{ 
+				alternatives.push_back( Alternative{
 					alt, new TupleIndexExpr( expr->clone(), val ), newCost } );
 			} // if
@@ -374,5 +374,5 @@
 	}
 
-	void AlternativeFinder::Finder::postvisit( ApplicationExpr *applicationExpr ) {
+	void AlternativeFinder::Finder::postvisit( ApplicationExpr * applicationExpr ) {
 		alternatives.push_back( Alternative{ applicationExpr->clone(), env } );
 	}
@@ -475,5 +475,5 @@
 		}
 
-		// specialization cost of return types can't be accounted for directly, it disables 
+		// specialization cost of return types can't be accounted for directly, it disables
 		// otherwise-identical calls, like this example based on auto-newline in the I/O lib:
 		//
@@ -1226,6 +1226,6 @@
 				// count one safe conversion for each value that is thrown away
 				thisCost.incSafe( discardedValues );
-				Alternative newAlt{ 
-					restructureCast( alt.expr->clone(), toType, castExpr->isGenerated ), 
+				Alternative newAlt{
+					restructureCast( alt.expr->clone(), toType, castExpr->isGenerated ),
 					alt.env, openVars, needAssertions, alt.cost, alt.cost + thisCost };
 				inferParameters( newAlt, back_inserter( candidates ) );
@@ -1328,5 +1328,5 @@
 		if ( sizeofExpr->get_isType() ) {
 			Type * newType = sizeofExpr->get_type()->clone();
-			alternatives.push_back( Alternative{ 
+			alternatives.push_back( Alternative{
 				new SizeofExpr{ resolveTypeof( newType, indexer ) }, env } );
 		} else {
@@ -1343,5 +1343,5 @@
 			Alternative &choice = winners.front();
 			referenceToRvalueConversion( choice.expr, choice.cost );
-			alternatives.push_back( Alternative{ 
+			alternatives.push_back( Alternative{
 				choice, new SizeofExpr( choice.expr->clone() ), Cost::zero } );
 		} // if
@@ -1351,5 +1351,5 @@
 		if ( alignofExpr->get_isType() ) {
 			Type * newType = alignofExpr->get_type()->clone();
-			alternatives.push_back( Alternative{ 
+			alternatives.push_back( Alternative{
 				new AlignofExpr{ resolveTypeof( newType, indexer ) }, env } );
 		} else {
@@ -1366,5 +1366,5 @@
 			Alternative &choice = winners.front();
 			referenceToRvalueConversion( choice.expr, choice.cost );
-			alternatives.push_back( Alternative{ 
+			alternatives.push_back( Alternative{
 				choice, new AlignofExpr{ choice.expr->clone() }, Cost::zero } );
 		} // if
@@ -1377,5 +1377,5 @@
 		for ( std::list< Declaration* >::const_iterator i = members.begin(); i != members.end(); ++i ) {
 			if ( DeclarationWithType *dwt = dynamic_cast< DeclarationWithType* >( *i ) ) {
-				alternatives.push_back( Alternative{ 
+				alternatives.push_back( Alternative{
 					new OffsetofExpr{ aggInst->clone(), dwt }, env } );
 				renameTypes( alternatives.back().expr );
@@ -1405,8 +1405,8 @@
 
 	namespace {
-		void resolveAttr( SymTab::Indexer::IdData data, FunctionType *function, Type *argType, const TypeEnvironment &env, AlternativeFinder & finder ) {
+		void resolveAttr( SymTab::Indexer::IdData data, const FunctionType * function, Type * argType, const TypeEnvironment &env, AlternativeFinder & finder ) {
 			// assume no polymorphism
 			// assume no implicit conversions
-			assert( function->get_parameters().size() == 1 );
+			assert( function->parameters.size() == 1 );
 			PRINT(
 				std::cerr << "resolvAttr: funcDecl is ";
@@ -1418,9 +1418,9 @@
 			const SymTab::Indexer & indexer = finder.get_indexer();
 			AltList & alternatives = finder.get_alternatives();
-			if ( typesCompatibleIgnoreQualifiers( argType, function->get_parameters().front()->get_type(), indexer, env ) ) {
+			if ( typesCompatibleIgnoreQualifiers( argType, function->parameters.front()->get_type(), indexer, env ) ) {
 				Cost cost = Cost::zero;
 				Expression * newExpr = data.combine( cost );
-				alternatives.push_back( Alternative{ 
-					new AttrExpr{ newExpr, argType->clone() }, env, OpenVarSet{}, 
+				alternatives.push_back( Alternative{
+					new AttrExpr{ newExpr, argType->clone() }, env, OpenVarSet{},
 					AssertionList{}, Cost::zero, cost } );
 				for ( DeclarationWithType * retVal : function->returnVals ) {
@@ -1431,7 +1431,7 @@
 	}
 
-	void AlternativeFinder::Finder::postvisit( AttrExpr *attrExpr ) {
+	void AlternativeFinder::Finder::postvisit( AttrExpr * attrExpr ) {
 		// assume no 'pointer-to-attribute'
-		NameExpr *nameExpr = dynamic_cast< NameExpr* >( attrExpr->get_attr() );
+		NameExpr * nameExpr = dynamic_cast< NameExpr* >( attrExpr->get_attr() );
 		assert( nameExpr );
 		std::list< SymTab::Indexer::IdData > attrList;
@@ -1439,9 +1439,9 @@
 		if ( attrExpr->get_isType() || attrExpr->get_expr() ) {
 			for ( auto & data : attrList ) {
-				DeclarationWithType * id = data.id;
+				const DeclarationWithType * id = data.id;
 				// check if the type is function
-				if ( FunctionType *function = dynamic_cast< FunctionType* >( id->get_type() ) ) {
+				if ( const FunctionType * function = dynamic_cast< const FunctionType * >( id->get_type() ) ) {
 					// assume exactly one parameter
-					if ( function->get_parameters().size() == 1 ) {
+					if ( function->parameters.size() == 1 ) {
 						if ( attrExpr->get_isType() ) {
 							resolveAttr( data, function, attrExpr->get_type(), env, altFinder);
@@ -1462,5 +1462,5 @@
 				Cost cost = Cost::zero;
 				Expression * newExpr = data.combine( cost );
-				alternatives.push_back( Alternative{ 
+				alternatives.push_back( Alternative{
 					newExpr, env, OpenVarSet{}, AssertionList{}, Cost::zero, cost } );
 				renameTypes( alternatives.back().expr );
@@ -1469,5 +1469,5 @@
 	}
 
-	void AlternativeFinder::Finder::postvisit( LogicalExpr *logicalExpr ) {
+	void AlternativeFinder::Finder::postvisit( LogicalExpr * logicalExpr ) {
 		AlternativeFinder firstFinder( indexer, env );
 		firstFinder.findWithAdjustment( logicalExpr->get_arg1() );
@@ -1486,8 +1486,8 @@
 				cloneAll( second.need, need );
 
-				LogicalExpr *newExpr = new LogicalExpr{ 
+				LogicalExpr *newExpr = new LogicalExpr{
 					first.expr->clone(), second.expr->clone(), logicalExpr->get_isAnd() };
-				alternatives.push_back( Alternative{ 
-					newExpr, std::move(compositeEnv), std::move(openVars), 
+				alternatives.push_back( Alternative{
+					newExpr, std::move(compositeEnv), std::move(openVars),
 					AssertionList( need.begin(), need.end() ), first.cost + second.cost } );
 			}
@@ -1522,21 +1522,21 @@
 					cloneAll( third.need, need );
 					AssertionSet have;
-					
+
 					// unify true and false types, then infer parameters to produce new alternatives
 					Type* commonType = nullptr;
-					if ( unify( second.expr->result, third.expr->result, compositeEnv, 
+					if ( unify( second.expr->result, third.expr->result, compositeEnv,
 							need, have, openVars, indexer, commonType ) ) {
-						ConditionalExpr *newExpr = new ConditionalExpr{ 
+						ConditionalExpr *newExpr = new ConditionalExpr{
 							first.expr->clone(), second.expr->clone(), third.expr->clone() };
 						newExpr->result = commonType ? commonType : second.expr->result->clone();
 						// convert both options to the conditional result type
 						Cost cost = first.cost + second.cost + third.cost;
-						cost += computeExpressionConversionCost( 
+						cost += computeExpressionConversionCost(
 							newExpr->arg2, newExpr->result, indexer, compositeEnv );
-						cost += computeExpressionConversionCost( 
+						cost += computeExpressionConversionCost(
 							newExpr->arg3, newExpr->result, indexer, compositeEnv );
 						// output alternative
-						Alternative newAlt{ 
-							newExpr, std::move(compositeEnv), std::move(openVars), 
+						Alternative newAlt{
+							newExpr, std::move(compositeEnv), std::move(openVars),
 							AssertionList( need.begin(), need.end() ), cost };
 						inferParameters( newAlt, back_inserter( alternatives ) );
@@ -1553,5 +1553,5 @@
 		secondFinder.findWithAdjustment( commaExpr->get_arg2() );
 		for ( const Alternative & alt : secondFinder.alternatives ) {
-			alternatives.push_back( Alternative{ 
+			alternatives.push_back( Alternative{
 				alt, new CommaExpr{ newFirstArg->clone(), alt.expr->clone() }, alt.cost } );
 		} // for
@@ -1579,11 +1579,11 @@
 
 				Type* commonType = nullptr;
-				if ( unify( first.expr->result, second.expr->result, compositeEnv, need, have, 
+				if ( unify( first.expr->result, second.expr->result, compositeEnv, need, have,
 						openVars, indexer, commonType ) ) {
-					RangeExpr * newExpr = 
+					RangeExpr * newExpr =
 						new RangeExpr{ first.expr->clone(), second.expr->clone() };
 					newExpr->result = commonType ? commonType : first.expr->result->clone();
-					Alternative newAlt{ 
-						newExpr, std::move(compositeEnv), std::move(openVars), 
+					Alternative newAlt{
+						newExpr, std::move(compositeEnv), std::move(openVars),
 						AssertionList( need.begin(), need.end() ), first.cost + second.cost };
 					inferParameters( newAlt, back_inserter( alternatives ) );
@@ -1612,7 +1612,7 @@
 				cloneAll( alt.need, need );
 			}
-			
-			alternatives.push_back( Alternative{ 
-				new TupleExpr{ exprs }, std::move(compositeEnv), std::move(openVars), 
+
+			alternatives.push_back( Alternative{
+				new TupleExpr{ exprs }, std::move(compositeEnv), std::move(openVars),
 				AssertionList( need.begin(), need.end() ), sumCost( alts ) } );
 		} // for
@@ -1633,5 +1633,5 @@
 		finder.findWithoutPrune( ctorExpr->get_callExpr() );
 		for ( Alternative & alt : finder.alternatives ) {
-			alternatives.push_back( Alternative{ 
+			alternatives.push_back( Alternative{
 				alt, new ConstructorExpr( alt.expr->clone() ), alt.cost } );
 		}
@@ -1685,21 +1685,21 @@
 				cloneAll( alt.need, need );
 				AssertionSet have;
-				OpenVarSet openVars( alt.openVars );  
-				// xxx - find things in env that don't have a "representative type" and claim 
+				OpenVarSet openVars( alt.openVars );
+				// xxx - find things in env that don't have a "representative type" and claim
 				// those are open vars?
 				PRINT(
 					std::cerr << "  @ " << toType << " " << initAlt.designation << std::endl;
 				)
-				// It's possible that a cast can throw away some values in a multiply-valued 
-				// expression. (An example is a cast-to-void, which casts from one value to 
-				// zero.)  Figure out the prefix of the subexpression results that are cast 
-				// directly.  The candidate is invalid if it has fewer results than there are 
+				// It's possible that a cast can throw away some values in a multiply-valued
+				// expression. (An example is a cast-to-void, which casts from one value to
+				// zero.)  Figure out the prefix of the subexpression results that are cast
+				// directly.  The candidate is invalid if it has fewer results than there are
 				// types to cast to.
 				int discardedValues = alt.expr->result->size() - toType->size();
 				if ( discardedValues < 0 ) continue;
-				// xxx - may need to go into tuple types and extract relevant types and use 
-				// unifyList. Note that currently, this does not allow casting a tuple to an 
+				// xxx - may need to go into tuple types and extract relevant types and use
+				// unifyList. Note that currently, this does not allow casting a tuple to an
 				// atomic type (e.g. (int)([1, 2, 3]))
-				
+
 				// unification run for side-effects
 				unify( toType, alt.expr->result, newEnv, need, have, openVars, indexer );
@@ -1710,8 +1710,8 @@
 					// count one safe conversion for each value that is thrown away
 					thisCost.incSafe( discardedValues );
-					Alternative newAlt{ 
-						new InitExpr{ 
-							restructureCast( alt.expr->clone(), toType, true ), initAlt.designation->clone() }, 
-						std::move(newEnv), std::move(openVars), 
+					Alternative newAlt{
+						new InitExpr{
+							restructureCast( alt.expr->clone(), toType, true ), initAlt.designation->clone() },
+						std::move(newEnv), std::move(openVars),
 						AssertionList( need.begin(), need.end() ), alt.cost, thisCost };
 					inferParameters( newAlt, back_inserter( candidates ) );
Index: src/ResolvExpr/CastCost.cc
===================================================================
--- src/ResolvExpr/CastCost.cc	(revision 99da2670a9c3077bcfe60c06fde4a115b84eccae)
+++ src/ResolvExpr/CastCost.cc	(revision 4eb43fa21537c79c32be1ee375bd917f2a305475)
@@ -37,15 +37,15 @@
 	struct CastCost_old : public ConversionCost {
 	  public:
-		CastCost_old( Type *dest, const SymTab::Indexer &indexer, const TypeEnvironment &env, CostFunction costFunc );
+		CastCost_old( const Type * dest, const SymTab::Indexer &indexer, const TypeEnvironment &env, CostFunction costFunc );
 
 		using ConversionCost::previsit;
 		using ConversionCost::postvisit;
-		void postvisit( BasicType * basicType );
-		void postvisit( PointerType * pointerType );
+		void postvisit( const BasicType * basicType );
+		void postvisit( const PointerType * pointerType );
 	};
 
-	Cost castCost( Type *src, Type *dest, const SymTab::Indexer &indexer, const TypeEnvironment &env ) {
-		if ( TypeInstType *destAsTypeInst = dynamic_cast< TypeInstType* >( dest ) ) {
-			if ( const EqvClass* eqvClass = env.lookup( destAsTypeInst->get_name() ) ) {
+	Cost castCost( const Type * src, const Type * dest, const SymTab::Indexer &indexer, const TypeEnvironment &env ) {
+		if ( const TypeInstType * destAsTypeInst = dynamic_cast< const TypeInstType * >( dest ) ) {
+			if ( const EqvClass * eqvClass = env.lookup( destAsTypeInst->name ) ) {
 				if ( eqvClass->type ) {
 					return castCost( src, eqvClass->type, indexer, env );
@@ -53,7 +53,7 @@
 					return Cost::infinity;
 				}
-			} else if ( NamedTypeDecl *namedType = indexer.lookupType( destAsTypeInst->get_name() ) ) {
+			} else if ( const NamedTypeDecl * namedType = indexer.lookupType( destAsTypeInst->name ) ) {
 				// all typedefs should be gone by this point
-				TypeDecl *type = strict_dynamic_cast< TypeDecl* >( namedType );
+				const TypeDecl * type = strict_dynamic_cast< const TypeDecl * >( namedType );
 				if ( type->base ) {
 					return castCost( src, type->base, indexer, env ) + Cost::safe;
@@ -74,15 +74,15 @@
 			PRINT( std::cerr << "compatible!" << std::endl; )
 			return Cost::zero;
-		} else if ( dynamic_cast< VoidType* >( dest ) ) {
+		} else if ( dynamic_cast< const VoidType * >( dest ) ) {
 			return Cost::safe;
-		} else if ( ReferenceType * refType = dynamic_cast< ReferenceType * > ( dest ) ) {
+		} else if ( const ReferenceType * refType = dynamic_cast< const ReferenceType * > ( dest ) ) {
 			PRINT( std::cerr << "conversionCost: dest is reference" << std::endl; )
-			return convertToReferenceCost( src, refType, indexer, env, [](Type * t1, Type * t2, const SymTab::Indexer & indexer, const TypeEnvironment & env ) {
+			return convertToReferenceCost( src, refType, indexer, env, [](const Type * t1, const Type * t2, const SymTab::Indexer & indexer, const TypeEnvironment & env ) {
 				return ptrsCastable( t1, t2, env, indexer );
 			});
 		} else {
-			PassVisitor<CastCost_old> converter( 
-				dest, indexer, env, 
-				(Cost (*)( Type *, Type *, const SymTab::Indexer &, const TypeEnvironment & ))
+			PassVisitor<CastCost_old> converter(
+				dest, indexer, env,
+				(Cost (*)( const Type *, const Type *, const SymTab::Indexer &, const TypeEnvironment & ))
 					castCost );
 			src->accept( converter );
@@ -96,12 +96,12 @@
 	}
 
-	CastCost_old::CastCost_old( Type *dest, const SymTab::Indexer &indexer, const TypeEnvironment &env, CostFunction costFunc )
+	CastCost_old::CastCost_old( const Type * dest, const SymTab::Indexer &indexer, const TypeEnvironment &env, CostFunction costFunc )
 		: ConversionCost( dest, indexer, env, costFunc ) {
 	}
 
-	void CastCost_old::postvisit( BasicType *basicType ) {
-		PointerType *destAsPointer = dynamic_cast< PointerType* >( dest );
+	void CastCost_old::postvisit( const BasicType * basicType ) {
+		const PointerType * destAsPointer = dynamic_cast< const PointerType * >( dest );
 		if ( destAsPointer && basicType->isInteger() ) {
-			// necessary for, e.g. unsigned long => void*
+			// necessary for, e.g. unsigned long => void *
 			cost = Cost::unsafe;
 		} else {
@@ -110,7 +110,7 @@
 	}
 
-	void CastCost_old::postvisit( PointerType *pointerType ) {
-		if ( PointerType *destAsPtr = dynamic_cast< PointerType* >( dest ) ) {
-			if ( pointerType->get_qualifiers() <= destAsPtr->get_qualifiers() && typesCompatibleIgnoreQualifiers( pointerType->base, destAsPtr->base, indexer, env ) ) {
+	void CastCost_old::postvisit( const PointerType * pointerType ) {
+		if ( const PointerType * destAsPtr = dynamic_cast< const PointerType * >( dest ) ) {
+			if ( pointerType->tq <= destAsPtr->tq && typesCompatibleIgnoreQualifiers( pointerType->base, destAsPtr->base, indexer, env ) ) {
 				cost = Cost::safe;
 			} else {
@@ -125,7 +125,7 @@
 				} // if
 			} // if
-		} else if ( BasicType *destAsBasic = dynamic_cast< BasicType* >( dest ) ) {
+		} else if ( const BasicType * destAsBasic = dynamic_cast< const BasicType * >( dest ) ) {
 			if ( destAsBasic->isInteger() ) {
-				// necessary for, e.g. void* => unsigned long
+				// necessary for, e.g. void * => unsigned long
 				cost = Cost::unsafe;
 			} // if
@@ -138,6 +138,6 @@
 		using ConversionCost_new::postvisit;
 
-		CastCost_new( 
-			const ast::Type * dst, const ast::SymbolTable & symtab, 
+		CastCost_new(
+			const ast::Type * dst, const ast::SymbolTable & symtab,
 			const ast::TypeEnvironment & env, CostCalculation costFunc )
 		: ConversionCost_new( dst, symtab, env, costFunc ) {}
@@ -182,7 +182,7 @@
 } // anonymous namespace
 
-Cost castCost( 
-	const ast::Type * src, const ast::Type * dst, const ast::SymbolTable & symtab, 
-	const ast::TypeEnvironment & env 
+Cost castCost(
+	const ast::Type * src, const ast::Type * dst, const ast::SymbolTable & symtab,
+	const ast::TypeEnvironment & env
 ) {
 	if ( auto typeInst = dynamic_cast< const ast::TypeInstType * >( dst ) ) {
@@ -220,8 +220,8 @@
 		PRINT( std::cerr << "conversionCost: dest is reference" << std::endl; )
 		#warning cast on ptrsCastable artifact of having two functions, remove when port done
-		return convertToReferenceCost( 
-			src, refType, symtab, env, 
-			( int (*)( 
-				const ast::Type *, const ast::Type *, const ast::SymbolTable &, 
+		return convertToReferenceCost(
+			src, refType, symtab, env,
+			( int (*)(
+				const ast::Type *, const ast::Type *, const ast::SymbolTable &,
 				const ast::TypeEnvironment & )
 			) ptrsCastable );
@@ -229,7 +229,7 @@
 		#warning cast on castCost artifact of having two functions, remove when port done
 		ast::Pass< CastCost_new > converter{
-			dst, symtab, env, 
-			( Cost (*)( 
-				const ast::Type *, const ast::Type *, const ast::SymbolTable &, 
+			dst, symtab, env,
+			( Cost (*)(
+				const ast::Type *, const ast::Type *, const ast::SymbolTable &,
 				const ast::TypeEnvironment & )
 			) castCost };
Index: src/ResolvExpr/CommonType.cc
===================================================================
--- src/ResolvExpr/CommonType.cc	(revision 99da2670a9c3077bcfe60c06fde4a115b84eccae)
+++ src/ResolvExpr/CommonType.cc	(revision 4eb43fa21537c79c32be1ee375bd917f2a305475)
@@ -38,6 +38,6 @@
 namespace ResolvExpr {
 	struct CommonType_old : public WithShortCircuiting {
-		CommonType_old( Type *type2, bool widenFirst, bool widenSecond, const SymTab::Indexer &indexer, TypeEnvironment &env, const OpenVarSet &openVars );
-		Type *get_result() const { return result; }
+		CommonType_old( Type * type2, bool widenFirst, bool widenSecond, const SymTab::Indexer &indexer, TypeEnvironment &env, const OpenVarSet &openVars );
+		Type * get_result() const { return result; }
 
 		void previsit( BaseSyntaxNode * ) { visit_children = false; }
@@ -60,9 +60,9 @@
 
 	  private:
-		template< typename Pointer > void getCommonWithVoidPointer( Pointer* voidPointer, Pointer* otherPointer );
-		template< typename RefType > void handleRefType( RefType *inst, Type *other );
-
-		Type *result;
-		Type *type2;				// inherited
+		template< typename Pointer > void getCommonWithVoidPointer( Pointer * voidPointer, Pointer * otherPointer );
+		template< typename RefType > void handleRefType( RefType * inst, Type * other );
+
+		Type * result;
+		Type * type2;				// inherited
 		bool widenFirst, widenSecond;
 		const SymTab::Indexer &indexer;
@@ -80,10 +80,10 @@
 				std::cerr << "unify success: " << widenFirst << " " << widenSecond << std::endl;
 			)
-			if ( (widenFirst || t2->get_qualifiers() <= t1->get_qualifiers()) && (widenSecond || t1->get_qualifiers() <= t2->get_qualifiers()) ) {
+			if ( (widenFirst || t2->tq <= t1->tq) && (widenSecond || t1->tq <= t2->tq) ) {
 				PRINT(
 					std::cerr << "widen okay" << std::endl;
 				)
-				common->get_qualifiers() |= t1->get_qualifiers();
-				common->get_qualifiers() |= t2->get_qualifiers();
+				common->tq |= t1->tq;
+				common->tq |= t2->tq;
 				return common;
 			}
@@ -95,5 +95,5 @@
 	}
 
-	Type *commonType( Type *type1, Type *type2, bool widenFirst, bool widenSecond, const SymTab::Indexer &indexer, TypeEnvironment &env, const OpenVarSet &openVars ) {
+	Type * commonType( Type * type1, Type * type2, bool widenFirst, bool widenSecond, const SymTab::Indexer &indexer, TypeEnvironment &env, const OpenVarSet &openVars ) {
 		PassVisitor<CommonType_old> visitor( type2, widenFirst, widenSecond, indexer, env, openVars );
 
@@ -127,5 +127,5 @@
 						std::cerr << "formal is reference; result should be reference" << std::endl;
 					)
-					result = new ReferenceType( ref1->get_qualifiers(), result );
+					result = new ReferenceType( ref1->tq, result );
 				}
 				PRINT(
@@ -138,23 +138,23 @@
 
 		type1->accept( visitor );
-		Type *result = visitor.pass.get_result();
+		Type * result = visitor.pass.get_result();
 		if ( ! result ) {
 			// this appears to be handling for opaque type declarations
 			if ( widenSecond ) {
-				if ( TypeInstType *inst = dynamic_cast< TypeInstType* >( type2 ) ) {
-					if ( NamedTypeDecl *nt = indexer.lookupType( inst->get_name() ) ) {
-						TypeDecl *type = strict_dynamic_cast< TypeDecl* >( nt );
+				if ( const TypeInstType * inst = dynamic_cast< const TypeInstType * >( type2 ) ) {
+					if ( const NamedTypeDecl * nt = indexer.lookupType( inst->get_name() ) ) {
+						const TypeDecl * type = strict_dynamic_cast< const TypeDecl * >( nt );
 						if ( type->get_base() ) {
-							Type::Qualifiers tq1 = type1->get_qualifiers(), tq2 = type2->get_qualifiers();
+							Type::Qualifiers tq1 = type1->tq, tq2 = type2->tq;
 							AssertionSet have, need;
 							OpenVarSet newOpen( openVars );
-							type1->get_qualifiers() = Type::Qualifiers();
-							type->get_base()->get_qualifiers() = tq1;
+							type1->tq = Type::Qualifiers();
+							type->get_base()->tq = tq1;
 							if ( unifyExact( type1, type->get_base(), env, have, need, newOpen, indexer ) ) {
 								result = type1->clone();
-								result->get_qualifiers() = tq1 | tq2;
+								result->tq = tq1 | tq2;
 							} // if
-							type1->get_qualifiers() = tq1;
-							type->get_base()->get_qualifiers() = Type::Qualifiers();
+							type1->tq = tq1;
+							type->get_base()->tq = Type::Qualifiers();
 						} // if
 					} // if
@@ -190,5 +190,5 @@
 				 */
 				  {
-		/*     B*/                BT Bool,                BT Char,          BT SignedChar,        BT UnsignedChar,      BT ShortSignedInt,    BT ShortUnsignedInt,
+		/*     B */                BT Bool,                BT Char,          BT SignedChar,        BT UnsignedChar,      BT ShortSignedInt,    BT ShortUnsignedInt,
 				             BT SignedInt,         BT UnsignedInt,       BT LongSignedInt,     BT LongUnsignedInt,   BT LongLongSignedInt, BT LongLongUnsignedInt,
 				          BT SignedInt128,      BT UnsignedInt128,            BT uFloat16,     BT uFloat16Complex,            BT uFloat32,     BT uFloat32Complex,
@@ -198,5 +198,5 @@
 				  },
 				  {
-		/*     C*/                BT Char,                BT Char,          BT SignedChar,        BT UnsignedChar,      BT ShortSignedInt,    BT ShortUnsignedInt,
+		/*     C */                BT Char,                BT Char,          BT SignedChar,        BT UnsignedChar,      BT ShortSignedInt,    BT ShortUnsignedInt,
 				             BT SignedInt,         BT UnsignedInt,       BT LongSignedInt,     BT LongUnsignedInt,   BT LongLongSignedInt, BT LongLongUnsignedInt,
 				          BT SignedInt128,      BT UnsignedInt128,            BT uFloat16,     BT uFloat16Complex,            BT uFloat32,     BT uFloat32Complex,
@@ -206,5 +206,5 @@
 				  },
 				  {
-		/*    SC*/          BT SignedChar,          BT SignedChar,          BT SignedChar,        BT UnsignedChar,      BT ShortSignedInt,    BT ShortUnsignedInt,
+		/*    SC */          BT SignedChar,          BT SignedChar,          BT SignedChar,        BT UnsignedChar,      BT ShortSignedInt,    BT ShortUnsignedInt,
 				             BT SignedInt,         BT UnsignedInt,       BT LongSignedInt,     BT LongUnsignedInt,   BT LongLongSignedInt, BT LongLongUnsignedInt,
 				          BT SignedInt128,      BT UnsignedInt128,            BT uFloat16,     BT uFloat16Complex,            BT uFloat32,     BT uFloat32Complex,
@@ -214,5 +214,5 @@
 				  },
 				  {
-		/*    UC*/        BT UnsignedChar,        BT UnsignedChar,        BT UnsignedChar,        BT UnsignedChar,      BT ShortSignedInt,    BT ShortUnsignedInt,
+		/*    UC */        BT UnsignedChar,        BT UnsignedChar,        BT UnsignedChar,        BT UnsignedChar,      BT ShortSignedInt,    BT ShortUnsignedInt,
 				             BT SignedInt,         BT UnsignedInt,       BT LongSignedInt,     BT LongUnsignedInt,   BT LongLongSignedInt, BT LongLongUnsignedInt,
 				          BT SignedInt128,      BT UnsignedInt128,            BT uFloat16,     BT uFloat16Complex,            BT uFloat32,     BT uFloat32Complex,
@@ -222,5 +222,5 @@
 				  },
 				  {
-		/*    SI*/      BT ShortSignedInt,      BT ShortSignedInt,      BT ShortSignedInt,      BT ShortSignedInt,      BT ShortSignedInt,    BT ShortUnsignedInt,
+		/*    SI */      BT ShortSignedInt,      BT ShortSignedInt,      BT ShortSignedInt,      BT ShortSignedInt,      BT ShortSignedInt,    BT ShortUnsignedInt,
 				             BT SignedInt,         BT UnsignedInt,       BT LongSignedInt,     BT LongUnsignedInt,   BT LongLongSignedInt, BT LongLongUnsignedInt,
 				          BT SignedInt128,      BT UnsignedInt128,            BT uFloat16,     BT uFloat16Complex,            BT uFloat32,     BT uFloat32Complex,
@@ -230,5 +230,5 @@
 				  },
 				  {
-		/*   SUI*/    BT ShortUnsignedInt,    BT ShortUnsignedInt,    BT ShortUnsignedInt,    BT ShortUnsignedInt,    BT ShortUnsignedInt,    BT ShortUnsignedInt,
+		/*   SUI */    BT ShortUnsignedInt,    BT ShortUnsignedInt,    BT ShortUnsignedInt,    BT ShortUnsignedInt,    BT ShortUnsignedInt,    BT ShortUnsignedInt,
 				             BT SignedInt,         BT UnsignedInt,       BT LongSignedInt,     BT LongUnsignedInt,   BT LongLongSignedInt, BT LongLongUnsignedInt,
 				          BT SignedInt128,      BT UnsignedInt128,            BT uFloat16,     BT uFloat16Complex,            BT uFloat32,     BT uFloat32Complex,
@@ -238,5 +238,5 @@
 				  },
 				  {
-		/*     I*/           BT SignedInt,           BT SignedInt,           BT SignedInt,           BT SignedInt,           BT SignedInt,           BT SignedInt,
+		/*     I */           BT SignedInt,           BT SignedInt,           BT SignedInt,           BT SignedInt,           BT SignedInt,           BT SignedInt,
 				             BT SignedInt,         BT UnsignedInt,       BT LongSignedInt,     BT LongUnsignedInt,   BT LongLongSignedInt, BT LongLongUnsignedInt,
 				          BT SignedInt128,      BT UnsignedInt128,            BT uFloat16,     BT uFloat16Complex,            BT uFloat32,     BT uFloat32Complex,
@@ -246,5 +246,5 @@
 				  },
 				  {
-		/*    UI*/         BT UnsignedInt,         BT UnsignedInt,         BT UnsignedInt,         BT UnsignedInt,         BT UnsignedInt,         BT UnsignedInt,
+		/*    UI */         BT UnsignedInt,         BT UnsignedInt,         BT UnsignedInt,         BT UnsignedInt,         BT UnsignedInt,         BT UnsignedInt,
 				           BT UnsignedInt,         BT UnsignedInt,       BT LongSignedInt,     BT LongUnsignedInt,   BT LongLongSignedInt, BT LongLongUnsignedInt,
 				          BT SignedInt128,      BT UnsignedInt128,            BT uFloat16,     BT uFloat16Complex,            BT uFloat32,     BT uFloat32Complex,
@@ -254,5 +254,5 @@
 				  },
 				  {
-		/*    LI*/       BT LongSignedInt,       BT LongSignedInt,       BT LongSignedInt,       BT LongSignedInt,       BT LongSignedInt,       BT LongSignedInt,
+		/*    LI */       BT LongSignedInt,       BT LongSignedInt,       BT LongSignedInt,       BT LongSignedInt,       BT LongSignedInt,       BT LongSignedInt,
 				         BT LongSignedInt,       BT LongSignedInt,       BT LongSignedInt,     BT LongUnsignedInt,   BT LongLongSignedInt, BT LongLongUnsignedInt,
 				          BT SignedInt128,      BT UnsignedInt128,            BT uFloat16,     BT uFloat16Complex,            BT uFloat32,     BT uFloat32Complex,
@@ -262,5 +262,5 @@
 				  },
 				  {
-		/*   LUI*/     BT LongUnsignedInt,     BT LongUnsignedInt,     BT LongUnsignedInt,     BT LongUnsignedInt,     BT LongUnsignedInt,     BT LongUnsignedInt,
+		/*   LUI */     BT LongUnsignedInt,     BT LongUnsignedInt,     BT LongUnsignedInt,     BT LongUnsignedInt,     BT LongUnsignedInt,     BT LongUnsignedInt,
 				       BT LongUnsignedInt,     BT LongUnsignedInt,     BT LongUnsignedInt,     BT LongUnsignedInt,   BT LongLongSignedInt, BT LongLongUnsignedInt,
 				          BT SignedInt128,      BT UnsignedInt128,            BT uFloat16,     BT uFloat16Complex,            BT uFloat32,     BT uFloat32Complex,
@@ -270,5 +270,5 @@
 				  },
 				  {
-		/*   LLI*/   BT LongLongSignedInt,   BT LongLongSignedInt,   BT LongLongSignedInt,   BT LongLongSignedInt,   BT LongLongSignedInt,   BT LongLongSignedInt,
+		/*   LLI */   BT LongLongSignedInt,   BT LongLongSignedInt,   BT LongLongSignedInt,   BT LongLongSignedInt,   BT LongLongSignedInt,   BT LongLongSignedInt,
 				     BT LongLongSignedInt,   BT LongLongSignedInt,   BT LongLongSignedInt,   BT LongLongSignedInt,   BT LongLongSignedInt, BT LongLongUnsignedInt,
 				          BT SignedInt128,      BT UnsignedInt128,            BT uFloat16,     BT uFloat16Complex,            BT uFloat32,     BT uFloat32Complex,
@@ -278,5 +278,5 @@
 				  },
 				  {
-		/*  LLUI*/ BT LongLongUnsignedInt, BT LongLongUnsignedInt, BT LongLongUnsignedInt, BT LongLongUnsignedInt, BT LongLongUnsignedInt, BT LongLongUnsignedInt,
+		/*  LLUI */ BT LongLongUnsignedInt, BT LongLongUnsignedInt, BT LongLongUnsignedInt, BT LongLongUnsignedInt, BT LongLongUnsignedInt, BT LongLongUnsignedInt,
 				   BT LongLongUnsignedInt, BT LongLongUnsignedInt, BT LongLongUnsignedInt, BT LongLongUnsignedInt, BT LongLongUnsignedInt, BT LongLongUnsignedInt,
 				          BT SignedInt128,      BT UnsignedInt128,            BT uFloat16,     BT uFloat16Complex,            BT uFloat32,     BT uFloat32Complex,
@@ -286,5 +286,5 @@
 				  },
 				  {
-		/*    IB*/        BT SignedInt128,        BT SignedInt128,        BT SignedInt128,        BT SignedInt128,        BT SignedInt128,        BT SignedInt128,
+		/*    IB */        BT SignedInt128,        BT SignedInt128,        BT SignedInt128,        BT SignedInt128,        BT SignedInt128,        BT SignedInt128,
 				          BT SignedInt128,        BT SignedInt128,        BT SignedInt128,        BT SignedInt128,        BT SignedInt128,        BT SignedInt128,
 				          BT SignedInt128,      BT UnsignedInt128,            BT uFloat16,     BT uFloat16Complex,            BT uFloat32,     BT uFloat32Complex,
@@ -294,5 +294,5 @@
 				  },
 				  {
-		/*   UIB*/      BT UnsignedInt128,      BT UnsignedInt128,      BT UnsignedInt128,      BT UnsignedInt128,      BT UnsignedInt128,      BT UnsignedInt128,
+		/*   UIB */      BT UnsignedInt128,      BT UnsignedInt128,      BT UnsignedInt128,      BT UnsignedInt128,      BT UnsignedInt128,      BT UnsignedInt128,
 				        BT UnsignedInt128,      BT UnsignedInt128,      BT UnsignedInt128,      BT UnsignedInt128,      BT UnsignedInt128,      BT UnsignedInt128,
 				        BT UnsignedInt128,      BT UnsignedInt128,            BT uFloat16,     BT uFloat16Complex,            BT uFloat32,     BT uFloat32Complex,
@@ -302,5 +302,5 @@
 				  },
 				  {
-		/*   _FH*/            BT uFloat16,            BT uFloat16,            BT uFloat16,            BT uFloat16,            BT uFloat16,            BT uFloat16,
+		/*   _FH */            BT uFloat16,            BT uFloat16,            BT uFloat16,            BT uFloat16,            BT uFloat16,            BT uFloat16,
 				              BT uFloat16,            BT uFloat16,            BT uFloat16,            BT uFloat16,            BT uFloat16,            BT uFloat16,
 				              BT uFloat16,            BT uFloat16,            BT uFloat16,     BT uFloat16Complex,            BT uFloat32,     BT uFloat32Complex,
@@ -310,5 +310,5 @@
 				  },
 				  {
-		/*   _FH*/     BT uFloat16Complex,     BT uFloat16Complex,     BT uFloat16Complex,     BT uFloat16Complex,     BT uFloat16Complex,     BT uFloat16Complex,
+		/*   _FH */     BT uFloat16Complex,     BT uFloat16Complex,     BT uFloat16Complex,     BT uFloat16Complex,     BT uFloat16Complex,     BT uFloat16Complex,
 				       BT uFloat16Complex,     BT uFloat16Complex,     BT uFloat16Complex,     BT uFloat16Complex,     BT uFloat16Complex,     BT uFloat16Complex,
 				       BT uFloat16Complex,     BT uFloat16Complex,     BT uFloat16Complex,     BT uFloat16Complex,     BT uFloat32Complex,     BT uFloat32Complex,
@@ -318,5 +318,5 @@
 				  },
 				  {
-		/*    _F*/            BT uFloat32,            BT uFloat32,            BT uFloat32,            BT uFloat32,            BT uFloat32,            BT uFloat32,
+		/*    _F */            BT uFloat32,            BT uFloat32,            BT uFloat32,            BT uFloat32,            BT uFloat32,            BT uFloat32,
 				              BT uFloat32,            BT uFloat32,            BT uFloat32,            BT uFloat32,            BT uFloat32,            BT uFloat32,
 				              BT uFloat32,            BT uFloat32,            BT uFloat32,     BT uFloat32Complex,            BT uFloat32,     BT uFloat32Complex,
@@ -326,5 +326,5 @@
 				  },
 				  {
-		/*   _FC*/     BT uFloat32Complex,     BT uFloat32Complex,     BT uFloat32Complex,     BT uFloat32Complex,     BT uFloat32Complex,     BT uFloat32Complex,
+		/*   _FC */     BT uFloat32Complex,     BT uFloat32Complex,     BT uFloat32Complex,     BT uFloat32Complex,     BT uFloat32Complex,     BT uFloat32Complex,
 				       BT uFloat32Complex,     BT uFloat32Complex,     BT uFloat32Complex,     BT uFloat32Complex,     BT uFloat32Complex,     BT uFloat32Complex,
 				       BT uFloat32Complex,     BT uFloat32Complex,     BT uFloat32Complex,     BT uFloat32Complex,     BT uFloat32Complex,     BT uFloat32Complex,
@@ -334,5 +334,5 @@
 				  },
 				  {
-		/*     F*/               BT Float,               BT Float,               BT Float,               BT Float,               BT Float,               BT Float,
+		/*     F */               BT Float,               BT Float,               BT Float,               BT Float,               BT Float,               BT Float,
 				                 BT Float,               BT Float,               BT Float,               BT Float,               BT Float,               BT Float,
 				                 BT Float,               BT Float,               BT Float,        BT FloatComplex,               BT Float,        BT FloatComplex,
@@ -342,5 +342,5 @@
 				  },
 				  {
-		/*    FC*/        BT FloatComplex,        BT FloatComplex,        BT FloatComplex,        BT FloatComplex,        BT FloatComplex,        BT FloatComplex,
+		/*    FC */        BT FloatComplex,        BT FloatComplex,        BT FloatComplex,        BT FloatComplex,        BT FloatComplex,        BT FloatComplex,
 				          BT FloatComplex,        BT FloatComplex,        BT FloatComplex,        BT FloatComplex,        BT FloatComplex,        BT FloatComplex,
 				          BT FloatComplex,        BT FloatComplex,        BT FloatComplex,        BT FloatComplex,        BT FloatComplex,        BT FloatComplex,
@@ -350,5 +350,5 @@
 				  },
 				  {
-		/*   _FX*/           BT uFloat32x,           BT uFloat32x,           BT uFloat32x,           BT uFloat32x,           BT uFloat32x,           BT uFloat32x,
+		/*   _FX */           BT uFloat32x,           BT uFloat32x,           BT uFloat32x,           BT uFloat32x,           BT uFloat32x,           BT uFloat32x,
 				             BT uFloat32x,           BT uFloat32x,           BT uFloat32x,           BT uFloat32x,           BT uFloat32x,           BT uFloat32x,
 				             BT uFloat32x,           BT uFloat32x,           BT uFloat32x,    BT uFloat32xComplex,           BT uFloat32x,    BT uFloat32xComplex,
@@ -358,5 +358,5 @@
 				  },
 				  {
-		/*  _FXC*/    BT uFloat32xComplex,    BT uFloat32xComplex,    BT uFloat32xComplex,    BT uFloat32xComplex,    BT uFloat32xComplex,    BT uFloat32xComplex,
+		/*  _FXC */    BT uFloat32xComplex,    BT uFloat32xComplex,    BT uFloat32xComplex,    BT uFloat32xComplex,    BT uFloat32xComplex,    BT uFloat32xComplex,
 				      BT uFloat32xComplex,    BT uFloat32xComplex,    BT uFloat32xComplex,    BT uFloat32xComplex,    BT uFloat32xComplex,    BT uFloat32xComplex,
 				      BT uFloat32xComplex,    BT uFloat32xComplex,    BT uFloat32xComplex,    BT uFloat32xComplex,    BT uFloat32xComplex,    BT uFloat32xComplex,
@@ -366,5 +366,5 @@
 				  },
 				  {
-		/*    FD*/            BT uFloat64,            BT uFloat64,            BT uFloat64,            BT uFloat64,            BT uFloat64,            BT uFloat64,
+		/*    FD */            BT uFloat64,            BT uFloat64,            BT uFloat64,            BT uFloat64,            BT uFloat64,            BT uFloat64,
 				              BT uFloat64,            BT uFloat64,            BT uFloat64,            BT uFloat64,            BT uFloat64,            BT uFloat64,
 				              BT uFloat64,            BT uFloat64,            BT uFloat64,     BT uFloat64Complex,            BT uFloat64,     BT uFloat64Complex,
@@ -374,5 +374,5 @@
 				  },
 				  {
-		/*  _FDC*/     BT uFloat64Complex,     BT uFloat64Complex,     BT uFloat64Complex,     BT uFloat64Complex,     BT uFloat64Complex,     BT uFloat64Complex,
+		/*  _FDC */     BT uFloat64Complex,     BT uFloat64Complex,     BT uFloat64Complex,     BT uFloat64Complex,     BT uFloat64Complex,     BT uFloat64Complex,
 				       BT uFloat64Complex,     BT uFloat64Complex,     BT uFloat64Complex,     BT uFloat64Complex,     BT uFloat64Complex,     BT uFloat64Complex,
 				       BT uFloat64Complex,     BT uFloat64Complex,     BT uFloat64Complex,     BT uFloat64Complex,     BT uFloat64Complex,     BT uFloat64Complex,
@@ -382,5 +382,5 @@
 				  },
 				  {
-		/*     D*/              BT Double,              BT Double,              BT Double,              BT Double,              BT Double,              BT Double,
+		/*     D */              BT Double,              BT Double,              BT Double,              BT Double,              BT Double,              BT Double,
 				                BT Double,              BT Double,              BT Double,              BT Double,              BT Double,              BT Double,
 				                BT Double,              BT Double,              BT Double,       BT DoubleComplex,              BT Double,       BT DoubleComplex,
@@ -390,5 +390,5 @@
 				  },
 				  {
-		/*    DC*/       BT DoubleComplex,       BT DoubleComplex,       BT DoubleComplex,       BT DoubleComplex,       BT DoubleComplex,       BT DoubleComplex,
+		/*    DC */       BT DoubleComplex,       BT DoubleComplex,       BT DoubleComplex,       BT DoubleComplex,       BT DoubleComplex,       BT DoubleComplex,
 				         BT DoubleComplex,       BT DoubleComplex,       BT DoubleComplex,       BT DoubleComplex,       BT DoubleComplex,       BT DoubleComplex,
 				         BT DoubleComplex,       BT DoubleComplex,       BT DoubleComplex,       BT DoubleComplex,       BT DoubleComplex,       BT DoubleComplex,
@@ -398,5 +398,5 @@
 				  },
 				  {
-		/*  F80X*/           BT uFloat64x,           BT uFloat64x,           BT uFloat64x,           BT uFloat64x,           BT uFloat64x,           BT uFloat64x,
+		/*  F80X */           BT uFloat64x,           BT uFloat64x,           BT uFloat64x,           BT uFloat64x,           BT uFloat64x,           BT uFloat64x,
 				             BT uFloat64x,           BT uFloat64x,           BT uFloat64x,           BT uFloat64x,           BT uFloat64x,           BT uFloat64x,
 				             BT uFloat64x,           BT uFloat64x,           BT uFloat64x,    BT uFloat64xComplex,           BT uFloat64x,    BT uFloat64xComplex,
@@ -406,5 +406,5 @@
 				  },
 				  {
-		/* _FDXC*/    BT uFloat64xComplex,    BT uFloat64xComplex,    BT uFloat64xComplex,    BT uFloat64xComplex,    BT uFloat64xComplex,    BT uFloat64xComplex,
+		/* _FDXC */    BT uFloat64xComplex,    BT uFloat64xComplex,    BT uFloat64xComplex,    BT uFloat64xComplex,    BT uFloat64xComplex,    BT uFloat64xComplex,
 				      BT uFloat64xComplex,    BT uFloat64xComplex,    BT uFloat64xComplex,    BT uFloat64xComplex,    BT uFloat64xComplex,    BT uFloat64xComplex,
 				      BT uFloat64xComplex,    BT uFloat64xComplex,    BT uFloat64xComplex,    BT uFloat64xComplex,    BT uFloat64xComplex,    BT uFloat64xComplex,
@@ -422,5 +422,5 @@
 				  },
 				  {
-		/*   _FB*/           BT uFloat128,           BT uFloat128,           BT uFloat128,           BT uFloat128,           BT uFloat128,           BT uFloat128,
+		/*   _FB */           BT uFloat128,           BT uFloat128,           BT uFloat128,           BT uFloat128,           BT uFloat128,           BT uFloat128,
 				             BT uFloat128,           BT uFloat128,           BT uFloat128,           BT uFloat128,           BT uFloat128,           BT uFloat128,
 				             BT uFloat128,           BT uFloat128,           BT uFloat128,    BT uFloat128Complex,           BT uFloat128,    BT uFloat128Complex,
@@ -430,5 +430,5 @@
 				  },
 				  {
-		/* _FLDC*/    BT uFloat128Complex,    BT uFloat128Complex,    BT uFloat128Complex,    BT uFloat128Complex,    BT uFloat128Complex,    BT uFloat128Complex,
+		/* _FLDC */    BT uFloat128Complex,    BT uFloat128Complex,    BT uFloat128Complex,    BT uFloat128Complex,    BT uFloat128Complex,    BT uFloat128Complex,
 				      BT uFloat128Complex,    BT uFloat128Complex,    BT uFloat128Complex,    BT uFloat128Complex,    BT uFloat128Complex,    BT uFloat128Complex,
 				      BT uFloat128Complex,    BT uFloat128Complex,    BT uFloat128Complex,    BT uFloat128Complex,    BT uFloat128Complex,    BT uFloat128Complex,
@@ -438,5 +438,5 @@
 				  },
 				  {
-		/*    FB*/          BT uuFloat128,          BT uuFloat128,          BT uuFloat128,          BT uuFloat128,          BT uuFloat128,          BT uuFloat128,
+		/*    FB */          BT uuFloat128,          BT uuFloat128,          BT uuFloat128,          BT uuFloat128,          BT uuFloat128,          BT uuFloat128,
 				            BT uuFloat128,          BT uuFloat128,          BT uuFloat128,          BT uuFloat128,          BT uuFloat128,          BT uuFloat128,
 				            BT uuFloat128,          BT uuFloat128,          BT uuFloat128,    BT uFloat128Complex,          BT uuFloat128,    BT uFloat128Complex,
@@ -446,5 +446,5 @@
 				  },
 				  {
-		/*    LD*/          BT LongDouble,          BT LongDouble,          BT LongDouble,          BT LongDouble,          BT LongDouble,          BT LongDouble,
+		/*    LD */          BT LongDouble,          BT LongDouble,          BT LongDouble,          BT LongDouble,          BT LongDouble,          BT LongDouble,
 				            BT LongDouble,          BT LongDouble,          BT LongDouble,          BT LongDouble,          BT LongDouble,          BT LongDouble,
 				            BT LongDouble,          BT LongDouble,          BT LongDouble,   BT LongDoubleComplex,          BT LongDouble,   BT LongDoubleComplex,
@@ -454,5 +454,5 @@
 				  },
 				  {
-		/*   LDC*/   BT LongDoubleComplex,   BT LongDoubleComplex,   BT LongDoubleComplex,   BT LongDoubleComplex,   BT LongDoubleComplex,   BT LongDoubleComplex,
+		/*   LDC */   BT LongDoubleComplex,   BT LongDoubleComplex,   BT LongDoubleComplex,   BT LongDoubleComplex,   BT LongDoubleComplex,   BT LongDoubleComplex,
 				     BT LongDoubleComplex,   BT LongDoubleComplex,   BT LongDoubleComplex,   BT LongDoubleComplex,   BT LongDoubleComplex,   BT LongDoubleComplex,
 				     BT LongDoubleComplex,   BT LongDoubleComplex,   BT LongDoubleComplex,   BT LongDoubleComplex,   BT LongDoubleComplex,   BT LongDoubleComplex,
@@ -462,5 +462,5 @@
 				  },
 				  {
-		/*  _FBX*/          BT uFloat128x,          BT uFloat128x,          BT uFloat128x,          BT uFloat128x,          BT uFloat128x,          BT uFloat128x,
+		/*  _FBX */          BT uFloat128x,          BT uFloat128x,          BT uFloat128x,          BT uFloat128x,          BT uFloat128x,          BT uFloat128x,
 				            BT uFloat128x,          BT uFloat128x,          BT uFloat128x,          BT uFloat128x,          BT uFloat128x,          BT uFloat128x,
 				            BT uFloat128x,          BT uFloat128x,          BT uFloat128x,   BT uFloat128xComplex,          BT uFloat128x,   BT uFloat128xComplex,
@@ -470,5 +470,5 @@
 				  },
 				  {
-		/*_FLDXC*/   BT uFloat128xComplex,   BT uFloat128xComplex,   BT uFloat128xComplex,   BT uFloat128xComplex,   BT uFloat128xComplex,   BT uFloat128xComplex,
+		/* _FLDXC */   BT uFloat128xComplex,   BT uFloat128xComplex,   BT uFloat128xComplex,   BT uFloat128xComplex,   BT uFloat128xComplex,   BT uFloat128xComplex,
 				     BT uFloat128xComplex,   BT uFloat128xComplex,   BT uFloat128xComplex,   BT uFloat128xComplex,   BT uFloat128xComplex,   BT uFloat128xComplex,
 				     BT uFloat128xComplex,   BT uFloat128xComplex,   BT uFloat128xComplex,   BT uFloat128xComplex,   BT uFloat128xComplex,   BT uFloat128xComplex,
@@ -481,9 +481,9 @@
 	// GENERATED END
 	static_assert(
-		sizeof(commonTypes)/sizeof(commonTypes[0][0]) == BasicType::NUMBER_OF_BASIC_TYPES*BasicType::NUMBER_OF_BASIC_TYPES,
+		sizeof(commonTypes)/sizeof(commonTypes[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_old::CommonType_old( Type *type2, bool widenFirst, bool widenSecond, const SymTab::Indexer &indexer, TypeEnvironment &env, const OpenVarSet &openVars )
+	CommonType_old::CommonType_old( Type * type2, bool widenFirst, bool widenSecond, const SymTab::Indexer &indexer, TypeEnvironment &env, const OpenVarSet &openVars )
 		: result( 0 ), type2( type2 ), widenFirst( widenFirst ), widenSecond( widenSecond ), indexer( indexer ), env( env ), openVars( openVars ) {
 	}
@@ -491,15 +491,15 @@
 	void CommonType_old::postvisit( VoidType * ) {}
 
-	void CommonType_old::postvisit( BasicType *basicType ) {
-		if ( BasicType *otherBasic = dynamic_cast< BasicType* >( type2 ) ) {
+	void CommonType_old::postvisit( BasicType * basicType ) {
+		if ( BasicType * otherBasic = dynamic_cast< BasicType * >( type2 ) ) {
 			BasicType::Kind newType = commonTypes[ basicType->get_kind() ][ otherBasic->get_kind() ];
-			if ( ( ( newType == basicType->get_kind() && basicType->get_qualifiers() >= otherBasic->get_qualifiers() ) || widenFirst ) && ( ( newType == otherBasic->get_kind() && basicType->get_qualifiers() <= otherBasic->get_qualifiers() ) || widenSecond ) ) {
-				result = new BasicType( basicType->get_qualifiers() | otherBasic->get_qualifiers(), newType );
+			if ( ( ( newType == basicType->get_kind() && basicType->tq >= otherBasic->tq ) || widenFirst ) && ( ( newType == otherBasic->get_kind() && basicType->tq <= otherBasic->tq ) || widenSecond ) ) {
+				result = new BasicType( basicType->tq | otherBasic->tq, newType );
 			} // if
-		} else if ( dynamic_cast< EnumInstType * > ( type2 ) || dynamic_cast< ZeroType* >( type2 ) || dynamic_cast< OneType* >( type2 ) ) {
+		} else if ( dynamic_cast< EnumInstType * > ( type2 ) || dynamic_cast< ZeroType * >( type2 ) || dynamic_cast< OneType * >( type2 ) ) {
 			// use signed int in lieu of the enum/zero/one type
 			BasicType::Kind newType = commonTypes[ basicType->get_kind() ][ BasicType::SignedInt ];
-			if ( ( ( newType == basicType->get_kind() && basicType->get_qualifiers() >= type2->get_qualifiers() ) || widenFirst ) && ( ( newType != basicType->get_kind() && basicType->get_qualifiers() <= type2->get_qualifiers() ) || widenSecond ) ) {
-				result = new BasicType( basicType->get_qualifiers() | type2->get_qualifiers(), newType );
+			if ( ( ( newType == basicType->get_kind() && basicType->tq >= type2->tq ) || widenFirst ) && ( ( newType != basicType->get_kind() && basicType->tq <= type2->tq ) || widenSecond ) ) {
+				result = new BasicType( basicType->tq | type2->tq, newType );
 			} // if
 		} // if
@@ -507,6 +507,6 @@
 
 	template< typename Pointer >
-	void CommonType_old::getCommonWithVoidPointer( Pointer* voidPointer, Pointer* otherPointer ) {
-		if ( TypeInstType* var = dynamic_cast< TypeInstType* >( otherPointer->get_base() ) ) {
+	void CommonType_old::getCommonWithVoidPointer( Pointer * voidPointer, Pointer * otherPointer ) {
+		if ( TypeInstType * var = dynamic_cast< TypeInstType * >( otherPointer->get_base() ) ) {
 			OpenVarSet::const_iterator entry = openVars.find( var->get_name() );
 			if ( entry != openVars.end() ) {
@@ -517,20 +517,20 @@
 		}
 		result = voidPointer->clone();
-		result->get_qualifiers() |= otherPointer->get_qualifiers();
-	}
-
-	void CommonType_old::postvisit( PointerType *pointerType ) {
-		if ( PointerType *otherPointer = dynamic_cast< PointerType* >( type2 ) ) {
+		result->tq |= otherPointer->tq;
+	}
+
+	void CommonType_old::postvisit( PointerType * pointerType ) {
+		if ( PointerType * otherPointer = dynamic_cast< PointerType * >( type2 ) ) {
 			// std::cerr << "commonType: two pointers: " << pointerType << " / " << otherPointer << std::endl;
-			if ( widenFirst && dynamic_cast< VoidType* >( otherPointer->get_base() ) && ! isFtype(pointerType->get_base()) ) {
+			if ( widenFirst && dynamic_cast< VoidType * >( otherPointer->get_base() ) && ! isFtype(pointerType->get_base()) ) {
 				getCommonWithVoidPointer( otherPointer, pointerType );
-			} else if ( widenSecond && dynamic_cast< VoidType* >( pointerType->get_base() ) && ! isFtype(otherPointer->get_base()) ) {
+			} else if ( widenSecond && dynamic_cast< VoidType * >( pointerType->get_base() ) && ! isFtype(otherPointer->get_base()) ) {
 				getCommonWithVoidPointer( pointerType, otherPointer );
-			} else if ( ( pointerType->get_base()->get_qualifiers() >= otherPointer->get_base()->get_qualifiers() || widenFirst )
-					   && ( pointerType->get_base()->get_qualifiers() <= otherPointer->get_base()->get_qualifiers() || widenSecond ) ) {
+			} else if ( ( pointerType->get_base()->tq >= otherPointer->get_base()->tq || widenFirst )
+					   && ( pointerType->get_base()->tq <= otherPointer->get_base()->tq || widenSecond ) ) {
 				// std::cerr << "middle case" << std::endl;
-				Type::Qualifiers tq1 = pointerType->get_base()->get_qualifiers(), tq2 = otherPointer->get_base()->get_qualifiers();
-				pointerType->get_base()->get_qualifiers() = Type::Qualifiers();
-				otherPointer->get_base()->get_qualifiers() = Type::Qualifiers();
+				Type::Qualifiers tq1 = pointerType->get_base()->tq, tq2 = otherPointer->get_base()->tq;
+				pointerType->get_base()->tq = Type::Qualifiers();
+				otherPointer->get_base()->tq = Type::Qualifiers();
 				AssertionSet have, need;
 				OpenVarSet newOpen( openVars );
@@ -542,14 +542,14 @@
 						result = otherPointer->clone();
 					} // if
-					strict_dynamic_cast<PointerType*>(result)->base->get_qualifiers() = tq1 | tq2;
+					strict_dynamic_cast<PointerType *>(result)->base->tq = tq1 | tq2;
 				} else {
 					/// std::cerr << "place for ptr-to-type" << std::endl;
 				} // if
-				pointerType->get_base()->get_qualifiers() = tq1;
-				otherPointer->get_base()->get_qualifiers() = tq2;
+				pointerType->get_base()->tq = tq1;
+				otherPointer->get_base()->tq = tq2;
 			} // if
-		} else if ( widenSecond && dynamic_cast< ZeroType* >( type2 ) ) {
+		} else if ( widenSecond && dynamic_cast< ZeroType * >( type2 ) ) {
 			result = pointerType->clone();
-			result->get_qualifiers() |= type2->get_qualifiers();
+			result->tq |= type2->tq;
 		} // if
 	}
@@ -557,18 +557,18 @@
 	void CommonType_old::postvisit( ArrayType * ) {}
 
-	void CommonType_old::postvisit( ReferenceType *refType ) {
-		if ( ReferenceType *otherRef = dynamic_cast< ReferenceType* >( type2 ) ) {
+	void CommonType_old::postvisit( ReferenceType * refType ) {
+		if ( ReferenceType * otherRef = dynamic_cast< ReferenceType * >( type2 ) ) {
 			// std::cerr << "commonType: both references: " << refType << " / " << otherRef << std::endl;
-			// std::cerr << ( refType->get_base()->get_qualifiers() >= otherRef->get_base()->get_qualifiers() || widenFirst ) << (refType->get_base()->get_qualifiers() <= otherRef->get_base()->get_qualifiers() || widenSecond) << std::endl;
-			if ( widenFirst && dynamic_cast< VoidType* >( otherRef->get_base() ) && ! isFtype(refType->get_base()) ) {
+			// std::cerr << ( refType->get_base()->tq >= otherRef->get_base()->tq || widenFirst ) << (refType->get_base()->tq <= otherRef->get_base()->tq || widenSecond) << std::endl;
+			if ( widenFirst && dynamic_cast< VoidType * >( otherRef->get_base() ) && ! isFtype(refType->get_base()) ) {
 				getCommonWithVoidPointer( otherRef, refType );
-			} else if ( widenSecond && dynamic_cast< VoidType* >( refType->get_base() ) && ! isFtype(otherRef->get_base()) ) {
+			} else if ( widenSecond && dynamic_cast< VoidType * >( refType->get_base() ) && ! isFtype(otherRef->get_base()) ) {
 				getCommonWithVoidPointer( refType, otherRef );
-			} else if ( ( refType->get_base()->get_qualifiers() >= otherRef->get_base()->get_qualifiers() || widenFirst )
-					   && ( refType->get_base()->get_qualifiers() <= otherRef->get_base()->get_qualifiers() || widenSecond ) ) {
+			} else if ( ( refType->get_base()->tq >= otherRef->get_base()->tq || widenFirst )
+					   && ( refType->get_base()->tq <= otherRef->get_base()->tq || widenSecond ) ) {
 				// std::cerr << "middle case" << std::endl;
-				Type::Qualifiers tq1 = refType->get_base()->get_qualifiers(), tq2 = otherRef->get_base()->get_qualifiers();
-				refType->get_base()->get_qualifiers() = Type::Qualifiers();
-				otherRef->get_base()->get_qualifiers() = Type::Qualifiers();
+				Type::Qualifiers tq1 = refType->get_base()->tq, tq2 = otherRef->get_base()->tq;
+				refType->get_base()->tq = Type::Qualifiers();
+				otherRef->get_base()->tq = Type::Qualifiers();
 				AssertionSet have, need;
 				OpenVarSet newOpen( openVars );
@@ -579,14 +579,14 @@
 						result = otherRef->clone();
 					} // if
-					strict_dynamic_cast<ReferenceType*>(result)->base->get_qualifiers() = tq1 | tq2;
+					strict_dynamic_cast<ReferenceType *>(result)->base->tq = tq1 | tq2;
 				} else {
 					/// std::cerr << "place for ptr-to-type" << std::endl;
 				} // if
-				refType->get_base()->get_qualifiers() = tq1;
-				otherRef->get_base()->get_qualifiers() = tq2;
+				refType->get_base()->tq = tq1;
+				otherRef->get_base()->tq = tq2;
 			} // if
-		} else if ( widenSecond && dynamic_cast< ZeroType* >( type2 ) ) {
+		} else if ( widenSecond && dynamic_cast< ZeroType * >( type2 ) ) {
 			result = refType->clone();
-			result->get_qualifiers() |= type2->get_qualifiers();
+			result->tq |= type2->tq;
 		} // if
 	}
@@ -596,6 +596,6 @@
 	void CommonType_old::postvisit( UnionInstType * ) {}
 
-	void CommonType_old::postvisit( EnumInstType *enumInstType ) {
-		if ( dynamic_cast< BasicType * >( type2 ) || dynamic_cast< ZeroType* >( type2 ) || dynamic_cast< OneType* >( type2 ) ) {
+	void CommonType_old::postvisit( EnumInstType * enumInstType ) {
+		if ( dynamic_cast< BasicType * >( type2 ) || dynamic_cast< ZeroType * >( type2 ) || dynamic_cast< OneType * >( type2 ) ) {
 			// reuse BasicType, EnumInstType code by swapping type2 with enumInstType
 			result = commonType( type2, enumInstType, widenSecond, widenFirst, indexer, env, openVars );
@@ -606,21 +606,21 @@
 	}
 
-	void CommonType_old::postvisit( TypeInstType *inst ) {
+	void CommonType_old::postvisit( TypeInstType * inst ) {
 		if ( widenFirst ) {
-			NamedTypeDecl *nt = indexer.lookupType( inst->get_name() );
+			const NamedTypeDecl * nt = indexer.lookupType( inst->get_name() );
 			if ( nt ) {
-				TypeDecl *type = strict_dynamic_cast< TypeDecl* >( nt );
+				const TypeDecl * type = strict_dynamic_cast< const TypeDecl * >( nt );
 				if ( type->get_base() ) {
-					Type::Qualifiers tq1 = inst->get_qualifiers(), tq2 = type2->get_qualifiers();
+					Type::Qualifiers tq1 = inst->tq, tq2 = type2->tq;
 					AssertionSet have, need;
 					OpenVarSet newOpen( openVars );
-					type2->get_qualifiers() = Type::Qualifiers();
-					type->get_base()->get_qualifiers() = tq1;
+					type2->tq = Type::Qualifiers();
+					type->get_base()->tq = tq1;
 					if ( unifyExact( type->get_base(), type2, env, have, need, newOpen, indexer ) ) {
 						result = type2->clone();
-						result->get_qualifiers() = tq1 | tq2;
+						result->tq = tq1 | tq2;
 					} // if
-					type2->get_qualifiers() = tq2;
-					type->get_base()->get_qualifiers() = Type::Qualifiers();
+					type2->tq = tq2;
+					type->get_base()->tq = Type::Qualifiers();
 				} // if
 			} // if
@@ -631,28 +631,28 @@
 	void CommonType_old::postvisit( VarArgsType * ) {}
 
-	void CommonType_old::postvisit( ZeroType *zeroType ) {
+	void CommonType_old::postvisit( ZeroType * zeroType ) {
 		if ( widenFirst ) {
-			if ( dynamic_cast< BasicType* >( type2 ) || dynamic_cast< PointerType* >( type2 ) || dynamic_cast< EnumInstType* >( type2 ) ) {
-				if ( widenSecond || zeroType->get_qualifiers() <= type2->get_qualifiers() ) {
+			if ( dynamic_cast< BasicType * >( type2 ) || dynamic_cast< PointerType * >( type2 ) || dynamic_cast< EnumInstType * >( type2 ) ) {
+				if ( widenSecond || zeroType->tq <= type2->tq ) {
 					result = type2->clone();
-					result->get_qualifiers() |= zeroType->get_qualifiers();
-				}
-			} else if ( widenSecond && dynamic_cast< OneType* >( type2 ) ) {
-				result = new BasicType( zeroType->get_qualifiers(), BasicType::SignedInt );
-				result->get_qualifiers() |= type2->get_qualifiers();
-			}
-		}
-	}
-
-	void CommonType_old::postvisit( OneType *oneType ) {
+					result->tq |= zeroType->tq;
+				}
+			} else if ( widenSecond && dynamic_cast< OneType * >( type2 ) ) {
+				result = new BasicType( zeroType->tq, BasicType::SignedInt );
+				result->tq |= type2->tq;
+			}
+		}
+	}
+
+	void CommonType_old::postvisit( OneType * oneType ) {
 		if ( widenFirst ) {
-			if ( dynamic_cast< BasicType* >( type2 ) || dynamic_cast< EnumInstType* >( type2 ) ) {
-				if ( widenSecond || oneType->get_qualifiers() <= type2->get_qualifiers() ) {
+			if ( dynamic_cast< BasicType * >( type2 ) || dynamic_cast< EnumInstType * >( type2 ) ) {
+				if ( widenSecond || oneType->tq <= type2->tq ) {
 					result = type2->clone();
-					result->get_qualifiers() |= oneType->get_qualifiers();
-				}
-			} else if ( widenSecond && dynamic_cast< ZeroType* >( type2 ) ) {
-				result = new BasicType( oneType->get_qualifiers(), BasicType::SignedInt );
-				result->get_qualifiers() |= type2->get_qualifiers();
+					result->tq |= oneType->tq;
+				}
+			} else if ( widenSecond && dynamic_cast< ZeroType * >( type2 ) ) {
+				result = new BasicType( oneType->tq, BasicType::SignedInt );
+				result->tq |= type2->tq;
 			}
 		}
@@ -668,6 +668,6 @@
 		ast::ptr< ast::Type > result;
 
-		CommonType_new( 
-			const ast::Type * t2, WidenMode w, const ast::SymbolTable & st, 
+		CommonType_new(
+			const ast::Type * t2, WidenMode w, const ast::SymbolTable & st,
 			ast::TypeEnvironment & env, const ast::OpenVarSet & o )
 		: type2( t2 ), widen( w ), symtab( st ), tenv( env ), open( o ), result() {}
@@ -681,14 +681,14 @@
 				#warning remove casts when `commonTypes` moved to new AST
 				ast::BasicType::Kind kind = (ast::BasicType::Kind)(int)commonTypes[ (BasicType::Kind)(int)basic->kind ][ (BasicType::Kind)(int)basic2->kind ];
-				if ( 
-					( ( kind == basic->kind && basic->qualifiers >= basic2->qualifiers ) 
-						|| widen.first ) 
-					&& ( ( kind == basic2->kind && basic->qualifiers <= basic2->qualifiers ) 
-						|| widen.second ) 
+				if (
+					( ( kind == basic->kind && basic->qualifiers >= basic2->qualifiers )
+						|| widen.first )
+					&& ( ( kind == basic2->kind && basic->qualifiers <= basic2->qualifiers )
+						|| widen.second )
 				) {
 					result = new ast::BasicType{ kind, basic->qualifiers | basic2->qualifiers };
 				}
-			} else if ( 
-				dynamic_cast< const ast::EnumInstType * >( type2 ) 
+			} else if (
+				dynamic_cast< const ast::EnumInstType * >( type2 )
 				|| dynamic_cast< const ast::ZeroType * >( type2 )
 				|| dynamic_cast< const ast::OneType * >( type2 )
@@ -696,9 +696,9 @@
 				#warning remove casts when `commonTypes` moved to new AST
 				ast::BasicType::Kind kind = (ast::BasicType::Kind)(int)commonTypes[ (BasicType::Kind)(int)basic->kind ][ (BasicType::Kind)(int)ast::BasicType::SignedInt ];
-				if ( 
-					( ( kind == basic->kind && basic->qualifiers >= type2->qualifiers ) 
-						|| widen.first ) 
-					&& ( ( kind != basic->kind && basic->qualifiers <= type2->qualifiers ) 
-						|| widen.second ) 
+				if (
+					( ( kind == basic->kind && basic->qualifiers >= type2->qualifiers )
+						|| widen.first )
+					&& ( ( kind != basic->kind && basic->qualifiers <= type2->qualifiers )
+						|| widen.second )
 				) {
 					result = new ast::BasicType{ kind, basic->qualifiers | type2->qualifiers };
@@ -715,6 +715,6 @@
 				if ( entry != open.end() ) {
 					ast::AssertionSet need, have;
-					if ( ! tenv.bindVar( 
-						var, voidPtr->base, entry->second, need, have, open, widen, symtab ) 
+					if ( ! tenv.bindVar(
+						var, voidPtr->base, entry->second, need, have, open, widen, symtab )
 					) return;
 				}
@@ -727,14 +727,14 @@
 		void postvisit( const ast::PointerType * pointer ) {
 			if ( auto pointer2 = dynamic_cast< const ast::PointerType * >( type2 ) ) {
-				if ( 
-					widen.first 
-					&& pointer2->base.as< ast::VoidType >() 
-					&& ! ast::isFtype( pointer->base ) 
+				if (
+					widen.first
+					&& pointer2->base.as< ast::VoidType >()
+					&& ! ast::isFtype( pointer->base )
 				) {
 					getCommonWithVoidPointer( pointer2, pointer );
-				} else if ( 
-					widen.second 
-					&& pointer->base.as< ast::VoidType >() 
-					&& ! ast::isFtype( pointer2->base ) 
+				} else if (
+					widen.second
+					&& pointer->base.as< ast::VoidType >()
+					&& ! ast::isFtype( pointer2->base )
 				) {
 					getCommonWithVoidPointer( pointer, pointer2 );
@@ -746,10 +746,10 @@
 					ast::CV::Qualifiers q2 = pointer2->base->qualifiers;
 
-					// force t{1,2} to be cloned if their qualifiers must be stripped, so that 
+					// force t{1,2} to be cloned if their qualifiers must be stripped, so that
 					// pointer{,2}->base are unchanged
 					ast::ptr< ast::Type > t1{ pointer->base }, t2{ pointer2->base };
 					reset_qualifiers( t1 );
 					reset_qualifiers( t2 );
-					
+
 					ast::AssertionSet have, need;
 					ast::OpenVarSet newOpen{ open };
@@ -758,6 +758,6 @@
 						if ( q1.val != q2.val ) {
 							// reset result->base->qualifiers to be union of two base qualifiers
-							strict_dynamic_cast< ast::PointerType * >( 
-								result.get_and_mutate() 
+							strict_dynamic_cast< ast::PointerType * >(
+								result.get_and_mutate()
 							)->base.get_and_mutate()->qualifiers = q1 | q2;
 						}
@@ -775,9 +775,9 @@
 			if ( auto ref2 = dynamic_cast< const ast::ReferenceType * >( type2 ) ) {
 				if (
-					widen.first && ref2->base.as< ast::VoidType >() && ! ast::isFtype( ref->base ) 
+					widen.first && ref2->base.as< ast::VoidType >() && ! ast::isFtype( ref->base )
 				) {
 					getCommonWithVoidPointer( ref2, ref );
-				} else if ( 
-					widen.second && ref->base.as< ast::VoidType>() && ! ast::isFtype( ref2->base ) 
+				} else if (
+					widen.second && ref->base.as< ast::VoidType>() && ! ast::isFtype( ref2->base )
 				) {
 					getCommonWithVoidPointer( ref, ref2 );
@@ -788,5 +788,5 @@
 					ast::CV::Qualifiers q1 = ref->base->qualifiers, q2 = ref2->base->qualifiers;
 
-					// force t{1,2} to be cloned if their qualifiers must be stripped, so that 
+					// force t{1,2} to be cloned if their qualifiers must be stripped, so that
 					// ref{,2}->base are unchanged
 					ast::ptr< ast::Type > t1{ ref->base }, t2{ ref2->base };
@@ -800,6 +800,6 @@
 						if ( q1.val != q2.val ) {
 							// reset result->base->qualifiers to be union of two base qualifiers
-							strict_dynamic_cast< ast::ReferenceType * >( 
-								result.get_and_mutate() 
+							strict_dynamic_cast< ast::ReferenceType * >(
+								result.get_and_mutate()
 							)->base.get_and_mutate()->qualifiers = q1 | q2;
 						}
@@ -819,6 +819,6 @@
 
 		void postvisit( const ast::EnumInstType * enumInst ) {
-			if ( 
-				dynamic_cast< const ast::BasicType * >( type2 ) 
+			if (
+				dynamic_cast< const ast::BasicType * >( type2 )
 				|| dynamic_cast< const ast::ZeroType * >( type2 )
 				|| dynamic_cast< const ast::OneType * >( type2 )
@@ -834,6 +834,6 @@
 			if ( ! widen.first ) return;
 			if ( const ast::NamedTypeDecl * nt = symtab.lookupType( inst->name ) ) {
-				if ( const ast::Type * base = 
-						strict_dynamic_cast< const ast::TypeDecl * >( nt )->base 
+				if ( const ast::Type * base =
+						strict_dynamic_cast< const ast::TypeDecl * >( nt )->base
 				) {
 					ast::CV::Qualifiers q1 = inst->qualifiers, q2 = type2->qualifiers;
@@ -860,5 +860,5 @@
 		void postvisit( const ast::ZeroType * zero ) {
 			if ( ! widen.first ) return;
-			if ( 
+			if (
 				dynamic_cast< const ast::BasicType * >( type2 )
 				|| dynamic_cast< const ast::PointerType * >( type2 )
@@ -870,5 +870,5 @@
 				}
 			} else if ( widen.second && dynamic_cast< const ast::OneType * >( type2 ) ) {
-				result = new ast::BasicType{ 
+				result = new ast::BasicType{
 					ast::BasicType::SignedInt, zero->qualifiers | type2->qualifiers };
 			}
@@ -877,5 +877,5 @@
 		void postvisit( const ast::OneType * one ) {
 			if ( ! widen.first ) return;
-			if ( 
+			if (
 				dynamic_cast< const ast::BasicType * >( type2 )
 				|| dynamic_cast< const ast::EnumInstType * >( type2 )
@@ -886,5 +886,5 @@
 				}
 			} else if ( widen.second && dynamic_cast< const ast::ZeroType * >( type2 ) ) {
-				result = new ast::BasicType{ 
+				result = new ast::BasicType{
 					ast::BasicType::SignedInt, one->qualifiers | type2->qualifiers };
 			}
@@ -894,8 +894,8 @@
 
 	namespace {
-		ast::ptr< ast::Type > handleReference( 
-			const ast::ptr< ast::Type > & t1, const ast::ptr< ast::Type > & t2, WidenMode widen, 
-			const ast::SymbolTable & symtab, ast::TypeEnvironment & env, 
-			const ast::OpenVarSet & open 
+		ast::ptr< ast::Type > handleReference(
+			const ast::ptr< ast::Type > & t1, const ast::ptr< ast::Type > & t2, WidenMode widen,
+			const ast::SymbolTable & symtab, ast::TypeEnvironment & env,
+			const ast::OpenVarSet & open
 		) {
 			ast::ptr<ast::Type> common;
@@ -926,7 +926,7 @@
 
 	ast::ptr< ast::Type > commonType(
-			const ast::ptr< ast::Type > & type1, const ast::ptr< ast::Type > & type2, 
-			WidenMode widen, const ast::SymbolTable & symtab, ast::TypeEnvironment & env, 
-			const ast::OpenVarSet & open 
+			const ast::ptr< ast::Type > & type1, const ast::ptr< ast::Type > & type2,
+			WidenMode widen, const ast::SymbolTable & symtab, ast::TypeEnvironment & env,
+			const ast::OpenVarSet & open
 	) {
 		unsigned depth1 = type1->referenceDepth();
@@ -940,5 +940,5 @@
 			const ast::ReferenceType * ref1 = type1.as< ast::ReferenceType >();
 			const ast::ReferenceType * ref2 = type2.as< ast::ReferenceType >();
-			
+
 			if ( depth1 > depth2 ) {
 				assert( ref1 );
@@ -978,11 +978,11 @@
 						ast::OpenVarSet newOpen{ open };
 
-						// force t{1,2} to be cloned if its qualifiers must be stripped, so that 
-						// type1 and type->base are left unchanged; calling convention forces 
+						// force t{1,2} to be cloned if its qualifiers must be stripped, so that
+						// type1 and type->base are left unchanged; calling convention forces
 						// {type1,type->base}->strong_ref >= 1
 						ast::ptr<ast::Type> t1{ type1 }, t2{ type->base };
 						reset_qualifiers( t1 );
 						reset_qualifiers( t2, q1 );
-						
+
 						if ( unifyExact( t1, t2, env, have, need, newOpen, noWiden(), symtab ) ) {
 							result = t1;
Index: src/ResolvExpr/ConversionCost.cc
===================================================================
--- src/ResolvExpr/ConversionCost.cc	(revision 99da2670a9c3077bcfe60c06fde4a115b84eccae)
+++ src/ResolvExpr/ConversionCost.cc	(revision 4eb43fa21537c79c32be1ee375bd917f2a305475)
@@ -46,8 +46,8 @@
 #endif
 
-	Cost conversionCost( Type *src, Type *dest, const SymTab::Indexer &indexer, const TypeEnvironment &env ) {
-		if ( TypeInstType *destAsTypeInst = dynamic_cast< TypeInstType* >( dest ) ) {
+	Cost conversionCost( const Type * src, const Type * dest, const SymTab::Indexer &indexer, const TypeEnvironment &env ) {
+		if ( const TypeInstType * destAsTypeInst = dynamic_cast< const TypeInstType * >( dest ) ) {
 			PRINT( std::cerr << "type inst " << destAsTypeInst->name; )
-			if ( const EqvClass* eqvClass = env.lookup( destAsTypeInst->name ) ) {
+			if ( const EqvClass * eqvClass = env.lookup( destAsTypeInst->name ) ) {
 				if ( eqvClass->type ) {
 					return conversionCost( src, eqvClass->type, indexer, env );
@@ -55,7 +55,7 @@
 					return Cost::infinity;
 				}
-			} else if ( NamedTypeDecl *namedType = indexer.lookupType( destAsTypeInst->name ) ) {
+			} else if ( const NamedTypeDecl * namedType = indexer.lookupType( destAsTypeInst->name ) ) {
 				PRINT( std::cerr << " found" << std::endl; )
-				TypeDecl *type = dynamic_cast< TypeDecl* >( namedType );
+				const TypeDecl * type = dynamic_cast< const TypeDecl * >( namedType );
 				// all typedefs should be gone by this point
 				assert( type );
@@ -77,15 +77,15 @@
 			PRINT( std::cerr << "compatible!" << std::endl; )
 			return Cost::zero;
-		} else if ( dynamic_cast< VoidType* >( dest ) ) {
+		} else if ( dynamic_cast< const VoidType * >( dest ) ) {
 			return Cost::safe;
-		} else if ( ReferenceType * refType = dynamic_cast< ReferenceType * > ( dest ) ) {
+		} else if ( const ReferenceType * refType = dynamic_cast< const ReferenceType * > ( dest ) ) {
 			PRINT( std::cerr << "conversionCost: dest is reference" << std::endl; )
-			return convertToReferenceCost( src, refType, indexer, env, [](Type * t1, Type * t2, const SymTab::Indexer &, const TypeEnvironment & env ){
+			return convertToReferenceCost( src, refType, indexer, env, [](const Type * const t1, const Type * t2, const SymTab::Indexer &, const TypeEnvironment & env ){
 				return ptrsAssignable( t1, t2, env );
 			});
 		} else {
-			PassVisitor<ConversionCost> converter( 
-				dest, indexer, env, 
-				(Cost (*)(Type*, Type*, const SymTab::Indexer&, const TypeEnvironment&))
+			PassVisitor<ConversionCost> converter(
+				dest, indexer, env,
+				(Cost (*)(const Type *, const Type *, const SymTab::Indexer&, const TypeEnvironment&))
 					conversionCost );
 			src->accept( converter );
@@ -98,23 +98,23 @@
 	}
 
-	Cost convertToReferenceCost( Type * src, Type * dest, int diff, const SymTab::Indexer & indexer, const TypeEnvironment & env, PtrsFunction func ) {
+	Cost convertToReferenceCost( const Type * src, const Type * dest, int diff, const SymTab::Indexer & indexer, const TypeEnvironment & env, PtrsFunction func ) {
 		PRINT( std::cerr << "convert to reference cost... diff " << diff << " " << src << " / " << dest << std::endl; )
 		if ( diff > 0 ) {
 			// TODO: document this
-			Cost cost = convertToReferenceCost( strict_dynamic_cast< ReferenceType * >( src )->base, dest, diff-1, indexer, env, func );
+			Cost cost = convertToReferenceCost( strict_dynamic_cast< const ReferenceType * >( src )->base, dest, diff-1, indexer, env, func );
 			cost.incReference();
 			return cost;
 		} else if ( diff < -1 ) {
 			// TODO: document this
-			Cost cost = convertToReferenceCost( src, strict_dynamic_cast< ReferenceType * >( dest )->base, diff+1, indexer, env, func );
+			Cost cost = convertToReferenceCost( src, strict_dynamic_cast< const ReferenceType * >( dest )->base, diff+1, indexer, env, func );
 			cost.incReference();
 			return cost;
 		} else if ( diff == 0 ) {
-			ReferenceType * srcAsRef = dynamic_cast< ReferenceType * >( src );
-			ReferenceType * destAsRef = dynamic_cast< ReferenceType * >( dest );
+			const ReferenceType * srcAsRef = dynamic_cast< const ReferenceType * >( src );
+			const ReferenceType * destAsRef = dynamic_cast< const ReferenceType * >( dest );
 			if ( srcAsRef && destAsRef ) { // pointer-like conversions between references
 				PRINT( std::cerr << "converting between references" << std::endl; )
-				Type::Qualifiers tq1 = srcAsRef->base->get_qualifiers();
-				Type::Qualifiers tq2 = destAsRef->base->get_qualifiers();
+				Type::Qualifiers tq1 = srcAsRef->base->tq;
+				Type::Qualifiers tq2 = destAsRef->base->tq;
 				if ( tq1 <= tq2 && typesCompatibleIgnoreQualifiers( srcAsRef->base, destAsRef->base, indexer, env ) ) {
 					PRINT( std::cerr << " :: compatible and good qualifiers" << std::endl; )
@@ -137,7 +137,7 @@
 			} else {
 				PRINT( std::cerr << "reference to rvalue conversion" << std::endl; )
-				PassVisitor<ConversionCost> converter( 
-					dest, indexer, env, 
-					(Cost (*)(Type*, Type*, const SymTab::Indexer&, const TypeEnvironment&))
+				PassVisitor<ConversionCost> converter(
+					dest, indexer, env,
+					(Cost (*)(const Type *, const Type *, const SymTab::Indexer&, const TypeEnvironment&))
 						conversionCost );
 				src->accept( converter );
@@ -145,5 +145,5 @@
 			} // if
 		} else {
-			ReferenceType * destAsRef = dynamic_cast< ReferenceType * >( dest );
+			const ReferenceType * destAsRef = dynamic_cast< const ReferenceType * >( dest );
 			assert( diff == -1 && destAsRef );
 			PRINT( std::cerr << "dest is: " << dest << " / src is: " << src << std::endl; )
@@ -156,7 +156,7 @@
 					)
 					// lvalue-to-reference conversion:  cv lvalue T => cv T &
-					if ( src->get_qualifiers() == destAsRef->base->get_qualifiers() ) {
+					if ( src->tq == destAsRef->base->tq ) {
 						return Cost::reference; // cost needs to be non-zero to add cast
-					} if ( src->get_qualifiers() < destAsRef->base->get_qualifiers() ) {
+					} if ( src->tq < destAsRef->base->tq ) {
 						return Cost::safe; // cost needs to be higher than previous cast to differentiate adding qualifiers vs. keeping same
 					} else {
@@ -178,5 +178,5 @@
 	}
 
-	Cost convertToReferenceCost( Type * src, ReferenceType * dest, const SymTab::Indexer & indexer, const TypeEnvironment & env, PtrsFunction func ) {
+	Cost convertToReferenceCost( const Type * src, const ReferenceType * dest, const SymTab::Indexer & indexer, const TypeEnvironment & env, PtrsFunction func ) {
 		int sdepth = src->referenceDepth(), ddepth = dest->referenceDepth();
 		Cost cost = convertToReferenceCost( src, dest, sdepth-ddepth, indexer, env, func );
@@ -185,5 +185,5 @@
 	}
 
-	ConversionCost::ConversionCost( Type *dest, const SymTab::Indexer &indexer, const TypeEnvironment &env, CostFunction costFunc )
+	ConversionCost::ConversionCost( const Type * dest, const SymTab::Indexer &indexer, const TypeEnvironment &env, CostFunction costFunc )
 		: dest( dest ), indexer( indexer ), cost( Cost::infinity ), env( env ), costFunc( costFunc ) {
 	}
@@ -193,22 +193,22 @@
 	/* EXTENDED INTEGRAL RANK HIERARCHY (root to leaves)
 	                         _Bool
-	char                signed char         unsigned char       
-	          signed short int         unsigned short int       
-	          signed int               unsigned int             
-	          signed long int          unsigned long int        
-	          signed long long int     unsigned long long int   
-	          __int128                 unsigned __int128        
-	          _Float16                 _Float16 _Complex        
-	          _Float32                 _Float32 _Complex        
-	          float                    float _Complex           
-	          _Float32x                _Float32x _Complex       
-	          _Float64                 _Float64 _Complex        
-	          double                   double _Complex          
-	          _Float64x                _Float64x _Complex       
+	char                signed char         unsigned char
+	          signed short int         unsigned short int
+	          signed int               unsigned int
+	          signed long int          unsigned long int
+	          signed long long int     unsigned long long int
+	          __int128                 unsigned __int128
+	          _Float16                 _Float16 _Complex
+	          _Float32                 _Float32 _Complex
+	          float                    float _Complex
+	          _Float32x                _Float32x _Complex
+	          _Float64                 _Float64 _Complex
+	          double                   double _Complex
+	          _Float64x                _Float64x _Complex
 	                     __float80
-	          _Float128                _Float128 _Complex       
+	          _Float128                _Float128 _Complex
 	                    __float128
-	          long double              long double _Complex     
-	          _Float128x               _Float128x _Complex      
+	          long double              long double _Complex
+	          _Float128x               _Float128x _Complex
 	*/
 	// GENERATED END
@@ -218,45 +218,45 @@
 	static const int costMatrix[BasicType::NUMBER_OF_BASIC_TYPES][BasicType::NUMBER_OF_BASIC_TYPES] = { // path length from root to node
 		/*             B    C   SC   UC   SI  SUI    I   UI   LI  LUI  LLI LLUI   IB  UIB  _FH  _FH   _F  _FC    F   FC  _FX _FXC   FD _FDC    D   DC F80X_FDXC  F80  _FB_FLDC   FB   LD  LDC _FBX_FLDXC */
-		/*     B*/ {   0,   1,   1,   2,   2,   3,   3,   4,   4,   5,   5,   6,   6,   7,   7,   8,   8,   9,   9,  10,  10,  11,  11,  12,  12,  13,  13,  14,  14,  15,  15,  16,  17,  16,  18,  17, },
-		/*     C*/ {  -1,   0,   1,   1,   1,   2,   2,   3,   3,   4,   4,   5,   5,   6,   6,   7,   7,   8,   8,   9,   9,  10,  10,  11,  11,  12,  12,  13,  13,  14,  14,  15,  16,  15,  17,  16, },
-		/*    SC*/ {  -1,  -1,   0,   1,   1,   2,   2,   3,   3,   4,   4,   5,   5,   6,   6,   7,   7,   8,   8,   9,   9,  10,  10,  11,  11,  12,  12,  13,  13,  14,  14,  15,  16,  15,  17,  16, },
-		/*    UC*/ {  -1,  -1,  -1,   0,   1,   1,   2,   2,   3,   3,   4,   4,   5,   5,   6,   7,   7,   8,   8,   9,   9,  10,  10,  11,  11,  12,  12,  13,  13,  14,  14,  15,  16,  15,  17,  16, },
-		/*    SI*/ {  -1,  -1,  -1,  -1,   0,   1,   1,   2,   2,   3,   3,   4,   4,   5,   5,   6,   6,   7,   7,   8,   8,   9,   9,  10,  10,  11,  11,  12,  12,  13,  13,  14,  15,  14,  16,  15, },
-		/*   SUI*/ {  -1,  -1,  -1,  -1,  -1,   0,   1,   1,   2,   2,   3,   3,   4,   4,   5,   6,   6,   7,   7,   8,   8,   9,   9,  10,  10,  11,  11,  12,  12,  13,  13,  14,  15,  14,  16,  15, },
-		/*     I*/ {  -1,  -1,  -1,  -1,  -1,  -1,   0,   1,   1,   2,   2,   3,   3,   4,   4,   5,   5,   6,   6,   7,   7,   8,   8,   9,   9,  10,  10,  11,  11,  12,  12,  13,  14,  13,  15,  14, },
-		/*    UI*/ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,   1,   1,   2,   2,   3,   3,   4,   5,   5,   6,   6,   7,   7,   8,   8,   9,   9,  10,  10,  11,  11,  12,  12,  13,  14,  13,  15,  14, },
-		/*    LI*/ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,   1,   1,   2,   2,   3,   3,   4,   4,   5,   5,   6,   6,   7,   7,   8,   8,   9,   9,  10,  10,  11,  11,  12,  13,  12,  14,  13, },
-		/*   LUI*/ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,   1,   1,   2,   2,   3,   4,   4,   5,   5,   6,   6,   7,   7,   8,   8,   9,   9,  10,  10,  11,  11,  12,  13,  12,  14,  13, },
-		/*   LLI*/ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,   1,   1,   2,   2,   3,   3,   4,   4,   5,   5,   6,   6,   7,   7,   8,   8,   9,   9,  10,  10,  11,  12,  11,  13,  12, },
-		/*  LLUI*/ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,   1,   1,   2,   3,   3,   4,   4,   5,   5,   6,   6,   7,   7,   8,   8,   9,   9,  10,  10,  11,  12,  11,  13,  12, },
-		/*    IB*/ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,   1,   1,   2,   2,   3,   3,   4,   4,   5,   5,   6,   6,   7,   7,   8,   8,   9,   9,  10,  11,  10,  12,  11, },
-		/*   UIB*/ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,   1,   2,   2,   3,   3,   4,   4,   5,   5,   6,   6,   7,   7,   8,   8,   9,   9,  10,  11,  10,  12,  11, },
-		/*   _FH*/ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,   1,   1,   2,   2,   3,   3,   4,   4,   5,   5,   6,   6,   7,   7,   8,   8,   9,  10,   9,  11,  10, },
-		/*   _FH*/ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,  -1,   1,  -1,   2,  -1,   3,  -1,   4,  -1,   5,  -1,   6,  -1,  -1,   7,  -1,  -1,   8,  -1,   9, },
-		/*    _F*/ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,   1,   1,   2,   2,   3,   3,   4,   4,   5,   5,   6,   6,   7,   7,   8,   9,   8,  10,   9, },
-		/*   _FC*/ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,  -1,   1,  -1,   2,  -1,   3,  -1,   4,  -1,   5,  -1,  -1,   6,  -1,  -1,   7,  -1,   8, },
-		/*     F*/ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,   1,   1,   2,   2,   3,   3,   4,   4,   5,   5,   6,   6,   7,   8,   7,   9,   8, },
-		/*    FC*/ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,  -1,   1,  -1,   2,  -1,   3,  -1,   4,  -1,  -1,   5,  -1,  -1,   6,  -1,   7, },
-		/*   _FX*/ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,   1,   1,   2,   2,   3,   3,   4,   4,   5,   5,   6,   7,   6,   8,   7, },
-		/*  _FXC*/ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,  -1,   1,  -1,   2,  -1,   3,  -1,  -1,   4,  -1,  -1,   5,  -1,   6, },
-		/*    FD*/ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,   1,   1,   2,   2,   3,   3,   4,   4,   5,   6,   5,   7,   6, },
-		/*  _FDC*/ {  -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,   1,  -1,   2,  -1,  -1,   3,  -1,  -1,   4,  -1,   5, },
-		/*     D*/ {  -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,   1,   1,   2,   2,   3,   3,   4,   5,   4,   6,   5, },
-		/*    DC*/ {  -1,  -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,  -1,   1,  -1,  -1,   2,  -1,  -1,   3,  -1,   4, },
-		/*  F80X*/ {  -1,  -1,  -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,   1,   1,   2,   2,   3,   4,   3,   5,   4, },
-		/* _FDXC*/ {  -1,  -1,  -1,  -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,  -1,  -1,   1,  -1,  -1,   2,  -1,   3, },
+		/*     B */ {   0,   1,   1,   2,   2,   3,   3,   4,   4,   5,   5,   6,   6,   7,   7,   8,   8,   9,   9,  10,  10,  11,  11,  12,  12,  13,  13,  14,  14,  15,  15,  16,  17,  16,  18,  17, },
+		/*     C */ {  -1,   0,   1,   1,   1,   2,   2,   3,   3,   4,   4,   5,   5,   6,   6,   7,   7,   8,   8,   9,   9,  10,  10,  11,  11,  12,  12,  13,  13,  14,  14,  15,  16,  15,  17,  16, },
+		/*    SC */ {  -1,  -1,   0,   1,   1,   2,   2,   3,   3,   4,   4,   5,   5,   6,   6,   7,   7,   8,   8,   9,   9,  10,  10,  11,  11,  12,  12,  13,  13,  14,  14,  15,  16,  15,  17,  16, },
+		/*    UC */ {  -1,  -1,  -1,   0,   1,   1,   2,   2,   3,   3,   4,   4,   5,   5,   6,   7,   7,   8,   8,   9,   9,  10,  10,  11,  11,  12,  12,  13,  13,  14,  14,  15,  16,  15,  17,  16, },
+		/*    SI */ {  -1,  -1,  -1,  -1,   0,   1,   1,   2,   2,   3,   3,   4,   4,   5,   5,   6,   6,   7,   7,   8,   8,   9,   9,  10,  10,  11,  11,  12,  12,  13,  13,  14,  15,  14,  16,  15, },
+		/*   SUI */ {  -1,  -1,  -1,  -1,  -1,   0,   1,   1,   2,   2,   3,   3,   4,   4,   5,   6,   6,   7,   7,   8,   8,   9,   9,  10,  10,  11,  11,  12,  12,  13,  13,  14,  15,  14,  16,  15, },
+		/*     I */ {  -1,  -1,  -1,  -1,  -1,  -1,   0,   1,   1,   2,   2,   3,   3,   4,   4,   5,   5,   6,   6,   7,   7,   8,   8,   9,   9,  10,  10,  11,  11,  12,  12,  13,  14,  13,  15,  14, },
+		/*    UI */ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,   1,   1,   2,   2,   3,   3,   4,   5,   5,   6,   6,   7,   7,   8,   8,   9,   9,  10,  10,  11,  11,  12,  12,  13,  14,  13,  15,  14, },
+		/*    LI */ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,   1,   1,   2,   2,   3,   3,   4,   4,   5,   5,   6,   6,   7,   7,   8,   8,   9,   9,  10,  10,  11,  11,  12,  13,  12,  14,  13, },
+		/*   LUI */ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,   1,   1,   2,   2,   3,   4,   4,   5,   5,   6,   6,   7,   7,   8,   8,   9,   9,  10,  10,  11,  11,  12,  13,  12,  14,  13, },
+		/*   LLI */ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,   1,   1,   2,   2,   3,   3,   4,   4,   5,   5,   6,   6,   7,   7,   8,   8,   9,   9,  10,  10,  11,  12,  11,  13,  12, },
+		/*  LLUI */ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,   1,   1,   2,   3,   3,   4,   4,   5,   5,   6,   6,   7,   7,   8,   8,   9,   9,  10,  10,  11,  12,  11,  13,  12, },
+		/*    IB */ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,   1,   1,   2,   2,   3,   3,   4,   4,   5,   5,   6,   6,   7,   7,   8,   8,   9,   9,  10,  11,  10,  12,  11, },
+		/*   UIB */ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,   1,   2,   2,   3,   3,   4,   4,   5,   5,   6,   6,   7,   7,   8,   8,   9,   9,  10,  11,  10,  12,  11, },
+		/*   _FH */ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,   1,   1,   2,   2,   3,   3,   4,   4,   5,   5,   6,   6,   7,   7,   8,   8,   9,  10,   9,  11,  10, },
+		/*   _FH */ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,  -1,   1,  -1,   2,  -1,   3,  -1,   4,  -1,   5,  -1,   6,  -1,  -1,   7,  -1,  -1,   8,  -1,   9, },
+		/*    _F */ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,   1,   1,   2,   2,   3,   3,   4,   4,   5,   5,   6,   6,   7,   7,   8,   9,   8,  10,   9, },
+		/*   _FC */ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,  -1,   1,  -1,   2,  -1,   3,  -1,   4,  -1,   5,  -1,  -1,   6,  -1,  -1,   7,  -1,   8, },
+		/*     F */ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,   1,   1,   2,   2,   3,   3,   4,   4,   5,   5,   6,   6,   7,   8,   7,   9,   8, },
+		/*    FC */ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,  -1,   1,  -1,   2,  -1,   3,  -1,   4,  -1,  -1,   5,  -1,  -1,   6,  -1,   7, },
+		/*   _FX */ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,   1,   1,   2,   2,   3,   3,   4,   4,   5,   5,   6,   7,   6,   8,   7, },
+		/*  _FXC */ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,  -1,   1,  -1,   2,  -1,   3,  -1,  -1,   4,  -1,  -1,   5,  -1,   6, },
+		/*    FD */ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,   1,   1,   2,   2,   3,   3,   4,   4,   5,   6,   5,   7,   6, },
+		/*  _FDC */ {  -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,   1,  -1,   2,  -1,  -1,   3,  -1,  -1,   4,  -1,   5, },
+		/*     D */ {  -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,   1,   1,   2,   2,   3,   3,   4,   5,   4,   6,   5, },
+		/*    DC */ {  -1,  -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,  -1,   1,  -1,  -1,   2,  -1,  -1,   3,  -1,   4, },
+		/*  F80X */ {  -1,  -1,  -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,   1,   1,   2,   2,   3,   4,   3,   5,   4, },
+		/* _FDXC */ {  -1,  -1,  -1,  -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,  -1,  -1,   1,  -1,  -1,   2,  -1,   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,  -1,  -1,  -1,  -1,   1,   0,   1,   2,   2,   3,   3,   4,   4, },
-		/*   _FB*/ {  -1,  -1,  -1,  -1,  -1,  -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,   1,   1,   2,   2,   3,   3, },
-		/* _FLDC*/ {  -1,  -1,  -1,  -1,  -1,  -1,  -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,  -1,  -1,   1,  -1,   2, },
-		/*    FB*/ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -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,   1,   2,   2,   3, },
-		/*    LD*/ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -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,   1,   1,   2, },
-		/*   LDC*/ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -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,  -1,   1, },
-		/*  _FBX*/ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -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,   1, },
-		/*_FLDXC*/ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -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, },
+		/*   _FB */ {  -1,  -1,  -1,  -1,  -1,  -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,   1,   1,   2,   2,   3,   3, },
+		/* _FLDC */ {  -1,  -1,  -1,  -1,  -1,  -1,  -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,  -1,  -1,   1,  -1,   2, },
+		/*    FB */ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -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,   1,   2,   2,   3, },
+		/*    LD */ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -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,   1,   1,   2, },
+		/*   LDC */ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -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,  -1,   1, },
+		/*  _FBX */ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -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,   1, },
+		/* _FLDXC */ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -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, },
 	}; // costMatrix
 	static const int maxIntCost = 15;
 	// GENERATED END
 	static_assert(
-		sizeof(costMatrix)/sizeof(costMatrix[0][0]) == BasicType::NUMBER_OF_BASIC_TYPES*BasicType::NUMBER_OF_BASIC_TYPES,
+		sizeof(costMatrix)/sizeof(costMatrix[0][0]) == BasicType::NUMBER_OF_BASIC_TYPES * BasicType::NUMBER_OF_BASIC_TYPES,
 		"Missing row in the cost matrix"
 	);
@@ -266,54 +266,54 @@
 	static const int signMatrix[BasicType::NUMBER_OF_BASIC_TYPES][BasicType::NUMBER_OF_BASIC_TYPES] = { // number of sign changes in safe conversion
 		/*             B    C   SC   UC   SI  SUI    I   UI   LI  LUI  LLI LLUI   IB  UIB  _FH  _FH   _F  _FC    F   FC  _FX _FXC   FD _FDC    D   DC F80X_FDXC  F80  _FB_FLDC   FB   LD  LDC _FBX_FLDXC */
-		/*     B*/ {   0,   0,   0,   1,   0,   1,   0,   1,   0,   1,   0,   1,   0,   1,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0, },
-		/*     C*/ {  -1,   0,   0,   1,   0,   1,   0,   1,   0,   1,   0,   1,   0,   1,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0, },
-		/*    SC*/ {  -1,  -1,   0,   1,   0,   1,   0,   1,   0,   1,   0,   1,   0,   1,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0, },
-		/*    UC*/ {  -1,  -1,  -1,   0,   1,   0,   1,   0,   1,   0,   1,   0,   1,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0, },
-		/*    SI*/ {  -1,  -1,  -1,  -1,   0,   1,   0,   1,   0,   1,   0,   1,   0,   1,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0, },
-		/*   SUI*/ {  -1,  -1,  -1,  -1,  -1,   0,   1,   0,   1,   0,   1,   0,   1,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0, },
-		/*     I*/ {  -1,  -1,  -1,  -1,  -1,  -1,   0,   1,   0,   1,   0,   1,   0,   1,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0, },
-		/*    UI*/ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,   1,   0,   1,   0,   1,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0, },
-		/*    LI*/ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,   1,   0,   1,   0,   1,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0, },
-		/*   LUI*/ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,   1,   0,   1,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0, },
-		/*   LLI*/ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,   1,   0,   1,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0, },
-		/*  LLUI*/ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,   1,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0, },
-		/*    IB*/ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,   1,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0, },
-		/*   UIB*/ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0, },
-		/*   _FH*/ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0, },
-		/*   _FH*/ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,  -1,   0,  -1,   0,  -1,   0,  -1,   0,  -1,   0,  -1,   0,  -1,  -1,   0,  -1,  -1,   0,  -1,   0, },
-		/*    _F*/ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0, },
-		/*   _FC*/ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,  -1,   0,  -1,   0,  -1,   0,  -1,   0,  -1,   0,  -1,  -1,   0,  -1,  -1,   0,  -1,   0, },
-		/*     F*/ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0, },
-		/*    FC*/ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,  -1,   0,  -1,   0,  -1,   0,  -1,   0,  -1,  -1,   0,  -1,  -1,   0,  -1,   0, },
-		/*   _FX*/ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0, },
-		/*  _FXC*/ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,  -1,   0,  -1,   0,  -1,   0,  -1,  -1,   0,  -1,  -1,   0,  -1,   0, },
-		/*    FD*/ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0, },
-		/*  _FDC*/ {  -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,   0,  -1,   0,  -1,  -1,   0,  -1,  -1,   0,  -1,   0, },
-		/*     D*/ {  -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,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0, },
-		/*    DC*/ {  -1,  -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,  -1,   0,  -1,  -1,   0,  -1,  -1,   0,  -1,   0, },
-		/*  F80X*/ {  -1,  -1,  -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,   0,   0,   0,   0,   0,   0,   0,   0,   0, },
-		/* _FDXC*/ {  -1,  -1,  -1,  -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,  -1,  -1,   0,  -1,  -1,   0,  -1,   0, },
+		/*     B */ {   0,   0,   0,   1,   0,   1,   0,   1,   0,   1,   0,   1,   0,   1,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0, },
+		/*     C */ {  -1,   0,   0,   1,   0,   1,   0,   1,   0,   1,   0,   1,   0,   1,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0, },
+		/*    SC */ {  -1,  -1,   0,   1,   0,   1,   0,   1,   0,   1,   0,   1,   0,   1,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0, },
+		/*    UC */ {  -1,  -1,  -1,   0,   1,   0,   1,   0,   1,   0,   1,   0,   1,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0, },
+		/*    SI */ {  -1,  -1,  -1,  -1,   0,   1,   0,   1,   0,   1,   0,   1,   0,   1,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0, },
+		/*   SUI */ {  -1,  -1,  -1,  -1,  -1,   0,   1,   0,   1,   0,   1,   0,   1,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0, },
+		/*     I */ {  -1,  -1,  -1,  -1,  -1,  -1,   0,   1,   0,   1,   0,   1,   0,   1,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0, },
+		/*    UI */ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,   1,   0,   1,   0,   1,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0, },
+		/*    LI */ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,   1,   0,   1,   0,   1,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0, },
+		/*   LUI */ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,   1,   0,   1,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0, },
+		/*   LLI */ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,   1,   0,   1,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0, },
+		/*  LLUI */ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,   1,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0, },
+		/*    IB */ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,   1,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0, },
+		/*   UIB */ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0, },
+		/*   _FH */ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0, },
+		/*   _FH */ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,  -1,   0,  -1,   0,  -1,   0,  -1,   0,  -1,   0,  -1,   0,  -1,  -1,   0,  -1,  -1,   0,  -1,   0, },
+		/*    _F */ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0, },
+		/*   _FC */ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,  -1,   0,  -1,   0,  -1,   0,  -1,   0,  -1,   0,  -1,  -1,   0,  -1,  -1,   0,  -1,   0, },
+		/*     F */ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0, },
+		/*    FC */ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,  -1,   0,  -1,   0,  -1,   0,  -1,   0,  -1,  -1,   0,  -1,  -1,   0,  -1,   0, },
+		/*   _FX */ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0, },
+		/*  _FXC */ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,  -1,   0,  -1,   0,  -1,   0,  -1,  -1,   0,  -1,  -1,   0,  -1,   0, },
+		/*    FD */ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0, },
+		/*  _FDC */ {  -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,   0,  -1,   0,  -1,  -1,   0,  -1,  -1,   0,  -1,   0, },
+		/*     D */ {  -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,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0, },
+		/*    DC */ {  -1,  -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,  -1,   0,  -1,  -1,   0,  -1,  -1,   0,  -1,   0, },
+		/*  F80X */ {  -1,  -1,  -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,   0,   0,   0,   0,   0,   0,   0,   0,   0, },
+		/* _FDXC */ {  -1,  -1,  -1,  -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,  -1,  -1,   0,  -1,  -1,   0,  -1,   0, },
 		/*   F80*/ {  -1,  -1,  -1,  -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,   0,   0,   0,   0,   0,   0,   0,   0, },
-		/*   _FB*/ {  -1,  -1,  -1,  -1,  -1,  -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,   0,   0,   0,   0,   0,   0, },
-		/* _FLDC*/ {  -1,  -1,  -1,  -1,  -1,  -1,  -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,  -1,  -1,   0,  -1,   0, },
-		/*    FB*/ {  -1,  -1,  -1,  -1,  -1,  -1,  -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,   0,   0,   0,   0,   0, },
-		/*    LD*/ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -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,   0,   0,   0, },
-		/*   LDC*/ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -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,  -1,   0, },
-		/*  _FBX*/ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -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,   0, },
-		/*_FLDXC*/ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -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, },
+		/*   _FB */ {  -1,  -1,  -1,  -1,  -1,  -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,   0,   0,   0,   0,   0,   0, },
+		/* _FLDC */ {  -1,  -1,  -1,  -1,  -1,  -1,  -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,  -1,  -1,   0,  -1,   0, },
+		/*    FB */ {  -1,  -1,  -1,  -1,  -1,  -1,  -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,   0,   0,   0,   0,   0, },
+		/*    LD */ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -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,   0,   0,   0, },
+		/*   LDC */ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -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,  -1,   0, },
+		/*  _FBX */ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -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,   0, },
+		/* _FLDXC */ {  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -1,  -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, },
 	}; // signMatrix
 	// GENERATED END
 	static_assert(
-		sizeof(signMatrix)/sizeof(signMatrix[0][0]) == BasicType::NUMBER_OF_BASIC_TYPES*BasicType::NUMBER_OF_BASIC_TYPES,
+		sizeof(signMatrix)/sizeof(signMatrix[0][0]) == BasicType::NUMBER_OF_BASIC_TYPES * BasicType::NUMBER_OF_BASIC_TYPES,
 		"Missing row in the sign matrix"
 	);
 
-	void ConversionCost::postvisit( VoidType * ) {
+	void ConversionCost::postvisit( const VoidType * ) {
 		cost = Cost::infinity;
 	}
 
-	void ConversionCost::postvisit(BasicType *basicType) {
-		if ( BasicType *destAsBasic = dynamic_cast< BasicType* >( dest ) ) {
-			int tableResult = costMatrix[ basicType->get_kind() ][ destAsBasic->get_kind() ];
+	void ConversionCost::postvisit(const BasicType * basicType) {
+		if ( const BasicType * destAsBasic = dynamic_cast< const BasicType * >( dest ) ) {
+			int tableResult = costMatrix[ basicType->kind ][ destAsBasic->kind ];
 			if ( tableResult == -1 ) {
 				cost = Cost::unsafe;
@@ -321,7 +321,7 @@
 				cost = Cost::zero;
 				cost.incSafe( tableResult );
-				cost.incSign( signMatrix[ basicType->get_kind() ][ destAsBasic->get_kind() ] );
-			} // if
-		} else if ( dynamic_cast< EnumInstType *>( dest ) ) {
+				cost.incSign( signMatrix[ basicType->kind ][ destAsBasic->kind ] );
+			} // if
+		} else if ( dynamic_cast< const EnumInstType * >( dest ) ) {
 			// xxx - not positive this is correct, but appears to allow casting int => enum
 			cost = Cost::unsafe;
@@ -330,9 +330,9 @@
 	}
 
-	void ConversionCost::postvisit( PointerType * pointerType ) {
-		if ( PointerType *destAsPtr = dynamic_cast< PointerType* >( dest ) ) {
+	void ConversionCost::postvisit( const PointerType * pointerType ) {
+		if ( const PointerType * destAsPtr = dynamic_cast< const PointerType * >( dest ) ) {
 			PRINT( std::cerr << pointerType << " ===> " << destAsPtr << std::endl; )
-			Type::Qualifiers tq1 = pointerType->base->get_qualifiers();
-			Type::Qualifiers tq2 = destAsPtr->base->get_qualifiers();
+			Type::Qualifiers tq1 = pointerType->base->tq;
+			Type::Qualifiers tq2 = destAsPtr->base->tq;
 			if ( tq1 <= tq2 && typesCompatibleIgnoreQualifiers( pointerType->base, destAsPtr->base, indexer, env ) ) {
 				PRINT( std::cerr << " :: compatible and good qualifiers" << std::endl; )
@@ -363,16 +363,16 @@
 	}
 
-	void ConversionCost::postvisit( ArrayType * ) {}
-
-	void ConversionCost::postvisit( ReferenceType * refType ) {
+	void ConversionCost::postvisit( const ArrayType * ) {}
+
+	void ConversionCost::postvisit( const ReferenceType * refType ) {
 		// Note: dest can never be a reference, since it would have been caught in an earlier check
-		assert( ! dynamic_cast< ReferenceType * >( dest ) );
+		assert( ! dynamic_cast< const ReferenceType * >( dest ) );
 		// convert reference to rvalue: cv T1 & => T2
 		// recursively compute conversion cost from T1 to T2.
 		// cv can be safely dropped because of 'implicit dereference' behavior.
 		cost = costFunc( refType->base, dest, indexer, env );
-		if ( refType->base->get_qualifiers() == dest->get_qualifiers() ) {
+		if ( refType->base->tq == dest->tq ) {
 			cost.incReference();  // prefer exact qualifiers
-		} else if ( refType->base->get_qualifiers() < dest->get_qualifiers() ) {
+		} else if ( refType->base->tq < dest->tq ) {
 			cost.incSafe(); // then gaining qualifiers
 		} else {
@@ -382,8 +382,8 @@
 	}
 
-	void ConversionCost::postvisit( FunctionType * ) {}
-
-	void ConversionCost::postvisit( StructInstType * inst ) {
-		if ( StructInstType *destAsInst = dynamic_cast< StructInstType* >( dest ) ) {
+	void ConversionCost::postvisit( const FunctionType * ) {}
+
+	void ConversionCost::postvisit( const StructInstType * inst ) {
+		if ( const StructInstType * destAsInst = dynamic_cast< const StructInstType * >( dest ) ) {
 			if ( inst->name == destAsInst->name ) {
 				cost = Cost::zero;
@@ -392,6 +392,6 @@
 	}
 
-	void ConversionCost::postvisit( UnionInstType * inst ) {
-		if ( UnionInstType *destAsInst = dynamic_cast< UnionInstType* >( dest ) ) {
+	void ConversionCost::postvisit( const UnionInstType * inst ) {
+		if ( const UnionInstType * destAsInst = dynamic_cast< const UnionInstType * >( dest ) ) {
 			if ( inst->name == destAsInst->name ) {
 				cost = Cost::zero;
@@ -400,5 +400,5 @@
 	}
 
-	void ConversionCost::postvisit( EnumInstType * ) {
+	void ConversionCost::postvisit( const EnumInstType * ) {
 		static Type::Qualifiers q;
 		static BasicType integer( q, BasicType::SignedInt );
@@ -409,15 +409,15 @@
 	}
 
-	void ConversionCost::postvisit( TraitInstType * ) {}
-
-	void ConversionCost::postvisit( TypeInstType *inst ) {
-		if ( const EqvClass *eqvClass = env.lookup( inst->name ) ) {
+	void ConversionCost::postvisit( const TraitInstType * ) {}
+
+	void ConversionCost::postvisit( const TypeInstType * inst ) {
+		if ( const EqvClass * eqvClass = env.lookup( inst->name ) ) {
 			cost = costFunc( eqvClass->type, dest, indexer, env );
-		} else if ( TypeInstType *destAsInst = dynamic_cast< TypeInstType* >( dest ) ) {
+		} else if ( const TypeInstType * destAsInst = dynamic_cast< const TypeInstType * >( dest ) ) {
 			if ( inst->name == destAsInst->name ) {
 				cost = Cost::zero;
 			}
-		} else if ( NamedTypeDecl *namedType = indexer.lookupType( inst->name ) ) {
-			TypeDecl *type = dynamic_cast< TypeDecl* >( namedType );
+		} else if ( const NamedTypeDecl * namedType = indexer.lookupType( inst->name ) ) {
+			const TypeDecl * type = dynamic_cast< const TypeDecl * >( namedType );
 			// all typedefs should be gone by this point
 			assert( type );
@@ -428,11 +428,11 @@
 	}
 
-	void ConversionCost::postvisit( TupleType * tupleType ) {
+	void ConversionCost::postvisit( const TupleType * tupleType ) {
 		Cost c = Cost::zero;
-		if ( TupleType * destAsTuple = dynamic_cast< TupleType * >( dest ) ) {
+		if ( const TupleType * destAsTuple = dynamic_cast< const TupleType * >( dest ) ) {
 			std::list< Type * >::const_iterator srcIt = tupleType->types.begin();
 			std::list< Type * >::const_iterator destIt = destAsTuple->types.begin();
 			while ( srcIt != tupleType->types.end() && destIt != destAsTuple->types.end() ) {
-				Cost newCost = costFunc( *srcIt++, *destIt++, indexer, env );
+				Cost newCost = costFunc( * srcIt++, * destIt++, indexer, env );
 				if ( newCost == Cost::infinity ) {
 					return;
@@ -448,16 +448,16 @@
 	}
 
-	void ConversionCost::postvisit( VarArgsType * ) {
-		if ( dynamic_cast< VarArgsType* >( dest ) ) {
-			cost = Cost::zero;
-		}
-	}
-
-	void ConversionCost::postvisit( ZeroType * ) {
-		if ( dynamic_cast< ZeroType * >( dest ) ) {
-			cost = Cost::zero;
-		} else if ( BasicType *destAsBasic = dynamic_cast< BasicType* >( dest ) ) {
-			// copied from visit(BasicType*) for signed int, but +1 for safe conversions
-			int tableResult = costMatrix[ BasicType::SignedInt ][ destAsBasic->get_kind() ];
+	void ConversionCost::postvisit( const VarArgsType * ) {
+		if ( dynamic_cast< const VarArgsType * >( dest ) ) {
+			cost = Cost::zero;
+		}
+	}
+
+	void ConversionCost::postvisit( const ZeroType * ) {
+		if ( dynamic_cast< const ZeroType * >( dest ) ) {
+			cost = Cost::zero;
+		} else if ( const BasicType * destAsBasic = dynamic_cast< const BasicType * >( dest ) ) {
+			// copied from visit(BasicType *) for signed int, but +1 for safe conversions
+			int tableResult = costMatrix[ BasicType::SignedInt ][ destAsBasic->kind ];
 			if ( tableResult == -1 ) {
 				cost = Cost::unsafe;
@@ -465,7 +465,7 @@
 				cost = Cost::zero;
 				cost.incSafe( tableResult + 1 );
-				cost.incSign( signMatrix[ BasicType::SignedInt ][ destAsBasic->get_kind() ] );
-			} // if
-		} else if ( dynamic_cast< PointerType* >( dest ) ) {
+				cost.incSign( signMatrix[ BasicType::SignedInt ][ destAsBasic->kind ] );
+			} // if
+		} else if ( dynamic_cast< const PointerType * >( dest ) ) {
 			cost = Cost::zero;
 			cost.incSafe( maxIntCost + 2 ); // +1 for zero_t -> int, +1 for disambiguation
@@ -473,10 +473,10 @@
 	}
 
-	void ConversionCost::postvisit( OneType * ) {
-		if ( dynamic_cast< OneType * >( dest ) ) {
-			cost = Cost::zero;
-		} else if ( BasicType *destAsBasic = dynamic_cast< BasicType* >( dest ) ) {
-			// copied from visit(BasicType*) for signed int, but +1 for safe conversions
-			int tableResult = costMatrix[ BasicType::SignedInt ][ destAsBasic->get_kind() ];
+	void ConversionCost::postvisit( const OneType * ) {
+		if ( dynamic_cast< const OneType * >( dest ) ) {
+			cost = Cost::zero;
+		} else if ( const BasicType * destAsBasic = dynamic_cast< const BasicType * >( dest ) ) {
+			// copied from visit(BasicType *) for signed int, but +1 for safe conversions
+			int tableResult = costMatrix[ BasicType::SignedInt ][ destAsBasic->kind ];
 			if ( tableResult == -1 ) {
 				cost = Cost::unsafe;
@@ -484,5 +484,5 @@
 				cost = Cost::zero;
 				cost.incSafe( tableResult + 1 );
-				cost.incSign( signMatrix[ BasicType::SignedInt ][ destAsBasic->get_kind() ] );
+				cost.incSign( signMatrix[ BasicType::SignedInt ][ destAsBasic->kind ] );
 			} // if
 		} // if
@@ -729,5 +729,5 @@
 		auto dstEnd = dstAsTuple->types.end();
 		while ( srcIt != srcEnd && dstIt != dstEnd ) {
-			Cost newCost = costCalc( *srcIt++, *dstIt++, symtab, env );
+			Cost newCost = costCalc( * srcIt++, * dstIt++, symtab, env );
 			if ( newCost == Cost::infinity ) {
 				return;
Index: src/ResolvExpr/ConversionCost.h
===================================================================
--- src/ResolvExpr/ConversionCost.h	(revision 99da2670a9c3077bcfe60c06fde4a115b84eccae)
+++ src/ResolvExpr/ConversionCost.h	(revision 4eb43fa21537c79c32be1ee375bd917f2a305475)
@@ -33,30 +33,30 @@
 	class TypeEnvironment;
 
-	typedef std::function<Cost(Type *, Type *, const SymTab::Indexer &, const TypeEnvironment &)> CostFunction;
+	typedef std::function<Cost(const Type *, const Type *, const SymTab::Indexer &, const TypeEnvironment &)> CostFunction;
 	struct ConversionCost : public WithShortCircuiting {
 	  public:
-		ConversionCost( Type *dest, const SymTab::Indexer &indexer, const TypeEnvironment &env, CostFunction );
+		ConversionCost( const Type * dest, const SymTab::Indexer &indexer, const TypeEnvironment &env, CostFunction );
 
 		Cost get_cost() const { return cost; }
 
-		void previsit( BaseSyntaxNode * ) { visit_children = false; }
+		void previsit( const BaseSyntaxNode * ) { visit_children = false; }
 
-		void postvisit( VoidType * voidType );
-		void postvisit( BasicType * basicType );
-		void postvisit( PointerType * pointerType );
-		void postvisit( ArrayType * arrayType );
-		void postvisit( ReferenceType * refType );
-		void postvisit( FunctionType * functionType );
-		void postvisit( StructInstType * aggregateUseType );
-		void postvisit( UnionInstType * aggregateUseType );
-		void postvisit( EnumInstType * aggregateUseType );
-		void postvisit( TraitInstType * aggregateUseType );
-		void postvisit( TypeInstType * aggregateUseType );
-		void postvisit( TupleType * tupleType );
-		void postvisit( VarArgsType * varArgsType );
-		void postvisit( ZeroType * zeroType );
-		void postvisit( OneType * oneType );
+		void postvisit( const VoidType * voidType );
+		void postvisit( const BasicType * basicType );
+		void postvisit( const PointerType * pointerType );
+		void postvisit( const ArrayType * arrayType );
+		void postvisit( const ReferenceType * refType );
+		void postvisit( const FunctionType * functionType );
+		void postvisit( const StructInstType * aggregateUseType );
+		void postvisit( const UnionInstType * aggregateUseType );
+		void postvisit( const EnumInstType * aggregateUseType );
+		void postvisit( const TraitInstType * aggregateUseType );
+		void postvisit( const TypeInstType * aggregateUseType );
+		void postvisit( const TupleType * tupleType );
+		void postvisit( const VarArgsType * varArgsType );
+		void postvisit( const ZeroType * zeroType );
+		void postvisit( const OneType * oneType );
 	  protected:
-		Type *dest;
+		const Type * dest;
 		const SymTab::Indexer &indexer;
 		Cost cost;
@@ -65,6 +65,6 @@
 	};
 
-	typedef std::function<int(Type *, Type *, const SymTab::Indexer &, const TypeEnvironment &)> PtrsFunction;
-	Cost convertToReferenceCost( Type * src, ReferenceType * dest, const SymTab::Indexer & indexer, const TypeEnvironment & env, PtrsFunction func );
+	typedef std::function<int(const Type *, const Type *, const SymTab::Indexer &, const TypeEnvironment &)> PtrsFunction;
+	Cost convertToReferenceCost( const Type * src, const ReferenceType * dest, const SymTab::Indexer & indexer, const TypeEnvironment & env, PtrsFunction func );
 
 // Some function pointer types, differ in return type.
Index: src/ResolvExpr/PtrsAssignable.cc
===================================================================
--- src/ResolvExpr/PtrsAssignable.cc	(revision 99da2670a9c3077bcfe60c06fde4a115b84eccae)
+++ src/ResolvExpr/PtrsAssignable.cc	(revision 4eb43fa21537c79c32be1ee375bd917f2a305475)
@@ -27,38 +27,38 @@
 namespace ResolvExpr {
 	struct PtrsAssignable : public WithShortCircuiting {
-		PtrsAssignable( Type *dest, const TypeEnvironment &env );
+		PtrsAssignable( const Type * dest, const TypeEnvironment &env );
 
 		int get_result() const { return result; }
 
-		void previsit( Type * ) { visit_children = false; }
-
-		void postvisit( VoidType * voidType );
-		void postvisit( BasicType * basicType );
-		void postvisit( PointerType * pointerType );
-		void postvisit( ArrayType * arrayType );
-		void postvisit( FunctionType * functionType );
-		void postvisit( StructInstType * inst );
-		void postvisit( UnionInstType * inst );
-		void postvisit( EnumInstType * inst );
-		void postvisit( TraitInstType * inst );
-		void postvisit( TypeInstType * inst );
-		void postvisit( TupleType * tupleType );
-		void postvisit( VarArgsType * varArgsType );
-		void postvisit( ZeroType * zeroType );
-		void postvisit( OneType * oneType );
+		void previsit( const Type * ) { visit_children = false; }
+
+		void postvisit( const VoidType * voidType );
+		void postvisit( const BasicType * basicType );
+		void postvisit( const PointerType * pointerType );
+		void postvisit( const ArrayType * arrayType );
+		void postvisit( const FunctionType * functionType );
+		void postvisit( const StructInstType * inst );
+		void postvisit( const UnionInstType * inst );
+		void postvisit( const EnumInstType * inst );
+		void postvisit( const TraitInstType * inst );
+		void postvisit( const TypeInstType * inst );
+		void postvisit( const TupleType * tupleType );
+		void postvisit( const VarArgsType * varArgsType );
+		void postvisit( const ZeroType * zeroType );
+		void postvisit( const OneType * oneType );
 	  private:
-		Type *dest;
+		const Type * dest;
 		int result;
 		const TypeEnvironment &env;
 	};
 
-	int ptrsAssignable( Type *src, Type *dest, const TypeEnvironment &env ) {
+	int ptrsAssignable( const Type *src, const Type * dest, const TypeEnvironment &env ) {
 		// std::cerr << "assignable: " << src << " | " << dest << std::endl;
-		if ( TypeInstType *destAsTypeInst = dynamic_cast< TypeInstType* >( dest ) ) {
-			if ( const EqvClass *eqvClass = env.lookup( destAsTypeInst->get_name() ) ) {
+		if ( const TypeInstType * destAsTypeInst = dynamic_cast< const TypeInstType* >( dest ) ) {
+			if ( const EqvClass * eqvClass = env.lookup( destAsTypeInst->get_name() ) ) {
 				return ptrsAssignable( src, eqvClass->type, env );
 			} // if
 		} // if
-		if ( dynamic_cast< VoidType* >( dest ) ) {
+		if ( dynamic_cast< const VoidType* >( dest ) ) {
 			// void * = T * for any T is unsafe
 			// xxx - this should be safe, but that currently breaks the build
@@ -71,21 +71,21 @@
 	}
 
-	PtrsAssignable::PtrsAssignable( Type *dest, const TypeEnvironment &env ) : dest( dest ), result( 0 ), env( env ) {}
-
-	void PtrsAssignable::postvisit( VoidType * ) {
+	PtrsAssignable::PtrsAssignable( const Type * dest, const TypeEnvironment &env ) : dest( dest ), result( 0 ), env( env ) {}
+
+	void PtrsAssignable::postvisit( const VoidType * ) {
 		// T * = void * is disallowed - this is a change from C, where any
 		// void * can be assigned or passed to a non-void pointer without a cast.
 	}
 
-	void PtrsAssignable::postvisit( __attribute__((unused)) BasicType *basicType ) {}
-	void PtrsAssignable::postvisit( __attribute__((unused)) PointerType *pointerType ) {}
-	void PtrsAssignable::postvisit( __attribute__((unused)) ArrayType *arrayType ) {}
-	void PtrsAssignable::postvisit( __attribute__((unused)) FunctionType *functionType ) {}
-
-	void PtrsAssignable::postvisit(  __attribute__((unused)) StructInstType *inst ) {}
-	void PtrsAssignable::postvisit(  __attribute__((unused)) UnionInstType *inst ) {}
-
-	void PtrsAssignable::postvisit( EnumInstType * ) {
-		if ( dynamic_cast< BasicType* >( dest ) ) {
+	void PtrsAssignable::postvisit( const BasicType * ) {}
+	void PtrsAssignable::postvisit( const PointerType * ) {}
+	void PtrsAssignable::postvisit( const ArrayType * ) {}
+	void PtrsAssignable::postvisit( const FunctionType * ) {}
+
+	void PtrsAssignable::postvisit( const StructInstType * ) {}
+	void PtrsAssignable::postvisit( const UnionInstType * ) {}
+
+	void PtrsAssignable::postvisit( const EnumInstType * ) {
+		if ( dynamic_cast< const BasicType* >( dest ) ) {
 			// int * = E *, etc. is safe. This isn't technically correct, as each
 			// enum has one basic type that it is compatible with, an that type can
@@ -97,7 +97,7 @@
 	}
 
-	void PtrsAssignable::postvisit(  __attribute__((unused)) TraitInstType *inst ) {}
-	void PtrsAssignable::postvisit( TypeInstType *inst ) {
-		if ( const EqvClass *eqvClass = env.lookup( inst->get_name() ) ) {
+	void PtrsAssignable::postvisit(  const TraitInstType * ) {}
+	void PtrsAssignable::postvisit( const TypeInstType * inst ) {
+		if ( const EqvClass * eqvClass = env.lookup( inst->name ) ) {
 			if ( eqvClass->type ) {
 				// T * = S * for any S depends on the type bound to T
@@ -107,8 +107,8 @@
 	}
 
-	void PtrsAssignable::postvisit(  __attribute__((unused)) TupleType *tupleType ) {}
-	void PtrsAssignable::postvisit(  __attribute__((unused)) VarArgsType *varArgsType ) {}
-	void PtrsAssignable::postvisit(  __attribute__((unused)) ZeroType *zeroType ) {}
-	void PtrsAssignable::postvisit(  __attribute__((unused)) OneType *oneType ) {}
+	void PtrsAssignable::postvisit( const TupleType * ) {}
+	void PtrsAssignable::postvisit( const VarArgsType * ) {}
+	void PtrsAssignable::postvisit( const ZeroType * ) {}
+	void PtrsAssignable::postvisit( const OneType * ) {}
 
 // TODO: Get rid of the `_new` suffix when the old version is removed.
Index: src/ResolvExpr/PtrsCastable.cc
===================================================================
--- src/ResolvExpr/PtrsCastable.cc	(revision 99da2670a9c3077bcfe60c06fde4a115b84eccae)
+++ src/ResolvExpr/PtrsCastable.cc	(revision 4eb43fa21537c79c32be1ee375bd917f2a305475)
@@ -29,26 +29,26 @@
 	struct PtrsCastable_old : public WithShortCircuiting  {
 	  public:
-		PtrsCastable_old( Type *dest, const TypeEnvironment &env, const SymTab::Indexer &indexer );
+		PtrsCastable_old( const Type * dest, const TypeEnvironment &env, const SymTab::Indexer &indexer );
 
 		int get_result() const { return result; }
 
-		void previsit( Type * ) { visit_children = false; }
-
-		void postvisit( VoidType * voidType );
-		void postvisit( BasicType * basicType );
-		void postvisit( PointerType * pointerType );
-		void postvisit( ArrayType * arrayType );
-		void postvisit( FunctionType * functionType );
-		void postvisit( StructInstType * inst );
-		void postvisit( UnionInstType * inst );
-		void postvisit( EnumInstType * inst );
-		void postvisit( TraitInstType * inst );
-		void postvisit( TypeInstType * inst );
-		void postvisit( TupleType * tupleType );
-		void postvisit( VarArgsType * varArgsType );
-		void postvisit( ZeroType * zeroType );
-		void postvisit( OneType * oneType );
+		void previsit( const Type * ) { visit_children = false; }
+
+		void postvisit( const VoidType * voidType );
+		void postvisit( const BasicType * basicType );
+		void postvisit( const PointerType * pointerType );
+		void postvisit( const ArrayType * arrayType );
+		void postvisit( const FunctionType * functionType );
+		void postvisit( const StructInstType * inst );
+		void postvisit( const UnionInstType * inst );
+		void postvisit( const EnumInstType * inst );
+		void postvisit( const TraitInstType * inst );
+		void postvisit( const TypeInstType * inst );
+		void postvisit( const TupleType * tupleType );
+		void postvisit( const VarArgsType * varArgsType );
+		void postvisit( const ZeroType * zeroType );
+		void postvisit( const OneType * oneType );
 	  private:
-		Type *dest;
+		const Type * dest;
 		int result;
 		const TypeEnvironment &env;
@@ -57,15 +57,15 @@
 
 	namespace {
-		int objectCast( Type *src, const TypeEnvironment &env, const SymTab::Indexer &indexer ) {
-			if ( dynamic_cast< FunctionType* >( src ) ) {
+		int objectCast( const Type * src, const TypeEnvironment &env, const SymTab::Indexer &indexer ) {
+			if ( dynamic_cast< const FunctionType* >( src ) ) {
 				return -1;
-			} else if ( TypeInstType *typeInst = dynamic_cast< TypeInstType* >( src ) ) {
-				if ( NamedTypeDecl *ntDecl = indexer.lookupType( typeInst->get_name() ) ) {
-					if ( TypeDecl *tyDecl = dynamic_cast< TypeDecl* >( ntDecl ) ) {
-						if ( tyDecl->get_kind() == TypeDecl::Ftype ) {
+			} else if ( const TypeInstType * typeInst = dynamic_cast< const TypeInstType* >( src ) ) {
+				if ( const NamedTypeDecl * ntDecl = indexer.lookupType( typeInst->name ) ) {
+					if ( const TypeDecl * tyDecl = dynamic_cast< const TypeDecl* >( ntDecl ) ) {
+						if ( tyDecl->kind == TypeDecl::Ftype ) {
 							return -1;
 						} // if
 					} //if
-				} else if ( const EqvClass *eqvClass = env.lookup( typeInst->get_name() ) ) {
+				} else if ( const EqvClass * eqvClass = env.lookup( typeInst->get_name() ) ) {
 					if ( eqvClass->data.kind == TypeDecl::Ftype ) {
 						return -1;
@@ -75,17 +75,17 @@
 			return 1;
 		}
-		int functionCast( Type *src, const TypeEnvironment &env, const SymTab::Indexer &indexer ) {
+		int functionCast( const Type * src, const TypeEnvironment &env, const SymTab::Indexer &indexer ) {
 			return -1 * objectCast( src, env, indexer );  // reverse the sense of objectCast
 		}
 	}
 
-	int ptrsCastable( Type *src, Type *dest, const TypeEnvironment &env, const SymTab::Indexer &indexer ) {
-		if ( TypeInstType *destAsTypeInst = dynamic_cast< TypeInstType* >( dest ) ) {
-			if ( const EqvClass *eqvClass = env.lookup( destAsTypeInst->get_name() ) ) {
+	int ptrsCastable( const Type * src, const Type * dest, const TypeEnvironment &env, const SymTab::Indexer &indexer ) {
+		if ( const TypeInstType * destAsTypeInst = dynamic_cast< const TypeInstType* >( dest ) ) {
+			if ( const EqvClass * eqvClass = env.lookup( destAsTypeInst->get_name() ) ) {
 				// xxx - should this be ptrsCastable?
 				return ptrsAssignable( src, eqvClass->type, env );
 			} // if
 		} // if
-		if ( dynamic_cast< VoidType* >( dest ) ) {
+		if ( dynamic_cast< const VoidType* >( dest ) ) {
 			return objectCast( src, env, indexer );
 		} else {
@@ -96,42 +96,42 @@
 	}
 
-	PtrsCastable_old::PtrsCastable_old( Type *dest, const TypeEnvironment &env, const SymTab::Indexer &indexer )
+	PtrsCastable_old::PtrsCastable_old( const Type * dest, const TypeEnvironment &env, const SymTab::Indexer &indexer )
 		: dest( dest ), result( 0 ), env( env ), indexer( indexer )	{
 	}
 
-	void PtrsCastable_old::postvisit( VoidType * ) {
-		result = objectCast( dest, env, indexer );
-	}
-
-	void PtrsCastable_old::postvisit( BasicType * ) {
-		result = objectCast( dest, env, indexer );
-	}
-
-	void PtrsCastable_old::postvisit( PointerType * ) {
-		result = objectCast( dest, env, indexer );
-	}
-
-	void PtrsCastable_old::postvisit( ArrayType * ) {
-		result = objectCast( dest, env, indexer );
-	}
-
-	void PtrsCastable_old::postvisit( FunctionType * ) {
+	void PtrsCastable_old::postvisit( const VoidType * ) {
+		result = objectCast( dest, env, indexer );
+	}
+
+	void PtrsCastable_old::postvisit( const BasicType * ) {
+		result = objectCast( dest, env, indexer );
+	}
+
+	void PtrsCastable_old::postvisit( const PointerType * ) {
+		result = objectCast( dest, env, indexer );
+	}
+
+	void PtrsCastable_old::postvisit( const ArrayType * ) {
+		result = objectCast( dest, env, indexer );
+	}
+
+	void PtrsCastable_old::postvisit( const FunctionType * ) {
 		// result = -1;
 		result = functionCast( dest, env, indexer );
 	}
 
-	void PtrsCastable_old::postvisit( StructInstType * ) {
-		result = objectCast( dest, env, indexer );
-	}
-
-	void PtrsCastable_old::postvisit( UnionInstType * ) {
-		result = objectCast( dest, env, indexer );
-	}
-
-	void PtrsCastable_old::postvisit( EnumInstType * ) {
-		if ( dynamic_cast< EnumInstType* >( dest ) ) {
+	void PtrsCastable_old::postvisit( const StructInstType * ) {
+		result = objectCast( dest, env, indexer );
+	}
+
+	void PtrsCastable_old::postvisit( const UnionInstType * ) {
+		result = objectCast( dest, env, indexer );
+	}
+
+	void PtrsCastable_old::postvisit( const EnumInstType * ) {
+		if ( dynamic_cast< const EnumInstType * >( dest ) ) {
 			result = 1;
-		} else if ( BasicType *bt = dynamic_cast< BasicType* >( dest ) ) {
-			if ( bt->get_kind() == BasicType::SignedInt ) {
+		} else if ( const BasicType * bt = dynamic_cast< const BasicType * >( dest ) ) {
+			if ( bt->kind == BasicType::SignedInt ) {
 				result = 0;
 			} else {
@@ -143,24 +143,24 @@
 	}
 
-	void PtrsCastable_old::postvisit( TraitInstType * ) {}
-
-	void PtrsCastable_old::postvisit(TypeInstType *inst ) {
+	void PtrsCastable_old::postvisit( const TraitInstType * ) {}
+
+	void PtrsCastable_old::postvisit( const TypeInstType *inst ) {
 		//result = objectCast( inst, env, indexer ) > 0 && objectCast( dest, env, indexer ) > 0 ? 1 : -1;
 		result = objectCast( inst, env, indexer ) == objectCast( dest, env, indexer ) ? 1 : -1;
 	}
 
-	void PtrsCastable_old::postvisit( TupleType * ) {
-		result = objectCast( dest, env, indexer );
-	}
-
-	void PtrsCastable_old::postvisit( VarArgsType * ) {
-		result = objectCast( dest, env, indexer );
-	}
-
-	void PtrsCastable_old::postvisit( ZeroType * ) {
-		result = objectCast( dest, env, indexer );
-	}
-
-	void PtrsCastable_old::postvisit( OneType * ) {
+	void PtrsCastable_old::postvisit( const TupleType * ) {
+		result = objectCast( dest, env, indexer );
+	}
+
+	void PtrsCastable_old::postvisit( const VarArgsType * ) {
+		result = objectCast( dest, env, indexer );
+	}
+
+	void PtrsCastable_old::postvisit( const ZeroType * ) {
+		result = objectCast( dest, env, indexer );
+	}
+
+	void PtrsCastable_old::postvisit( const OneType * ) {
 		result = objectCast( dest, env, indexer );
 	}
@@ -168,6 +168,6 @@
 namespace {
 	// can this type be cast to an object (1 for yes, -1 for no)
-	int objectCast( 
-		const ast::Type * src, const ast::TypeEnvironment & env, const ast::SymbolTable & symtab 
+	int objectCast(
+		const ast::Type * src, const ast::TypeEnvironment & env, const ast::SymbolTable & symtab
 	) {
 		if ( dynamic_cast< const ast::FunctionType * >( src ) ) {
@@ -191,6 +191,6 @@
 
 	// can this type be cast to a function (inverse of objectCast)
-	int functionCast( 
-		const ast::Type * src, const ast::TypeEnvironment & env, const ast::SymbolTable & symtab 
+	int functionCast(
+		const ast::Type * src, const ast::TypeEnvironment & env, const ast::SymbolTable & symtab
 	) {
 		return -1 * objectCast( src, env, symtab );
@@ -204,5 +204,5 @@
 		int result;
 
-		PtrsCastable_new( 
+		PtrsCastable_new(
 			const ast::Type * d, const ast::TypeEnvironment & e, const ast::SymbolTable & syms )
 		: dst( d ), env( e ), symtab( syms ), result( 0 ) {}
@@ -278,7 +278,7 @@
 } // anonymous namespace
 
-int ptrsCastable( 
-	const ast::Type * src, const ast::Type * dst, const ast::SymbolTable & symtab, 
-	const ast::TypeEnvironment & env 
+int ptrsCastable(
+	const ast::Type * src, const ast::Type * dst, const ast::SymbolTable & symtab,
+	const ast::TypeEnvironment & env
 ) {
 	if ( auto inst = dynamic_cast< const ast::TypeInstType * >( dst ) ) {
Index: src/ResolvExpr/ResolveAssertions.cc
===================================================================
--- src/ResolvExpr/ResolveAssertions.cc	(revision 99da2670a9c3077bcfe60c06fde4a115b84eccae)
+++ src/ResolvExpr/ResolveAssertions.cc	(revision 4eb43fa21537c79c32be1ee375bd917f2a305475)
@@ -9,7 +9,7 @@
 // Author           : Aaron B. Moss
 // Created On       : Fri Oct 05 13:46:00 2018
-// Last Modified By : Aaron B. Moss
-// Last Modified On : Fri Oct 05 13:46:00 2018
-// Update Count     : 1
+// Last Modified By : Peter A. Buhr
+// Last Modified On : Wed Jul 10 16:10:37 2019
+// Update Count     : 2
 //
 
@@ -197,5 +197,5 @@
 			}
 			if ( i == b.size() /* && i < a.size() */ ) return 1;
-			
+
 			int c = a[i].compare( b[i] );
 			if ( c != 0 ) return c;
@@ -220,5 +220,5 @@
 
 		/// Initial resolution state for an alternative
-		ResnState( Alternative& a, SymTab::Indexer& indexer )
+		ResnState( Alternative & a, SymTab::Indexer & indexer )
 		: alt(a), need(), newNeed(), deferred(), inferred(), costs{ Cost::zero }, indexer(indexer) {
 			need.swap( a.need );
@@ -226,5 +226,5 @@
 
 		/// Updated resolution state with new need-list
-		ResnState( ResnState&& o, IterateFlag )
+		ResnState( ResnState && o, IterateFlag )
 		: alt(std::move(o.alt)), need(o.newNeed.begin(), o.newNeed.end()), newNeed(), deferred(),
 		  inferred(std::move(o.inferred)), costs(o.costs), indexer(o.indexer) {
@@ -234,11 +234,11 @@
 
 	/// Binds a single assertion, updating resolution state
-	void bindAssertion( const DeclarationWithType* decl, AssertionSetValue info, Alternative& alt,
-			AssnCandidate& match, InferCache& inferred ) {
-
-		DeclarationWithType* candidate = match.cdata.id;
-		assertf( candidate->get_uniqueId(), "Assertion candidate does not have a unique ID: %s", toString( candidate ).c_str() );
-
-		Expression* varExpr = match.cdata.combine( alt.cvtCost );
+	void bindAssertion( const DeclarationWithType * decl, AssertionSetValue info, Alternative & alt,
+			AssnCandidate & match, InferCache & inferred ) {
+
+		const DeclarationWithType * candidate = match.cdata.id;
+		assertf( candidate->uniqueId, "Assertion candidate does not have a unique ID: %s", toString( candidate ).c_str() );
+
+		Expression * varExpr = match.cdata.combine( alt.cvtCost );
 		delete varExpr->result;
 		varExpr->result = match.adjType->clone();
@@ -247,10 +247,10 @@
 		// place newly-inferred assertion in proper place in cache
 		inferred[ info.resnSlot ][ decl->get_uniqueId() ] = ParamEntry{
-				candidate->get_uniqueId(), candidate->clone(), match.adjType->clone(), decl->get_type()->clone(),
+				candidate->uniqueId, candidate->clone(), match.adjType->clone(), decl->get_type()->clone(),
 				varExpr };
 	}
 
 	/// Adds a captured assertion to the symbol table
-	void addToIndexer( AssertionSet &assertSet, SymTab::Indexer &indexer ) {
+	void addToIndexer( AssertionSet & assertSet, SymTab::Indexer & indexer ) {
 		for ( auto&  i : assertSet ) {
 			if ( i.second.isUsed ) {
@@ -264,5 +264,5 @@
 
 	/// Resolve a single assertion, in context
-	bool resolveAssertion( AssertionItem& assn, ResnState& resn ) {
+	bool resolveAssertion( AssertionItem & assn, ResnState & resn ) {
 		// skip unused assertions
 		if ( ! assn.info.isUsed ) return true;
@@ -274,6 +274,6 @@
 		// find the candidates that unify with the desired type
 		CandidateList matches;
-		for ( const auto& cdata : candidates ) {
-			DeclarationWithType* candidate = cdata.id;
+		for ( const auto & cdata : candidates ) {
+			const DeclarationWithType * candidate = cdata.id;
 
 			// build independent unification context for candidate
@@ -281,5 +281,5 @@
 			TypeEnvironment newEnv{ resn.alt.env };
 			OpenVarSet newOpenVars{ resn.alt.openVars };
-			Type* adjType = candidate->get_type()->clone();
+			Type * adjType = candidate->get_type()->clone();
 			adjustExprType( adjType, newEnv, resn.indexer );
 			renameTyVars( adjType );
@@ -368,8 +368,8 @@
 		std::string resKey = SymTab::Mangler::mangleType( resType );
 		delete resType;
-		return std::move( resKey );
-	}
-	
-	/// Replace resnSlots with inferParams and add alternative to output list, if meets pruning 
+		return resKey;
+	}
+
+	/// Replace resnSlots with inferParams and add alternative to output list, if meets pruning
 	/// threshold.
 	void finalizeAssertions( ResnState& resn, PruneMap & pruneThresholds, AltList& out ) {
@@ -406,5 +406,5 @@
 		ResnList resns{ ResnState{ alt, root_indexer } };
 		ResnList new_resns{};
-		
+
 		// Pruning thresholds by result type of the output alternatives.
 		// Alternatives *should* be generated in sorted order, so no need to retroactively prune
Index: src/ResolvExpr/Resolver.cc
===================================================================
--- src/ResolvExpr/Resolver.cc	(revision 99da2670a9c3077bcfe60c06fde4a115b84eccae)
+++ src/ResolvExpr/Resolver.cc	(revision 4eb43fa21537c79c32be1ee375bd917f2a305475)
@@ -562,8 +562,7 @@
 		// TODO: Replace *exception type with &exception type.
 		if ( throwStmt->get_expr() ) {
-			StructDecl * exception_decl =
-				indexer.lookupStruct( "__cfaabi_ehm__base_exception_t" );
+			const StructDecl * exception_decl = indexer.lookupStruct( "__cfaabi_ehm__base_exception_t" );
 			assert( exception_decl );
-			Type * exceptType = new PointerType( noQualifiers, new StructInstType( noQualifiers, exception_decl ) );
+			Type * exceptType = new PointerType( noQualifiers, new StructInstType( noQualifiers, const_cast<StructDecl *>(exception_decl) ) );
 			findSingleExpression( throwStmt->expr, exceptType, indexer );
 		}
@@ -972,5 +971,5 @@
 		/// Calls the CandidateFinder and finds the single best candidate
 		CandidateRef findUnfinishedKindExpression(
-			const ast::Expr * untyped, const ast::SymbolTable & symtab, const std::string & kind, 
+			const ast::Expr * untyped, const ast::SymbolTable & symtab, const std::string & kind,
 			std::function<bool(const Candidate &)> pred = anyCandidate, ResolvMode mode = {}
 		) {
@@ -994,6 +993,6 @@
 			// produce invalid error if no candidates
 			if ( candidates.empty() ) {
-				SemanticError( untyped, 
-					toString( "No reasonable alternatives for ", kind, (kind != "" ? " " : ""), 
+				SemanticError( untyped,
+					toString( "No reasonable alternatives for ", kind, (kind != "" ? " " : ""),
 					"expression: ") );
 			}
@@ -1031,5 +1030,5 @@
 			if ( winners.size() != 1 ) {
 				std::ostringstream stream;
-				stream << "Cannot choose between " << winners.size() << " alternatives for " 
+				stream << "Cannot choose between " << winners.size() << " alternatives for "
 					<< kind << (kind != "" ? " " : "") << "expression\n";
 				ast::print( stream, untyped );
@@ -1054,10 +1053,10 @@
 		struct StripCasts_new final {
 			const ast::Expr * postmutate( const ast::CastExpr * castExpr ) {
-				if ( 
-					castExpr->isGenerated 
-					&& typesCompatible( castExpr->arg->result, castExpr->result ) 
+				if (
+					castExpr->isGenerated
+					&& typesCompatible( castExpr->arg->result, castExpr->result )
 				) {
 					// generated cast is the same type as its argument, remove it after keeping env
-					return ast::mutate_field( 
+					return ast::mutate_field(
 						castExpr->arg.get(), &ast::Expr::env, castExpr->env );
 				}
@@ -1088,10 +1087,10 @@
 
 		/// Establish post-resolver invariants for expressions
-		void finishExpr( 
-			ast::ptr< ast::Expr > & expr, const ast::TypeEnvironment & env, 
+		void finishExpr(
+			ast::ptr< ast::Expr > & expr, const ast::TypeEnvironment & env,
 			const ast::TypeSubstitution * oldenv = nullptr
 		) {
 			// set up new type substitution for expression
-			ast::ptr< ast::TypeSubstitution > newenv = 
+			ast::ptr< ast::TypeSubstitution > newenv =
 				 oldenv ? oldenv : new ast::TypeSubstitution{};
 			env.writeToSubstitution( *newenv.get_and_mutate() );
@@ -1102,15 +1101,15 @@
 	} // anonymous namespace
 
-		
+
 	ast::ptr< ast::Expr > resolveInVoidContext(
 		const ast::Expr * expr, const ast::SymbolTable & symtab, ast::TypeEnvironment & env
 	) {
 		assertf( expr, "expected a non-null expression" );
-		
+
 		// set up and resolve expression cast to void
 		ast::ptr< ast::CastExpr > untyped = new ast::CastExpr{ expr };
-		CandidateRef choice = findUnfinishedKindExpression( 
+		CandidateRef choice = findUnfinishedKindExpression(
 			untyped, symtab, "", anyCandidate, ResolvMode::withAdjustment() );
-		
+
 		// a cast expression has either 0 or 1 interpretations (by language rules);
 		// if 0, an exception has already been thrown, and this code will not run
@@ -1122,7 +1121,7 @@
 
 	namespace {
-		/// Resolve `untyped` to the expression whose candidate is the best match for a `void` 
+		/// Resolve `untyped` to the expression whose candidate is the best match for a `void`
 		/// context.
-		ast::ptr< ast::Expr > findVoidExpression( 
+		ast::ptr< ast::Expr > findVoidExpression(
 			const ast::Expr * untyped, const ast::SymbolTable & symtab
 		) {
@@ -1134,13 +1133,13 @@
 		}
 
-		/// resolve `untyped` to the expression whose candidate satisfies `pred` with the 
+		/// resolve `untyped` to the expression whose candidate satisfies `pred` with the
 		/// lowest cost, returning the resolved version
 		ast::ptr< ast::Expr > findKindExpression(
-			const ast::Expr * untyped, const ast::SymbolTable & symtab, 
-			std::function<bool(const Candidate &)> pred = anyCandidate, 
+			const ast::Expr * untyped, const ast::SymbolTable & symtab,
+			std::function<bool(const Candidate &)> pred = anyCandidate,
 			const std::string & kind = "", ResolvMode mode = {}
 		) {
 			if ( ! untyped ) return {};
-			CandidateRef choice = 
+			CandidateRef choice =
 				findUnfinishedKindExpression( untyped, symtab, kind, pred, mode );
 			finishExpr( choice->expr, choice->env, untyped->env );
@@ -1149,6 +1148,6 @@
 
 		/// Resolve `untyped` to the single expression whose candidate is the best match
-		ast::ptr< ast::Expr > findSingleExpression( 
-			const ast::Expr * untyped, const ast::SymbolTable & symtab 
+		ast::ptr< ast::Expr > findSingleExpression(
+			const ast::Expr * untyped, const ast::SymbolTable & symtab
 		) {
 			return findKindExpression( untyped, symtab );
@@ -1170,9 +1169,9 @@
 		bool hasIntegralType( const Candidate & i ) {
 			const ast::Type * type = i.expr->result;
-			
+
 			if ( auto bt = dynamic_cast< const ast::BasicType * >( type ) ) {
 				return bt->isInteger();
-			} else if ( 
-				dynamic_cast< const ast::EnumInstType * >( type ) 
+			} else if (
+				dynamic_cast< const ast::EnumInstType * >( type )
 				|| dynamic_cast< const ast::ZeroType * >( type )
 				|| dynamic_cast< const ast::OneType * >( type )
@@ -1183,6 +1182,6 @@
 
 		/// Resolve `untyped` as an integral expression, returning the resolved version
-		ast::ptr< ast::Expr > findIntegralExpression( 
-			const ast::Expr * untyped, const ast::SymbolTable & symtab 
+		ast::ptr< ast::Expr > findIntegralExpression(
+			const ast::Expr * untyped, const ast::SymbolTable & symtab
 		) {
 			return findKindExpression( untyped, symtab, hasIntegralType, "condition" );
@@ -1192,6 +1191,6 @@
 		bool isCharType( const ast::Type * t ) {
 			if ( auto bt = dynamic_cast< const ast::BasicType * >( t ) ) {
-				return bt->kind == ast::BasicType::Char 
-					|| bt->kind == ast::BasicType::SignedChar 
+				return bt->kind == ast::BasicType::Char
+					|| bt->kind == ast::BasicType::SignedChar
 					|| bt->kind == ast::BasicType::UnsignedChar;
 			}
@@ -1253,6 +1252,6 @@
 	}
 
-	ast::ptr< ast::Init > resolveCtorInit( 
-		const ast::ConstructorInit * ctorInit, const ast::SymbolTable & symtab 
+	ast::ptr< ast::Init > resolveCtorInit(
+		const ast::ConstructorInit * ctorInit, const ast::SymbolTable & symtab
 	) {
 		assert( ctorInit );
@@ -1261,6 +1260,6 @@
 	}
 
-	ast::ptr< ast::Expr > resolveStmtExpr( 
-		const ast::StmtExpr * stmtExpr, const ast::SymbolTable & symtab 
+	ast::ptr< ast::Expr > resolveStmtExpr(
+		const ast::StmtExpr * stmtExpr, const ast::SymbolTable & symtab
 	) {
 		assert( stmtExpr );
@@ -1303,16 +1302,16 @@
 
 	void Resolver_new::previsit( const ast::ObjectDecl * objectDecl ) {
-		// To handle initialization of routine pointers [e.g. int (*fp)(int) = foo()], 
-		// class-variable `initContext` is changed multiple times because the LHS is analyzed 
-		// twice. The second analysis changes `initContext` because a function type can contain 
-		// object declarations in the return and parameter types. Therefore each value of 
-		// `initContext` is retained so the type on the first analysis is preserved and used for 
+		// To handle initialization of routine pointers [e.g. int (*fp)(int) = foo()],
+		// class-variable `initContext` is changed multiple times because the LHS is analyzed
+		// twice. The second analysis changes `initContext` because a function type can contain
+		// object declarations in the return and parameter types. Therefore each value of
+		// `initContext` is retained so the type on the first analysis is preserved and used for
 		// selecting the RHS.
 		GuardValue( currentObject );
 		currentObject = ast::CurrentObject{ objectDecl->location, objectDecl->get_type() };
 		if ( inEnumDecl && dynamic_cast< const ast::EnumInstType * >( objectDecl->get_type() ) ) {
-			// enumerator initializers should not use the enum type to initialize, since the 
+			// enumerator initializers should not use the enum type to initialize, since the
 			// enum type is still incomplete at this point. Use `int` instead.
-			currentObject = ast::CurrentObject{ 
+			currentObject = ast::CurrentObject{
 				objectDecl->location, new ast::BasicType{ ast::BasicType::SignedInt } };
 		}
@@ -1325,9 +1324,9 @@
 	}
 
-	const ast::StaticAssertDecl * Resolver_new::previsit( 
-		const ast::StaticAssertDecl * assertDecl 
+	const ast::StaticAssertDecl * Resolver_new::previsit(
+		const ast::StaticAssertDecl * assertDecl
 	) {
-		return ast::mutate_field( 
-			assertDecl, &ast::StaticAssertDecl::cond, 
+		return ast::mutate_field(
+			assertDecl, &ast::StaticAssertDecl::cond,
 			findIntegralExpression( assertDecl->cond, symtab ) );
 	}
@@ -1338,6 +1337,6 @@
 			#warning should use new equivalent to Validate::SizeType rather than sizeType here
 			ast::ptr< ast::Type > sizeType = new ast::BasicType{ ast::BasicType::LongUnsignedInt };
-			ast::mutate_field( 
-				type, &PtrType::dimension, 
+			ast::mutate_field(
+				type, &PtrType::dimension,
 				findSingleExpression( type->dimension, sizeType, symtab ) );
 		}
@@ -1356,6 +1355,6 @@
 		visit_children = false;
 		assertf( exprStmt->expr, "ExprStmt has null expression in resolver" );
-		
-		return ast::mutate_field( 
+
+		return ast::mutate_field(
 			exprStmt, &ast::ExprStmt::expr, findVoidExpression( exprStmt->expr, symtab ) );
 	}
@@ -1364,12 +1363,12 @@
 		visit_children = false;
 
-		asmExpr = ast::mutate_field( 
+		asmExpr = ast::mutate_field(
 			asmExpr, &ast::AsmExpr::operand, findVoidExpression( asmExpr->operand, symtab ) );
-		
+
 		if ( asmExpr->inout ) {
 			asmExpr = ast::mutate_field(
 				asmExpr, &ast::AsmExpr::inout, findVoidExpression( asmExpr->inout, symtab ) );
 		}
-		
+
 		return asmExpr;
 	}
@@ -1388,5 +1387,5 @@
 
 	const ast::WhileStmt * Resolver_new::previsit( const ast::WhileStmt * whileStmt ) {
-		return ast::mutate_field( 
+		return ast::mutate_field(
 			whileStmt, &ast::WhileStmt::cond, findIntegralExpression( whileStmt->cond, symtab ) );
 	}
@@ -1409,5 +1408,5 @@
 		GuardValue( currentObject );
 		switchStmt = ast::mutate_field(
-			switchStmt, &ast::SwitchStmt::cond, 
+			switchStmt, &ast::SwitchStmt::cond,
 			findIntegralExpression( switchStmt->cond, symtab ) );
 		currentObject = ast::CurrentObject{ switchStmt->location, switchStmt->cond->result };
@@ -1420,15 +1419,15 @@
 			assertf( initAlts.size() == 1, "SwitchStmt did not correctly resolve an integral "
 				"expression." );
-			
-			ast::ptr< ast::Expr > untyped = 
+
+			ast::ptr< ast::Expr > untyped =
 				new ast::CastExpr{ caseStmt->location, caseStmt->cond, initAlts.front().type };
 			ast::ptr< ast::Expr > newExpr = findSingleExpression( untyped, symtab );
-			
-			// case condition cannot have a cast in C, so it must be removed here, regardless of 
+
+			// case condition cannot have a cast in C, so it must be removed here, regardless of
 			// whether it would perform a conversion.
 			if ( const ast::CastExpr * castExpr = newExpr.as< ast::CastExpr >() ) {
 				swap_and_save_env( newExpr, castExpr->arg );
 			}
-			
+
 			caseStmt = ast::mutate_field( caseStmt, &ast::CaseStmt::cond, newExpr );
 		}
@@ -1443,5 +1442,5 @@
 			ast::ptr< ast::Type > target = new ast::PointerType{ new ast::VoidType{} };
 			branchStmt = ast::mutate_field(
-				branchStmt, &ast::BranchStmt::computedTarget, 
+				branchStmt, &ast::BranchStmt::computedTarget,
 				findSingleExpression( branchStmt->computedTarget, target, symtab ) );
 		}
@@ -1453,5 +1452,5 @@
 		if ( returnStmt->expr ) {
 			returnStmt = ast::mutate_field(
-				returnStmt, &ast::ReturnStmt::expr, 
+				returnStmt, &ast::ReturnStmt::expr,
 				findSingleExpression( returnStmt->expr, functionReturn, symtab ) );
 		}
@@ -1462,11 +1461,11 @@
 		visit_children = false;
 		if ( throwStmt->expr ) {
-			const ast::StructDecl * exceptionDecl = 
+			const ast::StructDecl * exceptionDecl =
 				symtab.lookupStruct( "__cfaabi_ehm__base_exception_t" );
 			assert( exceptionDecl );
-			ast::ptr< ast::Type > exceptType = 
+			ast::ptr< ast::Type > exceptType =
 				new ast::PointerType{ new ast::StructInstType{ exceptionDecl } };
 			throwStmt = ast::mutate_field(
-				throwStmt, &ast::ThrowStmt::expr, 
+				throwStmt, &ast::ThrowStmt::expr,
 				findSingleExpression( throwStmt->expr, exceptType, symtab ) );
 		}
@@ -1477,6 +1476,6 @@
 		if ( catchStmt->cond ) {
 			ast::ptr< ast::Type > boolType = new ast::BasicType{ ast::BasicType::Bool };
-			catchStmt = ast::mutate_field( 
-				catchStmt, &ast::CatchStmt::cond, 
+			catchStmt = ast::mutate_field(
+				catchStmt, &ast::CatchStmt::cond,
 				findSingleExpression( catchStmt->cond, boolType, symtab ) );
 		}
@@ -1506,12 +1505,12 @@
 
 			if ( clause.target.args.empty() ) {
-				SemanticError( stmt->location, 
+				SemanticError( stmt->location,
 					"Waitfor clause must have at least one mutex parameter");
 			}
 
 			// Find all alternatives for all arguments in canonical form
-			std::vector< CandidateFinder > argFinders = 
+			std::vector< CandidateFinder > argFinders =
 				funcFinder.findSubExprs( clause.target.args );
-			
+
 			// List all combinations of arguments
 			std::vector< CandidateList > possibilities;
@@ -1519,5 +1518,5 @@
 
 			// For every possible function:
-			// * try matching the arguments to the parameters, not the other way around because 
+			// * try matching the arguments to the parameters, not the other way around because
 			//   more arguments than parameters
 			CandidateList funcCandidates;
@@ -1526,8 +1525,8 @@
 			for ( CandidateRef & func : funcFinder.candidates ) {
 				try {
-					auto pointerType = dynamic_cast< const ast::PointerType * >( 
+					auto pointerType = dynamic_cast< const ast::PointerType * >(
 						func->expr->result->stripReferences() );
 					if ( ! pointerType ) {
-						SemanticError( stmt->location, func->expr->result.get(), 
+						SemanticError( stmt->location, func->expr->result.get(),
 							"candidate not viable: not a pointer type\n" );
 					}
@@ -1535,5 +1534,5 @@
 					auto funcType = pointerType->base.as< ast::FunctionType >();
 					if ( ! funcType ) {
-						SemanticError( stmt->location, func->expr->result.get(), 
+						SemanticError( stmt->location, func->expr->result.get(),
 							"candidate not viable: not a function type\n" );
 					}
@@ -1544,5 +1543,5 @@
 
 						if( ! nextMutex( param, paramEnd ) ) {
-							SemanticError( stmt->location, funcType, 
+							SemanticError( stmt->location, funcType,
 								"candidate function not viable: no mutex parameters\n");
 						}
@@ -1560,5 +1559,5 @@
 							ast::AssertionSet need, have;
 							ast::TypeEnvironment resultEnv{ func->env };
-							// Add all type variables as open so that those not used in the 
+							// Add all type variables as open so that those not used in the
 							// parameter list are still considered open
 							resultEnv.add( funcType->forall );
@@ -1580,5 +1579,5 @@
 							unsigned n_mutex_param = 0;
 
-							// For every argument of its set, check if it matches one of the 
+							// For every argument of its set, check if it matches one of the
 							// parameters. The order is important
 							for ( auto & arg : argsList ) {
@@ -1587,5 +1586,5 @@
 									// We ran out of parameters but still have arguments.
 									// This function doesn't match
-									SemanticError( stmt->location, funcType, 
+									SemanticError( stmt->location, funcType,
 										toString("candidate function not viable: too many mutex "
 										"arguments, expected ", n_mutex_param, "\n" ) );
@@ -1594,11 +1593,11 @@
 								++n_mutex_param;
 
-								// Check if the argument matches the parameter type in the current 
+								// Check if the argument matches the parameter type in the current
 								// scope
 								ast::ptr< ast::Type > paramType = (*param)->get_type();
-								if ( 
-									! unify( 
-										arg->expr->result, paramType, resultEnv, need, have, open, 
-										symtab ) 
+								if (
+									! unify(
+										arg->expr->result, paramType, resultEnv, need, have, open,
+										symtab )
 								) {
 									// Type doesn't match
@@ -1627,7 +1626,7 @@
 								} while ( nextMutex( param, paramEnd ) );
 
-								// We ran out of arguments but still have parameters left; this 
+								// We ran out of arguments but still have parameters left; this
 								// function doesn't match
-								SemanticError( stmt->location, funcType, 
+								SemanticError( stmt->location, funcType,
 									toString( "candidate function not viable: too few mutex "
 									"arguments, expected ", n_mutex_param, "\n" ) );
@@ -1657,5 +1656,5 @@
 			// Make sure correct number of arguments
 			if( funcCandidates.empty() ) {
-				SemanticErrorException top( stmt->location, 
+				SemanticErrorException top( stmt->location,
 					"No alternatives for function in call to waitfor" );
 				top.append( errors );
@@ -1664,6 +1663,6 @@
 
 			if( argsCandidates.empty() ) {
-				SemanticErrorException top( stmt->location, 
-					"No alternatives for arguments in call to waitfor" ); 
+				SemanticErrorException top( stmt->location,
+					"No alternatives for arguments in call to waitfor" );
 				top.append( errors );
 				throw top;
@@ -1671,5 +1670,5 @@
 
 			if( funcCandidates.size() > 1 ) {
-				SemanticErrorException top( stmt->location, 
+				SemanticErrorException top( stmt->location,
 					"Ambiguous function in call to waitfor" );
 				top.append( errors );
@@ -1686,7 +1685,7 @@
 			// build new clause
 			ast::WaitForStmt::Clause clause2;
-			
+
 			clause2.target.func = funcCandidates.front()->expr;
-			
+
 			clause2.target.args.reserve( clause.target.args.size() );
 			for ( auto arg : argsCandidates.front() ) {
@@ -1708,5 +1707,5 @@
 			ast::WaitForStmt::Timeout timeout2;
 
-			ast::ptr< ast::Type > target = 
+			ast::ptr< ast::Type > target =
 				new ast::BasicType{ ast::BasicType::LongLongUnsignedInt };
 			timeout2.time = findSingleExpression( stmt->timeout.time, target, symtab );
@@ -1740,7 +1739,7 @@
 	const ast::SingleInit * Resolver_new::previsit( const ast::SingleInit * singleInit ) {
 		visit_children = false;
-		// resolve initialization using the possibilities as determined by the `currentObject` 
+		// resolve initialization using the possibilities as determined by the `currentObject`
 		// cursor.
-		ast::ptr< ast::Expr > untyped = new ast::UntypedInitExpr{ 
+		ast::ptr< ast::Expr > untyped = new ast::UntypedInitExpr{
 			singleInit->location, singleInit->value, currentObject.getOptions() };
 		ast::ptr<ast::Expr> newExpr = findSingleExpression( untyped, symtab );
@@ -1751,6 +1750,6 @@
 
 		// discard InitExpr wrapper and retain relevant pieces.
-		// `initExpr` may have inferred params in the case where the expression specialized a 
-		// function pointer, and newExpr may already have inferParams of its own, so a simple 
+		// `initExpr` may have inferred params in the case where the expression specialized a
+		// function pointer, and newExpr may already have inferParams of its own, so a simple
 		// swap is not sufficient
 		ast::Expr::InferUnion inferred = initExpr->inferred;
@@ -1758,5 +1757,5 @@
 		newExpr.get_and_mutate()->inferred.splice( std::move(inferred) );
 
-		// get the actual object's type (may not exactly match what comes back from the resolver 
+		// get the actual object's type (may not exactly match what comes back from the resolver
 		// due to conversions)
 		const ast::Type * initContext = currentObject.getCurrentType();
@@ -1770,5 +1769,5 @@
 				if ( auto pt = newExpr->result.as< ast::PointerType >() ) {
 					if ( isCharType( pt->base ) ) {
-						// strip cast if we're initializing a char[] with a char* 
+						// strip cast if we're initializing a char[] with a char*
 						// e.g. char x[] = "hello"
 						if ( auto ce = newExpr.as< ast::CastExpr >() ) {
@@ -1793,8 +1792,8 @@
 		assert( listInit->designations.size() == listInit->initializers.size() );
 		for ( unsigned i = 0; i < listInit->designations.size(); ++i ) {
-			// iterate designations and initializers in pairs, moving the cursor to the current 
+			// iterate designations and initializers in pairs, moving the cursor to the current
 			// designated object and resolving the initializer against that object
 			listInit = ast::mutate_field_index(
-				listInit, &ast::ListInit::designations, i, 
+				listInit, &ast::ListInit::designations, i,
 				currentObject.findNext( listInit->designations[i] ) );
 			listInit = ast::mutate_field_index(
@@ -1818,6 +1817,6 @@
 		ctorInit = ast::mutate_field( ctorInit, &ast::ConstructorInit::init, nullptr );
 
-		// intrinsic single-parameter constructors and destructors do nothing. Since this was 
-		// implicitly generated, there's no way for it to have side effects, so get rid of it to 
+		// intrinsic single-parameter constructors and destructors do nothing. Since this was
+		// implicitly generated, there's no way for it to have side effects, so get rid of it to
 		// clean up generated code
 		if ( InitTweak::isIntrinsicSingleArgCallStmt( ctorInit->ctor ) ) {
Index: src/ResolvExpr/Unify.cc
===================================================================
--- src/ResolvExpr/Unify.cc	(revision 99da2670a9c3077bcfe60c06fde4a115b84eccae)
+++ src/ResolvExpr/Unify.cc	(revision 4eb43fa21537c79c32be1ee375bd917f2a305475)
@@ -97,14 +97,14 @@
 	bool unifyExact( Type *type1, Type *type2, TypeEnvironment &env, AssertionSet &needAssertions, AssertionSet &haveAssertions, const OpenVarSet &openVars, WidenMode widen, const SymTab::Indexer &indexer );
 
-	bool unifyExact( 
-		const ast::Type * type1, const ast::Type * type2, ast::TypeEnvironment & env, 
-		ast::AssertionSet & need, ast::AssertionSet & have, const ast::OpenVarSet & open, 
+	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 typesCompatible( Type *first, Type *second, const SymTab::Indexer &indexer, const TypeEnvironment &env ) {
+	bool typesCompatible( const Type * first, const Type * second, const SymTab::Indexer & indexer, const TypeEnvironment & env ) {
 		TypeEnvironment newEnv;
 		OpenVarSet openVars, closedVars; // added closedVars
 		AssertionSet needAssertions, haveAssertions;
-		Type *newFirst = first->clone(), *newSecond = second->clone();
+		Type * newFirst = first->clone(), * newSecond = second->clone();
 		env.apply( newFirst );
 		env.apply( newSecond );
@@ -121,6 +121,6 @@
 	}
 
-	bool typesCompatible( 
-			const ast::Type * first, const ast::Type * second, const ast::SymbolTable & symtab, 
+	bool typesCompatible(
+			const ast::Type * first, const ast::Type * second, const ast::SymbolTable & symtab,
 			const ast::TypeEnvironment & env ) {
 		ast::TypeEnvironment newEnv;
@@ -135,9 +135,9 @@
 		findOpenVars( newSecond, open, closed, need, have, FirstOpen );
 
-		return unifyExact( 
+		return unifyExact(
 			newFirst, newSecond, newEnv, need, have, open, noWiden(), symtab );
 	}
 
-	bool typesCompatibleIgnoreQualifiers( Type *first, Type *second, const SymTab::Indexer &indexer, const TypeEnvironment &env ) {
+	bool typesCompatibleIgnoreQualifiers( const Type * first, const Type * second, const SymTab::Indexer &indexer, const TypeEnvironment &env ) {
 		TypeEnvironment newEnv;
 		OpenVarSet openVars;
@@ -163,11 +163,11 @@
 	}
 
-	bool typesCompatibleIgnoreQualifiers( 
-			const ast::Type * first, const ast::Type * second, const ast::SymbolTable & symtab, 
+	bool typesCompatibleIgnoreQualifiers(
+			const ast::Type * first, const ast::Type * second, const ast::SymbolTable & symtab,
 			const ast::TypeEnvironment & env ) {
 		ast::TypeEnvironment newEnv;
 		ast::OpenVarSet open;
 		ast::AssertionSet need, have;
-		
+
 		ast::ptr<ast::Type> newFirst{ first }, newSecond{ second };
 		env.apply( newFirst );
@@ -176,5 +176,5 @@
 		reset_qualifiers( newSecond );
 
-		return unifyExact( 
+		return unifyExact(
 			newFirst, newSecond, newEnv, need, have, open, noWiden(), symtab );
 	}
@@ -490,9 +490,9 @@
 
 			// sizes don't have to match if ttypes are involved; need to be more precise wrt where the ttype is to prevent errors
-			if ( 
-					(flatFunc->parameters.size() == flatOther->parameters.size() && 
-						flatFunc->returnVals.size() == flatOther->returnVals.size()) 
-					|| flatFunc->isTtype() 
-					|| flatOther->isTtype() 
+			if (
+					(flatFunc->parameters.size() == flatOther->parameters.size() &&
+						flatFunc->returnVals.size() == flatOther->returnVals.size())
+					|| flatFunc->isTtype()
+					|| flatOther->isTtype()
 			) {
 				if ( unifyDeclList( flatFunc->parameters.begin(), flatFunc->parameters.end(), flatOther->parameters.begin(), flatOther->parameters.end(), env, needAssertions, haveAssertions, openVars, indexer ) ) {
@@ -711,13 +711,13 @@
 		bool result;
 
-		Unify_new( 
-			const ast::Type * type2, ast::TypeEnvironment & env, ast::AssertionSet & need, 
-			ast::AssertionSet & have, const ast::OpenVarSet & open, WidenMode widen, 
+		Unify_new(
+			const ast::Type * type2, ast::TypeEnvironment & env, ast::AssertionSet & need,
+			ast::AssertionSet & have, const ast::OpenVarSet & open, WidenMode widen,
 			const ast::SymbolTable & symtab )
-		: type2(type2), tenv(env), need(need), have(have), open(open), widen(widen), 
+		: type2(type2), tenv(env), need(need), have(have), open(open), widen(widen),
 		  symtab(symtab), result(false) {}
 
 		void previsit( const ast::Node * ) { visit_children = false; }
-		
+
 		void postvisit( const ast::VoidType * ) {
 			result = dynamic_cast< const ast::VoidType * >( type2 );
@@ -732,6 +732,6 @@
 		void postvisit( const ast::PointerType * pointer ) {
 			if ( auto pointer2 = dynamic_cast< const ast::PointerType * >( type2 ) ) {
-				result = unifyExact( 
-					pointer->base, pointer2->base, tenv, need, have, open, 
+				result = unifyExact(
+					pointer->base, pointer2->base, tenv, need, have, open,
 					noWiden(), symtab );
 			}
@@ -742,8 +742,8 @@
 			if ( ! array2 ) return;
 
-			// to unify, array types must both be VLA or both not VLA and both must have a 
+			// to unify, array types must both be VLA or both not VLA and both must have a
 			// dimension expression or not have a dimension
 			if ( array->isVarLen != array2->isVarLen ) return;
-			if ( ! array->isVarLen && ! array2->isVarLen 
+			if ( ! array->isVarLen && ! array2->isVarLen
 					&& array->dimension && array2->dimension ) {
 				auto ce1 = array->dimension.as< ast::ConstantExpr >();
@@ -751,11 +751,11 @@
 
 				// see C11 Reference Manual 6.7.6.2.6
-				// two array types with size specifiers that are integer constant expressions are 
+				// two array types with size specifiers that are integer constant expressions are
 				// compatible if both size specifiers have the same constant value
 				if ( ce1 && ce2 && ce1->intValue() != ce2->intValue() ) return;
 			}
 
-			result = unifyExact( 
-				array->base, array2->base, tenv, need, have, open, noWiden(), 
+			result = unifyExact(
+				array->base, array2->base, tenv, need, have, open, noWiden(),
 				symtab );
 		}
@@ -763,6 +763,6 @@
 		void postvisit( const ast::ReferenceType * ref ) {
 			if ( auto ref2 = dynamic_cast< const ast::ReferenceType * >( type2 ) ) {
-				result = unifyExact( 
-					ref->base, ref2->base, tenv, need, have, open, noWiden(), 
+				result = unifyExact(
+					ref->base, ref2->base, tenv, need, have, open, noWiden(),
 					symtab );
 			}
@@ -771,5 +771,5 @@
 	private:
 		/// Replaces ttype variables with their bound types.
-		/// If this isn't done when satifying ttype assertions, then argument lists can have 
+		/// If this isn't done when satifying ttype assertions, then argument lists can have
 		/// different size and structure when they should be compatible.
 		struct TtypeExpander_new : public ast::WithShortCircuiting {
@@ -800,9 +800,9 @@
 				auto types = flatten( d->get_type() );
 				for ( ast::ptr< ast::Type > & t : types ) {
-					// outermost const, volatile, _Atomic qualifiers in parameters should not play 
-					// a role in the unification of function types, since they do not determine 
+					// outermost const, volatile, _Atomic qualifiers in parameters should not play
+					// a role in the unification of function types, since they do not determine
 					// whether a function is callable.
-					// NOTE: **must** consider at least mutex qualifier, since functions can be 
-					// overloaded on outermost mutex and a mutex function has different 
+					// NOTE: **must** consider at least mutex qualifier, since functions can be
+					// overloaded on outermost mutex and a mutex function has different
 					// requirements than a non-mutex function
 					remove_qualifiers( t, ast::CV::Const | ast::CV::Volatile | ast::CV::Atomic );
@@ -818,5 +818,5 @@
 			std::vector< ast::ptr< ast::Type > > types;
 			while ( crnt != end ) {
-				// it is guaranteed that a ttype variable will be bound to a flat tuple, so ensure 
+				// it is guaranteed that a ttype variable will be bound to a flat tuple, so ensure
 				// that this results in a flat tuple
 				flatten( (*crnt)->get_type(), types );
@@ -829,7 +829,7 @@
 
 		template< typename Iter >
-		static bool unifyDeclList( 
-			Iter crnt1, Iter end1, Iter crnt2, Iter end2, ast::TypeEnvironment & env, 
-			ast::AssertionSet & need, ast::AssertionSet & have, const ast::OpenVarSet & open, 
+		static bool unifyDeclList(
+			Iter crnt1, Iter end1, Iter crnt2, Iter end2, ast::TypeEnvironment & env,
+			ast::AssertionSet & need, ast::AssertionSet & have, const ast::OpenVarSet & open,
 			const ast::SymbolTable & symtab
 		) {
@@ -843,16 +843,16 @@
 				if ( isTuple1 && ! isTuple2 ) {
 					// combine remainder of list2, then unify
-					return unifyExact( 
-						t1, tupleFromDecls( crnt2, end2 ), env, need, have, open, 
+					return unifyExact(
+						t1, tupleFromDecls( crnt2, end2 ), env, need, have, open,
 						noWiden(), symtab );
 				} else if ( ! isTuple1 && isTuple2 ) {
 					// combine remainder of list1, then unify
-					return unifyExact( 
-						tupleFromDecls( crnt1, end1 ), t2, env, need, have, open, 
+					return unifyExact(
+						tupleFromDecls( crnt1, end1 ), t2, env, need, have, open,
 						noWiden(), symtab );
 				}
 
-				if ( ! unifyExact( 
-					t1, t2, env, need, have, open, noWiden(), symtab ) 
+				if ( ! unifyExact(
+					t1, t2, env, need, have, open, noWiden(), symtab )
 				) return false;
 
@@ -860,5 +860,5 @@
 			}
 
-			// May get to the end of one argument list before the other. This is only okay if the 
+			// May get to the end of one argument list before the other. This is only okay if the
 			// other is a ttype
 			if ( crnt1 != end1 ) {
@@ -866,6 +866,6 @@
 				const ast::Type * t1 = (*crnt1)->get_type();
 				if ( ! Tuples::isTtype( t1 ) ) return false;
-				return unifyExact( 
-					t1, tupleFromDecls( crnt2, end2 ), env, need, have, open, 
+				return unifyExact(
+					t1, tupleFromDecls( crnt2, end2 ), env, need, have, open,
 					noWiden(), symtab );
 			} else if ( crnt2 != end2 ) {
@@ -873,6 +873,6 @@
 				const ast::Type * t2 = (*crnt2)->get_type();
 				if ( ! Tuples::isTtype( t2 ) ) return false;
-				return unifyExact( 
-					tupleFromDecls( crnt1, end1 ), t2, env, need, have, open, 
+				return unifyExact(
+					tupleFromDecls( crnt1, end1 ), t2, env, need, have, open,
 					noWiden(), symtab );
 			}
@@ -881,12 +881,12 @@
 		}
 
-		static bool unifyDeclList( 
-			const std::vector< ast::ptr< ast::DeclWithType > > & list1, 
-			const std::vector< ast::ptr< ast::DeclWithType > > & list2, 
-			ast::TypeEnvironment & env, ast::AssertionSet & need, ast::AssertionSet & have, 
+		static bool unifyDeclList(
+			const std::vector< ast::ptr< ast::DeclWithType > > & list1,
+			const std::vector< ast::ptr< ast::DeclWithType > > & list2,
+			ast::TypeEnvironment & env, ast::AssertionSet & need, ast::AssertionSet & have,
 			const ast::OpenVarSet & open, const ast::SymbolTable & symtab
 		) {
-			return unifyDeclList( 
-				list1.begin(), list1.end(), list2.begin(), list2.end(), env, need, have, open, 
+			return unifyDeclList(
+				list1.begin(), list1.end(), list2.begin(), list2.end(), env, need, have, open,
 				symtab );
 		}
@@ -900,7 +900,7 @@
 
 		/// mark all assertions in `type` used in both `assn1` and `assn2`
-		static void markAssertions( 
-			ast::AssertionSet & assn1, ast::AssertionSet & assn2, 
-			const ast::ParameterizedType * type 
+		static void markAssertions(
+			ast::AssertionSet & assn1, ast::AssertionSet & assn2,
+			const ast::ParameterizedType * type
 		) {
 			for ( const auto & tyvar : type->forall ) {
@@ -918,13 +918,13 @@
 
 			if ( func->isVarArgs != func2->isVarArgs ) return;
-			
-			// Flatten the parameter lists for both functions so that tuple structure does not 
+
+			// Flatten the parameter lists for both functions so that tuple structure does not
 			// affect unification. Does not actually mutate function parameters.
 			auto params = flattenList( func->params, tenv );
 			auto params2 = flattenList( func2->params, tenv );
 
-			// sizes don't have to match if ttypes are involved; need to be more precise w.r.t. 
+			// sizes don't have to match if ttypes are involved; need to be more precise w.r.t.
 			// where the ttype is to prevent errors
-			if ( 
+			if (
 				( params.size() != params2.size() || func->returns.size() != func2->returns.size() )
 				&& ! func->isTtype()
@@ -933,7 +933,7 @@
 
 			if ( ! unifyDeclList( params, params2, tenv, need, have, open, symtab ) ) return;
-			if ( ! unifyDeclList( 
+			if ( ! unifyDeclList(
 				func->returns, func2->returns, tenv, need, have, open, symtab ) ) return;
-			
+
 			markAssertions( have, need, func );
 			markAssertions( have, need, func2 );
@@ -941,5 +941,5 @@
 			result = true;
 		}
-	
+
 	private:
 		template< typename RefType >
@@ -953,5 +953,5 @@
 		/// Creates a tuple type based on a list of TypeExpr
 		template< typename Iter >
-		static const ast::Type * tupleFromExprs( 
+		static const ast::Type * tupleFromExprs(
 			const ast::TypeExpr * param, Iter & crnt, Iter end, ast::CV::Qualifiers qs
 		) {
@@ -973,5 +973,5 @@
 			const RefType * inst2 = handleRefType( inst, other );
 			if ( ! inst2 ) return;
-			
+
 			// check that parameters of types unify, if any
 			const std::vector< ast::ptr< ast::Expr > > & params = inst->params;
@@ -1002,5 +1002,5 @@
 				}
 
-				if ( ! unifyExact( 
+				if ( ! unifyExact(
 						pty, pty2, tenv, need, have, open, noWiden(), symtab ) ) {
 					result = false;
@@ -1038,10 +1038,10 @@
 	private:
 		/// Creates a tuple type based on a list of Type
-		static ast::ptr< ast::Type > tupleFromTypes( 
+		static ast::ptr< ast::Type > tupleFromTypes(
 			const std::vector< ast::ptr< ast::Type > > & tys
 		) {
 			std::vector< ast::ptr< ast::Type > > out;
 			for ( const ast::Type * ty : tys ) {
-				// it is guaranteed that a ttype variable will be bound to a flat tuple, so ensure 
+				// it is guaranteed that a ttype variable will be bound to a flat tuple, so ensure
 				// that this results in a flat tuple
 				flatten( ty, out );
@@ -1051,8 +1051,8 @@
 		}
 
-		static bool unifyList( 
-			const std::vector< ast::ptr< ast::Type > > & list1, 
-			const std::vector< ast::ptr< ast::Type > > & list2, ast::TypeEnvironment & env, 
-			ast::AssertionSet & need, ast::AssertionSet & have, const ast::OpenVarSet & open, 
+		static bool unifyList(
+			const std::vector< ast::ptr< ast::Type > > & list1,
+			const std::vector< ast::ptr< ast::Type > > & list2, ast::TypeEnvironment & env,
+			ast::AssertionSet & need, ast::AssertionSet & have, const ast::OpenVarSet & open,
 			const ast::SymbolTable & symtab
 		) {
@@ -1068,16 +1068,16 @@
 				if ( isTuple1 && ! isTuple2 ) {
 					// combine entirety of list2, then unify
-					return unifyExact( 
-						t1, tupleFromTypes( list2 ), env, need, have, open, 
+					return unifyExact(
+						t1, tupleFromTypes( list2 ), env, need, have, open,
 						noWiden(), symtab );
 				} else if ( ! isTuple1 && isTuple2 ) {
 					// combine entirety of list1, then unify
 					return unifyExact(
-						tupleFromTypes( list1 ), t2, env, need, have, open, 
+						tupleFromTypes( list1 ), t2, env, need, have, open,
 						noWiden(), symtab );
 				}
 
-				if ( ! unifyExact( 
-					t1, t2, env, need, have, open, noWiden(), symtab ) 
+				if ( ! unifyExact(
+					t1, t2, env, need, have, open, noWiden(), symtab )
 				) return false;
 
@@ -1089,8 +1089,8 @@
 				const ast::Type * t1 = *crnt1;
 				if ( ! Tuples::isTtype( t1 ) ) return false;
-				// xxx - this doesn't generate an empty tuple, contrary to comment; both ported 
+				// xxx - this doesn't generate an empty tuple, contrary to comment; both ported
 				// from Rob's code
-				return unifyExact( 
-						t1, tupleFromTypes( list2 ), env, need, have, open, 
+				return unifyExact(
+						t1, tupleFromTypes( list2 ), env, need, have, open,
 						noWiden(), symtab );
 			} else if ( crnt2 != list2.end() ) {
@@ -1098,8 +1098,8 @@
 				const ast::Type * t2 = *crnt2;
 				if ( ! Tuples::isTtype( t2 ) ) return false;
-				// xxx - this doesn't generate an empty tuple, contrary to comment; both ported 
+				// xxx - this doesn't generate an empty tuple, contrary to comment; both ported
 				// from Rob's code
 				return unifyExact(
-						tupleFromTypes( list1 ), t2, env, need, have, open, 
+						tupleFromTypes( list1 ), t2, env, need, have, open,
 						noWiden(), symtab );
 			}
@@ -1133,5 +1133,5 @@
 		void postvisit( const ast::OneType * ) {
 			result = dynamic_cast< const ast::OneType * >( type2 );
-		}	
+		}
 
 	  private:
@@ -1140,7 +1140,7 @@
 	};
 
-	bool unify( 
-			const ast::ptr<ast::Type> & type1, const ast::ptr<ast::Type> & type2, 
-			ast::TypeEnvironment & env, ast::AssertionSet & need, ast::AssertionSet & have, 
+	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
 	) {
@@ -1149,19 +1149,19 @@
 	}
 
-	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 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
 	) {
 		ast::OpenVarSet closed;
 		findOpenVars( type1, open, closed, need, have, FirstClosed );
 		findOpenVars( type2, open, closed, need, have, FirstOpen );
-		return unifyInexact( 
+		return unifyInexact(
 			type1, type2, env, need, have, open, WidenMode{ true, true }, symtab, common );
 	}
 
-	bool unifyExact( 
-			const ast::Type * type1, const ast::Type * type2, ast::TypeEnvironment & env, 
-			ast::AssertionSet & need, ast::AssertionSet & have, const ast::OpenVarSet & open, 
+	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
 	) {
@@ -1170,6 +1170,6 @@
 		auto var1 = dynamic_cast< const ast::TypeInstType * >( type1 );
 		auto var2 = dynamic_cast< const ast::TypeInstType * >( type2 );
-		ast::OpenVarSet::const_iterator 
-			entry1 = var1 ? open.find( var1->name ) : open.end(), 
+		ast::OpenVarSet::const_iterator
+			entry1 = var1 ? open.find( var1->name ) : open.end(),
 			entry2 = var2 ? open.find( var2->name ) : open.end();
 		bool isopen1 = entry1 != open.end();
@@ -1178,6 +1178,6 @@
 		if ( isopen1 && isopen2 ) {
 			if ( entry1->second.kind != entry2->second.kind ) return false;
-			return env.bindVarToVar( 
-				var1, var2, ast::TypeDecl::Data{ entry1->second, entry2->second }, need, have, 
+			return env.bindVarToVar(
+				var1, var2, ast::TypeDecl::Data{ entry1->second, entry2->second }, need, have,
 				open, widen, symtab );
 		} else if ( isopen1 ) {
@@ -1192,18 +1192,18 @@
 	}
 
-	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 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
 	) {
 		ast::CV::Qualifiers q1 = type1->qualifiers, q2 = type2->qualifiers;
-		
-		// force t1 and t2 to be cloned if their qualifiers must be stripped, so that type1 and 
+
+		// force t1 and t2 to be cloned if their qualifiers must be stripped, so that type1 and
 		// type2 are left unchanged; calling convention forces type{1,2}->strong_ref >= 1
 		ast::ptr<ast::Type> t1{ type1 }, t2{ type2 };
 		reset_qualifiers( t1 );
 		reset_qualifiers( t2 );
-		
+
 		if ( unifyExact( t1, t2, env, need, have, open, widen, symtab ) ) {
 			t1 = nullptr; t2 = nullptr; // release t1, t2 to avoid spurious clones
Index: src/ResolvExpr/typeops.h
===================================================================
--- src/ResolvExpr/typeops.h	(revision 99da2670a9c3077bcfe60c06fde4a115b84eccae)
+++ src/ResolvExpr/typeops.h	(revision 4eb43fa21537c79c32be1ee375bd917f2a305475)
@@ -28,5 +28,8 @@
 #include "SynTree/SynTree.h"
 #include "SynTree/Type.h"
-#include "SymTab/Indexer.h"
+
+namespace SymTab {
+	class Indexer;
+}
 
 namespace ResolvExpr {
@@ -60,5 +63,5 @@
 	// in AdjustExprType.cc
 	/// Replaces array types with the equivalent pointer, and function types with a pointer-to-function
-	void adjustExprType( Type *&type, const TypeEnvironment &env, const SymTab::Indexer &indexer );
+	void adjustExprType( Type *& type, const TypeEnvironment & env, const SymTab::Indexer & indexer );
 
 	/// Replaces array types with the equivalent pointer, and function types with a pointer-to-function using empty TypeEnvironment and Indexer
@@ -66,5 +69,5 @@
 
 	template< typename ForwardIterator >
-	void adjustExprTypeList( ForwardIterator begin, ForwardIterator end, const TypeEnvironment &env, const SymTab::Indexer &indexer ) {
+	void adjustExprTypeList( ForwardIterator begin, ForwardIterator end, const TypeEnvironment & env, const SymTab::Indexer & indexer ) {
 		while ( begin != end ) {
 			adjustExprType( *begin++, env, indexer );
@@ -73,54 +76,54 @@
 
 	/// Replaces array types with equivalent pointer, and function types with a pointer-to-function
-	const ast::Type * adjustExprType( 
+	const ast::Type * adjustExprType(
 		const ast::Type * type, const ast::TypeEnvironment & env, const ast::SymbolTable & symtab );
 
 	// in CastCost.cc
-	Cost castCost( Type *src, Type *dest, const SymTab::Indexer &indexer, const TypeEnvironment &env );
-	Cost castCost( 
-		const ast::Type * src, const ast::Type * dst, const ast::SymbolTable & symtab, 
+	Cost castCost( const Type * src, const Type * dest, const SymTab::Indexer & indexer, const TypeEnvironment & env );
+	Cost castCost(
+		const ast::Type * src, const ast::Type * dst, const ast::SymbolTable & symtab,
 		const ast::TypeEnvironment & env );
 
 	// in ConversionCost.cc
-	Cost conversionCost( Type *src, Type *dest, const SymTab::Indexer &indexer, const TypeEnvironment &env );
-	Cost conversionCost( 
-		const ast::Type * src, const ast::Type * dst, const ast::SymbolTable & symtab, 
+	Cost conversionCost( const Type * src, const Type * dest, const SymTab::Indexer & indexer, const TypeEnvironment & env );
+	Cost conversionCost(
+		const ast::Type * src, const ast::Type * dst, const ast::SymbolTable & symtab,
 		const ast::TypeEnvironment & env );
 
 	// in AlternativeFinder.cc
-	Cost computeConversionCost( Type *actualType, Type *formalType, 
-		const SymTab::Indexer &indexer, const TypeEnvironment &env );
+	Cost computeConversionCost( Type * actualType, Type * formalType,
+		const SymTab::Indexer & indexer, const TypeEnvironment & env );
 
 	// in PtrsAssignable.cc
-	int ptrsAssignable( Type *src, Type *dest, const TypeEnvironment &env );
+	int ptrsAssignable( const Type * src, const Type * dest, const TypeEnvironment & env );
 	int ptrsAssignable( const ast::Type * src, const ast::Type * dst,
 		const ast::TypeEnvironment & env );
 
 	// in PtrsCastable.cc
-	int ptrsCastable( Type *src, Type *dest, const TypeEnvironment &env, const SymTab::Indexer &indexer );
-	int ptrsCastable( 
-		const ast::Type * src, const ast::Type * dst, const ast::SymbolTable & symtab, 
+	int ptrsCastable( const Type * src, const Type * dest, const TypeEnvironment & env, const SymTab::Indexer & indexer );
+	int ptrsCastable(
+		const ast::Type * src, const ast::Type * dst, const ast::SymbolTable & symtab,
 		const ast::TypeEnvironment & env );
 
 	// in Unify.cc
-	bool typesCompatible( Type *, Type *, const SymTab::Indexer &indexer, const TypeEnvironment &env );
-	bool typesCompatibleIgnoreQualifiers( Type *, Type *, const SymTab::Indexer &indexer, const TypeEnvironment &env );
-
-	inline bool typesCompatible( Type *t1, Type *t2, const SymTab::Indexer &indexer ) {
+	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( Type *t1, Type *t2, const SymTab::Indexer &indexer ) {
+	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 = {}, 
+	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::Type *, const ast::Type *, const ast::SymbolTable &,
 		const ast::TypeEnvironment & env = {} );
 
@@ -131,24 +134,24 @@
 
 	// in CommonType.cc
-	Type * commonType( Type *type1, Type *type2, bool widenFirst, bool widenSecond, const SymTab::Indexer &indexer, TypeEnvironment &env, const OpenVarSet &openVars );
+	Type * commonType( Type * type1, Type * type2, bool widenFirst, bool widenSecond, const SymTab::Indexer & indexer, TypeEnvironment & env, const OpenVarSet & openVars );
 	ast::ptr< ast::Type > commonType(
-		const ast::ptr< ast::Type > & type1, const ast::ptr< ast::Type > & type2, WidenMode widen, 
+		const ast::ptr< ast::Type > & type1, const ast::ptr< ast::Type > & type2, WidenMode widen,
 		const ast::SymbolTable & symtab, ast::TypeEnvironment & env, const ast::OpenVarSet & open );
 
 	// in PolyCost.cc
-	int polyCost( Type *type, const TypeEnvironment &env, const SymTab::Indexer &indexer );
-	int polyCost( 
+	int polyCost( Type * type, const TypeEnvironment & env, const SymTab::Indexer & indexer );
+	int polyCost(
 		const ast::Type * type, const ast::SymbolTable & symtab, const ast::TypeEnvironment & env );
 
 	// in SpecCost.cc
-	int specCost( Type *type );
+	int specCost( Type * type );
 	int specCost( const ast::Type * type );
 
 	// in Occurs.cc
-	bool occurs( Type *type, std::string varName, const TypeEnvironment &env );
+	bool occurs( Type * type, std::string varName, const TypeEnvironment & env );
 	// new AST version in TypeEnvironment.cpp (only place it was used in old AST)
 
-	template<typename Iter> 
-	bool occursIn( Type* ty, Iter begin, Iter end, const TypeEnvironment &env ) {
+	template<typename Iter>
+	bool occursIn( Type* ty, Iter begin, Iter end, const TypeEnvironment & env ) {
 		while ( begin != end ) {
 			if ( occurs( ty, *begin, env ) ) return true;
@@ -176,8 +179,8 @@
 
 	/// flatten tuple type into existing list of types
-	static inline void flatten( 
-		const ast::Type * type, std::vector< ast::ptr< ast::Type > > & out 
+	static inline void flatten(
+		const ast::Type * type, std::vector< ast::ptr< ast::Type > > & out
 	) {
-		if ( auto tupleType = dynamic_cast< const ast::TupleType * >( type ) ) {	
+		if ( auto tupleType = dynamic_cast< const ast::TupleType * >( type ) ) {
 			for ( const ast::Type * t : tupleType->types ) {
 				flatten( t, out );
@@ -197,5 +200,5 @@
 
 	// in TypeEnvironment.cc
-	bool isFtype( Type *type );
+	bool isFtype( Type * type );
 } // namespace ResolvExpr
 
