Index: src/GenPoly/Box.cc
===================================================================
--- src/GenPoly/Box.cc	(revision 7abee383f06a7fe5690784e7676edcdf68ff7660)
+++ src/GenPoly/Box.cc	(revision 02fdb8eb4c22b14a7fc7116a96f53d73dae71205)
@@ -76,5 +76,5 @@
 
 		/// Replaces polymorphic return types with out-parameters, replaces calls to polymorphic functions with adapter calls as needed, and adds appropriate type variables to the function call
-		class Pass1 final : public BoxPass, public WithTypeSubstitution, public WithStmtsToAdd, public WithGuards, public WithVisitorRef<Pass1>, public WithShortCircuiting {
+		class Pass1 final : public BoxPass, public WithConstTypeSubstitution, public WithStmtsToAdd, public WithGuards, public WithVisitorRef<Pass1>, public WithShortCircuiting {
 		  public:
 			Pass1();
@@ -150,5 +150,5 @@
 		/// * Calculates polymorphic offsetof expressions from offset array
 		/// * Inserts dynamic calculation of polymorphic type layouts where needed
-		class PolyGenericCalculator final : public BoxPass, public WithGuards, public WithVisitorRef<PolyGenericCalculator>, public WithStmtsToAdd, public WithDeclsToAdd, public WithTypeSubstitution {
+		class PolyGenericCalculator final : public BoxPass, public WithGuards, public WithVisitorRef<PolyGenericCalculator>, public WithStmtsToAdd, public WithDeclsToAdd, public WithConstTypeSubstitution {
 		public:
 			PolyGenericCalculator();
@@ -1764,7 +1764,7 @@
 
 		Expression *PolyGenericCalculator::postmutate( SizeofExpr *sizeofExpr ) {
-			Type *ty = sizeofExpr->get_isType() ? 
+			Type *ty = sizeofExpr->get_isType() ?
 				sizeofExpr->get_type() : sizeofExpr->get_expr()->get_result();
-			
+
 			Expression * gen = genSizeof( ty );
 			if ( gen ) {
Index: src/GenPoly/GenPoly.cc
===================================================================
--- src/GenPoly/GenPoly.cc	(revision 7abee383f06a7fe5690784e7676edcdf68ff7660)
+++ src/GenPoly/GenPoly.cc	(revision 02fdb8eb4c22b14a7fc7116a96f53d73dae71205)
@@ -440,5 +440,5 @@
 	}
 
-	bool needsBoxing( Type * param, Type * arg, const TyVarMap &exprTyVars, TypeSubstitution * env ) {
+	bool needsBoxing( Type * param, Type * arg, const TyVarMap &exprTyVars, const TypeSubstitution * env ) {
 		// is parameter is not polymorphic, don't need to box
 		if ( ! isPolyType( param, exprTyVars ) ) return false;
@@ -450,5 +450,5 @@
 	}
 
-	bool needsBoxing( Type * param, Type * arg, ApplicationExpr * appExpr, TypeSubstitution * env ) {
+	bool needsBoxing( Type * param, Type * arg, ApplicationExpr * appExpr, const TypeSubstitution * env ) {
 		FunctionType * function = getFunctionType( appExpr->function->result );
 		assertf( function, "ApplicationExpr has non-function type: %s", toString( appExpr->function->result ).c_str() );
Index: src/GenPoly/GenPoly.h
===================================================================
--- src/GenPoly/GenPoly.h	(revision 7abee383f06a7fe5690784e7676edcdf68ff7660)
+++ src/GenPoly/GenPoly.h	(revision 02fdb8eb4c22b14a7fc7116a96f53d73dae71205)
@@ -81,8 +81,8 @@
 
 	/// true if arg requires boxing given exprTyVars
-	bool needsBoxing( Type * param, Type * arg, const TyVarMap &exprTyVars, TypeSubstitution * env );
+	bool needsBoxing( Type * param, Type * arg, const TyVarMap &exprTyVars, const TypeSubstitution * env );
 
 	/// true if arg requires boxing in the call to appExpr
-	bool needsBoxing( Type * param, Type * arg, ApplicationExpr * appExpr, TypeSubstitution * env );
+	bool needsBoxing( Type * param, Type * arg, ApplicationExpr * appExpr, const TypeSubstitution * env );
 
 	/// Adds the type variable `tyVar` to `tyVarMap`
Index: src/GenPoly/InstantiateGeneric.cc
===================================================================
--- src/GenPoly/InstantiateGeneric.cc	(revision 7abee383f06a7fe5690784e7676edcdf68ff7660)
+++ src/GenPoly/InstantiateGeneric.cc	(revision 02fdb8eb4c22b14a7fc7116a96f53d73dae71205)
@@ -168,5 +168,5 @@
 
 	/// Mutator pass that replaces concrete instantiations of generic types with actual struct declarations, scoped appropriately
-	struct GenericInstantiator final : public WithTypeSubstitution, public WithDeclsToAdd, public WithVisitorRef<GenericInstantiator>, public WithGuards {
+	struct GenericInstantiator final : public WithConstTypeSubstitution, public WithDeclsToAdd, public WithVisitorRef<GenericInstantiator>, public WithGuards {
 		/// Map of (generic type, parameter list) pairs to concrete type instantiations
 		InstantiationMap< AggregateDecl, AggregateDecl > instantiations;
Index: src/GenPoly/Specialize.cc
===================================================================
--- src/GenPoly/Specialize.cc	(revision 7abee383f06a7fe5690784e7676edcdf68ff7660)
+++ src/GenPoly/Specialize.cc	(revision 02fdb8eb4c22b14a7fc7116a96f53d73dae71205)
@@ -42,5 +42,5 @@
 
 namespace GenPoly {
-	struct Specialize final : public WithTypeSubstitution, public WithStmtsToAdd, public WithVisitorRef<Specialize> {
+	struct Specialize final : public WithConstTypeSubstitution, public WithStmtsToAdd, public WithVisitorRef<Specialize> {
 		Expression * postmutate( ApplicationExpr *applicationExpr );
 		Expression * postmutate( CastExpr *castExpr );
@@ -54,5 +54,5 @@
 
 	/// Looks up open variables in actual type, returning true if any of them are bound in the environment or formal type.
-	bool needsPolySpecialization( Type *formalType, Type *actualType, TypeSubstitution *env ) {
+	bool needsPolySpecialization( Type *formalType, Type *actualType, const TypeSubstitution *env ) {
 		if ( env ) {
 			using namespace ResolvExpr;
@@ -145,5 +145,5 @@
 	}
 
-	bool needsSpecialization( Type *formalType, Type *actualType, TypeSubstitution *env ) {
+	bool needsSpecialization( Type *formalType, Type *actualType, const TypeSubstitution *env ) {
 		return needsPolySpecialization( formalType, actualType, env ) || needsTupleSpecialization( formalType, actualType );
 	}
